@bkm016/basalt 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +3 -2
  2. package/{chunk-bng72094.js → chunk-03wzwnn6.js} +1 -1
  3. package/{chunk-9e8vhzy7.js → chunk-0crbhhna.js} +1 -1
  4. package/{chunk-h9zxqeqr.js → chunk-0rasqm8y.js} +2 -2
  5. package/{chunk-0x9netvr.js → chunk-1w4nh5t6.js} +1 -1
  6. package/{chunk-dk6fgprw.js → chunk-2eaehpp6.js} +1 -1
  7. package/{chunk-6sea12mw.js → chunk-30dxcr91.js} +1 -1
  8. package/{chunk-2zbj8ny6.js → chunk-343jsm46.js} +2 -2
  9. package/chunk-38g4jd6v.js +5 -0
  10. package/{chunk-zx75vnw8.js → chunk-39mh7h58.js} +22 -22
  11. package/chunk-44b9yx79.js +2 -0
  12. package/{chunk-r1jn77q6.js → chunk-4f6p4n7k.js} +2 -2
  13. package/{chunk-sgz87ht5.js → chunk-4w8j6n7z.js} +1 -1
  14. package/{chunk-szj85dqe.js → chunk-4yxd2kg1.js} +2 -2
  15. package/{chunk-bp61xdsc.js → chunk-59hg9a84.js} +1 -1
  16. package/{chunk-bq54argx.js → chunk-62ebm0bn.js} +1 -1
  17. package/{chunk-6d9r9p91.js → chunk-6ef085c1.js} +4 -4
  18. package/{chunk-zk91579b.js → chunk-6hx9y86d.js} +2 -2
  19. package/chunk-73t051r6.js +2 -0
  20. package/{chunk-pryvvs96.js → chunk-7mgkpn94.js} +22 -22
  21. package/{chunk-2q56egb8.js → chunk-81x8r8w4.js} +1 -1
  22. package/{chunk-rn3jwyh1.js → chunk-8np9b2y8.js} +2 -2
  23. package/{chunk-1q6e3mj7.js → chunk-9ew8cap5.js} +2 -2
  24. package/chunk-9v3b7jjv.js +2 -0
  25. package/{chunk-tjg0gcks.js → chunk-9vam83py.js} +1 -1
  26. package/{chunk-ct77cdg7.js → chunk-9xjecw6c.js} +1 -1
  27. package/{chunk-8cgz8xv7.js → chunk-b2wpj81x.js} +2 -2
  28. package/{chunk-302n9g7p.js → chunk-bjvv3403.js} +1 -1
  29. package/{chunk-tfhze1vq.js → chunk-c8g9jjqs.js} +2 -2
  30. package/{chunk-0a7ft50x.js → chunk-cs91rmbf.js} +8 -8
  31. package/{chunk-gpnqmtbk.js → chunk-edcf97ka.js} +1 -1
  32. package/{chunk-74wwdx3y.js → chunk-en7z6ne5.js} +2 -2
  33. package/{chunk-f0h2bv11.js → chunk-evnqkyt7.js} +10 -10
  34. package/{chunk-4rnmxtpx.js → chunk-ge38dhv9.js} +2 -2
  35. package/chunk-hggam3je.js +2 -0
  36. package/{chunk-mf04h0yy.js → chunk-k38jaz6c.js} +4 -4
  37. package/{chunk-jjtt9aq8.js → chunk-kcn05erf.js} +3 -3
  38. package/{chunk-y23dpz5e.js → chunk-m5km74eq.js} +2 -2
  39. package/{chunk-095adzn5.js → chunk-mfb3dgs8.js} +2 -2
  40. package/{chunk-0nedq669.js → chunk-mh4bjtfs.js} +3 -3
  41. package/{chunk-yy1f9jxc.js → chunk-nysatg77.js} +429 -312
  42. package/{chunk-bja7p3em.js → chunk-p886jr17.js} +13 -13
  43. package/{chunk-xvm0y99b.js → chunk-pdt65s31.js} +2 -2
  44. package/{chunk-ymg7mtcx.js → chunk-pjgt1bdx.js} +2 -2
  45. package/{chunk-959z9efn.js → chunk-pyj6avd5.js} +2 -2
  46. package/chunk-qd2enpr2.js +3 -0
  47. package/{chunk-tnj2kqb8.js → chunk-qe76naq9.js} +1 -1
  48. package/{chunk-z0c8ek0j.js → chunk-qjnx4fsn.js} +2 -2
  49. package/{chunk-2tf7qfbx.js → chunk-qs161f2q.js} +2 -2
  50. package/{chunk-nbjnwd54.js → chunk-rghqprav.js} +1 -1
  51. package/{chunk-7chv3knf.js → chunk-t33bm5aa.js} +1 -1
  52. package/chunk-vd5332ps.js +2 -0
  53. package/{chunk-22az84sh.js → chunk-w55cnj0f.js} +2 -2
  54. package/{chunk-4k9t9jvx.js → chunk-wnd3y4c0.js} +1 -1
  55. package/{chunk-snz19yc2.js → chunk-xafx1p7z.js} +2 -2
  56. package/{chunk-15ve3nmv.js → chunk-xf7zw32f.js} +12 -12
  57. package/chunk-xk3t5ves.js +482 -0
  58. package/{chunk-kbpbrr11.js → chunk-xq74x4gc.js} +2 -2
  59. package/{chunk-mdkfm1ak.js → chunk-y0274xr2.js} +3 -3
  60. package/{chunk-y4pvhes1.js → chunk-z9p6s986.js} +6 -6
  61. package/{chunk-41das1ty.js → chunk-zcwz44db.js} +1 -1
  62. package/{chunk-77c2cqp2.js → chunk-zhyzhekt.js} +1 -1
  63. package/compiled.js +12 -12
  64. package/package.json +1 -1
  65. package/ui-test-worker.js +51 -51
  66. package/web/chunk-15g9pnzy.js +1 -0
  67. package/web/{chunk-16jc5m0f.js → chunk-17wwzrp4.js} +1 -1
  68. package/web/chunk-19tkjg9w.js +1 -0
  69. package/web/chunk-1y387f45.js +1 -0
  70. package/web/{chunk-mykrm8ba.js → chunk-25sn840r.js} +2 -2
  71. package/web/chunk-26sp6jre.js +1 -0
  72. package/web/{chunk-wpxtkxjt.js → chunk-2c7kxr4v.js} +2 -2
  73. package/web/{chunk-et1rsgmp.js → chunk-2gsf89vs.js} +2 -2
  74. package/web/{chunk-jpem3qvs.js → chunk-2gvz70wr.js} +5 -5
  75. package/web/chunk-2s3my1jn.js +1 -0
  76. package/web/{chunk-yn4t5s9r.js → chunk-32dh0hft.js} +1 -1
  77. package/web/{chunk-5cwxhhae.js → chunk-3haw3wcw.js} +2 -2
  78. package/web/{chunk-t82sngk9.js → chunk-3rxhs9qm.js} +7 -7
  79. package/web/chunk-410qdvmv.js +1 -0
  80. package/web/chunk-4qehf2xx.js +2 -0
  81. package/web/{chunk-b9jry5a3.js → chunk-51b8n5e1.js} +1 -1
  82. package/web/{chunk-xe121vg7.js → chunk-54mgncq3.js} +1 -1
  83. package/web/{chunk-ze6azq7z.js → chunk-59g6rrew.js} +4 -4
  84. package/web/{chunk-h6k1x096.js → chunk-5d9veaef.js} +2 -2
  85. package/web/chunk-6481wt3t.js +1 -0
  86. package/web/chunk-6ehecat3.js +1 -0
  87. package/web/chunk-6m8hq6ph.js +1 -0
  88. package/web/chunk-73941p08.js +1 -0
  89. package/web/{chunk-0jbf73pr.js → chunk-783s8jds.js} +3 -3
  90. package/web/{chunk-qbmtah1x.js → chunk-78m018ya.js} +1 -1
  91. package/web/{chunk-3p9w8sg5.js → chunk-797bh7z6.js} +3 -3
  92. package/web/{chunk-1xm9x7d6.js → chunk-7hpqrfgg.js} +2 -2
  93. package/web/{chunk-zxrbbbtp.js → chunk-7kywe73f.js} +2 -2
  94. package/web/chunk-7qq1ypvj.js +1 -0
  95. package/web/{chunk-awkdw9rw.js → chunk-7wzszsf5.js} +2 -2
  96. package/web/{chunk-c57f714b.js → chunk-7zfqppsx.js} +2 -2
  97. package/web/{chunk-jh33m2mq.js → chunk-8sr9w61v.js} +3 -3
  98. package/web/{chunk-4py9sndw.js → chunk-8ttp8fh3.js} +6 -6
  99. package/web/chunk-8zg89764.js +1 -0
  100. package/web/{chunk-ct7z7bea.js → chunk-988e9wx6.js} +3 -3
  101. package/web/{chunk-vk7ch6fh.js → chunk-9h0f3gar.js} +2 -2
  102. package/web/{chunk-p6e2vr51.js → chunk-9vr6hpmk.js} +6 -6
  103. package/web/chunk-9vrp249f.js +2 -0
  104. package/web/{chunk-eqxy6535.js → chunk-a205cj09.js} +2 -2
  105. package/web/{chunk-980zhtht.js → chunk-ahn2frbt.js} +1 -1
  106. package/web/{chunk-xvm66b7v.js → chunk-aknsydan.js} +4 -4
  107. package/web/chunk-at0xtfhy.js +1 -0
  108. package/web/chunk-bahccwb9.js +1 -0
  109. package/web/{chunk-w4tfad6c.js → chunk-c7fqrs8j.js} +1 -1
  110. package/web/{chunk-zqcg6frm.js → chunk-d3hyf9yd.js} +1 -1
  111. package/web/chunk-dcegr80c.js +1 -0
  112. package/web/{chunk-v4cqc9f9.js → chunk-dwtatme7.js} +1 -1
  113. package/web/{chunk-cr04125j.js → chunk-ex8rmqn1.js} +12 -12
  114. package/web/{chunk-jh3k7xex.js → chunk-faskbfjf.js} +3 -3
  115. package/web/{chunk-zb61mf0a.js → chunk-feanedhx.js} +1 -1
  116. package/web/{chunk-xk1vkcj4.js → chunk-ffywf5w5.js} +4 -4
  117. package/web/chunk-fx3d48e6.js +1 -0
  118. package/web/{chunk-3jjksgze.js → chunk-g3szt4c4.js} +1 -1
  119. package/web/chunk-g7bcntpm.js +1 -0
  120. package/web/chunk-gr1tjqbd.js +1 -0
  121. package/web/{chunk-2sef2wft.js → chunk-hbwxtbq3.js} +2 -2
  122. package/web/{chunk-6e87m0nm.js → chunk-hdtvrh0f.js} +2 -2
  123. package/web/chunk-j031r08w.js +1 -0
  124. package/web/{chunk-5ym5ffd5.js → chunk-j6wcszxq.js} +2 -2
  125. package/web/{chunk-jccz14ye.js → chunk-jdx7qp2w.js} +2 -2
  126. package/web/chunk-jge7nn3s.js +1 -0
  127. package/web/chunk-jy8zat04.js +1 -0
  128. package/web/{chunk-0rhx7qb8.js → chunk-jzge034r.js} +1 -1
  129. package/web/{chunk-qq6m2my8.js → chunk-k4qrqmdk.js} +2 -2
  130. package/web/chunk-k8s7kye3.js +1 -0
  131. package/web/{chunk-ke8dffnk.js → chunk-k9fyqrhp.js} +2 -2
  132. package/web/chunk-k9zn1n6d.js +1 -0
  133. package/web/chunk-kg3tksv7.js +1 -0
  134. package/web/chunk-kk5rw81s.js +2 -0
  135. package/web/{chunk-y9waq403.js → chunk-kpmd893m.js} +2 -2
  136. package/web/chunk-md9j949p.js +1 -0
  137. package/web/{chunk-e57h40qa.js → chunk-mn2wv9ye.js} +2 -2
  138. package/web/{chunk-14vmr99v.js → chunk-mv7jgmnb.js} +3 -3
  139. package/web/{chunk-qq06x2ce.js → chunk-mvm68qtt.js} +2 -2
  140. package/web/chunk-nbcpbqq4.js +1 -0
  141. package/web/{chunk-6rsr2cyw.js → chunk-nfpff7yf.js} +8 -8
  142. package/web/chunk-nk7jkpam.js +1 -0
  143. package/web/chunk-nmvt1rn3.js +1 -0
  144. package/web/{chunk-3ctmehg4.js → chunk-npw1s1h2.js} +1 -1
  145. package/web/chunk-nzzxv84v.js +8 -0
  146. package/web/{chunk-a9er7a7c.js → chunk-p4pqtybm.js} +19 -19
  147. package/web/{chunk-ba9qy65y.js → chunk-p79c7aak.js} +1 -1
  148. package/web/{chunk-frnh4zqf.js → chunk-pafw34vg.js} +2 -2
  149. package/web/{chunk-ct90yf8z.js → chunk-pf65cank.js} +2 -2
  150. package/web/{chunk-g0be12na.js → chunk-ppa21760.js} +1 -1
  151. package/web/{chunk-g7hqafb8.js → chunk-ptpkv0te.js} +1 -1
  152. package/web/{chunk-ddg8rz82.js → chunk-qcdej581.js} +1 -1
  153. package/web/{chunk-xxmaqj1m.js → chunk-qftcdcps.js} +2 -2
  154. package/web/{chunk-eqndhs21.js → chunk-qv1w36ja.js} +2 -2
  155. package/web/{chunk-mnf4ngj9.js → chunk-r8p741qj.js} +2 -2
  156. package/web/chunk-rcexbkjj.js +1 -0
  157. package/web/{chunk-w28dn4dw.js → chunk-rjakb64x.js} +1 -1
  158. package/web/{chunk-k0cg4n2k.js → chunk-s0xy00v5.js} +2 -2
  159. package/web/{chunk-cr05dttm.js → chunk-s2ps0ct5.js} +1 -1
  160. package/web/{chunk-xcyqd7cn.js → chunk-s45g7fp6.js} +1 -1
  161. package/web/{chunk-h1k2kqbs.js → chunk-s70aj1v5.js} +4 -4
  162. package/web/chunk-say8bvkc.js +1 -0
  163. package/web/{chunk-qh62nkem.js → chunk-sd3cdqcm.js} +2 -2
  164. package/web/{chunk-a6g3nqp0.js → chunk-sgkevxdf.js} +2 -2
  165. package/web/chunk-sjffrcq9.js +1 -0
  166. package/web/{chunk-2y1avvqj.js → chunk-snaepr87.js} +3 -3
  167. package/web/{chunk-p7pa02k9.js → chunk-tdzh6nsz.js} +2 -2
  168. package/web/{chunk-ga07tv37.js → chunk-tjd8qp87.js} +1 -1
  169. package/web/chunk-tncc9e57.js +1 -0
  170. package/web/{chunk-ve8gy05p.js → chunk-ty2rmwda.js} +92 -92
  171. package/web/chunk-v22hp18w.js +1 -0
  172. package/web/{chunk-zh7193nq.js → chunk-ve9dz857.js} +2 -2
  173. package/web/{chunk-s935z8er.js → chunk-vg346gxc.js} +2 -2
  174. package/web/{chunk-b4gcpsbg.js → chunk-vpegzgzb.js} +5 -5
  175. package/web/{chunk-pzg25qqe.js → chunk-vvvd3grf.js} +2 -2
  176. package/web/{chunk-ss96cz1f.js → chunk-vwv6pqy7.js} +1 -1
  177. package/web/{chunk-sq75q603.js → chunk-vxm7n7w6.js} +6 -6
  178. package/web/{chunk-qb8mbptk.js → chunk-w5q7978e.js} +1 -1
  179. package/web/{chunk-97t3ngqf.js → chunk-we4mhfmq.js} +7 -7
  180. package/web/{chunk-20jxvmbw.js → chunk-wfgrdabk.js} +1 -1
  181. package/web/{chunk-3wpxymxa.js → chunk-wkhj4hsw.js} +3 -3
  182. package/web/{chunk-q4vy3dkk.js → chunk-wspk8qbg.js} +2 -2
  183. package/web/{chunk-9wz8jne3.js → chunk-xf1hnpme.js} +1 -1
  184. package/web/{chunk-fnvgdvrg.js → chunk-xhqvzmfj.js} +4 -4
  185. package/web/chunk-xq70hgre.js +1 -0
  186. package/web/chunk-xtss82z2.js +1 -0
  187. package/web/{chunk-8j4tzff5.js → chunk-y3tb6410.js} +3 -3
  188. package/web/{chunk-mkxeenph.js → chunk-y6mcxfm0.js} +1 -1
  189. package/web/{chunk-0rvwj2wh.js → chunk-ya696bfe.js} +2 -2
  190. package/web/{chunk-2x7vmhm0.js → chunk-ysw5fs45.js} +3 -3
  191. package/web/{chunk-atppv8fk.js → chunk-zkq1xknc.js} +1 -1
  192. package/web/chunk-zkv025s5.js +1 -0
  193. package/web/{chunk-dmha2y9c.js → chunk-zpzvz973.js} +18 -18
  194. package/web/{chunk-c6m4vfn5.js → chunk-zsat72qd.js} +68 -68
  195. package/web/{chunk-9k7fkx80.js → chunk-zx3h7v72.js} +1 -1
  196. package/web/index.html +1 -1
  197. package/chunk-1dbfmejf.js +0 -2
  198. package/chunk-4w9zqv0k.js +0 -2
  199. package/chunk-6f4ht2hw.js +0 -2
  200. package/chunk-edbq461k.js +0 -5
  201. package/chunk-m71pj3g1.js +0 -2
  202. package/chunk-n22vd4at.js +0 -2
  203. package/chunk-sgrrxsnz.js +0 -482
  204. package/chunk-ydzag81d.js +0 -3
  205. package/web/chunk-12qf1r6m.js +0 -1
  206. package/web/chunk-1m6fx2h7.js +0 -2
  207. package/web/chunk-2n5xbnrt.js +0 -1
  208. package/web/chunk-36s08nye.js +0 -1
  209. package/web/chunk-4swea9sn.js +0 -1
  210. package/web/chunk-4zz5a483.js +0 -1
  211. package/web/chunk-6y55gk1n.js +0 -1
  212. package/web/chunk-7aep7k4v.js +0 -1
  213. package/web/chunk-8tgavnwx.js +0 -1
  214. package/web/chunk-a00vg115.js +0 -1
  215. package/web/chunk-a4gbxnm3.js +0 -1
  216. package/web/chunk-bq6mep6p.js +0 -2
  217. package/web/chunk-bwy3e58v.js +0 -1
  218. package/web/chunk-de29pe57.js +0 -1
  219. package/web/chunk-eeesa5q1.js +0 -1
  220. package/web/chunk-f7jpakwh.js +0 -1
  221. package/web/chunk-fp62avjh.js +0 -1
  222. package/web/chunk-gr163fex.js +0 -1
  223. package/web/chunk-gx340asc.js +0 -1
  224. package/web/chunk-gxtz10wf.js +0 -1
  225. package/web/chunk-k9qnvx86.js +0 -2
  226. package/web/chunk-kcnj0gan.js +0 -1
  227. package/web/chunk-kpp5xqsb.js +0 -1
  228. package/web/chunk-m33yted6.js +0 -1
  229. package/web/chunk-me5jqqn6.js +0 -1
  230. package/web/chunk-mzqqwbmr.js +0 -1
  231. package/web/chunk-mzzaet63.js +0 -1
  232. package/web/chunk-q34as3v6.js +0 -1
  233. package/web/chunk-q6c8p73w.js +0 -1
  234. package/web/chunk-qn93we3a.js +0 -1
  235. package/web/chunk-r1f1egve.js +0 -1
  236. package/web/chunk-tt9410zw.js +0 -8
  237. package/web/chunk-vg1ebkce.js +0 -1
  238. package/web/chunk-vnt34mkb.js +0 -1
  239. package/web/chunk-xh4xn1az.js +0 -1
  240. package/web/chunk-xrk5ewsn.js +0 -1
  241. package/web/chunk-xzwxcxb4.js +0 -1
  242. package/web/chunk-ydhnkws0.js +0 -1
  243. package/web/chunk-ys2tns0p.js +0 -1
