@bkm016/basalt 0.1.10 → 0.1.12

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 (230) hide show
  1. package/{chunk-755sy11p.js → chunk-01nve4qy.js} +1 -1
  2. package/{chunk-jtsve11b.js → chunk-0fc9apfn.js} +9 -9
  3. package/{chunk-d5j74pcp.js → chunk-1h34mzh7.js} +4 -4
  4. package/{chunk-fgwda4m0.js → chunk-1xfv4bd7.js} +1 -1
  5. package/{chunk-mbpb5c7w.js → chunk-2fyjph3f.js} +1 -1
  6. package/{chunk-13gvs0ax.js → chunk-2kxnw7vs.js} +1 -1
  7. package/{chunk-95964592.js → chunk-37zystxb.js} +11 -11
  8. package/{chunk-h1kb8b49.js → chunk-3pf1d62g.js} +2 -2
  9. package/{chunk-29qrxygd.js → chunk-5wnmbc1b.js} +2 -2
  10. package/{chunk-c71173py.js → chunk-6mges89p.js} +4 -4
  11. package/{chunk-d0a1jxk5.js → chunk-6sz5q3df.js} +2 -2
  12. package/chunk-7er5pz7s.js +479 -0
  13. package/{chunk-gbjn6d81.js → chunk-7g5smgjj.js} +1 -1
  14. package/chunk-7m3jagqn.js +2 -0
  15. package/{chunk-wnzvnskb.js → chunk-85v69h91.js} +2 -2
  16. package/{chunk-38g3gctw.js → chunk-9c4gdg1q.js} +2 -2
  17. package/{chunk-en218k4y.js → chunk-cbgpymt4.js} +1 -1
  18. package/{chunk-a1rb1a48.js → chunk-cdw03j4t.js} +2 -2
  19. package/chunk-ch1r3ted.js +2 -0
  20. package/{chunk-dfh9m9n7.js → chunk-db7ws33a.js} +2 -2
  21. package/{chunk-1n7dat03.js → chunk-ejjem0tc.js} +3 -3
  22. package/{chunk-c4qr1f41.js → chunk-eq4wqxzt.js} +2 -2
  23. package/{chunk-zc9ar0r4.js → chunk-eyrtbbdd.js} +1 -1
  24. package/{chunk-r4ttdkrz.js → chunk-fhxy6y34.js} +2 -2
  25. package/{chunk-zyyzk5ha.js → chunk-fy82qxa1.js} +1 -1
  26. package/{chunk-xtq1xpq0.js → chunk-hc300148.js} +1 -1
  27. package/{chunk-vtqr7dm8.js → chunk-j64dc767.js} +2 -2
  28. package/{chunk-msm9hmk9.js → chunk-jpnf71q7.js} +2 -2
  29. package/{chunk-q9f4xb0w.js → chunk-kpe7pnhy.js} +4 -4
  30. package/{chunk-a98wma9j.js → chunk-ksk49hv0.js} +1 -1
  31. package/{chunk-bdjr0kfr.js → chunk-m4bg1apa.js} +5 -5
  32. package/{chunk-dq01v5eq.js → chunk-nhm9z3d8.js} +1 -1
  33. package/{chunk-30rjf7my.js → chunk-ntks40jd.js} +2 -2
  34. package/{chunk-a1352w87.js → chunk-nw1xpt3s.js} +1 -1
  35. package/{chunk-xh444pfn.js → chunk-p2pmdbt2.js} +8 -8
  36. package/{chunk-hb4f2v34.js → chunk-qfcr5g35.js} +2 -2
  37. package/{chunk-n2jcx65v.js → chunk-qs8zzg50.js} +2 -2
  38. package/{chunk-qaeyhe65.js → chunk-r4gm8ngh.js} +1 -1
  39. package/{chunk-pz2afna8.js → chunk-rks90mh1.js} +1 -1
  40. package/{chunk-asyr3gnq.js → chunk-rwks9zaw.js} +2 -2
  41. package/{chunk-v3ee9z3f.js → chunk-t7te60m7.js} +1 -1
  42. package/{chunk-4dw43syb.js → chunk-tv52xajf.js} +1 -1
  43. package/{chunk-c0zfefq8.js → chunk-v7wcchy2.js} +1 -1
  44. package/{chunk-tevejprz.js → chunk-vjne04dp.js} +3 -3
  45. package/{chunk-ax04trym.js → chunk-w0rr66z7.js} +1 -1
  46. package/{chunk-gkf5jwvj.js → chunk-w6f2r052.js} +1 -1
  47. package/{chunk-0mjb3sm3.js → chunk-wqqjzsjt.js} +327 -282
  48. package/{chunk-c6q04xrd.js → chunk-xef4642x.js} +1 -1
  49. package/compiled.js +7 -7
  50. package/package.json +1 -1
  51. package/ui-test-worker.js +2 -2
  52. package/web/chunk-04drx71p.js +1 -0
  53. package/web/chunk-0mdf1qja.js +1 -0
  54. package/web/chunk-0rdgt4jb.css +1 -0
  55. package/web/{chunk-nawxgz87.js → chunk-19zd0tye.js} +8 -8
  56. package/web/chunk-1m0kp0g3.js +8 -0
  57. package/web/{chunk-07agqp8h.js → chunk-1zwc09e8.js} +2 -2
  58. package/web/{chunk-fmmrthpa.js → chunk-2cyzaqjy.js} +3 -3
  59. package/web/{chunk-vasppf6b.js → chunk-2jfesv7m.js} +2 -2
  60. package/web/{chunk-mykrm8ba.js → chunk-30aeb767.js} +2 -2
  61. package/web/chunk-3j2tcphs.js +1 -0
  62. package/web/chunk-3k9h7a73.js +1142 -0
  63. package/web/chunk-3m1bb2fw.js +1 -0
  64. package/web/{chunk-88wd49xe.js → chunk-3n9ypydh.js} +2 -2
  65. package/web/{chunk-sd3xat3r.js → chunk-3psgr0q8.js} +13 -13
  66. package/web/{chunk-yppgejg7.js → chunk-3qxxrwsp.js} +10 -10
  67. package/web/{chunk-js6kb05s.js → chunk-3rkkp6ed.js} +6 -6
  68. package/web/{chunk-tqze6d6b.js → chunk-4f6a8dsk.js} +1 -1
  69. package/web/{chunk-eqndhs21.js → chunk-4wwd3pfz.js} +2 -2
  70. package/web/chunk-55nvm2mj.js +1 -0
  71. package/web/chunk-5dkqfnh7.js +2 -0
  72. package/web/{chunk-zms6mrqk.js → chunk-5g8md2wg.js} +5 -5
  73. package/web/{chunk-h5ckjk48.js → chunk-5np514v5.js} +12 -12
  74. package/web/{chunk-z4bp6p32.js → chunk-60mym60n.js} +1 -1
  75. package/web/{chunk-bc3ajvfg.js → chunk-6f2sz84q.js} +2 -2
  76. package/web/{chunk-frnh4zqf.js → chunk-6jb2zyp6.js} +2 -2
  77. package/web/{chunk-g7dc4hrd.js → chunk-7adsmqv6.js} +1 -1
  78. package/web/{chunk-g7kz8f7q.js → chunk-7ksg3ccg.js} +5 -5
  79. package/web/chunk-7ky5nrrr.js +1 -0
  80. package/web/{chunk-sc63488q.js → chunk-7v85yvb2.js} +1 -1
  81. package/web/chunk-7vgh17es.js +1 -0
  82. package/web/chunk-80z8s8zb.js +2 -0
  83. package/web/{chunk-rxvm70w5.js → chunk-81s15c2e.js} +2 -2
  84. package/web/{chunk-knm82fw9.js → chunk-8539865x.js} +1 -1
  85. package/web/{chunk-jccz14ye.js → chunk-885kpj14.js} +2 -2
  86. package/web/{chunk-26ecc2xh.js → chunk-8cnjd0f2.js} +5 -5
  87. package/web/chunk-8sdjgv3k.js +1 -0
  88. package/web/chunk-9bxtzwtc.js +1 -0
  89. package/web/chunk-9jy8nc4r.js +1 -0
  90. package/web/{chunk-c57f714b.js → chunk-aa46mrgh.js} +2 -2
  91. package/web/{chunk-gw8x1g61.js → chunk-act3rr85.js} +1 -1
  92. package/web/chunk-aebrw6cv.js +39 -0
  93. package/web/{chunk-j37p0b13.js → chunk-aeymdtm1.js} +3 -3
  94. package/web/{chunk-8h2x89tw.js → chunk-ar6jnhm5.js} +1 -1
  95. package/web/{chunk-tfqarvdx.js → chunk-b5zf1hs3.js} +59 -59
  96. package/web/{chunk-m4fxd5d9.js → chunk-b99k8q22.js} +8 -8
  97. package/web/chunk-bcjgzwef.js +1 -0
  98. package/web/{chunk-jke2ev6m.js → chunk-bra33pt0.js} +2 -2
  99. package/web/{chunk-myd6sc76.js → chunk-bygwbpvq.js} +1 -1
  100. package/web/{chunk-zse05v6j.js → chunk-c3fty2c2.js} +9 -9
  101. package/web/chunk-cxpnj495.js +2 -0
  102. package/web/{chunk-x850q01z.js → chunk-d1btrqmw.js} +1 -1
  103. package/web/{chunk-qdzy124b.js → chunk-d57fm7k0.js} +2 -2
  104. package/web/{chunk-j89s11x8.js → chunk-d73zkc4q.js} +4 -4
  105. package/web/chunk-d94t9z70.js +1 -0
  106. package/web/chunk-de29pe57.js +1 -0
  107. package/web/{chunk-rag65pfs.js → chunk-dndd757x.js} +3 -3
  108. package/web/chunk-e68jw0bg.js +1 -0
  109. package/web/{chunk-grm2208k.js → chunk-e94pd9rr.js} +13 -13
  110. package/web/{chunk-zz1qkaar.js → chunk-enwfd8d5.js} +2 -2
  111. package/web/{chunk-qq6m2my8.js → chunk-fj753yzt.js} +2 -2
  112. package/web/chunk-fr4fft89.js +1 -0
  113. package/web/{chunk-5svqfj4g.js → chunk-g488hxx0.js} +3 -3
  114. package/web/{chunk-0770q5e1.js → chunk-g4zm0crw.js} +1 -1
  115. package/web/chunk-gckmcef6.js +1 -0
  116. package/web/{chunk-se4h6wx0.js → chunk-gkmaryr4.js} +1 -1
  117. package/web/chunk-gnb09wmx.js +1 -0
  118. package/web/{chunk-6e87m0nm.js → chunk-gten0rpx.js} +2 -2
  119. package/web/chunk-h24ybwp6.js +1 -0
  120. package/web/{chunk-z5qn0xev.js → chunk-h754ntg7.js} +2 -2
  121. package/web/{chunk-tt93zbn4.js → chunk-hn8m1vsg.js} +7 -7
  122. package/web/{chunk-rh3xb76f.js → chunk-hqxc9m07.js} +10 -10
  123. package/web/chunk-hrgqc1vr.js +1 -0
  124. package/web/{chunk-3eexx7y5.js → chunk-hva7xyne.js} +2 -2
  125. package/web/chunk-hxbfkdjd.js +1 -0
  126. package/web/chunk-j9c8fa82.js +1 -0
  127. package/web/{chunk-5v5q13hz.js → chunk-jeafmjsm.js} +2 -2
  128. package/web/chunk-jyf7a7yp.js +2 -0
  129. package/web/chunk-jz5mmp64.js +1 -0
  130. package/web/{chunk-18neka5g.js → chunk-k4dnjf8n.js} +5 -5
  131. package/web/{chunk-32ty2xfn.js → chunk-kerfb21g.js} +1 -1
  132. package/web/chunk-kxeaj44h.js +1 -0
  133. package/web/chunk-m0136xav.js +1 -0
  134. package/web/chunk-m1rdyvb5.js +1 -0
  135. package/web/chunk-m6vyvgm5.js +1 -0
  136. package/web/{chunk-w3zgfhjb.js → chunk-mxkbmgcv.js} +2 -2
  137. package/web/chunk-my0ec787.js +1 -0
  138. package/web/{chunk-qy1zx2yw.js → chunk-n9v14vyd.js} +22 -22
  139. package/web/{chunk-x5g1yy12.js → chunk-ncfzmf2g.js} +1 -1
  140. package/web/chunk-nkpdd9hw.js +1 -0
  141. package/web/chunk-ny436sqg.js +1 -0
  142. package/web/chunk-pbp1p5ex.js +1 -0
  143. package/web/chunk-ph75hddv.js +1 -0
  144. package/web/chunk-phdfyqaa.js +1 -0
  145. package/web/chunk-phxa5krt.js +1 -0
  146. package/web/{chunk-wrevb4ew.js → chunk-pjpre6de.js} +6 -6
  147. package/web/{chunk-vvvd3grf.js → chunk-pzg25qqe.js} +2 -2
  148. package/web/chunk-q1zxvjhs.js +2 -0
  149. package/web/{chunk-1qh7f5kr.js → chunk-qdd3bx8q.js} +1 -1
  150. package/web/{chunk-9yfftz38.js → chunk-qp3tjhaq.js} +1 -1
  151. package/web/chunk-r4zbw4zj.js +2 -0
  152. package/web/{chunk-1ev0n3n4.js → chunk-r6kk4vp1.js} +2 -2
  153. package/web/{chunk-n4yzs2q0.js → chunk-rdr6wt22.js} +4 -4
  154. package/web/chunk-ry4ycah9.js +1 -0
  155. package/web/{chunk-de40q05r.js → chunk-sdr5wa4z.js} +3 -3
  156. package/web/chunk-sqm16fat.js +1 -0
  157. package/web/{chunk-gsw1tv96.js → chunk-td83xf12.js} +1 -1
  158. package/web/{chunk-t5nvgz7z.js → chunk-v0wtk059.js} +7 -7
  159. package/web/{chunk-pgwf37s2.js → chunk-v1hfbjz9.js} +5 -5
  160. package/web/chunk-v1qt3gq4.js +1 -0
  161. package/web/{chunk-wtvch4ad.js → chunk-v34mr9ky.js} +9 -9
  162. package/web/chunk-v854w9yn.js +1 -0
  163. package/web/{chunk-xtn305fd.js → chunk-ve56gxq0.js} +1 -1
  164. package/web/chunk-w573ym17.js +1 -0
  165. package/web/{chunk-dv1berk6.js → chunk-w9gnqkez.js} +2 -2
  166. package/web/{chunk-q4bst4an.js → chunk-wqzbxzk3.js} +1 -1
  167. package/web/{chunk-rwfmccmh.js → chunk-wvrs986a.js} +4 -4
  168. package/web/chunk-x0mjydtp.js +1 -0
  169. package/web/{chunk-awkdw9rw.js → chunk-xbyrgyy0.js} +2 -2
  170. package/web/{chunk-p55vhns6.js → chunk-xpecre7w.js} +4 -4
  171. package/web/{chunk-ehtmb6sn.js → chunk-xvfeq8v2.js} +13 -13
  172. package/web/{chunk-rbqnre6q.js → chunk-yf8ykk4v.js} +4 -4
  173. package/web/{chunk-sjkg40ay.js → chunk-yjs6jmdb.js} +1 -1
  174. package/web/chunk-ym7kv2hs.js +1 -0
  175. package/web/chunk-zhybh04p.js +1 -0
  176. package/web/index.html +1 -1
  177. package/worker.js +1 -1
  178. package/chunk-3mqf9ped.js +0 -479
  179. package/chunk-7zkswxvk.js +0 -2
  180. package/chunk-m1eam0s5.js +0 -2
  181. package/web/chunk-045d3b5d.js +0 -1
  182. package/web/chunk-12qf1r6m.js +0 -1
  183. package/web/chunk-1ex3wgms.js +0 -2
  184. package/web/chunk-2cz7tx8q.js +0 -1
  185. package/web/chunk-46jnkghq.js +0 -2
  186. package/web/chunk-4am8j3k3.js +0 -1
  187. package/web/chunk-5qvmefq2.js +0 -1
  188. package/web/chunk-5z2n4z9x.css +0 -1
  189. package/web/chunk-6y55gk1n.js +0 -1
  190. package/web/chunk-7np1jp3x.js +0 -8
  191. package/web/chunk-7qq1ypvj.js +0 -1
  192. package/web/chunk-87e8d1hv.js +0 -1
  193. package/web/chunk-8y2526ve.js +0 -1
  194. package/web/chunk-905vw286.js +0 -2
  195. package/web/chunk-918e5t4x.js +0 -2
  196. package/web/chunk-96m2m3e8.js +0 -1
  197. package/web/chunk-9f4zzqbx.js +0 -1
  198. package/web/chunk-a1n4468c.js +0 -1
  199. package/web/chunk-arnzrqnm.js +0 -1
  200. package/web/chunk-b46ws7rf.js +0 -1
  201. package/web/chunk-bwy3e58v.js +0 -1
  202. package/web/chunk-d5gshd1a.js +0 -1
  203. package/web/chunk-dp0k5vhd.js +0 -1
  204. package/web/chunk-eh7wp62z.js +0 -2
  205. package/web/chunk-et1hytyv.js +0 -1
  206. package/web/chunk-f7jpakwh.js +0 -1
  207. package/web/chunk-f9m9seam.js +0 -1
  208. package/web/chunk-g2erm7k0.js +0 -1
  209. package/web/chunk-g3kbn0t2.js +0 -1
  210. package/web/chunk-ght0t49g.js +0 -1
  211. package/web/chunk-ghwm7bdj.js +0 -2
  212. package/web/chunk-h2txs73e.js +0 -39
  213. package/web/chunk-h3tkacc7.js +0 -1
  214. package/web/chunk-je78j3vr.js +0 -1
  215. package/web/chunk-kxdtg9dt.js +0 -1
  216. package/web/chunk-m9xzt9p7.js +0 -1
  217. package/web/chunk-ngt1j8py.js +0 -1139
  218. package/web/chunk-q34as3v6.js +0 -1
  219. package/web/chunk-qe0bgeda.js +0 -1
  220. package/web/chunk-sat7zyva.js +0 -1
  221. package/web/chunk-sk0hpa80.js +0 -1
  222. package/web/chunk-tvcxrx6h.js +0 -1
  223. package/web/chunk-tzpnh70q.js +0 -1
  224. package/web/chunk-vb7g4xg6.js +0 -1
  225. package/web/chunk-wzfe6jtq.js +0 -1
  226. package/web/chunk-xh4xn1az.js +0 -1
  227. package/web/chunk-xk904wqv.js +0 -1
  228. package/web/chunk-xzwxcxb4.js +0 -1
  229. package/web/chunk-yekaz74b.js +0 -1
  230. package/web/chunk-ys2tns0p.js +0 -1
