@bkm016/basalt 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/README.md +16 -22
  2. package/chunk-06hdzq5n.js +2 -0
  3. package/chunk-09rj27b2.js +2 -0
  4. package/{chunk-qnr1f5pj.js → chunk-0y7ne3d0.js} +2 -2
  5. package/{chunk-vgvq3q12.js → chunk-10xzzn07.js} +2 -2
  6. package/{chunk-6qertm2t.js → chunk-1qpces5a.js} +1 -1
  7. package/{chunk-nt2gntad.js → chunk-1zdwrgd4.js} +1 -1
  8. package/{chunk-sh74qzvt.js → chunk-27gntzs5.js} +4 -4
  9. package/{chunk-1v7st27a.js → chunk-2esbgxps.js} +14 -14
  10. package/{chunk-exnn1867.js → chunk-362g64pd.js} +1 -1
  11. package/{chunk-1aspj1hn.js → chunk-3cjsd292.js} +2 -2
  12. package/chunk-5c9j8qe4.js +478 -0
  13. package/{chunk-8dxzqwq3.js → chunk-5j1krv9v.js} +1 -1
  14. package/{chunk-vkkj4awb.js → chunk-6hssbcgj.js} +1 -1
  15. package/{chunk-1b7gbe8g.js → chunk-75m78j7x.js} +2 -2
  16. package/{chunk-kfq8wyd3.js → chunk-8296hw9m.js} +1 -1
  17. package/{chunk-szat3vp4.js → chunk-8d46jtbj.js} +2 -2
  18. package/{chunk-qczbfccb.js → chunk-8tjad3r0.js} +4 -4
  19. package/{chunk-agntrqs9.js → chunk-97rzj7f6.js} +1 -1
  20. package/{chunk-k7w7ac9q.js → chunk-981f9dw8.js} +8 -8
  21. package/{chunk-xysny0ve.js → chunk-aefadsy6.js} +2 -2
  22. package/{chunk-jhd54p1b.js → chunk-bannb9xm.js} +1 -1
  23. package/{chunk-a3tqx584.js → chunk-c7x1zq39.js} +1 -1
  24. package/{chunk-rv06x0kn.js → chunk-cjc90f84.js} +1 -1
  25. package/{chunk-x3dnb9sz.js → chunk-d2j735sd.js} +2 -2
  26. package/{chunk-yskm0hsy.js → chunk-d8gtbw9g.js} +1 -1
  27. package/{chunk-rm3kcxq9.js → chunk-fjtvjrkg.js} +13 -13
  28. package/{chunk-h6sw8fbt.js → chunk-fm0k0qtz.js} +1 -1
  29. package/{chunk-1yzt0qm0.js → chunk-fw2bpqmw.js} +1 -1
  30. package/{chunk-45cz26ap.js → chunk-gp7y0fja.js} +13 -13
  31. package/{chunk-2bb01ddq.js → chunk-gzxnene8.js} +1 -1
  32. package/{chunk-a8nyk4k9.js → chunk-hwr56pfj.js} +1 -1
  33. package/{chunk-0hbjv3y6.js → chunk-jwdb0ccj.js} +3 -3
  34. package/{chunk-kf8hq21a.js → chunk-k23t7vhs.js} +5 -5
  35. package/{chunk-bhqyxyap.js → chunk-k506w58v.js} +1 -1
  36. package/{chunk-44ek81ad.js → chunk-k6w6y71k.js} +2 -2
  37. package/chunk-m40gxwq4.js +5 -0
  38. package/chunk-m8vkwdgr.js +5 -0
  39. package/{chunk-f7egr55n.js → chunk-mvfsxdx6.js} +13 -13
  40. package/{chunk-pvncysbb.js → chunk-nbb9trwz.js} +1 -1
  41. package/{chunk-0szjy61m.js → chunk-pbcy6zdt.js} +1 -1
  42. package/chunk-pmqtkqsf.js +2 -0
  43. package/{chunk-hat3s3pr.js → chunk-pxsrqrd0.js} +1 -1
  44. package/{chunk-xsbxykr4.js → chunk-qe0teyn1.js} +1 -1
  45. package/{chunk-2zqny2sy.js → chunk-r7fpkb49.js} +1 -1
  46. package/{chunk-3m7qwfm3.js → chunk-rtzqqngy.js} +3 -3
  47. package/{chunk-6e49xsf5.js → chunk-shadcb9z.js} +2 -2
  48. package/{chunk-0qqb6v41.js → chunk-shhrr741.js} +120 -120
  49. package/{chunk-cv5wsd9m.js → chunk-t6zs4kw0.js} +2 -2
  50. package/{chunk-hcn9cf6v.js → chunk-v258nxcz.js} +1 -1
  51. package/{chunk-a6r4z44b.js → chunk-vk1gxk1t.js} +1 -1
  52. package/{chunk-s37s3k24.js → chunk-x1xss1d7.js} +2 -2
  53. package/{chunk-dakrpbe6.js → chunk-x4874m8e.js} +2 -2
  54. package/{chunk-wx7kdf0b.js → chunk-xfvvh1s5.js} +1 -1
  55. package/{chunk-0yytz0r1.js → chunk-y0m980k3.js} +5 -5
  56. package/{chunk-dhm42y04.js → chunk-y58ygzn9.js} +3 -3
  57. package/{chunk-2wkaw73s.js → chunk-y648fzx0.js} +5 -5
  58. package/{chunk-32at88hc.js → chunk-y7nma9rk.js} +1 -1
  59. package/{chunk-pmc3y1z8.js → chunk-ykens1hy.js} +1 -1
  60. package/{chunk-q8zx3kt6.js → chunk-z55bmysw.js} +1 -1
  61. package/{chunk-qx0m82rw.js → chunk-zmsgwr3s.js} +1 -1
  62. package/{chunk-501zkf9b.js → chunk-ztsjgssj.js} +1 -1
  63. package/compiled.js +5 -5
  64. package/package.json +1 -1
  65. package/ui-test-worker.js +63 -63
  66. package/web/chunk-0sewdyz1.js +1 -0
  67. package/web/{chunk-xbty0rv7.js → chunk-1z5p7a1h.js} +1 -1
  68. package/web/chunk-21ke27j6.js +1 -0
  69. package/web/{chunk-2msj52w6.js → chunk-24k0r5aq.js} +1 -1
  70. package/web/{chunk-a5x2zveg.js → chunk-284a17k8.js} +1 -1
  71. package/web/{chunk-ca682sm6.js → chunk-2pjdtesn.js} +14 -14
  72. package/web/{chunk-z7dcbxws.js → chunk-3mvr2gwh.js} +1 -1
  73. package/web/chunk-3t3zwx9j.js +1 -0
  74. package/web/{chunk-e6jxqbv7.js → chunk-3z93efr4.js} +1 -1
  75. package/web/{chunk-05w4fyzc.js → chunk-43jqvsrg.js} +1 -1
  76. package/web/{chunk-jwzd9tzk.js → chunk-4bry4xds.js} +2 -2
  77. package/web/{chunk-4ks96e4r.js → chunk-5e7ygjdn.js} +1 -1
  78. package/web/{chunk-qefasa1j.js → chunk-5jbf7n5q.js} +1 -1
  79. package/web/{chunk-e32y85kx.js → chunk-5rx8rtsa.js} +1 -1
  80. package/web/chunk-5xc9d5ft.js +1 -0
  81. package/web/{chunk-a1z5qx1r.js → chunk-693m9kt7.js} +3 -3
  82. package/web/{chunk-70qwwwak.js → chunk-6qejm5s2.js} +1 -1
  83. package/web/{chunk-kdyjnwdx.js → chunk-8ah6ce1b.js} +2 -2
  84. package/web/{chunk-5vw9rs4r.js → chunk-8e43yaq3.js} +3 -3
  85. package/web/{chunk-qnaqf0cr.js → chunk-8wye0wbb.js} +1 -1
  86. package/web/{chunk-45fzdcgz.js → chunk-986z0p48.js} +5 -5
  87. package/web/{chunk-y0m8hrwz.js → chunk-9dd1c37b.js} +77 -77
  88. package/web/{chunk-9yakxvjb.js → chunk-9re6yttj.js} +2 -2
  89. package/web/{chunk-2scce33n.js → chunk-abbvjt4e.js} +1 -1
  90. package/web/{chunk-b4wbk7vc.js → chunk-agmkx996.js} +3 -3
  91. package/web/{chunk-hev4hq89.js → chunk-anbn2ttv.js} +2 -2
  92. package/web/chunk-aqm3spxt.js +1139 -0
  93. package/web/{chunk-fk0dh93x.js → chunk-avwpjsxw.js} +5 -5
  94. package/web/chunk-b470hvpk.js +1 -0
  95. package/web/{chunk-9dxjafp2.js → chunk-bt1m87ck.js} +2 -2
  96. package/web/chunk-cqp1d4p0.js +1 -0
  97. package/web/{chunk-ss1bcb0n.js → chunk-ctcrk3qn.js} +2 -2
  98. package/web/{chunk-pf2ab8p8.js → chunk-ctd8bfg2.js} +1 -1
  99. package/web/{chunk-q5ke7a33.js → chunk-cwvtraca.js} +1 -1
  100. package/web/{chunk-yd46jhqv.js → chunk-dk90px7g.js} +1 -1
  101. package/web/{chunk-0mrkjnte.js → chunk-ds7srg4p.js} +1 -1
  102. package/web/{chunk-fscafg24.js → chunk-dt8ss97f.js} +5 -5
  103. package/web/{chunk-9p12mgs6.js → chunk-ezkqa7we.js} +1 -1
  104. package/web/{chunk-f26smjjf.js → chunk-f078k1ej.js} +1 -1
  105. package/web/chunk-fekjj24p.css +1 -0
  106. package/web/{chunk-a3verqw9.js → chunk-fqj9kry9.js} +5 -5
  107. package/web/chunk-frjfamx7.js +8 -0
  108. package/web/{chunk-g4azyef7.js → chunk-fy8ey195.js} +1 -1
  109. package/web/{chunk-wptv8atc.js → chunk-g8ee1csm.js} +1 -1
  110. package/web/{chunk-w880psmw.js → chunk-h31p43qa.js} +1 -1
  111. package/web/chunk-h5p5jsrw.js +1 -0
  112. package/web/chunk-h9fmr6ch.js +1 -0
  113. package/web/{chunk-qh7265qw.js → chunk-jf2ehmvp.js} +2 -2
  114. package/web/{chunk-fz06t6km.js → chunk-jmnaq7c1.js} +1 -1
  115. package/web/chunk-jq0pw0k2.js +1 -0
  116. package/web/{chunk-p3b9crsa.js → chunk-jvj66qhs.js} +2 -2
  117. package/web/{chunk-xjxv8dg8.js → chunk-jzmzhj8z.js} +4 -4
  118. package/web/chunk-k4cfnvyq.js +1 -0
  119. package/web/{chunk-dt462hk9.js → chunk-kgerjbn4.js} +1 -1
  120. package/web/{chunk-bc78qf1m.js → chunk-kww4azv5.js} +5 -5
  121. package/web/chunk-m29dhjkh.js +1 -0
  122. package/web/chunk-mj6tee5h.js +1 -0
  123. package/web/{chunk-jrcyc9s9.js → chunk-mjpjkyd1.js} +1 -1
  124. package/web/{chunk-20q90epj.js → chunk-n8sky2q6.js} +1 -1
  125. package/web/{chunk-fm2ybfj5.js → chunk-pk3ap3wh.js} +4 -4
  126. package/web/{chunk-bgnnrpna.js → chunk-q1pkntc6.js} +4 -4
  127. package/web/{chunk-taynqrgq.js → chunk-qryrg2pq.js} +2 -2
  128. package/web/{chunk-gqw3f02j.js → chunk-r92sbgwv.js} +5 -5
  129. package/web/{chunk-0vt9fg48.js → chunk-raqqscwa.js} +2 -2
  130. package/web/{chunk-3jhyzmnf.js → chunk-rc2vq9wz.js} +3 -3
  131. package/web/{chunk-2ps6mepk.js → chunk-rkj743fg.js} +3 -3
  132. package/web/{chunk-e53wfgb8.js → chunk-rrws61wf.js} +1 -1
  133. package/web/{chunk-9an7cjd9.js → chunk-s3hwejnr.js} +2 -2
  134. package/web/{chunk-dzwxgqgm.js → chunk-s3rdx28k.js} +2 -2
  135. package/web/{chunk-2m12wyrb.js → chunk-shbw6wg8.js} +1 -1
  136. package/web/chunk-szcy5z56.js +1 -0
  137. package/web/{chunk-tmvakq7n.js → chunk-t1xk6hca.js} +4 -4
  138. package/web/chunk-t2hhdg9r.js +1 -0
  139. package/web/chunk-tj4cmkwe.js +1 -0
  140. package/web/{chunk-bjkc94mv.js → chunk-tn1xzmgx.js} +1 -1
  141. package/web/{chunk-4v8en1yw.js → chunk-tnv7z83q.js} +1 -1
  142. package/web/chunk-v2b5q0n5.js +1 -0
  143. package/web/{chunk-3ee04tmm.js → chunk-vj6kstpp.js} +5 -5
  144. package/web/{chunk-b1pe46zz.js → chunk-vjqmnkh2.js} +1 -1
  145. package/web/{chunk-qd8bxxdj.js → chunk-vkc149rb.js} +1 -1
  146. package/web/{chunk-v28fx2nd.js → chunk-vny496ba.js} +1 -1
  147. package/web/{chunk-rpmpttbk.js → chunk-vz5ck6x9.js} +1 -1
  148. package/web/{chunk-y49fhfda.js → chunk-xa88zgkr.js} +1 -1
  149. package/web/{chunk-q0p5xqe1.js → chunk-xdcs8qz3.js} +4 -4
  150. package/web/chunk-y5x74t89.js +1 -0
  151. package/web/{chunk-xrxne80b.js → chunk-yen2kkn2.js} +1 -1
  152. package/web/{chunk-bj90t5gh.js → chunk-yjv2c45j.js} +4 -4
  153. package/web/chunk-yx3dh5hg.js +1 -0
  154. package/web/chunk-yz4fmtk2.js +1 -0
  155. package/web/{chunk-8p4tc9f4.js → chunk-z24vs8q9.js} +3 -3
  156. package/web/chunk-z5j6x6j8.js +2 -0
  157. package/web/chunk-z5stjrhc.js +1 -0
  158. package/web/{chunk-90kp4pnz.js → chunk-z760wagr.js} +1 -1
  159. package/web/{chunk-tqmwd9qp.js → chunk-znvnb9dh.js} +1 -1
  160. package/web/{chunk-22a4ety5.js → chunk-zrzq29e6.js} +1 -1
  161. package/web/{icon-yx2p2pye.svg → icon-1wgy7kzy.svg} +13 -13
  162. package/web/icon.svg +13 -13
  163. package/web/index.html +2 -2
  164. package/web/install.sh +0 -0
  165. package/web/sw.js +9 -0
  166. package/worker.js +1 -1
  167. package/chunk-09vr609h.js +0 -2
  168. package/chunk-58vz2qsq.js +0 -2
  169. package/chunk-c25s4w6a.js +0 -5
  170. package/chunk-t057xfrt.js +0 -5
  171. package/chunk-wjd9fr23.js +0 -2
  172. package/chunk-zef13k3h.js +0 -471
  173. package/web/chunk-2pver6r4.js +0 -1
  174. package/web/chunk-37ajk6zg.js +0 -2
  175. package/web/chunk-4wkm9fda.js +0 -1
  176. package/web/chunk-amzgyy1k.js +0 -1
  177. package/web/chunk-cff5hcm8.js +0 -8
  178. package/web/chunk-esp1mmgr.js +0 -1
  179. package/web/chunk-ew3cgdtd.js +0 -1
  180. package/web/chunk-gjq1pxw3.js +0 -1
  181. package/web/chunk-h5ejbf6e.js +0 -1
  182. package/web/chunk-jjh5jvva.js +0 -1
  183. package/web/chunk-k5btcvbg.js +0 -1
  184. package/web/chunk-kpvgecwy.js +0 -1
  185. package/web/chunk-kq40ss39.js +0 -1
  186. package/web/chunk-q7dsnvpf.js +0 -1
  187. package/web/chunk-rg426vkf.js +0 -1
  188. package/web/chunk-ry9256r7.js +0 -1
  189. package/web/chunk-scpwc9ev.js +0 -1
  190. package/web/chunk-ssy07dd2.js +0 -1
  191. package/web/chunk-tgpbhzn9.js +0 -1
  192. package/web/chunk-vt40e1kp.js +0 -1136
  193. package/web/chunk-w53rba6g.js +0 -1
  194. package/web/chunk-w86n42dy.js +0 -1
  195. package/web/chunk-wtawdeej.css +0 -1
  196. package/web/chunk-zde7mj43.js +0 -1
