@intent-hq/web 2.310.1 → 2.310.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/assets/{DiagramPresentation.fimBl1wP.css → DiagramPresentation.Bfi3xHm0.css} +1 -1
- package/web/app/immutable/chunks/-xK_vQQs.js +1 -0
- package/web/app/immutable/chunks/{CeEeQIAV.js → 2rlMb19F.js} +1 -1
- package/web/app/immutable/chunks/{Bhcwd2SW.js → 6Z5k9P1U.js} +4 -4
- package/web/app/immutable/chunks/7xAw-BT0.js +213 -0
- package/web/app/immutable/chunks/{t3bi-ExW.js → B1s3oEqm.js} +2 -2
- package/web/app/immutable/chunks/{phowbgF-.js → B2JLNOy6.js} +1 -1
- package/web/app/immutable/chunks/B53WwE3a.js +1 -0
- package/web/app/immutable/chunks/{R7gFhaG_.js → B7VncZW5.js} +1 -1
- package/web/app/immutable/chunks/{EZw3rvya.js → B7s4-XTz.js} +30 -30
- package/web/app/immutable/chunks/{DOHtPCK9.js → BDPXN-l5.js} +1 -1
- package/web/app/immutable/chunks/{zXW6V5sa.js → BENBNSN7.js} +1 -1
- package/web/app/immutable/chunks/{DevHtnbn.js → BFXzH5IE.js} +1 -1
- package/web/app/immutable/chunks/BGcL9rs9.js +217 -0
- package/web/app/immutable/chunks/BHnD9zfx.js +99 -0
- package/web/app/immutable/chunks/{qMHHnffV.js → BI_SwxaN.js} +1 -1
- package/web/app/immutable/chunks/{BV9p4X5I.js → BMMFveB2.js} +6 -6
- package/web/app/immutable/chunks/BP6OqM9o.js +1 -0
- package/web/app/immutable/chunks/BRvgBsbx.js +291 -0
- package/web/app/immutable/chunks/{Cuozo7M1.js → BSel_zEu.js} +1 -1
- package/web/app/immutable/chunks/{B4dTn6xv.js → BUlPMLws.js} +1 -1
- package/web/app/immutable/chunks/{xMirTl3q.js → BYxB_o2p.js} +2 -2
- package/web/app/immutable/chunks/{CsYRAdgB.js → B_mbXOka.js} +1 -1
- package/web/app/immutable/chunks/BakMVsPT.js +2 -0
- package/web/app/immutable/chunks/{DeopB2f-.js → Bd0N6Q84.js} +3 -3
- package/web/app/immutable/chunks/{CHH2PtZ7.js → BfPWAh77.js} +1 -1
- package/web/app/immutable/chunks/BfZK-g4H.js +2 -0
- package/web/app/immutable/chunks/BhWJ-mUa.js +292 -0
- package/web/app/immutable/chunks/{CwH3s3Sg.js → Bhw4MKUW.js} +1 -1
- package/web/app/immutable/chunks/{CUvX4uDB.js → BmpVZmDT.js} +3 -3
- package/web/app/immutable/chunks/{BNg3GOxL.js → Bn-4GS40.js} +2 -2
- package/web/app/immutable/chunks/BpXeqZkK.js +12 -0
- package/web/app/immutable/chunks/{D-9LH0ah.js → Bpofk5Ge.js} +1 -1
- package/web/app/immutable/chunks/{DjEB6QMF.js → BrV7vQ-C.js} +1 -1
- package/web/app/immutable/chunks/ByGoYv9M.js +1 -0
- package/web/app/immutable/chunks/C-1nTNwc.js +120 -0
- package/web/app/immutable/chunks/{CBHPIqXg.js → C3nOF7W6.js} +1 -1
- package/web/app/immutable/chunks/{BIxkRFIj.js → C72YfPmr.js} +2 -2
- package/web/app/immutable/chunks/{DMGAuSgb.js → C87YV7yB.js} +4 -4
- package/web/app/immutable/chunks/{Coy9jSf1.js → CCDTjxXZ.js} +1 -1
- package/web/app/immutable/chunks/CEXJj_TX.js +62 -0
- package/web/app/immutable/chunks/CHFvnHJS.js +39 -0
- package/web/app/immutable/chunks/{CWyh7Yhz.js → CK1qXB1I.js} +1 -1
- package/web/app/immutable/chunks/{CCIGQjYf.js → CLEySo6k.js} +1 -1
- package/web/app/immutable/chunks/{DXOCO_oS.js → CNxOtEoC.js} +1 -1
- package/web/app/immutable/chunks/{7KTbkf4W.js → CPi1vTiT.js} +2 -2
- package/web/app/immutable/chunks/{ejL3HmTG.js → CQI-dvtu.js} +3 -3
- package/web/app/immutable/chunks/CSiG9Hvp.js +1 -0
- package/web/app/immutable/chunks/{C0DDaBnV.js → CTaTQq2B.js} +1 -1
- package/web/app/immutable/chunks/{dtB9lR1B.js → CUMlGGeg.js} +1 -1
- package/web/app/immutable/chunks/{fULl8IO9.js → CVyfvlNb.js} +7 -7
- package/web/app/immutable/chunks/{DUkegami.js → C_tu278J.js} +1 -1
- package/web/app/immutable/chunks/CcUMYVEM.js +41 -0
- package/web/app/immutable/chunks/Ccfa6x-j.js +24 -0
- package/web/app/immutable/chunks/{BmDskjjc.js → Cd_IIsl2.js} +1 -1
- package/web/app/immutable/chunks/CeijcUhC.js +38 -0
- package/web/app/immutable/chunks/Ci2_N-bK.js +370 -0
- package/web/app/immutable/chunks/CiPifYNB.js +1 -0
- package/web/app/immutable/chunks/{D8SVxzqF.js → CjcP6chv.js} +1 -1
- package/web/app/immutable/chunks/Cl430GWg.js +344 -0
- package/web/app/immutable/chunks/ClKsLSpN.js +27 -0
- package/web/app/immutable/chunks/ClebXGIM.js +141 -0
- package/web/app/immutable/chunks/{DOVnLHFz.js → CnIb6mve.js} +1 -1
- package/web/app/immutable/chunks/{qOCErwrn.js → CrdTEIp7.js} +1 -1
- package/web/app/immutable/chunks/{CPvhRhlk.js → Cstq9SM5.js} +11 -11
- package/web/app/immutable/chunks/CuzanJ4G.js +1 -0
- package/web/app/immutable/chunks/{D81gRUjY.js → D-QdqmeZ.js} +1 -1
- package/web/app/immutable/chunks/D0gJOzJU.js +40 -0
- package/web/app/immutable/chunks/{CoeuT-m3.js → D2ffSQ9J.js} +1 -1
- package/web/app/immutable/chunks/D2ojbL4J.js +98 -0
- package/web/app/immutable/chunks/{Bfkn2BGM.js → D3lH_sy-.js} +1 -1
- package/web/app/immutable/chunks/{C0Yks_oS.js → D5XrjD_m.js} +1 -1
- package/web/app/immutable/chunks/{DzvQOT8_.js → D5gGhPeB.js} +1 -1
- package/web/app/immutable/chunks/{DLm51UIm.js → D7ePuUtq.js} +1 -1
- package/web/app/immutable/chunks/{B9r0JXjW.js → D9RktmhG.js} +1 -1
- package/web/app/immutable/chunks/{Si43_nYW.js → D9zTmP-H.js} +3 -3
- package/web/app/immutable/chunks/{DQEBW0YT.js → DAhqFWJw.js} +1 -1
- package/web/app/immutable/chunks/{B20hJMKp.js → DAmyup4Q.js} +2 -2
- package/web/app/immutable/chunks/{B0X6Qy4e.js → DH-0T9oO.js} +1 -1
- package/web/app/immutable/chunks/{D-o9b0Cd.js → DHf042m3.js} +2 -2
- package/web/app/immutable/chunks/DICP2Iar.js +169 -0
- package/web/app/immutable/chunks/{D04E4MVv.js → DJ4er0zy.js} +4 -4
- package/web/app/immutable/chunks/{BtHVXttl.js → DLTK7s08.js} +5 -5
- package/web/app/immutable/chunks/{DQulsXJ7.js → DM80xiYc.js} +1 -1
- package/web/app/immutable/chunks/{BsP5G0Fo.js → DPWD_Z0m.js} +1 -1
- package/web/app/immutable/chunks/{t9id1Dgw.js → DPjuFI2m.js} +1 -1
- package/web/app/immutable/chunks/{DhdMM_zt.js → DR30pTuY.js} +14 -14
- package/web/app/immutable/chunks/{D_9AVJm5.js → DStbB4cJ.js} +1 -1
- package/web/app/immutable/chunks/{C8CCN24q.js → DV_gHrZ4.js} +1 -1
- package/web/app/immutable/chunks/{CQe4IdgR.js → DWqMBuHP.js} +1 -1
- package/web/app/immutable/chunks/DhDem5lD.js +34 -0
- package/web/app/immutable/chunks/{DaEQgqyy.js → Dj7a19mR.js} +1 -1
- package/web/app/immutable/chunks/{CnmCWFKQ.js → Dn1Hge9W.js} +2 -2
- package/web/app/immutable/chunks/{DxlwMmI8.js → DpbPS--w.js} +1 -1
- package/web/app/immutable/chunks/{Drg52kVf.js → DqPGIq9m.js} +1 -1
- package/web/app/immutable/chunks/Dr9n9KYD.js +8 -0
- package/web/app/immutable/chunks/Dx4xDmS-.js +1 -0
- package/web/app/immutable/chunks/{D411lQkp.js → DxBZwGJl.js} +1 -1
- package/web/app/immutable/chunks/{CEdLQlJ6.js → EF47gh5F.js} +6 -6
- package/web/app/immutable/chunks/FTZaXc8b.js +106 -0
- package/web/app/immutable/chunks/NHQiGgbv.js +200 -0
- package/web/app/immutable/chunks/{BCm8Gasf.js → OEEtadht.js} +1 -1
- package/web/app/immutable/chunks/{DCeW9_0X.js → PR2rc_KV.js} +2 -2
- package/web/app/immutable/chunks/{_F3xl3RI.js → Q48HTbqK.js} +1 -1
- package/web/app/immutable/chunks/{TQIai6Ne.js → Sd4DhpzB.js} +79 -79
- package/web/app/immutable/chunks/{C-Mmob1s.js → WaYTk5P-.js} +1 -1
- package/web/app/immutable/chunks/{ByGsJxdn.js → X-Frg4xt.js} +1 -1
- package/web/app/immutable/chunks/YDWB9C4j.js +36 -0
- package/web/app/immutable/chunks/{BUSwtV99.js → YqBgboHy.js} +1 -1
- package/web/app/immutable/chunks/{B_D0NLtg.js → _GDZ01fB.js} +1 -1
- package/web/app/immutable/chunks/{C7oH1dbI.js → aloh9OcN.js} +1 -1
- package/web/app/immutable/chunks/{BEhoKnQT.js → ap51LBWo.js} +1 -1
- package/web/app/immutable/chunks/bBO0iA4_.js +7 -0
- package/web/app/immutable/chunks/cMysCMc_.js +24 -0
- package/web/app/immutable/chunks/dpdLM1Cx.js +140 -0
- package/web/app/immutable/chunks/eHLf0w_s.js +1 -0
- package/web/app/immutable/chunks/fyjA8lOg.js +4 -0
- package/web/app/immutable/chunks/{CQf-fH5v.js → h6Xb9K7f.js} +1 -1
- package/web/app/immutable/chunks/{j0ThtFJc.js → iX-41BqF.js} +1 -1
- package/web/app/immutable/chunks/ibC6Wlul.js +3 -0
- package/web/app/immutable/chunks/jU5_8m_P.js +84 -0
- package/web/app/immutable/chunks/{BKGPkCRs.js → kHJUvxPR.js} +1 -1
- package/web/app/immutable/chunks/{BBTS8ZOM.js → lG67Zx5D.js} +3 -3
- package/web/app/immutable/chunks/{CgAIOmc3.js → lb9Uy5lM.js} +4 -4
- package/web/app/immutable/chunks/{DdAxykhC.js → lh2cjQS1.js} +1 -1
- package/web/app/immutable/chunks/{r1_PrlQL.js → lqs_HYEw.js} +1 -1
- package/web/app/immutable/chunks/{CnszEr0a.js → oEWQ7BWN.js} +1 -1
- package/web/app/immutable/chunks/{BGLkcG6I.js → ry72TFIz.js} +2 -2
- package/web/app/immutable/chunks/{BV7dztYI.js → ryFwnMjp.js} +1 -1
- package/web/app/immutable/chunks/{CsASRGy9.js → uOEty9O6.js} +5 -5
- package/web/app/immutable/chunks/wh3Y68il.js +1 -0
- package/web/app/immutable/chunks/{DRMT9vvq.js → xPs_63iv.js} +1 -1
- package/web/app/immutable/entry/{app.DlF41taB.js → app.np0VAfbg.js} +2 -2
- package/web/app/immutable/entry/start.BGCfjmAX.js +1 -0
- package/web/app/immutable/nodes/{0.BLjNhnkb.js → 0.DoZAnEaT.js} +1 -1
- package/web/app/immutable/nodes/{1.DaghOy3j.js → 1.BfLNDde5.js} +1 -1
- package/web/app/immutable/nodes/{10.CbV_flkh.js → 10.WVRhKQHR.js} +1 -1
- package/web/app/immutable/nodes/{14.N_oC1pv5.js → 14.BGrxllXE.js} +1 -1
- package/web/app/immutable/nodes/{16.Cn0uYbJe.js → 16.CkZkKSWx.js} +2 -2
- package/web/app/immutable/nodes/{2.CMERPJYK.js → 2.COM3w17g.js} +8 -8
- package/web/app/immutable/nodes/{3.Dk5w9XeG.js → 3.BhRx3b1m.js} +1 -1
- package/web/app/immutable/nodes/{4.CvLiKH0B.js → 4.C02hhSi-.js} +1 -1
- package/web/app/immutable/nodes/{5.BL5oLCOi.js → 5.Dgt2hWD3.js} +1 -1
- package/web/app/immutable/nodes/{6.DiKzgiKt.js → 6.KyP4WP5g.js} +1 -1
- package/web/app/immutable/nodes/{7.CM-hNW3A.js → 7.BxnoAMeX.js} +1 -1
- package/web/app/immutable/nodes/{8.BThIGSQR.js → 8.CnlHpTsC.js} +2 -2
- package/web/app/immutable/nodes/{9.D70tN3NX.js → 9.CJ1_wepy.js} +18 -18
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/-SL67XKV.js +0 -1
- package/web/app/immutable/chunks/351KaJp_.js +0 -24
- package/web/app/immutable/chunks/7Iuyw4Ow.js +0 -106
- package/web/app/immutable/chunks/9ySBq1wF.js +0 -36
- package/web/app/immutable/chunks/B2safKX4.js +0 -1
- package/web/app/immutable/chunks/B8QrskMI.js +0 -139
- package/web/app/immutable/chunks/BCO4VeSA.js +0 -1
- package/web/app/immutable/chunks/BCaDoF8Y.js +0 -1
- package/web/app/immutable/chunks/BEdJCn-8.js +0 -1
- package/web/app/immutable/chunks/BGBb6fI-.js +0 -120
- package/web/app/immutable/chunks/BGQ3htf5.js +0 -1
- package/web/app/immutable/chunks/BKLEAopb.js +0 -7
- package/web/app/immutable/chunks/BKSgn5w-.js +0 -1
- package/web/app/immutable/chunks/BKY64haD.js +0 -12
- package/web/app/immutable/chunks/BOXqfDS_.js +0 -40
- package/web/app/immutable/chunks/BP_ooGOd.js +0 -24
- package/web/app/immutable/chunks/BQApP15C.js +0 -99
- package/web/app/immutable/chunks/BS6cE8e9.js +0 -231
- package/web/app/immutable/chunks/BTXk2yGf.js +0 -96
- package/web/app/immutable/chunks/BVrOGXf1.js +0 -78
- package/web/app/immutable/chunks/BZoKWA-r.js +0 -96
- package/web/app/immutable/chunks/BbiXTFqz.js +0 -1
- package/web/app/immutable/chunks/BgmKjqUX.js +0 -1
- package/web/app/immutable/chunks/Bk7xBWHf.js +0 -34
- package/web/app/immutable/chunks/BoiNnj2h.js +0 -1
- package/web/app/immutable/chunks/BrVvVCxw.js +0 -1
- package/web/app/immutable/chunks/ByM2DIOs.js +0 -1
- package/web/app/immutable/chunks/ByzYvvQp.js +0 -70
- package/web/app/immutable/chunks/Bz0SnIMO.js +0 -1
- package/web/app/immutable/chunks/C1IwSyrV.js +0 -99
- package/web/app/immutable/chunks/C9gL5x04.js +0 -39
- package/web/app/immutable/chunks/C9nyJoiB.js +0 -41
- package/web/app/immutable/chunks/CBV2Z_QZ.js +0 -89
- package/web/app/immutable/chunks/CDHds8o_.js +0 -3
- package/web/app/immutable/chunks/CHIHAnR-.js +0 -1
- package/web/app/immutable/chunks/CHj2oCmD.js +0 -39
- package/web/app/immutable/chunks/CIXNMjfT.js +0 -206
- package/web/app/immutable/chunks/CKFDW9cI.js +0 -24
- package/web/app/immutable/chunks/CKQlE_M1.js +0 -88
- package/web/app/immutable/chunks/CSBhPNbN.js +0 -206
- package/web/app/immutable/chunks/CSLTsum9.js +0 -38
- package/web/app/immutable/chunks/CSbiiZpm.js +0 -354
- package/web/app/immutable/chunks/CToDhNW4.js +0 -1
- package/web/app/immutable/chunks/CYFK9YEX.js +0 -168
- package/web/app/immutable/chunks/CcGF51wP.js +0 -1
- package/web/app/immutable/chunks/Cd5vVJw4.js +0 -292
- package/web/app/immutable/chunks/CgjSMAIJ.js +0 -120
- package/web/app/immutable/chunks/Ck7B90Kr.js +0 -38
- package/web/app/immutable/chunks/CkAILno9.js +0 -62
- package/web/app/immutable/chunks/CkawHIFZ.js +0 -1
- package/web/app/immutable/chunks/ClXr1b-t.js +0 -8
- package/web/app/immutable/chunks/CmWBRPmR.js +0 -24
- package/web/app/immutable/chunks/Cmo-9vFV.js +0 -1
- package/web/app/immutable/chunks/CoFCa7Mb.js +0 -231
- package/web/app/immutable/chunks/CrcLvVto.js +0 -84
- package/web/app/immutable/chunks/Cs_Q6mos.js +0 -1
- package/web/app/immutable/chunks/CsnLwu9F.js +0 -2
- package/web/app/immutable/chunks/CuYeKLE8.js +0 -8
- package/web/app/immutable/chunks/CvOaoHrI.js +0 -1
- package/web/app/immutable/chunks/CvYzv8kf.js +0 -1
- package/web/app/immutable/chunks/CxRm1vYn.js +0 -342
- package/web/app/immutable/chunks/CyfBUrNA.js +0 -1
- package/web/app/immutable/chunks/D1QKDDLH.js +0 -1
- package/web/app/immutable/chunks/D61DwhDw.js +0 -3
- package/web/app/immutable/chunks/DBAJPVI_.js +0 -1
- package/web/app/immutable/chunks/DBt8jmEX.js +0 -40
- package/web/app/immutable/chunks/DD-T_Om0.js +0 -178
- package/web/app/immutable/chunks/DEOiJZFa.js +0 -168
- package/web/app/immutable/chunks/DHW4IXFj.js +0 -36
- package/web/app/immutable/chunks/DJ0w8Oax.js +0 -129
- package/web/app/immutable/chunks/DJ52BT20.js +0 -1
- package/web/app/immutable/chunks/DK1048Bw.js +0 -129
- package/web/app/immutable/chunks/DZ0nrC9W.js +0 -162
- package/web/app/immutable/chunks/DeRneTJF.js +0 -106
- package/web/app/immutable/chunks/Df6EnPla.js +0 -4
- package/web/app/immutable/chunks/DfMKUxMU.js +0 -30
- package/web/app/immutable/chunks/DkH3yb1j.js +0 -34
- package/web/app/immutable/chunks/Doxgswr3.js +0 -4
- package/web/app/immutable/chunks/Dt53cexP.js +0 -1
- package/web/app/immutable/chunks/Dx6eBL0x.js +0 -1
- package/web/app/immutable/chunks/HP7Asd0t.js +0 -2
- package/web/app/immutable/chunks/HP8lGamR.js +0 -257
- package/web/app/immutable/chunks/HzpfURmp.js +0 -84
- package/web/app/immutable/chunks/PJfe_iA1.js +0 -1
- package/web/app/immutable/chunks/PXMyYXQv.js +0 -1
- package/web/app/immutable/chunks/Qi3HrsAm.js +0 -1
- package/web/app/immutable/chunks/S1FanOB0.js +0 -162
- package/web/app/immutable/chunks/SuMU9B9i.js +0 -1
- package/web/app/immutable/chunks/UaGv-ChR.js +0 -257
- package/web/app/immutable/chunks/YqyEOqRv.js +0 -178
- package/web/app/immutable/chunks/_MGNV7ZN.js +0 -338
- package/web/app/immutable/chunks/_lZu5Dth.js +0 -292
- package/web/app/immutable/chunks/gzjZWAx8.js +0 -62
- package/web/app/immutable/chunks/hqSEunOk.js +0 -15
- package/web/app/immutable/chunks/nGCCQCpO.js +0 -1
- package/web/app/immutable/chunks/o-kBqlaj.js +0 -7
- package/web/app/immutable/chunks/opO2fBQB.js +0 -1
- package/web/app/immutable/chunks/pdFamTTi.js +0 -7
- package/web/app/immutable/chunks/rEI8JpP3.js +0 -1
- package/web/app/immutable/chunks/s5P9UVzf.js +0 -1
- package/web/app/immutable/chunks/sIHUXgeh.js +0 -41
- package/web/app/immutable/entry/start.CCtO40vu.js +0 -1
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Df6EnPla.js","/app/immutable/chunks/BoiNnj2h.js","/app/immutable/chunks/D81gRUjY.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/Ck7B90Kr.js","/app/immutable/chunks/Qi3HrsAm.js","/app/immutable/chunks/DEOiJZFa.js","/app/immutable/chunks/DOVnLHFz.js","/app/immutable/chunks/j0ThtFJc.js","/app/immutable/chunks/nGCCQCpO.js","/app/immutable/chunks/TQIai6Ne.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/DUkegami.js","/app/immutable/chunks/BkBdyRjM.js","/app/immutable/chunks/D4jXWSLn.js","/app/immutable/chunks/DCeW9_0X.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/ByM2DIOs.js","/app/immutable/chunks/CuYeKLE8.js","/app/immutable/chunks/C1IwSyrV.js","/app/immutable/chunks/7Iuyw4Ow.js","/app/immutable/chunks/DdAxykhC.js","/app/immutable/chunks/BEhoKnQT.js","/app/immutable/chunks/YqyEOqRv.js","/app/immutable/chunks/_lZu5Dth.js","/app/immutable/chunks/BKSgn5w-.js","/app/immutable/chunks/DJ52BT20.js","/app/immutable/chunks/Gi6I4Gst.js","/app/immutable/chunks/CrowFXzY.js","/app/immutable/chunks/HP7Asd0t.js","/app/immutable/chunks/CHj2oCmD.js","/app/immutable/chunks/PXMyYXQv.js","/app/immutable/chunks/CmKTTxBW.js","/app/immutable/chunks/Dt53cexP.js","/app/immutable/chunks/CsASRGy9.js","/app/immutable/chunks/o-kBqlaj.js","/app/immutable/chunks/CyfBUrNA.js","/app/immutable/chunks/CrcLvVto.js","/app/immutable/chunks/S1FanOB0.js","/app/immutable/chunks/Dx6eBL0x.js","/app/immutable/chunks/CSBhPNbN.js","/app/immutable/chunks/CHIHAnR-.js","/app/immutable/chunks/BbiXTFqz.js","/app/immutable/chunks/CoFCa7Mb.js","/app/immutable/chunks/BCO4VeSA.js","/app/immutable/chunks/CUvX4uDB.js","/app/immutable/chunks/BGBb6fI-.js","/app/immutable/chunks/BZoKWA-r.js","/app/immutable/chunks/fULl8IO9.js","/app/immutable/chunks/BOXqfDS_.js","/app/immutable/chunks/CvOaoHrI.js","/app/immutable/chunks/CKFDW9cI.js","/app/immutable/chunks/sIHUXgeh.js","/app/immutable/chunks/DJ0w8Oax.js","/app/immutable/chunks/BtHVXttl.js","/app/immutable/chunks/9ySBq1wF.js","/app/immutable/chunks/D61DwhDw.js","/app/immutable/chunks/CmWBRPmR.js","/app/immutable/chunks/CvYzv8kf.js","/app/immutable/chunks/CgAIOmc3.js","/app/immutable/chunks/gzjZWAx8.js","/app/immutable/chunks/D_9AVJm5.js","/app/immutable/chunks/Si43_nYW.js","/app/immutable/chunks/CQe4IdgR.js","/app/immutable/chunks/Cmo-9vFV.js","/app/immutable/chunks/CBHPIqXg.js","/app/immutable/chunks/CSbiiZpm.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var YC=Object.defineProperty;var XC=(e,t,r)=>t in e?YC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var pr=(e,t,r)=>XC(e,typeof t!="symbol"?t+"":t,r);import{_ as Ye,t as To,bq as Ne,bo as ze,by as Mo,b as Bo,a_ as fr,br as jC}from"./7rNOGHzs.js";import{g as fd}from"./BJzHxIyr.js";import{aO as ca}from"./TQIai6Ne.js";import{b7 as GC,cc as UC,bs as Lo,a7 as Xo,ay as ti,aD as S,bS as De,be as Va,b$ as Vs,b_ as ar,bO as mr,W as ue,c9 as Pt,bn as Ao,aA as _e,aB as er,bk as gd,bH as gt,ca as bo,c5 as dl,a5 as Re,bA as Fe,bV as ce,bl as vr,c0 as Ch,aC as ii,aw as ul,a as ef,bj as fm,br as ui,cb as VC,bf as ZC}from"./B8o4lNgr.js";import{N as rf}from"./t3bi-ExW.js";import{k as Qi,s as de,j as Za,c as gm,a as KC,h as sn,i as of,d as pm,l as Rn}from"./DmsDslNo.js";import{b as Zi}from"./D2g8BuR1.js";import{c as QC}from"./ChTqQfQN.js";import{d0 as JC,cR as t2,F as os,aK as e2,b9 as mm,c$ as r2,l as i2,m as o2,f as n2,i as a2,y as s2,v as nf,s as af,g as l2,G as c2,P as h2,q as d2,z as u2,p as f2,j as g2,O as p2,D as sf,H as m2,U as y2,aw as x2,ax as b2,aW as C2}from"./CFejQM6t.js";import{f as Hn,am as w2}from"./Bgegixo2.js";import{r as k2,a4 as S2}from"./EZw3rvya.js";import{e as v2,H as _2}from"./Bhcwd2SW.js";import{E as ym}from"./DCaHy20k.js";import{H as xo,h as lf,G as Ba,d as cf}from"./DzMmhJrp.js";import{c as rn}from"./CiENRH6A.js";import{f as T2}from"./DsNWmyox.js";import{t as M2}from"./Ck-Ax5yG.js";import{s as Zs}from"./CQ4a5a4v.js";import{s as hf,j as B2}from"./DZX-XWnb.js";import{s as L2,K as A2,k as F2,l as Cc,M as $2}from"./DSjRkndX.js";import{t as fo}from"./lfJ8pseq.js";import"./D-cnPaTJ.js";import"./CRwmdgt6.js";import{ce as E2}from"./DUkegami.js";function P2(e,t){GC(window,["resize"],()=>UC(()=>t(window[e])))}var xm=Object.defineProperty,w=(e,t)=>xm(e,"name",{value:t,configurable:!0}),O2=(e,t)=>{for(var r in t)xm(e,r,{get:t[r],enumerable:!0})},Ks={exports:{}},I2=Ks.exports,df;function R2(){return df||(df=1,(function(e,t){(function(r,i){e.exports=i()})(I2,(function(){var r=1e3,i=6e4,o=36e5,n="millisecond",a="second",s="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),z=B%60;return(E<=0?"+":"-")+C(q,2,"0")+":"+C(z,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()),z=E.clone().add(q,d),I=B-z<0,D=E.clone().add(q+(I?-1:1),d);return+(-(q+(B-z)/(I?z-D:D-z))||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:s,s:a,ms:n,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},v="en",T={};T[v]=x;var L="$isDayjsObject",A=function(F){return F instanceof P||!(!F||!F[L])},_=function F(E,B,q){var z;if(!E)return v;if(typeof E=="string"){var I=E.toLowerCase();T[I]&&(z=I),B&&(T[I]=B,z=I);var D=E.split("-");if(!z&&D.length>1)return F(D[0])}else{var Z=E.name;T[Z]=E,z=Z}return!q&&z&&(v=z),z||!q&&v},M=function(F,E){if(A(F))return F.clone();var B=typeof E=="object"?E:{};return B.date=F,B.args=arguments,new P(B)},$=k;$.l=_,$.i=A,$.w=function(F,E){return M(F,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var P=(function(){function F(B){this.$L=_(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[L]=!0}var E=F.prototype;return E.parse=function(B){this.$d=(function(q){var z=q.date,I=q.utc;if(z===null)return new Date(NaN);if($.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var D=z.match(m);if(D){var Z=D[2]-1||0,G=(D[7]||"0").substring(0,3);return I?new Date(Date.UTC(D[1],Z,D[3]||1,D[4]||0,D[5]||0,D[6]||0,G)):new Date(D[1],Z,D[3]||1,D[4]||0,D[5]||0,D[6]||0,G)}}return new Date(z)})(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 z=M(B);return this.startOf(q)<=z&&z<=this.endOf(q)},E.isAfter=function(B,q){return M(B)<this.startOf(q)},E.isBefore=function(B,q){return this.endOf(q)<M(B)},E.$g=function(B,q,z){return $.u(B)?this[q]:this.set(z,B)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(B,q){var z=this,I=!!$.u(q)||q,D=$.p(B),Z=function(yt,Y){var H=$.w(z.$u?Date.UTC(z.$y,Y,yt):new Date(z.$y,Y,yt),z);return I?H:H.endOf(c)},G=function(yt,Y){return $.w(z.toDate()[yt].apply(z.toDate("s"),(I?[0,0,0,0]:[23,59,59,999]).slice(Y)),z)},W=this.$W,Q=this.$M,et=this.$D,tt="set"+(this.$u?"UTC":"");switch(D){case f:return I?Z(1,0):Z(31,11);case d:return I?Z(1,Q):Z(0,Q+1);case h:var J=this.$locale().weekStart||0,ct=(W<J?W+7:W)-J;return Z(I?et-ct:et+(6-ct),Q);case c:case p:return G(tt+"Hours",0);case l:return G(tt+"Minutes",1);case s:return G(tt+"Seconds",2);case a:return G(tt+"Milliseconds",3);default:return this.clone()}},E.endOf=function(B){return this.startOf(B,!1)},E.$set=function(B,q){var z,I=$.p(B),D="set"+(this.$u?"UTC":""),Z=(z={},z[c]=D+"Date",z[p]=D+"Date",z[d]=D+"Month",z[f]=D+"FullYear",z[l]=D+"Hours",z[s]=D+"Minutes",z[a]=D+"Seconds",z[n]=D+"Milliseconds",z)[I],G=I===c?this.$D+(q-this.$W):q;if(I===d||I===f){var W=this.clone().set(p,1);W.$d[Z](G),W.init(),this.$d=W.set(p,Math.min(this.$D,W.daysInMonth())).$d}else Z&&this.$d[Z](G);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 z,I=this;B=Number(B);var D=$.p(q),Z=function(Q){var et=M(I);return $.w(et.date(et.date()+Math.round(Q*B)),I)};if(D===d)return this.set(d,this.$M+B);if(D===f)return this.set(f,this.$y+B);if(D===c)return Z(1);if(D===h)return Z(7);var G=(z={},z[s]=i,z[l]=o,z[a]=r,z)[D]||1,W=this.$d.getTime()+B*G;return $.w(W,this)},E.subtract=function(B,q){return this.add(-1*B,q)},E.format=function(B){var q=this,z=this.$locale();if(!this.isValid())return z.invalidDate||g;var I=B||"YYYY-MM-DDTHH:mm:ssZ",D=$.z(this),Z=this.$H,G=this.$m,W=this.$M,Q=z.weekdays,et=z.months,tt=z.meridiem,J=function(Y,H,V,K){return Y&&(Y[H]||Y(q,I))||V[H].slice(0,K)},ct=function(Y){return $.s(Z%12||12,Y,"0")},yt=tt||function(Y,H,V){var K=Y<12?"AM":"PM";return V?K.toLowerCase():K};return I.replace(y,(function(Y,H){return H||(function(V){switch(V){case"YY":return String(q.$y).slice(-2);case"YYYY":return $.s(q.$y,4,"0");case"M":return W+1;case"MM":return $.s(W+1,2,"0");case"MMM":return J(z.monthsShort,W,et,3);case"MMMM":return J(et,W);case"D":return q.$D;case"DD":return $.s(q.$D,2,"0");case"d":return String(q.$W);case"dd":return J(z.weekdaysMin,q.$W,Q,2);case"ddd":return J(z.weekdaysShort,q.$W,Q,3);case"dddd":return Q[q.$W];case"H":return String(Z);case"HH":return $.s(Z,2,"0");case"h":return ct(1);case"hh":return ct(2);case"a":return yt(Z,G,!0);case"A":return yt(Z,G,!1);case"m":return String(G);case"mm":return $.s(G,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 D}return null})(Y)||D.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(B,q,z){var I,D=this,Z=$.p(q),G=M(B),W=(G.utcOffset()-this.utcOffset())*i,Q=this-G,et=function(){return $.m(D,G)};switch(Z){case f:I=et()/12;break;case d:I=et();break;case u:I=et()/3;break;case h:I=(Q-W)/6048e5;break;case c:I=(Q-W)/864e5;break;case l:I=Q/o;break;case s:I=Q/i;break;case a:I=Q/r;break;default:I=Q}return z?I:$.a(I)},E.daysInMonth=function(){return this.endOf(d).$D},E.$locale=function(){return T[this.$L]},E.locale=function(B,q){if(!B)return this.$L;var z=this.clone(),I=_(B,q,!0);return I&&(z.$L=I),z},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})(),N=P.prototype;return M.prototype=N,[["$ms",n],["$s",a],["$m",s],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach((function(F){N[F[1]]=function(E){return this.$g(E,F[0],F[1])}})),M.extend=function(F,E){return F.$i||(F(E,P,M),F.$i=!0),M},M.locale=_,M.isDayjs=A,M.unix=function(F){return M(1e3*F)},M.en=T[v],M.Ls=T,M.p={},M}))})(Ks)),Ks.exports}var D2=R2();const N2=fd(D2);var go={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},pt={trace:w((...e)=>{},"trace"),debug:w((...e)=>{},"debug"),info:w((...e)=>{},"info"),warn:w((...e)=>{},"warn"),error:w((...e)=>{},"error"),fatal:w((...e)=>{},"fatal")},pd=w(function(e="fatal"){let t=go.fatal;typeof e=="string"?e.toLowerCase()in go&&(t=go[e]):typeof e=="number"&&(t=e),pt.trace=()=>{},pt.debug=()=>{},pt.info=()=>{},pt.warn=()=>{},pt.error=()=>{},pt.fatal=()=>{},t<=go.fatal&&(pt.fatal=console.error?console.error.bind(console,bi("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",bi("FATAL"))),t<=go.error&&(pt.error=console.error?console.error.bind(console,bi("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",bi("ERROR"))),t<=go.warn&&(pt.warn=console.warn?console.warn.bind(console,bi("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",bi("WARN"))),t<=go.info&&(pt.info=console.info?console.info.bind(console,bi("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",bi("INFO"))),t<=go.debug&&(pt.debug=console.debug?console.debug.bind(console,bi("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",bi("DEBUG"))),t<=go.trace&&(pt.trace=console.debug?console.debug.bind(console,bi("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",bi("TRACE")))},"setLogLevel"),bi=w(e=>`%c${N2().format("ss.SSS")} : ${e} : `,"format");const Qs={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,n=2*r-o;switch(i){case"r":return Qs.hue2rgb(n,o,e+1/3)*255;case"g":return Qs.hue2rgb(n,o,e)*255;case"b":return Qs.hue2rgb(n,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),n=Math.min(e,t,r),a=(o+n)/2;if(i==="l")return a*100;if(o===n)return 0;const s=o-n,l=a>.5?s/(2-o-n):s/(o+n);if(i==="s")return l*100;switch(o){case e:return((t-r)/s+(t<r?6:0))*60;case t:return((r-e)/s+2)*60;case r:return((e-t)/s+4)*60;default:return-1}}},q2={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},z2={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},qe={channel:Qs,lang:q2,unit:z2},No={};for(let e=0;e<=255;e++)No[e]=qe.unit.dec2hex(e);const Xr={ALL:0,RGB:1,HSL:2};let W2=class{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 H2{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new W2}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=qe.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=qe.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=qe.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=qe.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=qe.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=qe.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(),qe.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(),qe.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(),qe.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(),qe.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(),qe.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(),qe.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 zl=new H2({r:0,g:0,b:0,a:0},"transparent"),Yn={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(Yn.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,n=o%4===0,a=o>4,s=a?1:17,l=a?8:4,c=n?0:-1,h=a?255:15;return zl.set({r:(i>>l*(c+3)&h)*s,g:(i>>l*(c+2)&h)*s,b:(i>>l*(c+1)&h)*s,a:n?(i&h)*s/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${No[Math.round(t)]}${No[Math.round(r)]}${No[Math.round(i)]}${No[Math.round(o*255)]}`:`#${No[Math.round(t)]}${No[Math.round(r)]}${No[Math.round(i)]}`}},ln={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(ln.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return qe.channel.clamp.h(parseFloat(r)*.9);case"rad":return qe.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return qe.channel.clamp.h(parseFloat(r)*360)}}return qe.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(ln.re);if(!r)return;const[,i,o,n,a,s]=r;return zl.set({h:ln._hue2deg(i),s:qe.channel.clamp.s(parseFloat(o)),l:qe.channel.clamp.l(parseFloat(n)),a:a?qe.channel.clamp.a(s?parseFloat(a)/100:parseFloat(a)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${qe.lang.round(t)}, ${qe.lang.round(r)}%, ${qe.lang.round(i)}%, ${o})`:`hsl(${qe.lang.round(t)}, ${qe.lang.round(r)}%, ${qe.lang.round(i)}%)`}},Ka={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=Ka.colors[e];if(t)return Yn.parse(t)},stringify:e=>{const t=Yn.stringify(e);for(const r in Ka.colors)if(Ka.colors[r]===t)return r}},Da={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(Da.re);if(!r)return;const[,i,o,n,a,s,l,c,h]=r;return zl.set({r:qe.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:qe.channel.clamp.g(a?parseFloat(n)*2.55:parseFloat(n)),b:qe.channel.clamp.b(l?parseFloat(s)*2.55:parseFloat(s)),a:c?qe.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(${qe.lang.round(t)}, ${qe.lang.round(r)}, ${qe.lang.round(i)}, ${qe.lang.round(o)})`:`rgb(${qe.lang.round(t)}, ${qe.lang.round(r)}, ${qe.lang.round(i)})`}},to={format:{keyword:Ka,hex:Yn,rgb:Da,rgba:Da,hsl:ln,hsla:ln},parse:e=>{if(typeof e!="string")return e;const t=Yn.parse(e)||Da.parse(e)||ln.parse(e)||Ka.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?ln.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Da.stringify(e):Yn.stringify(e)},bm=(e,t)=>{const r=to.parse(e);for(const i in t)r[i]=qe.channel.clamp[i](t[i]);return to.stringify(r)},jo=(e,t,r=0,i=1)=>{if(typeof e!="number")return bm(e,{a:t});const o=zl.set({r:qe.channel.clamp.r(e),g:qe.channel.clamp.g(t),b:qe.channel.clamp.b(r),a:qe.channel.clamp.a(i)});return to.stringify(o)},Y2=e=>{const{r:t,g:r,b:i}=to.parse(e),o=.2126*qe.channel.toLinear(t)+.7152*qe.channel.toLinear(r)+.0722*qe.channel.toLinear(i);return qe.lang.round(o)},X2=e=>Y2(e)>=.5,Ri=e=>!X2(e),Cm=(e,t,r)=>{const i=to.parse(e),o=i[t],n=qe.channel.clamp[t](o+r);return o!==n&&(i[t]=n),to.stringify(i)},xt=(e,t)=>Cm(e,"l",t),bt=(e,t)=>Cm(e,"l",-t),O=(e,t)=>{const r=to.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return bm(e,i)},j2=(e,t,r=50)=>{const{r:i,g:o,b:n,a}=to.parse(e),{r:s,g:l,b:c,a:h}=to.parse(t),d=r/100,u=d*2-1,f=a-h,g=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,m=1-g,y=i*g+s*m,x=o*g+l*m,C=n*g+c*m,k=a*d+h*(1-d);return jo(y,x,C,k)},lt=(e,t=100)=>{const r=to.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,j2(r,e,t)};var wh=w((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>wh(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(([n,a])=>{if(typeof a=="object"){if(a===null)return;Object.hasOwn(e,n)||Object.defineProperty(e,n,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[n]===void 0&&(o[n]=Array.isArray(a)?[]:{}),typeof o[n]=="object"&&(o[n]=wh(o[n],a,{depth:r-1}))}else typeof o[n]!="object"&&(Object.hasOwn(e,n)?o[n]=a:Object.defineProperty(e,n,{value:a,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),qr=wh,oo="#ffffff",no="#f2f2f2",Ie=w((e,t)=>t?O(e,{s:-40,l:10}):O(e,{s:-40,l:-10}),"mkBorder"),Un,G2=(Un=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||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||bt(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||xt(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||bt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||bt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||xt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||xt(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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(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]||xt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||bt(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]||O(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||O(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||O(this.primaryColor,{h:64}),this.fillType3=this.fillType3||O(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||O(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||O(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||O(this.primaryColor,{h:128}),this.fillType7=this.fillType7||O(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||O(this.primaryColor,{l:-10}),this.pie5=this.pie5||O(this.secondaryColor,{l:-10}),this.pie6=this.pie6||O(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||O(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||O(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??O(this.primaryColor,{l:-30}),this.venn2=this.venn2??O(this.secondaryColor,{l:-30}),this.venn3=this.venn3??O(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??O(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??O(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??O(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??O(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(this.primaryColor,{h:-30}),this.git4=this.git4||O(this.primaryColor,{h:-60}),this.git5=this.git5||O(this.primaryColor,{h:-90}),this.git6=this.git6||O(this.primaryColor,{h:60}),this.git7=this.git7||O(this.primaryColor,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no,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]=t[i]})}},w(Un,"Theme"),Un),U2=w(e=>{const t=new G2;return t.calculate(e),t},"getThemeVariables"),Vn,V2=(Vn=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=xt(this.primaryColor,16),this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=xt(lt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=jo(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=bt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=bt(this.sectionBkgColor,10),this.taskBorderColor=jo(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=jo(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||xt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||bt(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=xt(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=xt(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=xt(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=O(this.primaryColor,{h:64}),this.fillType3=O(this.secondaryColor,{h:64}),this.fillType4=O(this.primaryColor,{h:-64}),this.fillType5=O(this.secondaryColor,{h:-64}),this.fillType6=O(this.primaryColor,{h:128}),this.fillType7=O(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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(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]||xt(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||O(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||O(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)]??xt(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=xt(this.secondaryColor,20),this.git1=xt(this.pie2||this.secondaryColor,20),this.git2=xt(this.pie3||this.tertiaryColor,20),this.git3=xt(this.pie4||O(this.primaryColor,{h:-30}),20),this.git4=xt(this.pie5||O(this.primaryColor,{h:-60}),20),this.git5=xt(this.pie6||O(this.primaryColor,{h:-90}),10),this.git6=xt(this.pie7||O(this.primaryColor,{h:60}),10),this.git7=xt(this.pie8||O(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||xt("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||xt("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||xt("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||xt("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||xt(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||xt(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||xt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||xt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(Vn,"Theme"),Vn),Z2=w(e=>{const t=new V2;return t.calculate(e),t},"getThemeVariables"),Zn,K2=(Zn=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=O(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=Ie(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=jo(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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||bt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||bt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=bt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||bt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||O(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||O(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||O(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.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||xt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||xt(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=O(this.primaryColor,{h:64}),this.fillType3=O(this.secondaryColor,{h:64}),this.fillType4=O(this.primaryColor,{h:-64}),this.fillType5=O(this.secondaryColor,{h:-64}),this.fillType6=O(this.primaryColor,{h:128}),this.fillType7=O(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||O(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||O(this.primaryColor,{l:-10}),this.pie5=this.pie5||O(this.secondaryColor,{l:-30}),this.pie6=this.pie6||O(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||O(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||O(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??O(this.primaryColor,{l:-30}),this.venn2=this.venn2??O(this.secondaryColor,{l:-30}),this.venn3=this.venn3??O(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??O(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??O(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??O(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??O(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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||O(this.primaryColor,{h:-30}),this.git4=this.git4||O(this.primaryColor,{h:-60}),this.git5=this.git5||O(this.primaryColor,{h:-90}),this.git6=this.git6||O(this.primaryColor,{h:60}),this.git7=this.git7||O(this.primaryColor,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(this.git7,25)),this.gitInv0=this.gitInv0||bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(Zn,"Theme"),Zn),Q2=w(e=>{const t=new K2;return t.calculate(e),t},"getThemeVariables"),Kn,J2=(Kn=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=xt("#cde498",10),this.primaryBorderColor=Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=bt(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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||bt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||bt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=bt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||bt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||O(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]||O(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||O(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.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||xt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||xt(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=O(this.primaryColor,{h:64}),this.fillType3=O(this.secondaryColor,{h:64}),this.fillType4=O(this.primaryColor,{h:-64}),this.fillType5=O(this.secondaryColor,{h:-64}),this.fillType6=O(this.primaryColor,{h:128}),this.fillType7=O(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||O(this.primaryColor,{l:-30}),this.pie5=this.pie5||O(this.secondaryColor,{l:-30}),this.pie6=this.pie6||O(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||O(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||O(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??O(this.primaryColor,{l:-30}),this.venn2=this.venn2??O(this.secondaryColor,{l:-30}),this.venn3=this.venn3??O(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??O(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??O(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??O(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??O(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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||O(this.primaryColor,{h:-30}),this.git4=this.git4||O(this.primaryColor,{h:-60}),this.git5=this.git5||O(this.primaryColor,{h:-90}),this.git6=this.git6||O(this.primaryColor,{h:60}),this.git7=this.git7||O(this.primaryColor,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(Kn,"Theme"),Kn),tw=w(e=>{const t=new J2;return t.calculate(e),t},"getThemeVariables"),Qn,ew=(Qn=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=xt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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||xt(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=xt(this.contrast,55),this.border2=this.contrast,this.actorBorder=xt(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]||xt(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||bt(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]||O(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||O(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.sectionBkgColor=xt(this.contrast,30),this.sectionBkgColor2=xt(this.contrast,30),this.taskBorderColor=bt(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=xt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=bt(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=O(this.primaryColor,{h:64}),this.fillType3=O(this.secondaryColor,{h:64}),this.fillType4=O(this.primaryColor,{h:-64}),this.fillType5=O(this.secondaryColor,{h:-64}),this.fillType6=O(this.primaryColor,{h:128}),this.fillType7=O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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=bt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||O(this.primaryColor,{h:-30}),this.git4=this.pie5||O(this.primaryColor,{h:-60}),this.git5=this.pie6||O(this.primaryColor,{h:-90}),this.git6=this.pie7||O(this.primaryColor,{h:60}),this.git7=this.pie8||O(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(Qn,"Theme"),Qn),rw=w(e=>{const t=new ew;return t.calculate(e),t},"getThemeVariables"),Jn,iw=(Jn=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=Ie(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||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||bt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=O(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||xt(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||O(t,{h:30}),this.cScale4=this.cScale4||O(t,{h:60}),this.cScale5=this.cScale5||O(t,{h:90}),this.cScale6=this.cScale6||O(t,{h:120}),this.cScale7=this.cScale7||O(t,{h:150}),this.cScale8=this.cScale8||O(t,{h:210,l:150}),this.cScale9=this.cScale9||O(t,{h:270}),this.cScale10=this.cScale10||O(t,{h:300}),this.cScale11=this.cScale11||O(t,{h:330}),this.darkMode)for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScale"+n]=bt(this["cScale"+n],75);else for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScale"+n]=bt(this["cScale"+n],25);for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleInv"+n]=this["cScaleInv"+n]||lt(this["cScale"+n]);for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this.darkMode?this["cScalePeer"+n]=this["cScalePeer"+n]||xt(this["cScale"+n],10):this["cScalePeer"+n]=this["cScalePeer"+n]||bt(this["cScale"+n],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleLabel"+n]=this["cScaleLabel"+n]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let n=0;n<5;n++)this["surface"+n]=this["surface"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(5+n*3)}),this["surfacePeer"+n]=this["surfacePeer"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(8+n*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||O(t,{h:64}),this.fillType3=this.fillType3||O(r,{h:64}),this.fillType4=this.fillType4||O(t,{h:-64}),this.fillType5=this.fillType5||O(r,{h:-64}),this.fillType6=this.fillType6||O(t,{h:128}),this.fillType7=this.fillType7||O(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||O(t,{l:-10}),this.pie5=this.pie5||O(r,{l:-10}),this.pie6=this.pie6||O(i,{l:-10}),this.pie7=this.pie7||O(t,{h:60,l:-10}),this.pie8=this.pie8||O(t,{h:-60,l:-10}),this.pie9=this.pie9||O(t,{h:120,l:0}),this.pie10=this.pie10||O(t,{h:60,l:-20}),this.pie11=this.pie11||O(t,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(t,{h:-30}),this.git4=this.git4||O(t,{h:-60}),this.git5=this.git5||O(t,{h:-90}),this.git6=this.git6||O(t,{h:60}),this.git7=this.git7||O(t,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(Jn,"Theme"),Jn),ow=w(e=>{const t=new iw;return t.calculate(e),t},"getThemeVariables"),ta,nw=(ta=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=xt(this.primaryColor,16),this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=xt(lt("#323D47"),10),this.border1="#ccc",this.border2=jo(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||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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.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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||bt(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||xt(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||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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(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]||xt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||bt(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]||O(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||O(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||O(this.primaryColor,{h:64}),this.fillType3=this.fillType3||O(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||O(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||O(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||O(this.primaryColor,{h:128}),this.fillType7=this.fillType7||O(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||O(this.primaryColor,{l:-10}),this.pie5=this.pie5||O(this.secondaryColor,{l:-10}),this.pie6=this.pie6||O(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||O(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(ta,"Theme"),ta),aw=w(e=>{const t=new nw;return t.calculate(e),t},"getThemeVariables"),ea,sw=(ea=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=Ie("#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||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,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||bt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=O(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||xt(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 n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScale"+n]=this.mainBkg;if(this.darkMode)for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScale"+n]=bt(this["cScale"+n],75);else for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScale"+n]=bt(this["cScale"+n],25);for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleInv"+n]=this["cScaleInv"+n]||lt(this["cScale"+n]);for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this.darkMode?this["cScalePeer"+n]=this["cScalePeer"+n]||xt(this["cScale"+n],10):this["cScalePeer"+n]=this["cScalePeer"+n]||bt(this["cScale"+n],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleLabel"+n]=this["cScaleLabel"+n]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let n=0;n<5;n++)this["surface"+n]=this["surface"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(5+n*3)}),this["surfacePeer"+n]=this["surfacePeer"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(8+n*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||O(t,{h:64}),this.fillType3=this.fillType3||O(r,{h:64}),this.fillType4=this.fillType4||O(t,{h:-64}),this.fillType5=this.fillType5||O(r,{h:-64}),this.fillType6=this.fillType6||O(t,{h:128}),this.fillType7=this.fillType7||O(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||O(t,{l:-10}),this.pie5=this.pie5||O(r,{l:-10}),this.pie6=this.pie6||O(i,{l:-10}),this.pie7=this.pie7||O(t,{h:60,l:-10}),this.pie8=this.pie8||O(t,{h:-60,l:-10}),this.pie9=this.pie9||O(t,{h:120,l:0}),this.pie10=this.pie10||O(t,{h:60,l:-20}),this.pie11=this.pie11||O(t,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(t,{h:-30}),this.git4=this.git4||O(t,{h:-60}),this.git5=this.git5||O(t,{h:-90}),this.git6=this.git6||O(t,{h:60}),this.git7=this.git7||O(t,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(ea,"Theme"),ea),lw=w(e=>{const t=new sw;return t.calculate(e),t},"getThemeVariables"),ra,cw=(ra=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=xt(this.primaryColor,16),this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=xt(lt("#323D47"),10),this.border1="#ccc",this.border2=jo(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||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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.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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,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||bt(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||xt(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.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||O(this.primaryColor,{h:30}),this.cScale4=this.cScale4||O(this.primaryColor,{h:60}),this.cScale5=this.cScale5||O(this.primaryColor,{h:90}),this.cScale6=this.cScale6||O(this.primaryColor,{h:120}),this.cScale7=this.cScale7||O(this.primaryColor,{h:150}),this.cScale8=this.cScale8||O(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||O(this.primaryColor,{h:270}),this.cScale10=this.cScale10||O(this.primaryColor,{h:300}),this.cScale11=this.cScale11||O(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=bt(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]||xt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||bt(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]||O(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||O(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||O(this.primaryColor,{h:64}),this.fillType3=this.fillType3||O(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||O(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||O(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||O(this.primaryColor,{h:128}),this.fillType7=this.fillType7||O(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||O(this.primaryColor,{l:-10}),this.pie5=this.pie5||O(this.secondaryColor,{l:-10}),this.pie6=this.pie6||O(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||O(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(this.primaryColor,{h:-30}),this.git4=this.git4||O(this.primaryColor,{h:-60}),this.git5=this.git5||O(this.primaryColor,{h:-90}),this.git6=this.git6||O(this.primaryColor,{h:60}),this.git7=this.git7||O(this.primaryColor,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(ra,"Theme"),ra),hw=w(e=>{const t=new cw;return t.calculate(e),t},"getThemeVariables"),ia,dw=(ia=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=Ie(this.primaryColor,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.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.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||bt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor;const t="#ECECFE",r="#E9E9F1",i=O(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||xt(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.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||"#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";for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleInv"+n]=this["cScaleInv"+n]||lt(this["cScale"+n]);for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this.darkMode?this["cScalePeer"+n]=this["cScalePeer"+n]||xt(this["cScale"+n],10):this["cScalePeer"+n]=this["cScalePeer"+n]||bt(this["cScale"+n],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let n=0;n<this.THEME_COLOR_LIMIT;n++)this["cScaleLabel"+n]=this["cScaleLabel"+n]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let n=0;n<5;n++)this["surface"+n]=this["surface"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(5+n*3)}),this["surfacePeer"+n]=this["surfacePeer"+n]||O(this.mainBkg,{h:180,s:-15,l:o*(8+n*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||O(t,{h:64}),this.fillType3=this.fillType3||O(r,{h:64}),this.fillType4=this.fillType4||O(t,{h:-64}),this.fillType5=this.fillType5||O(r,{h:-64}),this.fillType6=this.fillType6||O(t,{h:128}),this.fillType7=this.fillType7||O(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||O(t,{l:-10}),this.pie5=this.pie5||O(r,{l:-10}),this.pie6=this.pie6||O(i,{l:-10}),this.pie7=this.pie7||O(t,{h:60,l:-10}),this.pie8=this.pie8||O(t,{h:-60,l:-10}),this.pie9=this.pie9||O(t,{h:120,l:0}),this.pie10=this.pie10||O(t,{h:60,l:-20}),this.pie11=this.pie11||O(t,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(t,{h:-30}),this.git4=this.git4||O(t,{h:-60}),this.git5=this.git5||O(t,{h:-90}),this.git6=this.git6||O(t,{h:60}),this.git7=this.git7||O(t,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(ia,"Theme"),ia),uw=w(e=>{const t=new dw;return t.calculate(e),t},"getThemeVariables"),oa,fw=(oa=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=xt(this.primaryColor,16),this.tertiaryColor=O(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ie(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=xt(lt("#323D47"),10),this.border1="#ccc",this.border2=jo(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.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||O(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||O(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ie(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ie(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ie(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ie(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.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?bt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,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||bt(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.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||xt(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.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.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||"#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";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]||xt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||bt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=bt(this["cScale"+r],75);const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||O(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||O(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||O(this.primaryColor,{h:64}),this.fillType3=this.fillType3||O(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||O(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||O(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||O(this.primaryColor,{h:128}),this.fillType7=this.fillType7||O(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||O(this.primaryColor,{l:-10}),this.pie5=this.pie5||O(this.secondaryColor,{l:-10}),this.pie6=this.pie6||O(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||O(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||O(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||O(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||O(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||O(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||O(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||O(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||O(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||O(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||O(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||O(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||O(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||Ri(this.quadrant1Fill)?xt(this.quadrant1Fill):bt(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?bt(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||O(this.primaryColor,{h:-30}),this.git4=this.git4||O(this.primaryColor,{h:-60}),this.git5=this.git5||O(this.primaryColor,{h:-90}),this.git6=this.git6||O(this.primaryColor,{h:60}),this.git7=this.git7||O(this.primaryColor,{h:120}),this.darkMode?(this.git0=xt(this.git0,25),this.git1=xt(this.git1,25),this.git2=xt(this.git2,25),this.git3=xt(this.git3,25),this.git4=xt(this.git4,25),this.git5=xt(this.git5,25),this.git6=xt(this.git6,25),this.git7=xt(this.git7,25)):(this.git0=bt(this.git0,25),this.git1=bt(this.git1,25),this.git2=bt(this.git2,25),this.git3=bt(this.git3,25),this.git4=bt(this.git4,25),this.git5=bt(this.git5,25),this.git6=bt(this.git6,25),this.git7=bt(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||oo,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||no}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=t[i]})}},w(oa,"Theme"),oa),gw=w(e=>{const t=new fw;return t.calculate(e),t},"getThemeVariables"),wo={base:{getThemeVariables:U2},dark:{getThemeVariables:Z2},default:{getThemeVariables:Q2},forest:{getThemeVariables:tw},neutral:{getThemeVariables:rw},neo:{getThemeVariables:ow},"neo-dark":{getThemeVariables:aw},redux:{getThemeVariables:lw},"redux-dark":{getThemeVariables:hw},"redux-color":{getThemeVariables:uw},"redux-dark-color":{getThemeVariables:gw}},zr={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,defaultRenderer:"dagre-wrapper",wrappingWidth:200,inheritDir:!1},swimlane:{useMaxWidth:!0,lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:"dagre-wrapper",htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5,defaultRenderer:"dagre-wrapper"},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,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,rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},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,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},venn:{useMaxWidth:!0,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:"dagre",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},wm={...zr,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:"BRANDES_KOEPF",nodePlacementAlignment:"NONE",forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1},themeCSS:void 0,themeVariables:wo.default.getThemeVariables(),sequence:{...zr.sequence,messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:w(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:w(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{defaultRenderer:"dagre-wrapper",hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...zr.gantt,tickInterval:void 0,useWidth:void 0},c4:{...zr.c4,useWidth:void 0,personFont:w(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...zr.flowchart,inheritDir:!1},external_personFont:w(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:w(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:w(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:w(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:w(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:w(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:w(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:w(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:w(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:w(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:w(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:w(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:w(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:w(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:w(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:w(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:w(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:w(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:w(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:w(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:w(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...zr.pie,useWidth:984},xyChart:{...zr.xyChart,useWidth:void 0},requirement:{...zr.requirement,useWidth:void 0},packet:{...zr.packet},eventmodeling:{...zr.eventmodeling},treeView:{...zr.treeView,useWidth:void 0},radar:{...zr.radar},railroad:{...zr.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:{...zr.ishikawa},sankey:{...zr.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:{...zr.venn},cynefin:{...zr.cynefin}},km=w((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...km(e[i],"")]:[...r,t+i],[]),"keyify"),pw=new Set(km(wm,"")),Sm=wm,mw={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},yw=w((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))&&(pt.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),fl=w(e=>{if(pt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>fl(t));return}for(const t of Object.keys(e)){if(pt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!pw.has(t)||e[t]==null){pt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=mw[t];i?yw(e[t],i):(pt.debug("sanitizing object",t),fl(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(pt.debug("sanitizing css option",t),e[t]=vm(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]="")}pt.debug("After sanitization",e)}},"sanitizeDirective"),vm=w(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"),ha=Object.freeze(Sm),ao=w(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),si=qr({},ha),gl,pn=[],Qa=qr({},ha),xs=w((e,t)=>{let r=qr({},e),i={};for(const o of t)Mm(o),i=qr(i,o);if(r=qr(r,i),i.theme&&i.theme in wo){const o=qr({},gl),n=qr(o.themeVariables||{},i.themeVariables);r.theme&&r.theme in wo&&(r.themeVariables=wo[r.theme].getThemeVariables(n))}return Qa=r,Sw(Qa),Qa},"updateCurrentConfig"),xw=w(e=>(si=qr({},ha),si=qr(si,e),e.theme&&wo[e.theme]&&(si.themeVariables=wo[e.theme].getThemeVariables(e.themeVariables)),xs(si,pn),si),"setSiteConfig"),bw=w(e=>{gl=qr({},e)},"saveConfigFromInitialize"),Cw=w(e=>(si=qr(si,e),xs(si,pn),si),"updateSiteConfig"),_m=w(()=>qr({},si),"getSiteConfig"),Tm=w(e=>(xs(Qa,[e]),Br()),"setConfig"),Br=w(()=>qr({},Qa),"getConfig"),Mm=w(e=>{e&&(["secure",...si.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(pt.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"&&Mm(e[t])}))},"sanitize"),ww=w(e=>{fl(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),pn.push(e),xs(si,pn)},"addDirective"),pl=w((e=si)=>{pn=[],xs(e,pn)},"reset"),kw={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."},uf={},Bm=w(e=>{uf[e]||(pt.warn(kw[e]),uf[e]=!0)},"issueWarning"),Sw=w(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&Bm("LAZY_LOAD_DEPRECATED")},"checkConfig"),n6=w(()=>{let e={};gl&&(e=qr(e,gl));for(const t of pn)e=qr(e,t);return e},"getUserDefinedConfig"),Vr=w(e=>(e.flowchart?.htmlLabels!=null&&Bm("FLOWCHART_HTML_LABELS_DEPRECATED"),ao(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),Lm=/^([^\S\n\r]*)-{3}\s*[\n\r](.*?)[\n\r]\1-{3}\s*[\n\r]+/s,Ja=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,vw=/\s*%%.*\n/gm,na,Am=(na=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},w(na,"UnknownDiagramError"),na),mn={},md=w(function(e,t){e=e.replace(Lm,"").replace(Ja,"").replace(vw,`
|
|
3
|
-
`);for(const[r,{detector:i}]of Object.entries(mn))if(i(e,t))return r;throw new Am(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),kh=w((...e)=>{for(const{id:t,detector:r,loader:i}of e)Fm(t,r,i)},"registerLazyLoadedDiagrams"),Fm=w((e,t,r)=>{mn[e]&&pt.warn(`Detector with key ${e} already exists. Overwriting.`),mn[e]={detector:t,loader:r},pt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),_w=w(e=>mn[e].loader,"getDiagramLoader"),bs=/<br\s*\/?>/gi,Tw=w(e=>e?Pm(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),Mw=(()=>{let e=!1;return()=>{e||($m(),e=!0)}})();function $m(){const e="data-temp-href-target";ca.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),ca.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"))})}w($m,"setupDompurifyHooks");var Em=w(e=>(Mw(),ca.sanitize(e)),"removeScript"),ff=w((e,t)=>{if(Vr(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=Em(e):r!=="loose"&&(e=Pm(e),e=e.replace(/</g,"<").replace(/>/g,">"),e=e.replace(/=/g,"="),e=Fw(e))}return e},"sanitizeMore"),vi=w((e,t)=>e&&(t.dompurifyConfig?e=ca.sanitize(ff(e,t),t.dompurifyConfig).toString():e=ca.sanitize(ff(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),Bw=w((e,t)=>typeof e=="string"?vi(e,t):e.flat().map(r=>vi(r,t)),"sanitizeTextOrArray"),Lw=w(e=>bs.test(e),"hasBreaks"),Aw=w(e=>e.split(bs),"splitBreaks"),Fw=w(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),Pm=w(e=>e.replace(bs,"#br#"),"breakToPlaceholder"),$w=w(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),Ew=w(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),Pw=w(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),gf=w(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 n=t[i-1],a=t[i+1];Ow(n,a)&&(o=n+","+a,i++,r.pop())}r.push(Iw(o))}return r.join("")},"parseGenericTypes"),Sh=w((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),Ow=w((e,t)=>{const r=Sh(e,"~"),i=Sh(t,"~");return r===1&&i===1},"shouldCombineSets"),Iw=w(e=>{const t=Sh(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("~"),n=i.lastIndexOf("~");for(;o!==-1&&n!==-1&&o!==n;)i[o]="<",i[n]=">",o=i.indexOf("~"),n=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),pf=w(()=>window.MathMLElement!==void 0,"isMathMLSupported"),vh=/\$\$(.*?)\$\$/g,ns=w(e=>(e.match(vh)?.length??0)>0,"hasKatex"),a6=w(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await Om(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"),Rw=w(async(e,t)=>{if(!ns(e))return e;if(!(pf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(vh,"MathML is unsupported in this environment.");{const{default:r}=await Ye(async()=>{const{default:o}=await import("./HP8lGamR.js");return{default:o}},[],import.meta.url),i=t.forceLegacyMathML||!pf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(bs).map(o=>ns(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(vh,(o,n)=>r.renderToString(n,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),Om=w(async(e,t)=>vi(await Rw(e,t),t),"renderKatexSanitized"),Cs={getRows:Tw,sanitizeText:vi,sanitizeTextOrArray:Bw,hasBreaks:Lw,splitBreaks:Aw,lineBreakRegex:bs,removeScript:Em,getUrl:$w,evaluate:ao,getMax:Ew,getMin:Pw},Dw=w(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),Nw=w(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"),Im=w(function(e,t,r,i){const o=Nw(t,r,i);Dw(e,o)},"configureSvgSize"),qw=w(function(e,t,r,i){const o=t.node().getBBox(),n=o.width,a=o.height;pt.info(`SVG bounds: ${n}x${a}`,o);let s=0,l=0;pt.info(`Graph bounds: ${s}x${l}`,e),s=n+r*2,l=a+r*2,pt.info(`Calculated bounds: ${s}x${l}`),Im(t,l,s,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),Js={};function _h(e){return[...e.cssRules].map(t=>t.cssText).join(`
|
|
4
|
-
`)}w(_h,"cssStyleSheetToString");var zw=w((e,t,r,i)=>{let o="";return e in Js&&Js[e]?o=Js[e]({...r,svgId:i}):pt.warn(`No theme found for ${e}`),`& {
|
|
5
|
-
font-family: ${r.fontFamily};
|
|
6
|
-
font-size: ${r.fontSize};
|
|
7
|
-
fill: ${r.textColor}
|
|
8
|
-
}
|
|
9
|
-
@keyframes edge-animation-frame {
|
|
10
|
-
from {
|
|
11
|
-
stroke-dashoffset: 0;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
@keyframes dash {
|
|
15
|
-
to {
|
|
16
|
-
stroke-dashoffset: 0;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
& .edge-animation-slow {
|
|
20
|
-
stroke-dasharray: 9,5 !important;
|
|
21
|
-
stroke-dashoffset: 900;
|
|
22
|
-
animation: dash 50s linear infinite;
|
|
23
|
-
stroke-linecap: round;
|
|
24
|
-
}
|
|
25
|
-
& .edge-animation-fast {
|
|
26
|
-
stroke-dasharray: 9,5 !important;
|
|
27
|
-
stroke-dashoffset: 900;
|
|
28
|
-
animation: dash 20s linear infinite;
|
|
29
|
-
stroke-linecap: round;
|
|
30
|
-
}
|
|
31
|
-
/* Classes common for multiple diagrams */
|
|
32
|
-
|
|
33
|
-
& .error-icon {
|
|
34
|
-
fill: ${r.errorBkgColor};
|
|
35
|
-
}
|
|
36
|
-
& .error-text {
|
|
37
|
-
fill: ${r.errorTextColor};
|
|
38
|
-
stroke: ${r.errorTextColor};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
& .edge-thickness-normal {
|
|
42
|
-
stroke-width: ${r.strokeWidth??1}px;
|
|
43
|
-
}
|
|
44
|
-
& .edge-thickness-thick {
|
|
45
|
-
stroke-width: 3.5px
|
|
46
|
-
}
|
|
47
|
-
& .edge-pattern-solid {
|
|
48
|
-
stroke-dasharray: 0;
|
|
49
|
-
}
|
|
50
|
-
& .edge-thickness-invisible {
|
|
51
|
-
stroke-width: 0;
|
|
52
|
-
fill: none;
|
|
53
|
-
}
|
|
54
|
-
& .edge-pattern-dashed{
|
|
55
|
-
stroke-dasharray: 3;
|
|
56
|
-
}
|
|
57
|
-
.edge-pattern-dotted {
|
|
58
|
-
stroke-dasharray: 2;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
& .marker {
|
|
62
|
-
fill: ${r.lineColor};
|
|
63
|
-
stroke: ${r.lineColor};
|
|
64
|
-
}
|
|
65
|
-
& .marker.cross {
|
|
66
|
-
stroke: ${r.lineColor};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
& svg {
|
|
70
|
-
font-family: ${r.fontFamily};
|
|
71
|
-
font-size: ${r.fontSize};
|
|
72
|
-
}
|
|
73
|
-
& p {
|
|
74
|
-
margin: 0
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
${o}
|
|
78
|
-
.node .neo-node {
|
|
79
|
-
stroke: ${r.nodeBorder};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
[data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
|
|
83
|
-
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
84
|
-
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
85
|
-
}
|
|
86
|
-
[data-look="neo"].swimlane.cluster rect {
|
|
87
|
-
filter: none;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
[data-look="neo"].node path {
|
|
92
|
-
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
93
|
-
stroke-width: ${r.strokeWidth??1}px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[data-look="neo"].node .outer-path {
|
|
97
|
-
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[data-look="neo"].node .neo-line path {
|
|
101
|
-
stroke: ${r.nodeBorder};
|
|
102
|
-
filter: none;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
[data-look="neo"].node circle{
|
|
106
|
-
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
107
|
-
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
[data-look="neo"].node circle .state-start{
|
|
111
|
-
fill: #000000;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
[data-look="neo"].icon-shape .icon {
|
|
115
|
-
fill: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
116
|
-
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
[data-look="neo"].icon-shape .icon-neo path {
|
|
120
|
-
stroke: ${r.useGradient?"url("+i+"-gradient)":r.nodeBorder};
|
|
121
|
-
filter: ${r.dropShadow?r.dropShadow.replace("url(#drop-shadow)",`url(${i}-drop-shadow)`):"none"};
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
${t}
|
|
125
|
-
`},"getStyles"),Ww=w((e,t)=>{t!==void 0&&(Js[e]=t)},"addStylesForDiagram"),Hw=zw,Rm={};O2(Rm,{clear:()=>Yw,getAccDescription:()=>Uw,getAccTitle:()=>jw,getDiagramTitle:()=>Zw,setAccDescription:()=>Gw,setAccTitle:()=>Xw,setDiagramTitle:()=>Vw});var yd="",xd="",bd="",Cd=w(e=>vi(e,Br()),"sanitizeText"),Yw=w(()=>{yd="",bd="",xd=""},"clear"),Xw=w(e=>{yd=Cd(e).replace(/^\s+/g,"")},"setAccTitle"),jw=w(()=>yd,"getAccTitle"),Gw=w(e=>{bd=Cd(e).replace(/\n\s+/g,`
|
|
126
|
-
`)},"setAccDescription"),Uw=w(()=>bd,"getAccDescription"),Vw=w(e=>{xd=Cd(e)},"setDiagramTitle"),Zw=w(()=>xd,"getDiagramTitle"),mf=pt,Kw=pd,Ke=Br,s6=Tm,l6=ha,wd=w(e=>vi(e,Ke()),"sanitizeText"),Qw=qw,Jw=w(()=>Rm,"getCommonDb"),ml={},yl=w((e,t,r)=>{ml[e]&&mf.warn(`Diagram with id ${e} already registered. Overwriting.`),ml[e]=t,r&&Fm(e,r),Ww(e,t.styles),t.injectUtils?.(mf,Kw,Ke,wd,Qw,Jw(),()=>{})},"registerDiagram"),Th=w(e=>{if(e in ml)return ml[e];throw new tk(e)},"getDiagram"),aa,tk=(aa=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},w(aa,"DiagramNotFoundError"),aa),ek={value:()=>{}};function Dm(){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 tl(r)}function tl(e){this._=e}function rk(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}})}tl.prototype=Dm.prototype={constructor:tl,on:function(e,t){var r=this._,i=rk(e+"",r),o,n=-1,a=i.length;if(arguments.length<2){for(;++n<a;)if((o=(e=i[n]).type)&&(o=ik(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++n<a;)if(o=(e=i[n]).type)r[o]=yf(r[o],e.name,t);else if(t==null)for(o in r)r[o]=yf(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 tl(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),i=0,o,n;i<o;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(n=this._[e],i=0,o=n.length;i<o;++i)n[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,n=i.length;o<n;++o)i[o].value.apply(t,r)}};function ik(e,t){for(var r=0,i=e.length,o;r<i;++r)if((o=e[r]).name===t)return o.value}function yf(e,t,r){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=ek,e=e.slice(0,i).concat(e.slice(i+1));break}return r!=null&&e.push({name:t,value:r}),e}var Mh="http://www.w3.org/1999/xhtml";const xf={svg:"http://www.w3.org/2000/svg",xhtml:Mh,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)),xf.hasOwnProperty(t)?{space:xf[t],local:e}:e}function ok(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Mh&&t.documentElement.namespaceURI===Mh?t.createElement(e):t.createElementNS(r,e)}}function nk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Nm(e){var t=Wl(e);return(t.local?nk:ok)(t)}function ak(){}function kd(e){return e==null?ak:function(){return this.querySelector(e)}}function sk(e){typeof e!="function"&&(e=kd(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var n=t[o],a=n.length,s=i[o]=new Array(a),l,c,h=0;h<a;++h)(l=n[h])&&(c=e.call(l,l.__data__,h,n))&&("__data__"in l&&(c.__data__=l.__data__),s[h]=c);return new gi(i,this._parents)}function lk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ck(){return[]}function qm(e){return e==null?ck:function(){return this.querySelectorAll(e)}}function hk(e){return function(){return lk(e.apply(this,arguments))}}function dk(e){typeof e=="function"?e=hk(e):e=qm(e);for(var t=this._groups,r=t.length,i=[],o=[],n=0;n<r;++n)for(var a=t[n],s=a.length,l,c=0;c<s;++c)(l=a[c])&&(i.push(e.call(l,l.__data__,c,a)),o.push(l));return new gi(i,o)}function zm(e){return function(){return this.matches(e)}}function Wm(e){return function(t){return t.matches(e)}}var uk=Array.prototype.find;function fk(e){return function(){return uk.call(this.children,e)}}function gk(){return this.firstElementChild}function pk(e){return this.select(e==null?gk:fk(typeof e=="function"?e:Wm(e)))}var mk=Array.prototype.filter;function yk(){return Array.from(this.children)}function xk(e){return function(){return mk.call(this.children,e)}}function bk(e){return this.selectAll(e==null?yk:xk(typeof e=="function"?e:Wm(e)))}function Ck(e){typeof e!="function"&&(e=zm(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var n=t[o],a=n.length,s=i[o]=[],l,c=0;c<a;++c)(l=n[c])&&e.call(l,l.__data__,c,n)&&s.push(l);return new gi(i,this._parents)}function Hm(e){return new Array(e.length)}function wk(){return new gi(this._enter||this._groups.map(Hm),this._parents)}function xl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xl.prototype={constructor:xl,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 kk(e){return function(){return e}}function Sk(e,t,r,i,o,n){for(var a=0,s,l=t.length,c=n.length;a<c;++a)(s=t[a])?(s.__data__=n[a],i[a]=s):r[a]=new xl(e,n[a]);for(;a<l;++a)(s=t[a])&&(o[a]=s)}function vk(e,t,r,i,o,n,a){var s,l,c=new Map,h=t.length,d=n.length,u=new Array(h),f;for(s=0;s<h;++s)(l=t[s])&&(u[s]=f=a.call(l,l.__data__,s,t)+"",c.has(f)?o[s]=l:c.set(f,l));for(s=0;s<d;++s)f=a.call(e,n[s],s,n)+"",(l=c.get(f))?(i[s]=l,l.__data__=n[s],c.delete(f)):r[s]=new xl(e,n[s]);for(s=0;s<h;++s)(l=t[s])&&c.get(u[s])===l&&(o[s]=l)}function _k(e){return e.__data__}function Tk(e,t){if(!arguments.length)return Array.from(this,_k);var r=t?vk:Sk,i=this._parents,o=this._groups;typeof e!="function"&&(e=kk(e));for(var n=o.length,a=new Array(n),s=new Array(n),l=new Array(n),c=0;c<n;++c){var h=i[c],d=o[c],u=d.length,f=Mk(e.call(h,h&&h.__data__,c,i)),p=f.length,g=s[c]=new Array(p),m=a[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 a=new gi(a,i),a._enter=s,a._exit=l,a}function Mk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Bk(){return new gi(this._exit||this._groups.map(Hm),this._parents)}function Lk(e,t,r){var i=this.enter(),o=this,n=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?n.remove():r(n),i&&o?i.merge(o).order():o}function Ak(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,n=i.length,a=Math.min(o,n),s=new Array(o),l=0;l<a;++l)for(var c=r[l],h=i[l],d=c.length,u=s[l]=new Array(d),f,p=0;p<d;++p)(f=c[p]||h[p])&&(u[p]=f);for(;l<o;++l)s[l]=r[l];return new gi(s,this._parents)}function Fk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,n=i[o],a;--o>=0;)(a=i[o])&&(n&&a.compareDocumentPosition(n)^4&&n.parentNode.insertBefore(a,n),n=a);return this}function $k(e){e||(e=Ek);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),n=0;n<i;++n){for(var a=r[n],s=a.length,l=o[n]=new Array(s),c,h=0;h<s;++h)(c=a[h])&&(l[h]=c);l.sort(t)}return new gi(o,this._parents).order()}function Ek(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ok(){return Array.from(this)}function Ik(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,n=i.length;o<n;++o){var a=i[o];if(a)return a}return null}function Rk(){let e=0;for(const t of this)++e;return e}function Dk(){return!this.node()}function Nk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],n=0,a=o.length,s;n<a;++n)(s=o[n])&&e.call(s,s.__data__,n,o);return this}function qk(e){return function(){this.removeAttribute(e)}}function zk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wk(e,t){return function(){this.setAttribute(e,t)}}function Hk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Yk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Xk(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 jk(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?zk:qk:typeof t=="function"?r.local?Xk:Yk:r.local?Hk:Wk)(r,t))}function Ym(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Gk(e){return function(){this.style.removeProperty(e)}}function Uk(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Vk(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function Zk(e,t,r){return arguments.length>1?this.each((t==null?Gk:typeof t=="function"?Vk:Uk)(e,t,r??"")):da(this.node(),e)}function da(e,t){return e.style.getPropertyValue(t)||Ym(e).getComputedStyle(e,null).getPropertyValue(t)}function Kk(e){return function(){delete this[e]}}function Qk(e,t){return function(){this[e]=t}}function Jk(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function tS(e,t){return arguments.length>1?this.each((t==null?Kk:typeof t=="function"?Jk:Qk)(e,t)):this.node()[e]}function Xm(e){return e.trim().split(/^|\s+/)}function Sd(e){return e.classList||new jm(e)}function jm(e){this._node=e,this._names=Xm(e.getAttribute("class")||"")}jm.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 Gm(e,t){for(var r=Sd(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function Um(e,t){for(var r=Sd(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function eS(e){return function(){Gm(this,e)}}function rS(e){return function(){Um(this,e)}}function iS(e,t){return function(){(t.apply(this,arguments)?Gm:Um)(this,e)}}function oS(e,t){var r=Xm(e+"");if(arguments.length<2){for(var i=Sd(this.node()),o=-1,n=r.length;++o<n;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?iS:t?eS:rS)(r,t))}function nS(){this.textContent=""}function aS(e){return function(){this.textContent=e}}function sS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lS(e){return arguments.length?this.each(e==null?nS:(typeof e=="function"?sS:aS)(e)):this.node().textContent}function cS(){this.innerHTML=""}function hS(e){return function(){this.innerHTML=e}}function dS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uS(e){return arguments.length?this.each(e==null?cS:(typeof e=="function"?dS:hS)(e)):this.node().innerHTML}function fS(){this.nextSibling&&this.parentNode.appendChild(this)}function gS(){return this.each(fS)}function pS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mS(){return this.each(pS)}function yS(e){var t=typeof e=="function"?e:Nm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function xS(){return null}function bS(e,t){var r=typeof e=="function"?e:Nm(e),i=t==null?xS:typeof t=="function"?t:kd(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function CS(){var e=this.parentNode;e&&e.removeChild(this)}function wS(){return this.each(CS)}function kS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function SS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vS(e){return this.select(e?SS:kS)}function _S(e){return arguments.length?this.property("__data__",e):this.node().__data__}function TS(e){return function(t){e.call(this,t,this.__data__)}}function MS(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 BS(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,n;r<o;++r)n=t[r],(!e.type||n.type===e.type)&&n.name===e.name?this.removeEventListener(n.type,n.listener,n.options):t[++i]=n;++i?t.length=i:delete this.__on}}}function LS(e,t,r){return function(){var i=this.__on,o,n=TS(t);if(i){for(var a=0,s=i.length;a<s;++a)if((o=i[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=n,o.options=r),o.value=t;return}}this.addEventListener(e.type,n,r),o={type:e.type,name:e.name,value:t,listener:n,options:r},i?i.push(o):this.__on=[o]}}function AS(e,t,r){var i=MS(e+""),o,n=i.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,c=s.length,h;l<c;++l)for(o=0,h=s[l];o<n;++o)if((a=i[o]).type===h.type&&a.name===h.name)return h.value}return}for(s=t?LS:BS,o=0;o<n;++o)this.each(s(i[o],t,r));return this}function Vm(e,t,r){var i=Ym(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 FS(e,t){return function(){return Vm(this,e,t)}}function $S(e,t){return function(){return Vm(this,e,t.apply(this,arguments))}}function ES(e,t){return this.each((typeof t=="function"?$S:FS)(e,t))}function*PS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,n=i.length,a;o<n;++o)(a=i[o])&&(yield a)}var Zm=[null];function gi(e,t){this._groups=e,this._parents=t}function ws(){return new gi([[document.documentElement]],Zm)}function OS(){return this}gi.prototype=ws.prototype={constructor:gi,select:sk,selectAll:dk,selectChild:pk,selectChildren:bk,filter:Ck,data:Tk,enter:wk,exit:Bk,join:Lk,merge:Ak,selection:OS,order:Fk,sort:$k,call:Pk,nodes:Ok,node:Ik,size:Rk,empty:Dk,each:Nk,attr:jk,style:Zk,property:tS,classed:oS,text:lS,html:uS,raise:gS,lower:mS,append:yS,insert:bS,remove:wS,clone:vS,datum:_S,on:AS,dispatch:ES,[Symbol.iterator]:PS};function He(e){return typeof e=="string"?new gi([[document.querySelector(e)]],[document.documentElement]):new gi([[e]],Zm)}function vd(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Km(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function ks(){}var as=.7,bl=1/as,Xn="\\s*([+-]?\\d+)\\s*",ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",IS=/^#([0-9a-f]{3,8})$/,RS=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),DS=new RegExp(`^rgb\\(${Ji},${Ji},${Ji}\\)$`),NS=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${ss}\\)$`),qS=new RegExp(`^rgba\\(${Ji},${Ji},${Ji},${ss}\\)$`),zS=new RegExp(`^hsl\\(${ss},${Ji},${Ji}\\)$`),WS=new RegExp(`^hsla\\(${ss},${Ji},${Ji},${ss}\\)$`),bf={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};vd(ks,ua,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Cf,formatHex:Cf,formatHex8:HS,formatHsl:YS,formatRgb:wf,toString:wf});function Cf(){return this.rgb().formatHex()}function HS(){return this.rgb().formatHex8()}function YS(){return Qm(this).formatHsl()}function wf(){return this.rgb().formatRgb()}function ua(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=IS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?kf(t):r===3?new li(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ls(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ls(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=RS.exec(e))?new li(t[1],t[2],t[3],1):(t=DS.exec(e))?new li(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NS.exec(e))?Ls(t[1],t[2],t[3],t[4]):(t=qS.exec(e))?Ls(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zS.exec(e))?_f(t[1],t[2]/100,t[3]/100,1):(t=WS.exec(e))?_f(t[1],t[2]/100,t[3]/100,t[4]):bf.hasOwnProperty(e)?kf(bf[e]):e==="transparent"?new li(NaN,NaN,NaN,0):null}function kf(e){return new li(e>>16&255,e>>8&255,e&255,1)}function Ls(e,t,r,i){return i<=0&&(e=t=r=NaN),new li(e,t,r,i)}function XS(e){return e instanceof ks||(e=ua(e)),e?(e=e.rgb(),new li(e.r,e.g,e.b,e.opacity)):new li}function Ci(e,t,r,i){return arguments.length===1?XS(e):new li(e,t,r,i??1)}function li(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}vd(li,Ci,Km(ks,{brighter(e){return e=e==null?bl:Math.pow(bl,e),new li(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?as:Math.pow(as,e),new li(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new li(dn(this.r),dn(this.g),dn(this.b),Cl(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:Sf,formatHex:Sf,formatHex8:jS,formatRgb:vf,toString:vf}));function Sf(){return`#${cn(this.r)}${cn(this.g)}${cn(this.b)}`}function jS(){return`#${cn(this.r)}${cn(this.g)}${cn(this.b)}${cn((isNaN(this.opacity)?1:this.opacity)*255)}`}function vf(){const e=Cl(this.opacity);return`${e===1?"rgb(":"rgba("}${dn(this.r)}, ${dn(this.g)}, ${dn(this.b)}${e===1?")":`, ${e})`}`}function Cl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function cn(e){return e=dn(e),(e<16?"0":"")+e.toString(16)}function _f(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Pi(e,t,r,i)}function Qm(e){if(e instanceof Pi)return new Pi(e.h,e.s,e.l,e.opacity);if(e instanceof ks||(e=ua(e)),!e)return new Pi;if(e instanceof Pi)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),n=Math.max(t,r,i),a=NaN,s=n-o,l=(n+o)/2;return s?(t===n?a=(r-i)/s+(r<i)*6:r===n?a=(i-t)/s+2:a=(t-r)/s+4,s/=l<.5?n+o:2-n-o,a*=60):s=l>0&&l<1?0:a,new Pi(a,s,l,e.opacity)}function GS(e,t,r,i){return arguments.length===1?Qm(e):new Pi(e,t,r,i??1)}function Pi(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}vd(Pi,GS,Km(ks,{brighter(e){return e=e==null?bl:Math.pow(bl,e),new Pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?as:Math.pow(as,e),new Pi(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 li(wc(e>=240?e-240:e+120,o,i),wc(e,o,i),wc(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Pi(Tf(this.h),As(this.s),As(this.l),Cl(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=Cl(this.opacity);return`${e===1?"hsl(":"hsla("}${Tf(this.h)}, ${As(this.s)*100}%, ${As(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Tf(e){return e=(e||0)%360,e<0?e+360:e}function As(e){return Math.max(0,Math.min(1,e||0))}function wc(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 _d=e=>()=>e;function Jm(e,t){return function(r){return e+r*t}}function US(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 c6(e,t){var r=t-e;return r?Jm(e,r>180||r<-180?r-360*Math.round(r/360):r):_d(isNaN(e)?t:e)}function VS(e){return(e=+e)==1?ty:function(t,r){return r-t?US(t,r,e):_d(isNaN(t)?r:t)}}function ty(e,t){var r=t-e;return r?Jm(e,r):_d(isNaN(e)?t:e)}const Mf=(function e(t){var r=VS(t);function i(o,n){var a=r((o=Ci(o)).r,(n=Ci(n)).r),s=r(o.g,n.g),l=r(o.b,n.b),c=ty(o.opacity,n.opacity);return function(h){return o.r=a(h),o.g=s(h),o.b=l(h),o.opacity=c(h),o+""}}return i.gamma=e,i})(1);function qo(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Bh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kc=new RegExp(Bh.source,"g");function ZS(e){return function(){return e}}function KS(e){return function(t){return e(t)+""}}function QS(e,t){var r=Bh.lastIndex=kc.lastIndex=0,i,o,n,a=-1,s=[],l=[];for(e=e+"",t=t+"";(i=Bh.exec(e))&&(o=kc.exec(t));)(n=o.index)>r&&(n=t.slice(r,n),s[a]?s[a]+=n:s[++a]=n),(i=i[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:qo(i,o)})),r=kc.lastIndex;return r<t.length&&(n=t.slice(r),s[a]?s[a]+=n:s[++a]=n),s.length<2?l[0]?KS(l[0].x):ZS(t):(t=l.length,function(c){for(var h=0,d;h<t;++h)s[(d=l[h]).i]=d.x(c);return s.join("")})}var Bf=180/Math.PI,Lh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ey(e,t,r,i,o,n){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*r+t*i)&&(r-=e*l,i-=t*l),(s=Math.sqrt(r*r+i*i))&&(r/=s,i/=s,l/=s),e*i<t*r&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:n,rotate:Math.atan2(t,e)*Bf,skewX:Math.atan(l)*Bf,scaleX:a,scaleY:s}}var Fs;function JS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lh:ey(t.a,t.b,t.c,t.d,t.e,t.f)}function tv(e){return e==null||(Fs||(Fs=document.createElementNS("http://www.w3.org/2000/svg","g")),Fs.setAttribute("transform",e),!(e=Fs.transform.baseVal.consolidate()))?Lh:(e=e.matrix,ey(e.a,e.b,e.c,e.d,e.e,e.f))}function ry(e,t,r,i){function o(c){return c.length?c.pop()+" ":""}function n(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:qo(c,d)},{i:g-2,x:qo(h,u)})}else(d||u)&&f.push("translate("+d+t+u+r)}function a(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:qo(c,h)})):h&&d.push(o(d)+"rotate("+h+i)}function s(c,h,d,u){c!==h?u.push({i:d.push(o(d)+"skewX(",null,i)-2,x:qo(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:qo(c,d)},{i:g-2,x:qo(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),n(c.translateX,c.translateY,h.translateX,h.translateY,d,u),a(c.rotate,h.rotate,d,u),s(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 ev=ry(JS,"px, ","px)","deg)"),rv=ry(tv,", ",")",")"),fa=0,Na=0,La=0,iy=1e3,wl,qa,kl=0,yn=0,Hl=0,ls=typeof performance=="object"&&performance.now?performance:Date,oy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Td(){return yn||(oy(iv),yn=ls.now()+Hl)}function iv(){yn=0}function Sl(){this._call=this._time=this._next=null}Sl.prototype=ny.prototype={constructor:Sl,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Td():+r)+(t==null?0:+t),!this._next&&qa!==this&&(qa?qa._next=this:wl=this,qa=this),this._call=e,this._time=r,Ah()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ah())}};function ny(e,t,r){var i=new Sl;return i.restart(e,t,r),i}function ov(){Td(),++fa;for(var e=wl,t;e;)(t=yn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--fa}function Lf(){yn=(kl=ls.now())+Hl,fa=Na=0;try{ov()}finally{fa=0,av(),yn=0}}function nv(){var e=ls.now(),t=e-kl;t>iy&&(Hl-=t,kl=e)}function av(){for(var e,t=wl,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:wl=r);qa=e,Ah(i)}function Ah(e){if(!fa){Na&&(Na=clearTimeout(Na));var t=e-yn;t>24?(e<1/0&&(Na=setTimeout(Lf,e-ls.now()-Hl)),La&&(La=clearInterval(La))):(La||(kl=ls.now(),La=setInterval(nv,iy)),fa=1,oy(Lf))}}function Af(e,t,r){var i=new Sl;return t=t==null?0:+t,i.restart(o=>{i.stop(),e(o+t)},t,r),i}var sv=Dm("start","end","cancel","interrupt"),lv=[],ay=0,Ff=1,Fh=2,el=3,$f=4,$h=5,rl=6;function Yl(e,t,r,i,o,n){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;cv(e,r,{name:t,index:i,group:o,on:sv,tween:lv,time:n.time,delay:n.delay,duration:n.duration,ease:n.ease,timer:null,state:ay})}function Md(e,t){var r=Di(e,t);if(r.state>ay)throw new Error("too late; already scheduled");return r}function so(e,t){var r=Di(e,t);if(r.state>el)throw new Error("too late; already running");return r}function Di(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function cv(e,t,r){var i=e.__transition,o;i[t]=r,r.timer=ny(n,0,r.time);function n(c){r.state=Ff,r.timer.restart(a,r.delay,r.time),r.delay<=c&&a(c-r.delay)}function a(c){var h,d,u,f;if(r.state!==Ff)return l();for(h in i)if(f=i[h],f.name===r.name){if(f.state===el)return Af(a);f.state===$f?(f.state=rl,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[h]):+h<t&&(f.state=rl,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[h])}if(Af(function(){r.state===el&&(r.state=$f,r.timer.restart(s,r.delay,r.time),s(c))}),r.state=Fh,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Fh){for(r.state=el,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 s(c){for(var h=c<r.duration?r.ease.call(null,c/r.duration):(r.timer.restart(l),r.state=$h,1),d=-1,u=o.length;++d<u;)o[d].call(e,h);r.state===$h&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=rl,r.timer.stop(),delete i[t];for(var c in i)return;delete e.__transition}}function hv(e,t){var r=e.__transition,i,o,n=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((i=r[a]).name!==t){n=!1;continue}o=i.state>Fh&&i.state<$h,i.state=rl,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[a]}n&&delete e.__transition}}function dv(e){return this.each(function(){hv(this,e)})}function uv(e,t){var r,i;return function(){var o=so(this,e),n=o.tween;if(n!==r){i=r=n;for(var a=0,s=i.length;a<s;++a)if(i[a].name===t){i=i.slice(),i.splice(a,1);break}}o.tween=i}}function fv(e,t,r){var i,o;if(typeof r!="function")throw new Error;return function(){var n=so(this,e),a=n.tween;if(a!==i){o=(i=a).slice();for(var s={name:t,value:r},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}n.tween=o}}function gv(e,t){var r=this._id;if(e+="",arguments.length<2){for(var i=Di(this.node(),r).tween,o=0,n=i.length,a;o<n;++o)if((a=i[o]).name===e)return a.value;return null}return this.each((t==null?uv:fv)(r,e,t))}function Bd(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 Di(o,i).value[t]}}function sy(e,t){var r;return(typeof t=="number"?qo:t instanceof ua?Mf:(r=ua(t))?(t=r,Mf):QS)(e,t)}function pv(e){return function(){this.removeAttribute(e)}}function mv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yv(e,t,r){var i,o=r+"",n;return function(){var a=this.getAttribute(e);return a===o?null:a===i?n:n=t(i=a,r)}}function xv(e,t,r){var i,o=r+"",n;return function(){var a=this.getAttributeNS(e.space,e.local);return a===o?null:a===i?n:n=t(i=a,r)}}function bv(e,t,r){var i,o,n;return function(){var a,s=r(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===i&&l===o?n:(o=l,n=t(i=a,s)))}}function Cv(e,t,r){var i,o,n;return function(){var a,s=r(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===i&&l===o?n:(o=l,n=t(i=a,s)))}}function wv(e,t){var r=Wl(e),i=r==="transform"?rv:sy;return this.attrTween(e,typeof t=="function"?(r.local?Cv:bv)(r,i,Bd(this,"attr."+e,t)):t==null?(r.local?mv:pv)(r):(r.local?xv:yv)(r,i,t))}function kv(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Sv(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function vv(e,t){var r,i;function o(){var n=t.apply(this,arguments);return n!==i&&(r=(i=n)&&Sv(e,n)),r}return o._value=t,o}function _v(e,t){var r,i;function o(){var n=t.apply(this,arguments);return n!==i&&(r=(i=n)&&kv(e,n)),r}return o._value=t,o}function Tv(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?vv:_v)(i,t))}function Mv(e,t){return function(){Md(this,e).delay=+t.apply(this,arguments)}}function Bv(e,t){return t=+t,function(){Md(this,e).delay=t}}function Lv(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Mv:Bv)(t,e)):Di(this.node(),t).delay}function Av(e,t){return function(){so(this,e).duration=+t.apply(this,arguments)}}function Fv(e,t){return t=+t,function(){so(this,e).duration=t}}function $v(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Av:Fv)(t,e)):Di(this.node(),t).duration}function Ev(e,t){if(typeof t!="function")throw new Error;return function(){so(this,e).ease=t}}function Pv(e){var t=this._id;return arguments.length?this.each(Ev(t,e)):Di(this.node(),t).ease}function Ov(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;so(this,e).ease=r}}function Iv(e){if(typeof e!="function")throw new Error;return this.each(Ov(this._id,e))}function Rv(e){typeof e!="function"&&(e=zm(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var n=t[o],a=n.length,s=i[o]=[],l,c=0;c<a;++c)(l=n[c])&&e.call(l,l.__data__,c,n)&&s.push(l);return new So(i,this._parents,this._name,this._id)}function Dv(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,i=t.length,o=r.length,n=Math.min(i,o),a=new Array(i),s=0;s<n;++s)for(var l=t[s],c=r[s],h=l.length,d=a[s]=new Array(h),u,f=0;f<h;++f)(u=l[f]||c[f])&&(d[f]=u);for(;s<i;++s)a[s]=t[s];return new So(a,this._parents,this._name,this._id)}function Nv(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 qv(e,t,r){var i,o,n=Nv(t)?Md:so;return function(){var a=n(this,e),s=a.on;s!==i&&(o=(i=s).copy()).on(t,r),a.on=o}}function zv(e,t){var r=this._id;return arguments.length<2?Di(this.node(),r).on.on(e):this.each(qv(r,e,t))}function Wv(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function Hv(){return this.on("end.remove",Wv(this._id))}function Yv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=kd(e));for(var i=this._groups,o=i.length,n=new Array(o),a=0;a<o;++a)for(var s=i[a],l=s.length,c=n[a]=new Array(l),h,d,u=0;u<l;++u)(h=s[u])&&(d=e.call(h,h.__data__,u,s))&&("__data__"in h&&(d.__data__=h.__data__),c[u]=d,Yl(c[u],t,r,u,c,Di(h,r)));return new So(n,this._parents,t,r)}function Xv(e){var t=this._name,r=this._id;typeof e!="function"&&(e=qm(e));for(var i=this._groups,o=i.length,n=[],a=[],s=0;s<o;++s)for(var l=i[s],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=Di(h,r),g=0,m=u.length;g<m;++g)(f=u[g])&&Yl(f,t,r,g,u,p);n.push(u),a.push(h)}return new So(n,a,t,r)}var jv=ws.prototype.constructor;function Gv(){return new jv(this._groups,this._parents)}function Uv(e,t){var r,i,o;return function(){var n=da(this,e),a=(this.style.removeProperty(e),da(this,e));return n===a?null:n===r&&a===i?o:o=t(r=n,i=a)}}function ly(e){return function(){this.style.removeProperty(e)}}function Vv(e,t,r){var i,o=r+"",n;return function(){var a=da(this,e);return a===o?null:a===i?n:n=t(i=a,r)}}function Zv(e,t,r){var i,o,n;return function(){var a=da(this,e),s=r(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),da(this,e))),a===l?null:a===i&&l===o?n:(o=l,n=t(i=a,s))}}function Kv(e,t){var r,i,o,n="style."+t,a="end."+n,s;return function(){var l=so(this,e),c=l.on,h=l.value[n]==null?s||(s=ly(t)):void 0;(c!==r||o!==h)&&(i=(r=c).copy()).on(a,o=h),l.on=i}}function Qv(e,t,r){var i=(e+="")=="transform"?ev:sy;return t==null?this.styleTween(e,Uv(e,i)).on("end.style."+e,ly(e)):typeof t=="function"?this.styleTween(e,Zv(e,i,Bd(this,"style."+e,t))).each(Kv(this._id,e)):this.styleTween(e,Vv(e,i,t),r).on("end.style."+e,null)}function Jv(e,t,r){return function(i){this.style.setProperty(e,t.call(this,i),r)}}function t_(e,t,r){var i,o;function n(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&Jv(e,a,r)),i}return n._value=t,n}function e_(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,t_(e,t,r??""))}function r_(e){return function(){this.textContent=e}}function i_(e){return function(){var t=e(this);this.textContent=t??""}}function o_(e){return this.tween("text",typeof e=="function"?i_(Bd(this,"text",e)):r_(e==null?"":e+""))}function n_(e){return function(t){this.textContent=e.call(this,t)}}function a_(e){var t,r;function i(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&n_(o)),t}return i._value=e,i}function s_(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,a_(e))}function l_(){for(var e=this._name,t=this._id,r=cy(),i=this._groups,o=i.length,n=0;n<o;++n)for(var a=i[n],s=a.length,l,c=0;c<s;++c)if(l=a[c]){var h=Di(l,t);Yl(l,e,r,c,a,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new So(i,this._parents,e,r)}function c_(){var e,t,r=this,i=r._id,o=r.size();return new Promise(function(n,a){var s={value:a},l={value:function(){--o===0&&n()}};r.each(function(){var c=so(this,i),h=c.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),c.on=t}),o===0&&n()})}var h_=0;function So(e,t,r,i){this._groups=e,this._parents=t,this._name=r,this._id=i}function cy(){return++h_}var po=ws.prototype;So.prototype={constructor:So,select:Yv,selectAll:Xv,selectChild:po.selectChild,selectChildren:po.selectChildren,filter:Rv,merge:Dv,selection:Gv,transition:l_,call:po.call,nodes:po.nodes,node:po.node,size:po.size,empty:po.empty,each:po.each,on:zv,attr:wv,attrTween:Tv,style:Qv,styleTween:e_,text:o_,textTween:s_,remove:Hv,tween:gv,delay:Lv,duration:$v,ease:Pv,easeVarying:Iv,end:c_,[Symbol.iterator]:po[Symbol.iterator]};function d_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var u_={time:null,delay:0,duration:250,ease:d_};function f_(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 g_(e){var t,r;e instanceof So?(t=e._id,e=e._name):(t=cy(),(r=u_).time=Td(),e=e==null?null:e+"");for(var i=this._groups,o=i.length,n=0;n<o;++n)for(var a=i[n],s=a.length,l,c=0;c<s;++c)(l=a[c])&&Yl(l,e,t,c,a,r||f_(l,t));return new So(i,this._parents,e,t)}ws.prototype.interrupt=dv;ws.prototype.transition=g_;const Eh=Math.PI,Ph=2*Eh,on=1e-6,p_=Ph-on;function hy(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function m_(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return hy;const r=10**t;return function(i){this._+=i[0];for(let o=1,n=i.length;o<n;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}class y_{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?hy:m_(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,n,a){this._append`C${+t},${+r},${+i},${+o},${this._x1=+n},${this._y1=+a}`}arcTo(t,r,i,o,n){if(t=+t,r=+r,i=+i,o=+o,n=+n,n<0)throw new Error(`negative radius: ${n}`);let a=this._x1,s=this._y1,l=i-t,c=o-r,h=a-t,d=s-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>on)if(!(Math.abs(d*l-c*h)>on)||!n)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-a,p=o-s,g=l*l+c*c,m=f*f+p*p,y=Math.sqrt(g),x=Math.sqrt(u),C=n*Math.tan((Eh-Math.acos((g+u-m)/(2*y*x)))/2),k=C/x,v=C/y;Math.abs(k-1)>on&&this._append`L${t+k*h},${r+k*d}`,this._append`A${n},${n},0,0,${+(d*f>h*p)},${this._x1=t+v*l},${this._y1=r+v*c}`}}arc(t,r,i,o,n,a){if(t=+t,r=+r,i=+i,a=!!a,i<0)throw new Error(`negative radius: ${i}`);let s=i*Math.cos(o),l=i*Math.sin(o),c=t+s,h=r+l,d=1^a,u=a?o-n:n-o;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>on||Math.abs(this._y1-h)>on)&&this._append`L${c},${h}`,i&&(u<0&&(u=u%Ph+Ph),u>p_?this._append`A${i},${i},0,1,${d},${t-s},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`:u>on&&this._append`A${i},${i},0,${+(u>=Eh)},${d},${this._x1=t+i*Math.cos(n)},${this._y1=r+i*Math.sin(n)}`)}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 Fn(e){return function(){return e}}const h6=Math.abs,d6=Math.atan2,u6=Math.cos,f6=Math.max,g6=Math.min,p6=Math.sin,m6=Math.sqrt,Ef=1e-12,Ld=Math.PI,Pf=Ld/2,y6=2*Ld;function x6(e){return e>1?0:e<-1?Ld:Math.acos(e)}function b6(e){return e>=1?Pf:e<=-1?-Pf:Math.asin(e)}function x_(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 y_(t)}function b_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dy(e){this._context=e}dy.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 ts(e){return new dy(e)}function C_(e){return e[0]}function w_(e){return e[1]}function k_(e,t){var r=Fn(!0),i=null,o=ts,n=null,a=x_(s);e=typeof e=="function"?e:e===void 0?C_:Fn(e),t=typeof t=="function"?t:t===void 0?w_:Fn(t);function s(l){var c,h=(l=b_(l)).length,d,u=!1,f;for(i==null&&(n=o(f=a())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?n.lineStart():n.lineEnd()),u&&n.point(+e(d,c,l),+t(d,c,l));if(f)return n=null,f+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:Fn(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:Fn(+l),s):t},s.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Fn(!!l),s):r},s.curve=function(l){return arguments.length?(o=l,i!=null&&(n=o(i)),s):o},s.context=function(l){return arguments.length?(l==null?i=n=null:n=o(i=l),s):i},s}class uy{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 fy(e){return new uy(e,!0)}function gy(e){return new uy(e,!1)}function Go(){}function vl(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 Xl(e){this._context=e}Xl.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:vl(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:vl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oh(e){return new Xl(e)}function py(e){this._context=e}py.prototype={areaStart:Go,areaEnd:Go,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:vl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S_(e){return new py(e)}function my(e){this._context=e}my.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:vl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v_(e){return new my(e)}function yy(e,t){this._basis=new Xl(e),this._beta=t}yy.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],n=e[r]-i,a=t[r]-o,s=-1,l;++s<=r;)l=s/r,this._basis.point(this._beta*e[s]+(1-this._beta)*(i+l*n),this._beta*t[s]+(1-this._beta)*(o+l*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const __=(function e(t){function r(i){return t===1?new Xl(i):new yy(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function _l(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 Ad(e,t){this._context=e,this._k=(1-t)/6}Ad.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:_l(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:_l(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 xy=(function e(t){function r(i){return new Ad(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Fd(e,t){this._context=e,this._k=(1-t)/6}Fd.prototype={areaStart:Go,areaEnd:Go,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:_l(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 T_=(function e(t){function r(i){return new Fd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function $d(e,t){this._context=e,this._k=(1-t)/6}$d.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:_l(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 M_=(function e(t){function r(i){return new $d(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Ed(e,t,r){var i=e._x1,o=e._y1,n=e._x2,a=e._y2;if(e._l01_a>Ef){var s=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*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>Ef){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);n=(n*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,n,a,e._x2,e._y2)}function by(e,t){this._context=e,this._alpha=t}by.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:Ed(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 Cy=(function e(t){function r(i){return t?new by(i,t):new Ad(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function wy(e,t){this._context=e,this._alpha=t}wy.prototype={areaStart:Go,areaEnd:Go,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:Ed(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 B_=(function e(t){function r(i){return t?new wy(i,t):new Fd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ky(e,t){this._context=e,this._alpha=t}ky.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:Ed(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 L_=(function e(t){function r(i){return t?new ky(i,t):new $d(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function Sy(e){this._context=e}Sy.prototype={areaStart:Go,areaEnd:Go,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 A_(e){return new Sy(e)}function Of(e){return e<0?-1:1}function If(e,t,r){var i=e._x1-e._x0,o=t-e._x1,n=(e._y1-e._y0)/(i||o<0&&-0),a=(r-e._y1)/(o||i<0&&-0),s=(n*o+a*i)/(i+o);return(Of(n)+Of(a))*Math.min(Math.abs(n),Math.abs(a),.5*Math.abs(s))||0}function Rf(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Sc(e,t,r){var i=e._x0,o=e._y0,n=e._x1,a=e._y1,s=(n-i)/3;e._context.bezierCurveTo(i+s,o+s*t,n-s,a-s*r,n,a)}function Tl(e){this._context=e}Tl.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:Sc(this,this._t0,Rf(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,Sc(this,Rf(this,r=If(this,e,t)),r);break;default:Sc(this,this._t0,r=If(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function vy(e){this._context=new _y(e)}(vy.prototype=Object.create(Tl.prototype)).point=function(e,t){Tl.prototype.point.call(this,t,e)};function _y(e){this._context=e}_y.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,n){this._context.bezierCurveTo(t,e,i,r,n,o)}};function Ty(e){return new Tl(e)}function My(e){return new vy(e)}function By(e){this._context=e}By.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=Df(e),o=Df(t),n=0,a=1;a<r;++n,++a)this._context.bezierCurveTo(i[0][n],o[0][n],i[1][n],o[1][n],e[a],t[a]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Df(e){var t,r=e.length-1,i,o=new Array(r),n=new Array(r),a=new Array(r);for(o[0]=0,n[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,n[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,n[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/n[t-1],n[t]-=i,a[t]-=i*a[t-1];for(o[r-1]=a[r-1]/n[r-1],t=r-2;t>=0;--t)o[t]=(a[t]-o[t+1])/n[t];for(n[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)n[t]=2*e[t+1]-o[t+1];return[o,n]}function Ly(e){return new By(e)}function jl(e,t){this._context=e,this._t=t}jl.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 Ay(e){return new jl(e,.5)}function Fy(e){return new jl(e,0)}function $y(e){return new jl(e,1)}function za(e,t,r){this.k=e,this.x=t,this.y=r}za.prototype={constructor:za,scale:function(e){return e===1?this:new za(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new za(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+")"}};za.prototype;var F_=w(e=>{const{securityLevel:t}=Ke();let r=He("body");if(t==="sandbox"){const n=He(`#i${e}`).node()?.contentDocument??document;r=He(n.body)}return r.select(`#${e}`)},"selectSvgElement"),$_=w(e=>{const{handDrawnSeed:t}=Ke();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},"solidStateFill"),E_=w(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),ba=w(e=>{const t=P_([...e.cssCompiledStyles||[],...e.cssStyles||[],...E_(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),P_=w(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),Ey=w(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"),ae=w(e=>{const{stylesArray:t}=ba(e),r=[],i=[],o=[],n=[];return t.forEach(a=>{const s=a[0];Ey(s)?r.push(a.join(":")+" !important"):(i.push(a.join(":")+" !important"),s.includes("stroke")&&o.push(a.join(":")+" !important"),s==="fill"&&n.push(a.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:n}},"styles2String"),ee=w((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Ke(),{nodeBorder:o,mainBkg:n}=r,{stylesMap:a}=ba(e);return Object.assign({roughness:.7,fill:a.get("fill")||n,fillStyle:"hachure",fillWeight:4,hachureGap:5.2,stroke:a.get("stroke")||o,seed:i,strokeWidth:a.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:O_(a.get("stroke-dasharray"))},t)},"userNodeOverrides"),O_=w(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 I_=Object.freeze({left:0,top:0,width:16,height:16}),Ml=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Py=Object.freeze({...I_,...Ml}),R_=Object.freeze({...Py,body:"",hidden:!1}),D_=Object.freeze({width:null,height:null}),N_=Object.freeze({...D_,...Ml}),q_=(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 s=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:s};return vc(c)?c:null}const n=o[0],a=n.split("-");if(a.length>1){const s={provider:i,prefix:a.shift(),name:a.join("-")};return vc(s)?s:null}if(r&&i===""){const s={provider:i,prefix:"",name:n};return vc(s,r)?s:null}return null},vc=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function z_(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 Nf(e,t){const r=z_(e,t);for(const i in R_)i in Ml?i in e&&!(i in r)&&(r[i]=Ml[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function W_(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function n(a){if(r[a])return o[a]=[];if(!(a in o)){o[a]=null;const s=i[a]&&i[a].parent,l=s&&n(s);l&&(o[a]=[s].concat(l))}return o[a]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(n),o}function qf(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let n={};function a(s){n=Nf(i[s]||o[s],n)}return a(t),r.forEach(a),Nf(e,n)}function H_(e,t){if(e.icons[t])return qf(e,t,[]);const r=W_(e,[t])[t];return r?qf(e,t,r):null}const Y_=/(-?[0-9.]*[0-9]+[0-9.]*)/g,X_=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function zf(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(Y_);if(i===null||!i.length)return e;const o=[];let n=i.shift(),a=X_.test(n);for(;;){if(a){const s=parseFloat(n);isNaN(s)?o.push(n):o.push(Math.ceil(s*t*r)/r)}else o.push(n);if(n=i.shift(),n===void 0)return o.join("");a=!a}}function j_(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),n=e.indexOf("</"+t);if(o===-1||n===-1)break;const a=e.indexOf(">",n);if(a===-1)break;r+=e.slice(o+1,n).trim(),e=e.slice(0,i).trim()+e.slice(a+1)}return{defs:r,content:e}}function G_(e,t){return e?"<defs>"+e+"</defs>"+t:t}function U_(e,t,r){const i=j_(e);return G_(i.defs,t+i.content+r)}const V_=e=>e==="unset"||e==="undefined"||e==="none";function Z_(e,t){const r={...Py,...e},i={...N_,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let n=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&&(n=U_(n,'<g transform="'+m.join(" ")+'">',"</g>"))});const a=i.width,s=i.height,l=o.width,c=o.height;let h,d;a===null?(d=s===null?"1em":s==="auto"?c:s,h=zf(d,l/c)):(h=a==="auto"?l:a,d=s===null?zf(h,c/l):s==="auto"?c:s);const u={},f=(g,m)=>{V_(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:n}}const K_=/\sid="(\S+)"/g,Wf=new Map;function Q_(e){e=e.replace(/[0-9]+$/,"")||"a";const t=Wf.get(e)||0;return Wf.set(e,t+1),t?`${e}${t}`:e}function J_(e){const t=[];let r;for(;r=K_.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 n=Q_(o),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+n+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function tT(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 eT={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},Ih=new Map,Oy=new Map,rT=w(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(pt.debug("Registering icon pack:",t.name),"loader"in t)Oy.set(t.name,t.loader);else if("icons"in t)Ih.set(t.name,t.icons);else throw pt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Iy=w(async(e,t)=>{const r=q_(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=Ih.get(i);if(!o){const a=Oy.get(i);if(!a)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await a(),prefix:i},Ih.set(i,o)}catch(s){throw pt.error(s),new Error(`Failed to load icon set: ${r.prefix}`)}}const n=H_(o,r.name);if(!n)throw new Error(`Icon not found: ${e}`);return n},"getRegisteredIconData"),iT=w(async e=>{try{return await Iy(e),!0}catch{return!1}},"isIconAvailable"),Ss=w(async(e,t,r)=>{let i;try{i=await Iy(e,t?.fallbackPrefix)}catch(a){pt.error(a),i=eT}const o=Z_(i,t),n=tT(J_(o.body),{...o.attributes,...r});return vi(n,Br())},"getIconSVG"),$s={},Dr={},Hf;function oT(){return Hf||(Hf=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=/^.+(:|:)/gim,Dr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Dr.relativeFirstCharacters=[".","/"],Dr.BLANK_URL="about:blank"),Dr}var Yf;function nT(){if(Yf)return $s;Yf=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.sanitizeUrl=n;var e=oT();function t(a){return e.relativeFirstCharacters.indexOf(a[0])>-1}function r(a){var s=a.replace(e.ctrlCharactersRegex,"");return s.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(a){return URL.canParse(a)}function o(a){try{return decodeURIComponent(a)}catch{return a}}function n(a){if(!a)return e.BLANK_URL;var s,l=o(a.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),s=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(s&&s.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 $s}var aT=nT();function _c(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 sT(){}function Ry(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Pd(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const lT="[object RegExp]",Dy="[object String]",Ny="[object Number]",qy="[object Boolean]",zy="[object Arguments]",cT="[object Symbol]",hT="[object Date]",dT="[object Map]",uT="[object Set]",fT="[object Array]",gT="[object ArrayBuffer]",pT="[object Object]",mT="[object DataView]",yT="[object Uint8Array]",xT="[object Uint8ClampedArray]",bT="[object Uint16Array]",CT="[object Uint32Array]",wT="[object Int8Array]",kT="[object Int16Array]",ST="[object Int32Array]",vT="[object Float32Array]",_T="[object Float64Array]",Xf=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Od(e){return typeof Xf.Buffer<"u"&&Xf.Buffer.isBuffer(e)}function TT(e){return Number.isSafeInteger(e)&&e>=0}function Wy(e){return e!=null&&typeof e!="function"&&TT(e.length)}function MT(e){return e==="__proto__"}function Id(e){return e==null||typeof e!="object"&&typeof e!="function"}function Rd(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function BT(e,t){return zn(e,void 0,e,new Map,t)}function zn(e,t,r,i=new Map,o=void 0){const n=o?.(e,t,r,i);if(n!==void 0)return n;if(Id(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const a=new Array(e.length);i.set(e,a);for(let s=0;s<e.length;s++)a[s]=zn(e[s],s,r,i,o);return Object.hasOwn(e,"index")&&(a.index=e.index),Object.hasOwn(e,"input")&&(a.input=e.input),a}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const a=new RegExp(e.source,e.flags);return a.lastIndex=e.lastIndex,a}if(e instanceof Map){const a=new Map;i.set(e,a);for(const[s,l]of e)a.set(s,zn(l,s,r,i,o));return a}if(e instanceof Set){const a=new Set;i.set(e,a);for(const s of e)a.add(zn(s,void 0,r,i,o));return a}if(Od(e))return e.subarray();if(Rd(e)){const a=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,a);for(let s=0;s<e.length;s++)a[s]=zn(e[s],s,r,i,o);return a}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const a=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,a),Ai(a,e,r,i,o),a}if(typeof File<"u"&&e instanceof File){const a=new File([e],e.name,{type:e.type});return i.set(e,a),Ai(a,e,r,i,o),a}if(typeof Blob<"u"&&e instanceof Blob){const a=new Blob([e],{type:e.type});return i.set(e,a),Ai(a,e,r,i,o),a}if(e instanceof Error){const a=structuredClone(e);return i.set(e,a),a.message=e.message,a.name=e.name,a.stack=e.stack,a.cause=e.cause,a.constructor=e.constructor,Ai(a,e,r,i,o),a}if(e instanceof Boolean){const a=new Boolean(e.valueOf());return i.set(e,a),Ai(a,e,r,i,o),a}if(e instanceof Number){const a=new Number(e.valueOf());return i.set(e,a),Ai(a,e,r,i,o),a}if(e instanceof String){const a=new String(e.valueOf());return i.set(e,a),Ai(a,e,r,i,o),a}if(typeof e=="object"&<(e)){const a=Object.create(Object.getPrototypeOf(e));return i.set(e,a),Ai(a,e,r,i,o),a}return e}function Ai(e,t,r=e,i,o){const n=[...Object.keys(t),...Ry(t)];for(let a=0;a<n.length;a++){const s=n[a],l=Object.getOwnPropertyDescriptor(e,s);(l==null||l.writable)&&(e[s]=zn(t[s],s,r,i,o))}}function LT(e){switch(Pd(e)){case zy:case fT:case gT:case mT:case qy:case hT:case vT:case _T:case wT:case kT:case ST:case dT:case Ny:case pT:case lT:case uT:case Dy:case cT:case yT:case xT:case bT:case CT:return!0;default:return!1}}function AT(e,t){return BT(e,(r,i,o,n)=>{if(typeof e=="object"){if(Pd(e)==="[object Object]"&&typeof e.constructor!="function"){const a={};return n.set(e,a),Ai(a,e,o,n),a}switch(Object.prototype.toString.call(e)){case Ny:case Dy:case qy:{const a=new e.constructor(e?.valueOf());return Ai(a,e),a}case zy:{const a={};return Ai(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function jf(e){return AT(e)}function Rh(e){return e!==null&&typeof e=="object"&&Pd(e)==="[object Arguments]"}function Dh(e){return typeof e=="object"&&e!==null}function FT(e){return Dh(e)&&Wy(e)}function il(e){return Rd(e)}function $T(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function vs(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],n=r.cache;if(n.has(o))return n.get(o);const a=e.apply(this,i);return r.cache=n.set(o,a)||n,a};return r.cache=new(vs.Cache||Map),r}vs.Cache=Map;function ET(e){if(Id(e))return e;if(Array.isArray(e)||Rd(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 PT(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let n=0;n<r.length;n++){const a=r[n];o=ol(o,a,i,new Map)}return o}function ol(e,t,r,i){if(Id(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return ET(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let n=0;n<t.length;n++)n in t||(t[n]=void 0)}const o=[...Object.keys(t),...Ry(t)];for(let n=0;n<o.length;n++){const a=o[n];if(MT(a))continue;let s=t[a],l=e[a];if(Rh(s)&&(s={...s}),Rh(l)&&(l={...l}),Od(s)&&(s=jf(s)),Array.isArray(s))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(FT(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,s,a,e,t,i);c!==void 0?e[a]=c:Array.isArray(s)||Dh(l)&&Dh(s)&&(_c(l)||_c(s)||il(l)||il(s))?e[a]=ol(l,s,r,i):l==null&&_c(s)?e[a]=ol({},s,r,i):l==null&&il(s)?e[a]=jf(s):(l===void 0||s!==void 0)&&(e[a]=s)}return e}function OT(e,...t){return PT(e,...t,sT)}function Gf(e){if(e==null)return!0;if(Wy(e))return typeof e.splice!="function"&&typeof e!="string"&&!Od(e)&&!il(e)&&!Rh(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 $T(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var IT="",RT={curveBasis:Oh,curveBasisClosed:S_,curveBasisOpen:v_,curveBumpX:fy,curveBumpY:gy,curveBundle:__,curveCardinalClosed:T_,curveCardinalOpen:M_,curveCardinal:xy,curveCatmullRomClosed:B_,curveCatmullRomOpen:L_,curveCatmullRom:Cy,curveLinear:ts,curveLinearClosed:A_,curveMonotoneX:Ty,curveMonotoneY:My,curveNatural:Ly,curveStep:Ay,curveStepAfter:$y,curveStepBefore:Fy},DT=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,NT=w(function(e,t){const r=Hy(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const a=r.map(s=>s.args);fl(a),i=qr(i,[...a])}else i=r.args;if(!i)return;let o=md(e,t);const n="config";return i[n]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[n],delete i[n]),i},"detectInit"),Hy=w(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${DT.source})(?=[}][%]{2}).*
|
|
127
|
-
`,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),pt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=Ja.exec(e))!==null;)if(i.index===Ja.lastIndex&&Ja.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const n=i[1]?i[1]:i[2],a=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:n,args:a})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return pt.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),qT=w(function(e){return e.replace(Ja,"")},"removeDirectives"),zT=w(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Dd(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return RT[r]??t}w(Dd,"interpolateToCurve");function Yy(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?aT.sanitizeUrl(r):r}w(Yy,"formatUrl");var WT=w((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let n=window;for(let a=0;a<i;a++)if(n=n[r[a]],!n){pt.error(`Function name: ${e} not found in window`);return}n[o](...t)},"runFunc");function Nd(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}w(Nd,"distance");function Xy(e){let t,r=0;e.forEach(o=>{r+=Nd(o,t),t=o});const i=r/2;return qd(e,i)}w(Xy,"traverseEdge");function jy(e){return e.length===1?e[0]:Xy(e)}w(jy,"calcLabelPosition");var Uf=w((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),qd=w((e,t)=>{let r,i=t;for(const o of e){if(r){const n=Nd(o,r);if(n===0)return r;if(n<i)i-=n;else{const a=i/n;if(a<=0)return r;if(a>=1)return{x:o.x,y:o.y};if(a>0&&a<1)return{x:Uf((1-a)*r.x+a*o.x,5),y:Uf((1-a)*r.y+a*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),HT=w((e,t,r)=>{pt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=qd(t,25),n=e?10:5,a=Math.atan2(t[0].y-o.y,t[0].x-o.x),s={x:0,y:0};return s.x=Math.sin(a)*n+(t[0].x+o.x)/2,s.y=-Math.cos(a)*n+(t[0].y+o.y)/2,s},"calcCardinalityPosition");function Gy(e,t,r){const i=structuredClone(r);pt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,n=qd(i,o),a=10+e*.5,s=Math.atan2(i[0].y-n.y,i[0].x-n.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(s+Math.PI)*a+(i[0].x+n.x)/2,l.y=-Math.cos(s+Math.PI)*a+(i[0].y+n.y)/2):t==="end_right"?(l.x=Math.sin(s-Math.PI)*a+(i[0].x+n.x)/2-5,l.y=-Math.cos(s-Math.PI)*a+(i[0].y+n.y)/2-5):t==="end_left"?(l.x=Math.sin(s)*a+(i[0].x+n.x)/2-5,l.y=-Math.cos(s)*a+(i[0].y+n.y)/2-5):(l.x=Math.sin(s)*a+(i[0].x+n.x)/2,l.y=-Math.cos(s)*a+(i[0].y+n.y)/2),l}w(Gy,"calcTerminalLabelPosition");function Uy(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}}w(Uy,"getStylesFromArray");var Vf=0,YT=w(()=>(Vf++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Vf),"generateId");function Vy(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}w(Vy,"makeRandomHex");var XT=w(e=>Vy(e.length),"random"),jT=w(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"),GT=w(function(e,t){const r=t.text.replace(Cs.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 n=o.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.attr("fill",t.fill),n.text(r),o},"drawSimpleText"),UT=vs((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),Cs.lineBreakRegex.test(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let n="";return i.forEach((a,s)=>{const l=vo(`${a} `,r),c=vo(n,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=VT(a,t,"-",r);o.push(n,...u),n=f}else c+l>=t?(o.push(n),n=a):n=[n,a].filter(Boolean).join(" ");s+1===i.length&&o.push(n)}),o.filter(a=>a!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),VT=vs((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],n=[];let a="";return o.forEach((s,l)=>{const c=`${a}${s}`;if(vo(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;n.push(u?c:f),a=""}else a=c}),{hyphenatedStrings:n,remainingWord:a}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Zy(e,t){return zd(e,t).height}w(Zy,"calculateTextHeight");function vo(e,t){return zd(e,t).width}w(vo,"calculateTextWidth");var zd=vs((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,n]=Gl(r),a=["sans-serif",i],s=e.split(Cs.lineBreakRegex),l=[],c=He("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of a){let f=0;const p={width:0,height:0,lineHeight:0};for(const g of s){const m=jT();m.text=g||IT;const y=GT(h,m).style("font-size",n).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}`),sa,ZT=(sa=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},w(sa,"InitIDGenerator"),sa),Es,KT=w(function(e){return Es=Es||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Es.innerHTML=e,unescape(Es.textContent)},"entityDecode");function Wd(e){return"str"in e}w(Wd,"isDetailedError");var QT=w((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=w(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 Hd(e,t){return OT({},e,t)}w(Hd,"cleanAndMerge");var Ur={assignWithDepth:qr,wrapLabel:UT,calculateTextHeight:Zy,calculateTextWidth:vo,calculateTextDimensions:zd,cleanAndMerge:Hd,detectInit:NT,detectDirective:Hy,isSubstringInArray:zT,interpolateToCurve:Dd,calcLabelPosition:jy,calcCardinalityPosition:HT,calcTerminalLabelPosition:Gy,formatUrl:Yy,getStylesFromArray:Uy,generateId:YT,random:XT,runFunc:WT,entityDecode:KT,insertTitle:QT,isLabelCoordinateInPath:Ky,parseFontSize:Gl,InitIDGenerator:ZT},JT=w(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"),Uo=w(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),C6=w((e,t,{counter:r=0,prefix:i,suffix:o},n)=>n||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Rr(e){return e??null}w(Rr,"handleUndefinedAttr");function Ky(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,n=>Math.round(parseFloat(n)).toString());return o.includes(r.toString())||o.includes(i.toString())}w(Ky,"isLabelCoordinateInPath");var nl={exports:{}},Zf=nl.exports,Kf;function tM(){return Kf||(Kf=1,(function(e){(function(t){var r=function(){},i=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function o(){var h=this;h.reads=[],h.writes=[],h.raf=i.bind(t)}o.prototype={constructor:o,runTasks:function(h){for(var d;d=h.shift();)d()},measure:function(h,d){var u=d?h.bind(d):h;return this.reads.push(u),n(this),u},mutate:function(h,d){var u=d?h.bind(d):h;return this.writes.push(u),n(this),u},clear:function(h){return s(this.reads,h)||s(this.writes,h)},extend:function(h){if(typeof h!="object")throw new Error("expected object");var d=Object.create(this);return l(d,h),d.fastdom=this,d.initialize&&d.initialize(),d},catch:null};function n(h){h.scheduled||(h.scheduled=!0,h.raf(a.bind(null,h)))}function a(h){var d=h.writes,u=h.reads,f;try{r("flushing reads",u.length),h.runTasks(u),r("flushing writes",d.length),h.runTasks(d)}catch(p){f=p}if(h.scheduled=!1,(u.length||d.length)&&n(h),f)if(r("task errored",f.message),h.catch)h.catch(f);else throw f}function s(h,d){var u=h.indexOf(d);return!!~u&&!!h.splice(u,1)}function l(h,d){for(var u in d)d.hasOwnProperty(u)&&(h[u]=d[u])}var c=t.fastdom=t.fastdom||new o;e.exports=c})(typeof window<"u"?window:typeof Zf<"u"?Zf:globalThis)})(nl)),nl.exports}var eM=tM();const rM=fd(eM);var Tc={exports:{}},Qf;function iM(){return Qf||(Qf=1,(function(e){(function(){var t={initialize:function(){this._tasks=new Map},mutate:function(i,o){return r(this,"mutate",i,o)},measure:function(i,o){return r(this,"measure",i,o)},clear:function(i){var o=this._tasks,n=o.get(i);this.fastdom.clear(n),o.delete(i)}};function r(i,o,n,a){var s=i._tasks,l=i.fastdom,c,h=new Promise(function(d,u){c=l[o](function(){s.delete(h);try{d(a?n.call(a):n())}catch(f){u(f)}},a)});return s.set(h,c),h}e.exports=t})()})(Tc)),Tc.exports}var oM=iM();const nM=fd(oM);function Yd(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vn=Yd();function Qy(e){vn=e}var es={exec:()=>null};function cr(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,n)=>{let a=typeof n=="string"?n:n.source;return a=a.replace(ei.caret,"$1"),r=r.replace(o,a),i},getRegex:()=>new RegExp(r,t)};return i}var aM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ei={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")},sM=/^(?:[ \t]*(?:\n|$))+/,lM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_s=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xd=/(?:[*+-]|\d{1,9}[.)])/,Jy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tx=cr(Jy).replace(/bull/g,Xd).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(),dM=cr(Jy).replace(/bull/g,Xd).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(),jd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uM=/^[^\n]+/,Gd=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fM=cr(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gd).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gM=cr(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Xd).getRegex(),Ul="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",Ud=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,pM=cr("^ {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",Ud).replace("tag",Ul).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ex=cr(jd).replace("hr",_s).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",Ul).getRegex(),mM=cr(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ex).getRegex(),Vd={blockquote:mM,code:lM,def:fM,fences:cM,heading:hM,hr:_s,html:pM,lheading:tx,list:gM,newline:sM,paragraph:ex,table:es,text:uM},Jf=cr("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_s).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",Ul).getRegex(),yM={...Vd,lheading:dM,table:Jf,paragraph:cr(jd).replace("hr",_s).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jf).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",Ul).getRegex()},xM={...Vd,html:cr(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ud).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:es,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:cr(jd).replace("hr",_s).replace("heading",` *#{1,6} *[^
|
|
128
|
-
]`).replace("lheading",tx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,CM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rx=/^( {2,}|\\)\n(?!\s*$)/,wM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vl=/[\p{P}\p{S}]/u,Zd=/[\s\p{P}\p{S}]/u,ix=/[^\s\p{P}\p{S}]/u,kM=cr(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zd).getRegex(),ox=/(?!~)[\p{P}\p{S}]/u,SM=/(?!~)[\s\p{P}\p{S}]/u,vM=/(?:[^\s\p{P}\p{S}]|~)/u,_M=cr(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",aM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),nx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,TM=cr(nx,"u").replace(/punct/g,Vl).getRegex(),MM=cr(nx,"u").replace(/punct/g,ox).getRegex(),ax="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",BM=cr(ax,"gu").replace(/notPunctSpace/g,ix).replace(/punctSpace/g,Zd).replace(/punct/g,Vl).getRegex(),LM=cr(ax,"gu").replace(/notPunctSpace/g,vM).replace(/punctSpace/g,SM).replace(/punct/g,ox).getRegex(),AM=cr("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ix).replace(/punctSpace/g,Zd).replace(/punct/g,Vl).getRegex(),FM=cr(/\\(punct)/,"gu").replace(/punct/g,Vl).getRegex(),$M=cr(/^<(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(),EM=cr(Ud).replace("(?:-->|$)","-->").getRegex(),PM=cr("^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",EM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Bl=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,OM=cr(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Bl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sx=cr(/^!?\[(label)\]\[(ref)\]/).replace("label",Bl).replace("ref",Gd).getRegex(),lx=cr(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gd).getRegex(),IM=cr("reflink|nolink(?!\\()","g").replace("reflink",sx).replace("nolink",lx).getRegex(),tg=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Kd={_backpedal:es,anyPunctuation:FM,autolink:$M,blockSkip:_M,br:rx,code:CM,del:es,emStrongLDelim:TM,emStrongRDelimAst:BM,emStrongRDelimUnd:AM,escape:bM,link:OM,nolink:lx,punctuation:kM,reflink:sx,reflinkSearch:IM,tag:PM,text:wM,url:es},RM={...Kd,link:cr(/^!?\[(label)\]\((.*?)\)/).replace("label",Bl).getRegex(),reflink:cr(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bl).getRegex()},Nh={...Kd,emStrongRDelimAst:LM,emStrongLDelim:MM,url:cr(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",tg).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:cr(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",tg).getRegex()},DM={...Nh,br:cr(rx).replace("{2,}","*").getRegex(),text:cr(Nh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ps={normal:Vd,gfm:yM,pedantic:xM},Aa={normal:Kd,gfm:Nh,breaks:DM,pedantic:RM},NM={"&":"&","<":"<",">":">",'"':""","'":"'"},eg=e=>NM[e];function Xi(e,t){if(t){if(ei.escapeTest.test(e))return e.replace(ei.escapeReplace,eg)}else if(ei.escapeTestNoEncode.test(e))return e.replace(ei.escapeReplaceNoEncode,eg);return e}function rg(e){try{e=encodeURI(e).replace(ei.percentDecode,"%")}catch{return null}return e}function ig(e,t){let r=e.replace(ei.findPipe,(n,a,s)=>{let l=!1,c=a;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(ei.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(ei.slashPipe,"|");return i}function Fa(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 qM(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 og(e,t,r,i,o){let n=t.href,a=t.title||null,s=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:n,title:a,text:s,tokens:i.inlineTokens(s)};return i.state.inLink=!1,l}function zM(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
|
|
129
|
-
`).map(n=>{let a=n.match(r.other.beginningSpace);if(a===null)return n;let[s]=a;return s.length>=o.length?n.slice(o.length):n}).join(`
|
|
130
|
-
`)}var Ll=class{constructor(t){pr(this,"options");pr(this,"rules");pr(this,"lexer");this.options=t||vn}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:Fa(i,`
|
|
131
|
-
`)}}}fences(t){let r=this.rules.block.fences.exec(t);if(r){let i=r[0],o=zM(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=Fa(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:Fa(r[0],`
|
|
132
|
-
`)}}blockquote(t){let r=this.rules.block.blockquote.exec(t);if(r){let i=Fa(r[0],`
|
|
133
|
-
`).split(`
|
|
134
|
-
`),o="",n="",a=[];for(;i.length>0;){let s=!1,l=[],c;for(c=0;c<i.length;c++)if(this.rules.other.blockquoteStart.test(i[c]))l.push(i[c]),s=!0;else if(!s)l.push(i[c]);else break;i=i.slice(c);let h=l.join(`
|
|
135
|
-
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
136
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
137
|
-
${h}`:h,n=n?`${n}
|
|
138
|
-
${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=u,i.length===0)break;let f=a.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let p=f,g=p.raw+`
|
|
139
|
-
`+i.join(`
|
|
140
|
-
`),m=this.blockquote(g);a[a.length-1]=m,o=o.substring(0,o.length-p.raw.length)+m.raw,n=n.substring(0,n.length-p.text.length)+m.text;break}else if(f?.type==="list"){let p=f,g=p.raw+`
|
|
141
|
-
`+i.join(`
|
|
142
|
-
`),m=this.list(g);a[a.length-1]=m,o=o.substring(0,o.length-f.raw.length)+m.raw,n=n.substring(0,n.length-p.raw.length)+m.raw,i=g.substring(a.at(-1).raw.length).split(`
|
|
143
|
-
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:n}}}list(t){let r=this.rules.block.list.exec(t);if(r){let i=r[1].trim(),o=i.length>1,n={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 a=this.rules.other.listItemRegex(i),s=!1;for(;t;){let c=!1,h="",d="";if(!(r=a.exec(t))||this.rules.block.hr.test(t))break;h=r[0],t=t.substring(h.length);let u=r[2].split(`
|
|
144
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),f=t.split(`
|
|
145
|
-
`,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+`
|
|
146
|
-
`,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),T=this.rules.other.htmlBeginRegex(g);for(;t;){let L=t.split(`
|
|
147
|
-
`,1)[0],A;if(f=L,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),A=f):A=f.replace(this.rules.other.tabCharGlobal," "),k.test(f)||v.test(f)||T.test(f)||x.test(f)||C.test(f))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!f.trim())d+=`
|
|
148
|
-
`+A.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+=`
|
|
149
|
-
`+f}!p&&!f.trim()&&(p=!0),h+=L+`
|
|
150
|
-
`,t=t.substring(L.length+1),u=A.slice(g)}}n.loose||(s?n.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!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,""))),n.items.push({type:"list_item",raw:h,task:!!m,checked:y,loose:!1,text:d,tokens:[]}),n.raw+=h}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let h=n.items[c].tokens.filter(u=>u.type==="space"),d=h.length>0&&h.some(u=>this.rules.other.anyLine.test(u.raw));n.loose=d}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}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"):"",n=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:n}}}table(t){let r=this.rules.block.table.exec(t);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;let i=ig(r[1]),o=r[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
151
|
-
`):[],a={type:"table",raw:r[0],header:[],align:[],rows:[]};if(i.length===o.length){for(let s of o)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<i.length;s++)a.header.push({text:i[s],tokens:this.lexer.inline(i[s]),header:!0,align:a.align[s]});for(let s of n)a.rows.push(ig(s,a.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[c]})));return a}}lheading(t){let r=this.rules.block.lheading.exec(t);if(r)return{type:"heading",raw:r[0],depth:r[2].charAt(0)==="="?1:2,text:r[1],tokens:this.lexer.inline(r[1])}}paragraph(t){let r=this.rules.block.paragraph.exec(t);if(r){let i=r[1].charAt(r[1].length-1)===`
|
|
152
|
-
`?r[1].slice(0,-1):r[1];return{type:"paragraph",raw:r[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let r=this.rules.block.text.exec(t);if(r)return{type:"text",raw:r[0],text:r[0],tokens:this.lexer.inline(r[0])}}escape(t){let r=this.rules.inline.escape.exec(t);if(r)return{type:"escape",raw:r[0],text:r[1]}}tag(t){let r=this.rules.inline.tag.exec(t);if(r)return!this.lexer.state.inLink&&this.rules.other.startATag.test(r[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(r[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(r[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(r[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:r[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:r[0]}}link(t){let r=this.rules.inline.link.exec(t);if(r){let i=r[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let a=Fa(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{let a=qM(r[2],"()");if(a===-2)return;if(a>-1){let s=(r[0].indexOf("!")===0?5:4)+r[1].length+a;r[2]=r[2].substring(0,a),r[0]=r[0].substring(0,s).trim(),r[3]=""}}let o=r[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],n=a[3])}else n=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)),og(r,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.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," "),n=r[o.toLowerCase()];if(!n){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return og(i,n,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 n=[...o[0]].length-1,a,s,l=n,c=0,h=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,r=r.slice(-1*t.length+n);(o=h.exec(r))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(s=[...a].length,o[3]||o[4]){l+=s;continue}else if((o[5]||o[6])&&n%3&&!((n+s)%3)){c+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+c);let d=[...o[0]][0].length,u=t.slice(0,n+o.index+d+s);if(Math.min(n,s)%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),n=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&n&&(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 n;do n=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])?.[0]??"";while(n!==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}}}},Fi=class qh{constructor(t){pr(this,"tokens");pr(this,"options");pr(this,"state");pr(this,"tokenizer");pr(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||vn,this.options.tokenizer=this.options.tokenizer||new Ll,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:ei,block:Ps.normal,inline:Aa.normal};this.options.pedantic?(r.block=Ps.pedantic,r.inline=Aa.pedantic):this.options.gfm&&(r.block=Ps.gfm,this.options.breaks?r.inline=Aa.breaks:r.inline=Aa.gfm),this.tokenizer.rules=r}static get rules(){return{block:Ps,inline:Aa}}static lex(t,r){return new qh(r).lex(t)}static lexInline(t,r){return new qh(r).inlineTokens(t)}lex(t){t=t.replace(ei.carriageReturn,`
|
|
153
|
-
`),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(ei.tabCharGlobal," ").replace(ei.spaceLine,""));t;){let o;if(this.options.extensions?.block?.some(a=>(o=a.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 a=r.at(-1);o.raw.length===1&&a!==void 0?a.raw+=`
|
|
154
|
-
`:r.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
155
|
-
`)?"":`
|
|
156
|
-
`)+o.raw,a.text+=`
|
|
157
|
-
`+o.text,this.inlineQueue.at(-1).src=a.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 a=r.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
158
|
-
`)?"":`
|
|
159
|
-
`)+o.raw,a.text+=`
|
|
160
|
-
`+o.raw,this.inlineQueue.at(-1).src=a.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 n=t;if(this.options.extensions?.startBlock){let a=1/0,s=t.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},s),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(n=t.substring(0,a+1))}if(this.state.top&&(o=this.tokenizer.paragraph(n))){let a=r.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
|
|
161
|
-
`)?"":`
|
|
162
|
-
`)+o.raw,a.text+=`
|
|
163
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o),i=n.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let a=r.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
|
|
164
|
-
`)?"":`
|
|
165
|
-
`)+o.raw,a.text+=`
|
|
166
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(o);continue}if(t){let a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}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 n;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)n=o[2]?o[2].length:0,i=i.slice(0,o.index+n)+"["+"a".repeat(o[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let a=!1,s="";for(;t;){a||(s=""),a=!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,s)){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)!=="_"&&(s=l.raw.slice(-1)),a=!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}},Al=class{constructor(t){pr(this,"options");pr(this,"parser");this.options=t||vn}space(t){return""}code({text:t,lang:r,escaped:i}){let o=(r||"").match(ei.notSpaceStart)?.[0],n=t.replace(ei.endingNewline,"")+`
|
|
167
|
-
`;return o?'<pre><code class="language-'+Xi(o)+'">'+(i?n:Xi(n,!0))+`</code></pre>
|
|
168
|
-
`:"<pre><code>"+(i?n:Xi(n,!0))+`</code></pre>
|
|
169
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
170
|
-
${this.parser.parse(t)}</blockquote>
|
|
171
|
-
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:r}){return`<h${r}>${this.parser.parseInline(t)}</h${r}>
|
|
172
|
-
`}hr(t){return`<hr>
|
|
173
|
-
`}list(t){let r=t.ordered,i=t.start,o="";for(let s=0;s<t.items.length;s++){let l=t.items[s];o+=this.listitem(l)}let n=r?"ol":"ul",a=r&&i!==1?' start="'+i+'"':"";return"<"+n+a+`>
|
|
174
|
-
`+o+"</"+n+`>
|
|
175
|
-
`}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+" "+Xi(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>
|
|
176
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
177
|
-
`}table(t){let r="",i="";for(let n=0;n<t.header.length;n++)i+=this.tablecell(t.header[n]);r+=this.tablerow({text:i});let o="";for(let n=0;n<t.rows.length;n++){let a=t.rows[n];i="";for(let s=0;s<a.length;s++)i+=this.tablecell(a[s]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
178
|
-
<thead>
|
|
179
|
-
`+r+`</thead>
|
|
180
|
-
`+o+`</table>
|
|
181
|
-
`}tablerow({text:t}){return`<tr>
|
|
182
|
-
${t}</tr>
|
|
183
|
-
`}tablecell(t){let r=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+r+`</${i}>
|
|
184
|
-
`}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>${Xi(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),n=rg(t);if(n===null)return o;t=n;let a='<a href="'+t+'"';return r&&(a+=' title="'+Xi(r)+'"'),a+=">"+o+"</a>",a}image({href:t,title:r,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));let n=rg(t);if(n===null)return Xi(i);t=n;let a=`<img src="${t}" alt="${i}"`;return r&&(a+=` title="${Xi(r)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Xi(t.text)}},Qd=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""}},$i=class zh{constructor(t){pr(this,"options");pr(this,"renderer");pr(this,"textRenderer");this.options=t||vn,this.options.renderer=this.options.renderer||new Al,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qd}static parse(t,r){return new zh(r).parse(t)}static parseInline(t,r){return new zh(r).parseInline(t)}parse(t,r=!0){let i="";for(let o=0;o<t.length;o++){let n=t[o];if(this.options.extensions?.renderers?.[n.type]){let s=n,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){i+=l||"";continue}}let a=n;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let s=a,l=this.renderer.text(s);for(;o+1<t.length&&t[o+1].type==="text";)s=t[++o],l+=`
|
|
185
|
-
`+this.renderer.text(s);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 s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}parseInline(t,r=this.renderer){let i="";for(let o=0;o<t.length;o++){let n=t[o];if(this.options.extensions?.renderers?.[n.type]){let s=this.options.extensions.renderers[n.type].call({parser:this},n);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=s||"";continue}}let a=n;switch(a.type){case"escape":{i+=r.text(a);break}case"html":{i+=r.html(a);break}case"link":{i+=r.link(a);break}case"image":{i+=r.image(a);break}case"strong":{i+=r.strong(a);break}case"em":{i+=r.em(a);break}case"codespan":{i+=r.codespan(a);break}case"br":{i+=r.br(a);break}case"del":{i+=r.del(a);break}case"text":{i+=r.text(a);break}default:{let s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},Us,Wa=(Us=class{constructor(t){pr(this,"options");pr(this,"block");this.options=t||vn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?Fi.lex:Fi.lexInline}provideParser(){return this.block?$i.parse:$i.parseInline}},pr(Us,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),pr(Us,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Us),WM=class{constructor(...t){pr(this,"defaults",Yd());pr(this,"options",this.setOptions);pr(this,"parse",this.parseMarkdown(!0));pr(this,"parseInline",this.parseMarkdown(!1));pr(this,"Parser",$i);pr(this,"Renderer",Al);pr(this,"TextRenderer",Qd);pr(this,"Lexer",Fi);pr(this,"Tokenizer",Ll);pr(this,"Hooks",Wa);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 n=o;for(let a of n.header)i=i.concat(this.walkTokens(a.tokens,r));for(let a of n.rows)for(let s of a)i=i.concat(this.walkTokens(s.tokens,r));break}case"list":{let n=o;i=i.concat(this.walkTokens(n.items,r));break}default:{let n=o;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let s=n[a].flat(1/0);i=i.concat(this.walkTokens(s,r))}):n.tokens&&(i=i.concat(this.walkTokens(n.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(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=r.renderers[n.name];a?r.renderers[n.name]=function(...s){let l=n.renderer.apply(this,s);return l===!1&&(l=a.apply(this,s)),l}:r.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=r[n.level];a?a.unshift(n.tokenizer):r[n.level]=[n.tokenizer],n.start&&(n.level==="block"?r.startBlock?r.startBlock.push(n.start):r.startBlock=[n.start]:n.level==="inline"&&(r.startInline?r.startInline.push(n.start):r.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(r.childTokens[n.name]=n.childTokens)}),o.extensions=r),i.renderer){let n=this.defaults.renderer||new Al(this.defaults);for(let a in i.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,l=i.renderer[s],c=n[s];n[s]=(...h)=>{let d=l.apply(n,h);return d===!1&&(d=c.apply(n,h)),d||""}}o.renderer=n}if(i.tokenizer){let n=this.defaults.tokenizer||new Ll(this.defaults);for(let a in i.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,l=i.tokenizer[s],c=n[s];n[s]=(...h)=>{let d=l.apply(n,h);return d===!1&&(d=c.apply(n,h)),d}}o.tokenizer=n}if(i.hooks){let n=this.defaults.hooks||new Wa;for(let a in i.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,l=i.hooks[s],c=n[s];Wa.passThroughHooks.has(a)?n[s]=h=>{if(this.defaults.async&&Wa.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await l.call(n,h);return c.call(n,u)})();let d=l.call(n,h);return c.call(n,d)}:n[s]=(...h)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(n,h);return u===!1&&(u=await c.apply(n,h)),u})();let d=l.apply(n,h);return d===!1&&(d=c.apply(n,h)),d}}o.hooks=n}if(i.walkTokens){let n=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(s){let l=[];return l.push(a.call(this,s)),n&&(l=l.concat(n.call(this,s))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return Fi.lex(t,r??this.defaults)}parser(t,r){return $i.parse(t,r??this.defaults)}parseMarkdown(t){return(r,i)=>{let o={...i},n={...this.defaults,...o},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&o.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let s=n.hooks?await n.hooks.preprocess(r):r,l=await(n.hooks?await n.hooks.provideLexer():t?Fi.lex:Fi.lexInline)(s,n),c=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let h=await(n.hooks?await n.hooks.provideParser():t?$i.parse:$i.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(h):h})().catch(a);try{n.hooks&&(r=n.hooks.preprocess(r));let s=(n.hooks?n.hooks.provideLexer():t?Fi.lex:Fi.lexInline)(r,n);n.hooks&&(s=n.hooks.processAllTokens(s)),n.walkTokens&&this.walkTokens(s,n.walkTokens);let l=(n.hooks?n.hooks.provideParser():t?$i.parse:$i.parseInline)(s,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(s){return a(s)}}}onError(t,r){return i=>{if(i.message+=`
|
|
186
|
-
Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+Xi(i.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(i);throw i}}},xn=new WM;function hr(e,t){return xn.parse(e,t)}hr.options=hr.setOptions=function(e){return xn.setOptions(e),hr.defaults=xn.defaults,Qy(hr.defaults),hr};hr.getDefaults=Yd;hr.defaults=vn;hr.use=function(...e){return xn.use(...e),hr.defaults=xn.defaults,Qy(hr.defaults),hr};hr.walkTokens=function(e,t){return xn.walkTokens(e,t)};hr.parseInline=xn.parseInline;hr.Parser=$i;hr.parser=$i.parse;hr.Renderer=Al;hr.TextRenderer=Qd;hr.Lexer=Fi;hr.lexer=Fi.lex;hr.Tokenizer=Ll;hr.Hooks=Wa;hr.parse=hr;hr.options;hr.setOptions;hr.use;hr.walkTokens;hr.parseInline;$i.parse;Fi.lex;function cx(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(s,l){var c=l.match(/\n([\t ]+|(?!\s).)/g);return c?s.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})):s},[]);if(o.length){var n=new RegExp(`
|
|
187
|
-
[ ]{`.concat(Math.min.apply(Math,o),"}"),"g");i=i.map(function(s){return s.replace(n,`
|
|
188
|
-
`)})}i[0]=i[0].replace(/^\r?\n/,"");var a=i[0];return t.forEach(function(s,l){var c=a.match(/(?:^|\n)( *)$/),h=c?c[1]:"",d=s;typeof s=="string"&&s.includes(`
|
|
189
|
-
`)&&(d=String(s).split(`
|
|
190
|
-
`).map(function(u,f){return f===0?u:"".concat(h).concat(u)}).join(`
|
|
191
|
-
`)),a+=d+i[l+1]}),a}var Wh=typeof performance<"u"&&typeof performance.now=="function",$n=w(()=>Wh?performance.now():0,"now"),Mc="🧜 ",HM="Mermaid render",YM="Mermaid",XM={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},la;la=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=$n();try{return r()}finally{this.buckets[t]=(this.buckets[t]??0)+($n()-i)}}async tick(t,r){if(!this.enabled)return r();const i=$n();try{return await r()}finally{this.buckets[t]=(this.buckets[t]??0)+($n()-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:$n(),duration:-1,children:[]},i=this.stack.at(-1);if(i?i.children.push(r):this.roots.push(r),this.stack.push(r),Wh&&typeof performance.mark=="function")try{performance.mark(`${Mc}${t} ▶`)}catch{}}end(){if(!this.enabled)return;const t=this.stack.pop();if(!t)return;const r=$n();if(t.duration=r-t.start,Wh&&typeof performance.measure=="function")try{performance.measure(`${Mc}${t.name}`,{start:t.start,end:r,detail:{devtools:{dataType:"track-entry",track:HM,trackGroup:YM,color:XM[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,n=["ms % phase"],a=w((l,c)=>{const h=" ".repeat(c),d=l.duration.toFixed(1).padStart(8),u=i>0?`${(l.duration/i*100).toFixed(0).padStart(3)}%`:" -";n.push(`${d} ${u} ${h}${l.name}`);for(const f of l.children)a(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);n.push(`${g} ${h} (self)`)}}},"walk");a(t,0);const s=Object.keys(this.buckets);if(s.length>0){n.push("—— buckets (summed) ——");for(const l of s)n.push(`${this.buckets[l].toFixed(1).padStart(8)} ${l}`)}console.log(`${Mc}mermaid render profile · ${o}
|
|
192
|
-
${n.join(`
|
|
193
|
-
`)}`)}},w(la,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var jM=rM.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(nM),bn=jM;function hx(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
|
|
194
|
-
`).replace(/\n{2,}/g,`
|
|
195
|
-
`);return cx(i)}w(hx,"preprocessMarkdown");function dx(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}w(dx,"nonMarkdownToLines");function ux(e,t={}){const r=hx(e,t),i=hr.lexer(r),o=[[]];let n=0;function a(s,l="normal"){s.type==="text"?s.text.split(`
|
|
196
|
-
`).forEach((h,d)=>{d!==0&&(n++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/'/g,"'"),u&&o[n].push({content:u,type:l})})}):s.type==="strong"||s.type==="em"?s.tokens.forEach(c=>{a(c,s.type)}):s.type==="html"&&o[n].push({content:s.text,type:"normal"})}return w(a,"processNode"),i.forEach(s=>{s.type==="paragraph"?s.tokens?.forEach(l=>{a(l)}):s.type==="html"?o[n].push({content:s.text,type:"normal"}):o[n].push({content:s.raw,type:"normal"})}),o}w(ux,"markdownToLines");function fx(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}w(fx,"nonMarkdownToHTML");function gx(e,{markdownAutoWrap:t}={}){const r=hr.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g," "):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:(pt.warn(`Unsupported markdown: ${o.type}`),o.raw)}return w(i,"output"),r.map(i).join("")}w(gx,"markdownToHTML");function px(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}w(px,"splitTextToChars");function mx(e,t){const r=px(t.content);return Jd(e,[],r,t.type)}w(mx,"splitWordToFitWidth");function Jd(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...n]=r,a=[...t,o];return e([{content:a.join(""),type:i}])?Jd(e,a,n,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}w(Jd,"splitWordToFitWidthRecursion");function yx(e,t){if(e.some(({content:r})=>r.includes(`
|
|
197
|
-
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Fl(e,t)}w(yx,"splitLineToFitWidth");function Fl(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 n=e.shift()??{content:" ",type:"normal"},a=[...i];if(o!==""&&a.push({content:o,type:"normal"}),a.push(n),t(a))return Fl(e,t,r,a);if(i.length>0)r.push(i),e.unshift(n);else if(n.content){const[s,l]=mx(t,n);r.push([s]),l.content&&e.unshift(l)}return Fl(e,t,r)}w(Fl,"splitLineToFitWidthRecursion");function Hh(e,t){t&&e.attr("style",t)}w(Hh,"applyStyle");var ng=16384;async function xx(e,t,r,i,o=!1,n=Br()){const a=e.append("foreignObject");a.attr("width",`${Math.min(10*r,ng)}px`),a.attr("height",`${Math.min(10*r,ng)}px`);const s=a.append("xhtml:div"),l=ns(t.label)?await Om(t.label.replace(Cs.lineBreakRegex,`
|
|
198
|
-
`),n):vi(t.label,n),c=t.isNode?"nodeLabel":"edgeLabel",h=s.append("span");return h.html(l),Hh(h,t.labelStyle),h.attr("class",`${c} ${i}`),Hh(s,t.labelStyle),s.style("display","table-cell"),s.style("white-space","nowrap"),s.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(s.style("max-width",r+"px"),s.style("text-align","center")),s.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&s.attr("class","labelBkg"),(await bn.measure(()=>s.node().getBoundingClientRect())).width===r&&(s.style("display","table"),s.style("white-space","break-spaces"),s.style("width",r+"px")),a.node()}w(xx,"addHtmlSpan");function Zl(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}w(Zl,"createTspan");function bx(e,t,r){const i=e.append("text"),o=Zl(i,1,t);Kl(o,r);const n=o.node().getComputedTextLength();return i.remove(),n}w(bx,"computeWidthOfText");function GM(e,t,r){const i=e.append("text"),o=Zl(i,1,t);Kl(o,[{content:r,type:"normal"}]);const n=o.node()?.getBoundingClientRect();return n&&i.remove(),n}w(GM,"computeDimensionOfText");function Cx(e,t,r,i=!1,o=!1){const a=t.append("g"),s=a.insert("rect").attr("class","background").attr("style","stroke: none"),l=a.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=w(f=>bx(a,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:yx(h,d);for(const f of u){const p=Zl(l,c,1.1,o);Kl(p,f),c++}}if(i){const h=l.node().getBBox(),d=2;return s.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),a.node()}else return l.node()}w(Cx,"createFormattedText");function Yh(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}})}w(Yh,"decodeHTMLEntities");function Kl(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(Yh(r.content)):o.text(" "+Yh(r.content))})}w(Kl,"updateTextContentAndStyles");async function wx(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,n,a)=>(r.push((async()=>{const s=`${n}:${a}`;return await iT(s)?await Ss(s,void 0,{class:"label-icon"}):`<i class='${vi(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}w(wx,"replaceIconSubstring");var Ni=w(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:n=!0,markdown:a=!0,isNode:s=!0,width:l=200,addSvgBackground:c=!1}={},h)=>{if(pt.debug("XYZ createText",t,r,i,o,n,s,"addSvgBackground: ",c),n){const d=a?gx(t,h):fx(t),u=await wx(Uo(d),h),f=t.replace(/\\\\/g,"\\"),p={isNode:s,label:ns(t)?f:u,labelStyle:r.replace("fill:","color:")};return await xx(e,p,l,o,c,h)}else{const d=Uo(t.replace(/<br\s*\/?>/g,"<br/>")),u=a?ux(d.replace("<br>","<br/>"),h):dx(d),f=Cx(l,e,u,t?c:!1,!s);if(s){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(f).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");He(f).select("rect").attr("style",p.replace(/background:/g,"fill:"));const g=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");He(f).select("text").attr("style",g)}return i?He(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):He(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");function Bc(e,t,r){if(e&&e.length){const[i,o]=t,n=Math.PI/180*r,a=Math.cos(n),s=Math.sin(n);for(const l of e){const[c,h]=l;l[0]=(c-i)*a-(h-o)*s+i,l[1]=(c-i)*s+(h-o)*a+o}}}function UM(e,t){return e[0]===t[0]&&e[1]===t[1]}function VM(e,t,r,i=1){const o=r,n=Math.max(t,.1),a=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,s=[0,0];if(o)for(const c of a)Bc(c,s,o);const l=(function(c,h,d){const u=[];for(const x of c){const C=[...x];UM(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 T=Math.min(k[1],v[1]);p.push({ymin:T,ymax:Math.max(k[1],v[1]),x:T===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})(a,n,i);if(o){for(const c of a)Bc(c,s,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Bc(u,h,d)})(l,s,-o)}return l}function Ts(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 n=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(n=o),VM(e,o,i,n||1)}class tu{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Ts(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 Ql(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 ZM extends tu{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Ts(t,Object.assign({},r,{hachureGap:i})),n=Math.PI/180*r.hachureAngle,a=[],s=.5*i*Math.cos(n),l=.5*i*Math.sin(n);for(const[c,h]of o)Ql([c,h])&&a.push([[c[0]-s,c[1]+l],[...h]],[[c[0]+s,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(a,r)}}}class KM extends tu{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),n=this._fillPolygons(t,o);return i.ops=i.ops.concat(n.ops),i}}class QM{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ts(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 n=r.fillWeight;n<0&&(n=r.strokeWidth/2);const a=o/4;for(const s of t){const l=Ql(s),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(s[0][0]+s[1][0])/2-o/4,f=Math.min(s[0][1],s[1][1]);for(let p=0;p<h;p++){const g=f+d+p*o,m=u-a+2*Math.random()*a,y=g-a+2*Math.random()*a,x=this.helper.ellipse(m,y,n,n,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class JM{constructor(t){this.helper=t}fillPolygons(t,r){const i=Ts(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,n=[];return t.forEach((a=>{const s=Ql(a),l=Math.floor(s/(i+o)),c=(s+o-l*(i+o))/2;let h=a[0],d=a[1];h[0]>d[0]&&(h=a[1],d=a[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)];n.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],r))}})),n}}class tB{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,n=Ts(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(n,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((n=>{const a=Ql(n),s=Math.round(a/(2*r));let l=n[0],c=n[1];l[0]>c[0]&&(l=n[1],c=n[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<s;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 eB{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const rB=0,Lc=1,ag=2,Os={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 Ac(e,t){return e.type===t}function eu(e){const t=[],r=(function(a){const s=new Array;for(;a!=="";)if(a.match(/^([ \t\r\n,]+)/))a=a.substr(RegExp.$1.length);else if(a.match(/^([aAcChHlLmMqQsStTvVzZ])/))s[s.length]={type:rB,text:RegExp.$1},a=a.substr(RegExp.$1.length);else{if(!a.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];s[s.length]={type:Lc,text:`${parseFloat(RegExp.$1)}`},a=a.substr(RegExp.$1.length)}return s[s.length]={type:ag,text:""},s})(e);let i="BOD",o=0,n=r[o];for(;!Ac(n,ag);){let a=0;const s=[];if(i==="BOD"){if(n.text!=="M"&&n.text!=="m")return eu("M0,0"+e);o++,a=Os[n.text],i=n.text}else Ac(n,Lc)?a=Os[i]:(o++,a=Os[n.text],i=n.text);if(!(o+a<r.length))throw new Error("Path data ended short");for(let l=o;l<o+a;l++){const c=r[l];if(!Ac(c,Lc))throw new Error("Param not a number: "+i+","+c.text);s[s.length]=+c.text}if(typeof Os[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:s};t.push(l),o+=a,n=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function kx(e){let t=0,r=0,i=0,o=0;const n=[];for(const{key:a,data:s}of e)switch(a){case"M":n.push({key:"M",data:[...s]}),[t,r]=s,[i,o]=s;break;case"m":t+=s[0],r+=s[1],n.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":n.push({key:"L",data:[...s]}),[t,r]=s;break;case"l":t+=s[0],r+=s[1],n.push({key:"L",data:[t,r]});break;case"C":n.push({key:"C",data:[...s]}),t=s[4],r=s[5];break;case"c":{const l=s.map(((c,h)=>h%2?c+r:c+t));n.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":n.push({key:"Q",data:[...s]}),t=s[2],r=s[3];break;case"q":{const l=s.map(((c,h)=>h%2?c+r:c+t));n.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":n.push({key:"A",data:[...s]}),t=s[5],r=s[6];break;case"a":t+=s[5],r+=s[6],n.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,r]});break;case"H":n.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],n.push({key:"H",data:[t]});break;case"V":n.push({key:"V",data:[...s]}),r=s[0];break;case"v":r+=s[0],n.push({key:"V",data:[r]});break;case"S":n.push({key:"S",data:[...s]}),t=s[2],r=s[3];break;case"s":{const l=s.map(((c,h)=>h%2?c+r:c+t));n.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":n.push({key:"T",data:[...s]}),t=s[0],r=s[1];break;case"t":t+=s[0],r+=s[1],n.push({key:"T",data:[t,r]});break;case"Z":case"z":n.push({key:"Z",data:[]}),t=i,r=o}return n}function Sx(e){const t=[];let r="",i=0,o=0,n=0,a=0,s=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[n,a]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],s=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-s),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),s=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-s),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]}),s=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]}),s=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)&&(vx(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=n,o=a}r=c}return t}function $a(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function vx(e,t,r,i,o,n,a,s,l,c){const h=(d=a,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]=$a(e,t,-h),[r,i]=$a(r,i,-h);const N=(e-r)/2,F=(t-i)/2;let E=N*N/(o*o)+F*F/(n*n);E>1&&(E=Math.sqrt(E),o*=E,n*=E);const B=o*o,q=n*n,z=B*q-B*F*F-q*N*N,I=B*F*F+q*N*N,D=(s===l?-1:1)*Math.sqrt(Math.abs(z/I));g=D*o*F/n+(e+r)/2,m=D*-n*N/o+(t+i)/2,f=Math.asin(parseFloat(((t-m)/n).toFixed(9))),p=Math.asin(parseFloat(((i-m)/n).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 N=p,F=r,E=i;p=l&&p>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=vx(r=g+o*Math.cos(p),i=m+n*Math.sin(p),F,E,o,n,a,0,l,[p,N,g,m])}y=p-f;const x=Math.cos(f),C=Math.sin(f),k=Math.cos(p),v=Math.sin(p),T=Math.tan(y/4),L=4/3*o*T,A=4/3*n*T,_=[e,t],M=[e+L*C,t-A*x],$=[r+L*v,i-A*k],P=[r,i];if(M[0]=2*_[0]-M[0],M[1]=2*_[1]-M[1],c)return[M,$,P].concat(u);{u=[M,$,P].concat(u);const N=[];for(let F=0;F<u.length;F+=3){const E=$a(u[F][0],u[F][1],h),B=$a(u[F+1][0],u[F+1][1],h),q=$a(u[F+2][0],u[F+2][1],h);N.push([E[0],E[1],B[0],B[1],q[0],q[1]])}return N}}const iB={randOffset:function(e,t){return Oe(e,t)},randOffsetWithRange:function(e,t,r){return $l(e,t,r)},ellipse:function(e,t,r,i,o){const n=Tx(r,i,o);return Xh(e,t,o,n).opset},doubleLineOps:function(e,t,r,i,o){return Vo(e,t,r,i,o,!0)}};function _x(e,t,r,i,o){return{type:"path",ops:Vo(e,t,r,i,o)}}function al(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let n=0;n<i-1;n++)o.push(...Vo(e[n][0],e[n][1],e[n+1][0],e[n+1][1],r));return t&&o.push(...Vo(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?_x(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function oB(e,t,r,i,o){return(function(n,a){return al(n,!0,a)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function sg(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=Is(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:Is(r[0],1.5*(1+.22*t.roughness),hg(t));for(let n=1;n<r.length;n++){const a=r[n];if(a.length){const s=Is(a,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:Is(a,1.5*(1+.22*t.roughness),hg(t));for(const c of s)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 Tx(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)),n=2*Math.PI/o;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-r.curveFitting;return a+=Oe(a*l,r),s+=Oe(s*l,r),{increment:n,rx:a,ry:s}}function Xh(e,t,r,i){const[o,n]=dg(i.increment,e,t,i.rx,i.ry,1,i.increment*$l(.1,$l(.4,1,r),r),r);let a=El(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[s]=dg(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=El(s,null,r);a=a.concat(l)}return{estimatedPoints:n,opset:{type:"path",ops:a}}}function lg(e,t,r,i,o,n,a,s,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=Oe(.01*d,l),u+=Oe(.01*u,l);let f=o,p=n;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=ug(m,c,h,d,u,f,p,1,l);if(!l.disableMultiStroke){const x=ug(m,c,h,d,u,f,p,1.5,l);y.push(...x)}return a&&(s?y.push(...Vo(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...Vo(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 cg(e,t){const r=Sx(kx(eu(e))),i=[];let o=[0,0],n=[0,0];for(const{key:a,data:s}of r)switch(a){case"M":n=[s[0],s[1]],o=[s[0],s[1]];break;case"L":i.push(...Vo(n[0],n[1],s[0],s[1],t)),n=[s[0],s[1]];break;case"C":{const[l,c,h,d,u,f]=s;i.push(...nB(l,c,h,d,u,f,n,t)),n=[u,f];break}case"Z":i.push(...Vo(n[0],n[1],o[0],o[1],t)),n=[o[0],o[1]]}return{type:"path",ops:i}}function Fc(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,n=i.length;if(n>2){r.push({op:"move",data:[i[0][0]+Oe(o,t),i[0][1]+Oe(o,t)]});for(let a=1;a<n;a++)r.push({op:"lineTo",data:[i[a][0]+Oe(o,t),i[a][1]+Oe(o,t)]})}}return{type:"fillPath",ops:r}}function En(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!ai[o])switch(o){case"zigzag":ai[o]||(ai[o]=new ZM(i));break;case"cross-hatch":ai[o]||(ai[o]=new KM(i));break;case"dots":ai[o]||(ai[o]=new QM(i));break;case"dashed":ai[o]||(ai[o]=new JM(i));break;case"zigzag-line":ai[o]||(ai[o]=new tB(i));break;default:o="hachure",ai[o]||(ai[o]=new tu(i))}return ai[o]})(t,iB).fillPolygons(e,t)}function hg(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function Mx(e){return e.randomizer||(e.randomizer=new eB(e.seed||0)),e.randomizer.next()}function $l(e,t,r,i=1){return r.roughness*i*(Mx(r)*(t-e)+e)}function Oe(e,t,r=1){return $l(-e,e,t,r)}function Vo(e,t,r,i,o,n=!1){const a=n?o.disableMultiStrokeFill:o.disableMultiStroke,s=jh(e,t,r,i,o,!0,!1);if(a)return s;const l=jh(e,t,r,i,o,!0,!0);return s.concat(l)}function jh(e,t,r,i,o,n,a){const s=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>s&&(h=l/10);const d=h/2,u=.2+.2*Mx(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,p=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=Oe(f,o,c),p=Oe(p,o,c);const g=[],m=()=>Oe(d,o,c),y=()=>Oe(h,o,c),x=o.preserveVertices;return a?g.push({op:"move",data:[e+(x?0:m()),t+(x?0:m())]}):g.push({op:"move",data:[e+(x?0:Oe(h,o,c)),t+(x?0:Oe(h,o,c))]}),a?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 Is(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Oe(t,r),e[0][1]+Oe(t,r)]),i.push([e[0][0]+Oe(t,r),e[0][1]+Oe(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+Oe(t,r),e[o][1]+Oe(t,r)]),o===e.length-1&&i.push([e[o][0]+Oe(t,r),e[o][1]+Oe(t,r)]);return El(i,null,r)}function El(e,t,r){const i=e.length,o=[];if(i>3){const n=[],a=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let s=1;s+2<i;s++){const l=e[s];n[0]=[l[0],l[1]],n[1]=[l[0]+(a*e[s+1][0]-a*e[s-1][0])/6,l[1]+(a*e[s+1][1]-a*e[s-1][1])/6],n[2]=[e[s+1][0]+(a*e[s][0]-a*e[s+2][0])/6,e[s+1][1]+(a*e[s][1]-a*e[s+2][1])/6],n[3]=[e[s+1][0],e[s+1][1]],o.push({op:"bcurveTo",data:[n[1][0],n[1][1],n[2][0],n[2][1],n[3][0],n[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(...jh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function dg(e,t,r,i,o,n,a,s){const l=[],c=[];if(s.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=Oe(.5,s)-Math.PI/2;c.push([Oe(n,s)+t+.9*i*Math.cos(h-e),Oe(n,s)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[Oe(n,s)+t+i*Math.cos(u),Oe(n,s)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([Oe(n,s)+t+i*Math.cos(h+2*Math.PI+.5*a),Oe(n,s)+r+o*Math.sin(h+2*Math.PI+.5*a)]),c.push([Oe(n,s)+t+.98*i*Math.cos(h+a),Oe(n,s)+r+.98*o*Math.sin(h+a)]),c.push([Oe(n,s)+t+.9*i*Math.cos(h+.5*a),Oe(n,s)+r+.9*o*Math.sin(h+.5*a)])}return[c,l]}function ug(e,t,r,i,o,n,a,s,l){const c=n+Oe(.1,l),h=[];h.push([Oe(s,l)+t+.9*i*Math.cos(c-e),Oe(s,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)h.push([Oe(s,l)+t+i*Math.cos(d),Oe(s,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),h.push([t+i*Math.cos(a),r+o*Math.sin(a)]),El(h,null,l)}function nB(e,t,r,i,o,n,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let h=[0,0];const d=s.disableMultiStroke?1:2,u=s.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(u?0:Oe(c[0],s)),a[1]+(u?0:Oe(c[0],s))]}),h=u?[o,n]:[o+Oe(c[f],s),n+Oe(c[f],s)],l.push({op:"bcurveTo",data:[e+Oe(c[f],s),t+Oe(c[f],s),r+Oe(c[f],s),i+Oe(c[f],s),h[0],h[1]]});return l}function Ea(e){return[...e]}function fg(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(Ea(e[0]),Ea(e[1]),Ea(e[2]),Ea(e[2]));else{const o=[];o.push(e[0],e[0]);for(let s=1;s<e.length;s++)o.push(e[s]),s===e.length-1&&o.push(e[s]);const n=[],a=1-t;i.push(Ea(o[0]));for(let s=1;s+2<o.length;s++){const l=o[s];n[0]=[l[0],l[1]],n[1]=[l[0]+(a*o[s+1][0]-a*o[s-1][0])/6,l[1]+(a*o[s+1][1]-a*o[s-1][1])/6],n[2]=[o[s+1][0]+(a*o[s][0]-a*o[s+2][0])/6,o[s+1][1]+(a*o[s][1]-a*o[s+2][1])/6],n[3]=[o[s+1][0],o[s+1][1]],i.push(n[1],n[2],n[3])}}return i}function sl(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function aB(e,t,r){const i=sl(t,r);if(i===0)return sl(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)),sl(e,nn(t,r,o))}function nn(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Gh(e,t,r,i){const o=i||[];if((function(s,l){const c=s[l+0],h=s[l+1],d=s[l+2],u=s[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 s=e[t+0];o.length?(n=o[o.length-1],a=s,Math.sqrt(sl(n,a))>1&&o.push(s)):o.push(s),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=nn(l,c,.5),f=nn(c,h,.5),p=nn(h,d,.5),g=nn(u,f,.5),m=nn(f,p,.5),y=nn(g,m,.5);Gh([l,u,g,y],0,r,o),Gh([y,m,p,d],0,r,o)}var n,a;return o}function sB(e,t){return Pl(e,0,e.length,t)}function Pl(e,t,r,i,o){const n=o||[],a=e[t],s=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=aB(e[h],a,s);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Pl(e,t,c+1,i,n),Pl(e,c,r,i,n)):(n.length||n.push(a),n.push(s)),n}function $c(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let n=0;n<o;n++)Gh(e,3*n,t,i);return r&&r>0?Pl(i,0,i.length,r):i}const fi="none";class Ol{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,n){const a=this._o(n);return this._d("line",[_x(t,r,i,o,a)],a)}rectangle(t,r,i,o,n){const a=this._o(n),s=[],l=oB(t,r,i,o,a);if(a.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];a.fillStyle==="solid"?s.push(Fc([c],a)):s.push(En([c],a))}return a.stroke!==fi&&s.push(l),this._d("rectangle",s,a)}ellipse(t,r,i,o,n){const a=this._o(n),s=[],l=Tx(i,o,a),c=Xh(t,r,a,l);if(a.fill)if(a.fillStyle==="solid"){const h=Xh(t,r,a,l).opset;h.type="fillPath",s.push(h)}else s.push(En([c.estimatedPoints],a));return a.stroke!==fi&&s.push(c.opset),this._d("ellipse",s,a)}circle(t,r,i,o){const n=this.ellipse(t,r,i,i,o);return n.shape="circle",n}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[al(t,!1,i)],i)}arc(t,r,i,o,n,a,s=!1,l){const c=this._o(l),h=[],d=lg(t,r,i,o,n,a,s,!0,c);if(s&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=lg(t,r,i,o,n,a,!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),T=Math.abs(g/2);v+=Oe(.01*v,x),T+=Oe(.01*T,x);let L=m,A=y;for(;L<0;)L+=2*Math.PI,A+=2*Math.PI;A-L>2*Math.PI&&(L=0,A=2*Math.PI);const _=(A-L)/x.curveStepCount,M=[];for(let $=L;$<=A;$+=_)M.push([C+v*Math.cos($),k+T*Math.sin($)]);return M.push([C+v*Math.cos(A),k+T*Math.sin(A)]),M.push([C,k]),En([M],x)})(t,r,i,o,n,a,c));return c.stroke!==fi&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],n=sg(t,i);if(i.fill&&i.fill!==fi)if(i.fillStyle==="solid"){const a=sg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(a.ops)})}else{const a=[],s=t;if(s.length){const l=typeof s[0][0]=="number"?[s]:s;for(const c of l)c.length<3?a.push(...c):c.length===3?a.push(...$c(fg([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):a.push(...$c(fg(c),10,(1+i.roughness)/2))}a.length&&o.push(En([a],i))}return i.stroke!==fi&&o.push(n),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],n=al(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(Fc([t],i)):o.push(En([t],i))),i.stroke!==fi&&o.push(n),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 n=i.fill&&i.fill!=="transparent"&&i.fill!==fi,a=i.stroke!==fi,s=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=Sx(kx(eu(h))),p=[];let g=[],m=[0,0],y=[];const x=()=>{y.length>=4&&g.push(...$c(y,d)),y=[]},C=()=>{x(),g.length&&(p.push(g),g=[])};for(const{key:v,data:T}of f)switch(v){case"M":C(),m=[T[0],T[1]],g.push(m);break;case"L":x(),g.push([T[0],T[1]]);break;case"C":if(!y.length){const L=g.length?g[g.length-1]:m;y.push([L[0],L[1]])}y.push([T[0],T[1]]),y.push([T[2],T[3]]),y.push([T[4],T[5]]);break;case"Z":x(),g.push([m[0],m[1]])}if(C(),!u)return p;const k=[];for(const v of p){const T=sB(v,u);T.length&&k.push(T)}return k})(t,1,s?4-4*(i.simplification||1):(1+i.roughness)/2),c=cg(t,i);if(n)if(i.fillStyle==="solid")if(l.length===1){const h=cg(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(Fc(l,i));else o.push(En(l,i));return a&&(s?l.forEach((h=>{o.push(al(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const n=typeof r=="number"&&r>=0?o.data.map((a=>+a.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${n[0]} ${n[1]} `;break;case"bcurveTo":i+=`C${n[0]} ${n[1]}, ${n[2]} ${n[3]}, ${n[4]} ${n[5]} `;break;case"lineTo":i+=`L${n[0]} ${n[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const n of r){let a=null;switch(n.type){case"path":a={d:this.opsToPath(n),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:fi};break;case"fillPath":a={d:this.opsToPath(n),stroke:fi,strokeWidth:0,fill:i.fill||fi};break;case"fillSketch":a=this.fillSketch(n,i)}a&&o.push(a)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||fi,strokeWidth:i,fill:fi}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class lB{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new Ol(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,n=t.options.fixedDecimalPlaceDigits;for(const a of r)switch(a.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,a,n),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const s=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,a,n,s),o.restore();break}case"fillSketch":this.fillSketch(o,a,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 n of r.ops){const a=typeof i=="number"&&i>=0?n.data.map((s=>+s.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(a[0],a[1]);break;case"bcurveTo":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"lineTo":t.lineTo(a[0],a[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,n){const a=this.gen.line(t,r,i,o,n);return this.draw(a),a}rectangle(t,r,i,o,n){const a=this.gen.rectangle(t,r,i,o,n);return this.draw(a),a}ellipse(t,r,i,o,n){const a=this.gen.ellipse(t,r,i,o,n);return this.draw(a),a}circle(t,r,i,o){const n=this.gen.circle(t,r,i,o);return this.draw(n),n}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,n,a,s=!1,l){const c=this.gen.arc(t,r,i,o,n,a,s,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 Rs="http://www.w3.org/2000/svg";class cB{constructor(t,r){this.svg=t,this.gen=new Ol(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,n=o.createElementNS(Rs,"g"),a=t.options.fixedDecimalPlaceDigits;for(const s of r){let l=null;switch(s.type){case"path":l=o.createElementNS(Rs,"path"),l.setAttribute("d",this.opsToPath(s,a)),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(Rs,"path"),l.setAttribute("d",this.opsToPath(s,a)),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,s,i)}l&&n.appendChild(l)}return n}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const n=t.createElementNS(Rs,"path");return n.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),n.setAttribute("stroke",i.fill||""),n.setAttribute("stroke-width",o+""),n.setAttribute("fill","none"),i.fillLineDash&&n.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&n.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),n}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,n){const a=this.gen.line(t,r,i,o,n);return this.draw(a)}rectangle(t,r,i,o,n){const a=this.gen.rectangle(t,r,i,o,n);return this.draw(a)}ellipse(t,r,i,o,n){const a=this.gen.ellipse(t,r,i,o,n);return this.draw(a)}circle(t,r,i,o){const n=this.gen.circle(t,r,i,o);return this.draw(n)}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,n,a,s=!1,l){const c=this.gen.arc(t,r,i,o,n,a,s,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 re={canvas:(e,t)=>new lB(e,t),svg:(e,t)=>new cB(e,t),generator:e=>new Ol(e),newSeed:()=>Ol.newSeed()},hB=1,dB=3;async function ru(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!iu(e);await Promise.all([...t].map(i=>new Promise(o=>{function n(){if(i.style.display="flex",i.style.flexDirection="column",r){const a=Ke().fontSize?Ke().fontSize:window.getComputedStyle(document.body).fontSize,s=5,[l=Sm.fontSize]=Gl(a),c=l*s+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}w(n,"setupImage"),setTimeout(()=>{i.complete&&n()}),i.addEventListener("error",n),i.addEventListener("load",n)})))}w(ru,"configureLabelImages");function iu(e){return e.nodeType===dB?e.textContent?.trim()!=="":e.nodeType!==hB||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(iu)}w(iu,"hasTextBesidesImages");var gg=3,uB=32,fB=w(async(e,t,r)=>{const i=Ke(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),n=o.insert("g").attr("class","label").attr("style",Rr(t.labelStyle)),s=[{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),uB):Ke().flowchart?.wrappingWidth??200,h=i.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(s.map(async y=>{const x=n.append("g").attr("class",y.cssClass),C=await Ni(x,vi(Uo(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+gg;const p=d.length>0?f-gg:0;n.insert("rect",":first-child"),n.attr("transform",`translate(${-u/2}, ${-p/2})`);const g=n.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:g,halfPadding:m,label:n}},"c4LabelHelper"),xe=w(async(e,t,r)=>{if(t.stereotype!==void 0)return fB(e,t,r);let i;const o=t.useHtmlLabels||ao(Ke()?.htmlLabels);r?i=r:i="node default";const n=e.insert("g").attr("class",i).attr("id",t.domId||t.id),a=n.insert("g").attr("class","label").attr("style",Rr(t.labelStyle));let s;t.label===void 0?s="":s=typeof t.label=="string"?t.label:t.label[0];const l=!!t.icon||!!t.img,c=t.labelType==="markdown",h=await Ni(a,vi(Uo(s),Ke()),{useHtmlLabels:o,width:t.width||t.wrappingWidth||Ke().flowchart?.wrappingWidth,classes:c?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:l,markdown:c},Ke()),d=(t?.padding??0)/2;let u;if(o){const f=h.children[0],p=He(h);await ru(f),u=await bn.measure(()=>f.getBoundingClientRect()),p.attr("width",u.width),p.attr("height",u.height)}else u=await bn.measure(()=>h.getBBox());return o?a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"):a.attr("transform","translate(0, "+-u.height/2+")"),t.centerLabel&&a.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),a.insert("rect",":first-child"),{shapeSvg:n,bbox:u,halfPadding:d,label:a}},"labelHelper"),Ec=w(async(e,t,r)=>{const i=r.useHtmlLabels??Vr(Ke()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),n=await Ni(o,vi(Uo(t),Ke()),{useHtmlLabels:i,width:r.width||Ke()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),a=r.padding/2;let s;if(Vr(Ke())){const l=n.children[0],c=He(n);s=await bn.measure(()=>l.getBoundingClientRect()),c.attr("width",s.width),c.attr("height",s.height)}else s=await bn.measure(()=>n.getBBox());return i?o.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"):o.attr("transform","translate(0, "+-s.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-s.width/2+", "+-s.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:s,halfPadding:a,label:o}},"insertLabel"),ne=w((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"),be=w((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function ir(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}w(ir,"createPathFromPoints");function Zo(e,t,r,i,o,n){const a=[],l=r-e,c=i-t,h=l/n,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));a.push({x:g,y:m})}return a}w(Zo,"generateFullSineWavePoints");function Vi(e,t,r,i,o,n){const a=[],s=o*Math.PI/180,h=(n*Math.PI/180-s)/(i-1);for(let d=0;d<i;d++){const u=s+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}w(Vi,"generateCirclePoints");function Uh(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"),n=t.find(l=>l.getAttribute("stroke")!=="none"),a=w((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:a(o,"fill"),"fill-opacity":a(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(n){const l={stroke:a(n,"stroke"),"stroke-width":a(n,"stroke-width")??"1","stroke-opacity":a(n,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const s=document.createElementNS("http://www.w3.org/2000/svg","g");return s.appendChild(r),s}w(Uh,"mergePaths");var gB=w((e,t)=>{var r=e.x,i=e.y,o=t.x-r,n=t.y-i,a=e.width/2,s=e.height/2,l,c;return Math.abs(n)*a>Math.abs(o)*s?(n<0&&(s=-s),l=n===0?0:s*o/n,c=s):(o<0&&(a=-a),l=a,c=o===0?0:a*n/o),{x:r+l,y:i+c}},"intersectRect"),_n=gB,Ti=w((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"),pB=w(async(e,t,r,i=!1,o=!1)=>{let n=t||"";typeof n=="object"&&(n=n[0]);const a=Ke(),s=Vr(a);return await Ni(e,n,{style:r,isTitle:i,useHtmlLabels:s,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},a)},"createLabel"),Wo=pB;function Bx(e,t){return e.intersect(t)}w(Bx,"intersectNode");var mB=Bx;function Lx(e,t,r,i){var o=e.x,n=e.y,a=o-i.x,s=n-i.y,l=Math.sqrt(t*t*s*s+r*r*a*a),c=Math.abs(t*r*a/l);i.x<o&&(c=-c);var h=Math.abs(t*r*s/l);return i.y<n&&(h=-h),{x:o+c,y:n+h}}w(Lx,"intersectEllipse");var Ax=Lx;function Fx(e,t,r){return Ax(e,t,t,r)}w(Fx,"intersectCircle");var yB=Fx;function $x(e,t,r,i){{const o=t.y-e.y,n=e.x-t.x,a=t.x*e.y-e.x*t.y,s=o*r.x+n*r.y+a,l=o*i.x+n*i.y+a,c=1e-6;if(s!==0&&l!==0&&Vh(s,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&&Vh(f,p))return;const g=o*d-h*n;if(g===0)return;const m=Math.abs(g/2);let y=n*u-d*a;const x=y<0?(y-m)/g:(y+m)/g;y=h*a-o*u;const C=y<0?(y-m)/g:(y+m)/g;return{x,y:C}}}w($x,"intersectLine");function Vh(e,t){return e*t>0}w(Vh,"sameSign");var xB=$x;function Ex(e,t,r){let i=e.x,o=e.y,n=[],a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){a=Math.min(a,h.x),s=Math.min(s,h.y)}):(a=Math.min(a,t.x),s=Math.min(s,t.y));let l=i-e.width/2-a,c=o-e.height/2-s;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=xB(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&n.push(f)}return n.length?(n.length>1&&n.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}),n[0]):e}w(Ex,"intersectPolygon");var bB=Ex,Vt={node:mB,circle:yB,ellipse:Ax,polygon:bB,rect:_n};function Px(e,t){const{labelStyles:r}=ae(t);t.labelStyle=r;const i=be(t);let o=i;i||(o="anchor");const n=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=1,{cssStyles:s}=t,l=re.svg(n),c=ee(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,a*2,c),d=n.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Rr(s)),ne(t,d),t.intersect=function(u){return pt.info("Circle intersect",t,a,u),Vt.circle(t,a,u)},n}w(Px,"anchor");function Zh(e,t,r,i,o,n,a){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/n,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*n*Math.sin(h)*(a?-1:1),x=c-m*o*Math.cos(h)*(a?-1:1),C=Math.atan2((t-x)/n,(e-y)/o);let v=Math.atan2((i-x)/n,(r-y)/o)-C;a&&v<0&&(v+=2*Math.PI),!a&&v>0&&(v-=2*Math.PI);const T=[];for(let L=0;L<20;L++){const A=L/19,_=C+A*v,M=y+o*Math.cos(_),$=x+n*Math.sin(_);T.push({x:M,y:$})}return T}w(Zh,"generateArcPoints");function Ox(e,t,r){const[i,o]=[t,r].sort((n,a)=>a-n);return o*(1-Math.sqrt(1-(e/i/2)**2))}w(Ox,"calculateArcSagitta");async function Ix(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o,s=w(_=>_+a,"calcTotalHeight"),l=w(_=>{const M=_/2;return[M/(2.5+_/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await xe(e,t,be(t)),d=s(t?.height?t?.height:h.height),[u,f]=l(d),p=Ox(d,u,f),m=(t?.width?t?.width:h.width)+n*2+p-p,y=d,{cssStyles:x}=t,C=[{x:m/2,y:-y/2},{x:-m/2,y:-y/2},...Zh(-m/2,-y/2,-m/2,y/2,u,f,!1),{x:m/2,y:y/2},...Zh(m/2,y/2,m/2,-y/2,u,f,!0)],k=re.svg(c),v=ee(t,{});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=ir(C),L=k.path(T,v),A=c.insert(()=>L,":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(${u/2}, 0)`),ne(t,A),t.intersect=function(_){return Vt.polygon(t,C,_)},c}w(Ix,"bowTieRect");async function Rx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{shapeSvg:n,bbox:a,label:s}=await xe(e,t,be(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=Math.max(a.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(a.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=n.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const A=re.svg(n).path(m,ee(t,{}));x.node()?.appendChild(A),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`),ne(t,x);const C=f+(p-f)/2;s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${C-a.height/2-(a.y-(a.top??0))})`);const k=12,v=w((L,A,_)=>Array.from({length:k+1},(M,$)=>{const P=Math.PI-$*Math.PI/k;return{x:L*Math.cos(P),y:A+_*d*Math.sin(P)}}),"arc"),T=[...v(h/2,f,-1),...v(g/2,p,1).reverse()];return t.intersect=function(L){return Vt.polygon(t,T,L)},n}w(Rx,"bucket");var pg=20,mg=8,CB=80,Pc=8;async function Dx(e,t){const{themeVariables:r}=Ke(),i=r.clusterBkg,o=r.clusterBorder,{nodeStyles:n}=ae(t),{shapeSvg:a,bbox:s}=await xe(e,t,be(t)),l=t.padding??8,c=s.height,h=Math.max(s.width+l*2,CB,t?.width??0),d=Math.max(c+mg+pg+l*2,t?.height??0),u=-h/2,f=-d/2,p=-28/2,g=a.select(".label");g&&(t.useHtmlLabels??Vr(Ke())?g.attr("transform",`translate(${-s.width/2}, ${-s.height/2+p})`):g.attr("transform",`translate(0, ${-s.height/2+p})`));let m;if(t.look==="handDrawn"){const v=re.svg(a),T=ee(t,{fill:i,stroke:o,fillStyle:"solid"}),L=v.path(Ti(u,f,h,d,Pc),T);m=a.insert(()=>L,":first-child"),m.attr("class","basic label-container collapsed-group").attr("style",Rr(t.cssStyles))}else m=a.insert("rect",":first-child"),m.attr("class","basic label-container collapsed-group").attr("style",n).attr("rx",Pc).attr("ry",Pc).attr("x",u).attr("y",f).attr("width",h).attr("height",d).attr("fill",i).attr("stroke",o);const y=f+l+c+mg;a.append("line").attr("class","collapsed-separator").attr("x1",u+8).attr("y1",y).attr("x2",u+h-8).attr("y2",y).attr("stroke",o).attr("stroke-dasharray","3, 3");const x=y+pg/2,C=2.5,k=10;for(let v=-1;v<=1;v++)a.append("circle").attr("class","collapsed-indicator").attr("cx",v*k).attr("cy",x).attr("r",C).attr("fill",o);return ne(t,m),t.calcIntersect=function(v,T){return Vt.rect(v,T)},t.intersect=function(v){return Vt.rect(t,v)},a}w(Dx,"collapsedGroup");function lo(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+")")}w(lo,"insertPolygonShape");var wB=["right","left","up","down"],ou="point",kB=w(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"),SB=w(e=>wB.filter(t=>e.has(t)).join("|")||ou,"getDirectionKey"),yg={"right|left|up|down":w(({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":w(({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":w(({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":w(({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":w(({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":w(({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":w(({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":w(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":w(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":w(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":w(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:w(({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:w(({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:w(({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:w(({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"),[ou]:()=>[{x:0,y:0}]},vB=w((e,t,r,i)=>{const o=kB(e),n=(r.padding??0)/2,a=t.height+4*n,s=a/2,l=i??t.width+2*s+2*n,c=SB(o);return(yg[c]??yg[ou])({height:a,midpoint:s,padding:n,width:l})},"getArrowPoints");async function Nx(e,t){const r=t,{shapeSvg:i,bbox:o}=await xe(e,r,be(r)),n=r.padding??0,a=o.height+2*n,s=a/2,l=o.width+2*s+n,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>l?c:l,u=vB(r.directions??[],o,r,d),f=lo(i,d,a,u);return f.attr("style",r.style??null),ne(r,f),r.intersect=function(p){return Vt.polygon(r,u,p)},i}w(Nx,"block_arrow");async function qx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{shapeSvg:n,bbox:a,label:s}=await xe(e,t,be(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=n.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=re.svg(n).path(Ti(-u/2,p,u,f,d),ee(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`),ne(t,m);const y=p+h+(f-h)/2;return s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(x){return Vt.rect(t,x)},n}w(qx,"browser");var Ds=12;async function zx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?28:o,a=t.look==="neo"?24:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=(t?.width??l.width)+(t.look==="neo"?n*2:n+Ds),h=(t?.height??l.height)+(t.look==="neo"?a*2:a),d=0,u=c,f=-h,p=0,g=[{x:d+Ds,y:f},{x:u,y:f},{x:u,y:p},{x:d,y:p},{x:d,y:f+Ds},{x:d+Ds,y:f}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=re.svg(s),C=ee(t,{}),k=ir(g),v=x.path(k,C);m=s.insert(()=>v,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),y&&m.attr("style",y)}else m=lo(s,c,h,g);return i&&m.attr("style",i),ne(t,m),t.intersect=function(x){return Vt.polygon(t,g,x)},s}w(zx,"card");function Wx(e,t){const{nodeStyles:r}=ae(t);t.label="";const i=e.insert("g").attr("class",be(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,n=Math.max(28,t.width??0),a=[{x:0,y:n/2},{x:n/2,y:0},{x:0,y:-n/2},{x:-n/2,y:0}],s=re.svg(i),l=ee(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=ir(a),h=s.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 Vt.polygon(t,a,u)},i}w(Wx,"choice");async function nu(e,t,r){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{shapeSvg:n,bbox:a,halfPadding:s}=await xe(e,t,be(t)),l=16,c=r?.padding??s,h=t.look==="neo"?a.width/2+l*2:a.width/2+c;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=re.svg(n),p=ee(t,{}),g=f.circle(0,0,h*2,p);d=n.insert(()=>g,":first-child"),d.attr("class","basic label-container").attr("style",Rr(u))}else d=n.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",h).attr("cx",0).attr("cy",0);return ne(t,d),t.calcIntersect=function(f,p){const g=f.width/2;return Vt.circle(f,g,p)},t.intersect=function(f){return pt.info("Circle intersect",t,h,f),Vt.circle(t,h,f)},n}w(nu,"circle");async function Hx(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:n,halfPadding:a}=await xe(e,r,i),s=o.insert("rect",":first-child"),l=r.padding??0,c=r.positioned?r.width??0:n.width+l,h=r.positioned?r.height??0:n.height+l,d=r.positioned?-c/2:-n.width/2-a,u=r.positioned?-h/2:-n.height/2-a;return s.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),ne(r,s),r.intersect=function(f){return Vt.rect(r,f)},o}w(Hx,"composite");async function Yx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{shapeSvg:n,bbox:a,label:s}=await xe(e,t,be(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(a.width+c*2,t.width??0,90),f=Math.max(a.height+c*2+h,t.height??0),p=-f/2,{cssStyles:g}=t,m=n.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const C=re.svg(n).path(Ti(-u/2,p,u,f,d),ee(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(">_"),ne(t,m);const y=p+h+(f-h)/2;return s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(x){return Vt.rect(t,x)},n}w(Yx,"consoleWindow");function Xx(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},n={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};return`M ${n.x},${n.y} L ${s.x},${s.y}
|
|
199
|
-
M ${o.x},${o.y} L ${a.x},${a.y}`}w(Xx,"createLine");function jx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",be(t)).attr("id",t.domId??t.id),n=Math.max(30,t?.width??0),{cssStyles:a}=t,s=re.svg(o),l=ee(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=s.circle(0,0,n*2,l),h=Xx(n),d=s.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),a&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ne(t,u),t.intersect=function(f){return pt.info("crossedCircle intersect",t,{radius:n,point:f}),Vt.circle(t,n,f)},o}w(jx,"crossedCircle");function mo(e,t,r,i=100,o=0,n=180){const a=[],s=o*Math.PI/180,h=(n*Math.PI/180-s)/(i-1);for(let d=0;d<i;d++){const u=s+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}w(mo,"generateCirclePoints");async function Gx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=n.width+s,h=n.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...mo(c/2,-h/2,d,30,-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+c*.1,-d,d,20,-180,-270),...mo(c/2+c*.1,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=re.svg(o),m=ee(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=ir(f).replace("Z",""),C=g.path(x,m),k=ir(p),v=g.path(k,{...m}),T=o.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>C,":first-child"),T.attr("class","text"),u&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${d}, 0)`),a.attr("transform",`translate(${-c/2+d-(n.x-(n.left??0))},${-h/2+(t.padding??0)/2-(n.y-(n.top??0))})`),ne(t,T),t.intersect=function(L){return Vt.polygon(t,p,L)},o}w(Gx,"curlyBraceLeft");function yo(e,t,r,i=100,o=0,n=180){const a=[],s=o*Math.PI/180,h=(n*Math.PI/180-s)/(i-1);for(let d=0;d<i;d++){const u=s+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:f,y:p})}return a}w(yo,"generateCirclePoints");async function Ux(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=n.width+(t.look==="neo"?s*2:s),h=n.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...yo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...yo(c/2+d*2,-d,d,20,-180,-270),...yo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...yo(c/2,h/2,d,20,0,90)],p=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...yo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...yo(c/2+d*2,-d,d,20,-180,-270),...yo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...yo(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],g=re.svg(o),m=ee(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=ir(f).replace("Z",""),C=g.path(x,m),k=ir(p),v=g.path(k,{...m}),T=o.insert("g",":first-child");return T.insert(()=>v,":first-child").attr("stroke-opacity",0),T.insert(()=>C,":first-child"),T.attr("class","text"),u&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&T.selectAll("path").attr("style",i),T.attr("transform",`translate(${-d}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(n.x-(n.left??0))},${-h/2+(t.padding??0)/2-(n.y-(n.top??0))})`),ne(t,T),t.intersect=function(L){return Vt.polygon(t,p,L)},o}w(Ux,"curlyBraceRight");function Wr(e,t,r,i=100,o=0,n=180){const a=[],s=o*Math.PI/180,h=(n*Math.PI/180-s)/(i-1);for(let d=0;d<i;d++){const u=s+d*h,f=e+r*Math.cos(u),p=t+r*Math.sin(u);a.push({x:-f,y:-p})}return a}w(Wr,"generateCirclePoints");async function Vx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=n.width+(t.look==="neo"?s*2:s),h=n.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=re.svg(o),y=ee(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const C=ir(f).replace("Z",""),k=m.path(C,y),T=ir(p).replace("Z",""),L=m.path(T,y),A=ir(g),_=m.path(A,{...y}),M=o.insert("g",":first-child");return M.insert(()=>_,":first-child").attr("stroke-opacity",0),M.insert(()=>k,":first-child"),M.insert(()=>L,":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-d/4}, 0)`),a.attr("transform",`translate(${-c/2+(t.padding??0)/2-(n.x-(n.left??0))},${-h/2+(t.padding??0)/2-(n.y-(n.top??0))})`),ne(t,M),t.intersect=function($){return Vt.polygon(t,g,$)},o}w(Vx,"curlyBraces");async function Zx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o,s=20,l=5,{shapeSvg:c,bbox:h}=await xe(e,t,be(t)),d=Math.max(s,(h.width+n*2)*1.25,t?.width??0),u=Math.max(l,h.height+a*2,t?.height??0),f=u/2,{cssStyles:p}=t,g=re.svg(c),m=ee(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=d,x=u,C=y-f,k=x/4,v=[{x:C,y:0},{x:k,y:0},{x:0,y:x/2},{x:k,y:x},{x:C,y:x},...Vi(-C,-x/2,f,50,270,90)],T=ir(v),L=g.path(T,m),A=c.insert(()=>L,":first-child");return A.attr("class","basic label-container outer-path"),p&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",p),i&&t.look!=="handDrawn"&&A.selectChildren("path").attr("style",i),A.attr("transform",`translate(${-d/2}, ${-u/2})`),ne(t,A),t.intersect=function(_){return Vt.polygon(t,v,_)},c}w(Zx,"curvedTrapezoid");async function Kx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.padding??20,l=Math.max(n.width+s*2,t.width??0,100),c=Math.min(Math.max(l*.23,16),56),h=c*.27,d=Math.max(n.height+s*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 A=re.svg(o),_=ee(t,{}),M=A.path(Ti(-l/2,g,l,d,u),_),$=A.circle(0,p+c,c*2,_);m.insert(()=>$,":first-child"),m.insert(()=>M,":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);ne(t,m);const x=g+d/2;a.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${x-n.height/2-(n.y-(n.top??0))})`);const C=p+c,k=Math.asin(Math.min(1,(g-C)/c))*180/Math.PI,L=[...Vi(0,-C,c,24,180+k,-k),...Vi(-(-l/2+u),-(g+u),u,12,90,0),...Vi(-(-l/2+u),-(f/2-u),u,12,360,270),...Vi(-(l/2-u),-(f/2-u),u,12,270,180),...Vi(-(l/2-u),-(g+u),u,12,180,90)];return t.intersect=function(A){return Vt.polygon(t,L,A)},o}w(Kx,"person");var _B=w((e,t,r,i,o,n)=>[`M${e},${t+n}`,`a${o},${n} 0,0,0 ${r},0`,`a${o},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),TB=w((e,t,r,i,o,n)=>[`M${e},${t+n}`,`M${e+r},${t+n}`,`a${o},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${n} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),MB=w((e,t,r,i,o,n)=>[`M${e-r/2},${-i/2}`,`a${o},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),xg=8,bg=8;async function Qx(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?24:o,a=t.look==="neo"?24:o,s=t.width??0;if(t.width&&(t.width=t.width-a,t.width<bg&&(t.width=bg)),t.height){const x=s/2/(2.5+s/50);t.height=t.height-n-x*3,t.height<xg&&(t.height=xg)}const{shapeSvg:l,bbox:c,label:h}=await xe(e,t,be(t)),d=Math.max(t.width??0,c.width)+a,u=d/2,f=u/(2.5+d/50),p=Math.max(t.height??0,c.height)+n+f;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=re.svg(l),x=TB(0,0,d,p,u,f),C=MB(0,f,d,p,u,f),k=ee(t,{}),v=y.path(x,k),T=y.path(C,ee(t,{fill:"none"}));g=l.insert(()=>T,":first-child"),g=l.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=_B(0,0,d,p,u,f);g=l.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Rr(m)).attr("style",i)}return g.attr("label-offset-y",f),g.attr("transform",`translate(${-d/2}, ${-(p/2+f)})`),ne(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=Vt.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}w(Qx,"cylinder");async function Ca(e,t,r){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{shapeSvg:n,bbox:a}=await xe(e,t,be(t)),s=Math.max(a.width+r.labelPaddingX*2,t?.width||0),l=Math.max(a.height+r.labelPaddingY*2,t?.height||0),c=-s/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=re.svg(n),m=ee(t,{}),y=u||f?g.path(Ti(c,h,s,l,u||0),m):g.rectangle(c,h,s,l,m);d=n.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Rr(p))}else d=n.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Rr(u)).attr("ry",Rr(f)).attr("x",c).attr("y",h).attr("width",s).attr("height",l);return ne(t,d,t.look==="handDrawn"?void 0:{width:s,height:l}),t.calcIntersect=function(g,m){return Vt.rect(g,m)},t.intersect=function(g){return Vt.rect(t,g)},n}w(Ca,"drawRect");async function Jx(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:n,width:a,height:s}=t,l={rx:0,ry:0,labelPaddingX:i??(n??0)*2,labelPaddingY:o??n??0},c=await Ca(e,t,l);if(t.look==="handDrawn"){const f=re.svg(c),p=ee(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"))||a)??0,u=(Number(h.attr("height"))||s)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}w(Jx,"datastore");async function t0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?16:t.padding??0,{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=s.width+o,h=s.height+n,d=h*.2,u=-c/2,f=-h/2-d/2,{cssStyles:p}=t,g=re.svg(a),m=ee(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=a.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-(s.x-(s.left??0))}, ${f+d+(t.padding??0)/2-(s.y-(s.top??0))})`),ne(t,C),t.intersect=function(k){return Vt.rect(t,k)},a}w(t0,"dividedRectangle");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t),o=t.look==="neo"?12:5;t.labelStyle=r;const n=t.padding??0,a=t.look==="neo"?16:n,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=(t?.width?t?.width/2:l.width/2)+(a??0),h=c-o;let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=re.svg(s),p=ee(t,{roughness:.2,strokeWidth:2.5}),g=ee(t,{roughness:.2,strokeWidth:1.5}),m=f.circle(0,0,c*2,p),y=f.circle(0,0,h*2,g);d=s.insert("g",":first-child"),d.attr("class",Rr(t.cssClasses)).attr("style",Rr(u)),d.node()?.appendChild(m),d.node()?.appendChild(y)}else{d=s.insert("g",":first-child");const f=d.insert("circle",":first-child"),p=d.insert("circle");d.attr("class","basic label-container").attr("style",i),f.attr("class","outer-circle").attr("style",i).attr("r",c).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ne(t,d),t.intersect=function(f){return pt.info("DoubleCircle intersect",t,c,f),Vt.circle(t,c,f)},s}w(e0,"doublecircle");function r0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.label="",t.labelStyle=i;const n=e.insert("g").attr("class",be(t)).attr("id",t.domId??t.id),a=7,{cssStyles:s}=t,l=re.svg(n),{nodeBorder:c}=r,h=ee(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,a*2,h),u=n.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),s&&s.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),ne(t,u),t.intersect=function(f){return pt.info("filledCircle intersect",t,{radius:a,point:f}),Vt.circle(t,a,f)},n}w(r0,"filledCircle");var Cg=10,wg=10;async function i0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<Cg&&(t.height=Cg),t.width=(t?.width??0)-n-n/2,t.width<wg&&(t.width=wg));const{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=(t?.width?t?.width:s.width)+(n??0),h=t?.height?t?.height:c+s.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,p=re.svg(a),g=ee(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=ir(u),y=p.path(m,g),x=a.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,ne(t,x),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${-h/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(C){return pt.info("Triangle intersect",t,u,C),Vt.polygon(t,u,C)},a}w(i0,"flippedTriangle");async function o0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.padding??12,l=Math.max(n.width+s*2,t.width??0,90),c=n.height+s*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=re.svg(o).path(m,ee(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"?ne(t,x):ne(t,x,{width:l,height:d});const C=p+h+u/2;return a.attr("transform",`translate(${-(n.width/2)-(n.x-(n.left??0))}, ${C-n.height/2-(n.y-(n.top??0))})`),t.intersect=function(k){return Vt.polygon(t,g,k)},o}w(o0,"folder");function n0(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:n}=ae(t);t.label="";const a=e.insert("g").attr("class",be(t)).attr("id",t.domId??t.id),{cssStyles:s}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);r==="LR"&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=re.svg(a),f=ee(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=a.insert(()=>p,":first-child");s&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",s),n&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",n),ne(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 Vt.rect(t,y)},a}w(n0,"forkJoin");async function a0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=15,n=10,a=t.look==="neo"?16:t.padding??0,s=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-s*2,t.height<n&&(t.height=n),t.width=(t?.width??0)-a*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await xe(e,t,be(t)),h=(t?.width?t?.width:Math.max(o,c.width))+a*2,d=(t?.height?t?.height:Math.max(n,c.height))+s*2,u=d/2,{cssStyles:f}=t,p=re.svg(l),g=ee(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-h/2,y:-d/2},{x:h/2-u,y:-d/2},...Vi(-h/2+u,0,u,50,90,270),{x:h/2-u,y:d/2},{x:-h/2,y:d/2}],y=ir(m),x=p.path(y,g),C=l.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),ne(t,C),t.intersect=function(k){return pt.info("Pill intersect",t,{radius:u,point:k}),Vt.polygon(t,m,k)},l}w(a0,"halfRoundedRectangle");var BB=w((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 s0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const n=t.padding??0,a=70,s=32,l=t.look==="neo"?a:n,c=t.look==="neo"?s:n;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 xe(e,t,be(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=re.svg(h),C=ee(t,{}),k=BB(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=lo(h,p,u,g);return i&&m.attr("style",i),t.width=p,t.height=u,ne(t,m),t.intersect=function(x){return Vt.polygon(t,g,x)},h}w(s0,"hexagon");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await xe(e,t,be(t)),n=Math.max(30,t?.width??0),a=Math.max(30,t?.height??0),{cssStyles:s}=t,l=re.svg(o),c=ee(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:n,y:0},{x:0,y:a},{x:n,y:a}],d=ir(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),s&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",s),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-n/2}, ${-a/2})`),ne(t,f),t.intersect=function(p){return pt.info("Pill intersect",t,{points:h}),Vt.polygon(t,h,p)},o}w(l0,"hourglass");async function c0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ae(t);t.labelStyle=o;const n=t.assetHeight??48,a=t.assetWidth??48,s=Math.max(n,a),l=i?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:h,label:d}=await xe(e,t,"icon-shape default"),u=t.pos==="t",f=s,p=s,{nodeBorder:g}=r,{stylesMap:m}=ba(t),y=-p/2,x=-f/2,C=t.label?8:0,k=re.svg(c),v=ee(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(v.roughness=0,v.fillStyle="solid");const T=k.rectangle(y,x,p,f,v),L=Math.max(p,h.width),A=f+h.height+C,_=k.rectangle(-L/2,-A/2,L,A,{...v,fill:"transparent",stroke:"none"}),M=c.insert(()=>T,":first-child"),$=c.insert(()=>_);if(t.icon){const P=c.append("g");P.html(`<g>${await Ss(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const N=P.node().getBBox(),F=N.width,E=N.height,B=N.x,q=N.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?-A/2:A/2-h.height})`),M.attr("transform",`translate(0,${u?h.height/2+C/2:-h.height/2-C/2})`),ne(t,$),t.intersect=function(P){if(pt.info("iconSquare intersect",t,P),!t.label)return Vt.rect(t,P);const N=t.x??0,F=t.y??0,E=t.height??0;let B=[];return u?B=[{x:N-h.width/2,y:F-E/2},{x:N+h.width/2,y:F-E/2},{x:N+h.width/2,y:F-E/2+h.height+C},{x:N+p/2,y:F-E/2+h.height+C},{x:N+p/2,y:F+E/2},{x:N-p/2,y:F+E/2},{x:N-p/2,y:F-E/2+h.height+C},{x:N-h.width/2,y:F-E/2+h.height+C}]:B=[{x:N-p/2,y:F-E/2},{x:N+p/2,y:F-E/2},{x:N+p/2,y:F-E/2+f},{x:N+h.width/2,y:F-E/2+f},{x:N+h.width/2/2,y:F+E/2},{x:N-h.width/2,y:F+E/2},{x:N-h.width/2,y:F-E/2+f},{x:N-p/2,y:F-E/2+f}],Vt.polygon(t,B,P)},c}w(c0,"icon");async function h0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ae(t);t.labelStyle=o;const n=t.assetHeight??48,a=t.assetWidth??48,s=Math.max(n,a),l=i?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:h,label:d}=await xe(e,t,"icon-shape default"),u=20,f=t.label?8:0,p=t.pos==="t",{nodeBorder:g,mainBkg:m}=r,{stylesMap:y}=ba(t),x=re.svg(c),C=ee(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 Ss(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const T=v.node().getBBox(),L=T.width,A=T.height,_=T.x,M=T.y,$=Math.max(L,A)*Math.SQRT2+u*2,P=x.circle(0,0,$,C),N=Math.max($,h.width),F=$+h.height+f,E=x.rectangle(-N/2,-F/2,N,F,{...C,fill:"transparent",stroke:"none"}),B=c.insert(()=>P,":first-child"),q=c.insert(()=>E);return v.attr("transform",`translate(${-L/2-_},${p?h.height/2+f/2-A/2-M:-h.height/2-f/2-A/2-M})`),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})`),ne(t,q),t.intersect=function(z){return pt.info("iconSquare intersect",t,z),Vt.rect(t,z)},c}w(h0,"iconCircle");async function d0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ae(t);t.labelStyle=o;const n=t.assetHeight??48,a=t.assetWidth??48,s=Math.max(n,a),l=i?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await xe(e,t,"icon-shape default"),f=t.pos==="t",p=s+d*2,g=s+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=ba(t),C=-g/2,k=-p/2,v=t.label?8:0,T=re.svg(c),L=ee(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const A=x.get("fill");L.stroke=A??y;const _=T.path(Ti(C,k,g,p,5),L),M=Math.max(g,h.width),$=p+h.height+v,P=T.rectangle(-M/2,-$/2,M,$,{...L,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child").attr("class","icon-shape2"),F=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await Ss(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const B=E.node().getBBox(),q=B.width,z=B.height,I=B.x,D=B.y;E.attr("transform",`translate(${-q/2-I},${f?h.height/2+v/2-z/2-D:-h.height/2-v/2-z/2-D})`),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})`),N.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ne(t,F),t.intersect=function(E){if(pt.info("iconSquare intersect",t,E),!t.label)return Vt.rect(t,E);const B=t.x??0,q=t.y??0,z=t.height??0;let I=[];return f?I=[{x:B-h.width/2,y:q-z/2},{x:B+h.width/2,y:q-z/2},{x:B+h.width/2,y:q-z/2+h.height+v},{x:B+g/2,y:q-z/2+h.height+v},{x:B+g/2,y:q+z/2},{x:B-g/2,y:q+z/2},{x:B-g/2,y:q-z/2+h.height+v},{x:B-h.width/2,y:q-z/2+h.height+v}]:I=[{x:B-g/2,y:q-z/2},{x:B+g/2,y:q-z/2},{x:B+g/2,y:q-z/2+p},{x:B+h.width/2,y:q-z/2+p},{x:B+h.width/2/2,y:q+z/2},{x:B-h.width/2,y:q+z/2},{x:B-h.width/2,y:q-z/2+p},{x:B-g/2,y:q-z/2+p}],Vt.polygon(t,I,E)},c}w(d0,"iconRounded");async function u0(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=ae(t);t.labelStyle=o;const n=t.assetHeight??48,a=t.assetWidth??48,s=Math.max(n,a),l=i?.wrappingWidth;t.width=Math.max(s,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await xe(e,t,"icon-shape default"),f=t.pos==="t",p=s+d*2,g=s+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=ba(t),C=-g/2,k=-p/2,v=t.label?8:0,T=re.svg(c),L=ee(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const A=x.get("fill");L.stroke=A??y;const _=T.path(Ti(C,k,g,p,.1),L),M=Math.max(g,h.width),$=p+h.height+v,P=T.rectangle(-M/2,-$/2,M,$,{...L,fill:"transparent",stroke:"none"}),N=c.insert(()=>_,":first-child"),F=c.insert(()=>P);if(t.icon){const E=c.append("g");E.html(`<g>${await Ss(t.icon,{height:s,width:s,fallbackPrefix:""})}</g>`);const B=E.node().getBBox(),q=B.width,z=B.height,I=B.x,D=B.y;E.attr("transform",`translate(${-q/2-I},${f?h.height/2+v/2-z/2-D:-h.height/2-v/2-z/2-D})`),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})`),N.attr("transform",`translate(0,${f?h.height/2+v/2:-h.height/2-v/2})`),ne(t,F),t.intersect=function(E){if(pt.info("iconSquare intersect",t,E),!t.label)return Vt.rect(t,E);const B=t.x??0,q=t.y??0,z=t.height??0;let I=[];return f?I=[{x:B-h.width/2,y:q-z/2},{x:B+h.width/2,y:q-z/2},{x:B+h.width/2,y:q-z/2+h.height+v},{x:B+g/2,y:q-z/2+h.height+v},{x:B+g/2,y:q+z/2},{x:B-g/2,y:q+z/2},{x:B-g/2,y:q-z/2+h.height+v},{x:B-h.width/2,y:q-z/2+h.height+v}]:I=[{x:B-g/2,y:q-z/2},{x:B+g/2,y:q-z/2},{x:B+g/2,y:q-z/2+p},{x:B+h.width/2,y:q-z/2+p},{x:B+h.width/2/2,y:q+z/2},{x:B-h.width/2,y:q+z/2},{x:B-h.width/2,y:q-z/2+p},{x:B-g/2,y:q-z/2+p}],Vt.polygon(t,I,E)},c}w(u0,"iconSquare");async function f0(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),n=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/n;const{labelStyles:a}=ae(t);t.labelStyle=a;const s=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?s??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??n;t.width=Math.max(c,s??0);const{shapeSvg:d,bbox:u,label:f}=await xe(e,t,"image-shape default"),p=t.pos==="t",g=-c/2,m=-h/2,y=t.label?8:0,x=re.svg(d),C=ee(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),T=h+u.height+y,L=x.rectangle(-v/2,-T/2,v,T,{...C,fill:"none",stroke:"none"}),A=d.insert(()=>k,":first-child"),_=d.insert(()=>L);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${p?T/2-h:-T/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})`),A.attr("transform",`translate(0,${p?u.height/2+y/2:-u.height/2-y/2})`),ne(t,_),t.intersect=function(M){if(pt.info("iconSquare intersect",t,M),!t.label)return Vt.rect(t,M);const $=t.x??0,P=t.y??0,N=t.height??0;let F=[];return p?F=[{x:$-u.width/2,y:P-N/2},{x:$+u.width/2,y:P-N/2},{x:$+u.width/2,y:P-N/2+u.height+y},{x:$+c/2,y:P-N/2+u.height+y},{x:$+c/2,y:P+N/2},{x:$-c/2,y:P+N/2},{x:$-c/2,y:P-N/2+u.height+y},{x:$-u.width/2,y:P-N/2+u.height+y}]:F=[{x:$-c/2,y:P-N/2},{x:$+c/2,y:P-N/2},{x:$+c/2,y:P-N/2+h},{x:$+u.width/2,y:P-N/2+h},{x:$+u.width/2/2,y:P+N/2},{x:$-u.width/2,y:P+N/2},{x:$-u.width/2,y:P-N/2+h},{x:$-c/2,y:P-N/2+h}],Vt.polygon(t,F,M)},d}w(f0,"imageSquare");async function g0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=o,a=t.look==="neo"?o*2:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=Math.max(l.height+n*2,t.height??0),h=Math.max(l.width+a*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=re.svg(s),g=ee(t,{}),m=ir(d),y=p.path(m,g);u=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=lo(s,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ne(t,u),t.intersect=function(p){return Vt.polygon(t,d,p)},s}w(g0,"inv_trapezoid");async function p0(e,t){const{shapeSvg:r,bbox:i,label:o}=await xe(e,t,"label"),n=r.insert("rect",":first-child");return n.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))})`),ne(t,n),t.intersect=function(l){return Vt.rect(t,l)},r}w(p0,"labelRect");async function m0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=o,a=t.look==="neo"?o*2:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=Math.max(l.height+n,t.height??0),h=Math.max(l.width+a,(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=re.svg(s),g=ee(t,{}),m=ir(d),y=p.path(m,g);u=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=lo(s,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ne(t,u),t.intersect=function(p){return Vt.polygon(t,d,p)},s}w(m0,"lean_left");async function y0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=o,a=t.look==="neo"?o*2:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=Math.max(l.height+n,t.height??0),h=Math.max(l.width+a,(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=re.svg(s),g=ee(t,{}),m=ir(d),y=p.path(m,g);u=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=lo(s,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ne(t,u),t.intersect=function(p){return Vt.polygon(t,d,p)},s}w(y0,"lean_right");function x0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",be(t)).attr("id",t.domId??t.id),{cssStyles:n}=t,a=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),l=7,c=[{x:a,y:0},{x:0,y:s+l/2},{x:a-2*l,y:s+l/2},{x:0,y:2*s},{x:a,y:s-l/2},{x:2*l,y:s-l/2}],h=re.svg(o),d=ee(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=ir(c),f=h.path(u,d),p=o.insert(()=>f,":first-child");return p.attr("class","outer-path"),n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),i&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",i),p.attr("transform",`translate(-${a/2},${-s})`),ne(t,p),t.intersect=function(g){return pt.info("lightningBolt intersect",t,g),Vt.polygon(t,c,g)},o}w(x0,"lightningBolt");var LB=w((e,t,r,i,o,n,a)=>[`M${e},${t+n}`,`a${o},${n} 0,0,0 ${r},0`,`a${o},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+n+a}`,`a${o},${n} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),AB=w((e,t,r,i,o,n,a)=>[`M${e},${t+n}`,`M${e+r},${t+n}`,`a${o},${n} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${n} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+n+a}`,`a${o},${n} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),FB=w((e,t,r,i,o,n)=>[`M${e-r/2},${-i/2}`,`a${o},${n} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),kg=10,Sg=10;async function b0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-n,t.width<Sg&&(t.width=Sg);const C=y/2/(2.5+y/50);t.height=(t.height??0)-a-C*3,t.height<kg&&(t.height=kg)}const{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(t)),h=(t?.width?t?.width:l.width)+n*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+a*2,p=f*.1;let g;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=re.svg(s),x=AB(0,0,h,f,d,u,p),C=FB(0,u,h,f,d,u),k=ee(t,{}),v=y.path(x,k),T=y.path(C,k);s.insert(()=>T,":first-child").attr("class","line"),g=s.insert(()=>v,":first-child"),g.attr("class","basic label-container"),m&&g.attr("style",m)}else{const y=LB(0,0,h,f,d,u,p);g=s.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Rr(m)).attr("style",i)}return g.attr("label-offset-y",u),g.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),ne(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=Vt.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},s}w(b0,"linedCylinder");async function C0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o;if(t.width||t.height){const k=t.width;t.width=(k??0)*10/11-n*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10)}const{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(t)),h=(t?.width?t?.width:l.width)+(n??0)*2,d=(t?.height?t?.height:l.height)+(a??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:p}=t,g=re.svg(s),m=ee(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},...Zo(-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=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),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/2-(l.y-(l.top??0))})`),ne(t,C),t.intersect=function(k){return Vt.polygon(t,y,k)},s}w(C0,"linedWaveEdgedRect");async function w0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o,s=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-n*2-2*s,10),t.height=Math.max((t?.height??0)-a*2-2*s,10));const{shapeSvg:l,bbox:c,label:h}=await xe(e,t,be(t)),d=(t?.width?t?.width:c.width)+n*2+2*s,u=(t?.height?t?.height:c.height)+a*2+2*s,f=d-2*s,p=u-2*s,g=-f/2,m=-p/2,{cssStyles:y}=t,x=re.svg(l),C=ee(t,{}),k=[{x:g-s,y:m+s},{x:g-s,y:m+p+s},{x:g+f-s,y:m+p+s},{x:g+f-s,y:m+p},{x:g+f,y:m+p},{x:g+f,y:m+p-s},{x:g+f+s,y:m+p-s},{x:g+f+s,y:m-s},{x:g+s,y:m-s},{x:g+s,y:m},{x:g,y:m},{x:g,y:m+s}],v=[{x:g,y:m+s},{x:g+f-s,y:m+s},{x:g+f-s,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 T=ir(k);let L=x.path(T,C);const A=ir(v);let _=x.path(A,C);t.look!=="handDrawn"&&(L=Uh(L),_=Uh(_));const M=l.insert("g",":first-child");return M.insert(()=>L),M.insert(()=>_),M.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-s-(c.x-(c.left??0))}, ${-(c.height/2)+s-(c.y-(c.top??0))})`),ne(t,M),t.intersect=function($){return Vt.polygon(t,k,$)},l}w(w0,"multiRect");async function k0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=t.padding??0,l=t.look==="neo"?16:s,c=t.look==="neo"?12:s;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(n.width,t?.width??0)+l*2,u=Math.max(n.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=Zo(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}],T=[{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}],L=re.svg(o),A=ee(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const _=ir(v),M=L.path(_,A),$=ir(T),P=L.path($,A),N=o.insert(()=>M,":first-child");return N.insert(()=>P),N.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&N.selectAll("path").attr("style",i),N.attr("transform",`translate(0,${-f/2})`),a.attr("transform",`translate(${-(n.width/2)-y-(n.x-(n.left??0))}, ${-(n.height/2)+y-f/2-(n.y-(n.top??0))})`),ne(t,N),t.intersect=function(F){return Vt.polygon(t,v,F)},o}w(k0,"multiWaveEdgedRectangle");async function S0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i,t.useHtmlLabels||Vr(Br())||(t.centerLabel=!0);const{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=Math.max(s.width+(t.padding??0)*2,t?.width??0),h=Math.max(s.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:f}=t,p=re.svg(a),g=ee(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=a.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(${-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),ne(t,y),t.intersect=function(x){return Vt.rect(t,x)},a}w(S0,"note");var $B=w((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 v0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n}=await xe(e,t,be(t)),a=n.width+(t.padding??0),s=n.height+(t.padding??0),l=a+s,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=re.svg(o),p=ee(t,{}),g=$B(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=lo(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ne(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}],y=Vt.polygon(f,m,p);return{x:y.x-.5,y:y.y-.5}},t.intersect=function(f){return this.calcIntersect(t,f)},o}w(v0,"question");async function _0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?21:o??0,a=t.look==="neo"?12:o??0,{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(t)),h=l.width+(t.look==="neo"?n*2:n),d=Math.max(l.height+(t.look==="neo"?a*2:a),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=re.svg(s),k=ee(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=ir(y),T=C.path(v,k),L=s.insert(()=>T,":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(${-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))})`),ne(t,L),t.intersect=function(A){return Vt.polygon(t,y,A)},s}w(_0,"rect_left_inv_arrow");async function T0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const n=e.insert("g").attr("class",o).attr("id",t.domId||t.id),a=n.insert("g"),s=n.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await Wo(s,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Vr(Ke())){const A=h.children[0],_=He(h);d=A.getBoundingClientRect(),_.attr("width",d.width),_.attr("height",d.height)}pt.info("Text 2",l);const u=l||[],f=h.getBBox(),p=await Wo(s,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=s.node().getBBox(),s.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 T,L;if(t.look==="handDrawn"){const A=re.svg(n),_=ee(t,{}),M=A.path(Ti(k,v,x,C,t.rx||0),_),$=A.line(-d.width/2-y,-d.height/2-y+f.height+y,d.width/2+y,-d.height/2-y+f.height+y,_);L=n.insert(()=>(pt.debug("Rough node insert CXC",M),$),":first-child"),T=n.insert(()=>(pt.debug("Rough node insert CXC",M),M),":first-child")}else T=a.insert("rect",":first-child"),L=a.insert("line"),T.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)),L.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 ne(t,T),t.intersect=function(A){return Vt.rect(t,A)},n}w(T0,"rectWithTitle");async function M0(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 Ca(e,t,o)}w(M0,"roundedRect");var Qo=8;async function B0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0,{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=(t?.width??s.width)+o*2+(t.look==="neo"?Qo:Qo*2),h=(t?.height??s.height)+n*2,d=c-Qo,u=h,f=Qo-c/2,p=-h/2,{cssStyles:g}=t,m=re.svg(a),y=ee(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=a.insert(()=>C,":first-child");return k.attr("class","basic label-container outer-path").attr("style",Rr(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-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),ne(t,k),t.intersect=function(v){return Vt.rect(t,v)},a}w(B0,"shadedProcess");async function L0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-n*2,10),t.height=Math.max((t?.height??0)/1.5-a*2,10));const{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(t)),h=(t?.width?t?.width:l.width)+n*2,d=((t?.height?t?.height:l.height)+a*2)*1.5,u=h,f=d/1.5,p=-u/2,g=-f/2,{cssStyles:m}=t,y=re.svg(s),x=ee(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=ir(C),v=y.path(k,x),T=s.insert(()=>v,":first-child");return T.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&T.selectChildren("path").attr("style",i),T.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))})`),ne(t,T),t.intersect=function(L){return Vt.polygon(t,C,L)},s}w(L0,"slopedRect");async function A0(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,n={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o};return Ca(e,t,n)}w(A0,"squareRect");async function F0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?20:o,a=t.look==="neo"?12:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=l.height+(t.look==="neo"?a*2:a),h=l.width+c/4+(t.look==="neo"?n*2:n),d=c/2,{cssStyles:u}=t,f=re.svg(s),p=ee(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const g=[{x:-h/2+d,y:-c/2},{x:h/2-d,y:-c/2},...Vi(-h/2+d,0,d,50,90,270),{x:h/2-d,y:c/2},...Vi(h/2-d,0,d,50,270,450)],m=ir(g),y=f.path(m,p),x=s.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),ne(t,x),t.intersect=function(C){return Vt.polygon(t,g,C)},s}w(F0,"stadium");async function $0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return Ca(e,t,r)}w($0,"state");function E0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i;const{cssStyles:n}=t,{lineColor:a,stateBorder:s,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=re.svg(h),u=ee(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:a,strokeWidth:2}),p=s??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"),n&&y.selectAll("path").attr("style",n),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 ne(t,y),t.intersect=function(x){return Vt.circle(t,(t.width??0)/2,x)},h}w(E0,"stateEnd");function P0(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 n=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let a;if(t.look==="handDrawn"){const l=re.svg(n).circle(0,0,t.width,$_(i));a=n.insert(()=>l),a.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else a=n.insert("circle",":first-child"),a.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 s=e.node()?.ownerSVGElement?.id??"",l=s?`${s}-drop-shadow-small`:"drop-shadow-small";a.attr("style",`filter:url(#${l})`)}return ne(t,a),t.intersect=function(s){return Vt.circle(t,(t.width??7)/2,s)},n}w(P0,"stateStart");var Pn=8;async function O0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t?.padding??8,n=t.look==="neo"?28:o,a=t.look==="neo"?12:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=Math.max(l.width+2*Pn+n,t.width??0),h=Math.max(l.height+a,t.height??0),d=c-2*Pn,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=re.svg(s),y=ee(t,{}),x=m.rectangle(f,p,d+16,u,y),C=m.line(f+Pn,p,f+Pn,p+u,y),k=m.line(f+Pn+d,p,f+Pn+d,p+u,y);s.insert(()=>C,":first-child"),s.insert(()=>k,":first-child");const v=s.insert(()=>x,":first-child"),{cssStyles:T}=t;v.attr("class","basic label-container").attr("style",Rr(T)),ne(t,v)}else{const m=lo(s,d,u,g);i&&m.attr("style",i),ne(t,m)}return t.intersect=function(m){return Vt.polygon(t,g,m)},s}w(O0,"subroutine");var Oc=.2;async function I0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-a*2,10),t.width=Math.max((t?.width??0)-n*2-Oc*(t.height+a*2),10));const{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=(t?.height?t?.height:l.height)+a*2,h=Oc*c,d=Oc*c,f=(t?.width?t?.width:l.width)+n*2+h-h,p=c,g=-f/2,m=-p/2,{cssStyles:y}=t,x=re.svg(s),C=ee(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 T=ir(k),L=x.path(T,C),A=ir(v),_=x.path(A,{...C,fillStyle:"solid"}),M=s.insert(()=>_,":first-child");return M.insert(()=>L,":first-child"),M.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),ne(t,M),t.intersect=function($){return Vt.polygon(t,k,$)},s}w(I0,"taggedRect");async function R0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,label:a}=await xe(e,t,be(t)),s=Math.max(n.width+(t.padding??0)*2,t?.width??0),l=Math.max(n.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*s,d=.2*l,u=l+c,{cssStyles:f}=t,p=re.svg(o),g=ee(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-s/2-s/2*.1,y:u/2},...Zo(-s/2-s/2*.1,u/2,s/2+s/2*.1,u/2,c,.8),{x:s/2+s/2*.1,y:-u/2},{x:-s/2-s/2*.1,y:-u/2}],y=-s/2+s/2*.1,x=-u/2-d*.4,C=[{x:y+s-h,y:(x+l)*1.3},{x:y+s,y:x+l-d},{x:y+s,y:(x+l)*.9},...Zo(y+s,(x+l)*1.25,y+s-h,(x+l)*1.3,-l*.02,.5)],k=ir(m),v=p.path(k,g),T=ir(C),L=p.path(T,{...g,fillStyle:"solid"}),A=o.insert(()=>L,":first-child");return A.insert(()=>v,":first-child"),A.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.attr("transform",`translate(0,${-c/2})`),a.attr("transform",`translate(${-s/2+(t.padding??0)-(n.x-(n.left??0))},${-l/2+(t.padding??0)-c/2-(n.y-(n.top??0))})`),ne(t,A),t.intersect=function(_){return Vt.polygon(t,m,_)},o}w(R0,"taggedWaveEdgedRectangle");async function D0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n}=await xe(e,t,be(t)),a=Math.max(n.width+(t.padding??0),t?.width||0),s=Math.max(n.height+(t.padding??0),t?.height||0),l=-a/2,c=-s/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",a).attr("height",s),ne(t,h),t.intersect=function(d){return Vt.rect(t,d)},o}w(D0,"text");var EB=w((e,t,r,i,o,n)=>`M${e},${t}
|
|
200
|
-
a${o},${n} 0,0,1 0,${-i}
|
|
201
|
-
l${r},0
|
|
202
|
-
a${o},${n} 0,0,1 0,${i}
|
|
203
|
-
M${r},${-i}
|
|
204
|
-
a${o},${n} 0,0,0 0,${i}
|
|
205
|
-
l${-r},0`,"createCylinderPathD"),PB=w((e,t,r,i,o,n)=>[`M${e},${t}`,`M${e+r},${t}`,`a${o},${n} 0,0,0 0,${-i}`,`l${-r},0`,`a${o},${n} 0,0,0 0,${i}`,`l${r},0`].join(" "),"createOuterCylinderPathD"),OB=w((e,t,r,i,o,n)=>[`M${e+r/2},${-i/2}`,`a${o},${n} 0,0,0 0,${i}`].join(" "),"createInnerCylinderPathD"),vg=5,_g=10;async function N0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?12:o/2,a=t.height??0;if(t.height&&(t.height=t.height-n,t.height<vg&&(t.height=vg)),t.width){const y=a/2/(2.5+a/50);t.width=t.width-n-y*3,t.width<_g&&(t.width=_g)}const{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(t)),h=Math.max(t.height??0,l.height)+n,d=h/2,u=d/(2.5+h/50),f=Math.max(t.width??0,l.width)+u+n,{cssStyles:p}=t;let g;if(t.look==="handDrawn"){const m=re.svg(s),y=PB(0,0,f,h,u,d),x=OB(0,0,f,h,u,d),C=m.path(y,ee(t,{})),k=m.path(x,ee(t,{fill:"none"}));g=s.insert(()=>k,":first-child"),g=s.insert(()=>C,":first-child"),g.attr("class","basic label-container"),p&&g.attr("style",p)}else{const m=EB(0,0,f,h,u,d);g=s.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",Rr(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))})`),ne(t,g),t.intersect=function(m){const y=Vt.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},s}w(N0,"tiltedCylinder");async function q0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=(t.look==="neo",o),a=t.look==="neo"?o*2:o,{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=Math.max(l.height+n,t.height??0),h=Math.max(l.width+a,(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=re.svg(s),g=ee(t,{}),m=ir(d),y=p.path(m,g);u=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=lo(s,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ne(t,u),t.intersect=function(p){return Vt.polygon(t,d,p)},s}w(q0,"trapezoid");async function z0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o,s=15,l=5;(t.width||t.height)&&(t.height=(t.height??0)-a*2,t.height<l&&(t.height=l),t.width=(t.width??0)-n*2,t.width<s&&(t.width=s));const{shapeSvg:c,bbox:h}=await xe(e,t,be(t)),d=(t?.width?t?.width:h.width)+n*2,u=(t?.height?t?.height:h.height)+a*2,{cssStyles:f}=t,p=re.svg(c),g=ee(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=ir(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),ne(t,C),t.intersect=function(k){return Vt.polygon(t,m,k)},c}w(z0,"trapezoidalPentagon");var Tg=10,Mg=10;async function W0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.width=((t?.width??0)-n)/2,t.width<Mg&&(t.width=Mg),t.height=t?.height??0,t.height<Tg&&(t.height=Tg));const{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=ao(Ke().flowchart?.htmlLabels),h=(t?.width?t?.width:s.width)+n,d=t?.height?t?.height:h+s.height,u=d,f=[{x:0,y:0},{x:u,y:0},{x:u/2,y:-d}],{cssStyles:p}=t,g=re.svg(a),m=ee(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=ir(f),x=g.path(y,m),C=a.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,ne(t,C),l.attr("transform",`translate(${-s.width/2-(s.x-(s.left??0))}, ${d/2-(s.height+(t.padding??0)/(c?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(k){return pt.info("Triangle intersect",t,f,k),Vt.polygon(t,f,k)},a}w(W0,"triangle");async function H0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=t.look==="neo"?12:o;let s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-n*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10));const{shapeSvg:l,bbox:c,label:h}=await xe(e,t,be(t)),d=(t?.width?t?.width:c.width)+(n??0)*2,u=(t?.height?t?.height:c.height)+(a??0)*2,f=t.look==="neo"?u/4:u/8,p=u+(s?f:-f),{cssStyles:g}=t,y=14-d,x=y>0?y/2:0,C=re.svg(l),k=ee(t,{});t.look!=="handDrawn"&&(k.roughness=0,k.fillStyle="solid");const v=[{x:-d/2-x,y:p/2},...Zo(-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}],T=ir(v),L=C.path(T,k),A=l.insert(()=>L,":first-child");return A.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&A.selectAll("path").attr("style",i),A.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))})`),ne(t,A),t.intersect=function(_){return Vt.polygon(t,v,_)},l}w(H0,"waveEdgedRectangle");async function Y0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.padding??0,n=t.look==="neo"?16:o,a=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-a-k*(20/9)),t.width=t.width-n*2}const{shapeSvg:s,bbox:l}=await xe(e,t,be(t)),c=(t?.width?t?.width:l.width)+n*2,h=(t?.height?t?.height:l.height)+a,d=h/8,u=h+d*2,{cssStyles:f}=t,p=re.svg(s),g=ee(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const m=[{x:-c/2,y:u/2},...Zo(-c/2,u/2,c/2,u/2,d,1),{x:c/2,y:-u/2},...Zo(c/2,-u/2,-c/2,-u/2,d,-1)],y=ir(m),x=p.path(y,g),C=s.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),ne(t,C),t.intersect=function(k){return Vt.polygon(t,m,k)},s}w(Y0,"waveRectangle");var Ar=10;async function X0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-o*2-Ar,10),t.height=Math.max((t?.height??0)-n*2-Ar,10));const{shapeSvg:a,bbox:s,label:l}=await xe(e,t,be(t)),c=(t?.width?t?.width:s.width)+o*2+Ar,h=(t?.height?t?.height:s.height)+n*2+Ar,d=c-Ar,u=h-Ar,f=-d/2,p=-u/2,{cssStyles:g}=t,m=re.svg(a),y=ee(t,{}),x=[{x:f-Ar,y:p-Ar},{x:f-Ar,y:p+u},{x:f+d,y:p+u},{x:f+d,y:p-Ar}],C=`M${f-Ar},${p-Ar} L${f+d},${p-Ar} L${f+d},${p+u} L${f-Ar},${p+u} L${f-Ar},${p-Ar}
|
|
206
|
-
M${f-Ar},${p} L${f+d},${p}
|
|
207
|
-
M${f},${p-Ar} L${f},${p+u}`;t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const k=m.path(C,y),v=a.insert(()=>k,":first-child");return v.attr("transform",`translate(${Ar/2}, ${Ar/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(${-(s.width/2)+Ar/2-(s.x-(s.left??0))}, ${-(s.height/2)+Ar/2-(s.y-(s.top??0))})`),ne(t,v),t.intersect=function(T){return Vt.polygon(t,x,T)},a}w(X0,"windowPane");var Bg=new Set(["redux-color","redux-dark-color"]),IB=new Set(["redux","redux-dark","redux-color","redux-dark-color"]);async function au(e,t){const r=t;r.alias&&(t.label=r.alias);const{theme:i,themeVariables:o}=Br(),{rowEven:n,rowOdd:a,nodeBorder:s,borderColorArray:l}=o;if(t.look==="handDrawn"){const{themeVariables:tt}=Br(),{background:J}=tt,ct={...t,id:t.id+"-background",domId:(t.domId||t.id)+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]};await au(e,ct)}const c=Br();t.useHtmlLabels=c.htmlLabels;let h=c.er?.diagramPadding??10,d=c.er?.entityPadding??6;const{cssStyles:u}=t,{labelStyles:f,nodeStyles:p}=ae(t);if(r.attributes.length===0&&t.label){const tt={rx:0,ry:0,labelPaddingX:h,labelPaddingY:h*1.5};vo(t.label,c)+tt.labelPaddingX*2<c.er.minEntityWidth&&(t.width=c.er.minEntityWidth);const J=await Ca(e,t,tt);if(i!=null&&Bg.has(i)){const ct=r.colorIndex??0;J.attr("data-color-id",`color-${ct%l.length}`)}if(!ao(c.htmlLabels)){const ct=J.select("text"),yt=ct.node()?.getBBox();ct.attr("transform",`translate(${-yt.width/2}, 0)`)}return J}c.htmlLabels||(h*=1.25,d*=1.25);let g=be(t);g||(g="node default");const m=e.insert("g").attr("class",g).attr("id",t.domId||t.id),y=await Dn(m,t.label??"",c,0,0,["name"],f);y.height+=d;let x=0;const C=[],k=[];let v=0,T=0,L=0,A=0,_=!0,M=!0;for(const tt of r.attributes){const J=await Dn(m,tt.type,c,0,x,["attribute-type"],f);v=Math.max(v,J.width+h);const ct=await Dn(m,tt.name,c,0,x,["attribute-name"],f);T=Math.max(T,ct.width+h);const yt=await Dn(m,tt.keys.join(),c,0,x,["attribute-keys"],f);L=Math.max(L,yt.width+h);const Y=await Dn(m,tt.comment,c,0,x,["attribute-comment"],f);A=Math.max(A,Y.width+h);const H=Math.max(J.height,ct.height,yt.height,Y.height)+d;k.push({yOffset:x,rowHeight:H}),x+=H}let $=4;L<=h&&(_=!1,L=0,$--),A<=h&&(M=!1,A=0,$--);const P=m.node().getBBox();if(y.width+h*2-(v+T+L+A)>0){const tt=y.width+h*2-(v+T+L+A);v+=tt/$,T+=tt/$,L>0&&(L+=tt/$),A>0&&(A+=tt/$)}const N=v+T+L+A,F=re.svg(m),E=ee(t,{});t.look!=="handDrawn"&&(E.roughness=0,E.fillStyle="solid");let B=0;k.length>0&&(B=k.reduce((tt,J)=>tt+(J?.rowHeight??0),0));const q=Math.max(P.width+h*2,t?.width||0,N),z=Math.max((B??0)+y.height,t?.height||0),I=-q/2,D=-z/2;if(m.selectAll("g:not(:first-child)").each((tt,J,ct)=>{const yt=He(ct[J]),Y=yt.attr("transform");let H=0,V=0;if(Y){const at=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(Y);at&&(H=parseFloat(at[1]),V=parseFloat(at[2]),yt.attr("class").includes("attribute-name")?H+=v:yt.attr("class").includes("attribute-keys")?H+=v+T:yt.attr("class").includes("attribute-comment")&&(H+=v+T+L))}yt.attr("transform",`translate(${I+h/2+H}, ${V+D+y.height+d/2})`)}),m.select(".name").attr("transform","translate("+-y.width/2+", "+(D+d/2)+")"),i!=null&&Bg.has(i)){const tt=r.colorIndex??0;m.attr("data-color-id",`color-${tt%l.length}`)}const Z=F.rectangle(I,D,q,z,E),G=m.insert(()=>Z,":first-child").attr("class","outer-path").attr("style",u.join(""));C.push(0);for(const[tt,J]of k.entries()){const yt=(tt+1)%2===0&&J.yOffset!==0,Y=F.rectangle(I,y.height+D+J?.yOffset,q,J?.rowHeight,{...E,fill:yt?n:a,stroke:s});m.insert(()=>Y,"g.label").attr("style",u.join("")).attr("class",`row-rect-${yt?"even":"odd"}`)}const W=1e-4;let Q=Nn(I,y.height+D,q+I,y.height+D,W),et=F.polygon(Q.map(tt=>[tt.x,tt.y]),E);if(m.insert(()=>et).attr("class","divider"),Q=Nn(v+I,y.height+D,v+I,z+D,W),et=F.polygon(Q.map(tt=>[tt.x,tt.y]),E),m.insert(()=>et).attr("class","divider"),_){const tt=v+T+I;Q=Nn(tt,y.height+D,tt,z+D,W),et=F.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>et).attr("class","divider")}if(M){const tt=v+T+L+I;Q=Nn(tt,y.height+D,tt,z+D,W),et=F.polygon(Q.map(J=>[J.x,J.y]),E),m.insert(()=>et).attr("class","divider")}for(const tt of C){const J=y.height+D+tt;Q=Nn(I,J,q+I,J,W),et=F.polygon(Q.map(ct=>[ct.x,ct.y]),E),m.insert(()=>et).attr("class","divider")}if(ne(t,G),p&&t.look!=="handDrawn")if(i!=null&&IB.has(i))m.selectAll("path").attr("style",p);else{const J=p.split(";")?.filter(ct=>ct.includes("stroke"))?.map(ct=>`${ct}`).join("; ");m.selectAll("path").attr("style",J??""),m.selectAll(".row-rect-even path").attr("style",p)}return t.intersect=function(tt){return Vt.rect(t,tt)},m}w(au,"erBox");async function Dn(e,t,r,i=0,o=0,n=[],a=""){const s=e.insert("g").attr("class",`label ${n.join(" ")}`).attr("transform",`translate(${i}, ${o})`).attr("style",a);t!==gf(t)&&(t=gf(t),t=t.replaceAll("<","<").replaceAll(">",">"));const l=s.node().appendChild(await Ni(s,t,{width:vo(t,r)+100,style:a,useHtmlLabels:r.htmlLabels},r));if(t.includes("<")||t.includes(">")){let h=l.children[0];for(h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">");h.childNodes[0];)h=h.childNodes[0],h.textContent=h.textContent.replaceAll("<","<").replaceAll(">",">")}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}w(Dn,"addText");function Nn(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}]}w(Nn,"lineToPolygon");async function j0(e,t,r,i,o=r.class.padding??12){const n=i?0:3,a=e.insert("g").attr("class",be(t)).attr("id",t.domId||t.id);let s=null,l=null,c=null,h=null,d=0,u=0,f=0;if(s=a.insert("g").attr("class","annotation-group text"),t.annotations.length>0){const x=t.annotations[0];await Ha(s,{text:`«${x}»`},0),d=s.node().getBBox().height}l=a.insert("g").attr("class","label-group text"),await Ha(l,t,0,["font-weight: bolder"]);const p=l.node().getBBox();u=p.height,c=a.insert("g").attr("class","members-group text");let g=0;for(const x of t.members){const C=await Ha(c,x,g,[x.parseClassifier()]);g+=C+n}f=c.node().getBBox().height,f<=0&&(f=o/2),h=a.insert("g").attr("class","methods-group text");let m=0;for(const x of t.methods){const C=await Ha(h,x,m,[x.parseClassifier()]);m+=C+n}let y=a.node().getBBox();if(s!==null){const x=s.node().getBBox();s.attr("transform",`translate(${-x.width/2})`)}return l.attr("transform",`translate(${-p.width/2}, ${d})`),y=a.node().getBBox(),c.attr("transform",`translate(0, ${d+u+o*2})`),y=a.node().getBBox(),h.attr("transform",`translate(0, ${d+u+(f?f+o*4:o*2)})`),y=a.node().getBBox(),{shapeSvg:a,bbox:y}}w(j0,"textHelper");async function Ha(e,t,r,i=[]){const o=e.insert("g").attr("class","label").attr("style",i.join("; ")),n=Br();let a="useHtmlLabels"in t?t.useHtmlLabels:ao(n.htmlLabels)??!0,s="";"text"in t?s=t.text:s=t.label,!a&&s.startsWith("\\")&&(s=s.substring(1)),ns(s)&&(a=!0);const l=await Ni(o,wd(Uo(s)),{width:vo(s,n)+50,classes:"markdown-node-label",useHtmlLabels:a},n);let c,h=1;if(a){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 ru(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(">"))&&(d.textContent=s[0]+s.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),s[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}w(Ha,"addText");async function G0(e,t){const r=Ke(),{themeVariables:i}=r,{useGradient:o}=i,n=r.class.padding??12,a=n,s=t.useHtmlLabels??ao(r.htmlLabels)??!0,l=t;l.annotations=l.annotations??[],l.members=l.members??[],l.methods=l.methods??[];const{shapeSvg:c,bbox:h}=await j0(e,t,r,s,a),{labelStyles:d,nodeStyles:u}=ae(t);t.labelStyle=d,t.cssStyles=l.styles||"";const f=l.styles?.join(";")||u||"";t.cssStyles||(t.cssStyles=f.replaceAll("!important","").split(";"));const p=l.members.length===0&&l.methods.length===0&&!r.class?.hideEmptyMembersBox,g=re.svg(c),m=ee(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=Math.max(t.width??0,h.width);let x=Math.max(t.height??0,h.height);const C=(t.height??0)>h.height;l.members.length===0&&l.methods.length===0?x+=a:l.members.length>0&&l.methods.length===0&&(x+=a*2);const k=-y/2,v=-x/2;let T=p?n*2:l.members.length===0&&l.methods.length===0?-n:0;C&&(T=n*2);const L=g.rectangle(k-n,v-n-(p?n:l.members.length===0&&l.methods.length===0?-n/2:0),y+2*n,x+2*n+T,m),A=c.insert(()=>L,":first-child");A.attr("class","basic label-container outer-path");const _=A.node().getBBox(),M=c.select(".annotation-group").node().getBBox().height-(p?n/2:0)||0,$=c.select(".label-group").node().getBBox().height-(p?n/2:0)||0,P=c.select(".members-group").node().getBBox().height-(p?n/2:0)||0,N=(M+$+v+n-(v-n-(p?n:l.members.length===0&&l.methods.length===0?-n/2:0)))/2;if(c.selectAll(".text").each((F,E,B)=>{const q=He(B[E]),z=q.attr("transform");let I=0;if(z){const W=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(z);W&&(I=parseFloat(W[2]))}let D=I+v+n-(p?n:l.members.length===0&&l.methods.length===0?-n/2:0);if(q.attr("class").includes("methods-group")){const G=Math.max(P,a/2);C?D=Math.max(N,M+$+G+v+a*2+n)+a*2:D=M+$+G+v+a*4+n}l.members.length===0&&l.methods.length===0&&r.class?.hideEmptyMembersBox&&(l.annotations.length>0?D=I-a:D=I),s||(D-=4);let Z=k;(q.attr("class").includes("label-group")||q.attr("class").includes("annotation-group"))&&(Z=-q.node()?.getBBox().width/2||0,c.selectAll("text").each(function(G,W,Q){window.getComputedStyle(Q[W]).textAnchor==="middle"&&(Z=0)})),q.attr("transform",`translate(${Z}, ${D})`)}),l.members.length>0||l.methods.length>0||p){const F=M+$+v+n,E=g.line(_.x,F,_.x+_.width,F+.001,m);c.insert(()=>E).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(p||l.members.length>0||l.methods.length>0){const F=M+$+P+v+a*2+n,E=g.line(_.x,C?Math.max(N,F):F,_.x+_.width,(C?Math.max(N,F):F)+.001,m);c.insert(()=>E).attr("class",`divider${t.look==="neo"&&!o?" neo-line":""}`).attr("style",f)}if(l.look!=="handDrawn"&&c.selectAll("path").attr("style",f),A.select(":nth-child(2)").attr("style",f),c.selectAll(".divider").select("path").attr("style",f),t.labelStyle?c.selectAll("span").attr("style",t.labelStyle):c.selectAll("span").attr("style",f),!s){const F=RegExp(/color\s*:\s*([^;]*)/),E=F.exec(f);if(E){const B=E[0].replace("color","fill");c.selectAll("tspan").attr("style",B)}else if(d){const B=F.exec(d);if(B){const q=B[0].replace("color","fill");c.selectAll("tspan").attr("style",q)}}}return ne(t,A),t.intersect=function(F){return Vt.rect(t,F)},c}w(G0,"classBox");async function U0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const o=t,n=t,a=20,s=20,l="verifyMethod"in t,c=be(t),h=Ke(),{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 ji(g,`<<${o.type}>>`,0,t.labelStyle):m=await ji(g,"<<Element>>",0,t.labelStyle);let y=m;const x=await ji(g,o.name,y,t.labelStyle+"; font-weight: bold;");if(y+=x+s,l){const $=await ji(g,`${o.requirementId?`ID: ${o.requirementId}`:""}`,y,t.labelStyle,p);y+=$;const P=await ji(g,`${o.text?`Text: ${o.text}`:""}`,y,t.labelStyle,p);y+=P;const N=await ji(g,`${o.risk?`Risk: ${o.risk}`:""}`,y,t.labelStyle,p);y+=N,await ji(g,`${o.verifyMethod?`Verification: ${o.verifyMethod}`:""}`,y,t.labelStyle,p)}else{const $=await ji(g,`${n.type?`Type: ${n.type}`:""}`,y,t.labelStyle,p);y+=$,await ji(g,`${n.docRef?`Doc Ref: ${n.docRef}`:""}`,y,t.labelStyle,p)}const C=(g.node()?.getBBox().width??200)+a,k=(g.node()?.getBBox().height??200)+a,v=-C/2,T=-k/2,L=re.svg(g),A=ee(t,{});t.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const _=L.rectangle(v,T,C,k,A),M=g.insert(()=>_,":first-child");if(M.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,N)=>{const F=He(N[P]),E=F.attr("transform");let B=0,q=0;if(E){const Z=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(E);Z&&(B=parseFloat(Z[1]),q=parseFloat(Z[2]))}const z=q-k/2;let I=v+a/2;(P===0||P===1)&&(I=B),F.attr("transform",`translate(${I}, ${z+a})`)}),y>m+x+s){const $=T+m+x+s;let P;if(t.look==="neo"){const E=[[v,$],[v+C,$],[v+C,$+.001],[v,$+.001]];P=L.polygon(E,A)}else P=L.line(v,$,v+C,$,A);g.insert(()=>P).attr("class","divider")}return ne(t,M),t.intersect=function($){return Vt.rect(t,$)},i&&t.look!=="handDrawn"&&(f||u?.length)&&g.selectAll("path").attr("style",i),g}w(U0,"requirementBox");async function ji(e,t,r,i="",o="center"){if(t==="")return 0;const n=e.insert("g").attr("class","label").attr("style",i),a=Ke(),s=a.htmlLabels??!0,l=await Ni(n,wd(Uo(t)),{width:vo(t,a)+50,classes:"markdown-node-label",useHtmlLabels:s,style:i},a);let c;if(s){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 n.attr("transform",`translate(${-c.width/2},${-c.height/2+r})`),c.height}w(ji,"addText");var RB=w(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 V0(e,t,{config:r}){const{labelStyles:i,nodeStyles:o}=ae(t);t.labelStyle=i||"";const n=10,a=t.width;t.width=(t.width??200)-10;const{shapeSvg:s,bbox:l,label:c}=await xe(e,t,be(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=s.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 Ec(u,"ticket"in t&&t.ticket||"",f):{label:p,bbox:g}=await Ec(s,"ticket"in t&&t.ticket||"",f);const{label:m,bbox:y}=await Ec(s,"assigned"in t&&t.assigned||"",f);t.width=a;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,T=-C/2,L=-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*n)+", "+(-k+l.height/2)+")");let A;const{rx:_,ry:M}=t,{cssStyles:$}=t;if(t.look==="handDrawn"){const P=re.svg(s),N=ee(t,{}),F=_||M?P.path(Ti(T,L,C,v,_||0),N):P.rectangle(T,L,C,v,N);A=s.insert(()=>F,":first-child"),A.attr("class","basic label-container").attr("style",$||null)}else{A=s.insert("rect",":first-child"),A.attr("class","basic label-container __APA__").attr("style",o).attr("rx",_??5).attr("ry",M??5).attr("x",T).attr("y",L).attr("width",C).attr("height",v);const P="priority"in t&&t.priority;if(P){const N=s.append("line"),F=T+2,E=L+Math.floor((_??0)/2),B=L+v-Math.floor((_??0)/2);N.attr("x1",F).attr("y1",E).attr("x2",F).attr("y2",B).attr("stroke-width","4").attr("stroke",RB(P))}}return ne(t,A),t.height=v,t.intersect=function(P){return Vt.rect(t,P)},s}w(V0,"kanbanItem");async function Z0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,halfPadding:a,label:s}=await xe(e,t,be(t)),l=n.width+10*a,c=n.height+8*a,h=.15*l,{cssStyles:d}=t,u=n.width+20,f=n.height+20,p=Math.max(l,u),g=Math.max(c,f);s.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`);let m;const y=`M0 0
|
|
208
|
-
a${h},${h} 1 0,0 ${p*.25},${-1*g*.1}
|
|
209
|
-
a${h},${h} 1 0,0 ${p*.25},0
|
|
210
|
-
a${h},${h} 1 0,0 ${p*.25},0
|
|
211
|
-
a${h},${h} 1 0,0 ${p*.25},${g*.1}
|
|
212
|
-
|
|
213
|
-
a${h},${h} 1 0,0 ${p*.15},${g*.33}
|
|
214
|
-
a${h*.8},${h*.8} 1 0,0 0,${g*.34}
|
|
215
|
-
a${h},${h} 1 0,0 ${-1*p*.15},${g*.33}
|
|
216
|
-
|
|
217
|
-
a${h},${h} 1 0,0 ${-1*p*.25},${g*.15}
|
|
218
|
-
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
219
|
-
a${h},${h} 1 0,0 ${-1*p*.25},0
|
|
220
|
-
a${h},${h} 1 0,0 ${-1*p*.25},${-1*g*.15}
|
|
221
|
-
|
|
222
|
-
a${h},${h} 1 0,0 ${-1*p*.1},${-1*g*.33}
|
|
223
|
-
a${h*.8},${h*.8} 1 0,0 0,${-1*g*.34}
|
|
224
|
-
a${h},${h} 1 0,0 ${p*.1},${-1*g*.33}
|
|
225
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const x=re.svg(o),C=ee(t,{}),k=x.path(y,C);m=o.insert(()=>k,":first-child"),m.attr("class","basic label-container").attr("style",Rr(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})`),ne(t,m),t.calcIntersect=function(x,C){return Vt.rect(x,C)},t.intersect=function(x){return pt.info("Bang intersect",t,x),Vt.rect(t,x)},o}w(Z0,"bang");async function K0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,halfPadding:a,label:s}=await xe(e,t,be(t)),l=n.width+2*a,c=n.height+2*a,h=.15*l,d=.25*l,u=.35*l,f=.2*l,{cssStyles:p}=t;let g;const m=`M0 0
|
|
226
|
-
a${h},${h} 0 0,1 ${l*.25},${-1*l*.1}
|
|
227
|
-
a${u},${u} 1 0,1 ${l*.4},${-1*l*.1}
|
|
228
|
-
a${d},${d} 1 0,1 ${l*.35},${l*.2}
|
|
229
|
-
|
|
230
|
-
a${h},${h} 1 0,1 ${l*.15},${c*.35}
|
|
231
|
-
a${f},${f} 1 0,1 ${-1*l*.15},${c*.65}
|
|
232
|
-
|
|
233
|
-
a${d},${h} 1 0,1 ${-1*l*.25},${l*.15}
|
|
234
|
-
a${u},${u} 1 0,1 ${-1*l*.5},0
|
|
235
|
-
a${h},${h} 1 0,1 ${-1*l*.25},${-1*l*.15}
|
|
236
|
-
|
|
237
|
-
a${h},${h} 1 0,1 ${-1*l*.1},${-1*c*.35}
|
|
238
|
-
a${f},${f} 1 0,1 ${l*.1},${-1*c*.65}
|
|
239
|
-
H0 V0 Z`;if(t.look==="handDrawn"){const y=re.svg(o),x=ee(t,{}),C=y.path(m,x);g=o.insert(()=>C,":first-child"),g.attr("class","basic label-container").attr("style",Rr(p))}else g=o.insert("path",":first-child").attr("class","basic label-container").attr("style",i).attr("d",m);return s.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),g.attr("transform",`translate(${-l/2}, ${-c/2})`),ne(t,g),t.calcIntersect=function(y,x){return Vt.rect(y,x)},t.intersect=function(y){return pt.info("Cloud intersect",t,y),Vt.rect(t,y)},o}w(K0,"cloud");async function Q0(e,t){const{labelStyles:r,nodeStyles:i}=ae(t);t.labelStyle=r;const{shapeSvg:o,bbox:n,halfPadding:a,label:s}=await xe(e,t,be(t)),l=n.width+8*a,c=n.height+2*a,h=5,d=t.look==="neo"?`
|
|
240
|
-
M${-l/2} ${c/2-h}
|
|
241
|
-
v${-c+2*h}
|
|
242
|
-
q0,-${h} ${h},-${h}
|
|
243
|
-
h${l-2*h}
|
|
244
|
-
q${h},0 ${h},${h}
|
|
245
|
-
v${c-h}
|
|
246
|
-
H${-l/2}
|
|
247
|
-
Z
|
|
248
|
-
`:`
|
|
249
|
-
M${-l/2} ${c/2-h}
|
|
250
|
-
v${-c+2*h}
|
|
251
|
-
q0,-${h} ${h},-${h}
|
|
252
|
-
h${l-2*h}
|
|
253
|
-
q${h},0 ${h},${h}
|
|
254
|
-
v${c-2*h}
|
|
255
|
-
q0,${h} ${-h},${h}
|
|
256
|
-
h${-(l-2*h)}
|
|
257
|
-
q${-h},0 ${-h},${-h}
|
|
258
|
-
Z
|
|
259
|
-
`;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),s.attr("transform",`translate(${-n.width/2}, ${-n.height/2})`),o.append(()=>s.node()),ne(t,u),t.calcIntersect=function(f,p){return Vt.rect(f,p)},t.intersect=function(f){return Vt.rect(t,f)},o}w(Q0,"defaultMindmapNode");async function J0(e,t){const r={padding:t.padding??0};return nu(e,t,r)}w(J0,"mindmapCircle");var DB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:A0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:M0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:F0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:O0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Qx},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Jx},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:o0},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:Rx},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:Yx},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:qx},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Kx},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:nu},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:Z0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:K0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:v0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:s0},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:y0},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:m0},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:q0},{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:g0},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:e0},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:D0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:zx},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:B0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:P0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:E0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:n0},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:l0},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Gx},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Ux},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Vx},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:x0},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:H0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:a0},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:N0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:b0},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Zx},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:t0},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:W0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:X0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:r0},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:z0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:i0},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:L0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:k0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:w0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Ix},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:jx},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:R0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:I0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Y0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:_0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:C0}],NB=w(()=>{const t=[...Object.entries({state:$0,choice:Wx,note:S0,composite:Hx,rectWithTitle:T0,labelRect:p0,block_arrow:Nx,collapsedGroup:Dx,iconSquare:u0,iconCircle:h0,icon:c0,iconRounded:d0,imageSquare:f0,anchor:Px,kanbanItem:V0,mindmapCircle:J0,defaultMindmapNode:Q0,classBox:G0,erBox:au,requirementBox:U0}),...DB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),tb=NB();function qB(e){return e in tb}w(qB,"isValidShape");var Jl=w(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),tc=new Map;async function su(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const n=t.shape?tb[t.shape]:void 0;if(!n)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let a;r.config.securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a??null),o=await n(i,t,r)}else o=await n(e,t,r),i=o;return i.attr("data-look",Rr(t.look)),t.tooltip&&o.attr("title",t.tooltip),tc.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}w(su,"insertNode");var T6=w((e,t)=>{tc.set(t.id,e)},"setNodeElem"),zB=w(()=>{tc.clear()},"clear"),Lg=w(e=>{const t=tc.get(e.id);pt.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"),WB=w(async(e,t)=>{const r=Ke(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:n,clusterBorder:a}=i,s=a,{labelStyles:l,nodeStyles:c,borderStyles:h,backgroundStyles:d}=ae(t),u=e.insert("g").attr("class","cluster swimlane "+(t.cssClasses||"")).attr("id",t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look),f=ao(r.flowchart.htmlLabels),p=t.direction==="LR",g=u.insert("g").attr("class","cluster-label swimlane-label"),m=await Ni(g,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width});let y=m.getBBox();if(f){const N=m.children[0],F=He(m);y=N.getBoundingClientRect(),F.attr("width",y.width),F.attr("height",y.height)}const x=t.padding??0,C=t.width<=y.width+x?y.width+x:t.width;t.width<=y.width+x?t.diff=(C-t.width)/2-x:t.diff=-x;const k=t.height,v=t.y-k/2,T=t.y+k/2,L=t.x-C/2,A=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:v+k/3,_=p?4:0,M=y.height+2*_;let $,P;if(p){const N=Math.max(M,y.height+2*_),F=L+N,E=Math.max(0,C-N);if(t.look==="handDrawn"){const z=re.svg(u),I=ee(t,{roughness:.7,fill:n,stroke:s,fillWeight:3,seed:o}),D=ee(t,{roughness:.7,fill:"none",stroke:s,seed:o}),Z=z.rectangle(L,v,N,k,I);$=u.insert(()=>Z,":first-child");const G=z.rectangle(F,v,E,k,D);P=u.insert(()=>G,":first-child"),$.select("path:nth-child(2)").attr("style",h.join(";")),$.select("path").attr("style",d.join(";").replace("fill","stroke"))}else $=u.insert("rect",":first-child"),P=u.insert("rect",":first-child"),$.attr("class","swimlane-title").attr("style",c).attr("x",L).attr("y",v).attr("width",N).attr("height",k).attr("fill",n).attr("stroke",s),P.attr("class","swimlane-body").attr("style",c).attr("x",F).attr("y",v).attr("width",E).attr("height",k).attr("fill","none").attr("stroke",s);const B=L+N/2,q=t.y;g.attr("transform",`translate(${B}, ${q}) rotate(-90) translate(${-y.width/2}, ${-y.height/2})`)}else{const N=Math.max(0,A-v),F=Math.min(M,N),E=v+F,B=Math.max(0,T-E),q=t.x-C/2;if(t.look==="handDrawn"){const D=re.svg(u),Z=ee(t,{roughness:.7,fill:n,stroke:s,fillWeight:3,seed:o}),G=ee(t,{roughness:.7,fill:"none",stroke:s,seed:o}),W=D.rectangle(q,v,C,F,Z);$=u.insert(()=>W,":first-child");const Q=D.rectangle(q,E,C,B,G);P=u.insert(()=>Q,":first-child"),$.select("path:nth-child(2)").attr("style",h.join(";")),$.select("path").attr("style",d.join(";").replace("fill","stroke"))}else $=u.insert("rect",":first-child"),P=u.insert("rect",":first-child"),$.attr("class","swimlane-title").attr("style",c).attr("x",q).attr("y",v).attr("width",C).attr("height",F).attr("fill",n).attr("stroke",s),P.attr("class","swimlane-body").attr("style",c).attr("x",q).attr("y",E).attr("width",C).attr("height",B).attr("fill","none").attr("stroke",s);const z=t.x-y.width/2,I=v+(F-y.height)/2;g.attr("transform",`translate(${z}, ${I})`)}if(pt.trace("Swimlane data ",t,JSON.stringify(t)),l){const N=g.select("span");N&&N.attr("style",l)}return t.offsetX=0,t.width=C,t.height=k,t.offsetY=y.height-x/2,t.intersect=function(N){return _n(t,N)},{cluster:u,labelBBox:y}},"swimlane"),eb=w(async(e,t)=>{pt.info("Creating subgraph rect for ",t.id,t);const r=Ke(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:n,clusterBorder:a}=i,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ae(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Vr(r),f=d.insert("g").attr("class","cluster-label ");let p;t.labelType==="markdown"?p=await Ni(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width}):p=await Wo(f,t.label,t.labelStyle||"",!1,!0);let g=p.getBBox();if(Vr(r)){const L=p.children[0],A=He(p);g=L.getBoundingClientRect(),A.attr("width",g.width),A.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;pt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const L=re.svg(d),A=ee(t,{roughness:.7,fill:n,stroke:a,fillWeight:3,seed:o}),_=L.path(Ti(x,C,m,y,0),A);k=d.insert(()=>(pt.debug("Rough node insert CXC",_),_),":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}=Jl(r);if(f.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+v})`),s){const L=f.select("span");L&&L.attr("style",s)}const T=k.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=g.height-t.padding/2,t.intersect=function(L){return _n(t,L)},{cluster:d,labelBBox:g}},"rect"),HB=w((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,n=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-n).attr("y",t.y-t.height/2-n).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const a=i.node().getBBox();return t.width=a.width,t.height=a.height,t.intersect=function(s){return _n(t,s)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),YB=w(async(e,t)=>{const r=Ke(),{themeVariables:i,handDrawnSeed:o}=r,{altBackground:n,compositeBackground:a,compositeTitleBackground:s,nodeBorder:l}=i,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look),h=c.insert("g",":first-child"),d=c.insert("g").attr("class","cluster-label");let u=c.append("rect");const f=await Wo(d,t.label,t.labelStyle,void 0,!0);let p=f.getBBox();if(Vr(r)){const _=f.children[0],M=He(f);p=_.getBoundingClientRect(),M.attr("width",p.width),M.attr("height",p.height)}const g=0*t.padding,m=g/2,y=(t.width<=p.width+t.padding?p.width+t.padding:t.width)+g;t.width<=p.width+t.padding?t.diff=(y-t.width)/2-t.padding:t.diff=-t.padding;const x=t.height+g,C=t.height+g-p.height-6,k=t.x-y/2,v=t.y-x/2;t.width=y;const T=t.y-t.height/2-m+p.height+2;let L;if(t.look==="handDrawn"){const _=t.cssClasses.includes("statediagram-cluster-alt"),M=re.svg(c),$=t.rx||t.ry?M.path(Ti(k,v,y,x,10),{roughness:.7,fill:s,fillStyle:"solid",stroke:l,seed:o}):M.rectangle(k,v,y,x,{seed:o});L=c.insert(()=>$,":first-child");const P=M.rectangle(k,T,y,C,{fill:_?n:a,fillStyle:_?"hachure":"solid",stroke:l,seed:o});L=c.insert(()=>$,":first-child"),u=c.insert(()=>P)}else L=h.insert("rect",":first-child"),L.attr("class","outer").attr("x",k).attr("y",v).attr("width",y).attr("height",x).attr("data-look",t.look),u.attr("class","inner").attr("x",k).attr("y",T).attr("width",y).attr("height",C);d.attr("transform",`translate(${t.x-p.width/2}, ${v+1-(Vr(r)?0:3)})`);const A=L.node().getBBox();return t.height=A.height,t.offsetX=0,t.offsetY=p.height-t.padding/2,t.labelBBox=p,t.intersect=function(_){return _n(t,_)},{cluster:c,labelBBox:p}},"roundedWithTitle"),XB=w(async(e,t)=>{pt.info("Creating subgraph rect for ",t.id,t);const r=Ke(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:n,clusterBorder:a}=i,{labelStyles:s,nodeStyles:l,borderStyles:c,backgroundStyles:h}=ae(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Vr(r),f=d.insert("g").attr("class","cluster-label "),p=await Ni(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let g=p.getBBox();if(Vr(r)){const L=p.children[0],A=He(p);g=L.getBoundingClientRect(),A.attr("width",g.width),A.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;pt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const L=re.svg(d),A=ee(t,{roughness:.7,fill:n,stroke:a,fillWeight:4,seed:o}),_=L.path(Ti(x,C,m,y,t.rx),A);k=d.insert(()=>(pt.debug("Rough node insert CXC",_),_),":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}=Jl(r);if(f.attr("transform",`translate(${t.x-g.width/2}, ${t.y-t.height/2+v})`),s){const L=f.select("span");L&&L.attr("style",s)}const T=k.node().getBBox();return t.offsetX=0,t.width=T.width,t.height=T.height,t.offsetY=g.height-t.padding/2,t.intersect=function(L){return _n(t,L)},{cluster:d,labelBBox:g}},"kanbanSection"),jB=w((e,t)=>{const r=Ke(),{themeVariables:i,handDrawnSeed:o}=r,{nodeBorder:n}=i,a=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look),s=a.insert("g",":first-child"),l=0*t.padding,c=t.width+l;t.diff=-t.padding;const h=t.height+l,d=t.x-c/2,u=t.y-h/2;t.width=c;let f;if(t.look==="handDrawn"){const m=re.svg(a).rectangle(d,u,c,h,{fill:"lightgrey",roughness:.5,strokeLineDash:[5],stroke:n,seed:o});f=a.insert(()=>m,":first-child")}else{f=s.insert("rect",":first-child");let g="outer";t.look,g="divider",f.attr("class",g).attr("x",d).attr("y",u).attr("width",c).attr("height",h).attr("data-look",t.look)}const p=f.node().getBBox();return t.height=p.height,t.offsetX=0,t.offsetY=0,t.intersect=function(g){return _n(t,g)},{cluster:a,labelBBox:{}}},"divider"),GB=eb,UB={rect:eb,squareRect:GB,roundedWithTitle:YB,noteGroup:HB,divider:jB,kanbanSection:XB,swimlane:WB},rb=new Map,ib=w(async(e,t)=>{const r=t.shape||"rect",i=await UB[r](e,t);return rb.set(t.id,i),i},"insertCluster"),VB=w(()=>{rb=new Map},"clear"),Pa=w((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"),jr={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},Ag={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function Ya(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Mr(e),t=Mr(t);const[r,i]=[e.x,e.y],[o,n]=[t.x,t.y],a=o-r,s=n-i;return{angle:Math.atan(s/a),deltaX:a,deltaY:s}}w(Ya,"calculateDeltaAndAngle");var Mr=w(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),ZB=w(e=>({x:w(function(t,r,i){let o=0;const n=Mr(i[0]).x<Mr(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(jr,e.arrowTypeStart)){const{angle:f,deltaX:p}=Ya(i[0],i[1]);o=jr[e.arrowTypeStart]*Math.cos(f)*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(jr,e.arrowTypeEnd)){const{angle:f,deltaX:p}=Ya(i[i.length-1],i[i.length-2]);o=jr[e.arrowTypeEnd]*Math.cos(f)*(p>=0?1:-1)}const a=Math.abs(Mr(t).x-Mr(i[i.length-1]).x),s=Math.abs(Mr(t).y-Mr(i[i.length-1]).y),l=Math.abs(Mr(t).x-Mr(i[0]).x),c=Math.abs(Mr(t).y-Mr(i[0]).y),h=jr[e.arrowTypeStart],d=jr[e.arrowTypeEnd],u=1;if(a<d&&a>0&&s<d){let f=d+u-a;f*=n==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=n==="right"?-1:1,o+=f}return Mr(t).x+o},"x"),y:w(function(t,r,i){let o=0;const n=Mr(i[0]).y<Mr(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(jr,e.arrowTypeStart)){const{angle:f,deltaY:p}=Ya(i[0],i[1]);o=jr[e.arrowTypeStart]*Math.abs(Math.sin(f))*(p>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(jr,e.arrowTypeEnd)){const{angle:f,deltaY:p}=Ya(i[i.length-1],i[i.length-2]);o=jr[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(p>=0?1:-1)}const a=Math.abs(Mr(t).y-Mr(i[i.length-1]).y),s=Math.abs(Mr(t).x-Mr(i[i.length-1]).x),l=Math.abs(Mr(t).y-Mr(i[0]).y),c=Math.abs(Mr(t).x-Mr(i[0]).x),h=jr[e.arrowTypeStart],d=jr[e.arrowTypeEnd],u=1;if(a<d&&a>0&&s<d){let f=d+u-a;f*=n==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=n==="up"?-1:1,o+=f}return Mr(t).y+o},"y")}),"getLineFunctionsWithOffset"),KB=w((e,t,r,i,o,n=!1,a)=>{t.arrowTypeStart&&Fg(e,"start",t.arrowTypeStart,r,i,o,n,a),t.arrowTypeEnd&&Fg(e,"end",t.arrowTypeEnd,r,i,o,n,a)},"addEdgeMarkers"),QB={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},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}},JB=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],Fg=w((e,t,r,i,o,n,a=!1,s)=>{if(!r||r==="none")return;const l=QB[r],c=l&&JB.includes(l.type);if(!l){pt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${n}-${h}${t==="start"?"Start":"End"}${a&&c?"-margin":""}`;if(s&&s.trim()!==""){const p=s.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",s),l.fill&&C.setAttribute("fill",s)}),m.parentNode?.appendChild(y)}}e.attr(`marker-${t}`,`url(${i}#${g})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),tL=w(e=>typeof e=="string"?e:Ke()?.flowchart?.curve,"resolveEdgeCurveType"),ga=new Map,$r=new Map,eL=w(()=>{ga.clear(),$r.clear()},"clear"),ob=w(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),Oa=w(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),lu=w(async(e,t)=>{const r=Ke();let i=Vr(r);const{labelStyles:o}=ae(t);t.labelStyle=o;const n=e.insert("g").attr("class","edgeLabel"),a=n.insert("g").attr("class","label").attr("data-id",t.id),s=t.labelType==="markdown",c=await Ni(e,t.label,{style:Oa(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:s,width:s?void 0:void 0},r);a.node().appendChild(c),pt.info("abc82",t,t.labelType);let h,d;if(i){const f=c.children[0],p=He(c);h=await bn.measure(()=>f.getBoundingClientRect()),d=h,p.attr("width",h.width),p.attr("height",h.height)}else{const f=He(c).select("text").node();await bn.measure(()=>{h=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=h})}a.attr("transform",Pa(d,i)),ga.set(t.id,n),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 Wo(p,t.startLabelLeft,Oa(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",Pa(m,i)),$r.get(t.id)||$r.set(t.id,{}),$r.get(t.id).startLeft=f,Xa(u,t.startLabelLeft)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await Wo(p,t.startLabelRight,Oa(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",Pa(m,i)),$r.get(t.id)||$r.set(t.id,{}),$r.get(t.id).startRight=f,Xa(u,t.startLabelRight)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await Wo(f,t.endLabelLeft,Oa(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",Pa(m,i)),$r.get(t.id)||$r.set(t.id,{}),$r.get(t.id).endLeft=f,Xa(u,t.endLabelLeft)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),p=f.insert("g").attr("class","inner"),g=await Wo(f,t.endLabelRight,Oa(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",Pa(m,i)),$r.get(t.id)||$r.set(t.id,{}),$r.get(t.id).endRight=f,Xa(u,t.endLabelRight)}return c},"insertEdgeLabel");function Xa(e,t){Vr(Ke())&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}w(Xa,"setTerminalWidth");var rL=w((e,t)=>{pt.debug("Moving label abc88 ",e.id,e.label,ga.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath;const i=Ke(),{subGraphTitleTotalMargin:o}=Jl(i);if(e.label){const n=ga.get(e.id);let a=e.x,s=e.y;if(r){const l=Ur.calcLabelPosition(r);pt.debug("Moving label "+e.label+" from (",a,",",s,") to (",l.x,",",l.y,") abc88"),t.updatedPath&&(a=l.x,s=l.y)}n.attr("transform",`translate(${a}, ${s+o/2})`)}if(e.startLabelLeft){const n=$r.get(e.id).startLeft;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.startLabelRight){const n=$r.get(e.id).startRight;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelLeft){const n=$r.get(e.id).endLeft;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelRight){const n=$r.get(e.id).endRight;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}},"positionEdgeLabel"),iL=w((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),n=Math.abs(i.y-r.y);return o<.001||n<.001?t:n>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),oL=w((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),n=Math.abs(t.y-i),a=e.width/2,s=e.height/2;return o>=a||n>=s},"outsideNode"),nL=w((e,t,r)=>{pt.debug(`intersection calc abc89:
|
|
260
|
-
outsidePoint: ${JSON.stringify(t)}
|
|
261
|
-
insidePoint : ${JSON.stringify(r)}
|
|
262
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,n=Math.abs(i-r.x),a=e.width/2;let s=r.x<t.x?a-n:a+n;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)*a>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;s=h*d/c;const u={x:r.x<t.x?r.x+s:r.x-h+s,y:r.y<t.y?r.y+c-d:r.y-c+d};return s===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),pt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${s}`,u),u}else{r.x<t.x?s=t.x-a-i:s=i-a-t.x;let d=c*s/h,u=r.x<t.x?r.x+h-s:r.x-h+s,f=r.y<t.y?r.y+d:r.y-d;return pt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${s}`,{_x:u,_y:f}),s===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),$g=w((e,t)=>{pt.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(n=>{if(pt.info("abc88 checking point",n,t),!oL(t,n)&&!o){const a=nL(t,i,n);pt.debug("abc88 inside",n,i,a),pt.debug("abc88 intersection",a,t);let s=!1;r.forEach(l=>{s=s||l.x===a.x&&l.y===a.y}),r.some(l=>l.x===a.x&&l.y===a.y)?pt.warn("abc88 no intersect",a,r):r.push(a),o=!0}else pt.warn("abc88 outside",n,i),i=n,o||r.push(n)}),pt.debug("returning points",r),r},"cutPathAtIntersect");function nb(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],n=e[i],a=e[i+1];(o.x===n.x&&n.y===a.y&&Math.abs(n.x-a.x)>5&&Math.abs(n.y-o.y)>5||o.y===n.y&&n.x===a.x&&Math.abs(n.x-o.x)>5&&Math.abs(n.y-a.y)>5)&&(t.push(n),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}w(nb,"extractCornerPoints");var Eg=w(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,n=Math.sqrt(i*i+o*o),a=r/n;return{x:t.x-a*i,y:t.y-a*o}},"findAdjacentPoint"),aL=w(function(e){const{cornerPointPositions:t}=nb(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],n=e[i+1],a=e[i],s=Eg(o,a,5),l=Eg(n,a,5),c=l.x-s.x,h=l.y-s.y;r.push(s);const d=Math.sqrt(2)*2;let u={x:a.x,y:a.y};if(Math.abs(n.x-o.x)>10&&Math.abs(n.y-o.y)>=10){pt.debug("Corner point fixing",Math.abs(n.x-o.x),Math.abs(n.y-o.y));const f=5;a.x===s.x?u={x:c<0?s.x-f+d:s.x+f-d,y:h<0?s.y-d:s.y+d}:u={x:c<0?s.x-d:s.x+d,y:h<0?s.y-f+d:s.y+f-d}}else pt.debug("Corner point skipping fixing",Math.abs(n.x-o.x),Math.abs(n.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),sL=w((e,t,r)=>{const i=e-t-r,o=2,n=2,a=o+n,s=Math.floor(i/a),l=Number.isFinite(s)?Math.max(0,s):0,c=Array(l).fill(`${o} ${n}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),ab=w(function(e,t,r,i,o,n,a,s=!1){if(!a)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:l,layout:c}=Ke();let h=t.points,d=!1;const u=o;var f=n;const p=[];for(const z in t.cssCompiledStyles)Ey(z)||p.push(t.cssCompiledStyles[z]);if(c==="swimlane"){if(f.intersect&&u.intersect&&Array.isArray(h)&&h.length>=2)if(h.length===2)h=[u.intersect(h[0]),f.intersect(h[1])];else{const z=h.slice(1,-1),I=z[0],D=z[z.length-1],Z=.5,G=Math.abs(h[h.length-1].x-D.x)<Z&&Math.abs(h[h.length-1].y-D.y)<Z,W=u.intersect(I),Q=G?D:f.intersect(D),et=Math.abs(Q.x-D.x)<Z&&Math.abs(Q.y-D.y)<Z,J=Math.abs(W.x-I.x)<Z&&Math.abs(W.y-I.y)<Z?[]:[W],ct=et?[]:[Q];h=[...J,...z,...ct]}h=iL(t,h)}else f.intersect&&u.intersect&&!s&&(h=h.slice(1,t.points.length-1),h.unshift(u.intersect(h[0])),h.push(f.intersect(h[h.length-1])));const g=btoa(JSON.stringify(h));t.toCluster&&(pt.info("to cluster abc88",r.get(t.toCluster)),h=$g(t.points,r.get(t.toCluster).node),d=!0),t.fromCluster&&(pt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(h,null,2)),h=$g(h.reverse(),r.get(t.fromCluster).node).reverse(),d=!0);let m=h.filter(z=>!Number.isNaN(z.y));const y=tL(t.curve);y!=="rounded"&&(m=aL(m));let x=ts;switch(y){case"linear":x=ts;break;case"basis":x=Oh;break;case"cardinal":x=xy;break;case"bumpX":x=fy;break;case"bumpY":x=gy;break;case"catmullRom":x=Cy;break;case"monotoneX":x=Ty;break;case"monotoneY":x=My;break;case"natural":x=Ly;break;case"step":x=Ay;break;case"stepAfter":x=$y;break;case"stepBefore":x=Fy;break;case"rounded":x=ts;break;default:x=Oh}const{x:C,y:k}=ZB(t),v=k_().x(C).y(k).curve(x);let T;switch(t.thickness){case"normal":T="edge-thickness-normal";break;case"thick":T="edge-thickness-thick";break;case"invisible":T="edge-thickness-invisible";break;default:T="edge-thickness-normal"}switch(t.pattern){case"solid":T+=" edge-pattern-solid";break;case"dotted":T+=" edge-pattern-dotted";break;case"dashed":T+=" edge-pattern-dashed";break;default:T+=" edge-pattern-solid"}let L,A=y==="rounded"?sb(lb(m,t),5):v(m);const _=Array.isArray(t.style)?t.style:[t.style];let M=_.find(z=>z?.startsWith("stroke:")),$="";t.animate&&($="edge-animation-fast"),t.animation&&($="edge-animation-"+t.animation);let P=!1;if(t.look==="handDrawn"){const z=re.svg(e);Object.assign([],m);const I=z.path(A,{roughness:.3,seed:l});T+=" transition",L=He(I).select("path").attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+($?" "+$:"")).attr("style",_?_.reduce((Z,G)=>Z+";"+G,""):"");let D=L.attr("d");L.attr("d",D),e.node().appendChild(L.node())}else{const z=p.join(";"),I=_?_.reduce((et,tt)=>et+tt+";",""):"",D=(z?z+";"+I+";":I)+";"+(_?_.reduce((et,tt)=>et+";"+tt,""):"");L=e.append("path").attr("d",A).attr("id",`${a}-${t.id}`).attr("class"," "+T+(t.classes?" "+t.classes:"")+($?" "+$:"")).attr("style",D),M=D.match(/stroke:([^;]+)/)?.[1],P=t.animate===!0||!!t.animation||z.includes("animation");const Z=L.node(),G=typeof Z.getTotalLength=="function"?Z.getTotalLength():0,W=Ag[t.arrowTypeStart]||0,Q=Ag[t.arrowTypeEnd]||0;if(t.look==="neo"&&!P){const tt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?sL(G,W,Q):`0 ${W} ${G-W-Q} ${Q}`}; stroke-dashoffset: 0;`;L.attr("style",tt+L.attr("style"))}}L.attr("data-edge",!0),L.attr("data-et","edge"),L.attr("data-id",t.id),L.attr("data-points",g),L.attr("data-look",Rr(t.look)),t.showPoints&&m.forEach(z=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",z.x).attr("cy",z.y)});let N="";(Ke().flowchart.arrowMarkerAbsolute||Ke().state.arrowMarkerAbsolute)&&(N=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,N=N.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),pt.info("arrowTypeStart",t.arrowTypeStart),pt.info("arrowTypeEnd",t.arrowTypeEnd);const F=!P&&t?.look==="neo";KB(L,t,N,a,i,F,M);const E=Math.floor(h.length/2),B=h[E];Ur.isLabelCoordinateInPath(B,L.attr("d"))||(d=!0);let q={};return d&&(q.updatedPath=h),q.originalPath=t.points,q},"insertEdge");function sb(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let n=0;n<i;n++){const a=e[n],s=e[n-1],l=e[n+1];if(n===0)r+=`M${a.x},${a.y}`;else if(n===i-1)r+=`L${a.x},${a.y}`;else{const c=a.x-s.x,h=a.y-s.y,d=l.x-a.x,u=l.y-a.y,f=Math.hypot(c,h),p=Math.hypot(d,u);if(f<o||p<o){r+=`L${a.x},${a.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${a.x},${a.y}`;continue}const T=Math.min(t/Math.sin(v/2),f/2,p/2),L=a.x-g*T,A=a.y-m*T,_=a.x+y*T,M=a.y+x*T;r+=`L${L},${A}`,r+=`Q${a.x},${a.y} ${_},${M}`}}return r}w(sb,"generateRoundedPath");function Kh(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}}w(Kh,"calculateDeltaAndAngle");function lb(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&jr[t.arrowTypeStart]){const o=jr[t.arrowTypeStart],n=e[0],a=e[1],{angle:s}=Kh(n,a),l=o*Math.cos(s),c=o*Math.sin(s);r[0].x=n.x+l,r[0].y=n.y+c}const i=e.length;if(i>=2&&jr[t.arrowTypeEnd]){const o=jr[t.arrowTypeEnd],n=e[i-1],a=e[i-2],{angle:s}=Kh(a,n),l=o*Math.cos(s),c=o*Math.sin(s);r[i-1].x=n.x-l,r[i-1].y=n.y-c}return r}w(lb,"applyMarkerOffsetsToPoints");var lL=w((e,t,r,i)=>{t.forEach(o=>{FL[o](e,r,i)})},"insertMarkers"),cL=w((e,t,r)=>{pt.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=w((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"),dL=w((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"),uL=w((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"),fL=w((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"),gL=w((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"),pL=w((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"),mL=w((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"),yL=w((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"),xL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{transitionColor:n}=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",`${n}`)},"barbNeo"),bL=w((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"),CL=w((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"),wL=w((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"),kL=w((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"),SL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n}=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",`${n}`),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",`${n}`)},"only_one_neo"),vL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n,mainBkg:a}=o,s=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");s.append("circle").attr("fill",a??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),s.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${n}`);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",a??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${n}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${n}`)},"zero_or_one_neo"),_L=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n}=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",`${n}`),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",`${n}`)},"one_or_more_neo"),TL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n,mainBkg:a}=o,s=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");s.append("circle").attr("fill",a??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),s.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${n}`);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",a??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${n}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${n}`)},"zero_or_more_neo"),ML=w((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
|
|
263
|
-
L20,10
|
|
264
|
-
M20,10
|
|
265
|
-
L0,20`)},"requirement_arrow"),BL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n}=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",`${n}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
266
|
-
L20,10
|
|
267
|
-
M20,10
|
|
268
|
-
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),LL=w((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"),AL=w((e,t,r)=>{const i=Br(),{themeVariables:o}=i,{strokeWidth:n}=o,a=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");a.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),a.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),a.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),a.selectAll("*").attr("stroke-width",`${n}`)},"requirement_contains_neo"),FL={extension:cL,composition:hL,aggregation:dL,dependency:uL,lollipop:fL,point:gL,circle:pL,cross:mL,barb:yL,barbNeo:xL,only_one:bL,zero_or_one:CL,one_or_more:wL,zero_or_more:kL,only_one_neo:SL,zero_or_one_neo:vL,one_or_more_neo:_L,zero_or_more_neo:TL,requirement_arrow:ML,requirement_contains:LL,requirement_arrow_neo:BL,requirement_contains_neo:AL},cb=lL,hb=typeof global=="object"&&global&&global.Object===Object&&global,$L=typeof self=="object"&&self&&self.Object===Object&&self,Fo=hb||$L||Function("return this")(),eo=Fo.Symbol,db=Object.prototype,EL=db.hasOwnProperty,PL=db.toString,Ia=eo?eo.toStringTag:void 0;function OL(e){var t=EL.call(e,Ia),r=e[Ia];try{e[Ia]=void 0;var i=!0}catch{}var o=PL.call(e);return i&&(t?e[Ia]=r:delete e[Ia]),o}var IL=Object.prototype,RL=IL.toString;function DL(e){return RL.call(e)}var NL="[object Null]",qL="[object Undefined]",Pg=eo?eo.toStringTag:void 0;function wa(e){return e==null?e===void 0?qL:NL:Pg&&Pg in Object(e)?OL(e):DL(e)}function Cn(e){return e!=null&&typeof e=="object"}var zL="[object Symbol]";function cu(e){return typeof e=="symbol"||Cn(e)&&wa(e)==zL}function ub(e,t){for(var r=-1,i=e==null?0:e.length,o=Array(i);++r<i;)o[r]=t(e[r],r,e);return o}var ci=Array.isArray,Og=eo?eo.prototype:void 0,Ig=Og?Og.toString:void 0;function fb(e){if(typeof e=="string")return e;if(ci(e))return ub(e,fb)+"";if(cu(e))return Ig?Ig.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function hu(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ec(e){return e}var WL="[object AsyncFunction]",HL="[object Function]",YL="[object GeneratorFunction]",XL="[object Proxy]";function Il(e){if(!hu(e))return!1;var t=wa(e);return t==HL||t==YL||t==WL||t==XL}var Ic=Fo["__core-js_shared__"],Rg=(function(){var e=/[^.]+$/.exec(Ic&&Ic.keys&&Ic.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function jL(e){return!!Rg&&Rg in e}var GL=Function.prototype,UL=GL.toString;function Tn(e){if(e!=null){try{return UL.call(e)}catch{}try{return e+""}catch{}}return""}var VL=/[\\^$.*+?()[\]{}|]/g,ZL=/^\[object .+?Constructor\]$/,KL=Function.prototype,QL=Object.prototype,JL=KL.toString,tA=QL.hasOwnProperty,eA=RegExp("^"+JL.call(tA).replace(VL,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rA(e){if(!hu(e)||jL(e))return!1;var t=Il(e)?eA:ZL;return t.test(Tn(e))}function iA(e,t){return e?.[t]}function Mn(e,t){var r=iA(e,t);return rA(r)?r:void 0}var Qh=Mn(Fo,"WeakMap");function oA(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function nA(){}var aA=800,sA=16,lA=Date.now;function cA(e){var t=0,r=0;return function(){var i=lA(),o=sA-(i-r);if(r=i,o>0){if(++t>=aA)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ja(e){return function(){return e}}var Dg=(function(){try{var e=Mn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),hA=Dg?function(e,t){return Dg(e,"toString",{configurable:!0,enumerable:!1,value:ja(t),writable:!0})}:ec,dA=cA(hA);function uA(e,t){for(var r=-1,i=e==null?0:e.length;++r<i&&t(e[r],r,e)!==!1;);return e}function fA(e,t,r,i){for(var o=e.length,n=r+-1;++n<o;)if(t(e[n],n,e))return n;return-1}function gA(e){return e!==e}function pA(e,t,r){for(var i=r-1,o=e.length;++i<o;)if(e[i]===t)return i;return-1}function mA(e,t,r){return t===t?pA(e,t,r):fA(e,gA,r)}function yA(e,t){var r=e==null?0:e.length;return!!r&&mA(e,t,0)>-1}var xA=9007199254740991,bA=/^(?:0|[1-9]\d*)$/;function gb(e,t){var r=typeof e;return t=t??xA,!!t&&(r=="number"||r!="symbol"&&bA.test(e))&&e>-1&&e%1==0&&e<t}function pb(e,t){return e===t||e!==e&&t!==t}var Ng=Math.max;function CA(e,t,r){return t=Ng(t===void 0?e.length-1:t,0),function(){for(var i=arguments,o=-1,n=Ng(i.length-t,0),a=Array(n);++o<n;)a[o]=i[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=i[o];return s[t]=r(a),oA(e,this,s)}}function wA(e,t){return dA(CA(e,t,ec),e+"")}var kA=9007199254740991;function du(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kA}function rc(e){return e!=null&&du(e.length)&&!Il(e)}var SA=Object.prototype;function mb(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||SA;return e===r}function vA(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}var _A="[object Arguments]";function qg(e){return Cn(e)&&wa(e)==_A}var yb=Object.prototype,TA=yb.hasOwnProperty,MA=yb.propertyIsEnumerable,ic=qg((function(){return arguments})())?qg:function(e){return Cn(e)&&TA.call(e,"callee")&&!MA.call(e,"callee")};function BA(){return!1}var xb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zg=xb&&typeof module=="object"&&module&&!module.nodeType&&module,LA=zg&&zg.exports===xb,Wg=LA?Fo.Buffer:void 0,AA=Wg?Wg.isBuffer:void 0,Rl=AA||BA,FA="[object Arguments]",$A="[object Array]",EA="[object Boolean]",PA="[object Date]",OA="[object Error]",IA="[object Function]",RA="[object Map]",DA="[object Number]",NA="[object Object]",qA="[object RegExp]",zA="[object Set]",WA="[object String]",HA="[object WeakMap]",YA="[object ArrayBuffer]",XA="[object DataView]",jA="[object Float32Array]",GA="[object Float64Array]",UA="[object Int8Array]",VA="[object Int16Array]",ZA="[object Int32Array]",KA="[object Uint8Array]",QA="[object Uint8ClampedArray]",JA="[object Uint16Array]",t5="[object Uint32Array]",Sr={};Sr[jA]=Sr[GA]=Sr[UA]=Sr[VA]=Sr[ZA]=Sr[KA]=Sr[QA]=Sr[JA]=Sr[t5]=!0;Sr[FA]=Sr[$A]=Sr[YA]=Sr[EA]=Sr[XA]=Sr[PA]=Sr[OA]=Sr[IA]=Sr[RA]=Sr[DA]=Sr[NA]=Sr[qA]=Sr[zA]=Sr[WA]=Sr[HA]=!1;function e5(e){return Cn(e)&&du(e.length)&&!!Sr[wa(e)]}function r5(e){return function(t){return e(t)}}var bb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rs=bb&&typeof module=="object"&&module&&!module.nodeType&&module,i5=rs&&rs.exports===bb,Rc=i5&&hb.process,Hg=(function(){try{var e=rs&&rs.require&&rs.require("util").types;return e||Rc&&Rc.binding&&Rc.binding("util")}catch{}})(),Yg=Hg&&Hg.isTypedArray,uu=Yg?r5(Yg):e5,o5=Object.prototype,n5=o5.hasOwnProperty;function a5(e,t){var r=ci(e),i=!r&&ic(e),o=!r&&!i&&Rl(e),n=!r&&!i&&!o&&uu(e),a=r||i||o||n,s=a?vA(e.length,String):[],l=s.length;for(var c in e)(t||n5.call(e,c))&&!(a&&(c=="length"||o&&(c=="offset"||c=="parent")||n&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||gb(c,l)))&&s.push(c);return s}function s5(e,t){return function(r){return e(t(r))}}var l5=s5(Object.keys,Object),c5=Object.prototype,h5=c5.hasOwnProperty;function Cb(e){if(!mb(e))return l5(e);var t=[];for(var r in Object(e))h5.call(e,r)&&r!="constructor"&&t.push(r);return t}function Ui(e){return rc(e)?a5(e):Cb(e)}var d5=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u5=/^\w*$/;function fu(e,t){if(ci(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||cu(e)?!0:u5.test(e)||!d5.test(e)||t!=null&&e in Object(t)}var cs=Mn(Object,"create");function f5(){this.__data__=cs?cs(null):{},this.size=0}function g5(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var p5="__lodash_hash_undefined__",m5=Object.prototype,y5=m5.hasOwnProperty;function x5(e){var t=this.__data__;if(cs){var r=t[e];return r===p5?void 0:r}return y5.call(t,e)?t[e]:void 0}var b5=Object.prototype,C5=b5.hasOwnProperty;function w5(e){var t=this.__data__;return cs?t[e]!==void 0:C5.call(t,e)}var k5="__lodash_hash_undefined__";function S5(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=cs&&t===void 0?k5:t,this}function wn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}wn.prototype.clear=f5;wn.prototype.delete=g5;wn.prototype.get=x5;wn.prototype.has=w5;wn.prototype.set=S5;function v5(){this.__data__=[],this.size=0}function oc(e,t){for(var r=e.length;r--;)if(pb(e[r][0],t))return r;return-1}var _5=Array.prototype,T5=_5.splice;function M5(e){var t=this.__data__,r=oc(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():T5.call(t,r,1),--this.size,!0}function B5(e){var t=this.__data__,r=oc(t,e);return r<0?void 0:t[r][1]}function L5(e){return oc(this.__data__,e)>-1}function A5(e,t){var r=this.__data__,i=oc(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}function $o(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}$o.prototype.clear=v5;$o.prototype.delete=M5;$o.prototype.get=B5;$o.prototype.has=L5;$o.prototype.set=A5;var hs=Mn(Fo,"Map");function F5(){this.size=0,this.__data__={hash:new wn,map:new(hs||$o),string:new wn}}function $5(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function nc(e,t){var r=e.__data__;return $5(t)?r[typeof t=="string"?"string":"hash"]:r.map}function E5(e){var t=nc(this,e).delete(e);return this.size-=t?1:0,t}function P5(e){return nc(this,e).get(e)}function O5(e){return nc(this,e).has(e)}function I5(e,t){var r=nc(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}function Eo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}Eo.prototype.clear=F5;Eo.prototype.delete=E5;Eo.prototype.get=P5;Eo.prototype.has=O5;Eo.prototype.set=I5;var R5="Expected a function";function gu(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(R5);var r=function(){var i=arguments,o=t?t.apply(this,i):i[0],n=r.cache;if(n.has(o))return n.get(o);var a=e.apply(this,i);return r.cache=n.set(o,a)||n,a};return r.cache=new(gu.Cache||Eo),r}gu.Cache=Eo;var D5=500;function N5(e){var t=gu(e,function(i){return r.size===D5&&r.clear(),i}),r=t.cache;return t}var q5=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z5=/\\(\\)?/g,W5=N5(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(q5,function(r,i,o,n){t.push(o?n.replace(z5,"$1"):i||r)}),t});function H5(e){return e==null?"":fb(e)}function wb(e,t){return ci(e)?e:fu(e,t)?[e]:W5(H5(e))}function ac(e){if(typeof e=="string"||cu(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function kb(e,t){t=wb(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[ac(t[r++])];return r&&r==i?e:void 0}function Y5(e,t,r){var i=e==null?void 0:kb(e,t);return i===void 0?r:i}function Sb(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}var Xg=eo?eo.isConcatSpreadable:void 0;function X5(e){return ci(e)||ic(e)||!!(Xg&&e&&e[Xg])}function j5(e,t,r,i,o){var n=-1,a=e.length;for(r||(r=X5),o||(o=[]);++n<a;){var s=e[n];r(s)?Sb(o,s):i||(o[o.length]=s)}return o}function G5(e,t,r,i){var o=-1,n=e==null?0:e.length;for(i&&n&&(r=e[++o]);++o<n;)r=t(r,e[o],o,e);return r}function U5(){this.__data__=new $o,this.size=0}function V5(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Z5(e){return this.__data__.get(e)}function K5(e){return this.__data__.has(e)}var Q5=200;function J5(e,t){var r=this.__data__;if(r instanceof $o){var i=r.__data__;if(!hs||i.length<Q5-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Eo(i)}return r.set(e,t),this.size=r.size,this}function ko(e){var t=this.__data__=new $o(e);this.size=t.size}ko.prototype.clear=U5;ko.prototype.delete=V5;ko.prototype.get=Z5;ko.prototype.has=K5;ko.prototype.set=J5;function vb(e,t){for(var r=-1,i=e==null?0:e.length,o=0,n=[];++r<i;){var a=e[r];t(a,r,e)&&(n[o++]=a)}return n}function tF(){return[]}var eF=Object.prototype,rF=eF.propertyIsEnumerable,jg=Object.getOwnPropertySymbols,iF=jg?function(e){return e==null?[]:(e=Object(e),vb(jg(e),function(t){return rF.call(e,t)}))}:tF;function oF(e,t,r){var i=t(e);return ci(e)?i:Sb(i,r(e))}function Gg(e){return oF(e,Ui,iF)}var Jh=Mn(Fo,"DataView"),td=Mn(Fo,"Promise"),jn=Mn(Fo,"Set"),Ug="[object Map]",nF="[object Object]",Vg="[object Promise]",Zg="[object Set]",Kg="[object WeakMap]",Qg="[object DataView]",aF=Tn(Jh),sF=Tn(hs),lF=Tn(td),cF=Tn(jn),hF=Tn(Qh),Co=wa;(Jh&&Co(new Jh(new ArrayBuffer(1)))!=Qg||hs&&Co(new hs)!=Ug||td&&Co(td.resolve())!=Vg||jn&&Co(new jn)!=Zg||Qh&&Co(new Qh)!=Kg)&&(Co=function(e){var t=wa(e),r=t==nF?e.constructor:void 0,i=r?Tn(r):"";if(i)switch(i){case aF:return Qg;case sF:return Ug;case lF:return Vg;case cF:return Zg;case hF:return Kg}return t});var Jg=Fo.Uint8Array,dF="__lodash_hash_undefined__";function uF(e){return this.__data__.set(e,dF),this}function fF(e){return this.__data__.has(e)}function ds(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Eo;++t<r;)this.add(e[t])}ds.prototype.add=ds.prototype.push=uF;ds.prototype.has=fF;function gF(e,t){for(var r=-1,i=e==null?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}function _b(e,t){return e.has(t)}var pF=1,mF=2;function Tb(e,t,r,i,o,n){var a=r&pF,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=n.get(e),h=n.get(t);if(c&&h)return c==t&&h==e;var d=-1,u=!0,f=r&mF?new ds:void 0;for(n.set(e,t),n.set(t,e);++d<s;){var p=e[d],g=t[d];if(i)var m=a?i(g,p,d,t,e,n):i(p,g,d,e,t,n);if(m!==void 0){if(m)continue;u=!1;break}if(f){if(!gF(t,function(y,x){if(!_b(f,x)&&(p===y||o(p,y,r,i,n)))return f.push(x)})){u=!1;break}}else if(!(p===g||o(p,g,r,i,n))){u=!1;break}}return n.delete(e),n.delete(t),u}function yF(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}function pu(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var xF=1,bF=2,CF="[object Boolean]",wF="[object Date]",kF="[object Error]",SF="[object Map]",vF="[object Number]",_F="[object RegExp]",TF="[object Set]",MF="[object String]",BF="[object Symbol]",LF="[object ArrayBuffer]",AF="[object DataView]",tp=eo?eo.prototype:void 0,Dc=tp?tp.valueOf:void 0;function FF(e,t,r,i,o,n,a){switch(r){case AF:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case LF:return!(e.byteLength!=t.byteLength||!n(new Jg(e),new Jg(t)));case CF:case wF:case vF:return pb(+e,+t);case kF:return e.name==t.name&&e.message==t.message;case _F:case MF:return e==t+"";case SF:var s=yF;case TF:var l=i&xF;if(s||(s=pu),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=bF,a.set(e,t);var h=Tb(s(e),s(t),i,o,n,a);return a.delete(e),h;case BF:if(Dc)return Dc.call(e)==Dc.call(t)}return!1}var $F=1,EF=Object.prototype,PF=EF.hasOwnProperty;function OF(e,t,r,i,o,n){var a=r&$F,s=Gg(e),l=s.length,c=Gg(t),h=c.length;if(l!=h&&!a)return!1;for(var d=l;d--;){var u=s[d];if(!(a?u in t:PF.call(t,u)))return!1}var f=n.get(e),p=n.get(t);if(f&&p)return f==t&&p==e;var g=!0;n.set(e,t),n.set(t,e);for(var m=a;++d<l;){u=s[d];var y=e[u],x=t[u];if(i)var C=a?i(x,y,u,t,e,n):i(y,x,u,e,t,n);if(!(C===void 0?y===x||o(y,x,r,i,n):C)){g=!1;break}m||(m=u=="constructor")}if(g&&!m){var k=e.constructor,v=t.constructor;k!=v&&"constructor"in e&&"constructor"in t&&!(typeof k=="function"&&k instanceof k&&typeof v=="function"&&v instanceof v)&&(g=!1)}return n.delete(e),n.delete(t),g}var IF=1,ep="[object Arguments]",rp="[object Array]",Ns="[object Object]",RF=Object.prototype,ip=RF.hasOwnProperty;function DF(e,t,r,i,o,n){var a=ci(e),s=ci(t),l=a?rp:Co(e),c=s?rp:Co(t);l=l==ep?Ns:l,c=c==ep?Ns:c;var h=l==Ns,d=c==Ns,u=l==c;if(u&&Rl(e)){if(!Rl(t))return!1;a=!0,h=!1}if(u&&!h)return n||(n=new ko),a||uu(e)?Tb(e,t,r,i,o,n):FF(e,t,l,r,i,o,n);if(!(r&IF)){var f=h&&ip.call(e,"__wrapped__"),p=d&&ip.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return n||(n=new ko),o(g,m,r,i,n)}}return u?(n||(n=new ko),OF(e,t,r,i,o,n)):!1}function mu(e,t,r,i,o){return e===t?!0:e==null||t==null||!Cn(e)&&!Cn(t)?e!==e&&t!==t:DF(e,t,r,i,mu,o)}var NF=1,qF=2;function zF(e,t,r,i){var o=r.length,n=o;if(e==null)return!n;for(e=Object(e);o--;){var a=r[o];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<n;){a=r[o];var s=a[0],l=e[s],c=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var h=new ko,d;if(!(d===void 0?mu(c,l,NF|qF,i,h):d))return!1}}return!0}function Mb(e){return e===e&&!hu(e)}function WF(e){for(var t=Ui(e),r=t.length;r--;){var i=t[r],o=e[i];t[r]=[i,o,Mb(o)]}return t}function Bb(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function HF(e){var t=WF(e);return t.length==1&&t[0][2]?Bb(t[0][0],t[0][1]):function(r){return r===e||zF(r,e,t)}}function YF(e,t){return e!=null&&t in Object(e)}function XF(e,t,r){t=wb(t,e);for(var i=-1,o=t.length,n=!1;++i<o;){var a=ac(t[i]);if(!(n=e!=null&&r(e,a)))break;e=e[a]}return n||++i!=o?n:(o=e==null?0:e.length,!!o&&du(o)&&gb(a,o)&&(ci(e)||ic(e)))}function jF(e,t){return e!=null&&XF(e,t,YF)}var GF=1,UF=2;function VF(e,t){return fu(e)&&Mb(t)?Bb(ac(e),t):function(r){var i=Y5(r,e);return i===void 0&&i===t?jF(r,e):mu(t,i,GF|UF)}}function ZF(e){return function(t){return t?.[e]}}function KF(e){return function(t){return kb(t,e)}}function QF(e){return fu(e)?ZF(ac(e)):KF(e)}function Lb(e){return typeof e=="function"?e:e==null?ec:typeof e=="object"?ci(e)?VF(e[0],e[1]):HF(e):QF(e)}function JF(e){return function(t,r,i){for(var o=-1,n=Object(t),a=i(t),s=a.length;s--;){var l=a[++o];if(r(n[l],l,n)===!1)break}return t}}var t$=JF();function e$(e,t){return e&&t$(e,t,Ui)}function r$(e,t){return function(r,i){if(r==null)return r;if(!rc(r))return e(r,i);for(var o=r.length,n=-1,a=Object(r);++n<o&&i(a[n],n,a)!==!1;);return r}}var yu=r$(e$);function i$(e){return Cn(e)&&rc(e)}function o$(e){return typeof e=="function"?e:ec}function Jo(e,t){var r=ci(e)?uA:yu;return r(e,o$(t))}function n$(e,t){var r=[];return yu(e,function(i,o,n){t(i,o,n)&&r.push(i)}),r}function qs(e,t){var r=ci(e)?vb:n$;return r(e,Lb(t))}function a$(e,t){return ub(t,function(r){return e[r]})}function Nc(e){return e==null?[]:a$(e,Ui(e))}var s$="[object Map]",l$="[object Set]",c$=Object.prototype,h$=c$.hasOwnProperty;function op(e){if(e==null)return!0;if(rc(e)&&(ci(e)||typeof e=="string"||typeof e.splice=="function"||Rl(e)||uu(e)||ic(e)))return!e.length;var t=Co(e);if(t==s$||t==l$)return!e.size;if(mb(e))return!Cb(e).length;for(var r in e)if(h$.call(e,r))return!1;return!0}function qn(e){return e===void 0}function d$(e,t,r,i,o){return o(e,function(n,a,s){r=i?(i=!1,n):t(r,n,a,s)}),r}function u$(e,t,r){var i=ci(e)?G5:d$,o=arguments.length<3;return i(e,Lb(t),r,o,yu)}var f$=1/0,g$=jn&&1/pu(new jn([,-0]))[1]==f$?function(e){return new jn(e)}:nA,p$=200;function m$(e,t,r){var i=-1,o=yA,n=e.length,a=!0,s=[],l=s;if(n>=p$){var c=g$(e);if(c)return pu(c);a=!1,o=_b,l=new ds}else l=s;t:for(;++i<n;){var h=e[i],d=h;if(h=h!==0?h:0,a&&d===d){for(var u=l.length;u--;)if(l[u]===d)continue t;s.push(h)}else o(l,d,r)||(l!==s&&l.push(d),s.push(h))}return s}var y$=wA(function(e){return m$(j5(e,1,i$,!0))}),x$="\0",tn="\0",np="";class sc{constructor(t={}){this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=ja(void 0),this._defaultEdgeLabelFn=ja(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[tn]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return Il(t)||(t=ja(t)),this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Ui(this._nodes)}sources(){var t=this;return qs(this.nodes(),function(r){return op(t._in[r])})}sinks(){var t=this;return qs(this.nodes(),function(r){return op(t._out[r])})}setNodes(t,r){var i=arguments,o=this;return Jo(t,function(n){i.length>1?o.setNode(n,r):o.setNode(n)}),this}setNode(t,r){return Object.prototype.hasOwnProperty.call(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=r),this):(this._nodes[t]=arguments.length>1?r:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=tn,this._children[t]={},this._children[tn][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var r=i=>this.removeEdge(this._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Jo(this.children(t),i=>{this.setParent(i)}),delete this._children[t]),Jo(Ui(this._in[t]),r),delete this._in[t],delete this._preds[t],Jo(Ui(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(qn(r))r=tn;else{r+="";for(var i=r;!qn(i);i=this.parent(i))if(i===t)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");this.setNode(r)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=r,this._children[r][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var r=this._parent[t];if(r!==tn)return r}}children(t){if(qn(t)&&(t=tn),this._isCompound){var r=this._children[t];if(r)return Ui(r)}else{if(t===tn)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var r=this._preds[t];if(r)return Ui(r)}successors(t){var r=this._sucs[t];if(r)return Ui(r)}neighbors(t){var r=this.predecessors(t);if(r)return y$(r,this.successors(t))}isLeaf(t){var r;return this.isDirected()?r=this.successors(t):r=this.neighbors(t),r.length===0}filterNodes(t){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var i=this;Jo(this._nodes,function(a,s){t(s)&&r.setNode(s,a)}),Jo(this._edgeObjs,function(a){r.hasNode(a.v)&&r.hasNode(a.w)&&r.setEdge(a,i.edge(a))});var o={};function n(a){var s=i.parent(a);return s===void 0||r.hasNode(s)?(o[a]=s,s):s in o?o[s]:n(s)}return this._isCompound&&Jo(r.nodes(),function(a){r.setParent(a,n(a))}),r}setDefaultEdgeLabel(t){return Il(t)||(t=ja(t)),this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Nc(this._edgeObjs)}setPath(t,r){var i=this,o=arguments;return u$(t,function(n,a){return o.length>1?i.setEdge(n,a,r):i.setEdge(n,a),a}),this}setEdge(){var t,r,i,o,n=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,r=a.w,i=a.name,arguments.length===2&&(o=arguments[1],n=!0)):(t=a,r=arguments[1],i=arguments[3],arguments.length>2&&(o=arguments[2],n=!0)),t=""+t,r=""+r,qn(i)||(i=""+i);var s=Ga(this._isDirected,t,r,i);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return n&&(this._edgeLabels[s]=o),this;if(!qn(i)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(r),this._edgeLabels[s]=n?o:this._defaultEdgeLabelFn(t,r,i);var l=b$(this._isDirected,t,r,i);return t=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,ap(this._preds[r],t),ap(this._sucs[t],r),this._in[r][s]=l,this._out[t][s]=l,this._edgeCount++,this}edge(t,r,i){var o=arguments.length===1?qc(this._isDirected,arguments[0]):Ga(this._isDirected,t,r,i);return this._edgeLabels[o]}hasEdge(t,r,i){var o=arguments.length===1?qc(this._isDirected,arguments[0]):Ga(this._isDirected,t,r,i);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,r,i){var o=arguments.length===1?qc(this._isDirected,arguments[0]):Ga(this._isDirected,t,r,i),n=this._edgeObjs[o];return n&&(t=n.v,r=n.w,delete this._edgeLabels[o],delete this._edgeObjs[o],sp(this._preds[r],t),sp(this._sucs[t],r),delete this._in[r][o],delete this._out[t][o],this._edgeCount--),this}inEdges(t,r){var i=this._in[t];if(i){var o=Nc(i);return r?qs(o,function(n){return n.v===r}):o}}outEdges(t,r){var i=this._out[t];if(i){var o=Nc(i);return r?qs(o,function(n){return n.w===r}):o}}nodeEdges(t,r){var i=this.inEdges(t,r);if(i)return i.concat(this.outEdges(t,r))}}sc.prototype._nodeCount=0;sc.prototype._edgeCount=0;function ap(e,t){e[t]?e[t]++:e[t]=1}function sp(e,t){--e[t]||delete e[t]}function Ga(e,t,r,i){var o=""+t,n=""+r;if(!e&&o>n){var a=o;o=n,n=a}return o+np+n+np+(qn(i)?x$:i)}function b$(e,t,r,i){var o=""+t,n=""+r;if(!e&&o>n){var a=o;o=n,n=a}var s={v:o,w:n};return i&&(s.name=i),s}function qc(e,t){return Ga(e,t.v,t.w,t.name)}function Ab(e,{edgePathsClass:t="edges edgePaths"}={}){const r=e.insert("g").attr("class","root"),i=r.insert("g").attr("class","clusters"),o=r.insert("g").attr("class",t),n=r.insert("g").attr("class","edgeLabels"),a=r.insert("g").attr("class","nodes");return{clusters:i,edgePaths:o,edgeLabels:n,nodes:a,rootGroups:r}}w(Ab,"createLayoutElementGroups");async function Fb(e,t){if(t.label){const{shapeSvg:r,bbox:i}=await xe(e,t);t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}w(Fb,"measureGroupLabel");async function $b(e,t,r){const i=await su(e,t,r),o=i.node()?.getBBox()??{width:0,height:0};return t.width=o.width,t.height=o.height,i}w($b,"insertMeasuredNode");async function Eb(e,t){const r=new sc({multigraph:!0,compound:!0}),i=[...t.edges],o=Ke(),n=Ab(e),{edgeLabels:a,nodes:s}=n,l=new Map,c=e.node()!=null;await Promise.all(t.nodes.map(async h=>{if(h.isGroup)c&&await Fb(s,h),r.setNode(h.id,{...h});else{if(c){const d=await $b(s,h,{config:o,dir:h.dir});l.set(h.id,d)}r.setNode(h.id,{...h})}}));for(const h of i)c&&ob(h)&&await lu(a,h),r.setEdge(h.start,h.end,{...h},h.id),t.edges.some(u=>u.id===h.id)||t.edges.push(h);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:h}=await Ye(async()=>{const{captureNodeSizes:d}=await import("./D-9LH0ah.js");return{captureNodeSizes:d}},[],import.meta.url);h(e,t)}return{graph:r,groups:n,nodeElements:l}}w(Eb,"createGraphWithElements");var rr=new Map,hn=new Map,Pb=new Map,C$=w(()=>{hn.clear(),Pb.clear(),rr.clear()},"clear"),us=w((e,t)=>{const r=hn.get(t)||[];return pt.trace("In isDescendant",t," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),w$=w((e,t)=>{const r=hn.get(t)||[];return pt.info("Descendants of ",t," is ",r),pt.info("Edge is ",e),e.v===t||e.w===t?!1:r?r.includes(e.v)||us(e.v,t)||us(e.w,t)||r.includes(e.w):(pt.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),Ob=w((e,t,r,i)=>{pt.debug("Copying children of ",e,"root",i,"data",t.node(e),i);const o=t.children(e)||[];e!==i&&o.push(e),pt.debug("Copying (nodes) clusterId",e,"nodes",o),o.forEach(n=>{if(t.children(n).length>0)Ob(n,t,r,i);else{const a=t.node(n);pt.info("cp ",n," to ",i," with parent ",e),r.setNode(n,a),i!==t.parent(n)&&(pt.debug("Setting parent",n,t.parent(n)),r.setParent(n,t.parent(n))),e!==i&&n!==e?(pt.debug("Setting parent",n,e),r.setParent(n,e)):(pt.info("In copy ",e,"root",i,"data",t.node(e),i),pt.debug("Not Setting parent for node=",n,"cluster!==rootId",e!==i,"node!==clusterId",n!==e));const s=t.edges(n);pt.debug("Copying Edges",s),s.forEach(l=>{pt.info("Edge",l);const c=t.edge(l.v,l.w,l.name);pt.info("Edge data",c,i);try{w$(l,i)?(pt.info("Copying as ",l.v,l.w,c,l.name),r.setEdge(l.v,l.w,c,l.name),pt.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):pt.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",i," clusterId:",e)}catch(h){pt.error(h)}})}pt.debug("Removing node",n),t.removeNode(n)})},"copy"),Ib=w((e,t)=>{const r=t.children(e);let i=[...r];for(const o of r)Pb.set(o,e),i=[...i,...Ib(o,t)];return i},"extractDescendants"),k$=w((e,t,r)=>{const i=e.edges().filter(l=>l.v===t||l.w===t),o=e.edges().filter(l=>l.v===r||l.w===r),n=i.map(l=>({v:l.v===t?r:l.v,w:l.w===t?t:l.w})),a=o.map(l=>({v:l.v,w:l.w}));return n.filter(l=>a.some(c=>l.v===c.v&&l.w===c.w))},"findCommonEdges"),Dl=w((e,t,r)=>{const i=t.children(e);if(pt.trace("Searching children of id ",e,i),i.length<1)return e;let o;for(const n of i){const a=Dl(n,t,r),s=k$(t,r,a);if(a)if(s.length>0)o=a;else return a}return o},"findNonClusterChild"),lp=w(e=>!rr.has(e)||!rr.get(e).externalConnections?e:rr.has(e)?rr.get(e).id:e,"getAnchorId"),M6=w((e,t)=>{if(!e||t>10){pt.debug("Opting out, no graph ");return}else pt.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(pt.debug("Cluster identified",r," Replacement id in edges: ",Dl(r,e,r)),hn.set(r,Ib(r,e)),rr.set(r,{id:Dl(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const i=e.children(r),o=e.edges();i.length>0?(pt.debug("Cluster identified",r,hn),o.forEach(n=>{const a=us(n.v,r),s=us(n.w,r);a^s&&(pt.debug("Edge: ",n," leaves cluster ",r),pt.debug("Descendants of XXX ",r,": ",hn.get(r)),rr.get(r).externalConnections=!0)})):pt.debug("Not a cluster ",r,hn)});for(let r of rr.keys()){const i=rr.get(r).id,o=e.parent(i);o!==r&&rr.has(o)&&!rr.get(o).externalConnections&&(rr.get(r).id=o);const n=e.edges().some(a=>a.v===r);if(i&&rr.get(r)?.externalConnections&&n&&Nb(e,i,r)){const a=S$(e,r,e.parent(i));a&&(rr.get(r).id=a)}}e.edges().forEach(function(r){const i=e.edge(r);pt.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),pt.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let o=r.v,n=r.w;if(pt.debug("Fix XXX",rr,"ids:",r.v,r.w,"Translating: ",rr.get(r.v)," --- ",rr.get(r.w)),rr.get(r.v)||rr.get(r.w)){if(pt.debug("Fixing and trying - removing XXX",r.v,r.w,r.name),o=lp(r.v),n=lp(r.w),e.removeEdge(r.v,r.w,r.name),o!==r.v){const a=e.parent(o);rr.get(a).externalConnections=!0,i.fromCluster=r.v}if(n!==r.w){const a=e.parent(n);rr.get(a).externalConnections=!0,i.toCluster=r.w}pt.debug("Fix Replacing with XXX",o,n,r.name),e.setEdge(o,n,i,r.name)}}),Rb(e,0),pt.trace(rr)},"adjustClustersAndEdges"),Rb=w((e,t)=>{if(t>10){pt.error("Bailing out");return}let r=e.nodes(),i=!1;for(const o of r){const n=e.children(o);i=i||n.length>0}if(!i){pt.debug("Done, no node has children",e.nodes());return}pt.debug("Nodes = ",r,t);for(const o of r)if(pt.debug("Extracting node",o,rr,rr.has(o)&&!rr.get(o).externalConnections,!e.parent(o),e.node(o),e.children("D")," Depth ",t),!rr.has(o))pt.debug("Not a cluster",o,t);else if(!rr.get(o).externalConnections&&e.children(o)&&e.children(o).length>0){pt.debug("Cluster without external connections, without a parent and with children",o,t);let a=e.graph().rankdir==="TB"?"LR":"TB";rr.get(o)?.clusterData?.dir&&(a=rr.get(o).clusterData.dir,pt.debug("Fixing dir",rr.get(o).clusterData.dir,a));const s=new sc({multigraph:!0,compound:!0}).setGraph({rankdir:a,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Ob(o,e,s,o),e.setNode(o,{clusterNode:!0,id:o,clusterData:rr.get(o).clusterData,label:rr.get(o).label,graph:s})}else pt.debug("Cluster ** ",o," **not meeting the criteria !externalConnections:",!rr.get(o).externalConnections," no parent: ",!e.parent(o)," children ",e.children(o)&&e.children(o).length>0,e.children("D"),t),pt.debug(rr);r=e.nodes(),pt.debug("New list of nodes",r);for(const o of r){const n=e.node(o);pt.debug(" Now next level",o,n),n?.clusterNode&&Rb(n.graph,t+1)}},"extractor"),Db=w((e,t)=>{if(t.length===0)return[];let r=Object.assign([],t);return t.forEach(i=>{const o=e.children(i),n=Db(e,o);r=[...r,...n]}),r},"sorter"),B6=w(e=>Db(e,e.children()),"sortNodesByHierarchy"),Nb=w((e,t,r)=>{let i=e.parent(t);for(;i&&i!==r;){const o=rr.get(i);if(o&&!o.externalConnections)return!0;i=e.parent(i)}return!1},"isNodeInExtractableCluster"),S$=w((e,t,r)=>{const i=e.children(t)??[];for(const o of i){if(o===r||us(o,r))continue;const n=Dl(o,e,t);if(n&&!Nb(e,n,t))return n}return null},"findSafeAnchorNode");function v$({prepareLayout:e,measureLayout:t,runLayoutCore:r,paintLayout:i,afterPaint:o,paintOptions:n}){const a=t??zb;return w(async function(l,c,h,d){const u=c.select("g");(h?.insertMarkers??cb)(u,l.markers,l.type,l.diagramId),qb();const f={element:u,helpers:h,options:d};f.preparedLayout=await e?.(l,f);const p=await a(l,f),g=await r(l,f),m={...f,measure:p};i?await i(l,m,g):await Wb(l,m,n),await o?.(l,m,g)},"render")}w(v$,"createCommonLayoutRenderer");function qb(){zB(),eL(),VB(),C$()}w(qb,"clearLayoutRenderState");async function zb(e,{element:t}){return await Eb(t,e)}w(zb,"defaultMeasureLayout");async function Wb(e,t,r={}){const{measure:i}=t,{groups:o}=i;for(const a of r.getNodes?.(e,t)??e.nodes)r.skipNode?.(a,t)||await Hb(o,a,t,r);const n=Xb(e.nodes);for(const a of e.edges)jb(a,r)||await Gb(o,a,n,e,r,t)}w(Wb,"paintLayoutData");async function Hb(e,t,r,i){t.clusterNode?Lg(t):Yb(t,r,i)?await ib(e.clusters,t):Lg(t)}w(Hb,"paintLayoutNode");function Yb(e,t,r){return e.isGroup===!0&&(r.isCluster?.(e,t)??!0)}w(Yb,"shouldPaintAsCluster");function Xb(e){const t=new Map;for(const r of e)r?.id&&t.set(r.id,r);return t}w(Xb,"buildNodeLookup");function jb(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}w(jb,"shouldSkipPaintEdge");async function Gb(e,t,r,i,o,n){const a=ab(e.edgePaths,{...t},o.clusterDb??new Map,i.type,ed(t.start,t,r,n,o),ed(t.end,t,r,n,o),i.diagramId,Ub(t,o));ob(t)&&(ga.has(t.id)||await lu(e.edgeLabels,t),Vb(t,a))}w(Gb,"paintLayoutEdge");function ed(e,t,r,i,o){return o.getEdgeNode?.(e,t,i)??(e?r.get(e)??{}:{})}w(ed,"getRenderedNode");function Ub(e,t){return typeof t.skipIntersect=="function"?t.skipIntersect(e):t.skipIntersect??!1}w(Ub,"shouldSkipIntersect");function Vb(e,t){const r=t?.updatedPath??t?.originalPath,i=Br(),{subGraphTitleTotalMargin:o}=Jl({flowchart:i.flowchart??{}});if(e.label){const n=ga.get(e.id);let a=e.x,s=e.y;if(r){const l=Ur.calcLabelPosition(r);pt.debug("Moving label "+e.label+" from (",a,",",s,") to (",l.x,",",l.y,") abc88"),t?.updatedPath&&(a=l.x,s=l.y)}n.attr("transform",`translate(${a}, ${s+o/2})`)}if(e?.startLabelLeft){const n=$r.get(e.id).startLeft;let a=e?.x,s=e?.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.startLabelRight){const n=$r.get(e.id).startRight;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelLeft){const n=$r.get(e.id).endLeft;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}if(e.endLabelRight){const n=$r.get(e.id).endRight;let a=e.x,s=e.y;if(r){const l=Ur.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",r);a=l.x,s=l.y}n.attr("transform",`translate(${a}, ${s})`)}}w(Vb,"positionRenderedEdgeLabel");function Zb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}w(Zb,"getDefaultExportFromCjs");var Yr={},zs={},Do={},cp;function ka(){if(cp)return Do;cp=1;function e(a){return typeof a>"u"||a===null}w(e,"isNothing");function t(a){return typeof a=="object"&&a!==null}w(t,"isObject");function r(a){return Array.isArray(a)?a:e(a)?[]:[a]}w(r,"toArray");function i(a,s){if(s){const l=Object.keys(s);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];a[d]=s[d]}}return a}w(i,"extend");function o(a,s){let l="";for(let c=0;c<s;c+=1)l+=a;return l}w(o,"repeat");function n(a){return a===0&&Number.NEGATIVE_INFINITY===1/a}return w(n,"isNegativeZero"),Do.isNothing=e,Do.isObject=t,Do.toArray=r,Do.repeat=o,Do.isNegativeZero=n,Do.extend=i,Do}w(ka,"requireCommon");var zc,hp;function Sa(){if(hp)return zc;hp=1;function e(r,i){let o="";const n=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+=`
|
|
269
|
-
|
|
270
|
-
`+r.mark.snippet),n+" "+o):n}w(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 w(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=w(function(i){return this.name+": "+e(this,i)},"toString"),zc=t,zc}w(Sa,"requireException");var Wc,dp;function Kb(){if(dp)return Wc;dp=1;const e=ka();function t(o,n,a,s,l){let c="",h="";const d=Math.floor(l/2)-1;return s-n>d&&(c=" ... ",n=s-d+c.length),a-s>d&&(h=" ...",a=s+d-h.length),{str:c+o.slice(n,a).replace(/\t/g,"→")+h,pos:s-n+c.length}}w(t,"getLine");function r(o,n){return e.repeat(" ",n-o.length)+o}w(r,"padStart");function i(o,n){if(n=Object.create(n||null),!o.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);const a=/\r?\n|\r|\0/g,s=[0],l=[];let c,h=-1;for(;c=a.exec(o.buffer);)l.push(c.index),s.push(c.index+c[0].length),o.position<=c.index&&h<0&&(h=s.length-2);h<0&&(h=s.length-1);let d="";const u=Math.min(o.line+n.linesAfter,l.length).toString().length,f=n.maxLength-(n.indent+u+3);for(let g=1;g<=n.linesBefore&&!(h-g<0);g++){const m=t(o.buffer,s[h-g],l[h-g],o.position-(s[h]-s[h-g]),f);d=e.repeat(" ",n.indent)+r((o.line-g+1).toString(),u)+" | "+m.str+`
|
|
271
|
-
`+d}const p=t(o.buffer,s[h],l[h],o.position,f);d+=e.repeat(" ",n.indent)+r((o.line+1).toString(),u)+" | "+p.str+`
|
|
272
|
-
`,d+=e.repeat("-",n.indent+u+3+p.pos)+`^
|
|
273
|
-
`;for(let g=1;g<=n.linesAfter&&!(h+g>=l.length);g++){const m=t(o.buffer,s[h+g],l[h+g],o.position-(s[h]-s[h+g]),f);d+=e.repeat(" ",n.indent)+r((o.line+g+1).toString(),u)+" | "+m.str+`
|
|
274
|
-
`}return d.replace(/\n$/,"")}return w(i,"makeSnippet"),Wc=i,Wc}w(Kb,"requireSnippet");var Hc,up;function Zr(){if(up)return Hc;up=1;const e=Sa(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function i(n){const a={};return n!==null&&Object.keys(n).forEach(function(s){n[s].forEach(function(l){a[String(l)]=s})}),a}w(i,"compileStyleAliases");function o(n,a){if(a=a||{},Object.keys(a).forEach(function(s){if(t.indexOf(s)===-1)throw new e('Unknown option "'+s+'" is met in definition of "'+n+'" YAML type.')}),this.options=a,this.tag=n,this.kind=a.kind||null,this.resolve=a.resolve||function(){return!0},this.construct=a.construct||function(s){return s},this.instanceOf=a.instanceOf||null,this.predicate=a.predicate||null,this.represent=a.represent||null,this.representName=a.representName||null,this.defaultStyle=a.defaultStyle||null,this.multi=a.multi||!1,this.styleAliases=i(a.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}return w(o,"Type2"),Hc=o,Hc}w(Zr,"requireType");var Yc,fp;function xu(){if(fp)return Yc;fp=1;const e=Sa(),t=Zr();function r(n,a){const s=[];return n[a].forEach(function(l){let c=s.length;s.forEach(function(h,d){h.tag===l.tag&&h.kind===l.kind&&h.multi===l.multi&&(c=d)}),s[c]=l}),s}w(r,"compileList");function i(){const n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function a(s){s.multi?(n.multi[s.kind].push(s),n.multi.fallback.push(s)):n[s.kind][s.tag]=n.fallback[s.tag]=s}w(a,"collectType");for(let s=0,l=arguments.length;s<l;s+=1)arguments[s].forEach(a);return n}w(i,"compileMap");function o(n){return this.extend(n)}return w(o,"Schema2"),o.prototype.extend=w(function(a){let s=[],l=[];if(a instanceof t)l.push(a);else if(Array.isArray(a))l=l.concat(a);else if(a&&(Array.isArray(a.implicit)||Array.isArray(a.explicit)))a.implicit&&(s=s.concat(a.implicit)),a.explicit&&(l=l.concat(a.explicit));else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");s.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(s),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"),Yc=o,Yc}w(xu,"requireSchema");var Xc,gp;function bu(){if(gp)return Xc;gp=1;const e=Zr();return Xc=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:w(function(t){return t!==null?t:""},"construct")}),Xc}w(bu,"requireStr");var jc,pp;function Cu(){if(pp)return jc;pp=1;const e=Zr();return jc=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:w(function(t){return t!==null?t:[]},"construct")}),jc}w(Cu,"requireSeq");var Gc,mp;function wu(){if(mp)return Gc;mp=1;const e=Zr();return Gc=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:w(function(t){return t!==null?t:{}},"construct")}),Gc}w(wu,"requireMap");var Uc,yp;function ku(){if(yp)return Uc;yp=1;const e=xu();return Uc=new e({explicit:[bu(),Cu(),wu()]}),Uc}w(ku,"requireFailsafe");var Vc,xp;function Su(){if(xp)return Vc;xp=1;const e=Zr();function t(o){if(o===null)return!0;const n=o.length;return n===1&&o==="~"||n===4&&(o==="null"||o==="Null"||o==="NULL")}w(t,"resolveYamlNull");function r(){return null}w(r,"constructYamlNull");function i(o){return o===null}return w(i,"isNull"),Vc=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{canonical:w(function(){return"~"},"canonical"),lowercase:w(function(){return"null"},"lowercase"),uppercase:w(function(){return"NULL"},"uppercase"),camelcase:w(function(){return"Null"},"camelcase"),empty:w(function(){return""},"empty")},defaultStyle:"lowercase"}),Vc}w(Su,"require_null");var Zc,bp;function vu(){if(bp)return Zc;bp=1;const e=Zr();function t(o){if(o===null)return!1;const n=o.length;return n===4&&(o==="true"||o==="True"||o==="TRUE")||n===5&&(o==="false"||o==="False"||o==="FALSE")}w(t,"resolveYamlBoolean");function r(o){return o==="true"||o==="True"||o==="TRUE"}w(r,"constructYamlBoolean");function i(o){return Object.prototype.toString.call(o)==="[object Boolean]"}return w(i,"isBoolean"),Zc=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:i,represent:{lowercase:w(function(o){return o?"true":"false"},"lowercase"),uppercase:w(function(o){return o?"TRUE":"FALSE"},"uppercase"),camelcase:w(function(o){return o?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),Zc}w(vu,"requireBool");var Kc,Cp;function _u(){if(Cp)return Kc;Cp=1;const e=ka(),t=Zr();function r(c){return c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102}w(r,"isHexCode");function i(c){return c>=48&&c<=55}w(i,"isOctCode");function o(c){return c>=48&&c<=57}w(o,"isDecCode");function n(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(a(c))}if(f==="x"){for(d++;d<h;d++){if(!r(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}if(f==="o"){for(d++;d<h;d++){if(!i(c.charCodeAt(d)))return!1;u=!0}return u&&isFinite(a(c))}}for(;d<h;d++){if(!o(c.charCodeAt(d)))return!1;u=!0}return u?isFinite(a(c)):!1}w(n,"resolveYamlInteger");function a(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)}w(a,"parseYamlInteger");function s(c){return a(c)}w(s,"constructYamlInteger");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&c%1===0&&!e.isNegativeZero(c)}return w(l,"isInteger"),Kc=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:n,construct:s,predicate:l,represent:{binary:w(function(c){return c>=0?"0b"+c.toString(2):"-0b"+c.toString(2).slice(1)},"binary"),octal:w(function(c){return c>=0?"0o"+c.toString(8):"-0o"+c.toString(8).slice(1)},"octal"),decimal:w(function(c){return c.toString(10)},"decimal"),hexadecimal:w(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}w(_u,"requireInt");var Qc,wp;function Tu(){if(wp)return Qc;wp=1;const e=ka(),t=Zr(),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)}w(o,"resolveYamlFloat");function n(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)}w(n,"constructYamlFloat");const a=/^[-+]?[0-9]+e/;function s(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 a.test(d)?d.replace("e",".e"):d}w(s,"representYamlFloat");function l(c){return Object.prototype.toString.call(c)==="[object Number]"&&(c%1!==0||e.isNegativeZero(c))}return w(l,"isFloat"),Qc=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:n,predicate:l,represent:s,defaultStyle:"lowercase"}),Qc}w(Tu,"requireFloat");var Jc,kp;function Mu(){return kp||(kp=1,Jc=ku().extend({implicit:[Su(),vu(),_u(),Tu()]})),Jc}w(Mu,"requireJson");var th,Sp;function Bu(){return Sp||(Sp=1,th=Mu()),th}w(Bu,"requireCore");var eh,vp;function Lu(){if(vp)return eh;vp=1;const e=Zr(),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(a){return a===null?!1:t.exec(a)!==null||r.exec(a)!==null}w(i,"resolveYamlTimestamp");function o(a){let s=0,l=null,c=t.exec(a);if(c===null&&(c=r.exec(a)),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(s=c[7].slice(0,3);s.length<3;)s+="0";s=+s}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,s));return l&&m.setTime(m.getTime()-l),m}w(o,"constructYamlTimestamp");function n(a){return a.toISOString()}return w(n,"representYamlTimestamp"),eh=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:o,instanceOf:Date,represent:n}),eh}w(Lu,"requireTimestamp");var rh,_p;function Au(){if(_p)return rh;_p=1;const e=Zr();function t(r){return r==="<<"||r===null}return w(t,"resolveYamlMerge"),rh=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),rh}w(Au,"requireMerge");var ih,Tp;function Fu(){if(Tp)return ih;Tp=1;const e=Zr(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
275
|
-
\r`;function r(a){if(a===null)return!1;let s=0;const l=a.length,c=t;for(let h=0;h<l;h++){const d=c.indexOf(a.charAt(h));if(!(d>64)){if(d<0)return!1;s+=6}}return s%8===0}w(r,"resolveYamlBinary");function i(a){const s=a.replace(/[\r\n=]/g,""),l=s.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(s.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)}w(i,"constructYamlBinary");function o(a){let s="",l=0;const c=a.length,h=t;for(let u=0;u<c;u++)u%3===0&&u&&(s+=h[l>>18&63],s+=h[l>>12&63],s+=h[l>>6&63],s+=h[l&63]),l=(l<<8)+a[u];const d=c%3;return d===0?(s+=h[l>>18&63],s+=h[l>>12&63],s+=h[l>>6&63],s+=h[l&63]):d===2?(s+=h[l>>10&63],s+=h[l>>4&63],s+=h[l<<2&63],s+=h[64]):d===1&&(s+=h[l>>2&63],s+=h[l<<4&63],s+=h[64],s+=h[64]),s}w(o,"representYamlBinary");function n(a){return Object.prototype.toString.call(a)==="[object Uint8Array]"}return w(n,"isBinary"),ih=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:i,predicate:n,represent:o}),ih}w(Fu,"requireBinary");var oh,Mp;function $u(){if(Mp)return oh;Mp=1;const e=Zr(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function i(n){if(n===null)return!0;const a=[],s=n;for(let l=0,c=s.length;l<c;l+=1){const h=s[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)return!1;if(a.indexOf(u)===-1)a.push(u);else return!1}return!0}w(i,"resolveYamlOmap");function o(n){return n!==null?n:[]}return w(o,"constructYamlOmap"),oh=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:o}),oh}w($u,"requireOmap");var nh,Bp;function Eu(){if(Bp)return nh;Bp=1;const e=Zr(),t=Object.prototype.toString;function r(o){if(o===null)return!0;const n=o,a=new Array(n.length);for(let s=0,l=n.length;s<l;s+=1){const c=n[s];if(t.call(c)!=="[object Object]")return!1;const h=Object.keys(c);if(h.length!==1)return!1;a[s]=[h[0],c[h[0]]]}return!0}w(r,"resolveYamlPairs");function i(o){if(o===null)return[];const n=o,a=new Array(n.length);for(let s=0,l=n.length;s<l;s+=1){const c=n[s],h=Object.keys(c);a[s]=[h[0],c[h[0]]]}return a}return w(i,"constructYamlPairs"),nh=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i}),nh}w(Eu,"requirePairs");var ah,Lp;function Pu(){if(Lp)return ah;Lp=1;const e=Zr(),t=Object.prototype.hasOwnProperty;function r(o){if(o===null)return!0;const n=o;for(const a in n)if(t.call(n,a)&&n[a]!==null)return!1;return!0}w(r,"resolveYamlSet");function i(o){return o!==null?o:{}}return w(i,"constructYamlSet"),ah=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i}),ah}w(Pu,"requireSet");var sh,Ap;function lc(){return Ap||(Ap=1,sh=Bu().extend({implicit:[Lu(),Au()],explicit:[Fu(),$u(),Eu(),Pu()]})),sh}w(lc,"require_default");var Fp;function Qb(){if(Fp)return zs;Fp=1;const e=ka(),t=Sa(),r=Kb(),i=lc(),o=Object.prototype.hasOwnProperty,n=1,a=2,s=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(b){return Object.prototype.toString.call(b)}w(y,"_class");function x(b){return b===10||b===13}w(x,"isEol");function C(b){return b===9||b===32}w(C,"isWhiteSpace");function k(b){return b===9||b===32||b===10||b===13}w(k,"isWsOrEol");function v(b){return b===44||b===91||b===93||b===123||b===125}w(v,"isFlowIndicator");function T(b){if(b>=48&&b<=57)return b-48;const U=b|32;return U>=97&&U<=102?U-97+10:-1}w(T,"fromHexCode");function L(b){return b===120?2:b===117?4:b===85?8:0}w(L,"escapedHexLen");function A(b){return b>=48&&b<=57?b-48:-1}w(A,"fromDecimalCode");function _(b){switch(b){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
276
|
-
`;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""}}w(_,"simpleEscapeSequence");function M(b){return b<=65535?String.fromCharCode(b):String.fromCharCode((b-65536>>10)+55296,(b-65536&1023)+56320)}w(M,"charFromCodepoint");function $(b,U,it){U==="__proto__"?Object.defineProperty(b,U,{configurable:!0,enumerable:!0,writable:!0,value:it}):b[U]=it}w($,"setProperty");const P=new Array(256),N=new Array(256);for(let b=0;b<256;b++)P[b]=_(b)?1:0,N[b]=_(b);function F(b,U){this.input=b,this.filename=U.filename||null,this.schema=U.schema||i,this.onWarning=U.onWarning||null,this.legacy=U.legacy||!1,this.json=U.json||!1,this.listener=U.listener||null,this.maxDepth=typeof U.maxDepth=="number"?U.maxDepth:100,this.maxTotalMergeKeys=typeof U.maxTotalMergeKeys=="number"?U.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=b.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=[]}w(F,"State");function E(b,U){const it={name:b.filename,buffer:b.input.slice(0,-1),position:b.position,line:b.line,column:b.position-b.lineStart};return it.snippet=r(it),new t(U,it)}w(E,"generateError");function B(b,U){throw E(b,U)}w(B,"throwError");function q(b,U){b.onWarning&&b.onWarning.call(null,E(b,U))}w(q,"throwWarning");function z(b,U,it){const ft=b.anchorMapTransactions;if(ft.length!==0){const dt=ft[ft.length-1];o.call(dt,U)||(dt[U]={existed:o.call(b.anchorMap,U),value:b.anchorMap[U]})}b.anchorMap[U]=it}w(z,"storeAnchor");function I(b){b.anchorMapTransactions.push(Object.create(null))}w(I,"beginAnchorTransaction");function D(b){const U=b.anchorMapTransactions.pop(),it=b.anchorMapTransactions;if(it.length===0)return;const ft=it[it.length-1],dt=Object.keys(U);for(let _t=0,R=dt.length;_t<R;_t+=1){const j=dt[_t];o.call(ft,j)||(ft[j]=U[j])}}w(D,"commitAnchorTransaction");function Z(b){const U=b.anchorMapTransactions.pop(),it=Object.keys(U);for(let ft=it.length-1;ft>=0;ft-=1){const dt=U[it[ft]];dt.existed?b.anchorMap[it[ft]]=dt.value:delete b.anchorMap[it[ft]]}}w(Z,"rollbackAnchorTransaction");function G(b){return{position:b.position,line:b.line,lineStart:b.lineStart,lineIndent:b.lineIndent,firstTabInLine:b.firstTabInLine,tag:b.tag,anchor:b.anchor,kind:b.kind,result:b.result}}w(G,"snapshotState");function W(b,U){b.position=U.position,b.line=U.line,b.lineStart=U.lineStart,b.lineIndent=U.lineIndent,b.firstTabInLine=U.firstTabInLine,b.tag=U.tag,b.anchor=U.anchor,b.kind=U.kind,b.result=U.result}w(W,"restoreState");const Q={YAML:w(function(U,it,ft){U.version!==null&&B(U,"duplication of %YAML directive"),ft.length!==1&&B(U,"YAML directive accepts exactly one argument");const dt=/^([0-9]+)\.([0-9]+)$/.exec(ft[0]);dt===null&&B(U,"ill-formed argument of the YAML directive");const _t=parseInt(dt[1],10),R=parseInt(dt[2],10);_t!==1&&B(U,"unacceptable YAML version of the document"),U.version=ft[0],U.checkLineBreaks=R<2,R!==1&&R!==2&&q(U,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:w(function(U,it,ft){let dt;ft.length!==2&&B(U,"TAG directive accepts exactly two arguments");const _t=ft[0];dt=ft[1],g.test(_t)||B(U,"ill-formed tag handle (first argument) of the TAG directive"),o.call(U.tagMap,_t)&&B(U,'there is a previously declared suffix for "'+_t+'" tag handle'),m.test(dt)||B(U,"ill-formed tag prefix (second argument) of the TAG directive");try{dt=decodeURIComponent(dt)}catch{B(U,"tag prefix is malformed: "+dt)}U.tagMap[_t]=dt},"handleTagDirective")};function et(b,U,it,ft){if(U<it){const dt=b.input.slice(U,it);if(ft)for(let _t=0,R=dt.length;_t<R;_t+=1){const j=dt.charCodeAt(_t);j===9||j>=32&&j<=1114111||B(b,"expected valid JSON character")}else u.test(dt)&&B(b,"the stream contains non-printable characters");b.result+=dt}}w(et,"captureSegment");function tt(b,U,it,ft){e.isObject(it)||B(b,"cannot merge mappings; the provided source object is unacceptable");const dt=Object.keys(it);for(let _t=0,R=dt.length;_t<R;_t+=1){const j=dt[_t];b.maxTotalMergeKeys!==-1&&++b.totalMergeKeys>b.maxTotalMergeKeys&&B(b,"merge keys exceeded maxTotalMergeKeys ("+b.maxTotalMergeKeys+")"),o.call(U,j)||($(U,j,it[j]),ft[j]=!0)}}w(tt,"mergeMappings");function J(b,U,it,ft,dt,_t,R,j,ot){if(Array.isArray(dt)){dt=Array.prototype.slice.call(dt);for(let nt=0,mt=dt.length;nt<mt;nt+=1)Array.isArray(dt[nt])&&B(b,"nested arrays are not supported inside keys"),typeof dt=="object"&&y(dt[nt])==="[object Object]"&&(dt[nt]="[object Object]")}if(typeof dt=="object"&&y(dt)==="[object Object]"&&(dt="[object Object]"),dt=String(dt),U===null&&(U={}),ft==="tag:yaml.org,2002:merge")if(Array.isArray(_t))for(let nt=0,mt=_t.length;nt<mt;nt+=1)tt(b,U,_t[nt],it);else tt(b,U,_t,it);else!b.json&&!o.call(it,dt)&&o.call(U,dt)&&(b.line=R||b.line,b.lineStart=j||b.lineStart,b.position=ot||b.position,B(b,"duplicated mapping key")),$(U,dt,_t),delete it[dt];return U}w(J,"storeMappingPair");function ct(b){const U=b.input.charCodeAt(b.position);U===10?b.position++:U===13?(b.position++,b.input.charCodeAt(b.position)===10&&b.position++):B(b,"a line break is expected"),b.line+=1,b.lineStart=b.position,b.firstTabInLine=-1}w(ct,"readLineBreak");function yt(b,U,it){let ft=0,dt=b.input.charCodeAt(b.position);for(;dt!==0;){for(;C(dt);)dt===9&&b.firstTabInLine===-1&&(b.firstTabInLine=b.position),dt=b.input.charCodeAt(++b.position);if(U&&dt===35)do dt=b.input.charCodeAt(++b.position);while(dt!==10&&dt!==13&&dt!==0);if(x(dt))for(ct(b),dt=b.input.charCodeAt(b.position),ft++,b.lineIndent=0;dt===32;)b.lineIndent++,dt=b.input.charCodeAt(++b.position);else break}return it!==-1&&ft!==0&&b.lineIndent<it&&q(b,"deficient indentation"),ft}w(yt,"skipSeparationSpace");function Y(b){let U=b.position,it=b.input.charCodeAt(U);return!!((it===45||it===46)&&it===b.input.charCodeAt(U+1)&&it===b.input.charCodeAt(U+2)&&(U+=3,it=b.input.charCodeAt(U),it===0||k(it)))}w(Y,"testDocumentSeparator");function H(b,U){U===1?b.result+=" ":U>1&&(b.result+=e.repeat(`
|
|
277
|
-
`,U-1))}w(H,"writeFoldedLines");function V(b,U,it){let ft,dt,_t,R,j,ot;const nt=b.kind,mt=b.result;let St=b.input.charCodeAt(b.position);if(k(St)||v(St)||St===35||St===38||St===42||St===33||St===124||St===62||St===39||St===34||St===37||St===64||St===96)return!1;if(St===63||St===45){const ht=b.input.charCodeAt(b.position+1);if(k(ht)||it&&v(ht))return!1}for(b.kind="scalar",b.result="",ft=dt=b.position,_t=!1;St!==0;){if(St===58){const ht=b.input.charCodeAt(b.position+1);if(k(ht)||it&&v(ht))break}else if(St===35){const ht=b.input.charCodeAt(b.position-1);if(k(ht))break}else{if(b.position===b.lineStart&&Y(b)||it&&v(St))break;if(x(St))if(R=b.line,j=b.lineStart,ot=b.lineIndent,yt(b,!1,-1),b.lineIndent>=U){_t=!0,St=b.input.charCodeAt(b.position);continue}else{b.position=dt,b.line=R,b.lineStart=j,b.lineIndent=ot;break}}_t&&(et(b,ft,dt,!1),H(b,b.line-R),ft=dt=b.position,_t=!1),C(St)||(dt=b.position+1),St=b.input.charCodeAt(++b.position)}return et(b,ft,dt,!1),b.result?!0:(b.kind=nt,b.result=mt,!1)}w(V,"readPlainScalar");function K(b,U){let it,ft,dt=b.input.charCodeAt(b.position);if(dt!==39)return!1;for(b.kind="scalar",b.result="",b.position++,it=ft=b.position;(dt=b.input.charCodeAt(b.position))!==0;)if(dt===39)if(et(b,it,b.position,!0),dt=b.input.charCodeAt(++b.position),dt===39)it=b.position,b.position++,ft=b.position;else return!0;else x(dt)?(et(b,it,ft,!0),H(b,yt(b,!1,U)),it=ft=b.position):b.position===b.lineStart&&Y(b)?B(b,"unexpected end of the document within a single quoted scalar"):(b.position++,C(dt)||(ft=b.position));B(b,"unexpected end of the stream within a single quoted scalar")}w(K,"readSingleQuotedScalar");function at(b,U){let it,ft,dt,_t=b.input.charCodeAt(b.position);if(_t!==34)return!1;for(b.kind="scalar",b.result="",b.position++,it=ft=b.position;(_t=b.input.charCodeAt(b.position))!==0;){if(_t===34)return et(b,it,b.position,!0),b.position++,!0;if(_t===92){if(et(b,it,b.position,!0),_t=b.input.charCodeAt(++b.position),x(_t))yt(b,!1,U);else if(_t<256&&P[_t])b.result+=N[_t],b.position++;else if((dt=L(_t))>0){let R=dt,j=0;for(;R>0;R--)_t=b.input.charCodeAt(++b.position),(dt=T(_t))>=0?j=(j<<4)+dt:B(b,"expected hexadecimal character");b.result+=M(j),b.position++}else B(b,"unknown escape sequence");it=ft=b.position}else x(_t)?(et(b,it,ft,!0),H(b,yt(b,!1,U)),it=ft=b.position):b.position===b.lineStart&&Y(b)?B(b,"unexpected end of the document within a double quoted scalar"):(b.position++,C(_t)||(ft=b.position))}B(b,"unexpected end of the stream within a double quoted scalar")}w(at,"readDoubleQuotedScalar");function It(b,U){let it=!0,ft,dt,_t;const R=b.tag;let j;const ot=b.anchor;let nt,mt,St,ht;const Lt=Object.create(null);let Ht,Xt,jt,Le=b.input.charCodeAt(b.position);if(Le===91)nt=93,ht=!1,j=[];else if(Le===123)nt=125,ht=!0,j={};else return!1;for(b.anchor!==null&&z(b,b.anchor,j),Le=b.input.charCodeAt(++b.position);Le!==0;){if(yt(b,!0,U),Le=b.input.charCodeAt(b.position),Le===nt)return b.position++,b.tag=R,b.anchor=ot,b.kind=ht?"mapping":"sequence",b.result=j,!0;if(it?Le===44&&B(b,"expected the node content, but found ','"):B(b,"missed comma between flow collection entries"),Xt=Ht=jt=null,mt=St=!1,Le===63){const tr=b.input.charCodeAt(b.position+1);k(tr)&&(mt=St=!0,b.position++,yt(b,!0,U))}ft=b.line,dt=b.lineStart,_t=b.position,oe(b,U,n,!1,!0),Xt=b.tag,Ht=b.result,yt(b,!0,U),Le=b.input.charCodeAt(b.position),(St||b.line===ft)&&Le===58&&(mt=!0,Le=b.input.charCodeAt(++b.position),yt(b,!0,U),oe(b,U,n,!1,!0),jt=b.result),ht?J(b,j,Lt,Xt,Ht,jt,ft,dt,_t):mt?j.push(J(b,null,Lt,Xt,Ht,jt,ft,dt,_t)):j.push(Ht),yt(b,!0,U),Le=b.input.charCodeAt(b.position),Le===44?(it=!0,Le=b.input.charCodeAt(++b.position)):it=!1}B(b,"unexpected end of the stream within a flow collection")}w(It,"readFlowCollection");function Yt(b,U){let it,ft=c,dt=!1,_t=!1,R=U,j=0,ot=!1,nt,mt=b.input.charCodeAt(b.position);if(mt===124)it=!1;else if(mt===62)it=!0;else return!1;for(b.kind="scalar",b.result="";mt!==0;)if(mt=b.input.charCodeAt(++b.position),mt===43||mt===45)c===ft?ft=mt===43?d:h:B(b,"repeat of a chomping mode identifier");else if((nt=A(mt))>=0)nt===0?B(b,"bad explicit indentation width of a block scalar; it cannot be less than one"):_t?B(b,"repeat of an indentation width identifier"):(R=U+nt-1,_t=!0);else break;if(C(mt)){do mt=b.input.charCodeAt(++b.position);while(C(mt));if(mt===35)do mt=b.input.charCodeAt(++b.position);while(!x(mt)&&mt!==0)}for(;mt!==0;){for(ct(b),b.lineIndent=0,mt=b.input.charCodeAt(b.position);(!_t||b.lineIndent<R)&&mt===32;)b.lineIndent++,mt=b.input.charCodeAt(++b.position);if(!_t&&b.lineIndent>R&&(R=b.lineIndent),x(mt)){j++;continue}if(!_t&&R===0&&B(b,"missing indentation for block scalar"),b.lineIndent<R){ft===d?b.result+=e.repeat(`
|
|
278
|
-
`,dt?1+j:j):ft===c&&dt&&(b.result+=`
|
|
279
|
-
`);break}it?C(mt)?(ot=!0,b.result+=e.repeat(`
|
|
280
|
-
`,dt?1+j:j)):ot?(ot=!1,b.result+=e.repeat(`
|
|
281
|
-
`,j+1)):j===0?dt&&(b.result+=" "):b.result+=e.repeat(`
|
|
282
|
-
`,j):b.result+=e.repeat(`
|
|
283
|
-
`,dt?1+j:j),dt=!0,_t=!0,j=0;const St=b.position;for(;!x(mt)&&mt!==0;)mt=b.input.charCodeAt(++b.position);et(b,St,b.position,!1)}return!0}w(Yt,"readBlockScalar");function Wt(b,U){const it=b.tag,ft=b.anchor,dt=[];let _t=!1;if(b.firstTabInLine!==-1)return!1;b.anchor!==null&&z(b,b.anchor,dt);let R=b.input.charCodeAt(b.position);for(;R!==0&&(b.firstTabInLine!==-1&&(b.position=b.firstTabInLine,B(b,"tab characters must not be used in indentation")),R===45);){const j=b.input.charCodeAt(b.position+1);if(!k(j))break;if(_t=!0,b.position++,yt(b,!0,-1)&&b.lineIndent<=U){dt.push(null),R=b.input.charCodeAt(b.position);continue}const ot=b.line;if(oe(b,U,s,!1,!0),dt.push(b.result),yt(b,!0,-1),R=b.input.charCodeAt(b.position),(b.line===ot||b.lineIndent>U)&&R!==0)B(b,"bad indentation of a sequence entry");else if(b.lineIndent<U)break}return _t?(b.tag=it,b.anchor=ft,b.kind="sequence",b.result=dt,!0):!1}w(Wt,"readBlockSequence");function Ut(b,U,it){let ft,dt,_t,R;const j=b.tag,ot=b.anchor,nt={},mt=Object.create(null);let St=null,ht=null,Lt=null,Ht=!1,Xt=!1;if(b.firstTabInLine!==-1)return!1;b.anchor!==null&&z(b,b.anchor,nt);let jt=b.input.charCodeAt(b.position);for(;jt!==0;){!Ht&&b.firstTabInLine!==-1&&(b.position=b.firstTabInLine,B(b,"tab characters must not be used in indentation"));const Le=b.input.charCodeAt(b.position+1),tr=b.line;if((jt===63||jt===58)&&k(Le))jt===63?(Ht&&(J(b,nt,mt,St,ht,null,dt,_t,R),St=ht=Lt=null),Xt=!0,Ht=!0,ft=!0):Ht?(Ht=!1,ft=!0):B(b,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),b.position+=1,jt=Le;else{if(dt=b.line,_t=b.lineStart,R=b.position,!oe(b,it,a,!1,!0))break;if(b.line===tr){for(jt=b.input.charCodeAt(b.position);C(jt);)jt=b.input.charCodeAt(++b.position);if(jt===58)jt=b.input.charCodeAt(++b.position),k(jt)||B(b,"a whitespace character is expected after the key-value separator within a block mapping"),Ht&&(J(b,nt,mt,St,ht,null,dt,_t,R),St=ht=Lt=null),Xt=!0,Ht=!1,ft=!1,St=b.tag,ht=b.result;else if(Xt)B(b,"can not read an implicit mapping pair; a colon is missed");else return b.tag=j,b.anchor=ot,!0}else if(Xt)B(b,"can not read a block mapping entry; a multiline key may not be an implicit key");else return b.tag=j,b.anchor=ot,!0}if((b.line===tr||b.lineIndent>U)&&(Ht&&(dt=b.line,_t=b.lineStart,R=b.position),oe(b,U,l,!0,ft)&&(Ht?ht=b.result:Lt=b.result),Ht||(J(b,nt,mt,St,ht,Lt,dt,_t,R),St=ht=Lt=null),yt(b,!0,-1),jt=b.input.charCodeAt(b.position)),(b.line===tr||b.lineIndent>U)&&jt!==0)B(b,"bad indentation of a mapping entry");else if(b.lineIndent<U)break}return Ht&&J(b,nt,mt,St,ht,null,dt,_t,R),Xt&&(b.tag=j,b.anchor=ot,b.kind="mapping",b.result=nt),Xt}w(Ut,"readBlockMapping");function Et(b){let U=!1,it=!1,ft,dt,_t=b.input.charCodeAt(b.position);if(_t!==33)return!1;b.tag!==null&&B(b,"duplication of a tag property"),_t=b.input.charCodeAt(++b.position),_t===60?(U=!0,_t=b.input.charCodeAt(++b.position)):_t===33?(it=!0,ft="!!",_t=b.input.charCodeAt(++b.position)):ft="!";let R=b.position;if(U){do _t=b.input.charCodeAt(++b.position);while(_t!==0&&_t!==62);b.position<b.length?(dt=b.input.slice(R,b.position),_t=b.input.charCodeAt(++b.position)):B(b,"unexpected end of the stream within a verbatim tag")}else{for(;_t!==0&&!k(_t);)_t===33&&(it?B(b,"tag suffix cannot contain exclamation marks"):(ft=b.input.slice(R-1,b.position+1),g.test(ft)||B(b,"named tag handle cannot contain such characters"),it=!0,R=b.position+1)),_t=b.input.charCodeAt(++b.position);dt=b.input.slice(R,b.position),p.test(dt)&&B(b,"tag suffix cannot contain flow indicator characters")}dt&&!m.test(dt)&&B(b,"tag name cannot contain such characters: "+dt);try{dt=decodeURIComponent(dt)}catch{B(b,"tag name is malformed: "+dt)}return U?b.tag=dt:o.call(b.tagMap,ft)?b.tag=b.tagMap[ft]+dt:ft==="!"?b.tag="!"+dt:ft==="!!"?b.tag="tag:yaml.org,2002:"+dt:B(b,'undeclared tag handle "'+ft+'"'),!0}w(Et,"readTagProperty");function Nt(b){let U=b.input.charCodeAt(b.position);if(U!==38)return!1;b.anchor!==null&&B(b,"duplication of an anchor property"),U=b.input.charCodeAt(++b.position);const it=b.position;for(;U!==0&&!k(U)&&!v(U);)U=b.input.charCodeAt(++b.position);return b.position===it&&B(b,"name of an anchor node must contain at least one character"),b.anchor=b.input.slice(it,b.position),!0}w(Nt,"readAnchorProperty");function Te(b){let U=b.input.charCodeAt(b.position);if(U!==42)return!1;U=b.input.charCodeAt(++b.position);const it=b.position;for(;U!==0&&!k(U)&&!v(U);)U=b.input.charCodeAt(++b.position);b.position===it&&B(b,"name of an alias node must contain at least one character");const ft=b.input.slice(it,b.position);return o.call(b.anchorMap,ft)||B(b,'unidentified alias "'+ft+'"'),b.result=b.anchorMap[ft],yt(b,!0,-1),!0}w(Te,"readAlias");function Rt(b,U,it,ft){const dt=G(b);return I(b),W(b,U),b.tag=null,b.anchor=null,b.kind=null,b.result=null,Ut(b,it,ft)&&b.kind==="mapping"?(D(b),!0):(Z(b),W(b,dt),!1)}w(Rt,"tryReadBlockMappingFromProperty");function oe(b,U,it,ft,dt){let _t,R,j=1,ot=!1,nt=!1,mt=null,St,ht,Lt;b.depth>=b.maxDepth&&B(b,"nesting exceeded maxDepth ("+b.maxDepth+")"),b.depth+=1,b.listener!==null&&b.listener("open",b),b.tag=null,b.anchor=null,b.kind=null,b.result=null;const Ht=_t=R=l===it||s===it;if(ft&&yt(b,!0,-1)&&(ot=!0,b.lineIndent>U?j=1:b.lineIndent===U?j=0:b.lineIndent<U&&(j=-1)),j===1)for(;;){const Xt=b.input.charCodeAt(b.position),jt=G(b);if(ot&&(Xt===33&&b.tag!==null||Xt===38&&b.anchor!==null)||!Et(b)&&!Nt(b))break;mt===null&&(mt=jt),yt(b,!0,-1)?(ot=!0,R=Ht,b.lineIndent>U?j=1:b.lineIndent===U?j=0:b.lineIndent<U&&(j=-1)):R=!1}if(R&&(R=ot||dt),j===1||l===it)if(n===it||a===it?ht=U:ht=U+1,Lt=b.position-b.lineStart,j===1)if(R&&(Wt(b,Lt)||Ut(b,Lt,ht))||It(b,ht))nt=!0;else{const Xt=b.input.charCodeAt(b.position);mt!==null&&Ht&&!R&&Xt!==124&&Xt!==62&&Rt(b,mt,mt.position-mt.lineStart,ht)||_t&&Yt(b,ht)||K(b,ht)||at(b,ht)?nt=!0:Te(b)?(nt=!0,(b.tag!==null||b.anchor!==null)&&B(b,"alias node should not have any properties")):V(b,ht,n===it)&&(nt=!0,b.tag===null&&(b.tag="?")),b.anchor!==null&&z(b,b.anchor,b.result)}else j===0&&(nt=R&&Wt(b,Lt));if(b.tag===null)b.anchor!==null&&z(b,b.anchor,b.result);else if(b.tag==="?"){b.result!==null&&b.kind!=="scalar"&&B(b,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+b.kind+'"');for(let Xt=0,jt=b.implicitTypes.length;Xt<jt;Xt+=1)if(St=b.implicitTypes[Xt],St.resolve(b.result)){b.result=St.construct(b.result),b.tag=St.tag,b.anchor!==null&&z(b,b.anchor,b.result);break}}else if(b.tag!=="!"){if(o.call(b.typeMap[b.kind||"fallback"],b.tag))St=b.typeMap[b.kind||"fallback"][b.tag];else{St=null;const Xt=b.typeMap.multi[b.kind||"fallback"];for(let jt=0,Le=Xt.length;jt<Le;jt+=1)if(b.tag.slice(0,Xt[jt].tag.length)===Xt[jt].tag){St=Xt[jt];break}}St||B(b,"unknown tag !<"+b.tag+">"),b.result!==null&&St.kind!==b.kind&&B(b,"unacceptable node kind for !<"+b.tag+'> tag; it should be "'+St.kind+'", not "'+b.kind+'"'),St.resolve(b.result,b.tag)?(b.result=St.construct(b.result,b.tag),b.anchor!==null&&z(b,b.anchor,b.result)):B(b,"cannot resolve a node with !<"+b.tag+"> explicit tag")}return b.listener!==null&&b.listener("close",b),b.depth-=1,b.tag!==null||b.anchor!==null||nt}w(oe,"composeNode");function We(b){const U=b.position;let it=!1,ft;for(b.version=null,b.checkLineBreaks=b.legacy,b.tagMap=Object.create(null),b.anchorMap=Object.create(null);(ft=b.input.charCodeAt(b.position))!==0&&(yt(b,!0,-1),ft=b.input.charCodeAt(b.position),!(b.lineIndent>0||ft!==37));){it=!0,ft=b.input.charCodeAt(++b.position);let dt=b.position;for(;ft!==0&&!k(ft);)ft=b.input.charCodeAt(++b.position);const _t=b.input.slice(dt,b.position),R=[];for(_t.length<1&&B(b,"directive name must not be less than one character in length");ft!==0;){for(;C(ft);)ft=b.input.charCodeAt(++b.position);if(ft===35){do ft=b.input.charCodeAt(++b.position);while(ft!==0&&!x(ft));break}if(x(ft))break;for(dt=b.position;ft!==0&&!k(ft);)ft=b.input.charCodeAt(++b.position);R.push(b.input.slice(dt,b.position))}ft!==0&&ct(b),o.call(Q,_t)?Q[_t](b,_t,R):q(b,'unknown document directive "'+_t+'"')}if(yt(b,!0,-1),b.lineIndent===0&&b.input.charCodeAt(b.position)===45&&b.input.charCodeAt(b.position+1)===45&&b.input.charCodeAt(b.position+2)===45?(b.position+=3,yt(b,!0,-1)):it&&B(b,"directives end mark is expected"),oe(b,b.lineIndent-1,l,!1,!0),yt(b,!0,-1),b.checkLineBreaks&&f.test(b.input.slice(U,b.position))&&q(b,"non-ASCII line breaks are interpreted as content"),b.documents.push(b.result),b.position===b.lineStart&&Y(b)){b.input.charCodeAt(b.position)===46&&(b.position+=3,yt(b,!0,-1));return}b.position<b.length-1&&B(b,"end of the stream or a document separator is expected")}w(We,"readDocument");function me(b,U){b=String(b),U=U||{},b.length!==0&&(b.charCodeAt(b.length-1)!==10&&b.charCodeAt(b.length-1)!==13&&(b+=`
|
|
284
|
-
`),b.charCodeAt(0)===65279&&(b=b.slice(1)));const it=new F(b,U),ft=b.indexOf("\0");for(ft!==-1&&(it.position=ft,B(it,"null byte is not allowed in input")),it.input+="\0";it.input.charCodeAt(it.position)===32;)it.lineIndent+=1,it.position+=1;for(;it.position<it.length-1;)We(it);return it.documents}w(me,"loadDocuments");function Ce(b,U,it){U!==null&&typeof U=="object"&&typeof it>"u"&&(it=U,U=null);const ft=me(b,it);if(typeof U!="function")return ft;for(let dt=0,_t=ft.length;dt<_t;dt+=1)U(ft[dt])}w(Ce,"loadAll2");function Tt(b,U){const it=me(b,U);if(it.length!==0){if(it.length===1)return it[0];throw new t("expected a single document in the stream, but found more")}}return w(Tt,"load2"),zs.loadAll=Ce,zs.load=Tt,zs}w(Qb,"requireLoader");var lh={},$p;function Jb(){if($p)return lh;$p=1;const e=ka(),t=Sa(),r=lc(),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,n=65279,a=9,s=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,T=63,L=64,A=91,_=93,M=96,$=123,P=124,N=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(R,j){if(j===null)return{};const ot={},nt=Object.keys(j);for(let mt=0,St=nt.length;mt<St;mt+=1){let ht=nt[mt],Lt=String(j[ht]);ht.slice(0,2)==="!!"&&(ht="tag:yaml.org,2002:"+ht.slice(2));const Ht=R.compiledTypeMap.fallback[ht];Ht&&o.call(Ht.styleAliases,Lt)&&(Lt=Ht.styleAliases[Lt]),ot[ht]=Lt}return ot}w(q,"compileStyleMap");function z(R){let j,ot;const nt=R.toString(16).toUpperCase();if(R<=255)j="x",ot=2;else if(R<=65535)j="u",ot=4;else if(R<=4294967295)j="U",ot=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+j+e.repeat("0",ot-nt.length)+nt}w(z,"encodeHex");const I=1,D=2;function Z(R){this.schema=R.schema||r,this.indent=Math.max(1,R.indent||2),this.noArrayIndent=R.noArrayIndent||!1,this.skipInvalid=R.skipInvalid||!1,this.flowLevel=e.isNothing(R.flowLevel)?-1:R.flowLevel,this.styleMap=q(this.schema,R.styles||null),this.sortKeys=R.sortKeys||!1,this.lineWidth=R.lineWidth||80,this.noRefs=R.noRefs||!1,this.noCompatMode=R.noCompatMode||!1,this.condenseFlow=R.condenseFlow||!1,this.quotingType=R.quotingType==='"'?D:I,this.forceQuotes=R.forceQuotes||!1,this.replacer=typeof R.replacer=="function"?R.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}w(Z,"State");function G(R,j){const ot=e.repeat(" ",j);let nt=0,mt="";const St=R.length;for(;nt<St;){let ht;const Lt=R.indexOf(`
|
|
285
|
-
`,nt);Lt===-1?(ht=R.slice(nt),nt=St):(ht=R.slice(nt,Lt+1),nt=Lt+1),ht.length&&ht!==`
|
|
286
|
-
`&&(mt+=ot),mt+=ht}return mt}w(G,"indentString");function W(R,j){return`
|
|
287
|
-
`+e.repeat(" ",R.indent*j)}w(W,"generateNextLine");function Q(R,j){for(let ot=0,nt=R.implicitTypes.length;ot<nt;ot+=1)if(R.implicitTypes[ot].resolve(j))return!0;return!1}w(Q,"testImplicitResolving");function et(R){return R===c||R===a}w(et,"isWhitespace");function tt(R){return R>=32&&R<=126||R>=161&&R<=55295&&R!==8232&&R!==8233||R>=57344&&R<=65533&&R!==n||R>=65536&&R<=1114111}w(tt,"isPrintable");function J(R){return tt(R)&&R!==n&&R!==l&&R!==s}w(J,"isNsCharOrWhitespace");function ct(R,j,ot){const nt=J(R),mt=nt&&!et(R);return(ot?nt:nt&&R!==y&&R!==A&&R!==_&&R!==$&&R!==N)&&R!==u&&!(j===C&&!mt)||J(j)&&!et(j)&&R===u||j===C&&mt}w(ct,"isPlainSafe");function yt(R){return tt(R)&&R!==n&&!et(R)&&R!==x&&R!==T&&R!==C&&R!==y&&R!==A&&R!==_&&R!==$&&R!==N&&R!==u&&R!==p&&R!==m&&R!==h&&R!==P&&R!==k&&R!==v&&R!==g&&R!==d&&R!==f&&R!==L&&R!==M}w(yt,"isPlainSafeFirst");function Y(R){return!et(R)&&R!==C}w(Y,"isPlainSafeLast");function H(R,j){const ot=R.charCodeAt(j);let nt;return ot>=55296&&ot<=56319&&j+1<R.length&&(nt=R.charCodeAt(j+1),nt>=56320&&nt<=57343)?(ot-55296)*1024+nt-56320+65536:ot}w(H,"codePointAt");function V(R){return/^\n* /.test(R)}w(V,"needIndentIndicator");const K=1,at=2,It=3,Yt=4,Wt=5;function Ut(R,j,ot,nt,mt,St,ht,Lt){let Ht,Xt=0,jt=null,Le=!1,tr=!1;const Po=nt!==-1;let co=-1,ho=yt(H(R,0))&&Y(H(R,R.length-1));if(j||ht)for(Ht=0;Ht<R.length;Xt>=65536?Ht+=2:Ht++){if(Xt=H(R,Ht),!tt(Xt))return Wt;ho=ho&&ct(Xt,jt,Lt),jt=Xt}else{for(Ht=0;Ht<R.length;Xt>=65536?Ht+=2:Ht++){if(Xt=H(R,Ht),Xt===s)Le=!0,Po&&(tr=tr||Ht-co-1>nt&&R[co+1]!==" ",co=Ht);else if(!tt(Xt))return Wt;ho=ho&&ct(Xt,jt,Lt),jt=Xt}tr=tr||Po&&Ht-co-1>nt&&R[co+1]!==" "}return!Le&&!tr?ho&&!ht&&!mt(R)?K:St===D?Wt:at:ot>9&&V(R)?Wt:ht?St===D?Wt:at:tr?Yt:It}w(Ut,"chooseScalarStyle");function Et(R,j,ot,nt,mt){R.dump=(function(){if(j.length===0)return R.quotingType===D?'""':"''";if(!R.noCompatMode&&(E.indexOf(j)!==-1||B.test(j)))return R.quotingType===D?'"'+j+'"':"'"+j+"'";const St=R.indent*Math.max(1,ot),ht=R.lineWidth===-1?-1:Math.max(Math.min(R.lineWidth,40),R.lineWidth-St),Lt=nt||R.flowLevel>-1&&ot>=R.flowLevel;function Ht(Xt){return Q(R,Xt)}switch(w(Ht,"testAmbiguity"),Ut(j,Lt,R.indent,ht,Ht,R.quotingType,R.forceQuotes&&!nt,mt)){case K:return j;case at:return"'"+j.replace(/'/g,"''")+"'";case It:return"|"+Nt(j,R.indent)+Te(G(j,St));case Yt:return">"+Nt(j,R.indent)+Te(G(Rt(j,ht),St));case Wt:return'"'+We(j)+'"';default:throw new t("impossible error: invalid scalar style")}})()}w(Et,"writeScalar");function Nt(R,j){const ot=V(R)?String(j):"",nt=R[R.length-1]===`
|
|
288
|
-
`,St=nt&&(R[R.length-2]===`
|
|
289
|
-
`||R===`
|
|
290
|
-
`)?"+":nt?"":"-";return ot+St+`
|
|
291
|
-
`}w(Nt,"blockHeader");function Te(R){return R[R.length-1]===`
|
|
292
|
-
`?R.slice(0,-1):R}w(Te,"dropEndingNewline");function Rt(R,j){const ot=/(\n+)([^\n]*)/g;let nt=(function(){let Lt=R.indexOf(`
|
|
293
|
-
`);return Lt=Lt!==-1?Lt:R.length,ot.lastIndex=Lt,oe(R.slice(0,Lt),j)})(),mt=R[0]===`
|
|
294
|
-
`||R[0]===" ",St,ht;for(;ht=ot.exec(R);){const Lt=ht[1],Ht=ht[2];St=Ht[0]===" ",nt+=Lt+(!mt&&!St&&Ht!==""?`
|
|
295
|
-
`:"")+oe(Ht,j),mt=St}return nt}w(Rt,"foldString");function oe(R,j){if(R===""||R[0]===" ")return R;const ot=/ [^ ]/g;let nt,mt=0,St,ht=0,Lt=0,Ht="";for(;nt=ot.exec(R);)Lt=nt.index,Lt-mt>j&&(St=ht>mt?ht:Lt,Ht+=`
|
|
296
|
-
`+R.slice(mt,St),mt=St+1),ht=Lt;return Ht+=`
|
|
297
|
-
`,R.length-mt>j&&ht>mt?Ht+=R.slice(mt,ht)+`
|
|
298
|
-
`+R.slice(ht+1):Ht+=R.slice(mt),Ht.slice(1)}w(oe,"foldLine");function We(R){let j="",ot=0;for(let nt=0;nt<R.length;ot>=65536?nt+=2:nt++){ot=H(R,nt);const mt=F[ot];!mt&&tt(ot)?(j+=R[nt],ot>=65536&&(j+=R[nt+1])):j+=mt||z(ot)}return j}w(We,"escapeString");function me(R,j,ot){let nt="";const mt=R.tag;for(let St=0,ht=ot.length;St<ht;St+=1){let Lt=ot[St];R.replacer&&(Lt=R.replacer.call(ot,String(St),Lt)),(it(R,j,Lt,!1,!1)||typeof Lt>"u"&&it(R,j,null,!1,!1))&&(nt!==""&&(nt+=","+(R.condenseFlow?"":" ")),nt+=R.dump)}R.tag=mt,R.dump="["+nt+"]"}w(me,"writeFlowSequence");function Ce(R,j,ot,nt){let mt="";const St=R.tag;for(let ht=0,Lt=ot.length;ht<Lt;ht+=1){let Ht=ot[ht];R.replacer&&(Ht=R.replacer.call(ot,String(ht),Ht)),(it(R,j+1,Ht,!0,!0,!1,!0)||typeof Ht>"u"&&it(R,j+1,null,!0,!0,!1,!0))&&((!nt||mt!=="")&&(mt+=W(R,j)),R.dump&&s===R.dump.charCodeAt(0)?mt+="-":mt+="- ",mt+=R.dump)}R.tag=St,R.dump=mt||"[]"}w(Ce,"writeBlockSequence");function Tt(R,j,ot){let nt="";const mt=R.tag,St=Object.keys(ot);for(let ht=0,Lt=St.length;ht<Lt;ht+=1){let Ht="";nt!==""&&(Ht+=", "),R.condenseFlow&&(Ht+='"');const Xt=St[ht];let jt=ot[Xt];R.replacer&&(jt=R.replacer.call(ot,Xt,jt)),it(R,j,Xt,!1,!1)&&(R.dump.length>1024&&(Ht+="? "),Ht+=R.dump+(R.condenseFlow?'"':"")+":"+(R.condenseFlow?"":" "),it(R,j,jt,!1,!1)&&(Ht+=R.dump,nt+=Ht))}R.tag=mt,R.dump="{"+nt+"}"}w(Tt,"writeFlowMapping");function b(R,j,ot,nt){let mt="";const St=R.tag,ht=Object.keys(ot);if(R.sortKeys===!0)ht.sort();else if(typeof R.sortKeys=="function")ht.sort(R.sortKeys);else if(R.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let Lt=0,Ht=ht.length;Lt<Ht;Lt+=1){let Xt="";(!nt||mt!=="")&&(Xt+=W(R,j));const jt=ht[Lt];let Le=ot[jt];if(R.replacer&&(Le=R.replacer.call(ot,jt,Le)),!it(R,j+1,jt,!0,!0,!0))continue;const tr=R.tag!==null&&R.tag!=="?"||R.dump&&R.dump.length>1024;tr&&(R.dump&&s===R.dump.charCodeAt(0)?Xt+="?":Xt+="? "),Xt+=R.dump,tr&&(Xt+=W(R,j)),it(R,j+1,Le,!0,tr)&&(R.dump&&s===R.dump.charCodeAt(0)?Xt+=":":Xt+=": ",Xt+=R.dump,mt+=Xt)}R.tag=St,R.dump=mt||"{}"}w(b,"writeBlockMapping");function U(R,j,ot){const nt=ot?R.explicitTypes:R.implicitTypes;for(let mt=0,St=nt.length;mt<St;mt+=1){const ht=nt[mt];if((ht.instanceOf||ht.predicate)&&(!ht.instanceOf||typeof j=="object"&&j instanceof ht.instanceOf)&&(!ht.predicate||ht.predicate(j))){if(ot?ht.multi&&ht.representName?R.tag=ht.representName(j):R.tag=ht.tag:R.tag="?",ht.represent){const Lt=R.styleMap[ht.tag]||ht.defaultStyle;let Ht;if(i.call(ht.represent)==="[object Function]")Ht=ht.represent(j,Lt);else if(o.call(ht.represent,Lt))Ht=ht.represent[Lt](j,Lt);else throw new t("!<"+ht.tag+'> tag resolver accepts not "'+Lt+'" style');R.dump=Ht}return!0}}return!1}w(U,"detectType");function it(R,j,ot,nt,mt,St,ht){R.tag=null,R.dump=ot,U(R,ot,!1)||U(R,ot,!0);const Lt=i.call(R.dump),Ht=nt;nt&&(nt=R.flowLevel<0||R.flowLevel>j);const Xt=Lt==="[object Object]"||Lt==="[object Array]";let jt,Le;if(Xt&&(jt=R.duplicates.indexOf(ot),Le=jt!==-1),(R.tag!==null&&R.tag!=="?"||Le||R.indent!==2&&j>0)&&(mt=!1),Le&&R.usedDuplicates[jt])R.dump="*ref_"+jt;else{if(Xt&&Le&&!R.usedDuplicates[jt]&&(R.usedDuplicates[jt]=!0),Lt==="[object Object]")nt&&Object.keys(R.dump).length!==0?(b(R,j,R.dump,mt),Le&&(R.dump="&ref_"+jt+R.dump)):(Tt(R,j,R.dump),Le&&(R.dump="&ref_"+jt+" "+R.dump));else if(Lt==="[object Array]")nt&&R.dump.length!==0?(R.noArrayIndent&&!ht&&j>0?Ce(R,j-1,R.dump,mt):Ce(R,j,R.dump,mt),Le&&(R.dump="&ref_"+jt+R.dump)):(me(R,j,R.dump),Le&&(R.dump="&ref_"+jt+" "+R.dump));else if(Lt==="[object String]")R.tag!=="?"&&Et(R,R.dump,j,St,Ht);else{if(Lt==="[object Undefined]")return!1;if(R.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+Lt)}if(R.tag!==null&&R.tag!=="?"){let tr=encodeURI(R.tag[0]==="!"?R.tag.slice(1):R.tag).replace(/!/g,"%21");R.tag[0]==="!"?tr="!"+tr:tr.slice(0,18)==="tag:yaml.org,2002:"?tr="!!"+tr.slice(18):tr="!<"+tr+">",R.dump=tr+" "+R.dump}}return!0}w(it,"writeNode");function ft(R,j){const ot=[],nt=[];dt(R,ot,nt);const mt=nt.length;for(let St=0;St<mt;St+=1)j.duplicates.push(ot[nt[St]]);j.usedDuplicates=new Array(mt)}w(ft,"getDuplicateReferences");function dt(R,j,ot){if(R!==null&&typeof R=="object"){const nt=j.indexOf(R);if(nt!==-1)ot.indexOf(nt)===-1&&ot.push(nt);else if(j.push(R),Array.isArray(R))for(let mt=0,St=R.length;mt<St;mt+=1)dt(R[mt],j,ot);else{const mt=Object.keys(R);for(let St=0,ht=mt.length;St<ht;St+=1)dt(R[mt[St]],j,ot)}}}w(dt,"inspectNode");function _t(R,j){j=j||{};const ot=new Z(j);ot.noRefs||ft(R,ot);let nt=R;return ot.replacer&&(nt=ot.replacer.call({"":nt},"",nt)),it(ot,0,nt,!0,!0)?ot.dump+`
|
|
299
|
-
`:""}return w(_t,"dump2"),lh.dump=_t,lh}w(Jb,"requireDumper");var Ep;function t1(){if(Ep)return Yr;Ep=1;const e=Qb(),t=Jb();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 w(r,"renamed"),Yr.Type=Zr(),Yr.Schema=xu(),Yr.FAILSAFE_SCHEMA=ku(),Yr.JSON_SCHEMA=Mu(),Yr.CORE_SCHEMA=Bu(),Yr.DEFAULT_SCHEMA=lc(),Yr.load=e.load,Yr.loadAll=e.loadAll,Yr.dump=t.dump,Yr.YAMLException=Sa(),Yr.types={binary:Fu(),float:Tu(),map:wu(),null:Su(),pairs:Eu(),set:Pu(),timestamp:Lu(),bool:vu(),int:_u(),merge:Au(),omap:$u(),seq:Cu(),str:bu()},Yr.safeLoad=r("safeLoad","load"),Yr.safeLoadAll=r("safeLoadAll","loadAll"),Yr.safeDump=r("safeDump","dump"),Yr}w(t1,"requireJsYaml");var _$=t1(),T$=Zb(_$),{Type:L6,Schema:A6,FAILSAFE_SCHEMA:F6,JSON_SCHEMA:M$,CORE_SCHEMA:$6,DEFAULT_SCHEMA:E6,load:B$,loadAll:P6,dump:O6,YAMLException:I6,types:R6,safeLoad:D6,safeLoadAll:N6,safeDump:q6}=T$,L$={common:Cs,getConfig:Br,insertCluster:ib,insertEdge:ab,insertEdgeLabel:lu,insertMarkers:cb,insertNode:su,interpolateToCurve:Dd,labelHelper:xe,log:pt,positionEdgeLabel:rL},fs={},e1=w(e=>{for(const t of e)fs[t.name]=t},"registerLayoutLoaders"),A$=w(()=>{e1([{name:"dagre",loader:w(async()=>await Ye(()=>import("./Df6EnPla.js"),__vite__mapDeps([0,1]),import.meta.url),"loader")},{name:"swimlane",loader:w(async()=>await Ye(()=>import("./PJfe_iA1.js"),[],import.meta.url),"loader")},{name:"cose-bilkent",loader:w(async()=>await Ye(()=>import("./D81gRUjY.js"),__vite__mapDeps([2,3,4]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");A$();var z6=w(async(e,t)=>{if(!(e.layoutAlgorithm in fs))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const h of e.nodes){const d=h.domId||h.id;h.domId=`${e.diagramId}-${d}`}const r=fs[e.layoutAlgorithm],i=await r.loader(),{theme:o,themeVariables:n}=e.config,{useGradient:a,gradientStart:s,gradientStop:l}=n,c=t.attr("id");if(t.append("defs").append("filter").attr("id",`${c}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),t.append("defs").append("filter").attr("id",`${c}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${o?.includes("dark")?"#FFFFFF":"#000000"}`),a){const h=t.append("linearGradient").attr("id",t.attr("id")+"-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",s).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",l).attr("stop-opacity",1)}return i.render(e,t,L$,{algorithm:r.algorithm})},"render"),W6=w((e="",{fallback:t="dagre"}={})=>{if(e in fs)return e;if(t in fs)return pt.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw new Error(`Both layout algorithms ${e} and ${t} are not registered.`)},"getRegisteredLayoutAlgorithm"),Ou="comm",r1="rule",i1="decl",F$="@media",$$="@import",E$="@supports",P$="@namespace",rd="@keyframes",o1="@layer",O$="@scope",I$=Math.abs,is=String.fromCharCode;function n1(e){return e.trim()}function id(e,t,r){return e.replace(t,r)}function Gn(e,t){return e.charCodeAt(t)|0}function pa(e,t,r){return e.slice(t,r)}function Gi(e){return e.length}function a1(e){return e.length}function Ws(e,t){return t.push(e),e}var cc=1,ma=1,s1=0,_i=0,Or=0,va="";function Iu(e,t,r,i,o,n,a,s){return{value:e,root:t,parent:r,type:i,props:o,children:n,line:cc,column:ma,length:a,return:"",siblings:s}}function R$(){return Or}function D$(){return Or=_i>0?Gn(va,--_i):0,ma--,Or===10&&(ma=1,cc--),Or}function Oi(){return Or=_i<s1?Gn(va,_i++):0,ma++,Or===10&&(ma=1,cc++),Or}function Ho(){return Gn(va,_i)}function ll(){return _i}function hc(e,t){return pa(va,e,t)}function gs(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 N$(e){return cc=ma=1,s1=Gi(va=e),_i=0,[]}function q$(e){return va="",e}function ch(e){return n1(hc(_i-1,od(e===91?e+2:e===40?e+1:e)))}function z$(e){for(;(Or=Ho())&&Or<33;)Oi();return gs(e)>2||gs(Or)>3?"":" "}function W$(e,t){for(;--t&&Oi()&&!(Or<48||Or>102||Or>57&&Or<65||Or>70&&Or<97););return hc(e,ll()+(t<6&&Ho()==32&&Oi()==32))}function od(e){for(;Oi();)switch(Or){case e:return _i;case 34:case 39:e!==34&&e!==39&&od(Or);break;case 40:e===41&&od(e);break;case 92:Oi();break}return _i}function H$(e,t){for(;Oi()&&e+Or!==57;)if(e+Or===84&&Ho()===47)break;return"/*"+hc(t,_i-1)+"*"+is(e===47?e:Oi())}function Y$(e){for(;!gs(Ho());)Oi();return hc(e,_i)}function X$(e){return q$(cl("",null,null,null,[""],e=N$(e),0,[0],e))}function cl(e,t,r,i,o,n,a,s,l){for(var c=0,h=0,d=a,u=0,f=0,p=0,g=1,m=1,y=1,x=0,C=0,k="",v=o,T=n,L=i,A=k;m;)switch(p=C,C=Oi()){case 40:p!=108&&Gn(A,d-1)==58?(x++,A+="("):A+=ch(C);break;case 41:x--,A+=")";break;case 34:case 39:case 91:A+=ch(C);break;case 9:case 10:case 13:case 32:if(x>0){A+=is(C);break}A+=z$(p);break;case 92:A+=W$(ll()-1,7);continue;case 47:switch(Ho()){case 42:case 47:Ws(j$(H$(Oi(),ll()),t,r,l),l),(gs(p||1)==5||gs(Ho()||1)==5)&&Gi(A)&&pa(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*g:s[c++]=Gi(A)*y;case 125*g:case 59:case 0:if(x>0&&C){A+=is(C);break}switch(C){case 0:case 125:m=0;case 59+h:y==-1&&(A=id(A,/\f/g,"")),f>0&&(Gi(A)-d||g===0)&&Ws(f>32?Op(A+";",i,r,d-1,l):Op(id(A," ","")+";",i,r,d-2,l),l);break;case 59:A+=";";default:if(Ws(L=Pp(A,t,r,c,h,o,s,k,v=[],T=[],d,n),n),C===123)if(h===0)cl(A,t,L,L,v,n,d,s,T);else{switch(u){case 99:if(Gn(A,3)===110)break;case 108:if(Gn(A,2)===97)break;default:h=0;case 100:case 109:case 115:}h?cl(e,L,L,i&&Ws(Pp(e,L,L,0,0,o,s,k,o,v=[],d,T),T),o,T,d,s,i?v:T):cl(A,L,L,L,[""],T,0,s,T)}}c=h=f=0,g=y=1,k=A="",d=a;break;case 58:d=1+Gi(A),f=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&D$()==125)continue}switch(A+=is(C),C*g){case 38:y=h>0?1:(A+="\f",-1);break;case 44:if(x>0)break;s[c++]=(Gi(A)-1)*y,y=1;break;case 64:Ho()===45&&(A+=ch(Oi())),u=Ho(),h=d=Gi(k=A+=Y$(ll())),C++;break;case 45:p===45&&Gi(A)==2&&(g=0)}}return n}function Pp(e,t,r,i,o,n,a,s,l,c,h,d){for(var u=o-1,f=o===0?n:[""],p=a1(f),g=0,m=0,y=0;g<i;++g)for(var x=0,C=pa(e,u+1,u=I$(m=a[g])),k=e;x<p;++x)(k=n1(m>0?f[x]+" "+C:id(C,/&\f/g,f[x])))&&(l[y++]=k);return Iu(e,t,r,o===0?r1:s,l,c,h,d)}function j$(e,t,r,i){return Iu(e,t,r,Ou,is(R$()),pa(e,2,-2),0,i)}function Op(e,t,r,i,o){return Iu(e,t,r,i1,pa(e,0,i),pa(e,i+1,-1),i,o)}function nd(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function G$(e,t,r,i){switch(e.type){case o1:if(e.children.length)break;case $$:case P$:case i1:return e.return=e.return||e.value;case Ou:return"";case rd:return e.return=e.value+"{"+nd(e.children,i)+"}";case r1:if(!Gi(e.value=e.props.join(",")))return""}return Gi(r=nd(e.children,i))?e.return=e.value+"{"+r+"}":""}function U$(e){var t=a1(e);return function(r,i,o,n){for(var a="",s=0;s<t;s++)a+=e[s](r,i,o,n)||"";return a}}var l1="c4",V$=w(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),Z$=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./Ck7B90Kr.js");return{diagram:t}},__vite__mapDeps([5,6]),import.meta.url);return{id:l1,diagram:e}},"loader"),K$={id:l1,detector:V$,loader:Z$},Q$=K$,c1="flowchart",J$=w((e,t)=>t?.flowchart?.defaultRenderer==="dagre-wrapper"||t?.flowchart?.defaultRenderer==="elk"?!1:/^\s*graph/.test(e),"detector"),t3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./DEOiJZFa.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([7,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44,45]),import.meta.url);return{id:c1,diagram:e}},"loader"),e3={id:c1,detector:J$,loader:t3},r3=e3,h1="flowchart-v2",i3=w((e,t)=>t?.flowchart?.defaultRenderer==="dagre-d3"?!1:(t?.flowchart?.defaultRenderer==="elk"&&(t.layout="elk"),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer==="dagre-wrapper"?!0:/^\s*flowchart/.test(e)),"detector"),o3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./DEOiJZFa.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([7,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44,45]),import.meta.url);return{id:h1,diagram:e}},"loader"),n3={id:h1,detector:i3,loader:o3},a3=n3,d1="swimlane",s3=w(e=>/^\s*swimlane-beta\b/.test(e),"detector"),l3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CuYeKLE8.js");return{diagram:t}},__vite__mapDeps([46,7,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44,45]),import.meta.url);return{id:d1,diagram:e}},"loader"),c3={id:d1,detector:s3,loader:l3},h3=c3,u1="er",d3=w(e=>/^\s*erDiagram/.test(e),"detector"),u3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./C1IwSyrV.js");return{diagram:t}},__vite__mapDeps([47,9,10,45]),import.meta.url);return{id:u1,diagram:e}},"loader"),f3={id:u1,detector:d3,loader:u3},g3=f3,f1="gitGraph",p3=w(e=>/^\s*gitGraph/.test(e),"detector"),m3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./7Iuyw4Ow.js");return{diagram:t}},__vite__mapDeps([48,49,50,51,15,16]),import.meta.url);return{id:f1,diagram:e}},"loader"),y3={id:f1,detector:p3,loader:m3},x3=y3,g1="gantt",b3=w(e=>/^\s*gantt/.test(e),"detector"),C3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./_lZu5Dth.js");return{diagram:t}},__vite__mapDeps([52,4,53,54,55,56]),import.meta.url);return{id:g1,diagram:e}},"loader"),w3={id:g1,detector:b3,loader:C3},k3=w3,p1="info",S3=w(e=>/^\s*info/.test(e),"detector"),v3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./HP7Asd0t.js");return{diagram:t}},__vite__mapDeps([57,51,15,16]),import.meta.url);return{id:p1,diagram:e}},"loader"),_3={id:p1,detector:S3,loader:v3},m1="pie",T3=w(e=>/^\s*pie/.test(e),"detector"),M3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CHj2oCmD.js");return{diagram:t}},__vite__mapDeps([58,50,51,15,16,59,60,55,61]),import.meta.url);return{id:m1,diagram:e}},"loader"),B3={id:m1,detector:T3,loader:M3},y1="quadrantChart",L3=w(e=>/^\s*quadrantChart/.test(e),"detector"),A3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CsASRGy9.js");return{diagram:t}},__vite__mapDeps([62,54,55,56]),import.meta.url);return{id:y1,diagram:e}},"loader"),F3={id:y1,detector:L3,loader:A3},$3=F3,x1="xychart",E3=w(e=>/^\s*xychart(-beta)?/.test(e),"detector"),P3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./o-kBqlaj.js");return{diagram:t}},__vite__mapDeps([63,64,55,60,54,56]),import.meta.url);return{id:x1,diagram:e}},"loader"),O3={id:x1,detector:E3,loader:P3},I3=O3,b1="requirement",R3=w(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),D3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CrcLvVto.js");return{diagram:t}},__vite__mapDeps([65,9,10]),import.meta.url);return{id:b1,diagram:e}},"loader"),N3={id:b1,detector:R3,loader:D3},q3=N3,C1="sequence",z3=w(e=>/^\s*sequenceDiagram/.test(e),"detector"),W3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./S1FanOB0.js");return{diagram:t}},__vite__mapDeps([66,49,6]),import.meta.url);return{id:C1,diagram:e}},"loader"),H3={id:C1,detector:z3,loader:W3},Y3=H3,w1="class",X3=w((e,t)=>t?.class?.defaultRenderer==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e),"detector"),j3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./Dx6eBL0x.js");return{diagram:t}},__vite__mapDeps([67,68,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44]),import.meta.url);return{id:w1,diagram:e}},"loader"),G3={id:w1,detector:X3,loader:j3},U3=G3,k1="classDiagram",V3=w((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e),"detector"),Z3=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CHIHAnR-.js");return{diagram:t}},__vite__mapDeps([69,68,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44]),import.meta.url);return{id:k1,diagram:e}},"loader"),K3={id:k1,detector:V3,loader:Z3},Q3=K3,S1="state",J3=w((e,t)=>t?.state?.defaultRenderer==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e),"detector"),tE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BbiXTFqz.js");return{diagram:t}},__vite__mapDeps([70,71,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44,1]),import.meta.url);return{id:S1,diagram:e}},"loader"),eE={id:S1,detector:J3,loader:tE},rE=eE,v1="stateDiagram",iE=w((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer==="dagre-wrapper"),"detector"),oE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BCO4VeSA.js");return{diagram:t}},__vite__mapDeps([72,71,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44]),import.meta.url);return{id:v1,diagram:e}},"loader"),nE={id:v1,detector:iE,loader:oE},aE=nE,_1="journey",sE=w(e=>/^\s*journey/.test(e),"detector"),lE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CUvX4uDB.js");return{diagram:t}},__vite__mapDeps([73,8,6,59]),import.meta.url);return{id:_1,diagram:e}},"loader"),cE={id:_1,detector:sE,loader:lE},hE=cE,dE=w((e,t,r)=>{pt.debug(`rendering svg for syntax error
|
|
300
|
-
`);const i=F_(t),o=i.append("g");i.attr("viewBox","0 0 2412 512"),Im(i,100,512,!0),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.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"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`)},"draw"),T1={draw:dE},uE=T1,fE={db:{},renderer:T1,parser:{parse:w(()=>{},"parse")}},gE=fE,M1="flowchart-elk",pE=w((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer==="elk"?(t.layout="elk",!0):!1,"detector"),mE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./DEOiJZFa.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([7,8,9,10,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,4,37,38,39,40,41,42,43,44,45]),import.meta.url);return{id:M1,diagram:e}},"loader"),yE={id:M1,detector:pE,loader:mE},xE=yE,B1="timeline",bE=w(e=>/^\s*timeline/.test(e),"detector"),CE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BGBb6fI-.js");return{diagram:t}},__vite__mapDeps([74,59]),import.meta.url);return{id:B1,diagram:e}},"loader"),wE={id:B1,detector:bE,loader:CE},kE=wE,L1="mindmap",SE=w(e=>/^\s*mindmap/.test(e),"detector"),vE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BZoKWA-r.js");return{diagram:t}},__vite__mapDeps([75,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,35,36,4,37,38,39,40,41,42,43,44]),import.meta.url);return{id:L1,diagram:e}},"loader"),_E={id:L1,detector:SE,loader:vE},TE=_E,A1="kanban",ME=w(e=>/^\s*kanban/.test(e),"detector"),BE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./fULl8IO9.js");return{diagram:t}},__vite__mapDeps([76,8]),import.meta.url);return{id:A1,diagram:e}},"loader"),LE={id:A1,detector:ME,loader:BE},AE=LE,F1="sankey",FE=w(e=>/^\s*sankey(-beta)?/.test(e),"detector"),$E=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BOXqfDS_.js");return{diagram:t}},__vite__mapDeps([77,60,55,78]),import.meta.url);return{id:F1,diagram:e}},"loader"),EE={id:F1,detector:FE,loader:$E},PE=EE,$1="packet",OE=w(e=>/^\s*packet(-beta)?/.test(e),"detector"),IE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CKFDW9cI.js");return{diagram:t}},__vite__mapDeps([79,50,51,15,16]),import.meta.url);return{id:$1,diagram:e}},"loader"),RE={id:$1,detector:OE,loader:IE},E1="radar",DE=w(e=>/^\s*radar-beta/.test(e),"detector"),NE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./sIHUXgeh.js");return{diagram:t}},__vite__mapDeps([80,50,51,15,16]),import.meta.url);return{id:E1,diagram:e}},"loader"),qE={id:E1,detector:DE,loader:NE},P1="block",zE=w(e=>/^\s*block(-beta)?/.test(e),"detector"),WE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./DJ0w8Oax.js");return{diagram:t}},__vite__mapDeps([81,8,45]),import.meta.url);return{id:P1,diagram:e}},"loader"),HE={id:P1,detector:zE,loader:WE},YE=HE,O1="treeView",XE=w(e=>/^\s*treeView-beta/.test(e),"detector"),jE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./BtHVXttl.js");return{diagram:t}},__vite__mapDeps([82,49,50,51,15,16]),import.meta.url);return{id:O1,diagram:e}},"loader"),GE={id:O1,detector:XE,loader:jE},UE=GE,I1="architecture",VE=w(e=>/^\s*architecture/.test(e),"detector"),ZE=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./9ySBq1wF.js");return{diagram:t}},__vite__mapDeps([83,50,51,15,16,3,4]),import.meta.url);return{id:I1,diagram:e}},"loader"),KE={id:I1,detector:VE,loader:ZE},QE=KE,R1="eventmodeling",JE=w(e=>/^\s*eventmodeling/.test(e),"detector"),tP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./D61DwhDw.js");return{diagram:t}},__vite__mapDeps([84,50,51,15,16]),import.meta.url);return{id:R1,diagram:e}},"loader"),eP={id:R1,detector:JE,loader:tP},rP=eP,D1="ishikawa",iP=w(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),oP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./D04E4MVv.js");return{diagram:t}},[],import.meta.url);return{id:D1,diagram:e}},"loader"),nP={id:D1,detector:iP,loader:oP},N1="venn",aP=w(e=>/^\s*venn-beta/.test(e),"detector"),sP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./DkH3yb1j.js");return{diagram:t}},[],import.meta.url);return{id:N1,diagram:e}},"loader"),lP={id:N1,detector:aP,loader:sP},cP=lP,q1="treemap",hP=w(e=>/^\s*treemap/.test(e),"detector"),dP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CmWBRPmR.js");return{diagram:t}},__vite__mapDeps([85,50,10,51,15,16,56,60,55,86]),import.meta.url);return{id:q1,diagram:e}},"loader"),uP={id:q1,detector:hP,loader:dP},z1="wardley",fP=w(e=>/^\s*wardley-beta/i.test(e),"detector"),gP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CgAIOmc3.js");return{diagram:t}},__vite__mapDeps([87,50,51,15,16]),import.meta.url);return{id:z1,diagram:e}},"loader"),pP={id:z1,detector:fP,loader:gP},mP=pP,W1="cynefin",yP=w(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),xP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./gzjZWAx8.js");return{diagram:t}},__vite__mapDeps([88,50,51,15,16]),import.meta.url);return{id:W1,diagram:e}},"loader"),bP={id:W1,detector:yP,loader:xP},H1="railroad",CP=w(e=>/^\s*railroad-beta/i.test(e),"detector"),wP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./D_9AVJm5.js");return{diagram:t}},__vite__mapDeps([89,90,50,51,15,16]),import.meta.url);return{id:H1,diagram:e}},"loader"),kP={id:H1,detector:CP,loader:wP},Y1="railroadEbnf",SP=w(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),vP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CQe4IdgR.js");return{diagram:t}},__vite__mapDeps([91,90,50,51,15,16]),import.meta.url);return{id:Y1,diagram:e}},"loader"),_P={id:Y1,detector:SP,loader:vP},X1="railroadAbnf",TP=w(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),MP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./Cmo-9vFV.js");return{diagram:t}},__vite__mapDeps([92,90,50,51,15,16]),import.meta.url);return{id:X1,diagram:e}},"loader"),BP={id:X1,detector:TP,loader:MP},j1="railroadPeg",LP=w(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),AP=w(async()=>{const{diagram:e}=await Ye(async()=>{const{diagram:t}=await import("./CBHPIqXg.js");return{diagram:t}},__vite__mapDeps([93,90,50,51,15,16]),import.meta.url);return{id:j1,diagram:e}},"loader"),FP={id:j1,detector:LP,loader:AP},Ip=!1,dc=w(()=>{Ip||(Ip=!0,yl("error",gE,e=>e.toLowerCase().trim()==="error"),yl("---",{db:{clear:w(()=>{},"clear")},styles:{},renderer:{draw:w(()=>{},"draw")},parser:{parse:w(()=>{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:w(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),kh(xE,TE,QE),kh(Q$,AE,Q3,U3,g3,k3,_3,B3,q3,Y3,h3,a3,r3,kE,x3,aE,rE,hE,$3,PE,RE,I3,YE,rP,UE,qE,nP,uP,kP,_P,BP,FP,cP,mP,bP))},"addDiagrams"),$P=w(async()=>{pt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(mn).map(async([r,{detector:i,loader:o}])=>{if(o)try{Th(r)}catch{try{const{diagram:n,id:a}=await o();yl(a,n,i)}catch(n){throw pt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete mn[r],n}}}))).filter(r=>r.status==="rejected");if(t.length>0){pt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)pt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),EP="graphics-document document";function G1(e,t){e.attr("role",EP),t!==""&&e.attr("aria-roledescription",t)}w(G1,"setA11yDiagramInfo");function U1(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)}}}w(U1,"addSVGa11yTitleDescription");var gn,ad=(gn=class{constructor(t,r,i,o,n){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=n}static async fromText(t,r={}){const i=Br(),o=md(t,i);t=JT(t)+`
|
|
301
|
-
`;try{Th(o)}catch{const c=_w(o);if(!c)throw new Am(`Diagram ${o} not found.`);const{id:h,diagram:d}=await c();yl(h,d)}const{db:n,parser:a,renderer:s,init:l}=Th(o);return a.parser&&(a.parser.yy=n),n.clear?.(),l?.(i),r.title&&n.setDiagramTitle?.(r.title),await a.parse(t),new gn(o,t,n,a,s)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},w(gn,"Diagram"),gn),Rp=[],PP=w(()=>{Rp.forEach(e=>{e()}),Rp=[]},"attachFunctions"),OP=w(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function V1(e){const t=e.match(Lm);if(!t)return{text:e,metadata:{}};const r=t[1],i=r?t[2].split(`
|
|
302
|
-
`).map(a=>a.startsWith(r)?a.slice(r.length):a).join(`
|
|
303
|
-
`):t[2];let o=B$(i,{schema:M$})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const n={};return o.displayMode&&(n.displayMode=o.displayMode.toString()),o.title&&(n.title=o.title.toString()),o.config&&(n.config=o.config),{text:e.slice(t[0].length),metadata:n}}w(V1,"extractFrontMatter");var IP=w(e=>e.replace(/\r\n?/g,`
|
|
304
|
-
`).replace(/<(\w+)([^>]*)>/g,(t,r,i)=>"<"+r+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),RP=w(e=>{const{text:t,metadata:r}=V1(e),{displayMode:i,title:o,config:n={}}=r;return i&&(n.gantt||(n.gantt={}),n.gantt.displayMode=i),{title:o,config:n,text:t}},"processFrontmatter"),DP=w(e=>{const t=Ur.detectInit(e)??{},r=Ur.detectDirective(e,"wrap");return Array.isArray(r)?t.wrap=r.some(({type:i})=>i==="wrap"):r?.type==="wrap"&&(t.wrap=!0),{text:qT(e),directive:t}},"processDirectives");function Ru(e){const t=IP(e),r=RP(t),i=DP(r.text),o=Hd(r.config,i.directive);return e=OP(i.text),{code:e,title:r.title,config:o}}w(Ru,"preprocessDiagram");function Z1(e){const t=new TextEncoder().encode(e),r=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(r)}w(Z1,"toBase64");var NP=5e4,qP="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",zP="sandbox",WP="loose",HP="http://www.w3.org/2000/svg",YP="http://www.w3.org/1999/xlink",XP="http://www.w3.org/1999/xhtml",jP="100%",GP="100%",UP="border:0;margin:0;",VP="margin:0",ZP="allow-top-navigation-by-user-activation allow-popups",KP='The "iframe" tag is not supported by your browser.',QP=["foreignobject"],JP=["dominant-baseline"];function Du(e){const t=Ru(e);return pl(),ww(t.config??{}),t}w(Du,"processAndSetConfigs");async function K1(e,t){dc();try{const{code:r,config:i}=Du(e);return{diagramType:(await J1(r)).type,config:i}}catch(r){if(t?.suppressErrors)return!1;throw r}}w(K1,"parse");var Dp=w((e,t,r=[])=>{const i=vm(`{ ${r.join(" !important; ")} !important; }`);return`.${e} ${t} ${i}`},"cssImportantStyles"),t4=w((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 s=Vr(e)?["> *","span"]:["rect","polygon","ellipse","circle","path"];t.forEach(l=>{Gf(l.styles)||s.forEach(c=>{r.insertRule(Dp(l.id,c,l.styles),r.cssRules.length)}),Gf(l.textStyles)||r.insertRule(Dp(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=_h(o)+`
|
|
305
|
-
`}else i+=`${e.themeCSS}
|
|
306
|
-
`;return i+_h(r)},"createCssStyles"),e4=w((e,t)=>nd(X$(`${e}{${t}}`),U$([w(function(i,o,n,a){if(i.type==="rule"&&Array.isArray(i.props)){if(i.parent&&i.parent.type===rd)return;i.props=i.props.map(s=>s===e&&Array.isArray(i.children)&&i.children.every(c=>c.type!=="decl"?!1:new Set(["font-family","font-size","fill"]).has(c.props))||(s.startsWith(`${e} `)||s.startsWith(`${e}>`))&&!s.startsWith(`${e} ||`)?s:`${e} ${s}`)}else i.type.startsWith("@")&&([...[F$,E$,o1,O$,"@container","@starting-style"],rd].includes(i.type)||(pt.warn(`Removing unsupported at-rule ${i.type} from CSS`),i.type=Ou))},"addNamespace"),G$])),"compileCSS"),r4=w((e,t,r,i)=>{const o=t4(e,r),n=Hw(t,o,{...e.themeVariables,theme:e.theme,look:e.look},i);return e4(i,n)},"createUserStyles"),i4=w((e="",t,r)=>{let i=e;return!r&&!t&&(i=i.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#')),i=Uo(i),i=i.replace(/<br>/g,"<br/>"),i},"cleanUpSvgCode"),o4=w((e="",t)=>{const r=t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+"px":GP,i=Z1(`<body style="${VP}">${e}</body>`);return`<iframe style="width:${jP};height:${r};${UP}" src="data:text/html;charset=UTF-8;base64,${i}" sandbox="${ZP}">
|
|
307
|
-
${KP}
|
|
308
|
-
</iframe>`},"putIntoIFrame"),Np=w((e,t,r,i,o)=>{const n=e.append("div");n.attr("id",r),i&&n.attr("style",i);const a=n.append("svg").attr("id",t).attr("width","100%").attr("xmlns",HP);return o&&a.attr("xmlns:xlink",o),a.append("g"),e},"appendDivSvgG");function sd(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}w(sd,"sandboxedIframe");var n4=w((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),a4=w(async function(e,t,r){dc();const i=Du(t);t=i.code;const o=Br();pt.debug(o),t.length>(o?.maxTextSize??NP)&&(t=qP);const n=`#${e}`,a="i"+e,s="#"+a,l="d"+e,c="#"+l,h=w(()=>{const F=He(u?s:c).node();F&&"remove"in F&&F.remove()},"removeTempElements");let d=He(document.body);const u=o.securityLevel===zP,f=o.securityLevel===WP,p=o.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),u){const N=sd(He(r),a);d=He(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=He(r);Np(d,e,l,`font-family: ${p}`,YP)}else{if(n4(document,e,l,a),u){const N=sd(He(document.body),a);d=He(N.nodes()[0].contentDocument.body),d.node().style.margin="0"}else d=He("body");Np(d,e,l)}let g,m;try{g=await ad.fromText(t,{title:i.title})}catch(N){if(o.suppressErrorRendering)throw h(),N;g=await ad.fromText("error"),m=N}const y=d.select(c).node(),x=g.type,C=y.firstChild,k=C.firstChild,v=g.renderer.getClasses?.(t,g),T=r4(o,x,v,n),L=document.createElement("style");L.innerHTML=T,C.insertBefore(L,k);try{await g.renderer.draw(t,e,"11.17.2",g)}catch(N){throw o.suppressErrorRendering?h():uE.draw(t,e,"11.17.2"),N}const A=d.select(`${c} svg`),_=g.db.getAccTitle?.(),M=g.db.getAccDescription?.();tC(x,A,_,M);const P=w(()=>{d.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",XP);let N=d.select(c).node().innerHTML;if(pt.debug("config.arrowMarkerAbsolute",o.arrowMarkerAbsolute),N=i4(N,u,ao(o.arrowMarkerAbsolute)),u){const F=d.select(c+" svg").node();N=o4(N,F)}else f||(N=ca.sanitize(N,{ADD_TAGS:QP,ADD_ATTR:JP,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return PP(),N},"serializeSvg")();if(m)throw m;return h(),{diagramType:x,svg:P,bindFunctions:g.db.bindFunctions}},"render");function Q1(e={}){const t=qr({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),bw(t),t?.theme&&t.theme in wo?t.themeVariables=wo[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=wo.default.getThemeVariables(t.themeVariables));const r=typeof t=="object"?xw(t):_m();pd(r.logLevel),dc()}w(Q1,"initialize");var J1=w((e,t={})=>{const{code:r}=Ru(e);return ad.fromText(r,t)},"getDiagramFromText");function tC(e,t,r,i){G1(t,e),U1(t,r,i,t.attr("id"))}w(tC,"addA11yInfo");var kn=Object.freeze({render:a4,parse:K1,getDiagramFromText:J1,initialize:Q1,getConfig:Br,setConfig:Tm,getSiteConfig:_m,updateSiteConfig:Cw,reset:w(()=>{pl()},"reset"),globalReset:w(()=>{pl(ha)},"globalReset"),defaultConfig:ha});pd(Br().logLevel);pl(Br());var s4=w((e,t,r)=>{pt.warn(e),Wd(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"),eC=w(async function(e={querySelector:".mermaid"}){try{await l4(e)}catch(t){if(Wd(t)&&pt.error(t.str),_o.parseError&&_o.parseError(t),!e.suppressErrors)throw pt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),l4=w(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=kn.getConfig();pt.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");pt.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(pt.debug("Start On Load: "+i?.startOnLoad),kn.updateSiteConfig({startOnLoad:i?.startOnLoad}));const n=new Ur.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let a;const s=[];for(const l of Array.from(o)){if(pt.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${n.next()}`;a=l.innerHTML,a=cx(Ur.entityDecode(a)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Ur.detectInit(a);h&&pt.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await nC(c,a,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){s4(d,s,_o.parseError)}}if(s.length>0)throw s[0]},"runThrowsErrors"),rC=w(function(e){kn.initialize(e)},"initialize"),c4=w(async function(e,t,r){pt.warn("mermaid.init is deprecated. Please use run instead."),e&&rC(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await eC(i)},"init"),h4=w(async(e,{lazyLoad:t=!0}={})=>{dc(),kh(...e),t===!1&&await $P()},"registerExternalDiagrams"),iC=w(function(){if(_o.startOnLoad){const{startOnLoad:e}=kn.getConfig();e&&_o.run().catch(t=>pt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",iC,!1);var d4=w(function(e){_o.parseError=e},"setParseErrorHandler"),Nl=[],hh=!1,oC=w(async()=>{if(!hh){for(hh=!0;Nl.length>0;){const e=Nl.shift();if(e)try{await e()}catch(t){pt.error("Error executing queue",t)}}hh=!1}},"executeQueue"),u4=w(async(e,t)=>new Promise((r,i)=>{const o=w(()=>new Promise((n,a)=>{kn.parse(e,t).then(s=>{n(s),r(s)},s=>{pt.error("Error parsing",s),_o.parseError?.(s),a(s),i(s)})}),"performCall");Nl.push(o),oC().catch(i)}),"parse"),nC=w((e,t,r)=>new Promise((i,o)=>{const n=w(()=>new Promise((a,s)=>{kn.render(e,t,r).then(l=>{a(l),i(l)},l=>{pt.error("Error parsing",l),_o.parseError?.(l),s(l),o(l)})}),"performCall");Nl.push(n),oC().catch(o)}),"render"),f4=w(()=>Object.keys(mn).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),_o={startOnLoad:!0,mermaidAPI:kn,parse:u4,render:nC,init:c4,run:eC,registerExternalDiagrams:h4,registerLayoutLoaders:e1,initialize:rC,parseError:void 0,contentLoaded:iC,setParseErrorHandler:d4,detectType:md,registerIconPacks:rT,getRegisteredDiagramsMetadata:f4},hl=_o;/*! Check if previously processed *//*!
|
|
309
|
-
* Wait for document loaded before starting the execution
|
|
310
|
-
*/var g4=Object.create,Nu=Object.defineProperty,p4=Object.getOwnPropertyDescriptor,aC=Object.getOwnPropertyNames,m4=Object.getPrototypeOf,y4=Object.prototype.hasOwnProperty,x4=(e,t)=>Nu(e,"name",{value:t,configurable:!0}),H6=(e,t)=>function(){return t||(0,e[aC(e)[0]])((t={exports:{}}).exports,t),t.exports},b4=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of aC(t))!y4.call(e,o)&&o!==r&&Nu(e,o,{get:()=>t[o],enumerable:!(i=p4(t,o))||i.enumerable});return e},Y6=(e,t,r)=>(r=e!=null?g4(m4(e)):{},b4(Nu(r,"default",{value:e,enumerable:!0}),e)),qp=x4(async()=>await Ye(()=>import("./CSbiiZpm.js").then(e=>e.az),__vite__mapDeps([94,15,16,4]),import.meta.url),"loader"),C4=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap"],w4=[{name:"elk",loader:qp,algorithm:"elk.layered"},...C4.map(e=>({name:e,loader:qp,algorithm:e}))],k4=w4;function S4(e,t=80){let r,i,o=!1,n=!1,a=0,s;async function l(){if(s=void 0,n||o||!i)return;const c=i,h=a;i=void 0,o=!0;try{await e(c,()=>!n&&h===a)}finally{o=!1,!n&&i&&(s=setTimeout(()=>void l(),t))}}return{update(c){n||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))&&(a+=1),r=c,i=c,!o&&s===void 0&&l())},dispose(){n=!0,a+=1,i=void 0,s!==void 0&&clearTimeout(s)}}}const sC="http://www.w3.org/2000/svg",lC="http://www.w3.org/1999/xhtml",cC=["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 v4(e,t){const r=getComputedStyle(e);for(const i of cC){const o=r.getPropertyValue(i);o&&(t instanceof SVGElement||t instanceof HTMLElement)&&t.style.setProperty(i,o,"important")}}function _4(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(lC,"span");i.setAttribute("aria-hidden","true"),i.setAttribute("data-diagram-export-pseudo","before");for(const o of cC){const n=r.getPropertyValue(o);n&&i.style.setProperty(o,n)}for(const o of["position","z-index","top","right","bottom","left","pointer-events","mask-image","mask-composite","mask-size","mask-repeat"]){const n=r.getPropertyValue(o);n&&i.style.setProperty(o,n)}t.prepend(i)}function hC(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,n=e.getAttribute("width")??"",a=e.getAttribute("height")??"",s=/^\d+(?:\.\d+)?(?:px)?$/.test(n)?Number.parseFloat(n):0,l=/^\d+(?:\.\d+)?(?:px)?$/.test(a)?Number.parseFloat(a):0,c=e.classList.contains("diagram-svg-layer"),h=(c?s:0)||r.width||s||i||1,d=(c?l:0)||r.height||l||o||1;return{width:h,height:d}}function T4(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 uc(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 fc(e){const t=e.cloneNode(!0);t.setAttribute("xmlns",sC),t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const r=[e,...e.querySelectorAll("*")],i=[t,...t.querySelectorAll("*")];r.forEach((a,s)=>{const l=i[s];if(l){if(v4(a,l),a.parentElement?.localName==="foreignObject"&&a instanceof HTMLElement&&l.setAttribute("xmlns",lC),a instanceof HTMLElement&&l instanceof HTMLElement)for(const c of["position","isolation","z-index"])l.style.setProperty(c,getComputedStyle(a).getPropertyValue(c));_4(a,l)}});const{width:o,height:n}=hC(e);return t.hasAttribute("viewBox")||t.setAttribute("viewBox",`0 0 ${o} ${n}`),t.setAttribute("width",String(o)),t.setAttribute("height",String(n)),t.style.setProperty("width",`${o}px`,"important"),t.style.setProperty("height",`${n}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 X6(e){return new XMLSerializer().serializeToString(fc(uc(e)))}async function qu(e){const t=s=>s.trim().replace(/^["']|["']$/g,"").toLowerCase(),r=new Set([e,...e.querySelectorAll("[style]")].flatMap(s=>s.style.fontFamily.split(",").map(t))),i=[],o=s=>{let l;try{l=s.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 s of Array.from(e.ownerDocument.styleSheets))o(s);if(!i.length)return;const n=await Promise.all(i.map(async s=>{const l=[...s.cssText.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)];let c=s.cssText;for(const[h,,d]of l){if(d.startsWith("data:"))continue;const u=await fetch(new URL(d,s.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})),a=document.createElementNS(sC,"style");a.textContent=n.join(`
|
|
311
|
-
`),e.prepend(a)}async function M4(e){const t=fc(uc(e));await qu(t),await E2(new XMLSerializer().serializeToString(t))}async function B4(e){const t=uc(e),r=fc(t),{width:i,height:o}=hC(t);await qu(r);const n=2,a=new Image;try{a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`,await a.decode();const s=document.createElement("canvas");s.width=Math.round(i*n),s.height=Math.round(o*n);const l=s.getContext("2d");if(!l)throw new Error("Canvas context is unavailable");l.fillStyle=T4(t),l.fillRect(0,0,s.width,s.height),l.drawImage(a,0,0,s.width,s.height);const c=await new Promise((h,d)=>{s.toBlob(u=>u?h(u):d(new Error("PNG encoding failed")),"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}finally{a.src=""}}async function L4(e,t="diagram"){const r=fc(uc(e));await qu(r);const i=new Blob([new XMLSerializer().serializeToString(r)],{type:"image/svg+xml"}),o=URL.createObjectURL(i),n=document.createElement("a");n.href=o,n.download=`${t.replace(/[^a-z0-9._-]+/gi,"-").replace(/^-|-$/g,"")||"diagram"}.svg`,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(o)}var A4=er("<!> <!> <!>",1),F4=er("<!> <!>",1);function zu(e,t){if(new.target)return To({component:zu,...e});Lo(t,!0);let r=Ne(t,"container",7),i=Ne(t,"fileName",7,"diagram"),o=Ne(t,"compactTrigger",7,!1);async function n(){if(!r())return fo.error(ze.diagram_actions_copyFailed_error());try{await B4(r()),fo.success(ze.diagram_actions_imageCopied_label())}catch{fo.error(ze.diagram_actions_copyFailed_error())}}async function a(){if(!r())return fo.error(ze.diagram_actions_copyFailed_error());try{await M4(r()),fo.success(ze.diagram_actions_svgCopied_label())}catch{fo.error(ze.diagram_actions_copyFailed_error())}}async function s(){if(!r())return fo.error(ze.diagram_actions_downloadFailed_error());try{await L4(r(),i()),fo.success(ze.diagram_actions_svgDownloaded_label())}catch{fo.error(ze.diagram_actions_downloadFailed_error())}}var l={get container(){return r()},set container(d){r(d),_e()},get fileName(){return i()},set fileName(d="diagram"){i(d),_e()},get compactTrigger(){return o()},set compactTrigger(d=!1){o(d),_e()},$set:Mo,$on:(d,u)=>Bo(t,d,u)},c=Xo(),h=ti(c);return rn(h,()=>$2,(d,u)=>{u(d,{children:(f,p)=>{var g=F4(),m=ti(g);{let x=Pt(()=>ze.diagram_actions_menu_ariaLabel()),C=Pt(()=>o()?"size-(--control-height-compact) p-0":void 0);rn(m,()=>L2,(k,v)=>{v(k,{get"aria-label"(){return S(x)},get class(){return S(C)},children:(T,L)=>{A2(T,{class:"size-3.5"})},$$slots:{default:!0}})})}var y=De(m,2);rn(y,()=>F2,(x,C)=>{C(x,{align:"end",children:(k,v)=>{var T=A4(),L=ti(T);rn(L,()=>Cc,(M,$)=>{$(M,{onSelect:()=>void n(),children:(P,N)=>{Va();var F=Vs();ar(E=>mr(F,E),[()=>ze.diagram_actions_copyImage_label()]),ue(P,F)},$$slots:{default:!0}})});var A=De(L,2);rn(A,()=>Cc,(M,$)=>{$(M,{onSelect:()=>void a(),children:(P,N)=>{Va();var F=Vs();ar(E=>mr(F,E),[()=>ze.diagram_actions_copySvg_label()]),ue(P,F)},$$slots:{default:!0}})});var _=De(A,2);rn(_,()=>Cc,(M,$)=>{$(M,{onSelect:()=>void s(),children:(P,N)=>{Va();var F=Vs();ar(E=>mr(F,E),[()=>ze.diagram_actions_downloadSvg_label()]),ue(P,F)},$$slots:{default:!0}})}),ue(k,T)},$$slots:{default:!0}})}),ue(f,g)},$$slots:{default:!0}})}),ue(e,c),Ao(l)}const $4="Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",E4="Inter";function gc(e,t,r){const i=e.getPropertyValue(t).trim();if(!i&&r)return gc(e,r);if(!i)throw new Error(`Missing Mermaid design token: ${t}`);return i}function Yi(e,t,r){const i=gc(e,t,r);if(i.startsWith("color-mix(")&&typeof document<"u"){const o=document.createElement("canvas");o.width=1,o.height=1;const n=o.getContext("2d");if(n){n.fillStyle=i,n.fillRect(0,0,1,1);const[a,s,l,c]=n.getImageData(0,0,1,1).data;return c===255?`rgb(${a}, ${s}, ${l})`:`rgba(${a}, ${s}, ${l}, ${c/255})`}}return/^(#|rgb|hsl|oklch|color(?:-mix)?\()/.test(i)?i:`hsl(${i})`}function P4(e,t,r){const i=gc(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 O4(e,t=!0){const r=Yi(e,"--foreground"),i=Yi(e,"--card-foreground"),o=Yi(e,"--muted"),n=Yi(e,"--border"),a=Yi(e,"--accent"),s=Yi(e,"--accent-foreground"),l=Yi(e,"--diagram-canvas","--background"),c=Yi(e,"--diagram-node-surface","--card"),h=Yi(e,"--diagram-connector","--muted-foreground"),d=Yi(e,"--muted-foreground"),u=e.getPropertyValue("--font-ui").trim()||$4,f=P4(e,"--text-caption-size");return gc(e,"--radius-small"),{startOnLoad:!1,theme:"base",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(`
|
|
312
|
-
`),flowchart:{useMaxWidth:!1,curve:"stepAfter",diagramPadding:8,nodeSpacing:32,rankSpacing:40,wrappingWidth:200},sequence:{useMaxWidth:!1,wrap:!0,mirrorActors:!1,actorMargin:40,boxMargin:8,boxTextMargin:6,noteMargin:8,messageMargin:24,width:140,wrapPadding:6},class:{defaultRenderer:"dagre-d3",htmlLabels:!1},state:{defaultRenderer:"dagre-d3",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:n,lineColor:h,arrowheadColor:h,textColor:r,mainBkg:c,nodeBkg:c,nodeBorder:c,nodeTextColor:i,clusterBkg:l,clusterBorder:n,defaultLinkColor:h,edgeLabelBackground:l,titleColor:r,actorBkg:c,actorBorder:c,actorTextColor:i,actorLineColor:n,signalColor:h,signalTextColor:r,labelBoxBkgColor:o,labelBoxBorderColor:n,labelTextColor:r,loopTextColor:r,activationBkgColor:a,activationBorderColor:n,noteBkgColor:a,noteBorderColor:n,noteTextColor:s,transitionColor:h,transitionLabelColor:d,stateBkg:c,stateLabelColor:i,labelBackgroundColor:l,compositeBackground:l,compositeTitleBackground:l,compositeBorder:n,classText:i,fillType0:c,fillType1:o,fontFamily:u}}}let zp=Promise.resolve();function I4(e,t=()=>!0){const r=async()=>{if(t()&&(await new Promise(o=>setTimeout(o,0)),!!t()))return e()},i=zp.then(r,r);return zp=i.then(()=>{},()=>{}),i}const R4=/[./\\:_-]/;function pc(e){const t=[];let r="";const i=(o,n=!1)=>{r&&t.push({text:r,breakAfter:o,hardBreak:n}),r=""};for(let o=0;o<e.length;o+=1){const n=e[o],a=e[o-1]??"";if(r&&/[A-Z]/.test(n)&&/[a-z0-9]/.test(a)&&i(!0),n===`
|
|
313
|
-
`){i(!0,!0);continue}r+=n,(/\s/.test(n)||R4.test(n))&&i(!0)}return i(!1),t}function Wp(e){return pc(e).map(t=>t.text.trim()).filter(Boolean)}function Wu(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 D4(e){const t=Wu(e);return t||e.split(/\s+/).flatMap(r=>r.match(/[^./\\]+[./\\]?/g)??[]).filter(Boolean)}const N4=new Intl.Segmenter(void 0,{granularity:"grapheme"});function ld(e){return Array.from(N4.segment(e),({segment:t})=>t)}function Hp(e,t,r,i=!1){const o=Math.max(1,t);let n=1,a="";for(const[s,l]of e.entries()){const c=l.replace(/[\t\r\f ]+/g," "),h=`${a}${c}`.trimStart();if(r(h.trimEnd())<=o){a=h;continue}a.trim()&&(n+=1),a="";for(const d of ld(c.trimStart()))a&&r(`${a}${d}`.trimEnd())>o&&(n+=1,a=""),a+=d;i&&r(c.trim())>o&&s<e.length-1&&(n+=1,a="")}return n}function q4(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,n=a=>{if(!(a===i||o.has(a))){o.add(a);for(const s of t.get(a)??[])n(s)}};for(const a of t.get(i)??[])n(a);r.set(i,o)}return r}function Hu(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 dC(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 Yp(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:n}of t)dC(r,i,o),n&&(n.dataset.labelKnockout="true")}function z4(e){const t=getComputedStyle(e),r=t.font||`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return document.fonts?.load(r,e.textContent??"")}const Xp="rect, circle, ellipse, polygon, path",jp=new WeakMap;function W4(){const e=new Map;let t;return r=>{if(e.has(r))return e.get(r);let i=r==="none"?Ci(0,0,0,0):ua(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,n,a,s]=t.getImageData(0,0,1,1).data;i=Ci(o,n,a,s/255)}}return i=i?.clamp()??null,e.set(r,i),i}}function Hs(e,t){const r=e.opacity+t.opacity*(1-e.opacity);if(!r)return Ci(0,0,0,0);const i=(o,n)=>(o*e.opacity+n*t.opacity*(1-e.opacity))/r;return Ci(i(e.r,t.r),i(e.g,t.g),i(e.b,t.b),r)}function Ys(e){return e?e.endsWith("%")?Number.parseFloat(e)/100:Number(e):1}function H4(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;for(const d of jp.get(e)??[])d();const r=[];jp.set(e,r);const i=W4();let o=Ci(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=Hs(o,f),o.opacity===1)break}if(o.opacity!==1)return;const n=[...e.querySelectorAll("g.cluster")],a=new Map(n.map(d=>[d,t?Hu(d,t):d.id])),s=d=>{const u=a.get(d)??d.id.match(/flowchart-(.+?)-\d+$/)?.[1]??d.id,f=n.filter(p=>{const g=a.get(p);return p!==d&&g&&t?.get(g)?.has(u)});return f.length?f.sort((p,g)=>t.get(a.get(p)).size-t.get(a.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=s(d),p=f?c(f,u):o;if(!p)return null;const g=d.querySelector(":scope > .label-container"),m=g?.matches(Xp)?g:g?.querySelector(Xp)??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?Hs(Ci(x.r,x.g,x.b,x.opacity*Ys(y.fillOpacity)*Ys(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(_=>_.nodeType===3&&_.textContent?.trim()))continue;let g=!1,m=u;const y=[];for(let _=p;_&&_!==e;_=_.parentElement){const M=getComputedStyle(_);(M.display==="none"||M.visibility==="hidden"||Ys(M.opacity)!==1)&&(g=!0),_.namespaceURI==="http://www.w3.org/1999/xhtml"&&y.unshift(_)}if(g)continue;for(const _ of y){const M=getComputedStyle(_),$=i(M.backgroundColor);if(!$||M.backgroundImage&&M.backgroundImage!=="none"){g=!0;break}m=Hs($,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"?Ys(x.fillOpacity):1;if(!k||!k.opacity||!v)continue;const T=_=>v2(Hs(Ci(_.r,_.g,_.b,_.opacity*v),m).formatHex(),m.formatHex()).ratio;if(T(k)>=4.5)continue;const A=[i(getComputedStyle(e).color),Ci(0,0,0),Ci(255,255,255)].filter(_=>_!==null).filter(_=>T(_)>=4.55)[0];A&&h.push({element:p,property:C,value:A.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 uC=6,ri=16,Y4=18,X4=4,Xs=7,fC=8,Yu=8;function Ei(e,t){return t==="top"?At(e,.5,0):t==="right"?At(e,1,.5):t==="bottom"?At(e,.5,1):At(e,0,.5)}function j4(e,t){const r=e.x+e.width/2,i=t.filter(Number.isFinite).toSorted((a,s)=>a-s);if(!i.some(a=>Math.abs(a-r)<=1))return r;const o=i.length+1,n=Math.min(ri,e.width*.6/(o-1));return r-n*(o-1)/2}function G4(e,t){const r=e.x+e.width/2;if(!t.some(n=>n<r)||!t.some(n=>n>r)||t.every(n=>Math.abs(n-r)>=ri))return;const i=Math.min(...t)-ri,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 Xu(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 n=new DOMPoint(t.x,t.y).matrixTransform(i),a=new DOMPoint(r.x,r.y).matrixTransform(i);return Math.hypot(a.x-n.x,a.y-n.y)/o||1}const Gr=24,U4=32;function ps(e){return Math.ceil(Math.max(e,18))+Gr+U4}function V4(e,t,r,i,o=!1){if((!o||r==="upper")&&t.y>=e.y+e.height+16){const u=Ei(e,"bottom"),f=Ei(t,"top"),p=(u.y+f.y)/2,g=Tr([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(nr(g).every(y=>!m.some(x=>_r(y,x,8))))return g}const n=r==="upper"&&t.y>=e.y+e.height,a=r==="upper"&&!n?"top":"right";if(o&&n){const u=Ei(e,"bottom"),f=Ei(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)&&_r(m,x,Yu)))return[u,p]}const s=n?"right":r==="upper"?"top":t.x>=e.x+e.width?"left":"right",l=Ei(e,a),c=Ei(t,s),h=o?16:32;if(a==="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 Tr([l,{x:l.x,y:u},{x:f,y:u},{x:f,y:c.y},c])}return Tr([l,{x:l.x,y:u},{x:c.x,y:u},c])}if(s==="left"&&l.y>=t.y&&l.y<=t.y+t.height)return[l,{x:t.x,y:l.y}];if(s==="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 Tr([l,{x:d,y:l.y},{x:d,y:c.y},c])}function Z4(e,t,r,i=!1){const o=Ei(e,"bottom"),n=Ei(t,i?"left":"bottom"),a=i?16:32,s=Math.max(...r.map(l=>l.y+l.height))+a;if(i){const l=Math.min(e.x,t.x,...r.map(h=>h.x))-a-12,c=o.y+12;return Tr([o,{x:o.x,y:c},{x:l,y:c},{x:l,y:n.y},n])}return Tr([o,{x:o.x,y:s},{x:n.x,y:s},n])}function K4(e,t,r,i=!1){const o=i?e.x+e.width+28:Math.max(...r.map(c=>c.x+c.width))+28,n=Math.min(...r.map(c=>c.x))-(i?12:28),a=Math.max(...r.map(c=>c.y+c.height))+(i?12:28),s=e.y+e.height/2,l=t.x+t.width/2;return[{x:e.x+e.width,y:s},{x:o,y:s},{x:o,y:a},{x:n,y:a},{x:n,y:t.y+t.height+12},{x:l,y:t.y+t.height+12},{x:l,y:t.y+t.height+.25}]}function Q4(e,t,r,i=!1){const o=Math.max(...r.map(s=>s.x+s.width))+(i?18:28),n=e.y+e.height/2,a=t.y+t.height/2;return[{x:e.x+e.width,y:n},{x:o,y:n},{x:o,y:a},{x:t.x+t.width,y:a}]}function J4(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 wi(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 _r(e,t,r=0){const i=t.x-r,o=t.x+t.width+r,n=t.y-r,a=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)>n&&Math.min(e.start.y,e.end.y)<a:Math.abs(e.start.y-e.end.y)>=.001?!1:e.start.y>n&&e.start.y<a&&Math.max(e.start.x,e.end.x)>i&&Math.min(e.start.x,e.end.x)<o}function tO(e,t,r=Yu,i=[]){let o=Tr(e);for(let n=0;n<t.length*2+1;n+=1){let a;for(let s=0;s<o.length-1&&!a;s+=1){const l={start:o[s],end:o[s+1]},c=t.find(m=>_r(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=nr(Tr(y)),C=x.reduce((T,L)=>T+t.filter(A=>A!==c&&_r(L,A,r)).length,0),k=x.filter(T=>i.some(L=>ya(T,L))).length,v=x.reduce((T,L)=>T+Math.hypot(L.end.x-L.start.x,L.end.y-L.start.y),0);return{detour:y,score:C*1e6+k*1e4+v}});a={index:s,points:g.toSorted((m,y)=>m.score-y.score)[0].detour}}if(!a)break;o=Tr([...o.slice(0,a.index),...a.points,...o.slice(a.index+2)])}return o}const ve={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={[ve.userSendsMessage]:["Idle","Starting"],[ve.agentResponds]:["Starting","Streaming"],[ve.toolStarts]:["Streaming","RunningTool"],[ve.toolCompletes]:["RunningTool","Streaming"],[ve.agentAsksUser]:["Streaming","NeedsInput"],[ve.userReplies]:["NeedsInput","Streaming"],[ve.agentFinishes]:["Streaming","Complete"],[ve.requestFails]:["Starting","Failed"],[ve.streamFails]:["Streaming","Failed"],[ve.userRetries]:["Failed","Starting"]};function eO(e){return{direction:e.direction,nodes:e.nodes.map(({id:t,domId:r,shape:i,isGroup:o,parentId:n})=>({id:t,domId:r,shape:i,isGroup:o,parentId:n})),edges:e.edges.map(({id:t,start:r,end:i,label:o})=>({id:t,start:r,end:i,label:o}))}}function cd(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}`,n=o.match(new RegExp(`L\\s*(${r})[\\s,]+(${r})\\s*$`,"i"));if(!n||n.index===void 0)return o;const a=o.slice(0,n.index).match(new RegExp(`(${r})[\\s,]+(${r})\\s*$`,"i"));return a&&Math.hypot(Number(a[1])-t.x,Number(a[2])-t.y)<.001?o.slice(0,n.index).trimEnd():o}function rO(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},n=[];let a={x:0,y:0};for(let p=0;p<i.length;){const g=i[p++],m=o[g];if(!m)return cd(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]}));n.push({command:g,points:x,start:a}),a=x.at(-1)}const s=p=>(p.x-t.x)*r.x+(p.y-t.y)*r.y;let l=n.length-1;for(;l>0&&s(n[l].start)>=0;)l-=1;const c=n[l];if(!c||c.command==="M"||s(c.points.at(-1))<0)return cd(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;s(h(g).at(-1))<0?d=g:u=g}return[...n.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 Ze(e,t){const r=e.getScreenCTM(),i=t.getScreenCTM();if(!r||!i)return null;const o=i.inverse(),n=e.getBBox(),a=[new DOMPoint(n.x,n.y),new DOMPoint(n.x+n.width,n.y),new DOMPoint(n.x+n.width,n.y+n.height),new DOMPoint(n.x,n.y+n.height)].map(d=>d.matrixTransform(r).matrixTransform(o)),s=Math.min(...a.map(d=>d.x)),l=Math.min(...a.map(d=>d.y)),c=Math.max(...a.map(d=>d.x)),h=Math.max(...a.map(d=>d.y));return{x:s,y:l,width:c-s,height:h-l}}function br(e,t){const r=t.getScreenCTM();if(!r)return Ze(e,t);const i=r.inverse(),o=e.getBoundingClientRect(),n=[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)),a=Math.min(...n.map(h=>h.x)),s=Math.min(...n.map(h=>h.y)),l=Math.max(...n.map(h=>h.x)),c=Math.max(...n.map(h=>h.y));return{x:a,y:s,width:l-a,height:c-s}}function gC(e,t,r,i=0){let o=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const[a,s,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(s)<1e-4){if(a<l-i||a>c+i)return null;continue}const h=(l-a)/s,d=(c-a)/s;o=Math.max(o,Math.min(h,d)),n=Math.min(n,Math.max(h,d))}return o<0||o>n?null:{x:e.x+t.x*o,y:e.y+t.y*o}}function Ki(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 iO(e,t,r){const i=r.x-t.x,o=r.y-t.y,n=i*i+o*o,a=n?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/n)):0;return Math.hypot(e.x-t.x-i*a,e.y-t.y-o*a)}function oO(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,n=e.width/2,a=[];for(let s=0;s<=32;s+=1){const l=Math.PI+Math.PI*s/32;a.push({x:o+Math.cos(l)*n,y:e.y+i+Math.sin(l)*i})}a.push({x:e.x+e.width,y:e.y+e.height-i});for(let s=0;s<=32;s+=1){const l=Math.PI*s/32;a.push({x:o+Math.cos(l)*n,y:e.y+e.height-i+Math.sin(l)*i})}return a.push({x:e.x,y:e.y+i}),a}function ro(e){return e.tagName.toLowerCase()!=="polygon"?!1:e.getAttribute("points")?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number)?.length===8}function pC(e){const t=At(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 nO(e,t,r){const i=(n,a)=>n.x*a.y-n.y*a.x,o=pC(r);return o.map((n,a)=>({start:n,end:o[(a+1)%o.length]})).flatMap(({start:n,end:a})=>{const s={x:a.x-n.x,y:a.y-n.y},l=i(t,s);if(Math.abs(l)<1e-4)return[];const c={x:n.x-e.x,y:n.y-e.y},h=i(c,s)/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((n,a)=>n.rayProgress-a.rayProgress)[0]?.point}function Up(e,t,r){if(r.tagName.toLowerCase()==="rect"&&r.closest("svg")?.classList.contains("statediagram")){const o=r.getScreenCTM(),n=getComputedStyle(r),a=r.getBBox(),s=h=>/^\d+(?:\.\d+)?(?:px)?$/.test(h)?Number.parseFloat(h):NaN,l=s(n.rx==="auto"?n.ry:n.rx),c=s(n.ry==="auto"?n.rx:n.ry);if(o&&Math.abs(o.b)<1e-8&&Math.abs(o.c)<1e-8){const h=Math.min(a.width/2,l)*Math.abs(o.a),d=Math.min(a.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=ro(r)?pC(t):r.dataset.diagramCylinder==="true"?oO(t,r):null;return i?Math.min(...i.map((o,n)=>iO(e,o,i[(n+1)%i.length]))):Ki(e,t)}function aO(e,t,r,i,o=0){const n=gC(e,t,r,o);if(!n)return null;if(ro(i))return nO(e,t,r)??n;if(i.dataset.diagramCylinder!=="true")return n;const a={x:r.x+r.width/2,y:r.y+r.height/2};let s=Math.hypot(n.x-e.x,n.y-e.y),l=(a.x-e.x)*t.x+(a.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-a.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=(s+l)/2;d(f)?l=f:s=f}return{x:e.x+t.x*l,y:e.y+t.y*l}}function Vp(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),n=r.getPointAtLength(Math.max(0,i-.1)),a=(r.dataset.terminalDirection??"").split(",").map(Number),s=a.length===2&&a.every(Number.isFinite)?{x:a[0],y:a[1]}:{x:o.x-n.x,y:o.y-n.y},l=Math.hypot(s.x,s.y);if(l<1e-4)continue;const c={x:s.x/l,y:s.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=br(m,r);if(!y)return[];const x=y,C=gC(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<=X4)?[{node:g,intersection:C,correction:k}]:[]}).sort((g,m)=>g.correction-m.correction)[0];if(!f)continue;const p=cd(r.getAttribute("d")??"",f.intersection);p&&(r.setAttribute("d",p),r.dataset.terminalTarget=f.node.id,r.dataset.terminalDirection=`${c.x},${c.y}`)}}function Zp(e,t){const i=(t.getAttribute("marker-end")??"").match(/#([^)'"]+)/)?.[1];return i?e.querySelector(`marker[id="${CSS.escape(i)}"]`):null}function Ra(e,t=5){const r=[...e.querySelectorAll("g.node")].flatMap(i=>{const o=Ve(i);return o?[{node:i,shape:o}]:[]});for(const i of e.querySelectorAll(".edgePaths path[marker-end], .edges.edgePath path[marker-end]")){if(Zp(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 n=i.getTotalLength();if(n<.25)continue;const a=i.getPointAtLength(n),s=i.getPointAtLength(Math.max(0,n-.1)),l=i.getScreenCTM();if(!l)continue;const c=new DOMPoint(a.x,a.y).matrixTransform(l),h=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(I=>I.split(",").map(Number)).filter(I=>I.length===2&&I.every(Number.isFinite)).map(([I,D])=>({x:I,y:D})),d=h.at(-2)??s,u=h.at(-1)??a,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:a.x-s.x,y:a.y-s.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=wr(i),k=i.dataset.terminalTarget??C?.target,v={x:c.x-x.x*256,y:c.y-x.y*256},L=r.flatMap(({node:I,shape:D})=>{if(k&&I.id!==k&&Ir(I)!==k)return[];const Z=D.getBoundingClientRect(),G={x:Z.left,y:Z.top,width:Z.width,height:Z.height},W=aO(v,x,G,D,e.classList.contains("statediagram")?.5:0);if(!W)return[];const Q={x:G.x+G.width/2,y:G.y+G.height/2},et=x.x*(Q.x-W.x)+x.y*(Q.y-W.y)>0,tt=Math.hypot(W.x-c.x,W.y-c.y);return et&&(k||tt<=12)?[{node:I,shape:D,bounds:G,intersection:W,correction:tt}]:[]}).sort((I,D)=>I.correction-D.correction)[0];if(!L)continue;const A=Zp(e,i)?.querySelector("path"),_=Number.parseFloat(A?getComputedStyle(A).strokeWidth:"0"),M=t+(Number.isFinite(_)?_/2:0);let $=0,P=M;const N=I=>({x:L.intersection.x-x.x*I,y:L.intersection.y-x.y*I});for(;Up(N(P),L.bounds,L.shape)<M&&P<256;)P*=2;for(let I=0;I<24;I+=1){const D=($+P)/2;Up(N(D),L.bounds,L.shape)<M?$=D:P=D}const F=N(P),E=new DOMPoint(F.x,F.y).matrixTransform(l.inverse()),B=N(P+1),q=new DOMPoint(B.x,B.y).matrixTransform(l.inverse()),z=rO(i.getAttribute("d")??"",q,p);z&&(i.setAttribute("d",`${z} L ${E.x} ${E.y}`),i.dataset.terminalTarget=L.node.id,i.dataset.terminalGapCss=String(t))}}function ju(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 n=[];let a="";for(let s=0;s<i.length;s+=1){const l=i[s];if(/^[ML]$/i.test(l)){a=l.toUpperCase();continue}const c=i[s+1];if(!a||!c||/^[ML]$/i.test(c))return null;n.push({x:Number(l),y:Number(c)}),s+=1,a="L"}return n.length<t?null:n.slice(1).every((s,l)=>{const c=n[l];return Math.abs(s.x-c.x)<.001||Math.abs(s.y-c.y)<.001})?n:null}function Tr(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),n=r.at(-2);o&&n&&(Math.abs(n.x-o.x)<.001&&Math.abs(o.x-i.x)<.001||Math.abs(n.y-o.y)<.001&&Math.abs(o.y-i.y)<.001)?r[r.length-1]=i:r.push(i)}return r}function Gu(e,t=uC){const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const n=e[o-1],a=e[o],s=e[o+1],l=Math.hypot(a.x-n.x,a.y-n.y),c=Math.hypot(s.x-a.x,s.y-a.y),h=(a.x-n.x)*(s.y-a.y)-(a.y-n.y)*(s.x-a.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${a.x} ${a.y}`);continue}const u=a.x-(a.x-n.x)/l*d,f=a.y-(a.y-n.y)/l*d,p=a.x+(s.x-a.x)/c*d,g=a.y+(s.y-a.y)/c*d;r.push(`L ${u} ${f}`,`Q ${a.x} ${a.y} ${p} ${g}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function dh(e){for(const t of e.querySelectorAll('.flowchart-link, .edgePaths path, path.relation, path.transition[data-edge="true"]')){const r=ju(t.getAttribute("d")??"");if(!r)continue;const i=Tr(r);t.dataset.manhattanPoints??=i.map(n=>`${n.x},${n.y}`).join(" ");const o=Gu(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(uC))}}function Ve(e){return e.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > .outer-path, :scope > .basic.label-container, :scope > polygon")}function sO(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,a=i.width/2,s=Math.min(8,o*.14),l=-o/2,c=o/2;r.setAttribute("d",`M ${-a} ${l+s} A ${a} ${s} 0 0 1 ${a} ${l+s} L ${a} ${c-s} A ${a} ${s} 0 0 1 ${-a} ${c-s} Z`),r.removeAttribute("transform"),r.dataset.diagramCylinder="true",r.dataset.cylinderRimRatio=String(s/o);const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",`M ${-a} ${l+s} A ${a} ${s} 0 0 1 ${a} ${l+s} A ${a} ${s} 0 0 1 ${-a} ${l+s} Z`),h.setAttribute("class","diagram-cylinder-rim"),h.setAttribute("aria-hidden","true"),h.setAttribute("focusable","false"),r.after(h)}}function lO(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=Ve(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 cO(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 n=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x+d.width)),s=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:n,y:d},{x:a,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:s})}}}function On(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,n=t.id.includes("pointStart");!r||!o&&!n||(t.setAttribute("viewBox",`0 0 ${Xs} ${Xs}`),t.setAttribute("markerWidth",String(Xs)),t.setAttribute("markerHeight",String(Xs)),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 wr(e){const t=e.id.match(/-L_([^_]+)_([^_]+)_\d+$/);return t?{source:t[1],target:t[2]}:null}function Si(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 Qe(e,t){return[...e.querySelectorAll("g.node")].find(r=>Ir(r)===t)}function hO(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return!1;const t=[...e.querySelectorAll(".edgePaths path")].find(L=>{const A=wr(L);return A?.source==="Client"&&A.target==="Gateway"}),r=Qe(e,"Client"),i=Qe(e,"Gateway"),o=Qe(e,"Queue"),n=[...e.querySelectorAll(".edgePaths path")].find(L=>{const A=wr(L);return A?.source==="Gateway"&&A.target==="Queue"}),a=t&&Si(e,t);let s=r&&Cr(r);const l=i&&Cr(i),c=o&&Cr(o),h=t&&a&&br(a,t);if(!t||!r||!s||!l||!a||!h)return!1;const d=At(l,.5,.5),u=[...e.querySelectorAll("g.cluster > rect")].flatMap(L=>{const A=br(L,t);return A?[A]:[]}).filter(L=>d.x>L.x&&d.x<L.x+L.width&&d.y>L.y&&d.y<L.y+L.height).toSorted((L,A)=>A.width*A.height-L.width*L.height)[0];if(!u)return!1;const f=Math.max(52,h.height+24),p=u.y-(s.y+s.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),s={...s,y:s.y-g});const y=At(s,.5,1),x=At(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((L,A)=>`${A?"L":"M"}${L.x},${L.y}`).join("")),t.dataset.clientRequestLane="downward",t.dataset.manhattanPoints=v.map(L=>`${L.x},${L.y}`).join(" "),io(a,t,v,1);const T=n&&Si(e,n);if(n&&T&&c){const L=At(l,0,.65),A=At(c,0,.5),_=u.x+12,M=[L,{x:_,y:L.y},{x:_,y:A.y},A];n.setAttribute("d",M.map(($,P)=>`${P?"L":"M"}${$.x},${$.y}`).join("")),n.dataset.clientRequestLane="enqueue",n.dataset.manhattanPoints=M.map($=>`${$.x},${$.y}`).join(" "),io(T,n,M,1)}return mC(e,"Client",s),!0}function dO(e,t,r){if(!wi(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:n}=i.toSorted((a,s)=>Number(s.clear)-Number(a.clear)||Math.hypot(a.x,a.y)-Math.hypot(s.x,s.y))[0];return{x:o,y:n}}function Kp(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 uO(e,t,r){const i=e.parentElement?.getScreenCTM(),o=t.getScreenCTM();if(!i||!o)return;const n=new DOMPoint(0,0).matrixTransform(o).matrixTransform(i.inverse()),a=new DOMPoint(r.x,r.y).matrixTransform(o).matrixTransform(i.inverse()),s=e.getAttribute("transform")??"";e.setAttribute("transform",`translate(${a.x-n.x}, ${a.y-n.y}) ${s}`)}function fO(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=[...e.querySelectorAll("g.node")],i=[...e.querySelectorAll("g.cluster")].flatMap(a=>{const s=a.querySelector(":scope > rect"),l=a.querySelector(":scope > g.cluster-label");if(!s||!l)return[];const c=t&&Hu(a,t),h=c?t?.get(c):void 0;if(t&&!h)return[];const d=s.getBBox(),u=r.filter(f=>{if(h)return h.has(Ir(f));const p=Cr(f);if(!p)return!1;const g=At(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:a,rect:s,label:l,frame:d,members:u,id:c,memberIds:h}]}),o=t?[...e.querySelectorAll(".edgePaths path")].flatMap(a=>{const s=wr(a),l=ju(a.getAttribute("d")??"",2);if(!s||!l)return[];const c=h=>{const d=Qe(e,h),u=(d&&Ve(d))??i.find(p=>p.id===h)?.rect,f=u&&Ze(u,a);return u&&f?{shape:u,bounds:f}:null};return[{path:a,points:l,source:c(s.source),target:c(s.target)}]}):[],n=new Map;for(const a of i.toSorted((s,l)=>(s.memberIds?.size??0)-(l.memberIds?.size??0)||s.frame.width*s.frame.height-l.frame.width*l.frame.height)){const s=i.filter(P=>P!==a&&(a.memberIds?!!(P.id&&a.memberIds.has(P.id)):P.frame.x>=a.frame.x&&P.frame.y>=a.frame.y&&P.frame.x+P.frame.width<=a.frame.x+a.frame.width&&P.frame.y+P.frame.height<=a.frame.y+a.frame.height)).flatMap(({cluster:P,rect:N})=>{const F=t?Ze(N,a.cluster):n.get(P);return F?[F]:[]}),c=[...a.members.flatMap(P=>{const N=Ve(P),F=t&&N?Ze(N,a.cluster):Cr(P);return F?[F]:[]}),...s];if(!c.length)continue;const h=a.label.querySelector("foreignObject"),d=h?.querySelector("div"),u=Kp(c),f=t?r.filter(P=>!a.members.includes(P)).flatMap(P=>{const N=Ve(P),F=N&&Ze(N,a.cluster);return F?[F]:[]}):[];let p=Math.ceil(Math.max(d?.getBoundingClientRect().height??0,d?.scrollHeight??0,a.label.getBBox().height,18)),g=ps(p);const m=Math.min(...c.map(({x:P})=>P)),y=Math.max(...c.map(({x:P,width:N})=>P+N)),x=Math.min(...c.map(({y:P})=>P)),C=Math.max(...c.map(({y:P,height:N})=>P+N));let k=Math.min(a.frame.x,m-Gr),v=Math.min(a.frame.y,x-g),T=Math.max(a.frame.x+a.frame.width,y+Gr),L=Math.max(a.frame.y+a.frame.height,C+20);if(t&&f.some(P=>wi({x:k,y:v,width:T-k,height:L-v},P,12))){if(k=m-Gr,T=y+Gr,L=C+20,h&&d){const P=h.cloneNode(!0),N=P.querySelector("div");P.style.visibility="hidden",P.setAttribute("height","1"),P.setAttribute("width",String(T-k-Gr*2)),N.style.setProperty("height","auto","important"),N.style.setProperty("width","100%","important"),a.label.append(P);try{const F=Math.max(u.width,N.scrollWidth);T=k+F+Gr*2,P.setAttribute("width",String(F)),p=Math.ceil(Math.max(18,N.scrollHeight))}finally{P.remove()}}else T=Math.max(T,k+a.label.getBBox().width+Gr*2);g=ps(p),v=x-g}const A={x:k,y:v,width:T-k,height:L-v};if(a.rect.setAttribute("x",String(A.x)),a.rect.setAttribute("y",String(A.y)),a.rect.setAttribute("width",String(A.width)),a.rect.setAttribute("height",String(A.height)),a.cluster.dataset.headerHeight=String(g),h)h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",String(Math.max(24,A.width-Gr*2))),h.setAttribute("height",String(p)),a.label.setAttribute("transform",`translate(${A.x+Gr}, ${A.y+Gr})`);else{const P=a.label.getBBox();a.label.setAttribute("transform",`translate(${A.x+A.width/2-P.x-P.width/2}, ${A.y+Gr-P.y})`)}if(n.set(a.cluster,A),!t)continue;const _=i.filter(P=>P!==a&&P.id&&a.id&&!a.memberIds?.has(P.id)&&!P.memberIds?.has(a.id)),M=_.filter(P=>!_.some(N=>N!==P&&P.id&&N.memberIds?.has(P.id))),$=M.map(P=>[P.cluster,...P.members,...i.filter(N=>N.id&&P.memberIds?.has(N.id)).map(N=>N.cluster)]);$.push(...r.filter(P=>!a.members.includes(P)&&!M.some(N=>N.members.includes(P))).map(P=>[P]));for(const P of $){const N=I=>{const D=I.flatMap(Z=>{const G=Z.matches("g.node")?Ve(Z):Z.querySelector(":scope > rect"),W=G&&Ze(G,a.cluster);return W?[W]:[]});return D.length?Kp(D):null},F=N(P);if(!F)continue;const E=dO(A,u,F);if(!E.x&&!E.y)continue;const B=E.x?"x":"y",q=E.x?"width":"height",z=$.filter(I=>{const D=N(I);return D&&(E[B]>0?D[B]+D[q]>F[B]:D[B]<F[B]+F[q])}).flat();for(const I of new Set(z))z.some(D=>D!==I&&D.contains(I))||uO(I,a.cluster,E)}}for(const{path:a,points:s,source:l,target:c}of o){let h=!1;const d=(g,m)=>{const y=g&&Ze(g.shape,a);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,s[0]),f=d(c,s[s.length-1]);if(!h)continue;const p=mc(s,u,f,Math.abs(s[1].x-s[0].x)<.001);a.setAttribute("d",p.map((g,m)=>`${m?"L":"M"}${g.x},${g.y}`).join("")),a.dataset.manhattanPoints=p.map(g=>`${g.x},${g.y}`).join(" ")}}function uh(e,t=!1){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const i=[...e.querySelectorAll(".edgePaths path")].flatMap(y=>{const x=wr(y);return x?[{path:y,...x}]:[]}),o=new Map,n=new Map;for(const y of i.filter(({source:x,target:C})=>x!==C))o.set(y.target,(o.get(y.target)??0)+1),n.set(y.source,(n.get(y.source)??0)+1);const a=i.find(y=>y.source!==y.target&&(o.get(y.source)??0)>=2&&(n.get(y.source)??0)===1&&(n.get(y.target)??0)>=2);if(!a)return;if(!t&&a.path.dataset.feedbackLane==="outer")return a.path.getBBox();const s=Qe(e,a.source),l=Qe(e,a.target),c=s&&Ve(s),h=l&&Ve(l);if(!c||!h)return;const d=s&&Cr(s),u=l&&Cr(l),f=[...e.querySelectorAll("g.node")].flatMap(y=>{const x=Cr(y);return x?[x]:[]});if(!d||!u||!f.length)return;const p=[...e.querySelectorAll(".edgePaths path")].filter(y=>y!==a.path).map(y=>y.getBBox()),g=a.path.dataset.compactFlowchart==="true",m=K4(d,u,g?f:[...f,...p],g);a.path.setAttribute("d",m.map((y,x)=>`${x?"L":"M"}${y.x},${y.y}`).join("")),a.path.dataset.feedbackLane="outer",a.path.dataset.feedbackSource=a.source,a.path.dataset.feedbackTarget=a.target,a.path.dataset.manhattanSegments="4",a.path.dataset.manhattanPoints=m.map(y=>`${y.x},${y.y}`).join(" ")}function mC(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((n,a)=>{if(n.dataset.nestedDecisionRoute)return;const s=wr(n),l=s?i.filter(v=>wr(v)?.source===s.source).length:0,c=s&&Qe(e,s.source),h=s&&Qe(e,s.target),d=c&&Ze(c,n),u=s?.target===t?r:h&&br(h,n);if(!s||!d||!u||l>1||u.y>=d.y)return;const f=[...[...e.querySelectorAll("g.node")].flatMap(v=>{const T=Ze(v,n);return T?[T]:[]}),...[...e.querySelectorAll("g.cluster > rect")].flatMap(v=>{const T=Ze(v,n);return T?[T]:[]})],p=Q4(d,u,f,n.dataset.compactFlowchart==="true");n.setAttribute("d",p.map((v,T)=>`${T?"L":"M"}${v.x},${v.y}`).join("")),n.dataset.groupedReturnLane="right",n.dataset.manhattanPoints=p.map(v=>`${v.x},${v.y}`).join(" ");const g=o[a];if(!g)return;const m={x:p[1].x,y:(p[1].y+p[2].y)/2},y=g.getBBox(),x=n.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 gO(e){mC(e)}function Qp(e){const t=e.querySelector('path[data-feedback-lane="outer"]'),r=t?.dataset.feedbackSource&&Qe(e,t.dataset.feedbackSource),i=t?.dataset.feedbackTarget&&Qe(e,t.dataset.feedbackTarget),o=t?.getScreenCTM(),n=(t?.dataset.manhattanPoints??"").split(" ").map(P=>P.split(",").map(Number)).filter(P=>P.length===2&&P.every(Number.isFinite)).map(([P,N])=>({x:P,y:N}));if(!t||!r||!i||!o||n.length<4)return;const a=o.inverse(),s=r.getBoundingClientRect(),l=i.getBoundingClientRect(),c=t.dataset.feedbackTarget,h=[...e.querySelectorAll(".edgePaths path")].flatMap(P=>{if(P===t)return[];const N=wr(P),F=(P.dataset.manhattanPoints??"").trim().split(/\s+/).map(Z=>Z.split(",").map(Number)).filter(Z=>Z.length===2&&Z.every(Number.isFinite)).map(([Z,G])=>({x:Z,y:G})),E=P.getScreenCTM();if(!N||!E||F.length<2)return[];const B=N.source===c?0:N.target===c?-1:null;if(B===null)return[];const q=F[B===0?0:F.length-1],z=F[B===0?1:F.length-2],I=new DOMPoint(q.x,q.y).matrixTransform(E),D=new DOMPoint(z.x,z.y).matrixTransform(E);return Math.abs(I.y-l.bottom)>1||Math.abs(I.x-D.x)>1?[]:[I.matrixTransform(a).x]}),d=new DOMPoint(l.left,l.bottom).matrixTransform(a).x,u=new DOMPoint(l.right,l.bottom).matrixTransform(a).x;let f=j4({x:Math.min(d,u),width:Math.abs(u-d)},h);const p=(d+u)/2,g=new DOMPoint(s.right,s.top+s.height/2).matrixTransform(a),m=Ve(i),y=m&&Ze(m,t),x=m?getComputedStyle(m).rx:"0",C=m?.getBBox().width??0,k=y&&C&&n.at(-2).y>y.y+y.height?G4({...y,corner:{x:(Number.parseFloat(x)||0)*(x.endsWith("%")?y.width/100:y.width/C),y:0}},h):void 0,v=k===void 0?[]:[{...n[n.length-3]},{x:k,y:n[n.length-2].y},{x:k,y:new DOMPoint(l.left,l.bottom).matrixTransform(a).y}],T=[...e.querySelectorAll("g.node")].filter(P=>P!==i).flatMap(P=>{const N=Ze(P,t);return N?[N]:[]}),L=Si(e,t),A=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(P=>P!==L&&P.textContent?.trim()).flatMap(P=>{const N=br(P,t);return N?[N]:[]}),_=Uu(e).filter(P=>P.path!==t).flatMap(P=>{const N=P.path.getScreenCTM();return N?nr(P.points.map(({x:F,y:E})=>new DOMPoint(F,E).matrixTransform(N).matrixTransform(a))):[]}),M=v.length>0&&nr(v).every(P=>!T.some(N=>_r(P,N,8))&&!A.some(N=>_r(P,N,4))&&!_.some(({start:N,end:F})=>_r(P,{x:Math.min(N.x,F.x),y:Math.min(N.y,F.y),width:Math.abs(F.x-N.x),height:Math.abs(F.y-N.y)},6)));if(M&&(f=k),!M&&Math.abs(f-p)>1&&n.length>=7){const P=new DOMPoint(l.left+l.width/2,l.top-.25).matrixTransform(a),N=new DOMPoint(l.left+l.width/2,l.top-12).matrixTransform(a);n[0]={x:g.x,y:g.y},n[1].y=g.y,n[4]={x:n[3].x,y:N.y},n[5]={x:N.x,y:N.y},n[6]={x:P.x,y:P.y},t.dataset.feedbackTargetSide="top",t.dataset.manhattanPoints=n.map(({x:F,y:E})=>`${F},${E}`).join(" "),t.setAttribute("d",n.map(({x:F,y:E},B)=>`${B===0?"M":"L"}${F},${E}`).join("")),io(Si(e,t),t,n);return}const $=new DOMPoint(l.left+l.width/2,l.bottom+.25).matrixTransform(a);$.x=f,n[0]={x:g.x,y:g.y},n[1].y=g.y,n[n.length-2].x=$.x,n[n.length-1]={x:$.x,y:$.y},t.dataset.feedbackTargetSide="bottom",t.dataset.manhattanPoints=n.map(({x:P,y:N})=>`${P},${N}`).join(" "),t.setAttribute("d",n.map(({x:P,y:N},F)=>`${F===0?"M":"L"}${P},${N}`).join("")),io(Si(e,t),t,n)}function Jp(e){const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{if(i.dataset.clusterHeaderClearance||i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)return[];const o=wr(i),n=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(a=>a.split(",").map(Number)).filter(a=>a.length===2&&a.every(Number.isFinite)).map(([a,s])=>({x:a,y:s}));return o&&n.length>=2?[{path:i,points:n,...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 n=o.length>=2&&Qe(e,i),a=n&&Cr(n);if(!a)continue;const s=o.filter(({points:u})=>Math.abs(u[0].x-u[1].x)<.001);if(s.length<2)continue;const l=s.toSorted((u,f)=>{const p=Qe(e,u.target),g=Qe(e,f.target),m=p&&Cr(p),y=g&&Cr(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(Y4,a.width*.4/(l.length-1)),d=a.x+a.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=mc(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 mc(e,t,r,i){if(e.length<2)return e;if(e.length===2){if(i&&Math.abs(t.x-r.x)>=.001){const a=(t.y+r.y)/2;return[t,{x:t.x,y:a},{x:r.x,y:a},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const a=(t.x+r.x)/2;return[t,{x:a,y:t.y},{x:a,y:r.y},r]}return[t,r]}if(e.length===3){if(i&&Math.abs(t.x-r.x)>=.001){const a=(t.y+r.y)/2;return[t,{x:t.x,y:a},{x:r.x,y:a},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const a=(t.x+r.x)/2;return[t,{x:a,y:t.y},{x:a,y:r.y},r]}return[t,r]}const o=e.map(a=>({...a}));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((a,s)=>{const l=o[s];return Math.abs(a.x-l.x)>=.001&&Math.abs(a.y-l.y)>=.001})?mc([t,r],t,r,i):o}function io(e,t,r,i,o){if(!e?.textContent?.trim())return!0;if(r.length<2)return!1;const n=t.getScreenCTM(),a=e.parentElement?.getScreenCTM();if(!n||!a)return!1;const s=e.getBoundingClientRect(),l=br(e,t);if(o&&!l)return!1;const c=new DOMPoint(s.left+s.width/2,s.top+s.height/2).matrixTransform(n.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,T=Math.hypot(x.x-k.x,x.y-k.y),L=(v?d.width:d.height)+12;return T<L?[]:[.5,.35,.65,.2,.8].flatMap(A=>{if(T*Math.min(A,1-A)<L/2)return[];const _={x:k.x+(x.x-k.x)*A,y:k.y+(x.y-k.y)*A};if(o&&l){const N={x:_.x-l.width/2,y:_.y-l.height/2,width:l.width,height:l.height};if(o.obstacles.some(F=>wi(N,F,4))||o.occupied.some(F=>_r(F,N,4)))return[]}const M=new DOMPoint(_.x,_.y).matrixTransform(n),$=DOMRect.fromRect({x:M.x-s.width/2,y:M.y-s.height/2,width:s.width,height:s.height}),P=u.filter(N=>p($,N)).length+f.filter(N=>p($,N)).length;return[{start:k,end:x,center:_,preferred:C===i,collisions:P,distance:Math.hypot(_.x-c.x,_.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(n).matrixTransform(a.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 tm(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")].flatMap(o=>{const n=Ve(o);return n?[{node:o,bounds:n.getBoundingClientRect()}]:[]}),i=new Map;for(const o of t){const n=wr(o);if(!n||n.source===n.target)continue;const a=[n.source,n.target].toSorted().join("\0");i.set(a,[...i.get(a)??[],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 n=wr(o),a=n&&Qe(e,n.source),s=n&&Qe(e,n.target),l=a&&Ve(a),c=s&&Ve(s),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,et])=>({x:Q,y:et}));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),T=Math.min(u.right,f.right),L=Math.max(u.top,f.top),A=Math.min(u.bottom,f.bottom),_=v<=T?(v+T)/2:p.x,M=v<=T?_:g.x,$=L<=A?(L+A)/2:p.y,P=L<=A?$:g.y,N=x?{x:_,y:C?u.bottom:u.top}:{x:k?u.right:u.left,y:$},F=x?{x:M,y:C?f.top:f.bottom}:{x:k?f.left:f.right,y:P},E=h.inverse(),B=(Q,et)=>{const tt=new DOMPoint(Q,et).matrixTransform(E);return{x:tt.x,y:tt.y}};let q=B(N.x,N.y),z=B(F.x,F.y),I=null;if(n?.source===n?.target){const Q=u.right+48;I=[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&&n){const Q=[n.source,n.target].toSorted().join("\0"),et=i.get(Q)??[],tt=et.indexOf(o)-(et.length-1)/2;if(et.length>1){if(tt===0&&x){const J=(p.x+g.x)/2;I=[B(J,C?u.bottom:u.top),B(J,C?f.top:f.bottom)]}else if(tt===0){const J=(p.y+g.y)/2;I=[B(k?u.right:u.left,J),B(k?f.left:f.right,J)]}else if(x){const J=24+(Math.ceil(Math.abs(tt))-1)*16,ct=tt<0,yt=Math.min(p.y,g.y),Y=Math.max(p.y,g.y),H=r.filter(({node:It,bounds:Yt})=>It!==a&&It!==s&&Yt.bottom>yt&&Yt.top<Y),V=ct?Math.min(u.left,f.left,...H.map(({bounds:It})=>It.left))-J:Math.max(u.right,f.right,...H.map(({bounds:It})=>It.right))+J,K=ct?u.left:u.right,at=ct?f.left:f.right;I=[B(K,p.y),B(V,p.y),B(V,g.y),B(at,g.y)]}else{const J=24+(Math.ceil(Math.abs(tt))-1)*16,ct=tt<0,yt=Math.min(p.x,g.x),Y=Math.max(p.x,g.x),H=r.filter(({node:It,bounds:Yt})=>It!==a&&It!==s&&Yt.right>yt&&Yt.left<Y),V=ct?Math.min(u.top,f.top,...H.map(({bounds:It})=>It.top))-J:Math.max(u.bottom,f.bottom,...H.map(({bounds:It})=>It.bottom))+J,K=ct?u.top:u.bottom,at=ct?f.top:f.bottom;I=[B(p.x,K),B(p.x,V),B(g.x,V),B(g.x,at)]}o.dataset.parallelLane=tt<0?"before":tt>0?"after":"center"}}I&&(q=I[0],z=I[I.length-1]);const D=I??(d.length>=2?d:[q,z]),Z=D.slice(1).some((Q,et)=>{const tt=D[et];return Math.abs(Q.x-tt.x)>=.001&&Math.abs(Q.y-tt.y)>=.001}),G=I??mc(D,q,z,x),W=Tr(G);Z&&(o.dataset.cardinalRepaired="true"),o.dataset.manhattanPoints=W.map(({x:Q,y:et})=>`${Q},${et}`).join(" "),o.setAttribute("d",W.map(({x:Q,y:et},tt)=>`${tt===0?"M":"L"}${Q},${et}`).join("")),o.dataset.compactFlowchart||io(Si(e,o),o,W)}}function Ms(e,t,r,i){const o=At(t,.5,.5),n=s=>!r.some(l=>wi(s,l,4))&&!i.some(l=>_r(l,s,4));return nr(e).flatMap(({start:s,end:l})=>{const c=Math.abs(s.y-l.y)<.001,h=c?"x":"y",d=c?"y":"x",u=(c?t.width:t.height)/2,f=Math.min(s[h],l[h])+u+6,p=Math.max(s[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]:s[d]},y={...t,x:m.x-t.width/2,y:m.y-t.height/2};return n(y)?[{center:m,bounds:y,start:s,end:l,distance:Math.hypot(m.x-o.x,m.y-o.y)}]:[]})}).toSorted((s,l)=>s.distance-l.distance)[0]}function yC(e,t,r,i,o,n=[],a=[],s,l=!1,c=!1){if(e.length<2)return e;const h=_=>nr(_).some(M=>i.some($=>_r(M,$,8))),d=_=>nr(_).some(M=>o.some($=>ya(M,$))),u=_=>!s||Ms(_,s.bounds,[t,r,...i,...s.obstacles],s.occupied);if(!c&&!h(e)&&!d(e)&&u(e))return e;const f=(_,M,$,P,N=!1)=>{const F=Sn(M,$),E=[{point:M,side:F}];for(const B of N?[]:["top","right","bottom","left"])for(const q of c?[.5,.25,.75,0,1]:[.5,.25,.75]){const z=B==="top"||B==="bottom"?At(_,q,B==="top"?0:1):At(_,B==="left"?0:1,q);if(B==="top"||B==="bottom"){const I=Math.min(_.width/2,_.corner?.x??0);z.x=Math.max(_.x+I,Math.min(_.x+_.width-I,z.x))}else{const I=Math.min(_.height/2,_.corner?.y??0);z.y=Math.max(_.y+I,Math.min(_.y+_.height-I,z.y))}P.every(I=>Math.hypot(I.x-z.x,I.y-z.y)>=(c?8:ri))&&E.push({point:z,side:B})}return E.map(B=>{const q={...B.point},z=Math.max(16,(s?.bounds.height??0)/2+(c?4:8)),I=Math.max(16,(s?.bounds.width??0)/2+(c?4:8));return B.side==="top"&&(q.y-=z),B.side==="bottom"&&(q.y+=z),B.side==="left"&&(q.x-=I),B.side==="right"&&(q.x+=I),{...B,lead:q}})},p=f(t,e[0],e[1],n,l),g=f(r,e.at(-1),e.at(-2),a),m=[t,r,...i,...o.map(({start:_,end:M})=>({x:Math.min(_.x,M.x),y:Math.min(_.y,M.y),width:Math.abs(_.x-M.x),height:Math.abs(_.y-M.y)}))],y=Math.max(16,(s?.bounds.width??0)/2+8),x=Math.max(16,(s?.bounds.height??0)/2+8),C=[Math.min(...m.map(_=>_.x))-y,Math.max(...m.map(_=>_.x+_.width))+y],k=[Math.min(...m.map(_=>_.y))-x,Math.max(...m.map(_=>_.y+_.height))+x];if(c){const _=(M,$)=>[...new Set(i.flatMap(P=>[P[M]-16,P[M]+P[$]+16]))].toSorted((P,N)=>Math.abs(P-t[M])-Math.abs(N-t[M])).slice(0,12);C.push(..._("x","width")),k.push(..._("y","height"))}const v=p.flatMap(_=>g.flatMap(M=>[[_.point,_.lead,{x:_.lead.x,y:M.lead.y},M.lead,M.point],[_.point,_.lead,{x:M.lead.x,y:_.lead.y},M.lead,M.point],...C.map($=>[_.point,_.lead,{x:$,y:_.lead.y},{x:$,y:M.lead.y},M.lead,M.point]),...k.map($=>[_.point,_.lead,{x:_.lead.x,y:$},{x:M.lead.x,y:$},M.lead,M.point])].map(Tr))),T=_=>nr(_).reduce((M,$)=>M+Math.hypot($.end.x-$.start.x,$.end.y-$.start.y),0);let L,A=1/0;for(const{candidate:_,length:M}of v.map($=>({candidate:$,length:T($)})).toSorted(($,P)=>$.length-P.length)){if(c&&(M>=T(e)-1||_.some(P=>P.y<Math.min(t.y,r.y)-x))||h(_)||!u(_)||nr(_).some(P=>_r(P,t)||_r(P,r)))continue;const $=nr(_).reduce((P,N)=>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+(ya(N,E)?100:_r(N,B,6)?1:0)},0),0);if($<A&&(!c||$===0)&&(L=_,A=$),A===0)break}return L??e}function Uu(e){return[...e.querySelectorAll(".edgePaths path")].flatMap(t=>{const r=wr(t),i=(t.dataset.manhattanPoints??"").trim().split(/\s+/).map(o=>{const[n,a]=o.split(",").map(Number);return{x:n,y:a}});return r&&i.length>=2&&i.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))?[{path:t,...r,points:i,label:Si(e,t)}]:[]})}function pO(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=Uu(e),r=t[0]?.path;if(!r)return;const i=new Map([...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ve(l),h=c&&Ze(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()&&br(l.label,r);return c?[[l,c]]:[]})),n=[...e.querySelectorAll("g.cluster > .cluster-label")].flatMap(l=>{const c=br(l,r);return c?[c]:[]}),a=new Map,s=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 s){const u=t.filter(v=>v!==l),f=v=>u.flatMap(T=>[...T.source===v?[T.points[0]]:[],...T.target===v?[T.points.at(-1)]:[]]),p=u.filter(v=>v.source!==l.source||v.target===l.target).flatMap(v=>nr(v.points)),g=[...i].filter(([v])=>v!==l.source&&v!==l.target).map(([,v])=>v.bounds).concat(n,[...o].filter(([v])=>v!==l).map(([,v])=>v)),m=o.get(l),y=(v,T=!1)=>!d&&c&&h?yC(v,c.bounds,h.bounds,g,p,f(l.source),f(l.target),m?{bounds:m,obstacles:[...o].filter(([L])=>L!==l).map(([,L])=>L),occupied:u.flatMap(L=>nr(L.points))}:void 0,!!l.path.dataset.fanoutPort&&u.some(L=>L.source===l.source&&L.target!==l.target),T):v,x=yO(e,l.path,c?.bounds,h?.bounds),C=x?[At(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},At(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=mO(k,u.filter(v=>v.path.dataset.feedbackLane).flatMap(v=>nr(v.points)),g)),!d&&c&&h&&h.bounds.y>c.bounds.y&&u.some(v=>v.path.dataset.feedbackLane&&v.target===l.source&&nr(k).some(T=>nr(v.points).some(({start:L,end:A})=>_r(T,{x:Math.min(L.x,A.x),y:Math.min(L.y,A.y),width:Math.abs(A.x-L.x),height:Math.abs(A.y-L.y)}))))&&(k=y(k,!0)),m){const v=Ms(k,m,[...[c,h].flatMap(T=>T?[T.bounds]:[]),...g],u.flatMap(T=>nr(T.points)));v&&(o.set(l,v.bounds),a.set(l.path.id,v.center))}k!==l.points&&(l.points=k,l.path.dataset.manhattanPoints=k.map(({x:v,y:T})=>`${v},${T}`).join(" "),l.path.setAttribute("d",k.map(({x:v,y:T},L)=>`${L?"L":"M"}${v},${T}`).join("")))}for(const l of t.filter(c=>c.path.dataset.feedbackLane==="outer")){const h=t.filter(u=>u!==l).flatMap(u=>nr(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=J4(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("")),a.delete(l.path.id))}return a}function mO(e,t,r){for(let i=1;i<e.length-2;i++){const o=e[i],n=e[i+1];if(Math.abs(o.x-n.x)>.001||Math.abs(o.y-n.y)<32)continue;const a=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,n.y),Math.max(l.start.y,l.end.y))-Math.max(Math.min(o.y,n.y),Math.min(l.start.y,l.end.y))>20);if(!a.length)continue;const s=a.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 s){const c=e.map((d,u)=>u===i||u===i+1?{...d,x:l}:d),h=nr(c).slice(i-1,i+2);if(!(a.some(d=>Math.abs(d.start.x-l)<19.99)||h.some(d=>r.some(u=>_r(d,u,4)))))return c}}return e}function yO(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,n=[...e.querySelectorAll("g.cluster > rect")].flatMap(l=>{const c=Ze(l,t);return c?[c]:[]}),a=n.filter(l=>o(l,i)&&!o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0],s=a&&n.filter(l=>l!==a&&o(l,a)&&o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0];return!a||!s||r.y+r.height>a.y?null:{x:(a.x+a.width+s.x+s.width)/2}}function xO(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=Uu(e),i=r[0]?.path;if(!i)return;const o=[...e.querySelectorAll("g.node, g.cluster > .cluster-label")].flatMap(a=>{const s=br(a,i);return s?[s]:[]}),n=r.flatMap(a=>{const s=a.label;if(!s?.textContent?.trim())return[];const l=br(s,i),c=t?.get(a.path.id);l&&c&&(l.x=c.x-l.width/2,l.y=c.y-l.height/2);const h=i.getScreenCTM(),d=s.parentElement?.getScreenCTM(),u=s.getBBox();return l&&h&&d?[{route:a,label:s,current:l,matrix:h,inverse:d.inverse(),local:u}]:[]});for(const a of n){const{route:s,label:l,current:c,matrix:h,inverse:d,local:u}=a,f=r.filter(m=>m!==s).flatMap(m=>nr(m.points)),p=Ms(s.points,c,[...o,...n.filter(m=>m!==a).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}`,a.current=p.bounds}}function bO(e,t,r,i,o=[],n=[],a=[],s=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,...[...n,...a].flatMap(C=>[C[h]-ri,C[h]+ri]),...i.flatMap(C=>[C[h]-s,C[h]+(c?C.height:C.width)+s]),...o.flatMap(C=>[Math.min(C.start[h],C.end[h])-s,Math.max(C.start[h],C.end[h])+s])])].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(n.some(L=>Math.hypot(k.x-L.x,k.y-L.y)<ri-.001)||a.some(L=>Math.hypot(v.x-L.x,v.y-L.y)<ri-.001))continue;const T={start:k,end:v};if(!i.some(L=>_r(T,L,s))&&!o.some(L=>_r(T,{x:Math.min(L.start.x,L.end.x),y:Math.min(L.start.y,L.end.y),width:Math.abs(L.start.x-L.end.x),height:Math.abs(L.start.y-L.end.y)},s)))return[k,v]}return e}function Sn(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 CO(e,t,r,i,o){const n=a=>nr(a).reduce((s,{start:l,end:c})=>s+Math.hypot(c.x-l.x,c.y-l.y),0);return t.map(Tr).filter(a=>a.length<=e.length&&n(a)<n(e)-1).filter(a=>nr(a).every(s=>!r.some(l=>_r(s,l,8))&&!i.some(({start:l,end:c})=>_r(s,{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(a=>!o||Ms(a,o.bounds,[...r,...o.obstacles],i)).sort((a,s)=>n(a)-n(s))[0]??e}function wO(e,t){const r=t.map(i=>({...i,points:(i.path.dataset.manhattanPoints??"").split(" ").map(o=>{const[n,a]=o.split(",").map(Number);return{x:n,y:a}})})).filter(({points:i})=>i.length>=2&&i.every(({x:o,y:n})=>Number.isFinite(o)&&Number.isFinite(n)));for(const i of r){if(i.source===i.target||i.points.length===2)continue;const{path:o,points:n}=i,a=y=>{const x=Qe(e,i[y]),C=x&&Ve(x),k=C&&Ze(C,o);if(!C||!k)return;const v=y==="source"?n[0]:n[n.length-1],T=y==="source"?n[1]:n[n.length-2],L=Sn(v,T),A=L==="left"||L==="right",_=Math.max(8,Number(C.getAttribute(A?"ry":"rx"))||0),M=C.tagName.toLowerCase()==="rect"?A?[k.y+_,k.y+k.height-_]:[k.x+_,k.x+k.width-_]:void 0;return{point:v,side:L,range:M}},s=a("source"),l=a("target");if(!s||!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=>br(y,o)).filter(y=>!!y);for(const y of e.querySelectorAll("g.cluster > rect")){const x=Ze(y,o);x&&!d(x,s.point)&&!d(x,l.point)&&u.push(x)}const f=c.flatMap(y=>nr(y.points));let p=bO(n,s,l,u,f,h(i.source),h(i.target));if(p===n&&o.dataset.nestedDecisionRoute==="secondary-retry"){const y=Qe(e,i.source),x=Qe(e,i.target),C=y&&Ve(y),k=x&&Ve(x),v=C&&Ze(C,o),T=k&&Ze(k,o);if(C?.tagName.toLowerCase()==="rect"&&k&&ro(k)&&v&&T){const L=At(v,.5,0),A=[];if(l.side==="bottom"&&L.y>T.y+T.height+8&&L.x>l.point.x){const N=(L.y+T.y+T.height)/2;A.push([L,{x:L.x,y:N},{x:l.point.x,y:N},l.point])}const _=Hr(T,"left",24);L.x<_.x&&L.y>_.y&&A.push([L,{x:L.x,y:_.y},_]);const M=Hr(T,"right",T.height*.32);L.x>M.x&&L.y>M.y&&A.push([L,{x:L.x,y:M.y},M]);const $=A.filter(N=>!h(i.source).some(F=>Math.hypot(F.x-L.x,F.y-L.y)<ri)&&!h(i.target).some(F=>Math.hypot(F.x-N.at(-1).x,F.y-N.at(-1).y)<ri)),P=i.label&&br(i.label,o);p=CO(n,$,u,f,P?{bounds:P,obstacles:[v,T]}:void 0)}}if(p===n||!io(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=Sn(g,m)),o.setAttribute("d",p.map(({x:y,y:x},C)=>`${C?"L":"M"}${y},${x}`).join(""))}}function xC(e,t,r){const i=e.map(o=>({...o}));if(t){const o=i[1],n=i[0];i[0]=t.point;const a=t.side==="top"||t.side==="bottom";if(i.length>2&&(a&&Math.abs(n.x-o.x)<.001?o.x=t.point.x:!a&&Math.abs(n.y-o.y)<.001&&(o.y=t.point.y)),!(a?Math.abs(o.x-t.point.x)<.001:Math.abs(o.y-t.point.y)<.001))if(t.lead){const l=a?{x:o.x,y:t.lead.y}:{x:t.lead.x,y:o.y};i.splice(1,0,t.lead,l)}else{const l=a?{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],n=i[i.length-1];i[i.length-1]=r.point;const a=r.side==="top"||r.side==="bottom";if(i.length>2&&(a&&Math.abs(n.x-o.x)<.001?o.x=r.point.x:!a&&Math.abs(n.y-o.y)<.001&&(o.y=r.point.y)),!(a?Math.abs(o.x-r.point.x)<.001:Math.abs(o.y-r.point.y)<.001))if(r.lead){const l=a?{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=a?{x:r.point.x,y:o.y}:{x:o.x,y:r.point.y};i.splice(i.length-1,0,l)}}return Tr(i)}function Hr(e,t,r=0){const i=At(e,.5,.5),o=e.width/2,n=e.height/2;if(t==="top"||t==="bottom"){const l=Math.max(-o*.7,Math.min(o*.7,r)),c=n*(1-Math.abs(l)/o);return{x:i.x+l,y:i.y+(t==="top"?-c:c)}}const a=Math.max(-n*.7,Math.min(n*.7,r)),s=o*(1-Math.abs(a)/n);return{x:i.x+(t==="left"?-s:s),y:i.y+a}}function kO(e,t,r=0){const i=Hr(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 SO(e,t){const r=new Map(t.map(a=>[a,wr(a)])),i=[];for(const a of t){const s=r.get(a),l=(a.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(!s||l.length<2)continue;const c=Qe(e,s.source),h=c&&Ve(c);if(h&&ro(h)){const f=Ze(h,a);if(f){const p=Sn(At(f,.5,.5),l[1]);i.push({path:a,role:"source",nodeId:s.source,bounds:f,side:p,adjacent:l[1]})}}const d=Qe(e,s.target),u=d&&Ve(d);if(u&&ro(u)){const f=Ze(u,a);if(f){const p=t.some(m=>{const y=r.get(m);return m!==a&&y?.source===s.target&&y.target===s.source}),g=a.dataset.decisionReturn&&a.dataset.compactFlowchart==="true"?"left":a.dataset.decisionReturn||p?"bottom":Sn(At(f,.5,.5),l[l.length-2]);i.push({path:a,role:"target",nodeId:s.target,bounds:f,side:g,adjacent:l[l.length-2]})}}}const o=new Map;for(const a of i){const s=`${a.nodeId}\0${a.side}`;o.set(s,[...o.get(s)??[],a])}const n=new Map;for(const a of o.values()){const s=a[0].side,l=s==="top"||s==="bottom",c=a.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?a[0].bounds.width:a[0].bounds.height)*.5,d=Math.min(ri,h/Math.max(1,a.length-1));c.forEach((u,f)=>{const p=a.length===1?0:(f-(a.length-1)/2)*d,g=n.get(u.path)??{};g[u.role]=kO(u.bounds,s,p),n.set(u.path,g)})}return n}function vO(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=wr(i),n=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(a=>a.split(",").map(Number)).filter(a=>a.length===2&&a.every(Number.isFinite)).map(([a,s])=>({x:a,y:s}));if(!(!o||n.length<2))for(const a of["source","target"]){if(a==="source"&&i.dataset.fanoutSource)continue;const s=o[a],l=Qe(e,s),c=l&&Ve(l),h=c&&Ze(c,i);if(!c||!h||ro(c))continue;const d=a==="source"?n[0]:n[n.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=`${s}\0${f}`;t.set(p,[...t.get(p)??[],{path:i,role:a,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,n=o==="top"||o==="bottom",a=i.toSorted((c,h)=>(n?c.endpoint.x-h.endpoint.x:c.endpoint.y-h.endpoint.y)||c.path.id.localeCompare(h.path.id)||c.role.localeCompare(h.role)),s=(n?i[0].bounds.width:i[0].bounds.height)*.6,l=Math.min(ri,s/Math.max(1,i.length-1));a.forEach((c,h)=>{const d=(h-(i.length-1)/2)*l,u=Ei(c.bounds,o),f=n?{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 n=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,l])=>({x:s,y:l}));if(n.length<2)continue;const a=xC(n,o.source,o.target);i.dataset.manhattanPoints=a.map(({x:s,y:l})=>`${s},${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",a.map(({x:s,y:l},c)=>`${c===0?"M":"L"}${s},${l}`).join(""))}}function _O(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;vO(e);const t=[...e.querySelectorAll(".edgePaths path")],r=SO(e,t);for(const i of t){if(i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)continue;const o=wr(i),n=o&&Qe(e,o.source),a=o&&Qe(e,o.target),s=n&&Ve(n),l=a&&Ve(a),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=Si(e,i)?.textContent?.trim().toLocaleLowerCase();if(s&&ro(s)){const m=Ze(s,i),y=r.get(i)?.source;if(m&&y){const x=At(m,.5,.5),C=Sn(x,c[1]),{side:k}=y;if(u==="no"&&C!==k&&c.length>2){const T=c.slice(1).map((L,A)=>({index:A,length:Math.abs(c[A].y-L.y)<.001?Math.abs(c[A].x-L.x):0})).toSorted((L,A)=>A.length-L.length)[0];if(T?.length){const L=(c[T.index].y>=x.y?1:-1)*ri;c[T.index].y+=L,c[T.index+1].y+=L,i.dataset.decisionLane=String(c[T.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&&ro(l)){const m=r.get(i)?.target;if(m){const{side:y}=m,{point:x}=m;d=m,a&&(i.dataset.diamondTargetPort=`${x.x},${x.y}`,i.dataset.diamondTargetSide=y,i.dataset.terminalTarget=a.id)}}const f=xC(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||io(Si(e,i),i,f)}}function TO(e,t,r,i){const n=Ei(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<=n.x+16||Math.abs(u.y-d.y)>.001||u.x<d.x+8||u.x>d.x+d.width-8)))return null;const a={x:n.x+16,y:n.y},s=[];for(const{bounds:d,port:u,tail:f}of t){const m=(Math.abs(u.x-d.x)<.001?[[n,a,{x:a.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?[[n,a,{x:a.x,y:f[0].y},f[0],u]]:[],[n,a,{x:a.x,y:d.y-32},{x:u.x,y:d.y-32},u]]).map(Tr).find(y=>nr(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=>_r(x,k,8))&&!_r(x,e,C===0?0:8)&&!t.some(({bounds:k})=>_r(x,k,k===d&&C===y.length-2?0:8))));if(!m)return null;s.push(m)}const[l,c]=s.map(nr);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){ya(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(ya(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 s}function MO(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 n=o.inverse(),a=[...e.querySelectorAll("g.node")].map(y=>{const x=Ve(y);return{id:Ir(y),shape:x,bounds:x&&Ze(x,i)}});if(a.some(({bounds:y})=>!y)||new Set(a.map(({id:y})=>y)).size!==a.length)return;const s=a.find(({id:y})=>y===t);if(!s?.bounds||s.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,T)=>y.getPointAtLength(C*T/k).matrixTransform(x).matrixTransform(n))}});if(c.some(y=>!y))return;const h=c.flatMap(y=>nr(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=a.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,T=c.filter($=>wr($.path)?.target===x);if(T.length>1||T.length&&v.width*.6<ri||T.some($=>{const P=$.points.at(-1);return Math.abs(P.y-v.y)>8||P.x<v.x+v.width/2}))return null;const L=v.x<=s.bounds.x+s.bounds.width+16?Ei(v,"left"):{x:v.x+v.width/2-(T.length?ri/2:0),y:v.y},A=y.dataset.manhattanPoints?.split(" ").map(($,P)=>`${P?"L":"M"}${$}`).join(""),M=ju(A??y.getAttribute("d")??"")?.slice(-2);return{bounds:v,port:L,tail:M&&Math.abs(M[0].x-L.x)<.001&&Math.abs(M[1].y-L.y)<.001?[M[0],L]:void 0}});if(d.some(y=>!y))return;const u=r.map(({path:y})=>Si(e,y)),f=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y.textContent?.trim()&&!u.includes(y)).map(y=>br(y,i));if(f.some(y=>!y))return;const p=[...a.filter(y=>y!==s&&!d.some(x=>x.bounds===y.bounds)).map(y=>y.bounds),...f],g=TO(s.bounds,d,p,h);if(!g)return;const m=[];for(const[y,x]of u.entries()){if(!x?.textContent?.trim())continue;const C=br(x,i),k=x.parentElement?.getScreenCTM();if(!C||!k)return;const v=nr(g[y]).find(_=>{const M={x:(_.start.x+_.end.x)/2,y:(_.start.y+_.end.y)/2},$={x:M.x-C.width/2,y:M.y-C.height/2,width:C.width,height:C.height},P=Math.abs(_.start.y-_.end.y)<.001;return Math.hypot(_.end.x-_.start.x,_.end.y-_.start.y)>=(P?C.width:C.height)+16&&![...a.map(N=>N.bounds),...f,...h,...m.map(N=>N.bounds)].some(N=>wi($,N,8))&&!g.filter((N,F)=>F!==y).some(N=>nr(N).some(F=>_r(F,$,8)))});if(!v)return;const T={x:(v.start.x+v.end.x)/2,y:(v.start.y+v.end.y)/2},L=x.getBBox(),A=new DOMPoint(T.x,T.y).matrixTransform(o).matrixTransform(k.inverse());m.push({label:x,center:T,segment:v,bounds:{x:T.x-C.width/2,y:T.y-C.height/2,width:C.width,height:C.height},transform:`translate(${A.x-L.x-L.width/2}, ${A.y-L.y-L.height/2})`})}g.forEach((y,x)=>{const{path:C,target:k}=r[x];C.setAttribute("d",y.map(({x:v,y:T},L)=>`${L?"L":"M"}${v},${T}`).join("")),delete C.dataset.terminalGapBasePath,C.dataset.fanoutSource=t,C.dataset.fanoutTarget=k,C.dataset.fanoutTrunk=y.slice(0,2).map(({x:v,y:T})=>`${v},${T}`).join(" "),C.dataset.manhattanPoints=y.map(({x:v,y:T})=>`${v},${T}`).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 em(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{const o=wr(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 n=Qe(e,i);if(!n||n.querySelector(":scope > polygon.label-container"))continue;const a=o.flatMap(f=>{const p=Cr(n),g=Qe(e,f.target),m=g&&Cr(g);return p&&m?[{...f,targetId:f.target,source:p,target:m}]:[]});if(a.length!==o.length||new Set(a.map(({targetId:f})=>f)).size!==a.length)continue;const s=a[0].source.x+a[0].source.width,l=a[0].source.y+a[0].source.height;if(a.length===3&&a.every(f=>f.target.y>=l+16)&&Math.max(...a.map(f=>f.target.y))-Math.min(...a.map(f=>f.target.y))<=8){const f=a.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:s,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,T=y.target.y,L=T-16,A=[k,{x:k.x,y:L},{x:v,y:L}];A.unshift(C),A.push({x:v,y:T}),y.path.setAttribute("d",A.map((_,M)=>`${M?"L":"M"}${_.x},${_.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=A.map(_=>`${_.x},${_.y}`).join(" "),io(Si(e,y.path),y.path,A)});continue}if(a.some(f=>f.target.x<=s+16)){MO(e,i,o);continue}const h=Math.min(...a.map(f=>f.target.x)),d=s+Math.min(36,Math.max(16,(h-s)/2)),u=a[0].source.y+a[0].source.height/2;for(const f of a){const p=f.target.y+f.target.height/2,g=[{x:s,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=`${s},${u} ${d},${u}`,f.path.dataset.manhattanPoints=g.map(m=>`${m.x},${m.y}`).join(" ")}}}function BO(e,t,r,i){if(!e.textContent?.trim())return;const o=e.getAttribute("transform");e.removeAttribute("transform");const n=e.getBBox();o&&e.setAttribute("transform",o);const a=t.getCTM(),s=e.parentElement?.getCTM();if(!a||!s)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(a).matrixTransform(s.inverse());e.setAttribute("transform",`translate(${c.x-n.x-n.width/2}, ${c.y-n.y-n.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 bC(e,t,r){const i=Ve(e),o=i&&Ze(i,r),n=e.transform.baseVal.consolidate()?.matrix;!o||!n||(e.style.setProperty("transition-property","none","important"),e.setAttribute("transform",`translate(${n.e+t.x-o.x-o.width/2}, ${n.f+t.y-o.y-o.height/2})`))}function LO(e,t){const r=new Map;for(const i of e.toSorted((o,n)=>o.frame.width*o.frame.height-n.frame.width*n.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]:[]}),n=[...i.members.flatMap(f=>{const p=Ve(f),g=p&&Ze(p,t);return g?[g]:[]}),...o];if(!n.length)continue;const a=Number(i.cluster.dataset.headerHeight)||ps(18),s=Math.min(...n.map(f=>f.x))-24,l=Math.min(...n.map(f=>f.y))-a,c=Math.max(...n.map(f=>f.x+f.width))+24,h=Math.max(...n.map(f=>f.y+f.height))+24,d={x:s,y:l,width:c-s,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 AO(e,t){if(e.querySelectorAll("g.cluster").length<2)return!1;const r=t[0]?.path;if(!r)return!1;const i=I=>{const D=I&&Ve(I);return D?Ze(D,r):null},o=[...e.querySelectorAll("g.node")].flatMap(I=>{const D=Ir(I),Z=Ve(I);if(!Z||!ro(Z))return[];const G=t.filter(K=>K.source===D&&K.target!==D),W=G.find(K=>t.some(at=>at.source===K.target&&at.target===D))?.target;if(!W)return[];const Q=G.find(K=>K.target!==W&&t.some(at=>at.source===W&&at.target===K.target)&&t.some(at=>at.source===K.target&&at.target===K.target))?.target;if(!Q)return[];const et=new Map;for(const K of t.filter(at=>at.target===D&&at.source!==W))et.set(K.source,[...et.get(K.source)??[],K]);const tt=[...et.values()].find(K=>K.length>=2),J=t.filter(K=>K.source===D&&K.target===Q),ct=t.find(K=>K.source===D&&K.target===W),yt=t.find(K=>K.source===W&&K.target===D),Y=t.find(K=>K.source===W&&K.target===Q),H=t.find(K=>K.source===Q&&K.target===Q),V=t.find(K=>K.source===Q&&K.target!==Q);return!tt||J.length<2||!ct||!yt||!Y||!H||!V?[]:[{decisionId:D,secondary:W,merge:Q,ingress:tt,branches:J,add:ct,retry:yt,done:Y,loop:H,downstream:V}]})[0];if(!o)return!1;const n=o.ingress[0].source,a=o.downstream.target,s=new Set([o.decisionId,o.secondary,o.merge,n,a]),l=[...e.querySelectorAll("g.node")],c=new Map(l.filter(I=>s.has(Ir(I))).map(I=>[Ir(I),I]));if(c.size!==s.size)return!1;const h=[...e.querySelectorAll("g.cluster")].flatMap(I=>{const D=I.querySelector(":scope > rect"),Z=I.querySelector(":scope > g.cluster-label");if(!D||!Z)return[];const G=Ze(D,r);if(!G)return[];const W=l.filter(Q=>{const et=i(Q);if(!et)return!1;const tt=At(et,.5,.5);return tt.x>=G.x&&tt.x<=G.x+G.width&&tt.y>=G.y&&tt.y<=G.y+G.height});return[{cluster:I,rect:D,label:Z,frame:G,members:W}]}),d=h.filter(I=>I.members.some(D=>Ir(D)===o.decisionId)).toSorted((I,D)=>I.frame.width*I.frame.height-D.frame.width*D.frame.height)[0],u=d?h.filter(I=>I!==d&&d.frame.x>=I.frame.x&&d.frame.y>=I.frame.y&&d.frame.x+d.frame.width<=I.frame.x+I.frame.width&&d.frame.y+d.frame.height<=I.frame.y+I.frame.height).toSorted((I,D)=>I.frame.width*I.frame.height-D.frame.width*D.frame.height)[0]:void 0,f=(I,D)=>{const Z=c.get(D);I&&Z&&!I.members.includes(Z)&&I.members.push(Z)};f(d,o.decisionId),f(d,o.secondary),f(u,n),f(u,o.merge);const p=new Map([...c].flatMap(([I,D])=>{const Z=i(D);return Z?[[I,Z]]:[]}));if(p.size!==c.size)return!1;const g=t.some(({path:I})=>I.dataset.compactFlowchart==="true"),m=g?"compact":"wide",y=e.dataset.nestedDecisionLayout!==m,x=p.get(n),C=p.get(o.decisionId),k=p.get(o.secondary),v=p.get(o.merge),T=p.get(a),L=g?(()=>{const I=At(C,.5,.5).x,D=At(x,.5,.5).y,Z=Math.max(x.height,C.height,v.height,T.height)+94;return{intake:{x:I,y:D},decision:{x:I,y:D+Z},secondary:{x:I+k.width/2,y:D+Z*1.5},merge:{x:I,y:D+Z*2},registry:{x:I,y:D+Z*3}}})():(()=>{const I=At(C,.5,.5).y,D=At(x,.5,.5).x,Z=D+x.width/2+C.width/2+116,G=Z+C.width/2+v.width/2+184;return{intake:{x:D,y:I},decision:{x:Z,y:I},secondary:{x:(Z+G)/2+8,y:I+95},merge:{x:G,y:I},registry:{x:G+v.width/2+T.width/2+124,y:I}}})();if(y){for(const[I,D]of[[n,L.intake],[o.decisionId,L.decision],[o.secondary,L.secondary],[o.merge,L.merge],[a,L.registry]])bC(c.get(I),D,r);e.dataset.nestedDecisionLayout=m}LO(h,r);const A=I=>i(c.get(I)),_=A(n),M=A(o.decisionId),$=A(o.secondary),P=A(o.merge),N=A(a),[F,E]=o.ingress,[B,q]=o.branches,z=[];if(g){const I=Math.min(_.x,M.x,P.x,N.x)-16,D=Math.max(M.x+M.width,$.x+$.width)+12,Z=D+20,G=Hr(M,"top",-8),W=Hr(M,"left",-8),Q=Hr(M,"top",8),et=Hr(M,"bottom",-8),tt=Hr(M,"left",8);z.push({edge:F,role:"primary-ingress",points:[At(_,.5,1),{x:G.x,y:At(_,.5,1).y},G],targetSide:"top"},{edge:E,role:"metadata-return",points:[At(_,0,.55),{x:I-22,y:At(_,0,.55).y},{x:I-22,y:W.y},W],labelSegment:1,targetSide:"left"},{edge:o.add,role:"secondary-add",points:[Hr(M,"right",-8),{x:D,y:Hr(M,"right",-8).y},{x:D,y:At($,1,.35).y},At($,1,.35)],labelSegment:1,sourceSide:"right"},{edge:o.retry,role:"secondary-retry",points:[At($,1,.68),{x:Z,y:At($,1,.68).y},{x:Z,y:M.y-24},{x:Q.x,y:M.y-24},Q],labelSegment:1,targetSide:"top"},{edge:B,role:"primary-branch",points:[et,{x:et.x,y:M.y+M.height+12},{x:et.x-16,y:M.y+M.height+12},{x:et.x-16,y:P.y-12},{x:At(P,.42,0).x,y:P.y-12},At(P,.42,0)],labelSegment:2,sourceSide:"bottom"},{edge:q,role:"decision-return",points:[tt,{x:I,y:tt.y},{x:I,y:At(P,0,.65).y},At(P,0,.65)],labelSegment:1,sourceSide:"left"},{edge:o.done,role:"secondary-done",points:[At($,1,.65),{x:$.x+$.width,y:At(P,1,.65).y},At(P,1,.65)],labelSegment:0},{edge:o.downstream,role:"primary-save",points:[At(P,.5,1),At(N,.5,0)]})}else{const I=Math.min(_.y,M.y)-44,D=$.y+$.height+72,Z=Hr(M,"left",-8),G=Hr(M,"top",-8),W=Hr(M,"right",-8),Q=Hr(M,"right",8),et={x:P.x,y:Q.y},tt=Hr(M,"bottom",-10),J=Hr(M,"bottom",10),ct={x:P.x,y:W.y};z.push({edge:F,role:"primary-ingress",points:[{x:_.x+_.width,y:Z.y},Z],targetSide:"left"},{edge:E,role:"metadata-return",points:[At(_,.5,0),{x:At(_,.5,0).x,y:I},{x:G.x,y:I},G],labelSegment:1,targetSide:"top"},{edge:o.add,role:"secondary-add",points:[tt,{x:tt.x,y:At($,0,.38).y},At($,0,.38)],labelSegment:1,sourceSide:"bottom"},{edge:o.retry,role:"secondary-retry",points:[At($,.38,1),{x:At($,.38,1).x,y:D},{x:J.x,y:D},J],labelSegment:1,targetSide:"bottom"},{edge:B,role:"primary-branch",points:[W,ct],sourceSide:"right"},{edge:q,role:"decision-return",points:[Q,et],sourceSide:"right"},{edge:o.done,role:"secondary-done",points:[At($,1,.62),{x:At(P,.42,1).x,y:At($,1,.62).y},At(P,.42,1)]},{edge:o.downstream,role:"primary-save",points:[At(P,1,.64),{x:N.x,y:At(P,1,.64).y}]})}z.push({edge:o.loop,role:"compact-loop",points:[At(P,1,.16),{x:P.x+P.width+30,y:At(P,1,.16).y},{x:P.x+P.width+30,y:At(P,1,.4).y},At(P,1,.4)]});for(const{edge:I,role:D,points:Z,labelSegment:G,sourceSide:W,targetSide:Q}of z){const et=Tr(Z);for(const ct of["feedbackLane","fanoutSource","groupedReturnLane","decisionBranch","decisionReturn","clusterHeaderClearance","compactGroupedRoute"])delete I.path.dataset[ct];I.path.dataset.nestedDecisionRoute=D,D==="compact-loop"?I.path.dataset.selfLoop="right":delete I.path.dataset.selfLoop,W?I.path.dataset.diamondSourceSide=W:delete I.path.dataset.diamondSourceSide,Q?I.path.dataset.diamondTargetSide=Q:delete I.path.dataset.diamondTargetSide,I.path.dataset.manhattanPoints=et.map(({x:ct,y:yt})=>`${ct},${yt}`).join(" "),I.path.dataset.manhattanSegments=String(et.length-1),I.path.dataset.terminalTarget=c.get(I.target)?.id??"";const tt=et.at(-1),J=et.at(-2);I.path.dataset.terminalDirection=`${tt.x-J.x},${tt.y-J.y}`,I.path.setAttribute("d",et.map(({x:ct,y:yt},Y)=>`${Y?"L":"M"}${ct},${yt}`).join("")),io(I.label,I.path,et,G)}return wO(e,t),!0}function FO(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 n=o[0].target;if(n===r||e.filter(c=>c.source===n||c.target===n).length!==2)return null;const a=e.filter(c=>c.source!==n&&c.target!==n),s=a.filter(c=>!a.some(h=>h.target===c.source));if(s.length!==1)return null;const l=[s[0].source];for(;;){const c=a.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!==a.length+1||l.indexOf(r)<=0||l.at(-1)===r?null:{decision:r,retry:n,spine:l}}function $O(e,t){if(!["TD","TB"].includes(e.dataset.flowchartDirection??"")||e.querySelector("g.cluster"))return!1;const r=[...e.querySelectorAll("g.node")],i=FO(t,r.filter(p=>{const g=Ve(p);return g&&ro(g)}).map(Ir));if(!i||r.length!==i.spine.length+1)return!1;const o=t[0].path,n=new Map(r.flatMap(p=>{const g=Ve(p),m=g&&Ze(g,o);return m?[[Ir(p),m]]:[]}));if(n.size!==r.length)return!1;const a=t.find(p=>p.source===i.decision&&p.target===i.retry),s=a.label?.getBBox(),l=n.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=n.get(p);g.x=c-g.width/2,g.y=h,h+=g.height+(d?100:64)}const u=n.get(i.decision),f=n.get(i.retry);f.x=u.x+u.width+Math.max(80,(s?.width??0)+48),f.y=u.y+(u.height-f.height)/2;for(const p of r)bC(p,At(n.get(Ir(p)),.5,.5),o);for(const p of t){const g=n.get(p.source),m=n.get(p.target),y=p.source===i.retry,x=p===a;let C;if(y){const k=Hr(m,"right",-Math.min(32,m.height/4)),v=Math.min(g.y,m.y)-32;C=[At(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=[At(g,1,.5),At(m,0,.5)]:C=[At(g,.5,1),At(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},T)=>`${T?"L":"M"}${k},${v}`).join("")),io(p.label,p.path,C)}return e.dataset.decisionCycleLayout="vertical",!0}function js(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],r=[...e.querySelectorAll(".edgePaths path")].flatMap((a,s)=>{const l=wr(a);return l?[{path:a,label:t[s],...l}]:[]}),i=r[0]?.path;if(!i||AO(e,r)||$O(e,r))return;const o=a=>{const s=a&&Ve(a);return s?Ze(s,i):null},n=[...e.querySelectorAll("g.node")].flatMap(a=>{const s=o(a);return s?[s]:[]});for(const a of new Set(r.map(({source:s})=>s))){const s=Qe(e,a),l=o(s),c=r.filter(({source:m})=>m===a).flatMap(m=>{const y=Qe(e,m.target),x=o(y);return x?[{...m,targetBounds:x}]:[]});if(!s?.querySelector(":scope > polygon.label-container")||!l||c.length!==2||!n.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=V4(l,m.targetBounds,x,n,C);if(m.path.setAttribute("d",k.map((v,T)=>`${T?"L":"M"}${v.x},${v.y}`).join("")),m.path.dataset.decisionBranch=x,m.path.dataset.decisionSource=a,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;BO(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===a),f=u&&Qe(e,u.source),p=o(f);if(!u||!p)continue;const g=Z4(p,l,n,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=a,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 EO(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 s of e.querySelectorAll(".edgePaths path")){const l=wr(s);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 n=t.filter(s=>!o.has(s));if(n.length<2||n.some(s=>!i.has(s)))return!1;const a=new Set;for(const s of n){let l=s;for(;l!==void 0;){if(a.has(l))return!1;a.add(l),l=i.get(l)}}return a.size===t.length}function fh(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?DO(e):RO(e,r),t?PO(e,i):null;if(i.length<2)return null;if(!t){let x=0;for(const C of i){const v=Ve(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")],n=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],a=new Map(i.map((x,C)=>[Ir(x),C])),s=new Map,l=new Map;for(const x of o){const C=wr(x);if(!C)continue;const k=[C.source,C.target].toSorted().join("\0");s.set(k,(s.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=wr(x),v=k&&Qe(e,k.source),T=k&&Qe(e,k.target),L=v&&Cr(v),A=T&&Cr(T);if(!k||!L||!A)return;f.push(L,A);const _=a.get(k.source)??0,M=a.get(k.target)??0,$=[k.source,k.target].toSorted().join("\0"),P=s.get($)??0,N=d.get($)??0;if(d.set($,N+1),P>1){const J=N-(P-1)/2;x.dataset.parallelLane=J<0?"before":J>0?"after":"center"}else delete x.dataset.parallelLane;let F;if(M===_+1&&s.get($)===1&&l.get(k.source)===1)F=[At(L,.5,1),At(A,.5,0)];else{const J=M<=_?"left":"right",ct=c[J]++,yt=`${k.source}\0${J}`,Y=h.get(yt)??0;h.set(yt,Y+1);const H=M>_,V=At(L,.5,H?1:0),K=At(A,.5,H?0:1),at=28+Y*30,It=V.y+(H?at:-at),Yt=K.y+(H?-28:28),Wt=42+ct%2*6,Ut=J==="left"?Math.min(L.x,A.x)-Wt:Math.max(L.x+L.width,A.x+A.width)+Wt;F=[V,{x:V.x,y:It},{x:Ut,y:It},{x:Ut,y:Yt},{x:K.x,y:Yt},K]}F=Tr(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)),z=Math.max(...F.map(J=>J.y));f.push({x:E,y:B,width:q-E,height:z-B}),x.setAttribute("d",F.map((J,ct)=>`${ct?"L":"M"}${J.x},${J.y}`).join("")),x.dataset.compactFlowchart="true",x.dataset.manhattanPoints=F.map(J=>`${J.x},${J.y}`).join(" ");const I=n[C];if(!I)return;const Z=F.slice(1).map((J,ct)=>({start:F[ct],end:J})).toSorted((J,ct)=>+(Math.abs(ct.end.y-ct.start.y)<.001)-+(Math.abs(J.end.y-J.start.y)<.001)||Math.hypot(ct.end.x-ct.start.x,ct.end.y-ct.start.y)-Math.hypot(J.end.x-J.start.x,J.end.y-J.start.y)),G=I.getBBox(),W=Z.flatMap(J=>[.5,.35,.65,.2,.8].map(ct=>({segment:J,midpoint:{x:J.start.x+(J.end.x-J.start.x)*ct,y:J.start.y+(J.end.y-J.start.y)*ct}}))),Q=W.find(({midpoint:J})=>{const ct={x:J.x-G.width/2,y:J.y-G.height/2,width:G.width,height:G.height};return!u.some(yt=>wi(ct,yt,4))})??W[0];if(!Q)return;const{midpoint:et}=Q;I.setAttribute("transform",`translate(${et.x-G.x-G.width/2}, ${et.y-G.y-G.height/2})`);const tt={x:et.x-G.width/2,y:et.y-G.height/2,width:G.width,height:G.height};u.push(tt),f.push(tt)}),!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 PO(e,t){const r=t.map(Cr).filter(s=>!!s);for(const s of e.querySelectorAll(".edgePaths path")){const l=s.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(s=>s.x)),o=Math.min(...r.map(s=>s.y)),n=Math.max(...r.map(s=>s.x+s.width)),a=Math.max(...r.map(s=>s.y+s.height));return{x:i-6,y:o-46,width:n-i+12,height:a-o+54}}function OO(e){const t=e.querySelector(".edgePaths path");if(!t)return null;const i=[...[...e.querySelectorAll("g.node")].flatMap(l=>{const c=Ve(l);return c?[c]:[]}),...e.querySelectorAll("g.cluster > rect"),...e.querySelectorAll(".edgePaths path")].flatMap(l=>{const c=Ze(l,t);return c?[c]:[]});if(!i.length)return null;const o=Math.min(...i.map(l=>l.x)),n=Math.min(...i.map(l=>l.y)),a=Math.max(...i.map(l=>l.x+l.width)),s=Math.max(...i.map(l=>l.y+l.height));return{x:o,y:n,width:a-o,height:s-n}}function Ir(e){return e.id.match(/flowchart-(.+?)-\d+$/)?.[1]??e.id}function Cr(e){const t=Ve(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 IO(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,n=Math.max(...e.map(l=>l.x+l.width))+20,a=Math.max(...e.map(l=>l.y+l.height))+20,s={x:i,y:o,width:n-i,height:a-o};return t.some(l=>wi(s,l,4))?null:s}function RO(e,t){const r=[...e.querySelectorAll("g.node")],i=new Map(r.map(u=>[u,Cr(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&&Hu(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=At(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}]}),n=new Map,a=(u,f,p)=>{let g=p;for(const m of u){const y=m.getBBox();n.set(m,{x:f-y.x-y.width/2,y:g-y.y}),g+=y.height+100}},s=Math.max(...r.map(u=>u.getBBox().width)),l=EO(e);let c=l;if(c){const u=new Map([...e.querySelectorAll(".edgePaths path")].map(x=>{const C=wr(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,T)=>{const L=v.getBBox();n.set(v,{x:y+C/2-L.x-L.width/2,y:k+m[T]/2-L.y-L.height/2}),k+=m[T]+100}),y+=C+24}}else a(r,s/2,48);const h=()=>{const u=new Map(r.flatMap(p=>{const g=Ve(p),m=n.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(A=>{const _=u.get(A);return _?[_]:[]}),m=o.filter(A=>A!==p&&(p.memberIds?!!(A.id&&p.memberIds.has(A.id)):A.originalRect.x>=p.originalRect.x&&A.originalRect.y>=p.originalRect.y&&A.originalRect.x+A.originalRect.width<=p.originalRect.x+p.originalRect.width&&A.originalRect.y+A.originalRect.height<=p.originalRect.y+p.originalRect.height)).flatMap(({cluster:A})=>{const _=f.get(A);return _?[_.frame]:[]}),y=[...g,...m];if(!y.length)continue;const x=p.label.querySelector("foreignObject"),C=l&&x?x.cloneNode(!0):null;if(C){const A=Math.max(...y.map(M=>M.x+M.width))-Math.min(...y.map(M=>M.x));C.setAttribute("width",String(Math.max(24,A))),C.style.visibility="hidden";const _=C.querySelector("div");_&&(_.style.width="100%",_.style.whiteSpace="normal",_.style.overflowWrap="normal",_.style.wordBreak="normal"),p.label.append(C)}let k;try{const A=(C??x)?.querySelector("div");k=Math.ceil(Math.max(A?.getBoundingClientRect().height??0,A?.scrollHeight??0,18))}finally{C?.remove()}const v=ps(k),T=l?r.filter(A=>!p.members.includes(A)).flatMap(A=>{const _=u.get(A);return _?[_]:[]}):[],L=IO(y,T,v);if(!L)return null;f.set(p.cluster,{frame:L,measuredTitleHeight:k,headerHeight:v})}return f};let d=h();if(c&&!d&&(c=!1,a(r,s/2,48),d=h()),e.dataset.compactGroupedLayout=d?c?"parallel":"column":"original",!!d){for(const[u,f]of n)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 T=u.label.getBBox();u.label.setAttribute("transform",`translate(${(y+x)/2-T.x-T.width/2}, ${C+20-T.y})`)}}}}function DO(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])),n=t.flatMap(g=>{const m=wr(g);return m?[{path:g,...m}]:[]}),a=new Map;for(const g of n){const m=[g.source,g.target].toSorted().join("\0");a.set(m,[...a.get(m)??[],g])}const s={left:0,right:0},l=n.flatMap(g=>{if(g.source===g.target)return[{...g,side:"right"}];const m=[g.source,g.target].toSorted().join("\0"),y=a.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(Cr).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=Qe(e,y),v=Qe(e,x),T=k&&Cr(k),L=v&&Cr(v);if(!T||!L)continue;let A;if(y===x){const _=T.x+T.width+24;A=[At(T,1,.3),{x:_,y:T.y+T.height*.3},{x:_,y:T.y+T.height*.7},At(T,1,.7)],m.dataset.selfLoop="right"}else if(C){const _=At(T,C==="left"?0:1,d(y,C)),M=At(L,C==="left"?0:1,d(x,C)),$=s[C]++,P=(C==="left"?f:p)+(C==="left"?-1:1)*$*12;A=[_,{x:P,y:_.y},{x:P,y:M.y},M],m.dataset.compactGroupedSide=C,m.dataset.compactGroupedPort=`${_.x},${_.y} ${M.x},${M.y}`}else if(L.x>=T.x+T.width||T.x>=L.x+L.width){const M=L.x>=T.x,$=At(T,M?1:0,.5),P=At(L,M?0:1,.5),N=($.x+P.x)/2;A=Tr([$,{x:N,y:$.y},{x:N,y:P.y},P])}else{const M=L.y>=T.y,$=At(T,.5,M?1:0),P=At(L,.5,M?0:1),N=($.y+P.y)/2;A=Tr([$,{x:$.x,y:N},{x:P.x,y:N},P])}A=Tr(A),m.setAttribute("d",A.map((_,M)=>`${M?"L":"M"}${_.x},${_.y}`).join("")),m.dataset.compactFlowchart="true",m.dataset.compactGroupedRoute="true",m.dataset.manhattanPoints=A.map(_=>`${_.x},${_.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 NO(e){if(e.dataset.nestedDecisionLayout)return;const t=[...e.querySelectorAll("g.node")],r=[...e.querySelectorAll("g.cluster")].flatMap(o=>{const n=o.querySelector(":scope > rect");return n?[{cluster:o,rect:n,frame:{x:Number(n.getAttribute("x")),y:Number(n.getAttribute("y")),width:Number(n.getAttribute("width")),height:Number(n.getAttribute("height"))}}]:[]}),i=(o,n)=>n.x>=o.x&&n.x+n.width<=o.x+o.width&&n.y>=o.y&&n.y+n.height<=o.y+o.height;for(const o of r){const n=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(!n)continue;const a=[...e.querySelectorAll(".edgePaths path")].flatMap(g=>{const m=wr(g),y=m&&Qe(e,m.source),x=m&&Qe(e,m.target),C=y&&Cr(y),k=x&&Cr(x),v=Si(e,g);return!C||!k||!i(o.frame,k)||i(o.frame,C)||!i(n.frame,C)||C.y+C.height>o.frame.y?[]:[{source:C,labelWidth:v?.getBBox().width??0}]});if(!a.length)continue;const s=24,l=Math.max(0,...a.map(({source:g})=>g.y+g.height+s-o.frame.y)),c=t.filter(g=>{const m=Cr(g);return m&&i(o.frame,m)}),h=t.filter(g=>!c.includes(g)).flatMap(g=>{const m=Cr(g);return m&&m.y>=o.frame.y+o.frame.height?[m.y]:[]}),d=Math.min(n.frame.y+n.frame.height,...h)-o.frame.y-o.frame.height-s,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(...a.map(({labelWidth:g})=>g+12)),p=Math.max(n.frame.x+n.frame.width,o.frame.x+o.frame.width+f);n.rect.setAttribute("width",String(p-n.frame.x))}}function gh(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&&wr(r),o=i&&Qe(e,i.source),n=i&&Qe(e,i.target),a=o&&Cr(o),s=n&&Cr(n),l=M=>t.flatMap($=>{const N=$.querySelector(":scope > rect")?.getBBox();return N?[{cluster:$,frame:N}]:[]}).filter(({frame:$})=>M.x+M.width/2>$.x&&M.x+M.width/2<$.x+$.width&&M.y+M.height/2>$.y&&M.y+M.height/2<$.y+$.height).toSorted(($,P)=>$.frame.width-P.frame.width)[0];if(a&&s){const M=l(a),$=l(s);if(M&&$&&M.cluster!==$.cluster){const P=At(a,1,.5),N=At(s,0,.5),F=(M.frame.x+M.frame.width+$.frame.x)/2,E=[P,{x:F,y:P.y},{x:F,y:N.y},N];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=wr(r),f=u&&Qe(e,u.source),p=u&&Qe(e,u.target),g=f&&Ve(f),m=p&&Ve(p),y=g?Ze(g,r):null,x=m?Ze(m,r):null,C=M=>M?t.map($=>{const P=$.querySelector(":scope > rect"),N=P&&br(P,r),F=Number($.dataset.headerHeight);return N?{bounds:N,protectedBottom:N.y+(Number.isFinite(F)?F:48)+8}:null}).filter($=>!!$).filter(({bounds:$})=>M.x+M.width/2>$.x&&M.x+M.width/2<$.x+$.width&&M.y+M.height/2>$.y&&M.y+M.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 M=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,N=$?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,z=Tr(F?[{x:q,y:B},{x:P,y:B},{x:P,y:M},{x:N,y:M}]:[{x:h.x,y:h.y},{x:h.x,y:E},{x:P,y:E},{x:P,y:M},{x:N,y:M}]);r.setAttribute("d",z.map((I,D)=>`${D?"L":"M"}${I.x},${I.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort=$?"left":"right",r.dataset.manhattanPoints=z.map(I=>`${I.x},${I.y}`).join(" ");continue}const T=t.flatMap(M=>{const $=M.querySelector(":scope > rect"),P=$&&br($,r);if(!P)return[];const N=Number(M.dataset.headerHeight),F={...P,height:Math.min(P.height,(Number.isFinite(N)?N: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((M,$)=>d.y>=h.y?M.y-$.y:$.y+$.height-(M.y+M.height));if(!T.length)continue;const L=d.y>=h.y,A=[{x:h.x,y:h.y}];for(const M of T){const $=L?M.y-6:M.y+M.height+6,P=L?M.y+M.height+6:M.y-6,N=M.x-8,F=M.x+M.width+8,E=Math.abs(h.x-N)<=Math.abs(h.x-F)?N:F;A.push({x:h.x,y:$},{x:E,y:$},{x:E,y:P},{x:h.x,y:P})}A.push({x:h.x,y:d.y},{x:d.x,y:d.y});const _=Tr(A);r.setAttribute("d",_.map((M,$)=>`${$?"L":"M"}${M.x},${M.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.manhattanPoints=_.map(M=>`${M.x},${M.y}`).join(" ")}}function In(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=a=>{const s=a.getAttribute("transform");a.removeAttribute("transform");const l=a.getBBox();return s&&a.setAttribute("transform",s),l},n=[];t.forEach((a,s)=>{const l=r[s];if(a.dataset.nestedDecisionRoute&&l){const C=br(l,a);C&&n.push(C);return}if(a.dataset.clientRequestLane==="downward"&&l){const C=br(l,a);C&&n.push(C);return}const c=(a.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=br(l,a);if(!d)return;const u=[...[...e.querySelectorAll("g.node")].map(C=>br(C,a)).filter(C=>!!C),...i.map(C=>br(C,a)).filter(C=>!!C),...n],f=nr(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),T=(k?d.width:d.height)+12;return v<T?[]:[.5,.35,.65,.2,.8].map(L=>{const A={x:C.start.x+(C.end.x-C.start.x)*L,y:C.start.y+(C.end.y-C.start.y)*L},_={x:A.x-d.width/2,y:A.y-d.height/2,width:d.width,height:d.height};return{center:A,bounds:_,horizontal:k,capacity:v}})}).filter(({bounds:C})=>u.every(k=>!wi(C,k,4))).sort((C,k)=>Number(k.horizontal)-Number(C.horizontal)||k.capacity-C.capacity)[0];if(!g){const C=f.map(A=>({...A,capacity:Math.hypot(A.end.x-A.start.x,A.end.y-A.start.y)})).sort((A,_)=>_.capacity-A.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},T=k?d.width/2:d.height/2,L=u.flatMap(A=>k?[{x:A.x-4-T,y:v.y},{x:A.x+A.width+4+T,y:v.y}]:[{x:v.x,y:A.y-4-T},{x:v.x,y:A.y+A.height+4+T}]);g=[k?{x:v.x+T+4,y:v.y}:{x:v.x,y:v.y+T+4},k?{x:v.x-T-4,y:v.y}:{x:v.x,y:v.y-T-4},...L].map(A=>({center:A,bounds:{x:A.x-d.width/2,y:A.y-d.height/2,width:d.width,height:d.height},horizontal:!k,capacity:C.capacity})).filter(({bounds:A})=>u.every(_=>!wi(A,_,4))&&n.every(_=>!wi(A,_,4))).toSorted((A,_)=>Math.hypot(A.center.x-v.x,A.center.y-v.y)-Math.hypot(_.center.x-v.x,_.center.y-v.y))[0]}if(!g)return;if(a.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=a.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}`,n.push(g.bounds)}),t.forEach((a,s)=>{const l=r[s];if(a.dataset.nestedDecisionRoute||a.dataset.clientRequestLane==="downward")return;const c=l?.dataset.finalPathCenter,h=a.dataset.manhattanPoints;if(!l?.textContent?.trim()||!h)return;const d=br(l,a);if(!d)return;const u=i.flatMap(M=>{const $=br(M,a);return $?[$]:[]}),f=u.find(M=>wi(d,M,4));if(!f)return;const p=M=>{const[$,P]=M.split(",").map(Number);return{x:$,y:P}},g=h.split(" ").map(p),m=g.slice(1).map((M,$)=>({start:g[$],end:M})),y=c?p(c):null,x=y?m.find(({start:M,end:$})=>{const P=Math.min(M.x,$.x)-1,N=Math.max(M.x,$.x)+1,F=Math.min(M.y,$.y)-1,E=Math.max(M.y,$.y)+1;return y.x>=P&&y.x<=N&&y.y>=F&&y.y<=E}):m.slice().sort((M,$)=>Math.hypot($.end.x-$.start.x,$.end.y-$.start.y)-Math.hypot(M.end.x-M.start.x,M.end.y-M.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 M=d.height/2,$=f.y+f.height+4+M,P=f.y-4-M,N=Math.min(x.start.y,x.end.y)+M,F=Math.max(x.start.y,x.end.y)-M;v.y=$<=F?Math.max(N,$):Math.min(F,P)}else{const M=d.width/2,$=f.x+f.width+4+M,P=f.x-4-M,N=Math.min(x.start.x,x.end.x)+M,F=Math.max(x.start.x,x.end.x)-M;v.x=$<=F?Math.max(N,$):Math.min(F,P)}else{const M=C?d.width/2:d.height/2,$=[1,-1].map(P=>C?{x:k.x+P*(M+4),y:k.y}:{x:k.x,y:k.y+P*(M+4)}).find(P=>{const N={x:P.x-d.width/2,y:P.y-d.height/2,width:d.width,height:d.height};return u.every(F=>!wi(N,F,4))});if(!$)return;v.x=$.x,v.y=$.y}const T=o(l),L=a.getCTM(),A=l.parentElement?.getCTM();if(!L||!A)return;const _=new DOMPoint(v.x,v.y).matrixTransform(L).matrixTransform(A.inverse());l.setAttribute("transform",`translate(${_.x-T.x-T.width/2}, ${_.y-T.y-T.height/2})`),l.dataset.finalPathCenter=`${v.x},${v.y}`})}function At(e,t,r){return{x:e.x+e.width*t,y:e.y+e.height*r}}function qO(e,t,r,i,o=!1){const n=Math.min(...i.map(f=>f.x)),a=Math.max(...i.map(f=>f.x+f.width)),s=Math.min(...i.map(f=>f.y)),l=At(t,.5,1),c=At(r,.5,0);if(e===ve.userSendsMessage)return[l,c];if(e===ve.agentResponds){const f=At(t,.28,1),p=At(r,.28,0),g=f.y+(o?38:50);return[f,{x:f.x,y:g},{x:p.x,y:g},p]}if(e===ve.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=At(t,.64,f?1:0),g=At(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===ve.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=At(t,.72,f?1:0),g=At(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===ve.agentAsksUser){const f=At(t,0,o?.75:.35),p=At(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===ve.userReplies){const f=At(t,1,.65),p=At(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===ve.agentFinishes){const f=At(t,1,.35),p=At(r,1,.35),g=o?Math.max(f.x,p.x)+40:a+90;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===ve.requestFails){const f=At(t,0,o?.9:.25),p=At(r,0,o?.75:.25),g=n-(o?88:40);return[f,{x:g,y:f.y},{x:g,y:p.y},p]}if(e===ve.streamFails){if(o){const y=At(t,0,.25),x=At(r,0,.25),C=n-60;return[y,{x:C,y:y.y},{x:C,y:x.y},x]}const f=At(t,.5,0),p=At(r,0,.5),g=n-80,m=s-40;return[f,{x:f.x,y:m},{x:g,y:m},{x:g,y:p.y},p]}if(o){const f=At(t,0,.9),p=At(r,0,.1),g=n-92;return[f,{x:g,y:f.y},{x:g,y:p.y},p]}const h=At(t,1,.75),d=At(r,0,.75),u=(h.x+d.x)/2;return[h,{x:u,y:h.y},{x:u,y:d.y},d]}function nr(e){return e.slice(1).map((t,r)=>({start:e[r],end:t}))}function ya(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 zO(e,t,r=[],i){return nr(e).flatMap((o,n)=>{const a=Math.abs(o.start.y-o.end.y)<.001,s=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),l=i?Xu(i,o.start,o.end):1,c=(a?t.width:t.height)+fC*2/l;return s>=c&&!r.some(h=>ya(o,h))?[{segment:o,index:n,horizontal:a,capacity:s,excess:s-c}]:[]}).sort((o,n)=>Number(n.horizontal)-Number(o.horizontal)||n.excess-o.excess)[0]}function WO(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"]')],n=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],a=[...e.querySelectorAll("g.node")];if(o.length!==t.edges.length||a.length!==t.nodes.length)return;const s=new Map;for(const d of o){const u=d.dataset.id;if(!u||s.has(u)||d.id!==`${e.id}-${u}`||!t.edges.some(f=>f.id===u))return;s.set(u,d)}const l=new Map;for(const d of n){const u=d.querySelector(":scope > .label[data-id]")?.getAttribute("data-id");if(!u||l.has(u)||!s.has(u))return;l.set(u,d)}const c=new Map;for(const d of t.nodes){const u=a.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=s.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:n,nodesById:c,routes:h,diagram:t}}function HO(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"),T=C.querySelector(":scope > .cluster-label");if(!k||!v||!T)continue;const L=Ze(T,C),A=T.transform.baseVal.consolidate()?.matrix;if(!L||!A)continue;const _=k.y.baseVal.value+6;T.setAttribute("transform",`translate(${A.e},${A.f+_-L.y})`);const M=Math.max(v.y.baseVal.value,_+L.height+6);v.setAttribute("height",String(Math.max(0,v.height.baseVal.value-(M-v.y.baseVal.value)))),v.setAttribute("y",String(M));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[N,F,E]=P,B=Ze(k,$);if(!B||Math.abs(N.y-B.y)>.5||N.x<B.x||N.x>B.x+B.width||N.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:N.y},P.splice(1,1),P=Tr(P);const q=Gu(P);$.setAttribute("d",q),$.dataset.terminalGapBasePath=q,$.dataset.manhattanPoints=P.map(({x:z,y:I})=>`${z},${I}`).join(" ")}}let i;try{i=WO(e,r??JSON.parse(e.dataset.stateRouteGraph??"null"))}catch{return}if(!i)return;const{paths:o,labels:n,nodesById:a,routes:s}=i,l=o[0];if(!l)return;const c=new Map,h=new Map;for(const[C,k]of a){const v=Ve(k),T=v&&Ze(v,l);if(!v||!T||!Object.values(T).every(Number.isFinite)||t&&!k.transform.baseVal.consolidate()?.matrix)return;c.set(C,T),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,...n])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:T,centerOffset:L,yOffset:A})=>{const _=h.get(T),M=c.get(T),$=_?.node.transform.baseVal.consolidate()?.matrix;if(!_||!M||!$)return;const P={x:k+L-M.width/2,y:C.y+A};_.node.style.setProperty("transition-property","none","important"),_.node.setAttribute("transform",`translate(${$.e+P.x-M.x}, ${$.f+P.y-M.y})`),c.set(T,{...M,...P})})}const d=[...c].flatMap(([C,k])=>C==="root_start"?[]:[k]),u=[],f=[],p=[];s.forEach(({edge:C,path:k,label:v,kind:T})=>{v.dataset.routePathId=k.id,k.dataset.routeLabel=T;const L=c.get(C.start),A=c.get(C.end);if(!L||!A)return;const _=Tr(qO(T,L,A,d,t)),M=_[1]?Xu(k,_[0],_[1]):1,$=tO(_,d.filter(B=>B!==L&&B!==A),Yu/M,f);p.push(...$);const P=v.getBBox(),N=T===ve.agentFinishes?$.slice(1,3):$,F=zO(N,P,u,k)??N.slice(0,-1).map((B,q)=>{const z=N[q+1];return{segment:{start:B,end:z},capacity:Math.hypot(z.x-B.x,z.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=T===ve.toolStarts&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===ve.agentAsksUser&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===ve.agentFinishes&&$[1]&&$[2]?{start:$[1],end:$[2]}:!t&&T===ve.userReplies&&$[1]&&$[2]?{start:$[1],end:$[2]}:T===ve.requestFails&&$[1]&&$[2]?{start:$[1],end:$[2]}:t&&T===ve.userRetries&&$[2]&&$[3]?{start:$[2],end:$[3]}:F.segment;k.dataset.routeLabel=T,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(...nr($))});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 YO(e,t,r,i,o=8){if(e.length<2)return e;const n=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)})),a=f=>nr(f).every(p=>!_r(p,t)&&[...r,...n].every(g=>!_r(p,g,o)));if(a(e))return e;const s=e[0],l=Sn(s,e[1]),c={...s},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:At(t,.5,0),dx:0,dy:-h},{point:At(t,1,.5),dx:h,dy:0},{point:At(t,.5,1),dx:0,dy:h},{point:At(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[[s,c,{x:c.x,y:m.y},m,f],[s,c,{x:m.x,y:c.y},m,f]].map(Tr).filter(y=>{const x=y[1],C=y.at(-2);return(x.x-s.x)*(c.x-s.x)+(x.y-s.y)*(c.y-s.y)>0&&(C.x-f.x)*p+(C.y-f.y)*g>0&&a(y)})}),u=f=>nr(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 XO(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(n=>{const a=Ve(n),s=a&&Ze(a,r);return a&&s?[{node:n,shape:a,bounds:s}]:[]}),o=t.flatMap(n=>{let a;try{a=n.dataset.manhattanPoints?n.dataset.manhattanPoints.split(" ").map(l=>{const[c,h]=l.split(",").map(Number);return{x:c,y:h}}):JSON.parse(atob(n.dataset.points??""))}catch{return[]}if(!Array.isArray(a)||a.length<2||a.some(l=>!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)))return[];const s=l=>i.toSorted((c,h)=>Ki(l,c.bounds)-Ki(l,h.bounds))[0];return[{path:n,points:a,source:s(a[0]),target:s(a.at(-1))}]});for(const n of o){const{path:a,points:s,source:l,target:c}=n;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=br(g,a);return m?[m]:[]}),d=YO(s,c.bounds,[...i.filter(g=>g!==l&&g!==c).map(g=>g.bounds),...h],o.filter(g=>g!==n).flatMap(g=>nr(g.points)));if(d===s)continue;const u=Gu(d);a.setAttribute("d",u),a.dataset.terminalGapBasePath=u,a.dataset.manhattanPoints=d.map(({x:g,y:m})=>`${g},${m}`).join(" "),a.dataset.manhattanSegments=String(d.length-1),a.dataset.terminalTarget=c.node.id;const f=d.at(-1),p=d.at(-2);a.dataset.terminalDirection=`${f.x-p.x},${f.y-p.y}`,n.points=d}}function jO(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(a=>{const s=Ve(a),l=s&&Ze(s,i);if(!s||!l)return[];const c=getComputedStyle(s);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)}}]}),n=t.flatMap(a=>{const s=(a.dataset.manhattanPoints??"").split(" ").map(c=>{const[h,d]=c.split(",").map(Number);return{x:h,y:d}});if(s.length<2||s.some(({x:c,y:h})=>!Number.isFinite(c)||!Number.isFinite(h)))return[];const l=c=>o.toSorted((h,d)=>Ki(c,h)-Ki(c,d))[0];return[{path:a,points:s,source:l(s[0]),target:l(s.at(-1))}]});for(const a of n){const{path:s,points:l,source:c,target:h}=a;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(_=>_.dataset.routePathId===s.id),u=d&&br(d,s);if(!d||!u)continue;const f=n.filter(_=>_!==a),p=f.flatMap(_=>nr(_.points)),g=o.filter(_=>_!==c&&_!==h),m=r.filter(_=>_!==d).flatMap(_=>{const M=br(_,s);return M?[M]:[]}),y=_=>f.flatMap(M=>[...M.source===_?[M.points[0]]:[],...M.target===_?[M.points.at(-1)]:[]]),x=yC(l,c,h,[...g,...m],p,y(c),y(h),{bounds:u,obstacles:m,occupied:p},!1,!0);if(x===l)continue;const C=Ms(x,u,[...o,...m],p);if(!C)continue;a.points=x,s.setAttribute("d",x.map(({x:_,y:M},$)=>`${$?"L":"M"}${_},${M}`).join("")),s.dataset.manhattanPoints=x.map(({x:_,y:M})=>`${_},${M}`).join(" "),s.dataset.manhattanSegments=String(x.length-1),s.dataset.labelSegment=`${C.start.x},${C.start.y} ${C.end.x},${C.end.y}`;const k=x.at(-1),v=x.at(-2);s.dataset.terminalDirection=`${k.x-v.x},${k.y-v.y}`,delete s.dataset.terminalGapBasePath;const T=d.getBBox(),L=d.parentElement?.getCTM(),A=s.getCTM();if(L&&A){const _=new DOMPoint(C.center.x,C.center.y).matrixTransform(A).matrixTransform(L.inverse());d.setAttribute("transform",`translate(${_.x-T.x-T.width/2},${_.y-T.y-T.height/2})`),d.dataset.finalPathCenter=`${C.center.x},${C.center.y}`}}}function GO(e,t){if(e.nativeId){const i=t.flatMap((o,n)=>o.nativeId===e.nativeId?[n]:[]);if(i.length)return i.length===1?i[0]:null}if(e.routePathId){const i=t.flatMap((o,n)=>o.id===e.routePathId?[n]:[]);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 UO(e,t){const r=br(t,e),i=e.getTotalLength();if(!r||!i)return!1;const o=Math.max(1,Math.min(r.width,r.height)/4),n=Math.max(16,Math.min(2048,Math.ceil(i/o)));return Array.from({length:n+1},(a,s)=>e.getPointAtLength(i*s/n)).some(a=>Ki(a,r)<=.5)}function VO(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 n=o.querySelector(":scope > .label[data-id]")?.getAttribute("data-id"),a=GO({nativeId:n??void 0,routePathId:o.dataset.routePathId},t.map(A=>({id:A.id,nativeId:A.dataset.id,intersectsLabel:UO(A,o)}))),s=a===null?void 0:t[a];if(!s||i.has(s))return;const l=s.getTotalLength();if(!l)return;const c=s.getPointAtLength(0),h=s.getPointAtLength(l),d=[...e.querySelectorAll("g.node")].flatMap(A=>{const _=Ve(A),M=_&&Ze(_,s);return _&&M?[{node:A,shape:_,bounds:M}]:[]}),u=d.toSorted((A,_)=>Ki(c,A.bounds)-Ki(c,_.bounds))[0],f=d.toSorted((A,_)=>Ki(h,A.bounds)-Ki(h,_.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,T=[{x:m,y:u.bounds.y+v},{x:m,y:f.bounds.y+f.bounds.height}],L=`M${T[0].x},${T[0].y}L${T[1].x},${T[1].y}`;s.setAttribute("d",L),s.dataset.terminalGapBasePath=L,s.dataset.manhattanPoints=T.map(A=>`${A.x},${A.y}`).join(" "),s.dataset.manhattanSegments="1",s.dataset.labelSegment=`${T[0].x},${T[0].y} ${T[1].x},${T[1].y}`,s.dataset.routeLabel="fail",s.dataset.terminalTarget=f.node.id,s.dataset.terminalDirection="0,-1",o.dataset.routePathId=s.id,i.add(s)})}function ZO(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}))}}),n=(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,a=(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===ve.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===ve.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===ve.agentAsksUser||f.dataset.routeLabel===ve.toolStarts||f.dataset.routeLabel===ve.requestFails||f.dataset.routeLabel===ve.userRetries)||!t&&(f.dataset.routeLabel===ve.agentAsksUser||f.dataset.routeLabel===ve.agentFinishes||f.dataset.routeLabel===ve.toolStarts||f.dataset.routeLabel===ve.userReplies||f.dataset.routeLabel===ve.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),z=(Math.abs(E.start.y-E.end.y)<.5?g.width:g.height)/2,I=fC/Xu(f,E.start,E.end);return m.filter(D=>B*Math.max(D,1-D)>=z+I).map(D=>{const Z={x:F.x1+(F.x2-F.x1)*D,y:F.y1+(F.y2-F.y1)*D};if(t&&Math.abs(F.x1-F.x2)<.5&&(f.dataset.routeLabel===ve.userReplies||f.dataset.routeLabel===ve.agentFinishes)&&(Z.x-=g.width/2-(f.dataset.routeLabel===ve.userReplies?0:6)),t&&Math.abs(F.x1-F.x2)<.5&&f.dataset.routeLabel===ve.agentResponds&&(Z.y+=6),Math.abs(F.x1-F.x2)<.5&&(t&&(f.dataset.routeLabel===ve.agentAsksUser||f.dataset.routeLabel===ve.requestFails||f.dataset.routeLabel===ve.streamFails)||!t&&f.dataset.routeLabel===ve.requestFails)){const V=f.dataset.routeLabel===ve.agentAsksUser?0:f.dataset.routeLabel===ve.streamFails?-26:0;Z.x+=g.width/2+V}t&&Math.abs(F.y1-F.y2)<.5&&f.dataset.routeLabel===ve.userRetries&&(Z.x+=12,Z.y-=g.height/2-4),!t&&Math.abs(F.x1-F.x2)<.5&&f.dataset.routeLabel===ve.toolCompletes&&(Z.x+=g.width/2-6);const J={x:Z.x-g.width/2,y:Z.y-g.height/2,width:g.width,height:g.height},ct=r.filter(V=>n(J,V)).length,yt=i.filter(V=>n(J,V,5)).length,Y=o.filter(V=>V.path!==f).flatMap(V=>V.segments).filter(V=>a(V,J)).length,H=B*Math.min(D,1-D);return{midpoint:Z,bounds:J,score:ct*1e4+yt*1e4+Y*1e3+(H<z+I?100:0)+Math.abs(D-.5)}})});if(v.length===0)continue;const T=v;T.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===ve.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===ve.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===ve.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===ve.agentAsksUser)return F.midpoint.x-E.midpoint.x;if(!t&&f.dataset.routeLabel===ve.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===ve.toolStarts?E.midpoint.y-F.midpoint.y:!t&&f.dataset.routeLabel===ve.userReplies?E.midpoint.x-F.midpoint.x:F.score-E.score});const L=T[0].midpoint,A={x:L.x-g.width/2,y:L.y-g.height/2,width:g.width,height:g.height},_=f.getCTM(),M=d.parentElement?.getCTM(),$=_&&M?new DOMPoint(L.x,L.y).matrixTransform(_).matrixTransform(M.inverse()):L,P=$.x-(g.x+g.width/2),N=$.y-(g.y+g.height/2);d.setAttribute("transform",`translate(${P}, ${N})`),d.dataset.finalPathCenter=`${L.x},${L.y}`,r.push(A)}if(jO(e),!r.length)return null;const s=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:s,y:l,width:c-s,height:h-l}}hl.registerLayoutLoaders(k4);var KO=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>'),QO=er('<div role="toolbar"><!> <!> <!></div>'),JO=er('<div class="mermaid-source svelte-9cn23y" role="region"><pre class="svelte-9cn23y"> </pre></div>'),t8=er('<div class="mermaid-svg-container svelte-9cn23y"><div><div class="mermaid-svg mermaid-presentation svelte-9cn23y"></div></div> <!></div> <!>',1),e8=er('<div class="mermaid-empty svelte-9cn23y" role="status"><strong class="svelte-9cn23y"> </strong> <span class="svelte-9cn23y"> </span></div>'),r8=er('<div class="mermaid-loading svelte-9cn23y" role="status"> </div>'),i8=er('<div class="fullscreen-diagram mermaid-presentation svelte-9cn23y" style="--mermaid-font-family: var(--font-ui)"></div>'),o8=er('<div class="fullscreen-surface h-[90vh] w-[90vw] overflow-hidden rounded-lg shadow-2xl svelte-9cn23y" data-media-lightbox-content=""><!></div>'),n8=er('<div style="--mermaid-font-family: var(--font-ui)"><span class="mermaid-actor-icon-template svelte-9cn23y" aria-hidden="true"><!></span> <!></div> <!>',1);function a8(e,t){if(new.target)return To({component:a8,...e});Lo(t,!0);const r=QC("MermaidRenderer"),i=12,o=16,n=["--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"],a={streamFails:"Stream fails"};let s=Ne(t,"code",7),l=Ne(t,"isStreaming",7,!1),c=Ne(t,"className",7,""),h=Ne(t,"showExpandButton",7,!0),d=Ne(t,"showSourceButton",7,!0),u=Ne(t,"showExportButton",7,!1),f=Ne(t,"showSource",15,!1),p=Ne(t,"onRenderStateChange",7),g=ce(""),m=ce(null),y=ce(!1),x=ce(!1),C=ce(""),k=ce(null),v=ce(void 0),T=ce(void 0),L=ce(void 0),A=ce(void 0),_,M=ce(0),$=ce(!1),P=ce(!1),N=0,F=ce(0),E=0,B=ce(0),q=Pt(()=>W(D(s())));const z=JC(t2);function I(){const rt=getComputedStyle(document.documentElement);return[rt.fontSize,...n.map(ut=>rt.getPropertyValue(ut).trim())].join("\0")}function D(rt){try{return/^[A-Za-z0-9+/=]+$/.test(rt.trim())?decodeURIComponent(escape(atob(rt))):rt}catch{return rt}}function Z(rt){return!/^\s*stateDiagram(?:-v2)?\b/m.test(rt)||/^\s*direction\s+(?:LR|RL|TB|BT)\b/m.test(rt)?rt:rt.replace(/^(\s*stateDiagram(?:-v2)?\b[^\n]*)/m,`$1
|
|
314
|
-
direction TB`)}function G(rt){return!S($)||!S(P)||!/^\s*sequenceDiagram\b/m.test(rt)?rt:`---
|
|
315
|
-
config:
|
|
316
|
-
sequence:
|
|
317
|
-
actorMargin: 0
|
|
318
|
-
diagramMarginX: 0
|
|
319
|
-
messageMargin: 24
|
|
320
|
-
noteMargin: 4
|
|
321
|
-
width: 96
|
|
322
|
-
wrap: true
|
|
323
|
-
---
|
|
324
|
-
${rt}`}function W(rt){return rt.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(///g,"/")}const Q=12,et=10,tt=6;function J(rt){const ut=rt.transform.baseVal.consolidate()?.matrix;return ut?{x:ut.e,y:ut.f}:null}function ct(rt){const ut=document.createTreeWalker(rt,NodeFilter.SHOW_TEXT),wt=[];for(;ut.nextNode();){if(!ut.currentNode.textContent?.trim())continue;const Ft=document.createRange();Ft.selectNodeContents(ut.currentNode),wt.push(...Array.from(Ft.getClientRects()))}if(!wt.length)return null;const Bt=Math.min(...wt.map(Ft=>Ft.left)),kt=Math.min(...wt.map(Ft=>Ft.top)),X=Math.max(...wt.map(Ft=>Ft.right)),vt=Math.max(...wt.map(Ft=>Ft.bottom));return new DOMRect(Bt,kt,X-Bt,vt-kt)}function yt(rt){if(rt.getAttribute("aria-roledescription")==="flowchart-v2")for(const ut of rt.querySelectorAll("g.node .nodeLabel > p, g.cluster .nodeLabel > p")){if(ut.dataset.semanticBreaks==="true")continue;const wt=ut.cloneNode(!0);wt.querySelectorAll("br").forEach(kt=>kt.replaceWith(`
|
|
325
|
-
`));const Bt=wt.textContent?.replace(/[^\S\n]+/g," ").trim();if(Bt){ut.replaceChildren();for(const kt of pc(Bt))ut.append(document.createTextNode(kt.text)),kt.hardBreak?ut.append(document.createElement("br")):kt.breakAfter&&ut.append(document.createElement("wbr"));ut.dataset.semanticBreaks="true"}}}function Y(rt){for(const ut of rt.querySelectorAll("g.edgeLabel"))ut.textContent?.trim()||(ut.style.display="none")}function H(rt){if(rt.getAttribute("aria-roledescription")==="flowchart-v2")for(const ut of rt.querySelectorAll("g.node")){const wt=ut.querySelector(":scope > .label"),Bt=wt?.querySelector("foreignObject"),kt=Bt?.firstElementChild,X=ut.querySelector(":scope > .label-container, :scope > .outer-path, :scope > .basic.label-container");if(!wt||!Bt||!(kt instanceof HTMLElement)||!X)continue;const vt=Number.parseFloat(Bt.getAttribute("height")??"0"),Ft=ct(wt),qt=wt.getScreenCTM(),zt=qt&&Math.hypot(qt.c,qt.d)||1,Gt=Math.max(kt.scrollHeight,Ft?Ft.height/zt:0);if(Gt>vt+.5){const Jt=Math.ceil(Gt+1);Bt.setAttribute("height",String(Jt));const $e=J(wt);if($e&&wt.setAttribute("transform",`translate(${$e.x}, ${-Jt/2})`),X instanceof SVGRectElement){const we=Math.max(0,(Number(X.getAttribute("height"))-vt)/2);X.setAttribute("y",String(-Jt/2-we)),X.setAttribute("height",String(Jt+we*2))}}const he=X.getBoundingClientRect(),ke=ct(wt),Dt=J(wt),Ae=wt.getScreenCTM();if(!ke||!Dt||!Ae)continue;const je=Math.hypot(Ae.a,Ae.b)||1,Me=Math.hypot(Ae.c,Ae.d)||1,se=ke.x+ke.width/2-(he.x+he.width/2),$t=ke.y+ke.height/2-(he.y+he.height/2);wt.setAttribute("transform",`translate(${Dt.x-se/je}, ${Dt.y-$t/Me})`)}}function V(rt){if(rt.classList.contains("statediagram"))for(const ut of rt.querySelectorAll("g.statediagram-state")){const wt=ut.querySelector(":scope > rect.basic.label-container"),Bt=ut.querySelector(":scope > g.label");if(!wt||!Bt||!ut.textContent?.trim())continue;const kt=wt.getBoundingClientRect(),X=ct(Bt),vt=J(Bt),Ft=Bt.getScreenCTM();if(!X||!vt||!Ft)continue;const qt=Math.hypot(Ft.a,Ft.b)||1,zt=X.x+X.width/2-(kt.x+kt.width/2);Bt.setAttribute("transform",`translate(${vt.x-zt/qt}, ${vt.y})`)}}function K(rt){for(const ut of rt.querySelectorAll("foreignObject:has(span.edgeLabel)")){if(ut.dataset.labelPadded==="true")continue;const wt=ut.x.baseVal.value,Bt=ut.y.baseVal.value,kt=ut.width.baseVal.value,X=ut.height.baseVal.value,vt=ut.querySelector("span.edgeLabel");if(!vt?.textContent?.trim())continue;const Ft=vt?.textContent?.trim()===a.streamFails;Ft&&vt&&(vt.style.display="inline-block",vt.style.width="40px",vt.style.whiteSpace="normal");const qt=Ft?52:kt+12;ut.setAttribute("x",String(wt+kt/2-qt/2)),ut.setAttribute("y",String(Bt-4)),ut.setAttribute("width",String(qt)),ut.setAttribute("height",String(Ft?Math.max(44,X+8):X+8)),ut.classList.add("edge-label-surface"),ut.dataset.labelPaddingX="6",ut.dataset.labelPaddingY="4",ut.dataset.labelPadded="true"}for(const ut of rt.querySelectorAll(".edgeLabel rect.background:not([data-label-padded])")){const wt=Number(ut.getAttribute("x")),Bt=Number(ut.getAttribute("y")),kt=Number(ut.getAttribute("width")),X=Number(ut.getAttribute("height"));[wt,Bt,kt,X].every(Number.isFinite)&&(ut.setAttribute("x",String(wt-6)),ut.setAttribute("y",String(Bt-5)),ut.setAttribute("width",String(kt+12)),ut.setAttribute("height",String(X+10)),ut.setAttribute("rx","2"),ut.dataset.labelPaddingX="6",ut.dataset.labelPaddingY="5",ut.dataset.labelPadded="true")}}function at(rt){const ut=[...rt.querySelectorAll(".edgeLabel rect.background[data-label-padded], .edge-label-knockout")];if(ut.length===0)return;const wt=ut.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=rt.querySelector(":scope > defs.edge-label-feather-defs");if(Bt?.dataset.signature===wt&&ut.every(X=>X.hasAttribute("mask")))return;Bt?.remove();const kt=document.createElementNS("http://www.w3.org/2000/svg","defs");kt.classList.add("edge-label-feather-defs"),kt.dataset.signature=wt,rt.prepend(kt),ut.forEach((X,vt)=>{const Ft=Number(X.getAttribute("width")),qt=Number(X.getAttribute("height")),zt=Number(X.dataset.labelPaddingX??6),Gt=Number(X.dataset.labelPaddingY??4);if(!Number.isFinite(Ft)||!Number.isFinite(qt)||Ft<=0||qt<=0)return;const he=`${rt.id||"mermaid"}-edge-label-feather-${vt}`,ke=`${he}-blur`,Dt=`${he}-mask`,Ae=Number(X.getAttribute("x")??0),je=Number(X.getAttribute("y")??0),Me=document.createElementNS("http://www.w3.org/2000/svg","filter");Me.id=ke,Me.setAttribute("filterUnits","userSpaceOnUse"),Me.setAttribute("x",String(Ae)),Me.setAttribute("y",String(je)),Me.setAttribute("width",String(Ft)),Me.setAttribute("height",String(qt));const se=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");se.setAttribute("stdDeviation",`${zt/6} ${Gt/6}`),Me.append(se),kt.append(Me);const $t=document.createElementNS("http://www.w3.org/2000/svg","mask");$t.id=Dt,$t.setAttribute("maskContentUnits","userSpaceOnUse"),$t.setAttribute("maskUnits","userSpaceOnUse"),$t.setAttribute("mask-type","alpha"),$t.setAttribute("x",String(Ae)),$t.setAttribute("y",String(je)),$t.setAttribute("width",String(Ft)),$t.setAttribute("height",String(qt));const Jt=document.createElementNS("http://www.w3.org/2000/svg","rect");Jt.setAttribute("x",String(Ae+zt/2)),Jt.setAttribute("y",String(je+Gt/2)),Jt.setAttribute("width",String(Math.max(0,Ft-zt))),Jt.setAttribute("height",String(Math.max(0,qt-Gt))),Jt.setAttribute("fill","hsl(var(--foreground))"),Jt.setAttribute("filter",`url(#${ke})`),$t.append(Jt),kt.append($t),X.setAttribute("mask",`url(#${Dt})`),X.dataset.labelFeathered="true"})}function It(rt){const wt=document.createElement("canvas").getContext("2d");if(wt)for(const Bt of rt.querySelectorAll("span.edgeLabel")){const kt=Bt.querySelector("p");if(!kt)continue;const X=getComputedStyle(kt);wt.font=X.font;const vt=kt.innerText.split(`
|
|
326
|
-
`).filter(Ae=>Ae.length>0);if(vt.length===0)continue;const Ft=wt.measureText(vt[0]),qt=wt.measureText(vt.at(-1)),zt=Ft.fontBoundingBoxAscent||Ft.actualBoundingBoxAscent,Gt=qt.fontBoundingBoxDescent||qt.actualBoundingBoxDescent,he=zt-Ft.actualBoundingBoxAscent,ke=Gt-qt.actualBoundingBoxDescent,Dt=(ke-he)/2;kt.style.transform=`translateY(${Dt}px)`,Bt.dataset.opticalTopGap=String(3+he+Dt),Bt.dataset.opticalBottomGap=String(3+ke-Dt)}}function Yt(rt){for(const ut of rt.querySelectorAll("g.edgeLabel[data-route-path-id]")){const wt=ut.dataset.finalPathCenter?.split(",").map(Number),kt=(ut.dataset.routePathId?rt.querySelector(`#${CSS.escape(ut.dataset.routePathId)}`):null)?.getCTM(),X=ut.parentElement?.getCTM();if(!wt||wt.length!==2||!kt||!X)continue;const vt=new DOMPoint(wt[0],wt[1]).matrixTransform(kt).matrixTransform(X.inverse()),Ft=ut.getBBox();ut.setAttribute("transform",`translate(${vt.x-(Ft.x+Ft.width/2)}, ${vt.y-(Ft.y+Ft.height/2)})`)}}function Wt(rt){for(const ut of rt.querySelectorAll("g.cluster")){const wt=ut.querySelector(":scope > rect"),Bt=ut.querySelector(":scope > g.cluster-label"),kt=Bt?.querySelector("foreignObject");if(!wt||!Bt||!kt)continue;const X=Number(wt.getAttribute("x")),vt=Number(wt.getAttribute("y")),Ft=Number(wt.getAttribute("width")),qt=Number(wt.getAttribute("height"));if(![X,vt,Ft,qt].every(Number.isFinite))continue;kt.setAttribute("x","0"),kt.setAttribute("y","0"),kt.setAttribute("width",String(Math.max(24,Ft-40)));const zt=kt.querySelector("div"),Gt=Math.ceil(Math.max(zt?.getBoundingClientRect().height??0,zt?.scrollHeight??0,18)),he=ps(Gt),ke=Number(ut.dataset.headerHeight)||he,Dt=Math.max(0,he-ke),Ae=vt-Dt;kt.setAttribute("height",String(Gt)),wt.setAttribute("y",String(Ae)),wt.setAttribute("height",String(qt+Dt)),ut.dataset.headerHeight=String(Math.max(ke,he)),Bt.setAttribute("transform",`translate(${X+20}, ${Ae+20})`)}}function Ut(rt){if(rt.getAttribute("aria-roledescription")!=="sequence")return;const ut=S(L)?.querySelector("svg");if(ut)for(const wt of rt.querySelectorAll("g.actor-man")){const Bt=wt.querySelector(":scope > circle"),kt=wt.querySelector(":scope > text.actor-man");if(!Bt||!kt)continue;const X=Number(Bt.getAttribute("cx")),vt=Number(Bt.getAttribute("cy"))-10,Ft=kt.getBBox().height;wt.querySelectorAll(":scope > line, :scope > circle").forEach(zt=>zt.remove());const qt=ut.cloneNode(!0);qt.classList.add("mermaid-actor-user-icon"),qt.setAttribute("x",String(X-15)),qt.setAttribute("y",String(vt+1)),qt.setAttribute("width","30"),qt.setAttribute("height","30"),qt.setAttribute("aria-hidden","true"),qt.setAttribute("focusable","false"),qt.removeAttribute("role"),kt.setAttribute("y",String(vt+37+Ft/2)),wt.insertBefore(qt,kt)}}function Et(rt){const ut=rt.toLowerCase();return/invalid|fail|error|denied|reject|unavailable/.test(ut)?"failure":/valid|success|accepted|ready|available|complete/.test(ut)?"success":"neutral"}function Nt(rt,ut,wt){const Bt=rt.replace(/^\[|\]$/g,"").trim().split(/\s+/),kt=document.createElement("canvas").getContext("2d");if(!kt||Bt.length===0)return[rt];const X=getComputedStyle(wt);kt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const vt=[];for(const Ft of Bt){const qt=vt.length?`${vt.at(-1)} ${Ft}`:Ft;vt.length&&kt.measureText(qt).width>ut?vt.push(Ft):vt.length?vt[vt.length-1]=qt:vt.push(Ft)}return vt}function Te(rt,ut,wt){const Bt=rt.trim().split(/\s+/),kt=document.createElement("canvas").getContext("2d");if(!kt||Bt.length===0)return[rt];const X=getComputedStyle(wt);kt.font=`${X.fontWeight} ${X.fontSize} ${X.fontFamily}`;const vt=[];for(const Ft of Bt){const qt=vt.length?`${vt.at(-1)} ${Ft}`:Ft;vt.length&&kt.measureText(qt).width>ut?vt.push(Ft):vt.length?vt[vt.length-1]=qt:vt.push(Ft)}return vt}function Rt(rt,ut,wt){for(const kt of rt.querySelectorAll("line"))for(const X of["y1","y2"]){const vt=Number(kt.getAttribute(X));Number.isFinite(vt)&&vt>=ut&&kt.setAttribute(X,String(vt+wt))}for(const kt of rt.querySelectorAll("text")){if(kt.closest("g.actor-man"))continue;const X=Number(kt.getAttribute("y"));Number.isFinite(X)&&X>=ut&&kt.setAttribute("y",String(X+wt))}for(const kt of rt.querySelectorAll("rect")){const X=Number(kt.getAttribute("y")),vt=Number(kt.getAttribute("height"));[X,vt].every(Number.isFinite)&&(X>=ut?kt.setAttribute("y",String(X+wt)):X+vt>=ut&&kt.setAttribute("height",String(vt+wt)))}const Bt=rt.getScreenCTM();for(const kt of rt.querySelectorAll("g.actor-man")){const X=kt.getScreenCTM(),vt=kt.parentElement?.getScreenCTM();if(!Bt||!X||!vt)continue;const Ft=kt.getBBox();if(new DOMPoint(Ft.x,Ft.y).matrixTransform(X).matrixTransform(Bt.inverse()).y<ut)continue;const zt=vt.inverse().multiply(Bt),Gt=rt.createSVGTransform();Gt.setTranslate(zt.c*wt,zt.d*wt),kt.transform.baseVal.insertItemBefore(Gt,0)}for(const kt of rt.querySelectorAll("path, polygon, polyline")){if(kt.ownerSVGElement!==rt||kt.closest("defs, marker"))continue;const X=kt.transform.baseVal.consolidate()?.matrix;if(kt.getBBox().y+(X?.f??0)<ut)continue;const Ft=rt.createSVGTransform();Ft.setTranslate(0,wt),kt.transform.baseVal.insertItemBefore(Ft,0)}}function oe(rt,ut){const wt=[...rt.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")].filter(Bt=>Bt.y1.baseVal.value===Bt.y2.baseVal.value);if(wt.length!==0)for(const Bt of ut){const kt=Bt.y.baseVal.value,X=wt.filter(zt=>zt.y1.baseVal.value<kt).sort((zt,Gt)=>Gt.y1.baseVal.value-zt.y1.baseVal.value)[0];if(!X)continue;const vt=Number.parseFloat(getComputedStyle(X).strokeWidth)||0;let Ft=vt/2;for(const zt of["marker-start","marker-end"]){const Gt=X.getAttribute(zt)?.match(/#([^)'"\s]+)/)?.[1],he=Gt?rt.querySelector(`marker[id="${CSS.escape(Gt)}"]`):null;if(!he)continue;const ke=he.viewBox.baseVal.height||he.markerHeight.baseVal.value,Dt=he.markerHeight.baseVal.value/ke,Ae=he.markerUnits.baseVal===SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH?vt:1,je=he.refY.baseVal.value-he.viewBox.baseVal.y;Ft=Math.max(Ft,Math.max(je,ke-je)*Dt*Ae)}const qt=X.y1.baseVal.value+Ft+i-kt;qt>0&&Rt(rt,kt,qt)}}function We(rt,ut){const wt=[];let Bt=[];for(const kt of rt.children){if(kt.matches("text.messageText")&&Bt.push(kt),kt.matches("path.messageLine0, path.messageLine1")){Bt=[];continue}kt.matches("line.messageLine0, line.messageLine1")&&(wt.push({labels:Bt,line:kt}),Bt=[])}for(const kt of wt){if(kt.labels.length===0)continue;const X=Number(kt.line.getAttribute("x1")),vt=Number(kt.line.getAttribute("x2")),Ft=ut.reduce((se,$t)=>Math.abs($t-X)<Math.abs(se-X)?$t:se),qt=ut.reduce((se,$t)=>Math.abs($t-vt)<Math.abs(se-vt)?$t:se),zt=(Ft+qt)/2,Gt=Math.abs(qt-Ft)-i*2,he=kt.labels.map(se=>se.textContent?.trim()).join(" "),ke=Te(he,Gt,kt.labels[0]),Dt=(ke.length-kt.labels.length)*o,Ae=Number(kt.line.getAttribute("y1"));Dt>0&&Number.isFinite(Ae)&&Rt(rt,Ae,Dt);const je=kt.labels[0],Me=Number(je.getAttribute("y"));for(const se of kt.labels.slice(1))se.remove();ke.forEach((se,$t)=>{const Jt=$t===0?je:je.cloneNode(!1);Jt.textContent=se,Jt.setAttribute("x",String(zt)),Jt.setAttribute("y",String(Me+$t*o)),Jt.setAttribute("text-anchor","middle"),$t>0&&kt.line.before(Jt)})}}async function me(rt,ut){if(rt.getAttribute("aria-roledescription")!=="sequence")return;const wt={x:rt.viewBox.baseVal.x,y:rt.viewBox.baseVal.y,width:rt.viewBox.baseVal.width,height:rt.viewBox.baseVal.height},Bt=rt.getBBox(),kt=wt.y+wt.height-(Bt.y+Bt.height),X=[...rt.querySelectorAll(".actor-line")].map($t=>Number($t.getAttribute("x1")));We(rt,X);for(const $t of rt.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")){const Jt=Number($t.getAttribute("x1")),$e=Number($t.getAttribute("x2")),we=Number($t.getAttribute("y1")),Ee=Number($t.getAttribute("y2")),Ge=Math.sign($e-Jt);if(![Jt,$e,we,Ee].every(Number.isFinite)||we!==Ee||Ge===0)continue;const Pe=X.reduce((Se,ge)=>Math.abs(ge-$e)<Math.abs(Se-$e)?ge:Se);Math.abs(Pe-$e)>12||$t.setAttribute("x2",String(Pe-Ge*5))}for(const $t of rt.querySelectorAll(":scope > g")){const Jt=[...$t.querySelectorAll(":scope > line.loopLine")],$e=$t.querySelector(":scope > text.labelText");if(Jt.length<4||!$e)continue;const we=$e.textContent?.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-")||"group";$t.classList.add("sequence-construct",`sequence-construct-${we}`),$e.classList.add("sequence-construct-label-text"),$t.querySelector(":scope > .labelBox")?.classList.add("sequence-construct-label");const Ee=Jt.flatMap(gr=>[Number(gr.getAttribute("x1")),Number(gr.getAttribute("x2"))]),Ge=Jt.flatMap(gr=>[Number(gr.getAttribute("y1")),Number(gr.getAttribute("y2"))]),Pe=Math.min(...Ee),Se=Math.max(...Ee),ge=Math.min(...Ge),Xe=Math.max(...Ge);if(![Pe,Se,ge,Xe].every(Number.isFinite))continue;const Kt=[];for(const gr of Jt){const mi=Number(gr.getAttribute("x1")),oi=Number(gr.getAttribute("x2")),hi=Number(gr.getAttribute("y1")),Kr=Number(gr.getAttribute("y2")),Bn=mi===oi&&(mi===Pe||mi===Se)||hi===Kr&&(hi===ge||hi===Xe);gr.classList.add(Bn?"sequence-frame-line":"sequence-branch-divider"),!Bn&&hi===Kr&&Kt.push(hi)}const or=[...$t.querySelectorAll(":scope > text.loopText, :scope > text.sectionTitle")],yr=$t.querySelector(":scope > .sequence-construct-label")?.getBBox(),sr=Math.max(Pe+12,(yr?.x??Pe)+(yr?.width??42)+12),pi=[ge,...Kt.sort((gr,mi)=>gr-mi),Xe],qi=pi.slice(0,-1).map(()=>[]);or.forEach(gr=>{gr.classList.add("sequence-branch-condition"),gr.setAttribute("x",String(sr)),gr.setAttribute("text-anchor","start");const mi=Number(gr.getAttribute("y")),oi=Math.max(0,Math.min(qi.length-1,pi.findIndex((hi,Kr)=>Kr>0&&mi<hi)-1));qi[oi].push(gr)}),qi.forEach((gr,mi)=>{if(gr.length===0)return;const oi=gr.map(Bi=>Bi.textContent??"").join(" ").replace(/-\s+/g,"").replace(/\[\s+/g,"[").replace(/\s+\]/g,"]").replace(/\]\s+\[/g," "),hi=Et(oi),Kr=gr[0];for(const Bi of gr)Bi.previousElementSibling?.classList.contains("edge-label-knockout")&&Bi.previousElementSibling.remove(),Bi!==Kr&&Bi.remove();Kr.replaceChildren();const Bn=Nt(oi,Math.max(48,Se-sr-12),Kr);Kr.setAttribute("aria-label",oi.replace(/^\[|\]$/g,"").trim()),Kr.dataset.sequenceBranch=hi;for(const[Bi,yc]of Bn.entries()){const Ln=document.createElementNS("http://www.w3.org/2000/svg","tspan");Ln.setAttribute("x",String(sr)),Ln.setAttribute("dy",Bi===0?"0":"1.15em"),Ln.textContent=yc,Kr.append(Ln)}dC($t,Kr,Kr.getBBox());const zi=pi[mi],Ko=pi[mi+1],Wi=document.createElementNS("http://www.w3.org/2000/svg","rect");Wi.classList.add("sequence-branch-surface"),Wi.setAttribute("x",String(Pe+4)),Wi.setAttribute("y",String(zi+4)),Wi.setAttribute("width",String(Math.max(0,Se-Pe-8))),Wi.setAttribute("height",String(Math.max(0,Ko-zi-8))),Wi.setAttribute("rx","6"),Wi.dataset.sequenceBranch="neutral";const Mi=document.createElementNS("http://www.w3.org/2000/svg","line");Mi.classList.add("sequence-branch-cue",`sequence-branch-${hi}`),Mi.setAttribute("x1",String(Pe+8)),Mi.setAttribute("x2",String(Pe+8)),Mi.setAttribute("y1",String(zi+12)),Mi.setAttribute("y2",String(Ko-10)),Mi.dataset.sequenceBranch=hi,$t.insertBefore(Mi,$t.firstElementChild),$t.insertBefore(Wi,$t.firstElementChild)})}const vt=[...rt.querySelectorAll(":scope > .sequence-construct")];vt.sort(($t,Jt)=>{const $e=$t.getBBox(),we=Jt.getBBox();return we.width*we.height-$e.width*$e.height});const Ft=[...rt.children].filter($t=>$t.matches("rect.rect")||$t.matches("g")&&$t.querySelector(":scope > rect.rect"));rt.prepend(...Ft,...vt);const qt=$t=>$t.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),zt=($t,Jt)=>{const $e=[];let we=0;for(const Ee of Jt){const Ge=qt(Ee);let Pe="";for(;we<$t.length&&qt(Pe)!==Ge;){const Se=[Pe,$t[we]].filter(Boolean).join(" ");if(!Ge.startsWith(qt(Se)))return $t;Pe=Se,we+=1}if(qt(Pe)!==Ge)return $t;$e.push(Pe)}return we===$t.length?$e:$t},Gt=ut.split(`
|
|
327
|
-
`).map($t=>/^\s*note\s+(?:left of|right of|over)\s+[^:]+:\s*(.*)$/i.exec($t)?.[1]).filter($t=>$t!==void 0).map($t=>$t.split(/<br\s*\/?>/i)),ke=[...rt.querySelectorAll(":scope > g")].flatMap($t=>{const Jt=$t.querySelector(":scope > rect.note"),$e=[...$t.querySelectorAll(":scope > text.noteText")];return Jt&&$e.length?[{group:$t,note:Jt,lines:$e}]:[]}).map(({group:$t,note:Jt,lines:$e},we)=>{const Ee=$e.map(ge=>ge.textContent?.trim()).filter(Boolean),Ge=Gt[we]??[],Pe=Ge.length>1?zt(Ee,Ge):[Ee.join(" ")];Pe.forEach((ge,Xe)=>{const Kt=$e[Xe],or=Kt.querySelector("tspan")?.getAttribute("x")??Kt.getAttribute("x"),yr=document.createElementNS("http://www.w3.org/2000/svg","tspan");or&&yr.setAttribute("x",or),yr.textContent=ge,Kt.replaceChildren(yr)}),$e.slice(Pe.length).forEach(ge=>ge.remove());const Se=$e.slice(0,Pe.length);return{group:$t,note:Jt,texts:Se}});for(const{group:$t,texts:Jt}of ke){$t.classList.add("sequence-note");for(const $e of Jt)$e.style.setProperty("transition-property","none","important"),$e.classList.add("sequence-note-text")}ke.length&&await Promise.all(ke.flatMap(({texts:$t})=>$t.map(z4)));for(const{note:$t,texts:Jt}of ke){const $e=Jt.map(sr=>sr.getBBox()),we=Math.min(...$e.map(sr=>sr.x)),Ee=Math.min(...$e.map(sr=>sr.y)),Ge=Math.max(...$e.map(sr=>sr.x+sr.width)),Pe=Math.max(...$e.map(sr=>sr.y+sr.height)),Se=document.createElement("canvas").getContext("2d"),Xe=Math.max(...Jt.map((sr,pi)=>{const qi=getComputedStyle(sr);return Se&&(Se.font=`${qi.fontWeight} ${qi.fontSize} ${qi.fontFamily}`),Se?.measureText(sr.textContent??"").width??$e[pi].width}))+20,Kt=Math.max(28,Pe-Ee+12),or=Number(Jt[0].getAttribute("x")),yr=Number.isFinite(or)?or:(we+Ge)/2;$t.style.setProperty("transition-property","none","important"),$t.setAttribute("x",String(yr-Xe/2)),$t.setAttribute("y",String(Ee-6)),$t.setAttribute("width",String(Xe)),$t.setAttribute("height",String(Kt)),$t.setAttribute("rx","6")}oe(rt,ke.map(({note:$t})=>$t));const Dt=rt.getBBox(),Ae=Math.min(wt.x,Math.floor(Dt.x)),Me=Math.max(wt.x+wt.width,Math.ceil(Dt.x+Dt.width))-Ae,se=Math.ceil(Dt.y+Dt.height+kt-wt.y);(Me>wt.width||se>wt.height)&&(rt.setAttribute("viewBox",`${Ae} ${wt.y} ${Me} ${Math.max(wt.height,se)}`),rt.setAttribute("width",String(Me)),rt.setAttribute("height",String(Math.max(wt.height,se))))}function Ce(rt){if(!rt)return null;const ut=Array.from(rt.children).filter(X=>X instanceof SVGGElement&&X.classList.contains("label")&&!!X.textContent?.trim());if(!ut.length)return rt.style.display="none",null;rt.style.removeProperty("display");let wt=0,Bt=Number.POSITIVE_INFINITY,kt=Number.NEGATIVE_INFINITY;for(const[X,vt]of ut.entries()){const Ft=vt.getBBox();vt.setAttribute("transform",`translate(0, ${wt-Ft.y})`),Bt=Math.min(Bt,Ft.x),kt=Math.max(kt,Ft.x+Ft.width),wt+=Ft.height,X<ut.length-1&&(wt+=tt)}return{element:rt,bounds:new DOMRect(Bt,0,kt-Bt,wt)}}function Tt(rt){if(!rt.classList.contains("classDiagram"))return null;const ut=Array.from(rt.querySelectorAll("g.node")).flatMap(zt=>{const Gt=zt.querySelector(".outer-path"),he=J(zt);if(!Gt||!he)return[];const ke=Gt.getBBox();zt.querySelectorAll(":scope > .divider").forEach(Kt=>Kt.remove()),zt.querySelector(":scope > .class-box-outline")?.remove();const Dt=Ce(zt.querySelector(":scope > .annotation-group")),Ae=Ce(zt.querySelector(":scope > .label-group")),je=Ce(zt.querySelector(":scope > .members-group")),Me=Ce(zt.querySelector(":scope > .methods-group")),se=[Dt,Ae].filter(Kt=>Kt!==null),$t=[{groups:se,centered:!0},...je?[{groups:[je],centered:!1}]:[],...Me?[{groups:[Me],centered:!1}]:[]];if(!se.length)return[];const Jt=$t.map(({groups:Kt})=>Kt.reduce((or,yr,sr)=>or+yr.bounds.height+(sr?tt:0),0)),$e=Math.max(...$t.flatMap(({groups:Kt})=>Kt.map(or=>or.bounds.width))),we=Math.max(ke.width,$e+Q*2),Ee=-we/2,Ge=-(Jt[0]+et*2)/2;let Pe=Ge+et;const Se=[];for(const[Kt,or]of $t.entries()){for(const[yr,sr]of or.groups.entries()){yr&&(Pe+=tt);const pi=or.centered?-sr.bounds.width/2-sr.bounds.x:Ee+Q-sr.bounds.x;sr.element.setAttribute("transform",`translate(${pi}, ${Pe-sr.bounds.y})`),Pe+=sr.bounds.height}if(Pe+=et,Kt<$t.length-1){const yr=document.createElementNS("http://www.w3.org/2000/svg","line");yr.classList.add("class-box-divider"),yr.setAttribute("x1",String(Ee)),yr.setAttribute("x2",String(Ee+we)),yr.setAttribute("y1",String(Pe)),yr.setAttribute("y2",String(Pe)),Se.push(yr),Pe+=et}}const ge=document.createElementNS("http://www.w3.org/2000/svg","rect");ge.classList.add("class-box-outline"),ge.setAttribute("x",String(Ee)),ge.setAttribute("y",String(Ge)),ge.setAttribute("width",String(we)),ge.setAttribute("height",String(Pe-Ge)),zt.insertBefore(ge,Gt),Gt.style.display="none";const Xe=zt.querySelector(":scope > .annotation-group, :scope > .label-group, :scope > .members-group, :scope > .methods-group");for(const Kt of Se)zt.insertBefore(Kt,Xe);return[{element:zt,name:Ae.element.textContent?.trim()??"",...he,box:ge.getBBox(),originalBox:ke,deltaX:0,deltaY:0}]}),wt=()=>{const zt=Math.min(...ut.map(Dt=>Dt.x+Dt.deltaX+Dt.box.x)),Gt=Math.min(...ut.map(Dt=>Dt.y+Dt.deltaY+Dt.box.y)),he=Math.max(...ut.map(Dt=>Dt.x+Dt.deltaX+Dt.box.x+Dt.box.width)),ke=Math.max(...ut.map(Dt=>Dt.y+Dt.deltaY+Dt.box.y+Dt.box.height));return new DOMRect(zt,Gt,he-zt,ke-Gt)};if(ut.length<2)return ut.length?wt():null;const Bt=Math.max(...ut.map(zt=>zt.x))-Math.min(...ut.map(zt=>zt.x)),X=Math.max(...ut.map(zt=>zt.y))-Math.min(...ut.map(zt=>zt.y))>=Bt,vt=zt=>X?zt.y:zt.x,Ft=[];for(const zt of ut.toSorted((Gt,he)=>vt(Gt)-vt(he))){const Gt=Ft.at(-1);Gt&&Math.abs(vt(Gt[0])-vt(zt))<1?Gt.push(zt):Ft.push([zt])}let qt=Number.NEGATIVE_INFINITY;for(const zt of Ft){const Gt=Math.min(...zt.map(Dt=>vt(Dt)+(X?Dt.box.y:Dt.box.x))),he=Math.max(...zt.map(Dt=>vt(Dt)+(X?Dt.box.y+Dt.box.height:Dt.box.x+Dt.box.width))),ke=Number.isFinite(qt)?Math.max(0,qt+24-Gt):0;for(const Dt of zt)X?Dt.deltaY=ke:Dt.deltaX=ke,Dt.element.setAttribute("transform",`translate(${Dt.x+Dt.deltaX}, ${Dt.y+Dt.deltaY})`);qt=he+ke}for(const zt of rt.querySelectorAll('.edgePaths path[data-edge="true"]')){const Gt=zt.getTotalLength();if(!Gt)continue;const he=zt.getPointAtLength(0),ke=zt.getPointAtLength(Gt),Dt=we=>ut.toSorted((Ee,Ge)=>{const Pe=Se=>{const{originalBox:ge}=Se,Xe=Math.max(Se.x+ge.x-we.x,0,we.x-Se.x-ge.x-ge.width),Kt=Math.max(Se.y+ge.y-we.y,0,we.y-Se.y-ge.y-ge.height);return Math.hypot(Xe,Kt)};return Pe(Ee)-Pe(Ge)})[0],Ae=zt.dataset.id??"",je=ut.flatMap(we=>ut.filter(Ee=>Ee!==we).map(Ee=>({source:we,target:Ee}))).find(({source:we,target:Ee})=>Ae.startsWith(`id_${we.name}_${Ee.name}_`)),Me=je?.source??Dt(he),se=je?.target??Dt(ke);if(!Me||!se||Me===se)continue;const $t={x:Me.x+Me.deltaX+Me.box.x+Me.box.width/2,y:Me.y+Me.deltaY+Me.box.y+Me.box.height/2},Jt={x:se.x+se.deltaX+se.box.x+se.box.width/2,y:se.y+se.deltaY+se.box.y+se.box.height/2};if(Math.abs(Jt.x-$t.x)>Math.abs(Jt.y-$t.y)){const we=Math.sign(Jt.x-$t.x)||1,Ee=Me.x+Me.deltaX+(we>0?Me.box.x+Me.box.width:Me.box.x),Ge=se.x+se.deltaX+(we>0?se.box.x:se.box.x+se.box.width),Pe=(Ee+Ge)/2,Se=[{x:Ee,y:$t.y},{x:Pe,y:$t.y},{x:Pe,y:Jt.y},{x:Ge,y:Jt.y}];zt.setAttribute("d",Se.map((ge,Xe)=>`${Xe?"L":"M"}${ge.x},${ge.y}`).join("")),zt.dataset.manhattanPoints=Se.map(ge=>`${ge.x},${ge.y}`).join(" ")}else{const we=Math.sign(Jt.y-$t.y)||1,Ee=Me.y+Me.deltaY+(we>0?Me.box.y+Me.box.height:Me.box.y),Ge=se.y+se.deltaY+(we>0?se.box.y:se.box.y+se.box.height),Pe=(Ee+Ge)/2,Se=[{x:$t.x,y:Ee},{x:$t.x,y:Pe},{x:Jt.x,y:Pe},{x:Jt.x,y:Ge}];zt.setAttribute("d",Se.map((ge,Xe)=>`${Xe?"L":"M"}${ge.x},${ge.y}`).join("")),zt.dataset.manhattanPoints=Se.map(ge=>`${ge.x},${ge.y}`).join(" ")}}return wt()}function b(rt,ut){const wt=Number.parseFloat(getComputedStyle(rt).fontSize),Bt=ut*(12/(Number.isFinite(wt)?wt:13));rt.style.setProperty("--mermaid-readable-width",`${Bt.toFixed(3)}px`)}function U(rt){const ut=rt.getBBox(),Bt=rt.querySelector(".edgePaths path, g.node")?.getScreenCTM()?.inverse();if(!Bt)return ut;const kt=[...rt.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(Gt=>{if(!Gt.textContent?.trim())return[];const he=Gt.getBoundingClientRect(),ke=[new DOMPoint(he.left,he.top),new DOMPoint(he.right,he.top),new DOMPoint(he.right,he.bottom),new DOMPoint(he.left,he.bottom)].map(se=>se.matrixTransform(Bt)),Dt=Math.min(...ke.map(se=>se.x)),Ae=Math.min(...ke.map(se=>se.y)),je=Math.max(...ke.map(se=>se.x)),Me=Math.max(...ke.map(se=>se.y));return[{x:Dt,y:Ae,width:je-Dt,height:Me-Ae}]}),X=[ut,...kt],vt=Math.min(...X.map(Gt=>Gt.x)),Ft=Math.min(...X.map(Gt=>Gt.y)),qt=Math.max(...X.map(Gt=>Gt.x+Gt.width)),zt=Math.max(...X.map(Gt=>Gt.y+Gt.height));return{x:vt,y:Ft,width:qt-vt,height:zt-Ft}}async function it(rt,ut,wt,Bt){const kt=++E;if(await Ch(),await document.fonts?.ready,rt!==N)return!1;const X=S(T)?.querySelector(".mermaid-svg svg");if(!X||(H4(X,wt),typeof X.getBBox!="function"))return!1;if(delete X.dataset.layoutSettled,Ut(X),On(X),X.getAttribute("aria-roledescription")==="sequence")return await me(X,ut),rt!==N||kt!==E?!1:(Yp(X),at(X),b(X,X.viewBox.baseVal.width),X.dataset.layoutGeneration=String(rt),X.dataset.layoutSettled="true",!0);yt(X),Y(X),H(X),V(X),It(X),K(X),Yp(X),at(X),X.getAttribute("aria-roledescription")!=="flowchart-v2"&&fO(X,wt),cO(X),sO(X),lO(X);const vt=X.getAttribute("aria-roledescription")==="flowchart-v2";if(vt&&(X.dataset.flowchartDirection=ut.match(/^\s*(?:flowchart|graph)\s+(\w+)\b/m)?.[1]??""),vt){const Kt=X.getBBox(),or=16,yr=Math.ceil(Kt.width+or*2),sr=Math.ceil(Kt.height+or*2);return X.setAttribute("viewBox",`${Kt.x-or} ${Kt.y-or} ${yr} ${sr}`),X.setAttribute("width",String(yr)),X.setAttribute("height",String(sr)),b(X,yr),Ra(X),Za(X.ownerDocument)||await new Promise(pi=>setTimeout(pi,64)),rt!==N||kt!==E?!1:(X.dataset.layoutGeneration=String(rt),X.dataset.layoutSettled="true",!0)}const Ft=S(T)?.clientWidth??0,qt=Ft>0?Ft<=620:S($);vt&&!qt&&X.querySelectorAll("g.cluster").length>=2&&js(X);const zt=X.dataset.nestedDecisionLayout==="wide"?OO(X)??X.getBBox():X.getBBox(),Gt=Number.parseFloat(getComputedStyle(X).fontSize),he=12/(Number.isFinite(Gt)?Gt:13),Dt=!/^\s*(?:flowchart|graph)\s+(?:LR|RL|BT)\b/m.test(ut)&&(qt||vt&&zt.width*he>Ft);if(Dt&&(fh(X,!1,wt),fh(X,!0,wt)),await new Promise(Kt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Kt()))),rt!==N)return!1;X.getBoundingClientRect(),Dt&&Wt(X),vt&&NO(X),uh(X),em(X),js(X);let Ae=null;Dt?(fh(X,!0,wt),uh(X,!0),em(X),js(X),Wt(X),gh(X),In(X),Ae=X.getBBox()):(gh(X),X.querySelector("g.cluster")&&In(X));const je=X.classList.contains("statediagram"),Me=S(P)?"compact":"wide",$t=(!je||X.dataset.stateRouteLayout!==Me)&&HO(X,S(P),Bt);VO(X),XO(X),je&&$t&&(X.dataset.stateRouteLayout=Me);const Jt=Tt(X);if(dh(X),On(X),Vp(X),ZO(X,S(P)),await new Promise(Kt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Kt()))),rt!==N)return!1;Yt(X),js(X),dh(X),On(X),X.querySelector("g.cluster")&&In(X);const $e=X.getBBox(),we=[Jt,Ae].filter(Kt=>!!Kt),Ee=$e,Ge=we.length?DOMRect.fromRect({x:Math.min(Ee.x,...we.map(Kt=>Kt.x)),y:Math.min(Ee.y,...we.map(Kt=>Kt.y)),width:Math.max(Ee.x+Ee.width,...we.map(Kt=>Kt.x+Kt.width))-Math.min(Ee.x,...we.map(Kt=>Kt.x)),height:Math.max(Ee.y+Ee.height,...we.map(Kt=>Kt.y+Kt.height))-Math.min(Ee.y,...we.map(Kt=>Kt.y))}):Ee;if(![Ge.x,Ge.y,Ge.width,Ge.height].every(Number.isFinite))return!1;const Pe=!!X.querySelector("g.cluster");let Se=vt?Dt?X.querySelector("g.cluster")?14:20:28:Pe?24:S($)?je?10:8:10,ge=Math.ceil(Ge.width+Se*2),Xe=Math.ceil(Ge.height+Se*2);if(X.setAttribute("viewBox",`${Ge.x-Se} ${Ge.y-Se} ${ge} ${Xe}`),X.style.removeProperty("width"),X.setAttribute("width",String(ge)),X.setAttribute("height",String(Xe)),je){if(await new Promise(or=>requestAnimationFrame(()=>or())),rt!==N)return!1;const Kt=X.getBBox();ge=Math.ceil(Kt.width+Se*2),Xe=Math.ceil(Kt.height+Se*2),X.setAttribute("viewBox",`${Kt.x-Se} ${Kt.y-Se} ${ge} ${Xe}`),X.setAttribute("width",String(ge)),X.setAttribute("height",String(Xe))}if(b(X,ge),Za(X.ownerDocument)||await new Promise(Kt=>setTimeout(Kt,64)),rt!==N)return!1;if(!Dt&&X.getAttribute("aria-roledescription")==="flowchart-v2"){uh(X,!0),On(X);const Kt=U(X);ge=Math.ceil(Kt.width+Se*2),Xe=Math.ceil(Kt.height+Se*2),X.setAttribute("viewBox",`${Kt.x-Se} ${Kt.y-Se} ${ge} ${Xe}`),X.setAttribute("width",String(ge)),X.setAttribute("height",String(Xe)),b(X,ge)}if(X.getAttribute("aria-roledescription")==="flowchart-v2"){if(await new Promise(Kt=>requestAnimationFrame(()=>Kt())),rt!==N)return!1;tm(X),Jp(X),Qp(X),gO(X),On(X),Dt&&X.querySelector("g.cluster")&&In(X)}if(Dt&&(Wt(X),gh(X),In(X)),X.getAttribute("aria-roledescription")==="flowchart-v2"){tm(X),Jp(X),Qp(X),hO(X),_O(X);const Kt=pO(X);dh(X),Pe&&In(X),xO(X,Kt),On(X),Dt&&X.querySelector('path[data-grouped-return-lane="right"]')&&(Se=Math.max(Se,23));const or=U(X);ge=Math.ceil(or.width+Se*2),Xe=Math.ceil(or.height+Se*2),X.setAttribute("viewBox",`${or.x-Se} ${or.y-Se} ${ge} ${Xe}`),X.setAttribute("width",String(ge)),X.setAttribute("height",String(Xe)),b(X,ge)}if((je||Dt&&vt&&!Pe&&!X.dataset.decisionCycleLayout)&&(X.style.setProperty("--mermaid-readable-width","0px"),X.style.setProperty("max-width","100%")),je&&Vp(X),Ra(X),Za(X.ownerDocument)||await new Promise(Kt=>setTimeout(Kt,120)),rt!==N||kt!==E)return!1;if(X.getAttribute("aria-roledescription")==="flowchart-v2"){const Kt=U(X);if(ge=Math.ceil(Kt.width+Se*2),Xe=Math.ceil(Kt.height+Se*2),X.setAttribute("viewBox",`${Kt.x-Se} ${Kt.y-Se} ${ge} ${Xe}`),X.setAttribute("width",String(ge)),X.setAttribute("height",String(Xe)),b(X,ge),await new Promise(or=>requestAnimationFrame(()=>or())),rt!==N||kt!==E)return!1}return Ra(X),X.dataset.layoutGeneration=String(rt),X.dataset.layoutSettled="true",!0}async function ft(rt,ut,wt){const Bt=++N;gt(F,Bt,!0),gt(B,0);const kt=D(rt),X=W(kt);if(!X?.trim()){ut||gt(g,""),gt(m,null),gt(B,Bt,!0);return}try{const vt=G(Z(X)),Ft=/(?:^|\n)\s*(?:flowchart|graph)\s/i.test(vt),qt=O4(getComputedStyle(document.documentElement),Ft);qt.suppressErrorRendering=!0;const zt=/^\s*stateDiagram(?:-v2)?\b/m.test(vt),Gt=/^\s*erDiagram\b/m.test(vt);if(qt.layout=zt||Gt?"elk":"dagre",Ft&&(qt.flowchart={...qt.flowchart,curve:"basis",nodeSpacing:48,rankSpacing:64}),S($)&&(qt.flowchart={...qt.flowchart,nodeSpacing:48,padding:9,rankSpacing:48,wrappingWidth:S(P)&&/\bsubgraph\b/.test(vt)?80:120},S(P)&&(qt.sequence={...qt.sequence,actorMargin:0,diagramMarginX:0,messageMargin:24,noteMargin:4,width:96,wrap:!0})),await document.fonts?.load(`400 ${qt.fontSize}px "${E4}"`),!wt())return;const he=await I4(async()=>{hl.initialize(qt);const Dt=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,{svg:Ae}=await hl.render(Dt,vt);if(Bt!==N||!wt())return;let je,Me;if(zt||Ft&&/class="[^"]*\bcluster\b/.test(Ae)){const se=await hl.mermaidAPI.getDiagramFromText(vt);if(Bt!==N||!wt())return;se.type==="flowchart-v2"&&(je=q4(se.db.getSubGraphs())),se.type==="stateDiagram"&&(Me=eO(se.db.getData()))}return{svg:Ae,clusterMembership:je,stateDiagram:Me}},()=>Bt===N&&wt());if(!he||Bt!==N||!wt())return;gt(g,he.svg,!0),gt(m,null),await it(Bt,vt,he.clusterMembership,he.stateDiagram)&&Bt===N&>(B,Bt,!0)}catch(vt){if(Bt!==N||!wt())return;if(ut){gt(m,null),gt(B,Bt,!0);return}r.error("Failed to render mermaid diagram:",vt),gt(m,vt instanceof Error?vt.message:ze.markdown_mermaid_renderFailed_error(),!0),gt(g,""),gt(B,Bt,!0)}}const dt=S4((rt,ut)=>ft(rt.source,rt.isStreaming,ut));function _t(rt){rt.stopPropagation(),rt.preventDefault(),gt(k,rt.currentTarget,!0),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),gt(C,S(T)?.querySelector(".mermaid-svg svg")?.outerHTML??S(g),!0),gt(x,!0)}function R(rt){rt.stopPropagation(),rt.preventDefault(),f(!f())}function j(){gt(x,!1),gt(C,"")}function ot(rt){rt.defaultPrevented||S(v)?.handleKeydown(rt)}function nt(){_!==void 0&&cancelAnimationFrame(_),_=requestAnimationFrame(()=>{_=void 0;const rt=S(A)?.querySelector("svg");rt&&Ra(rt)})}gd(()=>{gt(y,!0);const rt=S(T)?.closest(".node-mermaidBlock"),ut=rt??S(T),wt=()=>rt?.clientWidth??S(T)?.clientWidth??0;let Bt,kt;const X=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{const qt=wt();qt!==Bt&&(Bt=qt,gt($,qt<=620),gt(P,S(P)?qt<440:qt<=420,!0));const zt=S(T)?.clientWidth;if(zt===kt)return;kt=zt;const Gt=S(T)?.querySelector(".mermaid-svg svg");Gt?.dataset.layoutSettled==="true"&&Ra(Gt)});ut&&X&&(Bt=wt(),gt($,Bt<=620),gt(P,Bt<=420),X.observe(ut),S(T)&&S(T)!==ut&&X.observe(S(T)));let vt=I();const Ft=new MutationObserver(()=>{const qt=I();qt!==vt&&(vt=qt,gt(M,S(M)+1))});return Ft.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>{Ft.disconnect(),X?.disconnect(),_!==void 0&&cancelAnimationFrame(_),dt.dispose(),N+=1}}),bo(()=>{const rt={source:s(),isStreaming:l(),revision:`${S(M)}:${S($)}:${S(P)}`};S(y)&&S(T)&&dl(()=>dt.update(rt))});let mt=Pt(()=>S(m)?"error":S(g)?"rendered":!s()?.trim()&&!l()?"empty":"pending");bo(()=>{p()?.(S(mt))});var St={get code(){return s()},set code(rt){s(rt),_e()},get isStreaming(){return l()},set isStreaming(rt=!1){l(rt),_e()},get className(){return c()},set className(rt=""){c(rt),_e()},get showExpandButton(){return h()},set showExpandButton(rt=!0){h(rt),_e()},get showSourceButton(){return d()},set showSourceButton(rt=!0){d(rt),_e()},get showExportButton(){return u()},set showExportButton(rt=!1){u(rt),_e()},get showSource(){return f()},set showSource(rt=!1){f(rt),_e()},get onRenderStateChange(){return p()},set onRenderStateChange(rt){p(rt),_e()},$set:Mo,$on:(rt,ut)=>Bo(t,rt,ut)},ht=n8(),Lt=ti(ht);let Ht;var Xt=Re(Lt),jt=Re(Xt);z(jt,{size:30,weight:"light"}),Fe(Xt),Zi(Xt,rt=>gt(L,rt),()=>S(L));var Le=De(Xt,2);{var tr=rt=>{var ut=KO(),wt=Re(ut),Bt=Re(wt),kt=vr(Bt,!0),X=De(Bt,2),vt=vr(X,!0);Fe(wt);var Ft=De(wt,2),qt=Re(Ft),zt=vr(qt,!0),Gt=De(qt,2),he=vr(Gt,!0),ke=De(Gt,2),Dt=vr(ke,!0),Ae=De(ke,2),je=vr(Ae,!0);Fe(Ft),Fe(ut),ar((Me,se,$t,Jt)=>{mr(kt,Me),mr(vt,se),mr(zt,$t),mr(he,S(m)),mr(Dt,Jt),mr(je,S(q))},[()=>ze.markdown_mermaid_renderFailed_error(),()=>ze.markdown_mermaid_invalid_description(),()=>ze.markdown_mermaid_errorDetails_label(),()=>ze.markdown_mermaid_viewSource_label()]),ue(rt,ut)},Po=rt=>{var ut=t8(),wt=ti(ut),Bt=Re(wt);let kt;var X=Re(Bt);rf(X,()=>S(g),!0),Fe(X),Fe(Bt);var vt=De(Bt,2);{var Ft=Gt=>{var he=QO();let ke;var Dt=Re(he);{var Ae=Jt=>{{let $e=Pt(()=>ze.markdown_mermaid_viewSource_label()),we=Pt(()=>ze.markdown_mermaid_viewSource_label());Hn(Jt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button",onclick:R,get"aria-pressed"(){return f()},get"aria-label"(){return S($e)},get tooltip(){return S(we)},children:(Ee,Ge)=>{os(Ee,{get icon(){return e2},size:"sm"})},$$slots:{default:!0}})}};fr(Dt,Jt=>{d()&&Jt(Ae)})}var je=De(Dt,2);{var Me=Jt=>{{let $e=Pt(()=>ze.markdown_mermaid_expand_ariaLabel()),we=Pt(()=>ze.markdown_mermaid_expand_tooltip());Hn(Jt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button expand-button",onclick:_t,get"aria-label"(){return S($e)},get tooltip(){return S(we)},children:(Ee,Ge)=>{os(Ee,{get icon(){return mm},size:"sm"})},$$slots:{default:!0}})}};fr(je,Jt=>{h()&&Jt(Me)})}var se=De(je,2);{var $t=Jt=>{zu(Jt,{get container(){return S(T)},compactTrigger:!0})};fr(se,Jt=>{u()&&Jt($t)})}Fe(he),ar(Jt=>{ke=Qi(he,1,"mermaid-actions svelte-9cn23y",null,ke,{"with-export":u()}),de(he,"aria-label",Jt)},[()=>ze.markdown_mermaid_actions_ariaLabel()]),ue(Gt,he)};fr(vt,Gt=>{(d()||h()||u())&&Gt(Ft)})}Fe(wt);var qt=De(wt,2);{var zt=Gt=>{var he=JO(),ke=Re(he),Dt=vr(ke,!0);Fe(he),ar(Ae=>{de(he,"aria-label",Ae),mr(Dt,S(q))},[()=>ze.markdown_mermaid_viewSource_label()]),ue(Gt,he)};fr(qt,Gt=>{f()&&Gt(zt)})}ar(()=>kt=Qi(Bt,1,"mermaid-svg-viewport svelte-9cn23y",null,kt,{"without-actions":!d()&&!h()&&!u()})),ue(rt,ut)},co=rt=>{var ut=e8(),wt=Re(ut),Bt=vr(wt,!0),kt=De(wt,2),X=vr(kt,!0);Fe(ut),ar((vt,Ft)=>{mr(Bt,vt),mr(X,Ft)},[()=>ze.markdown_mermaid_noCode_label(),()=>ze.markdown_mermaid_noCode_description()]),ue(rt,ut)},ho=Pt(()=>!s()?.trim()&&!l()),_a=rt=>{var ut=r8(),wt=vr(ut,!0);ar(Bt=>mr(wt,Bt),[()=>ze.ui_spinner_loading_ariaLabel()]),ue(rt,ut)};fr(Le,rt=>{S(m)?rt(tr):S(g)?rt(Po,1):S(ho)?rt(co,2):rt(_a,-1)})}Fe(Lt),Zi(Lt,rt=>gt(T,rt),()=>S(T));var Ta=De(Lt,2);{let rt=Pt(()=>ze.markdown_mermaid_fullscreenView_ariaLabel()),ut=Pt(()=>ze.markdown_mermaid_closeFullscreen_ariaLabel());k2(Ta,{get ariaLabel(){return S(rt)},get closeLabel(){return S(ut)},onClose:j,get openerElement(){return S(k)},onKeydown:ot,get open(){return S(x)},set open(wt){gt(x,wt,!0)},children:(wt,Bt)=>{var kt=o8(),X=Re(kt);Zi(S2(X,{onScaleChange:nt,children:(vt,Ft)=>{var qt=i8();rf(qt,()=>S(C),!0),Fe(qt),Zi(qt,zt=>gt(A,zt),()=>S(A)),ue(vt,qt)},$$slots:{default:!0}}),vt=>gt(v,vt,!0),()=>S(v)),Fe(kt),ue(wt,kt)},$$slots:{default:!0}})}return ar(rt=>{Ht=Qi(Lt,1,`mermaid-renderer ${c()??""}`,"svelte-9cn23y",Ht,{"has-diagram":rt}),de(Lt,"data-render-generation",S(F)),de(Lt,"data-render-settled-generation",S(B)),de(Lt,"data-render-settled",S(F)>0&&S(B)===S(F))},[()=>!!S(g)]),ue(e,ht),Ao(St)}const Ii={labelFontSize:13,labelCharWidthRatio:.6,labelLineHeight:1.26,kindFontSize:11,kindCharWidthRatio:.88,kindLineHeight:1,paddingX:16,paddingY:12,gap:4,maxLines:3,maxWidth:250},ki=Object.freeze({fontSize:Ii.kindFontSize,lineHeight:Ii.labelLineHeight,paddingX:6,paddingY:4}),s8={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}}},l8=1.78,c8=900,h8=30,d8=300,Yo=6,u8=112,rm=32,f8=ki.fontSize*Ii.labelCharWidthRatio,Wn=ki.paddingX*2,g8=ki.paddingY*2,ph=0,p8=ki.fontSize*ki.lineHeight,m8=14,y8=8,x8=32,hd=500,b8=.84,zo=16,un=Object.freeze({centerY:24,headerHeight:68,horizontalPadding:24});function ms(e,t=Number.POSITIVE_INFINITY){if(e.length>=48)return 100;const r=Jr(e,60);return r.lines>=3&&t<r.height+16?80:60}let an,mh;function fn(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function ql(e,t,r,i,o=0,n=fn("--font-ui","Inter, system-ui, sans-serif")){return an===void 0&&(an=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null),an?(an.font=`${r} ${t}px ${n}`,an.measureText(e).width+Math.max(0,e.length-1)*o):e.length*i}function Vu(e){const t=ki.fontSize,r=fn("--text-caption-weight","500"),i=fn("--text-caption-tracking","-0.01em"),o=Number.parseFloat(i),n=Number.isFinite(o)?i.endsWith("em")?o*t:o:t*-.01,a=Math.max(...e.split(`
|
|
328
|
-
`).map(s=>ql(s,t,r,t*.5,n)));return Math.ceil(a)+un.horizontalPadding*2}function dd(e){const t=Vu(e.label)-un.horizontalPadding*2,r=ki.fontSize;return{left:e.x+(e.width-t)/2-Yo,right:e.x+(e.width+t)/2+Yo,top:e.y+un.centerY-r,bottom:e.y+un.centerY+r}}function Jr(e,t=u8){const r=ki.fontSize,i=fn("--text-body-weight","400"),o=fn("--text-caption-tracking","-0.01em"),n=Number.parseFloat(o),a=Number.isFinite(n)?o.endsWith("em")?n*r:n:-.01*r;mh===void 0&&(mh=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null);const s=mh;s&&(s.font=`${i} ${r}px ${fn("--font-ui","Inter, system-ui, sans-serif")}`,s.letterSpacing=`${a}px`);const l=m=>s?.measureText(m).width??ql(m,r,i,f8,a),c=e.split(`
|
|
329
|
-
`),h=Math.max(...c.map(l))+Wn+ph,d=Math.max(...e.split(/\s+/).map(l),rm-Wn)+Wn+ph,u=Math.max(t,d),f=Math.ceil(Math.max(rm,Math.min(h,u))),p=f-Wn-ph,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 T=l(v);if(T>p){k&&(C+=1),C+=Math.max(1,Math.ceil(T/p))-1,k="";continue}const L=k?`${k} ${v}`:v;k&&l(L)>p?(C+=1,k=v):k=L}return m+C},0);return{width:f,height:Math.min(g,3)*p8+g8,lines:g}}function yh(e){return Jr(e).width}function ys(e,t=Yo){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 n=e[o-1],a=e[o],s=e[o+1],l=Math.hypot(a.x-n.x,a.y-n.y),c=Math.hypot(s.x-a.x,s.y-a.y),h=(a.x-n.x)*(s.y-a.y)-(a.y-n.y)*(s.x-a.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${a.x} ${a.y}`);continue}const u={x:a.x-(a.x-n.x)/l*d,y:a.y-(a.y-n.y)/l*d},f={x:a.x+(s.x-a.x)/c*d,y:a.y+(s.y-a.y)/c*d};r.push(`L ${u.x} ${u.y}`,`Q ${a.x} ${a.y} ${f.x} ${f.y}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function xa(e,t=80){return Math.max(h8,Math.min(d8,e??t))}function C8(e,t,r,i=Ii,o=c8){const n=new Set(e.nodes.map(p=>p.id)),a={...e,edges:e.edges.filter(p=>n.has(p.from)&&n.has(p.to))},s=s8[r],l=s?.nodeDefaults||{width:100,height:60},c=a.nodes.map(p=>({...p,size:p.size||wC(p,l,i)})),h={...s?.defaultLayout,...t.layout,edgeRouting:t.layout.edgeRouting||t.edgeRouting||s?.defaultLayout?.edgeRouting},d=t.layout.direction;if(!d&&["layered","tree"].includes(h.type)){const p={...h,direction:"LR"},g={...h,direction:"TB"},m=xh(c,a,p,l),y=xh(c,a,g,l),x=w8(m,y,o),C=x===m?p:g;return o<hd||x.bounds.width>o?om(x,o,xa(h.spacing,80),C,l,i):x}const u=xh(c,a,h,l);return d==="LR"||d==="RL"?u:o<hd||!a.groups?.length&&(u.bounds.width>o||u.bounds.height>0&&u.bounds.width/u.bounds.height>l8)?om(u,o,xa(h.spacing,80),h,l,i):u}function w8(e,t,r){if(r<hd)return t;const i=im(e,r),o=im(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 im(e,t){const r=e.edges.flatMap(s=>CC(s.points??[]));let i=0,o=0,n=0;for(let s=0;s<r.length;s+=1){for(let l=s+1;l<r.length;l+=1){const c=k8(r[s],r[l]);c==="crossing"&&(i+=1),c==="overlap"&&(o+=1)}n+=e.nodes.filter(l=>S8(r[s],l)).length}const a=Math.min(1,t/Math.max(e.bounds.width,1));return{crossings:i,overlaps:o,collisions:n,unreadable:a<b8,overflow:Math.max(0,e.bounds.width/Math.max(t,1)-1)}}function CC(e){return e.slice(1).flatMap((t,r)=>{const i=e[r],o=Math.abs(i.y-t.y)<.001,n=Math.abs(i.x-t.x)<.001;return o||n?[{start:i,end:t,horizontal:o}]:[]})}function k8(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,[n,a]=r(i.start.x,i.end.x),[s,l]=r(o.start.y,o.end.y);return o.start.x>n+.5&&o.start.x<a-.5&&i.start.y>s+.5&&i.start.y<l-.5?"crossing":"none"}function S8(e,t){if(e.horizontal){const o=Math.min(e.start.x,e.end.x),n=Math.max(e.start.x,e.end.x);return e.start.y>t.y+.5&&e.start.y<t.y+t.height-.5&&n>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 om(e,t,r,i,o,n){const a=e.edges.some(x=>!!x.label)||e.nodes.some(x=>x.width>t),s=i.type==="manual"&&e.bounds.width>t;if(t<500&&a||s){const x=Math.max(150,Math.min(260,t)),C=e.nodes.map(M=>{const $=Math.min(M.width,x),P=wC(M,o,n,$).height;return{...M,width:$,height:M.size?Math.max(M.size.height,P):P}}),k=Math.max(...C.map(M=>M.width)),v=new Map;for(const M of e.edges)M.label&&v.set(M.from,(v.get(M.from)??0)+1);let T=0;const L=C.map(M=>{const $={...M,x:(k-M.width)/2,y:T},P=v.get(M.id)??0;return T+=M.height+Math.max(140,P*62+60,r*.65),$}),A=e.groups?nm(e.groups,L):void 0,_=P8(e.edges,L,A);return{nodes:L,groups:A,edges:_,bounds:am(L,A,_)}}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?nm(e.groups,p):void 0,m=SC(e.edges,p,i,g),y=am(p,g,m);return{nodes:p,edges:m,groups:g,bounds:y}}function nm(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 n=30,a=un.headerHeight,s=30,l=Math.min(...o.map(p=>p.x)),c=Math.max(...o.map(p=>p.x+p.width)),h=Math.max(c-l+n*2,Vu(r.label)),d=(l+c-h)/2,u=Math.min(...o.map(p=>p.y))-a,f=Math.max(...o.map(p=>p.y+p.height))+s;return{...r,x:d,y:u,width:h,height:f-u}})}function am(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(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),a=Math.max(...e.map(s=>s.y+s.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(s=>s.x)),o=Math.min(o,...t.map(s=>s.y)),n=Math.max(n,...t.map(s=>s.x+s.width)),a=Math.max(a,...t.map(s=>s.y+s.height))),r&&r.length>0){for(const s of r)if(s.points)for(const l of s.points)i=Math.min(i,l.x),o=Math.min(o,l.y),n=Math.max(n,l.x),a=Math.max(a,l.y)}return{minX:i,minY:o,maxX:n,maxY:a,width:n-i,height:a-o}}function xh(e,t,r,i){const o=v8(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 n=t.groups?R8(t.groups,o):void 0,a=A8(t.edges,o,r,n),s=new Map;for(const c of a){const h=c.id,d=s.get(h)??0;d>0&&(c.id=`${h}-${d}`),s.set(h,d+1)}const l=D8(o,n,a);return{nodes:o,edges:a,groups:n,bounds:l}}function wC(e,t,r,i=r.maxWidth){const o=r===Ii,n=["db","store","data_store"].includes(e.kind??""),a=(o?10:r.paddingX)+(n?8:0),s=o?7:r.paddingY,l=o?2:r.gap,c=o?11:r.kindFontSize,h=m8+y8,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=Wp(e.label).length<=2&&e.label.length<=20,k="600",v=fn("--font-editorial","Georgia, Times New Roman, serif"),T=et=>ql(et,r.labelFontSize,k,g,-.01*r.labelFontSize,v)+(an?(et.length-ld(et).length)*.01*r.labelFontSize:0),L=et=>ql(et,c,"500",m,.015*c)-(an?(et.length-ld(et).length)*.015*c:0),A=y.map(T),_=Math.max(...A),M=Math.max(...D4(e.label).map(T),0),$=M>u,P=Math.max(1,u-a*2-h-d-f,$?0:M);let N,F=1;if(C&&!$)N=_,F=y.length;else{const et=Math.min(_,P),tt=Math.min(P,Math.max(et,M));N=tt,F=y.reduce((ct,yt)=>{const Y=Wu(yt);if(M>P||/[^\x00-\x7f]/.test(yt))return ct+Hp(Y??pc(yt).map(({text:at})=>at),tt,T,Y!==null);const H=Y??Wp(yt);if(!H.length)return ct+1;let V=1,K="";for(const at of H){const It=T(at);if(It>tt+.5){K&&(V+=1),V+=Math.max(1,Math.ceil((It-.5)/tt))-1,K="";continue}const Yt=K?`${K}${Y?"":" "}${at}`:at;K&&T(Yt)>tt+.5?(V+=1,K=at):K=Yt}return ct+V},0)}const E=r.labelFontSize*r.labelLineHeight*F;let B=0,q=0;if(e.kind){const et=e.kind.split(`
|
|
330
|
-
`);B=Math.min(P,Math.max(...et.map(L))),q=c*r.kindLineHeight*et.reduce((tt,J)=>tt+Hp(J.match(/\S+[\t ]*|[\t ]+/g)??[],P,L),0)}const z=e.kind?1:0,I=Math.max(N+f,B+z)+h,D=E+(e.kind?l+q:0),Z=Math.max(C?72:t.width*.6,n?112:0),G=h+a*2+d,W=Math.max(Math.min(Math.max(I+a*2+d,Z),u),Math.min(M,P)+G+f),Q=Math.max(D+s*2+d,x8,n?90:0);return{width:W,height:Q}}function v8(e,t,r,i,o){if(e.some(a=>a.position)||r.type==="manual"){const a=[],s=[];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};s.push(g),a.push(g)}else s.push({...u,x:0,y:0,width:f,height:p})}const l=xa(r.spacing,80);for(let u=0;u<s.length;u++){if(e[u].position)continue;const p=s[u].width,g=s[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),T=C*(g+l);a.some(A=>!(v+p+l*.3<A.x||v>A.x+A.width+l*.3||T+g+l*.3<A.y||T>A.y+A.height+l*.3))||(m=v,y=T,x=!0)}s[u]={...s[u],x:m,y},a.push({x:m,y,width:p,height:g})}const c=new Map;for(const u of s){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(...s.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 s)d.has(u.id)||(u.x=h+(u.x-h)*.89);return s}switch(r.type){case"layered":return sm(e,t,r,i,o);case"force":return M8(e,t,r,i,o);case"circular":return B8(e,r,i);case"tree":return L8(e,t,r,i);default:return sm(e,t,r,i,o)}}function sm(e,t,r,i,o){const n=xa(r.spacing,80),a=r.direction??"LR",s=a==="LR"||a==="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?_8(e,t,o,d,l,c,h,n,s):T8(e,t,d,n,s)}function _8(e,t,r,i,o,n,a,s,l){const c="__ungrouped__",d=s<=40,u=Math.max(d?35:48,s*.75),f=Math.max(20,s*.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(D=>!(g.get(F)?.has(D)??!1)||y.indexOf(D)<B);let z=-1;q.forEach(D=>{z=Math.max(z,k(D))});const I=z+1;return x.set(F,I),I}y.forEach(F=>{(p.get(F)?.length??0)>0&&k(F)});const v=Math.max(...Array.from(x.values()),0),T=Array.from({length:v+1},()=>[]);x.forEach((F,E)=>{(p.get(E)?.length??0)>0&&T[F].push(E)});const L=new Map,A=new Map,_=new Map,M=new Map;e.forEach(F=>{_.set(F.id,[]),M.set(F.id,[])}),t.forEach(F=>{const E=o.get(F.from)||c,B=o.get(F.to)||c;E===B&&(_.get(F.from)?.push(F.to),M.get(F.to)?.push(F.from))}),y.forEach(F=>{const E=p.get(F)||[];if(E.length===0){A.set(F,{width:0,height:0}),L.set(F,{layers:[],nodeLayer:new Map,layerSpacing:[]});return}const B=new Set(E),q=new Map,z=new Set;function I(J){const ct=q.get(J);if(ct!==void 0)return ct;if(z.has(J))return 0;z.add(J);const yt=(M.get(J)||[]).filter(V=>B.has(V));let Y=-1;yt.forEach(V=>{Y=Math.max(Y,I(V))});const H=Y+1;return q.set(J,H),H}E.forEach(J=>I(J));const D=Math.max(...Array.from(q.values()),0),Z=Array.from({length:D+1},()=>[]);q.forEach((J,ct)=>{B.has(ct)&&Z[J].push(ct)});for(let J=0;J<4;J++){for(let ct=1;ct<Z.length;ct++){const yt=Z[ct],Y=Z[ct-1],H=new Map;yt.forEach(V=>{const at=(M.get(V)||[]).filter(It=>B.has(It)).map(It=>Y.indexOf(It)).filter(It=>It!==-1);at.length>0?H.set(V,at.reduce((It,Yt)=>It+Yt,0)/at.length):H.set(V,yt.indexOf(V))}),yt.sort((V,K)=>(H.get(V)??0)-(H.get(K)??0))}for(let ct=Z.length-2;ct>=0;ct--){const yt=Z[ct],Y=Z[ct+1],H=new Map;yt.forEach(V=>{const at=(_.get(V)||[]).filter(It=>B.has(It)).map(It=>Y.indexOf(It)).filter(It=>It!==-1);at.length>0?H.set(V,at.reduce((It,Yt)=>It+Yt,0)/at.length):H.set(V,yt.indexOf(V))}),yt.sort((V,K)=>(H.get(V)??0)-(H.get(K)??0))}}const G=Z.slice(0,-1).map((J,ct)=>{const yt=t.reduce((Y,H)=>{if(!H.label||o.get(H.from)!==F||o.get(H.to)!==F||q.get(H.from)!==ct||q.get(H.to)!==ct+1)return Y;const V=Jr(H.label);return Math.max(Y,(l?V.width:V.height)+(d?18:24))},0);return Math.max(s*.5,yt)});L.set(F,{layers:Z,nodeLayer:q,layerSpacing:G});let W=0,Q=0;Z.forEach((J,ct)=>{let yt=0,Y=0;J.forEach(H=>{const V=i.get(H);V&&(l?(Y+=V.height+f,yt=Math.max(yt,V.width)):(Y+=V.width+f,yt=Math.max(yt,V.height)))}),Y-=f,Q=Math.max(Q,Y),W+=yt,ct>0&&(W+=G[ct-1]??s*.5)});const et=l?W+64:Q+64,tt=l?Q+64:W+64;A.set(F,{width:et,height:tt})});for(let F=0;F<4;F++){for(let E=1;E<T.length;E++){const B=T[E],q=T[E-1],z=new Map;B.forEach(I=>{const Z=Array.from(m.get(I)||[]).map(G=>q.indexOf(G)).filter(G=>G!==-1);Z.length>0?z.set(I,Z.reduce((G,W)=>G+W,0)/Z.length):z.set(I,B.indexOf(I))}),B.sort((I,D)=>(z.get(I)??0)-(z.get(D)??0))}for(let E=T.length-2;E>=0;E--){const B=T[E],q=T[E+1],z=new Map;B.forEach(I=>{const Z=Array.from(g.get(I)||[]).map(G=>q.indexOf(G)).filter(G=>G!==-1);Z.length>0?z.set(I,Z.reduce((G,W)=>G+W,0)/Z.length):z.set(I,B.indexOf(I))}),B.sort((I,D)=>(z.get(I)??0)-(z.get(D)??0))}}const $=new Map;let P=0;if(T.forEach(F=>{let E=0,B=0;F.forEach(q=>{const z=A.get(q);z&&(l?($.set(q,{x:P,y:E}),E+=z.height+u,B=Math.max(B,z.width)):($.set(q,{x:E,y:P}),E+=z.width+u,B=Math.max(B,z.height)))}),P+=B+u}),!l){const F=[];for(const[E,B]of $){const q=F.find(z=>Math.abs(z.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=>A.get(q)?.width??0));for(const q of E.groupIds){const z=$.get(q),I=A.get(q)?.width;!z||I===void 0||$.set(q,{...z,x:z.x+(B-I)/2})}}}const N=[];return y.forEach(F=>{const E=p.get(F)||[],B=$.get(F),q=L.get(F);if(!B||E.length===0||!q)return;const{layers:z,layerSpacing:I}=q;let D=32;z.forEach((Z,G)=>{let W=0;Z.forEach(ct=>{const yt=i.get(ct);yt&&(W+=(l?yt.height:yt.width)+f)}),W-=f;const Q=A.get(F);if(!Q)return;let tt=32+((l?Q.height:Q.width)-64-W)/2,J=0;Z.forEach(ct=>{const yt=e.find(K=>K.id===ct),Y=i.get(ct);if(!yt||!Y)return;let H,V;l?(H=B.x+D,V=B.y+tt,tt+=Y.height+f,J=Math.max(J,Y.width)):(H=B.x+tt,V=B.y+D,tt+=Y.width+f,J=Math.max(J,Y.height)),N.push({...yt,x:H,y:V,width:Y.width,height:Y.height})}),D+=J+(I[G]??s*.5)})}),N}function T8(e,t,r,i,o){const n=new Map(e.map((k,v)=>[k.id,v])),a=new Set,s=new Map;for(const k of t){const v=s.get(k.from)??[];v.push(k),s.set(k.from,v)}const l=(k,v,T)=>{const L=[k],A=new Set;for(;L.length;){const _=L.pop();if(_){if(_===v)return!0;if(!A.has(_)){A.add(_);for(const M of s.get(_)??[])M.id!==T&&L.push(M.to)}}}return!1};for(const k of t){const v=n.get(k.from)??0,T=n.get(k.to)??0;v>T&&l(k.to,k.from,k.id)&&a.add(k.id)}const c=new Map,h=new Map;for(const k of t)a.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 T=c.get(k)||[];let L=-1;T.forEach(_=>{L=Math.max(L,f(_))});const A=L+1;return d.set(k,A),A}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 T=g[v],L=g[v-1],A=new Map;T.forEach(_=>{const $=(c.get(_)||[]).map(P=>L.indexOf(P)).filter(P=>P!==-1);$.length>0?A.set(_,$.reduce((P,N)=>P+N,0)/$.length):A.set(_,T.indexOf(_))}),T.sort((_,M)=>(A.get(_)??0)-(A.get(M)??0))}for(let v=g.length-2;v>=0;v--){const T=g[v],L=g[v+1],A=new Map;T.forEach(_=>{const $=(h.get(_)||[]).map(P=>L.indexOf(P)).filter(P=>P!==-1);$.length>0?A.set(_,$.reduce((P,N)=>P+N,0)/$.length):A.set(_,T.indexOf(_))}),T.sort((_,M)=>(A.get(_)??0)-(A.get(M)??0))}}const m=[],y=i*.4,x=g.slice(0,-1).map((k,v)=>{const T=t.reduce((L,A)=>{const _=d.get(A.from),M=d.get(A.to);if(!A.label||a.has(A.id)||_!==v||M!==v+1)return L;const $=Jr(A.label);return Math.max(L,(o?$.width:$.height)+36)},0);return Math.max(i*.65,T)});let C=0;return g.forEach((k,v)=>{let T=0,L=0;L=-k.reduce((_,M)=>{const $=r.get(M);return $?_+(o?$.height:$.width)+y:_},-y)/2,k.forEach(_=>{const M=e.find(F=>F.id===_),$=r.get(_);if(!M||!$)return;let P,N;o?(P=C,N=L,L+=$.height+y,T=Math.max(T,$.width)):(P=L,N=C,L+=$.width+y,T=Math.max(T,$.height)),m.push({...M,x:P,y:N,width:$.width,height:$.height})}),C+=T+(x[v]??i*.8)}),m}function M8(e,t,r,i,o){const n=xa(r.spacing,100),a=r.direction??"LR",s=a==="LR"||a==="RL",l=150,c=n*n*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(I=>{y.has(I)||k.push({id:I,depth:q+1})})}e.forEach(E=>{m.has(E.id)||m.set(E.id,0)});const T=new Map;m.forEach(E=>{T.set(E,(T.get(E)??0)+1)});const L=new Map,A=new Map;if(o&&o.length>0){const E=o.length;let B,q;s?(B=E,q=1):(B=1,q=E);const z=n*.8;o.forEach((I,D)=>{const Z=D%B,G=Math.floor(D/B),W=(Z-(B-1)/2)*z,Q=(G-(q-1)/2)*z;A.set(I.id,{x:s?W:Q,y:s?Q:W,vx:0,vy:0})})}const _=e.map(E=>{const B=m.get(E.id)??0,q=T.get(B)??1,z=L.get(B)??0;L.set(B,z+1);const I=s?2:1.5,D=s?1:1.2,Z=B/Math.max(v,1)*n*I;let G=(z-q/2)/Math.max(q,1)*n*D;const W=f.get(E.id),Q=W?A.get(W):void 0;Q&&(s?G=Q.y+G*.2:G=Q.x+G*.2);const et=E.id.split("").reduce((ct,yt)=>ct+yt.charCodeAt(0),0),tt=(et%100/100-.5)*n*.1,J=(et*7%100/100-.5)*n*.1;return{node:E,x:(s?Z:G)+tt,y:(s?G:Z)+J,vx:0,vy:0,width:E.size?.width??i.width,height:E.size?.height??i.height}}),M=E=>_.find(B=>B.node.id===E);for(let E=0;E<l;E++){_.forEach(B=>{B.vx=0,B.vy=0});for(let B=0;B<_.length;B++)for(let q=B+1;q<_.length;q++){const z=_[q].x-_[B].x,I=_[q].y-_[B].y,D=z*z+I*I+.01,Z=Math.sqrt(D),G=(_[B].width+_[q].width)/2+n*.25,W=(_[B].height+_[q].height)/2+n*.25,Q=Math.sqrt(G*G+W*W),et=Z<Q?c*3/D:c*1/D;let tt=z/Z*et,J=I/Z*et;s?(tt*=1.5,J*=.6):(tt*=.6,J*=1.5),_[B].vx-=tt,_[B].vy-=J,_[q].vx+=tt,_[q].vy+=J}t.forEach(B=>{const q=M(B.from),z=M(B.to);if(!q||!z)return;const I=z.x-q.x,D=z.y-q.y,Z=Math.sqrt(I*I+D*D+.01),G=h*Z,W=I/Z*G,Q=D/Z*G;q.vx+=W,q.vy+=Q,z.vx-=W,z.vy-=Q}),_.forEach(B=>{t.forEach(q=>{if(q.from===B.node.id||q.to===B.node.id)return;const z=M(q.from),I=M(q.to);if(!z||!I)return;const D=I.x-z.x,Z=I.y-z.y,G=D*D+Z*Z;if(G<.01)return;const W=Math.max(0,Math.min(1,((B.x-z.x)*D+(B.y-z.y)*Z)/G));if(W<.1||W>.9)return;const Q=z.x+W*D,et=z.y+W*Z,tt=B.x-Q,J=B.y-et,ct=tt*tt+J*J+.01,yt=Math.sqrt(ct),H=Math.max(B.width,B.height)/2+n*.1;if(yt<H){const V=yt/H,K=d*(1-V)*(1-V)*n;B.vx+=tt/yt*K,B.vy+=J/yt*K}})});for(let B=0;B<t.length;B++)for(let q=B+1;q<t.length;q++){const z=t[B],I=t[q];if(z.from===I.from||z.from===I.to||z.to===I.from||z.to===I.to)continue;const D=M(z.from),Z=M(z.to),G=M(I.from),W=M(I.to);if(!D||!Z||!G||!W)continue;const Q=(Z.x-D.x)*(W.y-G.y)-(Z.y-D.y)*(W.x-G.x);if(Math.abs(Q)<.01)continue;const et=((G.x-D.x)*(W.y-G.y)-(G.y-D.y)*(W.x-G.x))/Q,tt=((G.x-D.x)*(Z.y-D.y)-(G.y-D.y)*(Z.x-D.x))/Q;if(et>.1&&et<.9&&tt>.1&&tt<.9){const J=d*n*.15,ct=W.x-G.x,yt=W.y-G.y,Y=Math.sqrt(ct*ct+yt*yt),H=-yt/Y,V=ct/Y,at=(W.x-G.x)*(D.y-G.y)-(W.y-G.y)*(D.x-G.x)>0?1:-1;D.vx+=H*J*at,D.vy+=V*J*at,Z.vx+=H*J*at,Z.vy+=V*J*at,G.vx-=H*J*at,G.vy-=V*J*at,W.vx-=H*J*at,W.vy-=V*J*at}}if(o&&o.length>0&&A.size>0){A.forEach(D=>{D.vx=0,D.vy=0});const B=n*n*5,q=Array.from(A.entries());for(let D=0;D<q.length;D++)for(let Z=D+1;Z<q.length;Z++){const[,G]=q[D],[,W]=q[Z],Q=W.x-G.x,et=W.y-G.y,tt=Q*Q+et*et+.01,J=Math.sqrt(tt),ct=B/tt,yt=Q/J*ct,Y=et/J*ct;G.vx-=yt,G.vy-=Y,W.vx+=yt,W.vy+=Y}const z=.05;_.forEach(D=>{const Z=f.get(D.node.id),G=Z?A.get(Z):void 0;if(G){const W=G.x-D.x,Q=G.y-D.y;D.vx+=W*z,D.vy+=Q*z,G.vx-=W*z*.1,G.vy-=Q*z*.1}});const I=n*2;for(let D=0;D<_.length;D++)for(let Z=D+1;Z<_.length;Z++){const G=f.get(_[D].node.id),W=f.get(_[Z].node.id);if(G&&W&&G!==W||(G&&!W||!G&&W)){const tt=_[Z].x-_[D].x,J=_[Z].y-_[D].y,ct=Math.sqrt(tt*tt+J*J+.01),yt=I/(ct*1+n*.5),Y=tt/ct*yt,H=J/ct*yt;_[D].vx-=Y,_[D].vy-=H,_[Z].vx+=Y,_[Z].vy+=H}}A.forEach(D=>{D.x+=D.vx*u,D.y+=D.vy*u})}_.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<_.length;q++)for(let z=q+1;z<_.length;z++){const I=(_[q].width+_[z].width)/2+n*.15-Math.abs(_[z].x-_[q].x),D=(_[q].height+_[z].height)/2+n*.15-Math.abs(_[z].y-_[q].y);if(I>0&&D>0)if(B=!0,I<D){const Z=I/2+1;_[z].x>=_[q].x?(_[q].x-=Z,_[z].x+=Z):(_[q].x+=Z,_[z].x-=Z)}else{const Z=D/2+1;_[z].y>=_[q].y?(_[q].y-=Z,_[z].y+=Z):(_[q].y+=Z,_[z].y-=Z)}}if(!B)break}const $=60,P=new Map;_.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 N=new Map;let F=0;if(_.forEach(E=>{if(N.has(E.node.id))return;const B=F++,q=[E.node.id];for(;q.length>0;){const z=q.pop();if(z===void 0)break;N.has(z)||(N.set(z,B),P.get(z)?.forEach(I=>{N.has(I)||q.push(I)}))}}),F>1){const E=new Map;_.forEach(G=>{const W=N.get(G.node.id);if(W===void 0)return;const Q=E.get(W);Q?(Q.minX=Math.min(Q.minX,G.x),Q.minY=Math.min(Q.minY,G.y),Q.maxX=Math.max(Q.maxX,G.x+G.width),Q.maxY=Math.max(Q.maxY,G.y+G.height)):E.set(W,{minX:G.x,minY:G.y,maxX:G.x+G.width,maxY:G.y+G.height})});const B=Array.from(E.keys()).sort((G,W)=>{const Q=E.get(G),et=E.get(W);return!Q||!et?0:(et.maxX-et.minX)*(et.maxY-et.minY)-(Q.maxX-Q.minX)*(Q.maxY-Q.minY)}),q=Math.ceil(Math.sqrt(B.length));let z=0,I=0,D=0,Z=0;for(const G of B){const W=E.get(G);if(!W)continue;const Q=W.maxX-W.minX,et=W.maxY-W.minY,tt=z-W.minX,J=I-W.minY;_.forEach(ct=>{N.get(ct.node.id)===G&&(ct.x+=tt,ct.y+=J)}),z+=Q+$,D=Math.max(D,et),Z++,Z>=q&&(Z=0,z=0,I+=D+$,D=0)}}return _.map(E=>({...E.node,x:E.x,y:E.y,width:E.width,height:E.height}))}function B8(e,t,r){const o=2*Math.PI/e.length;return e.map((n,a)=>{const s=a*o,l=200*Math.cos(s),c=200*Math.sin(s),h=n.size?.width??r.width,d=n.size?.height??r.height;return{...n,x:l,y:c,width:h,height:d}})}function L8(e,t,r,i){const o=xa(r.spacing,60),n=r.direction??"TB",a=n==="TB"||n==="BT",s=new Map,l=new Map;t.forEach(f=>{let p=s.get(f.from);p||(p=[],s.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(_=>_.id===f);if(!g)return{width:0,height:0};const m=g.size?.width??i.width,y=g.size?.height??i.height,x=s.get(f)||[];if(x.length===0){const _=a?d:p*(m+o),M=a?p*(y+o):d;return h.set(f,{x:_,y:M,width:m,height:y}),d+=(a?m:y)+o,{width:m,height:y}}const C=[];x.forEach(_=>{const M=u(_,p+1);C.push(a?M.width:M.height)});const T=(d-C.reduce((_,M)=>_+M,0)-o*(C.length-1)+d)/2,L=a?T:p*(m+o),A=a?p*(y+o):T;return h.set(f,{x:L,y:A,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 A8(e,t,r,i){const o=r.edgeRouting||"polyline";return r.type==="circular"?cm(e,t):o==="orthogonal"||o==="curved"?SC(e,t,r,i):cm(e,t)}const F8=32,$8=6;function E8(e,t){return Math.max(F8,(e+t)/4+$8/2)}function kC(e,t){const r=new Map,i=new Map(t.map(a=>[a.id,a])),o=new Map;for(const a of e){if(a.from===a.to)continue;const s=`${a.from}::${a.to}`;let l=o.get(s);l||(l=[],o.set(s,l)),l.push(a)}const n=new Set;for(const[a]of o){const[s,l]=a.split("::"),c=`${l}::${s}`,h=[s,l].sort().join("::");if(n.has(h)||!o.has(c))continue;n.add(h);const d=o.get(a),u=o.get(c);if(!d||!u)continue;const f=i.get(s),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=Jr(C.label);return g?k.height:k.width})),y=E8(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 lm(e,t,r,i){const o=r.x-t.x,n=r.y-t.y,a=Math.sqrt(o*o+n*n);if(a===0)return e;const s=-n/a,l=o/a;return{x:e.x+s*i,y:e.y+l*i}}function cm(e,t){const r=new Map(t.map(n=>[n.id,n])),i=kC(e,t),o=new Map;return e.map(n=>{const a=r.get(n.from),s=r.get(n.to);if(!a||!s)return{...n,path:"",points:[]};if(a.id===s.id){const _=o.get(n.from)??0;o.set(n.from,_+1);const{path:M,points:$}=vC(a,_);return{...n,path:M,points:$}}const l=a.x+a.width/2,c=a.y+a.height/2,h=s.x+s.width/2,d=s.y+s.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:a.x+a.width,y:c},g={x:s.x,y:d}):y>3*Math.PI/4?(p={x:a.x,y:c},g={x:s.x+s.width,y:d}):m>0?(p={x:l,y:a.y+a.height},g={x:h,y:s.y}):(p={x:l,y:a.y},g={x:h,y:s.y+s.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 _=C/v,M=k/v;p={x:p.x+_*x,y:p.y+M*x}}const T=i.get(n.id);if(T){const _={x:l,y:c},M={x:h,y:d};p=lm(p,_,M,T),g=lm(g,_,M,T)}const L=`M ${p.x} ${p.y} L ${g.x} ${g.y}`,A=[p,{x:(p.x+g.x)/2,y:(p.y+g.y)/2},g];return{...n,path:L,points:A}})}function SC(e,t,r,i){const o=new Map(t.map(Y=>[Y.id,Y])),n=new Map(t.flatMap(Y=>Y.group?[[Y.id,Y.group]]:[]));i?.forEach(Y=>Y.nodeIds?.forEach(H=>n.set(H,Y.id)));const a=kC(e,t),s=r.direction||"TB",l=s==="TB"||s==="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 Y of t)m=Math.min(m,Y.x),y=Math.max(y,Y.x+Y.width),x=Math.max(x,Y.y+Y.height);const C=[],k=[],v=new Map;for(const[Y,H]of e.entries()){const V=o.get(H.from),K=o.get(H.to);if(!V||!K)continue;if(V.id===K.id){const Ut=v.get(H.from)??0;v.set(H.from,Ut+1);const{path:Et,points:Nt}=vC(V,Ut);k.push({...H,path:Et,points:Nt});continue}const{fromSide:at,toSide:It}=I8(V,K,l),Wt=(r.type==="layered"||r.type==="tree")&&(l?V.y+V.height/2>K.y+K.height/2:V.x+V.width/2>K.x+K.width/2);C.push({index:Y,edge:H,fromNode:V,toNode:K,fromSide:at,toSide:It,goesBackward:Wt})}const T=yt(C),L=new Map;C.forEach(Y=>{const{fromNode:H,toNode:V,fromSide:K,toSide:at}=Y,It=K==="top"||K==="bottom",Yt=at==="top"||at==="bottom",Wt=H.x+H.width/2,Ut=H.y+H.height/2,Et=V.x+V.width/2,Nt=V.y+V.height/2;let Te=!1,Rt=!1,oe;if(K==="bottom"&&at==="top"){const me=H.y+H.height,Ce=V.y;oe=(me+Ce)/2,oe=Math.max(oe,me+h),oe=Math.min(oe,Ce-h)}else if(K==="top"&&at==="bottom"){const me=H.y,Ce=V.y+V.height;oe=(me+Ce)/2,oe=Math.min(oe,me-h),oe=Math.max(oe,Ce+h)}else oe=(Ut+Nt)/2;let We;if(K==="right"&&at==="left"){const me=H.x+H.width,Ce=V.x;We=(me+Ce)/2}else if(K==="left"&&at==="right"){const me=H.x,Ce=V.x+V.width;We=(me+Ce)/2}else We=(Wt+Et)/2;It&&Yt&&Math.abs(Wt-Et)>5?Te=!0:!It&&!Yt&&(Rt=!0),L.set(Y.edge.id,{needsHorizontalChannel:Te,needsVerticalChannel:Rt,horizontalY:oe,verticalX:We})});const A=C.filter(Y=>L.get(Y.edge.id)?.needsHorizontalChannel),_=C.filter(Y=>L.get(Y.edge.id)?.needsVerticalChannel);A.sort((Y,H)=>{const V=L.get(Y.edge.id),K=L.get(H.edge.id);return!V||!K?0:V.horizontalY-K.horizontalY}),_.sort((Y,H)=>{const V=L.get(Y.edge.id),K=L.get(H.edge.id);return!V||!K?0:V.verticalX-K.verticalX});const M=new Map,$=new Map,P=()=>{const Y=[];A.forEach(H=>{const{fromNode:V,toNode:K}=H,at=L.get(H.edge.id);if(!at)return;const It=at.horizontalY,Yt=Math.min(V.x,K.x),Wt=Math.max(V.x+V.width,K.x+K.width),Ut=Y.filter(Nt=>!(Wt<Nt.minX-10||Yt>Nt.maxX+10)&&(Nt.sourceId!==H.edge.from||Nt.targetId===H.edge.to));let Et=It;if(Ut.length>0){const Nt=Ut.map(Rt=>Rt.y).sort((Rt,oe)=>Rt-oe);let Te=!1;for(let Rt=0;Rt<=Ut.length;Rt++){const oe=It+Rt*c;if(!Nt.some(Tt=>Math.abs(Tt-oe)<c-1)){Et=oe,Te=!0;break}const me=It-Rt*c;if(!Nt.some(Tt=>Math.abs(Tt-me)<c-1)&&Rt>0){Et=me,Te=!0;break}}Te||(Et=It+Ut.length*c)}Y.push({minX:Yt,maxX:Wt,y:Et,edgeId:H.edge.id,sourceId:H.edge.from,targetId:H.edge.to}),M.set(H.edge.id,Et)})},N=()=>{const Y=[];_.forEach(H=>{const{fromNode:V,toNode:K}=H,at=L.get(H.edge.id);if(!at)return;const It=at.verticalX,Yt=Math.min(V.y,K.y),Wt=Math.max(V.y+V.height,K.y+K.height),Ut=Y.filter(Nt=>!(Wt<Nt.minY-10||Yt>Nt.maxY+10));let Et=It;if(Ut.length>0){const Nt=Ut.map(Rt=>Rt.x).sort((Rt,oe)=>Rt-oe);let Te=!1;for(let Rt=0;Rt<=Ut.length;Rt++){const oe=It+Rt*c;if(!Nt.some(Tt=>Math.abs(Tt-oe)<c-1)){Et=oe,Te=!0;break}const me=It-Rt*c;if(!Nt.some(Tt=>Math.abs(Tt-me)<c-1)&&Rt>0){Et=me,Te=!0;break}}Te||(Et=It+Ut.length*c)}Y.push({minY:Yt,maxY:Wt,x:Et,edgeId:H.edge.id}),$.set(H.edge.id,Et)})};P(),N();const F=C.filter(Y=>Y.goesBackward);F.sort((Y,H)=>{const V=Math.abs(l?Y.fromNode.y-Y.toNode.y:Y.fromNode.x-Y.toNode.x);return Math.abs(l?H.fromNode.y-H.toNode.y:H.fromNode.x-H.toNode.x)-V});const E=new Map;F.forEach((Y,H)=>{E.set(Y.edge.id,H)});const B=yt(l?F.map(Y=>({...Y,fromSide:"left",toSide:"left"})):[]),q=new Map;if(l)for(const Y of F){const H=Math.max(i?.length?0:32,Y.edge.label?yh(Y.edge.label)/2+4:0),V=Math.min(Y.fromNode.y,Y.toNode.y),K=Math.max(Y.fromNode.y+Y.fromNode.height,Y.toNode.y+Y.toNode.height),at=Math.min(...[...t,...i??[]].filter(Wt=>Wt.y<K&&Wt.y+Wt.height>V).map(Wt=>Wt.x));let It=i?.length?m-h-H-((E.get(Y.edge.id)??0)+1)*c:at-h-H-c;const Yt=F.filter(Wt=>{const Ut=Math.min(Wt.fromNode.y,Wt.toNode.y),Et=Math.max(Wt.fromNode.y+Wt.fromNode.height,Wt.toNode.y+Wt.toNode.height);return Ut<=K&&Et>=V}).flatMap(Wt=>q.has(Wt.edge.id)?[q.get(Wt.edge.id)]:[]).sort((Wt,Ut)=>Ut-Wt);for(const Wt of Yt)Math.abs(It-Wt)<c&&(It=Wt-c);q.set(Y.edge.id,It)}const z=new Map,I=new Map;for(const Y of C){const H=`${Y.edge.from}->${Y.edge.to}`,V=I.get(H)??[];V.push(Y),I.set(H,V)}for(const Y of I.values())Y.forEach((H,V)=>z.set(H.edge.id,{index:V,count:Y.length}));const D=Y=>{const H=(Y.fromNode.x+Y.fromNode.width/2+Y.toNode.x+Y.toNode.width/2)/2,V=Math.min(Y.fromNode.y+Y.fromNode.height,Y.toNode.y+Y.toNode.height),K=Math.max(Y.fromNode.y,Y.toNode.y);return K<=V?!1:t.some(at=>at.id!==Y.fromNode.id&&at.id!==Y.toNode.id&&H>=at.x-d&&H<=at.x+at.width+d&&at.y<K&&at.y+at.height>V)},Z=Y=>{if(!Y.edge.label)return!1;const H=Math.max(0,Math.max(Y.fromNode.y,Y.toNode.y)-Math.min(Y.fromNode.y+Y.fromNode.height,Y.toNode.y+Y.toNode.height)),V=Jr(Y.edge.label,ms(Y.edge.label,H));return V.lines>=3&&H<V.height+16},G=(Y,H,V)=>Math.abs(Y.x-H.x)<.001?Y.x>V.left&&Y.x<V.right&&Math.max(Y.y,H.y)>V.top&&Math.min(Y.y,H.y)<V.bottom:Y.y>V.top&&Y.y<V.bottom&&Math.max(Y.x,H.x)>V.left&&Math.min(Y.x,H.x)<V.right,W=(Y,H)=>Y.slice(1).some((V,K)=>H.some(at=>G(Y[K],V,at))),Q=(Y,H)=>Math.abs(H.x-Y.x)>=Math.abs(H.y-Y.y)?{x:Y.x+Math.sign(H.x-Y.x)*d,y:Y.y}:{x:Y.x,y:Y.y+Math.sign(H.y-Y.y)*d},et=Y=>Y.slice(1).reduce((H,V,K)=>H+Math.abs(V.x-Y[K].x)+Math.abs(V.y-Y[K].y),0),tt=(Y,H)=>{const V=(j,ot)=>Math.abs(ot.x-j.x)>=Math.abs(ot.y-j.y)?`${Math.sign(ot.x-j.x)},0`:`0,${Math.sign(ot.y-j.y)}`,K=new Set([n.get(Y.fromNode.id),n.get(Y.toNode.id)].filter(j=>j!==void 0)),at=t.map(j=>{const ot=j.id===Y.fromNode.id||j.id===Y.toNode.id?0:u;return{left:j.x-ot,right:j.x+j.width+ot,top:j.y-ot,bottom:j.y+j.height+ot}}),It=(i??[]).filter(j=>!K.has(j.id)&&j.width>0&&j.height>0).map(j=>({left:j.x-f,right:j.x+j.width+f,top:j.y-f,bottom:j.y+j.height+f})),Yt=(i??[]).map(dd),Wt=[...at,...It,...Yt],Ut=Ua(H);if(!W(Ut,Wt))return Ut;const Et=Y.edge.label?Jr(Y.edge.label):void 0,Nt=[...Yt,...t.map(j=>({left:j.x,right:j.x+j.width,top:j.y,bottom:j.y+j.height})),...(i??[]).filter(j=>!K.has(j.id)&&j.width>0&&j.height>0).map(j=>({left:j.x,right:j.x+j.width,top:j.y,bottom:j.y+j.height}))],Te=j=>{if(!Et)return Number.POSITIVE_INFINITY;const ot=[.5,.25,.75,.125,.875];return j.slice(1).reduce((nt,mt,St)=>{const ht=j[St];return nt+ot.filter(Lt=>{const Ht=ht.x+(mt.x-ht.x)*Lt,Xt=ht.y+(mt.y-ht.y)*Lt,jt={left:Ht-Et.width/2-p,right:Ht+Et.width/2+p,top:Xt-Et.height/2-p,bottom:Xt+Et.height/2+p};return!Nt.some(Le=>jt.left<Le.right&&jt.right>Le.left&&jt.top<Le.bottom&&jt.bottom>Le.top)}).length},0)},Rt=j=>Te(j)>=3,oe=Ut[0],We=Ut[Ut.length-1],me=V(oe,H[1]),Ce=V(H[H.length-2],We),Tt=Q(oe,Ut[1]),b=Q(We,Ut[Ut.length-2]),U=j=>[...new Set(j)].sort((ot,nt)=>ot-nt),it=U([...Wt.flatMap(({left:j,right:ot})=>[j,ot]),...Et?Nt.flatMap(({left:j,right:ot})=>[j-Et.width/2-g,ot+Et.width/2+g]):[]]),ft=U([...Wt.flatMap(({top:j,bottom:ot})=>[j,ot]),...Et?Nt.flatMap(({top:j,bottom:ot})=>[j-Et.height/2-g,ot+Et.height/2+g]):[]]),dt=[...it.map(j=>Ua([oe,Tt,{x:j,y:Tt.y},{x:j,y:b.y},b,We])),...ft.map(j=>Ua([oe,Tt,{x:Tt.x,y:j},{x:b.x,y:j},b,We]))].filter(j=>!W(j,Wt)&&V(j[0],j[1])===me&&V(j[j.length-2],j[j.length-1])===Ce),_t=dt.filter(Rt);return(_t.length>0?_t:dt).toSorted((j,ot)=>{const nt=mt=>et(mt)+mt.length*c;return nt(j)-nt(ot)||JSON.stringify(j).localeCompare(JSON.stringify(ot))})[0]??Ut},J=C.map(Y=>{const{index:H,edge:V,fromNode:K,toNode:at,fromSide:It,toSide:Yt,goesBackward:Wt}=Y,Ut=(Tt,b)=>{switch(b){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}}},Et=T.get(`${H}:from`)??Ut(K,It);let Nt=T.get(`${H}:to`)??Ut(at,Yt);const Te=a.get(V.id),Rt=[Et],oe=It==="top"||It==="bottom",We=Yt==="top"||Yt==="bottom",me=(()=>{if(oe||We||Te||T.has(`${H}:from`)||T.has(`${H}:to`))return null;const Tt=ht=>Math.min(ht.height/4,["db","store","data_store"].includes(ht.kind??"")?10:6),b=Math.max(K.y+Tt(K),at.y+Tt(at)),U=Math.min(K.y+K.height-Tt(K),at.y+at.height-Tt(at));if(b>U)return null;const it=Math.max(b,Math.min(U,(K.y+K.height/2+at.y+at.height/2)/2)),ft={x:It==="right"?K.x+K.width:K.x,y:it},dt={x:Yt==="left"?at.x:at.x+at.width,y:it},_t=Math.min(ft.x,dt.x),R=Math.max(ft.x,dt.x),j=new Set([n.get(K.id),n.get(at.id)].filter(ht=>ht!==void 0)),ot=t.some(ht=>ht.id!==K.id&&ht.id!==at.id&&ht.x<R&&ht.x+ht.width>_t&&it>ht.y-u&&it<ht.y+ht.height+u),nt=(i??[]).some(ht=>!j.has(ht.id)&&ht.x<R&&ht.x+ht.width>_t&&it>ht.y-f&&it<ht.y+ht.height+f),mt=V.label?Jr(V.label).width:0,St=R-_t>=mt+p*2;return ot||nt||!St?null:{source:ft,target:dt}})();if(K.id===at.id){const Tt={x:K.x+K.width,y:K.y+K.height/2},b={x:K.x+K.width/2,y:K.y+K.height},U=Tt.x+h+c+80,it=b.y+h+c;Rt[0]=Tt,Rt.push({x:U,y:Tt.y},{x:U,y:it},{x:b.x,y:it}),Nt=b}else if(t.length<=6&&V.dashed&&e.some(Tt=>Tt.id!==V.id&&Tt.from===V.from&&Tt.to===V.to)){const Tt={x:K.x+K.width,y:K.y+K.height/2},b={x:at.x+at.width,y:at.y+at.height/2},U=Math.max(Tt.x,b.x)+h+c;Rt[0]=Tt,Rt.push({x:U,y:Tt.y},{x:U,y:b.y}),Nt=b}else if(Wt){const Tt=E.get(V.id)??0;if(l){const b=q.get(V.id),U=B.get(`${H}:from`)??{x:K.x,y:K.y+K.height/2},it=B.get(`${H}:to`)??{x:at.x,y:at.y+at.height/2};Rt[0]=U,Rt.push({x:b,y:U.y},{x:b,y:it.y}),Nt=it}else{const b=x+h+(Tt+1)*c,U=d+Tt*c,it=It==="right"?Et.x+U:Et.x-U,ft=Yt==="left"?Nt.x-U:Nt.x+U;Rt.push({x:it,y:Et.y}),Rt.push({x:it,y:b}),Rt.push({x:ft,y:b}),Rt.push({x:ft,y:Nt.y})}}else if(l&&oe&&We&&n.has(K.id)&&n.has(at.id)&&n.get(K.id)!==n.get(at.id)){const Tt=V.label?yh(V.label):0,b=new Set([n.get(K.id),n.get(at.id)].filter(nt=>nt!==void 0)),U=(i??[]).filter(nt=>b.has(nt.id)),it=Math.max(K.x+K.width,at.x+at.width,...U.map(nt=>nt.x+nt.width)),ft=Math.min(K.y,at.y),dt=Math.max(K.y+K.height,at.y+at.height),_t=(i??[]).some(nt=>!b.has(nt.id)&&nt.x>=it&&nt.y<dt&&nt.y+nt.height>ft),R=K.x+K.width/2,j=at.x+at.width/2;if((i?.length??0)>=3&&Math.abs(R-j)<12&&!D(Y)&&!_t){const nt=Ut(K,It),mt=Ut(at,Yt);if(Rt[0]=nt,Math.abs(nt.x-mt.x)>=.5){const St=(nt.y+mt.y)/2;Rt.push({x:nt.x,y:St},{x:mt.x,y:St})}Nt=mt}else if(_t){const nt={x:K.x,y:K.y+K.height/2},mt={x:at.x,y:at.y+at.height/2},ht=Math.min(nt.x,mt.x,...U.map(Lt=>Lt.x))-h-Tt/2-p;Rt[0]=nt,Rt.push({x:ht,y:nt.y},{x:ht,y:mt.y}),Nt=mt}else{const nt={x:K.x+K.width,y:K.y+K.height/2},mt={x:at.x+at.width,y:at.y+at.height/2},St=Math.max(y+h+d,nt.x+d,mt.x+d);Rt[0]=nt,Rt.push({x:St,y:nt.y},{x:St,y:mt.y}),Nt=mt}}else if(l&&oe&&We&&(D(Y)||Z(Y))){const Tt=V.label?yh(V.label):0,b={x:K.x+K.width,y:K.y+K.height/2},U={x:at.x+at.width,y:at.y+at.height/2},it=Math.max(y+h+Tt/2+c,b.x+Math.max(Tt+Wn,d),U.x+Math.max(Tt+Wn,d));Rt[0]=b,Rt.push({x:it,y:b.y},{x:it,y:U.y}),Nt=U}else if(oe&&We){const Tt=K.x+K.width/2,b=at.x+at.width/2,U=Math.abs(Et.x-Nt.x)<1;if(Math.abs(Tt-b)<5&&!Te&&U){const it=(Tt+b)/2;Rt[0]={x:it,y:Et.y},Nt={x:it,y:Nt.y}}else if(Math.abs(Tt-b)<5&&!Te){const it=(Tt+b)/2;Rt[0]={x:it,y:Et.y},Nt={x:it,y:Nt.y}}else if(Math.abs(Tt-b)<5){const it=Et.y<=Nt.y?1:-1,ft=(Tt+b)/2+it*Math.abs(Te??0);Rt[0]={x:ft,y:Et.y},Nt={x:ft,y:Nt.y}}else{const it=M.get(V.id)??(Et.y+Nt.y)/2,ft=It==="bottom"?Math.max(Et.y+d,it):Math.min(Et.y-d,it),dt=Yt==="top"?Math.min(Nt.y-d,it):Math.max(Nt.y+d,it);Math.abs(ft-it)>2&&Rt.push({x:Et.x,y:ft}),Rt.push({x:Et.x,y:it}),Rt.push({x:Nt.x,y:it}),Math.abs(dt-it)>2&&Rt.push({x:Nt.x,y:dt})}}else if(!oe&&!We&&Te){const Tt=Et.x<Nt.x,b=Tt?Math.max(K.y+K.height,at.y+at.height)+h+Math.abs(Te)/2+(V.dashed?28:0):Math.min(K.y,at.y)-h-Math.abs(Te)/2-(V.dashed?28:0);if(Tt){const U={x:K.x+K.width*.65,y:K.y+K.height},it={x:at.x+at.width*.35,y:at.y+at.height};Rt[0]=U,Rt.push({x:U.x,y:b},{x:it.x,y:b}),Nt=it}else{const U=Ut(K,It),it=Ut(at,Yt),ft=It==="right"?U.x+d:U.x-d,dt=Yt==="left"?it.x-d:it.x+d;Rt[0]=U,Rt.push({x:ft,y:U.y},{x:ft,y:b},{x:dt,y:b},{x:dt,y:it.y}),Nt=it}}else if(me)Rt[0]=me.source,Nt=me.target;else if(!oe&&!We){const Tt=$.get(V.id)??(Et.x+Nt.x)/2,b=It==="right"?Math.max(Et.x+d,Tt):Math.min(Et.x-d,Tt),U=Yt==="left"?Math.min(Nt.x-d,Tt):Math.max(Nt.x+d,Tt);Math.abs(b-Tt)>2&&Rt.push({x:b,y:Et.y}),Rt.push({x:Tt,y:Et.y}),Rt.push({x:Tt,y:Nt.y}),Math.abs(U-Tt)>2&&Rt.push({x:U,y:Nt.y})}else if(oe){const Tt=It==="bottom"?Et.y+d:Et.y-d;Math.abs(Tt-Nt.y)>5?(Rt.push({x:Et.x,y:Tt}),Rt.push({x:Nt.x,y:Tt})):Rt.push({x:Et.x,y:Nt.y})}else{const Tt=It==="right"?Et.x+d:Et.x-d;Math.abs(Tt-Nt.x)>5?(Rt.push({x:Tt,y:Et.y}),Rt.push({x:Tt,y:Nt.y})):Rt.push({x:Nt.x,y:Et.y})}Rt.push(Nt);const Ce=tt(Y,Rt);return{...V,path:ys(Ce),points:Ce}}),ct=C.map((Y,H)=>({info:Y,route:J[H]})).toSorted((Y,H)=>+(Y.info.fromNode.x<Y.info.toNode.x)-+(H.info.fromNode.x<H.info.toNode.x)||Y.info.fromNode.x-H.info.fromNode.x||Y.info.fromNode.y-H.info.fromNode.y||Y.info.toNode.x-H.info.toNode.x||Y.info.toNode.y-H.info.toNode.y);for(const{info:Y,route:H}of ct){const{fromNode:V,toNode:K,fromSide:at,toSide:It}=Y;if(l||!["left","right"].includes(at)||!["left","right"].includes(It)||(z.get(H.id)?.count??1)>1||!H.points||H.points.length<=2)continue;const Yt=V.x<K.x,Wt=Yt?V.x+V.width:V.x,Ut=Yt?K.x:K.x+K.width;if((Ut-Wt)*(Yt?1:-1)<=0)continue;const Et=H.label?Jr(H.label):void 0,Nt=new Set([n.get(V.id),n.get(K.id)]),Te=[...t.map(ot=>({node:ot,clearance:ot.id===V.id||ot.id===K.id?0:u})),...(i??[]).filter(ot=>!Nt.has(ot.id)).map(ot=>({node:ot,clearance:f}))].map(({node:ot,clearance:nt})=>({left:ot.x-nt,right:ot.x+ot.width+nt,top:ot.y-nt,bottom:ot.y+ot.height+nt}));Te.push(...(i??[]).map(dd));const Rt=[...t.map(ot=>({left:ot.x,right:ot.x+ot.width,top:ot.y,bottom:ot.y+ot.height})),...Te.slice(t.length)],oe=[...k,...J].filter(ot=>ot!==H).flatMap(ot=>{const nt=ot.label?Jr(ot.label):void 0,mt=(ot.points??[]).slice(1).map((ht,Lt)=>({start:ot.points[Lt],end:ht})),St=nt&&mt.some(({start:ht,end:Lt})=>{if(ht.y!==Lt.y||Math.abs(Lt.x-ht.x)<nt.width+16||mt.some(jt=>Math.abs(jt.end.y-jt.start.y)>Math.abs(Lt.x-ht.x)))return!1;const Ht=(ht.x+Lt.x)/2,Xt={left:Ht-nt.width/2-8,right:Ht+nt.width/2+8,top:ht.y-nt.height/2-8,bottom:ht.y+nt.height/2+8};return!Rt.some(jt=>Xt.left<jt.right&&Xt.right>jt.left&&Xt.top<jt.bottom&&Xt.bottom>jt.top)&&![...k,...J].some(jt=>jt!==ot&&jt!==H&&W(jt.points??[],[Xt]))});return mt.map(({start:ht,end:Lt})=>{const Ht=Math.abs(ht.y-Lt.y)<.001,Xt=nt&&(Ht||!St)&&Math.hypot(Lt.x-ht.x,Lt.y-ht.y)>=(Ht?nt.width:nt.height)+16,jt=Math.max(c,Xt&&!Ht?nt.width/2+2:0),Le=Math.max(c,Xt&&Ht?nt.height/2+2:0);return{left:Math.min(ht.x,Lt.x)-jt,right:Math.max(ht.x,Lt.x)+jt,top:Math.min(ht.y,Lt.y)-Le,bottom:Math.max(ht.y,Lt.y)+Le}})}),We=[...Te,...oe],me=[...Rt,...oe],Ce=[],Tt=ot=>Math.min(ot.height/4,["db","store","data_store"].includes(ot.kind??"")?10:6),b=Math.max(V.y+Tt(V),K.y+Tt(K)),U=Math.min(V.y+V.height-Tt(V),K.y+K.height-Tt(K));if(b<=U)for(const ot of[(b+U)/2,b,U])Ce.push([{x:Wt,y:ot},{x:Ut,y:ot}]);const it=ot=>[ot.y+ot.height/2,ot.y+Tt(ot),ot.y+ot.height-Tt(ot)],ft=Yt?1:-1;if(Math.abs(Ut-Wt)>=c*2){const ot=[(Wt+Ut)/2,Wt+ft*d,Ut-ft*d,Wt+ft*c,Ut-ft*c].filter(nt=>(nt-Wt)*ft>=c&&(Ut-nt)*ft>=c);for(const nt of it(V))for(const mt of it(K))for(const St of ot)Ce.push([{x:Wt,y:nt},{x:St,y:nt},{x:St,y:mt},{x:Ut,y:mt}])}for(const ot of[!1,!0]){const nt={x:V.x+V.width/2,y:V.y+(ot?V.height:0)},mt={x:K.x+K.width/2,y:K.y+(ot?K.height:0)},St=Math.max(d,(Et?.height??0)/2+p),ht=ot?Math.max(nt.y,mt.y)+St:Math.min(nt.y,mt.y)-St;Ce.push([nt,{x:nt.x,y:ht},{x:mt.x,y:ht},mt])}const dt=(ot,nt=!1)=>{if(!Et)return!0;const mt=CC(ot);return(nt?mt.filter(({horizontal:ht})=>ht).toSorted((ht,Lt)=>Math.abs(Lt.end.x-Lt.start.x)-Math.abs(ht.end.x-ht.start.x)).slice(0,1):mt).some(({start:ht,end:Lt})=>{const Ht=ht.y===Lt.y?Et.width:Et.height;return Math.hypot(Lt.x-ht.x,Lt.y-ht.y)<Ht+16?!1:(nt?[.5]:[.5,.25,.75]).some(Xt=>{const jt=ht.x+(Lt.x-ht.x)*Xt,Le=ht.y+(Lt.y-ht.y)*Xt;return!me.some(tr=>jt-Et.width/2-8<tr.right&&jt+Et.width/2+8>tr.left&&Le-Et.height/2-8<tr.bottom&&Le+Et.height/2+8>tr.top)})})},_t=W(H.points,Te),R=dt(H.points,!0),j=Ce.map(Ua).map(ot=>({points:ot,centeredLabel:dt(ot,!0)})).filter(({points:ot,centeredLabel:nt})=>(_t||ot.length<H.points.length||ot.length===H.points.length&&(nt&&!R||nt===R&&et(ot)<et(H.points)))&&!W(ot,We)&&dt(ot)).toSorted((ot,nt)=>ot.points.length-nt.points.length||Number(nt.centeredLabel)-Number(ot.centeredLabel)||et(ot.points)-et(nt.points))[0]?.points;j&&(H.points=j,H.path=ys(j))}return[...k,...J];function yt(Y){const H=new Map,V=at=>{const It=`${at.node.id}:${at.side}`;H.set(It,[...H.get(It)??[],at])};for(const at of Y){const It=at.fromSide==="top"||at.fromSide==="bottom",Yt=at.toSide==="top"||at.toSide==="bottom";V({key:`${at.index}:from`,node:at.fromNode,side:at.fromSide,desired:It?at.toNode.x+at.toNode.width/2:at.toNode.y+at.toNode.height/2,role:"from",edgeId:at.edge.id}),V({key:`${at.index}:to`,node:at.toNode,side:at.toSide,desired:Yt?at.fromNode.x+at.fromNode.width/2:at.fromNode.y+at.fromNode.height/2,role:"to",edgeId:at.edge.id})}const K=new Map;for(const at of H.values()){const It=new Set(at.map(({role:U})=>U)),Yt=new Set(at.map(U=>{const it=Y.find(ft=>ft.index===Number(U.key.split(":")[0]));return U.role==="from"?it?.toNode.id:it?.fromNode.id}));if(!(at.length>=2&&(It.size>1||Yt.size>1)))continue;const Ut=at.toSorted((U,it)=>U.desired-it.desired||U.role.localeCompare(it.role)||U.edgeId.localeCompare(it.edgeId)||U.key.localeCompare(it.key)),{node:Et,side:Nt}=Ut[0],Te=Nt==="top"||Nt==="bottom",Rt=Te?Et.width:Et.height,oe=Te?Et.x+Et.width/2:Et.y+Et.height/2,We=Math.max(0,Rt-Math.min(32,Rt*.4)),me=Ut.map(U=>{const it=Y.find(dt=>dt.edge.id===U.edgeId)?.edge,ft=it?.label?Jr(it.label):void 0;return ft?Te?ft.width:ft.height:0}),Ce=It.size===1?Math.max(zo,...me.slice(1).map((U,it)=>(U+me[it])/2+p)):zo,Tt=Ut.length>1?Math.min(Ce,We/(Ut.length-1)):0,b=oe-Tt*(Ut.length-1)/2;Ut.forEach((U,it)=>{const ft=b+it*Tt;K.set(U.key,Te?{x:ft,y:Nt==="top"?Et.y:Et.y+Et.height}:{x:Nt==="left"?Et.x:Et.x+Et.width,y:ft})})}return K}}function P8(e,t,r){const i=new Map(t.map((u,f)=>[u.id,{node:u,index:f}])),o=new Map,n=[],a=(r??[]).map(dd),s=Math.max(...t.map(u=>u.x+u.width)),l=(e.length>=t.length*1.5?24:32)+Yo,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?Jr(u.label,ms(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))||a.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(zo,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?Jr(u.label,ms(u.label)):null,v=c(u);let T;if(u.from===u.to){const A=u.label?64:28,_={x:g.x+g.width/2,y:g.y},M={x:g.x+g.width,y:g.y+g.height/2},$=s+A,P=g.y-32-C*26;T=[_,{x:_.x,y:P},{x:$,y:P},{x:$,y:M.y},M]}else if(x===m+1&&!v)T=[{x:g.x+g.width/2,y:g.y+g.height},{x:y.x+y.width/2,y:y.y}];else{const A=x>m,_={x:A?g.x+g.width:g.x,y:d(g,u,A)},M={x:A?y.x+y.width:y.x,y:d(y,u,A)},$=Math.max(l,(k?.width??0)/2+10),P=Math.min(_.y,M.y),N=Math.max(_.y,M.y),F=t.filter(D=>D.id!==g.id&&D.id!==y.id&&D.y<N&&D.y+D.height>P),E=Math.max(g.x+g.width+l,y.x+y.width+l,...F.map(D=>D.x+D.width+(k?.width??0)/2+10),...a.filter(D=>D.top<N&&D.bottom>P).map(D=>D.right+$)),B=Math.min(g.x,y.x,...F.map(D=>D.x),...a.filter(D=>D.top<N&&D.bottom>P).map(D=>D.left))-$,q=(k?.width??0)/2,z=n.filter(D=>D.downward===A&&D.top<N&&D.bottom>P);let I=A?Math.max(E,...z.map(D=>D.x+D.halfWidth+q+Yo)):Math.min(B,...z.map(D=>D.x-D.halfWidth-q-Yo));if(!A){const D=n.filter(G=>!G.downward&&(G.from===u.to||G.to===u.from)).toSorted((G,W)=>W.x-G.x),Z=G=>{if(z.length||Math.min(_.x,M.x)-G<zo+Yo||N-P<(k?.height??0)+zo)return!1;const W=(H,V)=>({left:Math.min(H.x,V.x),right:Math.max(H.x,V.x),top:Math.min(H.y,V.y),bottom:Math.max(H.y,V.y)}),Q=(H,V,K)=>H.left<V.right+K&&H.right>V.left-K&&H.top<V.bottom+K&&H.bottom>V.top-K,et=(H,V,K)=>[W(V,{x:H,y:V.y}),W({x:H,y:V.y},{x:H,y:K.y}),W({x:H,y:K.y},K)],tt=t.map(H=>({...W(H,{x:H.x+H.width,y:H.y+H.height}),id:H.id})),J=(r??[]).map(H=>W(H,{x:H.x+H.width,y:H.y+H.height})),ct=et(G,_,M),yt=[...tt.filter(H=>H.id!==g.id&&H.id!==y.id),...J,...a];if(ct.some(H=>yt.some(V=>Q(H,V,10))))return!1;const Y={left:G-q,right:G+q,top:(P+N-(k?.height??0))/2,bottom:(P+N+(k?.height??0))/2};return[...tt,...J,...a].some(H=>Q(Y,H,8))||Y.right+10>Math.min(...t.map(H=>H.x+H.width/2))?!1:n.every(H=>{const V=et(H.x,H.start,H.end),K={left:H.x-H.halfWidth,right:H.x+H.halfWidth,top:(H.top+H.bottom)/2-H.halfHeight,bottom:(H.top+H.bottom)/2+H.halfHeight};return ct.every(at=>V.every(It=>!Q(at,It,10)))&&(!k||V.every(at=>!Q(Y,at,10)))&&(!H.halfWidth||ct.every(at=>!Q(K,at,10)))&&(!k||!H.halfWidth||!Q(Y,K,6))})};for(const G of D)if(Math.abs(I-G.x)<zo){const W=G.x+zo;I=Z(W)?W:G.x-zo}}n.push({x:I,top:P,bottom:N,halfWidth:q,downward:A,from:u.from,to:u.to,start:_,end:M,halfHeight:(k?.height??0)/2}),T=[_,{x:_.x+(A?l:-l),y:_.y},{x:I,y:_.y},{x:I,y:M.y},{x:M.x+(A?l:-l),y:M.y},M]}const L=Ua(T);return[{...u,path:O8(L),points:L}]})}function O8(e,t=Yo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];let i=e[0],o=!1;const n=a=>{o?Math.abs(a.y-i.y)<.001?r.push(`H ${a.x}`):r.push(`V ${a.y}`):(r.push(`L ${a.x} ${a.y}`),o=!0),i=a};for(let a=1;a<e.length-1;a+=1){const s=e[a-1],l=e[a],c=e[a+1],h=Math.hypot(l.x-s.x,l.y-s.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-s.x)/h*u,y:l.y-(l.y-s.y)/h*u},p={x:l.x+(c.x-l.x)/d*u,y:l.y+(c.y-l.y)/d*u};n(f),r.push(`Q ${l.x} ${l.y} ${p.x} ${p.y}`),i=p}return n(e[e.length-1]),r.join(" ")}function Ua(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 n=t[t.length-2],a=t[t.length-1];if(!(r(n.x,a.x)&&r(a.x,i.x)||r(n.y,a.y)&&r(a.y,i.y)))break;t.pop()}t.push(i)}}return t}function I8(e,t,r){const i=e.x+e.width/2,o=e.y+e.height/2,n=t.x+t.width/2,a=t.y+t.height/2,s=n-i,l=a-o;return r?e.y+e.height<=t.y?{fromSide:"bottom",toSide:"top"}:t.y+t.height<=e.y?{fromSide:"top",toSide:"bottom"}:s>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:Math.abs(s)>10?s>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:l>0?{fromSide:"bottom",toSide:"top"}:{fromSide:"top",toSide:"bottom"}}function vC(e,t=0){const r=e.y,i=Math.max(Math.min(e.width,e.height)*.4,28),o=t*12,n=r-i-o,a=e.x+e.width+i+o,s={x:e.x+e.width/2,y:r},l={x:e.x+e.width,y:e.y+e.height/2},c=[s,{x:s.x,y:n},{x:a,y:n},{x:a,y:l.y},l];return{path:ys(c),points:c}}function R8(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 n=o.map(g=>r.get(g)).filter(Boolean);if(n.length===0)return{...i,x:0,y:0,width:0,height:0};const a=Math.min(...n.map(g=>g.x)),s=Math.min(...n.map(g=>g.y)),l=Math.max(...n.map(g=>g.x+g.width)),c=Math.max(...n.map(g=>g.y+g.height)),h=30,d=un.headerHeight,u=30,f=Math.max(l-a+h*2,Vu(i.label)),p=(a+l-f)/2;return{...i,x:p,y:s-d,width:f,height:c-s+d+u}})}function D8(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(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),a=Math.max(...e.map(s=>s.y+s.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(s=>s.x)),o=Math.min(o,...t.map(s=>s.y)),n=Math.max(n,...t.map(s=>s.x+s.width)),a=Math.max(a,...t.map(s=>s.y+s.height))),r&&r.length>0){for(const s of r)if(s.points)for(const l of s.points)i=Math.min(i,l.x),o=Math.min(o,l.y),n=Math.max(n,l.x),a=Math.max(a,l.y)}return{minX:i,minY:o,maxX:n,maxY:a,width:n-i,height:a-o}}var N8=new Set(["$$slots","$$events","$$legacy","children"]),q8=ii('<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>'),z8=ii('<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),W8=ii('<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>'),H8=ii('<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>'),Y8=ii('<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>'),X8=ii('<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>'),j8=ii('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');function _C(e,t){if(new.target)return To({component:_C,...e});Lo(t,!0);const r=r2();let i=Ne(t,"children",7),o=jC(t,N8),n=Pt(()=>t.weight??r.weight??"regular"),a=Pt(()=>t.color??r.color??"currentColor"),s=Pt(()=>t.size??r.size??"1em"),l=Pt(()=>t.mirrored??r.mirrored??!1);function c(T){let{weight:L,color:A,size:_,mirrored:M,...$}=T;return $}var h={get children(){return i()},set children(T){i(T),_e()},$set:Mo,$on:(T,L)=>Bo(t,T,L)},d=j8();gm(d,(T,L)=>({xmlns:"http://www.w3.org/2000/svg",role:"img",width:S(s),height:S(s),fill:S(a),transform:S(l)?"scale(-1, 1)":void 0,viewBox:"0 0 256 256",...T,...L}),[()=>c(r),()=>c(o)]);var u=Re(d);{var f=T=>{var L=Xo(),A=ti(L);Zs(A,i),ue(T,L)};fr(u,T=>{i()&&T(f)})}var p=De(u,2);{var g=T=>{var L=q8();ue(T,L)},m=T=>{var L=z8();Va(),ue(T,L)},y=T=>{var L=W8();ue(T,L)},x=T=>{var L=H8();ue(T,L)},C=T=>{var L=Y8();ue(T,L)},k=T=>{var L=X8();ue(T,L)},v=T=>{var L=Vs();L.nodeValue=(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),""),ue(T,L)};fr(p,T=>{S(n)==="bold"?T(g):S(n)==="duotone"?T(m,1):S(n)==="fill"?T(y,2):S(n)==="light"?T(x,3):S(n)==="regular"?T(C,4):S(n)==="thin"?T(k,5):T(v,-1)})}return Fe(d),ue(e,d),Ao(h)}const Fr=(e,t)=>({name:e,component:t}),ud=Fr("cube",i2),G8={actor:Fr("user",y2),data:Fr("database",sf),data_store:Fr("hard-drive",m2),db:Fr("database",sf),decision:Fr("code-branch",af),end:Fr("stop",p2),event:Fr("clock",g2),external:Fr("globe",_C),file:Fr("file-lines",f2),interface:Fr("plug",u2),milestone:Fr("flag",d2),module:ud,node:ud,package:Fr("box",h2),process:Fr("gear",c2),queue:Fr("message",l2),router:Fr("code-branch",af),server:Fr("server",nf),service:Fr("server",nf),start:Fr("play",s2),state:Fr("circle",a2),switch:Fr("right-left",n2),ui_component:Fr("desktop",o2)};function U8(e){return e&&G8[e]||ud}var hm=er("<wbr/>"),V8=er('<span class="semantic-filename-unit svelte-u4m0nr"> </span><!>',1),Z8=er("<br/>"),K8=er(" <!>",1),Q8=er('<div class="node-kind-label svelte-u4m0nr"> </div>'),J8=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 TC(e,t){if(new.target)return To({component:TC,...e});Lo(t,!0);let r=Ne(t,"node",7),i=Ne(t,"editable",7,!1),o=Ne(t,"dimmed",7,!1),n=Ne(t,"highlighted",7,!1),a=Ne(t,"styleConfig",7,Ii),s=Ne(t,"onMove",7),l=Ne(t,"onHover",7),c=Ne(t,"onBindingClick",7),h=ce(!1),d=ce(0),u=ce(0),f=ce(void 0);function p(I,D){const Z=S(f)?.closest("svg");if(Z){const G=Z.getScreenCTM();if(G){const W=G.inverse();return{x:W.a*I+W.c*D+W.e,y:W.b*I+W.d*D+W.f}}}return{x:I,y:D}}function g(I){if(!i())return;gt(h,!0);const D=p(I.clientX,I.clientY);gt(d,D.x-r().x),gt(u,D.y-r().y)}function m(I){if(!S(h)||!i())return;const D=p(I.clientX,I.clientY),Z=D.x-S(d),G=D.y-S(u);s()?.(Z,G)}function y(){gt(h,!1)}function x(){return r().binding?r().binding:r().bindings&&r().bindings.length>0?r().bindings[0]:null}let C=Pt(()=>!!x()),k=Pt(()=>a()===Ii),v=Pt(()=>U8(r().kind)),T=Pt(()=>S(v).component),L=Pt(()=>S(k)?10:a().paddingX),A=Pt(()=>S(k)?7:a().paddingY),_=Pt(()=>S(k)?2:a().gap),M=Pt(()=>S(k)?11:a().kindFontSize),$=Pt(()=>["db","store","data_store"].includes(r().kind??"")),P=Pt(()=>Wu(r().label)),N=Pt(()=>{const I=x();if(I)return ze.diagram_node_openBinding_ariaLabel({label:r().label,type:I.type})});function F(I){const D=x();D&&c()&&c()(I,D)}let E=Pt(()=>{const I=["diagram-node-html"];return r().semanticStyle&&I.push(`node-${r().semanticStyle}`),r().kind&&I.push(`node-kind-${r().kind}`),S(C)&&I.push("node-clickable"),i()&&I.push("node-editable"),o()&&I.push("node-dimmed"),n()&&I.push("node-state-highlighted"),I.join(" ")});var B={get node(){return r()},set node(I){r(I),_e()},get editable(){return i()},set editable(I=!1){i(I),_e()},get dimmed(){return o()},set dimmed(I=!1){o(I),_e()},get highlighted(){return n()},set highlighted(I=!1){n(I),_e()},get styleConfig(){return a()},set styleConfig(I=Ii){a(I),_e()},get onMove(){return s()},set onMove(I){s(I),_e()},get onHover(){return l()},set onHover(I){l(I),_e()},get onBindingClick(){return c()},set onBindingClick(I){c(I),_e()},$set:Mo,$on:(I,D)=>Bo(t,I,D)},q=Xo();ul("mousemove",ef,m),ul("mouseup",ef,y);var z=ti(q);return T2(z,()=>S(C)?"button":"div",!1,(I,D)=>{Zi(I,Yt=>gt(f,Yt,!0),()=>S(f));var Z=()=>l()?.(r().id),G=()=>l()?.(null),W=()=>l()?.(r().id),Q=()=>l()?.(null);gm(I,()=>({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":n(),"data-dimmed":o(),"data-store-node":S($),"aria-label":S(N),style:`
|
|
331
|
-
--label-font-size: ${a().labelFontSize??""}px;
|
|
332
|
-
--label-line-height: ${a().labelLineHeight??""};
|
|
333
|
-
--kind-font-size: ${S(M)??""}px;
|
|
334
|
-
--kind-line-height: ${a().kindLineHeight??""};
|
|
335
|
-
--padding-x: ${S(L)??""}px;
|
|
336
|
-
--padding-y: ${S(A)??""}px;
|
|
337
|
-
--gap: ${S(_)??""}px;
|
|
338
|
-
`,onmousedown:g,onclick:F,onmouseenter:Z,onmouseleave:G,onfocus:W,onblur:Q}),void 0,void 0,void 0,"svelte-u4m0nr");var et=J8(),tt=Re(et),J=Re(tt),ct=Re(J);rn(ct,()=>S(T),(Yt,Wt)=>{Wt(Yt,{size:14,weight:"regular",get"data-icon"(){return S(v).name},"data-weight":"regular","aria-hidden":"true"})}),Fe(J);var yt=De(J,2),Y=Re(yt),H=Re(Y);{var V=Yt=>{var Wt=Xo(),Ut=ti(Wt);sn(Ut,17,()=>S(P),of,(Et,Nt,Te)=>{var Rt=V8(),oe=ti(Rt),We=vr(oe,!0),me=De(oe);{var Ce=Tt=>{var b=hm();ue(Tt,b)};fr(me,Tt=>{Te<S(P).length-1&&Tt(Ce)})}ar(()=>mr(We,S(Nt))),ue(Et,Rt)}),ue(Yt,Wt)},K=Yt=>{var Wt=Xo(),Ut=ti(Wt);sn(Ut,17,()=>pc(r().label),of,(Et,Nt)=>{Va();var Te=K8(),Rt=ti(Te,!0),oe=De(Rt);{var We=Ce=>{var Tt=Z8();ue(Ce,Tt)},me=Ce=>{var Tt=hm();ue(Ce,Tt)};fr(oe,Ce=>{S(Nt).hardBreak?Ce(We):S(Nt).breakAfter&&Ce(me,1)})}ar(()=>mr(Rt,S(Nt).text)),ue(Et,Te)}),ue(Yt,Wt)};fr(H,Yt=>{S(P)?Yt(V):Yt(K,-1)})}Fe(Y),KC(Y,(Yt,Wt)=>M2?.(Yt,Wt),()=>r().label);var at=De(Y,2);{var It=Yt=>{var Wt=Q8(),Ut=vr(Wt,!0);ar(()=>mr(Ut,r().kind)),ue(Yt,Wt)};fr(at,Yt=>{r().kind&&Yt(It)})}Fe(yt),Fe(tt),Fe(et),ue(D,et)}),ue(e,q),Ao(B)}var tI=ii('<circle class="edge-origin" r="1.5" aria-hidden="true"></circle>'),eI=ii('<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 MC(e,t){if(new.target)return To({component:MC,...e});Lo(t,!0);let r=Ne(t,"edge",7),i=Ne(t,"dimmed",7,!1),o=Ne(t,"highlighted",7,!1),n=Ne(t,"markerScope",7,""),a=Ne(t,"terminalGap",7,0),s=Ne(t,"motionDelay",7,0),l=Ne(t,"onmotionchange",7),c=ce(""),h=ce(1),d=[],u="",f,p="",g,m=Pt(()=>`edge-reveal-${n()}-${r().id}`),y=Pt(()=>{S(c);const W=[...r().points??[],...d],Q=Math.max(16,a()*3),et=W.map(H=>H.x),tt=W.map(H=>H.y),J=et.length>0?Math.min(...et):0,ct=tt.length>0?Math.min(...tt):0,yt=et.length>0?Math.max(...et):1,Y=tt.length>0?Math.max(...tt):1;return{x:J-Q,y:ct-Q,width:Math.max(1,yt-J)+Q*2,height:Math.max(1,Y-ct)+Q*2}});function x(W,Q){if(W.length<2||Q<=0)return W;const et=W.map(yt=>({...yt})),tt=et.at(-1),J=et.at(-2),ct=Math.hypot(tt.x-J.x,tt.y-J.y);return ct<=Q?W:(tt.x-=(tt.x-J.x)/ct*Q,tt.y-=(tt.y-J.y)/ct*Q,et)}function C(W){dl(()=>l()?.(r().id,W))}function k(W){return g?.ownerSVGElement?.querySelector(`[data-node-id="${CSS.escape(W)}"]`)}function v(W){if(!W)return null;const Q=getComputedStyle(W),et=(tt,J)=>{const ct=Number.parseFloat(Q.getPropertyValue(tt));return Number.isFinite(ct)?ct:J};return{x:et("x",W.x.baseVal.value),y:et("y",W.y.baseVal.value),width:et("width",W.width.baseVal.value),height:et("height",W.height.baseVal.value)}}function T(W,Q,et=0){if(!Q)return W;const tt=Q.x+Q.width/2,J=Q.y+Q.height/2,ct=Q.width/2,yt=Q.height/2,Y=W.x-tt,H=W.y-J;if(Math.hypot(Y,H)<.001)return W;const K=Math.abs(Y)<.001?1/0:ct/Math.abs(Y),at=Math.abs(H)<.001?1/0:yt/Math.abs(H);return K<=at?{x:tt+Math.sign(Y)*(ct+et),y:J+H*K}:{x:tt+Y*at,y:J+Math.sign(H)*(yt+et)}}function L(W,Q,et){const tt=1-et;return 3*tt*tt*et*W+3*tt*et*et*Q+et**3}function A(W){let Q=0,et=1,tt=W;for(let J=0;J<12;J+=1)L(.16,.3,tt)<W?Q=tt:et=tt,tt=(Q+et)/2;return L(1,1,tt)}function _(W,Q){if(W.length<2)return Array.from({length:Q},()=>W[0]??{x:0,y:0});const et=W.slice(1).map((J,ct)=>Math.hypot(J.x-W[ct].x,J.y-W[ct].y)),tt=et.reduce((J,ct)=>J+ct,0);return Array.from({length:Q},(J,ct)=>{let yt=tt*ct/(Q-1),Y=0;for(;Y<et.length-1&&yt>et[Y];)yt-=et[Y],Y+=1;const H=W[Y],V=W[Y+1],K=et[Y]?yt/et[Y]:0;return{x:H.x+(V.x-H.x)*K,y:H.y+(V.y-H.y)*K}})}bo(()=>{const W=x(r().points??[],a()),Q=a()>0?ys(W):r().path;if(Za()||u===Q&&f===r()||d.length<2||W.length<2){gt(c,Q,!0),d=W,u=Q,f=r(),p=r().id,gt(h,1),C(!1);return}const tt=_(d,24),J=_(W,24),ct=p===r().id,yt=d[0],Y=d[d.length-1],H=W[0],V=W[W.length-1],K=k(r().from),at=k(r().to),It=ct&&Math.abs(H.x-yt.x-(V.x-Y.x))<1&&Math.abs(H.y-yt.y-(V.y-Y.y))<1;u=Q,f=r(),p=r().id;let Yt=0,Wt;gt(h,0),C(!0);const Ut=Te=>{const oe=Math.max(0,Math.min(1,(Te-Et)/220)),We=A(oe),me=tt.map((Ce,Tt)=>({x:Ce.x+(J[Tt].x-Ce.x)*We,y:Ce.y+(J[Tt].y-Ce.y)*We}));It&&(me[0]=W[0],me[me.length-1]=W[W.length-1]),me[0]=T(me[0],v(K)),me[me.length-1]=T(me[me.length-1],v(at),a()),d=me,gt(h,oe,!0),gt(c,ys(me),!0),oe<1?Yt=requestAnimationFrame(Ut):(gt(c,Q,!0),d=W,gt(h,1),C(!1))};let Et;const Nt=()=>{Et=performance.now(),Yt=requestAnimationFrame(Ut)};return s()>0?Wt=window.setTimeout(Nt,s()):Nt(),()=>{Wt!==void 0&&window.clearTimeout(Wt),cancelAnimationFrame(Yt),C(!1)}});let M=Pt(()=>{const W=["diagram-edge"];return r().semanticStyle&&W.push(`edge-${r().semanticStyle}`),r().animated&&W.push("edge-animated"),r().dashed&&W.push("edge-dashed"),i()&&W.push("edge-dimmed"),o()&&W.push("edge-state-highlighted"),W.join(" ")});const $=new Set(["danger","success","warning","muted","inactive","highlighted","active"]);let P=Pt(()=>n()?`-${n()}`:""),N=Pt(()=>r().semanticStyle&&$.has(r().semanticStyle)?`url(#arrowhead-${r().semanticStyle}${S(P)})`:`url(#arrowhead${S(P)})`);var F={get edge(){return r()},set edge(W){r(W),_e()},get dimmed(){return i()},set dimmed(W=!1){i(W),_e()},get highlighted(){return o()},set highlighted(W=!1){o(W),_e()},get markerScope(){return n()},set markerScope(W=""){n(W),_e()},get terminalGap(){return a()},set terminalGap(W=0){a(W),_e()},get motionDelay(){return s()},set motionDelay(W=0){s(W),_e()},get onmotionchange(){return l()},set onmotionchange(W){l(W),_e()},$set:Mo,$on:(W,Q)=>Bo(t,W,Q)},E=eI(),B=Re(E),q=Re(B),z=vr(q);Fe(B);var I=De(B),D=Re(I),Z=De(D);{var G=W=>{var Q=tI();ar(()=>{de(Q,"cx",r().points[0].x),de(Q,"cy",r().points[0].y)}),ue(W,Q)};fr(Z,W=>{(r().animated||r().dashed)&&r().points?.[0]&&W(G)})}return Fe(I),Fe(E),Zi(E,W=>g=W,()=>g),ar(W=>{Qi(E,0,pm(S(M))),de(E,"data-edge-id",r().id),de(E,"data-edge-from",r().from),de(E,"data-edge-to",r().to),de(E,"data-edge-motion-progress",S(h)),de(q,"id",S(m)),de(q,"x",S(y).x),de(q,"y",S(y).y),de(q,"width",S(y).width),de(q,"height",S(y).height),de(z,"d",S(c)),de(z,"stroke-width",W),de(I,"mask",`url(#${S(m)})`),de(D,"d",S(c)),de(D,"marker-end",S(N))},[()=>Math.max(12,a()*3)]),ue(e,E),Ao(F)}var rI=ii('<g><rect class="group-bg"></rect><text text-anchor="middle" dominant-baseline="middle" class="group-label"> </text></g>');function BC(e,t){if(new.target)return To({component:BC,...e});Lo(t,!0);let r=Ne(t,"group",7),i=Ne(t,"dimmed",7,!1),o=Ne(t,"onHover",7),n=Pt(()=>{const f=["diagram-group"];return r().semanticStyle&&f.push(`group-${r().semanticStyle}`),i()&&f.push("group-dimmed"),f.join(" ")});function a(){o()?.(r().id)}function s(){o()?.(null)}var l={get group(){return r()},set group(f){r(f),_e()},get dimmed(){return i()},set dimmed(f=!1){i(f),_e()},get onHover(){return o()},set onHover(f){o(f),_e()},$set:Mo,$on:(f,p)=>Bo(t,f,p)},c=rI(),h=Re(c),d=De(h),u=vr(d,!0);return Fe(c),ar(()=>{Qi(c,0,pm(S(n))),de(c,"data-group-id",r().id),de(h,"x",r().x),de(h,"y",r().y),de(h,"width",r().width),de(h,"height",r().height),de(d,"x",r().x+r().width/2),de(d,"y",r().y+un.centerY),mr(u,r().label)}),ul("mouseenter",c,a),ul("mouseleave",c,s),ue(e,c),Ao(l)}var iI=er('<div class="narrative-title svelte-1v8paz2"> </div>'),oI=er('<div class="narrative-text svelte-1v8paz2"> </div>'),nI=er('<div class="narrative svelte-1v8paz2"><!> <!></div>'),aI=er('<div class="text-xs font-medium mb-0.5"> </div>'),sI=er('<div class="text-ui text-subtle leading-snug"> </div>'),lI=er('<div class="p-2.5"><!> <!></div>'),cI=er("<!> <!>",1),hI=er('<div class="navigation-buttons svelte-1v8paz2"><!> <!></div>'),dI=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 LC(e,t){if(new.target)return To({component:LC,...e});Lo(t,!0);let r=Ne(t,"states",7),i=Ne(t,"currentStateId",7),o=Ne(t,"onStateChange",7);function n(F){return F?typeof F=="string"?{text:F}:F:null}let a=Pt(()=>i()?r().findIndex(F=>F.id===i()):-1),s=Pt(()=>S(a)>=0?r()[S(a)]:null),l=ce(-1),c=Pt(()=>S(l)<S(a)?"left":"right"),h=ce(null),d=ce(null),u;function f(){gt(l,S(a),!0),S(a)>0&&o()(r()[S(a)-1].id)}function p(){gt(l,S(a),!0),S(a)<r().length-1&&o()(r()[S(a)+1].id)}function g(F){gt(l,S(a),!0),gt(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))}fm(()=>{u!==void 0&&cancelAnimationFrame(u)});var x={get states(){return r()},set states(F){r(F),_e()},get currentStateId(){return i()},set currentStateId(F){i(F),_e()},get onStateChange(){return o()},set onStateChange(F){o(F),_e()},$set:Mo,$on:(F,E)=>Bo(t,F,E)},C=dI(),k=Re(C),v=Re(k),T=Re(v);{var L=F=>{const E=Pt(()=>n(S(s).narrative));var B=Xo(),q=ti(B);ym(q,()=>S(a),z=>{var I=nI(),D=Re(I);{var Z=Q=>{var et=iI(),tt=vr(et,!0);ar(()=>mr(tt,S(E).title)),ue(Q,et)};fr(D,Q=>{S(E)?.title&&Q(Z)})}var G=De(D,2);{var W=Q=>{var et=oI(),tt=vr(et,!0);ar(()=>mr(tt,S(E).text)),ue(Q,et)};fr(G,Q=>{S(E)?.text&&Q(W)})}Fe(I),xo(1,I,()=>lf,()=>({axis:"x",distance:S(c)==="left"?8:-8,tier:"fast"})),xo(2,I,()=>lf,()=>({axis:"x",distance:S(c)==="left"?-8:8,tier:"fast"})),ue(z,I)}),ue(F,B)};fr(T,F=>{S(s)?.narrative&&F(L)})}Fe(v);var A=De(v,2),_=Re(A);sn(_,23,r,F=>F.id,(F,E,B)=>{const q=Pt(()=>n(S(E).narrative));var z=cI(),I=ti(z);{let G=Pt(()=>S(B)===S(a)?"active":""),W=Pt(()=>S(B)<S(a)?"completed":""),Q=Pt(()=>S(B)===S(a)?"step":void 0),et=Pt(()=>S(B)===S(a)?0:-1),tt=Pt(()=>ze.diagram_controls_state_ariaLabel({number:S(B)+1,title:S(q)?.title||ze.diagram_controls_stateNumber_label({number:S(B)+1})}));Hn(I,{variant:"ghost",size:"icon-compact",iconOnly:!0,get class(){return`stepper-dot ${S(G)??""} ${S(W)??""}`},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:()=>gt(h,S(B),!0),onmouseleave:()=>gt(h,null),get"aria-current"(){return S(Q)},get tabindex(){return S(et)},get"aria-label"(){return S(tt)}})}var D=De(I,2);{var Z=G=>{_2(G,{get anchor(){return`--segment-${S(B)??""}`},position:"top",class:"rounded-md !pointer-events-none",children:(W,Q)=>{var et=lI(),tt=Re(et);{var J=Y=>{var H=aI(),V=vr(H,!0);ar(()=>mr(V,S(q).title)),ue(Y,H)};fr(tt,Y=>{S(q).title&&Y(J)})}var ct=De(tt,2);{var yt=Y=>{var H=sI(),V=vr(H,!0);ar(()=>mr(V,S(q).text)),ue(Y,H)};fr(ct,Y=>{S(q).text&&Y(yt)})}Fe(et),ue(W,et)},$$slots:{default:!0}})};fr(D,G=>{S(h)===S(B)&&S(q)&&G(Z)})}ue(F,z)}),Fe(_);var M=De(_,2),$=vr(M),P=De(M,2);{var N=F=>{var E=hI(),B=Re(E);{let z=Pt(()=>S(a)<=0),I=Pt(()=>ze.diagram_controls_previousStep_ariaLabel());Hn(B,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:f,get disabled(){return S(z)},get"aria-label"(){return S(I)},children:(D,Z)=>{os(D,{get icon(){return x2},class:"text-ui"})},$$slots:{default:!0}})}var q=De(B,2);{let z=Pt(()=>S(a)>=r().length-1),I=Pt(()=>ze.diagram_controls_nextStep_ariaLabel());Hn(q,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:p,get disabled(){return S(z)},get"aria-label"(){return S(I)},children:(D,Z)=>{os(D,{get icon(){return b2},class:"text-ui"})},$$slots:{default:!0}})}Fe(E),ue(F,E)};fr(P,F=>{r().length>1&&F(N)})}return Fe(A),Zi(A,F=>gt(d,F),()=>S(d)),Fe(k),Fe(C),ar((F,E)=>{de(A,"aria-label",F),de(M,"aria-label",E),mr($,`${S(a)+1}/${r().length??""}`)},[()=>ze.diagram_controls_walkthrough_ariaLabel(),()=>ze.diagram_controls_stepCounter_ariaLabel({current:S(a)+1,total:r().length})]),ue(e,C),Ao(x)}function bh(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 dm(e){const t=e.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);return t?.every(Number.isFinite)?t:null}function uI(e,t){if(e===t)return!0;const r=dm(e),i=dm(t);return r!==null&&i!==null&&r.length===i.length&&r.every((o,n)=>Math.abs(o-i[n])<.001)}function fI(e,t){return uI(e,t)?[]:[{transform:e},{transform:t}]}function gI(e,t,r,i,o){const n=t.x-e.x,a=t.y-e.y,s=Math.hypot(n,a),l=Math.abs(n)>=Math.abs(a)?r.width:r.height;if(s<=l+2*o)return[];const c=(l/2+o)/s,h=1-c,d=[];for(const p of i){const g=p.padding??0,m=[[e.x,n,p.x-r.width/2-g,p.x+p.width+r.width/2+g],[e.y,a,p.y-r.height/2-g,p.y+p.height+r.height/2+g]];let y=c,x=h;for(const[C,k,v,T]of m)if(k===0)(C<v||C>T)&&(x=-1);else{const L=(v-C)/k,A=(T-C)/k;y=Math.max(y,Math.min(L,A)),x=Math.min(x,Math.max(L,A))}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 pI(e,t){return(e===null||typeof e!="object"&&typeof e!="function")&&Object.is(e,t)}function en(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)||pI(Reflect.get(e,o),Reflect.get(t,o))))}function Gs(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 mI(e,t){return e!==null&&en(e,t,["nodes","edges","groups","bounds"])&&en(e.bounds,t.bounds)&&Gs(e.nodes,t.nodes,(r,i)=>en(r,i,["size"])&&(r.size===void 0&&i.size===void 0||!!r.size&&!!i.size&&en(r.size,i.size)))&&Gs(e.edges,t.edges,(r,i)=>en(r,i,["points"])&&Gs(r.points,i.points,en))&&Gs(e.groups,t.groups,en)}var yI=er('<div class="diagram-actions svelte-10vg205" role="toolbar"><!></div>'),xI=er('<div class="diagram-feedback svelte-10vg205" role="alert"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),bI=er('<div class="diagram-feedback svelte-10vg205" role="status"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),CI=ii("<g><!></g>"),wI=ii('<g class="edge-reveal"><!></g>'),um=er('<div class="edge-label-html"><span class="edge-label-text"> </span></div>'),kI=ii("<foreignObject><!></foreignObject>"),SI=ii('<foreignObject class="diagram-geometry-motion svelte-10vg205"><!></foreignObject>'),vI=ii('<g class="diagram-geometry-motion svelte-10vg205"><!><!><!><!></g>'),_I=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>'),TI=er('<div class="diagram-footer svelte-10vg205"><!></div>'),MI=er("<div><!> <div><!></div> <!></div>");function BI(e,t){if(new.target)return To({component:BI,...e});Lo(t,!0);let r=Ne(t,"diagram",7),i=Ne(t,"onUpdate",7),o=Ne(t,"editable",7,!1),n=Ne(t,"styleConfig",7,Ii),a=Ne(t,"onBindingClick",7),s=Ne(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(st){return S(f)||Za(S(_)?.ownerDocument)?0:st}let x=ce(null),C=null,k=ce(!1),v=ce(!1),T=ce(1),L=ce(900),A=ce(900),_=ce(null),M=ce(null),$=ce(null),P=ce(void 0),N=ce(!1),F,E,B=ce(0);gd(()=>{let st=!1;return document.fonts?.ready.then(()=>{st||gt(B,S(B)+1)}),()=>{st=!0}});let q=ce(ui(r().currentStateId??(r().states&&r().states.length>0?r().states[0].id:void 0))),z=Pt(()=>r().states?.find(st=>st.id===S(q))??null),I=ce(ui(S(q))),D,Z=Pt(()=>r().states?.find(st=>st.id===S(I))??S(z)),G=Pt(()=>S(z)?.camera?.zoom??1),W=Pt(()=>S(z)!==null),Q=Pt(()=>S(M)!==null&&S(M)>0?S(M):S(_)?.clientWidth??null),et=Pt(()=>S(A)<500||S(W)&&(S($)??S(Q)??0)>0&&(S($)??S(Q)??0)<500),tt=Pt(()=>S(et)?4:l),J=Pt(()=>S(et)?{...n(),maxWidth:Math.min(n().maxWidth,150),maxLines:Math.max(n().maxLines,5),paddingX:Math.min(n().paddingX,10)}:n()),ct=Pt(()=>S(G)*(S(v)||S(W)?S(T):1)),yt=Pt(()=>Math.max(c/S(J).labelFontSize,h/(n()===Ii?11:S(J).kindFontSize))),Y=Pt(()=>(d+u)/S(ct)),H=Pt(()=>8/S(ct)),V=ce(!1),K=ce(ui([])),at=ce(ui([])),It=ce(ui([])),Yt=ce(ui([])),Wt=ce(ui([])),Ut=ce(ui([])),Et=ce(ui(new Map)),Nt=ce(ui([])),Te=ce(ui([])),Rt=ce(ui([])),oe=ce(ui(new Map)),We=ce(!1),me=ce(!1),Ce=ce(!0);const Tt=new Set;let b=ce(void 0),U=ce(!0),it=0,ft,dt=0,_t=ce("settled"),R=[];const j=180,ot="cubic-bezier(0.65, 0, 0.35, 1)",nt=220,mt=160,St=180,ht=180,Lt=60,Ht=ht-Lt;function Xt(){const st=S(b)?.querySelector(".diagram-svg-layer"),Ot=S(b)?.querySelector(".diagram-geometry-motion")?.getScreenCTM?.();return{camera:st?getComputedStyle(st).transform:null,screenMatrix:Ot?new DOMMatrix([Ot.a,Ot.b,Ot.c,Ot.d,Ot.e,Ot.f]):null}}function jt(st){if(y(1)===0||!S(b))return[];const Ct=S(b).querySelector(".diagram-svg-layer"),Ot=S(b).querySelector(".diagram-svg-layer > g");if(!Ct||!Ot||!st.camera)return[];for(const ie of Ct.getAnimations({subtree:!1}))ie.cancel();const Zt=getComputedStyle(Ct).transform;let Qt=st.camera;const Mt=st.screenMatrix?Ct.getScreenCTM():null;if(Mt&&st.screenMatrix){const ie=new DOMMatrix([Mt.a,Mt.b,Mt.c,Mt.d,Mt.e,Mt.f]),fe=new DOMMatrix(getComputedStyle(Ot).transform);Qt=new DOMMatrix(Zt).multiply(ie.inverse()).multiply(st.screenMatrix).multiply(fe.inverse()).toString()}const le=fI(Qt,Zt);if(le.length===0)return[];const te=Ct.animate(le,{duration:j,easing:ot});return te.finished.catch(()=>{}),[te]}function Le(st,{delay:Ct=0,duration:Ot}){return{delay:Ct,duration:y(Ot),easing:cf,css:Zt=>`--edge-reveal-progress: ${Zt};`}}function tr(){return S(b)?.getAnimations?S(b).getAnimations({subtree:!0}).filter(st=>{const Ct=Number(st.effect?.getComputedTiming().endTime);return Number.isFinite(Ct)&&st.playState!=="finished"&&st.playState!=="idle"}):[]}async function Po(st){if(await Ch(),await new Promise(Ot=>requestAnimationFrame(()=>Ot())),st!==dt)return!1;const Ct=tr();return await Promise.allSettled(Ct.map(Ot=>Ot.finished)),st===dt}async function co(st,Ct,Ot){if(Ot.length>0&&(await Promise.allSettled(Ot.map(Qt=>Qt.finished)),st!==dt)||S(Nt).length===0&&S(Dt).length>0&&(gt(_t,"scene"),gt(Ce,!0),_e(),!await Po(st))||(gt(_t,"exit"),gt(We,!1),gt(me,!1),gt(I,Ct,!0),_e(),!await Po(st)))return;const Zt=Xt();gt(Yt,[],!0),gt(Wt,[],!0),gt(Ut,[],!0),gt(Et,new Map,!0),gt(Nt,[],!0),gt(Te,[],!0),gt(Rt,[],!0),gt(oe,new Map,!0),gt(_t,"camera"),_e(),R=jt(Zt),await Po(st)&&(gt(_t,"scene"),gt(Ce,!0),_e())}function ho(){if(!S(b))return"";const st=S(b).getBoundingClientRect(),Ct=[".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(b).querySelectorAll(Ct)].map(Ot=>{const Zt=Ot.getBoundingClientRect(),Qt=getComputedStyle(Ot);return[Ot.tagName,Ot.getAttribute("data-node-id"),Ot.getAttribute("data-edge-id"),Ot.getAttribute("data-group-id"),Ot.getAttribute("class"),Ot.getAttribute("d"),(Zt.x-st.x).toFixed(3),(Zt.y-st.y).toFixed(3),Zt.width.toFixed(3),Zt.height.toFixed(3),Qt.opacity,Qt.transform].join("|")}).join(`
|
|
339
|
-
`)}function _a(st,Ct){ft=requestAnimationFrame(()=>{if(st!==it)return;E?.();const Ot=ho(),Zt=S(_t)==="camera"||S(_t)==="exit"||Tt.size>0||tr().length>0;if(!Zt&&Ct!==void 0&&Ot===Ct){if(S(V)){gt(V,!1),ft=void 0,Ch().then(()=>{st===it&&_a(st)});return}gt(U,!0),gt(_t,"settled"),oi(),ft=void 0;return}_a(st,Zt?void 0:Ot)})}function Ta(){it+=1;const st=it;ft!==void 0&&cancelAnimationFrame(ft),ft=void 0,y(1)===0&>(V,!1),gt(U,!1),queueMicrotask(()=>{st===it&&_a(st)})}fm(()=>{oi(),dt+=1,it+=1,ft!==void 0&&cancelAnimationFrame(ft),g!==void 0&&cancelAnimationFrame(g),Ko();for(const st of R)st.cancel();R=[],Tt.clear()});let rt=ce(null),ut=ce(null),wt=Pt(()=>{if(!S(rt))return new Set;const st=new Set;return st.add(S(rt)),r().model.edges.forEach(Ct=>{Ct.from===S(rt)&&st.add(Ct.to),Ct.to===S(rt)&&st.add(Ct.from)}),st}),Bt=Pt(()=>{if(!S(rt))return new Set;const st=new Set;return r().model.edges.forEach(Ct=>{(Ct.from===S(rt)||Ct.to===S(rt))&&st.add(Ct.id)}),st}),kt=Pt(()=>{if(!S(ut))return new Set;const st=new Set;if(r().model.groups){const Ct=r().model.groups.find(Ot=>Ot.id===S(ut));Ct?.nodeIds&&Ct.nodeIds.forEach(Ot=>st.add(Ot))}return r().model.nodes.forEach(Ct=>{Ct.group===S(ut)&&st.add(Ct.id)}),st}),X=Pt(()=>{if(!S(ut))return new Set;const st=S(kt),Ct=new Set;return r().model.edges.forEach(Ot=>{(st.has(Ot.from)||st.has(Ot.to))&&Ct.add(Ot.id)}),Ct}),vt=Pt(()=>S(Z)?.highlightedNodes&&S(Z).highlightedNodes.length>0?new Set(S(Z).highlightedNodes):null),Ft=Pt(()=>S(Z)?.highlightedEdges&&S(Z).highlightedEdges.length>0?new Set(S(Z).highlightedEdges):null),qt=Pt(()=>S(vt)!==null||S(Ft)!==null),zt=Pt(()=>S(z)?.visibleNodes??r().model.nodes.map(st=>st.id)),Gt=Pt(()=>new Set(S(zt))),he=Pt(()=>S(z)?.visibleEdges??r().model.edges.map(st=>st.id)),ke=Pt(()=>S(he).filter(st=>{const Ct=r().model.edges.find(Ot=>Ot.id===st);return Ct&&S(Gt).has(Ct.from)&&S(Gt).has(Ct.to)})),Dt=Pt(()=>S(x)?.nodes.filter(st=>S(zt).includes(st.id))??[]),Ae=Pt(()=>S(x)?.edges.filter(st=>S(ke).includes(st.id))??[]),je=Pt(()=>{S(B);const st=new Map,Ct=[],Ot=(le,te,ie,fe,ye=0)=>S(Dt).some(pe=>!(le+ie+ye<pe.x||le-ye>pe.x+pe.width||te+fe+ye<pe.y||te-ye>pe.y+pe.height)),Zt=(le,te,ie,fe,ye=6)=>Ct.some(pe=>!(le+ie+ye<pe.x||le-ye>pe.x+pe.width||te+fe+ye<pe.y||te-ye>pe.y+pe.height)),Qt=(le,te,ie,fe)=>(S(x)?.groups??[]).some(ye=>le<ye.x+ye.width&&le+ie>ye.x&&te<ye.y+34&&te+fe>ye.y),Mt=(le,te,ie,fe,ye,pe=2)=>S(Ae).some(Er=>Er.id!==ye&&(Er.points??[]).slice(0,-1).some((yi,Oo)=>{const di=Er.points[Oo+1],Qr=Math.max(1,Math.ceil(Math.hypot(di.x-yi.x,di.y-yi.y)/4));for(let xi=0;xi<=Qr;xi+=1){const Io=yi.x+(di.x-yi.x)*xi/Qr,xr=yi.y+(di.y-yi.y)*xi/Qr;if(Io>le-pe&&Io<le+ie+pe&&xr>te-pe&&xr<te+fe+pe)return!0}return!1}));for(const le of S(Ae)){if(!le.label||!le.points||le.points.length<2)continue;const te=le.points,ie=te.length===2&&Math.abs(te[0].x-te[1].x)<.5?Math.abs(te[0].y-te[1].y):void 0,{width:fe,height:ye,lines:pe}=Jr(le.label,S(et)?ms(le.label??"",ie):void 0),Er=pe>3,yi=r().model.edges.find(({id:xr})=>xr===le.id),Oo=yi&&r().model.edges.find(xr=>xr.from===yi.to&&xr.to===yi.from);if(Oo&&te.length===2){const xr=Jr(Oo.label??"",S(et)?ms(Oo.label??""):void 0),Ue=Math.abs(te[1].x-te[0].x),lr=Math.abs(te[1].y-te[0].y),Lr=Math.max(Ue,lr),Je=Ue>=lr?(fe+xr.width)/2:(ye+xr.height)/2,Be=S(ke).includes(Oo.id)?Math.max(.05,Math.min(.35,(1-(Je+6)/Lr)/2)):.35,kr=Ue>=lr?fe:ye,Pr=Math.min(.5,(kr/2+4/S(ct))/Lr),dr=Math.max(Pr,Math.min(1-Pr,Be)),ur=te[0].x+(te[1].x-te[0].x)*dr-fe/2,Nr=te[0].y+(te[1].y-te[0].y)*dr-ye/2;if(!Ot(ur,Nr,fe,ye,8)&&!Qt(ur,Nr,fe,ye)&&!Mt(ur,Nr,fe,ye,le.id)&&!Zt(ur,Nr,fe,ye,1)){st.set(le.id,{x:ur,y:Nr,width:fe,height:ye,truncated:Er}),Ct.push({x:ur,y:Nr,width:fe,height:ye});continue}}const di=[],Qr=[],xi=[],Io=(xr,Ue,lr,Lr=di)=>{const Je=xr-fe/2,Be=Ue-ye/2;if(Ot(Je,Be,fe,ye,8)||Qt(Je,Be,fe,ye)||Mt(Je,Be,fe,ye,le.id))return;const kr={x:Je,y:Be,score:lr};if(Zt(Je,Be,fe,ye)){Zt(Je,Be,fe,ye,1)||Qr.push(kr);return}Lr.push(kr)};for(let xr=0;xr<te.length-1;xr++){const Ue=te[xr],lr=te[xr+1],Lr=Math.abs(lr.x-Ue.x),Je=Math.abs(lr.y-Ue.y),Be=Math.hypot(Lr,Je);if(Be<8)continue;const kr=Lr>=Je,Pr=kr?fe:ye,dr=[.5,.25,.75,.2,.3,.4,.6,.7,.8,.125,.875,.05,.1,.15,.85,.9,.95];for(const ur of dr){const Nr=Be*Math.min(ur,1-ur);if(Be*Math.max(ur,1-ur)<Pr/2+S(H))continue;const Ma=Ue.x+(lr.x-Ue.x)*ur,ni=Ue.y+(lr.y-Ue.y)*ur;Io(Ma,ni,Be+(kr?1e3:0)-Math.abs(ur-.5)*16,Nr>=Pr/2+S(H)?di:xi)}}if(!di.length&&!Qr.length&&!xi.length){const xr=[...S(Dt).map(Ue=>({...Ue,padding:8})),...(S(x)?.groups??[]).map(Ue=>({...Ue,height:34,padding:0})),...Ct.map(Ue=>({...Ue,padding:1})),...S(Ae).filter(Ue=>Ue.id!==le.id).flatMap(Ue=>(Ue.points??[]).slice(1).map((lr,Lr)=>{const Je=Ue.points[Lr];return{x:Math.min(Je.x,lr.x),y:Math.min(Je.y,lr.y),width:Math.abs(lr.x-Je.x),height:Math.abs(lr.y-Je.y),padding:2}}))];for(let Ue=1;Ue<te.length;Ue+=1){const lr=te[Ue-1],Lr=te[Ue],Je=Math.hypot(Lr.x-lr.x,Lr.y-lr.y),Be=Math.abs(Lr.x-lr.x)>=Math.abs(Lr.y-lr.y)?1e3:0;for(const kr of gI(lr,Lr,{width:fe,height:ye},xr,S(H)))Io(lr.x+(Lr.x-lr.x)*kr,lr.y+(Lr.y-lr.y)*kr,Je+Be-Math.abs(kr-.5)*16)}}if(di.length>0||Qr.length>0||xi.length>0){const xr=di.length>0?di:Qr.length>0?Qr:xi;xr.sort((lr,Lr)=>Lr.score-lr.score);const Ue=xr[0];st.set(le.id,{x:Ue.x,y:Ue.y,width:fe,height:ye,truncated:Er}),Ct.push({x:Ue.x,y:Ue.y,width:fe,height:ye})}else if(te.length>=2){const[xr,Ue]=te.slice(0,-1).map((kr,Pr)=>[kr,te[Pr+1]]).toSorted(([kr,Pr],[dr,ur])=>Math.hypot(ur.x-dr.x,ur.y-dr.y)-Math.hypot(Pr.x-kr.x,Pr.y-kr.y))[0],lr=(xr.x+Ue.x)/2,Lr=(xr.y+Ue.y)/2,Je=lr-fe/2,Be=Lr-ye/2;st.set(le.id,{x:Je,y:Be,width:fe,height:ye,truncated:Er}),Ct.push({x:Je,y:Be,width:fe,height:ye})}}return st}),Me=Pt(()=>{const st=new Set(S(K)),Ct=S(Ce)?S(Dt):S(Dt).filter(Mt=>!st.has(Mt.id)),Ot=new Map(S(Nt).map(Mt=>[Mt.id,Mt])),Zt=S(We)?Ct.map(Mt=>Ot.get(Mt.id)??Mt):Ct;if(!S(me))return Zt;const Qt=new Set(Zt.map(Mt=>Mt.id));return[...Zt,...S(Yt).filter(Mt=>!Qt.has(Mt.id))]}),se=Pt(()=>{const st=new Set(S(at)),Ct=S(Ce)?S($e):S($e).filter(Mt=>!st.has(Mt.id)),Ot=new Map(S(Te).map(Mt=>[Mt.id,Mt])),Zt=S(We)?Ct.map(Mt=>Ot.get(Mt.id)??Mt):Ct;if(!S(me))return Zt;const Qt=new Set(Zt.map(Mt=>Mt.id));return[...Zt,...S(Wt).filter(Mt=>!Qt.has(Mt.id))]}),$t=Pt(()=>{const st=new Set(S(It)),Ct=S(Ce)?S(Ae):S(Ae).filter(Mt=>!st.has(Mt.id)),Ot=new Map(S(Rt).map(Mt=>[Mt.id,Mt])),Zt=S(We)?Ct.map(Mt=>Ot.get(Mt.id)??Mt):Ct;if(!S(me))return Zt;const Qt=new Set(Zt.map(Mt=>Mt.id));return[...Zt,...S(Ut).filter(Mt=>!Qt.has(Mt.id))]}),Jt=Pt(()=>{const st=S(me)?new Map(S(Et)):new Map;for(const[Ct,Ot]of S(je))st.set(Ct,Ot);if(S(We))for(const[Ct,Ot]of S(oe))st.set(Ct,Ot);return st}),$e=Pt(()=>{if(!S(x)?.groups)return[];if(S(z)?.visibleGroups)return S(x).groups.filter(st=>S(z).visibleGroups.includes(st.id));if(S(z)?.highlightedNodes&&S(z).highlightedNodes.length>0){const st=new Set(S(z).highlightedNodes);return S(x).groups.filter(Ct=>Array.isArray(Ct.nodeIds)&&Ct.nodeIds.some(Ot=>st.has(Ot)))}return S(x).groups.filter(st=>Array.isArray(st.nodeIds)&&st.nodeIds.some(Ct=>S(zt).includes(Ct)))});bo(()=>{S(B);try{const st=S(z)?r().model.groups?.filter(Qt=>{if(S(z).visibleGroups)return S(z).visibleGroups.includes(Qt.id);const Mt=S(z).highlightedNodes?.length?S(z).highlightedNodes:S(zt);return Qt.nodeIds?.some(le=>Mt.includes(le)&&S(Gt).has(le))}).map(Qt=>({...Qt,nodeIds:Qt.nodeIds?.filter(Mt=>S(Gt).has(Mt))})):r().model.groups,Ct=new Set(st?.map(Qt=>Qt.id)),Ot=S(z)?{...r().model,nodes:r().model.nodes.filter(Qt=>S(Gt).has(Qt.id)).map(Qt=>Qt.group&&!Ct.has(Qt.group)?{...Qt,group:void 0}:Qt),edges:r().model.edges.filter(Qt=>S(ke).includes(Qt.id)),groups:st}:r().model,Zt=C8(Ot,S(z)?{...r().baseView,layout:{...r().baseView.layout,spacing:Math.min(r().baseView.layout.spacing??80,S(et)?40:56)}}:r().baseView,r().grammar,S(J),S(L));mI(C,Zt)||(C=Zt,gt(x,Zt,!0)),gt(k,!1),Ta()}catch{C=null,gt(x,null),gt(k,!0)}});let we=Pt(()=>S(z)?.camera?.pan??null),Ee=Pt(()=>S(z)?.camera?.focus??null),Ge=ce(!1);function Pe(){gt(V,!1),gt(_t,"scene"),gt(We,!1),gt(me,!1),gt(Ce,!0),gt(K,[],!0),gt(at,[],!0),gt(It,[],!0),gt(Yt,[],!0),gt(Wt,[],!0),gt(Ut,[],!0),gt(Et,new Map,!0),gt(Nt,[],!0),gt(Te,[],!0),gt(Rt,[],!0),gt(oe,new Map,!0),gt(I,S(q),!0)}VC(()=>{const st=r().id,Ct=r().states?.map(Zt=>Zt.id)??[],Ot=r().currentStateId;dl(()=>{if(D===void 0){D=st;return}const Zt=Mt=>Mt===void 0?Ct.length===0:Ct.includes(Mt);if(st===D&&Zt(S(q))&&Zt(S(I)))return;const Qt=st===D&&Zt(S(q));D=st,dt+=1;for(const Mt of R)Mt.cancel();R=[],Ko(),oi(),Tt.clear(),Qt||gt(q,Ct.find(Mt=>Mt===Ot)??Ct[0],!0),Pe(),gt(p,S(p)+1)})}),bo(()=>{if(!S(_))return;const st=S(_).closest(".node-diagram_block"),Ct=st??S(b)??S(_);let Ot=Ct.clientWidth;dl(()=>{gt($,st?.clientWidth??null,!0),gt(M,S(_).clientWidth,!0),zi()});const Zt=new ResizeObserver(()=>{if(S(W)&&S(M)!==null&&Math.abs(Ct.clientWidth-Ot)>.5){gt(f,!0),oi(),dt+=1;for(const Qt of R)Qt.cancel();R=[],Tt.clear(),Pe()}if(Ot=Ct.clientWidth,gt($,st?.clientWidth??null,!0),gt(M,S(_).clientWidth,!0),zi(),_e(),S(f)){gt(p,S(p)+1),_e();for(const Qt of tr())Qt.finish();g!==void 0&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{gt(f,!1),g=void 0})}});return Zt.observe(S(_)),Ct!==S(_)&&Zt.observe(Ct),()=>Zt.disconnect()});let Se=Pt(()=>{const st=S(we)?.x??0,Ct=S(we)?.y??0;if(S(W))return`scale(${S(ct)}) translate(calc(-50% + ${st/S(ct)}px), calc(-50% + ${Ct/S(ct)}px))`;const Ot=[];return S(we)&&Ot.push(`translate(${st}px, ${Ct}px)`),S(ct)!==1&&Ot.push(`scale(${S(ct)})`),Ot.length>0?Ot.join(" "):void 0});bo(()=>{if(!S(Ee)||!S(x)||!S(_))return;const st=S(x).nodes.find(ye=>ye.id===S(Ee));if(!st)return;const Ct=S(Xe)??S(x).bounds,Ot=st.x+st.width/2-(Ct.minX-S(tt)),Zt=st.y+st.height/2-(Ct.minY-S(tt)),Qt=Ot*S(G),Mt=Zt*S(G),le=S(_).clientWidth,te=S(_).clientHeight,ie=S(we)?.x??0,fe=S(we)?.y??0;S(_).scrollTo({left:Math.max(0,Qt+ie*S(G)-le/2),top:Math.max(0,Mt+fe*S(G)-te/2),behavior:y(1)===0?"auto":"smooth"})});function ge(st=!0){if(!S(x))return null;if(!S(z)){let{minX:ie,minY:fe,maxX:ye,maxY:pe}=S(x).bounds;for(const Er of S(je).values())ie=Math.min(ie,Er.x),fe=Math.min(fe,Er.y),ye=Math.max(ye,Er.x+Er.width),pe=Math.max(pe,Er.y+Er.height);return{minX:ie,minY:fe,maxX:ye,maxY:pe,width:ye-ie,height:pe-fe}}const Ct=st?[...S(Dt),...S(Yt),...S(Nt)]:S(Dt),Ot=st?[...S(Ae),...S(Ut),...S(Rt)]:S(Ae),Zt=st?[...S($e),...S(Wt),...S(Te)]:S($e);if(Ct.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let Qt=Math.min(...Ct.map(ie=>ie.x)),Mt=Math.min(...Ct.map(ie=>ie.y)),le=Math.max(...Ct.map(ie=>ie.x+ie.width)),te=Math.max(...Ct.map(ie=>ie.y+ie.height));for(const ie of Zt)Qt=Math.min(Qt,ie.x),Mt=Math.min(Mt,ie.y),le=Math.max(le,ie.x+ie.width),te=Math.max(te,ie.y+ie.height);for(const ie of Ot)if(ie.points)for(const fe of ie.points)Qt=Math.min(Qt,fe.x-4),Mt=Math.min(Mt,fe.y-4),le=Math.max(le,fe.x+4),te=Math.max(te,fe.y+4);for(const ie of[...S(je).values(),...st?S(Et).values():[],...st?S(oe).values():[]])Qt=Math.min(Qt,ie.x),Mt=Math.min(Mt,ie.y),le=Math.max(le,ie.x+ie.width),te=Math.max(te,ie.y+ie.height);return{minX:Qt,minY:Mt,maxX:le,maxY:te,width:le-Qt,height:te-Mt}}let Xe=Pt(()=>ge(!0)),Kt=Pt(()=>S(Xe)?S(Xe).width+S(tt)*2:800),or=Pt(()=>S(Xe)?S(Xe).height+S(tt)*2:600),yr=Pt(()=>S(Kt)*S(ct)),sr=Pt(()=>(S(x)?S(Kt)*S(G)*Math.max(1,S(yt)):0)+16),pi=Pt(()=>(S(or)+6)*S(ct)),qi=Pt(()=>Math.ceil((S(or)+6)*S(ct)+20)),gr=Pt(()=>S(qi)),mi=Pt(()=>S(W)&&(S(P)!==void 0&&S(gr)>S(P)*.9+1||S(Q)!==null&&S(yr)+16>S(Q)+1));function oi(){gt(N,!1),E=void 0,F?.(),F=void 0}function hi(){if(oi(),!S(b))return;gt(N,!0);const st=S(b),Ct=[];for(let Mt=st.parentElement;Mt;Mt=Mt.parentElement)/(auto|scroll)/.test(getComputedStyle(Mt).overflowY)&&Ct.push(Mt);const Ot=document.scrollingElement;Ot&&!Ct.includes(Ot)&&Ct.push(Ot);const Zt=Ct.map(Mt=>({element:Mt,value:Mt.style.getPropertyValue("overflow-anchor"),priority:Mt.style.getPropertyPriority("overflow-anchor")}));for(const{element:Mt}of Zt)Mt.style.setProperty("overflow-anchor","none");const Qt=()=>{E=void 0};for(const Mt of["wheel","touchstart","keydown"])window.addEventListener(Mt,Qt,{capture:!0,passive:!0});F=()=>{for(const{element:Mt,value:le,priority:te}of Zt)le?Mt.style.setProperty("overflow-anchor",le,te):Mt.style.removeProperty("overflow-anchor");for(const Mt of["wheel","touchstart","keydown"])window.removeEventListener(Mt,Qt,!0)},E=()=>{const Mt=st.querySelector(".diagram-footer");if(Mt)for(const le of Ct){const te=le.getBoundingClientRect(),ie=le===Ot?0:Math.max(0,te.top+le.clientTop),fe=le===Ot?window.innerHeight:Math.min(window.innerHeight,te.top+le.clientTop+le.clientHeight);if(fe<=ie)continue;const ye=Mt.getBoundingClientRect(),pe=ye.height<=fe-ie?ye:Mt.querySelector(".state-navigation").getBoundingClientRect(),Er=pe.bottom>fe?pe.bottom-fe:pe.top<ie?pe.top-ie:0;Math.abs(Er)>.5&&le.scrollBy({top:Er,behavior:"instant"})}}}let Kr=Pt(()=>S(Xe)?`translate(${-S(Xe).minX+S(tt)}px, ${-S(Xe).minY+S(tt)}px)`:"translate(0, 0)"),Bn=Pt(()=>S(Xe)?`translate(${-S(Xe).minX+S(tt)}, ${-S(Xe).minY+S(tt)})`:"translate(0, 0)");function zi(){if(!S(v)&&!S(W)||!S(_)){gt(T,1);return}const st=Math.max(1,S(_).clientWidth-16),Ct=Math.max(1,(S($)??S(_).clientWidth)-16),Ot=S(W)?Number.POSITIVE_INFINITY:Math.max(1,S(_).clientHeight-16),Zt=Math.max(1,S(Kt)*S(G)),Qt=Math.max(1,S(or)*S(G)),Mt=S(W)&&Ct>=500&&["TB","BT"].includes(r().baseView.layout.direction??"")?500:160;gt(A,Math.max(Mt,Ct/S(yt)-l*2),!0),gt(L,Math.max(Mt,Ct/S(yt)-S(tt)*2),!0),gt(T,Math.min(S($)===null?1.25:Math.max(1,S(yt)),Math.max(S(yt),Math.min(st/Zt,Ot/Qt))),!0)}function Ko(){m!==void 0&&cancelAnimationFrame(m),m=void 0}function Wi(){Ko(),gt(v,!S(v)),zi(),m=requestAnimationFrame(()=>{m=void 0,zi(),S(_)?.scrollTo({left:0,top:0,behavior:y(1)===0?"auto":"smooth"})})}bo(()=>{S(Kt),S(or),S(G),(S(v)||S(W))&&zi()}),bo(()=>{if(S(Ge)||!S(x)||!S(_))return;const st=S(_).clientWidth-16;st<=0||(S(Kt)*S(G)>st&&(gt(v,!0),zi()),gt(Ge,!0))});let Mi=ce(void 0),Bi=ce(!1);bo(()=>{const st=s();if(!S(Bi)){gt(Mi,st,!0),gt(Bi,!0);return}st!==S(Mi)&&(gt(Mi,st,!0),Ko(),oi(),gt(v,!1),gt(T,1),S(_)?.scrollTo({left:0,top:0,behavior:"auto"}))});function yc(st){if(st===S(q))return;hi();const Ct=Xt();dt+=1;const Ot=dt,Zt=S(Me),Qt=S(se),Mt=S($t),le=new Map(S(Jt)),te=y(1)>0;if(gt(V,te),gt(_t,te?"camera":"scene",!0),Ta(),te&&(gt(We,!0),gt(Ce,!1),gt(me,!0),gt(Nt,Zt,!0),gt(Te,Qt,!0),gt(Rt,Mt,!0),gt(oe,le,!0),gt(K,r().model.nodes.map(ie=>ie.id).filter(ie=>!Zt.some(fe=>fe.id===ie)),!0),gt(at,(r().model.groups??[]).map(ie=>ie.id).filter(ie=>!Qt.some(fe=>fe.id===ie)),!0),gt(It,r().model.edges.map(ie=>ie.id).filter(ie=>!Mt.some(fe=>fe.id===ie)),!0),gt(Yt,Zt,!0),gt(Wt,Qt,!0),gt(Ut,Mt,!0),gt(Et,le,!0)),gt(q,st,!0),_e(),te){const ie=bh(Zt.map(pe=>pe.id),S(Dt).map(pe=>pe.id)),fe=bh(Qt.map(pe=>pe.id),S($e).map(pe=>pe.id)),ye=bh(Mt.map(pe=>pe.id),S(Ae).map(pe=>pe.id));gt(K,ie.entering,!0),gt(at,fe.entering,!0),gt(It,ye.entering,!0),gt(Nt,Zt.filter(pe=>ie.shared.includes(pe.id)),!0),gt(Te,Qt.filter(pe=>fe.shared.includes(pe.id)),!0),gt(Rt,Mt.filter(pe=>ye.shared.includes(pe.id)),!0),gt(oe,new Map([...le].filter(([pe])=>ye.shared.includes(pe))),!0),gt(Yt,Zt.filter(pe=>ie.departing.includes(pe.id)),!0),gt(Wt,Qt.filter(pe=>fe.departing.includes(pe.id)),!0),gt(Ut,Mt.filter(pe=>ye.departing.includes(pe.id)),!0),gt(Et,new Map([...le].filter(([pe])=>ye.departing.includes(pe))),!0),_e()}else Pe();R=jt(Ct),te&&(R.length===0&>(_t,"exit"),co(Ot,st,R)),i()?.({currentStateId:st}),E?.()}function Ln(st,Ct){(Ct?!Tt.has(st):Tt.has(st))&&(Ct?Tt.add(st):Tt.delete(st),Ct&&Ta())}function AC(st,Ct,Ot){if(!o()||!i())return;const Zt=r().model.nodes.map(Qt=>Qt.id===st?{...Qt,position:{x:Ct,y:Ot}}:Qt);i()({model:{...r().model,nodes:Zt}})}var FC={get diagram(){return r()},set diagram(st){r(st),_e()},get onUpdate(){return i()},set onUpdate(st){i(st),_e()},get editable(){return o()},set editable(st=!1){o(st),_e()},get styleConfig(){return n()},set styleConfig(st=Ii){n(st),_e()},get onBindingClick(){return a()},set onBindingClick(st){a(st),_e()},get viewResetKey(){return s()},set viewResetKey(st){s(st),_e()},$set:Mo,$on:(st,Ct)=>Bo(t,st,Ct)},Hi=MI();let Zu,Ku;var Qu=Re(Hi);{var $C=st=>{var Ct=yI(),Ot=Re(Ct);{let Zt=Pt(()=>S(v)?ze.diagram_renderer_actualSize_ariaLabel():ze.diagram_renderer_fitToWidth_ariaLabel()),Qt=Pt(()=>S(v)?ze.diagram_renderer_actualSize_ariaLabel():ze.diagram_renderer_fitToWidth_ariaLabel());Hn(Ot,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-fit-button",onclick:Wi,get"aria-pressed"(){return S(v)},get"aria-label"(){return S(Zt)},get tooltip(){return S(Qt)},children:(Mt,le)=>{{let te=Pt(()=>S(v)?mm:C2);os(Mt,{get icon(){return S(te)},size:"sm"})}},$$slots:{default:!0}})}Fe(Ct),ar(Zt=>de(Ct,"aria-label",Zt),[()=>ze.diagram_renderer_actions_ariaLabel()]),ue(st,Ct)};fr(Qu,st=>{S(x)&&r().model.nodes.length>0&&st($C)})}var uo=De(Qu,2);let Ju,tf;var EC=Re(uo);{var PC=st=>{var Ct=xI(),Ot=Re(Ct),Zt=vr(Ot,!0),Qt=De(Ot,2),Mt=vr(Qt,!0);Fe(Ct),ar((le,te)=>{mr(Zt,le),mr(Mt,te)},[()=>ze.markdown_mermaid_renderFailed_error(),()=>ze.diagram_renderer_error_description()]),ue(st,Ct)},OC=st=>{var Ct=bI(),Ot=Re(Ct),Zt=vr(Ot,!0),Qt=De(Ot,2),Mt=vr(Qt,!0);Fe(Ct),ar((le,te)=>{mr(Zt,le),mr(Mt,te)},[()=>ze.diagram_validator_noNodes_warning(),()=>ze.diagram_renderer_empty_description()]),ue(st,Ct)},IC=st=>{var Ct=_I();let Ot;var Zt=Re(Ct);let Qt;var Mt=Re(Zt),le=Re(Mt),te=De(le),ie=De(te),fe=De(ie),ye=De(fe),pe=De(ye),Er=De(pe),yi=De(Er);Fe(Mt);var Oo=De(Mt);ym(Oo,()=>S(p),di=>{var Qr=vI();let xi;var Io=Re(Qr);{var xr=Je=>{var Be=Xo(),kr=ti(Be);sn(kr,17,()=>S(se),Pr=>Pr.id,(Pr,dr)=>{var ur=CI(),Nr=Re(ur);{let Li=Pt(()=>S(ut)!==null&&S(ut)!==S(dr).id);BC(Nr,{get group(){return S(dr)},get dimmed(){return S(Li)},onHover:Ma=>gt(ut,Ma,!0)})}Fe(ur),xo(1,ur,()=>Ba,()=>({delay:0,duration:y(ht)})),xo(2,ur,()=>Ba,()=>({duration:y(mt)})),ue(Pr,ur)}),ue(Je,Be)};fr(Io,Je=>{S(se)&&Je(xr)})}var Ue=De(Io);sn(Ue,17,()=>S($t),Je=>Je.id,(Je,Be)=>{const kr=Pt(()=>S(rt)!==null&&!S(Bt).has(S(Be).id)||S(ut)!==null&&!S(X).has(S(Be).id)||S(qt)&&S(Ft)!==null&&!S(Ft).has(S(Be).id)),Pr=Pt(()=>S(Ft)!==null&&S(Ft).has(S(Be).id));var dr=wI(),ur=Re(dr);MC(ur,{get edge(){return S(Be)},get dimmed(){return S(kr)},get highlighted(){return S(Pr)},get markerScope(){return r().id},get terminalGap(){return S(Y)},motionDelay:0,onmotionchange:Ln}),Fe(dr),xo(1,dr,()=>Le,()=>({duration:ht})),xo(2,dr,()=>Le,()=>({duration:St})),ue(Je,dr)});var lr=De(Ue);sn(lr,17,()=>S($t),Je=>Je.id,(Je,Be)=>{var kr=Xo(),Pr=ti(kr);{var dr=Nr=>{const Li=Pt(()=>S(Jt).get(S(Be).id)),Ma=Pt(()=>S(rt)!==null&&!S(Bt).has(S(Be).id)||S(ut)!==null&&!S(X).has(S(Be).id)||S(qt)&&S(Ft)!==null&&!S(Ft).has(S(Be).id));var ni=kI();let xc;var NC=Re(ni);{var qC=Ro=>{w2(Ro,{get content(){return S(Be).label},side:"top",class:"edge-label-tooltip",trigger:bc=>{var An=um(),WC=Re(An),HC=vr(WC,!0);Fe(An),ar(()=>{de(An,"aria-label",S(Be).label),mr(HC,S(Be).label)}),ue(bc,An)},$$slots:{trigger:!0}})},zC=Ro=>{var Bs=um(),bc=Re(Bs),An=vr(bc,!0);Fe(Bs),ar(()=>mr(An,S(Be).label)),ue(Ro,Bs)};fr(NC,Ro=>{S(Li).truncated?Ro(qC):Ro(zC,-1)})}Fe(ni),ar(Ro=>{de(ni,"x",S(Li).x),de(ni,"y",S(Li).y),de(ni,"width",S(Li).width),de(ni,"height",S(Li).height),xc=Qi(ni,0,`edge-label-container diagram-geometry-motion ${S(Ma)?"edge-label-dimmed":""}`,null,xc,{"edge-label-entry":Ro}),de(ni,"data-edge-id",S(Be).id),de(ni,"data-semantic-style",S(Be).semanticStyle??"default"),de(ni,"data-truncated",S(Li).truncated)},[()=>S(V)&&S(It).includes(S(Be).id)]),xo(2,ni,()=>Ba,()=>({duration:y(mt/2)})),ue(Nr,ni)},ur=Pt(()=>S(Be).label&&S(Jt).has(S(Be).id));fr(Pr,Nr=>{S(ur)&&Nr(dr)})}ue(Je,kr)});var Lr=De(lr);sn(Lr,17,()=>S(Me),Je=>Je.id,(Je,Be)=>{const kr=Pt(()=>S(rt)!==null&&!S(wt).has(S(Be).id)||S(ut)!==null&&!S(kt).has(S(Be).id)||S(qt)&&S(vt)!==null&&!S(vt).has(S(Be).id)),Pr=Pt(()=>S(vt)!==null&&S(vt).has(S(Be).id));var dr=SI(),ur=Re(dr);TC(ur,{get node(){return S(Be)},get editable(){return o()},get styleConfig(){return S(J)},get dimmed(){return S(kr)},get highlighted(){return S(Pr)},onMove:(Nr,Li)=>AC(S(Be).id,Nr,Li),onHover:Nr=>gt(rt,Nr,!0),get onBindingClick(){return a()}}),Fe(dr),ar(()=>{de(dr,"data-node-id",S(Be).id),de(dr,"x",S(Be).x),de(dr,"y",S(Be).y),de(dr,"width",S(Be).width),de(dr,"height",S(Be).height)}),xo(1,dr,()=>Ba,()=>({delay:0,duration:S(V)?y(ht):0,easing:cf})),xo(2,dr,()=>Ba,()=>({duration:y(mt)})),ue(Je,dr)}),Fe(Qr),ar(()=>{de(Qr,"transform",S(Bn)),xi=Rn(Qr,"",xi,{transform:S(Kr)})}),ue(di,Qr)}),Fe(Zt),Fe(Ct),ar(()=>{Ot=Rn(Ct,"",Ot,{width:S(W)?`max(100%, ${S(yr)+16}px)`:`${S(yr)}px`,height:S(W)?`max(100%, ${S(gr)}px)`:`${S(pi)}px`}),de(Zt,"width",S(Kt)),de(Zt,"height",S(or)+6),Qt=Rn(Zt,"",Qt,{top:S(W)?`${S(qi)/2}px`:void 0,transform:S(Se)}),de(le,"id",`arrowhead-${r().id??""}`),de(te,"id",`arrowhead-danger-${r().id??""}`),de(ie,"id",`arrowhead-success-${r().id??""}`),de(fe,"id",`arrowhead-warning-${r().id??""}`),de(ye,"id",`arrowhead-muted-${r().id??""}`),de(pe,"id",`arrowhead-inactive-${r().id??""}`),de(Er,"id",`arrowhead-highlighted-${r().id??""}`),de(yi,"id",`arrowhead-active-${r().id??""}`)}),ue(st,Ct)};fr(EC,st=>{S(k)?st(PC):r().model.nodes.length===0?st(OC,1):st(IC,-1)})}Fe(uo),Zi(uo,st=>gt(_,st),()=>S(_));var RC=De(uo,2);{var DC=st=>{var Ct=TI(),Ot=Re(Ct);LC(Ot,{get states(){return r().states},get currentStateId(){return S(q)},onStateChange:yc}),Fe(Ct),ue(st,Ct)};fr(RC,st=>{!S(k)&&r().model.nodes.length>0&&r().states&&r().states.length>0&&st(DC)})}return Fe(Hi),Zi(Hi,st=>gt(b,st),()=>S(b)),ar((st,Ct,Ot,Zt,Qt,Mt,le,te)=>{Zu=Qi(Hi,1,"diagram-renderer svelte-10vg205",null,Zu,{"has-content":st,"compact-diagram":S(et),"fitted-diagram":S(v),"stateful-diagram":Ct,"camera-stage":S(_t)==="camera",resizing:S(f)}),de(Hi,"data-diagram-intrinsic-width",S(sr)),Ku=Rn(Hi,`--diagram-edge-label-font-size: ${ki.fontSize}px;
|
|
340
|
-
--diagram-edge-label-line-height: ${ki.lineHeight};
|
|
341
|
-
--diagram-edge-label-padding-x: ${ki.paddingX}px;
|
|
342
|
-
--diagram-edge-label-padding-y: ${ki.paddingY}px;`,Ku,{"--diagram-camera-duration":Ot,"--diagram-camera-easing":ot,"--diagram-move-exit-duration":Zt,"--diagram-label-entry-delay":Qt,"--diagram-label-entry-duration":Mt}),de(Hi,"data-diagram-settled",S(U)),de(Hi,"data-diagram-state",S(q)),de(Hi,"data-diagram-motion-phase",S(_t)),Ju=Qi(uo,1,"diagram-scroll-container svelte-10vg205",null,Ju,{"stepping-viewport":S(N)}),de(uo,"role",S(W)?"region":void 0),de(uo,"aria-label",le),de(uo,"tabindex",S(mi)?0:void 0),tf=Rn(uo,"",tf,{height:te})},[()=>!!(S(x)&&r().model.nodes.length>0),()=>!!r().states?.length,()=>`${y(j)}ms`,()=>`${y(nt)}ms`,()=>`${y(Lt)}ms`,()=>`${y(Ht)}ms`,()=>S(W)?ze.diagram_controls_walkthrough_ariaLabel():void 0,()=>S(W)?`${Math.min(S(gr),(S(P)??1/0)*.9)}px`:void 0]),P2("innerHeight",st=>gt(P,st,!0)),ue(e,Hi),Ao(FC)}var LI=er('<header class="diagram-presentation-header svelte-1rsrotk" data-diagram-presentation-header=""><!></header>'),AI=er('<div data-diagram-presentation-actions=""><!> <!></div>'),FI=er('<section data-diagram-presentation=""><!> <!> <div class="diagram-presentation-content svelte-1rsrotk" data-diagram-presentation-content=""><!></div></section>');function $I(e,t){if(new.target)return To({component:$I,...e});Lo(t,!0);let r=Ne(t,"kind",7),i=Ne(t,"children",7),o=Ne(t,"header",7),n=Ne(t,"actions",7),a=Ne(t,"actionsInTopMargin",7,!1),s=Ne(t,"rendererOwnsActions",7,!1),l=Ne(t,"selected",7,!1),c=Ne(t,"exportable",7,!0),h=Ne(t,"fileName",7),d=ce(void 0),u=ce(void 0),f=ce(void 0),p=ce(!1),g=ce(!1);gd(()=>{const M=S(d)?.closest(".node-mermaidBlock, .node-diagram_block"),$=M?.parentElement;if(!M||!$?.matches(".tiptap-editor.ProseMirror")||!S(d)){gt(p,!0);return}const P=S(d);gt(g,!0);let N=0,F=0,E=!1,B,q;const z=()=>{B=void 0;const G=F,W=P.querySelector("[data-diagram-intrinsic-width]"),Q=P.querySelector(".mermaid-svg > svg");W?.dataset.diagramSettled==="true"?N=Number(W.dataset.diagramIntrinsicWidth):Q?.dataset.layoutSettled==="true"?N=Q.viewBox.baseVal.width+16:!W&&!Q&&(N=0);const et=M.clientWidth,tt=$.clientWidth,J=Math.min(et,Math.max(tt,N)),ct=Math.min(et,tt),yt=W?W.dataset.diagramSettled==="true":Q?Q.dataset.layoutSettled==="true":!P.querySelector('[data-render-settled="false"]');q=B2(()=>{if(E||F!==G)return;q=void 0;const Y=S(u)!==J;gt(u,J,!0),gt(f,ct,!0),gt(p,yt,!0),S(g)&&yt&&et>0&&tt>0&&(Y?B??=hf(z):gt(g,!1))})},I=()=>{F+=1,gt(p,!1),q?.(),q=void 0,B??=hf(z)},D=new ResizeObserver(I);D.observe(M),D.observe($);const Z=new MutationObserver(I);return Z.observe(P,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-diagram-settled","data-diagram-intrinsic-width","data-layout-settled","data-render-settled"]}),I(),()=>{E=!0,D.disconnect(),Z.disconnect(),B?.(),q?.()}});var m={get kind(){return r()},set kind(M){r(M),_e()},get children(){return i()},set children(M){i(M),_e()},get header(){return o()},set header(M){o(M),_e()},get actions(){return n()},set actions(M){n(M),_e()},get actionsInTopMargin(){return a()},set actionsInTopMargin(M=!1){a(M),_e()},get rendererOwnsActions(){return s()},set rendererOwnsActions(M=!1){s(M),_e()},get selected(){return l()},set selected(M=!1){l(M),_e()},get exportable(){return c()},set exportable(M=!0){c(M),_e()},get fileName(){return h()},set fileName(M){h(M),_e()},$set:Mo,$on:(M,$)=>Bo(t,M,$)},y=FI();let x,C;var k=Re(y);{var v=M=>{var $=LI(),P=Re($);Zs(P,o),Fe($),ue(M,$)};fr(k,M=>{o()&&M(v)})}var T=De(k,2);{var L=M=>{var $=AI();let P;var N=Re($);Zs(N,()=>n()??ZC);var F=De(N,2);{var E=B=>{zu(B,{get container(){return S(d)},get fileName(){return h()},get compactTrigger(){return a()}})};fr(F,B=>{c()&&B(E)})}Fe($),ar(()=>P=Qi($,1,"diagram-presentation-actions svelte-1rsrotk",null,P,{"actions-in-top-margin":a()})),ue(M,$)};fr(T,M=>{!s()&&(n()||c())&&M(L)})}var A=De(T,2),_=Re(A);return Zs(_,i),Fe(A),Zi(A,M=>gt(d,M),()=>S(d)),Fe(y),ar(()=>{x=Qi(y,1,"diagram-presentation svelte-1rsrotk",null,x,{selected:l(),initializing:S(g),"renderer-owns-actions":s()}),y.inert=S(g),de(y,"data-diagram-presentation-settled",S(p)),de(y,"data-diagram-presentation-initializing",S(g)),de(y,"data-diagram-kind",r()),C=Rn(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"})}),ue(e,y),Ao(m)}export{Hd as $,t$ as A,e$ as B,to as C,$I as D,kb as E,wa as F,sc as G,Lb as H,wA as I,M$ as J,r5 as K,P2 as L,a8 as M,qy as N,fy as O,gy as P,a6 as Q,li as R,ko as S,zd as T,Jg as U,Zy as V,vo as W,o$ as X,wb as Y,IT as Z,H6 as _,ks as a,jF as a$,Yw as a0,rr as a1,ua as a2,Rm as a3,Cs as a4,GM as a5,Im as a6,Fn as a7,_d as a8,ja as a9,aT as aA,Ef as aB,pb as aC,Km as aD,qs as aE,Dl as aF,vT as aG,_T as aH,Jo as aI,YT as aJ,Uw as aK,jw as aL,Gg as aM,Br as aN,Ke as aO,Zw as aP,C6 as aQ,Ss as aR,W6 as aS,Uy as aT,Jl as aU,Pd as aV,Co as aW,Q2 as aX,$w as aY,n6 as aZ,Pf as a_,u6 as aa,v$ as ab,Ab as ac,Ni as ad,Oh as ae,S_ as af,v_ as ag,__ as ah,xy as ai,T_ as aj,M_ as ak,Cy as al,B_ as am,L_ as an,ts as ao,A_ as ap,Ly as aq,Ay as ar,bt as as,mT as at,hT as au,N2 as av,l6 as aw,Sm as ax,vd as ay,Dg as az,BI as b,XS as b$,ns as b0,XF as b1,c6 as b2,ec as b3,ib as b4,ab as b5,lu as b6,$b as b7,su as b8,kT as b9,bs as bA,B$ as bB,pt as bC,dT as bD,jr as bE,cb as bF,f6 as bG,g6 as bH,Ty as bI,My as bJ,Hg as bK,ty as bL,Ny as bM,pT as bN,s5 as bO,CA as bP,Gl as bQ,gf as bR,Ld as bS,rL as bT,Lg as bU,XT as bV,u$ as bW,lT as bX,rT as bY,z6 as bZ,Om as b_,ST as ba,wT as bb,qo as bc,Mf as bd,QS as be,ic as bf,ci as bg,rc as bh,i$ as bi,Rl as bj,Ri as bk,Il as bl,gb as bm,Ey as bn,hu as bo,Cn as bp,Id as bq,mb as br,cu as bs,il as bt,uu as bu,qn as bv,qB as bw,Ui as bx,xt as by,k_ as bz,eo as c,jo as c0,Fo as c1,vi as c2,He as c3,F_ as c4,X6 as c5,Gw as c6,Xw as c7,s6 as c8,Vw as c9,UT as cA,T6 as ca,uT as cb,dA as cc,qw as cd,Qw as ce,tb as cf,p6 as cg,B6 as ch,m6 as ci,$y as cj,Fy as ck,Dy as cl,ae as cm,cT as cn,y6 as co,ac as cp,H5 as cq,bT as cr,CT as cs,yT as ct,xT as cu,eT as cv,ne as cw,Ur as cx,Nc as cy,x_ as cz,qe as d,O2 as e,w as f,x4 as g,Y6 as h,h6 as i,x6 as j,Cm as k,M6 as l,zy as m,b_ as n,gT as o,uA as p,a5 as q,ub as r,fT as s,b6 as t,qr as u,re as v,d6 as w,yu as x,fA as y,j5 as z};
|