@alwith/module-chat 0.6.34 → 0.6.35

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 (490) hide show
  1. package/dist/activity-host.d.ts +2 -0
  2. package/dist/activity-host.js +1 -1
  3. package/dist/agent/client.d.ts +2 -0
  4. package/dist/agent/client.js +1 -1
  5. package/dist/agent/custom-model-effort.js +1 -1
  6. package/dist/agent/fork-title.js +1 -1
  7. package/dist/agent/image-request.js +1 -1
  8. package/dist/agent/image-tools.d.ts +3 -1
  9. package/dist/agent/image-tools.js +1 -1
  10. package/dist/agent/input-config.js +1 -1
  11. package/dist/agent/input-modes/chat.js +1 -1
  12. package/dist/agent/input-modes/execution-meta.js +1 -1
  13. package/dist/agent/input-modes/image-context.js +1 -1
  14. package/dist/agent/input-modes/image.js +1 -1
  15. package/dist/agent/input-modes/index.js +1 -1
  16. package/dist/agent/project-path.js +1 -1
  17. package/dist/agent/request-error.js +1 -1
  18. package/dist/agent/session-list-refresh.js +1 -1
  19. package/dist/app-reference.js +1 -1
  20. package/dist/application-tools.js +1 -1
  21. package/dist/approval/choice-elicitation-form.js +1 -1
  22. package/dist/approval/choice-schema.js +1 -1
  23. package/dist/approval/permission-options.js +1 -1
  24. package/dist/approval/permission-view.js +1 -1
  25. package/dist/approval/schema-elicitation-form.js +1 -1
  26. package/dist/approval/url-elicitation-card.js +1 -1
  27. package/dist/{chunk-0a3tr9ws.js → chunk-0sb0c014.js} +2 -2
  28. package/dist/{chunk-ks22p0wq.js → chunk-0xztk729.js} +2 -2
  29. package/dist/chunk-18gcnf2a.js +2 -0
  30. package/dist/{chunk-p216frcj.js → chunk-1a46v4cy.js} +2 -2
  31. package/dist/chunk-1b3frq9c.js +3 -0
  32. package/dist/{chunk-nhz4egjh.js → chunk-1vwece23.js} +6 -6
  33. package/dist/{chunk-wvm6ppb3.js → chunk-20dc4fm0.js} +2 -2
  34. package/dist/{chunk-45yrj0e1.js → chunk-22nybrkv.js} +5 -5
  35. package/dist/{chunk-vab1ysnz.js → chunk-23kvszfc.js} +2 -2
  36. package/dist/chunk-2nq204hz.js +2 -0
  37. package/dist/{chunk-dcvmc9hn.js → chunk-2nv5ebq1.js} +2 -2
  38. package/dist/chunk-33fxyn5r.js +2 -0
  39. package/dist/chunk-359pf448.js +2 -0
  40. package/dist/{chunk-n8b9yg4q.js → chunk-3knw8e0x.js} +2 -2
  41. package/dist/{chunk-2eceheqt.js → chunk-3kytka7m.js} +3 -3
  42. package/dist/{chunk-mq0npf36.js → chunk-3sq2k9ca.js} +2 -2
  43. package/dist/{chunk-vgea7ggq.js → chunk-3t3n8nfy.js} +2 -2
  44. package/dist/{chunk-9n8cds8p.js → chunk-3tvq6xr2.js} +2 -2
  45. package/dist/{chunk-gktjkghg.js → chunk-482segb0.js} +2 -2
  46. package/dist/{chunk-19jh646d.js → chunk-4chmr87g.js} +2 -2
  47. package/dist/chunk-4g2412p5.js +2 -0
  48. package/dist/chunk-4ma6bmcm.js +2 -0
  49. package/dist/{chunk-103z8myv.js → chunk-54jfqcd1.js} +2 -2
  50. package/dist/chunk-5mxh7h57.js +2 -0
  51. package/dist/{chunk-tjt1s9qs.js → chunk-5qaa4atv.js} +2 -2
  52. package/dist/{chunk-qwjz3jsz.js → chunk-5zf3px9y.js} +2 -2
  53. package/dist/chunk-60yk0ye9.js +2 -0
  54. package/dist/chunk-63kwbtgs.js +2 -0
  55. package/dist/{chunk-sgmh6sa8.js → chunk-67fn9pq0.js} +2 -2
  56. package/dist/{chunk-84p483n0.js → chunk-6br4568a.js} +2 -2
  57. package/dist/{chunk-4jza4wwy.js → chunk-6c7q2rz8.js} +2 -2
  58. package/dist/{chunk-7m8hw6gh.js → chunk-6ea6q6dj.js} +2 -2
  59. package/dist/{chunk-88ysxbdh.js → chunk-6v0r7m92.js} +2 -2
  60. package/dist/{chunk-kbzsn9xw.js → chunk-6xap6hvz.js} +2 -2
  61. package/dist/{chunk-re4vc51w.js → chunk-7naym98x.js} +2 -2
  62. package/dist/{chunk-r5q65gf3.js → chunk-7nfv27hz.js} +2 -2
  63. package/dist/{chunk-masqfje4.js → chunk-7tgfj1zb.js} +2 -2
  64. package/dist/{chunk-gfkx1z04.js → chunk-7ywnza68.js} +2 -2
  65. package/dist/{chunk-r8sq654w.js → chunk-8be6eq9r.js} +2 -2
  66. package/dist/chunk-8eyw37rv.js +2 -0
  67. package/dist/{chunk-eqa6cd7b.js → chunk-8pb726d6.js} +2 -2
  68. package/dist/{chunk-zv3bm3np.js → chunk-8x7a5n2w.js} +2 -2
  69. package/dist/{chunk-x2x9g6vk.js → chunk-8yetzgqb.js} +2 -2
  70. package/dist/{chunk-tj0530fn.js → chunk-8zkn8x2j.js} +2 -2
  71. package/dist/chunk-95f0wens.js +2 -0
  72. package/dist/{chunk-g1de763m.js → chunk-9ghxym50.js} +2 -2
  73. package/dist/{chunk-n8fe2njr.js → chunk-9hts7x5n.js} +2 -2
  74. package/dist/{chunk-8sa6xn88.js → chunk-9hwqfjc1.js} +2 -2
  75. package/dist/{chunk-zqpcrtde.js → chunk-9ns2xh84.js} +2 -2
  76. package/dist/{chunk-y8p2dmw3.js → chunk-9nz4c647.js} +2 -2
  77. package/dist/{chunk-tz1gzwas.js → chunk-a2tkhes5.js} +2 -2
  78. package/dist/{chunk-zy6qme7n.js → chunk-a4ebhcsy.js} +2 -2
  79. package/dist/{chunk-mhhtcbh9.js → chunk-aeccrrg1.js} +2 -2
  80. package/dist/{chunk-arr0hypp.js → chunk-aemtk0r5.js} +2 -2
  81. package/dist/{chunk-r7g85s0a.js → chunk-afnnrn6z.js} +2 -2
  82. package/dist/chunk-aj0z9a5r.js +2 -0
  83. package/dist/{chunk-x49qjrbk.js → chunk-aj6yxm6d.js} +2 -2
  84. package/dist/{chunk-rt9dn0b3.js → chunk-aq3hemsb.js} +3 -3
  85. package/dist/{chunk-zk395v8p.js → chunk-b0zzq2ky.js} +2 -2
  86. package/dist/{chunk-f6cexkjm.js → chunk-b3mja7d9.js} +3 -3
  87. package/dist/{chunk-8w08gd0y.js → chunk-b6kn9ack.js} +3 -3
  88. package/dist/{chunk-mfkrs2at.js → chunk-b8tx1n1a.js} +2 -2
  89. package/dist/chunk-bdea3k6b.js +2 -0
  90. package/dist/{chunk-52wrk1mh.js → chunk-bm457bsd.js} +2 -2
  91. package/dist/{chunk-bhajnmtf.js → chunk-bt42z99s.js} +2 -2
  92. package/dist/{chunk-2016dacx.js → chunk-by7k0ypx.js} +2 -2
  93. package/dist/{chunk-wpacvdsv.js → chunk-bysgsnph.js} +2 -2
  94. package/dist/{chunk-bq31dzpj.js → chunk-c0czkyzh.js} +2 -2
  95. package/dist/chunk-c70a2esc.js +2 -0
  96. package/dist/{chunk-xqqk85kd.js → chunk-ccner90h.js} +2 -2
  97. package/dist/{chunk-e84mhse2.js → chunk-cgpnhrm5.js} +3 -3
  98. package/dist/{chunk-kj3a1k2q.js → chunk-chjt1pct.js} +2 -2
  99. package/dist/{chunk-pr7xj1fn.js → chunk-ck70ewc8.js} +2 -2
  100. package/dist/{chunk-fpsn6fmf.js → chunk-ckft9abb.js} +2 -2
  101. package/dist/{chunk-6nbqbjnb.js → chunk-d0zazfrq.js} +3 -3
  102. package/dist/{chunk-q78ng7mn.js → chunk-d607659a.js} +2 -2
  103. package/dist/{chunk-zyn0ys4m.js → chunk-d84xx4bh.js} +2 -2
  104. package/dist/{chunk-vys8kfkp.js → chunk-db8hae9d.js} +2 -2
  105. package/dist/chunk-ddaz4j9s.js +2 -0
  106. package/dist/{chunk-r0dg1bjd.js → chunk-dhx1sd4s.js} +2 -2
  107. package/dist/{chunk-at25g15n.js → chunk-dzncwejn.js} +2 -2
  108. package/dist/chunk-e99t3sk5.js +2 -0
  109. package/dist/{chunk-ske5z0gp.js → chunk-ebkz1sy2.js} +2 -2
  110. package/dist/chunk-eevfr0tx.js +2 -0
  111. package/dist/{chunk-89gyxwmd.js → chunk-enkrqfqq.js} +2 -2
  112. package/dist/{chunk-z8b3nz7t.js → chunk-epqqzh99.js} +2 -2
  113. package/dist/{chunk-prwzyc7q.js → chunk-epqyjwrh.js} +2 -2
  114. package/dist/{chunk-0bc7gfq4.js → chunk-evgfpd16.js} +2 -2
  115. package/dist/chunk-eyw05qyj.js +4 -0
  116. package/dist/{chunk-15m908ph.js → chunk-f2h074g0.js} +2 -2
  117. package/dist/{chunk-zg0tv3sj.js → chunk-fggwwmzc.js} +3 -3
  118. package/dist/{chunk-a18avvt2.js → chunk-fqchnswc.js} +2 -2
  119. package/dist/{chunk-sbyp6k8w.js → chunk-fvmnj6bg.js} +2 -2
  120. package/dist/chunk-fxzh4f7c.js +4 -0
  121. package/dist/chunk-fzfwftqs.js +2 -0
  122. package/dist/{chunk-qd9s7wmj.js → chunk-g9v0jr0f.js} +3 -3
  123. package/dist/{chunk-28nsjq3w.js → chunk-ged1nyhk.js} +5 -5
  124. package/dist/chunk-gk7nn747.js +2 -0
  125. package/dist/chunk-gmns080g.js +2 -0
  126. package/dist/chunk-gw4zbw0m.js +2 -0
  127. package/dist/{chunk-cef598jy.js → chunk-gy446wcz.js} +2 -2
  128. package/dist/chunk-h71pkpwg.js +2 -0
  129. package/dist/{chunk-bsb08p49.js → chunk-ha1s3jbc.js} +3 -3
  130. package/dist/{chunk-k3fwyr6s.js → chunk-hfjttc7r.js} +2 -2
  131. package/dist/{chunk-vedvkp9e.js → chunk-hqc5c3nz.js} +3 -3
  132. package/dist/{chunk-5x2aqmhm.js → chunk-hwhyyaen.js} +2 -2
  133. package/dist/{chunk-z6tw9cf9.js → chunk-j1t1fnew.js} +2 -2
  134. package/dist/chunk-j2bp0zbe.js +2 -0
  135. package/dist/{chunk-y0rnvmrw.js → chunk-jne0bc79.js} +2 -2
  136. package/dist/chunk-jtws1jg5.js +2 -0
  137. package/dist/{chunk-1md5vq9g.js → chunk-jygp7479.js} +2 -2
  138. package/dist/{chunk-b9v0vew6.js → chunk-jz7mckdp.js} +2 -2
  139. package/dist/{chunk-8hm3nkrk.js → chunk-k014w2jg.js} +2 -2
  140. package/dist/{chunk-m6sdmcpj.js → chunk-k0h18sme.js} +2 -2
  141. package/dist/{chunk-vb9mn75j.js → chunk-k1w3acq7.js} +2 -2
  142. package/dist/{chunk-as2j0yp0.js → chunk-k5065dzv.js} +2 -2
  143. package/dist/chunk-k97dpdcj.js +2 -0
  144. package/dist/{chunk-v4tznge3.js → chunk-kgx0jj22.js} +3 -3
  145. package/dist/chunk-khd2r3jh.js +2 -0
  146. package/dist/{chunk-1gb1vwvy.js → chunk-kk9dbwd1.js} +2 -2
  147. package/dist/chunk-kvgn4b2n.js +2 -0
  148. package/dist/{chunk-w83nb5a8.js → chunk-mg9a4t04.js} +2 -2
  149. package/dist/{chunk-6h10jana.js → chunk-mgve4dcw.js} +2 -2
  150. package/dist/{chunk-dhn9f10w.js → chunk-mgwkmr8g.js} +2 -2
  151. package/dist/{chunk-qk1yqepm.js → chunk-mhrn3e8j.js} +2 -2
  152. package/dist/{chunk-fwn521m5.js → chunk-mkawbqx5.js} +2 -2
  153. package/dist/chunk-mp5f940y.js +1 -0
  154. package/dist/chunk-mybye5t2.js +2 -0
  155. package/dist/{chunk-9x70f7zv.js → chunk-n4rep234.js} +2 -2
  156. package/dist/{chunk-k5kzw2px.js → chunk-nebke41s.js} +3 -3
  157. package/dist/{chunk-5h49mv0e.js → chunk-newkrtrj.js} +2 -2
  158. package/dist/{chunk-9jth6sk7.js → chunk-nfnejf16.js} +2 -2
  159. package/dist/{chunk-zyyn9t8n.js → chunk-njw6x85v.js} +3 -3
  160. package/dist/{chunk-1d29gnb2.js → chunk-npt6at4f.js} +2 -2
  161. package/dist/chunk-nrfyvzmk.js +2 -0
  162. package/dist/{chunk-86tpa1nn.js → chunk-nvadhyne.js} +2 -2
  163. package/dist/{chunk-rd51rvde.js → chunk-p2bn8ypc.js} +2 -2
  164. package/dist/chunk-pnx0f495.js +2 -0
  165. package/dist/{chunk-7p0d3rz7.js → chunk-ppcwcrdz.js} +2 -2
  166. package/dist/chunk-prr551k0.js +2 -0
  167. package/dist/chunk-pvm6d77q.js +2 -0
  168. package/dist/{chunk-0b50jg23.js → chunk-pxbww0j1.js} +2 -2
  169. package/dist/{chunk-g947bnqx.js → chunk-pz5d0vgv.js} +2 -2
  170. package/dist/chunk-q2ykvjrz.js +2 -0
  171. package/dist/chunk-q8c4k6qh.js +2 -0
  172. package/dist/{chunk-vnd6smsp.js → chunk-q8y2a23c.js} +2 -2
  173. package/dist/{chunk-11kkxd6v.js → chunk-qbmgsd3h.js} +2 -2
  174. package/dist/{chunk-965sngjd.js → chunk-qbpy0aqe.js} +2 -2
  175. package/dist/chunk-qgrd5xre.js +2 -0
  176. package/dist/{chunk-r8gnmyb1.js → chunk-qkddvxjr.js} +2 -2
  177. package/dist/chunk-qv61ef2y.js +2 -0
  178. package/dist/{chunk-9t672hzm.js → chunk-qvdfrmpb.js} +2 -2
  179. package/dist/chunk-qvzxzzw8.js +2 -0
  180. package/dist/{chunk-b6sb3akb.js → chunk-r2b234a7.js} +2 -2
  181. package/dist/{chunk-0t4fcgge.js → chunk-ra52dqfb.js} +2 -2
  182. package/dist/{chunk-68afy8mk.js → chunk-rb6mjycp.js} +2 -2
  183. package/dist/{chunk-dqjhmzjy.js → chunk-rbs3079t.js} +2 -2
  184. package/dist/chunk-rcynxrkk.js +4 -0
  185. package/dist/{chunk-75xtk0a3.js → chunk-rms7wj04.js} +2 -2
  186. package/dist/{chunk-pr6qwqpj.js → chunk-rntrfb49.js} +2 -2
  187. package/dist/{chunk-h4xx90s4.js → chunk-rxj5619b.js} +2 -2
  188. package/dist/{chunk-72xm1tz1.js → chunk-ry5phnnk.js} +2 -2
  189. package/dist/{chunk-z0q7ghbg.js → chunk-s11mgwyh.js} +2 -2
  190. package/dist/{chunk-4wm5emgf.js → chunk-s170cg6j.js} +2 -2
  191. package/dist/{chunk-8gas4q2s.js → chunk-s1w3j9p9.js} +2 -2
  192. package/dist/{chunk-2dnzdsrv.js → chunk-sfd0pp49.js} +3 -3
  193. package/dist/chunk-shzj5zf0.js +2 -0
  194. package/dist/chunk-sk9rm826.js +2 -0
  195. package/dist/chunk-svxnx1c7.js +2 -0
  196. package/dist/chunk-symaxskd.js +2 -0
  197. package/dist/chunk-t3rv7vat.js +2 -0
  198. package/dist/{chunk-yq4wz4n8.js → chunk-t6ddgvkm.js} +2 -2
  199. package/dist/{chunk-g7dxg38a.js → chunk-th5vv83g.js} +2 -2
  200. package/dist/{chunk-dxwbgg69.js → chunk-tj4b0s68.js} +2 -2
  201. package/dist/chunk-veef1avy.js +2 -0
  202. package/dist/chunk-vgxvtmja.js +2 -0
  203. package/dist/{chunk-ad53zbdb.js → chunk-vjfxm73q.js} +2 -2
  204. package/dist/chunk-vnxa4qe2.js +2 -0
  205. package/dist/{chunk-9y0fxq8e.js → chunk-vq060dnz.js} +2 -2
  206. package/dist/{chunk-ckbqdg1s.js → chunk-vyvsm4v9.js} +2 -2
  207. package/dist/{chunk-8w5bt0nc.js → chunk-w1yrsbw1.js} +2 -2
  208. package/dist/{chunk-64apxzn7.js → chunk-w2p1g8rp.js} +2 -2
  209. package/dist/{chunk-rr5ek064.js → chunk-w4537026.js} +2 -2
  210. package/dist/chunk-wexhc7rb.js +2 -0
  211. package/dist/{chunk-nef7y6mg.js → chunk-wf0ytnh9.js} +2 -2
  212. package/dist/{chunk-xqb4thy8.js → chunk-wf4z9w5x.js} +2 -2
  213. package/dist/{chunk-j4ejwthn.js → chunk-whax282d.js} +2 -2
  214. package/dist/{chunk-x6spt0mc.js → chunk-wrxj79ct.js} +2 -2
  215. package/dist/{chunk-mt01qph9.js → chunk-xanfp0nh.js} +2 -2
  216. package/dist/{chunk-jaghs2z5.js → chunk-xjf2zkrg.js} +2 -2
  217. package/dist/{chunk-dwxmgsg8.js → chunk-xqrhfxct.js} +2 -2
  218. package/dist/{chunk-ksq9a3pf.js → chunk-xxwevgqr.js} +2 -2
  219. package/dist/{chunk-x2wcwpw3.js → chunk-y5qzgfsd.js} +2 -2
  220. package/dist/chunk-y72y3j24.js +2 -0
  221. package/dist/{chunk-81xwn9e5.js → chunk-y8aeahf2.js} +3 -3
  222. package/dist/chunk-ygake3bx.js +2 -0
  223. package/dist/{chunk-zb0m2cqy.js → chunk-ymdhz3x0.js} +2 -2
  224. package/dist/{chunk-erdrx47j.js → chunk-ytkcpeq2.js} +2 -2
  225. package/dist/{chunk-69tgmjdb.js → chunk-z27pxeqg.js} +2 -2
  226. package/dist/{chunk-mrwawq46.js → chunk-z53fd30n.js} +2 -2
  227. package/dist/{chunk-54j6xftt.js → chunk-zjzzqtaj.js} +2 -2
  228. package/dist/{chunk-mmrwaa9h.js → chunk-zpetyx45.js} +2 -2
  229. package/dist/chunk-zpm0t5ye.js +2 -0
  230. package/dist/chunk-ztrkk6sp.js +2 -0
  231. package/dist/client.js +1 -1
  232. package/dist/codex/activity-group.js +1 -1
  233. package/dist/codex/artifact-links.js +1 -1
  234. package/dist/codex/assistant-message.js +1 -1
  235. package/dist/codex/async-question-card.js +1 -1
  236. package/dist/codex/disclosure-state.js +1 -1
  237. package/dist/codex/edited-files-card.js +1 -1
  238. package/dist/codex/image-view-activity.js +1 -1
  239. package/dist/codex/markdown-renderer.js +1 -1
  240. package/dist/codex/navigation-audio.js +1 -1
  241. package/dist/codex/navigation-preview.js +1 -1
  242. package/dist/codex/navigation-rail.js +1 -1
  243. package/dist/codex/patch-view.js +1 -1
  244. package/dist/codex/plan.js +1 -1
  245. package/dist/codex/timeline-virtualizer.js +1 -1
  246. package/dist/codex/turn-activity.js +1 -1
  247. package/dist/codex/user-message.js +1 -1
  248. package/dist/codex/virtualized-turn-list.js +1 -1
  249. package/dist/collections/collection-emoji.js +1 -1
  250. package/dist/collections/collection-menu.js +1 -1
  251. package/dist/collections/collection-panel.js +1 -1
  252. package/dist/collections/collections.js +1 -1
  253. package/dist/collections/host.js +1 -1
  254. package/dist/collections/locales.js +1 -1
  255. package/dist/collections/model.js +1 -1
  256. package/dist/collections/store.js +1 -1
  257. package/dist/composer/completion-filter.js +1 -1
  258. package/dist/composer/completion-menu.js +1 -1
  259. package/dist/composer/completion-trigger.js +1 -1
  260. package/dist/composer/effort-slider.js +1 -1
  261. package/dist/composer/inline-document.js +1 -1
  262. package/dist/composer/inline-dom.js +1 -1
  263. package/dist/composer/menu-radio.js +1 -1
  264. package/dist/composer/model-select.js +1 -1
  265. package/dist/composer/permission-mode-select.js +1 -1
  266. package/dist/composer/prompt-input-attachments.js +1 -1
  267. package/dist/composer/prompt-input-clipboard.js +1 -1
  268. package/dist/composer/prompt-input-context.d.ts +9 -0
  269. package/dist/composer/prompt-input-context.js +1 -1
  270. package/dist/composer/prompt-input-inline.js +1 -1
  271. package/dist/composer/prompt-input-textarea.js +1 -1
  272. package/dist/composer/prompt-input.js +1 -1
  273. package/dist/conversation/action-card.js +1 -1
  274. package/dist/conversation/composer/app-mentions.js +1 -1
  275. package/dist/conversation/composer/apps-menu.js +1 -1
  276. package/dist/conversation/composer/composer-menu.js +1 -1
  277. package/dist/conversation/composer/composer.js +1 -1
  278. package/dist/conversation/composer/config-options.js +1 -1
  279. package/dist/conversation/composer/context.js +1 -1
  280. package/dist/conversation/composer/drafts.js +1 -1
  281. package/dist/conversation/composer/file-items.js +1 -1
  282. package/dist/conversation/composer/long-text.js +1 -1
  283. package/dist/conversation/composer/mention-chips.js +1 -1
  284. package/dist/conversation/composer/mention-uri.js +1 -1
  285. package/dist/conversation/composer/model-menu.js +1 -1
  286. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  287. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  288. package/dist/conversation/composer/prediction.js +1 -1
  289. package/dist/conversation/composer/prompt-history.js +1 -1
  290. package/dist/conversation/composer/slash-command-button.js +1 -1
  291. package/dist/conversation/composer/submit-button.js +1 -1
  292. package/dist/conversation/composer/usage-meter.js +1 -1
  293. package/dist/conversation/connection-notice.js +1 -1
  294. package/dist/conversation/context.js +1 -1
  295. package/dist/conversation/conversation-body.js +1 -1
  296. package/dist/conversation/conversation-search.js +1 -1
  297. package/dist/conversation/conversation-view.js +1 -1
  298. package/dist/conversation/conversation.js +1 -1
  299. package/dist/conversation/diff-modal.js +1 -1
  300. package/dist/conversation/draft-project-picker.js +1 -1
  301. package/dist/conversation/session-actions.js +1 -1
  302. package/dist/conversation/subagent-sessions.js +1 -1
  303. package/dist/conversation/subagent-tasks.js +1 -1
  304. package/dist/desktop/desktop-composer.d.ts +2 -1
  305. package/dist/desktop/desktop-composer.js +1 -1
  306. package/dist/desktop/desktop.js +1 -1
  307. package/dist/desktop/draft-model-select.js +1 -1
  308. package/dist/desktop/load-image.js +1 -1
  309. package/dist/desktop/model-catalog.js +1 -1
  310. package/dist/desktop/model-recovery.js +1 -1
  311. package/dist/desktop/model-settings-action.js +1 -1
  312. package/dist/desktop/native-file-drop.d.ts +3 -1
  313. package/dist/desktop/native-file-drop.js +1 -1
  314. package/dist/generated/commands.d.ts +1 -0
  315. package/dist/generated/commands.js +1 -1
  316. package/dist/generated-image-storage.d.ts +11 -0
  317. package/dist/generated-image-storage.js +1 -0
  318. package/dist/image-lightbox.js +1 -1
  319. package/dist/image-preview-dialog.js +1 -1
  320. package/dist/image.d.ts +5 -1
  321. package/dist/image.js +1 -1
  322. package/dist/lib/app-reference.js +1 -1
  323. package/dist/lib/application-metadata.js +1 -1
  324. package/dist/lib/chat-path.js +1 -1
  325. package/dist/lib/code-highlighter.js +1 -1
  326. package/dist/lib/file-url.js +1 -1
  327. package/dist/lib/fuzzy.js +1 -1
  328. package/dist/lib/group-blocks.js +1 -1
  329. package/dist/lib/image-encode.js +1 -1
  330. package/dist/lib/limits.js +1 -1
  331. package/dist/lib/markdown-parser.js +1 -1
  332. package/dist/lib/markdown-rules.js +1 -1
  333. package/dist/lib/model-name.js +1 -1
  334. package/dist/lib/pointer-centered-zoom.js +1 -1
  335. package/dist/lib/prepare-prompt-files.d.ts +2 -2
  336. package/dist/lib/prepare-prompt-files.js +1 -1
  337. package/dist/lib/reference-presentation.js +1 -1
  338. package/dist/lib/stream-style.js +1 -1
  339. package/dist/lib/streaming-markdown.js +1 -1
  340. package/dist/lib/tool-artifacts.js +1 -1
  341. package/dist/locales.js +1 -1
  342. package/dist/mermaid/diagram.js +1 -1
  343. package/dist/mermaid/export.js +1 -1
  344. package/dist/mermaid/index.js +1 -1
  345. package/dist/mermaid/preview.js +1 -1
  346. package/dist/oauth/claude-login.js +1 -1
  347. package/dist/oauth.js +1 -1
  348. package/dist/plugins/catalog-header.js +1 -1
  349. package/dist/plugins/catalog-skeleton.js +1 -1
  350. package/dist/plugins/host.js +1 -1
  351. package/dist/plugins/locales.js +1 -1
  352. package/dist/plugins/new-chat-directory.js +1 -1
  353. package/dist/plugins/pane.js +1 -1
  354. package/dist/plugins/panel-item.js +1 -1
  355. package/dist/plugins/plugin-detail-page.js +1 -1
  356. package/dist/plugins/plugin-icon.js +1 -1
  357. package/dist/plugins/plugin-icons.js +1 -1
  358. package/dist/plugins/plugins-page.js +1 -1
  359. package/dist/plugins/plugins.js +1 -1
  360. package/dist/plugins/read-skill-document.js +1 -1
  361. package/dist/plugins/skill-document.js +1 -1
  362. package/dist/plugins/skills-tab.js +1 -1
  363. package/dist/plugins/store.js +1 -1
  364. package/dist/plugins/toolbox-layout.js +1 -1
  365. package/dist/reference-projection.js +1 -1
  366. package/dist/search/chat-search.js +1 -1
  367. package/dist/search/codex-source-matches.js +1 -1
  368. package/dist/search/dom-matches.js +1 -1
  369. package/dist/search/find-bar.js +1 -1
  370. package/dist/search/literal-matches.js +1 -1
  371. package/dist/session-list/account-menu.js +1 -1
  372. package/dist/session-list/activity-list.js +1 -1
  373. package/dist/session-list/archived-sessions.js +1 -1
  374. package/dist/session-list/help-menu.js +1 -1
  375. package/dist/session-list/highlight.js +1 -1
  376. package/dist/session-list/host.js +1 -1
  377. package/dist/session-list/hover-info-card.js +1 -1
  378. package/dist/session-list/locales.js +1 -1
  379. package/dist/session-list/navigation-controls.js +1 -1
  380. package/dist/session-list/navigation-header.js +1 -1
  381. package/dist/session-list/navigation-store.js +1 -1
  382. package/dist/session-list/navigation-tabs.js +1 -1
  383. package/dist/session-list/navigation.js +1 -1
  384. package/dist/session-list/platform.js +1 -1
  385. package/dist/session-list/row-stop-button.js +1 -1
  386. package/dist/session-list/session-groups.js +1 -1
  387. package/dist/session-list/session-info-card.js +1 -1
  388. package/dist/session-list/session-list.js +1 -1
  389. package/dist/session-list/session-row.js +1 -1
  390. package/dist/session-list/session-state-dot.js +1 -1
  391. package/dist/session-list/session-state-menu.js +1 -1
  392. package/dist/session-list/shortcut-hint.js +1 -1
  393. package/dist/session-list/shortcut.js +1 -1
  394. package/dist/session-list/sidebar-overlay.js +1 -1
  395. package/dist/session-list/trailing-swap.js +1 -1
  396. package/dist/session-list/use-activity-notification.js +1 -1
  397. package/dist/session-list/use-activity-preview.js +1 -1
  398. package/dist/session-list/use-cmd-held.js +1 -1
  399. package/dist/session-list/use-project-sessions.js +1 -1
  400. package/dist/session-list/virtual-session-rows.js +1 -1
  401. package/dist/session-timeline/activity-group.js +1 -1
  402. package/dist/session-timeline/activity-projection.js +1 -1
  403. package/dist/session-timeline/assistant-content.js +1 -1
  404. package/dist/session-timeline/assistant-image-references.js +1 -1
  405. package/dist/session-timeline/assistant-turn.js +1 -1
  406. package/dist/session-timeline/async-questions.js +1 -1
  407. package/dist/session-timeline/edited-files-card.js +1 -1
  408. package/dist/session-timeline/history-timeline.js +1 -1
  409. package/dist/session-timeline/host.js +1 -1
  410. package/dist/session-timeline/image-generation-progress.js +1 -1
  411. package/dist/session-timeline/navigation-rail.js +1 -1
  412. package/dist/session-timeline/plan.js +1 -1
  413. package/dist/session-timeline/question-reply.js +1 -1
  414. package/dist/session-timeline/resource-content.js +1 -1
  415. package/dist/session-timeline/session-timeline.js +1 -1
  416. package/dist/session-timeline/timeline-registry.js +1 -1
  417. package/dist/session-timeline/turn-activity.js +1 -1
  418. package/dist/session-timeline/turn-error.js +1 -1
  419. package/dist/session-timeline/turn-retry.js +1 -1
  420. package/dist/session-timeline/turn-time.js +1 -1
  421. package/dist/session-timeline/turns.js +1 -1
  422. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  423. package/dist/session-timeline/user-message.js +1 -1
  424. package/dist/settings/codex-account-card.js +1 -1
  425. package/dist/settings/login-card.js +1 -1
  426. package/dist/settings/model-alias-settings.js +1 -1
  427. package/dist/settings/model-aliases.js +1 -1
  428. package/dist/settings/provider-logos.js +1 -1
  429. package/dist/settings/provider-section.js +1 -1
  430. package/dist/settings/providers-port.js +1 -1
  431. package/dist/settings/providers.js +1 -1
  432. package/dist/settings/settings-bridge.js +1 -1
  433. package/dist/settings/settings.js +1 -1
  434. package/native/win32-x64/alwith_native_chat.dll +0 -0
  435. package/native/win32-x64/artifact.json +1 -1
  436. package/package.json +3 -3
  437. package/dist/chunk-0kaa9dja.js +0 -2
  438. package/dist/chunk-0myfs71s.js +0 -2
  439. package/dist/chunk-19jwgexv.js +0 -4
  440. package/dist/chunk-1p3ekdt4.js +0 -2
  441. package/dist/chunk-1xgm6fpr.js +0 -2
  442. package/dist/chunk-2rjg9fs9.js +0 -2
  443. package/dist/chunk-2s0jckfr.js +0 -2
  444. package/dist/chunk-3272z6sv.js +0 -2
  445. package/dist/chunk-38eckxjk.js +0 -2
  446. package/dist/chunk-56jqg70p.js +0 -2
  447. package/dist/chunk-5rzy2287.js +0 -2
  448. package/dist/chunk-6cedp3k2.js +0 -2
  449. package/dist/chunk-6eg26dz5.js +0 -4
  450. package/dist/chunk-7hhc8y2n.js +0 -2
  451. package/dist/chunk-7xsrqwvt.js +0 -2
  452. package/dist/chunk-9s8ht9xe.js +0 -2
  453. package/dist/chunk-b5g055qp.js +0 -2
  454. package/dist/chunk-bqbyjazm.js +0 -2
  455. package/dist/chunk-cmfcnze3.js +0 -4
  456. package/dist/chunk-d4jkh19p.js +0 -2
  457. package/dist/chunk-dn8xcv31.js +0 -2
  458. package/dist/chunk-dwv3z2sk.js +0 -2
  459. package/dist/chunk-e4ws15tg.js +0 -2
  460. package/dist/chunk-e8bazy7m.js +0 -2
  461. package/dist/chunk-eaxevj9t.js +0 -2
  462. package/dist/chunk-f0hb6t2w.js +0 -2
  463. package/dist/chunk-f67e77e6.js +0 -2
  464. package/dist/chunk-fcy6mh2e.js +0 -2
  465. package/dist/chunk-gs0b02g2.js +0 -2
  466. package/dist/chunk-hs98zk6m.js +0 -2
  467. package/dist/chunk-jf7em132.js +0 -1
  468. package/dist/chunk-k2xs8svj.js +0 -2
  469. package/dist/chunk-kv3hsfyk.js +0 -2
  470. package/dist/chunk-kyqf7cqh.js +0 -2
  471. package/dist/chunk-m4ds8kjc.js +0 -2
  472. package/dist/chunk-m6yg0dc9.js +0 -2
  473. package/dist/chunk-n88j8hsd.js +0 -2
  474. package/dist/chunk-nvsws1yg.js +0 -2
  475. package/dist/chunk-p02bdewy.js +0 -2
  476. package/dist/chunk-pae2hjvq.js +0 -2
  477. package/dist/chunk-ptdx40ae.js +0 -2
  478. package/dist/chunk-q61xz251.js +0 -2
  479. package/dist/chunk-rkqptd9w.js +0 -2
  480. package/dist/chunk-t1qj0vqe.js +0 -2
  481. package/dist/chunk-t2ej667n.js +0 -2
  482. package/dist/chunk-tab23kkx.js +0 -2
  483. package/dist/chunk-w1ga47ww.js +0 -2
  484. package/dist/chunk-w2bgfpdh.js +0 -2
  485. package/dist/chunk-wj9s8331.js +0 -2
  486. package/dist/chunk-wjgrrfq9.js +0 -2
  487. package/dist/chunk-ygaqqwmb.js +0 -2
  488. package/dist/chunk-yvzkb5p5.js +0 -2
  489. package/dist/chunk-z6x70w62.js +0 -2
  490. package/dist/chunk-zea1chz7.js +0 -3
