@alwith/module-chat 0.5.11 → 0.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/dist/activity-host.js +1 -1
  2. package/dist/approval/choice-elicitation-form.js +1 -1
  3. package/dist/approval/choice-schema.js +1 -1
  4. package/dist/approval/permission-options.js +1 -1
  5. package/dist/approval/permission-view.js +1 -1
  6. package/dist/approval/schema-elicitation-form.js +1 -1
  7. package/dist/approval/url-elicitation-card.js +1 -1
  8. package/dist/{chunk-0gwe31zs.js → chunk-023yzyq8.js} +2 -2
  9. package/dist/{chunk-91x8etvh.js → chunk-0qm0fy2r.js} +2 -2
  10. package/dist/{chunk-ha5jfz6r.js → chunk-1dh0q11h.js} +3 -3
  11. package/dist/{chunk-rnykpmn2.js → chunk-1k03fpcj.js} +1 -1
  12. package/dist/{chunk-96xwaa2t.js → chunk-24b1z856.js} +2 -2
  13. package/dist/{chunk-syffw61b.js → chunk-27vftbhf.js} +4 -4
  14. package/dist/{chunk-m99k3e5h.js → chunk-2w576ygb.js} +2 -2
  15. package/dist/{chunk-5kpcpjrb.js → chunk-36t9x2qc.js} +3 -3
  16. package/dist/{chunk-r79zqx0t.js → chunk-3ah1ez70.js} +5 -5
  17. package/dist/{chunk-5w92bzgs.js → chunk-3dvx2q8w.js} +2 -2
  18. package/dist/{chunk-qj63fv6w.js → chunk-3g66qg03.js} +2 -2
  19. package/dist/{chunk-bhze2sjv.js → chunk-3q6ssrs3.js} +2 -2
  20. package/dist/{chunk-krmz8t4p.js → chunk-4wkpatzz.js} +2 -2
  21. package/dist/{chunk-460phps1.js → chunk-58bs5f2z.js} +2 -2
  22. package/dist/{chunk-rszktjdw.js → chunk-62m11b37.js} +3 -3
  23. package/dist/{chunk-t6t6hgzx.js → chunk-63zq5nr8.js} +2 -2
  24. package/dist/chunk-6nyba0m4.js +2 -0
  25. package/dist/{chunk-m6rrt94g.js → chunk-753s76b6.js} +2 -2
  26. package/dist/chunk-76w1a72z.js +2 -0
  27. package/dist/{chunk-30wqrz8v.js → chunk-7avpdkmf.js} +2 -2
  28. package/dist/{chunk-vv1ghqq3.js → chunk-8712sy9s.js} +1 -1
  29. package/dist/{chunk-sr5rcdza.js → chunk-8a1j96d1.js} +2 -2
  30. package/dist/{chunk-7k0wvvy0.js → chunk-8jpm8fnf.js} +1 -1
  31. package/dist/{chunk-ysc51tpb.js → chunk-9hvbm4be.js} +1 -1
  32. package/dist/{chunk-kahn24np.js → chunk-9t8ptjct.js} +2 -2
  33. package/dist/{chunk-5ev4qvsp.js → chunk-9v94xnhp.js} +2 -2
  34. package/dist/{chunk-50qyant6.js → chunk-a1kmc6t8.js} +3 -3
  35. package/dist/{chunk-17zegmxa.js → chunk-a2hygrpr.js} +1 -1
  36. package/dist/{chunk-5m4605a3.js → chunk-ana59z25.js} +1 -1
  37. package/dist/{chunk-magaaqab.js → chunk-anfrrs5x.js} +1 -1
  38. package/dist/chunk-b1vw42he.js +2 -0
  39. package/dist/{chunk-5fgakrmr.js → chunk-b3nt7axf.js} +2 -2
  40. package/dist/{chunk-p1ydsj54.js → chunk-b5z75meq.js} +2 -2
  41. package/dist/{chunk-mgtkmbmd.js → chunk-bbwb4555.js} +2 -2
  42. package/dist/{chunk-znx2e9e7.js → chunk-bcrq96dw.js} +2 -2
  43. package/dist/{chunk-ynw0f8h2.js → chunk-bftrddmr.js} +2 -2
  44. package/dist/{chunk-443z7mve.js → chunk-bna24ggr.js} +2 -2
  45. package/dist/chunk-bzk6wn2s.js +3 -0
  46. package/dist/{chunk-gzff19t3.js → chunk-c7km8xgd.js} +2 -2
  47. package/dist/{chunk-tjgq4882.js → chunk-c9k66x5g.js} +2 -2
  48. package/dist/{chunk-294gms5s.js → chunk-chwg3na0.js} +2 -2
  49. package/dist/chunk-ckft9abb.js +2 -0
  50. package/dist/{chunk-7a6t282a.js → chunk-cy6grsx0.js} +1 -1
  51. package/dist/{chunk-p8nx34zm.js → chunk-d6840cvf.js} +2 -2
  52. package/dist/{chunk-6amcjhqh.js → chunk-ddtb692j.js} +2 -2
  53. package/dist/{chunk-t3ew92b3.js → chunk-dgnk7h62.js} +2 -2
  54. package/dist/{chunk-sex6d2c2.js → chunk-ds6avzj3.js} +2 -2
  55. package/dist/{chunk-k5c82xk9.js → chunk-dxt9j0da.js} +2 -2
  56. package/dist/chunk-e15f3anm.js +3 -0
  57. package/dist/{chunk-j2wty8a3.js → chunk-ee9pzqnq.js} +2 -2
  58. package/dist/{chunk-q905xt4v.js → chunk-evx9d147.js} +2 -2
  59. package/dist/{chunk-dp8pjv6r.js → chunk-f3e3ged2.js} +1 -1
  60. package/dist/chunk-f7n8erng.js +2 -0
  61. package/dist/{chunk-b4dsjhkq.js → chunk-fa0kzj3j.js} +1 -1
  62. package/dist/{chunk-20svvgj3.js → chunk-fnbs3dq1.js} +2 -2
  63. package/dist/{chunk-88xay4pa.js → chunk-fpx4ng0t.js} +2 -2
  64. package/dist/{chunk-hjnf5kvc.js → chunk-fteek5h4.js} +2 -2
  65. package/dist/{chunk-133f0wed.js → chunk-gbbpdhg6.js} +2 -2
  66. package/dist/{chunk-m28hdj8j.js → chunk-gpz9f9zq.js} +2 -2
  67. package/dist/{chunk-0n240acr.js → chunk-gszy4mhj.js} +2 -2
  68. package/dist/{chunk-zbtas7pt.js → chunk-gtqwgjjg.js} +2 -2
  69. package/dist/{chunk-4nh3xzrm.js → chunk-hgj33wbd.js} +2 -2
  70. package/dist/chunk-hh498geh.js +7 -0
  71. package/dist/chunk-hpyaxv6h.js +2 -0
  72. package/dist/{chunk-m8djwdd5.js → chunk-ht28382s.js} +2 -2
  73. package/dist/{chunk-wb3zpzk3.js → chunk-hw99hhjf.js} +1 -1
  74. package/dist/{chunk-jn0q0b7k.js → chunk-hwfwd04r.js} +2 -2
  75. package/dist/{chunk-6edz9f7j.js → chunk-hz1pgnqp.js} +2 -2
  76. package/dist/chunk-jr591zg2.js +2 -0
  77. package/dist/{chunk-y3qgsj79.js → chunk-jtv179nm.js} +1 -1
  78. package/dist/{chunk-cke0v0a7.js → chunk-kbwjcnf6.js} +1 -1
  79. package/dist/{chunk-g7p46jq1.js → chunk-kfs19vc5.js} +2 -2
  80. package/dist/{chunk-7h8pv9eg.js → chunk-ks05sstp.js} +1 -1
  81. package/dist/{chunk-0yvbqccv.js → chunk-kw487283.js} +2 -2
  82. package/dist/{chunk-6d7ppje3.js → chunk-m6h92nq4.js} +2 -2
  83. package/dist/{chunk-fe3c678p.js → chunk-mk379yt7.js} +2 -2
  84. package/dist/{chunk-cgqhz23q.js → chunk-mkw0twsb.js} +2 -2
  85. package/dist/{chunk-4svcj9c6.js → chunk-mvv5xmap.js} +2 -2
  86. package/dist/{chunk-knsf6jm1.js → chunk-mwd0ed0c.js} +2 -2
  87. package/dist/chunk-nad1erxy.js +3 -0
  88. package/dist/{chunk-f1zvbkak.js → chunk-nwrbpw97.js} +1 -1
  89. package/dist/{chunk-5hsmhj1g.js → chunk-phy911dk.js} +2 -2
  90. package/dist/{chunk-7jdazbzv.js → chunk-q256c3hn.js} +2 -2
  91. package/dist/{chunk-a3krtv66.js → chunk-qg1b5k6m.js} +2 -2
  92. package/dist/chunk-qv4x469a.js +2 -0
  93. package/dist/{chunk-qw0jp3wm.js → chunk-qwyvq7bk.js} +2 -2
  94. package/dist/{chunk-tv89wh8b.js → chunk-r0t8zj4g.js} +2 -2
  95. package/dist/{chunk-xh8wth6z.js → chunk-rag9xsg5.js} +2 -2
  96. package/dist/{chunk-abwjd5yv.js → chunk-reaxcamj.js} +1 -1
  97. package/dist/{chunk-e55zxnda.js → chunk-rrrpp44m.js} +2 -2
  98. package/dist/{chunk-64whvkk0.js → chunk-rtg6xfgr.js} +1 -1
  99. package/dist/chunk-s2k5xynq.js +2 -0
  100. package/dist/{chunk-qpc4ca5y.js → chunk-sbyn62qx.js} +2 -2
  101. package/dist/chunk-shsyer15.js +2 -0
  102. package/dist/{chunk-w43dvzqk.js → chunk-sn80gr8g.js} +3 -3
  103. package/dist/{chunk-hxhptw6e.js → chunk-tjpr0adf.js} +2 -2
  104. package/dist/{chunk-zz734bzf.js → chunk-tjykfxrd.js} +2 -2
  105. package/dist/{chunk-rnzphmk6.js → chunk-tm4ee7m3.js} +2 -2
  106. package/dist/{chunk-7drq0g9b.js → chunk-tt40vzdd.js} +2 -2
  107. package/dist/{chunk-f4h7yb7d.js → chunk-vc9ts6wp.js} +2 -2
  108. package/dist/{chunk-cpk3y6ad.js → chunk-vcbv30ph.js} +2 -2
  109. package/dist/{chunk-cjztkcsm.js → chunk-vyccmpdn.js} +2 -2
  110. package/dist/{chunk-w8qmh6he.js → chunk-w45d5th9.js} +2 -2
  111. package/dist/{chunk-0d4xsx23.js → chunk-wmk2dwpf.js} +2 -2
  112. package/dist/{chunk-gj3j9zh5.js → chunk-x2tsybks.js} +3 -3
  113. package/dist/{chunk-nkypxxjk.js → chunk-xa20eex9.js} +1 -1
  114. package/dist/{chunk-hrsz92yq.js → chunk-xd5rqbwp.js} +1 -1
  115. package/dist/{chunk-728v2as1.js → chunk-xj0y094j.js} +2 -2
  116. package/dist/{chunk-377s443r.js → chunk-y0psrvcc.js} +2 -2
  117. package/dist/{chunk-j2wtwb37.js → chunk-y1kkt0m2.js} +2 -2
  118. package/dist/{chunk-ryz4c13z.js → chunk-y6r6tzfh.js} +2 -2
  119. package/dist/chunk-zg2342s2.js +2 -0
  120. package/dist/{chunk-jhk2chpp.js → chunk-zmpbfbnn.js} +1 -1
  121. package/dist/{chunk-mt965yn0.js → chunk-znyyzs85.js} +2 -2
  122. package/dist/{chunk-6pmc9283.js → chunk-zp5ntx27.js} +1 -1
  123. package/dist/{chunk-qah4fs3d.js → chunk-zw3h5xgf.js} +1 -1
  124. package/dist/codex/activity-group.js +1 -1
  125. package/dist/codex/assistant-message.d.ts +2 -1
  126. package/dist/codex/assistant-message.js +1 -1
  127. package/dist/codex/async-question-card.js +1 -1
  128. package/dist/codex/disclosure-state.js +1 -1
  129. package/dist/codex/edited-files-card.js +1 -1
  130. package/dist/codex/image-view-activity.js +1 -1
  131. package/dist/codex/markdown-renderer.js +1 -1
  132. package/dist/codex/navigation-audio.js +1 -1
  133. package/dist/codex/navigation-preview.js +1 -1
  134. package/dist/codex/navigation-rail.js +1 -1
  135. package/dist/codex/patch-view.js +1 -1
  136. package/dist/codex/plan.js +1 -1
  137. package/dist/codex/timeline-virtualizer.js +1 -1
  138. package/dist/codex/turn-activity.d.ts +1 -1
  139. package/dist/codex/turn-activity.js +1 -1
  140. package/dist/codex/user-message.js +1 -1
  141. package/dist/codex/virtualized-turn-list.js +1 -1
  142. package/dist/composer/completion-filter.js +1 -1
  143. package/dist/composer/completion-menu.js +1 -1
  144. package/dist/composer/completion-trigger.js +1 -1
  145. package/dist/composer/effort-slider.js +1 -1
  146. package/dist/composer/menu-radio.js +1 -1
  147. package/dist/composer/model-select.js +1 -1
  148. package/dist/composer/permission-mode-select.js +1 -1
  149. package/dist/composer/prompt-input-attachments.js +1 -1
  150. package/dist/composer/prompt-input-clipboard.js +1 -1
  151. package/dist/composer/prompt-input-context.js +1 -1
  152. package/dist/composer/prompt-input-textarea.js +1 -1
  153. package/dist/composer/prompt-input.js +1 -1
  154. package/dist/conversation/action-card.js +1 -1
  155. package/dist/conversation/composer/composer.d.ts +2 -1
  156. package/dist/conversation/composer/composer.js +1 -1
  157. package/dist/conversation/composer/config-options.js +1 -1
  158. package/dist/conversation/composer/context.d.ts +1 -0
  159. package/dist/conversation/composer/context.js +1 -1
  160. package/dist/conversation/composer/drafts.js +1 -1
  161. package/dist/conversation/composer/long-text.js +1 -1
  162. package/dist/conversation/composer/mention-chips.js +1 -1
  163. package/dist/conversation/composer/model-menu.d.ts +1 -1
  164. package/dist/conversation/composer/model-menu.js +1 -1
  165. package/dist/conversation/composer/pasted-text-attachment.js +1 -1
  166. package/dist/conversation/composer/permission-mode-menu.js +1 -1
  167. package/dist/conversation/composer/prediction.js +1 -1
  168. package/dist/conversation/composer/slash-command-button.js +1 -1
  169. package/dist/conversation/composer/submit-button.js +1 -1
  170. package/dist/conversation/composer/usage-meter.js +1 -1
  171. package/dist/conversation/context.js +1 -1
  172. package/dist/conversation/conversation-body.js +1 -1
  173. package/dist/conversation/conversation-view.js +1 -1
  174. package/dist/conversation/conversation.js +1 -1
  175. package/dist/conversation/diff-modal.js +1 -1
  176. package/dist/conversation/session-actions.js +1 -1
  177. package/dist/image-lightbox.js +1 -1
  178. package/dist/image-preview-dialog.js +1 -1
  179. package/dist/lib/code-highlighter.js +1 -1
  180. package/dist/lib/fuzzy.js +1 -1
  181. package/dist/lib/group-blocks.js +1 -1
  182. package/dist/lib/image-encode.js +1 -1
  183. package/dist/lib/limits.js +1 -1
  184. package/dist/lib/markdown-parser.js +1 -1
  185. package/dist/lib/markdown-rules.js +1 -1
  186. package/dist/lib/model-name.js +1 -1
  187. package/dist/lib/pointer-centered-zoom.js +1 -1
  188. package/dist/lib/prepare-prompt-files.js +1 -1
  189. package/dist/lib/stream-style.js +1 -1
  190. package/dist/lib/streaming-markdown.js +1 -1
  191. package/dist/locales.d.ts +13 -0
  192. package/dist/locales.js +1 -1
  193. package/dist/search/chat-search.js +1 -1
  194. package/dist/search/dom-matches.js +1 -1
  195. package/dist/search/find-bar.js +1 -1
  196. package/dist/search/literal-matches.js +1 -1
  197. package/dist/session-list/archived-sessions.js +1 -1
  198. package/dist/session-list/host.js +1 -1
  199. package/dist/session-list/navigation.js +1 -1
  200. package/dist/session-list/overflow-marquee.js +1 -1
  201. package/dist/session-list/session-groups.js +1 -1
  202. package/dist/session-list/session-info-card.js +1 -1
  203. package/dist/session-list/session-list.js +1 -1
  204. package/dist/session-list/session-row.js +1 -1
  205. package/dist/session-list/session-state-dot.js +1 -1
  206. package/dist/session-list/session-state-menu.js +1 -1
  207. package/dist/session-list/sidebar-overlay.js +1 -1
  208. package/dist/session-list/trailing-swap.js +1 -1
  209. package/dist/session-list/use-activity-preview.js +1 -1
  210. package/dist/session-list/use-project-sessions.js +1 -1
  211. package/dist/session-list/virtual-session-rows.js +1 -1
  212. package/dist/session-timeline/activity-group.js +1 -1
  213. package/dist/session-timeline/activity-projection.d.ts +2 -1
  214. package/dist/session-timeline/activity-projection.js +1 -1
  215. package/dist/session-timeline/assistant-content.js +1 -1
  216. package/dist/session-timeline/assistant-turn.js +1 -1
  217. package/dist/session-timeline/async-questions.js +1 -1
  218. package/dist/session-timeline/edited-files-card.js +1 -1
  219. package/dist/session-timeline/history-timeline.js +1 -1
  220. package/dist/session-timeline/host.js +1 -1
  221. package/dist/session-timeline/navigation-rail.js +1 -1
  222. package/dist/session-timeline/plan.js +1 -1
  223. package/dist/session-timeline/question-reply.js +1 -1
  224. package/dist/session-timeline/resource-content.js +1 -1
  225. package/dist/session-timeline/session-timeline.js +1 -1
  226. package/dist/session-timeline/timeline-registry.js +1 -1
  227. package/dist/session-timeline/turn-activity.js +1 -1
  228. package/dist/session-timeline/turn-error.js +1 -1
  229. package/dist/session-timeline/turn-retry.js +1 -1
  230. package/dist/session-timeline/turns.js +1 -1
  231. package/dist/session-timeline/use-timeline-scroll.js +1 -1
  232. package/dist/session-timeline/user-message.js +1 -1
  233. package/dist/types.d.ts +1 -0
  234. package/dist/ui/alert.js +1 -1
  235. package/dist/ui/badge.js +1 -1
  236. package/dist/ui/card.js +1 -1
  237. package/dist/ui/dialog.js +1 -1
  238. package/dist/ui/dropdown-menu.js +1 -1
  239. package/dist/ui/empty.js +1 -1
  240. package/dist/ui/field.js +1 -1
  241. package/dist/ui/input-group-textarea.js +1 -1
  242. package/dist/ui/input-group.js +1 -1
  243. package/dist/ui/kbd.js +1 -1
  244. package/dist/ui/radio-group.js +1 -1
  245. package/dist/ui/select.js +1 -1
  246. package/dist/ui/tooltip.js +1 -1
  247. package/package.json +1 -1
  248. package/dist/chunk-0kwfy29d.js +0 -2
  249. package/dist/chunk-3e0mfcj6.js +0 -2
  250. package/dist/chunk-3vrtepy0.js +0 -3
  251. package/dist/chunk-4b3s7gyc.js +0 -3
  252. package/dist/chunk-51sbmqdk.js +0 -2
  253. package/dist/chunk-7dzq2t68.js +0 -2
  254. package/dist/chunk-93x6b2qa.js +0 -3
  255. package/dist/chunk-9a4kjze3.js +0 -7
  256. package/dist/chunk-9tdzg6e6.js +0 -2
  257. package/dist/chunk-d84cxw1v.js +0 -2
  258. package/dist/chunk-e11qjnb4.js +0 -2
  259. package/dist/chunk-k3375qqd.js +0 -2
  260. package/dist/chunk-p8qgqtkc.js +0 -2
  261. package/dist/chunk-w6hhyjcn.js +0 -2
  262. package/dist/chunk-zt8qaqbz.js +0 -2