package/ui-test-worker.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ur,Un,C,Bn,Fn,Wn,jr,$n,mt,Vr}from"./chunk-82v8jh1h.js";import{Dn,cr}from"./chunk-3mqf9ped.js";import"./chunk-4gtgqcct.js";import"./chunk-c71173py.js";import{i,r,Xe,Gt}from"./chunk-bwawt15q.js";var mh=r(function(FA){FA.removeLeadingAndTrailingHTTPWhitespace=(t)=>t.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");FA.removeTrailingHTTPWhitespace=(t)=>t.replace(/[ \t\n\r]+$/u,"");FA.isHTTPWhitespaceChar=(t)=>t===" "||t==="\t"||t===`
2
+ import{ur,Un,C,Bn,Fn,Wn,jr,$n,mt,Vr}from"./chunk-82v8jh1h.js";import{Dn,cr}from"./chunk-7er5pz7s.js";import"./chunk-4gtgqcct.js";import"./chunk-6mges89p.js";import{i,r,Xe,Gt}from"./chunk-bwawt15q.js";var mh=r(function(FA){FA.removeLeadingAndTrailingHTTPWhitespace=(t)=>t.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");FA.removeTrailingHTTPWhitespace=(t)=>t.replace(/[ \t\n\r]+$/u,"");FA.isHTTPWhitespaceChar=(t)=>t===" "||t==="\t"||t===`
3
3
  `||t==="\r";FA.solelyContainsHTTPTokenCodePoints=(t)=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(t);FA.soleyContainsHTTPQuotedStringTokenCodePoints=(t)=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(t);FA.asciiLowercase=(t)=>t.replace(/[A-Z]/ug,(e)=>e.toLowerCase());FA.collectAnHTTPQuotedString=(t,e)=>{let o="";e++;while(!0){while(e<t.length&&t[e]!=='"'&&t[e]!=="\\")o+=t[e],++e;if(e>=t.length)break;let s=t[e];if(++e,s==="\\"){if(e>=t.length){o+="\\";break}o+=t[e],++e}else break}return[o,e]}});var PS=r(function(z2,fS){var{asciiLowercase:Rc,solelyContainsHTTPTokenCodePoints:WA,soleyContainsHTTPQuotedStringTokenCodePoints:_A}=mh();fS.exports=class{constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=Rc(String(e)),this._map.get(e)}has(e){return e=Rc(String(e)),this._map.has(e)}set(e,o){if(e=Rc(String(e)),o=String(o),!WA(e))throw Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!_A(o))throw Error(`Invalid MIME type parameter value "${o}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,o)}clear(){this._map.clear()}delete(e){return e=Rc(String(e)),this._map.delete(e)}forEach(e,o){this._map.forEach(e,o)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var ES=r(function(J2,wS){var{removeLeadingAndTrailingHTTPWhitespace:YA,removeTrailingHTTPWhitespace:AS,isHTTPWhitespaceChar:KA,solelyContainsHTTPTokenCodePoints:cg,soleyContainsHTTPQuotedStringTokenCodePoints:QA,asciiLowercase:dg,collectAnHTTPQuotedString:jA}=mh();wS.exports=(t)=>{t=YA(t);let e=0,o="";while(e<t.length&&t[e]!=="/")o+=t[e],++e;if(o.length===0||!cg(o))return null;if(e>=t.length)return null;++e;let s="";while(e<t.length&&t[e]!==";")s+=t[e],++e;if(s=AS(s),s.length===0||!cg(s))return null;let n={type:dg(o),subtype:dg(s),parameters:new Map};while(e<t.length){++e;while(KA(t[e]))++e;let l="";while(e<t.length&&t[e]!==";"&&t[e]!=="=")l+=t[e],++e;if(l=dg(l),e<t.length){if(t[e]===";")continue;++e}let a=null;if(t[e]==='"'){[a,e]=jA(t,e);while(e<t.length&&t[e]!==";")++e}else{a="";while(e<t.length&&t[e]!==";")a+=t[e],++e;if(a=AS(a),a==="")continue}if(l.length>0&&cg(l)&&QA(a)&&!n.parameters.has(l))n.parameters.set(l,a)}return n}});var vS=r(function(Z2,xS){var{solelyContainsHTTPTokenCodePoints:qA}=mh();xS.exports=(t)=>{let e=`${t.type}/${t.subtype}`;if(t.parameters.size===0)return e;for(let[o,s]of t.parameters){if(e+=";",e+=o,e+="=",!qA(s)||s.length===0)s=s.replace(/(["\\])/ug,"\\$1"),s=`"${s}"`;e+=s}return e}});var LS=r(function(tU,NS){var $A=PS(),XA=ES(),zA=vS(),{asciiLowercase:TS,solelyContainsHTTPTokenCodePoints:CS}=mh();NS.exports=class{constructor(e){e=String(e);let o=XA(e);if(o===null)throw Error(`Could not parse MIME type string "${e}"`);this._type=o.type,this._subtype=o.subtype,this._parameters=new $A(o.parameters)}static parse(e){try{return new this(e)}catch(o){return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=TS(String(e)),e.length===0)throw Error("Invalid type: must be a non-empty string");if(!CS(e))throw Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=TS(String(e)),e.length===0)throw Error("Invalid subtype: must be a non-empty string");if(!CS(e))throw Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return zA(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var $d={};Xe($d,{PluginWebUIContext:()=>qd,SlotButton:()=>kw,useDraftReplace:()=>Lw,usePluginWebUI:()=>OS});var Lg={};Gt(Lg,{Fragment:()=>GS,jsxDEV:()=>US},{Fragment:(D5)=>GS=D5,jsxDEV:(D5)=>US=D5});var kg={};Gt(kg,{Fragment:()=>WS,jsx:()=>_S,jsxs:()=>YS},{Fragment:(B5)=>WS=B5,jsx:(B5)=>_S=B5,jsxs:(B5)=>YS=B5});var An=(t)=>globalThis.postMessage(t),lf=0,zd=new Map;function Rg(t,e){let o=lf++;return new Promise((s,n)=>{zd.set(o,{resolve:s,reject:n}),e.addEventListener("abort",()=>An({type:"cancel",id:o}),{once:!0}),An({type:"request",id:o,input:t})})}function Fg(t){let e=zd.get(t.id);if(zd.delete(t.id),t.error)e?.reject(Error(t.error));else if(t.response)e?.resolve(t.response)}var af="http://basalt.internal";function mf(t){if(!t.startsWith("/api/")||/[\\\r\n#]/.test(t)||!new URL(t,af).pathname.startsWith("/api/"))throw Error("request path must stay within /api/")}function yf(t,e){return new Promise((o,s)=>{let l=setTimeout(()=>{e.removeEventListener("abort",a),o()},t),a=()=>{clearTimeout(l),e.removeEventListener("abort",a),s(Error("Request aborted"))};e.addEventListener("abort",a,{once:!0})})}function pf(t){if(t===void 0||t===null)return;if(typeof t!=="string")throw Error("ui_test requests require a JSON string body");if(!t)return;let e=JSON.parse(t);if(!e||typeof e!=="object"||Array.isArray(e))throw Error("request body must be a JSON object");return e}function Vg(t,e){return{async request(o,s){mf(o);let n=(s?.method??"GET").toUpperCase(),l=s?.signal?AbortSignal.any([s.signal,e]):e;l.throwIfAborted();let a=`${n} ${o}`,y=t&&Object.hasOwn(t,a)?t[a]:void 0;if(y){if(await yf(y.delayMs??0,l),l.throwIfAborted(),y.status<200||y.status>=300)throw Error(`Request failed (${y.status})`);return structuredClone(y.body)}let u=await Rg({path:o,method:n,body:pf(s?.body)},l);if(l.throwIfAborted(),u.status<200||u.status>=300)throw Error(`Request failed (${u.status})`);if(u.truncated)throw Error("API response exceeds ui_test response limit");return JSON.parse(u.body)}}}function Dg(t,e){let o=t.ownerDocument;function s(E){for(let R=E;R;R=R.parentElement){if(R.hasAttribute("hidden")||R.getAttribute("aria-hidden")==="true")return!1;let H=e.getComputedStyle(R);if(H.display==="none"||H.visibility==="hidden")return!1}return!0}function n(E){let R=E.getAttribute("aria-label");if(R!==null)return R;let H=E.getAttribute("aria-labelledby");if(H)return H.split(/\s+/).map((pt)=>o.getElementById(pt)?.textContent??"").join(" ");if("labels"in E){let pt=Array.from(E.labels??[]);if(pt.length)return pt.map((gt)=>gt.textContent).join(" ")}return E.textContent??""}function l(E){return E.hasAttribute("disabled")||E.getAttribute("aria-disabled")==="true"}function a(E){let R=[],H=o.createTreeWalker(E,4);while(H.nextNode()){let pt=H.currentNode,gt=pt?.parentElement;if(gt&&!gt.closest("script,style,textarea")&&s(gt))R.push(pt?.textContent??"")}return R.join(" ").replace(/\s+/g," ").trim()}function y(){return Array.from(t.querySelectorAll("button,[role=button]")).filter(s).map((E)=>({name:n(E).trim(),disabled:l(E),busy:E.getAttribute("aria-busy")==="true"}))}function u(){return Array.from(t.querySelectorAll("input,textarea,select")).filter((E)=>E instanceof e.HTMLInputElement||E instanceof e.HTMLTextAreaElement||E instanceof e.HTMLSelectElement).filter(s).map((E)=>({label:n(E).trim(),value:E.value}))}function c(E=t,R=!0){let H=a(E),pt=y(),gt=u();if(!R)return{text:H,buttons:pt,values:gt,truncated:!1};let Rt=new TextEncoder().encode(H);return{text:new TextDecoder().decode(Rt.slice(0,2048),{stream:!0}),buttons:pt.slice(0,50),values:gt.slice(0,50),truncated:Rt.length>2048||pt.length>50||gt.length>50}}function d(E,R){let H=Array.from(t.querySelectorAll(E)).filter((pt)=>pt instanceof e.HTMLElement).filter((pt)=>s(pt)&&n(pt).trim()===R);if(H.length!==1||!H[0])throw Error(`Expected one control named ${JSON.stringify(R)}, found ${H.length}`);return H[0]}function g(E){let R=Array.from(t.querySelectorAll(E)).filter(s),H=R[0];if(R.length!==1||!(H instanceof e.HTMLElement))throw Error(`Expected one visible element for ${E}, found ${R.length}`);return H}function f(E,R){let H=200,pt=(gt,Rt)=>{H--;let lt=[];if(Rt<R)for(let dt of gt.children){if(!H)break;lt.push(pt(dt,Rt+1))}return{tag:gt.tagName.toLowerCase(),role:gt.getAttribute("role"),class:gt.className,text:Array.from(gt.childNodes).filter((dt)=>dt.nodeType===3).map((dt)=>dt.textContent).join(" ").trim(),childCount:gt.children.length,children:lt}};return pt(E,0)}return{visible:s,isDisabled:l,snapshot:c,findByName:d,selectOne:g,outline:f,count:(E)=>t.querySelectorAll(E).length,anyVisible:(E)=>Array.from(t.querySelectorAll(E)).some(s)}}var ci=Symbol("abort"),Me=Symbol("activeElement"),Pt=Symbol("asyncTaskManager"),di=Symbol("bodyBuffer"),Nt=Symbol("buffer"),qo=Symbol("cachedResponse"),bi=Symbol("callbacks"),wn=Symbol("checked"),Ns=Symbol("childNodes"),ir=Symbol("children"),Aa=Symbol("classList"),Zr=Symbol("connectedToNode"),Bi=Symbol("disconnectedFromNode"),sr=Symbol("connectedToDocument"),nr=Symbol("disconnectedFromDocument"),xl=Symbol("contentLength"),xe=Symbol("contentType"),fr=Symbol("cssText"),Oo=Symbol("currentScript"),Go=Symbol("currentTarget"),Kt=Symbol("data"),Lr=Symbol("defaultView"),At=Symbol("destroy"),En=Symbol("dirtyness"),Y=Symbol("end"),ze=Symbol("entries"),oE=Symbol("evaluateCSS"),Uo=Symbol("evaluateScript"),to=Symbol("exceptionObserver"),Ut=Symbol("formNode"),xn=Symbol("internalId"),F=Symbol("height"),Ls=Symbol("immediatePropagationStopped"),vn=Symbol("indeterminate"),ks=Symbol("isFirstWrite"),Ms=Symbol("isFirstWriteAfterOpen"),wa=Symbol("isInPassiveEventListener"),eo=Symbol("isValue"),Is=Symbol("listenerOptions"),he=Symbol("listeners"),Wr=Symbol("itemsByName"),Rs=Symbol("nextActiveElement"),vl=Symbol("observeMutations"),ro=Symbol("mutationListeners"),x=Symbol("ownerDocument"),xt=Symbol("ownerElement"),Fs=Symbol("propagationStopped"),Eo=Symbol("readyStateManager"),Pr=Symbol("referrer"),gi=Symbol("registry"),oo=Symbol("relList"),Ea=Symbol("resetSelection"),ve=Symbol("rootNode"),Ie=Symbol("selectNode"),Ar=Symbol("selectedness"),Tn=Symbol("selection"),Tm=Symbol("setupVMContext"),be=Symbol("shadowRoot"),O=Symbol("start"),ge=Symbol("style"),wr=Symbol("target"),Je=Symbol("textAreaNode"),xa=Symbol("unobserveMutations"),Oi=Symbol("reportMutation"),Cn=Symbol("updateSelectedness"),Pe=Symbol("url"),q=Symbol("value"),V=Symbol("width"),m=Symbol("window"),vh=Symbol("windowResizeListener"),Nn=Symbol("mutationObservers"),io=Symbol("openerFrame"),Si=Symbol("openerWindow"),Cm=Symbol("pointerCaptures"),Ln=Symbol("popup"),tt=Symbol("isConnected"),W=Symbol("parentNode"),D=Symbol("nodeType"),z=Symbol("tagName"),Ft=Symbol("prefix"),Jd=Symbol("scrollHeight"),Zd=Symbol("scrollWidth"),Th=Symbol("scrollTop"),Ch=Symbol("scrollLeft"),St=Symbol("attributes"),va=Symbol("attributesProxy"),J=Symbol("namespaceURI"),Ta=Symbol("accessKey"),iE=Symbol("accessKeyLabel"),tb=Symbol("offsetHeight"),eb=Symbol("offsetWidth"),rb=Symbol("offsetLeft"),ob=Symbol("offsetTop"),ib=Symbol("clientHeight"),sb=Symbol("clientWidth"),nb=Symbol("clientLeft"),lb=Symbol("clientTop"),rt=Symbol("name"),Nm=Symbol("specified"),Vs=Symbol("adoptedStyleSheets"),Nh=Symbol("implementation"),kn=Symbol("readyState"),Ds=Symbol("publicId"),Bs=Symbol("systemId"),Ce=Symbol("validationMessage"),Ke=Symbol("validity"),Lh=Symbol("returnValue"),Gi=Symbol("elements"),sE=Symbol("length"),ab=Symbol("complete"),mb=Symbol("naturalHeight"),yb=Symbol("naturalWidth"),Bg=Symbol("loading"),k=Symbol("x"),M=Symbol("y"),nE=Symbol("defaultChecked"),$o=Symbol("files"),Be=Symbol("sheet"),kh=Symbol("volume"),Tl=Symbol("paused"),Mh=Symbol("currentTime"),Ih=Symbol("playbackRate"),Rh=Symbol("defaultPlaybackRate"),Ca=Symbol("muted"),Cl=Symbol("defaultMuted"),Fh=Symbol("preservesPitch"),pb=Symbol("buffered"),ub=Symbol("duration"),Qe=Symbol("error"),hb=Symbol("ended"),cb=Symbol("networkState"),Vh=Symbol("textTracks"),db=Symbol("seeking"),bb=Symbol("seekable"),gb=Symbol("played"),Ui=Symbol("options"),so=Symbol("content"),Ee=Symbol("mode"),Mn=Symbol("host"),_r=Symbol("setURL"),ot=Symbol("localName"),Na=Symbol("classRegistry"),Lm=Symbol("nodeStream"),no=Symbol("location"),Oe=Symbol("history"),Dh=Symbol("navigator"),Bh=Symbol("screen"),Oh=Symbol("sessionStorage"),Gh=Symbol("localStorage"),km=Symbol("sandbox"),ct=Symbol("cloneNode"),Et=Symbol("appendChild"),hr=Symbol("removeChild"),kr=Symbol("insertBefore"),La=Symbol("replaceChild"),fi=Symbol("tracks"),ka=Symbol("constraints"),Pi=Symbol("capabilities"),In=Symbol("settings"),lE=Symbol("clone"),Os=Symbol("removeNamedItem"),Q=Symbol("items"),Rn=Symbol("selectedOptions"),dr=Symbol("styleNode"),Vn=Symbol("updateSheet"),Mr=Symbol("clearCache"),Re=Symbol("onSetAttribute"),br=Symbol("onRemoveAttribute"),_=Symbol("nodeArray"),bt=Symbol("elementArray"),U=Symbol("cache"),He=Symbol("affectsCache"),Ma=Symbol("forms"),Xo=Symbol("affectsComputedStyleCache"),Nl=Symbol("query"),Ll=Symbol("computedStyle"),lo=Symbol("getFormControlItems"),Mm=Symbol("getFormControlNamedItem"),Uh=Symbol("dataset"),aE=Symbol("getNamespaceItemKey"),mE=Symbol("getNamedItemKey"),Ai=Symbol("itemsByNamespaceURI"),Vt=Symbol("proxy"),zo=Symbol("setNamedItem"),Er=Symbol("getTokenList"),Gs=Symbol("attributeName"),Ho=Symbol("selectedIndex"),On=Symbol("self"),ao=Symbol("parent"),Jo=Symbol("top"),Im=Symbol("areas"),mo=Symbol("defaultValue"),wi=Symbol("elementIdMap"),Gn=Symbol("clonable"),kl=Symbol("delegatesFocus"),Hi=Symbol("serializable"),Ei=Symbol("slotAssignment"),Wi=Symbol("assignedNodes"),Zo=Symbol("assignedToSlot"),Rm=Symbol("cells"),Fm=Symbol("rows"),Hh=Symbol("headers"),Vm=Symbol("tBodies"),Ia=Symbol("track"),Dm=Symbol("controlsList"),Wh=Symbol("mediaKeys"),Sb=Symbol("remote"),_h=Symbol("sinkId"),Yh=Symbol("srcObject"),Ml=Symbol("cues"),fb=Symbol("activeCues"),xo=Symbol("kind"),Us=Symbol("label"),Il=Symbol("language"),Bm=Symbol("id"),h=Symbol("illegalConstructor"),Pb=Symbol("state"),Om=Symbol("canvas"),Hn=Symbol("popoverTargetElement"),Gm=Symbol("composed"),Hs=Symbol("bubbles"),_i=Symbol("cancelable"),lr=Symbol("defaultPrevented"),xr=Symbol("eventPhase"),Ab=Symbol("timeStamp"),Qt=Symbol("type"),Um=Symbol("detail"),yE=Symbol("globalObject"),Hm=Symbol("destroyed"),Se=Symbol("aborted"),Wm=Symbol("browserFrames"),Kh=Symbol("windowInternalId"),K=Symbol("getItemList"),Yi=Symbol("requiredExtensions"),Ki=Symbol("systemLanguage"),_m=Symbol("transform"),se=Symbol("baseVal"),ne=Symbol("animVal"),Ym=Symbol("pathLength"),pE=Symbol("unitType"),Qi=Symbol("viewBox"),Km=Symbol("markerUnits"),Qm=Symbol("markerWidth"),jm=Symbol("markerHeight"),Ze=Symbol("values"),qm=Symbol("orientType"),$m=Symbol("orientAngle"),Xm=Symbol("refX"),zm=Symbol("refY"),j=Symbol("readOnly"),ar=Symbol("preserveAspectRatio"),ji=Symbol("animatedPoints"),qi=Symbol("points"),$i=Symbol("rx"),Xi=Symbol("ry"),yo=Symbol("cx"),po=Symbol("cy"),zi=Symbol("r"),Jm=Symbol("clipPathUnits"),Zm=Symbol("maskUnits"),ty=Symbol("maskContentUnits"),ey=Symbol("filterUnits"),ry=Symbol("primitiveUnits"),Lt=Symbol("href"),Ji=Symbol("x1"),Zi=Symbol("y1"),ts=Symbol("x2"),es=Symbol("y2"),oy=Symbol("gradientUnits"),iy=Symbol("gradientTransform"),sy=Symbol("spreadMethod"),ny=Symbol("patternUnits"),ly=Symbol("patternContentUnits"),ay=Symbol("patternTransform"),my=Symbol("fx"),yy=Symbol("fy"),rs=Symbol("offset"),_n=Symbol("disabled"),py=Symbol("textLength"),uy=Symbol("lengthAdjust"),v=Symbol("getAttribute"),A=Symbol("setAttribute"),Ir=Symbol("z"),Rl=Symbol("w"),hy=Symbol("toArray"),Fl=Symbol("fromString"),vo=Symbol("fromArray"),uE=Symbol("angle"),kt=Symbol("m11"),Dt=Symbol("m12"),zt=Symbol("m13"),Jt=Symbol("m14"),Mt=Symbol("m21"),Bt=Symbol("m22"),Zt=Symbol("m23"),te=Symbol("m24"),Wt=Symbol("m31"),jt=Symbol("m32"),qt=Symbol("m33"),_t=Symbol("m34"),It=Symbol("m41"),Ot=Symbol("m42"),$t=Symbol("m43"),Xt=Symbol("m44"),Ra=Symbol("setMatrixValue"),To=Symbol("translateSelf"),Ws=Symbol("rotateSelf"),_s=Symbol("rotateAxisAngleSelf"),os=Symbol("scaleSelf"),cy=Symbol("scale3dSelf"),dy=Symbol("scaleNonUniformSelf"),Vl=Symbol("skewXSelf"),Dl=Symbol("skewYSelf"),Co=Symbol("multiplySelf"),Ys=Symbol("matrix"),hE=Symbol("domMatrix"),Ne=Symbol("getDOMMatrix"),gr=Symbol("setDOMMatrix"),I=Symbol("attributeValue"),by=Symbol("startOffset"),Ks=Symbol("method"),gy=Symbol("spacing"),at=Symbol("in1"),uo=Symbol("in2"),Z=Symbol("result"),Sy=Symbol("bias"),fy=Symbol("divisor"),is=Symbol("edgeMode"),Py=Symbol("kernelMatrix"),ho=Symbol("kernelUnitLengthX"),co=Symbol("kernelUnitLengthY"),Ay=Symbol("orderX"),wy=Symbol("orderY"),Ey=Symbol("preserveAlpha"),xy=Symbol("targetX"),vy=Symbol("targetY"),Ty=Symbol("diffuseConstant"),ss=Symbol("surfaceScale"),Cy=Symbol("scale"),Ny=Symbol("xChannelSelector"),Ly=Symbol("yChannelSelector"),ky=Symbol("azimuth"),My=Symbol("elevation"),bo=Symbol("dx"),go=Symbol("dy"),ns=Symbol("stdDeviationX"),ls=Symbol("stdDeviationY"),Iy=Symbol("tableValues"),Ry=Symbol("slope"),Fy=Symbol("intercept"),Vy=Symbol("amplitude"),Dy=Symbol("exponent"),Og=Symbol("crossOrigin"),By=Symbol("operator"),Oy=Symbol("radiusX"),Gy=Symbol("radiusY"),Uy=Symbol("specularConstant"),as=Symbol("specularExponent"),Hy=Symbol("pointsAtX"),Wy=Symbol("pointsAtY"),_y=Symbol("pointsAtZ"),Yy=Symbol("limitingConeAngle"),Ky=Symbol("baseFrequencyX"),Qy=Symbol("baseFrequencyY"),jy=Symbol("numOctaves"),qy=Symbol("seed"),$y=Symbol("stitchTiles"),Xy=Symbol("rotateFromVectorSelf"),zy=Symbol("flipXSelf"),Jy=Symbol("flipYSelf"),Zy=Symbol("invertSelf"),wb=Symbol("getLength"),Qh=Symbol("currentScale"),tp=Symbol("rotate"),Eb=Symbol("bindMethods"),Yn=Symbol("xmlProcessingInstruction"),cE=Symbol("root"),Wo=Symbol("filterNode"),Qs=Symbol("customElementReactionStack"),Kn=Symbol("dispatching"),ms=Symbol("modules"),Rr=Symbol("preloads"),js=Symbol("body"),jh=Symbol("redirect"),Fa=Symbol("referrerPolicy"),qh=Symbol("signal"),xi=Symbol("bodyUsed"),$h=Symbol("credentials"),ep=Symbol("blocking"),Bl=Symbol("moduleImportMap"),le=Symbol("dispatchError"),Xh=Symbol("supports"),No=Symbol("reason"),p=Symbol("propertyEventListeners"),We=Symbol("cssRules"),qs=Symbol("parentRule"),Lo=Symbol("parentStyleSheet"),So=Symbol("conditionText"),ys=Symbol("keyText"),xb=Symbol("media"),rp=Symbol("styleMap"),Ol=Symbol("selectorText"),Gl=Symbol("cssParser"),$s=Symbol("cssRule"),Fr=Symbol("rulePrefix"),Yr=Symbol("virtualServerFile"),vb=Symbol("frames"),Xs=Symbol("disableEvaluation"),Tb=Symbol("validateJavaScriptExecutionEnvironment"),dE=Symbol("currentNode"),Qn=Symbol("openWebSockets"),vr=Symbol("webSocket"),Va=Symbol("moduleCache");var Cb;(function(t){t.strict="Strict",t.lax="Lax",t.none="None"})(Cb||(Cb={}));var zs=Cb;var zh={key:null,originURL:null,value:null,domain:"",path:"",expires:null,httpOnly:!1,secure:!1,sameSite:zs.lax};class op{static hasExpired(t){return t.expires&&t.expires.getTime()<Date.now()}}class Jh{static cookieMatchesURL(t,e){let o=e.hostname==="localhost"||e.hostname?.endsWith(".localhost");return(!t.secure||e.protocol==="https:"||o)&&(!t.domain||e.hostname?.endsWith(t.domain))&&(!t.path||e.pathname?.startsWith(t.path))&&(t.sameSite===zs.none&&t.secure||t.originURL?.hostname===e.hostname)}}class ip{#t=[];addCookies(t){let e=new Map,o=(s)=>`${s.key}-${s.originURL.hostname}-${s.path}-${typeof s.value}`;for(let s=0,n=this.#t.length;s<n;s++)e.set(o(this.#t[s]),s);for(let s of t){let n=Object.assign({},zh,s);if(n&&n.key&&n.originURL){let l=e.get(o(n));if(l!==void 0)this.#t.splice(l,1);if(!op.hasExpired(n))e.set(o(n),this.#t.length),this.#t.push(n)}}}getCookies(t=null,e=!1){let o=[];for(let s of this.#t)if(!op.hasExpired(s)&&(!e||!s.httpOnly)&&(!t||Jh.cookieMatchesURL(s,t)))o.push(s);return o}clearCookies(){this.#t=[]}}var Nb;(function(t){t.fresh="fresh",t.stale="stale"})(Nb||(Nb={}));var jn=Nb;var Lb;(function(t){t.invalidStateError="InvalidStateError",t.indexSizeError="IndexSizeError",t.syntaxError="SyntaxError",t.hierarchyRequestError="HierarchyRequestError",t.notSupportedError="NotSupportedError",t.wrongDocumentError="WrongDocumentError",t.invalidNodeTypeError="InvalidNodeTypeError",t.invalidCharacterError="InvalidCharacterError",t.notFoundError="NotFoundError",t.securityError="SecurityError",t.networkError="NetworkError",t.domException="DOMException",t.invalidAccessError="InvalidAccessError",t.unknownError="UnknownError",t.abortError="AbortError",t.timeoutError="TimeoutError",t.encodingError="EncodingError",t.uriMismatchError="URIMismatchError",t.inUseAttributeError="InUseAttributeError",t.namespaceError="NamespaceError"})(Lb||(Lb={}));var w=Lb;class re extends Error{constructor(t,e=null){super(t);this.name=e||w.domException}}class vi{[ze]={};constructor(t){if(t)if(t instanceof vi)this[ze]=JSON.parse(JSON.stringify(t[ze]));else if(Array.isArray(t))for(let e of t){if(e.length!==2)throw new re('Failed to construct "Headers": The provided init is not a valid array.',w.invalidStateError);this.append(e[0],e[1])}else for(let e of Object.keys(t))this.set(e,t[e])}append(t,e){let o=t.toLowerCase();if(this[ze][o])this[ze][o].value.push(e);else this[ze][o]={name:t,value:[e]}}delete(t){delete this[ze][t.toLowerCase()]}get(t){return this[ze][t.toLowerCase()]?.value.join(", ")??null}set(t,e){this[ze][t.toLowerCase()]={name:t,value:[e]}}getSetCookie(){let t=this[ze]["set-cookie"];if(!t)return[];return t.value}has(t){return!!this[ze][t.toLowerCase()]}forEach(t,e){let o=e??this[m];for(let s of Object.values(this[ze]))t.call(o,s.value.join(", "),s.name,this)}*keys(){for(let t of Object.values(this[ze]))yield t.name}*values(){for(let t of Object.values(this[ze]))yield t.value.join(", ")}*entries(){for(let t of Object.values(this[ze]))yield[t.name,t.value.join(", ")]}*[Symbol.iterator](){for(let t of Object.values(this[ze]))yield[t.name,t.value.join(", ")]}}import Da from"fs";import Ba from"path";import uf from"crypto";class Zh{#t=new Set;#e=new Set;#r;constructor(t){this.#r=t}async load(t){if(!t)throw Error("Failed to execute 'load' on 'ResponseCacheFileSystem': Directory is not specified.");let e=Ba.resolve(t),o=[];try{o=await Da.promises.readdir(e)}catch(l){return}let s=[],n=this.#r;for(let l of o)if(l.endsWith(".json"))s.push(Da.promises.readFile(Ba.join(e,l),"utf8").then((a)=>{let y=JSON.parse(a);if(y.response&&y.request&&!y.virtual)return y.response.headers=new vi(y.response.headers),y.request.headers=new vi(y.request.headers),Da.promises.readFile(Ba.join(e,l.split(".")[0]+".data")).then((u)=>{y.response.body=u;let c=n.get(y.response.url);if(!c)c=[],n.set(y.response.url,c);c.push(y)}).catch(()=>{let u=n.get(y.response.url);if(!u)u=[],n.set(y.response.url,u);u.push(y)})}).catch(()=>{}));await Promise.all(s)}async save(t){if(!t)throw Error("Failed to execute 'store' on 'ResponseCacheFileSystem': Directory is not specified.");if(!this.#r.size)return;let e=Ba.resolve(t);if(!this.#t.has(e)){this.#t.add(e);try{await Da.promises.mkdir(e,{recursive:!0})}catch(l){}}let s=this.#r,n=[];for(let l of s.values())for(let a of l)if(!a.virtual){let y={},u={};for(let[f,E]of a.response.headers.entries())y[f]=E;for(let[f,E]of a.request.headers.entries())u[f]=E;let c={...a,response:{...a.response,headers:y,body:null},request:{...a.request,headers:u}},d=JSON.stringify(c,null,3),g=uf.createHash("md5").update(d).digest("hex");if(!this.#e.has(g)){if(this.#e.add(g),n.push(Da.promises.writeFile(Ba.join(e,`${g}.json`),d)),a.response.body)n.push(Da.promises.writeFile(Ba.join(e,`${g}.data`),a.response.body))}}await Promise.all(n)}}var hf=["Cache-Control","Last-Modified","Vary","ETag"];class sp{fileSystem;#t=new Map;constructor(){this.fileSystem=new Zh(this.#t)}get(t){if(t.headers.get("Cache-Control")?.includes("no-cache"))return null;let e=t.url,o=this.#t.get(e);if(o)for(let s=0,n=o.length;s<n;s++){let l=o[s],a=l.request.method===t.method;if(a)for(let y of Object.keys(l.vary)){let u=t.headers.get(y);if(u!==null&&l.vary[y]!==u){a=!1;break}}if(a){if(l.expires&&l.expires<Date.now()){if(l.lastModified)l.state=jn.stale;else if(!l.etag)return o.splice(s,1),null}return l}}return null}add(t,e){if(t.method!=="GET"&&t.method!=="HEAD"||t.headers.get("Cache-Control")?.includes("no-cache"))return null;let o=t.url,s=this.get(t);if(e.status===304){if(!s)throw Error("ResponseCache: Cached response not found.");for(let n of hf)if(e.headers.has(n))s.response.headers.set(n,e.headers.get(n));s.cacheUpdateTime=Date.now(),s.state=jn.fresh}else{if(s){let l=this.#t.get(o);if(l){let a=l.indexOf(s);if(a!==-1)l.splice(a,1)}}s={response:{status:e.status,statusText:e.statusText,url:e.url,headers:new vi(e.headers),waitingForBody:e.waitingForBody,body:e.body??null},request:{headers:t.headers,method:t.method},vary:{},expires:null,etag:null,cacheUpdateTime:Date.now(),lastModified:null,mustRevalidate:!1,staleWhileRevalidate:!1,state:jn.fresh,virtual:e.virtual??!1};let n=this.#t.get(o);if(!n)n=[],this.#t.set(o,n);n.push(s)}if(e.headers.has("Cache-Control")){let n=e.headers.get("Age");for(let l of e.headers.get("Cache-Control").split(",")){let[a,y]=l.trim().split("=");switch(a){case"max-age":s.expires=Date.now()+parseFloat(y)*1000-(n?parseFloat(n)*1000:0);break;case"no-cache":case"no-store":let u=this.#t.get(o);if(u){let c=u.indexOf(s);if(c!==-1)u.splice(c,1)}return null;case"must-revalidate":s.mustRevalidate=!0;break;case"stale-while-revalidate":s.staleWhileRevalidate=!0;break}}}if(e.headers.has("Last-Modified"))s.lastModified=Date.parse(e.headers.get("Last-Modified"));if(e.headers.has("Vary"))for(let n of e.headers.get("Vary").split(",")){let l=n.trim(),a=t.headers.get(l);if(a)s.vary[l]=a}if(e.headers.has("ETag"))s.etag=e.headers.get("ETag");if(!s.expires){let n=e.headers.get("Expires");if(n)s.expires=Date.parse(n)}if(!s.etag&&(!s.expires||s.expires<Date.now())){let n=this.#t.get(o);if(n){let l=n.indexOf(s);if(l!==-1)n.splice(l,1)}return null}return s}clear(t){if(t){if(t.toTime)for(let e of t.url?[t.url]:this.#t.keys()){let o=this.#t.get(e);if(o){for(let s=0,n=o.length;s<n;s++)if(o[s].cacheUpdateTime<t.toTime)o.splice(s,1),s--,n--}}else if(t.url)this.#t.delete(t.url)}else this.#t.clear()}}var kb;(function(t){t[t.log=0]="log",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error"})(kb||(kb={}));var mr=kb;var Mb;(function(t){t[t.elementNode=1]="elementNode",t[t.attributeNode=2]="attributeNode",t[t.textNode=3]="textNode",t[t.cdataSectionNode=4]="cdataSectionNode",t[t.commentNode=8]="commentNode",t[t.documentNode=9]="documentNode",t[t.documentTypeNode=10]="documentTypeNode",t[t.documentFragmentNode=11]="documentFragmentNode",t[t.processingInstructionNode=7]="processingInstructionNode"})(Mb||(Mb={}));var T=Mb;var Ib;(function(t){t[t.none=0]="none",t[t.capturing=1]="capturing",t[t.atTarget=2]="atTarget",t[t.bubbling=3]="bubbling"})(Ib||(Ib={}));var ae=Ib;class N{static NONE=ae.none;static CAPTURING_PHASE=ae.capturing;static AT_TARGET=ae.atTarget;static BUBBLING_PHASE=ae.bubbling;NONE=N.NONE;CAPTURING_PHASE=N.CAPTURING_PHASE;AT_TARGET=N.AT_TARGET;BUBBLING_PHASE=N.BUBBLING_PHASE;[Gm]=!1;[Hs]=!1;[_i]=!1;[lr]=!1;[xr]=ae.none;[Ab]=performance.now();[Qt];[Kn]=!1;[Ls]=!1;[Fs]=!1;[wr]=null;[Go]=null;[wa]=!1;constructor(t,e=null){this[Qt]=t,this[Hs]=e?.bubbles??!1,this[_i]=e?.cancelable??!1,this[Gm]=e?.composed??!1}get composed(){return this[Gm]}get bubbles(){return this[Hs]}get cancelable(){return this[_i]}get defaultPrevented(){return this[lr]}get eventPhase(){return this[xr]}get timeStamp(){return this[Ab]}get type(){return this[Qt]}get target(){return this[wr]}get currentTarget(){return this[Go]}get cancelBubble(){return this[Fs]}composedPath(){if(!this[wr])return[];let t=[],e=this[wr];while(e)if(t.push(e),e.parentNode)e=e.parentNode;else if(this[Gm]&&e[D]===T.documentFragmentNode&&e.host)e=e.host;else if(e[D]===T.documentNode&&this[Qt]!=="load")e=e[m];else break;return t}initEvent(t,e=!1,o=!1){this[Qt]=t,this[Hs]=e,this[_i]=o,this[Fs]=!1,this[Ls]=!1,this[lr]=!1}preventDefault(){if(!this[wa]&&this.cancelable)this[lr]=!0}stopImmediatePropagation(){this[Ls]=!0}stopPropagation(){this[Fs]=!0}}var Rb;(function(t){t.log="log",t.table="table",t.trace="trace",t.dir="dir",t.dirxml="dirxml",t.group="group",t.groupCollapsed="groupCollapsed",t.debug="debug",t.timeLog="timeLog",t.info="info",t.count="count",t.timeEnd="timeEnd",t.warn="warn",t.countReset="countReset",t.error="error",t.assert="assert"})(Rb||(Rb={}));var Fe=Rb;class tc{static toString(t){if(this.isLogEntryCollapsed(t))return"";let e=this.getLogEntryGroupTabbing(t),o=e;for(let s of t.message)if(o+=o!==""&&o!==e?" ":"",typeof s==="object"&&(s===null||s.constructor.name==="Object"||Array.isArray(s)))try{o+=JSON.stringify(s)}catch(n){o+=Error("Failed to JSON stringify object in log entry.").stack.replace(/\n at/gm,`
4
4
  `+e+"at")}else if(typeof s==="object"&&s.message&&s.stack)o+=s.stack.replace(/\n at/gm,`
5
5
  `+e+"at");else o+=this.getLogEntryIcon(t)+String(s);return o+`
@@ -222,5 +222,5 @@ It is recommended to disable code generation and freeze all builtins at process
222
222
  For more information, see https://github.com/capricorn86/happy-dom/wiki/JavaScript-Evaluation-Warning
223
223
 
224
224
  `)}[At](){if(this.closed)return;super[At](),this.closed=!0;let t=this[Nn];for(let n of t)if(n[At])n[At]();this[Nn]=[];for(let n of this[Qn])n[At]();this[Qn]=[],this.document[At]();let e=this.document.createElement("html"),o=this.document.createElement("head"),s=this.document.createElement("body");if(e.appendChild(o),e.appendChild(s),this.document[Et](e),this.location[At])this.location[At]();if(this.customElements[At])this.customElements[At]();if(this.history[At])this.history[At]();this[ms].json.clear(),this[ms].css.clear(),this[ms].esm.clear(),this.document[Rr].clear(),this.document[Me]=null,this.document[Rs]=null,this.document[Oo]=null,this.document[Tn]=null,this[ao]=null,this[Jo]=null,it.removeWindowBrowserFrameRelation(this)}[Eb](){for(let t of[El,vt]){let e=Object.getOwnPropertyDescriptors(t.prototype),o=Object.keys(e);for(let s of o){let n=e[s];if(n.get||n.set)Object.defineProperty(this,s,{...n,get:n.get?.bind(this),set:n.set?.bind(this)});else if(s!=="constructor"&&typeof n.value==="function"&&!n.value.toString().startsWith("class "))Object.defineProperty(this,s,{...n,value:n.value.bind(this)})}}}}import{Script as xw}from"vm";class Pm{static evaluate(t,e){if(!t.window)throw Error('The frame has been destroyed, the "window" property is not set.');return e=typeof e==="string"?new xw(e):e,e.runInContext(t.window)}static async evaluateModule(t,e){if(!t.window)throw Error('The frame has been destroyed, the "window" property is not set.');let o=t.window;if(e?.code){let s=e.url?new URL(e.url,o.location.href):o.location,n=e.code;switch(e?.type||"esm"){case"esm":let l=new Qo(o,s);return await new pn({window:o,url:s,source:n,factory:l}).evaluate();case"json":return await new mm({window:o,url:s,source:n}).evaluate();case"css":return await new am({window:o,url:s,source:n}).evaluate()}}if(e?.url)return await(await new Qo(o,o.location).getModule(e.url,{with:{type:e.type||"esm"}})).evaluate();return{}}}class dh{currentItem={title:"",href:"about:blank",state:null,popState:!1,scrollRestoration:ii.auto,method:"GET",formData:null};items=[this.currentItem];push(t){let e=this.items.indexOf(this.currentItem);if(e!==this.items.length-1)this.items.length=e+1;this.items.push(t),this.currentItem=t}replace(t){let e=this.items.indexOf(this.currentItem);if(e!==this.items.length-1)this.items.length=e+1;if(e===-1)throw Error("Current history item not found");this.currentItem=t,this.items[e]=t}clear(){this.items.length=0,this.currentItem={title:"",href:"about:blank",state:null,popState:!1,scrollRestoration:ii.auto,method:"GET",formData:null},this.items.push(this.currentItem)}}class Am{#t;#e={};#r={};#o=0;#i=[];constructor(t){this.#t=t}assert(t,e,...o){if(!t)this.#t.print({type:Fe.assert,level:mr.error,message:["Assertion failed:",...e?[e,...o]:o],group:this.#i[this.#i.length-1]||null})}clear(){this.#t.clear()}count(t="default"){if(!this.#e[t])this.#e[t]=0;this.#e[t]++,this.#t.print({type:Fe.count,level:mr.info,message:[`${t}: ${this.#e[t]}`],group:this.#i[this.#i.length-1]||null})}countReset(t="default"){delete this.#e[t],this.#t.print({type:Fe.countReset,level:mr.warn,message:[`${t}: 0`],group:this.#i[this.#i.length-1]||null})}debug(t,...e){this.#t.print({type:Fe.debug,level:mr.log,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}dir(t){this.#t.print({type:Fe.dir,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}dirxml(t){this.#t.print({type:Fe.dirxml,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}error(t,...e){this.#t.print({type:Fe.error,level:mr.error,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}exception(...t){this.error(...t)}group(t){this.#o++;let e={id:this.#o,label:t||"default",collapsed:!1,parent:this.#i[this.#i.length-1]||null};this.#i.push(e),this.#t.print({type:Fe.group,level:mr.log,message:[t||"default"],group:e})}groupCollapsed(t){this.#o++;let e={id:this.#o,label:t||"default",collapsed:!0,parent:this.#i[this.#i.length-1]||null};this.#i.push(e),this.#t.print({type:Fe.groupCollapsed,level:mr.log,message:[t||"default"],group:e})}groupEnd(){if(this.#i.length===0)return;this.#i.pop()}info(t,...e){this.#t.print({type:Fe.info,level:mr.info,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}log(t,...e){this.#t.print({type:Fe.log,level:mr.log,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}profile(){throw Error("Method not implemented.")}profileEnd(){throw Error("Method not implemented.")}table(t){this.#t.print({type:Fe.table,level:mr.log,message:[t],group:this.#i[this.#i.length-1]||null})}time(t="default"){this.#r[t]=performance.now()}timeEnd(t="default"){let e=this.#r[t];if(e){let o=performance.now()-e;this.#t.print({type:Fe.timeEnd,level:mr.info,message:[`${t}: ${o}ms - timer ended`],group:this.#i[this.#i.length-1]||null})}}timeLog(t="default",...e){let o=this.#r[t];if(o){let s=performance.now()-o;this.#t.print({type:Fe.timeLog,level:mr.info,message:[`${t}: ${s}ms`,...e],group:this.#i[this.#i.length-1]||null})}}timeStamp(){throw Error("Method not implemented.")}trace(t,...e){this.#t.print({type:Fe.trace,level:mr.log,message:[...t?[t,...e]:e,Error("stack").stack.replace("Error: stack","")],group:this.#i[this.#i.length-1]||null})}warn(t,...e){this.#t.print({type:Fe.warn,level:mr.warn,message:t?[t,...e]:e,group:this.#i[this.#i.length-1]||null})}}class wm{static getFrames(t){return this.findFrames(t.mainFrame)}static closePage(t){if(t.closed)return Promise.resolve();t.closed=!0;let e=t.context.pages.indexOf(t);if(e!==-1)t.context.pages.splice(e,1);return t.virtualConsolePrinter.close(),As.destroyFrame(t.mainFrame)}static findFrames(t){let e=[t];for(let o of t.childFrames)e=e.concat(this.findFrames(o));return e}}class bh{#t=new Map;get(t){let e=this.#t.get(t.url);if(e){if(e.expires<Date.now())return this.#t.delete(t.url),null;return e}return null}add(t,e){if(this.#t.delete(t.url),t.headers.get("Cache-Control")?.includes("no-cache"))return null;if(e.status<200||e.status>=300)return null;let o=e.headers.get("Access-Control-Max-Age"),s=e.headers.get("Access-Control-Allow-Origin");if(!o||!s)return null;let n=[];if(e.headers.has("Access-Control-Allow-Methods")){if(e.headers.get("Access-Control-Allow-Methods")!=="*")for(let y of e.headers.get("Access-Control-Allow-Methods").split(","))n.push(y.trim().toUpperCase())}let l={allowOrigin:s,allowMethods:n,expires:Date.now()+parseInt(o)*1000};if(isNaN(l.expires)||l.expires<Date.now())return null;return this.#t.set(t.url,l),l}clear(){this.#t.clear()}}var BS={version:"20.9.0"};var Di={disableJavaScriptEvaluation:!1,enableJavaScriptEvaluation:!1,disableJavaScriptFileLoading:!1,disableCSSFileLoading:!1,disableIframePageLoading:!1,disableComputedStyleRendering:!1,handleDisabledFileLoadingAsSuccess:!1,disableErrorCapturing:!1,errorCapture:me.tryAndCatch,enableFileSystemHttpRequests:!1,suppressCodeGenerationFromStringsWarning:!1,suppressInsecureJavaScriptEnvironmentWarning:!1,timer:{maxTimeout:-1,maxIntervalTime:-1,maxIntervalIterations:-1,preventTimerLoops:!1},fetch:{disableSameOriginPolicy:!1,disableStrictSSL:!1,interceptor:null,requestHeaders:null,virtualServers:null},module:{resolveNodeModules:null,urlResolver:null,disableCache:!1},navigation:{disableMainFrameNavigation:!1,disableChildFrameNavigation:!1,disableChildPageNavigation:!1,disableFallbackToSetURL:!1,crossOriginPolicy:im.anyOrigin,beforeContentCallback:null},navigator:{userAgent:`Mozilla/5.0 (X11; ${process.platform.charAt(0).toUpperCase()+process.platform.slice(1)+" "+process.arch}) AppleWebKit/537.36 (KHTML, like Gecko) HappyDOM/${BS.version}`,maxTouchPoints:0},device:{prefersColorScheme:"light",prefersReducedMotion:"no-preference",mediaType:"screen",forcedColors:"none"},debug:{traceWaitUntilComplete:-1},viewport:{width:1024,height:768,devicePixelRatio:1}};class gh{static createSettings(t){if(t)this.validate(Di,t);return{...Di,...t,navigation:{...Di.navigation,...t?.navigation},navigator:{...Di.navigator,...t?.navigator},timer:{...Di.timer,...t?.timer},fetch:{...Di.fetch,...t?.fetch},module:{...Di.module,...t?.module},device:{...Di.device,...t?.device},debug:{...Di.debug,...t?.debug},viewport:{...Di.viewport,...t?.viewport}}}static validate(t,e,o){for(let s of Object.keys(e)){if(t[s]===void 0){let n=o?o+"."+s:s;throw Error(`Unknown browser setting "${n}"`)}if(typeof t[s]==="object"&&!Array.isArray(t[s])&&t[s]!==null){let n=o?o+"."+s:s;if(typeof e[s]!=="object"||Array.isArray(e[s])||e[s]===null)throw Error(`Browser setting "${n}" cannot be null`);this.validate(t[s],e[s],n)}else if((typeof t[s]==="boolean"||typeof t[s]==="number"||typeof t[s]==="string")&&typeof e[s]!==typeof t[s]){if(!(s==="preventTimerLoops"&&typeof e[s]==="object"&&e[s]!==null)){let l=o?o+"."+s:s;throw Error(`Browser setting "${l}" must be of type "${typeof t[s]}"`)}}}}}class Sh{static listenerCount=0;observedWindows=[];uncaughtExceptionListener=null;uncaughtRejectionListener=null;observe(t){if(this.observedWindows.includes(t))throw Error("Browser window is already being observed.");if(this.observedWindows.push(t),this.uncaughtExceptionListener)return;this.uncaughtExceptionListener=(e,o)=>{if(o==="unhandledRejection")return;let s=null;for(let n of this.observedWindows)if(e instanceof n.Error||e instanceof n.DOMException){s=n;break}if(s)s.console.error(e),s.dispatchEvent(new s.ErrorEvent("error",{error:e,message:e.message}));else if(process.listenerCount("uncaughtException")===this.constructor.listenerCount)console.error(e),process.exit(1)},this.uncaughtRejectionListener=(e)=>{let o=null;for(let s of this.observedWindows)if(e instanceof s.Error||e instanceof s.DOMException){o=s;break}if(o)o.console.error(e),o.dispatchEvent(new o.ErrorEvent("error",{error:e,message:e.message}));else if(process.listenerCount("unhandledRejection")===this.constructor.listenerCount)console.error(e),process.exit(1)},this.constructor.listenerCount++,process.on("uncaughtException",this.uncaughtExceptionListener),process.on("unhandledRejection",this.uncaughtRejectionListener)}disconnect(t){let e=this.observedWindows.indexOf(t);if(e===-1)return;if(this.observedWindows.splice(e,1),this.observedWindows.length===0&&this.uncaughtExceptionListener){if(this.constructor.listenerCount--,process.off("uncaughtException",this.uncaughtExceptionListener),this.uncaughtRejectionListener)process.off("unhandledRejection",this.uncaughtRejectionListener);this.uncaughtExceptionListener=null,this.uncaughtRejectionListener=null}}}class fh{childFrames=[];parentFrame=null;page;closed=!1;[Pt]=new Js(this);[he]={navigation:[]};[io]=null;[Si]=null;[Ln]=!1;[Oe]=new dh;constructor(t){if(this.page=t,t.context.browser.contexts[0]?.pages[0]?.mainFrame){if(this.window=new this.page.context.browser.windowClass(this),t.context.browser[to])t.context.browser[to].observe(this.window)}}get content(){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');return this.window.document.documentElement.outerHTML}set content(t){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');this.window.document[ks]=!0,this.window.document[Ms]=!1,this.window.document.open(),this.window.document.write(t)}get url(){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');return this.window.location.href}set url(t){if(!this.window)throw Error('The frame has been destroyed, the "window" property is not set.');this.window[no][_r](this,Fo.getRelativeURL(this,t).href)}get document(){return this.window?.document??null}async waitUntilComplete(){await Promise.all([this[Pt].waitUntilComplete(),...this.childFrames.map((t)=>t.waitUntilComplete())])}waitForNavigation(){return new Promise((t)=>this[he].navigation.push(t))}abort(){if(!this.childFrames.length)return this[Pt].abort();return new Promise((t,e)=>{Promise.all(this.childFrames.map((o)=>o.abort()).concat([this[Pt].abort()])).then(()=>t()).catch(e)})}evaluate(t){return Pm.evaluate(this,t)}evaluateModule(t){return Pm.evaluateModule(this,t)}goto(t,e){return Xr.navigate({windowClass:this.page.context.browser.windowClass,frame:this,url:t,goToOptions:e})}goBack(t){return Xr.navigateBack({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}goForward(t){return Xr.navigateForward({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}goSteps(t,e){return Xr.navigateSteps({windowClass:this.page.context.browser.windowClass,frame:this,steps:t,goToOptions:e})}reload(t){return Xr.reload({windowClass:this.page.context.browser.windowClass,frame:this,goToOptions:t})}}class Em{virtualConsolePrinter=new Oa;mainFrame;context;console;viewport;closed=!1;constructor(t){this.context=t,this.console=t.browser.console??new Am(this.virtualConsolePrinter),this.mainFrame=new fh(this),this.viewport={width:t.browser.settings.viewport.width,height:t.browser.settings.viewport.height,devicePixelRatio:t.browser.settings.viewport.devicePixelRatio}}get frames(){return wm.getFrames(this)}get content(){return this.mainFrame.content}set content(t){this.mainFrame.content=t}get url(){return this.mainFrame.url}set url(t){this.mainFrame.url=t}close(){return new Promise((t,e)=>{let o=this.context;wm.closePage(this).then(()=>{if(o.pages[0]===this)o.browser.close().then(t).catch(e);else t()}).catch(e)})}waitUntilComplete(){return this.mainFrame.waitUntilComplete()}waitForNavigation(){return this.mainFrame.waitForNavigation()}abort(){return this.mainFrame.abort()}evaluate(t){return this.mainFrame.evaluate(t)}evaluateModule(t){return this.mainFrame.evaluateModule(t)}setViewport(t){let e=Object.assign({},this.viewport);if(Object.assign(this.viewport,t),e.width!==this.viewport.width||e.height!==this.viewport.height||e.devicePixelRatio!==this.viewport.devicePixelRatio)this.mainFrame.window.dispatchEvent(new N("resize"))}goto(t,e){return this.mainFrame.goto(t,e)}goBack(t){return this.mainFrame.goBack(t)}goForward(t){return this.mainFrame.goForward(t)}goSteps(t,e){return this.mainFrame.goSteps(t,e)}reload(t){return this.mainFrame.reload(t)}}class Ph{pages;browser;cookieContainer=new ip;responseCache=new sp;preflightResponseCache=new bh;closed=!1;[Va]=new Map;constructor(t){this.browser=t,this.pages=[],this.pages.push(new Em(this))}async close(){if(this.closed)return;if(this.browser.contexts[0]===this)throw Error("Cannot close the default context. Use `browser.close()` to close the browser instead.");this.closed=!0,await Promise.all(this.pages.slice().map((o)=>o.close()));let t=this.browser,e=t.contexts.indexOf(this);if(e!==-1)t.contexts.splice(e,1);this.pages=[],this.cookieContainer.clearCookies(),this.responseCache.clear(),this.preflightResponseCache.clear()}async waitUntilComplete(){await Promise.all(this.pages.map((t)=>t.waitUntilComplete()))}abort(){return new Promise((t,e)=>{if(!this.pages.length){t();return}Promise.all(this.pages.slice().map((o)=>o.abort())).then(()=>t()).catch((o)=>e(o))})}newPage(){let t=new Em(this);return this.pages.push(t),t}}class Ah{contexts;settings;console;windowClass;[to]=null;constructor(t,e){if(this.windowClass=t,this.console=e?.console||null,this.settings=gh.createSettings(e?.settings),this.settings.errorCapture===me.processLevel)this[to]=new Sh;this.contexts=[],this.contexts.push(new Ph(this))}get closed(){return this.contexts.length===0}get defaultContext(){if(this.contexts.length===0)throw Error("No default context. The browser has been closed.");return this.contexts[0]}async close(){if(this.contexts.length===0)return;let t=this.contexts;this.contexts=[],await Promise.all(t.map((e)=>e.close()))}async waitUntilComplete(){await Promise.all(this.contexts.map((t)=>t.waitUntilComplete()))}abort(){return new Promise((t,e)=>{if(!this.contexts.length){t();return}Promise.all(this.contexts.slice().map((o)=>o.abort())).then(()=>t()).catch((o)=>e(o))})}newIncognitoContext(){throw Error("Not possible to create a new context on a detached browser.")}newPage(){if(this.contexts.length===0)throw Error("No default context. The browser has been closed.");return this.contexts[0].newPage()}}class wh{#t;constructor(t){this.#t=t}get settings(){return this.#t.page.context.browser.settings}get virtualConsolePrinter(){return this.#t.page.virtualConsolePrinter}waitUntilComplete(){return this.#t.waitUntilComplete()}whenAsyncComplete(){return this.waitUntilComplete()}abort(){return this.#t.abort()}cancelAsync(){return this.abort()}close(){return this.#t.page.close()}setURL(t){this.#t.url=t}setViewport(t){this.#t.page.setViewport(t)}setWindowSize(t){this.setViewport({width:t?.width,height:t?.height})}setInnerWidth(t){this.setViewport({width:t})}setInnerHeight(t){this.setViewport({height:t})}}class Eh extends El{happyDOM;constructor(t){let o=new Ah(El,{console:t?.console,settings:t?.settings}).defaultContext.pages[0],s=o.mainFrame;if(t&&(t.width||t.height||t.innerWidth||t.innerHeight))Object.assign(o.viewport,{width:t.width||t.innerWidth||o.viewport.width,height:t.height||t.innerHeight||o.viewport.height});super(s,{url:t?.url});if(s.window=this,s.page.context.browser[to])s.page.context.browser[to].observe(this);this.happyDOM=new wh(s)}}import{Buffer as Nw}from"buffer";class xh extends Eh{Array=globalThis.Array;ArrayBuffer=globalThis.ArrayBuffer;Boolean=globalThis.Boolean;Buffer=Nw;DataView=globalThis.DataView;Date=globalThis.Date;Error=globalThis.Error;EvalError=globalThis.EvalError;Float32Array=globalThis.Float32Array;Float64Array=globalThis.Float64Array;Function=globalThis.Function;Infinity=globalThis.Infinity;Int16Array=globalThis.Int16Array;Int32Array=globalThis.Int32Array;Int8Array=globalThis.Int8Array;Intl=globalThis.Intl;JSON=globalThis.JSON;Map=globalThis.Map;Math=globalThis.Math;NaN=globalThis.NaN;Number=globalThis.Number;Object=globalThis.Object;Promise=globalThis.Promise;RangeError=globalThis.RangeError;ReferenceError=globalThis.ReferenceError;RegExp=globalThis.RegExp;Set=globalThis.Set;String=globalThis.String;Symbol=globalThis.Symbol;SyntaxError=globalThis.SyntaxError;TypeError=globalThis.TypeError;URIError=globalThis.URIError;Uint16Array=globalThis.Uint16Array;Uint32Array=globalThis.Uint32Array;Uint8Array=globalThis.Uint8Array;Uint8ClampedArray=globalThis.Uint8ClampedArray;WeakMap=globalThis.WeakMap;WeakSet=globalThis.WeakSet;decodeURI=globalThis.decodeURI;decodeURIComponent=globalThis.decodeURIComponent;encodeURI=globalThis.encodeURI;encodeURIComponent=globalThis.encodeURIComponent;eval=globalThis.eval;escape=globalThis.escape;global=globalThis;isFinite=globalThis.isFinite;isNaN=globalThis.isNaN;parseFloat=globalThis.parseFloat;parseInt=globalThis.parseInt;undefined=globalThis.undefined;unescape=globalThis.unescape;[Uo](t,e){if(e?.filename)return this.eval(`${t}
225
- //# sourceURL=${e.filename}`);return this.eval(t)}[Tm](){}}class Ng{context;active=!0;revision=0;controller;state={pending:!1,error:null};listeners=new Set;update(t){if(t?.text!==this.context?.text||t?.draftKey!==this.context?.draftKey||t?.busy!==this.context?.busy||t?.disabled!==this.context?.disabled)this.revision++;this.context=t}activate(){this.active=!0}dispose(){this.active=!1,this.controller?.abort(),this.controller=void 0,this.state={...this.state,pending:!1}}subscribe=(t)=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.state;publish(t,e){this.state={pending:t,error:e};for(let o of this.listeners)o()}clearError=()=>this.publish(this.state.pending,null);run=async(t)=>{if(!this.active||this.controller)return;let e=this.context;if(!e||e.busy||e.disabled){this.publish(!1,"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C");return}let o=this.revision,s=new AbortController;this.controller=s,this.publish(!0,null);try{let n=await t(e.text,s.signal);if(!this.active||s.signal.aborted)return;if(o!==this.revision){this.publish(!0,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9");return}e.setText((l)=>{if(!this.active||s.signal.aborted||o!==this.revision||l!==e.text)return queueMicrotask(()=>{if(this.active&&!s.signal.aborted)this.publish(this.state.pending,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9")}),l;return n})}catch(n){if(this.active&&!s.signal.aborted)this.publish(!0,n instanceof Error?n.message:String(n))}finally{if(this.controller===s){if(this.controller=void 0,this.active)this.publish(!1,this.state.error)}}}}var qd=Un(null);function OS(){let t=Bn(qd);if(!t)throw Error("Plugin Web UI provider is missing");return t}function Lw(t){let e=Wn(null);if(!e.current)e.current=new Ng;let o=e.current;return o.update(t.context),Fn(()=>(o.activate(),()=>o.dispose()),[o]),{...$n(o.subscribe,o.getSnapshot,o.getSnapshot),run:o.run,clearError:o.clearError}}function kw({pending:t,disabled:e,...o}){let{Button:s}=OS();return C(s,{...o,type:"button",size:"sm",variant:"ghost",disabled:e||t,loading:t,"aria-busy":t||void 0})}var Mw=Symbol.for("react.fragment");var GS=Mw,US=void 0;var Iw=Symbol.for("react.transitional.element"),Rw=Symbol.for("react.fragment");function HS(t,e,o){var s=null;if(o!==void 0&&(s=""+o),e.key!==void 0&&(s=""+e.key),"key"in e){o={};for(var n in e)n!=="key"&&(o[n]=e[n])}else o=e;return e=o.ref,{$$typeof:Iw,type:t,key:s,ref:e!==void 0?e:null,props:o}}var WS=Rw,_S=HS,YS=HS;var Fw={sans:'ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif',serif:'ui-serif, Georgia, "PingFang SC", "Microsoft YaHei", serif',mono:'ui-monospace, "SF Mono", Menlo, Consolas, monospace'},Vw={bg:"oklch(0.984 0.002 95)",sidebar:"oklch(0.966 0.003 95)",panel:"oklch(1 0 0)",raised:"oklch(0.94 0.004 95)",bubble:"oklch(0.948 0.004 95)",line:"oklch(0.905 0.005 95)",lineStrong:"oklch(0.84 0.006 95)",ink:"oklch(0.22 0.006 250)",dim:"oklch(0.47 0.008 250)",faint:"oklch(0.63 0.008 250)",accent:"oklch(0.53 0.085 172)",accentStrong:"oklch(0.47 0.085 172)",accentInk:"oklch(0.99 0.01 172)",accentSoft:"oklch(0.53 0.085 172 / 0.11)",danger:"oklch(0.55 0.17 27)",dangerFill:"oklch(0.52 0.17 27)",dangerFillHover:"oklch(0.47 0.17 27)",success:"oklch(0.56 0.11 155)",warning:"oklch(0.7 0.14 70)",overlay:"oklch(0.2 0.01 250 / 0.32)",facet:"oklch(0.32 0.012 240)",facetLit:"oklch(0.46 0.012 240)",facetShade:"oklch(0.27 0.01 240)",hex:{bg:"#f9f9f8",panel:"#ffffff",ink:"#1b1f24",dim:"#5b6068",faint:"#878c94",line:"#e3e2dd",lineStrong:"#cfcdc7"},chartPalette:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],chartSequential:["#cde2fb","#86b6ef","#3987e5","#1c5cab","#0d366b"]},Dw={float:"0 1px 2px oklch(0.2 0.01 250 / 0.05), 0 8px 28px -6px oklch(0.2 0.01 250 / 0.14)",composer:"0 1px 2px oklch(0.2 0.01 250 / 0.04), 0 6px 24px -8px oklch(0.2 0.01 250 / 0.1)"},Bw={scheme:"light",colors:Vw,fonts:Fw,shadows:Dw},KS={"surface.panel":"overflow-hidden rounded-xl border border-line bg-panel text-ink","surface.card":"rounded-2xl border border-line bg-panel text-ink","surface.subtle":"rounded-xl border border-line/60 bg-raised/25","surface.interactive":"overflow-hidden rounded-xl border border-line bg-panel/70 transition-colors hover:border-line-strong hover:bg-panel","surface.dock":"relative flex flex-col overflow-hidden rounded-[20px] border border-line bg-panel outline-none","surface.empty":"py-8 text-center text-xs text-faint","surface.emptyDashed":"flex flex-col items-center gap-3 rounded-2xl border border-dashed border-line-strong/70 px-6 py-16 text-center","surface.floating":"z-50 min-w-40 overflow-hidden rounded-xl border border-line bg-panel p-1 text-ink shadow-float outline-none","surface.floatingItem":"relative flex min-h-8 w-full cursor-default items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13.5px] outline-none select-none","surface.floatingLabel":"px-2 pt-1.5 pb-1 text-xs font-medium text-faint","surface.floatingSeparator":"-mx-1 my-1 h-px bg-line","surface.toolbarFloating":"flex items-center gap-0.5 rounded-lg border border-line/70 bg-panel/85 p-0.5 shadow-xs backdrop-blur-sm","surface.tooltip":"z-50 flex items-center gap-1.5 rounded-md bg-ink px-2 py-1 text-xs font-medium text-bg","surface.dialog":"fixed z-50 flex max-h-[min(92dvh,48rem)] w-full flex-col border border-line bg-panel shadow-float outline-none","surface.overlay":"fixed inset-0 z-40 bg-overlay backdrop-blur-[2px]","toast.item":"pointer-events-auto flex w-full items-start gap-2.5 rounded-xl border border-line bg-panel px-3.5 py-2.5 text-[13.5px] leading-5 text-ink shadow-float outline-none","toast.danger":"border-danger/35","button.base":"relative inline-flex shrink-0 items-center justify-center gap-1.5 font-medium whitespace-nowrap select-none","button.primary":"bg-accent text-accent-ink hover:bg-accent-strong","button.secondary":"border border-line bg-panel text-ink hover:border-line-strong hover:bg-raised/60","button.ghost":"text-dim hover:bg-raised hover:text-ink","button.danger":"bg-danger-fill text-white hover:bg-danger-fill-hover","button.dangerGhost":"text-danger hover:bg-danger/10","button.inverse":"bg-ink text-bg hover:bg-ink/85","control.input":"w-full rounded-[10px] border border-line bg-bg px-3 text-sm text-ink outline-none placeholder:text-faint","control.chipTrigger":"inline-flex h-8 max-w-full min-w-0 items-center gap-1.5 rounded-full border border-line bg-panel px-3 text-xs text-dim shadow-xs select-none","control.fieldTrigger":"inline-flex h-9 w-full min-w-0 items-center gap-2 rounded-[10px] border border-line bg-bg px-3 text-sm text-ink select-none","control.segmented":"relative inline-flex rounded-xl bg-raised p-1","control.segmentedPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-panel opacity-0 shadow-xs will-change-transform","control.switch":"group/switch relative inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-0.5","control.switchThumb":"block h-4.5 w-4.5 rounded-full bg-white","control.kbd":"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded border border-line bg-raised px-1","control.badge":"inline-flex items-center rounded-md bg-raised px-1.5 py-0.5 text-[10.5px] leading-none font-medium text-faint","control.badgeAccent":"inline-flex shrink-0 items-center rounded-md bg-accent-soft px-1.5 py-0.5 text-[11px] leading-none font-medium text-accent","control.iconCircle":"group relative flex size-7 items-center justify-center rounded-full border border-line bg-raised/40 text-dim","command.inputWrap":"flex shrink-0 items-center gap-2 border-b border-line px-3","command.input":"h-11 min-w-0 flex-1 bg-transparent text-[14px] outline-none placeholder:text-faint","command.group":"text-xs font-medium text-faint","command.row":"relative flex w-full cursor-default gap-3 rounded-lg px-2.5 py-2 text-left outline-none select-none","code.base":"overflow-x-auto font-mono text-[12.5px] leading-[1.65]","code.block":"group/code my-4 font-sans not-italic first:mt-0 last:mb-0","page.container":"mx-auto max-w-3xl px-4 pt-6 pb-16 sm:px-6 sm:pt-10","page.title":"min-w-0 flex-1 font-serif text-[1.75rem] leading-tight tracking-[-0.015em]","page.description":"mb-8 text-sm text-dim","workspace.header":"flex h-12 shrink-0 items-center gap-2 border-b border-line/60 px-3","settings.groupTitle":"text-[13px] font-medium text-dim","settings.groupDesc":"mt-0.5 text-xs text-faint","settings.groupBox":"divide-y divide-line overflow-hidden rounded-2xl border border-line bg-panel","settings.row":"flex flex-wrap items-center justify-between gap-4 p-4","settings.rowTitle":"text-sm font-medium text-ink","settings.rowDesc":"mt-0.5 text-xs leading-5 break-words text-dim","status.base":"inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-1 text-[11px] leading-none font-medium","status.success":"bg-success/10 text-success","status.warning":"bg-warning/10 text-warning","status.danger":"bg-danger/10 text-danger","status.neutral":"bg-raised text-dim","callout.base":"flex items-start gap-2.5 rounded-xl border px-3.5 py-2.5 text-[13.5px] leading-5","callout.info":"border-line bg-raised/40 text-dim","callout.danger":"border-danger/25 bg-danger/6 text-danger","chat.banner":"flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-line bg-raised/45 px-4 py-2 text-xs text-dim","chat.dockBanner":"flex shrink-0 flex-wrap items-center justify-between gap-2 rounded-[20px] border border-line bg-raised/55 px-4 py-3 text-xs text-dim","chat.userBubble":"rounded-[20px] rounded-br-md bg-bubble px-4 py-2.5 text-[14.5px] leading-[1.6] text-ink break-words whitespace-pre-wrap","chat.attachmentCard":"flex h-8 items-center gap-1.5 rounded-xl border border-line bg-panel px-2.5 text-xs text-dim","chat.prose":"font-serif text-[14.5px] leading-[1.78] tracking-[0.005em] break-words text-ink/84","chat.metaBadge":"inline-flex items-center gap-1 rounded-md border border-line/60 bg-raised/60 px-1.5 py-0.5","chat.stepRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1.5","chat.timelineRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1","chat.thinkingBody":"mt-1.5 mb-2.5 font-serif text-[13.5px] leading-[1.65] text-dim italic","chat.toolOutput":"max-h-80 overflow-auto px-4 py-3 font-mono text-[12.5px] leading-[1.65] whitespace-pre-wrap break-words","chat.diffAdd":"bg-success/10 text-success","chat.diffRemove":"bg-danger/9 text-danger","chat.foldPill":"group/fold flex cursor-pointer select-none items-center gap-2 rounded-full border border-line/70 bg-panel/90 px-3.5 py-1 text-xs text-faint","chat.scrollBottomBtn":"flex h-8 items-center gap-1.5 rounded-full border border-line bg-panel/95 px-3 text-xs font-medium text-dim shadow-float","search.highlight":"rounded-sm bg-accent-soft px-0.5 font-medium text-ink","search.filterChip":"inline-flex h-6 items-center gap-1 rounded-md border border-line bg-panel px-2 text-xs text-dim","search.filterChipActive":"inline-flex h-6 items-center gap-1 rounded-md border border-accent/35 bg-accent-soft pl-2 pr-1 text-xs font-medium text-accent","composer.box":"group/composer relative min-w-0 rounded-[20px] border border-line bg-panel","composer.input":"relative block min-h-13 w-full resize-none bg-transparent px-4 pt-3.5 pb-1.5 text-[15px] leading-6","composer.attachment":"group/att flex h-9 items-center gap-2 rounded-xl border border-line bg-raised/60 pr-1.5 pl-2.5 text-xs","sidebar.shell":"flex h-full flex-col bg-sidebar","sidebar.drawer":"fixed inset-y-0 left-0 z-0 flex w-[min(86vw,24rem)] flex-col bg-sidebar outline-none","sidebar.rightShell":"flex h-full w-full flex-col border-l border-line bg-sidebar","sidebar.rightDrawer":"fixed inset-y-0 right-0 z-50 flex w-[min(24rem,90vw)] flex-col border-l border-line bg-sidebar shadow-float outline-none","sidebar.navItem":"group flex h-9 w-full items-center gap-2.5 rounded-lg px-2 text-left text-sm select-none","sidebar.sectionTitle":"flex-1 text-xs font-medium text-faint","sidebar.hoverPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised/65 opacity-0","sidebar.activePill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised opacity-0","markdown.p":"my-4 first:mt-0 last:mb-0","markdown.strong":"font-semibold text-ink","markdown.a":"font-medium text-accent underline","markdown.fileChip":"inline-flex items-baseline gap-1 rounded-md bg-raised/85 px-[0.42em] py-[0.08em] font-mono","markdown.h1":"mt-6 mb-2.5 text-[1.28em] leading-snug font-semibold text-ink first:mt-0","markdown.h2":"mt-6 mb-2.5 text-[1.16em] leading-snug font-semibold text-ink first:mt-0","markdown.h3":"mt-5.5 mb-2 text-[1.06em] font-semibold text-ink first:mt-0","markdown.h4":"mt-4.5 mb-1.5 font-semibold text-ink first:mt-0","markdown.ul":"mt-1.5 mb-5 list-disc pl-[1.5em] marker:text-faint first:mt-0 last:mb-0","markdown.ol":"mt-1.5 mb-5 list-decimal pl-[1.6em] marker:text-[0.9em] marker:text-faint first:mt-0 last:mb-0","markdown.li":"my-2 pl-1","markdown.blockquote":"my-3.5 border-l-[3px] border-line-strong pl-3.5 text-dim italic","markdown.hr":"my-5 border-line","markdown.inlineCode":"mx-[0.18em] rounded-md bg-raised/85 px-[0.38em] py-[0.12em] font-mono text-[0.84em] text-ink/95 break-words","markdown.details":"my-3.5 overflow-hidden rounded-xl border border-line bg-raised/25 not-italic first:mt-0 last:mb-0","markdown.detailsTrigger":"group/collapsible flex w-full cursor-pointer items-center gap-2 px-3.5 py-2.5 text-left font-sans text-[13.5px] leading-snug font-medium text-ink","markdown.detailsContent":"border-t border-line px-3.5 py-3","markdown.imageButton":"my-3 block cursor-zoom-in overflow-hidden rounded-xl border border-line bg-panel text-left","markdown.tableWrap":"my-4 overflow-x-auto rounded-xl border border-line font-sans not-italic first:mt-0 last:mb-0","markdown.table":"w-full border-collapse text-[13.5px]","markdown.thead":"bg-raised/50","markdown.th":"min-w-24 border-b border-line px-3 py-2 text-left font-semibold","markdown.td":"min-w-24 border-t border-line px-3 py-2 align-top [&_code]:wrap-anywhere"},Ow={themeID:"basalt",preference:"light",resolved:"light",tokens:Bw,recipes:KS};function Gw({loading:t,disabled:e,size:o,variant:s,...n}){return C("button",{type:"button",...n,disabled:e||t,"aria-busy":t||void 0})}var QS={Button:Gw,Panel:({header:t,actions:e,children:o,...s})=>C("div",s,t,e,o),PageLayout:({title:t,description:e,actions:o,children:s,"aria-label":n,className:l})=>C("section",{"aria-label":n,className:l},C("header",null,C("h1",null,t),o,e&&C("p",null,e)),s),StatusChip:({children:t,title:e})=>C("span",{title:e},t),Markdown:({text:t})=>C("div",null,t),Form:(t)=>C("form",t),FormError:({children:t})=>C("p",{role:"alert"},t),Switch:({checked:t,onCheckedChange:e,label:o,...s})=>C("button",{...s,type:"button",role:"switch","aria-checked":t,onClick:()=>e(!t)},o),Select:({groups:t,onValueChange:e,placeholder:o,...s})=>C("select",{...s,onChange:(n)=>e(n.currentTarget.value)},o&&C("option",{value:""},o),t.map((n,l)=>C("optgroup",{key:l,label:n.label??""},n.options.map((a)=>C("option",{key:a.value,value:a.value},a.label))))),Input:(t)=>C("input",t),Textarea:(t)=>C("textarea",t),Code:({code:t,lang:e,className:o})=>C("pre",{className:o,"data-lang":e},C("code",null,t)),CopyButton:({text:t,label:e})=>C("button",{type:"button","aria-label":e??"\u590D\u5236",onClick:()=>void globalThis.navigator?.clipboard?.writeText(typeof t==="function"?t():t)}),useColorScheme:()=>"light",useTheme:()=>Ow,style:(t,...e)=>[KS[t]??t,...e].filter(Boolean).join(" "),cn:(...t)=>t.filter(Boolean).join(" ")},jS=new Proxy(QS,{get(t,e){if(Object.hasOwn(t,e))return Reflect.get(t,e);throw Error(`ui_test does not provide UI capability ${String(e)}; use supported native controls for structural tests and a browser for this capability`)}}),Xd={react:ur,"react-dom":Vr,"react/jsx-runtime":kg,"react/jsx-dev-runtime":Lg,"@basalt/plugin/web":$d,"@basalt/ui":QS};var qS=Promise.resolve();async function Uw(){let t=qS,e=()=>{};return qS=new Promise((o)=>{e=o}),await t,e}function Hw(t){return{window:t,document:t.document,navigator:t.navigator,HTMLElement:t.HTMLElement,HTMLInputElement:t.HTMLInputElement,HTMLTextAreaElement:t.HTMLTextAreaElement,Node:t.Node,Event:t.Event,MouseEvent:t.MouseEvent,getComputedStyle:t.getComputedStyle.bind(t)}}async function Ww(t,e){let o=await Bun.build({entrypoints:["basalt-ui-entry"],target:"browser",format:"esm",throw:!1,plugins:[{name:"basalt-ui-bridge",setup(n){n.onResolve({filter:/.*/},({path:l})=>{if(l==="basalt-ui-entry")return{path:l,namespace:"test-entry"};if(Object.hasOwn(Xd,l))return{path:l,namespace:"test-bridge"};throw Error(`Unsupported ui_test import: ${l}`)}),n.onLoad({filter:/.*/,namespace:"test-entry"},()=>({contents:t,loader:"js"})),n.onLoad({filter:/.*/,namespace:"test-bridge"},({path:l})=>({loader:"js",contents:Object.keys(Xd[l]??{}).map((a,y)=>{let u=`globalThis[${JSON.stringify(e)}][${JSON.stringify(l)}][${JSON.stringify(a)}]`;return`const e${y}=${u};export {e${y} as ${a}};`}).join(`
225
+ //# sourceURL=${e.filename}`);return this.eval(t)}[Tm](){}}class Ng{context;active=!0;revision=0;controller;state={pending:!1,error:null};listeners=new Set;update(t){if(t?.text!==this.context?.text||t?.draftKey!==this.context?.draftKey||t?.busy!==this.context?.busy||t?.disabled!==this.context?.disabled)this.revision++;this.context=t}activate(){this.active=!0}dispose(){this.active=!1,this.controller?.abort(),this.controller=void 0,this.state={...this.state,pending:!1}}subscribe=(t)=>(this.listeners.add(t),()=>this.listeners.delete(t));getSnapshot=()=>this.state;publish(t,e){this.state={pending:t,error:e};for(let o of this.listeners)o()}clearError=()=>this.publish(this.state.pending,null);run=async(t)=>{if(!this.active||this.controller)return;let e=this.context;if(!e||e.busy||e.disabled){this.publish(!1,"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C");return}let o=this.revision,s=new AbortController;this.controller=s,this.publish(!0,null);try{let n=await t(e.text,s.signal);if(!this.active||s.signal.aborted)return;if(o!==this.revision){this.publish(!0,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9");return}e.setText((l)=>{if(!this.active||s.signal.aborted||o!==this.revision||l!==e.text)return queueMicrotask(()=>{if(this.active&&!s.signal.aborted)this.publish(this.state.pending,this.context?.busy||this.context?.disabled?"\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u672A\u6267\u884C":"\u8349\u7A3F\u5DF2\u66F4\u6539\uFF0C\u672A\u8986\u76D6\u5F53\u524D\u5185\u5BB9")}),l;return n})}catch(n){if(this.active&&!s.signal.aborted)this.publish(!0,n instanceof Error?n.message:String(n))}finally{if(this.controller===s){if(this.controller=void 0,this.active)this.publish(!1,this.state.error)}}}}var qd=Un(null);function OS(){let t=Bn(qd);if(!t)throw Error("Plugin Web UI provider is missing");return t}function Lw(t){let e=Wn(null);if(!e.current)e.current=new Ng;let o=e.current;return o.update(t.context),Fn(()=>(o.activate(),()=>o.dispose()),[o]),{...$n(o.subscribe,o.getSnapshot,o.getSnapshot),run:o.run,clearError:o.clearError}}function kw({pending:t,disabled:e,...o}){let{Button:s}=OS();return C(s,{...o,type:"button",size:"sm",variant:"ghost",disabled:e||t,loading:t,"aria-busy":t||void 0})}var Mw=Symbol.for("react.fragment");var GS=Mw,US=void 0;var Iw=Symbol.for("react.transitional.element"),Rw=Symbol.for("react.fragment");function HS(t,e,o){var s=null;if(o!==void 0&&(s=""+o),e.key!==void 0&&(s=""+e.key),"key"in e){o={};for(var n in e)n!=="key"&&(o[n]=e[n])}else o=e;return e=o.ref,{$$typeof:Iw,type:t,key:s,ref:e!==void 0?e:null,props:o}}var WS=Rw,_S=HS,YS=HS;var Fw={sans:'ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif',serif:'ui-serif, Georgia, "PingFang SC", "Microsoft YaHei", serif',mono:'ui-monospace, "SF Mono", Menlo, Consolas, monospace'},Vw={bg:"oklch(0.984 0.002 95)",sidebar:"oklch(0.966 0.003 95)",panel:"oklch(1 0 0)",raised:"oklch(0.94 0.004 95)",bubble:"oklch(0.948 0.004 95)",line:"oklch(0.905 0.005 95)",lineStrong:"oklch(0.84 0.006 95)",ink:"oklch(0.22 0.006 250)",dim:"oklch(0.47 0.008 250)",faint:"oklch(0.63 0.008 250)",accent:"oklch(0.53 0.085 172)",accentStrong:"oklch(0.47 0.085 172)",accentInk:"oklch(0.99 0.01 172)",accentSoft:"oklch(0.53 0.085 172 / 0.11)",danger:"oklch(0.55 0.17 27)",dangerFill:"oklch(0.52 0.17 27)",dangerFillHover:"oklch(0.47 0.17 27)",success:"oklch(0.56 0.11 155)",warning:"oklch(0.7 0.14 70)",overlay:"oklch(0.2 0.01 250 / 0.32)",facet:"oklch(0.32 0.012 240)",facetLit:"oklch(0.46 0.012 240)",facetShade:"oklch(0.27 0.01 240)",hex:{bg:"#f9f9f8",panel:"#ffffff",ink:"#1b1f24",dim:"#5b6068",faint:"#878c94",line:"#e3e2dd",lineStrong:"#cfcdc7"},chartPalette:["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],chartSequential:["#cde2fb","#86b6ef","#3987e5","#1c5cab","#0d366b"]},Dw={float:"0 1px 2px oklch(0.2 0.01 250 / 0.05), 0 8px 28px -6px oklch(0.2 0.01 250 / 0.14)",composer:"0 1px 2px oklch(0.2 0.01 250 / 0.04), 0 6px 24px -8px oklch(0.2 0.01 250 / 0.1)"},Bw={scheme:"light",colors:Vw,fonts:Fw,shadows:Dw},KS={"surface.panel":"overflow-hidden rounded-xl border border-line bg-panel text-ink","surface.card":"rounded-2xl border border-line bg-panel text-ink","surface.subtle":"rounded-xl border border-line/60 bg-raised/25","surface.interactive":"overflow-hidden rounded-xl border border-line bg-panel/70 transition-colors hover:border-line-strong hover:bg-panel","surface.dock":"relative flex flex-col overflow-hidden rounded-[20px] border border-line bg-panel outline-none","surface.empty":"py-8 text-center text-xs text-faint","surface.emptyDashed":"flex flex-col items-center gap-3 rounded-2xl border border-dashed border-line-strong/70 px-6 py-16 text-center","surface.floating":"z-50 min-w-40 overflow-hidden rounded-xl border border-line bg-panel p-1 text-ink shadow-float outline-none","surface.floatingItem":"relative flex min-h-8 w-full cursor-default items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[13.5px] outline-none select-none","surface.floatingLabel":"px-2 pt-1.5 pb-1 text-xs font-medium text-faint","surface.floatingSeparator":"-mx-1 my-1 h-px bg-line","surface.toolbarFloating":"flex items-center gap-0.5 rounded-lg border border-line/70 bg-panel/85 p-0.5 shadow-xs backdrop-blur-sm","surface.tooltip":"z-50 flex items-center gap-1.5 rounded-md bg-ink px-2 py-1 text-xs font-medium text-bg","surface.dialog":"fixed z-50 flex max-h-[min(92dvh,48rem)] w-full flex-col border border-line bg-panel shadow-float outline-none","surface.overlay":"fixed inset-0 z-40 bg-overlay backdrop-blur-[2px]","toast.item":"pointer-events-auto flex w-full items-start gap-2.5 rounded-xl border border-line bg-panel px-3.5 py-2.5 text-[13.5px] leading-5 text-ink shadow-float outline-none","toast.danger":"border-danger/35","button.base":"relative inline-flex shrink-0 items-center justify-center gap-1.5 font-medium whitespace-nowrap select-none","button.primary":"bg-accent text-accent-ink hover:bg-accent-strong","button.secondary":"border border-line bg-panel text-ink hover:border-line-strong hover:bg-raised/60","button.ghost":"text-dim hover:bg-raised hover:text-ink","button.danger":"bg-danger-fill text-white hover:bg-danger-fill-hover","button.dangerGhost":"text-danger hover:bg-danger/10","button.inverse":"bg-ink text-bg hover:bg-ink/85","control.input":"w-full rounded-[10px] border border-line bg-bg px-3 text-sm text-ink outline-none placeholder:text-faint","control.chipTrigger":"inline-flex h-8 max-w-full min-w-0 items-center gap-1.5 rounded-full border border-line bg-panel px-3 text-xs text-dim shadow-xs select-none","control.fieldTrigger":"inline-flex h-9 w-full min-w-0 items-center gap-2 rounded-[10px] border border-line bg-bg px-3 text-sm text-ink select-none","control.segmented":"relative inline-flex rounded-xl bg-raised p-1","control.segmentedPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-panel opacity-0 shadow-xs will-change-transform","control.switch":"group/switch relative inline-flex h-5.5 w-9.5 shrink-0 items-center rounded-full p-0.5","control.switchThumb":"block h-4.5 w-4.5 rounded-full bg-white","control.kbd":"inline-flex h-4.5 min-w-4.5 items-center justify-center rounded border border-line bg-raised px-1","control.badge":"inline-flex items-center rounded-md bg-raised px-1.5 py-0.5 text-[10.5px] leading-none font-medium text-faint","control.badgeAccent":"inline-flex shrink-0 items-center rounded-md bg-accent-soft px-1.5 py-0.5 text-[11px] leading-none font-medium text-accent","control.iconCircle":"group relative flex size-7 items-center justify-center rounded-full border border-line bg-raised/40 text-dim","command.inputWrap":"flex shrink-0 items-center gap-2 border-b border-line px-3","command.input":"h-11 min-w-0 flex-1 bg-transparent text-[14px] outline-none placeholder:text-faint","command.group":"text-xs font-medium text-faint","command.row":"relative flex w-full cursor-default gap-3 rounded-lg px-2.5 py-2 text-left outline-none select-none","code.base":"overflow-x-auto font-mono text-[12.5px] leading-[1.65]","code.block":"group/code my-4 font-sans not-italic first:mt-0 last:mb-0","page.container":"mx-auto max-w-3xl px-4 pt-6 pb-16 sm:px-6 sm:pt-10","page.title":"min-w-0 flex-1 font-serif text-[1.75rem] leading-tight tracking-[-0.015em]","page.description":"mb-8 text-sm text-dim","workspace.header":"flex h-12 shrink-0 items-center gap-2 border-b border-line/60 px-3","settings.groupTitle":"text-[13px] font-medium text-dim","settings.groupDesc":"mt-0.5 text-xs text-faint","settings.groupBox":"divide-y divide-line overflow-hidden rounded-2xl border border-line bg-panel","settings.row":"flex flex-wrap items-center justify-between gap-4 p-4","settings.rowTitle":"text-sm font-medium text-ink","settings.rowDesc":"mt-0.5 text-xs leading-5 break-words text-dim","status.base":"inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-1 text-[11px] leading-none font-medium","status.success":"bg-success/10 text-success","status.warning":"bg-warning/10 text-warning","status.danger":"bg-danger/10 text-danger","status.neutral":"bg-raised text-dim","callout.base":"flex items-start gap-2.5 rounded-xl border px-3.5 py-2.5 text-[13.5px] leading-5","callout.info":"border-line bg-raised/40 text-dim","callout.danger":"border-danger/25 bg-danger/6 text-danger","chat.banner":"flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-line bg-raised/45 px-4 py-2 text-xs text-dim","chat.dockBanner":"flex shrink-0 flex-wrap items-center justify-between gap-2 rounded-[20px] border border-line bg-raised/55 px-4 py-3 text-xs text-dim","chat.userBubble":"rounded-[20px] rounded-br-md bg-bubble px-4 py-2.5 text-[14.5px] leading-[1.6] text-ink break-words whitespace-pre-wrap","chat.attachmentCard":"flex h-8 items-center gap-1.5 rounded-xl border border-line bg-panel px-2.5 text-xs text-dim","chat.prose":"font-serif text-[14.5px] leading-[1.78] tracking-[0.005em] break-words text-ink/84","chat.metaBadge":"inline-flex items-center gap-1 rounded-md border border-line/60 bg-raised/60 px-1.5 py-0.5","chat.stepRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1.5","chat.timelineRow":"group/collapsible -mx-2 flex w-[calc(100%+1rem)] items-center gap-2 rounded-lg px-2 py-1","chat.thinkingBody":"mt-1.5 mb-2.5 font-serif text-[13.5px] leading-[1.65] text-dim italic","chat.toolOutput":"max-h-80 overflow-auto px-4 py-3 font-mono text-[12.5px] leading-[1.65] whitespace-pre-wrap break-words","chat.diffAdd":"bg-success/10 text-success","chat.diffRemove":"bg-danger/9 text-danger","chat.foldPill":"group/fold flex cursor-pointer select-none items-center gap-2 rounded-full border border-line/70 bg-panel/90 px-3.5 py-1 text-xs text-faint","chat.scrollBottomBtn":"flex h-8 items-center gap-1.5 rounded-full border border-line bg-panel/95 px-3 text-xs font-medium text-dim shadow-float","search.highlight":"rounded-sm bg-accent-soft px-0.5 font-medium text-ink","search.filterChip":"inline-flex h-6 items-center gap-1 rounded-md border border-line bg-panel px-2 text-xs text-dim","search.filterChipActive":"inline-flex h-6 items-center gap-1 rounded-md border border-accent/35 bg-accent-soft pl-2 pr-1 text-xs font-medium text-accent","composer.box":"group/composer relative min-w-0 rounded-[20px] border border-line bg-panel","composer.input":"relative block min-h-13 w-full resize-none bg-transparent px-4 pt-3.5 pb-1.5 text-[15px] leading-6","composer.attachment":"group/att flex h-9 items-center gap-2 rounded-xl border border-line bg-raised/60 pr-1.5 pl-2.5 text-xs","sidebar.shell":"flex h-full flex-col bg-sidebar","sidebar.drawer":"fixed inset-y-0 left-0 z-0 flex w-[min(86vw,24rem)] flex-col bg-sidebar outline-none","sidebar.rightShell":"flex h-full w-full flex-col border-l border-line bg-sidebar","sidebar.rightDrawer":"fixed inset-y-0 right-0 z-50 flex w-[min(24rem,90vw)] flex-col border-l border-line bg-sidebar shadow-float outline-none","sidebar.navItem":"group flex h-9 w-full items-center gap-2.5 rounded-lg px-2 text-left text-sm select-none","sidebar.sectionTitle":"flex-1 text-xs font-medium text-faint","sidebar.hoverPill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised/65 opacity-0","sidebar.activePill":"pointer-events-none absolute top-0 left-0 rounded-lg bg-raised opacity-0","markdown.p":"my-4 first:mt-0 last:mb-0","markdown.strong":"font-semibold text-ink","markdown.a":"font-medium text-accent underline","markdown.fileChip":"inline-flex items-baseline gap-1 rounded-md bg-raised/85 px-[0.42em] py-[0.08em] font-mono","markdown.h1":"mt-6 mb-2.5 text-[1.28em] leading-snug font-semibold text-ink first:mt-0","markdown.h2":"mt-6 mb-2.5 text-[1.16em] leading-snug font-semibold text-ink first:mt-0","markdown.h3":"mt-5.5 mb-2 text-[1.06em] font-semibold text-ink first:mt-0","markdown.h4":"mt-4.5 mb-1.5 font-semibold text-ink first:mt-0","markdown.ul":"mt-1.5 mb-5 list-disc pl-[1.5em] marker:text-faint first:mt-0 last:mb-0","markdown.ol":"mt-1.5 mb-5 list-decimal pl-[1.6em] marker:text-[0.9em] marker:text-faint first:mt-0 last:mb-0","markdown.li":"my-2 pl-1","markdown.blockquote":"my-3.5 border-l-[3px] border-line-strong pl-3.5 text-dim italic","markdown.hr":"my-5 border-line","markdown.inlineCode":"mx-[0.18em] rounded-md bg-raised/85 px-[0.38em] py-[0.12em] font-mono text-[0.84em] text-ink/95 break-words","markdown.details":"my-3.5 overflow-hidden rounded-xl border border-line bg-raised/25 not-italic first:mt-0 last:mb-0","markdown.detailsTrigger":"group/collapsible flex w-full cursor-pointer items-center gap-2 px-3.5 py-2.5 text-left font-sans text-[13.5px] leading-snug font-medium text-ink","markdown.detailsContent":"border-t border-line px-3.5 py-3","markdown.imageButton":"my-3 block cursor-zoom-in overflow-hidden rounded-xl border border-line bg-panel text-left","markdown.tableWrap":"my-4 overflow-x-auto rounded-xl border border-line font-sans not-italic first:mt-0 last:mb-0","markdown.table":"w-full border-collapse text-[13.5px]","markdown.thead":"bg-raised/50","markdown.th":"min-w-24 border-b border-line px-3 py-2 text-left font-semibold","markdown.td":"min-w-24 border-t border-line px-3 py-2 align-top [&_code]:wrap-anywhere"},Ow={themeID:"basalt",preference:"light",resolved:"light",tokens:Bw,recipes:KS};function Gw({loading:t,disabled:e,size:o,variant:s,...n}){return C("button",{type:"button",...n,disabled:e||t,"aria-busy":t||void 0})}var QS={Button:Gw,Panel:({header:t,actions:e,children:o,...s})=>C("div",s,t,e,o),PageLayout:({title:t,description:e,actions:o,children:s,"aria-label":n,className:l})=>C("section",{"aria-label":n,className:l},C("header",null,C("h1",null,t),o,e&&C("p",null,e)),s),StatusChip:({children:t,title:e})=>C("span",{title:e},t),Markdown:({text:t})=>C("div",null,t),CatalogRow:({name:t,selectLabel:e,onSelect:o,meta:s,description:n,aside:l,actions:a,toggle:y,title:u})=>C("div",null,C(o?"button":"div",o?{type:"button","aria-label":e,title:u,onClick:o}:{title:u},t,s,n),l,a,y&&C("button",{type:"button",role:"switch","aria-checked":y.checked,"aria-label":y.label,disabled:y.disabled,onClick:()=>y.onCheckedChange(!y.checked)},y.label)),Form:(t)=>C("form",t),FormError:({children:t})=>C("p",{role:"alert"},t),Switch:({checked:t,onCheckedChange:e,label:o,...s})=>C("button",{...s,type:"button",role:"switch","aria-checked":t,onClick:()=>e(!t)},o),Select:({groups:t,onValueChange:e,placeholder:o,...s})=>C("select",{...s,onChange:(n)=>e(n.currentTarget.value)},o&&C("option",{value:""},o),t.map((n,l)=>C("optgroup",{key:l,label:n.label??""},n.options.map((a)=>C("option",{key:a.value,value:a.value},a.label))))),Input:(t)=>C("input",t),Textarea:(t)=>C("textarea",t),Code:({code:t,lang:e,className:o})=>C("pre",{className:o,"data-lang":e},C("code",null,t)),CopyButton:({text:t,label:e})=>C("button",{type:"button","aria-label":e??"\u590D\u5236",onClick:()=>void globalThis.navigator?.clipboard?.writeText(typeof t==="function"?t():t)}),useColorScheme:()=>"light",useTheme:()=>Ow,style:(t,...e)=>[KS[t]??t,...e].filter(Boolean).join(" "),cn:(...t)=>t.filter(Boolean).join(" ")},jS=new Proxy(QS,{get(t,e){if(Object.hasOwn(t,e))return Reflect.get(t,e);throw Error(`ui_test does not provide UI capability ${String(e)}; use supported native controls for structural tests and a browser for this capability`)}}),Xd={react:ur,"react-dom":Vr,"react/jsx-runtime":kg,"react/jsx-dev-runtime":Lg,"@basalt/plugin/web":$d,"@basalt/ui":QS};var qS=Promise.resolve();async function Uw(){let t=qS,e=()=>{};return qS=new Promise((o)=>{e=o}),await t,e}function Hw(t){return{window:t,document:t.document,navigator:t.navigator,HTMLElement:t.HTMLElement,HTMLInputElement:t.HTMLInputElement,HTMLTextAreaElement:t.HTMLTextAreaElement,Node:t.Node,Event:t.Event,MouseEvent:t.MouseEvent,getComputedStyle:t.getComputedStyle.bind(t)}}async function Ww(t,e){let o=await Bun.build({entrypoints:["basalt-ui-entry"],target:"browser",format:"esm",throw:!1,plugins:[{name:"basalt-ui-bridge",setup(n){n.onResolve({filter:/.*/},({path:l})=>{if(l==="basalt-ui-entry")return{path:l,namespace:"test-entry"};if(Object.hasOwn(Xd,l))return{path:l,namespace:"test-bridge"};throw Error(`Unsupported ui_test import: ${l}`)}),n.onLoad({filter:/.*/,namespace:"test-entry"},()=>({contents:t,loader:"js"})),n.onLoad({filter:/.*/,namespace:"test-bridge"},({path:l})=>({loader:"js",contents:Object.keys(Xd[l]??{}).map((a,y)=>{let u=`globalThis[${JSON.stringify(e)}][${JSON.stringify(l)}][${JSON.stringify(a)}]`;return`const e${y}=${u};export {e${y} as ${a}};`}).join(`
226
226
  `)}))}}]}),s=o.outputs[0];if(!o.success||!s)throw Error(o.logs.map((n)=>n.message).join("; ")||"UI bridge build failed");return s.text()}function _w(t,e){if(!(typeof t==="object"&&t!==null&&("id"in t)&&t.id===e&&("apiVersion"in t)&&t.apiVersion===1))throw Error("Web module must export default with matching id and apiVersion: 1")}async function Mg(t,e,o){let s=new xh({settings:{disableJavaScriptEvaluation:!0,disableJavaScriptFileLoading:!0,disableCSSFileLoading:!0,enableFileSystemHttpRequests:!1}}),n=await Uw(),l=`__basalt_ui_${crypto.randomUUID().replaceAll("-","")}`,a={...Hw(s),[l]:Xd},y=new Map(Object.keys(a).map((c)=>[c,Object.getOwnPropertyDescriptor(globalThis,c)])),u;try{for(let[d,g]of Object.entries(a))Object.defineProperty(globalThis,d,{configurable:!0,writable:!0,value:g});u=URL.createObjectURL(new Blob([await Ww(t,l)],{type:"text/javascript"})),An({type:"importing"});let c=await import(u);return An({type:"imported"}),_w(c.default,e),await o(c.default,s)}finally{try{await s.happyDOM.close()}finally{if(u)URL.revokeObjectURL(u);for(let[c,d]of y)if(d)Object.defineProperty(globalThis,c,d);else Reflect.deleteProperty(globalThis,c);n()}}}var Yw=10,$S=1000,XS=200,Kw="button,[role=button]";async function zS(t,e,o,s){let n=Date.now()+e;while(!t()){if(Date.now()>=n)throw Error(o);await Bun.sleep(Yw),await s.settle()}}function Qw(t,e,o){if(t.disabled||t.readOnly)throw Error("Control is not editable");let s=t.tagName==="TEXTAREA"?o.HTMLTextAreaElement.prototype:o.HTMLInputElement.prototype;Object.getOwnPropertyDescriptor(s,"value")?.set?.call(t,e),mt(()=>{t.dispatchEvent(new o.Event("input",{bubbles:!0})),t.dispatchEvent(new o.Event("change",{bubbles:!0}))})}async function jw(t,e){let{inspect:o,calls:s,window:n}=e;if("click"in t){let l=typeof t.click==="string"?o.findByName(Kw,t.click):o.selectOne(t.click.selector);if(o.isDisabled(l))throw Error("Control is disabled");mt(()=>l.click())}else if("type"in t)Qw(o.findByName("input,textarea",t.type.label),t.type.text,n);else if("waitText"in t){let{waitText:l}=t;await zS(()=>o.snapshot(void 0,!1).text.includes(l),t.timeoutMs??$S,`Timed out waiting for ${JSON.stringify(l)}`,e)}else if("waitSelector"in t){let{waitSelector:l}=t;await zS(()=>o.anyVisible(l),t.timeoutMs??$S,`Timed out waiting for selector ${l}`,e)}else if("expectCount"in t){let{selector:l,n:a}=t.expectCount,y=o.count(l);if(!Number.isInteger(a)||a<0||y!==a)throw Error(`Expected ${a} elements, got ${y}`)}else if("snapshot"in t){let l=t.snapshot.depth??10;if(!Number.isInteger(l)||l<0||l>XS)throw Error(`snapshot depth must be 0\u2013${XS}`);return o.outline(o.selectOne(t.snapshot.selector),l)}else if("expectCalls"in t){let{onOpen:l,onClose:a}=t.expectCalls;if(l&&JSON.stringify(l)!==JSON.stringify(s.onOpen))throw Error(`onOpen calls differ: ${JSON.stringify(s.onOpen)}`);if(a!==void 0&&a!==s.onClose)throw Error(`Expected ${a} onClose calls, got ${s.onClose}`)}else if("expectText"in t){let l=t.within?o.selectOne(t.within):void 0;if(!o.snapshot(l,!1).text.includes(t.expectText))throw Error(`Missing text: ${t.expectText}`)}else if("expectValue"in t){let l=o.findByName("input,textarea,select",t.expectValue.label);if(l.value!==t.expectValue.value)throw Error(`Expected value ${JSON.stringify(t.expectValue.value)}, got ${JSON.stringify(l.value)}`)}else throw Error("Unknown UI step")}async function JS(t,e){let o=[];for(let s of t)try{let n=await jw(s,e);await e.settle(),o.push({step:s,ok:!0,snapshot:e.inspect.snapshot(),outline:n})}catch(n){o.push({step:s,ok:!1,snapshot:e.inspect.snapshot(),error:n instanceof Error?n.message:String(n)});break}return o}var qw=()=>({id:"ui-test",title:"",projectID:null,model:"",created:0,updated:0,status:"idle",todos:[],parentID:null,forkThroughSeq:null,kind:"main",archivedAt:null}),ZS=["page","tab","card","sidebar"],tf=(t)=>[t.slot,t.view,t.codeBlock].filter(Boolean).length;async function ef(t,e){if(e.codeBlock){let n=e.codeBlock.toLowerCase(),l=Object.entries(t.codeBlocks??{}).find(([a])=>a.toLowerCase()===n)?.[1];if(!l)throw Error(`Unknown code block: ${e.codeBlock}`);return{view:void 0,codeBlock:n,component:(await l.load()).default}}let o=e.view?t.views?.[e.view]:void 0;if(e.view&&!o)throw Error(`Unknown view: ${e.view}`);if(o&&(!ZS.includes(o.kind)||e.kind&&e.kind!==o.kind))throw Error(`View kind mismatch for ${e.view}: expected ${e.kind??ZS.join("/")}, got ${o.kind}`);let s=o?(await o.load()).default:t.slots?.[e.slot??""];if(!s)throw Error(e.view?`Missing component for view: ${e.view}`:`Unknown slot: ${e.slot}`);return{view:o,codeBlock:void 0,component:s}}function $w(t,e,o,s,n){let l=(y)=>n.onOpen.push(y),a=()=>{n.onClose++};switch(t.kind){case"page":return C(e,{connection:s,onOpen:l});case"tab":return C(e,{connection:s,onClose:a});case"card":return C(e,{connection:s,onOpen:l,sessionID:typeof o.props?.sessionID==="string"?o.props.sessionID:"ui-test",payload:o.props?.payload});case"sidebar":return C(e,{session:qw(),entries:[],...o.props,connection:s})}}function rf(t,e,o,s){return function(){let[l,a]=jr(typeof e.context?.text==="string"?e.context.text:""),[y,u]=jr(Array.isArray(e.context?.attachments)?e.context.attachments:[]),c={disabled:!1,busy:!1,draftKey:"ui-test",...e.context,text:l,setText:a,attachments:y,setAttachments:u},d=C("textarea",{"aria-label":"__basalt_host_draft__",value:l,onInput:(f)=>{let E=Reflect.get(f.currentTarget,"value");if(typeof E==="string")a(E)}}),g=t.view?[$w(t.view,t.component,e,o,s)]:t.codeBlock?[C(t.component,{code:typeof e.props?.code==="string"?e.props.code:"",lang:t.codeBlock,streaming:e.props?.streaming===!0})]:[d,C(t.component,{context:c,connection:o})];return C(qd.Provider,{value:jS},...g)}}var of=1e4;function Xw(t){let e=`ui_test requires id, exactly one of slot, view or codeBlock, and at most ${Dn} steps`;if(!t.id||tf(t)!==1||!Array.isArray(t.steps))throw Error(e);if(t.steps.length>Dn)throw Error(e);for(let o of t.steps){if(!(("waitText"in o)||("waitSelector"in o)))continue;let s=o.timeoutMs??1000;if(!Number.isInteger(s)||s<1||s>cr)throw Error(`wait timeoutMs must be between 1 and ${cr}`)}for(let o of Object.values(t.mockRoutes??{})){let s=o.delayMs??0,n=Number.isInteger(o.status)&&o.status>=100&&o.status<=599,l=Number.isInteger(s)&&s>=0&&s<=of;if(!n||!l)throw Error(`mockRoutes requires HTTP status and delayMs between 0 and ${of}`)}}async function zw(t,e,o){return Xw(o),Mg(t,o.id,async(s,n)=>{if(e){let H=n.document.createElement("style");H.textContent=e,n.document.head.append(H)}let l=await ef(s,o),a={onOpen:[],onClose:0},y=new AbortController,u=Vg(o.mockRoutes,y.signal),c=rf(l,o,u,a),d=n.document.createElement("div");n.document.body.append(d);let g,{createRoot:f}=await import("./chunk-1zj3zvw5.js"),E=f(d,{onUncaughtError:(H)=>{g=H}}),R=async()=>{if(await Bun.sleep(0),mt(()=>{}),g)throw g};try{mt(()=>E.render(C(c))),await R();let H=Dg(d,n),pt=await JS(o.steps,{window:n,inspect:H,calls:a,settle:R});return{ok:pt.every((gt)=>gt.ok),steps:pt,calls:a}}finally{mt(()=>E.unmount()),y.abort()}})}function Jw(t,e){return Mg(t,e,async(o)=>{let s=o.pageNav?.viewID??"page";return{slots:Object.keys(o.slots??{}),views:Object.keys(o.views??{}),codeBlocks:Object.keys(o.codeBlocks??{}).map((n)=>n.toLowerCase()),pageNav:o.pageNav?{viewID:s,kind:o.views?.[s]?.kind}:void 0,themes:Array.isArray(o.themes)?o.themes.map((n)=>n&&typeof n==="object"?n.id:void 0).filter((n)=>typeof n==="string"&&n.length>0):void 0}})}globalThis.onmessage=async(t)=>{let e=t.data;if(e.type==="response")return Fg(e);try{let o=e.input?await zw(e.source,e.css,e.input):await Jw(e.source,e.id);An({type:"done",result:o})}catch(o){An({type:"error",error:o instanceof Error?o.message:String(o)})}};
@@ -0,0 +1 @@
1
+ import{t,a}from"./chunk-b5zf1hs3.js";import{J,Dt,Mt}from"./chunk-rdr6wt22.js";import{H}from"./chunk-jyf7a7yp.js";import{ir,_t}from"./chunk-n9v14vyd.js";var i=ir().RailroadPeg.parser.LangiumParser,s=t((e)=>{let r=e.alternatives.map(l);if(r.length===1)return r[0];return{type:"choice",alternatives:r}},"transformOrderedChoice"),l=t((e)=>{let r=e.elements.map(m);if(r.length===1)return r[0];return{type:"sequence",elements:r}},"transformSequence"),m=t((e)=>{let r=p(e.suffix);if(!e.operator)return r;return{type:"special",text:e.operator==="&"?`&${o(r)}`:`!${o(r)}`}},"transformPrefix"),o=t((e)=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),p=t((e)=>{let r=u(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),u=t((e)=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return s(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),c=t((e)=>({name:e.name,definition:s(e.definition)}),"transformRule"),f=t((e)=>{if(H(e,J),e.title)J.setTitle(e.title);e.rules.map((r)=>J.addRule(c(r)))},"populateDb"),d={parse:t((e)=>{J.clear(),a.debug("[PEG Parser] Starting Langium parse");let r=i.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new _t(r);let n=r.value;a.debug("[PEG Parser] Parsed rules:",n.rules.length),f(n),a.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:J}},w={parser:d,db:J,renderer:Mt,styles:Dt};export{w as diagram};
@@ -0,0 +1 @@
1
+ import{ui}from"./chunk-30aeb767.js";export{ui as default};