@bkm016/basalt 0.1.11 → 0.1.13
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/{chunk-7jezts2n.js → chunk-06s9pr82.js} +2 -2
- package/{chunk-msm9hmk9.js → chunk-095adzn5.js} +2 -2
- package/chunk-0a7ft50x.js +18 -0
- package/{chunk-tevejprz.js → chunk-0nedq669.js} +4 -4
- package/chunk-0x9netvr.js +5 -0
- package/{chunk-9as0p561.js → chunk-15ve3nmv.js} +11 -11
- package/chunk-1dbfmejf.js +2 -0
- package/{chunk-hbnmymaq.js → chunk-1q6e3mj7.js} +2 -2
- package/{chunk-wnzvnskb.js → chunk-22az84sh.js} +2 -2
- package/{chunk-ax04trym.js → chunk-2q56egb8.js} +1 -1
- package/{chunk-r4ttdkrz.js → chunk-2tf7qfbx.js} +2 -2
- package/{chunk-a1352w87.js → chunk-2zbj8ny6.js} +2 -2
- package/chunk-302n9g7p.js +2 -0
- package/{chunk-bk4rpnm8.js → chunk-37ndxehw.js} +2 -2
- package/chunk-41das1ty.js +2 -0
- package/{chunk-c71173py.js → chunk-44a7f5ta.js} +6 -6
- package/{chunk-jn5pqy5v.js → chunk-46vy2m29.js} +1 -1
- package/{chunk-1zj3zvw5.js → chunk-4k9t9jvx.js} +4 -4
- package/{chunk-c4qr1f41.js → chunk-4rnmxtpx.js} +2 -2
- package/{chunk-fgwda4m0.js → chunk-4w9zqv0k.js} +1 -1
- package/chunk-6d9r9p91.js +20 -0
- package/chunk-6f4ht2hw.js +2 -0
- package/{chunk-jj4hqbrx.js → chunk-6sea12mw.js} +3 -3
- package/chunk-74wwdx3y.js +3 -0
- package/{chunk-gkf5jwvj.js → chunk-77c2cqp2.js} +1 -1
- package/chunk-7chv3knf.js +2 -0
- package/chunk-86yr2c0r.js +3 -0
- package/{chunk-d0a1jxk5.js → chunk-8cgz8xv7.js} +2 -2
- package/{chunk-tvm4zmgj.js → chunk-959z9efn.js} +2 -2
- package/{chunk-zc9ar0r4.js → chunk-9e8vhzy7.js} +1 -1
- package/chunk-b516bp7n.js +3 -0
- package/chunk-bja7p3em.js +25 -0
- package/chunk-bng72094.js +2 -0
- package/{chunk-a98wma9j.js → chunk-bp61xdsc.js} +1 -1
- package/chunk-bq54argx.js +2 -0
- package/chunk-ct77cdg7.js +2 -0
- package/{chunk-02d3x4mj.js → chunk-dk6fgprw.js} +3 -3
- package/chunk-drett6hb.js +2 -0
- package/{chunk-4gtgqcct.js → chunk-edbq461k.js} +3 -3
- package/{chunk-xh444pfn.js → chunk-f0h2bv11.js} +12 -12
- package/{chunk-8mezk0cb.js → chunk-g2etemv5.js} +2 -2
- package/{chunk-n0ybj4h9.js → chunk-g5p9mj1r.js} +2 -2
- package/{chunk-zyyzk5ha.js → chunk-gpnqmtbk.js} +1 -1
- package/{chunk-q9f4xb0w.js → chunk-h9zxqeqr.js} +3 -3
- package/{chunk-hb4f2v34.js → chunk-jjtt9aq8.js} +3 -3
- package/{chunk-29qrxygd.js → chunk-kbpbrr11.js} +2 -2
- package/chunk-m71pj3g1.js +2 -0
- package/chunk-mdkfm1ak.js +7 -0
- package/chunk-mf04h0yy.js +7 -0
- package/chunk-n22vd4at.js +2 -0
- package/{chunk-c0zfefq8.js → chunk-nbjnwd54.js} +1 -1
- package/{chunk-d5j74pcp.js → chunk-pryvvs96.js} +22 -22
- package/{chunk-13gvs0ax.js → chunk-r1jn77q6.js} +2 -2
- package/{chunk-ypqjfv3a.js → chunk-rn3jwyh1.js} +2 -2
- package/chunk-sgrrxsnz.js +482 -0
- package/chunk-sgz87ht5.js +2 -0
- package/{chunk-stj493dn.js → chunk-snz19yc2.js} +2 -2
- package/{chunk-n2jcx65v.js → chunk-szj85dqe.js} +2 -2
- package/{chunk-nrsd810j.js → chunk-tfhp09nj.js} +2 -2
- package/{chunk-xtq1xpq0.js → chunk-tfhze1vq.js} +2 -2
- package/{chunk-755sy11p.js → chunk-tjg0gcks.js} +1 -1
- package/{chunk-en218k4y.js → chunk-tnj2kqb8.js} +1 -1
- package/{chunk-h1kb8b49.js → chunk-vqm94hz2.js} +2 -2
- package/{chunk-82v8jh1h.js → chunk-xvm0y99b.js} +2 -2
- package/{chunk-asyr3gnq.js → chunk-y23dpz5e.js} +2 -2
- package/{chunk-1n7dat03.js → chunk-y4pvhes1.js} +6 -6
- package/{chunk-bwawt15q.js → chunk-ydzag81d.js} +2 -2
- package/chunk-ymg7mtcx.js +3 -0
- package/chunk-yy1f9jxc.js +4044 -0
- package/{chunk-30rjf7my.js → chunk-z0c8ek0j.js} +5 -5
- package/chunk-zk91579b.js +3 -0
- package/{chunk-jtsve11b.js → chunk-zx75vnw8.js} +18 -18
- package/compiled.js +85 -12
- package/package.json +1 -1
- package/ui-test-worker.js +53 -53
- package/web/{chunk-3a57m7xm.js → chunk-0jbf73pr.js} +3 -3
- package/web/{chunk-dk0fnj87.js → chunk-0rhx7qb8.js} +1 -1
- package/web/{chunk-q8v5j963.js → chunk-0rvwj2wh.js} +2 -2
- package/web/chunk-12qf1r6m.js +1 -0
- package/web/{chunk-2ds0a2z1.js → chunk-14vmr99v.js} +3 -3
- package/web/{chunk-v3dn9bfw.js → chunk-16jc5m0f.js} +1 -1
- package/web/{chunk-f79ajymt.js → chunk-1m6fx2h7.js} +2 -2
- package/web/{chunk-793m5jjh.js → chunk-1xm9x7d6.js} +2 -2
- package/web/{chunk-j4gvtszc.js → chunk-1zwc09e8.js} +2 -2
- package/web/{chunk-mykbcvqz.js → chunk-20jxvmbw.js} +1 -1
- package/web/chunk-2n5xbnrt.js +1 -0
- package/web/{chunk-57pyz29y.js → chunk-2sef2wft.js} +2 -2
- package/web/{chunk-9kkzmss7.js → chunk-2x7vmhm0.js} +3 -3
- package/web/{chunk-cbwvfedy.js → chunk-2y1avvqj.js} +8 -8
- package/web/chunk-36s08nye.js +1 -0
- package/web/chunk-3ctmehg4.js +1 -0
- package/web/{chunk-cpshsp24.js → chunk-3jjksgze.js} +1 -1
- package/web/{chunk-94denx9h.js → chunk-3p9w8sg5.js} +3 -3
- package/web/{chunk-47mbbmst.js → chunk-3wpxymxa.js} +3 -3
- package/web/{chunk-2tsxj613.js → chunk-4py9sndw.js} +9 -9
- package/web/chunk-4swea9sn.js +1 -0
- package/web/chunk-4zz5a483.js +1 -0
- package/web/{chunk-hjyev38w.js → chunk-5cwxhhae.js} +5 -5
- package/web/chunk-5ym5ffd5.js +4 -0
- package/web/{chunk-gten0rpx.js → chunk-6e87m0nm.js} +2 -2
- package/web/{chunk-5ahx98zj.js → chunk-6rsr2cyw.js} +8 -8
- package/web/chunk-6y55gk1n.js +1 -0
- package/web/chunk-7aep7k4v.js +1 -0
- package/web/{chunk-tggja45g.js → chunk-8j4tzff5.js} +4 -4
- package/web/chunk-8tgavnwx.js +1 -0
- package/web/{chunk-zdhyq3ch.js → chunk-97t3ngqf.js} +12 -12
- package/web/{chunk-0hvxb5d5.js → chunk-980zhtht.js} +1 -1
- package/web/chunk-9k7fkx80.js +1 -0
- package/web/{chunk-yrh86m0n.js → chunk-9wz8jne3.js} +1 -1
- package/web/chunk-a00vg115.js +1 -0
- package/web/chunk-a4gbxnm3.js +1 -0
- package/web/{chunk-nhx8pw7p.js → chunk-a6g3nqp0.js} +2 -2
- package/web/{chunk-xjc5fmcr.js → chunk-a9er7a7c.js} +24 -24
- package/web/chunk-atppv8fk.js +1 -0
- package/web/{chunk-xbyrgyy0.js → chunk-awkdw9rw.js} +2 -2
- package/web/{chunk-2f2agfpj.js → chunk-b4gcpsbg.js} +11 -11
- package/web/{chunk-n33753da.js → chunk-b9jry5a3.js} +1 -1
- package/web/chunk-ba9qy65y.js +2 -0
- package/web/chunk-bq6mep6p.js +2 -0
- package/web/chunk-bwy3e58v.js +1 -0
- package/web/{chunk-drchr3yn.js → chunk-c57f714b.js} +2 -2
- package/web/{chunk-e763h2px.js → chunk-c6m4vfn5.js} +118 -118
- package/web/{chunk-mpdeqzc9.js → chunk-cr04125j.js} +9 -9
- package/web/{chunk-dsbyfvwz.js → chunk-cr05dttm.js} +1 -1
- package/web/{chunk-a3pye9ag.js → chunk-ct7z7bea.js} +3 -3
- package/web/{chunk-2weaa3gn.js → chunk-ct90yf8z.js} +2 -2
- package/web/{chunk-gyhr27dm.js → chunk-ddg8rz82.js} +3 -3
- package/web/{chunk-wbwets5x.js → chunk-dmha2y9c.js} +28 -28
- package/web/{chunk-4gc663j0.js → chunk-e57h40qa.js} +6 -6
- package/web/chunk-eeesa5q1.js +1 -0
- package/web/{chunk-4wwd3pfz.js → chunk-eqndhs21.js} +2 -2
- package/web/{chunk-zv73g4qq.js → chunk-eqxy6535.js} +2 -2
- package/web/{chunk-hm8thq7c.js → chunk-et1rsgmp.js} +3 -3
- package/web/chunk-f7jpakwh.js +1 -0
- package/web/{chunk-enryqmj7.js → chunk-fnvgdvrg.js} +5 -5
- package/web/chunk-fp62avjh.js +1 -0
- package/web/{chunk-6jb2zyp6.js → chunk-frnh4zqf.js} +2 -2
- package/web/chunk-g0be12na.js +1 -0
- package/web/{chunk-1zfxaafq.js → chunk-g7hqafb8.js} +1 -1
- package/web/{chunk-kfbgvh0c.js → chunk-ga07tv37.js} +1 -1
- package/web/chunk-gr163fex.js +1 -0
- package/web/chunk-gx340asc.js +1 -0
- package/web/chunk-gxtz10wf.js +1 -0
- package/web/chunk-h0c42zy3.js +1 -0
- package/web/{chunk-b3j07x0n.js → chunk-h1k2kqbs.js} +6 -6
- package/web/{chunk-pq56b3mq.js → chunk-h6k1x096.js} +2 -2
- package/web/{chunk-885kpj14.js → chunk-jccz14ye.js} +2 -2
- package/web/{chunk-1t38sgrk.js → chunk-jh33m2mq.js} +4 -4
- package/web/{chunk-g0rtcedn.js → chunk-jh3k7xex.js} +3 -3
- package/web/{chunk-nafe18y9.js → chunk-jpem3qvs.js} +10 -10
- package/web/{chunk-s0xy00v5.js → chunk-k0cg4n2k.js} +2 -2
- package/web/chunk-k9qnvx86.js +2 -0
- package/web/chunk-kcnj0gan.js +1 -0
- package/web/{chunk-8csw0mvf.js → chunk-ke8dffnk.js} +2 -2
- package/web/chunk-kpp5xqsb.js +1 -0
- package/web/chunk-m33yted6.js +1 -0
- package/web/chunk-me5jqqn6.js +1 -0
- package/web/{chunk-tpdcrrf1.js → chunk-mkxeenph.js} +1 -1
- package/web/chunk-mnf4ngj9.js +2 -0
- package/web/{chunk-30aeb767.js → chunk-mykrm8ba.js} +2 -2
- package/web/chunk-mzqqwbmr.js +1 -0
- package/web/chunk-mzzaet63.js +1 -0
- package/web/chunk-npyrdsf8.css +1 -0
- package/web/chunk-p6e2vr51.js +34 -0
- package/web/chunk-p7pa02k9.js +2 -0
- package/web/chunk-q34as3v6.js +1 -0
- package/web/{chunk-27812gqr.js → chunk-q4vy3dkk.js} +3 -3
- package/web/chunk-q6c8p73w.js +1 -0
- package/web/{chunk-m24yb8md.js → chunk-qb8mbptk.js} +1 -1
- package/web/{chunk-b6sqwmq7.js → chunk-qbmtah1x.js} +1 -1
- package/web/{chunk-ydtrc1ay.js → chunk-qh62nkem.js} +2 -2
- package/web/chunk-qn93we3a.js +1 -0
- package/web/{chunk-3ftb27f3.js → chunk-qq06x2ce.js} +8 -8
- package/web/{chunk-fj753yzt.js → chunk-qq6m2my8.js} +2 -2
- package/web/chunk-r1f1egve.js +1 -0
- package/web/chunk-s935z8er.js +2 -0
- package/web/{chunk-90fkdzx3.js → chunk-sq75q603.js} +21 -21
- package/web/{chunk-05mvzx00.js → chunk-ss96cz1f.js} +1 -1
- package/web/{chunk-3b4wqmnh.js → chunk-t82sngk9.js} +7 -7
- package/web/chunk-tt9410zw.js +8 -0
- package/web/{chunk-8151c970.js → chunk-v4cqc9f9.js} +1 -1
- package/web/chunk-ve8gy05p.js +1142 -0
- package/web/chunk-vg1ebkce.js +1 -0
- package/web/{chunk-g31dbnzm.js → chunk-vk7ch6fh.js} +5 -5
- package/web/chunk-vnt34mkb.js +1 -0
- package/web/{chunk-59nk506k.js → chunk-w28dn4dw.js} +1 -1
- package/web/{chunk-ppjw1mps.js → chunk-w4tfad6c.js} +4 -4
- package/web/{chunk-36dc7tcg.js → chunk-wpxtkxjt.js} +2 -2
- package/web/chunk-xcyqd7cn.js +1 -0
- package/web/chunk-xe121vg7.js +1 -0
- package/web/chunk-xh4xn1az.js +1 -0
- package/web/{chunk-d4519smc.js → chunk-xk1vkcj4.js} +15 -15
- package/web/chunk-xrk5ewsn.js +1 -0
- package/web/{chunk-96xhmmqz.js → chunk-xvm66b7v.js} +5 -5
- package/web/chunk-xxmaqj1m.js +2 -0
- package/web/chunk-xzwxcxb4.js +1 -0
- package/web/{chunk-7dycbjxn.js → chunk-y9waq403.js} +4 -4
- package/web/chunk-ydhnkws0.js +1 -0
- package/web/{chunk-3020mmp1.js → chunk-yn4t5s9r.js} +1 -1
- package/web/chunk-ys2tns0p.js +1 -0
- package/web/chunk-zb61mf0a.js +1 -0
- package/web/{chunk-g4as4zzd.js → chunk-ze6azq7z.js} +4 -4
- package/web/chunk-zh7193nq.js +2 -0
- package/web/chunk-zqcg6frm.js +1 -0
- package/web/{chunk-qykt7avq.js → chunk-zxrbbbtp.js} +2 -2
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-38g3gctw.js +0 -3
- package/chunk-3k627vf2.js +0 -3
- package/chunk-4dw43syb.js +0 -2
- package/chunk-7zkswxvk.js +0 -2
- package/chunk-95964592.js +0 -25
- package/chunk-a1rb1a48.js +0 -20
- package/chunk-b2bxqeb4.js +0 -2
- package/chunk-bdjr0kfr.js +0 -7
- package/chunk-bpw6q7g0.js +0 -3
- package/chunk-c6q04xrd.js +0 -3
- package/chunk-cmwdjes8.js +0 -18
- package/chunk-dfh9m9n7.js +0 -7
- package/chunk-dq01v5eq.js +0 -2
- package/chunk-e1x629v0.js +0 -5
- package/chunk-gbjn6d81.js +0 -2
- package/chunk-jymx3a77.js +0 -3951
- package/chunk-m1eam0s5.js +0 -2
- package/chunk-mbpb5c7w.js +0 -2
- package/chunk-pnspvnyd.js +0 -2
- package/chunk-pz2afna8.js +0 -2
- package/chunk-qaeyhe65.js +0 -2
- package/chunk-qnkrrwmg.js +0 -2
- package/chunk-v3ee9z3f.js +0 -2
- package/chunk-vtqr7dm8.js +0 -3
- package/chunk-zq32mwxj.js +0 -479
- package/web/chunk-086dshck.js +0 -1
- package/web/chunk-0fy590s0.js +0 -1
- package/web/chunk-0mdf1qja.js +0 -1
- package/web/chunk-0y971zgq.js +0 -2
- package/web/chunk-32zmk3f5.js +0 -1
- package/web/chunk-3d3wnh8a.js +0 -2
- package/web/chunk-48479gnx.js +0 -1
- package/web/chunk-4rwwtfnd.js +0 -2
- package/web/chunk-6cjm2yr7.js +0 -1
- package/web/chunk-7ycxz39p.js +0 -1
- package/web/chunk-8z7texmv.js +0 -1
- package/web/chunk-9jy8nc4r.js +0 -1
- package/web/chunk-9wr33d0t.js +0 -1
- package/web/chunk-a4tdrxdh.js +0 -1
- package/web/chunk-a9fvsyc1.js +0 -1
- package/web/chunk-apvbvg4d.js +0 -1
- package/web/chunk-bkxcc7v5.js +0 -1
- package/web/chunk-bve354k7.js +0 -1
- package/web/chunk-cwpxakby.js +0 -1
- package/web/chunk-d3f763n7.js +0 -2
- package/web/chunk-dtrh40vr.js +0 -1
- package/web/chunk-e68jw0bg.js +0 -1
- package/web/chunk-jd7npyv9.js +0 -8
- package/web/chunk-jhpg2kcf.js +0 -1
- package/web/chunk-jqqbkdtw.js +0 -4
- package/web/chunk-jzz5htxp.js +0 -1
- package/web/chunk-ka3q31t1.js +0 -1
- package/web/chunk-kahab58k.js +0 -1139
- package/web/chunk-krgvx75q.js +0 -1
- package/web/chunk-kxeaj44h.js +0 -1
- package/web/chunk-m1rdyvb5.js +0 -1
- package/web/chunk-m7k4wr3k.js +0 -1
- package/web/chunk-mdj3r75b.js +0 -1
- package/web/chunk-nbcpbqq4.js +0 -1
- package/web/chunk-nkpdd9hw.js +0 -1
- package/web/chunk-p1yc8hwn.js +0 -2
- package/web/chunk-p29brxyt.js +0 -1
- package/web/chunk-p8fbes0t.js +0 -1
- package/web/chunk-pbp1p5ex.js +0 -1
- package/web/chunk-q65zxczs.js +0 -34
- package/web/chunk-r6q1301x.js +0 -1
- package/web/chunk-r8kghrkb.js +0 -1
- package/web/chunk-rhxn7mxg.js +0 -1
- package/web/chunk-rqympya7.js +0 -2
- package/web/chunk-svqshmpg.js +0 -1
- package/web/chunk-swzxq7r3.css +0 -1
- package/web/chunk-t18tn37m.js +0 -2
- package/web/chunk-tbsaseer.js +0 -1
- package/web/chunk-tgkdyxbn.js +0 -1
- package/web/chunk-v0zfnvc1.js +0 -1
- package/web/chunk-vj31fs16.js +0 -1
- package/web/chunk-vr79r8vh.js +0 -1
- package/web/chunk-wb9tax0m.js +0 -1
- package/web/chunk-x9eghjjd.js +0 -1
- package/web/chunk-z3ky5ews.js +0 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{_,o,
|
|
2
|
-
`);let c=V(n),l=c.append("g"),m=
|
|
3
|
-
`;if(d.frontmatterLineOffset)m.setFrontmatterLineOffset?.(d.frontmatterLineOffset);return await f.parse(b),new i(l,b,m,f,u)}async render(n,s){await this.renderer.draw(this.text,n,s,this)}getParser(){return this.parser}getType(){return this.type}},ar=[],Lo=t(()=>{ar.forEach((i)=>{i()}),ar=[]},"attachFunctions"),Ao=t((i)=>i.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Zr(i){let n
|
|
1
|
+
import{_,o,W,r,e,y}from"./chunk-ve8gy05p.js";import{t,a,Gr,Re,$i,Bi,Tn,xr,Da,co,se,Kt,N,Fi,on,ht,Na,uo,po,mo,zi,Ui,x,fo,Wr,ke,F,Ma,go,Hr,Oa,p,V,nt,rt,In,un,Dr,Kr,ii,_o,si,Xi,U,M,wo,jt,li,eo}from"./chunk-c6m4vfn5.js";import{ra}from"./chunk-xxmaqj1m.js";function ze(i){let n=i?.constructor;return i===(typeof n==="function"?n.prototype:Object.prototype)}function De(i){if(i==null)return!0;if(ii(i)){if(typeof i.splice!=="function"&&typeof i!=="string"&&!Dr(i)&&!un(i)&&!Kr(i))return!1;return i.length===0}if(typeof i==="object"||typeof i==="function"){if(i instanceof Map||i instanceof Set)return i.size===0;let n=Object.keys(i);if(ze(i))return n.filter((s)=>s!=="constructor").length===0;return n.length===0}return!0}var Z="comm",le="rule",fe="decl";var Fe="@media",Oe="@import";var Be="@supports";var Pe="@namespace",oe="@keyframes";var me="@layer",Ne="@scope";var Ve=Math.abs,X=String.fromCharCode;function ue(i){return i.trim()}function ne(i,n,s){return i.replace(n,s)}function H(i,n){return i.charCodeAt(n)|0}function j(i,n,s){return i.slice(n,s)}function R(i){return i.length}function pe(i){return i.length}function J(i,n){return n.push(i),i}var ge=1,ee=1,Ge=0,O=0,T=0,te="";function ve(i,n,s,d,c,l,m,f){return{value:i,root:n,parent:s,type:d,props:c,children:l,line:ge,column:ee,length:m,return:"",siblings:f}}function He(){return T}function Ue(){if(T=O>0?H(te,--O):0,ee--,T===10)ee=1,ge--;return T}function B(){if(T=O<Ge?H(te,O++):0,ee++,T===10)ee=1,ge++;return T}function Y(){return H(te,O)}function de(){return O}function he(i,n){return j(te,i,n)}function re(i){switch(i){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 We(i){return ge=ee=1,Ge=R(te=i),O=0,[]}function je(i){return te="",i}function ye(i){return ue(he(O-1,Me(i===91?i+2:i===40?i+1:i)))}function Ye(i){while(T=Y())if(T<33)B();else break;return re(i)>2||re(T)>3?"":" "}function qe(i,n){while(--n&&B())if(T<48||T>102||T>57&&T<65||T>70&&T<97)break;return he(i,de()+(n<6&&Y()==32&&B()==32))}function Me(i){while(B())switch(T){case i:return O;case 34:case 39:if(i!==34&&i!==39)Me(T);break;case 40:if(i===41)Me(i);break;case 92:B();break}return O}function Xe(i,n){while(B())if(i+T===57)break;else if(i+T===84&&Y()===47)break;return"/*"+he(n,O-1)+"*"+X(i===47?i:B())}function Ke(i){while(!re(Y()))B();return he(i,O)}function Je(i){return je(we("",null,null,null,[""],i=We(i),0,[0],i))}function we(i,n,s,d,c,l,m,f,u){var v=0,w=0,b=m,h=0,C=0,A=0,k=1,E=1,D=1,I=0,S=0,P="",Q=c,G=l,z=d,g=P;while(E)switch(A=S,S=B()){case 40:if(A!=108&&H(g,b-1)==58)I++,g+="(";else g+=ye(S);break;case 41:I--,g+=")";break;case 34:case 39:case 91:g+=ye(S);break;case 9:case 10:case 13:case 32:if(I>0){g+=X(S);break}g+=Ye(A);break;case 92:g+=qe(de()-1,7);continue;case 47:switch(Y()){case 42:case 47:if(J(bt(Xe(B(),de()),n,s,u),u),(re(A||1)==5||re(Y()||1)==5)&&R(g)&&j(g,-1,void 0)!==" ")g+=" ";break;default:g+="/"}break;case 123*k:f[v++]=R(g)*D;case 125*k:case 59:case 0:if(I>0&&S){g+=X(S);break}switch(S){case 0:case 125:E=0;case 59+w:if(D==-1)g=ne(g,/\f/g,"");if(C>0&&(R(g)-b||k===0))J(C>32?Ze(g+";",d,s,b-1,u):Ze(ne(g," ","")+";",d,s,b-2,u),u);break;case 59:g+=";";default:if(J(z=Qe(g,n,s,v,w,c,f,P,Q=[],G=[],b,l),l),S===123)if(w===0)we(g,n,z,z,Q,l,b,f,G);else{switch(h){case 99:if(H(g,3)===110)break;case 108:if(H(g,2)===97)break;default:w=0;case 100:case 109:case 115:}if(w)we(i,z,z,d&&J(Qe(i,z,z,0,0,c,f,P,c,Q=[],b,G),G),c,G,b,f,d?Q:G);else we(g,z,z,z,[""],G,0,f,G)}}v=w=C=0,k=D=1,P=g="",b=m;break;case 58:b=1+R(g),C=A;default:if(k<1){if(S==123)--k;else if(S==125&&k++==0&&Ue()==125)continue}switch(g+=X(S),S*k){case 38:D=w>0?1:(g+="\f",-1);break;case 44:if(I>0)break;f[v++]=(R(g)-1)*D,D=1;break;case 64:if(Y()===45)g+=ye(B());h=Y(),w=b=R(P=g+=Ke(de())),S++;break;case 45:if(A===45&&R(g)==2)k=0}}return l}function Qe(i,n,s,d,c,l,m,f,u,v,w,b){var h=c-1,C=c===0?l:[""],A=pe(C);for(var k=0,E=0,D=0;k<d;++k)for(var I=0,S=j(i,h+1,h=Ve(E=m[k])),P=i;I<A;++I)if(P=ue(E>0?C[I]+" "+S:ne(S,/&\f/g,C[I])))u[D++]=P;return ve(i,n,s,c===0?le:f,u,v,w,b)}function bt(i,n,s,d){return ve(i,n,s,Z,X(He()),j(i,2,-2),0,d)}function Ze(i,n,s,d,c){return ve(i,n,s,fe,j(i,0,d),j(i,d+1,-1),d,c)}function xe(i,n){var s="";for(var d=0;d<i.length;d++)s+=n(i[d],d,i,n)||"";return s}function er(i,n,s,d){switch(i.type){case me:if(i.children.length)break;case Oe:case Pe:case fe:return i.return=i.return||i.value;case Z:return"";case oe:return i.return=i.value+"{"+xe(i.children,d)+"}";case le:if(!R(i.value=i.props.join(",")))return""}return R(s=xe(i.children,d))?i.return=i.value+"{"+s+"}":""}function rr(i){var n=pe(i);return function(s,d,c,l){var m="";for(var f=0;f<n;f++)m+=i[f](s,d,c,l)||"";return m}}var nr="c4",St=t((i)=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(i),"detector"),Et=t(async()=>{let{diagram:i}=await (_("et1rsgmp"),import("./chunk-et1rsgmp.js"));return{id:nr,diagram:i}},"loader"),Tt={id:nr,detector:St,loader:Et},Ct=Tt,sr="flowchart-v2",kt=t((i)=>/^\s*(graph|flowchart)/.test(i),"detector"),Dt=t(async()=>{let{diagram:i}=await (_("a00vg115"),import("./chunk-a00vg115.js"));return{id:sr,diagram:i}},"loader"),Mt={id:sr,detector:kt,loader:Dt},_t=Mt,dr="agentflow",Lt=t((i)=>/^\s*agentflow-beta\b/.test(i),"detector"),At=t(async()=>{let{diagram:i}=await (_("xk1vkcj4"),import("./chunk-xk1vkcj4.js"));return{id:dr,diagram:i}},"loader"),It={id:dr,detector:Lt,loader:At},Rt=It,cr="swimlane",$t=t((i)=>/^\s*swimlane-beta\b/.test(i),"detector"),zt=t(async()=>{let{diagram:i}=await (_("tt9410zw"),import("./chunk-tt9410zw.js"));return{id:cr,diagram:i}},"loader"),Ft={id:cr,detector:$t,loader:zt},Ot=Ft,lr="er",Bt=t((i)=>/^\s*erDiagram/.test(i),"detector"),Pt=t(async()=>{let{diagram:i}=await (_("jpem3qvs"),import("./chunk-jpem3qvs.js"));return{id:lr,diagram:i}},"loader"),Nt={id:lr,detector:Bt,loader:Pt},Vt=Nt,fr="gitGraph",Gt=t((i)=>/^\s*gitGraph/.test(i),"detector"),Ht=t(async()=>{let{diagram:i}=await (_("4py9sndw"),import("./chunk-4py9sndw.js"));return{id:fr,diagram:i}},"loader"),Ut={id:fr,detector:Gt,loader:Ht},Wt=Ut,mr="gantt",Yt=t((i)=>/^\s*gantt/.test(i),"detector"),qt=t(async()=>{let{diagram:i}=await (_("0jbf73pr"),import("./chunk-0jbf73pr.js"));return{id:mr,diagram:i}},"loader"),Xt={id:mr,detector:Yt,loader:qt},Qt=Xt,ur="info",Zt=t((i)=>/^\s*info/.test(i),"detector"),Jt=t(async()=>{let{diagram:i}=await (_("yn4t5s9r"),import("./chunk-yn4t5s9r.js"));return{id:ur,diagram:i}},"loader"),ea={id:ur,detector:Zt,loader:Jt},pr="pie",ta=t((i)=>/^\s*pie/.test(i),"detector"),aa=t(async()=>{let{diagram:i}=await (_("3p9w8sg5"),import("./chunk-3p9w8sg5.js"));return{id:pr,diagram:i}},"loader"),ia={id:pr,detector:ta,loader:aa},gr="quadrantChart",oa=t((i)=>/^\s*quadrantChart/.test(i),"detector"),na=t(async()=>{let{diagram:i}=await (_("fnvgdvrg"),import("./chunk-fnvgdvrg.js"));return{id:gr,diagram:i}},"loader"),sa={id:gr,detector:oa,loader:na},da=sa,vr="xychart",ca=t((i)=>/^\s*xychart(-beta)?/.test(i),"detector"),la=t(async()=>{let{diagram:i}=await (_("h1k2kqbs"),import("./chunk-h1k2kqbs.js"));return{id:vr,diagram:i}},"loader"),fa={id:vr,detector:ca,loader:la},ma=fa,hr="requirement",ua=t((i)=>/^\s*requirement(Diagram)?/.test(i),"detector"),pa=t(async()=>{let{diagram:i}=await (_("2y1avvqj"),import("./chunk-2y1avvqj.js"));return{id:hr,diagram:i}},"loader"),ga={id:hr,detector:ua,loader:pa},va=ga,yr="sequence",ha=t((i)=>/^\s*sequenceDiagram/.test(i),"detector"),ya=t(async()=>{let{diagram:i}=await (_("97t3ngqf"),import("./chunk-97t3ngqf.js"));return{id:yr,diagram:i}},"loader"),wa={id:yr,detector:ha,loader:ya},xa=wa,wr="classDiagram",ba=t((i)=>/^\s*classDiagram/.test(i),"detector"),Sa=t(async()=>{let{diagram:i}=await (_("5cwxhhae"),import("./chunk-5cwxhhae.js"));return{id:wr,diagram:i}},"loader"),Ea={id:wr,detector:ba,loader:Sa},Ta=Ea,br="stateDiagram",Ca=t((i)=>/^\s*stateDiagram/.test(i),"detector"),ka=t(async()=>{let{diagram:i}=await (_("ct7z7bea"),import("./chunk-ct7z7bea.js"));return{id:br,diagram:i}},"loader"),_a={id:br,detector:Ca,loader:ka},La=_a,Sr="journey",Aa=t((i)=>/^\s*journey/.test(i),"detector"),Ia=t(async()=>{let{diagram:i}=await (_("q4vy3dkk"),import("./chunk-q4vy3dkk.js"));return{id:Sr,diagram:i}},"loader"),Ra={id:Sr,detector:Aa,loader:Ia},$a=Ra,be=4,ce=75,za=t((i)=>{let n=[];for(let c of i.split(/\s+/)){let l=[...c];while(l.length>ce)n.push(l.slice(0,ce).join("")),l=l.slice(ce);if(l.length>0)n.push(l.join(""))}let s=[],d="";for(let c of n){let l=d?`${d} ${c}`:c;if([...l].length>ce)s.push(d),d=c;else d=l}if(d)s.push(d);if(s.length>be){s.length=be;let c=s[be-1]??"";s[be-1]=`${[...c].slice(0,ce-3).join("")}...`}return s},"wrapErrorMessage"),Fa=t((i,n,s,d)=>{a.debug(`rendering svg for syntax error
|
|
2
|
+
`);let c=V(n),l=c.append("g"),m=za(d?.db.getErrorMessage?.()??""),f=m.length>0?500+m.length*56:512;c.attr("viewBox",`0 0 2412 ${f}`),F(c,100,f,!0),l.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"),l.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"),l.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"),l.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"),l.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"),l.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"),l.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"),l.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${s}`),m.forEach((u,v)=>{l.append("text").attr("class","error-text").attr("x",1440).attr("y",510+v*56).attr("font-size","42px").style("text-anchor","middle").text(u)})},"draw"),Er={draw:Fa},Ba=Er,_e,Pa={clear(){_e=void 0},setErrorMessage(i){_e=i},getErrorMessage(){return _e}},Va={db:Pa,renderer:Er,parser:{parse:t(()=>{return},"parse")}},Ga=Va,Tr="flowchart-elk",Ha=t((i,n={})=>{if(/^\s*flowchart-elk/.test(i))return n.layout="elk",!0;return!1},"detector"),Ua=t(async()=>{let{diagram:i}=await (_("a00vg115"),import("./chunk-a00vg115.js"));return{id:Tr,diagram:i}},"loader"),Wa={id:Tr,detector:Ha,loader:Ua},ja=Wa,Cr="timeline",Ya=t((i)=>/^\s*timeline/.test(i),"detector"),qa=t(async()=>{let{diagram:i}=await (_("vk7ch6fh"),import("./chunk-vk7ch6fh.js"));return{id:Cr,diagram:i}},"loader"),Xa={id:Cr,detector:Ya,loader:qa},Ka=Xa,kr="mindmap",Qa=t((i)=>/^\s*mindmap/.test(i),"detector"),Za=t(async()=>{let{diagram:i}=await (_("y9waq403"),import("./chunk-y9waq403.js"));return{id:kr,diagram:i}},"loader"),Ja={id:kr,detector:Qa,loader:Za},ei=Ja,Mr="kanban",ri=t((i)=>/^\s*kanban/.test(i),"detector"),ti=t(async()=>{let{diagram:i}=await (_("qq06x2ce"),import("./chunk-qq06x2ce.js"));return{id:Mr,diagram:i}},"loader"),ai={id:Mr,detector:ri,loader:ti},oi=ai,_r="sankey",ni=t((i)=>/^\s*sankey(-beta)?/.test(i),"detector"),di=t(async()=>{let{diagram:i}=await (_("2x7vmhm0"),import("./chunk-2x7vmhm0.js"));return{id:_r,diagram:i}},"loader"),ci={id:_r,detector:ni,loader:di},fi=ci,Lr="packet",mi=t((i)=>/^\s*packet(-beta)?/.test(i),"detector"),ui=t(async()=>{let{diagram:i}=await (_("a6g3nqp0"),import("./chunk-a6g3nqp0.js"));return{id:Lr,diagram:i}},"loader"),pi={id:Lr,detector:mi,loader:ui},Ar="radar",gi=t((i)=>/^\s*radar-beta/.test(i),"detector"),vi=t(async()=>{let{diagram:i}=await (_("1xm9x7d6"),import("./chunk-1xm9x7d6.js"));return{id:Ar,diagram:i}},"loader"),hi={id:Ar,detector:gi,loader:vi},Ir="block",yi=t((i)=>/^\s*block(-beta)?/.test(i),"detector"),wi=t(async()=>{let{diagram:i}=await (_("xvm66b7v"),import("./chunk-xvm66b7v.js"));return{id:Ir,diagram:i}},"loader"),xi={id:Ir,detector:yi,loader:wi},bi=xi,Rr="treeView",Si=t((i)=>/^\s*treeView-beta/.test(i),"detector"),Ei=t(async()=>{let{diagram:i}=await (_("3wpxymxa"),import("./chunk-3wpxymxa.js"));return{id:Rr,diagram:i}},"loader"),Ti={id:Rr,detector:Si,loader:Ei},Ci=Ti,$r="architecture",ki=t((i)=>/^\s*architecture/.test(i),"detector"),Di=t(async()=>{let{diagram:i}=await (_("8j4tzff5"),import("./chunk-8j4tzff5.js"));return{id:$r,diagram:i}},"loader"),Mi={id:$r,detector:ki,loader:Di},_i=Mi,zr="eventmodeling",Li=t((i)=>/^\s*eventmodeling/.test(i),"detector"),Ai=t(async()=>{let{diagram:i}=await (_("jh3k7xex"),import("./chunk-jh3k7xex.js"));return{id:zr,diagram:i}},"loader"),Ii={id:zr,detector:Li,loader:Ai},Ri=Ii,Fr="ishikawa",Oi=t((i)=>/^\s*ishikawa(-beta)?\b/i.test(i),"detector"),Pi=t(async()=>{let{diagram:i}=await (_("e57h40qa"),import("./chunk-e57h40qa.js"));return{id:Fr,diagram:i}},"loader"),Ni={id:Fr,detector:Oi,loader:Pi},Or="venn",Vi=t((i)=>/^\s*venn-beta/.test(i),"detector"),Gi=t(async()=>{let{diagram:i}=await (_("p6e2vr51"),import("./chunk-p6e2vr51.js"));return{id:Or,diagram:i}},"loader"),Hi={id:Or,detector:Vi,loader:Gi},Wi=Hi,Br="treemap",ji=t((i)=>/^\s*treemap/.test(i),"detector"),Yi=t(async()=>{let{diagram:i}=await (_("v4cqc9f9"),import("./chunk-v4cqc9f9.js"));return{id:Br,diagram:i}},"loader"),qi={id:Br,detector:ji,loader:Yi},Pr="usecase",Ki=t((i)=>/^\s*usecase-beta(?:\s|$)/.test(i),"detector"),Qi=t(async()=>{let{diagram:i}=await (_("dmha2y9c"),import("./chunk-dmha2y9c.js"));return{id:Pr,diagram:i}},"loader"),Zi={id:Pr,detector:Ki,loader:Qi},Nr="wardley",Ji=t((i)=>/^\s*wardley-beta/i.test(i),"detector"),ro=t(async()=>{let{diagram:i}=await (_("jh33m2mq"),import("./chunk-jh33m2mq.js"));return{id:Nr,diagram:i}},"loader"),to={id:Nr,detector:Ji,loader:ro},ao=to,Vr="cynefin",io=t((i)=>/^\s*cynefin-beta(?:[\s:]|$)/.test(i),"detector"),oo=t(async()=>{let{diagram:i}=await (_("g7hqafb8"),import("./chunk-g7hqafb8.js"));return{id:Vr,diagram:i}},"loader"),no={id:Vr,detector:io,loader:oo},Ur="railroad",so=t((i)=>/^\s*railroad-beta/i.test(i),"detector"),lo=t(async()=>{let{diagram:i}=await (_("zqcg6frm"),import("./chunk-zqcg6frm.js"));return{id:Ur,diagram:i}},"loader"),vo={id:Ur,detector:so,loader:lo},jr="railroadEbnf",ho=t((i)=>/^\s*railroad-ebnf-beta/i.test(i),"detector"),yo=t(async()=>{let{diagram:i}=await (_("xe121vg7"),import("./chunk-xe121vg7.js"));return{id:jr,diagram:i}},"loader"),xo={id:jr,detector:ho,loader:yo},Yr="railroadAbnf",bo=t((i)=>/^\s*railroad-abnf-beta/i.test(i),"detector"),So=t(async()=>{let{diagram:i}=await (_("9k7fkx80"),import("./chunk-9k7fkx80.js"));return{id:Yr,diagram:i}},"loader"),Eo={id:Yr,detector:bo,loader:So},qr="railroadPeg",To=t((i)=>/^\s*railroad-peg-beta/i.test(i),"detector"),Co=t(async()=>{let{diagram:i}=await (_("atppv8fk"),import("./chunk-atppv8fk.js"));return{id:qr,diagram:i}},"loader"),ko={id:qr,detector:To,loader:Co},tr=!1,Te=t(()=>{if(tr)return;tr=!0,Hr("error",Ga,(i)=>i.toLowerCase().trim()==="error"),Hr("---",{db:{clear:t(()=>{},"clear")},styles:{},renderer:{draw:t(()=>{},"draw")},parser:{parse:t(()=>{throw 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:t(()=>null,"init")},(i)=>i.toLowerCase().trimStart().startsWith("---")),Da(ja,ei,_i),Da(Rt,Ct,oi,Ta,Vt,Qt,ea,ia,va,xa,Ot,_t,Ka,Wt,La,$a,da,fi,pi,ma,bi,Ri,Ci,hi,Ni,qi,vo,xo,Eo,ko,Wi,ao,no,Zi)},"addDiagrams"),Do=t(async()=>{a.debug("Loading registered diagrams");let n=(await Promise.allSettled(Object.entries(Tn).map(async([s,{detector:d,loader:c}])=>{if(!c)return;try{Oa(s)}catch{try{let{diagram:l,id:m}=await c();Hr(m,l,d)}catch(l){throw a.error(`Failed to load external diagram with key ${s}. Removing from detectors.`),delete Tn[s],l}}}))).filter((s)=>s.status==="rejected");if(n.length>0){a.error(`Failed to load ${n.length} external diagrams`);for(let s of n)a.error(s);throw Error(`Failed to load ${n.length} external diagrams`)}},"loadRegisteredDiagrams"),Mo="graphics-document document";function Xr(i,n){if(i.attr("role",Mo),n!=="")i.attr("aria-roledescription",n)}t(Xr,"setA11yDiagramInfo");function Qr(i,n,s,d){if(i.insert===void 0)return;if(s){let c=`chart-desc-${d}`;i.attr("aria-describedby",c),i.insert("desc",":first-child").attr("id",c).text(s)}if(n){let c=`chart-title-${d}`;i.attr("aria-labelledby",c),i.insert("title",":first-child").attr("id",c).text(n)}}t(Qr,"addSVGa11yTitleDescription");var Se=class i{constructor(n,s,d,c,l){this.type=n,this.text=s,this.db=d,this.parser=c,this.renderer=l}static{t(this,"Diagram")}static async fromText(n,s={}){let d=typeof n==="string"?{raw:n,cleaned:n}:n,c=x(),l=xr(d.cleaned,c);try{Oa(l)}catch{let h=co(l);if(!h)throw new Bi(`Diagram ${l} not found.`);let{id:C,diagram:A}=await h();Hr(C,A)}let{db:m,parser:f,renderer:u,init:v}=Oa(l);if(f.parser)f.parser.yy=m;if(m.clear?.(),v?.(c),s.title)m.setDiagramTitle?.(s.title);let w=d.cleaned;if(m.preserveCommentsWhenParsing&&d.withComments){let h=c.maxTextSize??N.maxTextSize;if(d.withComments.length>h)a.warn(`Comment-preserving source exceeds maxTextSize (${d.withComments.length} > ${h}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`);else w=d.withComments}let b=wo(w)+`
|
|
3
|
+
`;if(d.frontmatterLineOffset)m.setFrontmatterLineOffset?.(d.frontmatterLineOffset);return await f.parse(b),new i(l,b,m,f,u)}async render(n,s){await this.renderer.draw(this.text,n,s,this)}getParser(){return this.parser}getType(){return this.type}},ar=[],Lo=t(()=>{ar.forEach((i)=>{i()}),ar=[]},"attachFunctions"),Ao=t((i)=>i.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Zr(i){let n=$i(i);if(!n)return{text:i,metadata:{}};let s=n.indent,d=s?n.body.split(`
|
|
4
4
|
`).map((m)=>m.startsWith(s)?m.slice(s.length):m).join(`
|
|
5
|
-
`):n.body,c=
|
|
6
|
-
`).replace(/<(\w+)([^>]*)>/g,(n,s,d)=>"<"+s+d.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Ro=t((i)=>{let{text:n,metadata:s}=Zr(i),{displayMode:d,title:c,config:l={}}=s;if(d){if(!l.gantt)l.gantt={};l.gantt.displayMode=d}return{title:c,config:l,text:n}},"processFrontmatter"),$o=t((i)=>{let n=
|
|
5
|
+
`):n.body,c=rt(d,{schema:nt})??{};c=typeof c==="object"&&!Array.isArray(c)?c:{};let l={};if(c.displayMode)l.displayMode=c.displayMode.toString();if(c.title)l.title=c.title.toString();if(c.config)l.config=c.config;return{text:i.slice(n.length),metadata:l}}t(Zr,"extractFrontMatter");var Io=t((i)=>i.replace(/\r\n?/g,`
|
|
6
|
+
`).replace(/<(\w+)([^>]*)>/g,(n,s,d)=>"<"+s+d.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Ro=t((i)=>{let{text:n,metadata:s}=Zr(i),{displayMode:d,title:c,config:l={}}=s;if(d){if(!l.gantt)l.gantt={};l.gantt.displayMode=d}return{title:c,config:l,text:n}},"processFrontmatter"),$o=t((i)=>{let n=M.detectInit(i)??{},s=M.detectDirective(i,"wrap");if(Array.isArray(s))n.wrap=s.some(({type:d})=>d==="wrap");else if(s?.type==="wrap")n.wrap=!0;return{text:_o(i),directive:n}},"processDirectives");function Ie(i){let n=i,s=Io(i),d=Ro(s),c=$o(d.text),l=U(d.config,c.directive),m=c.text,f=Ao(m),u=s.length>d.text.length?(s.substring(0,s.length-d.text.length).match(/\n/g)??[]).length:0;return{code:{raw:n,cleaned:f,withComments:m,frontmatterLineOffset:u},title:d.title,config:l}}t(Ie,"preprocessDiagram");function Jr(i){let n=new TextEncoder().encode(i),s=Array.from(n,(d)=>String.fromCodePoint(d)).join("");return btoa(s)}t(Jr,"toBase64");var zo=50000,Fo="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Oo="sandbox",Bo="loose",Po="http://www.w3.org/2000/svg",No="http://www.w3.org/1999/xlink",Vo="http://www.w3.org/1999/xhtml",Go="100%",Ho="100%",Uo="border:0;margin:0;",Wo="margin:0",jo="allow-top-navigation-by-user-activation allow-popups",Yo='The "iframe" tag is not supported by your browser.',qo=["foreignobject"],Xo=["dominant-baseline"];function $e(i){let n=Ie(i);Wr();let s;try{s=xr(n.code.cleaned,x())}catch{s=void 0}return Na(s),fo(n.config??{}),n}t($e,"processAndSetConfigs");async function et(i,n){Te();try{let{code:s,config:d}=$e(i);return{diagramType:(await Se.fromText(s)).type,config:d}}catch(s){if(n?.suppressErrors)return!1;throw s}finally{Na(void 0)}}t(et,"parse");var ir=t((i,n,s=[])=>{let d=Fi(`{ ${s.join(" !important; ")} !important; }`);return`.${i} ${n} ${d}`},"cssImportantStyles"),Ko=t((i,n=new Map)=>{let s=new CSSStyleSheet;if(i.fontFamily!==void 0)s.insertRule(`:root { --mermaid-font-family: ${i.fontFamily}}`,s.cssRules.length);if(i.altFontFamily!==void 0)s.insertRule(`:root { --mermaid-alt-font-family: ${i.altFontFamily}}`,s.cssRules.length);if(n instanceof Map){let f=ke(i)?["> *","span"]:["rect","polygon","ellipse","circle","path"];n.forEach((u)=>{if(!De(u.styles))f.forEach((v)=>{s.insertRule(ir(u.id,v,u.styles),s.cssRules.length)});if(!De(u.textStyles))s.insertRule(ir(u.id,"tspan",(u?.textStyles||[]).map((v)=>v.replace("color","fill"))),s.cssRules.length)})}let d="";if(i.themeCSS!==void 0)if(typeof s.replaceSync==="function"){let c=new CSSStyleSheet;c.replaceSync(i.themeCSS),d=Ma(c)+`
|
|
7
7
|
`}else d+=`${i.themeCSS}
|
|
8
|
-
`;return d+
|
|
8
|
+
`;return d+Ma(s)},"createCssStyles"),Qo=t((i,n)=>xe(Je(`${i}{${n}}`),rr([t(function(d,c,l,m){if(d.type==="rule"&&Array.isArray(d.props)){if(d.parent&&d.parent.type===oe)return;d.props=d.props.map((f)=>{if(f===i&&Array.isArray(d.children)&&d.children.every((v)=>{if(v.type!=="decl")return!1;return new Set(["font-family","font-size","fill"]).has(v.props)}))return f;if(!((f.startsWith(`${i} `)||f.startsWith(`${i}>`))&&!f.startsWith(`${i} ||`)))return`${i} ${f}`;return f})}else if(d.type.startsWith("@")){if(![Fe,Be,me,Ne,"@container","@starting-style",oe].includes(d.type))a.warn(`Removing unsupported at-rule ${d.type} from CSS`),d.type=Z}},"addNamespace"),er])),"compileCSS"),Zo=t((i,n,s,d)=>{let c=Ko(i,s),l=go(n,c,{...i.themeVariables,theme:i.theme,look:i.look},d);return Qo(d,l)},"createUserStyles"),Jo=t((i="",n,s)=>{let d=i;if(!s&&!n)d=d.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,'marker-end="url(#');return d=jt(d),d=d.replace(/<br>/g,"<br/>"),d},"cleanUpSvgCode"),en=t((i="",n)=>{let s=n?.viewBox?.baseVal?.height?n.viewBox.baseVal.height+"px":Ho,d=Jr(`<body style="${Wo}">${i}</body>`);return`<iframe style="width:${Go};height:${s};${Uo}" src="data:text/html;charset=UTF-8;base64,${d}" sandbox="${jo}">
|
|
9
9
|
${Yo}
|
|
10
|
-
</iframe>`},"putIntoIFrame"),or=t((i,n,s,d,c)=>{let l=i.append("div");if(l.attr("id",s),d)l.attr("style",d);let m=l.append("svg").attr("id",n).attr("width","100%").attr("xmlns",Po);if(c)m.attr("xmlns:xlink",c);return m.append("g"),i},"appendDivSvgG");function Ae(i,n){return i.append("iframe").attr("id",n).attr("style","width: 100%; height: 100%;").attr("sandbox","")}t(Ae,"sandboxedIframe");var
|
|
10
|
+
</iframe>`},"putIntoIFrame"),or=t((i,n,s,d,c)=>{let l=i.append("div");if(l.attr("id",s),d)l.attr("style",d);let m=l.append("svg").attr("id",n).attr("width","100%").attr("xmlns",Po);if(c)m.attr("xmlns:xlink",c);return m.append("g"),i},"appendDivSvgG");function Ae(i,n){return i.append("iframe").attr("id",n).attr("style","width: 100%; height: 100%;").attr("sandbox","")}t(Ae,"sandboxedIframe");var rn=t((i,n,s,d)=>{i.getElementById(n)?.remove(),i.getElementById(s)?.remove(),i.getElementById(d)?.remove()},"removeExistingElements"),tn=t(async function(i,n,s){Te();let d=$e(n),c=d.code;n=c.cleaned;let l=x();if(a.debug(l),n.length>(l?.maxTextSize??zo))n=Fo,c={raw:n,cleaned:n};let m=`#${i}`,f="i"+i,u="#"+f,v="d"+i,w="#"+v,b=t(()=>{let ie=p(C?u:w).node();if(ie&&"remove"in ie)ie.remove()},"removeTempElements"),h=p(document.body),C=l.securityLevel===Oo,A=l.securityLevel===Bo,k=l.fontFamily;if(s!==void 0){if(s)s.innerHTML="";if(C){let L=Ae(p(s),f);h=p(L.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=p(s);or(h,i,v,`font-family: ${k}`,No)}else{if(rn(document,i,v,f),C){let L=Ae(p(document.body),f);h=p(L.nodes()[0].contentDocument.body),h.node().style.margin="0"}else h=p("body");or(h,i,v)}let E,D;try{E=await Se.fromText(c,{title:d.title})}catch(L){if(l.suppressErrorRendering)throw b(),L;E=await Se.fromText("error"),D=L,E.db.setErrorMessage?.(Xi(L))}let I=h.select(w).node(),S=E.type,P=I.firstChild,Q=P.firstChild,G=E.renderer.getClasses?.(n,E),z=Zo(l,S,G,m),g=document.createElement("style");g.innerHTML=z,P.insertBefore(g,Q);try{await E.renderer.draw(n,i,"12.2.0",E)}catch(L){if(l.suppressErrorRendering)b();else Ba.draw(n,i,"12.2.0");throw L}let gt=h.select(`${w} svg`),vt=E.db.getAccTitle?.(),yt=E.db.getAccDescription?.();at(S,gt,vt,yt);let wt=t(()=>{h.select(`[id="${i}"]`).selectAll("foreignobject > *").attr("xmlns",Vo);let L=h.select(w).node().innerHTML;if(a.debug("config.arrowMarkerAbsolute",l.arrowMarkerAbsolute),L=Jo(L,C,ht(l.arrowMarkerAbsolute)),C){let ie=h.select(w+" svg").node();L=en(L,ie)}else if(!A)L=Re.sanitize(L,{ADD_TAGS:qo,ADD_ATTR:Xo,HTML_INTEGRATION_POINTS:{foreignobject:!0}});return Lo(),L},"serializeSvg")();if(D)throw D;return b(),{diagramType:S,svg:wt,bindFunctions:E.db.bindFunctions}},"renderDiagram"),an=t(async function(i,n,s){try{return await tn(i,n,s)}finally{Na(void 0)}},"render");function tt(i={}){let n=se({},i);if(n?.fontFamily&&!n.themeVariables?.fontFamily){if(!n.themeVariables)n.themeVariables={};n.themeVariables.fontFamily=n.fontFamily}po(n);let s=on.theme;if(n?.theme&&Object.hasOwn(Kt,n.theme))n.themeVariables=Kt[n.theme].getThemeVariables(n.themeVariables);else if(n){if(n.theme!=null&&n.theme!=="null")n.theme=s;n.themeVariables=Kt[s].getThemeVariables(n.themeVariables)}let d=typeof n==="object"?uo(n):zi();Gr(d.logLevel),Te()}t(tt,"initialize");var nn=t((i,n={})=>{let{code:s}=Ie(i);return Se.fromText(s,n)},"getDiagramFromText");function at(i,n,s,d){Xr(n,i),Qr(n,s,d,n.attr("id"))}t(at,"addA11yInfo");var K=Object.freeze({render:an,parse:et,getDiagramFromText:nn,initialize:tt,getConfig:x,setConfig:Ui,getSiteConfig:zi,updateSiteConfig:mo,reset:t(()=>{Wr()},"reset"),globalReset:t(()=>{Wr(on)},"globalReset"),defaultConfig:on});Gr(x().logLevel);Wr(x());var sn=t((i,n,s)=>{if(a.warn(i),si(i)){if(s)s(i.str,i.hash);n.push({...i,message:i.str,error:i})}else{if(s)s(i);if(i instanceof Error)n.push({str:i.message,message:i.message,hash:i.name,error:i})}},"handleError"),it=t(async function(i={querySelector:".mermaid"}){try{await dn(i)}catch(n){if(si(n))a.error(n.str);if(q.parseError)q.parseError(n);if(!i.suppressErrors)throw a.error("Use the suppressErrors option to suppress these errors"),n}},"run"),dn=t(async function({postRenderCallback:i,querySelector:n,nodes:s}={querySelector:".mermaid"}){let d=K.getConfig();a.debug(`${!i?"No ":""}Callback function found`);let c;if(s)c=s;else if(n)c=document.querySelectorAll(n);else throw Error("Nodes and querySelector are both undefined");if(a.debug(`Found ${c.length} diagrams`),d?.startOnLoad!==void 0)a.debug("Start On Load: "+d?.startOnLoad),K.updateSiteConfig({startOnLoad:d?.startOnLoad});let l=new M.InitIDGenerator(d.deterministicIds,d.deterministicIDSeed),m,f=[];for(let u of Array.from(c)){if(a.info("Rendering diagram: "+u.id),u.getAttribute("data-processed"))continue;u.setAttribute("data-processed","true");let v=`mermaid-${l.next()}`;m=u.innerHTML,m=li(M.entityDecode(m)).trim().replace(/<br\s*\/?>/gi,"<br/>");let w=M.detectInit(m);if(w)a.debug("Detected early reinit: ",w);try{let{svg:b,bindFunctions:h}=await ct(v,m,u);if(u.innerHTML=b,i)await i(v);if(h)h(u)}catch(b){sn(b,f,q.parseError)}}if(f.length>0)throw f[0]},"runThrowsErrors"),ot=t(function(i){K.initialize(i)},"initialize"),cn=t(async function(i,n,s){if(a.warn("mermaid.init is deprecated. Please use run instead."),i)ot(i);let d={postRenderCallback:s,querySelector:".mermaid"};if(typeof n==="string")d.querySelector=n;else if(n)if(n instanceof HTMLElement)d.nodes=[n];else d.nodes=n;await it(d)},"init"),ln=t(async(i,{lazyLoad:n=!0}={})=>{if(Te(),Da(...i),n===!1)await Do()},"registerExternalDiagrams"),st=t(function(){if(q.startOnLoad){let{startOnLoad:i}=K.getConfig();if(i)q.run().catch((n)=>a.error("Mermaid failed to initialize",n))}},"contentLoaded");if(typeof document<"u")window.addEventListener("load",st,!1);var fn=t(function(i){q.parseError=i},"setParseErrorHandler"),Ee=[],Le=!1,dt=t(async()=>{if(Le)return;Le=!0;while(Ee.length>0){let i=Ee.shift();if(i)try{await i()}catch(n){a.error("Error executing queue",n)}}Le=!1},"executeQueue"),mn=t(async(i,n)=>new Promise((s,d)=>{let c=t(()=>new Promise((l,m)=>{K.parse(i,n).then((f)=>{l(f),s(f)},(f)=>{a.error("Error parsing",f),q.parseError?.(f),m(f),d(f)})}),"performCall");Ee.push(c),dt().catch(d)}),"parse"),ct=t((i,n,s)=>new Promise((d,c)=>{let l=t(()=>new Promise((m,f)=>{K.render(i,n,s).then((u)=>{m(u),d(u)},(u)=>{a.error("Error parsing",u),q.parseError?.(u),f(u),c(u)})}),"performCall");Ee.push(l),dt().catch(c)}),"render"),pn=t(()=>Object.keys(Tn).map((i)=>({id:i})),"getRegisteredDiagramsMetadata"),q={startOnLoad:!0,mermaidAPI:K,parse:mn,render:ct,init:cn,run:it,registerExternalDiagrams:ln,registerLayoutLoaders:eo,initialize:ot,parseError:void 0,contentLoaded:st,setParseErrorHandler:fn,detectType:xr,registerIconPacks:In,getRegisteredDiagramsMetadata:pn},Ce=q;/*! Check if previously processed *//*!
|
|
11
11
|
* Wait for document loaded before starting the execution
|
|
12
12
|
*/function lt(i,n){if(!(n instanceof Error)||!("hash"in n))return;let s=n.hash;if(typeof s!=="object"||s===null)return;if(!("token"in s)||s.token!=="LINK_ID")return;if(!("text"in s)||typeof s.text!=="string"||!s.text.endsWith("@"))return;if(!("line"in s)||typeof s.line!=="number"||!Number.isInteger(s.line))return;let d=i.split(`
|
|
13
13
|
`),c=d[s.line];if(c===void 0)return;let l=c.lastIndexOf(s.text);if(l<0)return;let m=l+s.text.length-1;return d[s.line]=`${c.slice(0,m)}@${c.slice(m+1)}`,d.join(`
|
|
@@ -18,4 +18,4 @@ import{_,o,Y,r,e,y}from"./chunk-kahab58k.js";import{t,a,jr,Re,Pi,Oi,kn,vr,La,so,
|
|
|
18
18
|
.edgeLabel, .edgeLabel p, .edgeLabel rect { border-radius: 999px; font-size: 12px; }
|
|
19
19
|
.edgeLabel p { padding: 1px 6px; }
|
|
20
20
|
.cluster rect { rx: 12px; ry: 12px; stroke-dasharray: 4 3; }
|
|
21
|
-
`}var gn=60,ae=new Map;function ut(i,n,s=""){return`${n}:${s}:${i}`}function vn(i,n){if(ae.size>=gn){let s=ae.keys().next().value;if(s!==void 0)ae.delete(s)}ae.set(i,n)}var pt;function hn(i,n,s){let d=s??i;if(pt===d)return;
|
|
21
|
+
`}var gn=60,ae=new Map;function ut(i,n,s=""){return`${n}:${s}:${i}`}function vn(i,n){if(ae.size>=gn){let s=ae.keys().next().value;if(s!==void 0)ae.delete(s)}ae.set(i,n)}var pt;function hn(i,n,s){let d=s??i;if(pt===d)return;Ce.initialize({startOnLoad:!1,suppressErrorRendering:!0,securityLevel:"strict",theme:"base",themeVariables:ft(i,n),themeCSS:mt(i),fontFamily:n?.fonts?.sans||"var(--font-sans)",flowchart:{useMaxWidth:!1,curve:"basis",padding:14,nodeSpacing:44,rankSpacing:56},sequence:{useMaxWidth:!1},state:{useMaxWidth:!1},class:{useMaxWidth:!1},er:{useMaxWidth:!1},gantt:{useMaxWidth:!1},mindmap:{useMaxWidth:!1},timeline:{useMaxWidth:!1}}),pt=d}var yn=0,wn=32;async function xn(i,n,s,d,c){hn(n,d,c);let l=`${s}-${++yn}`,m=i,f=0;try{while(!0)try{let{svg:u}=await Ce.render(l,m);return u.replace(/filter="url\(#[^"]+\)"/g,"").replace(/filter:\s*url\(#[^)]+\);?/g,"")}catch(u){let v=f<wn?lt(m,u):void 0;if(!v)throw u;m=v,f+=1}}finally{document.getElementById(`d${l}`)?.remove()}}var bn=(i)=>i instanceof Error?i.message:String(i);function Ts(i){let n=y(),s=n.useTheme?.(),d=n.useColorScheme?.(),c=s?.resolved??d??"light",l=s?.tokens,m=s?.themeID?`${s.themeID}-${c}`:c,f=`mermaid-${W().replace(/[^\w-]/g,"")}`,u=i.code.trim(),[v,w]=r(()=>ae.get(ut(u,c,m))),[b,h]=r(),[C,A]=r(!v);return o(()=>{let k=ut(u,c,m),E=ae.get(k);if(E){w(E),h(void 0),A(!1);return}let D=!0;A(!0);let I=setTimeout(async()=>{try{if(i.streaming&&!await Ce.parse(u,{suppressErrors:!0})){if(D)A(!1);return}let S=await xn(u,c,f,l,m);if(vn(k,S),!D)return;w(S),h(void 0)}catch(S){if(D)h(bn(S))}if(D)A(!1)},i.streaming?200:0);return()=>{D=!1,clearTimeout(I)}},[u,c,m,l,i.streaming,f]),e(ra,{title:"流程图",code:i.code,codeLang:"mermaid",rendered:Boolean(v),pending:C,streaming:i.streaming,error:b,children:e("div",{role:"img","aria-label":"Mermaid 流程图",className:"flex overflow-x-auto px-6 py-7 [background-image:radial-gradient(var(--color-line)_1px,transparent_1px)] [background-size:16px_16px] [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:v??""}})})}export{Ts as MermaidBlock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{pi}from"./chunk-mykrm8ba.js";export{pi as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ri}from"./chunk-a9er7a7c.js";export{Ri as createInfoServices};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G}from"./chunk-p1yc8hwn.js";import{t,a,M,x,O,yt,C,S,E,T,A,L,R,l,p,V,Vi,An,rt,U,ze,Le}from"./chunk-e763h2px.js";import{Q}from"./chunk-xjc5fmcr.js";import{ht,gr}from"./chunk-3b4wqmnh.js";import{Se,Te}from"./chunk-kahab58k.js";var ft=Te(function(it,st){(function(i,s){if(typeof it==="object"&&typeof st==="object")st.exports=s(gr());else if(typeof define==="function"&&define.amd)define(["cose-base"],s);else if(typeof it==="object")it.cytoscapeFcose=s(gr());else i.cytoscapeFcose=s(i.coseBase)})(it,function(e){return(()=>{var i={658:(N)=>{N.exports=Object.assign!=null?Object.assign.bind(Object):function(B){for(var v=arguments.length,b=Array(v>1?v-1:0),c=1;c<v;c++)b[c-1]=arguments[c];return b.forEach(function(y){Object.keys(y).forEach(function(d){return B[d]=y[d]})}),B}},548:(N,B,v)=>{var b=function(){function d(f,u){var g=[],r=!0,_=!1,F=void 0;try{for(var o=f[Symbol.iterator](),h;!(r=(h=o.next()).done);r=!0)if(g.push(h.value),u&&g.length===u)break}catch(k){_=!0,F=k}finally{try{if(!r&&o.return)o.return()}finally{if(_)throw F}}return g}return function(f,u){if(Array.isArray(f))return f;else if(Symbol.iterator in Object(f))return d(f,u);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=v(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(d){var f={};for(var u=0;u<d.length;u++)f[d[u].id()]=!0;var g=d.filter(function(r,_){if(typeof r==="number")r=_;var F=r.parent()[0];while(F!=null){if(f[F.id()])return!1;F=F.parent()[0]}return!0});return g},y.connectComponents=function(d,f,u,g){var r=new c,_=new Set,F=[],o=void 0,h=void 0,k=void 0,n=!1,P=1,X=[],D=[],j=function(){var I=d.collection();D.push(I);var H=u[0],J=d.collection();J.merge(H).merge(H.descendants().intersection(f)),F.push(H),J.forEach(function(re){r.push(re),_.add(re),I.merge(re)});var Z=function(){H=r.shift();var ue=d.collection();H.neighborhood().nodes().forEach(function(q){if(f.intersection(H.edgesWith(q)).length>0)ue.merge(q)});for(var Ce=0;Ce<ue.length;Ce++){var $e=ue[Ce];if(o=u.intersection($e.union($e.ancestors())),o!=null&&!_.has(o[0])){var de=o.union(o.descendants());de.forEach(function(q){if(r.push(q),_.add(q),I.merge(q),u.has(q))F.push(q)})}}};while(r.length!=0)Z();if(I.forEach(function(re){f.intersection(re.connectedEdges()).forEach(function(ue){if(I.has(ue.source())&&I.has(ue.target()))I.merge(ue)})}),F.length==u.length)n=!0;if(!n||n&&P>1){h=F[0],k=h.connectedEdges().length,F.forEach(function(re){if(re.connectedEdges().length<k)k=re.connectedEdges().length,h=re}),X.push(h.id());var se=d.collection();se.merge(F[0]),F.forEach(function(re){se.merge(re)}),F=[],u=u.difference(se),P++}};do j();while(!n);if(g){if(X.length>0)g.set("dummy"+(g.size+1),X)}return D},y.relocateComponent=function(d,f,u){if(!u.fixedNodeConstraint){var{POSITIVE_INFINITY:g,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:_,NEGATIVE_INFINITY:F}=Number;if(u.quality=="draft"){var o=!0,h=!1,k=void 0;try{for(var n=f.nodeIndexes[Symbol.iterator](),P;!(o=(P=n.next()).done);o=!0){var X=P.value,D=b(X,2),j=D[0],Y=D[1],I=u.cy.getElementById(j);if(I){var H=I.boundingBox(),J=f.xCoords[Y]-H.w/2,Z=f.xCoords[Y]+H.w/2,se=f.yCoords[Y]-H.h/2,re=f.yCoords[Y]+H.h/2;if(J<g)g=J;if(Z>r)r=Z;if(se<_)_=se;if(re>F)F=re}}}catch(q){h=!0,k=q}finally{try{if(!o&&n.return)n.return()}finally{if(h)throw k}}var ue=d.x-(r+g)/2,Ce=d.y-(F+_)/2;f.xCoords=f.xCoords.map(function(q){return q+ue}),f.yCoords=f.yCoords.map(function(q){return q+Ce})}else{Object.keys(f).forEach(function(q){var oe=f[q],Ne=oe.getRect().x,ke=oe.getRect().x+oe.getRect().width,De=oe.getRect().y,xe=oe.getRect().y+oe.getRect().height;if(Ne<g)g=Ne;if(ke>r)r=ke;if(De<_)_=De;if(xe>F)F=xe});var $e=d.x-(r+g)/2,de=d.y-(F+_)/2;Object.keys(f).forEach(function(q){var oe=f[q];oe.setCenter(oe.getCenterX()+$e,oe.getCenterY()+de)})}}},y.calcBoundingBox=function(d,f,u,g){var{MAX_SAFE_INTEGER:r,MIN_SAFE_INTEGER:_,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:o}=Number,h=void 0,k=void 0,n=void 0,P=void 0,X=d.descendants().not(":parent"),D=X.length;for(var j=0;j<D;j++){var Y=X[j];if(h=f[g.get(Y.id())]-Y.width()/2,k=f[g.get(Y.id())]+Y.width()/2,n=u[g.get(Y.id())]-Y.height()/2,P=u[g.get(Y.id())]+Y.height()/2,r>h)r=h;if(_<k)_=k;if(F>n)F=n;if(o<P)o=P}var I={};return I.topLeftX=r,I.topLeftY=F,I.width=_-r,I.height=o-F,I},y.calcParentsWithoutChildren=function(d,f){var u=d.collection();return f.nodes(":parent").forEach(function(g){var r=!1;if(g.children().forEach(function(_){if(_.css("display")!="none")r=!0}),!r)u.merge(g)}),u},N.exports=y},816:(N,B,v)=>{var b=v(548),c=v(140).CoSELayout,y=v(140).CoSENode,d=v(140).layoutBase.PointD,f=v(140).layoutBase.DimensionD,u=v(140).layoutBase.LayoutConstants,g=v(140).layoutBase.FDLayoutConstants,r=v(140).CoSEConstants,_=function(o,h){var{cy:k,eles:n}=o,P=n.nodes(),X=n.edges(),D=void 0,j=void 0,Y=void 0,I={};if(o.randomize)D=h.nodeIndexes,j=h.xCoords,Y=h.yCoords;var H=function(q){return typeof q==="function"},J=function(q,oe){if(H(q))return q(oe);else return q},Z=b.calcParentsWithoutChildren(k,n),se=function de(q,oe,Ne,ke){var De=oe.length;for(var xe=0;xe<De;xe++){var W=oe[xe],Ae=null;if(W.intersection(Z).length==0)Ae=W.children();var ie=void 0,ve=W.layoutDimensions({nodeDimensionsIncludeLabels:ke.nodeDimensionsIncludeLabels});if(W.outerWidth()!=null&&W.outerHeight()!=null)if(ke.randomize)if(!W.isParent())ie=q.add(new y(Ne.graphManager,new d(j[D.get(W.id())]-ve.w/2,Y[D.get(W.id())]-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else{var Me=b.calcBoundingBox(W,j,Y,D);if(W.intersection(Z).length==0)ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(Me.width,Me.height)));else ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(parseFloat(ve.w),parseFloat(ve.h))))}else ie=q.add(new y(Ne.graphManager,new d(W.position("x")-ve.w/2,W.position("y")-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else ie=q.add(new y(this.graphManager));if(ie.id=W.data("id"),ie.nodeRepulsion=J(ke.nodeRepulsion,W),ie.paddingLeft=parseInt(W.css("padding")),ie.paddingTop=parseInt(W.css("padding")),ie.paddingRight=parseInt(W.css("padding")),ie.paddingBottom=parseInt(W.css("padding")),ke.nodeDimensionsIncludeLabels)ie.labelWidth=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ie.labelHeight=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ie.labelPosVertical=W.css("text-valign"),ie.labelPosHorizontal=W.css("text-halign");if(I[W.data("id")]=ie,isNaN(ie.rect.x))ie.rect.x=0;if(isNaN(ie.rect.y))ie.rect.y=0;if(Ae!=null&&Ae.length>0){var Ge=void 0;Ge=Ne.getGraphManager().add(Ne.newGraph(),ie),de(Ge,Ae,Ne,ke)}}},re=function(q,oe,Ne){var ke=0,De=0;for(var xe=0;xe<Ne.length;xe++){var W=Ne[xe],Ae=I[W.data("source")],ie=I[W.data("target")];if(Ae&&ie&&Ae!==ie&&Ae.getEdgesBetween(ie).length==0){var ve=oe.add(q.newEdge(),Ae,ie);ve.id=W.id(),ve.idealLength=J(o.idealEdgeLength,W),ve.edgeElasticity=J(o.edgeElasticity,W),ke+=ve.idealLength,De++}}if(o.idealEdgeLength!=null){if(De>0)r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=ke/De;else if(!H(o.idealEdgeLength))r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=o.idealEdgeLength;else r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50;r.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,r.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH}},ue=function(q,oe){if(oe.fixedNodeConstraint)q.constraints.fixedNodeConstraint=oe.fixedNodeConstraint;if(oe.alignmentConstraint)q.constraints.alignmentConstraint=oe.alignmentConstraint;if(oe.relativePlacementConstraint)q.constraints.relativePlacementConstraint=oe.relativePlacementConstraint};if(o.nestingFactor!=null)r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.nestingFactor;if(o.gravity!=null)r.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=o.gravity;if(o.numIter!=null)r.MAX_ITERATIONS=g.MAX_ITERATIONS=o.numIter;if(o.gravityRange!=null)r.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=o.gravityRange;if(o.gravityCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.gravityCompound;if(o.gravityRangeCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.gravityRangeCompound;if(o.initialEnergyOnIncremental!=null)r.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.initialEnergyOnIncremental;if(o.tilingCompareBy!=null)r.TILING_COMPARE_BY=o.tilingCompareBy;if(o.quality=="proof")u.QUALITY=2;else u.QUALITY=0;if(r.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=o.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!o.randomize,r.ANIMATE=g.ANIMATE=u.ANIMATE=o.animate,r.TILE=o.tile,r.TILING_PADDING_VERTICAL=typeof o.tilingPaddingVertical==="function"?o.tilingPaddingVertical.call():o.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof o.tilingPaddingHorizontal==="function"?o.tilingPaddingHorizontal.call():o.tilingPaddingHorizontal,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!0,r.PURE_INCREMENTAL=!o.randomize,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=o.uniformNodeDimensions,o.step=="transformed")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!1;if(o.step=="enforced")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!1;if(o.step=="cose")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!0;if(o.step=="all"){if(o.randomize)r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0}if(o.fixedNodeConstraint||o.alignmentConstraint||o.relativePlacementConstraint)r.TREE_REDUCTION_ON_INCREMENTAL=!1;else r.TREE_REDUCTION_ON_INCREMENTAL=!0;var Ce=new c,$e=Ce.newGraphManager();return se($e.addRoot(),b.getTopMostNodes(P),Ce,o),re(Ce,$e,X),ue(Ce,o),Ce.runLayout(),I};N.exports={coseLayout:_}},212:(N,B,v)=>{var b=function(){function o(h,k){for(var n=0;n<k.length;n++){var P=k[n];if(P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P)P.writable=!0;Object.defineProperty(h,P.key,P)}}return function(h,k,n){if(k)o(h.prototype,k);if(n)o(h,n);return h}}();function c(o,h){if(!(o instanceof h))throw TypeError("Cannot call a class as a function")}var y=v(658),d=v(548),f=v(657),u=f.spectralLayout,g=v(816),r=g.coseLayout,_=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(h){return 4500},idealEdgeLength:function(h){return 50},edgeElasticity:function(h){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function o(h){c(this,o),this.options=y({},_,h)}return b(o,[{key:"run",value:function(){var k=this,n=this.options,{cy:P,eles:X}=n,D=[],j=void 0,Y=void 0,I=[],H=void 0,J=[];if(n.fixedNodeConstraint&&(!Array.isArray(n.fixedNodeConstraint)||n.fixedNodeConstraint.length==0))n.fixedNodeConstraint=void 0;if(n.alignmentConstraint){if(n.alignmentConstraint.vertical&&(!Array.isArray(n.alignmentConstraint.vertical)||n.alignmentConstraint.vertical.length==0))n.alignmentConstraint.vertical=void 0;if(n.alignmentConstraint.horizontal&&(!Array.isArray(n.alignmentConstraint.horizontal)||n.alignmentConstraint.horizontal.length==0))n.alignmentConstraint.horizontal=void 0}if(n.relativePlacementConstraint&&(!Array.isArray(n.relativePlacementConstraint)||n.relativePlacementConstraint.length==0))n.relativePlacementConstraint=void 0;var Z=n.fixedNodeConstraint||n.alignmentConstraint||n.relativePlacementConstraint;if(Z)n.tile=!1,n.packComponents=!1;var se=void 0,re=!1;if(P.layoutUtilities&&n.packComponents){if(se=P.layoutUtilities("get"),!se)se=P.layoutUtilities();re=!0}if(X.nodes().length>0)if(!re){var ue=n.eles.boundingBox();if(J.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2}),n.randomize){var Ce=u(n);D.push(Ce)}if(n.quality=="default"||n.quality=="proof")I.push(r(n,D[0])),d.relocateComponent(J[0],I[0],n);else d.relocateComponent(J[0],D[0],n)}else{var $e=d.getTopMostNodes(n.eles.nodes());if(H=d.connectComponents(P,n.eles,$e),H.forEach(function(K){var z=K.boundingBox();J.push({x:z.x1+z.w/2,y:z.y1+z.h/2})}),n.randomize)H.forEach(function(K){n.eles=K,D.push(u(n))});if(n.quality=="default"||n.quality=="proof"){var de=P.collection();if(n.tile){var q=new Map,oe=[],Ne=[],ke=0,De={nodeIndexes:q,xCoords:oe,yCoords:Ne},xe=[];if(H.forEach(function(K,z){if(K.edges().length==0)K.nodes().forEach(function(pe,le){if(de.merge(K.nodes()[le]),!pe.isParent())De.nodeIndexes.set(K.nodes()[le].id(),ke++),De.xCoords.push(K.nodes()[0].position().x),De.yCoords.push(K.nodes()[0].position().y)}),xe.push(z)}),de.length>1){var W=de.boundingBox();J.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),H.push(de),D.push(De);for(var Ae=xe.length-1;Ae>=0;Ae--)H.splice(xe[Ae],1),D.splice(xe[Ae],1),J.splice(xe[Ae],1)}}H.forEach(function(K,z){n.eles=K,I.push(r(n,D[z])),d.relocateComponent(J[z],I[z],n)})}else H.forEach(function(K,z){d.relocateComponent(J[z],D[z],n)});var ie=new Set;if(H.length>1){var ve=[],Me=X.filter(function(K){return K.css("display")=="none"});H.forEach(function(K,z){var pe=void 0;if(n.quality=="draft")pe=D[z].nodeIndexes;if(K.nodes().not(Me).length>0){var le={};le.edges=[],le.nodes=[];var me=void 0;if(K.nodes().not(Me).forEach(function(fe){if(n.quality=="draft")if(!fe.isParent())me=pe.get(fe.id()),le.nodes.push({x:D[z].xCoords[me]-fe.boundingbox().w/2,y:D[z].yCoords[me]-fe.boundingbox().h/2,width:fe.boundingbox().w,height:fe.boundingbox().h});else{var he=d.calcBoundingBox(fe,D[z].xCoords,D[z].yCoords,pe);le.nodes.push({x:he.topLeftX,y:he.topLeftY,width:he.width,height:he.height})}else if(I[z][fe.id()])le.nodes.push({x:I[z][fe.id()].getLeft(),y:I[z][fe.id()].getTop(),width:I[z][fe.id()].getWidth(),height:I[z][fe.id()].getHeight()})}),K.edges().forEach(function(fe){var he=fe.source(),Ee=fe.target();if(he.css("display")!="none"&&Ee.css("display")!="none"){if(n.quality=="draft"){var Be=pe.get(he.id()),et=pe.get(Ee.id()),Pe=[],Ye=[];if(he.isParent()){var We=d.calcBoundingBox(he,D[z].xCoords,D[z].yCoords,pe);Pe.push(We.topLeftX+We.width/2),Pe.push(We.topLeftY+We.height/2)}else Pe.push(D[z].xCoords[Be]),Pe.push(D[z].yCoords[Be]);if(Ee.isParent()){var Je=d.calcBoundingBox(Ee,D[z].xCoords,D[z].yCoords,pe);Ye.push(Je.topLeftX+Je.width/2),Ye.push(Je.topLeftY+Je.height/2)}else Ye.push(D[z].xCoords[et]),Ye.push(D[z].yCoords[et]);le.edges.push({startX:Pe[0],startY:Pe[1],endX:Ye[0],endY:Ye[1]})}else if(I[z][he.id()]&&I[z][Ee.id()])le.edges.push({startX:I[z][he.id()].getCenterX(),startY:I[z][he.id()].getCenterY(),endX:I[z][Ee.id()].getCenterX(),endY:I[z][Ee.id()].getCenterY()})}}),le.nodes.length>0)ve.push(le),ie.add(z)}});var Ge=se.packComponents(ve,n.randomize).shifts;if(n.quality=="draft")D.forEach(function(K,z){var pe=K.xCoords.map(function(me){return me+Ge[z].dx}),le=K.yCoords.map(function(me){return me+Ge[z].dy});K.xCoords=pe,K.yCoords=le});else{var Ke=0;ie.forEach(function(K){Object.keys(I[K]).forEach(function(z){var pe=I[K][z];pe.setCenter(pe.getCenterX()+Ge[Ke].dx,pe.getCenterY()+Ge[Ke].dy)}),Ke++})}}}var je=function(z,pe){if(n.quality=="default"||n.quality=="proof"){if(typeof z==="number")z=pe;var le=void 0,me=void 0,fe=z.data("id");if(I.forEach(function(Ee){if(fe in Ee)le={x:Ee[fe].getRect().getCenterX(),y:Ee[fe].getRect().getCenterY()},me=Ee[fe]}),n.nodeDimensionsIncludeLabels){if(me.labelWidth){if(me.labelPosHorizontal=="left")le.x+=me.labelWidth/2;else if(me.labelPosHorizontal=="right")le.x-=me.labelWidth/2}if(me.labelHeight){if(me.labelPosVertical=="top")le.y+=me.labelHeight/2;else if(me.labelPosVertical=="bottom")le.y-=me.labelHeight/2}}if(le==null)le={x:z.position("x"),y:z.position("y")};return{x:le.x,y:le.y}}else{var he=void 0;if(D.forEach(function(Ee){var Be=Ee.nodeIndexes.get(z.id());if(Be!=null)he={x:Ee.xCoords[Be],y:Ee.yCoords[Be]}}),he==null)he={x:z.position("x"),y:z.position("y")};return{x:he.x,y:he.y}}};if(n.quality=="default"||n.quality=="proof"||n.randomize){var at=d.calcParentsWithoutChildren(P,X),qe=X.filter(function(K){return K.css("display")=="none"});if(n.eles=X.not(qe),X.nodes().not(":parent").not(qe).layoutPositions(k,n,je),at.length>0)at.forEach(function(K){K.position(je(K))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),o}();N.exports=F},657:(N,B,v)=>{var b=v(548),c=v(140).layoutBase.Matrix,y=v(140).layoutBase.SVD,d=function(u){var{cy:g,eles:r}=u,_=r.nodes(),F=r.nodes(":parent"),o=new Map,h=new Map,k=new Map,n=[],P=[],X=[],D=[],j=[],Y=[],I=[],H=[],J=void 0,Z=void 0,se=1e8,re=0.000000001,{piTol:ue,samplingType:Ce,nodeSeparation:$e}=u,de=void 0,q=function(){var ee=0,te=0,ne=!1;while(te<de){ee=Math.floor(Math.random()*Z),ne=!1;for(var ae=0;ae<te;ae++)if(D[ae]==ee){ne=!0;break}if(!ne)D[te]=ee,te++;else continue}},oe=function(ee,te,ne){var ae=[],we=0,ge=0,ce=0,Ie=void 0,be=[],Fe=0,_e=1;for(var Ue=0;Ue<Z;Ue++)be[Ue]=se;ae[ge]=ee,be[ee]=0;while(ge>=we){ce=ae[we++];var Xe=n[ce];for(var He=0;He<Xe.length;He++)if(Ie=h.get(Xe[He]),be[Ie]==se)be[Ie]=be[ce]+1,ae[++ge]=Ie;Y[ce][te]=be[ce]*$e}if(ne){for(var Oe=0;Oe<Z;Oe++)if(Y[Oe][te]<j[Oe])j[Oe]=Y[Oe][te];for(var tt=0;tt<Z;tt++)if(j[tt]>Fe)Fe=j[tt],_e=tt}return _e},Ne=function(ee){var te=void 0;if(!ee){q();for(var ne=0;ne<de;ne++)oe(D[ne],ne,ee,!1)}else{te=Math.floor(Math.random()*Z),J=te;for(var ae=0;ae<Z;ae++)j[ae]=se;for(var we=0;we<de;we++)D[we]=te,te=oe(te,we,ee)}for(var ge=0;ge<Z;ge++)for(var ce=0;ce<de;ce++)Y[ge][ce]*=Y[ge][ce];for(var Ie=0;Ie<de;Ie++)I[Ie]=[];for(var be=0;be<de;be++)for(var Fe=0;Fe<de;Fe++)I[be][Fe]=Y[D[Fe]][be]},ke=function(){var ee=y.svd(I),{S:te,U:ne,V:ae}=ee,we=te[0]*te[0]*te[0],ge=[];for(var ce=0;ce<de;ce++){ge[ce]=[];for(var Ie=0;Ie<de;Ie++)if(ge[ce][Ie]=0,ce==Ie)ge[ce][Ie]=te[ce]/(te[ce]*te[ce]+we/(te[ce]*te[ce]))}H=c.multMat(c.multMat(ae,ge),c.transpose(ne))},De=function(){var ee=void 0,te=void 0,ne=[],ae=[],we=[],ge=[];for(var ce=0;ce<Z;ce++)ne[ce]=Math.random(),ae[ce]=Math.random();ne=c.normalize(ne),ae=c.normalize(ae);var Ie=0,be=re,Fe=re,_e=void 0;while(!0){Ie++;for(var Ue=0;Ue<Z;Ue++)we[Ue]=ne[Ue];if(ne=c.multGamma(c.multL(c.multGamma(we),Y,H)),ee=c.dotProduct(we,ne),ne=c.normalize(ne),be=c.dotProduct(we,ne),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Xe=0;Xe<Z;Xe++)we[Xe]=ne[Xe];Ie=0,Fe=re;while(!0){Ie++;for(var He=0;He<Z;He++)ge[He]=ae[He];if(ge=c.minusOp(ge,c.multCons(we,c.dotProduct(we,ge))),ae=c.multGamma(c.multL(c.multGamma(ge),Y,H)),te=c.dotProduct(ge,ae),ae=c.normalize(ae),be=c.dotProduct(ge,ae),_e=Math.abs(be/Fe),_e<=1+ue&&_e>=1)break;Fe=be}for(var Oe=0;Oe<Z;Oe++)ge[Oe]=ae[Oe];P=c.multCons(we,Math.sqrt(Math.abs(ee))),X=c.multCons(ge,Math.sqrt(Math.abs(te)))};b.connectComponents(g,r,b.getTopMostNodes(_),o),F.forEach(function(ye){b.connectComponents(g,r,b.getTopMostNodes(ye.descendants().intersection(r)),o)});var xe=0;for(var W=0;W<_.length;W++)if(!_[W].isParent())h.set(_[W].id(),xe++);var Ae=!0,ie=!1,ve=void 0;try{for(var Me=o.keys()[Symbol.iterator](),Ge;!(Ae=(Ge=Me.next()).done);Ae=!0){var Ke=Ge.value;h.set(Ke,xe++)}}catch(ye){ie=!0,ve=ye}finally{try{if(!Ae&&Me.return)Me.return()}finally{if(ie)throw ve}}for(var je=0;je<h.size;je++)n[je]=[];F.forEach(function(ye){var ee=ye.children().intersection(r);while(ee.nodes(":childless").length==0)ee=ee.nodes()[0].children().intersection(r);var te=0,ne=ee.nodes(":childless")[0].connectedEdges().length;ee.nodes(":childless").forEach(function(ae,we){if(ae.connectedEdges().length<ne)ne=ae.connectedEdges().length,te=we}),k.set(ye.id(),ee.nodes(":childless")[te].id())}),_.forEach(function(ye){var ee=void 0;if(ye.isParent())ee=h.get(k.get(ye.id()));else ee=h.get(ye.id());ye.neighborhood().nodes().forEach(function(te){if(r.intersection(ye.edgesWith(te)).length>0)if(te.isParent())n[ee].push(k.get(te.id()));else n[ee].push(te.id())})});var at=function(ee){var te=h.get(ee),ne=void 0;o.get(ee).forEach(function(ae){if(g.getElementById(ae).isParent())ne=k.get(ae);else ne=ae;n[te].push(ne),n[h.get(ne)].push(ee)})},qe=!0,K=!1,z=void 0;try{for(var pe=o.keys()[Symbol.iterator](),le;!(qe=(le=pe.next()).done);qe=!0){var me=le.value;at(me)}}catch(ye){K=!0,z=ye}finally{try{if(!qe&&pe.return)pe.return()}finally{if(K)throw z}}Z=h.size;var fe=void 0;if(Z>2){de=Z<u.sampleSize?Z:u.sampleSize;for(var he=0;he<Z;he++)Y[he]=[];for(var Ee=0;Ee<de;Ee++)H[Ee]=[];if(u.quality=="draft"||u.step=="all")Ne(Ce),ke(),De(),fe={nodeIndexes:h,xCoords:P,yCoords:X};else h.forEach(function(ye,ee){P.push(g.getElementById(ee).position("x")),X.push(g.getElementById(ee).position("y"))}),fe={nodeIndexes:h,xCoords:P,yCoords:X};return fe}else{var Be=h.keys(),et=g.getElementById(Be.next().value),Pe=et.position(),Ye=et.outerWidth();if(P.push(Pe.x),X.push(Pe.y),Z==2){var We=g.getElementById(Be.next().value),Je=We.outerWidth();P.push(Pe.x+Ye/2+Je/2+u.idealEdgeLength),X.push(Pe.y)}return fe={nodeIndexes:h,xCoords:P,yCoords:X},fe}};N.exports={spectralLayout:d}},579:(N,B,v)=>{var b=v(212),c=function(d){if(!d)return;d("layout","fcose",b)};if(typeof cytoscape<"u")c(cytoscape);N.exports=c},140:(N)=>{N.exports=e}},s={};function w(N){var B=s[N];if(B!==void 0)return B.exports;var v=s[N]={exports:{}};return i[N](v,v.exports,w),v.exports}var m=w(579);return m})()})});var xt=Se(ft(),1);var ut={L:"left",R:"right",T:"top",B:"bottom"},gt={L:t((e)=>`${e},${e/2} 0,${e} 0,0`,"L"),R:t((e)=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:t((e)=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:t((e)=>`${e/2},0 ${e},${e} 0,${e}`,"B")},ot={L:t((e,i)=>e-i+2,"L"),R:t((e,i)=>e-2,"R"),T:t((e,i)=>e-i+2,"T"),B:t((e,i)=>e-2,"B")},kt=t(function(e){if(Re(e))return e==="L"?"R":"L";else return e==="T"?"B":"T"},"getOppositeArchitectureDirection"),vt=t(function(e){let i=e;return i==="L"||i==="R"||i==="T"||i==="B"},"isArchitectureDirection"),Re=t(function(e){let i=e;return i==="L"||i==="R"},"isArchitectureDirectionX"),Ve=t(function(e){let i=e;return i==="T"||i==="B"},"isArchitectureDirectionY"),dt=t(function(e,i){let s=Re(e)&&Ve(i),w=Ve(e)&&Re(i);return s||w},"isArchitectureDirectionXY"),Dt=t(function(e){let i=e[0],s=e[1],w=Re(i)&&Ve(s),m=Ve(i)&&Re(s);return w||m},"isArchitecturePairXY"),Rt=t(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),lt=t(function(e,i){let s=`${e}${i}`;return Rt(s)?s:void 0},"getArchitectureDirectionPair"),Mt=t(function([e,i],s){let w=s[0],m=s[1];if(Re(w))if(Ve(m))return[e+(w==="L"?-1:1),i+(m==="T"?1:-1)];else return[e+(w==="L"?-1:1),i];else if(Re(m))return[e+(m==="L"?1:-1),i+(w==="T"?1:-1)];else return[e,i+(w==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ft=t(function(e){if(e==="LT"||e==="TL")return[1,1];else if(e==="BL"||e==="LB")return[1,-1];else if(e==="BR"||e==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),$t=t(function(e,i){if(dt(e,i))return"bend";else if(Re(e))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Pt=t(function(e){return e.type==="service"},"isArchitectureService"),Ot=t(function(e){return e.type==="junction"},"isArchitectureJunction"),pt=t((e,i)=>{let[s,w]=[e,i].sort();return`${JSON.stringify(s)}-${JSON.stringify(w)}`},"architectureGroupAlignmentKey"),mt=t((e)=>e.data(),"edgeData"),Qe=t((e)=>e.data(),"nodeData"),Gt=M.architecture,Et=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",C()}addService({id:e,icon:i,in:s,title:w,iconText:m}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(s)==="node")throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:i,iconText:m,title:w,edges:[],in:s})}getServices(){return[...this.nodes.values()].filter(Pt)}addJunction({id:e,in:i}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(i!==void 0){if(e===i)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(i)==="node")throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:i})}getJunctions(){return[...this.nodes.values()].filter(Ot)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:i,in:s,title:w}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(s)==="node")throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:i,title:w,in:s})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:i,lhsDir:s,rhsDir:w,lhsInto:m,rhsInto:N,lhsGroup:B,rhsGroup:v,title:b}){if(!vt(s))throw Error(`Invalid direction given for left hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(s)}`);if(!vt(w))throw Error(`Invalid direction given for right hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(w)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(i)&&!this.groups.has(i))throw Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);let c=this.nodes.get(e).in,y=this.nodes.get(i).in;if(B&&c&&y&&c==y)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(v&&c&&y&&c==y)throw Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:s,lhsInto:m,lhsGroup:B,rhsId:i,rhsDir:w,rhsInto:N,rhsGroup:v,title:b};this.edges.push(d);let f=this.nodes.get(e),u=this.nodes.get(i);if(f&&u)f.edges.push(this.edges[this.edges.length-1]),u.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let i=new Set;e.members.forEach((s)=>{if(this.registeredIds.get(s)!=="node")throw Error(`align ${e.direction} references [${s}], which is not a service or junction`);if(i.has(s))throw Error(`align ${e.direction} lists [${s}] more than once`);i.add(s)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,i=new Map;for(let[B,v]of this.nodes.entries()){let b=new Map;for(let c of v.edges){let y=this.getNode(c.lhsId)?.in,d=this.getNode(c.rhsId)?.in;if(y&&d&&y!==d){let f=$t(c.lhsDir,c.rhsDir);if(f!=="bend")e.set(pt(y,d),f)}if(c.lhsId===B){let f=lt(c.lhsDir,c.rhsDir);if(f)b.set(f,c.rhsId)}else{let f=lt(c.rhsDir,c.lhsDir);if(f)b.set(f,c.lhsId)}}i.set(B,b)}let s=new Set,w=new Set(i.keys()),m=t((B)=>{let v=new Map([[B,[0,0]]]),b=[B];while(b.length>0){let c=b.shift();if(c){s.add(c),w.delete(c);let y=i.get(c);if(!y)throw Error(`BFS error: adjacency list for id ${c} not found. Please report this as a bug.`);let d=v.get(c);if(!d)throw Error(`BFS error: position for id ${c} not found in spatial map. Please report this as a bug.`);let[f,u]=d;y.forEach((g,r)=>{if(!s.has(g))v.set(g,Mt([f,u],r)),b.push(g)})}}return v},"BFS"),N=[];while(w.size>0){let B=w.values().next().value;N.push(m(B))}this.dataStructures={adjList:i,spatialMaps:N,groupAlignments:e}}return this.dataStructures}setElementForId(e,i){this.elements.set(e,i)}getElementById(e){return this.elements.get(e)}getConfig(){return U({...Gt,...x().architecture})}getConfigField(e){return this.getConfig()[e]}},zt=t((e,i)=>{G(e,i),e.groups.map((s)=>i.addGroup(s)),e.services.map((s)=>i.addService({...s,type:"service"})),e.junctions.map((s)=>i.addJunction({...s,type:"junction"})),e.edges.map((s)=>i.addEdge(s)),e.alignments?.map((s)=>i.addLayoutHint({direction:s.direction,members:[...s.members]}))},"populateDb"),wt={parser:{yy:void 0},parse:t(async(e)=>{let i=await Q("architecture",e);a.debug(i);let s=wt.parser?.yy;if(!(s instanceof Et))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");zt(i,s)},"parse")},Bt=t((e)=>`
|
|
1
|
+
import{H}from"./chunk-ba9qy65y.js";import{t,a,N,x,O,gt,C,S,E,T,A,L,R,l,p,V,Wi,In,at,U,Fe,Le}from"./chunk-c6m4vfn5.js";import{J}from"./chunk-a9er7a7c.js";import{ft,vr}from"./chunk-t82sngk9.js";import{Ce,Se}from"./chunk-ve8gy05p.js";var ut=Se(function(rt,st){(function(i,s){if(typeof rt==="object"&&typeof st==="object")st.exports=s(vr());else if(typeof define==="function"&&define.amd)define(["cose-base"],s);else if(typeof rt==="object")rt.cytoscapeFcose=s(vr());else i.cytoscapeFcose=s(i.coseBase)})(rt,function(e){return(()=>{var i={658:(k)=>{k.exports=Object.assign!=null?Object.assign.bind(Object):function(z){for(var v=arguments.length,b=Array(v>1?v-1:0),c=1;c<v;c++)b[c-1]=arguments[c];return b.forEach(function(y){Object.keys(y).forEach(function(d){return z[d]=y[d]})}),z}},548:(k,z,v)=>{var b=function(){function d(f,u){var g=[],r=!0,B=!1,F=void 0;try{for(var o=f[Symbol.iterator](),h;!(r=(h=o.next()).done);r=!0)if(g.push(h.value),u&&g.length===u)break}catch(D){B=!0,F=D}finally{try{if(!r&&o.return)o.return()}finally{if(B)throw F}}return g}return function(f,u){if(Array.isArray(f))return f;else if(Symbol.iterator in Object(f))return d(f,u);else throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=v(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(d){var f={};for(var u=0;u<d.length;u++)f[d[u].id()]=!0;var g=d.filter(function(r,B){if(typeof r==="number")r=B;var F=r.parent()[0];while(F!=null){if(f[F.id()])return!1;F=F.parent()[0]}return!0});return g},y.connectComponents=function(d,f,u,g){var r=new c,B=new Set,F=[],o=void 0,h=void 0,D=void 0,n=!1,P=1,X=[],M=[],j=function(){var I=d.collection();M.push(I);var Y=u[0],Z=d.collection();Z.merge(Y).merge(Y.descendants().intersection(f)),F.push(Y),Z.forEach(function(re){r.push(re),B.add(re),I.merge(re)});var Q=function(){Y=r.shift();var ue=d.collection();Y.neighborhood().nodes().forEach(function(q){if(f.intersection(Y.edgesWith(q)).length>0)ue.merge(q)});for(var Ae=0;Ae<ue.length;Ae++){var Pe=ue[Ae];if(o=u.intersection(Pe.union(Pe.ancestors())),o!=null&&!B.has(o[0])){var de=o.union(o.descendants());de.forEach(function(q){if(r.push(q),B.add(q),I.merge(q),u.has(q))F.push(q)})}}};while(r.length!=0)Q();if(I.forEach(function(re){f.intersection(re.connectedEdges()).forEach(function(ue){if(I.has(ue.source())&&I.has(ue.target()))I.merge(ue)})}),F.length==u.length)n=!0;if(!n||n&&P>1){h=F[0],D=h.connectedEdges().length,F.forEach(function(re){if(re.connectedEdges().length<D)D=re.connectedEdges().length,h=re}),X.push(h.id());var se=d.collection();se.merge(F[0]),F.forEach(function(re){se.merge(re)}),F=[],u=u.difference(se),P++}};do j();while(!n);if(g){if(X.length>0)g.set("dummy"+(g.size+1),X)}return M},y.relocateComponent=function(d,f,u){if(!u.fixedNodeConstraint){var{POSITIVE_INFINITY:g,NEGATIVE_INFINITY:r,POSITIVE_INFINITY:B,NEGATIVE_INFINITY:F}=Number;if(u.quality=="draft"){var o=!0,h=!1,D=void 0;try{for(var n=f.nodeIndexes[Symbol.iterator](),P;!(o=(P=n.next()).done);o=!0){var X=P.value,M=b(X,2),j=M[0],_=M[1],I=u.cy.getElementById(j);if(I){var Y=I.boundingBox(),Z=f.xCoords[_]-Y.w/2,Q=f.xCoords[_]+Y.w/2,se=f.yCoords[_]-Y.h/2,re=f.yCoords[_]+Y.h/2;if(Z<g)g=Z;if(Q>r)r=Q;if(se<B)B=se;if(re>F)F=re}}}catch(q){h=!0,D=q}finally{try{if(!o&&n.return)n.return()}finally{if(h)throw D}}var ue=d.x-(r+g)/2,Ae=d.y-(F+B)/2;f.xCoords=f.xCoords.map(function(q){return q+ue}),f.yCoords=f.yCoords.map(function(q){return q+Ae})}else{Object.keys(f).forEach(function(q){var oe=f[q],Ne=oe.getRect().x,ke=oe.getRect().x+oe.getRect().width,De=oe.getRect().y,xe=oe.getRect().y+oe.getRect().height;if(Ne<g)g=Ne;if(ke>r)r=ke;if(De<B)B=De;if(xe>F)F=xe});var Pe=d.x-(r+g)/2,de=d.y-(F+B)/2;Object.keys(f).forEach(function(q){var oe=f[q];oe.setCenter(oe.getCenterX()+Pe,oe.getCenterY()+de)})}}},y.calcBoundingBox=function(d,f,u,g){var{MAX_SAFE_INTEGER:r,MIN_SAFE_INTEGER:B,MAX_SAFE_INTEGER:F,MIN_SAFE_INTEGER:o}=Number,h=void 0,D=void 0,n=void 0,P=void 0,X=d.descendants().not(":parent"),M=X.length;for(var j=0;j<M;j++){var _=X[j];if(h=f[g.get(_.id())]-_.width()/2,D=f[g.get(_.id())]+_.width()/2,n=u[g.get(_.id())]-_.height()/2,P=u[g.get(_.id())]+_.height()/2,r>h)r=h;if(B<D)B=D;if(F>n)F=n;if(o<P)o=P}var I={};return I.topLeftX=r,I.topLeftY=F,I.width=B-r,I.height=o-F,I},y.calcParentsWithoutChildren=function(d,f){var u=d.collection();return f.nodes(":parent").forEach(function(g){var r=!1;if(g.children().forEach(function(B){if(B.css("display")!="none")r=!0}),!r)u.merge(g)}),u},k.exports=y},816:(k,z,v)=>{var b=v(548),c=v(140).CoSELayout,y=v(140).CoSENode,d=v(140).layoutBase.PointD,f=v(140).layoutBase.DimensionD,u=v(140).layoutBase.LayoutConstants,g=v(140).layoutBase.FDLayoutConstants,r=v(140).CoSEConstants,B=function(o,h){var{cy:D,eles:n}=o,P=n.nodes(),X=n.edges(),M=void 0,j=void 0,_=void 0,I={};if(o.randomize)M=h.nodeIndexes,j=h.xCoords,_=h.yCoords;var Y=function(q){return typeof q==="function"},Z=function(q,oe){if(Y(q))return q(oe);else return q},Q=b.calcParentsWithoutChildren(D,n),se=function de(q,oe,Ne,ke){var De=oe.length;for(var xe=0;xe<De;xe++){var W=oe[xe],Te=null;if(W.intersection(Q).length==0)Te=W.children();var ie=void 0,ve=W.layoutDimensions({nodeDimensionsIncludeLabels:ke.nodeDimensionsIncludeLabels});if(W.outerWidth()!=null&&W.outerHeight()!=null)if(ke.randomize)if(!W.isParent())ie=q.add(new y(Ne.graphManager,new d(j[M.get(W.id())]-ve.w/2,_[M.get(W.id())]-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else{var Me=b.calcBoundingBox(W,j,_,M);if(W.intersection(Q).length==0)ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(Me.width,Me.height)));else ie=q.add(new y(Ne.graphManager,new d(Me.topLeftX,Me.topLeftY),new f(parseFloat(ve.w),parseFloat(ve.h))))}else ie=q.add(new y(Ne.graphManager,new d(W.position("x")-ve.w/2,W.position("y")-ve.h/2),new f(parseFloat(ve.w),parseFloat(ve.h))));else ie=q.add(new y(this.graphManager));if(ie.id=W.data("id"),ie.nodeRepulsion=Z(ke.nodeRepulsion,W),ie.paddingLeft=parseInt(W.css("padding")),ie.paddingTop=parseInt(W.css("padding")),ie.paddingRight=parseInt(W.css("padding")),ie.paddingBottom=parseInt(W.css("padding")),ke.nodeDimensionsIncludeLabels)ie.labelWidth=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,ie.labelHeight=W.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,ie.labelPosVertical=W.css("text-valign"),ie.labelPosHorizontal=W.css("text-halign");if(I[W.data("id")]=ie,isNaN(ie.rect.x))ie.rect.x=0;if(isNaN(ie.rect.y))ie.rect.y=0;if(Te!=null&&Te.length>0){var ze=void 0;ze=Ne.getGraphManager().add(Ne.newGraph(),ie),de(ze,Te,Ne,ke)}}},re=function(q,oe,Ne){var ke=0,De=0;for(var xe=0;xe<Ne.length;xe++){var W=Ne[xe],Te=I[W.data("source")],ie=I[W.data("target")];if(Te&&ie&&Te!==ie&&Te.getEdgesBetween(ie).length==0){var ve=oe.add(q.newEdge(),Te,ie);ve.id=W.id(),ve.idealLength=Z(o.idealEdgeLength,W),ve.edgeElasticity=Z(o.edgeElasticity,W),ke+=ve.idealLength,De++}}if(o.idealEdgeLength!=null){if(De>0)r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=ke/De;else if(!Y(o.idealEdgeLength))r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=o.idealEdgeLength;else r.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50;r.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,r.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH}},ue=function(q,oe){if(oe.fixedNodeConstraint)q.constraints.fixedNodeConstraint=oe.fixedNodeConstraint;if(oe.alignmentConstraint)q.constraints.alignmentConstraint=oe.alignmentConstraint;if(oe.relativePlacementConstraint)q.constraints.relativePlacementConstraint=oe.relativePlacementConstraint};if(o.nestingFactor!=null)r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=o.nestingFactor;if(o.gravity!=null)r.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=o.gravity;if(o.numIter!=null)r.MAX_ITERATIONS=g.MAX_ITERATIONS=o.numIter;if(o.gravityRange!=null)r.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=o.gravityRange;if(o.gravityCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=o.gravityCompound;if(o.gravityRangeCompound!=null)r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=o.gravityRangeCompound;if(o.initialEnergyOnIncremental!=null)r.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=o.initialEnergyOnIncremental;if(o.tilingCompareBy!=null)r.TILING_COMPARE_BY=o.tilingCompareBy;if(o.quality=="proof")u.QUALITY=2;else u.QUALITY=0;if(r.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=o.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!o.randomize,r.ANIMATE=g.ANIMATE=u.ANIMATE=o.animate,r.TILE=o.tile,r.TILING_PADDING_VERTICAL=typeof o.tilingPaddingVertical==="function"?o.tilingPaddingVertical.call():o.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof o.tilingPaddingHorizontal==="function"?o.tilingPaddingHorizontal.call():o.tilingPaddingHorizontal,r.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=!0,r.PURE_INCREMENTAL=!o.randomize,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=o.uniformNodeDimensions,o.step=="transformed")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!1;if(o.step=="enforced")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!1;if(o.step=="cose")r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,r.ENFORCE_CONSTRAINTS=!1,r.APPLY_LAYOUT=!0;if(o.step=="all"){if(o.randomize)r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0;else r.TRANSFORM_ON_CONSTRAINT_HANDLING=!1;r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0}if(o.fixedNodeConstraint||o.alignmentConstraint||o.relativePlacementConstraint)r.TREE_REDUCTION_ON_INCREMENTAL=!1;else r.TREE_REDUCTION_ON_INCREMENTAL=!0;var Ae=new c,Pe=Ae.newGraphManager();return se(Pe.addRoot(),b.getTopMostNodes(P),Ae,o),re(Ae,Pe,X),ue(Ae,o),Ae.runLayout(),I};k.exports={coseLayout:B}},212:(k,z,v)=>{var b=function(){function o(h,D){for(var n=0;n<D.length;n++){var P=D[n];if(P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P)P.writable=!0;Object.defineProperty(h,P.key,P)}}return function(h,D,n){if(D)o(h.prototype,D);if(n)o(h,n);return h}}();function c(o,h){if(!(o instanceof h))throw TypeError("Cannot call a class as a function")}var y=v(658),d=v(548),f=v(657),u=f.spectralLayout,g=v(816),r=g.coseLayout,B=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1000,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:0.0000001,nodeRepulsion:function(h){return 4500},idealEdgeLength:function(h){return 50},edgeElasticity:function(h){return 0.45},nestingFactor:0.1,gravity:0.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:0.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),F=function(){function o(h){c(this,o),this.options=y({},B,h)}return b(o,[{key:"run",value:function(){var D=this,n=this.options,{cy:P,eles:X}=n,M=[],j=void 0,_=void 0,I=[],Y=void 0,Z=[];if(n.fixedNodeConstraint&&(!Array.isArray(n.fixedNodeConstraint)||n.fixedNodeConstraint.length==0))n.fixedNodeConstraint=void 0;if(n.alignmentConstraint){if(n.alignmentConstraint.vertical&&(!Array.isArray(n.alignmentConstraint.vertical)||n.alignmentConstraint.vertical.length==0))n.alignmentConstraint.vertical=void 0;if(n.alignmentConstraint.horizontal&&(!Array.isArray(n.alignmentConstraint.horizontal)||n.alignmentConstraint.horizontal.length==0))n.alignmentConstraint.horizontal=void 0}if(n.relativePlacementConstraint&&(!Array.isArray(n.relativePlacementConstraint)||n.relativePlacementConstraint.length==0))n.relativePlacementConstraint=void 0;var Q=n.fixedNodeConstraint||n.alignmentConstraint||n.relativePlacementConstraint;if(Q)n.tile=!1,n.packComponents=!1;var se=void 0,re=!1;if(P.layoutUtilities&&n.packComponents){if(se=P.layoutUtilities("get"),!se)se=P.layoutUtilities();re=!0}if(X.nodes().length>0)if(!re){var ue=n.eles.boundingBox();if(Z.push({x:ue.x1+ue.w/2,y:ue.y1+ue.h/2}),n.randomize){var Ae=u(n);M.push(Ae)}if(n.quality=="default"||n.quality=="proof")I.push(r(n,M[0])),d.relocateComponent(Z[0],I[0],n);else d.relocateComponent(Z[0],M[0],n)}else{var Pe=d.getTopMostNodes(n.eles.nodes());if(Y=d.connectComponents(P,n.eles,Pe),Y.forEach(function(K){var G=K.boundingBox();Z.push({x:G.x1+G.w/2,y:G.y1+G.h/2})}),n.randomize)Y.forEach(function(K){n.eles=K,M.push(u(n))});if(n.quality=="default"||n.quality=="proof"){var de=P.collection();if(n.tile){var q=new Map,oe=[],Ne=[],ke=0,De={nodeIndexes:q,xCoords:oe,yCoords:Ne},xe=[];if(Y.forEach(function(K,G){if(K.edges().length==0)K.nodes().forEach(function(pe,le){if(de.merge(K.nodes()[le]),!pe.isParent())De.nodeIndexes.set(K.nodes()[le].id(),ke++),De.xCoords.push(K.nodes()[0].position().x),De.yCoords.push(K.nodes()[0].position().y)}),xe.push(G)}),de.length>1){var W=de.boundingBox();Z.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),Y.push(de),M.push(De);for(var Te=xe.length-1;Te>=0;Te--)Y.splice(xe[Te],1),M.splice(xe[Te],1),Z.splice(xe[Te],1)}}Y.forEach(function(K,G){n.eles=K,I.push(r(n,M[G])),d.relocateComponent(Z[G],I[G],n)})}else Y.forEach(function(K,G){d.relocateComponent(Z[G],M[G],n)});var ie=new Set;if(Y.length>1){var ve=[],Me=X.filter(function(K){return K.css("display")=="none"});Y.forEach(function(K,G){var pe=void 0;if(n.quality=="draft")pe=M[G].nodeIndexes;if(K.nodes().not(Me).length>0){var le={};le.edges=[],le.nodes=[];var me=void 0;if(K.nodes().not(Me).forEach(function(fe){if(n.quality=="draft")if(!fe.isParent())me=pe.get(fe.id()),le.nodes.push({x:M[G].xCoords[me]-fe.boundingbox().w/2,y:M[G].yCoords[me]-fe.boundingbox().h/2,width:fe.boundingbox().w,height:fe.boundingbox().h});else{var he=d.calcBoundingBox(fe,M[G].xCoords,M[G].yCoords,pe);le.nodes.push({x:he.topLeftX,y:he.topLeftY,width:he.width,height:he.height})}else if(I[G][fe.id()])le.nodes.push({x:I[G][fe.id()].getLeft(),y:I[G][fe.id()].getTop(),width:I[G][fe.id()].getWidth(),height:I[G][fe.id()].getHeight()})}),K.edges().forEach(function(fe){var he=fe.source(),Ee=fe.target();if(he.css("display")!="none"&&Ee.css("display")!="none"){if(n.quality=="draft"){var Be=pe.get(he.id()),et=pe.get(Ee.id()),Oe=[],Ye=[];if(he.isParent()){var We=d.calcBoundingBox(he,M[G].xCoords,M[G].yCoords,pe);Oe.push(We.topLeftX+We.width/2),Oe.push(We.topLeftY+We.height/2)}else Oe.push(M[G].xCoords[Be]),Oe.push(M[G].yCoords[Be]);if(Ee.isParent()){var Je=d.calcBoundingBox(Ee,M[G].xCoords,M[G].yCoords,pe);Ye.push(Je.topLeftX+Je.width/2),Ye.push(Je.topLeftY+Je.height/2)}else Ye.push(M[G].xCoords[et]),Ye.push(M[G].yCoords[et]);le.edges.push({startX:Oe[0],startY:Oe[1],endX:Ye[0],endY:Ye[1]})}else if(I[G][he.id()]&&I[G][Ee.id()])le.edges.push({startX:I[G][he.id()].getCenterX(),startY:I[G][he.id()].getCenterY(),endX:I[G][Ee.id()].getCenterX(),endY:I[G][Ee.id()].getCenterY()})}}),le.nodes.length>0)ve.push(le),ie.add(G)}});var ze=se.packComponents(ve,n.randomize).shifts;if(n.quality=="draft")M.forEach(function(K,G){var pe=K.xCoords.map(function(me){return me+ze[G].dx}),le=K.yCoords.map(function(me){return me+ze[G].dy});K.xCoords=pe,K.yCoords=le});else{var Ke=0;ie.forEach(function(K){Object.keys(I[K]).forEach(function(G){var pe=I[K][G];pe.setCenter(pe.getCenterX()+ze[Ke].dx,pe.getCenterY()+ze[Ke].dy)}),Ke++})}}}var je=function(G,pe){if(n.quality=="default"||n.quality=="proof"){if(typeof G==="number")G=pe;var le=void 0,me=void 0,fe=G.data("id");if(I.forEach(function(Ee){if(fe in Ee)le={x:Ee[fe].getRect().getCenterX(),y:Ee[fe].getRect().getCenterY()},me=Ee[fe]}),n.nodeDimensionsIncludeLabels){if(me.labelWidth){if(me.labelPosHorizontal=="left")le.x+=me.labelWidth/2;else if(me.labelPosHorizontal=="right")le.x-=me.labelWidth/2}if(me.labelHeight){if(me.labelPosVertical=="top")le.y+=me.labelHeight/2;else if(me.labelPosVertical=="bottom")le.y-=me.labelHeight/2}}if(le==null)le={x:G.position("x"),y:G.position("y")};return{x:le.x,y:le.y}}else{var he=void 0;if(M.forEach(function(Ee){var Be=Ee.nodeIndexes.get(G.id());if(Be!=null)he={x:Ee.xCoords[Be],y:Ee.yCoords[Be]}}),he==null)he={x:G.position("x"),y:G.position("y")};return{x:he.x,y:he.y}}};if(n.quality=="default"||n.quality=="proof"||n.randomize){var nt=d.calcParentsWithoutChildren(P,X),qe=X.filter(function(K){return K.css("display")=="none"});if(n.eles=X.not(qe),X.nodes().not(":parent").not(qe).layoutPositions(D,n,je),nt.length>0)nt.forEach(function(K){K.position(je(K))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),o}();k.exports=F},657:(k,z,v)=>{var b=v(548),c=v(140).layoutBase.Matrix,y=v(140).layoutBase.SVD,d=function(u){var{cy:g,eles:r}=u,B=r.nodes(),F=r.nodes(":parent"),o=new Map,h=new Map,D=new Map,n=[],P=[],X=[],M=[],j=[],_=[],I=[],Y=[],Z=void 0,Q=void 0,se=1e8,re=0.000000001,{piTol:ue,samplingType:Ae,nodeSeparation:Pe}=u,de=void 0,q=function(){var ee=0,te=0,ne=!1;while(te<de){ee=Math.floor(Math.random()*Q),ne=!1;for(var ae=0;ae<te;ae++)if(M[ae]==ee){ne=!0;break}if(!ne)M[te]=ee,te++;else continue}},oe=function(ee,te,ne){var ae=[],we=0,ge=0,ce=0,Ie=void 0,be=[],$e=0,_e=1;for(var Ue=0;Ue<Q;Ue++)be[Ue]=se;ae[ge]=ee,be[ee]=0;while(ge>=we){ce=ae[we++];var Xe=n[ce];for(var He=0;He<Xe.length;He++)if(Ie=h.get(Xe[He]),be[Ie]==se)be[Ie]=be[ce]+1,ae[++ge]=Ie;_[ce][te]=be[ce]*Pe}if(ne){for(var Ge=0;Ge<Q;Ge++)if(_[Ge][te]<j[Ge])j[Ge]=_[Ge][te];for(var tt=0;tt<Q;tt++)if(j[tt]>$e)$e=j[tt],_e=tt}return _e},Ne=function(ee){var te=void 0;if(!ee){q();for(var ne=0;ne<de;ne++)oe(M[ne],ne,ee,!1)}else{te=Math.floor(Math.random()*Q),Z=te;for(var ae=0;ae<Q;ae++)j[ae]=se;for(var we=0;we<de;we++)M[we]=te,te=oe(te,we,ee)}for(var ge=0;ge<Q;ge++)for(var ce=0;ce<de;ce++)_[ge][ce]*=_[ge][ce];for(var Ie=0;Ie<de;Ie++)I[Ie]=[];for(var be=0;be<de;be++)for(var $e=0;$e<de;$e++)I[be][$e]=_[M[$e]][be]},ke=function(){var ee=y.svd(I),{S:te,U:ne,V:ae}=ee,we=te[0]*te[0]*te[0],ge=[];for(var ce=0;ce<de;ce++){ge[ce]=[];for(var Ie=0;Ie<de;Ie++)if(ge[ce][Ie]=0,ce==Ie)ge[ce][Ie]=te[ce]/(te[ce]*te[ce]+we/(te[ce]*te[ce]))}Y=c.multMat(c.multMat(ae,ge),c.transpose(ne))},De=function(){var ee=void 0,te=void 0,ne=[],ae=[],we=[],ge=[];for(var ce=0;ce<Q;ce++)ne[ce]=Math.random(),ae[ce]=Math.random();ne=c.normalize(ne),ae=c.normalize(ae);var Ie=0,be=re,$e=re,_e=void 0;while(!0){Ie++;for(var Ue=0;Ue<Q;Ue++)we[Ue]=ne[Ue];if(ne=c.multGamma(c.multL(c.multGamma(we),_,Y)),ee=c.dotProduct(we,ne),ne=c.normalize(ne),be=c.dotProduct(we,ne),_e=Math.abs(be/$e),_e<=1+ue&&_e>=1)break;$e=be}for(var Xe=0;Xe<Q;Xe++)we[Xe]=ne[Xe];Ie=0,$e=re;while(!0){Ie++;for(var He=0;He<Q;He++)ge[He]=ae[He];if(ge=c.minusOp(ge,c.multCons(we,c.dotProduct(we,ge))),ae=c.multGamma(c.multL(c.multGamma(ge),_,Y)),te=c.dotProduct(ge,ae),ae=c.normalize(ae),be=c.dotProduct(ge,ae),_e=Math.abs(be/$e),_e<=1+ue&&_e>=1)break;$e=be}for(var Ge=0;Ge<Q;Ge++)ge[Ge]=ae[Ge];P=c.multCons(we,Math.sqrt(Math.abs(ee))),X=c.multCons(ge,Math.sqrt(Math.abs(te)))};b.connectComponents(g,r,b.getTopMostNodes(B),o),F.forEach(function(ye){b.connectComponents(g,r,b.getTopMostNodes(ye.descendants().intersection(r)),o)});var xe=0;for(var W=0;W<B.length;W++)if(!B[W].isParent())h.set(B[W].id(),xe++);var Te=!0,ie=!1,ve=void 0;try{for(var Me=o.keys()[Symbol.iterator](),ze;!(Te=(ze=Me.next()).done);Te=!0){var Ke=ze.value;h.set(Ke,xe++)}}catch(ye){ie=!0,ve=ye}finally{try{if(!Te&&Me.return)Me.return()}finally{if(ie)throw ve}}for(var je=0;je<h.size;je++)n[je]=[];F.forEach(function(ye){var ee=ye.children().intersection(r);while(ee.nodes(":childless").length==0)ee=ee.nodes()[0].children().intersection(r);var te=0,ne=ee.nodes(":childless")[0].connectedEdges().length;ee.nodes(":childless").forEach(function(ae,we){if(ae.connectedEdges().length<ne)ne=ae.connectedEdges().length,te=we}),D.set(ye.id(),ee.nodes(":childless")[te].id())}),B.forEach(function(ye){var ee=void 0;if(ye.isParent())ee=h.get(D.get(ye.id()));else ee=h.get(ye.id());ye.neighborhood().nodes().forEach(function(te){if(r.intersection(ye.edgesWith(te)).length>0)if(te.isParent())n[ee].push(D.get(te.id()));else n[ee].push(te.id())})});var nt=function(ee){var te=h.get(ee),ne=void 0;o.get(ee).forEach(function(ae){if(g.getElementById(ae).isParent())ne=D.get(ae);else ne=ae;n[te].push(ne),n[h.get(ne)].push(ee)})},qe=!0,K=!1,G=void 0;try{for(var pe=o.keys()[Symbol.iterator](),le;!(qe=(le=pe.next()).done);qe=!0){var me=le.value;nt(me)}}catch(ye){K=!0,G=ye}finally{try{if(!qe&&pe.return)pe.return()}finally{if(K)throw G}}Q=h.size;var fe=void 0;if(Q>2){de=Q<u.sampleSize?Q:u.sampleSize;for(var he=0;he<Q;he++)_[he]=[];for(var Ee=0;Ee<de;Ee++)Y[Ee]=[];if(u.quality=="draft"||u.step=="all")Ne(Ae),ke(),De(),fe={nodeIndexes:h,xCoords:P,yCoords:X};else h.forEach(function(ye,ee){P.push(g.getElementById(ee).position("x")),X.push(g.getElementById(ee).position("y"))}),fe={nodeIndexes:h,xCoords:P,yCoords:X};return fe}else{var Be=h.keys(),et=g.getElementById(Be.next().value),Oe=et.position(),Ye=et.outerWidth();if(P.push(Oe.x),X.push(Oe.y),Q==2){var We=g.getElementById(Be.next().value),Je=We.outerWidth();P.push(Oe.x+Ye/2+Je/2+u.idealEdgeLength),X.push(Oe.y)}return fe={nodeIndexes:h,xCoords:P,yCoords:X},fe}};k.exports={spectralLayout:d}},579:(k,z,v)=>{var b=v(212),c=function(d){if(!d)return;d("layout","fcose",b)};if(typeof cytoscape<"u")c(cytoscape);k.exports=c},140:(k)=>{k.exports=e}},s={};function w(k){var z=s[k];if(z!==void 0)return z.exports;var v=s[k]={exports:{}};return i[k](v,v.exports,w),v.exports}var m=w(579);return m})()})});var xt=Ce(ut(),1);var ht={L:"left",R:"right",T:"top",B:"bottom"},vt={L:t((e)=>`${e},${e/2} 0,${e} 0,0`,"L"),R:t((e)=>`0,${e/2} ${e},0 ${e},${e}`,"R"),T:t((e)=>`0,0 ${e},0 ${e/2},${e}`,"T"),B:t((e)=>`${e/2},0 ${e},${e} 0,${e}`,"B")},ot={L:t((e,i)=>e-i+2,"L"),R:t((e,i)=>e-2,"R"),T:t((e,i)=>e-i+2,"T"),B:t((e,i)=>e-2,"B")},kt=t(function(e){if(Re(e))return e==="L"?"R":"L";else return e==="T"?"B":"T"},"getOppositeArchitectureDirection"),pt=t(function(e){let i=e;return i==="L"||i==="R"||i==="T"||i==="B"},"isArchitectureDirection"),Re=t(function(e){let i=e;return i==="L"||i==="R"},"isArchitectureDirectionX"),Ve=t(function(e){let i=e;return i==="T"||i==="B"},"isArchitectureDirectionY"),dt=t(function(e,i){let s=Re(e)&&Ve(i),w=Ve(e)&&Re(i);return s||w},"isArchitectureDirectionXY"),Dt=t(function(e){let i=e[0],s=e[1],w=Re(i)&&Ve(s),m=Ve(i)&&Re(s);return w||m},"isArchitecturePairXY"),Rt=t(function(e){return e!=="LL"&&e!=="RR"&&e!=="TT"&&e!=="BB"},"isValidArchitectureDirectionPair"),lt=t(function(e,i){let s=`${e}${i}`;return Rt(s)?s:void 0},"getArchitectureDirectionPair"),Mt=t(function([e,i],s){let w=s[0],m=s[1];if(Re(w))if(Ve(m))return[e+(w==="L"?-1:1),i+(m==="T"?1:-1)];else return[e+(w==="L"?-1:1),i];else if(Re(m))return[e+(m==="L"?1:-1),i+(w==="T"?1:-1)];else return[e,i+(w==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ft=t(function(e){if(e==="LT"||e==="TL")return[1,1];else if(e==="BL"||e==="LB")return[1,-1];else if(e==="BR"||e==="RB")return[-1,-1];else return[-1,1]},"getArchitectureDirectionXYFactors"),$t=t(function(e,i){if(dt(e,i))return"bend";else if(Re(e))return"horizontal";return"vertical"},"getArchitectureDirectionAlignment"),Pt=t(function(e){return e.type==="service"},"isArchitectureService"),Ot=t(function(e){return e.type==="junction"},"isArchitectureJunction"),mt=t((e,i)=>{let[s,w]=[e,i].sort();return`${JSON.stringify(s)}-${JSON.stringify(w)}`},"architectureGroupAlignmentKey"),yt=t((e)=>e.data(),"edgeData"),Qe=t((e)=>e.data(),"nodeData"),Gt=N.architecture,Et=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId="",this.setAccTitle=S,this.getAccTitle=E,this.setDiagramTitle=L,this.getDiagramTitle=R,this.getAccDescription=A,this.setAccDescription=T,this.clear()}static{t(this,"ArchitectureDB")}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId="",C()}addService({id:e,icon:i,in:s,title:w,iconText:m}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(s)==="node")throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"service",icon:i,iconText:m,title:w,edges:[],in:s})}getServices(){return[...this.nodes.values()].filter(Pt)}addJunction({id:e,in:i}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(i!==void 0){if(e===i)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(i))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(i)==="node")throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,"node"),this.nodes.set(e,{id:e,type:"junction",edges:[],in:i})}getJunctions(){return[...this.nodes.values()].filter(Ot)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:i,in:s,title:w}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(s!==void 0){if(e===s)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(s))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(s)==="node")throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,"group"),this.groups.set(e,{id:e,icon:i,title:w,in:s})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:i,lhsDir:s,rhsDir:w,lhsInto:m,rhsInto:k,lhsGroup:z,rhsGroup:v,title:b}){if(!pt(s))throw Error(`Invalid direction given for left hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(s)}`);if(!pt(w))throw Error(`Invalid direction given for right hand side of edge ${e}--${i}. Expected (L,R,T,B) got ${String(w)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(i)&&!this.groups.has(i))throw Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);let c=this.nodes.get(e).in,y=this.nodes.get(i).in;if(z&&c&&y&&c==y)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(v&&c&&y&&c==y)throw Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:s,lhsInto:m,lhsGroup:z,rhsId:i,rhsDir:w,rhsInto:k,rhsGroup:v,title:b};this.edges.push(d);let f=this.nodes.get(e),u=this.nodes.get(i);if(f&&u)f.edges.push(this.edges[this.edges.length-1]),u.edges.push(this.edges[this.edges.length-1])}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let i=new Set;e.members.forEach((s)=>{if(this.registeredIds.get(s)!=="node")throw Error(`align ${e.direction} references [${s}], which is not a service or junction`);if(i.has(s))throw Error(`align ${e.direction} lists [${s}] more than once`);i.add(s)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,i=new Map;for(let[z,v]of this.nodes.entries()){let b=new Map;for(let c of v.edges){let y=this.getNode(c.lhsId)?.in,d=this.getNode(c.rhsId)?.in;if(y&&d&&y!==d){let f=$t(c.lhsDir,c.rhsDir);if(f!=="bend")e.set(mt(y,d),f)}if(c.lhsId===z){let f=lt(c.lhsDir,c.rhsDir);if(f)b.set(f,c.rhsId)}else{let f=lt(c.rhsDir,c.lhsDir);if(f)b.set(f,c.lhsId)}}i.set(z,b)}let s=new Set,w=new Set(i.keys()),m=t((z)=>{let v=new Map([[z,[0,0]]]),b=[z];while(b.length>0){let c=b.shift();if(c){s.add(c),w.delete(c);let y=i.get(c);if(!y)throw Error(`BFS error: adjacency list for id ${c} not found. Please report this as a bug.`);let d=v.get(c);if(!d)throw Error(`BFS error: position for id ${c} not found in spatial map. Please report this as a bug.`);let[f,u]=d;y.forEach((g,r)=>{if(!s.has(g))v.set(g,Mt([f,u],r)),b.push(g)})}}return v},"BFS"),k=[];while(w.size>0){let z=w.values().next().value;k.push(m(z))}this.dataStructures={adjList:i,spatialMaps:k,groupAlignments:e}}return this.dataStructures}setElementForId(e,i){this.elements.set(e,i)}getElementById(e){return this.elements.get(e)}getConfig(){return U({...Gt,...x().architecture})}getConfigField(e){return this.getConfig()[e]}},zt=t((e,i)=>{H(e,i),e.groups.map((s)=>i.addGroup(s)),e.services.map((s)=>i.addService({...s,type:"service"})),e.junctions.map((s)=>i.addJunction({...s,type:"junction"})),e.edges.map((s)=>i.addEdge(s)),e.alignments?.map((s)=>i.addLayoutHint({direction:s.direction,members:[...s.members]}))},"populateDb"),wt={parser:{yy:void 0},parse:t(async(e)=>{let i=await J("architecture",e);a.debug(i);let s=wt.parser?.yy;if(!(s instanceof Et))throw Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");zt(i,s)},"parse")},Bt=t((e)=>`
|
|
2
2
|
.edge {
|
|
3
3
|
stroke-width: ${e.archEdgeWidth};
|
|
4
4
|
stroke: ${e.archEdgeColor};
|
|
@@ -29,8 +29,8 @@ import{G}from"./chunk-p1yc8hwn.js";import{t,a,M,x,O,yt,C,S,E,T,A,L,R,l,p,V,Vi,An
|
|
|
29
29
|
display: -webkit-box;
|
|
30
30
|
-webkit-box-orient: vertical;
|
|
31
31
|
}
|
|
32
|
-
`,"getStyles"),_t=Bt;function ct(e,i){if(e===0)return i();let s=Math.random,w=e>>>0;Math.random=function(){w=w+1831565813>>>0;let m=w;return m=Math.imul(m^m>>>15,m|1),m^=m+Math.imul(m^m>>>7,m|61),((m^m>>>14)>>>0)/4294967296};try{return i()}finally{Math.random=s}}t(ct,"withSeededRandom");var Ze=t((e)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,"wrapIcon"),
|
|
32
|
+
`,"getStyles"),_t=Bt;function ct(e,i){if(e===0)return i();let s=Math.random,w=e>>>0;Math.random=function(){w=w+1831565813>>>0;let m=w;return m=Math.imul(m^m>>>15,m|1),m^=m+Math.imul(m^m>>>7,m|61),((m^m>>>14)>>>0)/4294967296};try{return i()}finally{Math.random=s}}t(ct,"withSeededRandom");var Ze=t((e)=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${e}</g>`,"wrapIcon"),it={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ze('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ze('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ze('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ze('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ze('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:Wi,blank:{body:Ze("")}}},Yt=t(async function(e,i,s,w){let m=s.getConfigField("padding"),k=s.getConfigField("iconSize"),z=k/2,v=k/6,b=v/2;await Promise.all(i.edges().map(async(c)=>{let{source:y,sourceDir:d,sourceArrow:f,sourceGroup:u,target:g,targetDir:r,targetArrow:B,targetGroup:F,label:o}=yt(c),{x:h,y:D}=c[0].sourceEndpoint(),{x:n,y:P}=c[0].midpoint(),{x:X,y:M}=c[0].targetEndpoint(),j=m+4;if(u)if(Re(d))h+=d==="L"?-j:j;else D+=d==="T"?-j:j+18;if(F)if(Re(r))X+=r==="L"?-j:j;else M+=r==="T"?-j:j+18;if(!u&&s.getNode(y)?.type==="junction")if(Re(d))h+=d==="L"?z:-z;else D+=d==="T"?z:-z;if(!F&&s.getNode(g)?.type==="junction")if(Re(r))X+=r==="L"?z:-z;else M+=r==="T"?z:-z;if(c[0]._private.rscratch){let _=e.insert("g");if(_.insert("path").attr("d",`M ${h},${D} L ${n},${P} L${X},${M} `).attr("class","edge").attr("id",`${w}-${Fe(y,g,{prefix:"L"})}`),f){let I=Re(d)?ot[d](h,v):h-b,Y=Ve(d)?ot[d](D,v):D-b;_.insert("polygon").attr("points",vt[d](v)).attr("transform",`translate(${I},${Y})`).attr("class","arrow")}if(B){let I=Re(r)?ot[r](X,v):X-b,Y=Ve(r)?ot[r](M,v):M-b;_.insert("polygon").attr("points",vt[r](v)).attr("transform",`translate(${I},${Y})`).attr("class","arrow")}if(o){let I=!dt(d,r)?Re(d)?"X":"Y":"XY",Y=0;if(I==="X")Y=Math.abs(h-X);else if(I==="Y")Y=Math.abs(D-M)/1.5;else Y=Math.abs(h-X)/2;let Z=_.append("g");if(await Le(Z,o,{useHtmlLabels:!1,width:Y,classes:"architecture-service-label"},l()),Z.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),I==="X")Z.attr("transform","translate("+n+", "+P+")");else if(I==="Y")Z.attr("transform","translate("+n+", "+P+") rotate(-90)");else if(I==="XY"){let Q=lt(d,r);if(Q&&Dt(Q)){let se=Z.node().getBoundingClientRect(),[re,ue]=Ft(Q);Z.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*re*ue*45})`);let Ae=Z.node().getBoundingClientRect();Z.attr("transform",`
|
|
33
33
|
translate(${n}, ${P-se.height/2})
|
|
34
|
-
translate(${re*
|
|
34
|
+
translate(${re*Ae.width/2}, ${ue*Ae.height/2})
|
|
35
35
|
rotate(${-1*re*ue*45}, 0, ${se.height/2})
|
|
36
|
-
`)}}}}}))},"drawEdges"),Ut=t(async function(e,i,s,w){let N=s.getConfigField("padding")*0.75,B=s.getConfigField("fontSize"),b=s.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async(c)=>{let y=Qe(c);if(y.type==="group"){let{h:d,w:f,x1:u,y1:g}=c.boundingBox(),r=e.append("rect");r.attr("id",`${w}-group-${y.id}`).attr("x",u+b).attr("y",g+b).attr("width",f).attr("height",d).attr("class","node-bkg");let _=e.append("g"),F=u,o=g;if(y.icon){let h=_.append("g");h.html(`<g>${await rt(y.icon,{height:N,width:N,fallbackPrefix:nt.prefix})}</g>`),h.attr("transform","translate("+(F+b+1)+", "+(o+b+1)+")"),F+=N,o+=B/2-1-2}if(y.label){let h=_.append("g");await Le(h,y.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},l()),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),h.attr("transform","translate("+(F+b+4)+", "+(o+b+2)+")")}s.setElementForId(y.id,r)}}))},"drawGroups"),Ht=t(async function(e,i,s,w){let m=l();for(let N of s){let B=i.append("g"),v=e.getConfigField("iconSize");if(N.title){let d=B.append("g");await Le(d,N.title,{useHtmlLabels:!1,width:v*1.5,classes:"architecture-service-label"},m),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+v/2+", "+v+")")}let b=B.append("g");if(N.icon)b.html(`<g>${await rt(N.icon,{height:v,width:v,fallbackPrefix:nt.prefix})}</g>`);else if(N.iconText){b.html(`<g>${await rt("blank",{height:v,width:v,fallbackPrefix:nt.prefix})}</g>`);let u=b.append("g").append("foreignObject").attr("width",v).attr("height",v).append("div").attr("class","node-icon-text").attr("style",`height: ${v}px;`).append("div").html(O(N.iconText,m)),g=parseInt(window.getComputedStyle(u.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;u.attr("style",`-webkit-line-clamp: ${Math.floor((v-2)/g)};`)}else b.append("path").attr("class","node-bkg").attr("id",`${w}-node-${N.id}`).attr("d",`M0,${v} V5 Q0,0 5,0 H${v-5} Q${v},0 ${v},5 V${v} Z`);B.attr("id",`${w}-service-${N.id}`).attr("class","architecture-service");let{width:c,height:y}=B.node().getBBox();N.width=c,N.height=y,e.setElementForId(N.id,B)}return 0},"drawServices"),Vt=t(function(e,i,s,w){s.forEach((m)=>{let N=i.append("g"),B=e.getConfigField("iconSize");N.append("g").append("rect").attr("id",`${w}-node-${m.id}`).attr("fill-opacity","0").attr("width",B).attr("height",B),N.attr("class","architecture-junction");let{width:b,height:c}=N._groups[0][0].getBBox();N.width=b,N.height=c,e.setElementForId(m.id,N)})},"drawJunctions");An([{name:nt.prefix,icons:nt}]);ht.use(xt.default);function Tt(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"service",id:w.id,icon:w.icon,label:w.title,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-service"})})}t(Tt,"addServices");function At(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"junction",id:w.id,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-junction"})})}t(At,"addJunctions");function Lt(e,i){i.nodes().map((s)=>{let w=Qe(s);if(w.type==="group")return;w.x=s.position().x,w.y=s.position().y,e.getElementById(w.id).attr("transform","translate("+(w.x||0)+","+(w.y||0)+")")})}t(Lt,"positionNodes");function Ct(e,i){e.forEach((s)=>{i.add({group:"nodes",data:{type:"group",id:s.id,icon:s.icon,label:s.title,parent:s.in},classes:"node-group"})})}t(Ct,"addGroups");function It(e,i){e.forEach((s)=>{let{lhsId:w,rhsId:m,lhsInto:N,lhsGroup:B,rhsInto:v,lhsDir:b,rhsDir:c,rhsGroup:y,title:d}=s,f=dt(s.lhsDir,s.rhsDir)?"segments":"straight",u={id:`${w}-${m}`,label:d,source:w,sourceDir:b,sourceArrow:N,sourceGroup:B,sourceEndpoint:b==="L"?"0 50%":b==="R"?"100% 50%":b==="T"?"50% 0":"50% 100%",target:m,targetDir:c,targetArrow:v,targetGroup:y,targetEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%"};i.add({group:"edges",data:u,classes:f})})}t(It,"addEdges");function bt(e,i,s,w=[]){let m=t((f,u)=>{let g=new Map;for(let[r,_]of f.entries()){let F=`${r}`,o=0,h=[..._.entries()];if(h.length===1){g.set(F,h[0][1]);continue}for(let k=0;k<h.length-1;k++)for(let n=k+1;n<h.length;n++){let[P,X]=h[k],[D,j]=h[n];if(s.get(pt(P,D))===u)g.set(F,[...g.get(F)??[],...X,...j]);else if(P==="default"||D==="default")g.set(F,[...g.get(F)??[],...X,...j]);else{let I=`${F}-${o++}`;g.set(I,X);let H=`${F}-${o++}`;g.set(H,j)}}}return g},"flattenAlignments"),N=i.map((f)=>{let u=new Map,g=new Map;return f.forEach(([r,_],F)=>{let o=e.getNode(F)?.in??"default",h=u.get(_)??new Map;if(!u.has(_))u.set(_,h);let k=g.get(r)??new Map;if(!g.has(r))g.set(r,k);for(let n of[h,k]){let P=n.get(o)??[];if(!n.has(o))n.set(o,P);P.push(F)}}),{horiz:[...m(u,"horizontal").values()].filter((r)=>r.length>1),vert:[...m(g,"vertical").values()].filter((r)=>r.length>1)}}),[B,v]=N.reduce(([f,u],{horiz:g,vert:r})=>[[...f,...g],[...u,...r]],[[],[]]),b=new Set;w.forEach((f)=>f.members.forEach((u)=>b.add(u)));let c=t((f)=>f.filter((u)=>!u.some((g)=>b.has(g))),"dropOverlapping"),y=c(B),d=c(v);return w.forEach((f)=>{if(f.members.length<2)return;if(f.direction==="row")y.push([...f.members]);else d.push([...f.members])}),{horizontal:y,vertical:d}}t(bt,"getAlignments");function Nt(e,i,s=[]){let w=[],m=i.getConfigField("iconSize"),N=i.getConfigField("idealEdgeLengthMultiplier"),B=N*m,v=new Set;s.forEach((y)=>{for(let d=0;d<y.members.length-1;d++){let f=y.members[d],u=y.members[d+1];if(v.add(`${f}|${u}`),v.add(`${u}|${f}`),y.direction==="row")w.push({left:f,right:u,gap:B});else w.push({top:f,bottom:u,gap:B})}});let b=t((y)=>`${y[0]},${y[1]}`,"posToStr"),c=t((y)=>y.split(",").map((d)=>parseInt(d)),"strToPos");return e.forEach((y)=>{let d=new Map([...y.entries()].map(([r,_])=>[b(_),r])),f=[b([0,0])],u={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(f.length>0){let r=f.shift();if(r){u[r]=1;let _=d.get(r);if(_){let F=c(r);Object.entries(g).forEach(([o,h])=>{let k=b([F[0]+h[0],F[1]+h[1]]),n=d.get(k);if(n&&!u[k]){if(f.push(k),v.has(`${_}|${n}`))return;w.push({[ut[o]]:n,[ut[kt(o)]]:_,gap:N*m})}})}}}}),w}t(Nt,"getRelativeConstraints");function St(e,i,s,w,m,{spatialMaps:N,groupAlignments:B}){return new Promise((v)=>{let b=p("body").append("div").attr("id","cy").attr("style","display:none"),c=ht({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${m.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${m.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});b.remove(),Ct(s,c),Tt(e,c,m),At(i,c,m),It(w,c);let y=m.getLayoutHints(),d=bt(m,N,B,y),f=Nt(N,m,y),u=m.getConfigField("iconSize"),g=m.getConfigField("idealEdgeLengthMultiplier")*u,r=0.5*u,_=m.getConfigField("edgeElasticity"),F=m.getConfigField("seed"),o=c.layout({name:"fcose",quality:"proof",randomize:m.getConfigField("randomize"),nodeSeparation:m.getConfigField("nodeSeparation"),numIter:m.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[k,n]=h.connectedNodes(),{parent:P}=Qe(k),{parent:X}=Qe(n);return P===X?g:r},edgeElasticity(h){let[k,n]=h.connectedNodes(),{parent:P}=Qe(k),{parent:X}=Qe(n);return P===X?_:0.001},alignmentConstraint:d,relativePlacementConstraint:f});o.one("layoutstop",()=>{function h(k,n,P,X){let D,j,{x:Y,y:I}=k,{x:H,y:J}=n;j=(X-I+(Y-P)*(I-J)/(Y-H))/Math.sqrt(1+Math.pow((I-J)/(Y-H),2)),D=Math.sqrt(Math.pow(X-I,2)+Math.pow(P-Y,2)-Math.pow(j,2));let Z=Math.sqrt(Math.pow(H-Y,2)+Math.pow(J-I,2));D=D/Z;let se=(H-Y)*(X-I)-(J-I)*(P-Y);switch(!0){case se>=0:se=1;break;case se<0:se=-1;break}let re=(H-Y)*(P-Y)+(J-I)*(X-I);switch(!0){case re>=0:re=1;break;case re<0:re=-1;break}return j=Math.abs(j)*se,D=D*re,{distances:j,weights:D}}t(h,"getSegmentWeights"),c.startBatch();for(let k of Object.values(c.edges()))if(k.data?.()){let{x:n,y:P}=k.source().position(),{x:X,y:D}=k.target().position();if(n!==X&&P!==D){let j=k.sourceEndpoint(),Y=k.targetEndpoint(),{sourceDir:I}=mt(k),[H,J]=Ve(I)?[j.x,Y.y]:[Y.x,j.y],{weights:Z,distances:se}=h(j,Y,H,J);k.style("segment-distances",se),k.style("segment-weights",Z)}}c.endBatch(),ct(F,()=>o.run())});try{ct(F,()=>o.run())}catch(h){if(h instanceof RangeError&&h.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw h}c.ready((h)=>{a.info("Ready",h),v(c)})})}t(St,"layoutArchitecture");var Xt=t(async(e,i,s,w)=>{let m=w.db;m.setDiagramId(i);let N=m.getServices(),B=m.getJunctions(),v=m.getGroups(),b=m.getEdges(),c=m.getDataStructures(),y=V(i),d=y.append("g");d.attr("class","architecture-edges");let f=y.append("g");f.attr("class","architecture-services");let u=y.append("g");u.attr("class","architecture-groups"),await Ht(m,f,N,i),Vt(m,f,B,i);let g=await St(N,B,v,b,m,c);await Yt(d,g,m,i),await Ut(u,g,m,i),Lt(m,g),yt(void 0,y,m.getConfigField("padding"),m.getConfigField("useMaxWidth"))},"draw"),jt={draw:Xt},ar={parser:wt,get db(){return new Et},renderer:jt,styles:_t};export{ar as diagram};
|
|
36
|
+
`)}}}}}))},"drawEdges"),Ut=t(async function(e,i,s,w){let k=s.getConfigField("padding")*0.75,z=s.getConfigField("fontSize"),b=s.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async(c)=>{let y=Qe(c);if(y.type==="group"){let{h:d,w:f,x1:u,y1:g}=c.boundingBox(),r=e.append("rect");r.attr("id",`${w}-group-${y.id}`).attr("x",u+b).attr("y",g+b).attr("width",f).attr("height",d).attr("class","node-bkg");let B=e.append("g"),F=u,o=g;if(y.icon){let h=B.append("g");h.html(`<g>${await at(y.icon,{height:k,width:k,fallbackPrefix:it.prefix})}</g>`),h.attr("transform","translate("+(F+b+1)+", "+(o+b+1)+")"),F+=k,o+=z/2-1-2}if(y.label){let h=B.append("g");await Le(h,y.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},l()),h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),h.attr("transform","translate("+(F+b+4)+", "+(o+b+2)+")")}s.setElementForId(y.id,r)}}))},"drawGroups"),Ht=t(async function(e,i,s,w){let m=l();for(let k of s){let z=i.append("g"),v=e.getConfigField("iconSize");if(k.title){let d=z.append("g");await Le(d,k.title,{useHtmlLabels:!1,width:v*1.5,classes:"architecture-service-label"},m),d.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),d.attr("transform","translate("+v/2+", "+v+")")}let b=z.append("g");if(k.icon)b.html(`<g>${await at(k.icon,{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);else if(k.iconText){b.html(`<g>${await at("blank",{height:v,width:v,fallbackPrefix:it.prefix})}</g>`);let u=b.append("g").append("foreignObject").attr("width",v).attr("height",v).append("div").attr("class","node-icon-text").attr("style",`height: ${v}px;`).append("div").html(O(k.iconText,m)),g=parseInt(window.getComputedStyle(u.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;u.attr("style",`-webkit-line-clamp: ${Math.floor((v-2)/g)};`)}else b.append("path").attr("class","node-bkg").attr("id",`${w}-node-${k.id}`).attr("d",`M0,${v} V5 Q0,0 5,0 H${v-5} Q${v},0 ${v},5 V${v} Z`);z.attr("id",`${w}-service-${k.id}`).attr("class","architecture-service");let{width:c,height:y}=z.node().getBBox();k.width=c,k.height=y,e.setElementForId(k.id,z)}return 0},"drawServices"),Vt=t(function(e,i,s,w){s.forEach((m)=>{let k=i.append("g"),z=e.getConfigField("iconSize");k.append("g").append("rect").attr("id",`${w}-node-${m.id}`).attr("fill-opacity","0").attr("width",z).attr("height",z),k.attr("class","architecture-junction");let{width:b,height:c}=k._groups[0][0].getBBox();k.width=b,k.height=c,e.setElementForId(m.id,k)})},"drawJunctions");In([{name:it.prefix,icons:it}]);ft.use(xt.default);function Tt(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"service",id:w.id,icon:w.icon,label:w.title,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-service"})})}t(Tt,"addServices");function At(e,i,s){e.forEach((w)=>{i.add({group:"nodes",data:{type:"junction",id:w.id,parent:w.in,width:s.getConfigField("iconSize"),height:s.getConfigField("iconSize")},classes:"node-junction"})})}t(At,"addJunctions");function Lt(e,i){i.nodes().map((s)=>{let w=Qe(s);if(w.type==="group")return;w.x=s.position().x,w.y=s.position().y,e.getElementById(w.id).attr("transform","translate("+(w.x||0)+","+(w.y||0)+")")})}t(Lt,"positionNodes");function Ct(e,i){e.forEach((s)=>{i.add({group:"nodes",data:{type:"group",id:s.id,icon:s.icon,label:s.title,parent:s.in},classes:"node-group"})})}t(Ct,"addGroups");function It(e,i){e.forEach((s)=>{let{lhsId:w,rhsId:m,lhsInto:k,lhsGroup:z,rhsInto:v,lhsDir:b,rhsDir:c,rhsGroup:y,title:d}=s,f=dt(s.lhsDir,s.rhsDir)?"segments":"straight",u={id:`${w}-${m}`,label:d,source:w,sourceDir:b,sourceArrow:k,sourceGroup:z,sourceEndpoint:b==="L"?"0 50%":b==="R"?"100% 50%":b==="T"?"50% 0":"50% 100%",target:m,targetDir:c,targetArrow:v,targetGroup:y,targetEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%"};i.add({group:"edges",data:u,classes:f})})}t(It,"addEdges");function bt(e,i,s,w=[]){let m=t((f,u)=>{let g=new Map;for(let[r,B]of f.entries()){let F=`${r}`,o=0,h=[...B.entries()];if(h.length===1){g.set(F,h[0][1]);continue}for(let D=0;D<h.length-1;D++)for(let n=D+1;n<h.length;n++){let[P,X]=h[D],[M,j]=h[n];if(s.get(mt(P,M))===u)g.set(F,[...g.get(F)??[],...X,...j]);else if(P==="default"||M==="default")g.set(F,[...g.get(F)??[],...X,...j]);else{let I=`${F}-${o++}`;g.set(I,X);let Y=`${F}-${o++}`;g.set(Y,j)}}}return g},"flattenAlignments"),k=i.map((f)=>{let u=new Map,g=new Map;return f.forEach(([r,B],F)=>{let o=e.getNode(F)?.in??"default",h=u.get(B)??new Map;if(!u.has(B))u.set(B,h);let D=g.get(r)??new Map;if(!g.has(r))g.set(r,D);for(let n of[h,D]){let P=n.get(o)??[];if(!n.has(o))n.set(o,P);P.push(F)}}),{horiz:[...m(u,"horizontal").values()].filter((r)=>r.length>1),vert:[...m(g,"vertical").values()].filter((r)=>r.length>1)}}),[z,v]=k.reduce(([f,u],{horiz:g,vert:r})=>[[...f,...g],[...u,...r]],[[],[]]),b=new Set;w.forEach((f)=>f.members.forEach((u)=>b.add(u)));let c=t((f)=>f.filter((u)=>!u.some((g)=>b.has(g))),"dropOverlapping"),y=c(z),d=c(v);return w.forEach((f)=>{if(f.members.length<2)return;if(f.direction==="row")y.push([...f.members]);else d.push([...f.members])}),{horizontal:y,vertical:d}}t(bt,"getAlignments");function Nt(e,i,s=[]){let w=[],m=i.getConfigField("iconSize"),k=i.getConfigField("idealEdgeLengthMultiplier"),z=k*m,v=new Set;s.forEach((y)=>{for(let d=0;d<y.members.length-1;d++){let f=y.members[d],u=y.members[d+1];if(v.add(`${f}|${u}`),v.add(`${u}|${f}`),y.direction==="row")w.push({left:f,right:u,gap:z});else w.push({top:f,bottom:u,gap:z})}});let b=t((y)=>`${y[0]},${y[1]}`,"posToStr"),c=t((y)=>y.split(",").map((d)=>parseInt(d)),"strToPos");return e.forEach((y)=>{let d=new Map([...y.entries()].map(([r,B])=>[b(B),r])),f=[b([0,0])],u={},g={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(f.length>0){let r=f.shift();if(r){u[r]=1;let B=d.get(r);if(B){let F=c(r);Object.entries(g).forEach(([o,h])=>{let D=b([F[0]+h[0],F[1]+h[1]]),n=d.get(D);if(n&&!u[D]){if(f.push(D),v.has(`${B}|${n}`))return;w.push({[ht[o]]:n,[ht[kt(o)]]:B,gap:k*m})}})}}}}),w}t(Nt,"getRelativeConstraints");function St(e,i,s,w,m,{spatialMaps:k,groupAlignments:z}){return new Promise((v)=>{let b=p("body").append("div").attr("id","cy").attr("style","display:none"),c=ft({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[0.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${m.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${m.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});b.remove(),Ct(s,c),Tt(e,c,m),At(i,c,m),It(w,c);let y=m.getLayoutHints(),d=bt(m,k,z,y),f=Nt(k,m,y),u=m.getConfigField("iconSize"),g=m.getConfigField("idealEdgeLengthMultiplier")*u,r=0.5*u,B=m.getConfigField("edgeElasticity"),F=m.getConfigField("seed"),o=c.layout({name:"fcose",quality:"proof",randomize:m.getConfigField("randomize"),nodeSeparation:m.getConfigField("nodeSeparation"),numIter:m.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?g:r},edgeElasticity(h){let[D,n]=h.connectedNodes(),{parent:P}=Qe(D),{parent:X}=Qe(n);return P===X?B:0.001},alignmentConstraint:d,relativePlacementConstraint:f});o.one("layoutstop",()=>{function h(D,n,P,X){let M,j,{x:_,y:I}=D,{x:Y,y:Z}=n;j=(X-I+(_-P)*(I-Z)/(_-Y))/Math.sqrt(1+Math.pow((I-Z)/(_-Y),2)),M=Math.sqrt(Math.pow(X-I,2)+Math.pow(P-_,2)-Math.pow(j,2));let Q=Math.sqrt(Math.pow(Y-_,2)+Math.pow(Z-I,2));M=M/Q;let se=(Y-_)*(X-I)-(Z-I)*(P-_);switch(!0){case se>=0:se=1;break;case se<0:se=-1;break}let re=(Y-_)*(P-_)+(Z-I)*(X-I);switch(!0){case re>=0:re=1;break;case re<0:re=-1;break}return j=Math.abs(j)*se,M=M*re,{distances:j,weights:M}}t(h,"getSegmentWeights"),c.startBatch();for(let D of Object.values(c.edges()))if(D.data?.()){let{x:n,y:P}=D.source().position(),{x:X,y:M}=D.target().position();if(n!==X&&P!==M){let j=D.sourceEndpoint(),_=D.targetEndpoint(),{sourceDir:I}=yt(D),[Y,Z]=Ve(I)?[j.x,_.y]:[_.x,j.y],{weights:Q,distances:se}=h(j,_,Y,Z);D.style("segment-distances",se),D.style("segment-weights",Q)}}c.endBatch(),ct(F,()=>o.run())});try{ct(F,()=>o.run())}catch(h){if(h instanceof RangeError&&h.message.includes("Invalid array length"))throw Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis.");throw h}c.ready((h)=>{a.info("Ready",h),v(c)})})}t(St,"layoutArchitecture");var Xt=t(async(e,i,s,w)=>{let m=w.db;m.setDiagramId(i);let k=m.getServices(),z=m.getJunctions(),v=m.getGroups(),b=m.getEdges(),c=m.getDataStructures(),y=V(i),d=y.append("g");d.attr("class","architecture-edges");let f=y.append("g");f.attr("class","architecture-services");let u=y.append("g");u.attr("class","architecture-groups"),await Ht(m,f,k,i),Vt(m,f,z,i);let g=await St(k,z,v,b,m,c);await Yt(d,g,m,i),await Ut(u,g,m,i),Lt(m,g),gt(void 0,y,m.getConfigField("padding"),m.getConfigField("useMaxWidth"))},"draw"),jt={draw:Xt},ar={parser:wt,get db(){return new Et},renderer:jt,styles:_t};export{ar as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,o,i,r,m,e,n,y,nn,ne}from"./chunk-ve8gy05p.js";import{$r,Br,Fr}from"./chunk-1m6fx2h7.js";var ee={global:"全局",project:"项目",custom:"自定义",builtin:"内置"};function F({skill:s,issue:x,connection:v}){let{Button:E,CopyButton:j,style:u,useTheme:R}=y();R();let[l,k]=r(),[L,P]=r(),[f,O]=r(0);return o(()=>{let p=!0;P(void 0),k(void 0);let b=new URLSearchParams;if(s.projectID)b.set("projectID",s.projectID);if(s.location)b.set("location",s.location);let S=b.toString()?`?${b.toString()}`:"";return Promise.all([v.request(`/api/skills/${encodeURIComponent(s.name)}/content${S}`),v.request(`/api/skills/${encodeURIComponent(s.name)}/files${S}`)]).then(([g,D])=>{if(p)k({text:g.text,files:D.files})}).catch((g)=>{if(p)P(g instanceof Error?g.message:"读取失败")}),()=>{p=!1}},[v,s.name,s.projectID,s.location,f]),n("div",{className:"min-w-0 space-y-5 text-sm text-ink",children:[e("p",{className:"whitespace-pre-wrap break-words [overflow-wrap:anywhere] text-dim",children:s.description||"暂无描述"}),n("div",{children:[n("p",{className:"break-all text-xs text-dim",children:[ee[s.scope],s.projectName?` · ${s.projectName}`:""]}),n("div",{className:"mt-1 flex min-w-0 items-center gap-2",children:[e("code",{className:u("markdown.inlineCode","min-w-0 flex-1 break-all text-xs"),children:s.location}),e(j,{text:s.location,label:"复制完整路径",className:"size-10"})]})]}),n("ul",{className:"space-y-1 break-words text-xs text-dim",children:[e("li",{children:"启用状态按名称生效,影响所有同名技能的新会话可用性。"}),s.disableModelInvocation&&e("li",{children:"仅手动:可由用户调用,不向模型自动提供。"}),s.platforms&&n("li",{children:["平台限制:",s.platforms.join("、")]}),s.disabled&&e("li",{children:"已禁用:不会提供给新会话。"}),x?.overriddenBy&&n("li",{className:"break-all",children:["被覆盖:同名技能优先使用 ",x.overriddenBy]})]}),s.commands?.length?n("div",{children:[e("h3",{className:"font-medium",children:"bin 命令"}),e("p",{className:"mt-1 text-xs text-dim",children:"技能目录中的可执行命令。"}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs",children:s.commands.map((p)=>e("li",{className:"break-all",children:p},p))})]}):null,L?n("div",{role:"alert",className:"space-y-2",children:[n("p",{className:"break-words text-danger",children:["读取失败:",L]}),e(E,{className:"h-10",onClick:()=>O(f+1),children:"重试"})]}):!l?e("p",{role:"status",className:"text-dim",children:"正在读取文件…"}):n(m,{children:[n("section",{children:[n("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e("h3",{className:"font-medium",children:"SKILL.md 原文"}),e(j,{text:l.text,label:"复制 SKILL.md 原文",className:"size-10"})]}),n("p",{className:"mb-2 text-xs text-faint",children:[l.text.length.toLocaleString()," 字符 · 约 ",Math.ceil(l.text.length/4).toLocaleString()," ","tokens(估算)"]}),e("pre",{className:u("surface.subtle",u("chat.toolOutput"),"rounded-lg bg-raised p-3 text-xs leading-5 break-all"),children:l.text})]}),n("section",{children:[n("h3",{className:"font-medium",children:["目录文件 · ",l.files.length,l.files.length===200?"(最多显示 200 个)":""]}),e("ul",{className:"mt-2 space-y-1 font-mono text-xs text-dim",children:l.files.map((p)=>e("li",{className:"break-all",children:p},p))})]})]})]})}var A="all",G="non-project";function me({connection:s}){let{Button:x,Select:v,Dialog:E,CatalogRow:j,style:u,useTheme:R}=y();R();let[l,k]=r([]),[L,P]=r([]),[f,O]=r(A),[p,b]=r([]),[S,g]=r(),[D,H]=r(""),[w,B]=r(),[N,q]=r(!0),[K,z]=r(),[W,Q]=r(),d=i(0),I=i(!1),C=h(async(t=!1)=>{let c=++d.current;I.current=!0,q(!0);try{if(t)await s.request("/api/skills/rescan",{method:"POST"});let[a,U,T]=await Promise.all([s.request("/api/skills?all=true"),s.request("/api/skills/settings"),s.request("/api/projects")]);if(c!==d.current)return;k(a.skills),P(T),b(a.issues),g(U),Q(new Date),z(void 0)}catch(a){if(c===d.current)z(a instanceof Error?a.message:"读取失败")}finally{if(c===d.current)I.current=!1,q(!1)}},[s]);o(()=>(C(),()=>{d.current++}),[C]);async function V(t){if(I.current)return;I.current=!0;let c=++d.current;q(!0);try{let a=await s.request("/api/skills/settings",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(c!==d.current)return;g(a),await C()}catch(a){if(c!==d.current)return;z(a instanceof Error?a.message:"保存设置失败"),I.current=!1,q(!1)}}let X=D.trim().toLocaleLowerCase(),J=f===A?l:l.filter((t)=>{if(t.scope!=="project")return!0;return f!==G&&t.projectID===f}),M=J.filter((t)=>`${t.name} ${t.description??""}`.toLocaleLowerCase().includes(X)),_=(t)=>p.find((c)=>c.kind==="overridden"&&(c.path==="<built-in>"?t.scope==="builtin":c.path.replace(/\\/g,"/")===`${t.location.replace(/\\/g,"/")}/SKILL.md`));return n("div",{className:"min-w-0 space-y-6",children:[n("section",{className:"min-w-0",children:[n("div",{className:"mb-2.5 flex flex-wrap items-end justify-between gap-3 px-0.5",children:[n("div",{className:"min-w-0 flex-1 basis-48",children:[e("h2",{className:u("settings.groupTitle"),children:"技能"}),e("p",{"aria-live":"polite",className:u("settings.groupDesc"),children:W&&`找到 ${J.length} 个 · ${W.toLocaleTimeString("zh-CN",{hour12:!1})}`})]}),n("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e(v,{value:f,disabled:N,onValueChange:(t)=>{B(void 0),O(t)},groups:[{options:[{value:A,label:"全部来源"},{value:G,label:"非项目技能"}]},...$r(L)],className:"w-44"}),n(x,{variant:"ghost",disabled:N,onClick:()=>C(!0),className:"h-9 px-2.5 text-xs",children:[e(ne,{className:`size-3.5 ${N?"animate-spin":""}`}),e("span",{className:"ml-1",children:"重新扫描"})]})]})]}),K&&n("div",{role:"alert",className:"mb-3 flex flex-wrap items-center gap-2 rounded-xl border border-line p-3",children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法更新技能:",K]}),e(x,{disabled:N,onClick:()=>C(),children:"重试"})]}),e(Br,{label:"搜索技能",placeholder:"搜索技能",value:D,onChange:H}),e("div",{className:u("settings.groupBox"),children:N&&!l.length?e(Fr,{}):M.length===0?e("p",{className:"p-4 text-sm text-dim",children:"没有找到匹配的技能"}):e("ul",{className:"divide-y divide-line",children:M.map((t)=>{let c=_(t),a=t.disabled;return e("li",{children:e(j,{name:t.name,selectLabel:`查看技能 ${t.name}`,onSelect:()=>B(t),description:t.description,inactive:a,aside:n(m,{children:[c&&n("span",{className:"flex items-center gap-1 text-xs text-warning",children:[e(nn,{className:"size-3.5"}),"被覆盖"]}),e("span",{className:u("control.badge"),children:t.scope==="project"?"项目":t.scope==="builtin"?"内置":"全局"})]}),toggle:{checked:!a,label:`启用技能 ${t.name}`,disabled:N,onCheckedChange:(U)=>{if(!S)return;let T=S.disabled??[],Y=U?T.filter((Z)=>Z!==t.name):[...T,t.name];V({...S,disabled:Y})}}})},`${t.scope}:${t.projectID??""}:${t.name}`)})})})]}),e(E,{open:Boolean(w),onOpenChange:(t)=>{if(!t)B(void 0)},title:w?.name??"",size:"lg",footer:e("div",{className:"flex w-full justify-end",children:e(x,{variant:"primary",onClick:()=>B(void 0),children:"关闭"})}),children:w&&e(F,{skill:w,issue:_(w),connection:s})})]})}export{me as SkillsSection};
|