@@ -1 +1 @@
1
- import{sr,a,v}from"./chunk-ryz4c13z.js";export{sr as ActivityHostProvider,v as ActivityMarkdown,a as useActivityHost};
1
+ import{lr,a,v}from"./chunk-y6r6tzfh.js";export{lr as ActivityHostProvider,v as ActivityMarkdown,a as useActivityHost};
@@ -1 +1 @@
1
- import{qe}from"../chunk-nkypxxjk.js";import{e}from"../chunk-6kn920c5.js";import{ue}from"../chunk-1drkvxzk.js";import{l}from"../chunk-1hy64ewz.js";import{f}from"../chunk-ek06eyp4.js";import{j,I}from"../chunk-5m4605a3.js";import{k}from"../chunk-ncekagm6.js";import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";import{autoUpdate as G}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as Q,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as V,useState as R}from"react";import{createPortal as W}from"react-dom";import{jsx as i,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:r,total:F,anchorRef:N,t:p,onAccept:A,onDecline:L}){let x=_(()=>r?mn(r.requestedSchema):[],[r]),[S,b]=R({}),T=V(null);M(()=>{if(r?.elicitationId===void 0)return;let t={};for(let{key:a,property:o}of x)if(!ae(o)){let u=We(o)[0];if(u)t[a]={selected:u.value}}b(t)},[r?.elicitationId,x]),M(()=>{if(r?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[r?.elicitationId]);let[y,q]=R(null),[C,z]=R(null),E=Q(()=>{let t=N.current;if(!t)return;let a=t.getBoundingClientRect();if(a.width===0){let o=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-o)/2,width:o,bottom:24});return}q({left:a.left,width:a.width,bottom:window.innerHeight-a.bottom+20})},[N]);O(()=>{if(!r)return;let t=0,a=()=>{if(N.current){E();return}t=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(t)},[r,E,N]),O(()=>{let t=N.current;if(!r||!t||!C)return;return G(t,C,E,{animationFrame:!0})},[r,C,N,E]);let U=_(()=>{if(!r)return!1;for(let{key:t,property:a}of x){let o=S[t];if(!o)return!1;if(ae(a)){if(!o.selectedSet||o.selectedSet.size===0)return!1;if(o.selectedSet.has(c)&&!o.otherText?.trim())return!1}else{if(!o.selected)return!1;if(o.selected===c&&!o.otherText?.trim())return!1}}return!0},[r,x,S]),D=Q(async()=>{if(!r)return;if(!U)return;let t={},a={};for(let{key:o,property:u}of x){let d=S[o];if(!d)continue;let g;if(ae(u))t[o]=[...d.selectedSet??[]].map((v)=>v===c?(d.otherText??"").trim():v).filter(Boolean);else{let v=d.selected??"";if(t[o]=v===c?(d.otherText??"").trim():v,v!==c)g=We(u).find((s)=>s.value===v)?.preview}let h=d.notes?.trim();if(g||h)a[o]={...g&&{preview:g},...h&&{notes:h}}}await A(r.elicitationId,t,a)},[r,x,S,U,A]),B=Q(async()=>{if(r)await L(r.elicitationId)},[r,L]);if(!r||!y)return null;return W(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:y.left,width:y.width,bottom:y.bottom,maxHeight:"70vh"},ref:(t)=>{T.current=t,z(t)},children:[m("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[i("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),F>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${F}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:a},o)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=We(a),v=ae(a);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[i(qe,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:Ct(a).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:Ct(a).description})]}),v?m("div",{className:"space-y-1.5 ps-1",children:[h.map((s)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(s.value),onCheckedChange:(n)=>{b((w)=>{let P=new Set(w[t]?.selectedSet??new Set);if(n)P.add(s.value);else P.delete(s.value);return{...w,[t]:{...w[t],selectedSet:P}}})}}),m("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(c),onCheckedChange:(s)=>{b((n)=>{let w=new Set(n[t]?.selectedSet??new Set);if(s)w.add(c);else w.delete(c);return{...n,[t]:{...n[t],selectedSet:w}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}):m(j,{value:d??"",onValueChange:(s)=>b((n)=>({...n,[t]:{...n[t],selected:s}})),className:"space-y-1.5 ps-1",children:[h.map((s)=>{let n=`${o}:${s.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===s.value&&"bg-muted/60"),children:[i(I,{value:s.value,id:n}),m(f,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[i(I,{value:c,id:`${o}:other`,className:"mt-0.5"}),i(f,{htmlFor:`${o}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}),!v&&d&&d!==c&&(()=>{let s=h.find((n)=>n.value===d)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),h.some((s)=>s.preview)&&i(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void B(),children:p("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
1
+ import{qe}from"../chunk-xa20eex9.js";import{e}from"../chunk-6kn920c5.js";import{ue}from"../chunk-1drkvxzk.js";import{l}from"../chunk-1hy64ewz.js";import{f}from"../chunk-ek06eyp4.js";import{j,P}from"../chunk-ana59z25.js";import{k}from"../chunk-ncekagm6.js";import{gn,Ct,ae,Ge}from"../chunk-63zq5nr8.js";import{autoUpdate as G}from"@floating-ui/dom";import{cn as H}from"cn";import{useCallback as R,useEffect as M,useLayoutEffect as O,useMemo as _,useRef as V,useState as F}from"react";import{createPortal as W}from"react-dom";import{jsx as i,jsxs as m}from"react/jsx-runtime";var c="__other__";function le({current:r,total:A,anchorRef:N,t:p,onAccept:I,onDecline:L}){let x=_(()=>r?gn(r.requestedSchema):[],[r]),[S,b]=F({}),T=V(null);M(()=>{if(r?.elicitationId===void 0)return;let t={};for(let{key:a,property:o}of x)if(!ae(o)){let u=Ge(o)[0];if(u)t[a]={selected:u.value}}b(t)},[r?.elicitationId,x]),M(()=>{if(r?.elicitationId!==void 0&&T.current&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA")T.current.focus()},[r?.elicitationId]);let[y,q]=F(null),[C,z]=F(null),E=R(()=>{let t=N.current;if(!t)return;let a=t.getBoundingClientRect();if(a.width===0){let o=Math.min(640,window.innerWidth*0.9);q({left:(window.innerWidth-o)/2,width:o,bottom:24});return}q({left:a.left,width:a.width,bottom:window.innerHeight-a.bottom+20})},[N]);O(()=>{if(!r)return;let t=0,a=()=>{if(N.current){E();return}t=requestAnimationFrame(a)};return a(),()=>cancelAnimationFrame(t)},[r,E,N]),O(()=>{let t=N.current;if(!r||!t||!C)return;return G(t,C,E,{animationFrame:!0})},[r,C,N,E]);let U=_(()=>{if(!r)return!1;for(let{key:t,property:a}of x){let o=S[t];if(!o)return!1;if(ae(a)){if(!o.selectedSet||o.selectedSet.size===0)return!1;if(o.selectedSet.has(c)&&!o.otherText?.trim())return!1}else{if(!o.selected)return!1;if(o.selected===c&&!o.otherText?.trim())return!1}}return!0},[r,x,S]),D=R(async()=>{if(!r)return;if(!U)return;let t={},a={};for(let{key:o,property:u}of x){let d=S[o];if(!d)continue;let g;if(ae(u))t[o]=[...d.selectedSet??[]].map((v)=>v===c?(d.otherText??"").trim():v).filter(Boolean);else{let v=d.selected??"";if(t[o]=v===c?(d.otherText??"").trim():v,v!==c)g=Ge(u).find((s)=>s.value===v)?.preview}let h=d.notes?.trim();if(g||h)a[o]={...g&&{preview:g},...h&&{notes:h}}}await I(r.elicitationId,t,a)},[r,x,S,U,I]),B=R(async()=>{if(r)await L(r.elicitationId)},[r,L]);if(!r||!y)return null;return W(m("div",{"data-overlay":"ask-user-question",tabIndex:0,onKeyDown:(t)=>{if(t.key==="Escape")t.preventDefault(),B()},className:"bg-card border-border fixed z-50 flex flex-col overflow-hidden rounded-lg border shadow-lg outline-none",style:{left:y.left,width:y.width,bottom:y.bottom,maxHeight:"70vh"},ref:(t)=>{T.current=t,z(t)},children:[m("div",{className:"border-border flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2",children:[i("div",{className:"text-foreground text-sm font-medium",children:p("askUserQuestion.title")}),A>1&&i("span",{className:"text-muted-foreground shrink-0 text-xs",children:`1 / ${A}`})]}),i("div",{className:"min-h-0 flex-1 overflow-y-auto",children:i("div",{className:"space-y-4 px-3 py-3",children:x.map(({key:t,property:a},o)=>{let u=S[t],d=u?.selected,g=u?.selectedSet??new Set,h=Ge(a),v=ae(a);return m("div",{className:"space-y-2",children:[m("div",{className:"flex items-center gap-2",children:[i(qe,{variant:"secondary",className:"font-mono text-[10px] tracking-wide uppercase",children:Ct(a).title??t}),i("div",{className:"text-foreground text-sm font-medium",children:Ct(a).description})]}),v?m("div",{className:"space-y-1.5 ps-1",children:[h.map((s)=>m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(s.value),onCheckedChange:(n)=>{b((w)=>{let Q=new Set(w[t]?.selectedSet??new Set);if(n)Q.add(s.value);else Q.delete(s.value);return{...w,[t]:{...w[t],selectedSet:Q}}})}}),m("div",{className:"min-w-0 flex-1",children:[i("div",{className:"text-foreground text-sm",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs",children:s.description})]})]},s.value)),m("label",{className:"hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",children:[i(ue,{checked:g.has(c),onCheckedChange:(s)=>{b((n)=>{let w=new Set(n[t]?.selectedSet??new Set);if(s)w.add(c);else w.delete(c);return{...n,[t]:{...n[t],selectedSet:w}}})}}),i("div",{className:"text-foreground min-w-0 flex-1 text-sm",children:p("askUserQuestion.other")})]}),g.has(c)&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}):m(j,{value:d??"",onValueChange:(s)=>b((n)=>({...n,[t]:{...n[t],selected:s}})),className:"space-y-1.5 ps-1",children:[h.map((s)=>{let n=`${o}:${s.value}`;return m("div",{className:H("hover:bg-muted/40 flex cursor-pointer items-center gap-2 rounded-sm px-1.5 py-1",d===s.value&&"bg-muted/60"),children:[i(P,{value:s.value,id:n}),m(f,{htmlFor:n,className:"min-w-0 flex-1 cursor-pointer",children:[i("div",{className:"text-foreground text-sm font-normal",children:s.label}),s.description&&i("div",{className:"text-muted-foreground text-xs font-normal",children:s.description})]})]},s.value)}),m("div",{className:H("hover:bg-muted/40 flex items-center gap-2 rounded-sm px-1.5 py-1",d===c&&"bg-muted/60"),children:[i(P,{value:c,id:`${o}:other`,className:"mt-0.5"}),i(f,{htmlFor:`${o}:other`,className:"text-foreground min-w-0 flex-1 cursor-pointer text-sm font-normal",children:p("askUserQuestion.other")})]}),d===c&&i("div",{className:"ps-7",children:i(l,{placeholder:p("askUserQuestion.otherPlaceholder"),value:u?.otherText??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],otherText:s.target.value}}))})})]}),!v&&d&&d!==c&&(()=>{let s=h.find((n)=>n.value===d)?.preview;if(!s)return null;return i("pre",{className:"bg-muted/50 text-muted-foreground ms-1 mt-1 overflow-auto rounded-sm px-2 py-1.5 font-mono text-[11px] whitespace-pre-wrap",children:s})})(),h.some((s)=>s.preview)&&i(k,{placeholder:p("askUserQuestion.notesPlaceholder"),value:u?.notes??"",onChange:(s)=>b((n)=>({...n,[t]:{...n[t],notes:s.target.value}})),rows:1,className:"min-h-0 resize-none text-xs"})]},t)})})}),m("div",{className:"border-border bg-card flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2",children:[i(e,{variant:"ghost",size:"sm",onClick:()=>void B(),children:p("askUserQuestion.cancel")}),i(e,{size:"sm",disabled:!U,onClick:()=>void D(),children:p("askUserQuestion.submit")})]})]}),document.body)}export{le as ChoiceElicitationForm};
@@ -1 +1 @@
1
- import{mn,Ct,ae,We}from"../chunk-t6t6hgzx.js";export{mn as elicitationFields,Ct as elicitationLabels,We as elicitationOptions,ae as isMultiSelect};
1
+ import{gn,Ct,ae,Ge}from"../chunk-63zq5nr8.js";export{gn as elicitationFields,Ct as elicitationLabels,Ge as elicitationOptions,ae as isMultiSelect};
@@ -1 +1 @@
1
- import{hr,kn,Yr,Zr}from"../chunk-p8qgqtkc.js";export{hr as PERMISSION_KIND_GROUP_ORDER,Yr as isAllowKind,Zr as isAlwaysKind,kn as sortPermissionOptions};
1
+ import{vr,Tn,Zr,Jr}from"../chunk-jr591zg2.js";export{vr as PERMISSION_KIND_GROUP_ORDER,Zr as isAllowKind,Jr as isAlwaysKind,Tn as sortPermissionOptions};
@@ -1 +1 @@
1
- import{yn}from"../chunk-cgqhz23q.js";import"../chunk-p8qgqtkc.js";export{yn as PermissionView};
1
+ import{wn}from"../chunk-mkw0twsb.js";import"../chunk-jr591zg2.js";export{wn as PermissionView};
@@ -1 +1 @@
1
- import{Pr,fr,Nr,bn}from"../chunk-443z7mve.js";import"../chunk-1drkvxzk.js";import"../chunk-7k0wvvy0.js";import"../chunk-1hy64ewz.js";import"../chunk-5m4605a3.js";import"../chunk-ek06eyp4.js";import"../chunk-ksv9pjc2.js";import"../chunk-17zegmxa.js";import"../chunk-ak0k5vg6.js";import"../chunk-ncekagm6.js";import"../chunk-6kn920c5.js";export{bn as SchemaElicitationForm,Pr as elicitationFields,fr as initialValues,Nr as isAnswered};
1
+ import{Nr,hr,Mr,kn}from"../chunk-bna24ggr.js";import"../chunk-1drkvxzk.js";import"../chunk-8jpm8fnf.js";import"../chunk-1hy64ewz.js";import"../chunk-ana59z25.js";import"../chunk-ek06eyp4.js";import"../chunk-ksv9pjc2.js";import"../chunk-a2hygrpr.js";import"../chunk-ak0k5vg6.js";import"../chunk-ncekagm6.js";import"../chunk-6kn920c5.js";export{kn as SchemaElicitationForm,Nr as elicitationFields,hr as initialValues,Mr as isAnswered};
@@ -1 +1 @@
1
- import{wn}from"../chunk-krmz8t4p.js";import"../chunk-vv1ghqq3.js";import"../chunk-6kn920c5.js";export{wn as UrlElicitationCard};
1
+ import{Cn}from"../chunk-4wkpatzz.js";import"../chunk-8712sy9s.js";import"../chunk-6kn920c5.js";export{Cn as UrlElicitationCard};
@@ -1,2 +1,2 @@
1
- var ri=280;function _n({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function me({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Dt({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function Hn({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function On({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function Fn({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
- export{ri,_n,me,Dt,Hn,On,Fn};
1
+ var ii=280;function On({entries:i,gapPx:t,measuredHeightsByKey:o,leadingInsetPx:e=0}){let n=[],r=[],d=new Map,s=[],u=e;for(let[x,a]of i.entries()){d.set(a.turnKey,x);for(let h of a.aliases??[])d.set(h,x);s.push(a.turnKey),r.push(u);let f=a.aliases?.map((h)=>o[h]).find((h)=>h!==void 0),m=o[a.turnKey]??f??a.estimatedHeightPx??280;if(n.push(m),u+=m,x<i.length-1)u+=t}return{bottomOffsetsPx:r.map((x,a)=>{let f=n[a];if(f===void 0)throw Error(`Codex turn height is missing at index ${a}`);return u-x-f}),heightsPx:n,topOffsetsPx:r,totalHeightPx:u,turnIndexByKey:d,turnKeys:s}}function me({distanceFromBottomPx:i,layout:t,overscanCount:o,viewportHeightPx:e}){if(t.turnKeys.length===0)return{startIndex:0,endIndex:0};let n=Math.min(Math.max(0,i),t.totalHeightPx),r=Math.min(n+Math.max(0,e),t.totalHeightPx),d=g(t.bottomOffsetsPx,r),s=l(t.bottomOffsetsPx,t.heightsPx,n);return{startIndex:Math.max(0,d-o),endIndex:Math.min(t.turnKeys.length,Math.max(s,d+1)+o)}}function Dt({anchorKey:i,layout:t,previousRange:o}){let e=t.turnIndexByKey.get(i);if(e===void 0)return null;return{startIndex:e,endIndex:Math.min(t.turnKeys.length,e+o.endIndex-o.startIndex)}}function Fn({anchorKey:i,distanceFromBottomPx:t,nextLayout:o,previousLayout:e}){let n=e.turnIndexByKey.get(i),r=o.turnIndexByKey.get(i);if(n===void 0||r===void 0)return null;let d=e.bottomOffsetsPx[n],s=e.heightsPx[n],u=o.bottomOffsetsPx[r],x=o.heightsPx[r];if(d===void 0||s===void 0||u===void 0||x===void 0)throw Error(`Codex turn geometry is missing: ${i}`);return Math.max(0,t+u+x-d-s)}function Bn({layout:i,turnKey:t,viewportHeightPx:o}){let e=i.turnIndexByKey.get(t);if(e===void 0)return null;let n=i.bottomOffsetsPx[e],r=i.heightsPx[e];if(n===void 0||r===void 0)throw Error(`Codex turn geometry is missing: ${t}`);return Math.max(0,n-o/2+r/2)}function zn({align:i,layout:t,targetHeightPx:o,targetOffsetPx:e,turnKey:n,viewportHeightPx:r}){let d=t.turnIndexByKey.get(n);if(d===void 0)return null;let s=t.bottomOffsetsPx[d],u=t.heightsPx[d];if(s===void 0||u===void 0)throw Error(`Codex turn geometry is missing: ${n}`);let x=s+u-e;return i==="top"?Math.max(0,x-r+10):Math.max(0,x-o/2-r/2)}function g(i,t){let o=0,e=i.length;while(o<e){let n=Math.floor((o+e)/2),r=i[n];if(r===void 0)throw Error(`Codex bottom offset is missing at index ${n}`);if(r<t)e=n;else o=n+1}return o}function l(i,t,o){let e=0,n=i.length;while(e<n){let r=Math.floor((e+n)/2),d=i[r],s=t[r];if(d===void 0||s===void 0)throw Error(`Codex turn geometry is missing at index ${r}`);if(d+s<=o)n=r;else e=r+1}return e}
2
+ export{ii,On,me,Dt,Fn,Bn,zn};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-6kn920c5.js";import{t}from"./chunk-dp8pjv6r.js";import{codexTurnError as h}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as R}from"lucide-react";import{useEffect as C,useRef as u,useState as i}from"react";import{jsx as o,jsxs as m}from"react/jsx-runtime";function Gt({children:c}){return m("div",{className:"codex-error-message",role:"alert",children:[o(R,{"aria-hidden":"true"}),o("div",{className:"min-w-0 flex-1",children:c})]})}function Wt({error:c,retry:r}){let{t:f}=t(),p=h(c),[l]=i(()=>r?.delaySeconds==null?null:Date.now()+r.delaySeconds*1000),[v,y]=i(r?.delaySeconds??null),[T,x]=i(!1),[g,w]=i(null),a=u(!1),E=u(!1),S=u(r?.run);S.current=r?.run;let b=u((N)=>{let s=S.current;if(a.current||s===void 0)return;a.current=!0,x(!0),w(null),s(N).catch((n)=>{E.current=!0,a.current=!1,y(null),x(!1),w(n instanceof Error?n.message:String(n))})}),d=r!==void 0&&p.retryable;return C(()=>{if(!d||l===null)return;let s=setInterval(()=>{if(E.current||a.current)return;let n=Math.max(0,Math.ceil((l-Date.now())/1000));if(y(n),n===0)b.current("automatic")},1000);return()=>clearInterval(s)},[l,d]),m(Gt,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:p.message}),d&&o(e,{variant:"outline",size:"sm",disabled:T,onClick:()=>b.current("manual"),children:v===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:v})})]}),g!==null&&o("div",{className:"text-muted-foreground mt-2 text-sm",children:g})]})}
2
- export{Gt,Wt};
1
+ import{e}from"./chunk-6kn920c5.js";import{t}from"./chunk-f3e3ged2.js";import{codexTurnError as h}from"@nyssance/codex-acp-v2/client";import{AlertCircleIcon as R}from"lucide-react";import{useEffect as C,useRef as u,useState as i}from"react";import{jsx as o,jsxs as m}from"react/jsx-runtime";function Gt({children:c}){return m("div",{className:"codex-error-message",role:"alert",children:[o(R,{"aria-hidden":"true"}),o("div",{className:"min-w-0 flex-1",children:c})]})}function jt({error:c,retry:r}){let{t:f}=t(),p=h(c),[l]=i(()=>r?.delaySeconds==null?null:Date.now()+r.delaySeconds*1000),[v,y]=i(r?.delaySeconds??null),[T,x]=i(!1),[g,w]=i(null),a=u(!1),E=u(!1),S=u(r?.run);S.current=r?.run;let b=u((N)=>{let s=S.current;if(a.current||s===void 0)return;a.current=!0,x(!0),w(null),s(N).catch((n)=>{E.current=!0,a.current=!1,y(null),x(!1),w(n instanceof Error?n.message:String(n))})}),d=r!==void 0&&p.retryable;return C(()=>{if(!d||l===null)return;let s=setInterval(()=>{if(E.current||a.current)return;let n=Math.max(0,Math.ceil((l-Date.now())/1000));if(y(n),n===0)b.current("automatic")},1000);return()=>clearInterval(s)},[l,d]),m(Gt,{children:[m("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o("div",{className:"min-w-0 flex-1 whitespace-pre-wrap",children:p.message}),d&&o(e,{variant:"outline",size:"sm",disabled:T,onClick:()=>b.current("manual"),children:v===null?f("timeline.retry"):f("timeline.retryCountdown",{seconds:v})})]}),g!==null&&o("div",{className:"text-muted-foreground mt-2 text-sm",children:g})]})}
2
+ export{Gt,jt};
@@ -1,4 +1,4 @@
1
- import{po}from"./chunk-sr5rcdza.js";import{t}from"./chunk-dp8pjv6r.js";import{qn,Vn}from"./chunk-460phps1.js";import{_}from"./chunk-g7p46jq1.js";import{G}from"./chunk-m6rrt94g.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var $n=p(function({item:s,messageTime:c}){let l=t(),o=Vn(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
1
+ import{go}from"./chunk-8a1j96d1.js";import{t}from"./chunk-f3e3ged2.js";import{Wn,Gn}from"./chunk-58bs5f2z.js";import{_}from"./chunk-kfs19vc5.js";import{W}from"./chunk-753s76b6.js";import{isEmbeddedResource as g,isImage as d,isResourceLink as f,isText as x}from"@nyssance/codex-acp-v2/client";import{memo as p}from"react";import{jsx as r,jsxs as h}from"react/jsx-runtime";var Vn=p(function({item:s,messageTime:c}){let l=t(),o=Gn(s._meta),m=o?o.map((e)=>e.question===void 0?e.text:`${e.question}
2
2
  ${e.text}`).join(`
3
- `):G(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=qn(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(_,{block:e},`${s.id}:${n}`))}),r(po,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
4
- export{$n};
3
+ `):W(s),a=s.content.filter(d),i=s.content.filter((e)=>f(e)||g(e)),u=o??s.content.filter(x).map((e)=>{let n=Wn(e._meta);return n?{question:n.question,text:n.answer}:{text:e.text}});if(m.length===0&&a.length===0&&i.length===0)return null;return h("div",{className:"group/codex-user flex min-w-0 flex-col items-end gap-2","data-content-search-unit-key":s.id,children:[i.length>0&&r("div",{className:"codex-user-mentions",children:i.map((e,n)=>r(_,{block:e},`${s.id}:${n}`))}),r(go,{host:l,message:s,text:m,textParts:u.some((e)=>("question"in e))?u:void 0,images:a,mentions:[],messageTime:c})]})});
4
+ export{Vn};
@@ -1,2 +1,2 @@
1
- import{Uo,$o}from"./chunk-qah4fs3d.js";import{cn as l}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function h({value:i,onValueChange:n,options:o,itemClassName:d}){return t(Uo,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a($o,{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))})}
1
+ import{$o,qo}from"./chunk-zw3h5xgf.js";import{cn as l}from"cn";import{jsx as t,jsxs as a}from"react/jsx-runtime";function h({value:i,onValueChange:n,options:o,itemClassName:d}){return t($o,{value:i,onValueChange:(e)=>n(String(e)),children:o.map((e)=>a(qo,{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
2
  export{h};
@@ -1,2 +1,2 @@
1
- function Br(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function Ao(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(Br(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Lo(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function zr(t){return[...t].filter((e)=>!s(e)).join("")}function br(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function ct(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=zr(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-br(e,o)),r=Math.max(0,i-br(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
2
- export{Br,Ao,Lo,zr,br,ct};
1
+ function zr(t,e){if(t.type||!e.type)return t;let o=e.type.split("/")[1],i=o!==void 0&&o!==""?`pasted-${Date.now()}.${o==="jpeg"?"jpg":o}`:"";return new File([t],t.name||i||`pasted-${Date.now()}`,{type:e.type})}function Lo(t){let e=[],o=!1;for(let i of t){if(i.kind!=="file")continue;let n=i.getAsFile();if(!n)continue;if(!(n.type||i.type).startsWith("image/")){o=!0;continue}e.push(zr(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Do(t){return[...t].some((e)=>e.kind==="string")}function s(t){let e=t.codePointAt(0);return e<32&&e!==9&&e!==10&&e!==13||e===127}function Ur(t){return[...t].filter((e)=>!s(e)).join("")}function wr(t,e){let o=0;for(let i=0;i<e;i++){let n=t.charCodeAt(i);if(n>=0&&n<=8||n===11||n===12||n>=14&&n<=31||n===127)o++}return o}function ct(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=Ur(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-wr(e,o)),r=Math.max(0,i-wr(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
2
+ export{zr,Lo,Do,Ur,wr,ct};
@@ -1,7 +1,7 @@
1
- import{Jn}from"./chunk-jn0q0b7k.js";import{Ot,to}from"./chunk-88xay4pa.js";import{Ht}from"./chunk-30wqrz8v.js";import{decodeHTMLAttribute as C,decodeHTMLStrict as R}from"entities";import oe from"katex";import{CheckIcon as z,ChevronLeftIcon as ae,ChevronRightIcon as se,CopyIcon as ie,DownloadIcon as ce,FileIcon as de,LinkIcon as le,MailIcon as ue,XIcon as me}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as ge,createElement as U,memo as B,startTransition as fe,useContext as he,useEffect as p,useLayoutEffect as D,useMemo as X,useRef as b,useState as h}from"react";import{jsx as a,jsxs as f,Fragment as te}from"react/jsx-runtime";var G=ge(null);function y(){let e=he(G);if(e===null)throw Error("Markdown host is missing");return e}var pe=80,A=/\[([^\]\n]+)\]\(([^)\n]+)$/,ke=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,we=/\uE200[^\uE201]*$/,be=4,xe=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 N(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function J(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Te(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)&&!J(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function ve(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!N(e,t)&&!J(e,t,n))return t;return-1}function Ce(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function ye(e){return Ce(e,"```")%2===1}function V(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]==="`"&&!N(e,t))n+=1;t+=1}return n%2===1}function Ne(e){return e.endsWith(`
1
+ import{to}from"./chunk-hwfwd04r.js";import{Ot,oo}from"./chunk-fpx4ng0t.js";import{Ht}from"./chunk-7avpdkmf.js";import{decodeHTMLAttribute as C,decodeHTMLStrict as R}from"entities";import oe from"katex";import{CheckIcon as z,ChevronLeftIcon as ae,ChevronRightIcon as se,CopyIcon as ie,DownloadIcon as ce,FileIcon as de,LinkIcon as le,MailIcon as ue,XIcon as me}from"lucide-react";import"katex/dist/katex.min.css";import{createContext as ge,createElement as U,memo as B,startTransition as fe,useContext as he,useEffect as k,useLayoutEffect as D,useMemo as X,useRef as w,useState as p}from"react";import{jsx as a,jsxs as f,Fragment as te}from"react/jsx-runtime";var G=ge(null);function y(){let e=he(G);if(e===null)throw Error("Markdown host is missing");return e}var pe=80,A=/\[([^\]\n]+)\]\(([^)\n]+)$/,ke=/(^|\n)[^\S\n]*!\[[^\]\n]*(?:\](?:\([^\n]*)?)?\s*$/,we=/\uE200[^\uE201]*$/,be=4,xe=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 N(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function J(e,n,t){if(t.length!==1)return!1;return e[n-1]===t||e[n+1]===t}function Te(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)&&!J(e,r,n)){t+=1,r+=n.length;continue}r+=1}return t}function ve(e,n){for(let t=e.length-n.length;t>=0;t-=1)if(e.startsWith(n,t)&&!N(e,t)&&!J(e,t,n))return t;return-1}function Ce(e,n){let t=0;for(let r=0;r<=e.length-n.length;){if(e.startsWith(n,r)&&!N(e,r)){t+=1,r+=n.length;continue}r+=1}return t}function ye(e){return Ce(e,"```")%2===1}function V(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]==="`"&&!N(e,t))n+=1;t+=1}return n%2===1}function Ne(e){return e.endsWith(`
2
2
  `)?`${e}\`\`\``:`${e}
3
3
  \`\`\``}function H(e,n){if(!e.includes(n)||Te(e,n)%2===0)return e;let t=ve(e,n);if(t<0)return e;let r=e.slice(t+n.length);if(r.length===0||/^\s/.test(r)||r.includes(`
4
4
  `)||V(r))return e;return`${e}${n}`}function Me(e){return e.startsWith("/")&&!e.startsWith("//")||/^[A-Za-z]:[\\/]/.test(e)||/^\\\\[^\\]+\\[^\\]+/.test(e)||/^\/\/[^/]+\/[^/]+/.test(e)}function Z(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 Ee(e){let{path:n,line:t,column:r,endLine:o,endColumn:s}=Z(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 u=d.toLowerCase();if(u.length>be&&!xe.has(u))return!1}return!0}function Le(e){let{path:n}=Z(e);if(Me(n))return!0;try{return new URL(n).protocol==="file:"}catch{return!1}}function Ie(e){let n=e.match(A);if(n===null)return e;let t=n[2];if(t===void 0)throw Error("Codex streaming link target is missing");return Ee(t)||Le(t)?e.replace(A,"$1"):`${e})`}function $e(e){let n=e.replace(we,"");if(n.length===0||n.includes("`")&&V(n))return{isCodeFenceOpen:!1,markdown:n};if(n.includes("```")&&ye(n))return{isCodeFenceOpen:!0,markdown:Ne(n)};if(n.includes("!["))n=n.replace(ke,(t,r)=>r);if(n.includes("]("))n=Ie(n);return n=H(n,"**"),n=H(n,"*"),{isCodeFenceOpen:!1,markdown:n}}function Re(e){return e?.type==="paragraph"&&"tokens"in e&&Array.isArray(e.tokens)}function _(e){return Re(e)&&e.tokens.length===1&&e.tokens[0]?.type==="image"}function Y(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))Y(t.tokens);if(!_(t))continue;let r=[...t.tokens],o=n+1,s=o;for(;;){while(e[o]?.type==="space")o+=1;let i=e[o];if(!_(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 O(e){return{type:"text",raw:e,text:e}}function Pe(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function I(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?[O(s)]:[O(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?Pe(o):o);I(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))I(n.tokens)}}function Se(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function Fe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function Ae(e){let n=Fe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function He({href:e}){let n=X(()=>Ae(e),[e]),[t,r]=h(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ue:o?de:le;return f("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 _e({children:e,href:n,title:t}){let r=y();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:t,onClick:(o)=>Se(o,n,r),children:f("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(He,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Oe({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=y(),i=b(null),[c,d]=h(null),[u,T]=h(null),[M,k]=h(!1);if(p(()=>{let g=Jn(d,T);return i.current=g,()=>{g.dispose(),i.current=null}},[]),p(()=>{let g=i.current;if(g===null)throw Error("Code highlighter is not mounted");g.update(e,n)},[e,n]),u!==null)throw u;let w=c!==null&&c.code===e&&c.language===n?c.html:null,l=async()=>{k(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),k(!0),window.setTimeout(()=>k(!1),2000)}catch(g){s?.(g)}};return f("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[f("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 l(),children:M?a(z,{}):a(ie,{})})})]}),a("div",{className:"codex-markdown-code-container",dir:"ltr",children:a("code",{className:"codex-markdown-code-content hljs",...w===null?{children:e}:{dangerouslySetInnerHTML:{__html:w}}})})]})}function je({code:e,language:n}){return y().preview?a("span",{children:e}):a(We,{code:e,language:n})}function We({code:e,language:n}){let t=b(null),[r,o]=h(!1);if(p(()=>{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(Oe,{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 qe(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 Ke({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 f("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),f("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(ae,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(ce,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(se,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(me,{})})]})]})}function ze(e){return y().preview?a(te,{children:e.alt}):a(Ue,{...e})}function Ue({src:e,alt:n,title:t,allowWide:r}){let o=b(null),[s,i]=h();p(()=>{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 f(te,{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(qe(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(Ke,{preview:s,setPreview:i})})]})}function Be({value:e,display:n}){let t=b(null);return D(()=>{if(t.current===null)throw Error("Codex math root is not mounted");oe.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 De=150,v=null;function j(e,n){let t=v;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),u=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,u-r)},`${n}:${t.generation}:${c.start}`)),i=u}if(i<o)s.push(e.slice(i-r));return s}function Q(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 W(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,pe)}function Xe(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}:${W(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return W(e.text);default:return""}}function ee(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${Q(Xe(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ee(r),s=t.get(o)??0;return t.set(o,s+1),ne(r,`${n}-${o}-${s}`)})}function Ge(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return f("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?f("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(z,{}):null]}):null,m(t,n)]},n)}function Je(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 q(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return U(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 Ve(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:f("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>q(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=Q(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)=>q(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=C(e.href);if(!Ht(r))return null;return a(ze,{src:r,alt:R(e.text),title:e.title==null?void 0:C(e.title),allowWide:t},n)}function ne(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 U(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((i)=>i.type!=="space"&&i.type!=="br"),o=r.length>0&&r.every((i)=>i.type==="image"),s=o&&r.length>1;return a("p",{className:`codex-markdown-paragraph${o?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${s?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":s?"true":void 0,"data-wide-markdown-block":o?"true":void 0,"data-wide-markdown-block-kind":o?"image":void 0,children:o?r.map((i,c)=>K(i,`${n}-image-${c}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?j(R(t.text),n):m(t.tokens,n)}case"escape":return j(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=C(t.href);return Ht(o)?a(_e,{href:o,title:t.title==null?void 0:C(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(je,{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 Je(e,n);case"list_item":return Ge(e,n);case"table":return Ve(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(Be,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function x(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?R(n.text):n.tokens.map(x).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(x).join("");case"list":return e.items.map(x).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(x).join("")).join("")).join("")}default:return""}}function Ze({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=v;try{return v={cursor:t,runs:r,generation:o},ne(e,n)}finally{v=s}}var Ye=B(function({result:n}){let{text:t,isStreaming:r}=n,o=X(()=>{let l=n.tokens;if(n.source.includes("!["))Y(l);I(l);let g=new Map,P=0;return l.map((E)=>{let L=ee(E),S=g.get(L)??0;g.set(L,S+1);let F=x(E),re={token:E,tokenKey:`root-${L}-${S}`,offset:P,visibleText:F};return P+=F.length,re})},[n]),s=o.map((l)=>l.visibleText).join(""),i=b({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),u=d?c.visibleText.length:0,T=performance.now(),M=r&&d?c.runs.filter((l)=>T-l.firstSeenAtMs<De):[],k=c.generation+(d?0:1),w={text:t,visibleText:s,runs:M.filter((l)=>l.start<s.length).map((l)=>({...l,end:Math.min(l.end,s.length)})),generation:k};if(r&&s.length>u)w.runs.push({start:u,end:s.length,firstSeenAtMs:T});return D(()=>{i.current=w}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((l)=>a(Ze,{token:l.token,tokenKey:l.tokenKey,offset:l.offset,runs:w.runs,generation:k},l.tokenKey))})}),Qe=B(function({text:n,isStreaming:t}){let r=b(null),[o,s]=h(()=>Ot(n,t)),[i,c]=h(null);if(p(()=>{let d=to((u)=>{fe(()=>s(u))},c);return r.current=d,()=>{d.dispose(),r.current=null}},[]),p(()=>{let d=r.current;if(d===null)throw Error("Markdown parser is not mounted");let u=t?$e(n).markdown:n;d.update({source:u,text:n,isStreaming:t})},[t,n]),i!==null)throw i;return o===null?a("div",{"data-markdown-pending":!0}):a(Ye,{result:o})});function jn({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=h(e);return p(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(G.Provider,{value:t,children:a(Qe,{text:r?o:e,isStreaming:r})})}
7
- export{jn};
5
+ `),t.raw=e.slice(n,s).map((i)=>i.raw).join(""),e.splice(n+1,s-n-1)}}function O(e){return{type:"text",raw:e,text:e}}function Pe(e){return{type:"paragraph",raw:e.raw,text:e.text,tokens:e.tokens??[e]}}function I(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?[O(s)]:[O(i),...o.tokens]}}if(t.loose)t.tokens=t.tokens.map((o)=>o.type==="text"?Pe(o):o);I(t.tokens)}if("tokens"in n&&Array.isArray(n.tokens))I(n.tokens)}}function Se(e,n,t){e.preventDefault(),e.stopPropagation(),t.openLink(n)}function Fe(e){try{let n=new URL(e);return n.protocol!=="http:"&&n.protocol!=="https:"?null:`${n.origin}/favicon.ico`}catch{return null}}function Ae(e){let n=Fe(e);return n===null?[]:[n,`https://www.google.com/s2/favicons?domain=${new URL(e).origin}&sz=32`]}function He({href:e}){let n=X(()=>Ae(e),[e]),[t,r]=p(),o=n.length===0&&!/^[a-z][a-z0-9+.-]*:/i.test(e),s=e.toLowerCase().startsWith("mailto:")?ue:o?de:le;return f("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 _e({children:e,href:n,title:t}){let r=y();if(r.preview)return a("span",{children:e});return a("a",{className:"codex-markdown-link","data-inline-mention-interactive":"",href:n,title:t,onClick:(o)=>Se(o,n,r),children:f("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(He,{href:n})}),a("span",{className:"codex-markdown-link-label",children:e})]})})}function Oe({code:e,language:n}){let{theme:t,copyLabel:r,copyText:o,onCopyError:s}=y(),i=w(null),[c,d]=p(null),[u,h]=p(null),[M,b]=p(!1);if(k(()=>{let g=to(d,h);return i.current=g,()=>{g.dispose(),i.current=null}},[]),k(()=>{let g=i.current;if(g===null)throw Error("Code highlighter is not mounted");g.update(e,n)},[e,n]),u!==null)throw u;let x=c!==null&&c.code===e&&c.language===n?c.html:null,l=async()=>{b(!1);try{await(o?o(e):navigator.clipboard.writeText(e)),b(!0),window.setTimeout(()=>b(!1),2000)}catch(g){s?.(g)}};return f("div",{className:"codex-markdown-code-block","data-markdown-copy":"code-block","data-markdown-copy-text":e,"data-theme":t==="dark"?"dark":"light",children:[f("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 l(),children:M?a(z,{}):a(ie,{})})})]}),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 je({code:e,language:n}){return y().preview?a("span",{children:e}):a(We,{code:e,language:n})}function We({code:e,language:n}){let t=w(null),[r,o]=p(!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(Oe,{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 qe(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 Ke({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 f("div",{className:"codex-markdown-image-preview",children:[a("img",{src:t.src,alt:t.alt}),f("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(ae,{})}),a("a",{href:t.src,download:!0,"aria-label":"Download image",children:a(ce,{})}),a("button",{type:"button","aria-label":"Next image",disabled:e.index===e.images.length-1,onClick:()=>n({...e,index:e.index+1}),children:a(se,{})}),a("button",{type:"button","aria-label":"Close image preview",onClick:()=>n(void 0),children:a(me,{})})]})]})}function ze(e){return y().preview?a(te,{children:e.alt}):a(Ue,{...e})}function Ue({src:e,alt:n,title:t,allowWide:r}){let o=w(null),[s,i]=p();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 f(te,{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(qe(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(Ke,{preview:s,setPreview:i})})]})}function Be({value:e,display:n}){let t=w(null);return D(()=>{if(t.current===null)throw Error("Codex math root is not mounted");oe.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 De=150,v=null;function j(e,n){let t=v;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),u=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,u-r)},`${n}:${t.generation}:${c.start}`)),i=u}if(i<o)s.push(e.slice(i-r));return s}function Q(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 W(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,pe)}function Xe(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}:${W(n.text)}`}case"html":case"space":case"br":case"hr":case"def":return e.raw;case"math":return W(e.text);default:return""}}function ee(e){return`${e.type==="math"?`math-${e.display?"block":"inline"}`:e.type}-${Q(Xe(e))}`}function m(e,n){let t=new Map;return e.map((r)=>{let o=ee(r),s=t.get(o)??0;return t.set(o,s+1),ne(r,`${n}-${o}-${s}`)})}function Ge(e,n){let t=e.task?e.tokens.filter((r)=>r.type!=="checkbox"):e.tokens;return f("li",{className:`codex-markdown-list-item${e.task?"codex-markdown-task-list-item":""}`,children:[e.task?f("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(z,{}):null]}):null,m(t,n)]},n)}function Je(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 q(e,n,t){let r=t?"th":"td",o=/^\d+$/.test(e.text);return U(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 Ve(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:f("table",{className:"codex-markdown-table",children:[a("thead",{children:a("tr",{className:"codex-markdown-table-row",children:e.header.map((r,o)=>q(r,`${n}-header-${o}`,!0))})}),a("tbody",{className:"codex-markdown-table-body",children:e.rows.map((r)=>{let o=Q(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)=>q(c,`${i}-cell-${d}`,!1))},i)})})]})})})},n)}function K(e,n,t){let r=C(e.href);if(!Ht(r))return null;return a(ze,{src:r,alt:R(e.text),title:e.title==null?void 0:C(e.title),allowWide:t},n)}function ne(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 U(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((i)=>i.type!=="space"&&i.type!=="br"),o=r.length>0&&r.every((i)=>i.type==="image"),s=o&&r.length>1;return a("p",{className:`codex-markdown-paragraph${o?"codex-markdown-media-paragraph codex-markdown-media-wide-block":""}${s?"codex-markdown-media-grid-paragraph":""}`,"data-markdown-image-grid":s?"true":void 0,"data-wide-markdown-block":o?"true":void 0,"data-wide-markdown-block-kind":o?"image":void 0,children:o?r.map((i,c)=>K(i,`${n}-image-${c}`,!0)):m(t.tokens,n)},n)}case"text":{let t=e;return t.tokens===void 0?j(R(t.text),n):m(t.tokens,n)}case"escape":return j(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=C(t.href);return Ht(o)?a(_e,{href:o,title:t.title==null?void 0:C(t.title),children:r},n):a("span",{children:r},n)}case"image":return K(e,n,!1);case"code":{let t=e;return a(je,{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 Je(e,n);case"list_item":return Ge(e,n);case"table":return Ve(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(Be,{value:t.text,display:t.display},n)}default:throw Error(`Unsupported Codex Markdown token: ${JSON.stringify(e)}`)}}function T(e){switch(e.type){case"text":{let n=e;return n.tokens===void 0?R(n.text):n.tokens.map(T).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(T).join("");case"list":return e.items.map(T).join("");case"table":{let n=e;return[n.header,...n.rows].map((t)=>t.map((r)=>r.tokens.map(T).join("")).join("")).join("")}default:return""}}function Ze({token:e,tokenKey:n,offset:t,runs:r,generation:o}){let s=v;try{return v={cursor:t,runs:r,generation:o},ne(e,n)}finally{v=s}}var Ye=B(function({result:n}){let{text:t,isStreaming:r}=n,o=X(()=>{let l=n.tokens;if(n.source.includes("!["))Y(l);I(l);let g=new Map,P=0;return l.map((E)=>{let L=ee(E),S=g.get(L)??0;g.set(L,S+1);let F=T(E),re={token:E,tokenKey:`root-${L}-${S}`,offset:P,visibleText:F};return P+=F.length,re})},[n]),s=o.map((l)=>l.visibleText).join(""),i=w({text:"",visibleText:"",runs:[],generation:0}),c=i.current,d=t.startsWith(c.text)||s.startsWith(c.visibleText),u=d?c.visibleText.length:0,h=performance.now(),M=r&&d?c.runs.filter((l)=>h-l.firstSeenAtMs<De):[],b=c.generation+(d?0:1),x={text:t,visibleText:s,runs:M.filter((l)=>l.start<s.length).map((l)=>({...l,end:Math.min(l.end,s.length)})),generation:b};if(r&&s.length>u)x.runs.push({start:u,end:s.length,firstSeenAtMs:h});return D(()=>{i.current=x}),a("div",{dir:"auto",className:"codex-markdown-content codex-markdown-root","data-streaming":r?"true":void 0,children:o.map((l)=>a(Ze,{token:l.token,tokenKey:l.tokenKey,offset:l.offset,runs:x.runs,generation:b},l.tokenKey))})}),Qe=B(function({text:n,isStreaming:t}){let r=w(null),[o,s]=p(()=>Ot(n,t)),i=w(o!==null),[c,d]=p(null);if(k(()=>{let u=oo((h)=>{if(!i.current)i.current=!0,s(h);else fe(()=>s(h))},d);return r.current=u,()=>{u.dispose(),r.current=null}},[]),k(()=>{let u=r.current;if(u===null)throw Error("Markdown parser is not mounted");let h=t?$e(n).markdown:n;u.update({source:h,text:n,isStreaming:t})},[t,n]),c!==null)throw c;return o===null?a("div",{"data-markdown-pending":!0}):a(Ye,{result:o})});function Qn({text:e,streaming:n,host:t}){let r=n===!0,[o,s]=p(e);return k(()=>{if(o===e)return;if(!r){s(e);return}let i=requestAnimationFrame(()=>s(e));return()=>cancelAnimationFrame(i)},[o,r,e]),a(G.Provider,{value:t,children:a(Qe,{text:r?o:e,isStreaming:r})})}
7
+ export{Qn};
@@ -1,2 +1,2 @@
1
- import{Po}from"./chunk-tjgq4882.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Io(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return Po(a,r)}
2
- export{Io};
1
+ import{No}from"./chunk-c9k66x5g.js";import{isPlanItems as o}from"@nyssance/codex-acp-v2/client";function Po(s,r){let n=s.items.findLast((e)=>e.kind!=="user"),a=s.items.map((e)=>{switch(e.kind){case"user":return{key:e.id,kind:"user",active:!1};case"tool":return{key:e.id,kind:"tool",active:e.status==="pending"||e.status==="in_progress"};case"compaction":return{key:e.id,kind:"compaction",active:e.status==="in_progress"};case"plan":return{key:e.id,kind:"plan",active:o(e.plan)&&e.plan.entries.some((t)=>t.status==="in_progress")};case"thought":return{key:e.id,kind:"reasoning",active:e===n};case"assistant":{let t=e._meta?.codex,i=typeof t==="object"&&t!==null&&(("messageCompleted"in t)&&t.messageCompleted===!0||("messageCompletedAt"in t)&&typeof t.messageCompletedAt==="number");return{key:e.id,kind:s.final.includes(e)?"answer":"text",active:e===n&&!i}}}});return No(a,r)}
2
+ export{Po};
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-6kn920c5.js";import{f}from"./chunk-ek06eyp4.js";import{j,I}from"./chunk-5m4605a3.js";import{k}from"./chunk-ncekagm6.js";import{useId as Q}from"react";import{jsx as r,jsxs as p,Fragment as h}from"react/jsx-runtime";function a(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function g(n){if(!a(n)||!a(n.codex))return[];let s=n.codex,i=s.questions;if(s.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>a(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((l)=>typeof l==="string"))))return[];return i}function Kt(n,s){return JSON.stringify(["request_user_input_async",n,s])}function wo(n){return{selected:n.options?.length?0:null,text:""}}function Qt(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function ko(n){return`<send_user_message_question_reply>
1
+ import{e}from"./chunk-6kn920c5.js";import{f}from"./chunk-ek06eyp4.js";import{j,P}from"./chunk-ana59z25.js";import{k}from"./chunk-ncekagm6.js";import{useId as Q}from"react";import{jsx as r,jsxs as p,Fragment as h}from"react/jsx-runtime";function a(n){return n!==null&&typeof n==="object"&&!Array.isArray(n)}function g(n){if(!a(n)||!a(n.codex))return[];let s=n.codex,i=s.questions;if(s.delivery!=="async"||!Array.isArray(i))return[];if(!i.every((t)=>a(t)&&typeof t.title==="string"&&t.title.trim().length>0&&(t.options===null||Array.isArray(t.options)&&t.options.every((l)=>typeof l==="string"))))return[];return i}function Qt(n,s){return JSON.stringify(["request_user_input_async",n,s])}function ko(n){return{selected:n.options?.length?0:null,text:""}}function Xt(n,s){return s.selected===null?s.text:n.options?.[s.selected]??""}function Co(n){return`<send_user_message_question_reply>
2
2
  ${JSON.stringify([n])}
3
- </send_user_message_question_reply>`}function Xt(n){if(!a(n)||!a(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>a(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>a(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:l,answer:c})=>({questionItemId:t,question:l,answer:c}))}function Co({question:n,draft:s,status:i,answer:t,error:l,onChange:c,onSubmit:x,onSkip:b,t:o}){let y=Q(),d=i==="pending",w=i==="answered"||i==="skipped";return p("section",{"aria-labelledby":`${y}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[r("h3",{id:`${y}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),w?r("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:o("asyncQuestion.skipped")}):p(h,{children:[(n.options?.length??0)>0&&p(j,{"aria-labelledby":`${y}-title`,disabled:!d,value:s.selected===null?"other":String(s.selected),onValueChange:(u)=>c({...s,selected:u==="other"?null:Number(u)}),children:[n.options?.map((u,m)=>p(f,{className:"flex items-start gap-2 text-sm",children:[r(I,{value:String(m)}),r("span",{className:"whitespace-pre-wrap",children:u})]},m)),p(f,{className:"flex items-center gap-2 text-sm",children:[r(I,{value:"other"}),o("asyncQuestion.other")]})]}),r(k,{"aria-label":o("asyncQuestion.answer"),placeholder:o("asyncQuestion.answer"),value:s.text,readOnly:!d,onChange:(u)=>c({selected:null,text:u.target.value})}),l&&r("p",{role:"alert",className:"text-destructive text-sm",children:l}),p("div",{className:"flex flex-wrap items-center gap-2",children:[r(e,{size:"sm",disabled:!d||Qt(n,s).trim().length===0,onClick:x,children:o(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),r(e,{size:"sm",variant:"ghost",disabled:!d,onClick:b,children:o("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&r("span",{role:"status",className:"text-muted-foreground text-xs",children:o(`asyncQuestion.${i}`)})]})]})]})}
4
- export{g,Kt,wo,Qt,ko,Xt,Co};
3
+ </send_user_message_question_reply>`}function Yt(n){if(!a(n)||!a(n.codex))return[];let s=n.codex;return(Array.isArray(s.questionReplyParts)?s.questionReplyParts.map((t)=>a(t)?{...t,answer:t.text}:t):[s.questionReply]).filter((t)=>a(t)&&typeof t.questionItemId==="string"&&typeof t.question==="string"&&typeof t.answer==="string").map(({questionItemId:t,question:l,answer:c})=>({questionItemId:t,question:l,answer:c}))}function To({question:n,draft:s,status:i,answer:t,error:l,onChange:c,onSubmit:x,onSkip:b,t:o}){let y=Q(),d=i==="pending",w=i==="answered"||i==="skipped";return p("section",{"aria-labelledby":`${y}-title`,className:"border-border bg-card text-card-foreground flex min-w-0 flex-col gap-3 rounded-xl border p-4",children:[r("h3",{id:`${y}-title`,className:"text-sm font-medium whitespace-pre-wrap",children:n.title}),w?r("p",{className:"text-sm whitespace-pre-wrap",children:i==="answered"?t:o("asyncQuestion.skipped")}):p(h,{children:[(n.options?.length??0)>0&&p(j,{"aria-labelledby":`${y}-title`,disabled:!d,value:s.selected===null?"other":String(s.selected),onValueChange:(u)=>c({...s,selected:u==="other"?null:Number(u)}),children:[n.options?.map((u,m)=>p(f,{className:"flex items-start gap-2 text-sm",children:[r(P,{value:String(m)}),r("span",{className:"whitespace-pre-wrap",children:u})]},m)),p(f,{className:"flex items-center gap-2 text-sm",children:[r(P,{value:"other"}),o("asyncQuestion.other")]})]}),r(k,{"aria-label":o("asyncQuestion.answer"),placeholder:o("asyncQuestion.answer"),value:s.text,readOnly:!d,onChange:(u)=>c({selected:null,text:u.target.value})}),l&&r("p",{role:"alert",className:"text-destructive text-sm",children:l}),p("div",{className:"flex flex-wrap items-center gap-2",children:[r(e,{size:"sm",disabled:!d||Xt(n,s).trim().length===0,onClick:x,children:o(i==="submitting"?"asyncQuestion.submitting":"asyncQuestion.submit")}),r(e,{size:"sm",variant:"ghost",disabled:!d,onClick:b,children:o("asyncQuestion.skip")}),(i==="closed"||i==="unavailable")&&r("span",{role:"status",className:"text-muted-foreground text-xs",children:o(`asyncQuestion.${i}`)})]})]})]})}
4
+ export{g,Qt,ko,Xt,Co,Yt,To};
@@ -1,5 +1,5 @@
1
- import{Ut}from"./chunk-50qyant6.js";import{t}from"./chunk-dp8pjv6r.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as f,jsxs as g,Fragment as h}from"react/jsx-runtime";function Dr(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
- `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function _r(o){let s=new Map,e=null;for(let n of o.split(`
3
- `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Hr(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?_r(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let c=u(i,r),d=n.patch?Dr(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=c.additions,l.deletions+=c.deletions,l.patch=l.patch?`${l.patch}
4
- ${d}`:d;else s.set(r,{path:r,patch:d,...c})}}return[...s.values()]}function uo({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return f(Ut,{files:Hr(o),onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[f(n,{path:i.path,className:"codex-edited-file-icon"}),f("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
- export{Dr,_r,Hr,uo};
1
+ import{$t}from"./chunk-a1kmc6t8.js";import{t}from"./chunk-f3e3ged2.js";import{isDiffEntry as p}from"@nyssance/codex-acp-v2/client";import{jsx as f,jsxs as g,Fragment as h}from"react/jsx-runtime";function _r(o,s){let e=o.split(/^(?=diff --git )/m).filter((i)=>i.length>0);if(e.length<=1)return o;return e.find((i)=>{let a=i.split(`
2
+ `,1)[0]??"";return a.endsWith(` b/${s}`)||a.endsWith(` ${s}`)||a.includes(`/${s} `)})??o}function Hr(o){let s=new Map,e=null;for(let n of o.split(`
3
+ `)){if(n.startsWith("diff --git ")){e=null;continue}if(n.startsWith("+++ ")){let i=n.slice(4).trim(),a=i==="/dev/null"?null:i.replace(/^b\//,"");if(a!==null)e={additions:0,deletions:0},s.set(a,e);continue}if(n.startsWith("--- ")){let i=n.slice(4).trim();if(i!=="/dev/null"&&e===null)e={additions:0,deletions:0},s.set(i.replace(/^a\//,""),e);continue}if(e===null)continue;if(n.startsWith("+"))e.additions+=1;else if(n.startsWith("-"))e.deletions+=1}return s}function u(o,s){let e=s.replaceAll("\\","/");for(let[n,i]of o)if(e===n||e.endsWith(`/${n}`))return i;return{additions:0,deletions:0}}function Or(o){let s=new Map;for(let e of o)for(let n of e.content){if(!p(n))continue;let i=n.patch?Hr(n.patch.text):new Map;for(let a of n.changes){let r=typeof a.path==="string"?a.path:null;if(r===null)continue;let c=u(i,r),d=n.patch?_r(n.patch.text,r):"",l=s.get(r);if(l)l.additions+=c.additions,l.deletions+=c.deletions,l.patch=l.patch?`${l.patch}
4
+ ${d}`:d;else s.set(r,{path:r,patch:d,...c})}}return[...s.values()]}function mo({items:o}){let s=t(),{openDiff:e,FileIcon:n}=s;return f($t,{files:Or(o),onOpen:e===void 0?void 0:(i)=>e({path:i.path,patch:i.patch}),renderPath:n===void 0?void 0:(i)=>g(h,{children:[f(n,{path:i.path,className:"codex-edited-file-icon"}),f("span",{className:"codex-edited-file-name",children:i.path})]})})}
5
+ export{_r,Hr,Or,mo};
@@ -1,2 +1,2 @@
1
- import{y}from"./chunk-cpk3y6ad.js";import{e}from"./chunk-6kn920c5.js";import{n}from"./chunk-ysc51tpb.js";import{Fe}from"./chunk-m28hdj8j.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Fo({data:s,sessionId:m}){let{host:a}=n(),{t:o}=a,p=y(),{text:c,status:r}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(e,{type:"button",variant:"ghost",disabled:r!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:r==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Fe(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
2
- export{Fo};
1
+ import{y}from"./chunk-vcbv30ph.js";import{e}from"./chunk-6kn920c5.js";import{n}from"./chunk-9hvbm4be.js";import{Fe}from"./chunk-gpz9f9zq.js";import{FileText as l,RotateCcw as x,X as d}from"lucide-react";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Bo({data:s,sessionId:m}){let{host:a}=n(),{t:o}=a,p=y(),{text:c,status:r}=s.pastedText;return i("div",{className:"bg-muted flex max-w-64 min-w-0 items-center gap-1 rounded-lg px-2 py-1",children:[i(e,{type:"button",variant:"ghost",disabled:r!=="ready",onClick:()=>a.openLink(s.url),className:"h-auto min-w-0 flex-1 shrink gap-2 overflow-hidden px-0 py-1",children:[t(l,{className:"size-4 shrink-0"}),i("span",{className:"min-w-0 flex-1 text-start",children:[t("span",{className:"block truncate text-xs",children:s.filename}),t("span",{className:"text-muted-foreground block text-xs",children:r==="ready"?o("composer.pastedTextCharacters",{count:c.length}):o(r==="pending"?"composer.pastedTextPending":"composer.pastedTextError")})]})]}),r==="error"&&a.writeTextAttachment&&t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRetry"),onClick:()=>Fe(m,s,a.writeTextAttachment),children:t(x,{className:"size-3"})}),t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":o("composer.pastedTextRemove"),onClick:()=>p.remove(s.id),children:t(d,{className:"size-3"})})]})}
2
+ export{Bo};
@@ -1,2 +1,2 @@
1
- import{s,r}from"./chunk-5fgakrmr.js";import{QUICK_CHATS_GROUP as m,sessionGroup as a}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function dr(c){let e=s(),o=r((t)=>t.projectContext),u=c===null?m:o?a(o,{cwd:e.projectPath(c)}).id:null,d=r((t)=>t.sessionList),l=r((t)=>t.connection),i=r((t)=>t.sessionListLoaded),n=r((t)=>t.sessionListError),f=()=>e.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(l==="ready"&&!i&&n===null)e.listSessions().catch(()=>{return})},[e,l,i,n]),{result:L(()=>{if(i&&o)return{status:"ready",sessionRows:d.filter((t)=>a(o,{...t,cwd:e.projectPath(t.cwd)}).id===u).toSorted((t,p)=>(p.updatedAt??"").localeCompare(t.updatedAt??""))};if(n!==null)return{status:"failed",error:n};return{status:"loading"}},[e,d,i,n,u,o]),retry:f}}
2
- export{dr};
1
+ import{s,r}from"./chunk-b3nt7axf.js";import{QUICK_CHATS_GROUP as m,sessionGroup as a}from"@nyssance/codex-acp-v2/client";import{useEffect as S,useMemo as L}from"react";function ur(c){let e=s(),o=r((t)=>t.projectContext),u=c===null?m:o?a(o,{cwd:e.projectPath(c)}).id:null,d=r((t)=>t.sessionList),l=r((t)=>t.connection),i=r((t)=>t.sessionListLoaded),n=r((t)=>t.sessionListError),f=()=>e.listSessions({reset:!0}).catch(()=>{return});return S(()=>{if(l==="ready"&&!i&&n===null)e.listSessions().catch(()=>{return})},[e,l,i,n]),{result:L(()=>{if(i&&o)return{status:"ready",sessionRows:d.filter((t)=>a(o,{...t,cwd:e.projectPath(t.cwd)}).id===u).toSorted((t,p)=>(p.updatedAt??"").localeCompare(t.updatedAt??""))};if(n!==null)return{status:"failed",error:n};return{status:"loading"}},[e,d,i,n,u,o]),retry:f}}
2
+ export{ur};
@@ -1,2 +1,2 @@
1
- import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function R(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function x(e,t){return e.find((n)=>n.category===t&&o(n))}function ne(e){return R(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
- export{R,x,ne};
1
+ import{isGroupedSelect as i,isSelectOption as o}from"@nyssance/codex-acp-v2/client";function E(e){return i(e.options)?e.options.flatMap((t)=>t.options):e.options}function x(e,t){return e.find((n)=>n.category===t&&o(n))}function ne(e){return E(e).find((t)=>t.value===e.currentValue)?.name??e.currentValue}
2
+ export{E,x,ne};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-6kn920c5.js";import{Cn,Tn,Sn,In,Pn,Nn}from"./chunk-vv1ghqq3.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function wn({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(Cn,{size:"sm",children:[n(Tn,{children:[a(In,{children:i("approval.needed")}),a(Sn,{children:r})]}),a(Pn,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(Nn,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
- export{wn};
1
+ import{e}from"./chunk-6kn920c5.js";import{In,Sn,Pn,Nn,Mn,Rn}from"./chunk-8712sy9s.js";import{ExternalLinkIcon as d}from"lucide-react";import{jsx as a,jsxs as n}from"react/jsx-runtime";function Cn({message:r,url:t,t:i,onOpen:l,onRespond:o}){return n(In,{size:"sm",children:[n(Sn,{children:[a(Nn,{children:i("approval.needed")}),a(Pn,{children:r})]}),a(Mn,{children:n("div",{className:"flex flex-col gap-3",children:[n(e,{variant:"outline",size:"sm",className:"w-fit",onClick:()=>void l(t),children:[a(d,{"data-icon":"inline-start"}),i("approval.openLink")]}),a("p",{className:"text-muted-foreground text-sm",children:i("approval.waitingForLink")})]})}),n(Rn,{className:"flex flex-wrap gap-2",children:[a(e,{variant:"outline",size:"sm",onClick:()=>o("decline"),children:i("actions.decline")}),a(e,{variant:"ghost",size:"sm",onClick:()=>o("cancel"),children:i("actions.cancel")})]})]})}
2
+ export{Cn};
@@ -1,2 +1,2 @@
1
- function qn(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 Vn(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{qn,Vn};
1
+ function Wn(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 Gn(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{Wn,Gn};
@@ -1,4 +1,4 @@
1
- import{an}from"./chunk-qpc4ca5y.js";import{Ao,Lo,ct}from"./chunk-96xwaa2t.js";import{Ue,y}from"./chunk-cpk3y6ad.js";import{cn as w}from"cn";import{forwardRef as A,useCallback as D,useEffect as M,useImperativeHandle as K,useRef as f}from"react";import{jsx as F}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,R=()=>!1,Yt=A(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:x,placeholder:T,bashMode:b=!1,isSendShortcut:E=L,isNewlineShortcut:I=R,...C},H)=>{let n=Ue(),l=y(),o=f(!1),u=f(!1),r=f(null),s=D(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);M(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=b&&(n?.textInput.value??"").startsWith("!"),P=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
1
+ import{ln}from"./chunk-sbyn62qx.js";import{Lo,Do,ct}from"./chunk-24b1z856.js";import{Ue,y}from"./chunk-vcbv30ph.js";import{cn as w}from"cn";import{forwardRef as A,useCallback as D,useEffect as M,useImperativeHandle as K,useRef as f}from"react";import{jsx as F}from"react/jsx-runtime";var L=(i)=>!i.shiftKey,R=()=>!1,Jt=A(({onChange:i,onCompositionStart:g,onCompositionEnd:v,className:x,placeholder:T,bashMode:b=!1,isSendShortcut:E=L,isNewlineShortcut:I=R,...C},H)=>{let n=Ue(),l=y(),o=f(!1),u=f(!1),r=f(null),s=D(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);M(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=b&&(n?.textInput.value??"").startsWith("!"),P=(e)=>{if(o.current||e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||u.current)return;if(e.key.length===1&&e.key.charCodeAt(0)<32&&e.key!==`
2
2
  `&&e.key!=="\r"&&e.key!=="\t"){e.preventDefault();return}if(c&&n){let t=e.currentTarget.selectionStart===0&&e.currentTarget.selectionEnd===0;if(e.key==="Escape"||(e.key==="Backspace"||e.key==="Delete")&&t){e.preventDefault(),n.textInput.setInput(n.textInput.value.slice(1));return}}if(e.key==="Enter"){if(I(e.nativeEvent)){e.preventDefault();let t=e.currentTarget,{selectionStart:a,selectionEnd:m,value:p}=t,d=`${p.slice(0,a)}
3
- ${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Ao(t),p=Lo(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},k=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:ct(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)ct(e.currentTarget);s(),i?.(e)}};return K(H,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),F(an,{"data-chat-input":!0,ref:r,rows:3,className:w("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",x),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=ct(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:P,onPaste:S,placeholder:T,...C,...k})});Yt.displayName="PromptInputTextarea";
4
- export{Yt};
3
+ ${p.slice(m)}`;if(n)n.textInput.setInput(d);else t.value=d;let h=a+1;t.setSelectionRange(h,h),s();return}if(E(e.nativeEvent)){e.preventDefault();let t=e.currentTarget.form;if(!t)return;let a=t.querySelector('button[type="submit"]');if(!a||a.disabled)return;t.requestSubmit(a)}}if(e.key==="Backspace"&&e.currentTarget.value===""&&l.files.length>0){e.preventDefault();let t=l.files.at(-1);if(t)l.remove(t.id)}},S=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Lo(t),p=Do(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},k=n?{value:o.current&&r.current?r.current.value:c?n.textInput.value.slice(1):n.textInput.value,onChange:(e)=>{let t=o.current?e.currentTarget.value:ct(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)ct(e.currentTarget);s(),i?.(e)}};return K(H,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),F(ln,{"data-chat-input":!0,ref:r,rows:3,className:w("field-sizing-content max-h-(--chat-input-max-height) min-h-[calc(var(--chat-input-line-height)*3)] min-w-0 flex-1 overflow-x-hidden","leading-(--chat-input-line-height)","placeholder:text-chat-input-placeholder p-0 pe-2.5","bg-chat-input-bg",x),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=ct(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),v?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,g?.(e)},onKeyDown:P,onPaste:S,placeholder:T,...C,...k})});Jt.displayName="PromptInputTextarea";
4
+ export{Jt};
@@ -1,2 +1,2 @@
1
- function mn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function Ct(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function ae(t){return t.type==="array"}function We(t){return(ae(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{mn,Ct,ae,We};
1
+ function gn(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function Ct(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function ae(t){return t.type==="array"}function Ge(t){return(ae(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{gn,Ct,ae,Ge};
@@ -0,0 +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 on({name:p,value:M,levels:h,disabled:c,onChange:P}){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}},f=100,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{on};
@@ -1,2 +1,2 @@
1
- import{g}from"./chunk-5kpcpjrb.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Fr(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function w(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function fo(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&w(e))}function T(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function M(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)M(s,e,n)}function j(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(A(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=E(e),i=e._meta?.codex,d=g(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(g(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||w(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":T(t,e,o);break;case"tool":if(T(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function ho(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Fr(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)M(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(qt),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>j(x,c,b<v,a[b-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function qt(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function G(t){return S(t.content)}function Ee(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Vt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function vo(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function xo(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function yo(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!xo(t,e[n-1],o))break;n--}return e[n]?.key}function bo(t,e,n){let o=n,s=n;while(o>0&&xo(t,e[o-1],e[o]))o--;while(s+1<e.length&&xo(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
- export{Fr,fo,ho,qt,G,Ee,Vt,vo,xo,yo,bo};
1
+ import{g}from"./chunk-36t9x2qc.js";import{codexMessageError as A,nativeTurnId as m,textOf as S,turns as _}from"@nyssance/codex-acp-v2/client";function Br(t){return t.kind==="tool"&&t.name==="mcp_startup"}function E(t){let e=t._meta?.codex;if(typeof e!=="object"||e===null)return null;let n=e.phase;return typeof n==="string"?n:null}function w(t){let e=t._meta?.codex;return typeof e==="object"&&e!==null&&e.notice===!0}function ho(t){return t.user===null&&t.items.length>0&&t.items.every((e)=>e.kind==="assistant"&&w(e))}function T(t,e,n){let o=t.work.at(-1);if(o?.kind==="activity"&&o.items.at(-1)===n){o.items.push(e);return}t.work.push({kind:"activity",key:`activity:${e.kind}:${e.id}`,items:[e]})}function M(t,e,n){if(t.kind!=="tool"){e.push(t);return}let o=n.get(t.id);if(o===void 0)throw Error(`Grouped tool is missing from the session: ${t.id}`);e.push(o);for(let s of t.children)M(s,e,n)}function j(t,e,n,o){switch(e.kind){case"user":break;case"assistant":{if(A(e)!==null){let u=m(e),f=t.errors.findIndex((p)=>u!==null&&m(p)===u);if(f===-1)t.errors.push(e);else t.errors[f]=e;break}let s=E(e),i=e._meta?.codex,d=g(e._meta).length>0||typeof i==="object"&&i!==null&&"delivery"in i&&i.delivery==="async";if(g(e._meta).length>0)t.final.push(e);else if(d)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else if(s==="final_answer")t.final.push(e);else if(s==="commentary"||w(e)||s===null&&n)t.work.push({kind:"text",key:`text:${e.id}`,item:e});else t.final.push(e);break}case"thought":T(t,e,o);break;case"tool":if(T(t,e,o),e.toolKind==="edit")t.edits.push(e);break;case"plan":t.work.push({kind:"plan",key:`plan:${e.id}`,item:e});break;case"compaction":t.work.push({kind:"compaction",key:`compaction:${e.id}`,item:e});break}}function vo(t,e=[],n=[]){let o=new Map(e.map((r)=>[r.key,r])),s=new Map(t.items.filter((r)=>r.kind==="tool").map((r)=>[r.id,r])),i={...t,items:t.items.filter((r)=>!Br(r))},d=new Map(n.map((r,a)=>[r.turnId,a])),u=[],f=[u],p,k=null;for(let r of i.items){let a=m(r),l=d.get(a??"");if(a!==null&&k!==null&&a!==k||l!==void 0&&p!==void 0&&l>p+1)u=[],f.push(u);if(u.push(r),a!==null||r.kind==="user")k=a;if(l!==void 0)p=l}return f.flatMap((r)=>_({...i,items:r})).map((r)=>{let a=r.prompt===null?[]:[r.prompt];for(let c of r.entries)M(c,a,s);let l=a[0];if(l===void 0)throw Error("A turn without items");let I=`turn:${l.kind}:${l.id}`,h=r.endedAt??Math.max(...a.map((c)=>c.at)),y=o.get(I);if(y!==void 0&&K(y.items,a)&&y.endedAt===h)return y;let x={key:I,user:r.prompt,work:[],final:[],errors:[],edits:[],startedAt:r.startedAt??l.at,endedAt:h,replayed:a.every(Vt),items:a},v=a.findLastIndex((c)=>c.kind!=="user"&&c.kind!=="compaction");return a.forEach((c,b)=>j(x,c,b<v,a[b-1])),x})}function K(t,e){return t.length===e.length&&t.every((n,o)=>n===e[o])}function Vt(t){let e=t._meta?.codex;return t.replayed||typeof e==="object"&&e!==null&&"historyReplay"in e&&e.historyReplay===!0}function W(t){return S(t.content)}function Ee(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"historyInterrupted"in n&&n.historyInterrupted===!0})}function Wt(t){return t.items.some((e)=>{let n=e._meta?.codex;return typeof n==="object"&&n!==null&&"turnInterrupted"in n&&n.turnInterrupted===!0})}function xo(t){let e=(s)=>{for(let i of t.items){let d=i._meta?.codex;if(typeof d!=="object"||d===null)continue;let u=d[s];if(typeof u==="number"&&Number.isFinite(u)&&u>=0)return u}return},n=e("workDurationMs"),o=e("turnDurationMs");return{durationMs:n??o,durationKind:n===void 0&&o!==void 0?"total":"work",startedAt:e("workStartedAt")}}function yo(t,e,n){if(n?.user==null)return!1;let o=e.items.map(m).find((i)=>i!==null),s=m(n.user);if(o!==void 0&&s!==null)return o===s;return!e.items.some((i)=>{let d=i._meta?.codex;return typeof d==="object"&&d!==null&&"turnCompletedAt"in d&&typeof d.turnCompletedAt==="number"})&&t.state!=="idle"&&(n.user.echo==="pending"||n.user.echo==="acknowledged")&&e.user!==null&&t.turnEndedAt[e.user.id]===void 0&&e.errors.length===0}function bo(t,e){if(t.state==="idle")return;let n=e.length-1;while(n>0){let o=e[n];if(o.items.some((s)=>s.kind!=="user"))break;if(!yo(t,e[n-1],o))break;n--}return e[n]?.key}function wo(t,e,n){let o=n,s=n;while(o>0&&yo(t,e[o-1],e[o]))o--;while(s+1<e.length&&yo(t,e[s],e[s+1]))s++;let i=e.slice(o,s+1),d=i.findLast((u)=>u.items.some((f)=>f.kind!=="user"))??i[0];return{continued:e[n]!==d,items:i.flatMap((u)=>u.items),edits:i.flatMap((u)=>u.edits),startedAt:i[0].startedAt}}
2
+ export{Br,ho,vo,Vt,W,Ee,Wt,xo,yo,bo,wo};
@@ -0,0 +1,2 @@
1
+ import{e}from"./chunk-6kn920c5.js";import{H,O,N,F,te,M,_e,He,Oe,rn,R}from"./chunk-zw3h5xgf.js";import{$e}from"./chunk-ak0k5vg6.js";import{ye,be,we}from"./chunk-hw99hhjf.js";import{on}from"./chunk-6nyba0m4.js";import{h}from"./chunk-1k03fpcj.js";import{cn as m}from"cn";import{ArrowUpRight as se,ChevronUp as P,Loader2Icon as U,Zap as W}from"lucide-react";import{Fragment as ie,useState as Z}from"react";import{jsx as n,jsxs as s,Fragment as p}from"react/jsx-runtime";function Uo({value:c,onChange:q,models:v,modelGroups:C,compactCatalog:l,effortPresentation:I="slider",unavailableEffort:D,providerMenu:w,header:g,className:A,condensed:T,stripLabelPrefix:V,showDescription:J,showModelList:K=!0,loading:Q,switching:L,isLoading:X,effortConfig:i,booleanOptions:f,onBooleanChange:z,selectOptions:Y=[],t:u,...r}){let[E,ee]=Z(!1),[ne,ae]=Z(!1),d=f?.find((a)=>a.id==="fast_mode"),_=l?f?.filter((a)=>a!==d):f,j=(a)=>V&&a.startsWith(V)?a.slice(V.length):a;if(Q)return n("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:s(e,{variant:"ghost",disabled:!0,className:m("h-7 min-w-0 shrink gap-1.5 rounded-md px-2 text-xs font-normal",A),children:[n(U,{className:"size-3 animate-spin"}),n("span",{className:"text-muted-foreground truncate",children:u("model.loadingModels")})]})});return s("div",{className:"inline-flex min-w-0 items-center gap-1.5",children:[w&&s(H,{open:E,onOpenChange:ee,children:[s(ye,{children:[n(be,{render:n(O,{render:s(e,{"data-testid":"provider-trigger",variant:"ghost",disabled:r.disabled,className:m("h-7 shrink-0 gap-1 rounded-md px-1.5","hover:bg-accent"),children:[w.icon,n(P,{className:"size-2.5 shrink-0 opacity-60"})]})})}),n(we,{children:u("model.switchProvider")})]}),s(N,{side:"top",align:"end",sideOffset:4,className:"z-100 min-w-[10rem]",children:[w.groups.map((a,t)=>s(ie,{children:[t>0&&a.length>0&&n(R,{}),n(h,{value:w.value,onValueChange:w.onChange,options:a})]},t)),w.moreAction&&s(p,{children:[n(R,{}),s(M,{onClick:w.moreAction,className:"whitespace-nowrap",children:[n("span",{className:"min-w-0 flex-1 truncate",children:u("model.moreModels")}),n(se,{className:"size-4"})]})]})]})]}),s(H,{open:ne,onOpenChange:ae,children:[s(ye,{children:[n(be,{render:n(O,{render:s(e,{"data-testid":"model-trigger","aria-busy":L,variant:"ghost",className:m("h-7 gap-1.5 rounded-md px-2 text-xs font-normal","hover:bg-accent","max-w-full min-w-0 shrink",T&&"h-7 gap-1 px-1.5 text-[11px]",A),...r,children:[c.icon,f?.some((a)=>a.id==="fast_mode"&&a.currentValue&&!a.disabled)&&n(W,{"aria-hidden":"true",className:"size-3 shrink-0 fill-current"}),n("span",{className:m("min-w-0 flex-1 truncate text-start",T&&"text-[11px]"),children:j(c.label)||u("model.selectModel")}),i&&s("span",{className:"text-muted-foreground grid shrink-0 justify-items-center",children:[n("span",{className:"invisible col-start-1 row-start-1",children:i.sizer??i.levels.reduce((a,t)=>t.name.length>a.length?t.name:a,"")}),n("span",{className:"col-start-1 row-start-1",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),L?n(U,{"data-testid":"model-switch-loading",className:"size-3 shrink-0 animate-spin"}):n(P,{className:m("size-3 shrink-0",T&&"size-2.5")})]})})}),n(we,{children:u("model.switchModel")})]}),s(N,{side:"top",align:"end",sideOffset:4,className:m("z-100 w-auto max-w-[min(24rem,calc(100vw-1rem))] min-w-[14rem]",l&&"flex h-[350px] w-80 min-w-0 flex-col overflow-hidden rounded-xl p-1.5"),children:[l&&s(p,{children:[s(F,{"data-model-menu-header":!0,className:"flex shrink-0 items-center justify-between gap-2 px-2 py-1",children:[i?I==="slider"?n("div",{role:"menuitem","aria-label":i.name,className:"min-w-0 flex-1 [&>div]:justify-between [&>div]:gap-3 [&>div]:px-0 [&>div]:py-1.5",children:n(on,{...i,disabled:r.disabled})}):s(_e,{children:[s(He,{disabled:r.disabled,className:"h-8 min-w-0 flex-1 gap-2 rounded-md",children:[n("span",{children:i.name}),n("span",{className:"text-muted-foreground min-w-0 truncate text-xs",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Oe,{children:n(h,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):D?s(M,{disabled:!0,className:"h-8 min-w-0 flex-1 gap-2",children:[n("span",{children:D.name}),n("span",{className:"text-muted-foreground truncate text-xs",children:D.label})]}):n(te,{className:"min-w-0 flex-1 truncate",children:g?.name}),d&&n(rn,{"aria-label":d.name,title:d.title??d.name,disabled:r.disabled||d.disabled,checked:d.currentValue,closeOnClick:!1,onCheckedChange:(a)=>z?.(d.id,a),className:m("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",d.currentValue&&!d.disabled?"text-foreground [&_svg]:fill-current":"text-muted-foreground"),children:d.icon??n(W,{className:"size-4","aria-hidden":"true"})})]}),n(R,{className:"shrink-0"})]}),g&&!l&&s(p,{children:[s("div",{className:"flex items-center gap-2 px-2 py-2",children:[g.icon,n("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:g.name}),g.action]}),n(R,{})]}),s(F,{"data-model-menu-list":l?"":void 0,className:l?"min-h-0 min-w-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain":void 0,children:[K&&(X?n(M,{disabled:!0,className:"text-muted-foreground",children:u("model.loadingModels")}):v.length===0?n(M,{disabled:!0,className:"text-muted-foreground",children:u("model.noModelsAvailable")}):(()=>{let a=v.filter((o)=>!o.more),t=v.filter((o)=>o.more),B=a.length>0&&t.length>0,y=(o,b)=>({disabled:r.disabled,icon:o.icon,value:o.api_id,label:j(o.label),description:b?.noDescription?void 0:J?o.description:void 0}),k=(o)=>{let b=v.find((S)=>S.api_id===o);if(b)q(b)};if(l)return n(h,{value:c.api_id,onValueChange:k,itemClassName:"min-w-0 max-w-full font-normal whitespace-nowrap",options:v.map((o)=>y(o))});return s(p,{children:[C?C.map((o)=>{let b=o.models.filter((x)=>!x.more),S=o.models.filter((x)=>x.more),G=b.length>0&&S.length>0;return s(F,{children:[n(te,{className:"text-muted-foreground text-xs font-normal",children:o.name}),n(h,{value:c.api_id,onValueChange:k,itemClassName:"font-medium whitespace-nowrap",options:(G?b:o.models).map((x)=>y(x))}),G&&s(_e,{children:[n(He,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Oe,{children:n(h,{value:c.api_id,onValueChange:k,itemClassName:"font-medium whitespace-nowrap",options:S.map((x)=>y(x,{noDescription:!0}))})})]})]},o.id)}):n(h,{value:c.api_id,onValueChange:k,itemClassName:"font-medium whitespace-nowrap",options:(B?a:v).map((o)=>y(o))}),!C&&B&&s(_e,{children:[n(He,{className:"font-medium whitespace-nowrap",children:u("model.moreModels")}),n(Oe,{children:n(h,{value:c.api_id,onValueChange:k,itemClassName:"font-medium whitespace-nowrap",options:t.map((o)=>y(o,{noDescription:!0}))})})]})]})})()),!l&&i&&s(p,{children:[n(R,{}),I==="menu"?s(_e,{children:[s(He,{disabled:r.disabled,children:[n("span",{className:"flex-1",children:i.name}),n("span",{className:"text-muted-foreground",children:i.levels.find((a)=>a.value===i.value)?.name??i.value})]}),n(Oe,{children:n(h,{value:i.value,onValueChange:i.onChange,options:i.levels.map((a)=>({value:a.value,label:a.name}))})})]}):n(on,{...i,disabled:r.disabled})]}),!l&&!i&&D&&s(p,{children:[n(R,{}),s(M,{disabled:!0,children:[n("span",{className:"flex-1",children:D.name}),n("span",{children:D.label})]})]}),Y.map((a)=>s(F,{children:[n(R,{}),n(te,{children:a.name}),n(h,{value:a.value,onValueChange:a.onChange,options:a.options,itemClassName:"whitespace-nowrap"})]},a.id)),_&&_.length>0&&s(p,{children:[!i&&n(R,{}),_.map((a)=>l?s(rn,{"aria-label":a.name,title:a.title,disabled:r.disabled||a.disabled,checked:a.currentValue,closeOnClick:!1,onCheckedChange:(t)=>z?.(a.id,t),className:"justify-between gap-3 py-2.5 pr-2 [&_[data-slot=dropdown-menu-checkbox-item-indicator]]:hidden",children:[s("span",{className:"flex items-center gap-2",children:[a.icon,a.name]}),n("span",{"aria-hidden":"true",className:m("flex h-[18px] w-8 shrink-0 items-center rounded-full p-0.5",a.currentValue?"bg-primary":"bg-input"),children:n("span",{className:m("bg-background size-3.5 rounded-full shadow-xs transition-transform",a.currentValue&&"translate-x-3.5")})})]},a.id):s("div",{title:a.title,className:m("flex items-center justify-between gap-3 px-2 py-2.5",a.disabled&&"opacity-50"),children:[s("span",{className:"flex items-center gap-2 text-sm font-medium",children:[a.icon,a.name]}),n($e,{"aria-label":a.name,disabled:r.disabled||a.disabled,checked:a.currentValue,onCheckedChange:(t)=>z?.(a.id,t)})]},a.id))]})]}),l&&g?.action&&s(p,{children:[n(R,{className:"shrink-0"}),n(F,{"data-model-menu-footer":!0,className:"shrink-0",children:g.action})]})]})]})]})}
2
+ export{Uo};
@@ -1,2 +1,2 @@
1
- import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function eo(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ht(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
- export{eo,Ht};
1
+ import{Marked as p}from"marked";import k from"marked-linkify-it";var h=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,m=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,d=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,x={extensions:[{name:"math",level:"block",tokenizer(n){let t=d.exec(n);if(t===null)return;return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0}}},{name:"math",level:"inline",start(n){return n.search(/\$|\\[([]/)},tokenizer(n){let t=d.exec(n);if(t!==null)return{type:"math",raw:t[0],text:(t[1]??t[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(n);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let i=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(n);if(i===null||/^\s|\s$/.test(i[1]))return;return{type:"math",raw:i[0],text:i[1],display:!1}}}]};function no(){let n=new p({gfm:!0}),t=k(),r=t.extensions[0],i=r.tokenizer;r.tokenizer=function(o,a){let e=i.call(this,o,a);if(e===void 0)return;if(e.raw.startsWith("<"))return e;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(e.raw);if(l===null)return e;let c=l[0].length-1,u=e.raw.slice(c).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(u===-1)return e;let s=e.raw.slice(0,c+u),f=e.href.slice(0,e.href.length-(e.raw.length-s.length));return{...e,raw:s,href:f,text:s,tokens:[{type:"text",raw:s,text:s}]}},n.use(x,t);for(let o of["block","inline"])n.use({extensions:[{name:"internalMessage",level:o,...o==="inline"?{start(a){return h.exec(a)?.index}}:{},tokenizer(a){let e=m.exec(a);if(e===null)return;return{type:"internalMessage",raw:e[0]}},renderer(){return""}}]});return n}function Ht(n){let t=n.replaceAll(/[\p{Cc}\s]/gu,"");return!/^(?:data|javascript|vbscript):/i.test(t)}
2
+ export{no,Ht};
@@ -1 +1 @@
1
- import{cn as r}from"cn";import{jsx as d}from"react/jsx-runtime";function Cn({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o})}function Tn({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t})}function Sn({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t})}function In({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t})}function Jr({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t})}function Pn({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t})}function Nn({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t})}export{Cn,Tn,Sn,In,Jr,Pn,Nn};
1
+ import{cn as r}from"cn";import{jsx as d}from"react/jsx-runtime";function In({className:a,size:t="default",...o}){return d("div",{"data-slot":"card","data-size":t,className:r("group/card bg-card text-card-foreground ring-foreground/10 flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl py-(--card-spacing) text-sm shadow-xs ring-1 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...o})}function Sn({className:a,...t}){return d("div",{"data-slot":"card-header",className:r("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",a),...t})}function Pn({className:a,...t}){return d("div",{"data-slot":"card-title",className:r("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",a),...t})}function Nn({className:a,...t}){return d("div",{"data-slot":"card-description",className:r("text-muted-foreground text-sm",a),...t})}function ei({className:a,...t}){return d("div",{"data-slot":"card-action",className:r("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),...t})}function Mn({className:a,...t}){return d("div",{"data-slot":"card-content",className:r("flex flex-col gap-3 px-(--card-spacing)",a),...t})}function Rn({className:a,...t}){return d("div",{"data-slot":"card-footer",className:r("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)",a),...t})}export{In,Sn,Pn,Nn,ei,Mn,Rn};
@@ -1,2 +1,2 @@
1
- import{go}from"./chunk-0n240acr.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function $t({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(go,{src:c,alt:"",onClose:()=>a(!1)})]})}function po({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e($t,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
- export{$t,po};
1
+ import{fo}from"./chunk-gszy4mhj.js";import{CheckIcon as N,ChevronDownIcon as E,CopyIcon as T,FileIcon as w}from"lucide-react";import{useEffect as k,useLayoutEffect as H,useRef as I,useState as f}from"react";import{jsx as e,jsxs as p,Fragment as h}from"react/jsx-runtime";var A=20,L='a[href], area[href], button, input, select, textarea, summary, audio[controls], video[controls], iframe, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';function y(n,o,s){if(n.toggleAttribute("inert",!o),!o){n.setAttribute("aria-hidden","true");return}if(s===null)n.removeAttribute("aria-hidden");else n.setAttribute("aria-hidden",s)}function R(n,o){let s=n.getBoundingClientRect(),a=o.getBoundingClientRect();return s.top>=a.top&&s.right<=a.right&&s.bottom<=a.bottom&&s.left>=a.left}function M({text:n,host:o}){let{t:s,Markdown:a}=o,c=I(null),[l,u]=f(!1),[d,x]=f(!1);return H(()=>{let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=()=>{if(r.scrollHeight===0){u(!1);return}let b=Number.parseFloat(getComputedStyle(r).lineHeight);if(!Number.isFinite(b))throw Error("Codex user message line height is invalid");u(r.scrollHeight>A*b+1)};t();let m=new ResizeObserver(t);return m.observe(r),()=>m.disconnect()},[]),k(()=>{if(!l||d)return;let r=c.current;if(!r)throw Error("Codex user message content is missing");let t=new Map,m=typeof IntersectionObserver>"u"?null:new IntersectionObserver((i)=>{for(let g of i){let v=g.target;if(!t.has(v))continue;y(v,g.isIntersecting&&g.intersectionRatio>=1,t.get(v))}},{root:r,rootMargin:"0px",threshold:1}),b=()=>{for(let i of t.keys()){if(r.contains(i))continue;m?.unobserve(i),t.delete(i)}for(let i of r.querySelectorAll(L)){if(t.has(i)||i.hasAttribute("inert"))continue;let g=i.getAttribute("aria-hidden");t.set(i,g),y(i,m===null&&R(i,r),g),m?.observe(i)}};b();let C=new MutationObserver(b);return C.observe(r,{childList:!0,subtree:!0}),()=>{m?.disconnect(),C.disconnect();for(let[i,g]of t)y(i,!0,g)}},[l,d]),p("div",{className:"codex-user-message-content",children:[e("div",{ref:c,className:l&&!d?"codex-user-message-text codex-user-message-text-collapsed":"codex-user-message-text",children:e(a,{text:n,streaming:!1})}),l&&!d&&e("span",{className:"codex-user-message-ellipsis","aria-hidden":"true",children:"…"}),l&&p("button",{type:"button","aria-expanded":d,className:"codex-user-message-collapse-trigger",onClick:()=>{x((r)=>!r)},children:[e("span",{children:d?s("stream.codex.showLess"):s("stream.codex.showMore")}),e(E,{className:d?"codex-user-message-collapse-chevron codex-user-message-collapse-chevron-expanded":"codex-user-message-collapse-chevron","aria-hidden":"true"})]})]})}function qt({text:n,label:o,host:s}){let[a,c]=f(!1),[l,u]=f(null),d=async()=>{c(!1),u(null);try{await(s?.copyText?s.copyText(n):navigator.clipboard.writeText(n)),c(!0),setTimeout(()=>c(!1),2000)}catch(x){u(String(x)),s?.onCopyError?.(x)}};return e("button",{type:"button",className:"codex-message-action","aria-label":o,title:l??o,onClick:()=>void d(),children:a?e(N,{className:"codex-message-action-confirmed"}):e(T,{})})}function S({image:n,openImage:o}){let[s,a]=f(!1),c=`data:${n.mimeType};base64,${n.data}`;return p(h,{children:[e("button",{type:"button",className:"codex-user-image",onClick:()=>o===void 0?a(!0):o(c),children:e("img",{src:c,alt:""})}),s&&e(fo,{src:c,alt:"",onClose:()=>a(!1)})]})}function go({message:n,text:o,textParts:s,mentions:a,images:c,messageTime:l,host:u,bubbleStyle:d}){let{t:x,openImage:r}=u;return e("div",{"data-content-search-unit-key":n.id,"data-message-id":n.id,className:"timeline-break codex-user-message scroll-mt-4",children:p("div",{className:"group/codex-user codex-user-message-group",children:[a.length>0&&e("div",{className:"codex-user-mentions",children:a.map((t)=>p("span",{className:"codex-user-mention",title:t.title,children:[e(w,{"aria-hidden":"true"}),e("span",{className:"codex-user-mention-label",children:t.label})]},t.key))}),c.length>0&&e("div",{className:"codex-user-images",children:c.map((t)=>e(S,{image:t,openImage:r},`${t.mimeType}:${t.data}`))}),o.length>0&&e(h,{children:e("div",{"data-user-message-bubble":!0,tabIndex:0,className:"codex-user-bubble",style:d,children:s?s.map((t,m)=>e("div",{className:"codex-user-text-part",children:t.question===void 0?e(M,{text:t.text,host:u}):p(h,{children:[e("div",{className:"codex-user-question-summary",title:t.question,children:t.question}),e("div",{className:"codex-user-question-answer",children:t.text})]})},m)):e(M,{text:o,host:u})})}),p("div",{className:"codex-user-actions",children:[e(qt,{text:o,label:x("actions.copy"),host:u}),l&&e("span",{className:"codex-user-time",title:l.full,children:l.short})]})]})})}
2
+ export{qt,go};
@@ -1 +1 @@
1
- import{f}from"./chunk-ek06eyp4.js";import{Q}from"./chunk-ksv9pjc2.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsx as t,jsxs as m}from"react/jsx-runtime";function At({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function Lt({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o})}function Mn({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function Rn({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o})}function ei({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function En({className:a,...e}){return t(f,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function ti({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function at({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e})}function ni({children:a,className:e,...o}){return m("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(Q,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a})]})}function oi({className:a,children:e,errors:o,...s}){let i=u(()=>{if(e)return e;if(!o?.length)return null;let r=[...new Map(o.map((d)=>[d?.message,d])).values()];if(r?.length==1)return r[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:r.map((d,n)=>d?.message&&t("li",{children:d.message},n))})},[e,o]);if(!i)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...s,children:i})}export{At,Lt,Mn,Rn,ei,En,ti,at,ni,oi};
1
+ import{f}from"./chunk-ek06eyp4.js";import{Q}from"./chunk-ksv9pjc2.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsx as t,jsxs as m}from"react/jsx-runtime";function At({className:a,...e}){return t("fieldset",{"data-slot":"field-set",className:l("flex flex-col gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",a),...e})}function Lt({className:a,variant:e="legend",...o}){return t("legend",{"data-slot":"field-legend","data-variant":e,className:l("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",a),...o})}function En({className:a,...e}){return t("div",{"data-slot":"field-group",className:l("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",a),...e})}var c=p("group/field data-[invalid=true]:text-destructive flex w-full gap-3",{variants:{orientation:{vertical:"flex-col *:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function An({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o})}function ti({className:a,...e}){return t("div",{"data-slot":"field-content",className:l("group/field-content flex flex-1 flex-col gap-1 leading-snug",a),...e})}function Ln({className:a,...e}){return t(f,{"data-slot":"field-label",className:l("group/field-label peer/field-label has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 *:data-[slot=field]:p-3","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",a),...e})}function ni({className:a,...e}){return t("div",{"data-slot":"field-label",className:l("flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",a),...e})}function at({className:a,...e}){return t("p",{"data-slot":"field-description",className:l("text-muted-foreground text-left text-sm leading-normal font-normal group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",a),...e})}function oi({children:a,className:e,...o}){return m("div",{"data-slot":"field-separator","data-content":!!a,className:l("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",e),...o,children:[t(Q,{className:"absolute inset-0 top-1/2"}),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a})]})}function ri({className:a,children:e,errors:o,...s}){let i=u(()=>{if(e)return e;if(!o?.length)return null;let r=[...new Map(o.map((d)=>[d?.message,d])).values()];if(r?.length==1)return r[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:r.map((d,n)=>d?.message&&t("li",{children:d.message},n))})},[e,o]);if(!i)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...s,children:i})}export{At,Lt,En,An,ti,Ln,ni,at,oi,ri};
@@ -1,2 +1,2 @@
1
- import{re}from"./chunk-dp8pjv6r.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function ht({host:o,client:e,children:t}){let s=l(()=>({host:o,client:e}),[o,e]);return r(re,{host:o,client:e,children:r(i,{value:s,children:t})})}function n(){let o=a(i);if(o===null)throw Error("Conversation host is missing");return o}function C(o,e){e.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
1
+ import{re}from"./chunk-f3e3ged2.js";import{createContext as v,useContext as a,useMemo as l}from"react";import{jsx as r}from"react/jsx-runtime";var i=v(null);function ht({host:o,client:e,children:t}){let s=l(()=>({host:o,client:e}),[o,e]);return r(re,{host:o,client:e,children:r(i,{value:s,children:t})})}function n(){let o=a(i);if(o===null)throw Error("Conversation host is missing");return o}function C(o,e){e.catch((t)=>{if(o.reportError)o.reportError(t);else console.error(t)})}
2
2
  export{ht,n,C};
@@ -1,2 +1,2 @@
1
- import{e}from"./chunk-6kn920c5.js";import{H,O,P}from"./chunk-qah4fs3d.js";import{h}from"./chunk-rnykpmn2.js";import{useState as f}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function Bo({value:r,currentName:o,icon:p,options:i,label:s,header:a,onValueChange:d,showLabel:l=!1,disabled:u=!1,warning:m=!1}){let[c,g]=f(!1);return t(H,{open:c,onOpenChange:g,children:[n(O,{render:t(e,{disabled:u,"data-permission-warning":m?"":void 0,variant:"ghost","aria-label":`${s}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[p,n("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(P,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(h,{value:r,onValueChange:d,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}
2
- export{Bo};
1
+ import{e}from"./chunk-6kn920c5.js";import{H,O,N}from"./chunk-zw3h5xgf.js";import{h}from"./chunk-1k03fpcj.js";import{useState as f}from"react";import{jsx as n,jsxs as t}from"react/jsx-runtime";function zo({value:r,currentName:o,icon:p,options:i,label:s,header:a,onValueChange:d,showLabel:l=!1,disabled:u=!1,warning:m=!1}){let[c,g]=f(!1);return t(H,{open:c,onOpenChange:g,children:[n(O,{render:t(e,{disabled:u,"data-permission-warning":m?"":void 0,variant:"ghost","aria-label":`${s}: ${o}`,title:o,className:"text-muted-foreground data-popup-open:hover:bg-muted h-7 gap-1.5 rounded-full bg-transparent px-2 text-xs font-normal whitespace-nowrap data-popup-open:bg-transparent",children:[p,n("span",{className:l?"max-w-40 truncate":"hidden max-w-40 truncate @[40rem]/input-footer:inline-block",children:o})]})}),t(N,{align:"start",sideOffset:4,className:"permission-mode-menu z-100 w-auto max-w-[calc(100vw-2rem)] min-w-72 rounded-xl p-1.5",children:[a&&n("div",{className:"text-muted-foreground flex items-center px-1.5 pt-0.5 pb-1 text-[11px] leading-4",children:n("span",{children:a})}),n(h,{value:r,onValueChange:d,itemClassName:"items-center gap-2 py-1 pr-6 pl-2 whitespace-nowrap",options:i})]})]})}
2
+ export{zo};