@@ -1,7 +1,7 @@
1
- import{ys}from"./chunk-72xm1tz1.js";import{xe}from"./chunk-erdrx47j.js";import{qo}from"./chunk-vys8kfkp.js";import{C}from"./chunk-wjgrrfq9.js";import{Go,Bt}from"./chunk-zk395v8p.js";import{le,Ko}from"./chunk-e4ws15tg.js";import{Uo}from"./chunk-9t672hzm.js";import{Wr,Zr}from"./chunk-pr6qwqpj.js";import{Kr}from"./chunk-4wm5emgf.js";import{Ho,qr}from"./chunk-b9v0vew6.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as y}from"entities";import de from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as be,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as w,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ie}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function T(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var Te=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,ve=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ye=/\uE200[^\uE201]*$/,Ce=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
1
+ import{ks}from"./chunk-ry5phnnk.js";import{Ce}from"./chunk-ytkcpeq2.js";import{Xo}from"./chunk-db8hae9d.js";import{w}from"./chunk-4g2412p5.js";import{Vo,Vt}from"./chunk-b0zzq2ky.js";import{de,Jo}from"./chunk-aj0z9a5r.js";import{Lo}from"./chunk-qvdfrmpb.js";import{Fr,Or}from"./chunk-rntrfb49.js";import{Lr}from"./chunk-s170cg6j.js";import{Ro,Dr}from"./chunk-jz7mckdp.js";import{decodeHTMLAttribute as N,decodeHTMLStrict as C}from"entities";import le from"katex";import{CheckIcon as B,ChevronLeftIcon as ue,ChevronRightIcon as me,CopyIcon as ge,DownloadIcon as fe,FileIcon as he,LinkIcon as pe,MailIcon as ke,XIcon as we}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as D,createElement as X,memo as G,startTransition as be,useContext as J,useEffect as k,useLayoutEffect as V,useMemo as Z,useRef as b,useState as h}from"react";import{jsx as a,jsxs as g,Fragment as ie}from"react/jsx-runtime";var Y=D(!1),Q=D(null);function v(){let e=J(Q);if(e===null)throw Error("Markdown host is missing");return e}var xe=80,H=/\[([^\]\n]+)\]\(([^)\n]+)$/,Te=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,ve=/\uE200[^\uE201]*$/,ye=4,Me=new Set("7zipx.accdb.asarpack.asciidoc.backup.backupdb.bundle.ccproj.cdrdao.code-workspace.config.debugin.deploy.design.docbook.dockerfile.dockerignore.editorconfig.eslintignore.gitattributes.gitignore.gitignore.gitkeep.gradle.graphqls.ignore.ipynb.keychain.keynote.licensee.lockfile.lockfile.markdown.markup.matlab.mkdocs.models.module.msstyle.notebook.npmignore.output.packageinfo.parquet.pickle.plistx.policy.postcssrc.prettierignore.projectfile.python.readme.review.robots.schema.search.series.settingsjson.shader.sqlite.sqlite3.storyboard.styles.system.target.terraform.update.vertex.webapp.webdoc.webpackrc.widget.workspace.xcodeproj.yarnlock".split("."));function L(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function ee(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Ne(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)&&!ee(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function Le(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!L(e,t)&&!ee(e,t,n))return t;return-1}function Ee(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!L(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function Ie(e){return Ee(e,"```")%2===1}function ne(e){let n=0;for(let t=0;t<e.length;){if(e.startsWith("```",t)){for(t+=3;t<e.length&&!e.startsWith("```",t);)t+=1;if(t<e.length)t+=3;continue}if(e[t]==="`"&&!L(e,t))n+=1;t+=1}return n%2===1}function Re(e){return e.endsWith(`
2
2
  `)?`${e}\`\`\``:`${e}
3
3
  \`\`\``}function _(e,n){if(!e.includes(n)||Ne(e,n)%2===0)return e;let t=Le(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
4
- `)||ne(r))return e;return`${e}${n}`}function $e(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function te(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Pe(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=te(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let l=d.toLowerCase();if(l.length>Ce&&!Me.has(l))return!1}return!0}function Se(e){let{path:n}=te(e);if($e(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ae(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Pe(t)||Se(t)?e.replace(H,"$1"):`${e})`}function Fe(e){let n=e.replace(ye,"");if(n.length===0||n.includes("`")&&ne(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Ie(n))return{isCodeFenceOpen:!0,markdown:Re(n)};if(n.includes("!["))n=n.replace(ve,(t,r)=>r);if(n.includes("]("))n=Ae(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function He(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return He(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function re(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))re(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
5
- `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Go(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=T(),r=Ko();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Zr,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=T(),o=le();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=T(),i=w(null),[c,d]=h(null),[l,p]=h(null),[E,b]=h(!1);if(k(()=>{let f=Kr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let x=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{b(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),b(!0),window.setTimeout(()=>b(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...x===null?{children:e}:{dangerouslySetInnerHTML:{__html:x}}})})]})}function De({code:e,language:n}){let t=T(),r=J(Y),o=Ko();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Uo,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=w(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return T().preview?a(ie,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=T(),t=le(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Bt(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=w(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ie,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=w(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");de.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
- `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,Te)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function ae(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ae(r),s=t.get(o)??0;return t.set(o,s+1),se(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!qo(r))return null;return a(Ve,{src:r,alt:y(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function se(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Wr))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(ys,{text:y(t.text),children:q(y(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=C(o);if(s!==null)return a(xe,{app:{id:s,name:y(t.text).replace(/^\$/,"")}},n);return qo(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function v(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?y(n.text):n.tokens.map(v).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(v).join("");case"list":return e.items.map(v).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(v).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},se(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=ae(I),A=f.get(R)??0;f.set(R,A+1);let F=v(I),ce={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,ce})},[n]),s=o.map((u)=>u.visibleText).join(""),i=w({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],b=c.generation+(d?0:1),x={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:b};if(r&&s.length>l)x.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=x}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:x.runs,generation:b},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=w(null),[o,s]=h(()=>Ho(n,t)),i=w(o!==null),[c,d]=h(null);if(k(()=>{let l=qr((p)=>{if(!i.current)i.current=!0,s(p);else be(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Ht({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
7
- export{Ht};
4
+ `)||ne(r))return e;return`${e}${n}`}function $e(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function te(e){let n=e.replaceAll("`","").trim(),t=n.match(/^(.*?):(\d+)(?::(\d+))?(?:[-–](\d+)(?::(\d+))?)?$/);if(t!==null){let[,o,s,i,c,d]=t;if(o===void 0||s===void 0)throw Error("Codex file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}let r=n.match(/^(.*?)#L(\d+)(?:C(\d+))?(?:-L(\d+)(?:C(\d+))?)?$/);if(r!==null){let[,o,s,i,c,d]=r;if(o===void 0||s===void 0)throw Error("Codex hash file location is incomplete");return{path:o,line:Number.parseInt(s,10),column:i===void 0?void 0:Number.parseInt(i,10),endLine:c===void 0?void 0:Number.parseInt(c,10),endColumn:d===void 0?void 0:Number.parseInt(d,10)}}return{path:n}}function Pe(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=te(e);if(/^[a-z][a-z0-9+.-]*:\/\//i.test(n)||/^www\./i.test(n)||/^(mailto|tel):/i.test(n))return!1;if(t!==void 0||r!==void 0||o!==void 0||s!==void 0)return!0;if(!/(?:^|[\\/])[^\\/]+\.(?!\d+$)[^\\/.]+$/i.test(n))return!1;let i=/[\\/]/.test(n),c=n.split(/[\\/]/).at(-1);if(c===void 0)throw Error("Codex streaming link target has no file name");let d=c.split(".").at(-1);if(d===void 0||d.length===0)return!1;if(!i&&/[a-z]/.test(d)&&/[A-Z]/.test(d.slice(1)))return!1;if(!i){let l=d.toLowerCase();if(l.length>ye&&!Me.has(l))return!1}return!0}function Se(e){let{path:n}=te(e);if($e(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ae(e){let n=e.match(H);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Pe(t)||Se(t)?e.replace(H,"$1"):`${e})`}function Fe(e){let n=e.replace(ve,"");if(n.length===0||n.includes("`")&&ne(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&Ie(n))return{isCodeFenceOpen:!0,markdown:Re(n)};if(n.includes("!["))n=n.replace(Te,(t,r)=>r);if(n.includes("]("))n=Ae(n);return n=_(n,"**"),n=_(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function He(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function O(e){return He(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function re(e){for(let n=0;n<e.length;n+=1){let t=e[n];if(t===void 0)throw Error(`Codex Markdown token is missing at index ${n}`);if("tokens"in t&&Array.isArray(t.tokens))re(t.tokens);if(!O(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!O(i))break;r.push(...i.tokens),o+=1,s=o}if(s===n+1)continue;t.tokens=r,t.text=r.map((i)=>i.raw).join(`
5
+ `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function j(e){return{type:"text",raw:e,text:e}}function _e(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function P(e){for(let n of e){if(n.type==="list")for(let t of n.items){let r=t.tokens[0];if(r?.type==="heading"){let o=r,s=o.raw.trimEnd(),i=s.match(/^#{1,6}\s+/)?.[0];if(i!==void 0)t.tokens[0]={type:"paragraph",raw:o.raw,text:s,tokens:o.tokens===void 0?[j(s)]:[j(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?_e(o):o);P(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))P(n.tokens)}}function Oe(e,n){let t;try{t=Vo(e,n)}catch{return}try{return decodeURIComponent(t)}catch(r){if(r instanceof URIError)return t;throw r}}function je({links:e,children:n}){let t=v(),r=Jo();if(t.preview||!r)return a("p",{className:"codex-markdown-paragraph",children:n});return a(Or,{links:e})}function We(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function qe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function ze(e){let n=qe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function Ue({href:e}){let n=Z(()=>ze(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ke:o?he:pe;return g("span",{className:"codex-markdown-favicon",children:[t===void 0?a("span",{className:"codex-markdown-favicon-fallback",children:a(s,{"aria-hidden":!0})}):null,n.map((i)=>a("img",{alt:"",className:t===i?"codex-markdown-favicon-image-loaded":void 0,decoding:"async",draggable:!1,referrerPolicy:"no-referrer",src:i,onLoad:()=>r((c)=>c!==void 0&&n.includes(c)?c:i)},i))]})}function Ke({children:e,href:n,title:t}){let r=v(),o=de();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:Oe(n,o)??t,onClick:(s)=>We(s,n,r),children:g("span",{className:"codex-markdown-link-mention","data-layout":"inline-flow","data-interactive":"","data-underline-on-hover":"",children:[a("span",{className:"codex-markdown-link-icon-container","data-markdown-copy":"exclude",children:a(Ue,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Be({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=v(),i=b(null),[c,d]=h(null),[l,p]=h(null),[E,x]=h(!1);if(k(()=>{let f=Lr(d,p);return i.current=f,()=>{f.dispose(),i.current=null}},[]),k(()=>{let f=i.current;if(f===null)throw Error("Code highlighter is not mounted");f.update(e,n)},[e,n]),l!==null)throw l;let T=c!==null&&c.code===e&&c.language===n?c.html:null,u=async()=>{x(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),x(!0),window.setTimeout(()=>x(!1),2000)}catch(f){s?.(f)}};return g("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[g("div",{className:"codex-markdown-code-header","data-markdown-copy":"exclude",children:[a("div",{className:"codex-markdown-code-title",children:n}),a("div",{className:"codex-markdown-code-actions",children:a("button",{type:"button",className:"codex-markdown-code-copy",title:r,onClick:()=>void u(),children:E?a(B,{}):a(ge,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...T===null?{children:e}:{dangerouslySetInnerHTML:{__html:T}}})})]})}function De({code:e,language:n}){let t=v(),r=J(Y),o=Jo();if(t.preview)return a("span",{children:e});if(!r&&o&&n?.toLowerCase()==="mermaid")return a(Lo,{source:e});return a(Xe,{code:e,language:n})}function Xe({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(k(()=>{if(r)return;let s=t.current;if(s===null)throw Error("Codex code block placeholder is not mounted");if(typeof IntersectionObserver>"u"){let c=window.setTimeout(()=>o(!0),0);return()=>window.clearTimeout(c)}let i=new IntersectionObserver((c)=>{if(!c.some((d)=>d.isIntersecting))return;o(!0),i.disconnect()},{rootMargin:"600px 0px"});return i.observe(s),()=>i.disconnect()},[r]),r)return a(Be,{code:e,language:n});return a("div",{ref:t,className:"codex-markdown-code-block",children:a("pre",{className:"codex-markdown-code-placeholder",children:a("code",{children:e})})})}function Ge(e){let n=[...document.body.querySelectorAll('[data-markdown-image-preview-trigger="true"]')],t=n.map((o)=>{let s=o.querySelector("img");if(s===null)throw Error("Codex image preview trigger has no image");return{src:s.currentSrc||s.src,alt:s.alt}}),r=n.indexOf(e);if(r===-1)throw Error("Codex image preview trigger is outside the document");return{images:t,index:r}}function Je({preview:e,setPreview:n}){let t=e.images[e.index];if(t===void 0)throw Error(`Codex image preview index is out of range: ${e.index}`);return g("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),g("div",{className:"codex-markdown-image-preview-actions",children:[a("button",{type:"button","aria-label":"Previous image",disabled:e.index===0,onClick:()=>n({...e,index:e.index-1}),children:a(ue,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(fe,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(me,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(we,{})})]})]})}function Ve(e){return v().preview?a(ie,{children:e.alt}):a(Ze,{...e})}function Ze(e){let{loadImage:n}=v(),t=de(),{src:r}=e,s=!r.startsWith("//")&&(!/^[a-z][a-z\d+.-]*:/i.test(r)||/^file:/i.test(r)||/^[a-z]:[\\/]/i.test(r))&&n!==void 0,[i,c]=h();if(k(()=>{if(!s)return;let d=!0;return(async()=>{let l=Vt(r,t);if(l===null)throw Error("The image does not name a local file");return n(l)})().then((l)=>{if(d)c({source:r,directory:t,url:l})},(l)=>{if(d)c({source:r,directory:t,error:l instanceof Error?l.message:String(l)})}),()=>{d=!1}},[s,n,r,t]),!s)return a(W,{...e});if(i?.source!==r||i.directory!==t)return a("span",{role:"status",children:e.alt});if(i.error!==void 0)return g("span",{role:"alert",title:i.error,children:[e.alt,": ",i.error]});if(i.url===void 0)throw Error("The local image result has no URL");return a(W,{...e,src:i.url})}function W({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();k(()=>{let d=o.current;if(d===null)throw Error("Codex image preview dialog is not mounted");if(s===void 0){if(d.open)d.close();return}if(!d.open)d.showModal()},[s]);let c=n.length===0?"Open image preview":n;return g(ie,{children:[a("button",{type:"button",className:`codex-markdown-image-trigger${r?"codex-markdown-image-trigger-wide":""}`,"aria-label":c,"data-markdown-image-preview-trigger":"true",onClick:(d)=>i(Ge(d.currentTarget)),children:a("img",{className:`codex-markdown-image${r?"codex-markdown-image-wide":""}`,src:e,alt:n,title:t,loading:"lazy"})}),a("dialog",{ref:o,className:"codex-markdown-image-dialog","aria-label":c,onClose:()=>i(void 0),children:s===void 0?null:a(Je,{preview:s,setPreview:i})})]})}function Ye({value:e,display:n}){let t=b(null);return V(()=>{if(t.current===null)throw Error("Codex math root is not mounted");le.render(e,t.current,{displayMode:n,throwOnError:!1})},[n,e]),a("span",{ref:t,className:n?"codex-markdown-math-block":"codex-markdown-inline-math"})}var Qe=150,M=null;function q(e,n){let t=M;if(t===null)return e;let r=t.cursor,o=r+e.length;t.cursor=o;let s=[],i=r;for(let c of t.runs){if(c.end<=r)continue;if(c.start>=o)break;let d=Math.max(r,c.start),l=Math.min(o,c.end);if(i<d)s.push(e.slice(i-r,d-r));s.push(a("span",{className:"codex-markdown-fade",children:e.slice(d-r,l-r)},`${n}:${t.generation}:${c.start}`)),i=l}if(i<o)s.push(e.slice(i-r));return s}function oe(e){let n=5381;for(let t=0;t<e.length;t+=1)n=(n*33+e.charCodeAt(t))%4294967296;return n.toString(36)}function z(e){let n=e.trim();if(n.length===0)return"";let t=n.split(`
6
+ `,1)[0];if(t===void 0)throw Error("Codex Markdown token has no first line");return(t.match(/\S+/)?.[0]??t).slice(0,xe)}function en(e){switch(e.type){case"code":return e.raw.trimStart().match(/^(```|~~~)/)?.[1]??"";case"link":return e.href;case"image":{let n=e;return`${n.href}:${z(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return z(e.text);default:return""}}function ae(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${oe(en(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ae(r),s=t.get(o)??0;return t.set(o,s+1),se(r,`${n}-${o}-${s}`)})}function nn(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return g("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?g("div",{className:"codex-markdown-task-checkbox",children:[a("input",{type:"checkbox",className:"codex-markdown-checkbox",checked:e.checked,"data-state":e.checked?"checked":"unchecked",readOnly:!0,disabled:!0}),e.checked?a(B,{}):null]}):null,m(t,n)]},n)}function tn(e,n){let r=`codex-markdown-list ${e.items.some((s)=>s.task)?"codex-markdown-task-list":e.ordered?"codex-markdown-ordered-list":"codex-markdown-unordered-list"}`,o=m(e.items,n);return e.ordered?a("ol",{className:r,start:e.start===""?void 0:e.start,children:o},n):a("ul",{className:r,children:o},n)}function U(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return X(r,{key:n,className:`${t?"codex-markdown-table-header":"codex-markdown-table-cell"}${o?" codex-markdown-numeric-table-cell":""}`,align:e.align??void 0},...m(e.tokens,n))}function rn(e,n){let t=new Map;return a("div",{className:"codex-markdown-table-container","data-markdown-table":!0,tabIndex:-1,children:a("div",{className:"codex-markdown-table-scroller",children:a("div",{className:"codex-markdown-table-wrapper",children:g("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>U(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=oe(r.map((c)=>c.text).join("\x00")),s=t.get(o)??0;t.set(o,s+1);let i=`${n}-row-${o}-${s}`;return a("tr",{className:"codex-markdown-table-row",children:r.map((c,d)=>U(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=N(e.href);if(!Xo(r))return null;return a(Ve,{src:r,alt:C(e.text),title:e.title==null?void 0:N(e.title),allowWide:t},n)}function se(e,n){switch(e.type){case"space":case"def":case"internalMessage":return null;case"hr":return a("hr",{className:"codex-markdown-horizontal-rule"},n);case"heading":{let t=e,o={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}[t.depth];if(o===void 0)throw Error(`Unsupported Codex Markdown heading depth: ${t.depth}`);return X(o,{key:n,className:`codex-markdown-heading codex-markdown-heading-${t.depth}`},...m(t.tokens,n))}case"paragraph":{let t=e,r=t.tokens.filter((c)=>c.type!=="space"&&c.type!=="br"),o=t.tokens.filter((c)=>c.type!=="text"||c.raw.trim().length>0);if(o.length>0&&o.every(Fr))return a(je,{links:o,children:m(t.tokens,n)},n);let s=r.length>0&&r.every((c)=>c.type==="image"),i=s&&r.length>1;return a("p",{className:`codex-markdown-paragraph${s?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${i?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":i?"true":void 0,"data-wide-markdown-block":s?"true":void 0,"data-wide-markdown-block-kind":s?"image":void 0,children:s?r.map((c,d)=>K(c,`${n}-image-${d}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?a(ks,{text:C(t.text),children:q(C(t.text),n)},n):m(t.tokens,n)}case"escape":return q(e.text,n);case"strong":return a("strong",{className:"codex-markdown-strong",children:m(e.tokens,n)},n);case"em":return a("em",{children:m(e.tokens,n)},n);case"del":return a("del",{children:m(e.tokens,n)},n);case"codespan":return a("span",{className:"codex-markdown-inline-code",dir:"ltr","data-markdown-copy":"inline-code",children:e.text},n);case"br":return a("br",{},n);case"link":{let t=e,r=m(t.tokens,n),o=N(t.href),s=w(o);if(s!==null)return a(Ce,{app:{id:s,name:C(t.text).replace(/^\$/,"")}},n);return Xo(o)?a(Ke,{href:o,title:t.title==null?void 0:N(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(De,{code:t.text,language:t.lang},n)}case"blockquote":return a("blockquote",{className:"codex-markdown-blockquote",children:m(e.tokens,n)},n);case"list":return tn(e,n);case"list_item":return nn(e,n);case"table":return rn(e,n);case"html":{let t=e;return/^<br\s*\/?>$/i.test(t.raw.trim())?a("br",{},n):t.raw}case"math":{let t=e;return a(Ye,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function y(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?C(n.text):n.tokens.map(y).join("")}case"escape":return e.text;case"paragraph":case"heading":case"strong":case"em":case"del":case"link":case"blockquote":case"list_item":return e.tokens.map(y).join("");case"list":return e.items.map(y).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(y).join("")).join("")).join("")}default:return""}}function on({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=M;try{return M={cursor:t,runs:r,generation:o},se(e,n)}finally{M=s}}var an=G(function({result:n}){let{text:t,isStreaming:r}=n,o=Z(()=>{let u=n.tokens;if(n.source.includes("!["))re(u);P(u);let f=new Map,S=0;return u.map((I)=>{let R=ae(I),A=f.get(R)??0;f.set(R,A+1);let F=y(I),ce={token:I,tokenKey:`root-${R}-${A}`,offset:S,visibleText:F};return S+=F.length,ce})},[n]),s=o.map((u)=>u.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),l=d?c.visibleText.length:0,p=performance.now(),E=r&&d?c.runs.filter((u)=>p-u.firstSeenAtMs<Qe):[],x=c.generation+(d?0:1),T={text:t,visibleText:s,runs:E.filter((u)=>u.start<s.length).map((u)=>({...u,end:Math.min(u.end,s.length)})),generation:x};if(r&&s.length>l)T.runs.push({start:l,end:s.length,firstSeenAtMs:p});return V(()=>{i.current=T}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((u)=>a(on,{token:u.token,tokenKey:u.tokenKey,offset:u.offset,runs:T.runs,generation:x},u.tokenKey))})}),sn=G(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Ro(n,t)),i=b(o!==null),[c,d]=h(null);if(k(()=>{let l=Dr((p)=>{if(!i.current)i.current=!0,s(p);else be(()=>s(p))},d);return r.current=l,()=>{l.dispose(),r.current=null}},[]),k(()=>{let l=r.current;if(l===null)throw Error("Markdown parser is not mounted");let p=t?Fe(n).markdown:n;l.update({source:p,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(an,{result:o})});function Bt({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(Q.Provider,{value:t,children:a(Y.Provider,{value:r,children:a(sn,{text:r?o:e,isStreaming:r})})})}
7
+ export{Bt};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-kyqf7cqh.js";import{ExternalLink as n}from"lucide-react";import{DropdownMenuItem as m}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as i,jsxs as l}from"react/jsx-runtime";function ze(){let{host:o}=e(),r=o.openSettings;if(!r)return null;return l(m,{className:"h-9 gap-2 rounded-md px-2 text-sm font-normal",onClick:()=>{Promise.resolve(r("provider")).catch((t)=>o.reportError?o.reportError(t):console.error(t))},children:[o.t("model.moreModels"),i(n,{className:"ml-auto size-4","aria-hidden":"true"})]})}
2
- export{ze};
1
+ import{e}from"./chunk-qgrd5xre.js";import{ExternalLink as n}from"lucide-react";import{DropdownMenuItem as m}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as i,jsxs as l}from"react/jsx-runtime";function Be(){let{host:o}=e(),r=o.openSettings;if(!r)return null;return l(m,{className:"h-9 gap-2 rounded-md px-2 text-sm font-normal",onClick:()=>{Promise.resolve(r("provider")).catch((t)=>o.reportError?o.reportError(t):console.error(t))},children:[o.t("model.moreModels"),i(n,{className:"ml-auto size-4","aria-hidden":"true"})]})}
2
+ export{Be};
@@ -0,0 +1,2 @@
1
+ import{u}from"./chunk-pz5d0vgv.js";async function ha(a){let e=await u.previewFile({path:a});if(e.kind!=="image")throw Error("Image preview is unavailable");return`data:${e.mimeType};base64,${e.data}`}
2
+ export{ha};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-e4ws15tg.js";import{Ft}from"./chunk-nhz4egjh.js";import{Dr}from"./chunk-5x2aqmhm.js";import{L}from"./chunk-38eckxjk.js";import{Wn}from"./chunk-q78ng7mn.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as C}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(L,{block:e.content},`${n.id}:${l}`))]})}var Ro=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(Wn),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...Dr(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(C,{children:[s(Ft,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
- export{Ro};
1
+ import{t}from"./chunk-aj0z9a5r.js";import{zt}from"./chunk-1vwece23.js";import{Xr}from"./chunk-hwhyyaen.js";import{C}from"./chunk-q2ykvjrz.js";import{Xn}from"./chunk-d607659a.js";import{isContentEntry as T,isEmbeddedResource as h,isResourceLink as x,terminalOf as A}from"@nyssance/codex-acp-v2/client";import{memo as I,useMemo as y}from"react";import{jsx as s,jsxs as g,Fragment as E}from"react/jsx-runtime";function R({item:n}){if(n.name==="view_image"&&n.status==="completed")return null;let r=n.content.filter(T).filter((e)=>h(e.content)||x(e.content));if(r.length===0)return null;return g("fieldset",{className:"mt-1 min-w-0",children:[s("legend",{className:"text-muted-foreground text-xs",children:n.title??n.name}),r.map((e,l)=>s(C,{block:e.content},`${n.id}:${l}`))]})}var Go=I(function({sessionId:r,items:e,terminals:l,streamingThoughtId:a}){let b=t(),i=e.every(Xn),c=b.toolBlock,m=y(()=>new WeakMap,[r,i,c]),v=y(()=>e.map((o)=>{let f=o.kind==="tool"?A(o,l):null,u=o.kind==="thought"&&o.id===a,d=m.get(o);if(d?.terminal===f&&d.thinking===u)return d.block;let p={...Xr(o,l,u),id:JSON.stringify([r,i?"history":"live",o.id])},k=p.type==="tool_use"&&o.kind==="tool"&&c!==void 0?c(p,o):p;return m.set(o,{terminal:f,thinking:u,block:k}),k}),[r,i,e,l,a,c,m]);return g(E,{children:[s(zt,{blocks:v,defaultExpanded:!i}),e.map((o)=>o.kind==="tool"&&s(R,{item:o},o.id))]})});
2
+ export{Go};
@@ -0,0 +1,2 @@
1
+ import{isResourceLink as t}from"@nyssance/codex-acp-v2/client";var to="alwith-generated-image:";function ke(e){return t(e)&&e.uri.startsWith(to)?e.uri.slice(to.length):null}
2
+ export{to,ke};
@@ -0,0 +1,2 @@
1
+ import{Ve}from"./chunk-xxwevgqr.js";import{b}from"./chunk-veef1avy.js";import{Xi,Yi,$e,er}from"./chunk-bt42z99s.js";import{R,_t,V,Tt}from"./chunk-th5vv83g.js";import{Bot as p}from"lucide-react";import{jsx as l}from"react/jsx-runtime";var r={"alwith-account":Xi,chatgpt:Yi,minimax:$e,seedream:er};function Vi({provider:o,className:i,...a}){let e=Object.hasOwn(r,o)?r[o]:R.find((n)=>n.id===o)?.logo??p;return l(e,{"aria-hidden":"true",...a,className:["size-4 shrink-0",i].filter(Boolean).join(" ")})}var s=new Map(Ve.filter((o)=>o.source==="account").flatMap((o)=>o.models.map((i)=>[V(o.id,i.id),i.label]))),d=new Map([...Ve.map((o)=>[o.id,o.source==="account"?1:2]),[b.id,0]]);function On(o){return o.shortLabel??o.label}function Ge(o,i={}){return o.toSorted((e,n)=>(d.get(e.id)??3)-(d.get(n.id)??3)).map((e)=>{let n=e.id===b.id;return{...e,models:e.models.map((t)=>({...t,label:s.get(t.api_id)??t.label,shortLabel:t.shortLabel??Tt[t.api_id]?.shortLabel,icon:i.providerIcon?.(e.id,t.api_id)??l(Vi,{provider:n?"chatgpt":e.id==="litellm"||e.id==="alwith-managed-litellm"||_t(t.api_id)?"alwith-account":e.id})}))}})}
2
+ export{Vi,On,Ge};
@@ -1,2 +1,2 @@
1
- import"@alwith/module-chat/plugins.css";import{jsx as o}from"react/jsx-runtime";var Q="toolbox-content pb-8",Se="toolbox-detail flex max-h-[85dvh] flex-col gap-6 overflow-hidden rounded-2xl p-6 sm:max-w-3xl";function _e({children:e}){return o("div",{className:"toolbox-content shrink-0 pt-8",children:o("div",{className:"toolbox-toolbar flex min-h-9 items-center [&>header]:w-full [&>nav]:w-full","data-plugin-page-header":"",children:e})})}
2
- export{Q,Se,_e};
1
+ import"@alwith/module-chat/plugins.css";import{jsx as o}from"react/jsx-runtime";var Q="toolbox-content pb-8",Pe="toolbox-detail flex max-h-[85dvh] flex-col gap-6 overflow-hidden rounded-2xl p-6 sm:max-w-3xl";function Te({children:e}){return o("div",{className:"toolbox-content shrink-0 pt-8",children:o("div",{className:"toolbox-toolbar flex min-h-9 items-center [&>header]:w-full [&>nav]:w-full","data-plugin-page-header":"",children:e})})}
2
+ export{Q,Pe,Te};
@@ -1,5 +1,5 @@
1
- import{H,Vt,xs}from"./chunk-k3fwyr6s.js";import{m}from"./chunk-x2x9g6vk.js";function f(o,d,r){let s=document.createElement("span");if(s.contentEditable="false",s.setAttribute("aria-label",o),s.className=Vt,r){let t=document.createElement("img");t.src=r,t.alt="",t.draggable=!1,t.setAttribute("aria-hidden","true"),t.className="size-3.5 shrink-0 self-center object-contain";let l=document.createElement("span");return l.textContent=o,s.append(t,l),s}let a=document.createElementNS("http://www.w3.org/2000/svg","svg");for(let[t,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))a.setAttribute(t,l);a.setAttribute("class","size-3.5 shrink-0 self-center");for(let[t,l]of xs[d]){let e=document.createElementNS("http://www.w3.org/2000/svg",t);for(let[i,c]of Object.entries(l))e.setAttribute(i,c);a.append(e)}let n=document.createElement("span");return n.textContent=o,s.append(a,n),s}function mr(o,d,r=[],s){let a=document.createDocumentFragment(),n="",t=()=>{let e=0;for(let i of H(n,r)){a.append(document.createTextNode(n.slice(e,i.start)));let c=f(i.name.slice(1),i.kind,i.kind==="skill"?s?.(i.name.slice(1)):void 0);if(i.kind==="skill")c.dataset.inlineSkill=i.name;else c.dataset.inlineCommand=i.name;a.append(c);let u=document.createElement("span");u.dataset.inlineAnchor="",u.textContent="​",a.append(u),e=i.end}if(n.slice(e))a.append(document.createTextNode(n.slice(e)));n=""};for(let e of m(d)){if(typeof e==="string"){n+=e;continue}t();let i=f(e.name,"app");i.dataset.inlineApp=e.id,a.append(i);let c=document.createElement("span");c.dataset.inlineAnchor="",c.textContent="​",a.append(c)}t();let l=document.createElement("br");l.dataset.inlineCaret="",a.append(l),o.replaceChildren(a)}function vo(o,d){let r=[],s=new Map(d.map((n)=>[n.id,n])),a=(n)=>{if(n.nodeType===Node.TEXT_NODE){r.push(...(n.textContent??"").split(""));return}if(n instanceof HTMLElement){if(n.hasAttribute("data-inline-caret"))return;if(n.hasAttribute("data-inline-anchor")){r.push(...(n.textContent??"").replace("​","").split(""));return}let t=n.dataset.inlineSkill??n.dataset.inlineCommand;if(t!==void 0){r.push(...t.split(""));return}let l=n.dataset.inlineApp;if(l!==void 0){let i=s.get(l);if(i)r.push(i);return}if(n.tagName==="BR"){r.push(`
1
+ import{H,qt,Ss}from"./chunk-hfjttc7r.js";import{m}from"./chunk-8yetzgqb.js";function f(o,d,r){let s=document.createElement("span");if(s.contentEditable="false",s.setAttribute("aria-label",o),s.className=qt,r){let t=document.createElement("img");t.src=r,t.alt="",t.draggable=!1,t.setAttribute("aria-hidden","true"),t.className="size-3.5 shrink-0 self-center object-contain";let l=document.createElement("span");return l.textContent=o,s.append(t,l),s}let a=document.createElementNS("http://www.w3.org/2000/svg","svg");for(let[t,l]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))a.setAttribute(t,l);a.setAttribute("class","size-3.5 shrink-0 self-center");for(let[t,l]of Ss[d]){let e=document.createElementNS("http://www.w3.org/2000/svg",t);for(let[i,c]of Object.entries(l))e.setAttribute(i,c);a.append(e)}let n=document.createElement("span");return n.textContent=o,s.append(a,n),s}function hr(o,d,r=[],s){let a=document.createDocumentFragment(),n="",t=()=>{let e=0;for(let i of H(n,r)){a.append(document.createTextNode(n.slice(e,i.start)));let c=f(i.name.slice(1),i.kind,i.kind==="skill"?s?.(i.name.slice(1)):void 0);if(i.kind==="skill")c.dataset.inlineSkill=i.name;else c.dataset.inlineCommand=i.name;a.append(c);let u=document.createElement("span");u.dataset.inlineAnchor="",u.textContent="​",a.append(u),e=i.end}if(n.slice(e))a.append(document.createTextNode(n.slice(e)));n=""};for(let e of m(d)){if(typeof e==="string"){n+=e;continue}t();let i=f(e.name,"app");i.dataset.inlineApp=e.id,a.append(i);let c=document.createElement("span");c.dataset.inlineAnchor="",c.textContent="​",a.append(c)}t();let l=document.createElement("br");l.dataset.inlineCaret="",a.append(l),o.replaceChildren(a)}function ko(o,d){let r=[],s=new Map(d.map((n)=>[n.id,n])),a=(n)=>{if(n.nodeType===Node.TEXT_NODE){r.push(...(n.textContent??"").split(""));return}if(n instanceof HTMLElement){if(n.hasAttribute("data-inline-caret"))return;if(n.hasAttribute("data-inline-anchor")){r.push(...(n.textContent??"").replace("​","").split(""));return}let t=n.dataset.inlineSkill??n.dataset.inlineCommand;if(t!==void 0){r.push(...t.split(""));return}let l=n.dataset.inlineApp;if(l!==void 0){let i=s.get(l);if(i)r.push(i);return}if(n.tagName==="BR"){r.push(`
2
2
  `);return}if((n.tagName==="DIV"||n.tagName==="P")&&r.length&&r.at(-1)!==`
3
3
  `)r.push(`
4
- `)}for(let t of n.childNodes)a(t)};for(let n of o.childNodes)a(n);return r}function gr(o,d,r){let s=window.getSelection();if(!s?.rangeCount)return r;let a=s.getRangeAt(0);if(!o.contains(a.startContainer)||!o.contains(a.endContainer))return r;let n=(t,l)=>{let e=document.createRange();return e.selectNodeContents(o),e.setEnd(t,l),vo(e.cloneContents(),d).length};return{start:n(a.startContainer,a.startOffset),end:n(a.endContainer,a.endOffset)}}function yo(o,d){let r=(n)=>{let t=Math.max(0,n);for(let[l,e]of[...o.childNodes].entries())if(e.nodeType===Node.TEXT_NODE){let i=e.textContent?.length??0;if(t<=i)return[e,t];t-=i}else if(e instanceof HTMLElement&&e.hasAttribute("data-inline-anchor")){let i=e.firstChild,c=(e.textContent??"").replace("​","").length;if(i&&t<=c)return[i,t+(i.textContent?.startsWith("​")?1:0)];t-=c}else if(e instanceof HTMLElement&&(e.dataset.inlineSkill!==void 0||e.dataset.inlineCommand!==void 0)){let i=(e.dataset.inlineSkill??e.dataset.inlineCommand).length;if(t<i)return[o,l];t-=i}else if(e instanceof HTMLElement&&e.dataset.inlineApp!==void 0){if(t===0)return[o,l];t--}else if(e instanceof HTMLElement&&e.tagName==="BR")return[o,l];return[o,o.childNodes.length]},s=document.createRange();s.setStart(...r(d.start)),s.setEnd(...r(d.end));let a=window.getSelection();a?.removeAllRanges(),a?.addRange(s)}
5
- export{mr,vo,gr,yo};
4
+ `)}for(let t of n.childNodes)a(t)};for(let n of o.childNodes)a(n);return r}function vr(o,d,r){let s=window.getSelection();if(!s?.rangeCount)return r;let a=s.getRangeAt(0);if(!o.contains(a.startContainer)||!o.contains(a.endContainer))return r;let n=(t,l)=>{let e=document.createRange();return e.selectNodeContents(o),e.setEnd(t,l),ko(e.cloneContents(),d).length};return{start:n(a.startContainer,a.startOffset),end:n(a.endContainer,a.endOffset)}}function So(o,d){let r=(n)=>{let t=Math.max(0,n);for(let[l,e]of[...o.childNodes].entries())if(e.nodeType===Node.TEXT_NODE){let i=e.textContent?.length??0;if(t<=i)return[e,t];t-=i}else if(e instanceof HTMLElement&&e.hasAttribute("data-inline-anchor")){let i=e.firstChild,c=(e.textContent??"").replace("​","").length;if(i&&t<=c)return[i,t+(i.textContent?.startsWith("​")?1:0)];t-=c}else if(e instanceof HTMLElement&&(e.dataset.inlineSkill!==void 0||e.dataset.inlineCommand!==void 0)){let i=(e.dataset.inlineSkill??e.dataset.inlineCommand).length;if(t<i)return[o,l];t-=i}else if(e instanceof HTMLElement&&e.dataset.inlineApp!==void 0){if(t===0)return[o,l];t--}else if(e instanceof HTMLElement&&e.tagName==="BR")return[o,l];return[o,o.childNodes.length]},s=document.createRange();s.setStart(...r(d.start)),s.setEnd(...r(d.end));let a=window.getSelection();a?.removeAllRanges(),a?.addRange(s)}
5
+ export{hr,ko,vr,So};
@@ -1,2 +1,2 @@
1
- import{Xo}from"./chunk-1d29gnb2.js";import{jsx as o}from"react/jsx-runtime";function Wt(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:Xo}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function Jo(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function U({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:Jo(t)})})}
2
- export{Wt,Jo,U};
1
+ import{oi}from"./chunk-npt6at4f.js";import{jsx as o}from"react/jsx-runtime";function Xt(){return o("svg",{"aria-hidden":"true",focusable:"false",width:0,height:0,className:"pointer-events-none absolute",dangerouslySetInnerHTML:{__html:oi}})}var n=["agent-mode","application-window","audiowave","bar-chart","block-stack-skills","book-open","briefcase","bubble-on-bubble","checkmark-circle","code","compass","components-window","credit-card","csv","document","docx","exclamationmark-bubble","figma-document","figure-text-document","file-video","flash","folder","game-controller","globe","heart","heart-bubble","heart-text-clipboard","hierarchy","jpg-document","kettlebell","ladybug","lightbulb","lightning-bolt","magnifingglass","map","mappin","microphone","ms-word-document","newspaper","paperclip","pdf-document","pencil","phone","photo","png-document","pointer","ppt-document","pptx","puzzle","radar","shield","shopping-bag","skill-creator","skill-installer","star-app","star-bookmark","template-creator","terminal","text-bubble-figure","text-document","text-document-lock","text-note-pointer","triangle-vercel","xls-document-excel","xlsx"];function ni(t){let e=0;for(let r of t)e=(e*31+r.charCodeAt(0))%997;return`#plugin-${n[e%n.length]}`}function U({name:t,className:e="size-6 shrink-0"}){return o("svg",{"aria-hidden":"true",focusable:"false",width:36,height:36,viewBox:"0 0 36 36",className:e,children:o("use",{href:ni(t)})})}
2
+ export{Xt,ni,U};
@@ -1,2 +1,2 @@
1
- import{t}from"./chunk-e4ws15tg.js";import{_n}from"./chunk-9s8ht9xe.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Ei({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:_n(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:_n(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
- export{Ei};
1
+ import{t}from"./chunk-aj0z9a5r.js";import{Nn}from"./chunk-svxnx1c7.js";import{FileIcon as i,XIcon as m}from"lucide-react";import{Badge as r}from"@nyssance/shadcn/vega/components/ui/badge";import{Button as l}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as o,jsxs as c}from"react/jsx-runtime";function Oi({mentions:a,onRemove:n}){let{t:s}=t();if(a.length===0)return null;return o("div",{className:"mb-1.5 flex flex-wrap items-center gap-1.5",children:a.map((e)=>c(r,{variant:"secondary",className:"gap-1 pe-0.5",title:e,children:[o(i,{className:"size-3"}),o("span",{className:"max-w-40 truncate",children:Nn(e)}),o(l,{type:"button",variant:"ghost",size:"icon-xs",className:"size-4","aria-label":s("composer.removeMention",{name:Nn(e)}),onClick:()=>n(e),children:o(m,{className:"size-3"})})]},e))})}
2
+ export{Oi};
@@ -1,2 +1,2 @@
1
- import{cn as l}from"cn";import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as a}from"react/jsx-runtime";function R({value:i,onValueChange:n,options:o,itemClassName:d}){return t(r,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(s,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
2
- export{R};
1
+ import{cn as l}from"cn";import{DropdownMenuRadioGroup as r,DropdownMenuRadioItem as s}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as t,jsxs as a}from"react/jsx-runtime";function L({value:i,onValueChange:n,options:o,itemClassName:d}){return t(r,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(s,{value:e.value,disabled:e.disabled,title:e.title,closeOnClick:!0,className:l("gap-2",e.description?"items-start":"items-center",d),children:[e.icon,e.description?a("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label}),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description})]}):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label})]},e.value))})}
2
+ export{L};
@@ -1,2 +1,2 @@
1
- import{xr}from"./chunk-t1qj0vqe.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function _o(t,r,e={}){let o=r.trim();if(o.length===0)return[];return xr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
- export{_o};
1
+ import{Cr}from"./chunk-mybye5t2.js";import{isText as s,terminalOf as i}from"@nyssance/codex-acp-v2/client";function n(t){if(typeof t==="string")return[t];if(Array.isArray(t))return t.flatMap(n);if(typeof t!=="object"||t===null)return[];return Object.entries(t).flatMap(([r,e])=>r==="data"||r==="blob"?[]:n(e))}function u(t){return s(t)?[t.text]:[]}function p(t,r){switch(t.kind){case"user":case"assistant":case"thought":return t.content.flatMap(u);case"tool":return[t.title??"",...n(t.rawInput),...n(i(t,r)?.output||t.rawOutput),...n(t.content)];case"plan":return n(t.plan);case"compaction":return[t.error??""]}}function No(t,r,e={}){let o=r.trim();if(o.length===0)return[];return Cr(t.map((a)=>({turnKey:a.key,segments:a.items.flatMap((c)=>p(c,e))})),o)}
2
+ export{No};
@@ -1,2 +1,2 @@
1
- import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function dt(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
- export{dt};
1
+ import{QUICK_CHATS_GROUP as r,sessionGroup as l}from"@nyssance/codex-acp-v2/client";function mt(n,t){return n!==null&&t&&l(t,{cwd:n}).id===r?null:n}
2
+ export{mt};
@@ -0,0 +1,2 @@
1
+ import{we}from"./chunk-db8hae9d.js";function w(e){return/^app:\/\/([^/?#\s)]+)$/.exec(e)?.[1]??null}function Kt(e){if(!e.includes("app://"))return[];let n=we(),r=new Map;return n.walkTokens(n.lexer(e),(i)=>{if(i.type!=="link")return;let p=i,t=w(p.href);if(t!==null)r.set(t,{id:t,name:p.text.replace(/^\$/,"")})}),[...r.values()]}function Ea(e){return[...new Map(e.map((n)=>[n.id,n])).values()].map((n)=>`[$${n.name.replace(/[\\`*_[\]<>]/g,"\\$&")}](app://${n.id})`).join(" ")}function ys(e,n){return[Ea(n),e.trim()].filter(Boolean).join(" ")}function xs(e,n){let r=Ea(n);if(!r)return e;if(e===r)return"";return e.startsWith(`${r} `)?e.slice(r.length+1):e}
2
+ export{w,Kt,Ea,ys,xs};
@@ -0,0 +1,2 @@
1
+ function ut(o){return o.kind==="tool"&&o.status==="completed"&&o.toolKind!=="read"&&o.toolKind!=="search"}
2
+ export{ut};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-kyqf7cqh.js";import{tn,nn}from"./chunk-mmrwaa9h.js";import{V}from"./chunk-g7dxg38a.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Zs({providers:n,store:l}){let{t:m}=e().host,d=tn(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=V(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await nn(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
- export{Zs};
1
+ import{e}from"./chunk-qgrd5xre.js";import{nn,on}from"./chunk-zpetyx45.js";import{V}from"./chunk-th5vv83g.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Qs({providers:n,store:l}){let{t:m}=e().host,d=nn(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=V(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await on(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
2
+ export{Qs};
@@ -0,0 +1,2 @@
1
+ function _i(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function lo(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function tt(t){return t.type==="array"}function pn(t){return(tt(t)?t.items?.oneOf??[]:t.oneOf??[]).map((e)=>{let i=e,r=i.const??i.title??"";return{value:r,label:i.title??r,...i.description?{description:i.description}:{},...i._meta?.alwith?.preview?{preview:i._meta.alwith.preview}:{}}})}
2
+ export{_i,lo,tt,pn};
@@ -1,2 +1,2 @@
1
- var z="collection-default";function se(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function Xe(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function sn(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function ea(o,e=Xe()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
- export{z,se,Xe,sn,ea};
1
+ var z="collection-default";function le(o,e){return o.id==="collection-default"?e("collection.defaultFavorites"):o.name}function et(){return{collections:{["collection-default"]:{id:"collection-default",name:"",nameIsCustom:!1,collapsed:!1,sessionIds:[]}},order:["collection-default"],sessionMeta:{}}}function dn(o,e){let i={...o.collections},l=(s,n)=>{if(!i[s])throw Error(`Collection missing: ${s}`);i[s]={...i[s],...n}},r=(s,n)=>l(s,{sessionIds:i[s].sessionIds.filter((d)=>d!==n)}),t=(s,n)=>{let d=i[s];if(!d)throw Error(`Collection missing: ${s}`);for(let c of o.order)if(c!==s&&i[c].sessionIds.includes(n))r(c,n);if(!d.sessionIds.includes(n))l(s,{sessionIds:[...d.sessionIds,n],collapsed:!1})};switch(e.type){case"create":{if(!e.name.trim())throw Error("Collection name is empty");if(i[e.id]={id:e.id,name:e.name.trim(),...e.emoji===void 0?{}:{emoji:e.emoji},collapsed:!1,sessionIds:[]},e.sessionId!==void 0){if(e.sourceCollectionId!==void 0)r(e.sourceCollectionId,e.sessionId);t(e.id,e.sessionId)}return{...o,collections:i,order:[...o.order,e.id]}}case"rename":if(e.id==="collection-default")throw Error("Default collection cannot be renamed");if(!e.name.trim())throw Error("Collection name is empty");l(e.id,{name:e.name.trim(),nameIsCustom:!0,...e.emoji===void 0?{}:{emoji:e.emoji}});break;case"collapse":l(e.id,{collapsed:e.collapsed});break;case"emoji":l(e.id,{emoji:e.emoji});break;case"clear":l(e.id,{sessionIds:[]});break;case"delete":if(e.id==="collection-default")throw Error("Default collection cannot be deleted");return delete i[e.id],{...o,collections:i,order:o.order.filter((s)=>s!==e.id)};case"add":t(e.collectionId,e.sessionId);break;case"materialize":return t(e.collectionId,e.sessionId),{...o,collections:i,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],cwd:e.cwd}}};case"move":{r(e.sourceCollectionId,e.sessionId),t(e.collectionId,e.sessionId);let n=i[e.collectionId].sessionIds.filter((d)=>d!==e.sessionId);n.splice(e.index??n.length,0,e.sessionId),l(e.collectionId,{sessionIds:n,collapsed:!1});break}case"reorder":{if(e.id==="collection-default")throw Error("Default collection cannot be reordered");let s=o.order.filter((n)=>n!==e.id);return s.splice(e.index,0,e.id),{...o,order:s}}case"forget":{for(let n of o.order)r(n,e.sessionId);let s={...o.sessionMeta};return delete s[e.sessionId],{...o,collections:i,sessionMeta:s}}case"remove":for(let s of e.collectionId===void 0?o.order:[e.collectionId])r(s,e.sessionId);break;case"favorite":if(o.order.some((s)=>i[s].sessionIds.includes(e.sessionId)))for(let s of o.order)r(s,e.sessionId);else t("collection-default",e.sessionId);break;case"meta":{let s=o.sessionMeta[e.sessionId],n={...s};if(e.meta.cwd!==void 0)n.cwd=e.meta.cwd;if(e.meta.title!==void 0&&!s?.titleOverride)n.title=e.meta.title;if(s?.cwd===n.cwd&&s?.title===n.title)return o;return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:n}}}case"renameSession":{let s=e.title.trim();return{...o,sessionMeta:{...o.sessionMeta,[e.sessionId]:{...o.sessionMeta[e.sessionId],title:s||void 0,titleOverride:s.length>0}}}}}return{...o,collections:i}}function ra(o,e=et()){let i={collections:{...e.collections},order:[...e.order],sessionMeta:{...e.sessionMeta}};for(let l of o){for(let[r,t]of Object.entries(l.sessionMeta??{})){let s=i.sessionMeta[r];i.sessionMeta[r]=s?.titleOverride?{...t,...s}:{...s,...t}}for(let r of l.order){if(r==="collection-default")continue;let t=l.collections[r];if(!t)throw Error(`Persisted collection missing: ${r}`);let s=i.collections[r];if(i.collections[r]={...t,...e.collections[r],sessionIds:[...new Set([...s?.sessionIds??[],...t.sessionIds??[]])]},!i.order.includes(r))i.order.push(r)}}return i}
2
+ export{z,le,et,dn,ra};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-kyqf7cqh.js";import{De}from"./chunk-k5kzw2px.js";import{nt}from"./chunk-ckbqdg1s.js";import{en}from"./chunk-r8gnmyb1.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function Xt({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function ui({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(Xt,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(Xt,{label:nt(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(Xt,{label:nt(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function Yt({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(ui,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(en,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(De,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
2
- export{Xt,ui,Yt};
1
+ import{e}from"./chunk-qgrd5xre.js";import{He}from"./chunk-nebke41s.js";import{it}from"./chunk-vyvsm4v9.js";import{an}from"./chunk-qkddvxjr.js";import{format as f}from"date-fns";import{useState as y}from"react";import{Button as x}from"@nyssance/shadcn/vega/components/ui/button";import{Skeleton as m}from"@nyssance/shadcn/vega/components/ui/skeleton";import{jsx as t,jsxs as u,Fragment as h}from"react/jsx-runtime";function rn({label:o,window:a,t:l}){let n=a?100-Math.round(Math.min(100,Math.max(0,a.usedPercent))):0,i=a&&a.resetsAt!==null?l("usage.resetsAt",{time:f(new Date(a.resetsAt*1000),"yyyy/MM/dd HH:mm")}):null;return u("div",{className:"space-y-1.5","aria-busy":!a,children:[u("div",{className:"grid min-h-5 grid-cols-[3.5rem_minmax(0,1fr)_5rem] items-center gap-3",children:[a?t("span",{className:"text-sm",children:o}):t(m,{className:"h-4 w-10 motion-reduce:animate-none"}),a?t("div",{className:"bg-muted h-2 overflow-hidden rounded-full",role:"progressbar","aria-label":o,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,children:t("div",{className:"bg-primary h-full rounded-full",style:{width:`${n}%`}})}):t(m,{className:"h-2 rounded-full motion-reduce:animate-none"}),a?t("span",{className:"text-muted-foreground text-end text-xs tabular-nums",children:l("usage.remaining",{percent:n})}):t(m,{className:"h-4 w-14 justify-self-end motion-reduce:animate-none"})]}),t("div",{className:"text-muted-foreground flex min-h-4 items-center justify-end text-xs",children:a?i:t(m,{className:"h-3 w-32 motion-reduce:animate-none"})})]})}function hi({account:o,disabled:a,onSignOut:l}){let{t:n}=e().host,i=o===void 0,r=o?.account.account??null,c=o===null?n("usage.accountUnavailable"):r===null?n("usage.notSignedIn"):r.type==="chatgpt"?[r.email,r.planType!=="unknown"?n(`usage.plan.${r.planType}`):null].filter(Boolean).join(" · "):r.type==="apiKey"?n("usage.apiKey"):n("usage.bedrock"),s=o?.rateLimits??null;return u("section",{"aria-busy":i,"aria-label":"Codex",className:"space-y-4",children:[u("div",{className:"flex min-h-8 items-center justify-between gap-4",children:[i?t(m,{className:"h-4 w-40 max-w-[65%] motion-reduce:animate-none"}):t("span",{className:"min-w-0 text-sm break-words",children:c}),i?t(m,{className:"h-8 w-16 shrink-0 motion-reduce:animate-none"}):r!==null&&t(x,{variant:"outline",size:"sm",className:"shrink-0",disabled:a,onClick:l,children:n("connection.signOut")})]}),(i||r!==null)&&t("div",{className:"flex flex-col gap-4",children:i?t(rn,{t:n}):s===null?t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")}):u(h,{children:[s.primary!==null&&t(rn,{label:it(s.primary,n),window:s.primary,t:n}),s.secondary!==null&&t(rn,{label:it(s.secondary,n),window:s.secondary,t:n}),s.primary===null&&s.secondary===null&&t("span",{className:"text-muted-foreground text-sm",children:n("usage.unavailable")})]})})]})}function sn({bridge:o,className:a="rounded-xl border p-4"}){let{host:l}=e(),n=o.useSettingsAgent(),i=o.useSettingsAccount(),[r,c]=y(!1);return u("div",{className:a,children:[t(hi,{account:i,disabled:n==null||r,onSignOut:()=>{c(!0),o.requestSignOut().catch((s)=>l.reportError?.(s)).finally(()=>c(!1))}}),i!=null&&!i.account.account&&n&&t(an,{methods:n.authMethods,signIn:o.requestSignIn}),n?.actions.map((s)=>t(He,{action:s,onRespond:(d,p)=>{o.requestActionResponse(d,p).catch((g)=>l.reportError?.(g))}},s.id))]})}
2
+ export{rn,hi,sn};
@@ -0,0 +1,2 @@
1
+ import{p}from"./chunk-vgxvtmja.js";import{s}from"./chunk-pxbww0j1.js";import{v,f}from"./chunk-95f0wens.js";import{ht}from"./chunk-s11mgwyh.js";import{cn as r}from"cn";import{ArrowLeftIcon as a,ArrowRightIcon as l,SlidersHorizontalIcon as c}from"lucide-react";import{DropdownMenu as m,DropdownMenuContent as u,DropdownMenuItem as d,DropdownMenuTrigger as g}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{jsx as o,jsxs as w}from"react/jsx-runtime";function Bs({onCollapseAll:i}){let{t:n}=s();return w(m,{children:[o(g,{render:o(ht,{"aria-label":n("sessionList.filter"),title:n("sessionList.filter")}),children:o(c,{})}),o(u,{align:"end",className:"w-52",children:o(d,{onClick:i,children:n("sessionList.collapseAllGroups")})})]})}function Gs({screen:i,onSwitch:n}){let{t:e}=s(),t=e(i==="main"?"sessionList.openLeading":"sessionList.backToMain");return o(f,{className:r(p,i==="main"?"justify-start":"justify-end"),"aria-label":t,title:t,onClick:n,children:o(v,{children:i==="main"?o(a,{}):o(l,{})})})}
2
+ export{Bs,Gs};
@@ -0,0 +1,2 @@
1
+ var pa={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function Ni(e){return[...e].toSorted((o,n)=>(pa[o.kind]??99)-(pa[n.kind]??99))}function Qa(e){return e==="allow_once"||e==="allow_always"}function Ja(e){return e==="allow_always"||e==="reject_always"}
2
+ export{pa,Ni,Qa,Ja};
@@ -1,2 +1,2 @@
1
- import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function yn(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
- export{yn};
1
+ import{codexTurnId as m,promptSuggestion as s}from"@nyssance/codex-acp-v2/client";import{useMemo as p,useState as c}from"react";function wn(t,i,a,l){let e=p(()=>t.items.findLast((u)=>u.kind==="user"),[t.items]),n=JSON.stringify([t.id,m(e?._meta)]),[r,d]=c(null),o=l&&i&&t.state==="idle"&&t.lastStopReason==="end_turn"&&!e?.replayed;return{text:o&&!a&&r!==n?s(t._meta):null,invalidate:()=>{if(o)d(n)}}}
2
+ export{wn};
@@ -1,2 +1,2 @@
1
- import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function Or(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
- export{Or};
1
+ import{useCallback as f,useEffect as U,useRef as s,useState as X}from"react";var S=24,q=160,z=45,j=()=>{};function os(e,Y,u=j){let r=s("following"),[A,b]=X(!0),D=s(Y);D.current=Y;let a=s(null),y=s(0),P=s(0),k=s(0),p=s(0),m=s(0),h=s(0),_=s(!1),g=s(null),o=f(()=>{if(a.current!==null)cancelAnimationFrame(a.current);a.current=null},[]),v=f(()=>{u(),o(),h.current++,g.current=null,m.current=0,r.current="reading",b(!1)},[o,u]),T=f(()=>{if(e===null||r.current!=="following"||a.current!==null)return;if(e.scrollTop>=Math.max(0,e.scrollHeight-e.clientHeight))return;y.current=performance.now(),P.current=e.scrollTop,k.current=0;let l=(c)=>{if(a.current=null,r.current!=="following")return;let i=Math.max(0,e.scrollHeight-e.clientHeight),w=i-e.scrollTop;if(w<=0)return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches||w<=1)e.scrollTop=i;else{let E=Math.max(0,c-y.current),H=e.scrollTop===P.current?k.current:0,L=e.scrollTop+H+(w-H)*(1-Math.exp(-E/z));e.scrollTop=L,P.current=e.scrollTop,k.current=L-e.scrollTop,a.current=requestAnimationFrame(l)}y.current=c,p.current=e.scrollTop};a.current=requestAnimationFrame(l)},[e]),d=f(()=>{u(),h.current++,g.current=null,m.current=0,r.current="following",b(!0),T()},[u,T]),B=f((l)=>{u(),o();let c=++h.current;return r.current="locating",_.current=l,g.current=null,m.current=0,b(l),{isCurrent:()=>h.current===c,finish:(i)=>{if(h.current!==c||e===null)return;e.scrollTo({top:i,behavior:"instant"}),p.current=e.scrollTop,r.current=l?"following":"reading"}}},[o,u,e]),x=f(()=>{if(h.current++,r.current==="locating")r.current=_.current?"following":"reading"},[]),G=f((l=null)=>{if(e===null)return;let c=g.current;if(c!==null&&e.scrollHeight!==c){if(g.current=null,e.scrollHeight<c&&e.scrollHeight-e.clientHeight-e.scrollTop<=S)d()}if(r.current==="following"&&l!==null)o(),e.scrollTo({top:l,behavior:"instant"}),p.current=e.scrollTop;else T()},[o,e,T,d]);return U(()=>{if(e===null)return;p.current=e.scrollTop,r.current=e.scrollHeight-e.clientHeight-e.scrollTop<=S?"following":"reading",b(r.current==="following");let l=!1,c=!1,i=null,w=e.closest('[data-slot="scroll-area"]'),F=w??e,E=(n)=>{if(g.current=null,(n<0||r.current==="locating")&&e.scrollHeight>e.clientHeight)v();else u();if(m.current=n,r.current==="reading"&&n>0&&e.scrollHeight-e.clientHeight-e.scrollTop<=1)d()},H=()=>{let n=e.scrollTop>p.current;p.current=e.scrollTop;let t=n&&m.current>0;if(m.current=0,l){c=n;return}if(r.current!=="reading"||!t)return;let M=D.current?q:S;if(e.scrollHeight-e.clientHeight-e.scrollTop<=M)d()},L=(n)=>{if(n.ctrlKey||n.deltaY===0)return;let t=n.target instanceof Element?n.target:null;while(t!==null&&t!==e){if(t.scrollHeight>t.clientHeight&&/auto|scroll/.test(getComputedStyle(t).overflowY)){if(n.deltaY<0?t.scrollTop>0:t.scrollTop+t.clientHeight<t.scrollHeight)return}t=t.parentElement}E(Math.sign(n.deltaY))},C=(n)=>{i=n.touches[0].clientY},O=(n)=>{let t=n.touches[0].clientY;if(i!==null&&t!==i)E(Math.sign(i-t));i=t},I=(n)=>{if(n.defaultPrevented||!(n.target instanceof Element))return;if(n.target.closest("input, textarea, select, button, a, [contenteditable='true']"))return;if(["ArrowUp","PageUp","Home"].includes(n.key)||n.key===" "&&n.shiftKey)E(-1);else if(["ArrowDown","PageDown","End"," "].includes(n.key))E(1)},N=(n)=>{let t=n.target instanceof Element?n.target.closest('[data-slot="scroll-area-scrollbar"][data-orientation="vertical"]'):null,M=t!==null&&t.closest('[data-slot="scroll-area"]')===w;if(l=(n.target===e||M)&&n.button===0&&e.scrollHeight>e.clientHeight,c=!1,l)v()},R=()=>{let n=D.current?q:S;if(l&&c&&e.scrollHeight-e.clientHeight-e.scrollTop<=n)d();l=!1},K=()=>{l=!1},W=(n)=>{if(!(n.target instanceof Element)||n.target.closest("[data-codex-disclosure]")===null)return;v(),g.current=e.scrollHeight};return e.addEventListener("scroll",H,{passive:!0}),e.addEventListener("wheel",L,{passive:!0}),e.addEventListener("touchstart",C,{passive:!0}),e.addEventListener("touchmove",O,{passive:!0}),e.addEventListener("keydown",I),F.addEventListener("pointerdown",N,{capture:!0}),window.addEventListener("pointerup",R),window.addEventListener("pointercancel",K),e.addEventListener("click",W,{capture:!0}),()=>{o(),x(),e.removeEventListener("scroll",H),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",C),e.removeEventListener("touchmove",O),e.removeEventListener("keydown",I),F.removeEventListener("pointerdown",N,{capture:!0}),window.removeEventListener("pointerup",R),window.removeEventListener("pointercancel",K),e.removeEventListener("click",W,{capture:!0})}},[e,o,x,u,d,v]),{isFollowing:A,scrollToBottom:d,stopFollowing:v,schedulePin:T,contentResized:G,beginLocate:B,cancelLocation:x}}
2
+ export{os};
@@ -1,2 +1,2 @@
1
- function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function vn(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
- export{vn};
1
+ function a(t){if(t.path.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t.path))return t.path;return`${t.root.replace(/[\\/]+$/,"")}/${t.path}`}function Cn(t,o=50){return t.slice(0,o).map((e)=>{let r=a(e);return{key:r,label:e.path,payload:r,description:e.match_type==="directory"?"/":""}})}
2
+ export{Cn};
@@ -1,2 +1,2 @@
1
- import{So}from"./chunk-kbzsn9xw.js";import{R}from"./chunk-9n8cds8p.js";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as H,Loader2Icon as W,Zap as Z}from"lucide-react";import{Fragment as ce,useState as q}from"react";import{Button as A}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as J,DropdownMenuCheckboxItem as K,DropdownMenuContent as Q,DropdownMenuGroup as D,DropdownMenuItem as y,DropdownMenuLabel as L,DropdownMenuSeparator as u,DropdownMenuSub as S,DropdownMenuSubContent as T,DropdownMenuSubTrigger as C,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as he}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as Y,TooltipContent as E,TooltipTrigger as ee}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function Pt({value:c,onChange:ne,models:x,modelGroups:O,compactCatalog:o,catalogHeight:ae="fixed",effortPresentation:j="slider",unavailableEffort:v,providerMenu:h,header:w,className:B,condensed:V,stripLabelPrefix:z,showDescription:se,showModelList:ie=!0,loading:oe,switching:G,isLoading:te,effortConfig:s,booleanOptions:k,onBooleanChange:_,selectOptions:le=[],t:m,...d}){let[de,re]=q(!1),[me,ue]=q(!1),l=k?.find((n)=>n.id==="fast_mode"),I=o?k?.filter((n)=>n!==l):k,P=(n)=>z&&n.startsWith(z)?n.slice(z.length):n;if(oe)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(A,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(W,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(J,{open:de,onOpenChange:re,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(E,{children:m("model.switchProvider")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,t)=>a(ce,{children:[t>0&&n.length>0&&e(u,{}),e(R,{value:h.value,onValueChange:h.onChange,options:n})]},t)),h.moreAction&&a(p,{children:[e(u,{}),a(y,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(J,{open:me,onOpenChange:ue,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(A,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",V&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,k?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(Z,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",V&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,t)=>t.name.length>n.length?t.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(W,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:r("size-3 shrink-0",V&&"size-2.5")})]})})}),e(E,{children:m("model.switchModel")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",o&&"flex w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5",o&&(ae==="content"?"max-h-[min(350px,var(--available-height))]":"h-[350px]")),children:[o&&a(p,{children:[a(D,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(So,{...s,disabled:d.disabled})}):a(S,{children:[a(C,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(R,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(y,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(L,{className:"min-w-0 flex-1 truncate",children:w?.name}),l&&e(K,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>_?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(Z,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),w&&!o&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(u,{})]}),a(D,{"data-model-menu-list":o?"":void 0,className:o?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(te?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):x.length===0?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=x.filter((i)=>!i.more),t=x.filter((i)=>i.more),F=n.length>0&&t.length>0,N=(i,g)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:g?.noDescription?void 0:se?i.description:void 0}),M=(i)=>{let g=x.find((f)=>f.api_id===i);if(g)ne(g)};if(o)return e(R,{value:c.api_id,onValueChange:M,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((i)=>N(i))});return a(p,{children:[O?O.map((i)=>{let g=i.models.filter((b)=>!b.more),f=i.models.filter((b)=>b.more),U=g.length>0&&f.length>0;return a(D,{children:[e(L,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(R,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(U?g:i.models).map((b)=>N(b))}),U&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(R,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:f.map((b)=>N(b,{noDescription:!0}))})})]})]},i.id)}):e(R,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(F?n:x).map((i)=>N(i))}),!O&&F&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(R,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:t.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),!o&&s&&a(p,{children:[e(u,{}),j==="menu"?a(S,{children:[a(C,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(R,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(So,{...s,disabled:d.disabled})]}),!o&&!s&&v&&a(p,{children:[e(u,{}),a(y,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),le.map((n)=>a(D,{children:[e(u,{}),e(L,{children:n.name}),e(R,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),I&&I.length>0&&a(p,{children:[!s&&e(u,{}),I.map((n)=>o?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(t)=>_?.(n.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(he,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(t)=>_?.(n.id,t)})]},n.id))]})]}),o&&w?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(D,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
2
- export{Pt};
1
+ import{bo}from"./chunk-6xap6hvz.js";import{L}from"./chunk-3tvq6xr2.js";import{cn as r}from"cn";import{ArrowUpRight as pe,ChevronUp as H,Loader2Icon as W,Zap as Z}from"lucide-react";import{Fragment as ce,useState as q}from"react";import{Button as I}from"@nyssance/shadcn/vega/components/ui/button";import{DropdownMenu as J,DropdownMenuCheckboxItem as K,DropdownMenuContent as Q,DropdownMenuGroup as D,DropdownMenuItem as y,DropdownMenuLabel as A,DropdownMenuSeparator as u,DropdownMenuSub as S,DropdownMenuSubContent as T,DropdownMenuSubTrigger as C,DropdownMenuTrigger as X}from"@nyssance/shadcn/vega/components/ui/dropdown-menu";import{Switch as he}from"@nyssance/shadcn/vega/components/ui/switch";import{Tooltip as Y,TooltipContent as E,TooltipTrigger as ee}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as e,jsxs as a,Fragment as p}from"react/jsx-runtime";function At({value:c,onChange:ne,models:x,modelGroups:O,compactCatalog:o,catalogHeight:ae="fixed",effortPresentation:j="slider",unavailableEffort:v,providerMenu:h,header:w,className:B,condensed:V,stripLabelPrefix:z,showDescription:se,showModelList:ie=!0,loading:oe,switching:G,isLoading:te,effortConfig:s,booleanOptions:k,onBooleanChange:_,selectOptions:le=[],t:m,...d}){let[de,re]=q(!1),[me,ue]=q(!1),l=k?.find((n)=>n.id==="fast_mode"),R=o?k?.filter((n)=>n!==l):k,P=(n)=>z&&n.startsWith(z)?n.slice(z.length):n;if(oe)return e("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:a(I,{variant:"ghost",disabled:!0,className:r("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",B),children:[e(W,{className:"size-3 animate-spin"}),e("span",{className:"text-muted-foreground truncate",children:m("model.loadingModels")})]})});return a("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[h&&a(J,{open:de,onOpenChange:re,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(I,{"data-testid":"provider-trigger",variant:"ghost",disabled:d.disabled,className:r("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[h.icon,e(H,{className:"size-2.5 shrink-0 opacity-60"})]})})}),e(E,{children:m("model.switchProvider")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[h.groups.map((n,t)=>a(ce,{children:[t>0&&n.length>0&&e(u,{}),e(L,{value:h.value,onValueChange:h.onChange,options:n})]},t)),h.moreAction&&a(p,{children:[e(u,{}),a(y,{onClick:h.moreAction,className:"whitespace-nowrap",children:[e("span",{className:"min-w-0 flex-1 truncate",children:m("model.moreModels")}),e(pe,{className:"size-4"})]})]})]})]}),a(J,{open:me,onOpenChange:ue,children:[a(Y,{children:[e(ee,{render:e(X,{render:a(I,{"data-testid":"model-trigger","aria-busy":G,variant:"ghost",className:r("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",V&&"h-7 gap-1 px-1.5 text-[11px]",B),...d,children:[c.icon,k?.some((n)=>n.id==="fast_mode"&&n.currentValue&&!n.disabled)&&e(Z,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),e("span",{className:r("min-w-0 flex-1 truncate text-start",V&&"text-[11px]"),children:P(c.label)||m("model.selectModel")}),s&&a("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[e("span",{className:"invisible col-start-1 row-start-1",children:s.sizer??s.levels.reduce((n,t)=>t.name.length>n.length?t.name:n,"")}),e("span",{className:"col-start-1 row-start-1",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),G?e(W,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):e(H,{className:r("size-3 shrink-0",V&&"size-2.5")})]})})}),e(E,{children:m("model.switchModel")})]}),a(Q,{side:"top",align:"end",sideOffset:4,className:r("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",o&&"flex w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5",o&&(ae==="content"?"max-h-[min(350px,var(--available-height))]":"h-[350px]")),children:[o&&a(p,{children:[a(D,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[s?j==="slider"?e("div",{role:"menuitem","aria-label":s.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:e(bo,{...s,disabled:d.disabled})}):a(S,{children:[a(C,{disabled:d.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[e("span",{children:s.name}),e("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(L,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):v?a(y,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[e("span",{children:v.name}),e("span",{className:"text-muted-foreground truncate text-xs",children:v.label})]}):e(A,{className:"min-w-0 flex-1 truncate",children:w?.name}),l&&e(K,{"aria-label":l.name,title:l.title??l.name,disabled:d.disabled||l.disabled,checked:l.currentValue,closeOnClick:!1,onCheckedChange:(n)=>_?.(l.id,n),className:r("hover:bg-accent focus:hover:bg-accent focus-visible:bg-accent ms-auto -me-2 size-8 shrink-0 justify-center rounded-md p-0 focus:bg-transparent [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",l.currentValue&&!l.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:l.icon??e(Z,{className:"size-4","aria-hidden":"true"})})]}),e(u,{className:"shrink-0"})]}),w&&!o&&a(p,{children:[a("div",{className:"flex items-center gap-2 px-2 py-2",children:[w.icon,e("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:w.name}),w.action]}),e(u,{})]}),a(D,{"data-model-menu-list":o?"":void 0,className:o?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[ie&&(te?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.loadingModels")}):x.length===0?e(y,{disabled:!0,className:"text-muted-foreground",children:m("model.noModelsAvailable")}):(()=>{let n=x.filter((i)=>!i.more),t=x.filter((i)=>i.more),F=n.length>0&&t.length>0,N=(i,g)=>({disabled:d.disabled,icon:i.icon,value:i.api_id,label:P(i.label),description:g?.noDescription?void 0:se?i.description:void 0}),M=(i)=>{let g=x.find((f)=>f.api_id===i);if(g)ne(g)};if(o)return e(L,{value:c.api_id,onValueChange:M,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:x.map((i)=>N(i))});return a(p,{children:[O?O.map((i)=>{let g=i.models.filter((b)=>!b.more),f=i.models.filter((b)=>b.more),U=g.length>0&&f.length>0;return a(D,{children:[e(A,{className:"text-muted-foreground text-xs font-normal",children:i.name}),e(L,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(U?g:i.models).map((b)=>N(b))}),U&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(L,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:f.map((b)=>N(b,{noDescription:!0}))})})]})]},i.id)}):e(L,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:(F?n:x).map((i)=>N(i))}),!O&&F&&a(S,{children:[e(C,{className:"font-medium whitespace-nowrap",children:m("model.moreModels")}),e(T,{children:e(L,{value:c.api_id,onValueChange:M,itemClassName:"font-medium whitespace-nowrap",options:t.map((i)=>N(i,{noDescription:!0}))})})]})]})})()),!o&&s&&a(p,{children:[e(u,{}),j==="menu"?a(S,{children:[a(C,{disabled:d.disabled,children:[e("span",{className:"flex-1",children:s.name}),e("span",{className:"text-muted-foreground",children:s.levels.find((n)=>n.value===s.value)?.name??s.value})]}),e(T,{children:e(L,{value:s.value,onValueChange:s.onChange,options:s.levels.map((n)=>({value:n.value,label:n.name}))})})]}):e(bo,{...s,disabled:d.disabled})]}),!o&&!s&&v&&a(p,{children:[e(u,{}),a(y,{disabled:!0,children:[e("span",{className:"flex-1",children:v.name}),e("span",{children:v.label})]})]}),le.map((n)=>a(D,{children:[e(u,{}),e(A,{children:n.name}),e(L,{value:n.value,onValueChange:n.onChange,options:n.options,itemClassName:"whitespace-nowrap"})]},n.id)),R&&R.length>0&&a(p,{children:[!s&&e(u,{}),R.map((n)=>o?a(K,{"aria-label":n.name,title:n.title,disabled:d.disabled||n.disabled,checked:n.currentValue,closeOnClick:!1,onCheckedChange:(t)=>_?.(n.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[a("span",{className:"flex items-center gap-2",children:[n.icon,n.name]}),e("span",{"aria-hidden":"true",className:r("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",n.currentValue?"bg-primary":"bg-input"),children:e("span",{className:r("bg-background size-3.5 rounded-full shadow-xs transition-transform",n.currentValue&&"translate-x-3.5")})})]},n.id):a("div",{title:n.title,className:r("flex items-center justify-between gap-3 px-2 py-2.5",n.disabled&&"opacity-50"),children:[a("span",{className:"flex items-center gap-2 text-sm font-medium",children:[n.icon,n.name]}),e(he,{"aria-label":n.name,disabled:d.disabled||n.disabled,checked:n.currentValue,onCheckedChange:(t)=>_?.(n.id,t)})]},n.id))]})]}),o&&w?.action&&a(p,{children:[e(u,{className:"shrink-0"}),e(D,{"data-model-menu-footer":!0,className:"shrink-0",children:w.action})]})]})]})]})}
2
+ export{At};
@@ -1,2 +1,2 @@
1
- async function lr(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
- export{lr};
1
+ async function pr(g,u){try{let a=await(await fetch(g)).blob(),s=u??a.type??"";if(!s.startsWith("image/"))return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(a)});let w=s.includes("svg"),n,r,o;if(w){let e=new Image,t=URL.createObjectURL(a);e.src=t;try{await new Promise((h,f)=>{e.onload=()=>h(),e.onerror=()=>f(Error("svg load failed"))})}finally{URL.revokeObjectURL(t)}r=e.naturalWidth||1024,o=e.naturalHeight||1024,n=e}else{let e=await createImageBitmap(a);r=e.width,o=e.height,n=e}let i=Math.min(1,2000/Math.max(r,o)),c=Math.round(r*i),l=Math.round(o*i),d=new OffscreenCanvas(c,l),m=d.getContext("2d");if(!m)throw Error("image-encode: OffscreenCanvas 2d context 不可用");if(m.drawImage(n,0,0,c,l),n instanceof ImageBitmap)n.close();let b=await d.convertToBlob({type:"image/webp",quality:0.85});return new Promise((e)=>{let t=new FileReader;t.onloadend=()=>e(t.result),t.onerror=()=>e(null),t.readAsDataURL(b)})}catch{return null}}
2
+ export{pr};
@@ -1,2 +1,2 @@
1
- import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function So({name:p,value:M,levels:h,disabled:c,onChange:P,trackWidth:f=100}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
- export{So};
1
+ import{cn as S}from"cn";import{useRef as y,useState as k}from"react";import{jsx as m,jsxs as u}from"react/jsx-runtime";function bo({name:p,value:M,levels:h,disabled:c,onChange:P,trackWidth:f=100}){if(h.length===0)throw Error("EffortSlider requires at least one level");let o=h,g=Math.max(0,o.findIndex((t)=>t.value===M)),[v,d]=k(null),l=y(null),[I,x]=k(null),b=y(0),s=v??I??g,w=(t)=>{let n=++b.current;x(t);let e=()=>{if(b.current===n)x(null)};try{Promise.resolve(P(o[t].value)).then(e,e)}catch(N){throw e(),N}},r=14,a=2,i=o.length,C=a+s/Math.max(1,i-1)*(f-r-a*2);return u("div",{className:S("flex items-center justify-between px-2 py-2.5",c&&"opacity-50"),children:[u("span",{className:"grid shrink-0 text-sm whitespace-nowrap",children:[o.map((t)=>u("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:[p," ",u("span",{style:{fontSize:12},children:["(",t.name,")"]})]},t.value)),u("span",{className:"col-start-1 row-start-1",children:[p," ",u("span",{"data-effort-value":"",style:{fontSize:12},children:["(",o[s].name,")"]})]})]}),u("button",{type:"button",disabled:c,role:"slider","aria-label":p,"aria-valuemin":0,"aria-valuemax":i-1,"aria-valuenow":s,"aria-valuetext":o[s].name,onKeyDown:(t)=>{let n;if(t.key==="ArrowRight"||t.key==="ArrowUp")n=Math.min(i-1,s+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")n=Math.max(0,s-1);else if(t.key==="Home")n=0;else if(t.key==="End")n=i-1;else return;if(t.preventDefault(),t.stopPropagation(),!c&&n!==s)w(n)},className:"relative shrink-0 cursor-pointer touch-none overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:f,height:18,background:"var(--input)"},onPointerDown:(t)=>{if(c||t.button!==0)return;t.preventDefault(),t.stopPropagation(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId);let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerMove:(t)=>{if(l.current===null)return;let n=t.currentTarget.getBoundingClientRect(),e=Math.round(Math.max(0,Math.min(1,(t.clientX-n.left-a-r/2)/Math.max(1,n.width-r-a*2)))*(i-1));l.current=e,d(e)},onPointerUp:(t)=>{let n=l.current;if(l.current=null,d(null),t.currentTarget.hasPointerCapture(t.pointerId))t.currentTarget.releasePointerCapture(t.pointerId);if(!c&&n!==null&&n!==g)w(n)},onLostPointerCapture:()=>{l.current=null,d(null)},onPointerCancel:()=>{l.current=null,d(null)},onClick:(t)=>{t.preventDefault(),t.stopPropagation()},children:[m("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}}),o.map((t,n)=>{let e=a+r/2+n/Math.max(1,i-1)*(f-r-a*2)-2;return m("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:e,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value)}),m("span",{className:"absolute rounded-full transition-all duration-150",style:{width:r,height:r,top:a,left:C,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}})]})]})}
2
+ export{bo};
@@ -1,2 +1,2 @@
1
- import{Qt}from"./chunk-k2xs8svj.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function Ts({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(Qt,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
- export{Ts};
1
+ import{en}from"./chunk-8eyw37rv.js";import{Button as n}from"@nyssance/shadcn/vega/components/ui/button";import{jsx as a,jsxs as o,Fragment as l}from"react/jsx-runtime";function Rs({title:i,actions:r=[],children:t}){return o(l,{children:[o("div",{className:"flex h-[var(--navigation-row-height,30px)] items-center gap-0.5","data-tauri-drag-region":!0,children:[a("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold","data-tauri-drag-region":!0,children:i}),r.map((e)=>a(en,{label:e.label,shortcut:e.shortcut,children:a(n,{variant:"ghost",size:"icon-sm",className:"size-[var(--navigation-row-height,30px)] p-0","aria-label":e.label,onClick:e.onClick,children:e.icon})},e.key))]}),t!=null&&a("div",{className:"flex flex-col gap-0.5",children:t})]})}
2
+ export{Rs};
@@ -1,2 +1,2 @@
1
- import{yr}from"./chunk-wpacvdsv.js";import{vr,Rt}from"./chunk-at25g15n.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as it}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function ol(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function ka(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;ka(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function hr({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await vr(d,t),t.aborted)return;if(!l)ka(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=Rt(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=Rt(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(it,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(yr,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
- export{ol,ka,hr};
1
+ import{br}from"./chunk-bysgsnph.js";import{xr,Ht}from"./chunk-dzncwejn.js";import{Button as et}from"@nyssance/shadcn/vega/components/ui/button";import{cn as rt}from"cn";import{LoaderCircleIcon as nt,SearchIcon as ot}from"lucide-react";import{useCallback as _,useEffect as f,useMemo as J,useRef as b,useState as v}from"react";import{jsx as H,jsxs as q,Fragment as it}from"react/jsx-runtime";var V="chat-search",W="chat-search-current",X=150;function el(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var lt=12;function Pa(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let g=o.getBoundingClientRect(),y=l.getBoundingClientRect(),m=r==="start"?lt:(l.clientHeight-g.height)/2;l.scrollTo({top:l.scrollTop+(g.top-y.top)-m,behavior:"smooth"})}function P(o){let r=o.startContainer.parentElement;if(!r)return;Pa(r)}var M=new Map;function Y(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(M.size===0){CSS.highlights.delete(V),CSS.highlights.delete(W);return}let o=[...M.values()];CSS.highlights.set(V,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(W,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function ct(){let o=Symbol();return{clearHighlights:()=>{M.delete(o),Y()},applyHighlights:(r,l)=>{M.set(o,{all:r,current:l}),Y()}}}function ir({getViewport:o,findSourceMatches:r,revealTurn:l,prepareSource:g,subscribeOpen:y,labels:m,placement:K="header"}){let{clearHighlights:s,applyHighlights:p}=J(ct,[]),S=r!==void 0,[c,R]=v(!1),[i,O]=v(""),[z,T]=v(!1),[D,L]=v(null),G=i.trim().length>0;f(()=>{if(!c||!G||g===void 0){T(!1),L(null);return}let e=new AbortController;return T(!0),L(null),g(e.signal).catch((t)=>{if(!e.signal.aborted)L(t instanceof Error?t.message:String(t))}).finally(()=>{if(!e.signal.aborted)T(!1)}),()=>e.abort()},[G,c,g]);let u=J(()=>c&&i.trim()&&r?r(i.trim()):[],[r,c,i]),[F,I]=v(0),[Z,E]=v(0),C=b([]),x=b(0),a=b(null),Q=b(null),U=b(null);f(()=>{if(!y)return;return y(()=>{R(!0);let t=U.current;if(t!==null)t.focus({preventScroll:!0}),t.select()})},[y]);let A=_(async(e,t)=>{let n=u[e];if(n===void 0)return;let h=o();if(h===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let d=h.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(d===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(await xr(d,t),t.aborted)return;if(!l)Pa(d,"start");if(await new Promise((tt)=>requestAnimationFrame(()=>tt())),t.aborted)return;let N=Ht(d,i.trim());C.current=N;let B=N[n.occurrenceInTurn];if(p(N,B??null),B!==void 0)P(B)},[p,u,o,i,l]),k=b(A);f(()=>{k.current=A},[A]);let w=_(()=>{R(!1),O(""),x.current=0,a.current?.abort(),a.current=null,s(),C.current=[]},[s]);f(()=>{if(!c)return;let e=(t)=>{if(t.key==="Escape"&&Q.current?.contains(document.activeElement))t.preventDefault(),w()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c,w]),f(()=>{if(!c||!i.trim()){s(),C.current=[],I(0),E(0),x.current=0;return}let e=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=Ht(t,i);if(C.current=n,I(n.length),E(0),p(n,n[0]??null),n[0])P(n[0])},X);return()=>{clearTimeout(e),s()}},[p,s,S,c,i,o]),f(()=>{if(!c||!S||!i.trim())return;let e=new AbortController;a.current?.abort(),a.current=e;let t=setTimeout(()=>{C.current=[],x.current=0,I(u.length),E(0),s(),k.current(0,e.signal)},X);return()=>{if(e.abort(),a.current===e)a.current=null;clearTimeout(t),s()}},[s,u.length,S,c,i]),f(()=>()=>{a.current?.abort(),s()},[s]),f(()=>{if(!c)s()},[s,c]);let j=_((e)=>{if(S){if(u.length===0)return;let n=(x.current+(e?-1:1)+u.length)%u.length;x.current=n,E(n),a.current?.abort();let h=new AbortController;a.current=h,k.current(n,h.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let h=(n+(e?-1:1)+t.length)%t.length,d=t[h];return p(t,d),P(d),h})},[p,u.length,S]);return q(it,{children:[K==="header"&&H(et,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>c?w():R(!0),children:H(ot,{})}),c&&q("div",{"data-chat-search":!0,"aria-busy":z||void 0,ref:Q,className:rt("bg-background border-b",K==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[H(br,{ref:U,value:i,onChange:O,onFind:j,onClose:w,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),i.trim()&&q("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:[z?H(nt,{"aria-hidden":"true",className:"size-3 animate-spin"}):F===0?"0 / 0":`${Z+1} / ${F}`,D!==null&&H("span",{role:"alert",children:D})]})]})]})}
2
+ export{el,Pa,ir};
@@ -1,2 +1,2 @@
1
- function bs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Cs(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
- export{bs,Cs};
1
+ function _s(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReply"in o))return null;let n=o.questionReply;if(!n||typeof n!=="object"||!("question"in n)||!("answer"in n))return null;return typeof n.question==="string"&&typeof n.answer==="string"?{question:n.question,answer:n.answer}:null}function Is(t){if(!t||typeof t!=="object"||!("codex"in t))return null;let o=t.codex;if(!o||typeof o!=="object"||!("questionReplyParts"in o))return null;let n=o.questionReplyParts;if(!Array.isArray(n)||n.length===0)return null;let i=n;if(!i.every((e)=>!!e&&typeof e==="object"&&("text"in e)&&typeof e.text==="string"&&(!("question"in e)||e.question===void 0||typeof e.question==="string")))return null;return i.map((e)=>({text:e.text,...e.question===void 0?{}:{question:e.question}}))}
2
+ export{_s,Is};
@@ -1,2 +1,2 @@
1
- var i=new Set(["inputMode","imageIntent","imageInstructions","imageSelection","imageRequestId","imageAspectRatio"]);function uo(n){let e=n?.alwith;if(!e||typeof e!=="object"||Array.isArray(e))return n;return{...n,alwith:Object.fromEntries(Object.entries(e).filter(([t])=>!i.has(t)))}}
2
- export{uo};
1
+ var i=new Set(["inputMode","imageIntent","imageInstructions","imageSelection","imageRequestId","imageAspectRatio"]);function ho(n){let e=n?.alwith;if(!e||typeof e!=="object"||Array.isArray(e))return n;return{...n,alwith:Object.fromEntries(Object.entries(e).filter(([t])=>!i.has(t)))}}
2
+ export{ho};
@@ -1,2 +1,2 @@
1
- import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function zr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function ll(){c()}function Vr(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function $r(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Sa(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function cl(e,n,t,i,o,a){if(a==="none")return;_(o,[Sa(e,n,t,i,a)])}function Sa(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ba(t,i);return _a(e,n)}function Ba(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function _a(e,n){return y+Ga(e,n)}function dl(e,n){return D(_a(e,n))}function Ga(e,n){if(n<=l)return za(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function za(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ul(){return r.context?.state}function pl(e){return g(e).ready}
2
- export{zr,ll,Vr,$r,cl,Sa,Ba,_a,dl,Ga,za,ul,pl};
1
+ import{CacheStorage as I,Soundfont as M}from"smplr";var T=4,y=21,l=88,s=[39,41,43,44,46,48,50],p=0.035,b=0.16,S=88,E=50,h="acoustic_grand_piano",O="MusyngKite",w="FluidR3_GM",f=[0,2,4,5,7,9,11],U=2,C=5,m=globalThis;if(m.__alwithTimelineUserMessageNavigationAudio?.version!==T)m.__alwithTimelineUserMessageNavigationAudio={version:T,context:null,storage:I("alwith-timeline-navigation-instruments"),players:new Map,nextNoteTime:0,unlockConsumerCount:0};var r=m.__alwithTimelineUserMessageNavigationAudio;function d(){return r.context??=new AudioContext,r.context}function c(){let e=d();if(e.state==="running"){r.nextNoteTime=e.currentTime;return}e.resume().then(()=>{r.nextNoteTime=e.currentTime},(n)=>{if(n instanceof DOMException&&n.name==="NotAllowedError")return;console.error("Failed to unlock timeline navigation audio",n)})}function k(e){let n=d();return M(n,{instrument:e,kit:e===h?O:w,storage:r.storage,volume:E})}function g(e){let n=r.players.get(e);if(n!==void 0)return n;let t=k(e),i={player:t,ready:t.ready};return r.players.set(e,i),i}function Nr(e){g(e).ready.catch((n)=>{console.error(`Failed to load navigation instrument "${e}"`,n)})}function ll(){c()}function Ar(){if(r.unlockConsumerCount===0)window.addEventListener("pointerdown",c,{capture:!0}),window.addEventListener("keydown",c,{capture:!0});return r.unlockConsumerCount++,()=>{if(r.unlockConsumerCount--,r.unlockConsumerCount===0)window.removeEventListener("pointerdown",c,{capture:!0}),window.removeEventListener("keydown",c,{capture:!0})}}function Er(e,n,t,i,o){if(o==="none")return;let a=Math.sign(n-e),u=Math.abs(n-e),x=Array.from({length:u},(L,A)=>{let N=e+a*(A+1),v=t[N];return Ma(N,t.length,v.inputTokens,v.outputTokens,o)});_(i,x)}function cl(e,n,t,i,o,a){if(a==="none")return;_(o,[Ma(e,n,t,i,a)])}function Ma(e,n,t,i,o){if(o==="none")throw Error("navigationMidiNote: 声音已关闭,不该求音符");if(o==="auto")return Ha(t,i);return Na(e,n)}function Ha(e,n){let t=Math.imul(e,5)+Math.imul(n,3)>>>0,i=(Math.imul(e,11)^Math.imul(n,13))>>>0,o=t%f.length;return 12*(U+i%C+1)+f[o]}function Na(e,n){return y+Ua(e,n)}function dl(e,n){return D(Na(e,n))}function Ua(e,n){if(n<=l)return Ba(n)[n-e-1];return Math.round((n-e-1)/(n-1)*(l-1))}function Ba(e){if(e<=s.length)return s.slice(0,e);let n=new Set(s),t=s[0]-1,i=s.at(-1)+1;while(n.size<e&&(t>=0||i<l)){if(t>=0&&n.size<e)n.add(t--);if(i<l&&n.size<e)n.add(i++)}for(let o=0;n.size<e&&o<l;o++)n.add(o);return[...n].toSorted((o,a)=>o-a)}function D(e){return 440*2**((e-69)/12)}function _(e,n){let t=d();if(t.state!=="running")return;let{player:i,ready:o}=g(e);o.then(()=>{let a=Math.max(t.currentTime,r.nextNoteTime);for(let u=0;u<n.length;u++)i.start({note:n[u],time:a+u*p,duration:b,velocity:S});r.nextNoteTime=a+n.length*p}).catch((a)=>{console.error(`Failed to play navigation instrument "${e}"`,a)})}function ul(){return r.context?.state}function pl(e){return g(e).ready}
2
+ export{Nr,ll,Ar,Er,cl,Ma,Ha,Na,dl,Ua,Ba,ul,pl};
@@ -0,0 +1,2 @@
1
+ import{Ee}from"./chunk-fvmnj6bg.js";import{Kbd as i}from"@nyssance/shadcn/vega/components/ui/kbd";import{Tooltip as p,TooltipContent as l,TooltipTrigger as a}from"@nyssance/shadcn/vega/components/ui/tooltip";import{jsx as r,jsxs as e,Fragment as c}from"react/jsx-runtime";function li({shortcut:t,...o}){return t?r(i,{"aria-hidden":"true",...o,children:Ee(t)}):null}function ci({label:t,shortcut:o}){return e(c,{children:[r("span",{className:"min-w-0",children:t}),r(li,{className:"shrink-0",shortcut:o,"aria-hidden":"false"})]})}function en({label:t,shortcut:o,children:n}){return e(p,{children:[r(a,{render:n}),r(l,{role:"tooltip",children:o?r(ci,{label:t,shortcut:o}):t})]})}
2
+ export{li,ci,en};