@intent-hq/web 2.303.1 → 2.303.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{BeoKf2Nm.js → 00uxEElC.js} +1 -1
- package/web/app/immutable/chunks/{Brbvu9Bf.js → 0_F49j-u.js} +1 -1
- package/web/app/immutable/chunks/{CgoYLyrh.js → 16TQPnhH.js} +1 -1
- package/web/app/immutable/chunks/{CqIXbU6G.js → 1PMPyNG_.js} +1 -1
- package/web/app/immutable/chunks/{K-3wWXoG.js → 1mYCesh4.js} +1 -1
- package/web/app/immutable/chunks/{jfXvxS2S.js → 27ieI8Q7.js} +1 -1
- package/web/app/immutable/chunks/{8L6UQh4N.js → 4NAJ4wU0.js} +1 -1
- package/web/app/immutable/chunks/{EY1yX4lQ.js → 4SHq9vZB.js} +1 -1
- package/web/app/immutable/chunks/{DyzwKjcO.js → 80lJL4Bn.js} +1 -1
- package/web/app/immutable/chunks/{DDXSm5kb.js → 8SGgBOu4.js} +1 -1
- package/web/app/immutable/chunks/{BZlF9cZE.js → Af4e_CfR.js} +1 -1
- package/web/app/immutable/chunks/{Br_vwCYL.js → B0Ix4oHU.js} +3 -3
- package/web/app/immutable/chunks/{LYkiL1Z7.js → B0yoZLtl.js} +1 -1
- package/web/app/immutable/chunks/{YaNhYlLh.js → B43OyUe0.js} +1 -1
- package/web/app/immutable/chunks/{n309YBvY.js → B4W6-XXO.js} +1 -1
- package/web/app/immutable/chunks/{DXwWG0kg.js → B59NonPS.js} +1 -1
- package/web/app/immutable/chunks/{Dz0HBLX5.js → B8eTvp12.js} +1 -1
- package/web/app/immutable/chunks/{DE-ZJyo7.js → B8vlcOwv.js} +1 -1
- package/web/app/immutable/chunks/{DsuTjoON.js → BAY-mFnP.js} +1 -1
- package/web/app/immutable/chunks/{bFa0TDbD.js → BC_OV_w3.js} +6 -6
- package/web/app/immutable/chunks/{C6q6LFl7.js → BD0xH6ju.js} +6 -6
- package/web/app/immutable/chunks/{MPaSCQWF.js → BGn-A48v.js} +2 -2
- package/web/app/immutable/chunks/{Bp0o4QK_.js → BIGW16GS.js} +1 -1
- package/web/app/immutable/chunks/{DIPmbnAQ.js → BJuRmCrE.js} +1 -1
- package/web/app/immutable/chunks/{BOUU5n11.js → BKmyS2KM.js} +1 -1
- package/web/app/immutable/chunks/{Da8-5i7r.js → BNJMdNln.js} +1 -1
- package/web/app/immutable/chunks/{D1wQuS9X.js → BNf1F4jC.js} +1 -1
- package/web/app/immutable/chunks/{B5OCTRwy.js → BNqPvIBf.js} +1 -1
- package/web/app/immutable/chunks/{B6AD3L6o.js → BOYIvbV1.js} +1 -1
- package/web/app/immutable/chunks/{C2zQhN_1.js → BQV3Ny-c.js} +1 -1
- package/web/app/immutable/chunks/{B__rt0-I.js → BR34HSgY.js} +4 -4
- package/web/app/immutable/chunks/{CQp6uUPO.js → BTYvk2mh.js} +1 -1
- package/web/app/immutable/chunks/{CDjySRKh.js → BYUq5x3t.js} +1 -1
- package/web/app/immutable/chunks/{8ouV2ksN.js → BZltciVZ.js} +1 -1
- package/web/app/immutable/chunks/B_2S_hHs.js +1 -0
- package/web/app/immutable/chunks/{CCkicAWR.js → Bb19RpMB.js} +1 -1
- package/web/app/immutable/chunks/{PM-2gCwH.js → BdDWti3j.js} +2 -2
- package/web/app/immutable/chunks/{Bfve9onU.js → BdMGXlaL.js} +1 -1
- package/web/app/immutable/chunks/{D4uurSjm.js → BeH4qLDH.js} +2 -2
- package/web/app/immutable/chunks/{DLg1LKff.js → BehTaWRy.js} +1 -1
- package/web/app/immutable/chunks/{CbgVFYxx.js → Bf2SLLHW.js} +1 -1
- package/web/app/immutable/chunks/{BnaVNQ5C.js → BgAd01eY.js} +1 -1
- package/web/app/immutable/chunks/{C0AUyzcq.js → BjZIrkYy.js} +1 -1
- package/web/app/immutable/chunks/{DiIl-PCx.js → Bm6CXfx7.js} +1 -1
- package/web/app/immutable/chunks/{DYrmWLZS.js → BmQTD8A8.js} +1 -1
- package/web/app/immutable/chunks/{CyrC60Vp.js → BnwJCd5q.js} +1 -1
- package/web/app/immutable/chunks/{uaFePogj.js → Bny3Va3q.js} +1 -1
- package/web/app/immutable/chunks/{BFf5Uhiw.js → BpPaCMNY.js} +2 -2
- package/web/app/immutable/chunks/{CuxOQF3U.js → BpznL-Sx.js} +1 -1
- package/web/app/immutable/chunks/{YgJaoLfT.js → Bq0ctQK9.js} +1 -1
- package/web/app/immutable/chunks/{DDXJdNWs.js → BqNKVfCm.js} +1 -1
- package/web/app/immutable/chunks/{BIZa5Cf_.js → BqfQpM-F.js} +1 -1
- package/web/app/immutable/chunks/{CDIkpSZv.js → BrRwX7DO.js} +1 -1
- package/web/app/immutable/chunks/{D4t7Z7vv.js → BsYKjXz_.js} +1 -1
- package/web/app/immutable/chunks/{CflfeJIa.js → Bt6eGVSt.js} +1 -1
- package/web/app/immutable/chunks/{Bj8NtCfK.js → Bt9uePlA.js} +1 -1
- package/web/app/immutable/chunks/{DdAufyF9.js → Bu9lZqPK.js} +2 -2
- package/web/app/immutable/chunks/{CMdvdycX.js → BuvWIiNr.js} +1 -1
- package/web/app/immutable/chunks/{BEpG-KhT.js → Bv033Zz3.js} +1 -1
- package/web/app/immutable/chunks/{Bc8F17WQ.js → Bv7kzLZM.js} +1 -1
- package/web/app/immutable/chunks/{Dam5_Z8s.js → Bx6JcGvf.js} +3 -3
- package/web/app/immutable/chunks/{Mfxk6hrK.js → By4T0eds.js} +1 -1
- package/web/app/immutable/chunks/{CDHK1MhW.js → ByA1TTJR.js} +1 -1
- package/web/app/immutable/chunks/{VNIUMXZ1.js → BzpcSTCe.js} +1 -1
- package/web/app/immutable/chunks/{Ddsqeq3q.js → C-EKIkEj.js} +1 -1
- package/web/app/immutable/chunks/{D-M2DNIU.js → C0PJP29a.js} +1 -1
- package/web/app/immutable/chunks/{C5b0K3dK.js → C3cCqJG4.js} +1 -1
- package/web/app/immutable/chunks/{BvuwU8jV.js → C5VEh5uc.js} +7 -7
- package/web/app/immutable/chunks/{CMmFp0Pt.js → C8Y8MofM.js} +1 -1
- package/web/app/immutable/chunks/{CGTwtuZB.js → CB9_hf7T.js} +1 -1
- package/web/app/immutable/chunks/{DHaw_3Nr.js → CBdGUJdw.js} +1 -1
- package/web/app/immutable/chunks/{BE5Fv7qN.js → CBeI_yeK.js} +1 -1
- package/web/app/immutable/chunks/{BbwEzwME.js → CFXCYKJP.js} +1 -1
- package/web/app/immutable/chunks/{DTonRSsv.js → CHRWNuEU.js} +1 -1
- package/web/app/immutable/chunks/{Dm6zmEG5.js → CJ6fKCMV.js} +1 -1
- package/web/app/immutable/chunks/{CjPzTuqd.js → CMrQ4XgK.js} +1 -1
- package/web/app/immutable/chunks/{D8GJ611X.js → CN2zlwHC.js} +1 -1
- package/web/app/immutable/chunks/{JxxJ9mXU.js → CPCUj0SC.js} +1 -1
- package/web/app/immutable/chunks/{BK4u9wtb.js → CPo0z1NF.js} +1 -1
- package/web/app/immutable/chunks/{C6BkQqQb.js → CQAi9FSX.js} +1 -1
- package/web/app/immutable/chunks/{CcWcrRx2.js → CQmHuNgQ.js} +1 -1
- package/web/app/immutable/chunks/{Bosjw8O3.js → CQw7GTs6.js} +1 -1
- package/web/app/immutable/chunks/{i6zTaEpb.js → CWEt6bXk.js} +1 -1
- package/web/app/immutable/chunks/{BVN4ilux.js → CWFKACW0.js} +1 -1
- package/web/app/immutable/chunks/{CTFAhMsj.js → CXDa1oob.js} +1 -1
- package/web/app/immutable/chunks/{BJZA2e1k.js → C_8qE1Ea.js} +1 -1
- package/web/app/immutable/chunks/{DAL0Y3FS.js → C_PzkP6E.js} +1 -1
- package/web/app/immutable/chunks/{BhPgWKZZ.js → C_c9fmWH.js} +1 -1
- package/web/app/immutable/chunks/{DTbuwXvH.js → CaZjPP9e.js} +1 -1
- package/web/app/immutable/chunks/{B_RQpkN5.js → CbVMangE.js} +1 -1
- package/web/app/immutable/chunks/{DJGQatsU.js → ChsApY2J.js} +1 -1
- package/web/app/immutable/chunks/{DIKzzQEG.js → CjD72_YJ.js} +1 -1
- package/web/app/immutable/chunks/{aPknFgnB.js → CjyLrIKT.js} +1 -1
- package/web/app/immutable/chunks/{BRWGra38.js → Ckh5WWeA.js} +1 -1
- package/web/app/immutable/chunks/{Cbo9e-lk.js → CrPX2-Do.js} +1 -1
- package/web/app/immutable/chunks/{8wsU44-j.js → CsPa9HxL.js} +1 -1
- package/web/app/immutable/chunks/{DZVScUjw.js → CtJ4QAPx.js} +1 -1
- package/web/app/immutable/chunks/{Di_N5xxx.js → CtMKqOD8.js} +1 -1
- package/web/app/immutable/chunks/{A4Dmh4Er.js → CtR_aYLO.js} +1 -1
- package/web/app/immutable/chunks/{CpO5voiW.js → CtnKv097.js} +1 -1
- package/web/app/immutable/chunks/{C5PE5dRA.js → CwGSuPgH.js} +1 -1
- package/web/app/immutable/chunks/{IS2i-qON.js → Cx0BWf2W.js} +2 -2
- package/web/app/immutable/chunks/{CnXUfSkf.js → D-P-dlJm.js} +1 -1
- package/web/app/immutable/chunks/{CE9oTb_7.js → D0P3i4zR.js} +1 -1
- package/web/app/immutable/chunks/{BA0tWkIy.js → D1LK1GGR.js} +1 -1
- package/web/app/immutable/chunks/{CRf1KTYE.js → D2uYpDGE.js} +1 -1
- package/web/app/immutable/chunks/{D-D5GX62.js → D3_DSRwK.js} +1 -1
- package/web/app/immutable/chunks/{Du_FFECf.js → D4z6L4My.js} +4 -4
- package/web/app/immutable/chunks/{TO63wgKH.js → D6gIQvhr.js} +1 -1
- package/web/app/immutable/chunks/{CXYSZJwQ.js → D9WcidNh.js} +1 -1
- package/web/app/immutable/chunks/{DW0i1p3h.js → D9xXuqJT.js} +3 -3
- package/web/app/immutable/chunks/{DKXptzLp.js → DBy0KL7v.js} +1 -1
- package/web/app/immutable/chunks/{NBksFwgt.js → DBzoyXfv.js} +1 -1
- package/web/app/immutable/chunks/{DyUJKXsD.js → DGC8CG3j.js} +1 -1
- package/web/app/immutable/chunks/{DnZciTxO.js → DHHxqqbm.js} +1 -1
- package/web/app/immutable/chunks/{Bg-9J17z.js → DHpbS8ZT.js} +1 -1
- package/web/app/immutable/chunks/{6HM0WwrI.js → DIRIzGp9.js} +1 -1
- package/web/app/immutable/chunks/{CrHeSy6g.js → DJPjZO1e.js} +1 -1
- package/web/app/immutable/chunks/{Dcd7scoM.js → DKYgLLV7.js} +4 -4
- package/web/app/immutable/chunks/{hV-a3cEo.js → DLAMU8JP.js} +1 -1
- package/web/app/immutable/chunks/{CbfNaFu6.js → DMjEYXkO.js} +1 -1
- package/web/app/immutable/chunks/{CyntsY8m.js → DP49kiGN.js} +1 -1
- package/web/app/immutable/chunks/{zZLFVw4s.js → DQe9PqN1.js} +1 -1
- package/web/app/immutable/chunks/{CcwPQ9O4.js → DSXZRa59.js} +1 -1
- package/web/app/immutable/chunks/{CJ9pemY5.js → DUPA9j6z.js} +1 -1
- package/web/app/immutable/chunks/{BXoIE56p.js → DVElz61c.js} +1 -1
- package/web/app/immutable/chunks/{Bu7emN7b.js → DW7zmdfj.js} +1 -1
- package/web/app/immutable/chunks/{Ba6ldMEi.js → DXlS97NX.js} +1 -1
- package/web/app/immutable/chunks/{BD6dhUAy.js → DY2NSWQA.js} +1 -1
- package/web/app/immutable/chunks/{BP5uTKE_.js → DYUcU12p.js} +1 -1
- package/web/app/immutable/chunks/{D5ffGNx9.js → Dc-LMfqP.js} +1 -1
- package/web/app/immutable/chunks/{w3jeSEdx.js → Dcl9PBqG.js} +1 -1
- package/web/app/immutable/chunks/{Mw-Gpasz.js → Dh58itL6.js} +1 -1
- package/web/app/immutable/chunks/{B_USDn20.js → DjLmwxj2.js} +1 -1
- package/web/app/immutable/chunks/{DCtWL3QH.js → DkCy9df6.js} +1 -1
- package/web/app/immutable/chunks/{DHzasNfT.js → DksBb8YR.js} +1 -1
- package/web/app/immutable/chunks/{BVvgEXvX.js → Dm-ly3pD.js} +1 -1
- package/web/app/immutable/chunks/{CQ3a1EyG.js → Dnce1kL4.js} +1 -1
- package/web/app/immutable/chunks/{pbklRmq5.js → Doj9MsHo.js} +1 -1
- package/web/app/immutable/chunks/{8CC8TVgI.js → Dq9THA-s.js} +1 -1
- package/web/app/immutable/chunks/{bzm-2n30.js → Dss2LRs8.js} +1 -1
- package/web/app/immutable/chunks/{DjDCBOVS.js → Dt12oijM.js} +1 -1
- package/web/app/immutable/chunks/{C1SVvLkf.js → Dt_YHb8y.js} +1 -1
- package/web/app/immutable/chunks/{A5biXxJf.js → DvXLHS0T.js} +1 -1
- package/web/app/immutable/chunks/{CKMwvgmW.js → Dw0cAOdh.js} +1 -1
- package/web/app/immutable/chunks/{BKb1USDa.js → DzCBift4.js} +1 -1
- package/web/app/immutable/chunks/{CrqpGEjY.js → DzyWp8BX.js} +1 -1
- package/web/app/immutable/chunks/{CjHpP5RK.js → FVjdVgy8.js} +1 -1
- package/web/app/immutable/chunks/{qVeyMZUH.js → Ga0tOshJ.js} +1 -1
- package/web/app/immutable/chunks/{D6_E0s-v.js → GmnYJDe5.js} +1 -1
- package/web/app/immutable/chunks/{BFAvFQtn.js → HJsrETfU.js} +1 -1
- package/web/app/immutable/chunks/{CxXNCTXN.js → I2TUHdNR.js} +1 -1
- package/web/app/immutable/chunks/{DeIkS6Ir.js → IJrjG441.js} +1 -1
- package/web/app/immutable/chunks/{CSxiQIqf.js → J4NypHg6.js} +1 -1
- package/web/app/immutable/chunks/{3C0u635Z.js → JkPZevtU.js} +1 -1
- package/web/app/immutable/chunks/{os23peQy.js → KOu-Cq5S.js} +1 -1
- package/web/app/immutable/chunks/{BDnl1KXt.js → KgMNo-wX.js} +1 -1
- package/web/app/immutable/chunks/{DtVW9_m7.js → N40ygtio.js} +1 -1
- package/web/app/immutable/chunks/{DqZfiNRX.js → NcsNOGAa.js} +1 -1
- package/web/app/immutable/chunks/{Cqpkx5D-.js → PNb0FkcG.js} +1 -1
- package/web/app/immutable/chunks/{d5YX3jLF.js → Q3WVX75B.js} +1 -1
- package/web/app/immutable/chunks/{2nZ4DEDk.js → QpyyH1fV.js} +1 -1
- package/web/app/immutable/chunks/{bU-QghYU.js → RTUC_gqV.js} +1 -1
- package/web/app/immutable/chunks/{UNcL8nMD.js → RYOcIy3J.js} +1 -1
- package/web/app/immutable/chunks/{BbfCrwpS.js → SQR2mS9I.js} +1 -1
- package/web/app/immutable/chunks/{C_lHU_9L.js → T3bfkv-Z.js} +2 -2
- package/web/app/immutable/chunks/{CRASodpm.js → _bcJX7ZM.js} +1 -1
- package/web/app/immutable/chunks/{sPXVt7LC.js → ahHOUTHC.js} +1 -1
- package/web/app/immutable/chunks/{BEOehA7p.js → c7MI1Uwa.js} +1 -1
- package/web/app/immutable/chunks/{DtPH5jDv.js → cwEGs1kY.js} +1 -1
- package/web/app/immutable/chunks/{lM8ThUgn.js → gKuhYg6Y.js} +1 -1
- package/web/app/immutable/chunks/{k-g3rTlx.js → h37S7kk-.js} +1 -1
- package/web/app/immutable/chunks/{B7kIvU97.js → hRfGY9BA.js} +1 -1
- package/web/app/immutable/chunks/{kGwqxarX.js → i9Hk2neJ.js} +1 -1
- package/web/app/immutable/chunks/{CQchJimX.js → jkdGOTth.js} +1 -1
- package/web/app/immutable/chunks/{CPUt5W4G.js → n7x1c6w9.js} +1 -1
- package/web/app/immutable/chunks/{D0ftNzpH.js → rtWGCI8s.js} +1 -1
- package/web/app/immutable/chunks/{x7K3UR1M.js → sLctU0Rs.js} +1 -1
- package/web/app/immutable/chunks/{CU742qVA.js → xCF3kBw_.js} +1 -1
- package/web/app/immutable/chunks/{CluMc6c4.js → xZ9BClBk.js} +5 -5
- package/web/app/immutable/chunks/{DDevx-cQ.js → yQjZw-Rk.js} +1 -1
- package/web/app/immutable/chunks/{tjLyHM1H.js → zbpnNt59.js} +1 -1
- package/web/app/immutable/entry/{app.DE4M1e5K.js → app.DYPZuUAX.js} +2 -2
- package/web/app/immutable/entry/start.CkreMjRr.js +1 -0
- package/web/app/immutable/nodes/{0.DzKcGMpw.js → 0.DNhWEYGp.js} +1 -1
- package/web/app/immutable/nodes/{1.BRKnSVrJ.js → 1.C9L1F6aA.js} +1 -1
- package/web/app/immutable/nodes/{10.Dq2vvlba.js → 10.B8AiTDsb.js} +1 -1
- package/web/app/immutable/nodes/{14.vi5_3ajt.js → 14.BKuNc4_Z.js} +1 -1
- package/web/app/immutable/nodes/{16.B4hQ-11c.js → 16.CtflurYW.js} +2 -2
- package/web/app/immutable/nodes/{2.CIWkcax4.js → 2.B4ArXfgw.js} +3 -3
- package/web/app/immutable/nodes/{3.nHUMIbz4.js → 3.FN9eOco4.js} +1 -1
- package/web/app/immutable/nodes/{4.CuGifUZf.js → 4.ChyHBjf2.js} +1 -1
- package/web/app/immutable/nodes/{5.B28pUbsn.js → 5.mYT25e0t.js} +1 -1
- package/web/app/immutable/nodes/{6.D04srF9Y.js → 6.BDco5Lux.js} +1 -1
- package/web/app/immutable/nodes/{7.U-29Oxv0.js → 7.CMc5WExh.js} +1 -1
- package/web/app/immutable/nodes/{8.Bw_t7MQd.js → 8.DZjomBnv.js} +2 -2
- package/web/app/immutable/nodes/{9.Dr8DgxLF.js → 9.TMF_rwOS.js} +1 -1
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/Ds156ydk.js +0 -1
- package/web/app/immutable/entry/start.Cx6ojV1T.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,v as h,t as T}from"./CjSUqH7t.js";import{Hi as c,u6 as w}from"./CM_x_DK5.js";import{i as W,c as s,n as u,b as m}from"./
|
|
1
|
+
import{d as l,v as h,t as T}from"./CjSUqH7t.js";import{Hi as c,u6 as w}from"./CM_x_DK5.js";import{i as W,c as s,n as u,b as m}from"./T3bfkv-Z.js";const E=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||E.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function A(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function N(n,t){return t.length>0&&A(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function I(n,t){return t?u(n,{state:t}):u(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const i=I(t,e),r={workspaceId:n,epoch:s(),startTabId:a};return await i,r}function y(n){return!n||W()}function b(n,t){if(s()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function v(n,t,e){if(y(n))return!1;const a=await S(n,t,e,o(c.state));return b(a,o(c.state))?(c.dispatch(R(n,e)),!0):!1}function*k(n,t,e){if(y(n))return!1;const a=o(yield*h(r=>r)),i=yield*l(S,n,t,e,a);return b(i,o(yield*h(r=>r)))?(yield*T(R(n,e)),!0):!1}function P(){m();const n=s(),t=o(c.state),e=p();return()=>s()===n&&o(c.state)===t&&p()===e}function _(n,t={}){return v(n,d(n,t.query),t.state)}function O(n,t={}){return k(n,d(n,t.query),t.state)}async function $(n){const t=f(n);t?await v(t,n,void 0):await u(n)}function*j(n){const t=f(n);t?yield*l(k,t,n,void 0):yield*l(u,n)}const U=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:P,navigateToAppRoute:$,navigateToAppRouteSaga:j,openAndShowWorkspace:_,showWorkspaceSaga:O,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,j as b,P as c,O as d,d as e,N as i,$ as n,_ as o,f as p,U as s,A as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as R,s as W,S as N}from"./Di_N5xxx.js";import{f,aO as t,c3 as H,bC as S,a6 as P,G as C,a4 as z,bz as U,ae as _,aY as F,cx as O}from"./bFa0TDbD.js";import{l as J}from"./YgJaoLfT.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,b,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(b);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const B=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return B.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const b=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-b.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const B of a){const x=B.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:B,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const b=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",B).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,B,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),b.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;b.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",B-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),m,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){m=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const B=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(B,x,void 0,!1,p,a,c);const g=m.padding,o=s.node().getBBox(),b=o.width+g*2,y=o.height+g*2,v=b*1.75;P(s,y,v,m.useMaxWidth),s.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+b+" "+y)},"draw"),at=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new C({compound:!0,multigraph:!0});let s,B=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){B=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+m.padding/2,T[u.id]={y:m.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:m.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*m.padding,k.height=v.height+2*m.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},dt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{dt as diagram};
|
|
1
|
+
import{b as R,s as W,S as N}from"./CtMKqOD8.js";import{f,aO as t,c3 as H,bC as S,a6 as P,G as C,a4 as z,bz as U,ae as _,aY as F,cx as O}from"./BC_OV_w3.js";import{l as J}from"./Bq0ctQK9.js";var X=f(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),Y=f(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),D=f((e,i)=>{const d=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),c=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",c.width+2*t().state.padding).attr("height",c.height+2*t().state.padding).attr("rx",t().state.radius),d},"drawSimpleState"),I=f((e,i)=>{const d=f(function(o,b,y){const v=o.append("tspan").attr("x",2*t().state.padding).text(b);y||v.attr("dy",t().state.textHeight)},"addTspan"),n=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),l=n.height,p=e.append("text").attr("x",t().state.padding).attr("y",l+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description");let a=!0,s=!0;i.descriptions.forEach(function(o){a||(d(p,o,s),s=!1),a=!1});const B=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+l+t().state.dividerMargin/2).attr("y2",t().state.padding+l+t().state.dividerMargin/2).attr("class","descr-divider"),x=p.node().getBBox(),g=Math.max(x.width,n.width);return B.attr("x2",g+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",g+2*t().state.padding).attr("height",x.height+l+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),$=f((e,i,d)=>{const c=t().state.padding,n=2*t().state.padding,l=e.node().getBBox(),p=l.width,a=l.x,s=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),x=s.node().getBBox().width+n;let g=Math.max(x,p);g===p&&(g=g+n);let o;const b=e.node().getBBox();i.doc,o=a-c,x>p&&(o=(p-g)/2+c),Math.abs(a-b.x)<c&&x>p&&(o=a-(x-p)/2);const y=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",o).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",g).attr("height",b.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),s.attr("x",o+c),x<=p&&s.attr("x",a+(g-n)/2-x/2+c),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",o).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",g).attr("height",b.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),q=f(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),Z=f((e,i)=>{let d=t().state.forkWidth,c=t().state.forkHeight;if(i.parentId){let n=d;d=c,c=n}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",c).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),j=f((e,i,d,c)=>{let n=0;const l=c.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const a=p.split(z.lineBreakRegex);let s=1.25*t().state.noteMargin;for(const B of a){const x=B.trim();if(x.length>0){const g=l.append("tspan");if(g.text(x),s===0){const o=g.node().getBBox();s+=o.height}n+=s,g.attr("x",i+t().state.noteMargin),g.attr("y",d+n+1.25*t().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:n}},"_drawLongText"),K=f((e,i)=>{i.attr("class","state-note");const d=i.append("rect").attr("x",0).attr("y",t().state.padding),c=i.append("g"),{textWidth:n,textHeight:l}=j(e,0,0,c);return d.attr("height",l+2*t().state.noteMargin),d.attr("width",n+t().state.noteMargin*2),d},"drawNote"),L=f(function(e,i){const d=i.id,c={id:d,label:i.id,width:0,height:0},n=e.append("g").attr("id",d).attr("class","stateGroup");i.type==="start"&&X(n),i.type==="end"&&q(n),(i.type==="fork"||i.type==="join")&&Z(n,i),i.type==="note"&&K(i.note.text,n),i.type==="divider"&&Y(n),i.type==="default"&&i.descriptions.length===0&&D(n,i),i.type==="default"&&i.descriptions.length>0&&I(n,i);const l=n.node().getBBox();return c.width=l.width+2*t().state.padding,c.height=l.height+2*t().state.padding,c},"drawState"),G=0,Q=f(function(e,i,d){const c=f(function(s){switch(s){case N.relationType.AGGREGATION:return"aggregation";case N.relationType.EXTENSION:return"extension";case N.relationType.COMPOSITION:return"composition";case N.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(s=>!Number.isNaN(s.y));const n=i.points,l=U().x(function(s){return s.x}).y(function(s){return s.y}).curve(_),p=e.append("path").attr("d",l(n)).attr("id","edge"+G).attr("class","transition");let a="";if(t().state.arrowMarkerAbsolute&&(a=F(!0)),p.attr("marker-end","url("+a+"#"+c(N.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:B,y:x}=O.calcLabelPosition(i.points),g=z.getRows(d.title);let o=0;const b=[];let y=0,v=0;for(let u=0;u<=g.length;u++){const h=s.append("text").attr("text-anchor","middle").text(g[u]).attr("x",B).attr("y",x+o),w=h.node().getBBox();y=Math.max(y,w.width),v=Math.min(v,w.x),S.info(w.x,B,x+o),o===0&&(o=h.node().getBBox().height,S.info("Title height",o,x)),b.push(h)}let k=o*g.length;if(g.length>1){const u=(g.length-1)*o*.5;b.forEach((h,w)=>h.attr("y",x+w*o-u)),k=o*g.length}const r=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",B-y/2-t().state.padding/2).attr("y",x-k/2-t().state.padding/2-3.5).attr("width",y+t().state.padding).attr("height",k+t().state.padding),S.info(r)}G++},"drawEdge"),m,T={},V=f(function(){},"setConf"),tt=f(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),et=f(function(e,i,d,c){m=t().state;const n=t().securityLevel;let l;n==="sandbox"&&(l=H("#i"+i));const p=n==="sandbox"?H(l.nodes()[0].contentDocument.body):H("body"),a=n==="sandbox"?l.nodes()[0].contentDocument:document;S.debug("Rendering diagram "+e);const s=p.select(`[id='${i}']`);tt(s);const B=c.db.getRootDoc(),x=s.append("g").attr("id",i+"-root");A(B,x,void 0,!1,p,a,c);const g=m.padding,o=s.node().getBBox(),b=o.width+g*2,y=o.height+g*2,v=b*1.75;P(s,y,v,m.useMaxWidth),s.attr("viewBox",`${o.x-m.padding} ${o.y-m.padding} `+b+" "+y)},"draw"),at=f(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),A=f((e,i,d,c,n,l,p)=>{const a=new C({compound:!0,multigraph:!0});let s,B=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){B=!1;break}d?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:B?1:m.edgeLengthFactor,nodeSep:B?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});const x=p.db.getStates(),g=p.db.getRelations(),o=Object.keys(x);for(const r of o){const u=x[r];d&&(u.parentId=d);let h;if(u.doc){let w=i.append("g").attr("id",u.id).attr("class","stateGroup");h=A(u.doc,w,u.id,!c,n,l,p);{w=$(w,u,c);let E=w.node().getBBox();h.width=E.width,h.height=E.height+m.padding/2,T[u.id]={y:m.compositTitleSize}}}else h=L(i,u,a);if(u.note){const w={descriptions:[],id:u.id+"-note",note:u.note,type:"note"},E=L(i,w,a);u.note.position==="left of"?(a.setNode(h.id+"-note",E),a.setNode(h.id,h)):(a.setNode(h.id,h),a.setNode(h.id+"-note",E)),a.setParent(h.id,h.id+"-group"),a.setParent(h.id+"-note",h.id+"-group")}else a.setNode(h.id,h)}S.debug("Count=",a.nodeCount(),a);let b=0;g.forEach(function(r){b++,S.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:m.labelHeight*z.getRows(r.title).length,labelpos:"c"},"id"+b)}),J(a),S.debug("Graph after layout",a.nodes());const y=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(S.warn("Node "+r+": "+JSON.stringify(a.node(r))),n.select("#"+y.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(T[r]?T[r].y:0)-a.node(r).height/2)+" )"),n.select("#"+y.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),l.querySelectorAll("#"+y.id+" #"+r+" .divider").forEach(h=>{const w=h.parentElement;let E=0,M=0;w&&(w.parentElement&&(E=w.parentElement.getBBox().width),M=parseInt(w.getAttribute("data-x-shift"),10),Number.isNaN(M)&&(M=0)),h.setAttribute("x1",0-M+8),h.setAttribute("x2",E-M-8)})):S.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let v=y.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(S.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),v=y.getBBox();const k={id:d||"root",label:d||"root",width:0,height:0};return k.width=v.width+2*m.padding,k.height=v.height+2*m.padding,S.debug("Doc rendered",k,a),k},"renderDoc"),it={setConf:V,draw:et},dt={parser:W,get db(){return new N(1)},renderer:it,styles:R,init:f(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{dt as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./
|
|
1
|
+
import{p as Mt}from"./BsYKjXz_.js";import{c6 as Nt,aK as Lt,aP as zt,c9 as Tt,aL as Xt,c7 as At,f as u,aX as Et,aN as Yt,$ as U,bC as Q,c4 as It,a6 as Bt,a0 as Ft,aO as V}from"./BC_OV_w3.js";import{p as Ot}from"./B96tyeqv.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),J=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Rt=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,O=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,O,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=J(e.fromPort)??J(e.toPort);const{flow:d,label:w}=Rt(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Ot("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Xt,setDiagramTitle:Tt,getDiagramTitle:zt,getAccDescription:Lt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),O=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;O&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(O);const L=u(t=>a.padding+t/100*I,"projectX"),z=u(t=>b-a.padding-t/100*B,"projectY"),R=v.append("g").attr("class","wardley-axes");R.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),R.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";R.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),R.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:L(t.x),y:z(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const K=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(K).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(K.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let A=Math.atan2(f,l)*180/Math.PI;return(A>90||A<-90)&&(A+=180),`rotate(${A} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=L(t.targetX),i=z(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:L(i.x),y:z(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=L(g.annotationsBox.x),n=z(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,A=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(A,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=L(s.x),i=z(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=L(s.x),i=z(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|