@@ -1,2 +1,2 @@
1
- import{At}from"./chunk-vt40e1kp.js";var Z={};At(Z,{default:()=>kt});var V={};At(V,{default:()=>Vt});var Kr=typeof global=="object"&&global&&global.Object===Object&&global,q=Kr;var Hr=typeof self=="object"&&self&&self.Object===Object&&self,qr=q||Hr||Function("return this")(),be=qr;var $r=be.Symbol,Pe=$r;var Ct=Object.prototype,{hasOwnProperty:kr,toString:Yr}=Ct,G=Pe?Pe.toStringTag:void 0;function Xr(t){var e=kr.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(i){}var a=Yr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var Et=Xr;var Zr=Object.prototype,Jr=Zr.toString;function Qr(t){return Jr.call(t)}var It=Qr;var Vr="[object Null]",to="[object Undefined]",Lt=Pe?Pe.toStringTag:void 0;function eo(t){if(t==null)return t===void 0?to:Vr;return Lt&&Lt in Object(t)?Et(t):It(t)}var Qe=eo;function ro(t){return t!=null&&typeof t=="object"}var Te=ro;var oo="[object Symbol]";function ao(t){return typeof t=="symbol"||Te(t)&&Qe(t)==oo}var ct=ao;function fo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var jt=fo;var io=Array.isArray,H=io;var no=1/0,Mt=Pe?Pe.prototype:void 0,Nt=Mt?Mt.toString:void 0;function Dt(t){if(typeof t=="string")return t;if(H(t))return jt(t,Dt)+"";if(ct(t))return Nt?Nt.call(t):"";var e=t+"";return e=="0"&&1/t==-no?"-0":e}var Rt=Dt;function so(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pe=so;function po(t){return t}var at=po;var uo="[object AsyncFunction]",mo="[object Function]",lo="[object GeneratorFunction]",xo="[object Proxy]";function ho(t){if(!pe(t))return!1;var e=Qe(t);return e==mo||e==lo||e==uo||e==xo}var qt=ho;var co=be["__core-js_shared__"],k=co;var Ft=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function go(t){return!!Ft&&Ft in t}var Bt=go;var yo=Function.prototype,_o=yo.toString;function bo(t){if(t!=null){try{return _o.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=bo;var vo=/[\\^$.*+?()[\]{}|]/g,Oo=/^\[object .+?Constructor\]$/,Ao=Function.prototype,To=Object.prototype,wo=Ao.toString,So=To.hasOwnProperty,Po=RegExp("^"+wo.call(So).replace(vo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Co(t){if(!pe(t)||Bt(t))return!1;var e=qt(t)?Po:Oo;return e.test(_(t))}var Ut=Co;function Eo(t,e){return t==null?void 0:t[e]}var zt=Eo;function Io(t,e){var r=zt(t,e);return Ut(r)?r:void 0}var h=Io;var Lo=h(be,"WeakMap"),Y=Lo;function jo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Kt=jo;function Mo(){}var $t=Mo;var No=800,Do=16,Ro=Date.now;function Fo(t){var e=0,r=0;return function(){var o=Ro(),a=Do-(o-r);if(r=o,a>0){if(++e>=No)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Yt=Fo;function Bo(t){return function(){return t}}var it=Bo;var Go=function(){try{var t=h(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),cr=Go;var Uo=!cr?at:function(t,e){return cr(t,"toString",{configurable:!0,enumerable:!1,value:it(e),writable:!0})},Xt=Uo;var zo=Yt(Xt),ua=zo;function Wo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var da=Wo;function Ko(t,e,r,o){var a=t.length,i=r+(o?1:-1);while(o?i--:++i<a)if(e(t[i],i,t))return i;return-1}var pa=Ko;function Ho(t){return t!==t}var Zt=Ho;function qo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Jt=qo;function $o(t,e,r){return e===e?Jt(t,e,r):pa(t,Zt,r)}var Qt=$o;function ko(t,e){var r=t==null?0:t.length;return!!r&&Qt(t,e,0)>-1}var te=ko;var Yo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function Zo(t,e){var r=typeof t;return e=e==null?Yo:e,!!e&&(r=="number"||r!="symbol"&&Xo.test(t))&&(t>-1&&t%1==0&&t<e)}var yn=Zo;function Jo(t,e){return t===e||t!==t&&e!==e}var wt=Jo;var ee=Math.max;function Qo(t,e,r){return e=ee(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,i=ee(o.length-e,0),n=Array(i);while(++a<i)n[a]=o[e+a];a=-1;var s=Array(e+1);while(++a<e)s[a]=o[a];return s[e]=r(n),Kt(t,this,s)}}var ma=Qo;function Vo(t,e){return ua(ma(t,e,at),t+"")}var vn=Vo;var ta=9007199254740991;function ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ta}var j=ea;function ra(t){return t!=null&&j(t.length)&&!qt(t)}var Oe=ra;var oa=Object.prototype;function aa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oa;return t===r}var bn=aa;function ia(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var re=ia;var na="[object Arguments]";function sa(t){return Te(t)&&Qe(t)==na}var gt=sa;var oe=Object.prototype,{hasOwnProperty:la,propertyIsEnumerable:ca}=oe,Oa=gt(function(){return arguments}())?gt:function(t){return Te(t)&&la.call(t,"callee")&&!ca.call(t,"callee")},Ot=Oa;function Aa(){return!1}var ae=Aa;var ne=typeof Z=="object"&&Z&&!Z.nodeType&&Z,fe=ne&&typeof X=="object"&&X&&!X.nodeType&&X,Ta=fe&&fe.exports===ne,ie=Ta?be.Buffer:void 0,Sa=ie?ie.isBuffer:void 0,Pa=Sa||ae,kt=Pa;var Ca="[object Arguments]",Ea="[object Array]",Ia="[object Boolean]",La="[object Date]",ja="[object Error]",Ma="[object Function]",Na="[object Map]",Da="[object Number]",Ra="[object Object]",Fa="[object RegExp]",Ba="[object Set]",Ga="[object String]",Ua="[object WeakMap]",za="[object ArrayBuffer]",Wa="[object DataView]",Ka="[object Float32Array]",Ha="[object Float64Array]",qa="[object Int8Array]",$a="[object Int16Array]",ka="[object Int32Array]",Ya="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Za="[object Uint16Array]",Ja="[object Uint32Array]",m={};m[Ka]=m[Ha]=m[qa]=m[$a]=m[ka]=m[Ya]=m[Xa]=m[Za]=m[Ja]=!0;m[Ca]=m[Ea]=m[za]=m[Ia]=m[Wa]=m[La]=m[ja]=m[Ma]=m[Na]=m[Da]=m[Ra]=m[Fa]=m[Ba]=m[Ga]=m[Ua]=!1;function Qa(t){return Te(t)&&j(t.length)&&!!m[Qe(t)]}var se=Qa;function Va(t){return function(e){return t(e)}}var xn=Va;var ue=typeof V=="object"&&V&&!V.nodeType&&V,U=ue&&typeof J=="object"&&J&&!J.nodeType&&J,tf=U&&U.exports===ue,yt=tf&&q.process,ef=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return yt&&yt.binding&&yt.binding("util")}catch(e){}}(),Vt=ef;var me=Vt&&Vt.isTypedArray,rf=me?xn(me):se,_n=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t,e){var r=H(t),o=!r&&Ot(t),a=!r&&!o&&kt(t),i=!r&&!o&&!a&&_n(t),n=r||o||a||i,s=n?re(t.length,String):[],p=s.length;for(var u in t)if((e||af.call(t,u))&&!(n&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yn(u,p))))s.push(u);return s}var fa=ff;function nf(t,e){return function(r){return t(e(r))}}var ha=nf;var sf=ha(Object.keys,Object),le=sf;var pf=Object.prototype,uf=pf.hasOwnProperty;function mf(t){if(!bn(t))return le(t);var e=[];for(var r in Object(t))if(uf.call(t,r)&&r!="constructor")e.push(r);return e}var ur=mf;function lf(t){return Oe(t)?fa(t):ur(t)}var xe=lf;var df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function hf(t,e){if(H(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||ct(t))return!0;return xf.test(t)||!df.test(t)||e!=null&&t in Object(e)}var M=hf;var cf=h(Object,"create"),b=cf;function gf(){this.__data__=b?b(null):{},this.size=0}var de=gf;function yf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var he=yf;var _f="__lodash_hash_undefined__",bf=Object.prototype,vf=bf.hasOwnProperty;function Of(t){var e=this.__data__;if(b){var r=e[t];return r===_f?void 0:r}return vf.call(e,t)?e[t]:void 0}var ce=Of;var Af=Object.prototype,Tf=Af.hasOwnProperty;function wf(t){var e=this.__data__;return b?e[t]!==void 0:Tf.call(e,t)}var ge=wf;var Sf="__lodash_hash_undefined__";function Pf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Sf:e,this}var ye=Pf;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=de;N.prototype.delete=he;N.prototype.get=ce;N.prototype.has=ge;N.prototype.set=ye;var _t=N;function Cf(){this.__data__=[],this.size=0}var ve=Cf;function Ef(t,e){var r=t.length;while(r--)if(wt(t[r][0],e))return r;return-1}var O=Ef;var If=Array.prototype,Lf=If.splice;function jf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Lf.call(e,r,1);return--this.size,!0}var Ae=jf;function Mf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var we=Mf;function Nf(t){return O(this.__data__,t)>-1}var Se=Nf;function Df(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Ce=Df;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=ve;D.prototype.delete=Ae;D.prototype.get=we;D.prototype.has=Se;D.prototype.set=Ce;var A=D;var Rf=h(be,"Map"),T=Rf;function Ff(){this.size=0,this.__data__={hash:new _t,map:new(T||A),string:new _t}}var Ee=Ff;function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ie=Bf;function Gf(t,e){var r=t.__data__;return Ie(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Gf;function Uf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Le=Uf;function zf(t){return w(this,t).get(t)}var je=zf;function Wf(t){return w(this,t).has(t)}var Me=Wf;function Kf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var Ne=Kf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Ee;R.prototype.delete=Le;R.prototype.get=je;R.prototype.has=Me;R.prototype.set=Ne;var E=R;var Hf="Expected a function";function bt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Hf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],i=r.cache;if(i.has(a))return i.get(a);var n=t.apply(this,o);return r.cache=i.set(a,n)||i,n};return r.cache=new(bt.Cache||E),r}bt.Cache=E;var De=bt;var qf=500;function $f(t){var e=De(t,function(o){if(r.size===qf)r.clear();return o}),r=e.cache;return e}var Re=$f;var kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yf=/\\(\\)?/g,Xf=Re(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(kf,function(r,o,a,i){e.push(a?i.replace(Yf,"$1"):o||r)}),e}),Fe=Xf;function Zf(t){return t==null?"":Rt(t)}var ga=Zf;function Jf(t,e){if(H(t))return t;return M(t,e)?[t]:Fe(ga(t))}var wn=Jf;var Qf=1/0;function Vf(t){if(typeof t=="string"||ct(t))return t;var e=t+"";return e=="0"&&1/t==-Qf?"-0":e}var Gt=Vf;function ti(t,e){e=wn(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[Gt(e[r++])];return r&&r==o?t:void 0}var kn=ti;function ei(t,e,r){var o=t==null?void 0:kn(t,e);return o===void 0?r:o}var Be=ei;function ri(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var dr=ri;var Ge=Pe?Pe.isConcatSpreadable:void 0;function oi(t){return H(t)||Ot(t)||!!(Ge&&t&&t[Ge])}var Ue=oi;function ze(t,e,r,o,a){var i=-1,n=t.length;r||(r=Ue),a||(a=[]);while(++i<n){var s=t[i];if(e>0&&r(s))if(e>1)ze(s,e-1,r,o,a);else dr(a,s);else if(!o)a[a.length]=s}return a}var pr=ze;function ai(t,e,r,o){var a=-1,i=t==null?0:t.length;if(o&&i)r=t[++a];while(++a<i)r=e(r,t[a],a,t);return r}var Ke=ai;function fi(){this.__data__=new A,this.size=0}var He=fi;function ii(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var qe=ii;function ni(t){return this.__data__.get(t)}var $e=ni;function si(t){return this.__data__.has(t)}var ke=si;var pi=200;function ui(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<pi-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Ye=ui;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=He;F.prototype.delete=qe;F.prototype.get=$e;F.prototype.has=ke;F.prototype.set=Ye;var Wt=F;function mi(t,e){var r=-1,o=t==null?0:t.length,a=0,i=[];while(++r<o){var n=t[r];if(e(n,r,t))i[a++]=n}return i}var tt=mi;function li(){return[]}var ya=li;var di=Object.prototype,xi=di.propertyIsEnumerable,Xe=Object.getOwnPropertySymbols,hi=!Xe?ya:function(t){if(t==null)return[];return t=Object(t),tt(Xe(t),function(e){return xi.call(t,e)})},mr=hi;function ci(t,e,r){var o=e(t);return H(t)?o:dr(o,r(t))}var va=ci;function gi(t){return va(t,xe,mr)}var zr=gi;var yi=h(be,"DataView"),et=yi;var _i=h(be,"Promise"),rt=_i;var bi=h(be,"Set"),S=bi;var Ze="[object Map]",vi="[object Object]",Ve="[object Promise]",tr="[object Set]",er="[object WeakMap]",rr="[object DataView]",Oi=_(et),Ai=_(T),Ti=_(rt),wi=_(S),Si=_(Y),I=Qe;if(et&&I(new et(new ArrayBuffer(1)))!=rr||T&&I(new T)!=Ze||rt&&I(rt.resolve())!=Ve||S&&I(new S)!=tr||Y&&I(new Y)!=er)I=function(t){var e=Qe(t),r=e==vi?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case Oi:return rr;case Ai:return Ze;case Ti:return Ve;case wi:return tr;case Si:return er}return e};var ut=I;var Pi=be.Uint8Array,fr=Pi;var Ci="__lodash_hash_undefined__";function Ei(t){return this.__data__.set(t,Ci),this}var or=Ei;function Ii(t){return this.__data__.has(t)}var ar=Ii;function ot(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}ot.prototype.add=ot.prototype.push=or;ot.prototype.has=ar;var ft=ot;function Li(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var ir=Li;function ji(t,e){return t.has(e)}var nt=ji;var Mi=1,Ni=2;function Di(t,e,r,o,a,i){var n=r&Mi,s=t.length,p=e.length;if(s!=p&&!(n&&p>s))return!1;var u=i.get(t),x=i.get(e);if(u&&x)return u==e&&x==t;var d=-1,l=!0,y=r&Ni?new ft:void 0;i.set(t,e),i.set(e,t);while(++d<s){var c=t[d],g=e[d];if(o)var v=n?o(g,c,d,e,t,i):o(c,g,d,t,e,i);if(v!==void 0){if(v)continue;l=!1;break}if(y){if(!ir(e,function(P,C){if(!nt(y,C)&&(c===P||a(c,P,r,o,i)))return y.push(C)})){l=!1;break}}else if(!(c===g||a(c,g,r,o,i))){l=!1;break}}return i.delete(t),i.delete(e),l}var st=Di;function Ri(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var nr=Ri;function Fi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=Fi;var Bi=1,Gi=2,Ui="[object Boolean]",zi="[object Date]",Wi="[object Error]",Ki="[object Map]",Hi="[object Number]",qi="[object RegExp]",$i="[object Set]",ki="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Zi="[object DataView]",sr=Pe?Pe.prototype:void 0,vt=sr?sr.valueOf:void 0;function Ji(t,e,r,o,a,i,n){switch(r){case Zi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xi:if(t.byteLength!=e.byteLength||!i(new fr(t),new fr(e)))return!1;return!0;case Ui:case zi:case Hi:return wt(+t,+e);case Wi:return t.name==e.name&&t.message==e.message;case qi:case ki:return t==e+"";case Ki:var s=nr;case $i:var p=o&Bi;if(s||(s=B),t.size!=e.size&&!p)return!1;var u=n.get(t);if(u)return u==e;o|=Gi,n.set(t,e);var x=st(s(t),s(e),o,a,i,n);return n.delete(t),x;case Yi:if(vt)return vt.call(t)==vt.call(e)}return!1}var lr=Ji;var Qi=1,Vi=Object.prototype,tn=Vi.hasOwnProperty;function en(t,e,r,o,a,i){var n=r&Qi,s=zr(t),p=s.length,u=zr(e),x=u.length;if(p!=x&&!n)return!1;var d=p;while(d--){var l=s[d];if(!(n?l in e:tn.call(e,l)))return!1}var y=i.get(t),c=i.get(e);if(y&&c)return y==e&&c==t;var g=!0;i.set(t,e),i.set(e,t);var v=n;while(++d<p){l=s[d];var P=t[l],C=e[l];if(o)var Pt=n?o(C,P,l,e,t,i):o(P,C,l,t,e,i);if(!(Pt===void 0?P===C||a(P,C,r,o,i):Pt)){g=!1;break}v||(v=l=="constructor")}if(g&&!v){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))g=!1}return i.delete(t),i.delete(e),g}var xr=en;var rn=1,_r="[object Arguments]",br="[object Array]",pt="[object Object]",on=Object.prototype,vr=on.hasOwnProperty;function an(t,e,r,o,a,i){var n=H(t),s=H(e),p=n?br:ut(t),u=s?br:ut(e);p=p==_r?pt:p,u=u==_r?pt:u;var x=p==pt,d=u==pt,l=p==u;if(l&&kt(t)){if(!kt(e))return!1;n=!0,x=!1}if(l&&!x)return i||(i=new Wt),n||_n(t)?st(t,e,r,o,a,i):lr(t,e,p,r,o,a,i);if(!(r&rn)){var y=x&&vr.call(t,"__wrapped__"),c=d&&vr.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return i||(i=new Wt),a(g,v,r,o,i)}}if(!l)return!1;return i||(i=new Wt),xr(t,e,r,o,a,i)}var Or=an;function Ar(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Te(t)&&!Te(e))return t!==t&&e!==e;return Or(t,e,r,o,Ar,a)}var mt=Ar;var fn=1,nn=2;function sn(t,e,r,o){var a=r.length,i=a,n=!o;if(t==null)return!i;t=Object(t);while(a--){var s=r[a];if(n&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}while(++a<i){s=r[a];var p=s[0],u=t[p],x=s[1];if(n&&s[2]){if(u===void 0&&!(p in t))return!1}else{var d=new Wt;if(o)var l=o(u,x,p,t,e,d);if(!(l===void 0?mt(x,u,fn|nn,o,d):l))return!1}}return!0}var Tr=sn;function pn(t){return t===t&&!pe(t)}var lt=pn;function un(t){var e=xe(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,lt(a)]}return e}var wr=un;function mn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var xt=mn;function ln(t){var e=wr(t);if(e.length==1&&e[0][2])return xt(e[0][0],e[0][1]);return function(r){return r===t||Tr(r,t,e)}}var Sr=ln;function dn(t,e){return t!=null&&e in Object(t)}var Pr=dn;function hn(t,e,r){e=wn(e,t);var o=-1,a=e.length,i=!1;while(++o<a){var n=Gt(e[o]);if(!(i=t!=null&&r(t,n)))break;t=t[n]}if(i||++o!=a)return i;return a=t==null?0:t.length,!!a&&j(a)&&yn(n,a)&&(H(t)||Ot(t))}var ba=hn;function cn(t,e){return t!=null&&ba(t,e,Pr)}var xa=cn;var gn=1,On=2;function An(t,e){if(M(t)&&lt(e))return xt(Gt(t),e);return function(r){var o=Be(r,t);return o===void 0&&o===e?xa(r,t):mt(e,o,gn|On)}}var Cr=An;function Tn(t){return function(e){return e==null?void 0:e[t]}}var _a=Tn;function Sn(t){return function(e){return kn(e,t)}}var Er=Sn;function Pn(t){return M(t)?_a(Gt(t)):Er(t)}var Ir=Pn;function En(t){if(typeof t=="function")return t;if(t==null)return at;if(typeof t=="object")return H(t)?Cr(t[0],t[1]):Sr(t);return Ir(t)}var We=En;function In(t){return function(e,r,o){var a=-1,i=Object(e),n=o(e),s=n.length;while(s--){var p=n[t?s:++a];if(r(i[p],p,i)===!1)break}return e}}var Lr=In;var Ln=Lr(),hr=Ln;function jn(t,e){return t&&hr(t,e,xe)}var gr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!Oe(r))return t(r,o);var a=r.length,i=e?a:-1,n=Object(r);while(e?i--:++i<a)if(o(n[i],i,n)===!1)break;return r}}var jr=Mn;var Nn=jr(gr),Cn=Nn;function Dn(t){return Te(t)&&Oe(t)}var wa=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var Mr=Rn;function Fn(t){return typeof t=="function"?t:at}var yr=Fn;function Bn(t,e){var r=H(t)?da:Cn;return r(t,yr(e))}var f=Bn;function Gn(t,e){var r=[];return Cn(t,function(o,a,i){if(e(o,a,i))r.push(o)}),r}var Nr=Gn;function Un(t,e){var r=H(t)?tt:Nr;return r(t,We(e,3))}var Je=Un;function zn(t,e){return jt(e,function(r){return t[r]})}var Dr=zn;function Wn(t){return t==null?[]:Dr(t,xe(t))}var dt=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if(Oe(t)&&(H(t)||typeof t=="string"||typeof t.splice=="function"||kt(t)||_n(t)||Ot(t)))return!t.length;var e=ut(t);if(e==Kn||e==Hn)return!t.size;if(bn(t))return!ur(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var ht=Yn;function Xn(t){return t===void 0}var _e=Xn;function Zn(t,e,r,o,a){return a(t,function(i,n,s){r=o?(o=!1,i):e(r,i,n,s)}),r}var Rr=Zn;function Jn(t,e,r){var o=H(t)?Ke:Rr,a=arguments.length<3;return o(t,We(e,4),r,a,Cn)}var Ht=Jn;var Qn=1/0,Vn=!(S&&1/B(new S([,-0]))[1]==Qn)?$t:function(t){return new S(t)},Fr=Vn;var ts=200;function es(t,e,r){var o=-1,a=te,i=t.length,n=!0,s=[],p=s;if(r)n=!1,a=Mr;else if(i>=ts){var u=e?null:Fr(t);if(u)return B(u);n=!1,a=nt,p=new ft}else p=e?[]:s;t:while(++o<i){var x=t[o],d=e?e(x):x;if(x=r||x!==0?x:0,n&&d===d){var l=p.length;while(l--)if(p[l]===d)continue t;if(e)p.push(d);s.push(x)}else if(!a(p,d,r)){if(p!==s)p.push(d);s.push(x)}}return s}var Br=es;var rs=vn(function(t){return Br(pr(t,1,wa,!0))}),Tt=rs;var as="\x00",L="\x00",Gr="\x01";class Q{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=it(void 0),this._defaultEdgeLabelFn=it(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!qt(t))t=it(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return xe(this._nodes)}sources(){var t=this;return Je(this.nodes(),function(e){return ht(t._in[e])})}sinks(){var t=this;return Je(this.nodes(),function(e){return ht(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return f(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],f(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];f(xe(this._in[t]),e),delete this._in[t],delete this._preds[t],f(xe(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(_e(e))e=L;else{e+="";for(var r=e;!_e(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(_e(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return xe(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return xe(e)}successors(t){var e=this._sucs[t];if(e)return xe(e)}neighbors(t){var e=this.predecessors(t);if(e)return Tt(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;f(this._nodes,function(i,n){if(t(n))e.setNode(n,i)}),f(this._edgeObjs,function(i){if(e.hasNode(i.v)&&e.hasNode(i.w))e.setEdge(i,r.edge(i))});var o={};function a(i){var n=r.parent(i);if(n===void 0||e.hasNode(n))return o[i]=n,n;else if(n in o)return o[n];else return a(n)}if(this._isCompound)f(e.nodes(),function(i){e.setParent(i,a(i))});return e}setDefaultEdgeLabel(t){if(!qt(t))t=it(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return dt(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return Ht(t,function(a,i){if(o.length>1)r.setEdge(a,i,e);else r.setEdge(a,i);return i}),this}setEdge(){var t,e,r,o,a=!1,i=arguments[0];if(typeof i==="object"&&i!==null&&"v"in i){if(t=i.v,e=i.w,r=i.name,arguments.length===2)o=arguments[1],a=!0}else if(t=i,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!_e(r))r=""+r;var n=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n)){if(a)this._edgeLabels[n]=o;return this}if(!_e(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[n]=a?o:this._defaultEdgeLabelFn(t,e,r);var s=fs(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[n]=s,Ur(this._preds[e],t),Ur(this._sucs[t],e),this._in[e][n]=s,this._out[t][n]=s,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?St(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?St(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?St(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Wr(this._preds[e],t),Wr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=dt(r);if(!e)return o;return Je(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=dt(r);if(!e)return o;return Je(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}Q.prototype._nodeCount=0;Q.prototype._edgeCount=0;function Ur(t,e){if(t[e])t[e]++;else t[e]=1}function Wr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}return a+Gr+i+Gr+(_e(o)?as:o)}function fs(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}var s={v:a,w:i};if(o)s.name=o;return s}function St(t,e){return z(t,e.v,e.w,e.name)}
2
- export{be,Pe,Qe,Te,ct,jt,H,pe,at,qt,it,cr,ua,da,pa,yn,wt,ma,vn,Oe,bn,Ot,kt,xn,Vt,_n,fa,ha,ur,xe,ga,wn,Gt,kn,dr,pr,Wt,ya,mr,va,zr,ut,fr,ba,xa,_a,We,hr,gr,Cn,wa,yr,f,Je,dt,_e,Ht,Q};
1
+ import{At}from"./chunk-aqm3spxt.js";var Z={};At(Z,{default:()=>kt});var V={};At(V,{default:()=>Gt});var Kr=typeof global=="object"&&global&&global.Object===Object&&global,q=Kr;var Hr=typeof self=="object"&&self&&self.Object===Object&&self,qr=q||Hr||Function("return this")(),be=qr;var $r=be.Symbol,Pe=$r;var Pt=Object.prototype,{hasOwnProperty:kr,toString:Yr}=Pt,G=Pe?Pe.toStringTag:void 0;function Xr(t){var e=kr.call(t,G),r=t[G];try{t[G]=void 0;var o=!0}catch(i){}var a=Yr.call(t);if(o)if(e)t[G]=r;else delete t[G];return a}var Ct=Xr;var Zr=Object.prototype,Jr=Zr.toString;function Qr(t){return Jr.call(t)}var Et=Qr;var Vr="[object Null]",to="[object Undefined]",It=Pe?Pe.toStringTag:void 0;function eo(t){if(t==null)return t===void 0?to:Vr;return It&&It in Object(t)?Ct(t):Et(t)}var Qe=eo;function ro(t){return t!=null&&typeof t=="object"}var Te=ro;var oo="[object Symbol]";function ao(t){return typeof t=="symbol"||Te(t)&&Qe(t)==oo}var ct=ao;function fo(t,e){var r=-1,o=t==null?0:t.length,a=Array(o);while(++r<o)a[r]=e(t[r],r,t);return a}var qt=fo;var io=Array.isArray,H=io;var no=1/0,Lt=Pe?Pe.prototype:void 0,jt=Lt?Lt.toString:void 0;function Mt(t){if(typeof t=="string")return t;if(H(t))return qt(t,Mt)+"";if(ct(t))return jt?jt.call(t):"";var e=t+"";return e=="0"&&1/t==-no?"-0":e}var Nt=Mt;function so(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var me=so;function po(t){return t}var at=po;var uo="[object AsyncFunction]",mo="[object Function]",lo="[object GeneratorFunction]",xo="[object Proxy]";function ho(t){if(!me(t))return!1;var e=Qe(t);return e==mo||e==lo||e==uo||e==xo}var Vt=ho;var co=be["__core-js_shared__"],k=co;var Dt=function(){var t=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function go(t){return!!Dt&&Dt in t}var Rt=go;var yo=Function.prototype,_o=yo.toString;function bo(t){if(t!=null){try{return _o.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var _=bo;var vo=/[\\^$.*+?()[\]{}|]/g,Oo=/^\[object .+?Constructor\]$/,Ao=Function.prototype,To=Object.prototype,wo=Ao.toString,So=To.hasOwnProperty,Po=RegExp("^"+wo.call(So).replace(vo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Co(t){if(!me(t)||Rt(t))return!1;var e=Vt(t)?Po:Oo;return e.test(_(t))}var Ft=Co;function Eo(t,e){return t==null?void 0:t[e]}var Bt=Eo;function Io(t,e){var r=Bt(t,e);return Ft(r)?r:void 0}var h=Io;var Lo=h(be,"WeakMap"),Y=Lo;function jo(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ut=jo;function Mo(){}var zt=Mo;var No=800,Do=16,Ro=Date.now;function Fo(t){var e=0,r=0;return function(){var o=Ro(),a=Do-(o-r);if(r=o,a>0){if(++e>=No)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Kt=Fo;function Bo(t){return function(){return t}}var it=Bo;var Go=function(){try{var t=h(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),cr=Go;var Uo=!cr?at:function(t,e){return cr(t,"toString",{configurable:!0,enumerable:!1,value:it(e),writable:!0})},Xt=Uo;var zo=Kt(Xt),ua=zo;function Wo(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t)===!1)break;return t}var da=Wo;function Ko(t,e,r,o){var a=t.length,i=r+(o?1:-1);while(o?i--:++i<a)if(e(t[i],i,t))return i;return-1}var pa=Ko;function Ho(t){return t!==t}var Zt=Ho;function qo(t,e,r){var o=r-1,a=t.length;while(++o<a)if(t[o]===e)return o;return-1}var Jt=qo;function $o(t,e,r){return e===e?Jt(t,e,r):pa(t,Zt,r)}var Qt=$o;function ko(t,e){var r=t==null?0:t.length;return!!r&&Qt(t,e,0)>-1}var te=ko;var Yo=9007199254740991,Xo=/^(?:0|[1-9]\d*)$/;function Zo(t,e){var r=typeof t;return e=e==null?Yo:e,!!e&&(r=="number"||r!="symbol"&&Xo.test(t))&&(t>-1&&t%1==0&&t<e)}var yn=Zo;function Jo(t,e){return t===e||t!==t&&e!==e}var wt=Jo;var ee=Math.max;function Qo(t,e,r){return e=ee(e===void 0?t.length-1:e,0),function(){var o=arguments,a=-1,i=ee(o.length-e,0),n=Array(i);while(++a<i)n[a]=o[e+a];a=-1;var s=Array(e+1);while(++a<e)s[a]=o[a];return s[e]=r(n),Ut(t,this,s)}}var ma=Qo;function Vo(t,e){return ua(ma(t,e,at),t+"")}var vn=Vo;var ta=9007199254740991;function ea(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ta}var j=ea;function ra(t){return t!=null&&j(t.length)&&!Vt(t)}var Oe=ra;var oa=Object.prototype;function aa(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||oa;return t===r}var bn=aa;function ia(t,e){var r=-1,o=Array(t);while(++r<t)o[r]=e(r);return o}var re=ia;var na="[object Arguments]";function sa(t){return Te(t)&&Qe(t)==na}var gt=sa;var oe=Object.prototype,{hasOwnProperty:la,propertyIsEnumerable:ca}=oe,Oa=gt(function(){return arguments}())?gt:function(t){return Te(t)&&la.call(t,"callee")&&!ca.call(t,"callee")},$t=Oa;function Aa(){return!1}var ae=Aa;var ne=typeof Z=="object"&&Z&&!Z.nodeType&&Z,fe=ne&&typeof X=="object"&&X&&!X.nodeType&&X,Ta=fe&&fe.exports===ne,ie=Ta?be.Buffer:void 0,Sa=ie?ie.isBuffer:void 0,Pa=Sa||ae,kt=Pa;var Ca="[object Arguments]",Ea="[object Array]",Ia="[object Boolean]",La="[object Date]",ja="[object Error]",Ma="[object Function]",Na="[object Map]",Da="[object Number]",Ra="[object Object]",Fa="[object RegExp]",Ba="[object Set]",Ga="[object String]",Ua="[object WeakMap]",za="[object ArrayBuffer]",Wa="[object DataView]",Ka="[object Float32Array]",Ha="[object Float64Array]",qa="[object Int8Array]",$a="[object Int16Array]",ka="[object Int32Array]",Ya="[object Uint8Array]",Xa="[object Uint8ClampedArray]",Za="[object Uint16Array]",Ja="[object Uint32Array]",m={};m[Ka]=m[Ha]=m[qa]=m[$a]=m[ka]=m[Ya]=m[Xa]=m[Za]=m[Ja]=!0;m[Ca]=m[Ea]=m[za]=m[Ia]=m[Wa]=m[La]=m[ja]=m[Ma]=m[Na]=m[Da]=m[Ra]=m[Fa]=m[Ba]=m[Ga]=m[Ua]=!1;function Qa(t){return Te(t)&&j(t.length)&&!!m[Qe(t)]}var se=Qa;function Va(t){return function(e){return t(e)}}var xn=Va;var pe=typeof V=="object"&&V&&!V.nodeType&&V,U=pe&&typeof J=="object"&&J&&!J.nodeType&&J,tf=U&&U.exports===pe,yt=tf&&q.process,ef=function(){try{var t=U&&U.require&&U.require("util").types;if(t)return t;return yt&&yt.binding&&yt.binding("util")}catch(e){}}(),Gt=ef;var ue=Gt&&Gt.isTypedArray,rf=ue?xn(ue):se,_n=rf;var of=Object.prototype,af=of.hasOwnProperty;function ff(t,e){var r=H(t),o=!r&&$t(t),a=!r&&!o&&kt(t),i=!r&&!o&&!a&&_n(t),n=r||o||a||i,s=n?re(t.length,String):[],p=s.length;for(var u in t)if((e||af.call(t,u))&&!(n&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yn(u,p))))s.push(u);return s}var fa=ff;function nf(t,e){return function(r){return t(e(r))}}var ha=nf;var sf=ha(Object.keys,Object),le=sf;var pf=Object.prototype,uf=pf.hasOwnProperty;function mf(t){if(!bn(t))return le(t);var e=[];for(var r in Object(t))if(uf.call(t,r)&&r!="constructor")e.push(r);return e}var ur=mf;function lf(t){return Oe(t)?fa(t):ur(t)}var xe=lf;var df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/;function hf(t,e){if(H(t))return!1;var r=typeof t;if(r=="number"||r=="symbol"||r=="boolean"||t==null||ct(t))return!0;return xf.test(t)||!df.test(t)||e!=null&&t in Object(e)}var M=hf;var cf=h(Object,"create"),b=cf;function gf(){this.__data__=b?b(null):{},this.size=0}var de=gf;function yf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var he=yf;var _f="__lodash_hash_undefined__",bf=Object.prototype,vf=bf.hasOwnProperty;function Of(t){var e=this.__data__;if(b){var r=e[t];return r===_f?void 0:r}return vf.call(e,t)?e[t]:void 0}var ce=Of;var Af=Object.prototype,Tf=Af.hasOwnProperty;function wf(t){var e=this.__data__;return b?e[t]!==void 0:Tf.call(e,t)}var ge=wf;var Sf="__lodash_hash_undefined__";function Pf(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Sf:e,this}var ye=Pf;function N(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=de;N.prototype.delete=he;N.prototype.get=ce;N.prototype.has=ge;N.prototype.set=ye;var _t=N;function Cf(){this.__data__=[],this.size=0}var ve=Cf;function Ef(t,e){var r=t.length;while(r--)if(wt(t[r][0],e))return r;return-1}var O=Ef;var If=Array.prototype,Lf=If.splice;function jf(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;if(r==o)e.pop();else Lf.call(e,r,1);return--this.size,!0}var Ae=jf;function Mf(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var we=Mf;function Nf(t){return O(this.__data__,t)>-1}var Se=Nf;function Df(t,e){var r=this.__data__,o=O(r,t);if(o<0)++this.size,r.push([t,e]);else r[o][1]=e;return this}var Ce=Df;function D(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=ve;D.prototype.delete=Ae;D.prototype.get=we;D.prototype.has=Se;D.prototype.set=Ce;var A=D;var Rf=h(be,"Map"),T=Rf;function Ff(){this.size=0,this.__data__={hash:new _t,map:new(T||A),string:new _t}}var Ee=Ff;function Bf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ie=Bf;function Gf(t,e){var r=t.__data__;return Ie(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Gf;function Uf(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var Le=Uf;function zf(t){return w(this,t).get(t)}var je=zf;function Wf(t){return w(this,t).has(t)}var Me=Wf;function Kf(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var Ne=Kf;function R(t){var e=-1,r=t==null?0:t.length;this.clear();while(++e<r){var o=t[e];this.set(o[0],o[1])}}R.prototype.clear=Ee;R.prototype.delete=Le;R.prototype.get=je;R.prototype.has=Me;R.prototype.set=Ne;var E=R;var Hf="Expected a function";function bt(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw TypeError(Hf);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],i=r.cache;if(i.has(a))return i.get(a);var n=t.apply(this,o);return r.cache=i.set(a,n)||i,n};return r.cache=new(bt.Cache||E),r}bt.Cache=E;var De=bt;var qf=500;function $f(t){var e=De(t,function(o){if(r.size===qf)r.clear();return o}),r=e.cache;return e}var Re=$f;var kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yf=/\\(\\)?/g,Xf=Re(function(t){var e=[];if(t.charCodeAt(0)===46)e.push("");return t.replace(kf,function(r,o,a,i){e.push(a?i.replace(Yf,"$1"):o||r)}),e}),Fe=Xf;function Zf(t){return t==null?"":Nt(t)}var ga=Zf;function Jf(t,e){if(H(t))return t;return M(t,e)?[t]:Fe(ga(t))}var wn=Jf;var Qf=1/0;function Vf(t){if(typeof t=="string"||ct(t))return t;var e=t+"";return e=="0"&&1/t==-Qf?"-0":e}var Wt=Vf;function ti(t,e){e=wn(e,t);var r=0,o=e.length;while(t!=null&&r<o)t=t[Wt(e[r++])];return r&&r==o?t:void 0}var kn=ti;function ei(t,e,r){var o=t==null?void 0:kn(t,e);return o===void 0?r:o}var Be=ei;function ri(t,e){var r=-1,o=e.length,a=t.length;while(++r<o)t[a+r]=e[r];return t}var dr=ri;var Ge=Pe?Pe.isConcatSpreadable:void 0;function oi(t){return H(t)||$t(t)||!!(Ge&&t&&t[Ge])}var Ue=oi;function ze(t,e,r,o,a){var i=-1,n=t.length;r||(r=Ue),a||(a=[]);while(++i<n){var s=t[i];if(e>0&&r(s))if(e>1)ze(s,e-1,r,o,a);else dr(a,s);else if(!o)a[a.length]=s}return a}var pr=ze;function ai(t,e,r,o){var a=-1,i=t==null?0:t.length;if(o&&i)r=t[++a];while(++a<i)r=e(r,t[a],a,t);return r}var Ke=ai;function fi(){this.__data__=new A,this.size=0}var He=fi;function ii(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var qe=ii;function ni(t){return this.__data__.get(t)}var $e=ni;function si(t){return this.__data__.has(t)}var ke=si;var pi=200;function ui(t,e){var r=this.__data__;if(r instanceof A){var o=r.__data__;if(!T||o.length<pi-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new E(o)}return r.set(t,e),this.size=r.size,this}var Ye=ui;function F(t){var e=this.__data__=new A(t);this.size=e.size}F.prototype.clear=He;F.prototype.delete=qe;F.prototype.get=$e;F.prototype.has=ke;F.prototype.set=Ye;var Ht=F;function mi(t,e){var r=-1,o=t==null?0:t.length,a=0,i=[];while(++r<o){var n=t[r];if(e(n,r,t))i[a++]=n}return i}var tt=mi;function li(){return[]}var ya=li;var di=Object.prototype,xi=di.propertyIsEnumerable,Xe=Object.getOwnPropertySymbols,hi=!Xe?ya:function(t){if(t==null)return[];return t=Object(t),tt(Xe(t),function(e){return xi.call(t,e)})},mr=hi;function ci(t,e,r){var o=e(t);return H(t)?o:dr(o,r(t))}var va=ci;function gi(t){return va(t,xe,mr)}var zr=gi;var yi=h(be,"DataView"),et=yi;var _i=h(be,"Promise"),rt=_i;var bi=h(be,"Set"),S=bi;var Ze="[object Map]",vi="[object Object]",Ve="[object Promise]",tr="[object Set]",er="[object WeakMap]",rr="[object DataView]",Oi=_(et),Ai=_(T),Ti=_(rt),wi=_(S),Si=_(Y),I=Qe;if(et&&I(new et(new ArrayBuffer(1)))!=rr||T&&I(new T)!=Ze||rt&&I(rt.resolve())!=Ve||S&&I(new S)!=tr||Y&&I(new Y)!=er)I=function(t){var e=Qe(t),r=e==vi?t.constructor:void 0,o=r?_(r):"";if(o)switch(o){case Oi:return rr;case Ai:return Ze;case Ti:return Ve;case wi:return tr;case Si:return er}return e};var ut=I;var Pi=be.Uint8Array,fr=Pi;var Ci="__lodash_hash_undefined__";function Ei(t){return this.__data__.set(t,Ci),this}var or=Ei;function Ii(t){return this.__data__.has(t)}var ar=Ii;function ot(t){var e=-1,r=t==null?0:t.length;this.__data__=new E;while(++e<r)this.add(t[e])}ot.prototype.add=ot.prototype.push=or;ot.prototype.has=ar;var ft=ot;function Li(t,e){var r=-1,o=t==null?0:t.length;while(++r<o)if(e(t[r],r,t))return!0;return!1}var ir=Li;function ji(t,e){return t.has(e)}var nt=ji;var Mi=1,Ni=2;function Di(t,e,r,o,a,i){var n=r&Mi,s=t.length,p=e.length;if(s!=p&&!(n&&p>s))return!1;var u=i.get(t),x=i.get(e);if(u&&x)return u==e&&x==t;var d=-1,l=!0,y=r&Ni?new ft:void 0;i.set(t,e),i.set(e,t);while(++d<s){var c=t[d],g=e[d];if(o)var v=n?o(g,c,d,e,t,i):o(c,g,d,t,e,i);if(v!==void 0){if(v)continue;l=!1;break}if(y){if(!ir(e,function(P,C){if(!nt(y,C)&&(c===P||a(c,P,r,o,i)))return y.push(C)})){l=!1;break}}else if(!(c===g||a(c,g,r,o,i))){l=!1;break}}return i.delete(t),i.delete(e),l}var st=Di;function Ri(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}var nr=Ri;function Fi(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}var B=Fi;var Bi=1,Gi=2,Ui="[object Boolean]",zi="[object Date]",Wi="[object Error]",Ki="[object Map]",Hi="[object Number]",qi="[object RegExp]",$i="[object Set]",ki="[object String]",Yi="[object Symbol]",Xi="[object ArrayBuffer]",Zi="[object DataView]",sr=Pe?Pe.prototype:void 0,vt=sr?sr.valueOf:void 0;function Ji(t,e,r,o,a,i,n){switch(r){case Zi:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xi:if(t.byteLength!=e.byteLength||!i(new fr(t),new fr(e)))return!1;return!0;case Ui:case zi:case Hi:return wt(+t,+e);case Wi:return t.name==e.name&&t.message==e.message;case qi:case ki:return t==e+"";case Ki:var s=nr;case $i:var p=o&Bi;if(s||(s=B),t.size!=e.size&&!p)return!1;var u=n.get(t);if(u)return u==e;o|=Gi,n.set(t,e);var x=st(s(t),s(e),o,a,i,n);return n.delete(t),x;case Yi:if(vt)return vt.call(t)==vt.call(e)}return!1}var lr=Ji;var Qi=1,Vi=Object.prototype,tn=Vi.hasOwnProperty;function en(t,e,r,o,a,i){var n=r&Qi,s=zr(t),p=s.length,u=zr(e),x=u.length;if(p!=x&&!n)return!1;var d=p;while(d--){var l=s[d];if(!(n?l in e:tn.call(e,l)))return!1}var y=i.get(t),c=i.get(e);if(y&&c)return y==e&&c==t;var g=!0;i.set(t,e),i.set(e,t);var v=n;while(++d<p){l=s[d];var P=t[l],C=e[l];if(o)var St=n?o(C,P,l,e,t,i):o(P,C,l,t,e,i);if(!(St===void 0?P===C||a(P,C,r,o,i):St)){g=!1;break}v||(v=l=="constructor")}if(g&&!v){var W=t.constructor,K=e.constructor;if(W!=K&&(("constructor"in t)&&("constructor"in e))&&!(typeof W=="function"&&W instanceof W&&typeof K=="function"&&K instanceof K))g=!1}return i.delete(t),i.delete(e),g}var xr=en;var rn=1,_r="[object Arguments]",br="[object Array]",pt="[object Object]",on=Object.prototype,vr=on.hasOwnProperty;function an(t,e,r,o,a,i){var n=H(t),s=H(e),p=n?br:ut(t),u=s?br:ut(e);p=p==_r?pt:p,u=u==_r?pt:u;var x=p==pt,d=u==pt,l=p==u;if(l&&kt(t)){if(!kt(e))return!1;n=!0,x=!1}if(l&&!x)return i||(i=new Ht),n||_n(t)?st(t,e,r,o,a,i):lr(t,e,p,r,o,a,i);if(!(r&rn)){var y=x&&vr.call(t,"__wrapped__"),c=d&&vr.call(e,"__wrapped__");if(y||c){var g=y?t.value():t,v=c?e.value():e;return i||(i=new Ht),a(g,v,r,o,i)}}if(!l)return!1;return i||(i=new Ht),xr(t,e,r,o,a,i)}var Or=an;function Ar(t,e,r,o,a){if(t===e)return!0;if(t==null||e==null||!Te(t)&&!Te(e))return t!==t&&e!==e;return Or(t,e,r,o,Ar,a)}var mt=Ar;var fn=1,nn=2;function sn(t,e,r,o){var a=r.length,i=a,n=!o;if(t==null)return!i;t=Object(t);while(a--){var s=r[a];if(n&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}while(++a<i){s=r[a];var p=s[0],u=t[p],x=s[1];if(n&&s[2]){if(u===void 0&&!(p in t))return!1}else{var d=new Ht;if(o)var l=o(u,x,p,t,e,d);if(!(l===void 0?mt(x,u,fn|nn,o,d):l))return!1}}return!0}var Tr=sn;function pn(t){return t===t&&!me(t)}var lt=pn;function un(t){var e=xe(t),r=e.length;while(r--){var o=e[r],a=t[o];e[r]=[o,a,lt(a)]}return e}var wr=un;function mn(t,e){return function(r){if(r==null)return!1;return r[t]===e&&(e!==void 0||(t in Object(r)))}}var xt=mn;function ln(t){var e=wr(t);if(e.length==1&&e[0][2])return xt(e[0][0],e[0][1]);return function(r){return r===t||Tr(r,t,e)}}var Sr=ln;function dn(t,e){return t!=null&&e in Object(t)}var Pr=dn;function hn(t,e,r){e=wn(e,t);var o=-1,a=e.length,i=!1;while(++o<a){var n=Wt(e[o]);if(!(i=t!=null&&r(t,n)))break;t=t[n]}if(i||++o!=a)return i;return a=t==null?0:t.length,!!a&&j(a)&&yn(n,a)&&(H(t)||$t(t))}var ba=hn;function cn(t,e){return t!=null&&ba(t,e,Pr)}var xa=cn;var gn=1,On=2;function An(t,e){if(M(t)&&lt(e))return xt(Wt(t),e);return function(r){var o=Be(r,t);return o===void 0&&o===e?xa(r,t):mt(e,o,gn|On)}}var Cr=An;function Tn(t){return function(e){return e==null?void 0:e[t]}}var _a=Tn;function Sn(t){return function(e){return kn(e,t)}}var Er=Sn;function Pn(t){return M(t)?_a(Wt(t)):Er(t)}var Ir=Pn;function En(t){if(typeof t=="function")return t;if(t==null)return at;if(typeof t=="object")return H(t)?Cr(t[0],t[1]):Sr(t);return Ir(t)}var We=En;function In(t){return function(e,r,o){var a=-1,i=Object(e),n=o(e),s=n.length;while(s--){var p=n[t?s:++a];if(r(i[p],p,i)===!1)break}return e}}var Lr=In;var Ln=Lr(),hr=Ln;function jn(t,e){return t&&hr(t,e,xe)}var gr=jn;function Mn(t,e){return function(r,o){if(r==null)return r;if(!Oe(r))return t(r,o);var a=r.length,i=e?a:-1,n=Object(r);while(e?i--:++i<a)if(o(n[i],i,n)===!1)break;return r}}var jr=Mn;var Nn=jr(gr),Cn=Nn;function Dn(t){return Te(t)&&Oe(t)}var wa=Dn;function Rn(t,e,r){var o=-1,a=t==null?0:t.length;while(++o<a)if(r(e,t[o]))return!0;return!1}var Mr=Rn;function Fn(t){return typeof t=="function"?t:at}var yr=Fn;function Bn(t,e){var r=H(t)?da:Cn;return r(t,yr(e))}var f=Bn;function Gn(t,e){var r=[];return Cn(t,function(o,a,i){if(e(o,a,i))r.push(o)}),r}var Nr=Gn;function Un(t,e){var r=H(t)?tt:Nr;return r(t,We(e,3))}var Je=Un;function zn(t,e){return qt(e,function(r){return t[r]})}var Dr=zn;function Wn(t){return t==null?[]:Dr(t,xe(t))}var dt=Wn;var Kn="[object Map]",Hn="[object Set]",qn=Object.prototype,$n=qn.hasOwnProperty;function Yn(t){if(t==null)return!0;if(Oe(t)&&(H(t)||typeof t=="string"||typeof t.splice=="function"||kt(t)||_n(t)||$t(t)))return!t.length;var e=ut(t);if(e==Kn||e==Hn)return!t.size;if(bn(t))return!ur(t).length;for(var r in t)if($n.call(t,r))return!1;return!0}var ht=Yn;function Xn(t){return t===void 0}var _e=Xn;function Zn(t,e,r,o,a){return a(t,function(i,n,s){r=o?(o=!1,i):e(r,i,n,s)}),r}var Rr=Zn;function Jn(t,e,r){var o=H(t)?Ke:Rr,a=arguments.length<3;return o(t,We(e,4),r,a,Cn)}var Yt=Jn;var Qn=1/0,Vn=!(S&&1/B(new S([,-0]))[1]==Qn)?zt:function(t){return new S(t)},Fr=Vn;var ts=200;function es(t,e,r){var o=-1,a=te,i=t.length,n=!0,s=[],p=s;if(r)n=!1,a=Mr;else if(i>=ts){var u=e?null:Fr(t);if(u)return B(u);n=!1,a=nt,p=new ft}else p=e?[]:s;t:while(++o<i){var x=t[o],d=e?e(x):x;if(x=r||x!==0?x:0,n&&d===d){var l=p.length;while(l--)if(p[l]===d)continue t;if(e)p.push(d);s.push(x)}else if(!a(p,d,r)){if(p!==s)p.push(d);s.push(x)}}return s}var Br=es;var rs=vn(function(t){return Br(pr(t,1,wa,!0))}),Ot=rs;var as="\x00",L="\x00",Gr="\x01";class Q{constructor(t={}){if(this._isDirected=Object.prototype.hasOwnProperty.call(t,"directed")?t.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=it(void 0),this._defaultEdgeLabelFn=it(void 0),this._nodes={},this._isCompound)this._parent={},this._children={},this._children[L]={};this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){if(!Vt(t))t=it(t);return this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return xe(this._nodes)}sources(){var t=this;return Je(this.nodes(),function(e){return ht(t._in[e])})}sinks(){var t=this;return Je(this.nodes(),function(e){return ht(t._out[e])})}setNodes(t,e){var r=arguments,o=this;return f(t,function(a){if(r.length>1)o.setNode(a,e);else o.setNode(a)}),this}setNode(t,e){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){if(arguments.length>1)this._nodes[t]=e;return this}if(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound)this._parent[t]=L,this._children[t]={},this._children[L][t]=!0;return this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this}node(t){return this._nodes[t]}hasNode(t){return Object.prototype.hasOwnProperty.call(this._nodes,t)}removeNode(t){if(Object.prototype.hasOwnProperty.call(this._nodes,t)){var e=(r)=>this.removeEdge(this._edgeObjs[r]);if(delete this._nodes[t],this._isCompound)this._removeFromParentsChildList(t),delete this._parent[t],f(this.children(t),(r)=>{this.setParent(r)}),delete this._children[t];f(xe(this._in[t]),e),delete this._in[t],delete this._preds[t],f(xe(this._out[t]),e),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,e){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(_e(e))e=L;else{e+="";for(var r=e;!_e(r);r=this.parent(r))if(r===t)throw Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var e=this._parent[t];if(e!==L)return e}}children(t){if(_e(t))t=L;if(this._isCompound){var e=this._children[t];if(e)return xe(e)}else if(t===L)return this.nodes();else if(this.hasNode(t))return[]}predecessors(t){var e=this._preds[t];if(e)return xe(e)}successors(t){var e=this._sucs[t];if(e)return xe(e)}neighbors(t){var e=this.predecessors(t);if(e)return Ot(e,this.successors(t))}isLeaf(t){var e;if(this.isDirected())e=this.successors(t);else e=this.neighbors(t);return e.length===0}filterNodes(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;f(this._nodes,function(i,n){if(t(n))e.setNode(n,i)}),f(this._edgeObjs,function(i){if(e.hasNode(i.v)&&e.hasNode(i.w))e.setEdge(i,r.edge(i))});var o={};function a(i){var n=r.parent(i);if(n===void 0||e.hasNode(n))return o[i]=n,n;else if(n in o)return o[n];else return a(n)}if(this._isCompound)f(e.nodes(),function(i){e.setParent(i,a(i))});return e}setDefaultEdgeLabel(t){if(!Vt(t))t=it(t);return this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return dt(this._edgeObjs)}setPath(t,e){var r=this,o=arguments;return Yt(t,function(a,i){if(o.length>1)r.setEdge(a,i,e);else r.setEdge(a,i);return i}),this}setEdge(){var t,e,r,o,a=!1,i=arguments[0];if(typeof i==="object"&&i!==null&&"v"in i){if(t=i.v,e=i.w,r=i.name,arguments.length===2)o=arguments[1],a=!0}else if(t=i,e=arguments[1],r=arguments[3],arguments.length>2)o=arguments[2],a=!0;if(t=""+t,e=""+e,!_e(r))r=""+r;var n=z(this._isDirected,t,e,r);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,n)){if(a)this._edgeLabels[n]=o;return this}if(!_e(r)&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[n]=a?o:this._defaultEdgeLabelFn(t,e,r);var s=fs(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[n]=s,Ur(this._preds[e],t),Ur(this._sucs[t],e),this._in[e][n]=s,this._out[t][n]=s,this._edgeCount++,this}edge(t,e,r){var o=arguments.length===1?Tt(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return this._edgeLabels[o]}hasEdge(t,e,r){var o=arguments.length===1?Tt(this._isDirected,arguments[0]):z(this._isDirected,t,e,r);return Object.prototype.hasOwnProperty.call(this._edgeLabels,o)}removeEdge(t,e,r){var o=arguments.length===1?Tt(this._isDirected,arguments[0]):z(this._isDirected,t,e,r),a=this._edgeObjs[o];if(a)t=a.v,e=a.w,delete this._edgeLabels[o],delete this._edgeObjs[o],Wr(this._preds[e],t),Wr(this._sucs[t],e),delete this._in[e][o],delete this._out[t][o],this._edgeCount--;return this}inEdges(t,e){var r=this._in[t];if(r){var o=dt(r);if(!e)return o;return Je(o,function(a){return a.v===e})}}outEdges(t,e){var r=this._out[t];if(r){var o=dt(r);if(!e)return o;return Je(o,function(a){return a.w===e})}}nodeEdges(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))}}Q.prototype._nodeCount=0;Q.prototype._edgeCount=0;function Ur(t,e){if(t[e])t[e]++;else t[e]=1}function Wr(t,e){if(!--t[e])delete t[e]}function z(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}return a+Gr+i+Gr+(_e(o)?as:o)}function fs(t,e,r,o){var a=""+e,i=""+r;if(!t&&a>i){var n=a;a=i,i=n}var s={v:a,w:i};if(o)s.name=o;return s}function Tt(t,e){return z(t,e.v,e.w,e.name)}
2
+ export{be,Pe,Qe,Te,ct,qt,H,me,at,Vt,it,cr,ua,da,pa,yn,wt,ma,vn,Oe,bn,$t,kt,xn,Gt,_n,fa,ha,ur,xe,ga,wn,Wt,kn,dr,pr,Ht,ya,mr,va,zr,ut,fr,ba,xa,_a,We,hr,gr,Cn,wa,yr,f,Je,dt,_e,Yt,Q};
@@ -1,4 +1,4 @@
1
- import{z,o,g,i,a,v,t,n,_,V,li,bo,Hi,Mr,tr,xo,Yi,_o,Jr,ea,Pn,ci,ui}from"./chunk-vt40e1kp.js";var M={sealed:"已封存",folded:"已折叠",archived:"已移出"},T=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function P(e,d){if(e.startsWith("recent-"))return"json";let c=d.trimStart();if(!c)return"markdown";if(c.startsWith("{")||c.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(c))return"xml";return"markdown"}function W(e){if(!e||e.length>32000)return e;if(!e.trimStart().startsWith("<"))return e;let c=[],m=0,s=(p)=>" ".repeat(p),l=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g,u;while((u=l.exec(e))!==null){let[,p,,,f,r,x,y]=u;if(p)c.push(`${s(m)}${p.trim()}`);else if(f)m=Math.max(0,m-1),c.push(`${s(m)}${f.trim()}`);else if(x)c.push(`${s(m)}${x.trim()}`),m++;else if(r)c.push(`${s(m)}${r.trim()}`);else if(y){let h=y.trim();if(h)for(let w of h.split(/\r?\n/)){let E=w.trim();if(E)c.push(`${s(m)}${E}`)}}}return c.length>0?c.join(`
2
- `):e}function R(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function k(e){let{style:d}=_();return t("p",{className:d("surface.empty"),children:e.children})}function B(e){let{cn:d}=_();if(!e.items.length)return t(k,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let c=e.items.reduce((m,s)=>m+s.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[t("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:e.items.map((m,s)=>t("span",{className:d(T[s%T.length],"transition-[width] duration-300 ease-out-quint"),title:`${m.label}:${m.tokens.toLocaleString()} token`,style:{width:`${m.tokens/c*100}%`}},m.id))}),t("div",{className:"space-y-1.5",children:e.items.map((m,s)=>t(Z,{item:m,total:c,index:s,color:T[s%T.length]??"bg-accent"},m.id))})]})}function Z(e){let{cn:d,Chevron:c,CopyButton:m,Code:s,style:l,useTheme:u}=_();u();let[p,f]=a(!1),r=(e.item.tokens/e.total*100).toFixed(1),x=g(()=>p&&e.item.detail?tr(e.item.detail):"",[p,e.item.detail]),y=g(()=>x?P(e.item.id,x):"markdown",[x,e.item.id]),h=g(()=>{if(!x)return"";return y==="xml"?W(x):x},[x,y]);return n("div",{"data-state":p?"open":"closed",className:l("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((w)=>!w),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[t("span",{className:d("size-2 shrink-0 rounded-full",e.color),"aria-hidden":!0}),t("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:e.item.label}),e.item.state&&t("span",{className:l("control.badge","text-[10px]"),children:M[e.item.state]}),t("span",{className:"font-mono tabular-nums text-dim",children:e.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[r,"%"]}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[t("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:t("div",{className:d("h-full",e.color),style:{width:`${r}%`}})}),h?n("div",{className:l("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(m,{text:e.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:t(s,{code:h,lang:y,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]}):t("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var I=40,K={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 A(e){let{Button:d,CopyButton:c,style:m,useTheme:s}=_();s();let[l,u]=a(I),p=i(null),f=l<e.entries.length;o(()=>{let x=p.current;if(!x||!f||typeof IntersectionObserver>"u")return;let y=new IntersectionObserver((h)=>{if(h.some((w)=>w.isIntersecting))u((w)=>Math.min(e.entries.length,w+I))},{rootMargin:"480px"});return y.observe(x),()=>y.disconnect()},[f,e.entries.length]);let r=g(()=>e.entries.slice(-l).reverse(),[e.entries,l]);if(!e.entries.length)return t(k,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:m("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",e.entries.length," 条记录"]}),t(c,{text:()=>e.entries.map((x)=>JSON.stringify(x,null,2)).join(`
1
+ import{z,o,g,i,a,v,t,n,_,q,li,bo,Hi,Mr,tr,xo,Yi,_o,Jr,ea,Pn,ci,ui}from"./chunk-aqm3spxt.js";var M={sealed:"已封存",folded:"已折叠",archived:"已移出"},T=["bg-accent","bg-accent-strong","bg-warning","bg-success"];function P(e,d){if(e.startsWith("recent-"))return"json";let c=d.trimStart();if(!c)return"markdown";if(c.startsWith("{")||c.startsWith("["))return"json";if(/^<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>/.test(c))return"xml";return"markdown"}function W(e){if(!e||e.length>32000)return e;if(!e.trimStart().startsWith("<"))return e;let c=[],m=0,s=(p)=>" ".repeat(p),l=/(<([a-zA-Z_][\w.-]*)(?:\s+[^>]*)?>([^\r\n<]*)<\/\2>)|(<\/[a-zA-Z_][\w.-]*>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?\/>)|(<[a-zA-Z_][\w.-]*(?:\s+[^>]*)?>)|([^<]+)/g,u;while((u=l.exec(e))!==null){let[,p,,,f,r,x,y]=u;if(p)c.push(`${s(m)}${p.trim()}`);else if(f)m=Math.max(0,m-1),c.push(`${s(m)}${f.trim()}`);else if(x)c.push(`${s(m)}${x.trim()}`),m++;else if(r)c.push(`${s(m)}${r.trim()}`);else if(y){let h=y.trim();if(h)for(let w of h.split(/\r?\n/)){let E=w.trim();if(E)c.push(`${s(m)}${E}`)}}}return c.length>0?c.join(`
2
+ `):e}function R(){return n("div",{role:"status","aria-busy":"true","aria-label":"正在加载上下文",className:"space-y-2 animate-pulse",children:[t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"}),t("div",{className:"h-10 rounded-xl border border-line bg-panel/40"})]})}function k(e){let{style:d}=_();return t("p",{className:d("surface.empty"),children:e.children})}function B(e){let{cn:d}=_();if(!e.items.length)return t(k,{children:"新会话还没有上下文。发送第一条消息后,这里会显示构成。"});let c=e.items.reduce((m,s)=>m+s.tokens,0)||1;return n("div",{className:"space-y-2.5",children:[t("div",{className:"flex h-2 overflow-hidden rounded-full bg-raised",children:e.items.map((m,s)=>t("span",{className:d(T[s%T.length],"transition-[width] duration-300 ease-out-quint"),title:`${m.label}:${m.tokens.toLocaleString()} token`,style:{width:`${m.tokens/c*100}%`}},m.id))}),t("div",{className:"space-y-1.5",children:e.items.map((m,s)=>t(K,{item:m,total:c,index:s,color:T[s%T.length]??"bg-accent"},m.id))})]})}function K(e){let{cn:d,Chevron:c,CopyButton:m,Code:s,style:l,useTheme:u}=_();u();let[p,f]=a(!1),r=(e.item.tokens/e.total*100).toFixed(1),x=g(()=>p&&e.item.detail?tr(e.item.detail):"",[p,e.item.detail]),y=g(()=>x?P(e.item.id,x):"markdown",[x,e.item.id]),h=g(()=>{if(!x)return"";return y==="xml"?W(x):x},[x,y]);return n("div",{"data-state":p?"open":"closed",className:l("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":p,onClick:()=>f((w)=>!w),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[t("span",{className:d("size-2 shrink-0 rounded-full",e.color),"aria-hidden":!0}),t("span",{className:"min-w-0 flex-1 truncate font-medium text-ink",children:e.item.label}),e.item.state&&t("span",{className:l("control.badge","text-[10px]"),children:M[e.item.state]}),t("span",{className:"font-mono tabular-nums text-dim",children:e.item.tokens.toLocaleString()}),n("span",{className:"w-10 text-right font-mono text-[11px] tabular-nums text-faint",children:[r,"%"]}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),p&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[t("div",{className:"mb-2 h-1 overflow-hidden rounded-full bg-raised",children:t("div",{className:d("h-full",e.color),style:{width:`${r}%`}})}),h?n("div",{className:l("surface.subtle","group/detail relative overflow-hidden rounded-lg bg-panel/70 p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(m,{text:e.item.detail,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-80 overflow-y-auto pr-6 text-dim",children:t(s,{code:h,lang:y,className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]}):t("p",{className:"py-2 text-center text-xs text-faint",children:"(空)"})]})]})}var I=40,H={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 A(e){let{Button:d,CopyButton:c,style:m,useTheme:s}=_();s();let[l,u]=a(I),p=i(null),f=l<e.entries.length;o(()=>{let x=p.current;if(!x||!f||typeof IntersectionObserver>"u")return;let y=new IntersectionObserver((h)=>{if(h.some((w)=>w.isIntersecting))u((w)=>Math.min(e.entries.length,w+I))},{rootMargin:"480px"});return y.observe(x),()=>y.disconnect()},[f,e.entries.length]);let r=g(()=>e.entries.slice(-l).reverse(),[e.entries,l]);if(!e.entries.length)return t(k,{children:"还没有消息。"});return n("div",{className:"space-y-1.5",children:[n("div",{className:m("surface.subtle","flex items-center justify-between px-3 py-1.5 text-xs text-faint"),children:[n("span",{children:["共 ",e.entries.length," 条记录"]}),t(c,{text:()=>e.entries.map((x)=>JSON.stringify(x,null,2)).join(`
3
3
 
4
- `),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),r.map((x)=>t(H,{entry:x},x.seq)),f&&n("div",{ref:p,className:m("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",r.length," / ",e.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[t(d,{size:"sm",variant:"ghost",onClick:()=>u((x)=>Math.min(e.entries.length,x+I)),children:"加载更多"}),t(d,{size:"sm",variant:"ghost",onClick:()=>u(e.entries.length),children:"显示全部"})]})]})]})}var H=z(function(d){let{Chevron:c,CopyButton:m,style:s,useTheme:l}=_();l();let[u,p]=a(!1),f=xo(d.entry),r=g(()=>bo(d.entry.time),[d.entry.time]);return n("div",{"data-state":u?"open":"closed",className:s("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((x)=>!x),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[n("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:["#",d.entry.seq]}),t("span",{className:s("control.badge","shrink-0 font-medium text-[10px]",K[f.tone]),children:f.badge}),t("span",{className:"min-w-0 flex-1 truncate text-ink",children:f.title}),f.meta&&t("span",{className:s("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:f.meta}),t("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:r}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&t("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2.5 text-xs text-dim",children:n("div",{className:"space-y-2",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[n("span",{className:"font-mono",children:[d.entry.type," · #",d.entry.seq]}),t(m,{text:()=>JSON.stringify(d.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),t(X,{entry:d.entry})]})})]})});function X(e){let{Code:d,style:c,useTheme:m}=_();m();let s=e.entry;if(s.type==="user")return n("div",{className:"space-y-2",children:[s.text&&t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:Mr(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,")"]}),t("div",{className:"flex flex-wrap gap-1.5",children:s.attachments.map((l,u)=>{let p=l.kind==="image"?Math.floor(l.data.length*0.75):l.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[t("span",{className:c("control.badge","text-[10px] text-faint"),children:l.kind==="image"?"图片":l.kind==="path"?"路径":"文本"}),t("span",{className:"max-w-40 truncate font-medium text-ink",children:l.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[l.mimeType," · ",Hi(p)]})]},`${l.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((l)=>n("div",{className:c("surface.subtle","flex items-center justify-between px-2.5 py-1.5 font-mono text-[11px]"),children:[n("span",{className:"truncate text-ink",children:[l.sourceKind,"/",l.sourceID]}),t("span",{className:"text-faint",children:l.state})]},l.dedupeKey))]})]});if(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&&t("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((l,u)=>{if(l.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs italic leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Mr(l.text)})]},`thinking-${u}`);if(l.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Mr(l.text)})]},`text-${u}`);return n("div",{className:c("surface.subtle","p-2.5 space-y-1.5"),children:[n("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[n("span",{className:"font-mono font-medium text-ink",children:["工具调用 · ",l.name]}),t("span",{className:"truncate font-mono text-[10px] text-faint",children:l.id})]}),t("div",{className:"max-h-60 overflow-y-auto text-dim",children:t(d,{code:tr(JSON.stringify(l.input,Yi,2)),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]},l.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:[t("span",{className:"text-ink",children:s.name}),t("span",{children:"·"}),t("span",{className:"truncate",children:s.callID}),t("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&&t("div",{className:"flex flex-wrap gap-1.5",children:s.images.map((l,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",l.mimeType," · ",Hi(Math.floor(l.data.length*0.75))]},`${l.mimeType}-${u}`))}),li(s.output)?t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words [overflow-wrap:anywhere]",s.isError?"text-danger":"text-dim"),children:Mr(s.output)}):t("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:_o(s)})}function L(e){let{cn:d,style:c,useTheme:m}=_();if(m(),!e.todos.length)return t(k,{children:"暂无待办。"});return t("ul",{className:"space-y-1.5",children:e.todos.map((s)=>n("li",{className:c("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:d("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border transition-colors duration-300",s.status==="completed"&&"border-success bg-success text-panel",s.status==="in_progress"&&"border-accent",s.status==="pending"&&"border-line-strong"),children:[s.status==="completed"&&t(V,{className:"size-2.5 animate-pop",strokeWidth:3.5}),s.status==="in_progress"&&t("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),t("span",{className:d("min-w-0 flex-1 break-words leading-relaxed [overflow-wrap:anywhere]",s.status==="completed"&&"text-faint line-through decoration-faint/60",s.status==="in_progress"&&"font-medium text-ink",s.status==="pending"&&"text-dim"),children:s.content})]},`${s.status}-${s.content}`))})}function O(e){let{cn:d,style:c,useTheme:m}=_();m();let[s,l]=a("all"),u=g(()=>e.tools.filter((r)=>r.deferred).length,[e.tools]),p=e.tools.length-u,f=g(()=>{if(s==="deferred")return e.tools.filter((r)=>r.deferred);if(s==="active")return e.tools.filter((r)=>!r.deferred);return e.tools},[e.tools,s]);if(!e.tools.length)return t(k,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[u>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>l("all"),className:d("rounded-lg px-2 py-1 transition-colors",s==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",e.tools.length,")"]}),n("button",{type:"button",onClick:()=>l("active"),className:d("rounded-lg px-2 py-1 transition-colors",s==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",p,")"]}),n("button",{type:"button",onClick:()=>l("deferred"),className:d("rounded-lg px-2 py-1 transition-colors",s==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",u,")"]})]}),t("div",{className:"space-y-1.5",children:f.map((r)=>t(G,{tool:r},`${r.group}-${r.name}`))})]})}function G(e){let{Chevron:d,CopyButton:c,Code:m,style:s,useTheme:l}=_();l();let[u,p]=a(!1),f=g(()=>u?JSON.stringify(e.tool.schema,null,2):"",[u,e.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((r)=>!r),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 truncate font-mono text-ink",children:[t("span",{className:"truncate",children:e.tool.name}),e.tool.group&&t("span",{className:s("control.badge","font-sans text-[10px]"),children:e.tool.group}),e.tool.deferred&&t("span",{className:s("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),t(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[e.tool.deferred&&t("div",{className:s("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),e.tool.description&&t("pre",{className:"mb-2 max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:tr(e.tool.description)}),n("div",{className:s("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(c,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:t(m,{code:tr(f),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]})]})]})}function Q(){try{let e=localStorage.getItem("basalt.contextSidebar.tab");if(e==="tools"||e==="todos"||e==="raw")return e}catch{}return"breakdown"}function Y(e){let{style:d,useTheme:c}=_();return c(),n("div",{className:d("surface.panel","bg-panel/70 px-3 py-2"),children:[t("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:e.label}),t("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:e.value})]})}function Pe(e){let{Button:d,StatusChip:c,Segmented:m,cn:s,style:l,useTheme:u}=_();u();let[p,f]=a(Q),[r,x]=a(()=>Pn.get(e.session.id)),[y,h]=a(!1),[w,E]=a(0),[D,j]=a(!1);o(()=>{let b=setTimeout(()=>j(!0),140);return()=>clearTimeout(b)},[]),o(()=>{let b=Pn.get(e.session.id);if(b)x(b);return ci((C,F)=>{if(C===e.session.id)x(F)})},[e.session.id]),o(()=>{let b=new AbortController;return h(!1),e.connection.request(`/api/sessions/${encodeURIComponent(e.session.id)}/context`,{signal:AbortSignal.any([b.signal,AbortSignal.timeout(15000)])}).then((C)=>{if(!b.signal.aborted)ui(e.session.id,C),x(C)},()=>{if(!b.signal.aborted)h(!0)}),()=>b.abort()},[e.connection,e.session.id,e.session.updated,e.entries.length,w]);let N=Jr(r?.items??[],r?.usableWindow,r?.calibratedTokens,r?.lastInputTokens,r?.hasPendingOutput),S=ea(N.percent),U=(b)=>{f(b);try{localStorage.setItem("basalt.contextSidebar.tab",b)}catch{}},J=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",r&&t("span",{className:"text-[10px] text-faint tabular-nums",children:r.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",e.session.todos.length>0&&t("span",{className:"text-[10px] text-faint tabular-nums",children:e.session.todos.length})]})},{value:"raw",label:"原始消息"}],q=n("div",{className:"border-b border-line px-3.5 py-3",children:[n("div",{className:"flex items-start justify-between gap-3",children:[n("div",{children:[t("div",{className:"text-[10.5px] font-medium uppercase tracking-wider text-faint",children:"上下文用量"}),n("div",{className:"mt-0.5 flex items-baseline gap-1.5",children:[t("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:r?N.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",r?.usableWindow.toLocaleString()??"—"]})]})]}),t(c,{tone:S==="overflow"||S==="near_limit"?"danger":S==="sealing"?"warning":"success",children:S==="overflow"?"预计超限":S==="near_limit"?"接近上限":S==="sealing"?"接近封存":"正常"})]}),N.percent!==null&&t("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,N.percent)}),t("div",{"aria-hidden":!0,className:s("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!r&&"animate-pulse"),children:t("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,N.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[t("span",{className:"text-dim",children:N.percent===null?"暂无窗口数据":`${N.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",r?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),r?.usage&&(r.usage.input>0||r.usage.output>0||r.usage.cacheRead>0||r.usage.cacheWrite>0||r.usage.cost>0)&&t("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",r.usage.input.toLocaleString()],["Output",r.usage.output.toLocaleString()],["Cache",`${r.usage.cacheRead.toLocaleString()} / ${r.usage.cacheWrite.toLocaleString()}`],["平均 TPS",r.usage.tps!==void 0?`${r.usage.tps.toFixed(1)} tok/s`:"—"]].map(([b,C])=>t(Y,{label:b,value:C},b))})]});return n(v,{children:[q,t("div",{className:"border-b border-line px-3 py-2",children:t(m,{value:p,onChange:U,options:J,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[y&&!r&&n("div",{role:"alert",className:"flex items-center justify-between rounded-xl border border-danger/30 bg-danger/8 px-3 py-2 text-xs text-danger",children:[t("span",{children:"上下文加载失败。"}),t(d,{size:"sm",variant:"ghost",onClick:()=>E((b)=>b+1),children:"重试"})]}),t("div",{children:!D?t(R,{}):n(v,{children:[p==="raw"&&t(A,{entries:e.entries}),p==="todos"&&t(L,{todos:e.session.todos}),p==="breakdown"&&(r?t(B,{items:N.items}):!y?t(R,{}):null),p==="tools"&&(r?t(O,{tools:r.tools??[]}):!y?t(R,{}):null)]})},p)]})]})}export{Pe as ContextSidebar};
4
+ `),size:"icon-xs",label:"复制全部原始 JSON",className:"hover:bg-raised text-faint hover:text-ink"})]}),r.map((x)=>t(V,{entry:x},x.seq)),f&&n("div",{ref:p,className:m("surface.subtle","flex items-center justify-between bg-panel/40 px-3 py-2 text-xs text-faint"),children:[n("span",{children:["已显示 ",r.length," / ",e.entries.length," 条"]}),n("div",{className:"flex items-center gap-1.5",children:[t(d,{size:"sm",variant:"ghost",onClick:()=>u((x)=>Math.min(e.entries.length,x+I)),children:"加载更多"}),t(d,{size:"sm",variant:"ghost",onClick:()=>u(e.entries.length),children:"显示全部"})]})]})]})}var V=z(function(d){let{Chevron:c,CopyButton:m,style:s,useTheme:l}=_();l();let[u,p]=a(!1),f=xo(d.entry),r=g(()=>bo(d.entry.time),[d.entry.time]);return n("div",{"data-state":u?"open":"closed",className:s("surface.interactive","group/collapsible"),children:[n("button",{type:"button","aria-expanded":u,onClick:()=>p((x)=>!x),className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs",children:[n("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:["#",d.entry.seq]}),t("span",{className:s("control.badge","shrink-0 font-medium text-[10px]",H[f.tone]),children:f.badge}),t("span",{className:"min-w-0 flex-1 truncate text-ink",children:f.title}),f.meta&&t("span",{className:s("control.badge","shrink-0 font-mono text-[10px] text-faint"),children:f.meta}),t("span",{className:"shrink-0 font-mono text-[10.5px] tabular-nums text-faint",children:r}),t(c,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&t("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2.5 text-xs text-dim",children:n("div",{className:"space-y-2",children:[n("div",{className:"flex items-center justify-between text-[11px] text-faint",children:[n("span",{className:"font-mono",children:[d.entry.type," · #",d.entry.seq]}),t(m,{text:()=>JSON.stringify(d.entry,null,2),size:"icon-xs",label:"复制此条 JSON",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink"})]}),t(X,{entry:d.entry})]})})]})});function X(e){let{Code:d,style:c,useTheme:m}=_();m();let s=e.entry;if(s.type==="user")return n("div",{className:"space-y-2",children:[s.text&&t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:Mr(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,")"]}),t("div",{className:"flex flex-wrap gap-1.5",children:s.attachments.map((l,u)=>{let p=l.kind==="image"?Math.floor(l.data.length*0.75):l.data.length;return n("div",{className:c("surface.subtle","inline-flex items-center gap-1.5 px-2 py-1 text-[11px]"),children:[t("span",{className:c("control.badge","text-[10px] text-faint"),children:l.kind==="image"?"图片":l.kind==="path"?"路径":"文本"}),t("span",{className:"max-w-40 truncate font-medium text-ink",children:l.name}),n("span",{className:"font-mono text-[10px] text-faint",children:[l.mimeType," · ",Hi(p)]})]},`${l.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((l)=>n("div",{className:c("surface.subtle","flex items-center justify-between px-2.5 py-1.5 font-mono text-[11px]"),children:[n("span",{className:"truncate text-ink",children:[l.sourceKind,"/",l.sourceID]}),t("span",{className:"text-faint",children:l.state})]},l.dedupeKey))]})]});if(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&&t("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((l,u)=>{if(l.type==="thinking")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"思考"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs italic leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Mr(l.text)})]},`thinking-${u}`);if(l.type==="text")return n("div",{className:c("surface.subtle","p-2.5 space-y-1"),children:[t("div",{className:"text-[10.5px] font-medium text-faint",children:"回复"}),t("pre",{className:"max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-ink whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:Mr(l.text)})]},`text-${u}`);return n("div",{className:c("surface.subtle","p-2.5 space-y-1.5"),children:[n("div",{className:"flex items-center justify-between gap-2 text-[11px]",children:[n("span",{className:"font-mono font-medium text-ink",children:["工具调用 · ",l.name]}),t("span",{className:"truncate font-mono text-[10px] text-faint",children:l.id})]}),t("div",{className:"max-h-60 overflow-y-auto text-dim",children:t(d,{code:tr(JSON.stringify(l.input,Yi,2)),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]},l.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:[t("span",{className:"text-ink",children:s.name}),t("span",{children:"·"}),t("span",{className:"truncate",children:s.callID}),t("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&&t("div",{className:"flex flex-wrap gap-1.5",children:s.images.map((l,u)=>n("span",{className:c("surface.subtle","px-2 py-1 font-mono text-[10.5px] text-faint"),children:["图片 #",u+1," · ",l.mimeType," · ",Hi(Math.floor(l.data.length*0.75))]},`${l.mimeType}-${u}`))}),li(s.output)?t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed whitespace-pre-wrap break-words [overflow-wrap:anywhere]",s.isError?"text-danger":"text-dim"),children:Mr(s.output)}):t("p",{className:"py-1 text-faint",children:"(无文本输出)"})]});return t("pre",{className:c("surface.subtle","max-h-72 overflow-y-auto p-2.5 font-mono text-[11px] leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]"),children:_o(s)})}function L(e){let{cn:d,style:c,useTheme:m}=_();if(m(),!e.todos.length)return t(k,{children:"暂无待办。"});return t("ul",{className:"space-y-1.5",children:e.todos.map((s)=>n("li",{className:c("surface.interactive","flex items-start gap-2.5 px-3 py-2 text-xs"),children:[n("span",{className:d("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border transition-colors duration-300",s.status==="completed"&&"border-success bg-success text-panel",s.status==="in_progress"&&"border-accent",s.status==="pending"&&"border-line-strong"),children:[s.status==="completed"&&t(q,{className:"size-2.5 animate-pop",strokeWidth:3.5}),s.status==="in_progress"&&t("span",{className:"size-1.5 animate-pulse rounded-full bg-accent"})]}),t("span",{className:d("min-w-0 flex-1 break-words leading-relaxed [overflow-wrap:anywhere]",s.status==="completed"&&"text-faint line-through decoration-faint/60",s.status==="in_progress"&&"font-medium text-ink",s.status==="pending"&&"text-dim"),children:s.content})]},`${s.status}-${s.content}`))})}function O(e){let{cn:d,style:c,useTheme:m}=_();m();let[s,l]=a("all"),u=g(()=>e.tools.filter((r)=>r.deferred).length,[e.tools]),p=e.tools.length-u,f=g(()=>{if(s==="deferred")return e.tools.filter((r)=>r.deferred);if(s==="active")return e.tools.filter((r)=>!r.deferred);return e.tools},[e.tools,s]);if(!e.tools.length)return t(k,{children:"当前会话没有可用工具。"});return n("div",{className:"space-y-2",children:[u>0&&n("div",{className:"flex items-center gap-1 text-[11px]",children:[n("button",{type:"button",onClick:()=>l("all"),className:d("rounded-lg px-2 py-1 transition-colors",s==="all"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["全部 (",e.tools.length,")"]}),n("button",{type:"button",onClick:()=>l("active"),className:d("rounded-lg px-2 py-1 transition-colors",s==="active"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["常驻 (",p,")"]}),n("button",{type:"button",onClick:()=>l("deferred"),className:d("rounded-lg px-2 py-1 transition-colors",s==="deferred"?"bg-raised font-medium text-ink":"text-faint hover:text-dim"),children:["延迟加载 (",u,")"]})]}),t("div",{className:"space-y-1.5",children:f.map((r)=>t(G,{tool:r},`${r.group}-${r.name}`))})]})}function G(e){let{Chevron:d,CopyButton:c,Code:m,style:s,useTheme:l}=_();l();let[u,p]=a(!1),f=g(()=>u?JSON.stringify(e.tool.schema,null,2):"",[u,e.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((r)=>!r),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs",children:[n("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 truncate font-mono text-ink",children:[t("span",{className:"truncate",children:e.tool.name}),e.tool.group&&t("span",{className:s("control.badge","font-sans text-[10px]"),children:e.tool.group}),e.tool.deferred&&t("span",{className:s("control.badge","font-sans text-[10px]"),children:"延迟加载"})]}),t(d,{className:"-rotate-90 text-faint group-data-[state=open]/collapsible:rotate-90"})]}),u&&n("div",{className:"border-t border-line/60 bg-raised/20 px-3 py-2 text-xs text-dim",children:[e.tool.deferred&&t("div",{className:s("surface.subtle","mb-2 px-2.5 py-1.5 text-[11px] text-faint"),children:"延迟加载:此工具默认以精简描述挂载,模型通过 toolsearch 取回定义后才向上下文注入完整参数 Schema。"}),e.tool.description&&t("pre",{className:"mb-2 max-h-60 overflow-y-auto font-sans text-xs leading-relaxed text-dim whitespace-pre-wrap break-words [overflow-wrap:anywhere]",children:tr(e.tool.description)}),n("div",{className:s("surface.subtle","group/schema relative overflow-hidden rounded-lg p-2.5"),children:[t("div",{className:"absolute right-1.5 top-1.5 z-10",children:t(c,{text:f,size:"icon-xs",className:"bg-raised/60 hover:bg-raised text-faint hover:text-ink backdrop-blur-sm"})}),t("div",{className:"max-h-72 overflow-y-auto pr-6 text-dim",children:t(m,{code:tr(f),lang:"json",className:"text-[11px]! leading-relaxed! [&_pre]:whitespace-pre-wrap [&_pre]:break-words [&_pre]:[overflow-wrap:anywhere]"})})]})]})]})}function Q(){try{let e=localStorage.getItem("basalt.contextSidebar.tab");if(e==="tools"||e==="todos"||e==="raw")return e}catch{}return"breakdown"}function Y(e){let{style:d,useTheme:c}=_();return c(),n("div",{className:d("surface.panel","bg-panel/70 px-3 py-2"),children:[t("div",{className:"text-[10px] font-medium uppercase tracking-wider text-faint",children:e.label}),t("div",{className:"mt-0.5 truncate font-mono text-xs font-semibold tabular-nums text-ink",children:e.value})]})}function Pe(e){let{Button:d,StatusChip:c,Segmented:m,cn:s,style:l,useTheme:u}=_();u();let[p,f]=a(Q),[r,x]=a(()=>Pn.get(e.session.id)),[y,h]=a(!1),[w,E]=a(0),[D,j]=a(!1);o(()=>{let b=setTimeout(()=>j(!0),140);return()=>clearTimeout(b)},[]),o(()=>{let b=Pn.get(e.session.id);if(b)x(b);return ci((C,Z)=>{if(C===e.session.id)x(Z)})},[e.session.id]),o(()=>{let b=new AbortController;return h(!1),e.connection.request(`/api/sessions/${encodeURIComponent(e.session.id)}/context`,{signal:AbortSignal.any([b.signal,AbortSignal.timeout(15000)])}).then((C)=>{if(!b.signal.aborted)ui(e.session.id,C),x(C)},()=>{if(!b.signal.aborted)h(!0)}),()=>b.abort()},[e.connection,e.session.id,e.session.updated,e.entries.length,w]);let N=Jr(r?.items??[],r?.usableWindow,r?.calibratedTokens,r?.lastInputTokens,r?.hasPendingOutput),S=ea(N.percent),U=(b)=>{f(b);try{localStorage.setItem("basalt.contextSidebar.tab",b)}catch{}},J=[{value:"breakdown",label:"构成"},{value:"tools",label:n("span",{className:"inline-flex items-center gap-1",children:["工具",r&&t("span",{className:"text-[10px] text-faint tabular-nums",children:r.tools.length})]})},{value:"todos",label:n("span",{className:"inline-flex items-center gap-1",children:["待办",e.session.todos.length>0&&t("span",{className:"text-[10px] text-faint tabular-nums",children:e.session.todos.length})]})},{value:"raw",label:"原始消息"}],F=n("div",{className:"border-b border-line px-3.5 py-3",children:[n("div",{className:"flex items-start justify-between gap-3",children:[n("div",{children:[t("div",{className:"text-[10.5px] font-medium uppercase tracking-wider text-faint",children:"上下文用量"}),n("div",{className:"mt-0.5 flex items-baseline gap-1.5",children:[t("span",{className:"font-mono text-xl font-semibold tabular-nums text-ink",children:r?N.totalTokens.toLocaleString():"—"}),n("span",{className:"font-mono text-xs text-dim",children:["/ ",r?.usableWindow.toLocaleString()??"—"]})]})]}),t(c,{tone:S==="overflow"||S==="near_limit"?"danger":S==="sealing"?"warning":"success",children:S==="overflow"?"预计超限":S==="near_limit"?"接近上限":S==="sealing"?"接近封存":"正常"})]}),N.percent!==null&&t("meter",{className:"sr-only","aria-label":"可用上下文窗口占比",min:0,max:100,value:Math.min(100,N.percent)}),t("div",{"aria-hidden":!0,className:s("relative mt-2.5 h-2 w-full overflow-hidden rounded-full bg-raised",!r&&"animate-pulse"),children:t("div",{className:"h-full rounded-full bg-accent transition-[width] duration-500 ease-out-quint",style:{width:`${Math.min(100,N.percent??0)}%`}})}),n("div",{className:"mt-2 flex items-center justify-between text-[11px]",children:[t("span",{className:"text-dim",children:N.percent===null?"暂无窗口数据":`${N.percent.toFixed(1)}% 可用窗口`}),n("span",{className:"text-faint",children:["总窗口 ",r?.contextWindow.toLocaleString()??"—"," · 80% 封存 · 97% 折叠"]})]}),r?.usage&&(r.usage.input>0||r.usage.output>0||r.usage.cacheRead>0||r.usage.cacheWrite>0||r.usage.cost>0)&&t("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[["Input",r.usage.input.toLocaleString()],["Output",r.usage.output.toLocaleString()],["Cache",`${r.usage.cacheRead.toLocaleString()} / ${r.usage.cacheWrite.toLocaleString()}`],["平均 TPS",r.usage.tps!==void 0?`${r.usage.tps.toFixed(1)} tok/s`:"—"]].map(([b,C])=>t(Y,{label:b,value:C},b))})]});return n(v,{children:[F,t("div",{className:"border-b border-line px-3 py-2",children:t(m,{value:p,onChange:U,options:J,className:"w-full grid grid-cols-4"})}),n("div",{className:"min-h-0 flex-1 overflow-y-auto px-3 py-3",children:[y&&!r&&n("div",{role:"alert",className:"flex items-center justify-between rounded-xl border border-danger/30 bg-danger/8 px-3 py-2 text-xs text-danger",children:[t("span",{children:"上下文加载失败。"}),t(d,{size:"sm",variant:"ghost",onClick:()=>E((b)=>b+1),children:"重试"})]}),t("div",{children:!D?t(R,{}):n(v,{children:[p==="raw"&&t(A,{entries:e.entries}),p==="todos"&&t(L,{todos:e.session.todos}),p==="breakdown"&&(r?t(B,{items:N.items}):!y?t(R,{}):null),p==="tools"&&(r?t(O,{tools:r.tools??[]}):!y?t(R,{}):null)]})},p)]})]})}export{Pe as ContextSidebar};
@@ -1 +1 @@
1
- import{h,o,a,t,n,_,Z,te,rt,vt}from"./chunk-vt40e1kp.js";import{gn}from"./chunk-f26smjjf.js";var I="/api/plugins/prompt-optimizer";function j({connection:u,onClose:x}){let{Button:g,ModelSelector:O,Select:D,SettingGroup:S,SettingRow:b,cn:C}=_(),[m,z]=a(null),[s,p]=a(null),[L,B]=a({models:[]}),[d,M]=a(!0),[N,R]=a(!1),[l,w]=a(!1),[f,r]=a(null),y=h(async(i=!1)=>{if(i)R(!0);else M(!0);r(null);try{let[e,c]=await Promise.all([u.request(`${I}/settings`),u.request("/api/models")]);z(e),p(e),B(c)}catch(e){r({type:"error",text:e instanceof Error?e.message:"读取优化插件设置失败"})}finally{M(!1),R(!1)}},[u]);o(()=>{y()},[y]);let P=s&&m?s.primaryModel?.providerID!==m.primaryModel?.providerID||s.primaryModel?.modelID!==m.primaryModel?.modelID||s.maxClarificationRounds!==m.maxClarificationRounds:!1,E=async(i)=>{if(i?.preventDefault(),!s||l||d)return;w(!0),r(null);try{let e=await u.request(`${I}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({schemaVersion:1,revision:s.revision,primaryModel:s.primaryModel,maxClarificationRounds:s.maxClarificationRounds})});z(e),p(e),r({type:"success",text:"设置已保存"})}catch(e){r({type:"error",text:e instanceof Error?e.message:"保存设置失败"})}finally{w(!1)}},T=()=>{p(m),r(null)},v=s?.primaryModel??null,q=v?`${v.providerID}/${v.modelID}`:"";return n("form",{onSubmit:E,className:"min-w-0 space-y-6",children:[t(S,{title:"模型策略",description:"提示词优化专用的改写模型配置",action:n(g,{type:"button",size:"sm",variant:"ghost",disabled:d||N||l,onClick:()=>void y(!0),className:"h-8 px-2.5 text-xs text-dim hover:text-ink",children:[t(te,{className:C("mr-1.5 size-3.5",N&&"animate-spin")}),"刷新模型"]}),children:t(b,{vertical:!0,title:"默认优化模型",description:"优化插件必须显式绑定模型才能发起改写;未选定模型时将拒绝调用,绝不隐式自动回退。",children:t("div",{className:"pt-1",children:t(O,{variant:"field",models:L,value:q,onChange:(i)=>{let e=i.indexOf("/"),c=e<0?"":i.slice(0,e),G=e<0?i:i.slice(e+1);p((k)=>k?{...k,primaryModel:{providerID:c,modelID:G}}:null),r(null)}})})})}),t(S,{title:"交互模式",description:"控制生成过程中的意图确认与澄清策略",children:t(b,{title:"澄清提问轮数",description:"当草稿存在关键歧义无法从上下文判定时,允许模型主动提问的最大轮数",children:t("div",{className:"w-48",children:t(D,{value:String(s?.maxClarificationRounds??1),disabled:d||l,onValueChange:(i)=>{let e=i==="2"?2:1;p((c)=>c?{...c,maxClarificationRounds:e}:null),r(null)},groups:[{options:[{value:"1",label:"单轮澄清(推荐)",description:"提问一次后直接输出改写结果"},{value:"2",label:"最多两轮澄清",description:"首轮澄清后可针对残留疑问追问一次"}]}]})})})}),n("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3 px-0.5",children:[t("div",{className:"min-w-0 flex-1",children:f&&n("div",{className:C("flex items-center gap-2 text-xs",f.type==="success"?"text-success":"text-danger"),children:[f.type==="success"?t(gn,{className:"size-3.5 shrink-0"}):t(Z,{className:"size-3.5 shrink-0"}),t("span",{children:f.text})]})}),n("div",{className:"flex items-center gap-2",children:[P&&n(g,{type:"button",variant:"ghost",size:"sm",disabled:d||l,onClick:T,children:[t(rt,{className:"mr-1.5 size-3.5"}),"重置"]}),n(g,{type:"submit",variant:"primary",size:"sm",disabled:d||l||!P,children:[t(vt,{className:"mr-1.5 size-3.5"}),l?"保存中…":"保存"]}),x&&t(g,{type:"button",variant:"secondary",size:"sm",onClick:x,children:"关闭"})]})]})]})}export{j as PromptOptimizerSettingsSection};
1
+ import{h,o,a,t,n,_,Z,te,rt,vt}from"./chunk-aqm3spxt.js";import{gn}from"./chunk-f078k1ej.js";var I="/api/plugins/prompt-optimizer";function j({connection:u,onClose:x}){let{Button:g,ModelSelector:O,Select:D,SettingGroup:S,SettingRow:b,cn:C}=_(),[m,z]=a(null),[s,p]=a(null),[L,B]=a({models:[]}),[d,M]=a(!0),[N,R]=a(!1),[l,w]=a(!1),[f,r]=a(null),y=h(async(i=!1)=>{if(i)R(!0);else M(!0);r(null);try{let[e,c]=await Promise.all([u.request(`${I}/settings`),u.request("/api/models")]);z(e),p(e),B(c)}catch(e){r({type:"error",text:e instanceof Error?e.message:"读取优化插件设置失败"})}finally{M(!1),R(!1)}},[u]);o(()=>{y()},[y]);let P=s&&m?s.primaryModel?.providerID!==m.primaryModel?.providerID||s.primaryModel?.modelID!==m.primaryModel?.modelID||s.maxClarificationRounds!==m.maxClarificationRounds:!1,E=async(i)=>{if(i?.preventDefault(),!s||l||d)return;w(!0),r(null);try{let e=await u.request(`${I}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({schemaVersion:1,revision:s.revision,primaryModel:s.primaryModel,maxClarificationRounds:s.maxClarificationRounds})});z(e),p(e),r({type:"success",text:"设置已保存"})}catch(e){r({type:"error",text:e instanceof Error?e.message:"保存设置失败"})}finally{w(!1)}},T=()=>{p(m),r(null)},v=s?.primaryModel??null,q=v?`${v.providerID}/${v.modelID}`:"";return n("form",{onSubmit:E,className:"min-w-0 space-y-6",children:[t(S,{title:"模型策略",description:"提示词优化专用的改写模型配置",action:n(g,{type:"button",size:"sm",variant:"ghost",disabled:d||N||l,onClick:()=>void y(!0),className:"h-8 px-2.5 text-xs text-dim hover:text-ink",children:[t(te,{className:C("mr-1.5 size-3.5",N&&"animate-spin")}),"刷新模型"]}),children:t(b,{vertical:!0,title:"默认优化模型",description:"优化插件必须显式绑定模型才能发起改写;未选定模型时将拒绝调用,绝不隐式自动回退。",children:t("div",{className:"pt-1",children:t(O,{variant:"field",models:L,value:q,onChange:(i)=>{let e=i.indexOf("/"),c=e<0?"":i.slice(0,e),G=e<0?i:i.slice(e+1);p((k)=>k?{...k,primaryModel:{providerID:c,modelID:G}}:null),r(null)}})})})}),t(S,{title:"交互模式",description:"控制生成过程中的意图确认与澄清策略",children:t(b,{title:"澄清提问轮数",description:"当草稿存在关键歧义无法从上下文判定时,允许模型主动提问的最大轮数",children:t("div",{className:"w-48",children:t(D,{value:String(s?.maxClarificationRounds??1),disabled:d||l,onValueChange:(i)=>{let e=i==="2"?2:1;p((c)=>c?{...c,maxClarificationRounds:e}:null),r(null)},groups:[{options:[{value:"1",label:"单轮澄清(推荐)",description:"提问一次后直接输出改写结果"},{value:"2",label:"最多两轮澄清",description:"首轮澄清后可针对残留疑问追问一次"}]}]})})})}),n("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3 px-0.5",children:[t("div",{className:"min-w-0 flex-1",children:f&&n("div",{className:C("flex items-center gap-2 text-xs",f.type==="success"?"text-success":"text-danger"),children:[f.type==="success"?t(gn,{className:"size-3.5 shrink-0"}):t(Z,{className:"size-3.5 shrink-0"}),t("span",{children:f.text})]})}),n("div",{className:"flex items-center gap-2",children:[P&&n(g,{type:"button",variant:"ghost",size:"sm",disabled:d||l,onClick:T,children:[t(rt,{className:"mr-1.5 size-3.5"}),"重置"]}),n(g,{type:"submit",variant:"primary",size:"sm",disabled:d||l||!P,children:[t(vt,{className:"mr-1.5 size-3.5"}),l?"保存中…":"保存"]}),x&&t(g,{type:"button",variant:"secondary",size:"sm",onClick:x,children:"关闭"})]})]})]})}export{j as PromptOptimizerSettingsSection};
@@ -1,7 +1,7 @@
1
- import{hn}from"./chunk-9p12mgs6.js";import{W}from"./chunk-b1pe46zz.js";import{e,r,D,b,O,B,C,S,E,T,A,I,L,q,In,nt,U}from"./chunk-y0m8hrwz.js";import{X}from"./chunk-taynqrgq.js";var Y=/[─━│┃└┗├┣]/,P=/[└┗├┣]/,ee=/[─━]/,R=/^[\s│┃]+$/,H=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,z=/^\s*%%/,te=" ";function F(i){return i.some((n)=>Y.test(n))}e(F,"isBoxDrawingFormat");function Z(i){for(let n of i){let t=P.exec(n);if(t?.index&&t.index>0)return t.index}return 4}e(Z,"inferSegmentWidth");function j(i,n){return i.replace(/\bline\s+(\d+)\b/gi,(t,o)=>{let c=parseInt(o,10),s=n.get(c);return s?`line ${s}`:t})}e(j,"remapErrorLines");function J(i){let n=i.split(`
2
- `),t=new Map,o=-1;for(let[g,d]of n.entries())if(d.trim()==="treeView-beta"){o=g;break}if(o===-1)return{text:i,lineMap:t};let c=[];for(let g=o+1;g<n.length;g++){let d=n[g];if(d.trim()===""||z.test(d)||H.test(d))continue;if(R.test(d))continue;c.push(d.replace(/\t/g," "))}if(!F(c))return{text:i,lineMap:t};let s=Z(c),a=[],l=0;for(let g=0;g<=o;g++)a.push(n[g]),l++,t.set(l,g+1);for(let g=o+1;g<n.length;g++){let d=n[g],p=d.trim(),f=g+1;if(p===""){a.push(d),l++,t.set(l,f);continue}if(z.test(d)){a.push(d),l++,t.set(l,f);continue}if(H.test(d)){a.push(d),l++,t.set(l,f);continue}if(R.test(d))continue;let h=d.replace(/\t/g," "),w=P.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/s)+1,m=u+1;while(m<h.length&&ee.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let y=h.slice(m).trimEnd();if(!y)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let Q=te.repeat(x);a.push(Q+y),l++,t.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(Y.test(h))a.push(d),l++,t.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else a.push(d),l++,t.set(l,f)}return{text:a.join(`
3
- `),lineMap:t}}e(J,"preprocessBoxDrawing");var v=new hn(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{v.reset(),C()},"clear"),ne=e(()=>v.records.stack[0],"getRoot"),ie=e(()=>v.records.cnt,"getCount"),oe=D.treeView,se=e(()=>U(oe,b().treeView),"getConfig"),ae=e((i,n,t,o,c,s)=>{while(i<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let a={id:v.records.cnt++,level:i,name:n,nodeType:t,icon:c,cssClass:o,description:s,children:[]};v.records.stack[v.records.stack.length-1].children.push(a),v.records.stack.push(a)},"addNode"),ce={clear:re,addNode:ae,getRoot:ne,getCount:ie,getConfig:se,getAccTitle:E,getAccDescription:A,getDiagramTitle:L,setAccDescription:T,setAccTitle:S,setDiagramTitle:I},k=ce,le=e((i)=>{W(i,k);for(let n of i.nodes){let t=typeof n.indent==="number"?n.indent:0,o=n.name,c=o.endsWith("/");if(c)o=o.slice(0,-1);let s=c?"directory":"file",a=n.classAnnotation||void 0,l=n.iconAnnotation,g=l!==void 0?l||"none":void 0,d=n.descAnnotation||void 0,p=d?O(d,b()):void 0;k.addNode(t,o,s,a,g,p)}},"populate"),de={parse:e(async(i)=>{let{text:n,lineMap:t}=J(i);try{let o=await X("treeView",n);r.debug(o),le(o)}catch(o){if(t.size>0&&o instanceof Error)o.message=j(o.message,t);throw o}},"parse")},V={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(i,n){let t=n?.filenameIcons?.[i];if(t)return t;let o=i.lastIndexOf(".");if(o>0){let c=i.substring(o).toLowerCase(),s=n?.extensionIcons;return s?.[c]??s?.[c.slice(1)]}return}e(K,"detectIcon");function N(i,n){if(i.includes(":"))return i;if(i in V.icons||!n)return`${V.prefix}:${i}`;return`${n}:${i}`}e(N,"qualifyIcon");function M(i,n){if(i.icon==="none")return;if(i.icon)return N(i.icon,n.defaultIconPack);if(!n.showIcons)return;if(i.nodeType==="file"){let t=K(i.name,n);if(t==="none")return;if(t)return N(t,n.defaultIconPack)}return`${V.prefix}:${i.nodeType==="directory"?"folder":"file"}`}e(M,"getNodeIcon");In([{name:V.prefix,icons:V}]);var _=14,he=4,pe=16,fe=e(async(i,n)=>{let t=[],o=e((s)=>{let a=M(s,n);if(a)t.push({icon:a,node:s});s.children.forEach(o)},"collect");o(i);let c=await Promise.all(t.map(async({icon:s,node:a})=>({id:a.id,svg:await nt(s,{height:_,width:_})})));return new Map(c.map(({id:s,svg:a})=>[s,a]))},"resolveNodeIcons"),ge=e((i,n,t,o,c,s)=>{let a=o.append("g"),l="treeView-node-label";if(t.nodeType==="directory")l+=" treeView-node-dir";if(t.cssClass)l+=` ${t.cssClass}`;let g=_+he,d=M(t,c),p=d!==void 0;if(d)a.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${i+c.paddingX}, ${n+c.paddingY})`).html(s.get(t.id)??"");let f=a.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,x=i+c.paddingX+(p?g:0);f.attr("x",x),f.attr("y",n+u/2);let m=x+w,y=w+c.paddingX*2+(p?g:0);if(t.BBox={x:i,y:n,width:y,height:u},t.cssClass?.split(/\s+/).includes("highlight"))a.insert("rect",":first-child").attr("x",i).attr("y",n+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:t,nodeGroup:a,labelRightEdge:m,centerY:n+u/2}},"positionLabel"),G=e((i,n,t,o,c,s)=>i.append("line").attr("x1",n).attr("y1",t).attr("x2",o).attr("y2",c).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),ue=e((i,n,t,o)=>{let c=0,s=0,a=[],l=e((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=ge(u,c,f,p,h,o);a.push(x);let{height:m,width:y}=f.BBox;G(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),s=Math.max(s,u+y),c+=m},"drawNode"),g=e((p,f=0)=>{l(i,p,t,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;G(i,h+t.paddingX,w+u,h+t.paddingX,x+m/2+t.lineThickness/2,t.lineThickness)}},"processNode");g(n);let d=a.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...a.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();s=Math.max(s,f+u.width+t.paddingX)}}for(let p of a)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=s-p.node.BBox.x+8;f.attr("width",h),s=Math.max(s,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:s}},"drawTree"),me=e(async(i,n,t,o)=>{r.debug(`Rendering treeView diagram
4
- `+i);let c=o.db,s=c.getRoot(),a=c.getConfig(),l=q(n),g=l.append("g");g.attr("class","tree-view");let d=await fe(s,a),{totalHeight:p,totalWidth:f}=ue(g,s,a,d);l.attr("viewBox",`-${a.lineThickness/2} 0 ${f} ${p}`),B(l,p,f,a.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=e(({treeView:i})=>{let{labelFontSize:n,labelColor:t,lineColor:o,iconColor:c,descriptionColor:s,highlightBg:a,highlightStroke:l}=U(ve,i);return`
1
+ import{hn}from"./chunk-ezkqa7we.js";import{W}from"./chunk-vjqmnkh2.js";import{e,r,D,b,O,B,C,S,E,T,A,I,L,V,In,nt,U}from"./chunk-9dd1c37b.js";import{X}from"./chunk-qryrg2pq.js";var P=/[─━│┃└┗├┣]/,F=/[└┗├┣]/,ee=/[─━]/,H=/^[\s│┃]+$/,z=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,G=/^\s*%%/,te=" ";function Z(i){return i.some((n)=>P.test(n))}e(Z,"isBoxDrawingFormat");function q(i){for(let n of i){let t=F.exec(n);if(t?.index&&t.index>0)return t.index}return 4}e(q,"inferSegmentWidth");function j(i,n){return i.replace(/\bline\s+(\d+)\b/gi,(t,o)=>{let c=parseInt(o,10),s=n.get(c);return s?`line ${s}`:t})}e(j,"remapErrorLines");function J(i){let n=i.split(`
2
+ `),t=new Map,o=-1;for(let[g,d]of n.entries())if(d.trim()==="treeView-beta"){o=g;break}if(o===-1)return{text:i,lineMap:t};let c=[];for(let g=o+1;g<n.length;g++){let d=n[g];if(d.trim()===""||G.test(d)||z.test(d))continue;if(H.test(d))continue;c.push(d.replace(/\t/g," "))}if(!Z(c))return{text:i,lineMap:t};let s=q(c),a=[],l=0;for(let g=0;g<=o;g++)a.push(n[g]),l++,t.set(l,g+1);for(let g=o+1;g<n.length;g++){let d=n[g],p=d.trim(),f=g+1;if(p===""){a.push(d),l++,t.set(l,f);continue}if(G.test(d)){a.push(d),l++,t.set(l,f);continue}if(z.test(d)){a.push(d),l++,t.set(l,f);continue}if(H.test(d))continue;let h=d.replace(/\t/g," "),w=F.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/s)+1,m=u+1;while(m<h.length&&ee.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let y=h.slice(m).trimEnd();if(!y)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let Q=te.repeat(x);a.push(Q+y),l++,t.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(P.test(h))a.push(d),l++,t.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else a.push(d),l++,t.set(l,f)}return{text:a.join(`
3
+ `),lineMap:t}}e(J,"preprocessBoxDrawing");var v=new hn(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{v.reset(),C()},"clear"),ne=e(()=>v.records.stack[0],"getRoot"),ie=e(()=>v.records.cnt,"getCount"),oe=D.treeView,se=e(()=>U(oe,b().treeView),"getConfig"),ae=e((i,n,t,o,c,s)=>{while(i<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let a={id:v.records.cnt++,level:i,name:n,nodeType:t,icon:c,cssClass:o,description:s,children:[]};v.records.stack[v.records.stack.length-1].children.push(a),v.records.stack.push(a)},"addNode"),ce={clear:re,addNode:ae,getRoot:ne,getCount:ie,getConfig:se,getAccTitle:E,getAccDescription:A,getDiagramTitle:L,setAccDescription:T,setAccTitle:S,setDiagramTitle:I},N=ce,le=e((i)=>{W(i,N);for(let n of i.nodes){let t=typeof n.indent==="number"?n.indent:0,o=n.name,c=o.endsWith("/");if(c)o=o.slice(0,-1);let s=c?"directory":"file",a=n.classAnnotation||void 0,l=n.iconAnnotation,g=l!==void 0?l||"none":void 0,d=n.descAnnotation||void 0,p=d?O(d,b()):void 0;N.addNode(t,o,s,a,g,p)}},"populate"),de={parse:e(async(i)=>{let{text:n,lineMap:t}=J(i);try{let o=await X("treeView",n);r.debug(o),le(o)}catch(o){if(t.size>0&&o instanceof Error)o.message=j(o.message,t);throw o}},"parse")},k={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(i,n){let t=n?.filenameIcons?.[i];if(t)return t;let o=i.lastIndexOf(".");if(o>0){let c=i.substring(o).toLowerCase(),s=n?.extensionIcons;return s?.[c]??s?.[c.slice(1)]}return}e(K,"detectIcon");function _(i,n){if(i.includes(":"))return i;if(i in k.icons||!n)return`${k.prefix}:${i}`;return`${n}:${i}`}e(_,"qualifyIcon");function R(i,n){if(i.icon==="none")return;if(i.icon)return _(i.icon,n.defaultIconPack);if(!n.showIcons)return;if(i.nodeType==="file"){let t=K(i.name,n);if(t==="none")return;if(t)return _(t,n.defaultIconPack)}return`${k.prefix}:${i.nodeType==="directory"?"folder":"file"}`}e(R,"getNodeIcon");In([{name:k.prefix,icons:k}]);var M=14,he=4,pe=16,fe=e(async(i,n)=>{let t=[],o=e((s)=>{let a=R(s,n);if(a)t.push({icon:a,node:s});s.children.forEach(o)},"collect");o(i);let c=await Promise.all(t.map(async({icon:s,node:a})=>({id:a.id,svg:await nt(s,{height:M,width:M})})));return new Map(c.map(({id:s,svg:a})=>[s,a]))},"resolveNodeIcons"),ge=e((i,n,t,o,c,s)=>{let a=o.append("g"),l="treeView-node-label";if(t.nodeType==="directory")l+=" treeView-node-dir";if(t.cssClass)l+=` ${t.cssClass}`;let g=M+he,d=R(t,c),p=d!==void 0;if(d)a.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${i+c.paddingX}, ${n+c.paddingY})`).html(s.get(t.id)??"");let f=a.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,x=i+c.paddingX+(p?g:0);f.attr("x",x),f.attr("y",n+u/2);let m=x+w,y=w+c.paddingX*2+(p?g:0);if(t.BBox={x:i,y:n,width:y,height:u},t.cssClass?.split(/\s+/).includes("highlight"))a.insert("rect",":first-child").attr("x",i).attr("y",n+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:t,nodeGroup:a,labelRightEdge:m,centerY:n+u/2}},"positionLabel"),Y=e((i,n,t,o,c,s)=>i.append("line").attr("x1",n).attr("y1",t).attr("x2",o).attr("y2",c).attr("stroke-width",s).attr("class","treeView-node-line"),"positionLine"),ue=e((i,n,t,o)=>{let c=0,s=0,a=[],l=e((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=ge(u,c,f,p,h,o);a.push(x);let{height:m,width:y}=f.BBox;Y(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),s=Math.max(s,u+y),c+=m},"drawNode"),g=e((p,f=0)=>{l(i,p,t,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;Y(i,h+t.paddingX,w+u,h+t.paddingX,x+m/2+t.lineThickness/2,t.lineThickness)}},"processNode");g(n);let d=a.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...a.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();s=Math.max(s,f+u.width+t.paddingX)}}for(let p of a)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=s-p.node.BBox.x+8;f.attr("width",h),s=Math.max(s,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:s}},"drawTree"),me=e(async(i,n,t,o)=>{r.debug(`Rendering treeView diagram
4
+ `+i);let c=o.db,s=c.getRoot(),a=c.getConfig(),l=V(n),g=l.append("g");g.attr("class","tree-view");let d=await fe(s,a),{totalHeight:p,totalWidth:f}=ue(g,s,a,d);l.attr("viewBox",`-${a.lineThickness/2} 0 ${f} ${p}`),B(l,p,f,a.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=e(({treeView:i})=>{let{labelFontSize:n,labelColor:t,lineColor:o,iconColor:c,descriptionColor:s,highlightBg:a,highlightStroke:l}=U(ve,i);return`
5
5
  .treeView-node-label {
6
6
  font-size: ${n};
7
7
  fill: ${t};
@@ -27,4 +27,4 @@ import{hn}from"./chunk-9p12mgs6.js";import{W}from"./chunk-b1pe46zz.js";import{e,
27
27
  stroke: ${l};
28
28
  stroke-width: 1;
29
29
  }
30
- `},"styles"),Ce=be,Ee={db:k,renderer:xe,parser:de,styles:Ce};export{Ee as diagram};
30
+ `},"styles"),Ce=be,Ee={db:N,renderer:xe,parser:de,styles:Ce};export{Ee as diagram};