@@ -0,0 +1 @@
1
+ import{Si}from"./chunk-hdtvrh0f.js";export{Si as default};
@@ -1,2 +1,2 @@
1
- import{t,zn,p,Hn}from"./chunk-c6m4vfn5.js";import{Ce}from"./chunk-ve8gy05p.js";var o=Ce(Hn(),1);var an=t((s,e)=>{let r=s.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name)r.attr("name",e.name);if(e.rx)r.attr("rx",e.rx);if(e.ry)r.attr("ry",e.ry);if(e.attrs!==void 0)for(let a in e.attrs)r.attr(a,e.attrs[a]);if(e.class)r.attr("class",e.class);return r},"drawRect"),Vr=t((s,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};an(s,r).lower()},"drawBackgroundRect"),lo=t((s,e)=>{let r=e.text.replace(zn," "),a=s.append("text");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class)a.attr("class",e.class);let i=a.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),a},"drawText"),Aa=t((s,e,r,a)=>{let i=s.append("image");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),Ra=t((s,e,r,a)=>{let i=s.append("use");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),tt=t(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),La=t(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ft=t(()=>{let s=p(".mermaidTooltip");if(s.empty())s=p("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
- export{an,Vr,lo,Aa,Ra,tt,La,Ft};
1
+ import{t,jn,p,Zn}from"./chunk-zsat72qd.js";import{Ce}from"./chunk-ty2rmwda.js";var o=Ce(Zn(),1);var on=t((s,e)=>{let r=s.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name)r.attr("name",e.name);if(e.rx)r.attr("rx",e.rx);if(e.ry)r.attr("ry",e.ry);if(e.attrs!==void 0)for(let a in e.attrs)r.attr(a,e.attrs[a]);if(e.class)r.attr("class",e.class);return r},"drawRect"),Gr=t((s,e)=>{let r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};on(s,r).lower()},"drawBackgroundRect"),uo=t((s,e)=>{let r=e.text.replace(jn," "),a=s.append("text");if(a.attr("x",e.x),a.attr("y",e.y),a.attr("class","legend"),a.style("text-anchor",e.anchor),e.class)a.attr("class",e.class);let i=a.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),a},"drawText"),La=t((s,e,r,a)=>{let i=s.append("image");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",n)},"drawImage"),Ia=t((s,e,r,a)=>{let i=s.append("use");i.attr("x",e),i.attr("y",r);let n=o.sanitizeUrl(a);i.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),tt=t(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),Da=t(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),Ft=t(()=>{let s=p(".mermaidTooltip");if(s.empty())s=p("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100");return s},"createTooltip");
2
+ export{on,Gr,uo,La,Ia,tt,Da,Ft};
@@ -0,0 +1 @@
1
+ import{da}from"./chunk-qv1w36ja.js";export{da as default};
@@ -0,0 +1 @@
1
+ import{lr}from"./chunk-p4pqtybm.js";export{lr as createRailroadPegServices};
@@ -0,0 +1,2 @@
1
+ import{e,n,y,ve}from"./chunk-ty2rmwda.js";function Fr(a){let t=a.filter((l)=>l.closedAt===null);if(!t.length)return[];return[{label:"项目",options:t.map((l)=>({value:l.id,label:l.name,description:l.directory}))}]}function zr(a){let{Input:t}=y();return n("div",{className:"relative mb-3 min-w-0",children:[e(ve,{"aria-hidden":!0,className:"pointer-events-none absolute top-3 left-3 size-4 text-faint"}),e(t,{type:"search","aria-label":a.label,placeholder:a.placeholder,value:a.value,onChange:(l)=>a.onChange(l.target.value),className:"h-10 min-w-0 pl-9"})]})}function Ur(){return e("div",{role:"status","aria-label":"正在加载",className:"divide-y divide-line",children:[0,1,2].map((a)=>n("div",{className:"h-16 space-y-2 px-4 py-3",children:[e("div",{className:"h-3 w-24 animate-pulse rounded bg-raised"}),e("div",{className:"h-3 w-2/3 animate-pulse rounded bg-raised"})]},a))})}
2
+ export{Fr,zr,Ur};
@@ -1,9 +1,9 @@
1
- import{t,a,X,u,d,N,x,ho,O,l,ge,ye}from"./chunk-c6m4vfn5.js";import{he}from"./chunk-mkxeenph.js";import{ue}from"./chunk-b9jry5a3.js";var _e=new Uint8Array(16);function ee(){return crypto.getRandomValues(_e)}var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function de(e,i=0){return(S[e[i+0]]+S[e[i+1]]+S[e[i+2]]+S[e[i+3]]+"-"+S[e[i+4]]+S[e[i+5]]+"-"+S[e[i+6]]+S[e[i+7]]+"-"+S[e[i+8]]+S[e[i+9]]+"-"+S[e[i+10]]+S[e[i+11]]+S[e[i+12]]+S[e[i+13]]+S[e[i+14]]+S[e[i+15]]).toLowerCase()}function Se(e,i,p){if(!i&&!e&&crypto.randomUUID)return crypto.randomUUID();return xe(e,i,p)}function xe(e,i,p){e=e||{};let h=e.random??e.rng?.()??ee();if(h.length<16)throw Error("Random bytes length must be >= 16");if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,i){if(p=p||0,p<0||p+16>i.length)throw RangeError(`UUID byte range ${p}:${p+15} is out of buffer bounds`);for(let n=0;n<16;++n)i[p+n]=h[n];return i}return de(h)}var te=Se;var ne=function(){var e=t(function(w,o,r,c){for(r=r||{},c=w.length;c--;r[w[c]]=o);return r},"o"),i=[1,4],p=[1,13],h=[1,12],n=[1,15],f=[1,16],k=[1,20],E=[1,19],L=[6,7,8],U=[1,26],M=[1,24],P=[1,25],m=[6,7,11],V=[1,6,13,15,16,19,22],ie=[1,33],re=[1,34],F=[1,6,7,11,13,15,16,19,22],Y={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(o,r,c,g,b,s,G){var y=s.length-1;switch(b){case 6:case 7:return g;case 8:g.getLogger().trace("Stop NL ");break;case 9:g.getLogger().trace("Stop EOF ");break;case 11:g.getLogger().trace("Stop NL2 ");break;case 12:g.getLogger().trace("Stop EOF2 ");break;case 15:g.getLogger().info("Node: ",s[y].id),g.addNode(s[y-1].length,s[y].id,s[y].descr,s[y].type);break;case 16:g.getLogger().trace("Icon: ",s[y]),g.decorateNode({icon:s[y]});break;case 17:case 21:g.decorateNode({class:s[y]});break;case 18:g.getLogger().trace("SPACELIST");break;case 19:g.getLogger().trace("Node: ",s[y].id),g.addNode(0,s[y].id,s[y].descr,s[y].type);break;case 20:g.decorateNode({icon:s[y]});break;case 25:g.getLogger().trace("node found ..",s[y-2]),this.$={id:s[y-1],descr:s[y-1],type:g.getType(s[y-2],s[y])};break;case 26:this.$={id:s[y],descr:s[y],type:g.nodeType.DEFAULT};break;case 27:g.getLogger().trace("node found ..",s[y-3]),this.$={id:s[y-3],descr:s[y-1],type:g.getType(s[y-2],s[y])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:p,7:[1,10],9:9,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(L,[2,3]),{1:[2,2]},e(L,[2,4]),e(L,[2,5]),{1:[2,6],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:p,9:22,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:U,7:M,10:23,11:P},e(m,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:E}),e(m,[2,18]),e(m,[2,19]),e(m,[2,20]),e(m,[2,21]),e(m,[2,23]),e(m,[2,24]),e(m,[2,26],{19:[1,30]}),{20:[1,31]},{6:U,7:M,10:32,11:P},{1:[2,7],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(V,[2,14],{7:ie,11:re}),e(F,[2,8]),e(F,[2,9]),e(F,[2,10]),e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{20:[1,35]},{21:[1,36]},e(V,[2,13],{7:ie,11:re}),e(F,[2,11]),e(F,[2,12]),{21:[1,37]},e(m,[2,25]),e(m,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(o,r){if(r.recoverable)this.trace(o);else{var c=Error(o);throw c.hash=r,c}},"parseError"),parse:t(function(o){var r=this,c=[0],g=[],b=[null],s=[],G=this.table,y="",H=0,se=0,oe=0,me=2,ae=1,ke=s.slice.call(arguments,1),_=Object.create(this.lexer),R={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))R.yy[q]=this.yy[q];if(_.setInput(o,R.yy),R.yy.lexer=_,R.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var J=_.yylloc;s.push(J);var be=_.options&&_.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Ee(T){c.length=c.length-2*T,b.length=b.length-T,s.length=s.length-T}t(Ee,"popStack");function ce(){var T=g.pop()||_.lex()||ae;if(typeof T!=="number"){if(T instanceof Array)g=T,T=g.pop();T=r.symbols_[T]||T}return T}t(ce,"lex");var D,K,A,v,we,Q,B={},W,I,le,z;while(!0){if(A=c[c.length-1],this.defaultActions[A])v=this.defaultActions[A];else{if(D===null||typeof D>"u")D=ce();v=G[A]&&G[A][D]}if(typeof v>"u"||!v.length||!v[0]){var Z="";z=[];for(W in G[A])if(this.terminals_[W]&&W>me)z.push("'"+this.terminals_[W]+"'");if(_.showPosition)Z="Parse error on line "+(H+1)+`:
1
+ import{t,a,X,u,d,N,x,yo,O,l,ge,ye}from"./chunk-zsat72qd.js";import{he}from"./chunk-y6mcxfm0.js";import{ue}from"./chunk-51b8n5e1.js";var _e=new Uint8Array(16);function ee(){return crypto.getRandomValues(_e)}var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function de(e,i=0){return(S[e[i+0]]+S[e[i+1]]+S[e[i+2]]+S[e[i+3]]+"-"+S[e[i+4]]+S[e[i+5]]+"-"+S[e[i+6]]+S[e[i+7]]+"-"+S[e[i+8]]+S[e[i+9]]+"-"+S[e[i+10]]+S[e[i+11]]+S[e[i+12]]+S[e[i+13]]+S[e[i+14]]+S[e[i+15]]).toLowerCase()}function Se(e,i,p){if(!i&&!e&&crypto.randomUUID)return crypto.randomUUID();return xe(e,i,p)}function xe(e,i,p){e=e||{};let h=e.random??e.rng?.()??ee();if(h.length<16)throw Error("Random bytes length must be >= 16");if(h[6]=h[6]&15|64,h[8]=h[8]&63|128,i){if(p=p||0,p<0||p+16>i.length)throw RangeError(`UUID byte range ${p}:${p+15} is out of buffer bounds`);for(let n=0;n<16;++n)i[p+n]=h[n];return i}return de(h)}var te=Se;var ne=function(){var e=t(function(w,o,r,c){for(r=r||{},c=w.length;c--;r[w[c]]=o);return r},"o"),i=[1,4],p=[1,13],h=[1,12],n=[1,15],f=[1,16],k=[1,20],E=[1,19],L=[6,7,8],U=[1,26],M=[1,24],P=[1,25],m=[6,7,11],V=[1,6,13,15,16,19,22],ie=[1,33],re=[1,34],F=[1,6,7,11,13,15,16,19,22],Y={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:t(function(o,r,c,g,b,s,G){var y=s.length-1;switch(b){case 6:case 7:return g;case 8:g.getLogger().trace("Stop NL ");break;case 9:g.getLogger().trace("Stop EOF ");break;case 11:g.getLogger().trace("Stop NL2 ");break;case 12:g.getLogger().trace("Stop EOF2 ");break;case 15:g.getLogger().info("Node: ",s[y].id),g.addNode(s[y-1].length,s[y].id,s[y].descr,s[y].type);break;case 16:g.getLogger().trace("Icon: ",s[y]),g.decorateNode({icon:s[y]});break;case 17:case 21:g.decorateNode({class:s[y]});break;case 18:g.getLogger().trace("SPACELIST");break;case 19:g.getLogger().trace("Node: ",s[y].id),g.addNode(0,s[y].id,s[y].descr,s[y].type);break;case 20:g.decorateNode({icon:s[y]});break;case 25:g.getLogger().trace("node found ..",s[y-2]),this.$={id:s[y-1],descr:s[y-1],type:g.getType(s[y-2],s[y])};break;case 26:this.$={id:s[y],descr:s[y],type:g.nodeType.DEFAULT};break;case 27:g.getLogger().trace("node found ..",s[y-3]),this.$={id:s[y-3],descr:s[y-1],type:g.getType(s[y-2],s[y])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:i},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:i},{6:p,7:[1,10],9:9,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(L,[2,3]),{1:[2,2]},e(L,[2,4]),e(L,[2,5]),{1:[2,6],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:p,9:22,12:11,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},{6:U,7:M,10:23,11:P},e(m,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:k,22:E}),e(m,[2,18]),e(m,[2,19]),e(m,[2,20]),e(m,[2,21]),e(m,[2,23]),e(m,[2,24]),e(m,[2,26],{19:[1,30]}),{20:[1,31]},{6:U,7:M,10:32,11:P},{1:[2,7],6:p,12:21,13:h,14:14,15:n,16:f,17:17,18:18,19:k,22:E},e(V,[2,14],{7:ie,11:re}),e(F,[2,8]),e(F,[2,9]),e(F,[2,10]),e(m,[2,15]),e(m,[2,16]),e(m,[2,17]),{20:[1,35]},{21:[1,36]},e(V,[2,13],{7:ie,11:re}),e(F,[2,11]),e(F,[2,12]),{21:[1,37]},e(m,[2,25]),e(m,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(o,r){if(r.recoverable)this.trace(o);else{var c=Error(o);throw c.hash=r,c}},"parseError"),parse:t(function(o){var r=this,c=[0],g=[],b=[null],s=[],G=this.table,y="",H=0,se=0,oe=0,me=2,ae=1,ke=s.slice.call(arguments,1),_=Object.create(this.lexer),R={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))R.yy[q]=this.yy[q];if(_.setInput(o,R.yy),R.yy.lexer=_,R.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var J=_.yylloc;s.push(J);var be=_.options&&_.options.ranges;if(typeof R.yy.parseError==="function")this.parseError=R.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function Ee(T){c.length=c.length-2*T,b.length=b.length-T,s.length=s.length-T}t(Ee,"popStack");function ce(){var T=g.pop()||_.lex()||ae;if(typeof T!=="number"){if(T instanceof Array)g=T,T=g.pop();T=r.symbols_[T]||T}return T}t(ce,"lex");var D,K,A,v,we,Q,B={},W,I,le,z;while(!0){if(A=c[c.length-1],this.defaultActions[A])v=this.defaultActions[A];else{if(D===null||typeof D>"u")D=ce();v=G[A]&&G[A][D]}if(typeof v>"u"||!v.length||!v[0]){var Z="";z=[];for(W in G[A])if(this.terminals_[W]&&W>me)z.push("'"+this.terminals_[W]+"'");if(_.showPosition)Z="Parse error on line "+(H+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else Z="Parse error on line "+(H+1)+": Unexpected "+(D==ae?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(Z,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:J,expected:z})}if(v[0]instanceof Array&&v.length>1)throw Error("Parse Error: multiple actions possible at state: "+A+", token: "+D);switch(v[0]){case 1:if(c.push(D),b.push(_.yytext),s.push(_.yylloc),c.push(v[1]),D=null,!K){if(se=_.yyleng,y=_.yytext,H=_.yylineno,J=_.yylloc,oe>0)oe--}else D=K,K=null;break;case 2:if(I=this.productions_[v[1]][1],B.$=b[b.length-I],B._$={first_line:s[s.length-(I||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(I||1)].first_column,last_column:s[s.length-1].last_column},be)B._$.range=[s[s.length-(I||1)].range[0],s[s.length-1].range[1]];if(Q=this.performAction.apply(B,[y,se,H,R.yy,v[1],b,s].concat(ke)),typeof Q<"u")return Q;if(I)c=c.slice(0,-1*I*2),b=b.slice(0,-1*I),s=s.slice(0,-1*I);c.push(this.productions_[v[1]][0]),b.push(B.$),s.push(B._$),le=G[c[c.length-2]][c[c.length-1]],c.push(le);break;case 3:return!0}}return!0},"parse")},fe=function(){var w={EOF:1,parseError:t(function(r,c){if(this.yy.parser)this.yy.parser.parseError(r,c);else throw Error(r)},"parseError"),setInput:t(function(o,r){if(this.yy=r||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var r=o.match(/(?:\r\n?|\n).*/g);if(r)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),o},"input"),unput:t(function(o){var r=o.length,c=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var g=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1)this.yylineno-=c.length-1;var b=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===g.length?this.yylloc.first_column:0)+g[g.length-c.length].length-c[0].length:this.yylloc.first_column-r},this.options.ranges)this.yylloc.range=[b[0],b[0]+this.yyleng-r];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(o){this.unput(this.match.slice(o))},"less"),pastInput:t(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var o=this.match;if(o.length<20)o+=this._input.substr(0,20-o.length);return(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var o=this.pastInput(),r=Array(o.length+1).join("-");return o+this.upcomingInput()+`
5
5
  `+r+"^"},"showPosition"),test_match:t(function(o,r){var c,g,b;if(this.options.backtrack_lexer){if(b={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)b.yylloc.range=this.yylloc.range.slice(0)}if(g=o[0].match(/(?:\r\n?|\n).*/g),g)this.yylineno+=g.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:g?g[g.length-1].length-g[g.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],c=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(c)return c;else if(this._backtrack){for(var s in b)this[s]=b[s];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var o,r,c,g;if(!this._more)this.yytext="",this.match="";var b=this._currentRules();for(var s=0;s<b.length;s++)if(c=this._input.match(this.rules[b[s]]),c&&(!r||c[0].length>r[0].length)){if(r=c,g=s,this.options.backtrack_lexer)if(o=this.test_match(c,b[s]),o!==!1)return o;else if(this._backtrack){r=!1;continue}else return!1;else if(!this.options.flex)break}if(r){if(o=this.test_match(r,b[g]),o!==!1)return o;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var r=this.next();if(r)return r;else return this.lex()},"lex"),begin:t(function(r){this.conditionStack.push(r)},"begin"),popState:t(function(){var r=this.conditionStack.length-1;if(r>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(r){if(r=this.conditionStack.length-1-Math.abs(r||0),r>=0)return this.conditionStack[r];else return"INITIAL"},"topState"),pushState:t(function(r){this.begin(r)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(r,c,g,b){var s=b;switch(g){case 0:return r.getLogger().trace("Found comment",c.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:r.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return r.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:r.getLogger().trace("end icon"),this.popState();break;case 10:return r.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return r.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return r.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return r.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:r.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return r.getLogger().trace("description:",c.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),r.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),r.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),r.getLogger().trace("node end ...",c.yytext),"NODE_DEND";break;case 30:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return r.getLogger().trace("Long description:",c.yytext),20;break;case 36:return r.getLogger().trace("Long description:",c.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();Y.lexer=fe;function j(){this.yy={}}return t(j,"Parser"),j.prototype=Y,Y.Parser=j,new j}();ne.parser=ne;var Ne=ne,pe=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Le=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{t(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<e)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,i,p,h){a.info("addNode",e,i,p,h);let n=!1;if(this.nodes.length===0)this.baseLevel=e,e=0,n=!0;else if(this.baseLevel!==void 0)e=e-this.baseLevel,n=!1;let f=l(),k=f.mindmap?.padding??N.mindmap.padding;switch(h){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:k*=2;break}let E={id:this.count++,nodeId:O(i,f),level:e,descr:O(p,f),type:h,children:[],width:f.mindmap?.maxNodeWidth??N.mindmap.maxNodeWidth,padding:k,isRoot:n},L=this.getParent(e);if(L)L.children.push(E),this.nodes.push(E);else if(n)this.nodes.push(E);else throw Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,i){switch(a.debug("In get type",e,i),e){case"[":return this.nodeType.RECT;case"(":return i===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,i){this.elements[e]=i}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let i=l(),p=this.nodes[this.nodes.length-1];if(e.icon)p.icon=O(e.icon,i);if(e.class)p.class=O(e.class,i)}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,i,p=0,h=!1){if(e.level===0)e.section=void 0;else e.section=h?(p-1)%(pe-1):i;if(e.children)for(let[n,f]of e.children.entries()){let k=e.level===0?n%(pe-1):i;this.assignSections(f,k,p+1,h)}}flattenNodes(e,i){let p=l(),h=["mindmap-node"];if(e.isRoot===!0)h.push("section-root","section--1");else if(e.section!==void 0)h.push(`section-${e.section}`);if(e.class)h.push(e.class);let n=h.join(" "),f=t((E)=>{let U=(p.theme?.toLowerCase()??"").includes("redux");switch(E){case C.CIRCLE:return"mindmapCircle";case C.RECT:return"rect";case C.ROUNDED_RECT:return"rounded";case C.CLOUD:return"cloud";case C.BANG:return"bang";case C.HEXAGON:return"hexagon";case C.DEFAULT:return U?"rounded":"defaultMindmapNode";case C.NO_BORDER:default:return"rect"}},"getShapeFromType"),k={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:f(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:n,cssStyles:[],centerLabel:!0,look:p.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(i.push(k),e.children)for(let E of e.children)this.flattenNodes(E,i)}generateEdges(e,i){if(!e.children)return;let p=l();for(let h of e.children){let n="edge";if(h.section!==void 0)n+=` section-edge-${h.section}`;let f=e.level+1;n+=` edge-depth-${f}`;let k={id:`edge_${e.id}_${h.id}`,start:e.id.toString(),end:h.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:p.look,classes:n,depth:e.level,section:h.section};i.push(k),this.generateEdges(h,i)}}getData(){let e=this.getMindmap(),i=l(),h=ho().layout!==void 0,n=i;if(!h)n.layout="cose-bilkent";if(!e)return{nodes:[],edges:[],config:n};a.debug("getData: mindmapRoot",e,i),this.assignSections(e,void 0,0,i.mindmap?.colorBy==="depth");let f=[],k=[];this.flattenNodes(e,f),this.generateEdges(e,k),a.debug(`getData: processed ${f.length} nodes and ${k.length} edges`);let E=new Map;for(let L of f)E.set(L.id,{shape:L.shape,width:L.width,height:L.height,padding:L.padding});return{nodes:f,edges:k,config:n,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+te()}}getLogger(){return a}},De=t(async(e,i,p,h)=>{a.debug(`Rendering mindmap diagram
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var r=this.next();if(r)return r;else return this.lex()},"lex"),begin:t(function(r){this.conditionStack.push(r)},"begin"),popState:t(function(){var r=this.conditionStack.length-1;if(r>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(r){if(r=this.conditionStack.length-1-Math.abs(r||0),r>=0)return this.conditionStack[r];else return"INITIAL"},"topState"),pushState:t(function(r){this.begin(r)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(r,c,g,b){var s=b;switch(g){case 0:return r.getLogger().trace("Found comment",c.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:r.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return r.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:r.getLogger().trace("end icon"),this.popState();break;case 10:return r.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return r.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return r.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return r.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:r.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return r.getLogger().trace("description:",c.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),r.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),r.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),r.getLogger().trace("node end ...",c.yytext),"NODE_DEND";break;case 30:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),r.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),r.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return r.getLogger().trace("Long description:",c.yytext),20;break;case 36:return r.getLogger().trace("Long description:",c.yytext),20;break}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return w}();Y.lexer=fe;function j(){this.yy={}}return t(j,"Parser"),j.prototype=Y,Y.Parser=j,new j}();ne.parser=ne;var Ne=ne,pe=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Le=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{t(this,"MindmapDB")}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let i=this.nodes.length-1;i>=0;i--)if(this.nodes[i].level<e)return this.nodes[i];return null}getMindmap(){return this.nodes.length>0?this.nodes[0]:null}addNode(e,i,p,h){a.info("addNode",e,i,p,h);let n=!1;if(this.nodes.length===0)this.baseLevel=e,e=0,n=!0;else if(this.baseLevel!==void 0)e=e-this.baseLevel,n=!1;let f=l(),k=f.mindmap?.padding??N.mindmap.padding;switch(h){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:k*=2;break}let E={id:this.count++,nodeId:O(i,f),level:e,descr:O(p,f),type:h,children:[],width:f.mindmap?.maxNodeWidth??N.mindmap.maxNodeWidth,padding:k,isRoot:n},L=this.getParent(e);if(L)L.children.push(E),this.nodes.push(E);else if(n)this.nodes.push(E);else throw Error(`There can be only one root. No parent could be found for ("${E.descr}")`)}getType(e,i){switch(a.debug("In get type",e,i),e){case"[":return this.nodeType.RECT;case"(":return i===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,i){this.elements[e]=i}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let i=l(),p=this.nodes[this.nodes.length-1];if(e.icon)p.icon=O(e.icon,i);if(e.class)p.class=O(e.class,i)}type2Str(e){switch(e){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}assignSections(e,i,p=0,h=!1){if(e.level===0)e.section=void 0;else e.section=h?(p-1)%(pe-1):i;if(e.children)for(let[n,f]of e.children.entries()){let k=e.level===0?n%(pe-1):i;this.assignSections(f,k,p+1,h)}}flattenNodes(e,i){let p=l(),h=["mindmap-node"];if(e.isRoot===!0)h.push("section-root","section--1");else if(e.section!==void 0)h.push(`section-${e.section}`);if(e.class)h.push(e.class);let n=h.join(" "),f=t((E)=>{let U=(p.theme?.toLowerCase()??"").includes("redux");switch(E){case C.CIRCLE:return"mindmapCircle";case C.RECT:return"rect";case C.ROUNDED_RECT:return"rounded";case C.CLOUD:return"cloud";case C.BANG:return"bang";case C.HEXAGON:return"hexagon";case C.DEFAULT:return U?"rounded":"defaultMindmapNode";case C.NO_BORDER:default:return"rect"}},"getShapeFromType"),k={id:e.id.toString(),domId:"node_"+e.id.toString(),label:e.descr,labelType:"markdown",isGroup:!1,shape:f(e.type),width:e.width,height:e.height??0,padding:e.padding,cssClasses:n,cssStyles:[],centerLabel:!0,look:p.look,icon:e.icon,x:e.x,y:e.y,level:e.level,nodeId:e.nodeId,type:e.type,section:e.section};if(i.push(k),e.children)for(let E of e.children)this.flattenNodes(E,i)}generateEdges(e,i){if(!e.children)return;let p=l();for(let h of e.children){let n="edge";if(h.section!==void 0)n+=` section-edge-${h.section}`;let f=e.level+1;n+=` edge-depth-${f}`;let k={id:`edge_${e.id}_${h.id}`,start:e.id.toString(),end:h.id.toString(),type:"normal",curve:"basis",thickness:"normal",look:p.look,classes:n,depth:e.level,section:h.section};i.push(k),this.generateEdges(h,i)}}getData(){let e=this.getMindmap(),i=l(),h=yo().layout!==void 0,n=i;if(!h)n.layout="cose-bilkent";if(!e)return{nodes:[],edges:[],config:n};a.debug("getData: mindmapRoot",e,i),this.assignSections(e,void 0,0,i.mindmap?.colorBy==="depth");let f=[],k=[];this.flattenNodes(e,f),this.generateEdges(e,k),a.debug(`getData: processed ${f.length} nodes and ${k.length} edges`);let E=new Map;for(let L of f)E.set(L.id,{shape:L.shape,width:L.width,height:L.height,padding:L.padding});return{nodes:f,edges:k,config:n,rootNode:e,markers:["point"],direction:"TB",nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(E),type:"mindmap",diagramId:"mindmap-"+te()}}getLogger(){return a}},De=t(async(e,i,p,h)=>{a.debug(`Rendering mindmap diagram
7
7
  `+e);let n=h.db,f=n.getData(),k=he(i,f.config.securityLevel);if(f.type=h.type,f.layoutAlgorithm=ye(f.config.layout,{fallback:"cose-bilkent"}),f.diagramId=i,!n.getMindmap())return;f.nodes.forEach((m)=>{if(m.shape==="rounded")m.radius=15,m.taper=15,m.stroke="none",m.width=0,m.padding=15;else if(m.shape==="circle")m.padding=10;else if(m.shape==="rect")m.width=0,m.padding=10;else if(m.shape==="hexagon")m.width=0,m.height=0}),await ge(f,k);let{themeVariables:L}=x(),{useGradient:U,gradientStart:M,gradientStop:P}=L;if(U&&M&&P){let m=k.attr("id"),V=k.append("defs").append("linearGradient").attr("id",`${m}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");V.append("stop").attr("offset","0%").attr("stop-color",M).attr("stop-opacity",1),V.append("stop").attr("offset","100%").attr("stop-color",P).attr("stop-opacity",1)}ue(k,f.config.mindmap?.padding??N.mindmap.padding,"mindmapDiagram",f.config.mindmap?.useMaxWidth??N.mindmap.useMaxWidth)},"draw"),ve={draw:De},Te=t((e)=>{let{theme:i,look:p}=e,h="";for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(e["lineColor"+n]=e["lineColor"+n]||e["cScaleInv"+n],X(e["lineColor"+n]))e["lineColor"+n]=u(e["lineColor"+n],20);else e["lineColor"+n]=d(e["lineColor"+n],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let f=""+(p==="neo"?Math.max(10-(n-1)*2,2):17-3*n),k=i==="redux"||i==="redux-dark"?e.nodeBorder:e["cScaleLabel"+(i==="neutral"?1:n)];h+=`
8
8
  .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} polygon, .section-${n-1} path {
9
9
  fill: ${e["cScale"+n]};
@@ -0,0 +1 @@
1
+ import{wi}from"./chunk-k4qrqmdk.js";export{wi as default};
@@ -1,9 +1,9 @@
1
- import{t,b,F,C,S,E,T,A,L,R,l,V,We,f}from"./chunk-c6m4vfn5.js";var dt=function(){var e=t(function(H,i,n,s){for(n=n||{},s=H.length;s--;n[H[s]]=i);return n},"o"),y=[1,4],r=[1,14],o=[1,12],h=[1,13],p=[6,7,8],k=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],w=[1,23],I=[1,24],M=[1,6,7,11,13,14],Z={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,c,g,a,P){var v=a.length-1;switch(g){case 6:case 7:return c;case 15:c.addNode(a[v-1].length,a[v].trim());break;case 16:c.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:y},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:y},{6:r,7:[1,10],9:9,12:11,13:o,14:h},e(p,[2,3]),{1:[2,2]},e(p,[2,4]),e(p,[2,5]),{1:[2,6],6:r,12:15,13:o,14:h},{6:r,9:16,12:11,13:o,14:h},{6:k,7:d,10:17,11:x},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:k,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:o,14:h},e(_,[2,14],{7:w,11:I}),e(M,[2,8]),e(M,[2,9]),e(M,[2,10]),e(u,[2,15]),e(_,[2,13],{7:w,11:I}),e(M,[2,11]),e(M,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],c=[],g=[null],a=[],P=this.table,v="",W=0,B=0,O=0,j=2,Y=1,rt=a.slice.call(arguments,1),m=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))N.yy[q]=this.yy[q];if(m.setInput(i,N.yy),N.yy.lexer=m,N.yy.parser=this,typeof m.yylloc>"u")m.yylloc={};var Q=m.yylloc;a.push(Q);var lt=m.options&&m.options.ranges;if(typeof N.yy.parseError==="function")this.parseError=N.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(U){s.length=s.length-2*U,g.length=g.length-U,a.length=a.length-U}t(xt,"popStack");function yt(){var U=c.pop()||m.lex()||Y;if(typeof U!=="number"){if(U instanceof Array)c=U,U=c.pop();U=n.symbols_[U]||U}return U}t(yt,"lex");var z,ot,J,G,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])G=this.defaultActions[J];else{if(z===null||typeof z>"u")z=yt();G=P[J]&&P[J][z]}if(typeof G>"u"||!G.length||!G[0]){var ct="";nt=[];for(st in P[J])if(this.terminals_[st]&&st>j)nt.push("'"+this.terminals_[st]+"'");if(m.showPosition)ct="Parse error on line "+(W+1)+`:
1
+ import{t,b,F,C,S,E,T,A,L,R,l,V,Ge,f}from"./chunk-zsat72qd.js";var dt=function(){var e=t(function(H,i,n,s){for(n=n||{},s=H.length;s--;n[H[s]]=i);return n},"o"),y=[1,4],r=[1,14],o=[1,12],h=[1,13],p=[6,7,8],k=[1,20],d=[1,18],x=[1,19],u=[6,7,11],_=[1,6,13,14],w=[1,23],I=[1,24],M=[1,6,7,11,13,14],Z={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:t(function(i,n,s,c,g,a,P){var v=a.length-1;switch(g){case 6:case 7:return c;case 15:c.addNode(a[v-1].length,a[v].trim());break;case 16:c.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:y},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:y},{6:r,7:[1,10],9:9,12:11,13:o,14:h},e(p,[2,3]),{1:[2,2]},e(p,[2,4]),e(p,[2,5]),{1:[2,6],6:r,12:15,13:o,14:h},{6:r,9:16,12:11,13:o,14:h},{6:k,7:d,10:17,11:x},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:k,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:o,14:h},e(_,[2,14],{7:w,11:I}),e(M,[2,8]),e(M,[2,9]),e(M,[2,10]),e(u,[2,15]),e(_,[2,13],{7:w,11:I}),e(M,[2,11]),e(M,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:t(function(i){var n=this,s=[0],c=[],g=[null],a=[],P=this.table,v="",W=0,B=0,O=0,j=2,Y=1,rt=a.slice.call(arguments,1),m=Object.create(this.lexer),N={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))N.yy[q]=this.yy[q];if(m.setInput(i,N.yy),N.yy.lexer=m,N.yy.parser=this,typeof m.yylloc>"u")m.yylloc={};var Q=m.yylloc;a.push(Q);var lt=m.options&&m.options.ranges;if(typeof N.yy.parseError==="function")this.parseError=N.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(U){s.length=s.length-2*U,g.length=g.length-U,a.length=a.length-U}t(xt,"popStack");function yt(){var U=c.pop()||m.lex()||Y;if(typeof U!=="number"){if(U instanceof Array)c=U,U=c.pop();U=n.symbols_[U]||U}return U}t(yt,"lex");var z,ot,J,G,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])G=this.defaultActions[J];else{if(z===null||typeof z>"u")z=yt();G=P[J]&&P[J][z]}if(typeof G>"u"||!G.length||!G[0]){var ct="";nt=[];for(st in P[J])if(this.terminals_[st]&&st>j)nt.push("'"+this.terminals_[st]+"'");if(m.showPosition)ct="Parse error on line "+(W+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+nt.join(", ")+", got '"+(this.terminals_[z]||z)+"'";else ct="Parse error on line "+(W+1)+": Unexpected "+(z==Y?"end of input":"'"+(this.terminals_[z]||z)+"'");this.parseError(ct,{text:m.match,token:this.terminals_[z]||z,line:m.yylineno,loc:Q,expected:nt})}if(G[0]instanceof Array&&G.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+z);switch(G[0]){case 1:if(s.push(z),g.push(m.yytext),a.push(m.yylloc),s.push(G[1]),z=null,!ot){if(B=m.yyleng,v=m.yytext,W=m.yylineno,Q=m.yylloc,O>0)O--}else z=ot,ot=null;break;case 2:if(K=this.productions_[G[1]][1],tt.$=g[g.length-K],tt._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},lt)tt._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,B,W,N.yy,G[1],g,a].concat(rt)),typeof ht<"u")return ht;if(K)s=s.slice(0,-1*K*2),g=g.slice(0,-1*K),a=a.slice(0,-1*K);s.push(this.productions_[G[1]][0]),g.push(tt.$),a.push(tt._$),ft=P[s[s.length-2]][s[s.length-1]],s.push(ft);break;case 3:return!0}}return!0},"parse")},X=function(){var H={EOF:1,parseError:t(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:t(function(i,n){if(this.yy=n||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:t(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var g=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===c.length?this.yylloc.first_column:0)+c[c.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[g[0],g[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(i){this.unput(this.match.slice(i))},"less"),pastInput:t(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
5
  `+n+"^"},"showPosition"),test_match:t(function(i,n){var s,c,g;if(this.options.backtrack_lexer){if(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges)g.yylloc.range=this.yylloc.range.slice(0)}if(c=i[0].match(/(?:\r\n?|\n).*/g),c)this.yylineno+=c.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:c?c[c.length-1].length-c[c.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],s=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(s)return s;else if(this._backtrack){for(var a in g)this[a]=g[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,n,s,c;if(!this._more)this.yytext="",this.match="";var g=this._currentRules();for(var a=0;a<g.length;a++)if(s=this._input.match(this.rules[g[a]]),s&&(!n||s[0].length>n[0].length)){if(n=s,c=a,this.options.backtrack_lexer)if(i=this.test_match(s,g[a]),i!==!1)return i;else if(this._backtrack){n=!1;continue}else return!1;else if(!this.options.flex)break}if(n){if(i=this.test_match(n,g[c]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(n,s,c,g){var a=g;switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return H}();Z.lexer=X;function D(){this.yy={}}return t(D,"Parser"),D.prototype=Z,Z.Parser=D,new D}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,C()}getRoot(){return this.root}addNode(e,y){let r=b.sanitizeText(y,l());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],L(r);return}this.baseLevel??=e;let o=e-this.baseLevel+1;if(o<=0)o=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=o)this.stack.pop();let h=this.stack[this.stack.length-1].node,p={text:r,children:[]};h.children.push(p),this.stack.push({level:o,node:p})}getAccTitle(){return E()}setAccTitle(e){S(e)}getAccDescription(){return A()}setAccDescription(e){T(e)}getDiagramTitle(){return R()}setDiagramTitle(e){L(e)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=t((e,y,r)=>{let o=e.node().getBBox(),h=o.width+y*2,p=o.height+y*2;F(e,p,h,r),e.attr("viewBox",`${o.x-y} ${o.y-y} ${h} ${p}`)},"applyPaddedViewBox"),Lt=t((e,y,r,o)=>{let p=o.db.getRoot();if(!p)return;let k=l(),{look:d,handDrawnSeed:x,themeVariables:u}=k,_=We(k.fontSize)[0]??Et,w=d==="handDrawn",I=p.children??[],M=k.ishikawa?.diagramPadding??20,Z=k.ishikawa?.useMaxWidth??!1,X=V(y),D=X.append("g").attr("class","ishikawa"),H=w?f.svg(X.node()):void 0,i=H?{roughSvg:H,seed:x??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,n=`ishikawa-arrow-${y}`;if(!w)D.append("defs").append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let s=0,c=et,g=w?void 0:it(D,s,c,s,c,"ishikawa-spine");if(Tt(D,s,c,p.text,_,i),!I.length){if(w)it(D,s,c,s,c,"ishikawa-spine",i);kt(X,M,Z);return}s-=20;let a=I.filter((m,N)=>N%2===0),P=I.filter((m,N)=>N%2===1),v=mt(a),W=mt(P),B=v.total+W.total,O=et,j=et;if(B>0){let m=et*2,N=et*0.3;O=Math.max(N,m*(v.total/B)),j=Math.max(N,m*(W.total/B))}let Y=_*2;if(O=Math.max(O,v.max*Y),j=Math.max(j,W.max*Y),c=Math.max(O,et),g)g.attr("y1",c).attr("y2",c);D.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);let rt=Math.ceil(I.length/2);for(let m=0;m<rt;m++){let N=D.append("g").attr("class","ishikawa-pair");for(let[q,Q,lt]of[[I[m*2],-1,O],[I[m*2+1],1,j]])if(q)Bt(N,q,s,c,Q,lt,_,i);s=N.selectAll("text").nodes().reduce((q,Q)=>Math.min(q,Q.getBBox().x),1/0)}if(w)it(D,s,c,0,c,"ishikawa-spine",i);else{g.attr("x1",s);let m=`url(#${n})`;D.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",m)}kt(X,M,Z)},"draw"),mt=t((e)=>{let y=t((r)=>r.children.reduce((o,h)=>o+1+y(h),0),"countDescendants");return e.reduce((r,o)=>{let h=y(o);return r.total+=h,r.max=Math.max(r.max,h),r},{total:0,max:0})},"sideStats"),Tt=t((e,y,r,o,h,p)=>{let k=Math.max(6,Math.floor(110/(h*0.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${y},${r})`),x=at(d,_t(o,k),0,0,"ishikawa-head-label","start",h),u=x.node().getBBox(),_=Math.max(60,u.width+6),w=Math.max(40,u.height*2+40),I=`M 0 ${-w/2} L 0 ${w/2} Q ${_*2.4} 0 0 ${-w/2} Z`;if(p){let M=p.roughSvg.path(I,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>M,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",I);x.attr("transform",`translate(${(_-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Mt=t((e,y)=>{let r=[],o=[],h=t((p,k,d)=>{let x=y===-1?[...p].reverse():p;for(let u of x){let _=r.length,w=u.children??[];if(r.push({depth:d,text:_t(u.text,15),parentIndex:k,childCount:w.length}),d%2===0){if(o.push(_),w.length)h(w,_,d+1)}else{if(w.length)h(w,_,d+1);o.push(_)}}},"walk");return h(e,-1,2),{entries:r,yOrder:o}},"flattenTree"),Pt=t((e,y,r,o,h,p,k)=>{let d=e.append("g").attr("class","ishikawa-label-group"),u=at(d,y,r,o+11*h,"ishikawa-label cause","middle",p).node().getBBox();if(k){let _=k.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:k.seed,fill:k.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:k.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ut=t((e,y,r,o,h,p)=>{let k=Math.sqrt(o*o+h*h);if(k===0)return;let d=o/k,x=h/k,u=6,_=-x*u,w=d*u,I=y,M=r,Z=`M ${I} ${M} L ${I-d*u*2+_} ${M-x*u*2+w} L ${I-d*u*2-_} ${M-x*u*2-w} Z`,X=p.roughSvg.path(Z,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});e.append(()=>X)},"drawArrowMarker"),Bt=t((e,y,r,o,h,p,k,d)=>{let x=y.children??[],u=p*(x.length?1:0.2),_=-pt*u,w=gt*u*h,I=r+_,M=o+w;if(it(e,r,o,I,M,"ishikawa-branch",d),d)ut(e,r,o,r-I,o-M,d);if(Pt(e,y.text,I,M,h,k,d),!x.length)return;let{entries:Z,yOrder:X}=Mt(x,h),D=Z.length,H=Array(D);for(let[g,a]of X.entries())H[a]=o+w*((g+1)/(D+1));let i=new Map;i.set(-1,{x0:r,y0:o,x1:I,y1:M,childCount:x.length,childrenDrawn:0});let n=-pt,s=gt*h,c=h<0?"ishikawa-label up":"ishikawa-label down";for(let[g,a]of Z.entries()){let P=H[g],v=i.get(a.parentIndex),W=e.append("g").attr("class","ishikawa-sub-group"),B=0,O=0,j=0;if(a.depth%2===0){let Y=v.y1-v.y0;if(B=wt(v.x0,v.x1,Y?(P-v.y0)/Y:0.5),O=P,j=B-(a.childCount>0?At+a.childCount*It:$t),it(W,B,P,j,P,"ishikawa-sub-branch",d),d)ut(W,B,P,1,0,d);at(W,a.text,j,P,"ishikawa-label align","end",k)}else{let Y=v.childrenDrawn++;if(B=wt(v.x0,v.x1,(v.childCount-Y)/(v.childCount+1)),O=v.y0,j=B+n*((P-O)/s),it(W,B,O,j,P,"ishikawa-sub-branch",d),d)ut(W,B,O,B-j,O-P,d);at(W,a.text,j,P,c,"end",k)}if(a.childCount>0)i.set(g,{x0:B,y0:O,x1:j,y1:P,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),Nt=t((e)=>e.split(/<br\s*\/?>|\n/),"splitLines"),_t=t((e,y)=>{if(e.length<=y)return e;let r=[];for(let o of e.split(/\s+/)){let h=r.length-1;if(h>=0&&r[h].length+1+o.length<=y)r[h]+=" "+o;else r.push(o)}return r.join(`
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:t(function(n){this.conditionStack.push(n)},"begin"),popState:t(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:t(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:t(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:t(function(n){this.begin(n)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(n,s,c,g){var a=g;switch(c){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return H}();Z.lexer=X;function D(){this.yy={}}return t(D,"Parser"),D.prototype=Z,Z.Parser=D,new D}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,C()}getRoot(){return this.root}addNode(e,y){let r=b.sanitizeText(y,l());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],L(r);return}this.baseLevel??=e;let o=e-this.baseLevel+1;if(o<=0)o=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=o)this.stack.pop();let h=this.stack[this.stack.length-1].node,p={text:r,children:[]};h.children.push(p),this.stack.push({level:o,node:p})}getAccTitle(){return E()}setAccTitle(e){S(e)}getAccDescription(){return A()}setAccDescription(e){T(e)}getDiagramTitle(){return R()}setDiagramTitle(e){L(e)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=t((e,y,r)=>{let o=e.node().getBBox(),h=o.width+y*2,p=o.height+y*2;F(e,p,h,r),e.attr("viewBox",`${o.x-y} ${o.y-y} ${h} ${p}`)},"applyPaddedViewBox"),Lt=t((e,y,r,o)=>{let p=o.db.getRoot();if(!p)return;let k=l(),{look:d,handDrawnSeed:x,themeVariables:u}=k,_=Ge(k.fontSize)[0]??Et,w=d==="handDrawn",I=p.children??[],M=k.ishikawa?.diagramPadding??20,Z=k.ishikawa?.useMaxWidth??!1,X=V(y),D=X.append("g").attr("class","ishikawa"),H=w?f.svg(X.node()):void 0,i=H?{roughSvg:H,seed:x??0,lineColor:u?.lineColor??"#333",fillColor:u?.mainBkg??"#fff"}:void 0,n=`ishikawa-arrow-${y}`;if(!w)D.append("defs").append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let s=0,c=et,g=w?void 0:it(D,s,c,s,c,"ishikawa-spine");if(Tt(D,s,c,p.text,_,i),!I.length){if(w)it(D,s,c,s,c,"ishikawa-spine",i);kt(X,M,Z);return}s-=20;let a=I.filter((m,N)=>N%2===0),P=I.filter((m,N)=>N%2===1),v=mt(a),W=mt(P),B=v.total+W.total,O=et,j=et;if(B>0){let m=et*2,N=et*0.3;O=Math.max(N,m*(v.total/B)),j=Math.max(N,m*(W.total/B))}let Y=_*2;if(O=Math.max(O,v.max*Y),j=Math.max(j,W.max*Y),c=Math.max(O,et),g)g.attr("y1",c).attr("y2",c);D.select(".ishikawa-head-group").attr("transform",`translate(0,${c})`);let rt=Math.ceil(I.length/2);for(let m=0;m<rt;m++){let N=D.append("g").attr("class","ishikawa-pair");for(let[q,Q,lt]of[[I[m*2],-1,O],[I[m*2+1],1,j]])if(q)Bt(N,q,s,c,Q,lt,_,i);s=N.selectAll("text").nodes().reduce((q,Q)=>Math.min(q,Q.getBBox().x),1/0)}if(w)it(D,s,c,0,c,"ishikawa-spine",i);else{g.attr("x1",s);let m=`url(#${n})`;D.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",m)}kt(X,M,Z)},"draw"),mt=t((e)=>{let y=t((r)=>r.children.reduce((o,h)=>o+1+y(h),0),"countDescendants");return e.reduce((r,o)=>{let h=y(o);return r.total+=h,r.max=Math.max(r.max,h),r},{total:0,max:0})},"sideStats"),Tt=t((e,y,r,o,h,p)=>{let k=Math.max(6,Math.floor(110/(h*0.6))),d=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${y},${r})`),x=at(d,_t(o,k),0,0,"ishikawa-head-label","start",h),u=x.node().getBBox(),_=Math.max(60,u.width+6),w=Math.max(40,u.height*2+40),I=`M 0 ${-w/2} L 0 ${w/2} Q ${_*2.4} 0 0 ${-w/2} Z`;if(p){let M=p.roughSvg.path(I,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>M,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",I);x.attr("transform",`translate(${(_-u.width)/2-u.x+3},${-u.y-u.height/2})`)},"drawHead"),Mt=t((e,y)=>{let r=[],o=[],h=t((p,k,d)=>{let x=y===-1?[...p].reverse():p;for(let u of x){let _=r.length,w=u.children??[];if(r.push({depth:d,text:_t(u.text,15),parentIndex:k,childCount:w.length}),d%2===0){if(o.push(_),w.length)h(w,_,d+1)}else{if(w.length)h(w,_,d+1);o.push(_)}}},"walk");return h(e,-1,2),{entries:r,yOrder:o}},"flattenTree"),Pt=t((e,y,r,o,h,p,k)=>{let d=e.append("g").attr("class","ishikawa-label-group"),u=at(d,y,r,o+11*h,"ishikawa-label cause","middle",p).node().getBBox();if(k){let _=k.roughSvg.rectangle(u.x-20,u.y-2,u.width+40,u.height+4,{roughness:1.5,seed:k.seed,fill:k.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:k.lineColor,strokeWidth:2});d.insert(()=>_,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",u.x-20).attr("y",u.y-2).attr("width",u.width+40).attr("height",u.height+4)},"drawCauseLabel"),ut=t((e,y,r,o,h,p)=>{let k=Math.sqrt(o*o+h*h);if(k===0)return;let d=o/k,x=h/k,u=6,_=-x*u,w=d*u,I=y,M=r,Z=`M ${I} ${M} L ${I-d*u*2+_} ${M-x*u*2+w} L ${I-d*u*2-_} ${M-x*u*2-w} Z`,X=p.roughSvg.path(Z,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});e.append(()=>X)},"drawArrowMarker"),Bt=t((e,y,r,o,h,p,k,d)=>{let x=y.children??[],u=p*(x.length?1:0.2),_=-pt*u,w=gt*u*h,I=r+_,M=o+w;if(it(e,r,o,I,M,"ishikawa-branch",d),d)ut(e,r,o,r-I,o-M,d);if(Pt(e,y.text,I,M,h,k,d),!x.length)return;let{entries:Z,yOrder:X}=Mt(x,h),D=Z.length,H=Array(D);for(let[g,a]of X.entries())H[a]=o+w*((g+1)/(D+1));let i=new Map;i.set(-1,{x0:r,y0:o,x1:I,y1:M,childCount:x.length,childrenDrawn:0});let n=-pt,s=gt*h,c=h<0?"ishikawa-label up":"ishikawa-label down";for(let[g,a]of Z.entries()){let P=H[g],v=i.get(a.parentIndex),W=e.append("g").attr("class","ishikawa-sub-group"),B=0,O=0,j=0;if(a.depth%2===0){let Y=v.y1-v.y0;if(B=wt(v.x0,v.x1,Y?(P-v.y0)/Y:0.5),O=P,j=B-(a.childCount>0?At+a.childCount*It:$t),it(W,B,P,j,P,"ishikawa-sub-branch",d),d)ut(W,B,P,1,0,d);at(W,a.text,j,P,"ishikawa-label align","end",k)}else{let Y=v.childrenDrawn++;if(B=wt(v.x0,v.x1,(v.childCount-Y)/(v.childCount+1)),O=v.y0,j=B+n*((P-O)/s),it(W,B,O,j,P,"ishikawa-sub-branch",d),d)ut(W,B,O,B-j,O-P,d);at(W,a.text,j,P,c,"end",k)}if(a.childCount>0)i.set(g,{x0:B,y0:O,x1:j,y1:P,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),Nt=t((e)=>e.split(/<br\s*\/?>|\n/),"splitLines"),_t=t((e,y)=>{if(e.length<=y)return e;let r=[];for(let o of e.split(/\s+/)){let h=r.length-1;if(h>=0&&r[h].length+1+o.length<=y)r[h]+=" "+o;else r.push(o)}return r.join(`
7
7
  `)},"wrapText"),at=t((e,y,r,o,h,p,k)=>{let d=Nt(y),x=k*1.05,u=e.append("text").attr("class",h).attr("text-anchor",p).attr("x",r).attr("y",o-(d.length-1)*x/2);for(let[_,w]of d.entries())u.append("tspan").attr("x",r).attr("dy",_===0?0:x).text(w);return u},"drawMultilineText"),wt=t((e,y,r)=>e+(y-e)*r,"lerp"),it=t((e,y,r,o,h,p,k)=>{if(k){let d=k.roughSvg.line(y,r,o,h,{roughness:1.5,seed:k.seed,stroke:k.lineColor,strokeWidth:2});e.append(()=>d).attr("class",p);return}return e.append("line").attr("class",p).attr("x1",y).attr("y1",r).attr("x2",o).attr("y2",h)},"drawLine"),Dt={draw:Lt},Ot=t((e)=>`
8
8
  .ishikawa .ishikawa-spine,
9
9
  .ishikawa .ishikawa-branch,
@@ -1,4 +1,4 @@
1
- import{B,o,v,i,r,m,e,n,y,q,gi,Ao,to,Or,nr,Ro,no,Lo,sa,la,$n,yi,bi}from"./chunk-ve8gy05p.js";var D={sealed:"已封存",folded:"已折叠",archived:"已移出"},R=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function W(t,c){if(t.startsWith("recent-"))return"json";let d=c.trimStart();if(!d)return"markdown";if(d.startsWith("{")||d.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(d))return"xml";return"markdown"}function A(t){if(!t||t.length>32000)return t;if(!t.trimStart().startsWith("<"))return t;let d=[],s=0,a=(p)=>" ".repeat(p),u=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g;for(let p of t.matchAll(u)){let[,f,,,g,l,x,h]=p;if(f)d.push(`${a(s)}${f.trim()}`);else if(g)s=Math.max(0,s-1),d.push(`${a(s)}${g.trim()}`);else if(x)d.push(`${a(s)}${x.trim()}`),s++;else if(l)d.push(`${a(s)}${l.trim()}`);else if(h){let N=h.trim();if(N)for(let S of N.split(/\r?\n/)){let I=S.trim();if(I)d.push(`${a(s)}${I}`)}}}return d.length>0?d.join(`
2
- `):t}function z(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function k(t){let{style:c}=y();return e("p",{className:c("surface.empty"),children:t.children})}function E(t){let{Code:c}=y();return e(c,{code:t.code,lang:t.lang,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})}function O(t){let{cn:c}=y();if(!t.items.length)return e(k,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let d=t.items.reduce((s,a)=>s+a.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[e("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:t.items.map((s,a)=>e("span",{className:c(R[a%R.length],"transition-[width] duration-300 ease-out-quint"),title:`${s.label}:${s.tokens.toLocaleString()} token`,style:{width:`${s.tokens/d*100}%`}},s.id))}),e("div",{className:"space-y-1.5",children:t.items.map((s,a)=>e(Q,{item:s,total:d,index:a,color:R[a%R.length]??"bg-accent"},s.id))})]})}function Q(t){let{cn:c,Chevron:d,CopyButton:s,style:a,useTheme:u}=y();u();let[p,f]=r(!1),g=(t.item.tokens/t.total*100).toFixed(1),l=v(()=>p&&t.item.detail?nr(t.item.detail):"",[p,t.item.detail]),x=v(()=>l?W(t.item.id,l):"markdown",[l,t.item.id]),h=v(()=>{if(!l)return"";return x==="xml"?A(l):l},[l,x]);return n("div",{"data-state":p?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((N)=>!N),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[e("span",{className:c("size-2 shrink-0 rounded-full",t.color),"aria-hidden":!0}),e("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:t.item.label}),t.item.state&&e("span",{className:a("control.badge","text-[10px]"),children:D[t.item.state]}),e("span",{className:"font-mono tabular-nums text-dim",children:t.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[g,"%"]}),e(d,{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:[e("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:e("div",{className:c("h-full",t.color),style:{width:`${g}%`}})}),h?n("div",{className:a("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(s,{text:t.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:e(E,{code:h,lang:x})})]}):e("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var M=40,Y={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 L(t){let{Button:c,CopyButton:d,style:s,useTheme:a}=y();a();let[u,p]=r(M),f=i(null),g=u<t.entries.length;o(()=>{let x=f.current;if(!x||!g||typeof IntersectionObserver>"u")return;let h=new IntersectionObserver((N)=>{if(N.some((S)=>S.isIntersecting))p((S)=>Math.min(t.entries.length,S+M))},{rootMargin:"480px"});return h.observe(x),()=>h.disconnect()},[g,t.entries.length]);let l=v(()=>t.entries.slice(-u).reverse(),[t.entries,u]);if(!t.entries.length)return e(k,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:s("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",t.entries.length," 条记录"]}),e(d,{text:()=>t.entries.map((x)=>JSON.stringify(x,null,2)).join(`
1
+ import{B,o,v,i,r,m,e,n,y,U,bi,Lo,ro,Br,ar,Io,ao,Do,ca,ua,Fn,xi,_i}from"./chunk-ty2rmwda.js";var D={sealed:"已封存",folded:"已折叠",archived:"已移出"},R=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function W(t,c){if(t.startsWith("recent-"))return"json";let d=c.trimStart();if(!d)return"markdown";if(d.startsWith("{")||d.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(d))return"xml";return"markdown"}function A(t){if(!t||t.length>32000)return t;if(!t.trimStart().startsWith("<"))return t;let d=[],s=0,a=(p)=>" ".repeat(p),u=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g;for(let p of t.matchAll(u)){let[,f,,,g,l,x,h]=p;if(f)d.push(`${a(s)}${f.trim()}`);else if(g)s=Math.max(0,s-1),d.push(`${a(s)}${g.trim()}`);else if(x)d.push(`${a(s)}${x.trim()}`),s++;else if(l)d.push(`${a(s)}${l.trim()}`);else if(h){let N=h.trim();if(N)for(let S of N.split(/\r?\n/)){let I=S.trim();if(I)d.push(`${a(s)}${I}`)}}}return d.length>0?d.join(`
2
+ `):t}function z(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),e("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function k(t){let{style:c}=y();return e("p",{className:c("surface.empty"),children:t.children})}function E(t){let{Code:c}=y();return e(c,{code:t.code,lang:t.lang,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})}function O(t){let{cn:c}=y();if(!t.items.length)return e(k,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let d=t.items.reduce((s,a)=>s+a.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[e("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:t.items.map((s,a)=>e("span",{className:c(R[a%R.length],"transition-[width] duration-300 ease-out-quint"),title:`${s.label}:${s.tokens.toLocaleString()} token`,style:{width:`${s.tokens/d*100}%`}},s.id))}),e("div",{className:"space-y-1.5",children:t.items.map((s,a)=>e(Q,{item:s,total:d,index:a,color:R[a%R.length]??"bg-accent"},s.id))})]})}function Q(t){let{cn:c,Chevron:d,CopyButton:s,style:a,useTheme:u}=y();u();let[p,f]=r(!1),g=(t.item.tokens/t.total*100).toFixed(1),l=v(()=>p&&t.item.detail?ar(t.item.detail):"",[p,t.item.detail]),x=v(()=>l?W(t.item.id,l):"markdown",[l,t.item.id]),h=v(()=>{if(!l)return"";return x==="xml"?A(l):l},[l,x]);return n("div",{"data-state":p?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((N)=>!N),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[e("span",{className:c("size-2 shrink-0 rounded-full",t.color),"aria-hidden":!0}),e("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:t.item.label}),t.item.state&&e("span",{className:a("control.badge","text-[10px]"),children:D[t.item.state]}),e("span",{className:"font-mono tabular-nums text-dim",children:t.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[g,"%"]}),e(d,{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:[e("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:e("div",{className:c("h-full",t.color),style:{width:`${g}%`}})}),h?n("div",{className:a("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(s,{text:t.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:e(E,{code:h,lang:x})})]}):e("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var M=40,Y={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 L(t){let{Button:c,CopyButton:d,style:s,useTheme:a}=y();a();let[u,p]=r(M),f=i(null),g=u<t.entries.length;o(()=>{let x=f.current;if(!x||!g||typeof IntersectionObserver>"u")return;let h=new IntersectionObserver((N)=>{if(N.some((S)=>S.isIntersecting))p((S)=>Math.min(t.entries.length,S+M))},{rootMargin:"480px"});return h.observe(x),()=>h.disconnect()},[g,t.entries.length]);let l=v(()=>t.entries.slice(-u).reverse(),[t.entries,u]);if(!t.entries.length)return e(k,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:s("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",t.entries.length," 条记录"]}),e(d,{text:()=>t.entries.map((x)=>JSON.stringify(x,null,2)).join(`
3
3
 
4
- `),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),l.map((x)=>e(ee,{entry:x},x.seq)),g&&n("div",{ref:f,className:s("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",l.length," / ",t.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[e(c,{size:"sm",variant:"ghost",onClick:()=>p((x)=>Math.min(t.entries.length,x+M)),children:"加载更多"}),e(c,{size:"sm",variant:"ghost",onClick:()=>p(t.entries.length),children:"显示全部"})]})]})]})}var ee=B(function(c){let{Chevron:d,CopyButton:s,style:a,useTheme:u}=y();u();let[p,f]=r(!1),g=Ro(c.entry),l=v(()=>Ao(c.entry.time),[c.entry.time]);return n("div",{"data-state":p?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((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:["#",c.entry.seq]}),e("span",{className:a("control.badge","shrink-0 font-medium text-[10px]",Y[g.tone]),children:g.badge}),e("span",{className:"min-w-0 flex-1 truncate text-ink",children:g.title}),g.meta&&e("span",{className:a("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:g.meta}),e("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:l}),e(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&e("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:[c.entry.type," · #",c.entry.seq]}),e(s,{text:()=>JSON.stringify(c.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),e(te,{entry:c.entry})]})})]})});function te(t){let{style:c,useTheme:d}=y();d();let s=t.entry;if(s.type==="user")return n("div",{className:"space-y-2",children:[s.text&&e("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:Or(s.text)}),s.attachments&&s.attachments.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["附件(",s.attachments.length,")"]}),e("div",{className:"flex flex-wrap gap-1.5",children:s.attachments.map((a,u)=>{let p=a.kind==="image"?Math.floor(a.data.length*0.75):a.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[e("span",{className:c("control.badge","text-[10px] text-faint"),children:a.kind==="image"?"图片":a.kind==="path"?"路径":"文本"}),e("span",{className:"max-w-40 truncate font-medium text-ink",children:a.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[a.mimeType," · ",to(p)]})]},`${a.name}-${u}`)})})]}),s.notices&&s.notices.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["通知来源(",s.notices.length,")"]}),s.notices.map((a)=>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:[a.sourceKind,"/",a.sourceID]}),e("span",{className:"text-faint",children:a.state})]},a.dedupeKey))]})]});if(s.type==="assistant")return n("div",{className:"space-y-2",children:[n("div",{className:"font-mono text-[11px] text-faint",children:["模型:",s.model]}),s.error&&e("div",{className:"rounded-lg border border-danger/30 bg-danger/8 px-2.5 py-2 text-xs text-danger",children:s.error}),s.parts.map((a,u)=>{if(a.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),e("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:Or(a.text)})]},`thinking-${u}`);if(a.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),e("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:Or(a.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:["工具调用 · ",a.name]}),e("span",{className:"truncate font-mono text-[10px] text-faint",children:a.id})]}),e("div",{className:"max-h-60 overflow-y-auto text-dim",children:e(E,{code:nr(JSON.stringify(a.input,no,2)),lang:"json"})})]},a.id||`tool-${u}`)})]});if(s.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:[e("span",{className:"text-ink",children:s.name}),e("span",{children:"·"}),e("span",{className:"truncate",children:s.callID}),e("span",{className:c("control.badge","ml-auto font-sans text-[10px]",s.isError?"bg-danger/15 text-danger":"text-dim"),children:s.isError?"执行失败":"执行完成"})]}),s.images&&s.images.length>0&&e("div",{className:"flex flex-wrap gap-1.5",children:s.images.map((a,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",a.mimeType," · ",to(Math.floor(a.data.length*0.75))]},`${a.mimeType}-${u}`))}),gi(s.output)?e("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]",s.isError?"text-danger":"text-dim"),children:Or(s.output)}):e("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return e("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:Lo(s)})}function j(t){let{cn:c,style:d,useTheme:s}=y();if(s(),!t.todos.length)return e(k,{children:"暂无待办。"});return e("ul",{className:"space-y-1.5",children:t.todos.map((a)=>n("li",{className:d("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:c("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"&&e(q,{className:"size-2.5 animate-pop",strokeWidth:3.5}),a.status==="in_progress"&&e("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),e("span",{className:c("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 F(t){let{cn:c,style:d,useTheme:s}=y();s();let[a,u]=r("all"),p=v(()=>t.tools.filter((l)=>l.deferred).length,[t.tools]),f=t.tools.length-p,g=v(()=>{if(a==="deferred")return t.tools.filter((l)=>l.deferred);if(a==="active")return t.tools.filter((l)=>!l.deferred);return t.tools},[t.tools,a]);if(!t.tools.length)return e(k,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[p>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>u("all"),className:c("rounded-lg px-2 py-1 transition-colors",a==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",t.tools.length,")"]}),n("button",{type:"button",onClick:()=>u("active"),className:c("rounded-lg px-2 py-1 transition-colors",a==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",f,")"]}),n("button",{type:"button",onClick:()=>u("deferred"),className:c("rounded-lg px-2 py-1 transition-colors",a==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",p,")"]})]}),e("div",{className:"space-y-1.5",children:g.map((l)=>e(ae,{tool:l},`${l.group}-${l.name}`))})]})}function ae(t){let{Chevron:c,CopyButton:d,style:s,useTheme:a}=y();a();let[u,p]=r(!1),f=v(()=>u?JSON.stringify(t.tool.schema,null,2):"",[u,t.tool.schema]);return n("div",{"data-state":u?"open":"closed",className:s("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((g)=>!g),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:[e("span",{className:"truncate",children:t.tool.name}),t.tool.group&&e("span",{className:s("control.badge","font-sans text-[10px]"),children:t.tool.group}),t.tool.deferred&&e("span",{className:s("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),e(c,{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:[t.tool.deferred&&e("div",{className:s("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),t.tool.description&&e("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(t.tool.description)}),n("div",{className:s("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(d,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:e(E,{code:nr(f),lang:"json"})})]})]})]})}function se(){try{let t=localStorage.getItem("basalt.contextSidebar.tab");if(t==="tools"||t==="todos"||t==="raw")return t}catch{}return"breakdown"}function ne(t){let{style:c,useTheme:d}=y();return d(),n("div",{className:c("surface.panel","bg-panel/70 px-3 py-2"),children:[e("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:t.label}),e("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:t.value})]})}function Oe(t){let{Button:c,StatusChip:d,Segmented:s,cn:a,style:u,useTheme:p}=y();p();let[f,g]=r(se),[l,x]=r(()=>$n.get(t.session.id)),[h,N]=r(!1),[S,I]=r(0),[H,U]=r(!1);o(()=>{let b=setTimeout(()=>U(!0),140);return()=>clearTimeout(b)},[]),o(()=>{let b=$n.get(t.session.id);if(b)x(b);return yi((T,G)=>{if(T===t.session.id)x(G)})},[t.session.id]),o(()=>{let b=new AbortController;return N(!1),t.connection.request(`/api/sessions/${encodeURIComponent(t.session.id)}/context`,{signal:AbortSignal.any([b.signal,AbortSignal.timeout(15000)])}).then((T)=>{if(!b.signal.aborted)bi(t.session.id,T),x(T)},()=>{if(!b.signal.aborted)N(!0)}),()=>b.abort()},[t.connection,t.session.id,t.session.updated,t.entries.length,S]);let w=sa(l?.items??[],l?.usableWindow,l?.calibratedTokens,l?.lastInputTokens,l?.hasPendingOutput),C=la(w.percent),_=l?.lastCacheHitRate,P=l?.usage?.cacheHitRate,J=_===void 0?"—":`${(_*100).toFixed(1)}%`,Z=P===void 0?"—":`${(P*100).toFixed(1)}%`,K=(b)=>{g(b);try{localStorage.setItem("basalt.contextSidebar.tab",b)}catch{}},V=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",l&&e("span",{className:"text-[10px] text-faint tabular-nums",children:l.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",t.session.todos.length>0&&e("span",{className:"text-[10px] text-faint tabular-nums",children:t.session.todos.length})]})},{value:"raw",label:"原始消息"}],X=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:[e("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:[e("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:l?w.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",l?.usableWindow.toLocaleString()??"—"]})]})]}),e(d,{tone:C==="overflow"||C==="near_limit"?"danger":C==="sealing"?"warning":"success",children:C==="overflow"?"预计超限":C==="near_limit"?"接近上限":C==="sealing"?"接近封存":"正常"})]}),w.percent!==null&&e("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,w.percent)}),e("div",{"aria-hidden":!0,className:a("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!l&&"animate-pulse"),children:e("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,w.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[e("span",{className:"text-dim",children:w.percent===null?"暂无窗口数据":`${w.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",l?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),l?.usage&&(l.usage.input>0||l.usage.output>0||l.usage.cacheRead>0||l.usage.cacheWrite>0||l.usage.cost>0)&&e("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",l.usage.input.toLocaleString()],["Output",l.usage.output.toLocaleString()],["缓存命中 当前 / 平均",`${J} / ${Z}`],["平均 TPS",l.usage.tps!==void 0?`${l.usage.tps.toFixed(1)} tok/s`:"—"]].map(([b,T])=>e(ne,{label:b,value:T},b))})]});return n(m,{children:[X,e("div",{className:"px-3 py-2",children:e(s,{value:f,onChange:K,options:V,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[h&&!l&&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:[e("span",{children:"上下文加载失败。"}),e(c,{size:"sm",variant:"ghost",onClick:()=>I((b)=>b+1),children:"重试"})]}),e("div",{children:!H?e(z,{}):n(m,{children:[f==="raw"&&e(L,{entries:t.entries}),f==="todos"&&e(j,{todos:t.session.todos}),f==="breakdown"&&(l?e(O,{items:w.items}):!h?e(z,{}):null),f==="tools"&&(l?e(F,{tools:l.tools??[]}):!h?e(z,{}):null)]})},f)]})]})}export{Oe as ContextSidebar};
4
+ `),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),l.map((x)=>e(ee,{entry:x},x.seq)),g&&n("div",{ref:f,className:s("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",l.length," / ",t.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[e(c,{size:"sm",variant:"ghost",onClick:()=>p((x)=>Math.min(t.entries.length,x+M)),children:"加载更多"}),e(c,{size:"sm",variant:"ghost",onClick:()=>p(t.entries.length),children:"显示全部"})]})]})]})}var ee=B(function(c){let{Chevron:d,CopyButton:s,style:a,useTheme:u}=y();u();let[p,f]=r(!1),g=Io(c.entry),l=v(()=>Lo(c.entry.time),[c.entry.time]);return n("div",{"data-state":p?"open":"closed",className:a("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((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:["#",c.entry.seq]}),e("span",{className:a("control.badge","shrink-0 font-medium text-[10px]",Y[g.tone]),children:g.badge}),e("span",{className:"min-w-0 flex-1 truncate text-ink",children:g.title}),g.meta&&e("span",{className:a("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:g.meta}),e("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:l}),e(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&e("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:[c.entry.type," · #",c.entry.seq]}),e(s,{text:()=>JSON.stringify(c.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),e(te,{entry:c.entry})]})})]})});function te(t){let{style:c,useTheme:d}=y();d();let s=t.entry;if(s.type==="user")return n("div",{className:"space-y-2",children:[s.text&&e("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:Br(s.text)}),s.attachments&&s.attachments.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["附件(",s.attachments.length,")"]}),e("div",{className:"flex flex-wrap gap-1.5",children:s.attachments.map((a,u)=>{let p=a.kind==="image"?Math.floor(a.data.length*0.75):a.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[e("span",{className:c("control.badge","text-[10px] text-faint"),children:a.kind==="image"?"图片":a.kind==="path"?"路径":"文本"}),e("span",{className:"max-w-40 truncate font-medium text-ink",children:a.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[a.mimeType," · ",ro(p)]})]},`${a.name}-${u}`)})})]}),s.notices&&s.notices.length>0&&n("div",{className:"space-y-1",children:[n("div",{className:"text-[10.5px] font-medium text-faint",children:["通知来源(",s.notices.length,")"]}),s.notices.map((a)=>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:[a.sourceKind,"/",a.sourceID]}),e("span",{className:"text-faint",children:a.state})]},a.dedupeKey))]})]});if(s.type==="assistant")return n("div",{className:"space-y-2",children:[n("div",{className:"font-mono text-[11px] text-faint",children:["模型:",s.model]}),s.error&&e("div",{className:"rounded-lg border border-danger/30 bg-danger/8 px-2.5 py-2 text-xs text-danger",children:s.error}),s.parts.map((a,u)=>{if(a.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),e("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:Br(a.text)})]},`thinking-${u}`);if(a.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[e("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),e("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:Br(a.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:["工具调用 · ",a.name]}),e("span",{className:"truncate font-mono text-[10px] text-faint",children:a.id})]}),e("div",{className:"max-h-60 overflow-y-auto text-dim",children:e(E,{code:ar(JSON.stringify(a.input,ao,2)),lang:"json"})})]},a.id||`tool-${u}`)})]});if(s.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:[e("span",{className:"text-ink",children:s.name}),e("span",{children:"·"}),e("span",{className:"truncate",children:s.callID}),e("span",{className:c("control.badge","ml-auto font-sans text-[10px]",s.isError?"bg-danger/15 text-danger":"text-dim"),children:s.isError?"执行失败":"执行完成"})]}),s.images&&s.images.length>0&&e("div",{className:"flex flex-wrap gap-1.5",children:s.images.map((a,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",a.mimeType," · ",ro(Math.floor(a.data.length*0.75))]},`${a.mimeType}-${u}`))}),bi(s.output)?e("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]",s.isError?"text-danger":"text-dim"),children:Br(s.output)}):e("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return e("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:Do(s)})}function j(t){let{cn:c,style:d,useTheme:s}=y();if(s(),!t.todos.length)return e(k,{children:"暂无待办。"});return e("ul",{className:"space-y-1.5",children:t.todos.map((a)=>n("li",{className:d("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:c("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"&&e(U,{className:"size-2.5 animate-pop",strokeWidth:3.5}),a.status==="in_progress"&&e("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),e("span",{className:c("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 F(t){let{cn:c,style:d,useTheme:s}=y();s();let[a,u]=r("all"),p=v(()=>t.tools.filter((l)=>l.deferred).length,[t.tools]),f=t.tools.length-p,g=v(()=>{if(a==="deferred")return t.tools.filter((l)=>l.deferred);if(a==="active")return t.tools.filter((l)=>!l.deferred);return t.tools},[t.tools,a]);if(!t.tools.length)return e(k,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[p>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>u("all"),className:c("rounded-lg px-2 py-1 transition-colors",a==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",t.tools.length,")"]}),n("button",{type:"button",onClick:()=>u("active"),className:c("rounded-lg px-2 py-1 transition-colors",a==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",f,")"]}),n("button",{type:"button",onClick:()=>u("deferred"),className:c("rounded-lg px-2 py-1 transition-colors",a==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",p,")"]})]}),e("div",{className:"space-y-1.5",children:g.map((l)=>e(ae,{tool:l},`${l.group}-${l.name}`))})]})}function ae(t){let{Chevron:c,CopyButton:d,style:s,useTheme:a}=y();a();let[u,p]=r(!1),f=v(()=>u?JSON.stringify(t.tool.schema,null,2):"",[u,t.tool.schema]);return n("div",{"data-state":u?"open":"closed",className:s("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((g)=>!g),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:[e("span",{className:"truncate",children:t.tool.name}),t.tool.group&&e("span",{className:s("control.badge","font-sans text-[10px]"),children:t.tool.group}),t.tool.deferred&&e("span",{className:s("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),e(c,{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:[t.tool.deferred&&e("div",{className:s("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),t.tool.description&&e("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:ar(t.tool.description)}),n("div",{className:s("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[e("div",{className:"absolute right-1.5 top-1.5 z-10",children:e(d,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),e("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:e(E,{code:ar(f),lang:"json"})})]})]})]})}function se(){try{let t=localStorage.getItem("basalt.contextSidebar.tab");if(t==="tools"||t==="todos"||t==="raw")return t}catch{}return"breakdown"}function ne(t){let{style:c,useTheme:d}=y();return d(),n("div",{className:c("surface.panel","bg-panel/70 px-3 py-2"),children:[e("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:t.label}),e("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:t.value})]})}function Oe(t){let{Button:c,StatusChip:d,Segmented:s,cn:a,style:u,useTheme:p}=y();p();let[f,g]=r(se),[l,x]=r(()=>Fn.get(t.session.id)),[h,N]=r(!1),[S,I]=r(0),[H,J]=r(!1);o(()=>{let b=setTimeout(()=>J(!0),140);return()=>clearTimeout(b)},[]),o(()=>{let b=Fn.get(t.session.id);if(b)x(b);return xi((T,G)=>{if(T===t.session.id)x(G)})},[t.session.id]),o(()=>{let b=new AbortController;return N(!1),t.connection.request(`/api/sessions/${encodeURIComponent(t.session.id)}/context`,{signal:AbortSignal.any([b.signal,AbortSignal.timeout(15000)])}).then((T)=>{if(!b.signal.aborted)_i(t.session.id,T),x(T)},()=>{if(!b.signal.aborted)N(!0)}),()=>b.abort()},[t.connection,t.session.id,t.session.updated,t.entries.length,S]);let w=ca(l?.items??[],l?.usableWindow,l?.calibratedTokens,l?.lastInputTokens,l?.hasPendingOutput),C=ua(w.percent),_=l?.lastCacheHitRate,P=l?.usage?.cacheHitRate,q=_===void 0?"—":`${(_*100).toFixed(1)}%`,Z=P===void 0?"—":`${(P*100).toFixed(1)}%`,K=(b)=>{g(b);try{localStorage.setItem("basalt.contextSidebar.tab",b)}catch{}},V=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",l&&e("span",{className:"text-[10px] text-faint tabular-nums",children:l.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",t.session.todos.length>0&&e("span",{className:"text-[10px] text-faint tabular-nums",children:t.session.todos.length})]})},{value:"raw",label:"原始消息"}],X=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:[e("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:[e("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:l?w.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",l?.usableWindow.toLocaleString()??"—"]})]})]}),e(d,{tone:C==="overflow"||C==="near_limit"?"danger":C==="sealing"?"warning":"success",children:C==="overflow"?"预计超限":C==="near_limit"?"接近上限":C==="sealing"?"接近封存":"正常"})]}),w.percent!==null&&e("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,w.percent)}),e("div",{"aria-hidden":!0,className:a("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!l&&"animate-pulse"),children:e("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,w.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[e("span",{className:"text-dim",children:w.percent===null?"暂无窗口数据":`${w.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",l?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),l?.usage&&(l.usage.input>0||l.usage.output>0||l.usage.cacheRead>0||l.usage.cacheWrite>0||l.usage.cost>0)&&e("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",l.usage.input.toLocaleString()],["Output",l.usage.output.toLocaleString()],["缓存命中 当前 / 平均",`${q} / ${Z}`],["平均 TPS",l.usage.tps!==void 0?`${l.usage.tps.toFixed(1)} tok/s`:"—"]].map(([b,T])=>e(ne,{label:b,value:T},b))})]});return n(m,{children:[X,e("div",{className:"px-3 py-2",children:e(s,{value:f,onChange:K,options:V,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[h&&!l&&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:[e("span",{children:"上下文加载失败。"}),e(c,{size:"sm",variant:"ghost",onClick:()=>I((b)=>b+1),children:"重试"})]}),e("div",{children:!H?e(z,{}):n(m,{children:[f==="raw"&&e(L,{entries:t.entries}),f==="todos"&&e(j,{todos:t.session.todos}),f==="breakdown"&&(l?e(O,{items:w.items}):!h?e(z,{}):null),f==="tools"&&(l?e(F,{tools:l.tools??[]}):!h?e(z,{}):null)]})},f)]})]})}export{Oe as ContextSidebar};
@@ -1,4 +1,4 @@
1
- import{t,a,X,u,d,N,O,gt,l,V,nt,rt,Tt,vt,Jt}from"./chunk-c6m4vfn5.js";import{qe}from"./chunk-qb8mbptk.js";var ae=function(){var e=t(function(R,r,i,o){for(i=i||{},o=R.length;o--;i[R[o]]=r);return i},"o"),f=[1,4],m=[1,13],s=[1,12],y=[1,15],x=[1,16],S=[1,20],g=[1,19],A=[6,7,8],P=[1,26],b=[1,24],j=[1,25],v=[6,7,11],Y=[1,31],L=[6,7,11,24],W=[1,6,13,16,17,20,23],k=[1,35],F=[1,36],T=[1,6,7,11,13,16,17,20,23],J=[1,38],G={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,o,c,p,n,M){var h=n.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",n[h-1].id),c.addNode(n[h-2].length,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 16:c.getLogger().info("Node: ",n[h].id),c.addNode(n[h-1].length,n[h].id,n[h].descr,n[h].type);break;case 17:c.getLogger().trace("Icon: ",n[h]),c.decorateNode({icon:n[h]});break;case 18:case 23:c.decorateNode({class:n[h]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",n[h-1].id),c.addNode(0,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 21:c.getLogger().trace("Node: ",n[h].id),c.addNode(0,n[h].id,n[h].descr,n[h].type);break;case 22:c.decorateNode({icon:n[h]});break;case 27:c.getLogger().trace("node found ..",n[h-2]),this.$={id:n[h-1],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 28:this.$={id:n[h],descr:n[h],type:0};break;case 29:c.getLogger().trace("node found ..",n[h-3]),this.$={id:n[h-3],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 30:this.$=n[h-1]+n[h];break;case 31:this.$=n[h];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(A,[2,3]),{1:[2,2]},e(A,[2,4]),e(A,[2,5]),{1:[2,6],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:P,7:b,10:23,11:j},e(v,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),e(v,[2,19]),e(v,[2,21],{15:30,24:Y}),e(v,[2,22]),e(v,[2,23]),e(L,[2,25]),e(L,[2,26]),e(L,[2,28],{20:[1,32]}),{21:[1,33]},{6:P,7:b,10:34,11:j},{1:[2,7],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(W,[2,14],{7:k,11:F}),e(T,[2,8]),e(T,[2,9]),e(T,[2,10]),e(v,[2,16],{15:37,24:Y}),e(v,[2,17]),e(v,[2,18]),e(v,[2,20],{24:J}),e(L,[2,31]),{21:[1,39]},{22:[1,40]},e(W,[2,13],{7:k,11:F}),e(T,[2,11]),e(T,[2,12]),e(v,[2,15],{24:J}),e(L,[2,30]),{22:[1,41]},e(L,[2,27]),e(L,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var o=Error(r);throw o.hash=i,o}},"parseError"),parse:t(function(r){var i=this,o=[0],c=[],p=[null],n=[],M=this.table,h="",q=0,he=0,ue=0,be=2,ge=1,ye=n.slice.call(arguments,1),_=Object.create(this.lexer),U={yy:{}};for(var te in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,te))U.yy[te]=this.yy[te];if(_.setInput(r,U.yy),U.yy.lexer=_,U.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var ne=_.yylloc;n.push(ne);var me=_.options&&_.options.ranges;if(typeof U.yy.parseError==="function")this.parseError=U.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(C){o.length=o.length-2*C,p.length=p.length-C,n.length=n.length-C}t(ke,"popStack");function de(){var C=c.pop()||_.lex()||ge;if(typeof C!=="number"){if(C instanceof Array)c=C,C=c.pop();C=i.symbols_[C]||C}return C}t(de,"lex");var D,ie,H,I,je,re,K={},Q,B,pe,Z;while(!0){if(H=o[o.length-1],this.defaultActions[H])I=this.defaultActions[H];else{if(D===null||typeof D>"u")D=de();I=M[H]&&M[H][D]}if(typeof I>"u"||!I.length||!I[0]){var se="";Z=[];for(Q in M[H])if(this.terminals_[Q]&&Q>be)Z.push("'"+this.terminals_[Q]+"'");if(_.showPosition)se="Parse error on line "+(q+1)+`:
1
+ import{t,a,X,u,d,N,O,yt,l,V,nt,rt,Et,bt,en}from"./chunk-zsat72qd.js";import{qe}from"./chunk-w5q7978e.js";var ae=function(){var e=t(function(R,r,i,o){for(i=i||{},o=R.length;o--;i[R[o]]=r);return i},"o"),f=[1,4],m=[1,13],s=[1,12],y=[1,15],x=[1,16],S=[1,20],g=[1,19],A=[6,7,8],P=[1,26],b=[1,24],j=[1,25],v=[6,7,11],Y=[1,31],L=[6,7,11,24],W=[1,6,13,16,17,20,23],k=[1,35],F=[1,36],T=[1,6,7,11,13,16,17,20,23],J=[1,38],G={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:t(function(r,i,o,c,p,n,M){var h=n.length-1;switch(p){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",n[h-1].id),c.addNode(n[h-2].length,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 16:c.getLogger().info("Node: ",n[h].id),c.addNode(n[h-1].length,n[h].id,n[h].descr,n[h].type);break;case 17:c.getLogger().trace("Icon: ",n[h]),c.decorateNode({icon:n[h]});break;case 18:case 23:c.decorateNode({class:n[h]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",n[h-1].id),c.addNode(0,n[h-1].id,n[h-1].descr,n[h-1].type,n[h]);break;case 21:c.getLogger().trace("Node: ",n[h].id),c.addNode(0,n[h].id,n[h].descr,n[h].type);break;case 22:c.decorateNode({icon:n[h]});break;case 27:c.getLogger().trace("node found ..",n[h-2]),this.$={id:n[h-1],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 28:this.$={id:n[h],descr:n[h],type:0};break;case 29:c.getLogger().trace("node found ..",n[h-3]),this.$={id:n[h-3],descr:n[h-1],type:c.getType(n[h-2],n[h])};break;case 30:this.$=n[h-1]+n[h];break;case 31:this.$=n[h];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(A,[2,3]),{1:[2,2]},e(A,[2,4]),e(A,[2,5]),{1:[2,6],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},{6:P,7:b,10:23,11:j},e(v,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),e(v,[2,19]),e(v,[2,21],{15:30,24:Y}),e(v,[2,22]),e(v,[2,23]),e(L,[2,25]),e(L,[2,26]),e(L,[2,28],{20:[1,32]}),{21:[1,33]},{6:P,7:b,10:34,11:j},{1:[2,7],6:m,12:21,13:s,14:14,16:y,17:x,18:17,19:18,20:S,23:g},e(W,[2,14],{7:k,11:F}),e(T,[2,8]),e(T,[2,9]),e(T,[2,10]),e(v,[2,16],{15:37,24:Y}),e(v,[2,17]),e(v,[2,18]),e(v,[2,20],{24:J}),e(L,[2,31]),{21:[1,39]},{22:[1,40]},e(W,[2,13],{7:k,11:F}),e(T,[2,11]),e(T,[2,12]),e(v,[2,15],{24:J}),e(L,[2,30]),{22:[1,41]},e(L,[2,27]),e(L,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(r,i){if(i.recoverable)this.trace(r);else{var o=Error(r);throw o.hash=i,o}},"parseError"),parse:t(function(r){var i=this,o=[0],c=[],p=[null],n=[],M=this.table,h="",q=0,he=0,ue=0,be=2,ge=1,ye=n.slice.call(arguments,1),_=Object.create(this.lexer),U={yy:{}};for(var te in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,te))U.yy[te]=this.yy[te];if(_.setInput(r,U.yy),U.yy.lexer=_,U.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var ne=_.yylloc;n.push(ne);var me=_.options&&_.options.ranges;if(typeof U.yy.parseError==="function")this.parseError=U.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(C){o.length=o.length-2*C,p.length=p.length-C,n.length=n.length-C}t(ke,"popStack");function de(){var C=c.pop()||_.lex()||ge;if(typeof C!=="number"){if(C instanceof Array)c=C,C=c.pop();C=i.symbols_[C]||C}return C}t(de,"lex");var D,ie,H,I,je,re,K={},Q,B,pe,Z;while(!0){if(H=o[o.length-1],this.defaultActions[H])I=this.defaultActions[H];else{if(D===null||typeof D>"u")D=de();I=M[H]&&M[H][D]}if(typeof I>"u"||!I.length||!I[0]){var se="";Z=[];for(Q in M[H])if(this.terminals_[Q]&&Q>be)Z.push("'"+this.terminals_[Q]+"'");if(_.showPosition)se="Parse error on line "+(q+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+Z.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else se="Parse error on line "+(q+1)+": Unexpected "+(D==ge?"end of input":"'"+(this.terminals_[D]||D)+"'");this.parseError(se,{text:_.match,token:this.terminals_[D]||D,line:_.yylineno,loc:ne,expected:Z})}if(I[0]instanceof Array&&I.length>1)throw Error("Parse Error: multiple actions possible at state: "+H+", token: "+D);switch(I[0]){case 1:if(o.push(D),p.push(_.yytext),n.push(_.yylloc),o.push(I[1]),D=null,!ie){if(he=_.yyleng,h=_.yytext,q=_.yylineno,ne=_.yylloc,ue>0)ue--}else D=ie,ie=null;break;case 2:if(B=this.productions_[I[1]][1],K.$=p[p.length-B],K._$={first_line:n[n.length-(B||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(B||1)].first_column,last_column:n[n.length-1].last_column},me)K._$.range=[n[n.length-(B||1)].range[0],n[n.length-1].range[1]];if(re=this.performAction.apply(K,[h,he,q,U.yy,I[1],p,n].concat(ye)),typeof re<"u")return re;if(B)o=o.slice(0,-1*B*2),p=p.slice(0,-1*B),n=n.slice(0,-1*B);o.push(this.productions_[I[1]][0]),p.push(K.$),n.push(K._$),pe=M[o[o.length-2]][o[o.length-1]],o.push(pe);break;case 3:return!0}}return!0},"parse")},ee=function(){var R={EOF:1,parseError:t(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw Error(i)},"parseError"),setInput:t(function(r,i){if(this.yy=i||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:t(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var i=r.match(/(?:\r\n?|\n).*/g);if(i)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),r},"input"),unput:t(function(r){var i=r.length,o=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var p=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges)this.yylloc.range=[p[0],p[0]+this.yyleng-i];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(r){this.unput(this.match.slice(r))},"less"),pastInput:t(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var r=this.match;if(r.length<20)r+=this._input.substr(0,20-r.length);return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var r=this.pastInput(),i=Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -8,7 +8,7 @@ Expecting `+Z.join(", ")+", got '"+(this.terminals_[D]||D)+"'";else se="Parse er
8
8
  `+y+`
9
9
  }`;else P=y+`
10
10
  `;let b=rt(P,{schema:nt});if(b.shape&&(b.shape!==b.shape.toLowerCase()||b.shape.includes("_")))throw Error(`No such shape: ${b.shape}. Shape names should be lowercase.`);if(b?.shape&&b.shape==="kanbanItem")g.shape=b?.shape;if(b?.label)g.label=b?.label;if(b?.icon)g.icon=b?.icon.toString();if(b?.assigned)g.assigned=b?.assigned.toString();if(b?.ticket)g.ticket=b?.ticket.toString();if(b?.priority)g.priority=b?.priority}let A=Se(e);if(A)g.parentId=A.id||"kbn"+oe++;else ce.push(g);w.push(g)},"addNode"),E={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},ve=t((e,f)=>{switch(a.debug("In get type",e,f),e){case"[":return E.RECT;case"(":return f===")"?E.ROUNDED_RECT:E.CLOUD;case"((":return E.CIRCLE;case")":return E.CLOUD;case"))":return E.BANG;case"{{":return E.HEXAGON;default:return E.DEFAULT}},"getType"),De=t((e,f)=>{le[e]=f},"setElementForId"),Le=t((e)=>{if(!e)return;let f=l(),m=w[w.length-1];if(e.icon)m.icon=O(e.icon,f);if(e.class)m.cssClasses=O(e.class,f)},"decorateNode"),Oe=t((e)=>{switch(e){case E.DEFAULT:return"no-border";case E.RECT:return"rect";case E.ROUNDED_RECT:return"rounded-rect";case E.CIRCLE:return"circle";case E.CLOUD:return"cloud";case E.BANG:return"bang";case E.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Ie=t(()=>a,"getLogger"),Ce=t((e)=>le[e],"getElementById"),we={clear:_e,addNode:xe,getSections:fe,getData:Ne,nodeType:E,getType:ve,setElementForId:De,decorateNode:Le,type2Str:Oe,getLogger:Ie,getElementById:Ce},Ae=we,Te=t(async(e,f,m,s)=>{a.debug(`Rendering kanban diagram
11
- `+e);let x=s.db.getData(),S=l();S.htmlLabels=!1;let g=V(f);for(let k of x.nodes)k.domId=`${f}-${k.id}`;let A=g.append("g");A.attr("class","sections");let P=g.append("g");P.attr("class","items");let b=x.nodes.filter((k)=>k.isGroup),j=0,v=10,Y=[],L=25;for(let k of b){let F=S?.kanban?.sectionWidth||200;j=j+1,k.x=F*j+(j-1)*v/2,k.width=F,k.y=0,k.height=F*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+j;let T=await Jt(A,k);L=Math.max(L,T?.labelBBox?.height),Y.push(T)}let W=0;for(let k of b){let F=Y[W];W=W+1;let T=S?.kanban?.sectionWidth||200,J=-T*3/2+L,G=J,ee=x.nodes.filter((r)=>r.parentId===k.id);for(let r of ee){if(r.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");r.x=k.x,r.width=T-1.5*v;let o=(await Tt(P,r,{config:S})).node().getBBox();r.y=G+o.height/2,await vt(r),G=r.y+o.height/2+v/2}let z=F.cluster.select("rect"),R=Math.max(G-J+3*v,50)+(L-25);z.attr("height",R)}gt(void 0,g,S.mindmap?.padding??N.kanban.padding,S.mindmap?.useMaxWidth??N.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=t((e)=>{let f="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],X(e["lineColor"+s]))e["lineColor"+s]=u(e["lineColor"+s],20);else e["lineColor"+s]=d(e["lineColor"+s],20);let m=t((s,y)=>e.darkMode?d(s,y):u(s,y),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){let y=""+(17-3*s);f+=`
11
+ `+e);let x=s.db.getData(),S=l();S.htmlLabels=!1;let g=V(f);for(let k of x.nodes)k.domId=`${f}-${k.id}`;let A=g.append("g");A.attr("class","sections");let P=g.append("g");P.attr("class","items");let b=x.nodes.filter((k)=>k.isGroup),j=0,v=10,Y=[],L=25;for(let k of b){let F=S?.kanban?.sectionWidth||200;j=j+1,k.x=F*j+(j-1)*v/2,k.width=F,k.y=0,k.height=F*3,k.rx=5,k.ry=5,k.cssClasses=k.cssClasses+" section-"+j;let T=await en(A,k);L=Math.max(L,T?.labelBBox?.height),Y.push(T)}let W=0;for(let k of b){let F=Y[W];W=W+1;let T=S?.kanban?.sectionWidth||200,J=-T*3/2+L,G=J,ee=x.nodes.filter((r)=>r.parentId===k.id);for(let r of ee){if(r.isGroup)throw Error("Groups within groups are not allowed in Kanban diagrams");r.x=k.x,r.width=T-1.5*v;let o=(await Et(P,r,{config:S})).node().getBBox();r.y=G+o.height/2,await bt(r),G=r.y+o.height/2+v/2}let z=F.cluster.select("rect"),R=Math.max(G-J+3*v,50)+(L-25);z.attr("height",R)}yt(void 0,g,S.mindmap?.padding??N.kanban.padding,S.mindmap?.useMaxWidth??N.kanban.useMaxWidth)},"draw"),Re={draw:Te},Pe=t((e)=>{let f="";for(let s=0;s<e.THEME_COLOR_LIMIT;s++)if(e["lineColor"+s]=e["lineColor"+s]||e["cScaleInv"+s],X(e["lineColor"+s]))e["lineColor"+s]=u(e["lineColor"+s],20);else e["lineColor"+s]=d(e["lineColor"+s],20);let m=t((s,y)=>e.darkMode?d(s,y):u(s,y),"adjuster");for(let s=0;s<e.THEME_COLOR_LIMIT;s++){let y=""+(17-3*s);f+=`
12
12
  .section-${s-1} rect, .section-${s-1} path, .section-${s-1} circle, .section-${s-1} polygon, .section-${s-1} path {
13
13
  fill: ${m(e["cScale"+s],10)};
14
14
  stroke: ${m(e["cScale"+s],10)};
@@ -0,0 +1 @@
1
+ import{dt}from"./chunk-s0xy00v5.js";export{dt as default};