@bkm016/basalt 0.1.4 → 0.1.6
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/README.md +61 -11
- package/{chunk-y648fzx0.js → chunk-0039s4jt.js} +3 -3
- package/{chunk-rmj5b73e.js → chunk-053vb71h.js} +1 -1
- package/{chunk-whvj83b7.js → chunk-063vbmtp.js} +2 -2
- package/{chunk-7tbya5b5.js → chunk-0javrjcm.js} +22 -22
- package/{chunk-y7nma9rk.js → chunk-10p3mb40.js} +2 -2
- package/{chunk-jk25nt60.js → chunk-39vwrg8n.js} +2 -2
- package/chunk-3k627vf2.js +3 -0
- package/{chunk-q7t30zz2.js → chunk-6kdgk70p.js} +5 -5
- package/{chunk-3x94302m.js → chunk-6ptv4g5e.js} +3 -3
- package/chunk-75434aay.js +2 -0
- package/{chunk-2zp1mv3q.js → chunk-7hr6zw2m.js} +1 -1
- package/{chunk-g2t6t8fk.js → chunk-7jezts2n.js} +2 -2
- package/{chunk-y58ygzn9.js → chunk-818nd6s1.js} +3 -3
- package/{chunk-k23t7vhs.js → chunk-8gw5bvh3.js} +5 -5
- package/{chunk-vv7fp27r.js → chunk-8mezk0cb.js} +2 -2
- package/{chunk-zggzfa7j.js → chunk-8saewt61.js} +2 -2
- package/{chunk-362g64pd.js → chunk-8wj32837.js} +1 -1
- package/{chunk-fjtvjrkg.js → chunk-8wv5t0w6.js} +5 -5
- package/{chunk-vk1gxk1t.js → chunk-8x21n7y9.js} +1 -1
- package/chunk-a0c989ky.js +2 -0
- package/{chunk-4w17tzp5.js → chunk-a5apjjcn.js} +12 -12
- package/chunk-a81p46j7.js +2 -0
- package/chunk-agsfy9w7.js +2 -0
- package/{chunk-fw2bpqmw.js → chunk-arcqjt91.js} +1 -1
- package/chunk-bdy4jksd.js +2 -0
- package/{chunk-qe0teyn1.js → chunk-benrzwea.js} +1 -1
- package/{chunk-0y7ne3d0.js → chunk-bwawt15q.js} +2 -2
- package/{chunk-pxsrqrd0.js → chunk-c4qr1f41.js} +2 -2
- package/{chunk-981f9dw8.js → chunk-c7rcw9fb.js} +6 -6
- package/{chunk-cjc90f84.js → chunk-ca982n62.js} +3 -3
- package/chunk-d20p02ny.js +2 -0
- package/{chunk-97rzj7f6.js → chunk-d6p2hgxh.js} +1 -1
- package/{chunk-k6w6y71k.js → chunk-dnx91jrd.js} +2 -2
- package/{chunk-8d46jtbj.js → chunk-dpz4hwqb.js} +2 -2
- package/{chunk-aky4tztg.js → chunk-ebpyvs1d.js} +2 -2
- package/{chunk-m40gxwq4.js → chunk-ecf896fz.js} +3 -3
- package/{chunk-pjyn2s97.js → chunk-ejsneb6f.js} +1 -1
- package/{chunk-pbcy6zdt.js → chunk-ey15ye2h.js} +1 -1
- package/{chunk-kp22kaez.js → chunk-f156y565.js} +2 -2
- package/{chunk-9rmqgc3c.js → chunk-f544p9rh.js} +15 -15
- package/chunk-fmq3zwzk.js +2 -0
- package/{chunk-em187cy3.js → chunk-fx7f4m3c.js} +2 -2
- package/{chunk-r7fpkb49.js → chunk-g0t9c3gv.js} +1 -1
- package/{chunk-mvfsxdx6.js → chunk-gv7wqkey.js} +10 -10
- package/chunk-hksqjts3.js +3884 -0
- package/{chunk-ztsjgssj.js → chunk-j7yvh0ae.js} +1 -1
- package/chunk-kns4kv7b.js +3 -0
- package/{chunk-nmca5h6m.js → chunk-n85qs7cs.js} +1 -1
- package/{chunk-8wc8qdx8.js → chunk-n981vx1t.js} +6 -6
- package/{chunk-3ct2tkr8.js → chunk-npez1492.js} +2 -2
- package/{chunk-t6zs4kw0.js → chunk-peja51xv.js} +2 -2
- package/{chunk-r0scgfwx.js → chunk-pg5nkf1y.js} +2 -2
- package/{chunk-7afmgncg.js → chunk-prgm07j4.js} +1 -1
- package/{chunk-jwdb0ccj.js → chunk-q9dd6fhj.js} +3 -3
- package/{chunk-ykens1hy.js → chunk-r8vvcp6c.js} +1 -1
- package/chunk-rfb85nj7.js +2 -0
- package/{chunk-ev6yvy5y.js → chunk-rfdt992v.js} +15 -15
- package/{chunk-xfvvh1s5.js → chunk-s6dejhfj.js} +1 -1
- package/{chunk-xh3vr5vz.js → chunk-s7skpgm2.js} +1 -1
- package/chunk-tgfbtehh.js +480 -0
- package/{chunk-m8vkwdgr.js → chunk-w67dvqtb.js} +4 -4
- package/{chunk-f3xadvab.js → chunk-whj87h4r.js} +2 -2
- package/{chunk-2hbfk5xd.js → chunk-wnzvnskb.js} +2 -2
- package/{chunk-vexrrw1b.js → chunk-xtq1xpq0.js} +2 -2
- package/{chunk-1vd0f74z.js → chunk-y8dkfpmj.js} +5 -5
- package/{chunk-shadcb9z.js → chunk-z02sj1je.js} +2 -2
- package/{chunk-akr0a8nc.js → chunk-zxkq9m8e.js} +1 -1
- package/compiled.js +12 -12
- package/package.json +1 -1
- package/ui-test-worker.js +32 -32
- package/web/{chunk-t4c8xavd.js → chunk-03dmzvaq.js} +7 -7
- package/web/{chunk-n8sky2q6.js → chunk-07agqp8h.js} +1 -1
- package/web/chunk-0fgaepwm.js +3 -0
- package/web/chunk-0gg00f86.js +292 -0
- package/web/chunk-0pecj6d7.js +1 -0
- package/web/{chunk-ts7zrf5b.js → chunk-0whceqes.js} +2 -2
- package/web/chunk-0wt1dgny.js +1 -0
- package/web/{chunk-sfg2wkhe.js → chunk-12xxh71x.js} +6 -6
- package/web/chunk-1ves7sq5.js +1 -0
- package/web/chunk-1yj79b48.js +1 -0
- package/web/chunk-296hgy6k.js +370 -0
- package/web/{chunk-f4tacm06.js → chunk-2bmq1whf.js} +1 -1
- package/web/chunk-2wqxhqr9.js +1 -0
- package/web/{chunk-2j4m0bh1.js → chunk-30b33r2w.js} +2 -2
- package/web/{chunk-sspfxp5e.js → chunk-30zfw7zg.js} +1 -1
- package/web/chunk-39ng8zwx.css +1 -0
- package/web/chunk-3de552rg.js +70 -0
- package/web/chunk-3nbzj48p.js +36 -0
- package/web/{chunk-0z0y25zf.js → chunk-3zebd9fq.js} +3 -3
- package/web/chunk-4r1n98zx.js +2 -0
- package/web/chunk-59678wmg.js +1 -0
- package/web/{chunk-ds7srg4p.js → chunk-5nda24gv.js} +1 -1
- package/web/chunk-5v44qv67.js +303 -0
- package/web/chunk-5wdk97mk.js +4 -0
- package/web/chunk-64rafq66.js +78 -0
- package/web/chunk-6bwgdvf6.js +1 -0
- package/web/chunk-6kkw9ptc.js +1 -0
- package/web/chunk-718mr5gc.js +2 -0
- package/web/chunk-7hs57qdr.js +1 -0
- package/web/chunk-7kp237t3.js +106 -0
- package/web/chunk-86p42kym.js +1 -0
- package/web/chunk-8n79cqyd.js +1 -0
- package/web/chunk-8r0s8tx7.js +1 -0
- package/web/chunk-96v2avmw.js +40 -0
- package/web/chunk-9an6wcnr.js +1 -0
- package/web/{chunk-5z4jcqct.js → chunk-9c1yt2ex.js} +20 -20
- package/web/chunk-9w5tf22s.js +1 -0
- package/web/{chunk-pws2seas.js → chunk-a7gtb4kg.js} +19 -19
- package/web/chunk-ahztazsg.js +1 -0
- package/web/chunk-b985y17w.js +2 -0
- package/web/chunk-bz2v64xe.js +1 -0
- package/web/{chunk-n1dmrz44.js → chunk-c01176kn.js} +2 -2
- package/web/chunk-c3nn0vvc.js +1 -0
- package/web/chunk-cb2rxtq9.js +2 -0
- package/web/{chunk-b1bgzz66.js → chunk-ck8rr0sr.js} +1 -1
- package/web/{chunk-aqfpnhmt.js → chunk-cktmyc13.js} +19 -19
- package/web/{chunk-rvrf0f3h.js → chunk-cm92fyr3.js} +2 -2
- package/web/chunk-cwtn2kdm.js +1 -0
- package/web/chunk-czq1yz51.js +99 -0
- package/web/chunk-d22wq71s.js +1 -0
- package/web/{chunk-pjkdrgm0.js → chunk-d4z2rgpx.js} +1 -1
- package/web/{chunk-hvw3gn2a.js → chunk-d6tbw8br.js} +20 -20
- package/web/{chunk-cg3jterp.js → chunk-d9wdsjkk.js} +2 -2
- package/web/{chunk-ttg6tbwx.js → chunk-da7m1kva.js} +2 -2
- package/web/chunk-dpkyygej.js +1 -0
- package/web/{chunk-0b47eyrf.js → chunk-dwajwrpk.js} +1 -1
- package/web/chunk-et5ess72.js +1 -0
- package/web/chunk-ez8b6neq.js +1 -0
- package/web/{chunk-bhsaj6qq.js → chunk-f5txt81n.js} +1 -1
- package/web/chunk-fd1kqwe3.js +1 -0
- package/web/chunk-fmthkpff.js +1 -0
- package/web/chunk-fp48zz2e.js +2 -0
- package/web/{chunk-n90cqdvg.js → chunk-fv6vm14n.js} +2 -2
- package/web/chunk-fx0n2g22.js +89 -0
- package/web/{chunk-9cx1be43.js → chunk-fxs4nb93.js} +16 -16
- package/web/chunk-g6k9z8zt.js +1 -0
- package/web/{chunk-42e3b9hv.js → chunk-g81h1e6n.js} +19 -19
- package/web/{chunk-pz9ps2jm.js → chunk-gsh80797.js} +12 -12
- package/web/{chunk-54thej0t.js → chunk-gyp6v7jd.js} +2 -2
- package/web/chunk-h0c42zy3.js +1 -0
- package/web/{chunk-6m69hczt.js → chunk-h6k1x096.js} +2 -2
- package/web/chunk-hs5x78fb.js +1 -0
- package/web/{chunk-zx8zec24.js → chunk-ht1dzftc.js} +56 -56
- package/web/{chunk-d11v5s7w.js → chunk-hy4m34qp.js} +6 -6
- package/web/chunk-hyd5hzpa.js +1 -0
- package/web/chunk-hyt1nkaw.js +1 -0
- package/web/{chunk-24mfx6w1.js → chunk-j1bw5v1g.js} +2 -2
- package/web/chunk-j6a4z530.js +1139 -0
- package/web/{chunk-0pbjgdgp.js → chunk-ja7w629n.js} +2 -2
- package/web/{chunk-zbj1trar.js → chunk-jam45rqg.js} +2 -2
- package/web/chunk-jfvxxp5c.js +1 -0
- package/web/{chunk-kmr7r9xj.js → chunk-jve1zc80.js} +2 -2
- package/web/chunk-kegv14sg.js +2 -0
- package/web/chunk-kw9emsqw.js +1 -0
- package/web/{chunk-df5zx17h.js → chunk-kyawkpv2.js} +1 -1
- package/web/chunk-m2prjwk3.js +4 -0
- package/web/chunk-m9bzz9m0.js +19 -0
- package/web/chunk-mqsyzzgt.js +30 -0
- package/web/chunk-mz9b5bsa.js +1 -0
- package/web/chunk-n1jpg57t.js +169 -0
- package/web/{chunk-ybrf9mhz.js → chunk-nyn9tghz.js} +4 -4
- package/web/{chunk-1eg9sbbt.js → chunk-nywdeb4m.js} +2 -2
- package/web/chunk-prvh9syp.js +324 -0
- package/web/chunk-pxkhm40r.js +2 -0
- package/web/{chunk-6cnek1xh.js → chunk-q9ekgjh6.js} +1 -1
- package/web/{chunk-xzp7jf7e.js → chunk-qcge7d6s.js} +2 -2
- package/web/chunk-r3mj50zs.js +1 -0
- package/web/{chunk-wnskxerq.js → chunk-rf9dt6bg.js} +5 -5
- package/web/{chunk-nvhmq4z5.js → chunk-s2920f21.js} +6 -6
- package/web/chunk-sc0ghp25.js +24 -0
- package/web/{chunk-ydtrc1ay.js → chunk-sd3cdqcm.js} +2 -2
- package/web/{chunk-rykfak98.js → chunk-sf101c23.js} +2 -2
- package/web/{chunk-4gavbw65.js → chunk-sy7e4dmq.js} +1 -1
- package/web/chunk-t74r2n8h.js +1 -0
- package/web/{chunk-0h0vb6gt.js → chunk-t851gdjh.js} +4 -4
- package/web/{chunk-a408enpy.js → chunk-t9mvsgt9.js} +1 -1
- package/web/chunk-thbqwq6b.js +1 -0
- package/web/{chunk-v5cnt7c8.js → chunk-twdy2f67.js} +1 -1
- package/web/chunk-v4yqrx5y.js +140 -0
- package/web/{chunk-b53bfkys.js → chunk-vf4vkcf9.js} +1 -1
- package/web/chunk-vnt34mkb.js +1 -0
- package/web/chunk-vtxw9rmr.js +1 -0
- package/web/{chunk-92ssjk2y.js → chunk-vw1pbv1x.js} +40 -40
- package/web/chunk-x19v2sxv.js +1 -0
- package/web/{chunk-3re8y26v.js → chunk-x5s7zr5f.js} +7 -7
- package/web/chunk-xc2sq3t5.js +2 -0
- package/web/chunk-xce8n339.js +1 -0
- package/web/chunk-xtss82z2.js +1 -0
- package/web/chunk-xvcfp1zh.js +2 -0
- package/web/chunk-y21zy3eh.js +1 -0
- package/web/chunk-ya3ghn3n.js +2 -0
- package/web/chunk-yd74yxzt.js +8 -0
- package/web/{chunk-74j07k8k.js → chunk-z1geewdf.js} +2 -2
- package/web/chunk-z4ha8181.js +1 -0
- package/web/chunk-z8rarqe6.js +1 -0
- package/web/{chunk-kwccs9f6.js → chunk-zp3qrrkb.js} +11 -11
- package/web/chunk-zsxw5fj7.js +39 -0
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-06hdzq5n.js +0 -2
- package/chunk-5dfbezv9.js +0 -2
- package/chunk-5x1sankd.js +0 -3753
- package/chunk-71h08f4g.js +0 -2
- package/chunk-7nzhdrv9.js +0 -2
- package/chunk-7q51n619.js +0 -2
- package/chunk-9mmz6wt3.js +0 -2
- package/chunk-fvn32nzj.js +0 -478
- package/chunk-n6e43rvk.js +0 -3
- package/chunk-ry0z4ev6.js +0 -2
- package/chunk-vkpvcxjr.js +0 -2
- package/web/chunk-0rmkpsgp.js +0 -1
- package/web/chunk-0s80zw00.js +0 -1
- package/web/chunk-0xkyryrq.js +0 -1
- package/web/chunk-1gbd61z0.js +0 -2
- package/web/chunk-2s0bmrkv.js +0 -39
- package/web/chunk-2z1rwr28.js +0 -2
- package/web/chunk-344bq59c.js +0 -89
- package/web/chunk-3t0211rw.js +0 -1
- package/web/chunk-44rmrmcn.js +0 -1
- package/web/chunk-4bzqrwr0.js +0 -1139
- package/web/chunk-4d3a7xs2.js +0 -1
- package/web/chunk-4jmazh6x.js +0 -370
- package/web/chunk-4re74xwm.js +0 -140
- package/web/chunk-4rm1vy7w.js +0 -1
- package/web/chunk-59kqahb3.js +0 -1
- package/web/chunk-5qtyq3ce.js +0 -292
- package/web/chunk-5z6x2n5h.js +0 -1
- package/web/chunk-6beqrmtq.js +0 -1
- package/web/chunk-6f5ke0x9.js +0 -1
- package/web/chunk-6xaqxcq8.js +0 -1
- package/web/chunk-7q6wvv2x.js +0 -1
- package/web/chunk-7qsa4p8h.js +0 -1
- package/web/chunk-8nja0ygy.js +0 -1
- package/web/chunk-8y64fkpz.js +0 -24
- package/web/chunk-9ad7v7bm.js +0 -8
- package/web/chunk-9dzxv335.js +0 -4
- package/web/chunk-9t5dnjaz.js +0 -19
- package/web/chunk-a497tykb.js +0 -70
- package/web/chunk-b6k9w215.js +0 -2
- package/web/chunk-cjfssg3m.js +0 -2
- package/web/chunk-cqp1d4p0.js +0 -1
- package/web/chunk-dy2gm1fs.js +0 -1
- package/web/chunk-e0zre35a.js +0 -1
- package/web/chunk-e9twvs9n.js +0 -3
- package/web/chunk-f2kgtyfp.js +0 -1
- package/web/chunk-f8bn5tzf.js +0 -1
- package/web/chunk-f91wzwtk.js +0 -1
- package/web/chunk-fdp9bsj7.js +0 -1
- package/web/chunk-fh2vj0wv.js +0 -2
- package/web/chunk-g1ev11wx.js +0 -1
- package/web/chunk-gmzqdm7v.js +0 -1
- package/web/chunk-hfaffkrh.js +0 -1
- package/web/chunk-j2vt8c8v.js +0 -1
- package/web/chunk-ka3q31t1.js +0 -1
- package/web/chunk-khxcn8tt.js +0 -106
- package/web/chunk-kqqmp1am.js +0 -1
- package/web/chunk-m2d1sp30.js +0 -1
- package/web/chunk-nbgqbxcy.js +0 -1
- package/web/chunk-ncpnpe9w.js +0 -99
- package/web/chunk-ne0v8mfb.js +0 -2
- package/web/chunk-ngx2cp8x.js +0 -2
- package/web/chunk-nxcgf7ec.js +0 -1
- package/web/chunk-p0kvmf28.js +0 -2
- package/web/chunk-p3k7m5nr.js +0 -1
- package/web/chunk-pggaffrh.js +0 -169
- package/web/chunk-pxe3vna4.js +0 -1
- package/web/chunk-qh15dxav.css +0 -1
- package/web/chunk-qpmbxhh6.js +0 -1
- package/web/chunk-r0rctnxz.js +0 -1
- package/web/chunk-rn3dnqm8.js +0 -1
- package/web/chunk-rtf2zzzv.js +0 -1
- package/web/chunk-srrfphes.js +0 -1
- package/web/chunk-tdr6x2xc.js +0 -1
- package/web/chunk-tncvg1nn.js +0 -1
- package/web/chunk-vyp0ns1f.js +0 -2
- package/web/chunk-wvdehm9y.js +0 -303
- package/web/chunk-x7ahcpj7.js +0 -1
- package/web/chunk-y38bf0wm.js +0 -1
- package/web/chunk-y56aaba5.js +0 -2
- package/web/chunk-ye58t45p.js +0 -4
- package/web/chunk-yqbnps3a.js +0 -1
- package/web/chunk-z1h20s8c.js +0 -78
- package/web/chunk-zj4q9jth.js +0 -36
- package/web/chunk-zj5k94dk.js +0 -40
- package/web/chunk-zqch0sc8.js +0 -30
- package/web/install.ps1 +0 -91
- package/web/install.sh +0 -177
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{F,o,g,i,r,y,t,n,_,j,ci,xo,Yi,Pr,nr,_o,Zi,wo,ea,ta,$n,ui,di}from"./chunk-j6a4z530.js";var P={sealed:"已封存",folded:"已折叠",archived:"已移出"},T=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function W(e,d){if(e.startsWith("recent-"))return"json";let c=d.trimStart();if(!c)return"markdown";if(c.startsWith("{")||c.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(c))return"xml";return"markdown"}function B(e){if(!e||e.length>32000)return e;if(!e.trimStart().startsWith("<"))return e;let c=[],m=0,a=(p)=>" ".repeat(p),l=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g,u;while((u=l.exec(e))!==null){let[,p,,,f,s,x,v]=u;if(p)c.push(`${a(m)}${p.trim()}`);else if(f)m=Math.max(0,m-1),c.push(`${a(m)}${f.trim()}`);else if(x)c.push(`${a(m)}${x.trim()}`),m++;else if(s)c.push(`${a(m)}${s.trim()}`);else if(v){let h=v.trim();if(h)for(let w of h.split(/\r?\n/)){let E=w.trim();if(E)c.push(`${a(m)}${E}`)}}}return c.length>0?c.join(`
|
|
2
|
+
`):e}function R(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function k(e){let{style:d}=_();return t("p",{className:d("surface.empty"),children:e.children})}function A(e){let{cn:d}=_();if(!e.items.length)return t(k,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let c=e.items.reduce((m,a)=>m+a.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[t("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:e.items.map((m,a)=>t("span",{className:d(T[a%T.length],"transition-[width] duration-300 ease-out-quint"),title:`${m.label}:${m.tokens.toLocaleString()} token`,style:{width:`${m.tokens/c*100}%`}},m.id))}),t("div",{className:"space-y-1.5",children:e.items.map((m,a)=>t(G,{item:m,total:c,index:a,color:T[a%T.length]??"bg-accent"},m.id))})]})}function G(e){let{cn:d,Chevron:c,CopyButton:m,Code:a,style:l,useTheme:u}=_();u();let[p,f]=r(!1),s=(e.item.tokens/e.total*100).toFixed(1),x=g(()=>p&&e.item.detail?nr(e.item.detail):"",[p,e.item.detail]),v=g(()=>x?W(e.item.id,x):"markdown",[x,e.item.id]),h=g(()=>{if(!x)return"";return v==="xml"?B(x):x},[x,v]);return n("div",{"data-state":p?"open":"closed",className:l("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((w)=>!w),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[t("span",{className:d("size-2 shrink-0 rounded-full",e.color),"aria-hidden":!0}),t("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:e.item.label}),e.item.state&&t("span",{className:l("control.badge","text-[10px]"),children:P[e.item.state]}),t("span",{className:"font-mono tabular-nums text-dim",children:e.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[s,"%"]}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[t("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:t("div",{className:d("h-full",e.color),style:{width:`${s}%`}})}),h?n("div",{className:l("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(m,{text:e.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:t(a,{code:h,lang:v,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]}):t("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var I=40,Q={accent:"bg-accent/15 text-accent",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",neutral:"bg-raised text-dim"};function O(e){let{Button:d,CopyButton:c,style:m,useTheme:a}=_();a();let[l,u]=r(I),p=i(null),f=l<e.entries.length;o(()=>{let x=p.current;if(!x||!f||typeof IntersectionObserver>"u")return;let v=new IntersectionObserver((h)=>{if(h.some((w)=>w.isIntersecting))u((w)=>Math.min(e.entries.length,w+I))},{rootMargin:"480px"});return v.observe(x),()=>v.disconnect()},[f,e.entries.length]);let s=g(()=>e.entries.slice(-l).reverse(),[e.entries,l]);if(!e.entries.length)return t(k,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:m("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",e.entries.length," 条记录"]}),t(c,{text:()=>e.entries.map((x)=>JSON.stringify(x,null,2)).join(`
|
|
3
|
+
|
|
4
|
+
`),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),s.map((x)=>t(Y,{entry:x},x.seq)),f&&n("div",{ref:p,className:m("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",s.length," / ",e.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[t(d,{size:"sm",variant:"ghost",onClick:()=>u((x)=>Math.min(e.entries.length,x+I)),children:"加载更多"}),t(d,{size:"sm",variant:"ghost",onClick:()=>u(e.entries.length),children:"显示全部"})]})]})]})}var Y=F(function(d){let{Chevron:c,CopyButton:m,style:a,useTheme:l}=_();l();let[u,p]=r(!1),f=_o(d.entry),s=g(()=>xo(d.entry.time),[d.entry.time]);return n("div",{"data-state":u?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((x)=>!x),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[n("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:["#",d.entry.seq]}),t("span",{className:a("control.badge","shrink-0 font-medium text-[10px]",Q[f.tone]),children:f.badge}),t("span",{className:"min-w-0 flex-1 truncate text-ink",children:f.title}),f.meta&&t("span",{className:a("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:f.meta}),t("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:s}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&t("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2.5 text-xs text-dim",children:n("div",{className:"space-y-2",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[n("span",{className:"font-mono",children:[d.entry.type," · #",d.entry.seq]}),t(m,{text:()=>JSON.stringify(d.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),t(ee,{entry:d.entry})]})})]})});function ee(e){let{Code:d,style:c,useTheme:m}=_();m();let a=e.entry;if(a.type==="user")return n("div",{className:"space-y-2",children:[a.text&&t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:Pr(a.text)}),a.attachments&&a.attachments.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["附件(",a.attachments.length,")"]}),t("div",{className:"flex flex-wrap gap-1.5",children:a.attachments.map((l,u)=>{let p=l.kind==="image"?Math.floor(l.data.length*0.75):l.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[t("span",{className:c("control.badge","text-[10px] text-faint"),children:l.kind==="image"?"图片":l.kind==="path"?"路径":"文本"}),t("span",{className:"max-w-40 truncate font-medium text-ink",children:l.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[l.mimeType," · ",Yi(p)]})]},`${l.name}-${u}`)})})]}),a.notices&&a.notices.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["通知来源(",a.notices.length,")"]}),a.notices.map((l)=>n("div",{className:c("surface.subtle","flex items-center justify-between px-2.5 py-1.5 font-mono text-[11px]"),children:[n("span",{className:"truncate text-ink",children:[l.sourceKind,"/",l.sourceID]}),t("span",{className:"text-faint",children:l.state})]},l.dedupeKey))]})]});if(a.type==="assistant")return n("div",{className:"space-y-2",children:[n("div",{className:"font-mono text-[11px] text-faint",children:["模型:",a.model]}),a.error&&t("div",{className:"rounded-lg border border-danger/30 bg-danger/8 px-2.5 py-2 text-xs text-danger",children:a.error}),a.parts.map((l,u)=>{if(l.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs italic leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Pr(l.text)})]},`thinking-${u}`);if(l.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Pr(l.text)})]},`text-${u}`);return n("div",{className:c("surface.subtle","p-2.5 space-y-1.5"),children:[n("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[n("span",{className:"font-mono font-medium text-ink",children:["工具调用 · ",l.name]}),t("span",{className:"truncate font-mono text-[10px] text-faint",children:l.id})]}),t("div",{className:"max-h-60 overflow-y-auto text-dim",children:t(d,{code:nr(JSON.stringify(l.input,Zi,2)),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]},l.id||`tool-${u}`)})]});if(a.type==="tool_result")return n("div",{className:"space-y-2",children:[n("div",{className:"flex flex-wrap items-center gap-2 font-mono text-[11px] text-faint",children:[t("span",{className:"text-ink",children:a.name}),t("span",{children:"·"}),t("span",{className:"truncate",children:a.callID}),t("span",{className:c("control.badge","ml-auto font-sans text-[10px]",a.isError?"bg-danger/15 text-danger":"text-dim"),children:a.isError?"执行失败":"执行完成"})]}),a.images&&a.images.length>0&&t("div",{className:"flex flex-wrap gap-1.5",children:a.images.map((l,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",l.mimeType," · ",Yi(Math.floor(l.data.length*0.75))]},`${l.mimeType}-${u}`))}),ci(a.output)?t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words [overflow-wrap:anywhere]",a.isError?"text-danger":"text-dim"),children:Pr(a.output)}):t("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:wo(a)})}function D(e){let{cn:d,style:c,useTheme:m}=_();if(m(),!e.todos.length)return t(k,{children:"暂无待办。"});return t("ul",{className:"space-y-1.5",children:e.todos.map((a)=>n("li",{className:c("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:d("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border transition-colors duration-300",a.status==="completed"&&"border-success bg-success text-panel",a.status==="in_progress"&&"border-accent",a.status==="pending"&&"border-line-strong"),children:[a.status==="completed"&&t(j,{className:"size-2.5 animate-pop",strokeWidth:3.5}),a.status==="in_progress"&&t("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),t("span",{className:d("min-w-0 flex-1 break-words leading-relaxed [overflow-wrap:anywhere]",a.status==="completed"&&"text-faint line-through decoration-faint/60",a.status==="in_progress"&&"font-medium text-ink",a.status==="pending"&&"text-dim"),children:a.content})]},`${a.status}-${a.content}`))})}function L(e){let{cn:d,style:c,useTheme:m}=_();m();let[a,l]=r("all"),u=g(()=>e.tools.filter((s)=>s.deferred).length,[e.tools]),p=e.tools.length-u,f=g(()=>{if(a==="deferred")return e.tools.filter((s)=>s.deferred);if(a==="active")return e.tools.filter((s)=>!s.deferred);return e.tools},[e.tools,a]);if(!e.tools.length)return t(k,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[u>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>l("all"),className:d("rounded-lg px-2 py-1 transition-colors",a==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",e.tools.length,")"]}),n("button",{type:"button",onClick:()=>l("active"),className:d("rounded-lg px-2 py-1 transition-colors",a==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",p,")"]}),n("button",{type:"button",onClick:()=>l("deferred"),className:d("rounded-lg px-2 py-1 transition-colors",a==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",u,")"]})]}),t("div",{className:"space-y-1.5",children:f.map((s)=>t(te,{tool:s},`${s.group}-${s.name}`))})]})}function te(e){let{Chevron:d,CopyButton:c,Code:m,style:a,useTheme:l}=_();l();let[u,p]=r(!1),f=g(()=>u?JSON.stringify(e.tool.schema,null,2):"",[u,e.tool.schema]);return n("div",{"data-state":u?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((s)=>!s),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 truncate font-mono text-ink",children:[t("span",{className:"truncate",children:e.tool.name}),e.tool.group&&t("span",{className:a("control.badge","font-sans text-[10px]"),children:e.tool.group}),e.tool.deferred&&t("span",{className:a("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),t(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[e.tool.deferred&&t("div",{className:a("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),e.tool.description&&t("pre",{className:"mb-2 max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:nr(e.tool.description)}),n("div",{className:a("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(c,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:t(m,{code:nr(f),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]})]})]})}function ae(){try{let e=localStorage.getItem("basalt.contextSidebar.tab");if(e==="tools"||e==="todos"||e==="raw")return e}catch{}return"breakdown"}function se(e){let{style:d,useTheme:c}=_();return c(),n("div",{className:d("surface.panel","bg-panel/70 px-3 py-2"),children:[t("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:e.label}),t("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:e.value})]})}function Oe(e){let{Button:d,StatusChip:c,Segmented:m,cn:a,style:l,useTheme:u}=_();u();let[p,f]=r(ae),[s,x]=r(()=>$n.get(e.session.id)),[v,h]=r(!1),[w,E]=r(0),[H,U]=r(!1);o(()=>{let b=setTimeout(()=>U(!0),140);return()=>clearTimeout(b)},[]),o(()=>{let b=$n.get(e.session.id);if(b)x(b);return ui((C,X)=>{if(C===e.session.id)x(X)})},[e.session.id]),o(()=>{let b=new AbortController;return h(!1),e.connection.request(`/api/sessions/${encodeURIComponent(e.session.id)}/context`,{signal:AbortSignal.any([b.signal,AbortSignal.timeout(15000)])}).then((C)=>{if(!b.signal.aborted)di(e.session.id,C),x(C)},()=>{if(!b.signal.aborted)h(!0)}),()=>b.abort()},[e.connection,e.session.id,e.session.updated,e.entries.length,w]);let N=ea(s?.items??[],s?.usableWindow,s?.calibratedTokens,s?.lastInputTokens,s?.hasPendingOutput),S=ta(N.percent),z=s?.lastCacheHitRate,M=s?.usage?.cacheHitRate,J=z===void 0?"—":`${(z*100).toFixed(1)}%`,q=M===void 0?"—":`${(M*100).toFixed(1)}%`,Z=(b)=>{f(b);try{localStorage.setItem("basalt.contextSidebar.tab",b)}catch{}},K=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",s&&t("span",{className:"text-[10px] text-faint tabular-nums",children:s.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",e.session.todos.length>0&&t("span",{className:"text-[10px] text-faint tabular-nums",children:e.session.todos.length})]})},{value:"raw",label:"原始消息"}],V=n("div",{className:"px-3.5 pt-1 pb-3",children:[n("div",{className:"flex items-start justify-between gap-3",children:[n("div",{children:[t("div",{className:"text-[10.5px] font-medium uppercase tracking-wider text-faint",children:"上下文用量"}),n("div",{className:"mt-0.5 flex items-baseline gap-1.5",children:[t("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:s?N.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",s?.usableWindow.toLocaleString()??"—"]})]})]}),t(c,{tone:S==="overflow"||S==="near_limit"?"danger":S==="sealing"?"warning":"success",children:S==="overflow"?"预计超限":S==="near_limit"?"接近上限":S==="sealing"?"接近封存":"正常"})]}),N.percent!==null&&t("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,N.percent)}),t("div",{"aria-hidden":!0,className:a("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!s&&"animate-pulse"),children:t("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,N.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[t("span",{className:"text-dim",children:N.percent===null?"暂无窗口数据":`${N.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",s?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),s?.usage&&(s.usage.input>0||s.usage.output>0||s.usage.cacheRead>0||s.usage.cacheWrite>0||s.usage.cost>0)&&t("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",s.usage.input.toLocaleString()],["Output",s.usage.output.toLocaleString()],["缓存命中 当前 / 平均",`${J} / ${q}`],["平均 TPS",s.usage.tps!==void 0?`${s.usage.tps.toFixed(1)} tok/s`:"—"]].map(([b,C])=>t(se,{label:b,value:C},b))})]});return n(y,{children:[V,t("div",{className:"px-3 py-2",children:t(m,{value:p,onChange:Z,options:K,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[v&&!s&&n("div",{role:"alert",className:"flex items-center justify-between rounded-xl border border-danger/30 bg-danger/8 px-3 py-2 text-xs text-danger",children:[t("span",{children:"上下文加载失败。"}),t(d,{size:"sm",variant:"ghost",onClick:()=>E((b)=>b+1),children:"重试"})]}),t("div",{children:!H?t(R,{}):n(y,{children:[p==="raw"&&t(O,{entries:e.entries}),p==="todos"&&t(D,{todos:e.session.todos}),p==="breakdown"&&(s?t(A,{items:N.items}):!v?t(R,{}):null),p==="tools"&&(s?t(L,{tools:s.tools??[]}):!v?t(R,{}):null)]})},p)]})]})}export{Oe as ContextSidebar};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{x,o,J,r,t,_}from"./chunk-j6a4z530.js";import{e,a,jr,Re,Ri,Ii,En,xr,Sa,no,ie,Jt,D,Di,sn,ft,Ta,ro,ao,io,Mi,Ni,b,oo,qr,Ce,B,Ea,lo,Vr,La,p,V,et,tt,Dn,dn,Dr,Yr,Qa,fo,ei,qi,U,M,ho,jt,ti,Hi}from"./chunk-5v44qv67.js";import{zr}from"./chunk-cb2rxtq9.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(Qa(i)){if(typeof i.splice!=="function"&&typeof i!=="string"&&!Dr(i)&&!dn(i)&&!Yr(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 Q="comm",le="rule",me="decl";var Fe="@media",Oe="@import";var Be="@supports";var Pe="@namespace",ne="@keyframes";var fe="@layer",Ne="@scope";var Ve=Math.abs,q=String.fromCharCode;function ue(i){return i.trim()}function se(i,n,s){return i.replace(n,s)}function H(i,n){return i.charCodeAt(n)|0}function W(i,n,s){return i.slice(n,s)}function z(i){return i.length}function pe(i){return i.length}function Z(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,f,m){return{value:i,root:n,parent:s,type:d,props:c,children:l,line:ge,column:ee,length:f,return:"",siblings:m}}function He(){return T}function Ue(){if(T=O>0?H(te,--O):0,ee--,T===10)ee=1,ge--;return T}function P(){if(T=O<Ge?H(te,O++):0,ee++,T===10)ee=1,ge++;return T}function j(){return H(te,O)}function de(){return O}function he(i,n){return W(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=z(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=j())if(T<33)P();else break;return re(i)>2||re(T)>3?"":" "}function qe(i,n){while(--n&&P())if(T<48||T>102||T>57&&T<65||T>70&&T<97)break;return he(i,de()+(n<6&&j()==32&&P()==32))}function Me(i){while(P())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:P();break}return O}function Xe(i,n){while(P())if(i+T===57)break;else if(i+T===84&&j()===47)break;return"/*"+he(n,O-1)+"*"+q(i===47?i:P())}function Ke(i){while(!re(j()))P();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,f,m,u){var h=0,y=0,w=f,v=0,C=0,I=0,k=1,E=1,L=1,R=0,S=0,N="",K=c,G=l,F=d,g=N;while(E)switch(I=S,S=P()){case 40:if(I!=108&&H(g,w-1)==58)R++,g+="(";else g+=ye(S);break;case 41:R--,g+=")";break;case 34:case 39:case 91:g+=ye(S);break;case 9:case 10:case 13:case 32:if(R>0){g+=q(S);break}g+=Ye(I);break;case 92:g+=qe(de()-1,7);continue;case 47:switch(j()){case 42:case 47:if(Z(bt(Xe(P(),de()),n,s,u),u),(re(I||1)==5||re(j()||1)==5)&&z(g)&&W(g,-1,void 0)!==" ")g+=" ";break;default:g+="/"}break;case 123*k:m[h++]=z(g)*L;case 125*k:case 59:case 0:if(R>0&&S){g+=q(S);break}switch(S){case 0:case 125:E=0;case 59+y:if(L==-1)g=se(g,/\f/g,"");if(C>0&&(z(g)-w||k===0))Z(C>32?Ze(g+";",d,s,w-1,u):Ze(se(g," ","")+";",d,s,w-2,u),u);break;case 59:g+=";";default:if(Z(F=Qe(g,n,s,h,y,c,m,N,K=[],G=[],w,l),l),S===123)if(y===0)we(g,n,F,F,K,l,w,m,G);else{switch(v){case 99:if(H(g,3)===110)break;case 108:if(H(g,2)===97)break;default:y=0;case 100:case 109:case 115:}if(y)we(i,F,F,d&&Z(Qe(i,F,F,0,0,c,m,N,c,K=[],w,G),G),c,G,w,m,d?K:G);else we(g,F,F,F,[""],G,0,m,G)}}h=y=C=0,k=L=1,N=g="",w=f;break;case 58:w=1+z(g),C=I;default:if(k<1){if(S==123)--k;else if(S==125&&k++==0&&Ue()==125)continue}switch(g+=q(S),S*k){case 38:L=y>0?1:(g+="\f",-1);break;case 44:if(R>0)break;m[h++]=(z(g)-1)*L,L=1;break;case 64:if(j()===45)g+=ye(P());v=j(),y=w=z(N=g+=Ke(de())),S++;break;case 45:if(I===45&&z(g)==2)k=0}}return l}function Qe(i,n,s,d,c,l,f,m,u,h,y,w){var v=c-1,C=c===0?l:[""],I=pe(C);for(var k=0,E=0,L=0;k<d;++k)for(var R=0,S=W(i,v+1,v=Ve(E=f[k])),N=i;R<I;++R)if(N=ue(E>0?C[R]+" "+S:se(S,/&\f/g,C[R])))u[L++]=N;return ve(i,n,s,c===0?le:m,u,h,y,w)}function bt(i,n,s,d){return ve(i,n,s,Q,q(He()),W(i,2,-2),0,d)}function Ze(i,n,s,d,c){return ve(i,n,s,me,W(i,0,d),W(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 fe:if(i.children.length)break;case Oe:case Pe:case me:return i.return=i.return||i.value;case Q:return"";case ne:return i.return=i.value+"{"+xe(i.children,d)+"}";case le:if(!z(i.value=i.props.join(",")))return""}return z(s=xe(i.children,d))?i.return=i.value+"{"+s+"}":""}function rr(i){var n=pe(i);return function(s,d,c,l){var f="";for(var m=0;m<n;m++)f+=i[m](s,d,c,l)||"";return f}}var nr="c4",St=e((i)=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(i),"detector"),Et=e(async()=>{let{diagram:i}=await (x("nyn9tghz"),import("./chunk-nyn9tghz.js"));return{id:nr,diagram:i}},"loader"),Tt={id:nr,detector:St,loader:Et},Ct=Tt,sr="flowchart-v2",kt=e((i)=>/^\s*(graph|flowchart)/.test(i),"detector"),Dt=e(async()=>{let{diagram:i}=await (x("hyt1nkaw"),import("./chunk-hyt1nkaw.js"));return{id:sr,diagram:i}},"loader"),Mt={id:sr,detector:kt,loader:Dt},_t=Mt,dr="agentflow",Lt=e((i)=>/^\s*agentflow-beta\b/.test(i),"detector"),At=e(async()=>{let{diagram:i}=await (x("9c1yt2ex"),import("./chunk-9c1yt2ex.js"));return{id:dr,diagram:i}},"loader"),It={id:dr,detector:Lt,loader:At},Rt=It,cr="swimlane",$t=e((i)=>/^\s*swimlane-beta\b/.test(i),"detector"),zt=e(async()=>{let{diagram:i}=await (x("yd74yxzt"),import("./chunk-yd74yxzt.js"));return{id:cr,diagram:i}},"loader"),Ft={id:cr,detector:$t,loader:zt},Ot=Ft,lr="er",Bt=e((i)=>/^\s*erDiagram/.test(i),"detector"),Pt=e(async()=>{let{diagram:i}=await (x("czq1yz51"),import("./chunk-czq1yz51.js"));return{id:lr,diagram:i}},"loader"),Nt={id:lr,detector:Bt,loader:Pt},Vt=Nt,mr="gitGraph",Gt=e((i)=>/^\s*gitGraph/.test(i),"detector"),Ht=e(async()=>{let{diagram:i}=await (x("7kp237t3"),import("./chunk-7kp237t3.js"));return{id:mr,diagram:i}},"loader"),Ut={id:mr,detector:Gt,loader:Ht},Wt=Ut,fr="gantt",Yt=e((i)=>/^\s*gantt/.test(i),"detector"),qt=e(async()=>{let{diagram:i}=await (x("0gg00f86"),import("./chunk-0gg00f86.js"));return{id:fr,diagram:i}},"loader"),Xt={id:fr,detector:Yt,loader:qt},Kt=Xt,ur="info",Qt=e((i)=>/^\s*info/.test(i),"detector"),Zt=e(async()=>{let{diagram:i}=await (x("fp48zz2e"),import("./chunk-fp48zz2e.js"));return{id:ur,diagram:i}},"loader"),ea={id:ur,detector:Qt,loader:Zt},pr="pie",ra=e((i)=>/^\s*pie/.test(i),"detector"),ta=e(async()=>{let{diagram:i}=await (x("zsxw5fj7"),import("./chunk-zsxw5fj7.js"));return{id:pr,diagram:i}},"loader"),aa={id:pr,detector:ra,loader:ta},gr="quadrantChart",oa=e((i)=>/^\s*quadrantChart/.test(i),"detector"),ia=e(async()=>{let{diagram:i}=await (x("s2920f21"),import("./chunk-s2920f21.js"));return{id:gr,diagram:i}},"loader"),na={id:gr,detector:oa,loader:ia},sa=na,vr="xychart",da=e((i)=>/^\s*xychart(-beta)?/.test(i),"detector"),ca=e(async()=>{let{diagram:i}=await (x("rf9dt6bg"),import("./chunk-rf9dt6bg.js"));return{id:vr,diagram:i}},"loader"),la={id:vr,detector:da,loader:ca},ma=la,hr="requirement",fa=e((i)=>/^\s*requirement(Diagram)?/.test(i),"detector"),ua=e(async()=>{let{diagram:i}=await (x("fxs4nb93"),import("./chunk-fxs4nb93.js"));return{id:hr,diagram:i}},"loader"),pa={id:hr,detector:fa,loader:ua},ga=pa,yr="sequence",va=e((i)=>/^\s*sequenceDiagram/.test(i),"detector"),ha=e(async()=>{let{diagram:i}=await (x("n1jpg57t"),import("./chunk-n1jpg57t.js"));return{id:yr,diagram:i}},"loader"),ya={id:yr,detector:va,loader:ha},wa=ya,wr="classDiagram",xa=e((i)=>/^\s*classDiagram/.test(i),"detector"),ba=e(async()=>{let{diagram:i}=await (x("ht1dzftc"),import("./chunk-ht1dzftc.js"));return{id:wr,diagram:i}},"loader"),Ca={id:wr,detector:xa,loader:ba},ka=Ca,br="stateDiagram",Da=e((i)=>/^\s*stateDiagram/.test(i),"detector"),Ma=e(async()=>{let{diagram:i}=await (x("zp3qrrkb"),import("./chunk-zp3qrrkb.js"));return{id:br,diagram:i}},"loader"),_a={id:br,detector:Da,loader:Ma},Aa=_a,Sr="journey",Ia=e((i)=>/^\s*journey/.test(i),"detector"),Ra=e(async()=>{let{diagram:i}=await (x("hy4m34qp"),import("./chunk-hy4m34qp.js"));return{id:Sr,diagram:i}},"loader"),$a={id:Sr,detector:Ia,loader:Ra},za=$a,be=4,ce=75,Fa=e((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"),Oa=e((i,n,s,d)=>{a.debug(`rendering svg for syntax error
|
|
2
|
+
`);let c=V(n),l=c.append("g"),f=Fa(d?.db.getErrorMessage?.()??""),m=f.length>0?500+f.length*56:512;c.attr("viewBox",`0 0 2412 ${m}`),B(c,100,m,!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}`),f.forEach((u,h)=>{l.append("text").attr("class","error-text").attr("x",1440).attr("y",510+h*56).attr("font-size","42px").style("text-anchor","middle").text(u)})},"draw"),Er={draw:Oa},Ba=Er,_e,Pa={clear(){_e=void 0},setErrorMessage(i){_e=i},getErrorMessage(){return _e}},Na={db:Pa,renderer:Er,parser:{parse:e(()=>{return},"parse")}},Va=Na,Tr="flowchart-elk",Ga=e((i,n={})=>{if(/^\s*flowchart-elk/.test(i))return n.layout="elk",!0;return!1},"detector"),Ha=e(async()=>{let{diagram:i}=await (x("hyt1nkaw"),import("./chunk-hyt1nkaw.js"));return{id:Tr,diagram:i}},"loader"),Ua={id:Tr,detector:Ga,loader:Ha},Wa=Ua,Cr="timeline",ja=e((i)=>/^\s*timeline/.test(i),"detector"),Ya=e(async()=>{let{diagram:i}=await (x("vw1pbv1x"),import("./chunk-vw1pbv1x.js"));return{id:Cr,diagram:i}},"loader"),qa={id:Cr,detector:ja,loader:Ya},Xa=qa,kr="mindmap",Ka=e((i)=>/^\s*mindmap/.test(i),"detector"),Za=e(async()=>{let{diagram:i}=await (x("12xxh71x"),import("./chunk-12xxh71x.js"));return{id:kr,diagram:i}},"loader"),Ja={id:kr,detector:Ka,loader:Za},eo=Ja,Mr="kanban",to=e((i)=>/^\s*kanban/.test(i),"detector"),so=e(async()=>{let{diagram:i}=await (x("g81h1e6n"),import("./chunk-g81h1e6n.js"));return{id:Mr,diagram:i}},"loader"),co={id:Mr,detector:to,loader:so},mo=co,_r="sankey",uo=e((i)=>/^\s*sankey(-beta)?/.test(i),"detector"),po=e(async()=>{let{diagram:i}=await (x("96v2avmw"),import("./chunk-96v2avmw.js"));return{id:_r,diagram:i}},"loader"),go={id:_r,detector:uo,loader:po},vo=go,Lr="packet",yo=e((i)=>/^\s*packet(-beta)?/.test(i),"detector"),wo=e(async()=>{let{diagram:i}=await (x("sc0ghp25"),import("./chunk-sc0ghp25.js"));return{id:Lr,diagram:i}},"loader"),xo={id:Lr,detector:yo,loader:wo},Ar="radar",bo=e((i)=>/^\s*radar-beta/.test(i),"detector"),So=e(async()=>{let{diagram:i}=await (x("gsh80797"),import("./chunk-gsh80797.js"));return{id:Ar,diagram:i}},"loader"),Eo={id:Ar,detector:bo,loader:So},Ir="block",To=e((i)=>/^\s*block(-beta)?/.test(i),"detector"),Co=e(async()=>{let{diagram:i}=await (x("v4yqrx5y"),import("./chunk-v4yqrx5y.js"));return{id:Ir,diagram:i}},"loader"),ko={id:Ir,detector:To,loader:Co},Do=ko,Rr="treeView",Mo=e((i)=>/^\s*treeView-beta/.test(i),"detector"),_o=e(async()=>{let{diagram:i}=await (x("mqsyzzgt"),import("./chunk-mqsyzzgt.js"));return{id:Rr,diagram:i}},"loader"),Lo={id:Rr,detector:Mo,loader:_o},Ao=Lo,$r="architecture",Io=e((i)=>/^\s*architecture/.test(i),"detector"),Ro=e(async()=>{let{diagram:i}=await (x("3nbzj48p"),import("./chunk-3nbzj48p.js"));return{id:$r,diagram:i}},"loader"),$o={id:$r,detector:Io,loader:Ro},zo=$o,Fr="eventmodeling",Fo=e((i)=>/^\s*eventmodeling/.test(i),"detector"),Oo=e(async()=>{let{diagram:i}=await (x("0fgaepwm"),import("./chunk-0fgaepwm.js"));return{id:Fr,diagram:i}},"loader"),Bo={id:Fr,detector:Fo,loader:Oo},Po=Bo,Or="ishikawa",No=e((i)=>/^\s*ishikawa(-beta)?\b/i.test(i),"detector"),Vo=e(async()=>{let{diagram:i}=await (x("3de552rg"),import("./chunk-3de552rg.js"));return{id:Or,diagram:i}},"loader"),Go={id:Or,detector:No,loader:Vo},Br="venn",Ho=e((i)=>/^\s*venn-beta/.test(i),"detector"),Uo=e(async()=>{let{diagram:i}=await (x("03dmzvaq"),import("./chunk-03dmzvaq.js"));return{id:Br,diagram:i}},"loader"),Wo={id:Br,detector:Ho,loader:Uo},jo=Wo,Pr="treemap",Yo=e((i)=>/^\s*treemap/.test(i),"detector"),qo=e(async()=>{let{diagram:i}=await (x("vf4vkcf9"),import("./chunk-vf4vkcf9.js"));return{id:Pr,diagram:i}},"loader"),Xo={id:Pr,detector:Yo,loader:qo},Nr="usecase",Ko=e((i)=>/^\s*usecase-beta(?:\s|$)/.test(i),"detector"),Qo=e(async()=>{let{diagram:i}=await (x("296hgy6k"),import("./chunk-296hgy6k.js"));return{id:Nr,diagram:i}},"loader"),Zo={id:Nr,detector:Ko,loader:Qo},Gr="wardley",Jo=e((i)=>/^\s*wardley-beta/i.test(i),"detector"),ri=e(async()=>{let{diagram:i}=await (x("64rafq66"),import("./chunk-64rafq66.js"));return{id:Gr,diagram:i}},"loader"),ai={id:Gr,detector:Jo,loader:ri},oi=ai,Hr="cynefin",ii=e((i)=>/^\s*cynefin-beta(?:[\s:]|$)/.test(i),"detector"),ni=e(async()=>{let{diagram:i}=await (x("q9ekgjh6"),import("./chunk-q9ekgjh6.js"));return{id:Hr,diagram:i}},"loader"),si={id:Hr,detector:ii,loader:ni},Ur="railroad",di=e((i)=>/^\s*railroad-beta/i.test(i),"detector"),ci=e(async()=>{let{diagram:i}=await (x("9an6wcnr"),import("./chunk-9an6wcnr.js"));return{id:Ur,diagram:i}},"loader"),li={id:Ur,detector:di,loader:ci},Wr="railroadEbnf",mi=e((i)=>/^\s*railroad-ebnf-beta/i.test(i),"detector"),fi=e(async()=>{let{diagram:i}=await (x("t74r2n8h"),import("./chunk-t74r2n8h.js"));return{id:Wr,diagram:i}},"loader"),ui={id:Wr,detector:mi,loader:fi},Xr="railroadAbnf",pi=e((i)=>/^\s*railroad-abnf-beta/i.test(i),"detector"),gi=e(async()=>{let{diagram:i}=await (x("bz2v64xe"),import("./chunk-bz2v64xe.js"));return{id:Xr,diagram:i}},"loader"),vi={id:Xr,detector:pi,loader:gi},Kr="railroadPeg",hi=e((i)=>/^\s*railroad-peg-beta/i.test(i),"detector"),yi=e(async()=>{let{diagram:i}=await (x("g6k9z8zt"),import("./chunk-g6k9z8zt.js"));return{id:Kr,diagram:i}},"loader"),wi={id:Kr,detector:hi,loader:yi},tr=!1,Te=e(()=>{if(tr)return;tr=!0,Vr("error",Va,(i)=>i.toLowerCase().trim()==="error"),Vr("---",{db:{clear:e(()=>{},"clear")},styles:{},renderer:{draw:e(()=>{},"draw")},parser:{parse:e(()=>{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:e(()=>null,"init")},(i)=>i.toLowerCase().trimStart().startsWith("---")),Sa(Wa,eo,zo),Sa(Rt,Ct,mo,ka,Vt,Kt,ea,aa,ga,wa,Ot,_t,Xa,Wt,Aa,za,sa,vo,xo,ma,Do,Po,Ao,Eo,Go,Xo,li,ui,vi,wi,jo,oi,si,Zo)},"addDiagrams"),xi=e(async()=>{a.debug("Loading registered diagrams");let n=(await Promise.allSettled(Object.entries(En).map(async([s,{detector:d,loader:c}])=>{if(!c)return;try{La(s)}catch{try{let{diagram:l,id:f}=await c();Vr(f,l,d)}catch(l){throw a.error(`Failed to load external diagram with key ${s}. Removing from detectors.`),delete En[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"),bi="graphics-document document";function Qr(i,n){if(i.attr("role",bi),n!=="")i.attr("aria-roledescription",n)}e(Qr,"setA11yDiagramInfo");function Zr(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)}}e(Zr,"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{e(this,"Diagram")}static async fromText(n,s={}){let d=typeof n==="string"?{raw:n,cleaned:n}:n,c=b(),l=xr(d.cleaned,c);try{La(l)}catch{let v=no(l);if(!v)throw new Ii(`Diagram ${l} not found.`);let{id:C,diagram:I}=await v();Vr(C,I)}let{db:f,parser:m,renderer:u,init:h}=La(l);if(m.parser)m.parser.yy=f;if(f.clear?.(),h?.(c),s.title)f.setDiagramTitle?.(s.title);let y=d.cleaned;if(f.preserveCommentsWhenParsing&&d.withComments){let v=c.maxTextSize??D.maxTextSize;if(d.withComments.length>v)a.warn(`Comment-preserving source exceeds maxTextSize (${d.withComments.length} > ${v}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`);else y=d.withComments}let w=ho(y)+`
|
|
3
|
+
`;if(d.frontmatterLineOffset)f.setFrontmatterLineOffset?.(d.frontmatterLineOffset);return await m.parse(w),new i(l,w,f,m,u)}async render(n,s){await this.renderer.draw(this.text,n,s,this)}getParser(){return this.parser}getType(){return this.type}},ar=[],Si=e(()=>{ar.forEach((i)=>{i()}),ar=[]},"attachFunctions"),Ei=e((i)=>i.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Jr(i){let n=Ri(i);if(!n)return{text:i,metadata:{}};let s=n.indent,d=s?n.body.split(`
|
|
4
|
+
`).map((f)=>f.startsWith(s)?f.slice(s.length):f).join(`
|
|
5
|
+
`):n.body,c=tt(d,{schema:et})??{};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}}e(Jr,"extractFrontMatter");var Ti=e((i)=>i.replace(/\r\n?/g,`
|
|
6
|
+
`).replace(/<(\w+)([^>]*)>/g,(n,s,d)=>"<"+s+d.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),Ci=e((i)=>{let{text:n,metadata:s}=Jr(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"),ki=e((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:fo(i),directive:n}},"processDirectives");function Ie(i){let n=i,s=Ti(i),d=Ci(s),c=ki(d.text),l=U(d.config,c.directive),f=c.text,m=Ei(f),u=s.length>d.text.length?(s.substring(0,s.length-d.text.length).match(/\n/g)??[]).length:0;return{code:{raw:n,cleaned:m,withComments:f,frontmatterLineOffset:u},title:d.title,config:l}}e(Ie,"preprocessDiagram");function rt(i){let n=new TextEncoder().encode(i),s=Array.from(n,(d)=>String.fromCodePoint(d)).join("");return btoa(s)}e(rt,"toBase64");var _i=50000,Li="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",Ai="sandbox",$i="loose",zi="http://www.w3.org/2000/svg",Fi="http://www.w3.org/1999/xlink",Oi="http://www.w3.org/1999/xhtml",Bi="100%",Pi="100%",Vi="border:0;margin:0;",Gi="margin:0",Ui="allow-top-navigation-by-user-activation allow-popups",Wi='The "iframe" tag is not supported by your browser.',ji=["foreignobject"],Yi=["dominant-baseline"];function $e(i){let n=Ie(i);qr();let s;try{s=xr(n.code.cleaned,b())}catch{s=void 0}return Ta(s),oo(n.config??{}),n}e($e,"processAndSetConfigs");async function at(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{Ta(void 0)}}e(at,"parse");var or=e((i,n,s=[])=>{let d=Di(`{ ${s.join(" !important; ")} !important; }`);return`.${i} ${n} ${d}`},"cssImportantStyles"),Xi=e((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 m=Ce(i)?["> *","span"]:["rect","polygon","ellipse","circle","path"];n.forEach((u)=>{if(!De(u.styles))m.forEach((h)=>{s.insertRule(or(u.id,h,u.styles),s.cssRules.length)});if(!De(u.textStyles))s.insertRule(or(u.id,"tspan",(u?.textStyles||[]).map((h)=>h.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=Ea(c)+`
|
|
7
|
+
`}else d+=`${i.themeCSS}
|
|
8
|
+
`;return d+Ea(s)},"createCssStyles"),Ki=e((i,n)=>xe(Je(`${i}{${n}}`),rr([e(function(d,c,l,f){if(d.type==="rule"&&Array.isArray(d.props)){if(d.parent&&d.parent.type===ne)return;d.props=d.props.map((m)=>{if(m===i&&Array.isArray(d.children)&&d.children.every((h)=>{if(h.type!=="decl")return!1;return new Set(["font-family","font-size","fill"]).has(h.props)}))return m;if(!((m.startsWith(`${i} `)||m.startsWith(`${i}>`))&&!m.startsWith(`${i} ||`)))return`${i} ${m}`;return m})}else if(d.type.startsWith("@")){if(![Fe,Be,fe,Ne,"@container","@starting-style",ne].includes(d.type))a.warn(`Removing unsupported at-rule ${d.type} from CSS`),d.type=Q}},"addNamespace"),er])),"compileCSS"),Qi=e((i,n,s,d)=>{let c=Xi(i,s),l=lo(n,c,{...i.themeVariables,theme:i.theme,look:i.look},d);return Ki(d,l)},"createUserStyles"),Zi=e((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"),Ji=e((i="",n)=>{let s=n?.viewBox?.baseVal?.height?n.viewBox.baseVal.height+"px":Pi,d=rt(`<body style="${Gi}">${i}</body>`);return`<iframe style="width:${Bi};height:${s};${Vi}" src="data:text/html;charset=UTF-8;base64,${d}" sandbox="${Ui}">
|
|
9
|
+
${Wi}
|
|
10
|
+
</iframe>`},"putIntoIFrame"),ir=e((i,n,s,d,c)=>{let l=i.append("div");if(l.attr("id",s),d)l.attr("style",d);let f=l.append("svg").attr("id",n).attr("width","100%").attr("xmlns",zi);if(c)f.attr("xmlns:xlink",c);return f.append("g"),i},"appendDivSvgG");function Ae(i,n){return i.append("iframe").attr("id",n).attr("style","width: 100%; height: 100%;").attr("sandbox","")}e(Ae,"sandboxedIframe");var en=e((i,n,s,d)=>{i.getElementById(n)?.remove(),i.getElementById(s)?.remove(),i.getElementById(d)?.remove()},"removeExistingElements"),rn=e(async function(i,n,s){Te();let d=$e(n),c=d.code;n=c.cleaned;let l=b();if(a.debug(l),n.length>(l?.maxTextSize??_i))n=Li,c={raw:n,cleaned:n};let f=`#${i}`,m="i"+i,u="#"+m,h="d"+i,y="#"+h,w=e(()=>{let oe=p(C?u:y).node();if(oe&&"remove"in oe)oe.remove()},"removeTempElements"),v=p(document.body),C=l.securityLevel===Ai,I=l.securityLevel===$i,k=l.fontFamily;if(s!==void 0){if(s)s.innerHTML="";if(C){let A=Ae(p(s),m);v=p(A.nodes()[0].contentDocument.body),v.node().style.margin="0"}else v=p(s);ir(v,i,h,`font-family: ${k}`,Fi)}else{if(en(document,i,h,m),C){let A=Ae(p(document.body),m);v=p(A.nodes()[0].contentDocument.body),v.node().style.margin="0"}else v=p("body");ir(v,i,h)}let E,L;try{E=await Se.fromText(c,{title:d.title})}catch(A){if(l.suppressErrorRendering)throw w(),A;E=await Se.fromText("error"),L=A,E.db.setErrorMessage?.(qi(A))}let R=v.select(y).node(),S=E.type,N=R.firstChild,K=N.firstChild,G=E.renderer.getClasses?.(n,E),F=Qi(l,S,G,f),g=document.createElement("style");g.innerHTML=F,N.insertBefore(g,K);try{await E.renderer.draw(n,i,"12.2.0",E)}catch(A){if(l.suppressErrorRendering)w();else Ba.draw(n,i,"12.2.0");throw A}let vt=v.select(`${y} svg`),ht=E.db.getAccTitle?.(),yt=E.db.getAccDescription?.();it(S,vt,ht,yt);let wt=e(()=>{v.select(`[id="${i}"]`).selectAll("foreignobject > *").attr("xmlns",Oi);let A=v.select(y).node().innerHTML;if(a.debug("config.arrowMarkerAbsolute",l.arrowMarkerAbsolute),A=Zi(A,C,ft(l.arrowMarkerAbsolute)),C){let oe=v.select(y+" svg").node();A=Ji(A,oe)}else if(!I)A=Re.sanitize(A,{ADD_TAGS:ji,ADD_ATTR:Yi,HTML_INTEGRATION_POINTS:{foreignobject:!0}});return Si(),A},"serializeSvg")();if(L)throw L;return w(),{diagramType:S,svg:wt,bindFunctions:E.db.bindFunctions}},"renderDiagram"),tn=e(async function(i,n,s){try{return await rn(i,n,s)}finally{Ta(void 0)}},"render");function ot(i={}){let n=ie({},i);if(n?.fontFamily&&!n.themeVariables?.fontFamily){if(!n.themeVariables)n.themeVariables={};n.themeVariables.fontFamily=n.fontFamily}ao(n);let s=sn.theme;if(n?.theme&&Object.hasOwn(Jt,n.theme))n.themeVariables=Jt[n.theme].getThemeVariables(n.themeVariables);else if(n){if(n.theme!=null&&n.theme!=="null")n.theme=s;n.themeVariables=Jt[s].getThemeVariables(n.themeVariables)}let d=typeof n==="object"?ro(n):Mi();jr(d.logLevel),Te()}e(ot,"initialize");var an=e((i,n={})=>{let{code:s}=Ie(i);return Se.fromText(s,n)},"getDiagramFromText");function it(i,n,s,d){Qr(n,i),Zr(n,s,d,n.attr("id"))}e(it,"addA11yInfo");var X=Object.freeze({render:tn,parse:at,getDiagramFromText:an,initialize:ot,getConfig:b,setConfig:Ni,getSiteConfig:Mi,updateSiteConfig:io,reset:e(()=>{qr()},"reset"),globalReset:e(()=>{qr(sn)},"globalReset"),defaultConfig:sn});jr(b().logLevel);qr(b());var on=e((i,n,s)=>{if(a.warn(i),ei(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"),nt=e(async function(i={querySelector:".mermaid"}){try{await nn(i)}catch(n){if(ei(n))a.error(n.str);if(Y.parseError)Y.parseError(n);if(!i.suppressErrors)throw a.error("Use the suppressErrors option to suppress these errors"),n}},"run"),nn=e(async function({postRenderCallback:i,querySelector:n,nodes:s}={querySelector:".mermaid"}){let d=X.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),X.updateSiteConfig({startOnLoad:d?.startOnLoad});let l=new M.InitIDGenerator(d.deterministicIds,d.deterministicIDSeed),f,m=[];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 h=`mermaid-${l.next()}`;f=u.innerHTML,f=ti(M.entityDecode(f)).trim().replace(/<br\s*\/?>/gi,"<br/>");let y=M.detectInit(f);if(y)a.debug("Detected early reinit: ",y);try{let{svg:w,bindFunctions:v}=await lt(h,f,u);if(u.innerHTML=w,i)await i(h);if(v)v(u)}catch(w){on(w,m,Y.parseError)}}if(m.length>0)throw m[0]},"runThrowsErrors"),st=e(function(i){X.initialize(i)},"initialize"),cn=e(async function(i,n,s){if(a.warn("mermaid.init is deprecated. Please use run instead."),i)st(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 nt(d)},"init"),ln=e(async(i,{lazyLoad:n=!0}={})=>{if(Te(),Sa(...i),n===!1)await xi()},"registerExternalDiagrams"),dt=e(function(){if(Y.startOnLoad){let{startOnLoad:i}=X.getConfig();if(i)Y.run().catch((n)=>a.error("Mermaid failed to initialize",n))}},"contentLoaded");if(typeof document<"u")window.addEventListener("load",dt,!1);var mn=e(function(i){Y.parseError=i},"setParseErrorHandler"),Ee=[],Le=!1,ct=e(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"),fn=e(async(i,n)=>new Promise((s,d)=>{let c=e(()=>new Promise((l,f)=>{X.parse(i,n).then((m)=>{l(m),s(m)},(m)=>{a.error("Error parsing",m),Y.parseError?.(m),f(m),d(m)})}),"performCall");Ee.push(c),ct().catch(d)}),"parse"),lt=e((i,n,s)=>new Promise((d,c)=>{let l=e(()=>new Promise((f,m)=>{X.render(i,n,s).then((u)=>{f(u),d(u)},(u)=>{a.error("Error parsing",u),Y.parseError?.(u),m(u),c(u)})}),"performCall");Ee.push(l),ct().catch(c)}),"render"),un=e(()=>Object.keys(En).map((i)=>({id:i})),"getRegisteredDiagramsMetadata"),Y={startOnLoad:!0,mermaidAPI:X,parse:fn,render:lt,init:cn,run:nt,registerExternalDiagrams:ln,registerLayoutLoaders:Hi,initialize:st,parseError:void 0,contentLoaded:dt,setParseErrorHandler:mn,detectType:xr,registerIconPacks:Dn,getRegisteredDiagramsMetadata:un},ke=Y;/*! Check if previously processed *//*!
|
|
11
|
+
* Wait for document loaded before starting the execution
|
|
12
|
+
*/function mt(i,n){let s=n?.colors?.hex,d=n?.fonts?.sans||"var(--font-sans)";if(i==="dark")return{darkMode:!0,fontFamily:d,fontSize:"14px",useGradient:!1,dropShadow:"none",background:"transparent",mainBkg:"#1c2a3d",nodeBkg:"#1c2a3d",nodeBorder:"#2f5c94",nodeTextColor:"#eef1f5",primaryColor:"#1c2a3d",primaryBorderColor:"#2f5c94",primaryTextColor:"#eef1f5",secondaryColor:"#21252b",secondaryBorderColor:"#3e4552",secondaryTextColor:"#c2c8d2",tertiaryColor:"#1d2127",tertiaryBorderColor:"#333945",tertiaryTextColor:"#c2c8d2",lineColor:"#6d7887",arrowheadColor:"#8a95a5",defaultLinkColor:"#6d7887",edgeLabelBackground:s?.panel??"#1f2329",labelBoxBkgColor:s?.panel??"#1f2329",labelBoxBorderColor:s?.line??"#333945",labelTextColor:s?.dim??"#c2c8d2",textColor:s?.dim??"#c2c8d2",titleColor:s?.ink??"#eef1f5",clusterBkg:"#1b1e24",clusterBorder:"#353b47",radius:8,strokeWidth:"1.5px"};return{darkMode:!1,fontFamily:d,fontSize:"14px",useGradient:!1,dropShadow:"none",background:"transparent",mainBkg:"#eef4fd",nodeBkg:"#eef4fd",nodeBorder:"#a9c8f1",nodeTextColor:"#181d24",primaryColor:"#eef4fd",primaryBorderColor:"#a9c8f1",primaryTextColor:"#181d24",secondaryColor:"#eef1f4",secondaryBorderColor:"#d0d5dd",secondaryTextColor:"#535e6e",tertiaryColor:"#e8ecf0",tertiaryBorderColor:"#cbd2dc",tertiaryTextColor:"#535e6e",lineColor:"#98a2b0",arrowheadColor:"#6b7787",defaultLinkColor:"#98a2b0",edgeLabelBackground:s?.panel??"#ffffff",labelBoxBkgColor:s?.panel??"#ffffff",labelBoxBorderColor:s?.line??"#e2e6eb",labelTextColor:s?.dim??"#535e6e",textColor:s?.dim??"#535e6e",titleColor:s?.ink??"#181d24",clusterBkg:"#f8fafc",clusterBorder:"#e2e6eb",radius:8,strokeWidth:"1.5px"}}function ut(i){let n=i==="dark"?{fill:"#3a2a17",stroke:"#a86b14"}:{fill:"#fff6e5",stroke:"#f0bf5c"};return`
|
|
13
|
+
.node rect, .node .basic.label-container { rx: 10px; ry: 10px; }
|
|
14
|
+
.node .label, .nodeLabel { font-weight: 500; }
|
|
15
|
+
.node polygon { fill: ${n.fill} !important; stroke: ${n.stroke} !important; }
|
|
16
|
+
.edgeLabel, .edgeLabel p, .edgeLabel rect { border-radius: 999px; font-size: 12px; }
|
|
17
|
+
.edgeLabel p { padding: 1px 6px; }
|
|
18
|
+
.cluster rect { rx: 12px; ry: 12px; stroke-dasharray: 4 3; }
|
|
19
|
+
`}var pn=60,ae=new Map;function pt(i,n,s=""){return`${n}:${s}:${i}`}function gn(i,n){if(ae.size>=pn){let s=ae.keys().next().value;if(s!==void 0)ae.delete(s)}ae.set(i,n)}var gt;function vn(i,n,s){let d=s??i;if(gt===d)return;ke.initialize({startOnLoad:!1,suppressErrorRendering:!0,securityLevel:"strict",theme:"base",themeVariables:mt(i,n),themeCSS:ut(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}}),gt=d}var hn=0;async function yn(i,n,s,d,c){vn(n,d,c);let l=`${s}-${++hn}`;try{let{svg:f}=await ke.render(l,i);return f.replace(/filter="url\(#[^"]+\)"/g,"").replace(/filter:\s*url\(#[^)]+\);?/g,"")}finally{document.getElementById(`d${l}`)?.remove()}}var wn=(i)=>i instanceof Error?i.message:String(i);function xs(i){let n=_(),s=n.useTheme?.(),d=n.useColorScheme?.(),c=s?.resolved??d??"light",l=s?.tokens,f=s?.themeID?`${s.themeID}-${c}`:c,m=`mermaid-${J().replace(/[^\w-]/g,"")}`,u=i.code.trim(),[h,y]=r(()=>ae.get(pt(u,c,f))),[w,v]=r(),[C,I]=r(!h);return o(()=>{let k=pt(u,c,f),E=ae.get(k);if(E){y(E),v(void 0),I(!1);return}let L=!0;I(!0);let R=setTimeout(async()=>{try{if(i.streaming&&!await ke.parse(u,{suppressErrors:!0})){if(L)I(!1);return}let S=await yn(u,c,m,l,f);if(gn(k,S),!L)return;y(S),v(void 0)}catch(S){if(L)v(wn(S))}if(L)I(!1)},i.streaming?200:0);return()=>{L=!1,clearTimeout(R)}},[u,c,f,l,i.streaming,m]),t(zr,{title:"流程图",code:i.code,codeLang:"mermaid",rendered:Boolean(h),pending:C,streaming:i.streaming,error:w,children:t("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:h??""}})})}export{xs as MermaidBlock};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{yn}from"./chunk-nywdeb4m.js";import{G}from"./chunk-ya3ghn3n.js";import{e,a,D,b,O,B,C,S,E,T,A,R,L,V,Dn,nt,U}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";var P=/[─━│┃└┗├┣]/,F=/[└┗├┣]/,ee=/[─━]/,H=/^[\s│┃]+$/,W=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,z=/^\s*%%/,te=" ";function Z(n){return n.some((r)=>P.test(r))}e(Z,"isBoxDrawingFormat");function q(n){for(let r of n){let t=F.exec(r);if(t?.index&&t.index>0)return t.index}return 4}e(q,"inferSegmentWidth");function j(n,r){return n.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{let c=parseInt(i,10),o=r.get(c);return o?`line ${o}`:t})}e(j,"remapErrorLines");function J(n){let r=n.split(`
|
|
2
|
+
`),t=new Map,i=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){i=g;break}if(i===-1)return{text:n,lineMap:t};let c=[];for(let g=i+1;g<r.length;g++){let d=r[g];if(d.trim()===""||z.test(d)||W.test(d))continue;if(H.test(d))continue;c.push(d.replace(/\t/g," "))}if(!Z(c))return{text:n,lineMap:t};let o=q(c),s=[],l=0;for(let g=0;g<=i;g++)s.push(r[g]),l++,t.set(l,g+1);for(let g=i+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){s.push(d),l++,t.set(l,f);continue}if(z.test(d)){s.push(d),l++,t.set(l,f);continue}if(W.test(d)){s.push(d),l++,t.set(l,f);continue}if(H.test(d))continue;let h=d.replace(/\t/g," "),w=F.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/o)+1,m=u+1;while(m<h.length&&ee.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let I=h.slice(m).trimEnd();if(!I)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let Q=te.repeat(x);s.push(Q+I),l++,t.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(P.test(h))s.push(d),l++,t.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else s.push(d),l++,t.set(l,f)}return{text:s.join(`
|
|
3
|
+
`),lineMap:t}}e(J,"preprocessBoxDrawing");var v=new yn(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{v.reset(),C()},"clear"),ne=e(()=>v.records.stack[0],"getRoot"),ie=e(()=>v.records.cnt,"getCount"),oe=D.treeView,se=e(()=>U(oe,b().treeView),"getConfig"),ae=e((n,r,t,i,c,o)=>{while(n<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let s={id:v.records.cnt++,level:n,name:r,nodeType:t,icon:c,cssClass:i,description:o,children:[]};v.records.stack[v.records.stack.length-1].children.push(s),v.records.stack.push(s)},"addNode"),ce={clear:re,addNode:ae,getRoot:ne,getCount:ie,getConfig:se,getAccTitle:E,getAccDescription:A,getDiagramTitle:L,setAccDescription:T,setAccTitle:S,setDiagramTitle:R},k=ce,le=e((n)=>{G(n,k);for(let r of n.nodes){let t=typeof r.indent==="number"?r.indent:0,i=r.name,c=i.endsWith("/");if(c)i=i.slice(0,-1);let o=c?"directory":"file",s=r.classAnnotation||void 0,l=r.iconAnnotation,g=l!==void 0?l||"none":void 0,d=r.descAnnotation||void 0,p=d?O(d,b()):void 0;k.addNode(t,i,o,s,g,p)}},"populate"),de={parse:e(async(n)=>{let{text:r,lineMap:t}=J(n);try{let i=await X("treeView",r);a.debug(i),le(i)}catch(i){if(t.size>0&&i instanceof Error)i.message=j(i.message,t);throw i}},"parse")},y={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(n,r){let t=r?.filenameIcons?.[n];if(t)return t;let i=n.lastIndexOf(".");if(i>0){let c=n.substring(i).toLowerCase(),o=r?.extensionIcons;return o?.[c]??o?.[c.slice(1)]}return}e(K,"detectIcon");function N(n,r){if(n.includes(":"))return n;if(n in y.icons||!r)return`${y.prefix}:${n}`;return`${r}:${n}`}e(N,"qualifyIcon");function M(n,r){if(n.icon==="none")return;if(n.icon)return N(n.icon,r.defaultIconPack);if(!r.showIcons)return;if(n.nodeType==="file"){let t=K(n.name,r);if(t==="none")return;if(t)return N(t,r.defaultIconPack)}return`${y.prefix}:${n.nodeType==="directory"?"folder":"file"}`}e(M,"getNodeIcon");Dn([{name:y.prefix,icons:y}]);var _=14,he=4,pe=16,fe=e(async(n,r)=>{let t=[],i=e((o)=>{let s=M(o,r);if(s)t.push({icon:s,node:o});o.children.forEach(i)},"collect");i(n);let c=await Promise.all(t.map(async({icon:o,node:s})=>({id:s.id,svg:await nt(o,{height:_,width:_})})));return new Map(c.map(({id:o,svg:s})=>[o,s]))},"resolveNodeIcons"),ge=e((n,r,t,i,c,o)=>{let s=i.append("g"),l="treeView-node-label";if(t.nodeType==="directory")l+=" treeView-node-dir";if(t.cssClass)l+=` ${t.cssClass}`;let g=_+he,d=M(t,c),p=d!==void 0;if(d)s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+c.paddingX}, ${r+c.paddingY})`).html(o.get(t.id)??"");let f=s.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,x=n+c.paddingX+(p?g:0);f.attr("x",x),f.attr("y",r+u/2);let m=x+w,I=w+c.paddingX*2+(p?g:0);if(t.BBox={x:n,y:r,width:I,height:u},t.cssClass?.split(/\s+/).includes("highlight"))s.insert("rect",":first-child").attr("x",n).attr("y",r+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:t,nodeGroup:s,labelRightEdge:m,centerY:r+u/2}},"positionLabel"),Y=e((n,r,t,i,c,o)=>n.append("line").attr("x1",r).attr("y1",t).attr("x2",i).attr("y2",c).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),ue=e((n,r,t,i)=>{let c=0,o=0,s=[],l=e((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=ge(u,c,f,p,h,i);s.push(x);let{height:m,width:I}=f.BBox;Y(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),o=Math.max(o,u+I),c+=m},"drawNode"),g=e((p,f=0)=>{l(n,p,t,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;Y(n,h+t.paddingX,w+u,h+t.paddingX,x+m/2+t.lineThickness/2,t.lineThickness)}},"processNode");g(r);let d=s.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...s.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();o=Math.max(o,f+u.width+t.paddingX)}}for(let p of s)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=o-p.node.BBox.x+8;f.attr("width",h),o=Math.max(o,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:o}},"drawTree"),me=e(async(n,r,t,i)=>{a.debug(`Rendering treeView diagram
|
|
4
|
+
`+n);let c=i.db,o=c.getRoot(),s=c.getConfig(),l=V(r),g=l.append("g");g.attr("class","tree-view");let d=await fe(o,s),{totalHeight:p,totalWidth:f}=ue(g,o,s,d);l.attr("viewBox",`-${s.lineThickness/2} 0 ${f} ${p}`),B(l,p,f,s.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=e(({treeView:n})=>{let{labelFontSize:r,labelColor:t,lineColor:i,iconColor:c,descriptionColor:o,highlightBg:s,highlightStroke:l}=U(ve,n);return`
|
|
5
|
+
.treeView-node-label {
|
|
6
|
+
font-size: ${r};
|
|
7
|
+
fill: ${t};
|
|
8
|
+
white-space: pre;
|
|
9
|
+
}
|
|
10
|
+
.treeView-node-dir {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
.treeView-node-line {
|
|
14
|
+
stroke: ${i};
|
|
15
|
+
}
|
|
16
|
+
.treeView-node-icon {
|
|
17
|
+
color: ${c};
|
|
18
|
+
}
|
|
19
|
+
.treeView-node-description {
|
|
20
|
+
font-size: ${r};
|
|
21
|
+
fill: ${o};
|
|
22
|
+
font-style: italic;
|
|
23
|
+
white-space: pre;
|
|
24
|
+
}
|
|
25
|
+
.treeView-highlight-bg {
|
|
26
|
+
fill: ${s};
|
|
27
|
+
stroke: ${l};
|
|
28
|
+
stroke-width: 1;
|
|
29
|
+
}
|
|
30
|
+
`},"styles"),Ce=be,Ee={db:k,renderer:xe,parser:de,styles:Ce};export{Ee as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mi}from"./chunk-fv6vm14n.js";export{mi as default};
|