@alwith/module-chat 0.1.30 → 0.1.31

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 (156) 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-ta690ra0.js → chunk-0e1pdbec.js} +2 -2
  9. package/dist/chunk-0m271xz8.js +1 -0
  10. package/dist/chunk-1hy64ewz.js +1 -0
  11. package/dist/chunk-1twg3evk.js +1 -0
  12. package/dist/{chunk-kew8ef6z.js → chunk-25na55ve.js} +2 -2
  13. package/dist/chunk-2r04c28x.js +2 -0
  14. package/dist/{chunk-y1cbwywe.js → chunk-341yykkp.js} +1 -1
  15. package/dist/chunk-3dr41azp.js +2 -0
  16. package/dist/chunk-54h8srdy.js +1 -0
  17. package/dist/chunk-6f7mdmsp.js +2 -0
  18. package/dist/chunk-7n3ege46.js +2 -0
  19. package/dist/chunk-7tj0a2na.js +2 -0
  20. package/dist/chunk-8r6388q9.js +2 -0
  21. package/dist/{chunk-aaybyhdj.js → chunk-9me7jmzd.js} +2 -2
  22. package/dist/chunk-arge74eh.js +2 -0
  23. package/dist/chunk-bf5fh35b.js +2 -0
  24. package/dist/{chunk-tbr607hk.js → chunk-bhvtt6tv.js} +2 -2
  25. package/dist/chunk-bwzjm3g8.js +1 -0
  26. package/dist/chunk-d0ptk8x8.js +1 -0
  27. package/dist/chunk-darkfx1b.js +2 -0
  28. package/dist/chunk-dj8v2w6n.js +1 -0
  29. package/dist/chunk-g20b01rn.js +2 -0
  30. package/dist/{chunk-p4c1w6qx.js → chunk-g77gammg.js} +2 -2
  31. package/dist/chunk-hnt4tt1n.js +2 -0
  32. package/dist/chunk-kscn218z.js +1 -0
  33. package/dist/chunk-p9wpghey.js +2 -0
  34. package/dist/chunk-pk9khgvs.js +2 -0
  35. package/dist/{chunk-wf194rae.js → chunk-qj8r5xvx.js} +2 -2
  36. package/dist/chunk-qmbekvg9.js +2 -0
  37. package/dist/chunk-qwe4sfh0.js +1 -0
  38. package/dist/chunk-qyhgwc51.js +2 -0
  39. package/dist/chunk-r125b0z5.js +2 -0
  40. package/dist/{chunk-h7y6vmb3.js → chunk-rakd7vzb.js} +1 -1
  41. package/dist/chunk-reqrpvyy.js +2 -0
  42. package/dist/chunk-s365bfbf.js +1 -0
  43. package/dist/{chunk-7471tnsq.js → chunk-s3z33k7f.js} +2 -2
  44. package/dist/chunk-sepy631p.js +1 -0
  45. package/dist/{chunk-98t2nc02.js → chunk-src2j5cw.js} +2 -2
  46. package/dist/chunk-tygbx698.js +7 -0
  47. package/dist/chunk-vq236zge.js +1 -0
  48. package/dist/chunk-w5mg77ac.js +2 -0
  49. package/dist/chunk-wjejhpgw.js +1 -0
  50. package/dist/chunk-wjqqh1d4.js +1 -0
  51. package/dist/chunk-x3jp5bsh.js +3 -0
  52. package/dist/chunk-xhkt2dhz.js +2 -0
  53. package/dist/{chunk-nvtvm7jc.js → chunk-y2xbq7rb.js} +3 -3
  54. package/dist/chunk-yk52gm8x.js +2 -0
  55. package/dist/chunk-zt7a6b1m.js +1 -0
  56. package/dist/chunk-zy5cq9m3.js +2 -0
  57. package/dist/codex/activity-group.js +1 -1
  58. package/dist/codex/assistant-message.js +2 -2
  59. package/dist/codex/async-question-card.js +2 -2
  60. package/dist/codex/edited-files-card.js +1 -1
  61. package/dist/codex/image-view-activity.js +1 -1
  62. package/dist/codex/markdown-renderer.js +5 -5
  63. package/dist/codex/navigation-preview.js +1 -1
  64. package/dist/codex/navigation-rail.js +1 -1
  65. package/dist/codex/patch-view.js +2 -2
  66. package/dist/codex/plan.js +1 -1
  67. package/dist/codex/terminal-output.js +1 -1
  68. package/dist/codex/thread-virtualizer.js +1 -1
  69. package/dist/codex/user-message.js +1 -1
  70. package/dist/codex/virtualized-turn-list.js +1 -1
  71. package/dist/composer/completion-filter.js +1 -1
  72. package/dist/composer/completion-menu.js +3 -3
  73. package/dist/composer/completion-trigger.js +1 -1
  74. package/dist/composer/effort-slider.js +1 -1
  75. package/dist/composer/menu-radio.js +1 -1
  76. package/dist/composer/model-select.js +1 -1
  77. package/dist/composer/permission-mode-select.js +1 -1
  78. package/dist/composer/prompt-input-attachments.js +1 -1
  79. package/dist/composer/prompt-input-clipboard.js +1 -1
  80. package/dist/composer/prompt-input-context.js +1 -1
  81. package/dist/composer/prompt-input-textarea.js +3 -3
  82. package/dist/composer/prompt-input.js +1 -1
  83. package/dist/image-lightbox.js +1 -1
  84. package/dist/image-preview-dialog.js +1 -1
  85. package/dist/lib/code-highlighter.js +1 -1
  86. package/dist/lib/fuzzy.js +1 -1
  87. package/dist/lib/group-blocks.js +1 -1
  88. package/dist/lib/image-encode.js +1 -1
  89. package/dist/lib/limits.js +1 -1
  90. package/dist/lib/markdown-parser.js +1 -1
  91. package/dist/lib/markdown-rules.js +1 -1
  92. package/dist/lib/model-name.js +1 -1
  93. package/dist/lib/pointer-centered-zoom.js +1 -1
  94. package/dist/lib/prepare-prompt-files.js +1 -1
  95. package/dist/lib/stream-style.js +1 -1
  96. package/dist/lib/streaming-markdown.js +1 -1
  97. package/dist/search/chat-search.js +1 -1
  98. package/dist/search/dom-matches.js +1 -1
  99. package/dist/search/find-bar.js +1 -1
  100. package/dist/search/literal-matches.js +1 -1
  101. package/dist/ui/badge.js +1 -1
  102. package/dist/ui/button.js +1 -1
  103. package/dist/ui/card.js +1 -1
  104. package/dist/ui/checkbox.js +1 -1
  105. package/dist/ui/dialog.js +1 -1
  106. package/dist/ui/dropdown-menu.js +1 -1
  107. package/dist/ui/field.js +1 -1
  108. package/dist/ui/hover-card.js +1 -1
  109. package/dist/ui/input-group-textarea.js +1 -1
  110. package/dist/ui/input-group.js +1 -1
  111. package/dist/ui/input.js +1 -1
  112. package/dist/ui/label.js +1 -1
  113. package/dist/ui/radio-group.js +1 -1
  114. package/dist/ui/separator.js +1 -1
  115. package/dist/ui/switch.js +1 -1
  116. package/dist/ui/textarea.js +1 -1
  117. package/dist/ui/tooltip.js +1 -1
  118. package/package.json +1 -1
  119. package/dist/chunk-11n6ah6p.js +0 -2
  120. package/dist/chunk-15a7wypc.js +0 -2
  121. package/dist/chunk-2kjmc9hg.js +0 -1
  122. package/dist/chunk-2sc7ppw2.js +0 -1
  123. package/dist/chunk-51qk29t6.js +0 -2
  124. package/dist/chunk-5hqv4m75.js +0 -1
  125. package/dist/chunk-67gms74t.js +0 -2
  126. package/dist/chunk-85y9tqsd.js +0 -2
  127. package/dist/chunk-99xmegcw.js +0 -2
  128. package/dist/chunk-9cdspnb1.js +0 -2
  129. package/dist/chunk-ake02dgs.js +0 -1
  130. package/dist/chunk-b5srhd6k.js +0 -1
  131. package/dist/chunk-bbnrzw5x.js +0 -2
  132. package/dist/chunk-bgj6z7z4.js +0 -2
  133. package/dist/chunk-d1xydh51.js +0 -2
  134. package/dist/chunk-dvfka70p.js +0 -2
  135. package/dist/chunk-eyn3tdcs.js +0 -2
  136. package/dist/chunk-h310nm02.js +0 -2
  137. package/dist/chunk-j63t6dxg.js +0 -1
  138. package/dist/chunk-jnx3t913.js +0 -2
  139. package/dist/chunk-nx3k6k2p.js +0 -2
  140. package/dist/chunk-p6kymvjw.js +0 -2
  141. package/dist/chunk-pkxfrrwf.js +0 -1
  142. package/dist/chunk-pnncsvbz.js +0 -1
  143. package/dist/chunk-q00ycy4m.js +0 -7
  144. package/dist/chunk-qf9n7v84.js +0 -1
  145. package/dist/chunk-r9k7kszp.js +0 -1
  146. package/dist/chunk-rka1mc9r.js +0 -1
  147. package/dist/chunk-s4w6yjc0.js +0 -1
  148. package/dist/chunk-t83jwyey.js +0 -1
  149. package/dist/chunk-tm40sncc.js +0 -2
  150. package/dist/chunk-twww750f.js +0 -2
  151. package/dist/chunk-wbpw278r.js +0 -2
  152. package/dist/chunk-x6jyxw9c.js +0 -1
  153. package/dist/chunk-xc6fz2xk.js +0 -3
  154. package/dist/chunk-xgy0heva.js +0 -1
  155. package/dist/chunk-ytqka33j.js +0 -2
  156. package/dist/chunk-z3gwnjmk.js +0 -2
@@ -1 +1 @@
1
- import"../chunk-wf194rae.js";import{e}from"../chunk-xgy0heva.js";import"../chunk-2kjmc9hg.js";import{Ae}from"../chunk-51qk29t6.js";import{Xe,Ze,Ye}from"../chunk-t83jwyey.js";import{h}from"../chunk-twww750f.js";import{cn as v}from"cn";import{PaperclipIcon as H,XIcon as k}from"lucide-react";import{Fragment as T,useEffect as M,useRef as L,useState as P}from"react";import{jsxDEV as t,Fragment as E}from"react/jsx-dev-runtime";function z(n){return t(Ye,{align:"start",...n},void 0,!1,void 0,this)}function W({data:n,t:r,className:l,...m}){let c=h(),[u,f]=P(!1),[N,d]=P(1),I=L(null),a=n.filename||"",o=(n.mediaType?.startsWith("image/")&&n.url?"image":"file")==="image",C=a||(o?r("input.image"):r("input.attachment"));return M(()=>{if(!u)return;let p=0.1,g=(i)=>Math.min(10,Math.max(0.1,i)),y=(i)=>{if(!(i.ctrlKey||i.metaKey))return;let s=i.key,x=s==="+"||s==="=",A=s==="-"||s==="_",w=s==="0";if(!x&&!A&&!w)return;i.preventDefault(),d((b)=>{if(w)return 1;if(x)return g(b+p);return g(b-p)})};return window.addEventListener("keydown",y,{passive:!1}),()=>window.removeEventListener("keydown",y)},[u]),t(E,{children:[t(Xe,{children:[t(Ze,{render:t("div",{className:v("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",l),...m,children:[t("div",{className:"relative size-5 shrink-0",children:[o?t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{d(1),f(!0)},children:t("img",{alt:a||"attachment",className:"size-5 object-cover",height:20,src:n.url,width:20},void 0,!1,void 0,this)},void 0,!1,void 0,this):t("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:t(H,{className:"size-3"},void 0,!1,void 0,this)},void 0,!1,void 0,this),t(e,{"aria-label":r("input.removeAttachment"),className:v("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(p)=>{p.stopPropagation(),c.remove(n.id)},type:"button",variant:"ghost",children:[t(k,{},void 0,!1,void 0,this),t("span",{className:"sr-only",children:r("input.removeAttachment")},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!o&&t("span",{className:"max-w-40 flex-1 truncate text-xs",children:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),t(z,{className:"w-auto p-2",children:t("div",{className:"w-auto space-y-3",children:[o&&t("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:t("img",{alt:a||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:n.url,width:448},void 0,!1,void 0,this)},void 0,!1,void 0,this),t("div",{className:"flex items-center gap-2.5",children:t("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[t("h4",{className:"truncate text-sm leading-none font-semibold",children:a||(o?"Image":"Attachment")},void 0,!1,void 0,this),n.mediaType&&t("p",{className:"text-muted-foreground truncate font-mono text-xs",children:n.mediaType},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o&&n.url&&t(Ae,{containerRef:I,filename:a||r("input.image"),onOpenChange:f,onScaleChange:d,open:u,scale:N,url:n.url},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function X({children:n,className:r,...l}){let m=h();if(!m.files.length)return null;return t("div",{className:v("flex w-full flex-wrap items-center gap-1",r),...l,children:m.files.map((c)=>t(T,{children:n(c)},c.id,!1,void 0,this))},void 0,!1,void 0,this)}export{W as PromptInputAttachment,X as PromptInputAttachments};
1
+ import"../chunk-qj8r5xvx.js";import{e}from"../chunk-wjejhpgw.js";import"../chunk-qwe4sfh0.js";import{Ke}from"../chunk-3dr41azp.js";import{Re,Le,_e}from"../chunk-1twg3evk.js";import{p}from"../chunk-w5mg77ac.js";import{cn as h}from"cn";import{PaperclipIcon as k,XIcon as T}from"lucide-react";import{Fragment as M,useEffect as L,useRef as z,useState as N}from"react";import{jsx as t,jsxs as o,Fragment as R}from"react/jsx-runtime";function E(n){return t(_e,{align:"start",...n})}function X({data:n,t:r,className:d,...c}){let l=p(),[v,g]=N(!1),[I,f]=N(1),C=z(null),s=n.filename||"",i=(n.mediaType?.startsWith("image/")&&n.url?"image":"file")==="image",A=s||(i?r("input.image"):r("input.attachment"));return L(()=>{if(!v)return;let u=0.1,y=(a)=>Math.min(10,Math.max(0.1,a)),x=(a)=>{if(!(a.ctrlKey||a.metaKey))return;let m=a.key,w=m==="+"||m==="=",H=m==="-"||m==="_",b=m==="0";if(!w&&!H&&!b)return;a.preventDefault(),f((P)=>{if(b)return 1;if(w)return y(P+u);return y(P-u)})};return window.addEventListener("keydown",x,{passive:!1}),()=>window.removeEventListener("keydown",x)},[v]),o(R,{children:[o(Re,{children:[t(Le,{render:o("div",{className:h("group border-border hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent relative flex h-8 cursor-pointer items-center gap-1.5 rounded-md border px-1.5 text-sm font-medium transition-all select-none",d),...c,children:[o("div",{className:"relative size-5 shrink-0",children:[i?t(e,{type:"button",variant:"ghost",size:"icon-xs","aria-label":r("input.image"),className:"bg-background absolute inset-0 size-5 overflow-hidden rounded p-0 transition-opacity group-hover:opacity-0",onClick:()=>{f(1),g(!0)},children:t("img",{alt:s||"attachment",className:"size-5 object-cover",height:20,src:n.url,width:20})}):t("div",{className:"bg-background text-muted-foreground absolute inset-0 flex size-5 items-center justify-center overflow-hidden rounded transition-opacity group-hover:opacity-0",children:t(k,{className:"size-3"})}),o(e,{"aria-label":r("input.removeAttachment"),className:h("absolute -top-1 -right-1 size-4 rounded-full p-0 opacity-0 transition-opacity [&>svg]:size-3","pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100"),onClick:(u)=>{u.stopPropagation(),l.remove(n.id)},type:"button",variant:"ghost",children:[t(T,{}),t("span",{className:"sr-only",children:r("input.removeAttachment")})]})]}),!i&&t("span",{className:"max-w-40 flex-1 truncate text-xs",children:A})]})}),t(E,{className:"w-auto p-2",children:o("div",{className:"w-auto space-y-3",children:[i&&t("div",{className:"flex max-h-96 w-96 items-center justify-center overflow-hidden rounded-md border",children:t("img",{alt:s||"attachment preview",className:"max-h-full max-w-full object-contain",height:384,src:n.url,width:448})}),t("div",{className:"flex items-center gap-2.5",children:o("div",{className:"min-w-0 flex-1 space-y-1 px-0.5",children:[t("h4",{className:"truncate text-sm leading-none font-semibold",children:s||(i?"Image":"Attachment")}),n.mediaType&&t("p",{className:"text-muted-foreground truncate font-mono text-xs",children:n.mediaType})]})})]})})]}),i&&n.url&&t(Ke,{containerRef:C,filename:s||r("input.image"),onOpenChange:g,onScaleChange:f,open:v,scale:I,url:n.url})]})}function _({children:n,className:r,...d}){let c=p();if(!c.files.length)return null;return t("div",{className:h("flex w-full flex-wrap items-center gap-1",r),...d,children:c.files.map((l)=>t(M,{children:n(l)},l.id))})}export{X as PromptInputAttachment,_ as PromptInputAttachments};
@@ -1 +1 @@
1
- import{st,Ie,Me,lt,rt,F}from"../chunk-nx3k6k2p.js";export{Me as clipboardHasStringItem,rt as countControlCharsBeforeIndex,st as normalizePastedImageFile,F as sanitizeTextareaTargetValue,lt as sanitizeTextareaValue,Ie as scanClipboardForImageFiles};
1
+ import{ot,le,de,it,nt,_}from"../chunk-7tj0a2na.js";export{de as clipboardHasStringItem,nt as countControlCharsBeforeIndex,ot as normalizePastedImageFile,_ as sanitizeTextareaTargetValue,it as sanitizeTextareaValue,le as scanClipboardForImageFiles};
@@ -1 +1 @@
1
- import{X,Pt,Z,It,C,_e,T,Mt,Nt,Y,h}from"../chunk-twww750f.js";export{Y as LocalAttachmentsContext,Nt as PromptInputProvider,Z as PromptInputSubmissionContext,X as PromptInputSubmitContext,C as ProviderAttachmentsContext,T as useOptionalPromptInputController,h as usePromptInputAttachments,_e as usePromptInputController,It as usePromptInputSubmission,Pt as usePromptInputSubmit,Mt as useProviderAttachments};
1
+ import{O,pt,B,gt,k,ce,C,ft,ht,z,p}from"../chunk-w5mg77ac.js";export{z as LocalAttachmentsContext,ht as PromptInputProvider,B as PromptInputSubmissionContext,O as PromptInputSubmitContext,k as ProviderAttachmentsContext,C as useOptionalPromptInputController,p as usePromptInputAttachments,ce as usePromptInputController,gt as usePromptInputSubmission,pt as usePromptInputSubmit,ft as useProviderAttachments};
@@ -1,3 +1,3 @@
1
- import"../chunk-r9k7kszp.js";import{ne}from"../chunk-jnx3t913.js";import{Ie,Me,F}from"../chunk-nx3k6k2p.js";import{T,h}from"../chunk-twww750f.js";import{cn as A}from"cn";import{forwardRef as D,useCallback as M,useEffect as K,useImperativeHandle as L,useRef as f}from"react";import{jsxDEV as z}from"react/jsx-dev-runtime";var R=(i)=>!i.shiftKey,N=()=>!1,q=D(({onChange:i,onCompositionStart:v,onCompositionEnd:x,className:y,placeholder:b,bashMode:E=!1,isSendShortcut:I=R,isNewlineShortcut:C=N,...H},P)=>{let n=T(),l=h(),o=f(!1),u=f(!1),r=f(null),s=M(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);K(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(s)});return t.observe(e),()=>t.disconnect()},[s]);let c=E&&(n?.textInput.value??"").startsWith("!"),S=(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
- `&&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(C(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 g=a+1;t.setSelectionRange(g,g),s();return}if(I(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)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:m}=Ie(t),p=Me(t);if(a.length>0)e.preventDefault(),l.add(a);else if(m&&!p)e.preventDefault()},w=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:F(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)F(e.currentTarget);s(),i?.(e)}};return L(P,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),z(ne,{"data-chat-input":!0,ref:r,rows:3,className:A("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",y),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=F(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),x?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,v?.(e)},onKeyDown:S,onPaste:k,placeholder:b,...H,...w},void 0,!1,void 0,this)});q.displayName="PromptInputTextarea";export{q as PromptInputTextarea};
1
+ import"../chunk-d0ptk8x8.js";import{ne}from"../chunk-2r04c28x.js";import{le,de,_}from"../chunk-7tj0a2na.js";import{C,p}from"../chunk-w5mg77ac.js";import{cn as A}from"cn";import{forwardRef as D,useCallback as M,useEffect as K,useImperativeHandle as L,useRef as d}from"react";import{jsx as q}from"react/jsx-runtime";var R=(i)=>!i.shiftKey,F=()=>!1,N=D(({onChange:i,onCompositionStart:v,onCompositionEnd:x,className:T,placeholder:y,bashMode:b=!1,isSendShortcut:E=R,isNewlineShortcut:I=F,...H},P)=>{let n=C(),l=p(),o=d(!1),u=d(!1),r=d(null),s=M(()=>{let e=r.current;if(!e||o.current)return;e.style.height="auto",e.style.height=`${e.scrollHeight}px`},[]);K(()=>{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("!"),S=(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
+ `&&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:f,value:m}=t,h=`${m.slice(0,a)}
3
+ ${m.slice(f)}`;if(n)n.textInput.setInput(h);else t.value=h;let g=a+1;t.setSelectionRange(g,g),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)}},k=(e)=>{let t=e.clipboardData?.items;if(!t)return;let{imageFiles:a,sawNonImageFile:f}=le(t),m=de(t);if(a.length>0)e.preventDefault(),l.add(a);else if(f&&!m)e.preventDefault()},w=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:_(e.currentTarget);n.textInput.setInput(c?`!${t}`:t),s(),i?.(e)}}:{onChange:(e)=>{if(!o.current)_(e.currentTarget);s(),i?.(e)}};return L(P,()=>({resetHeight:()=>{if(r.current)r.current.style.height="auto"},focus:()=>{r.current?.focus()},isComposing:()=>o.current||u.current,getTextarea:()=>r.current}),[]),q(ne,{"data-chat-input":!0,ref:r,rows:3,className:A("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",T),name:"message",onCompositionEnd:(e)=>{o.current=!1;let t=_(e.currentTarget);n?.textInput.setInput(c?`!${t}`:t),s(),x?.(e),u.current=!0,requestAnimationFrame(()=>{u.current=!1})},onCompositionStart:(e)=>{u.current=!1,o.current=!0,v?.(e)},onKeyDown:S,onPaste:k,placeholder:y,...H,...w})});N.displayName="PromptInputTextarea";export{N as PromptInputTextarea};
@@ -1 +1 @@
1
- import{Se,j}from"../chunk-wbpw278r.js";import"../chunk-ta690ra0.js";import{Ne}from"../chunk-98t2nc02.js";import"../chunk-xgy0heva.js";import"../chunk-r9k7kszp.js";import"../chunk-jnx3t913.js";import{Qe,ee,te}from"../chunk-pkxfrrwf.js";import{X,Z,C,T,Y}from"../chunk-twww750f.js";import{cn as P}from"cn";import{ArrowUpIcon as Ie,Loader2Icon as ye,SquareIcon as xe,XIcon as Le}from"lucide-react";import{Children as se,useCallback as h,useEffect as M,useMemo as Te,useRef as E,useState as Fe}from"react";import{flushSync as Me}from"react-dom";import{jsxDEV as o}from"react/jsx-dev-runtime";function ie(u){let s=new FormData(u).get("message");return typeof s==="string"?s:""}var De=({className:u,bashMode:s=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:A,multiple:ae,globalDrop:w,syncHiddenInput:B,maxFiles:k,maxFileSize:D,onError:b,onSubmit:ue,children:le,...pe})=>{let i=T(),l=!!i,me=s&&l&&i.textInput.value.startsWith("!"),x=E(null),S=E(null),N=E(!1),[ce,R]=Fe([]),c=l?i.attachments.files:ce,O=E(c);O.current=c;let de=h(()=>{x.current?.click()},[]),W=h((e)=>{if(!A||A.trim()==="")return!0;return A.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[A]),G=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),fe=h((e)=>{let r=[...e],t=r.filter((a)=>W(a));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(a)=>D?a.size<=D:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}R((a)=>{let v=I?I.uniqueFiles(m,a):m,p=typeof k==="number"?Math.max(0,k-a.length):void 0,H=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let ne=[];for(let F of H){let oe=I?.sourcePath(F);ne.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(F),mediaType:G(F),filename:F.name,size:F.size,lastModified:F.lastModified,...oe===void 0?{}:{sourcePath:oe}})}return[...a,...ne]})},[I,G,W,k,D,b]),ge=h((e)=>R((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),be=h(()=>R((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),q=l?i.attachments.add:fe,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,a)=>m+a.size,0);if(n>0){let m=c.filter((a)=>(a.mediaType??"").toLowerCase().startsWith("image/")).reduce((a,v)=>a+(v.size??0),0);if(Se(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${j}MB.`});return}}q(r)},[c,q,b]),J=l?i.attachments.remove:ge,U=l?i.attachments.clear:be,K=l?i.attachments.openFileDialog:de;M(()=>{if(!l)return;i.__registerFileInput(x,()=>x.current?.click())},[l,i]),M(()=>{if(B&&x.current&&c.length===0)x.current.value=""},[c,B]),M(()=>{let e=S.current;if(!e)return;if(w)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,w]),M(()=>{if(!w)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,w]),M(()=>()=>{if(!l){for(let e of O.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ve=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},Q=Te(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:J,clear:U,openFileDialog:K,fileInputRef:x}),[c,L,J,U,K]),_=E({controller:i,files:c,canSubmit:f});_.current={controller:i,files:c,canSubmit:f};let z=E(!0);M(()=>(z.current=!0,()=>{z.current=!1}),[]);let V=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(N.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=S.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?i.textInput.value:ie(t),m=i?.textInput.getRevision?.(),a=c,v=()=>{if(!z.current)return;let p=_.current;if(p.files!==a)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(ie(t)===n)t.reset();U()};N.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Ne(a),H=_.current.canSubmit===void 0?!0:_.current.canSubmit();if(H!==!0)return{status:"blocked",reason:H};if(!z.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ue({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{N.current=!1}},he=(e)=>{e.preventDefault(),V(e).catch(y)},Pe=h((e)=>{if(!e.trim())return;if(l&&i)Me(()=>{i.textInput.setInput(e)});S.current?.requestSubmit()},[i,l]),re=o(Z.Provider,{value:()=>V(null),children:o(X.Provider,{value:Pe,children:[o("input",{accept:A,"aria-label":"Upload files",className:"hidden",multiple:ae,onChange:ve,ref:x,title:"Upload files",type:"file"},void 0,!1,void 0,this),o("form",{className:P("w-full",u),onSubmit:he,ref:S,"data-tour":"chat-input",...pe,children:o(Qe,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",me&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:le},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return l?o(C.Provider,{value:Q,children:re},void 0,!1,void 0,this):o(Y.Provider,{value:Q,children:re},void 0,!1,void 0,this)};function Re({className:u,...s}){return o("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...s},void 0,!1,void 0,this)}function Ue({className:u,...s}){return o(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...s},void 0,!1,void 0,this)}function Be({className:u,...s}){return o(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...s},void 0,!1,void 0,this)}function Oe({className:u,...s}){return o("div",{className:P("flex items-center gap-1",u),...s},void 0,!1,void 0,this)}var We=({variant:u="ghost",className:s,size:I,collapsed:d=!1,...y})=>{let f=d||se.count(y.children)<=1?"icon-xs":"xs";return o(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||se.count(y.children)<=1)&&"size-7",s),size:f,type:"button",variant:u,...y},void 0,!1,void 0,this)},Ge=({className:u,variant:s="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=o(Ie,{className:"size-4"},void 0,!1,void 0,this);if(d==="submitted")g=o(ye,{className:"size-4 animate-spin"},void 0,!1,void 0,this);else if(d==="streaming")g=o(xe,{className:"size-3 fill-current"},void 0,!1,void 0,this);else if(d==="error")g=o(Le,{className:"size-4"},void 0,!1,void 0,this);return o(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:s,...f,children:y??g},void 0,!1,void 0,this)};export{j as MAX_TOTAL_IMAGE_MB,De as PromptInput,Re as PromptInputBody,We as PromptInputButton,Be as PromptInputFooter,Ue as PromptInputHeader,Ge as PromptInputSubmit,Oe as PromptInputTools};
1
+ import{Ze,ae}from"../chunk-reqrpvyy.js";import"../chunk-0e1pdbec.js";import{Ve}from"../chunk-src2j5cw.js";import"../chunk-wjejhpgw.js";import"../chunk-d0ptk8x8.js";import"../chunk-2r04c28x.js";import{ze,ee,te}from"../chunk-s365bfbf.js";import{O,B,k,C,z}from"../chunk-w5mg77ac.js";import{cn as P}from"cn";import{ArrowUpIcon as Ie,Loader2Icon as ye,SquareIcon as xe,XIcon as Le}from"lucide-react";import{Children as oe,useCallback as h,useEffect as F,useMemo as Te,useRef as M,useState as Fe}from"react";import{flushSync as Me}from"react-dom";import{jsx as a,jsxs as Ee}from"react/jsx-runtime";function se(u){let o=new FormData(u).get("message");return typeof o==="string"?o:""}var Ne=({className:u,bashMode:o=!1,attachmentPolicy:I,onCommand:d,onSubmitError:y,canSubmit:f,onSubmitAsync:g,accept:E,multiple:ie,globalDrop:A,syncHiddenInput:G,maxFiles:D,maxFileSize:N,onError:b,onSubmit:ue,children:le,...pe})=>{let s=C(),l=!!s,me=o&&l&&s.textInput.value.startsWith("!"),x=M(null),w=M(null),R=M(!1),[ce,U]=Fe([]),c=l?s.attachments.files:ce,j=M(c);j.current=c;let de=h(()=>{x.current?.click()},[]),q=h((e)=>{if(!E||E.trim()==="")return!0;return E.split(",").map((t)=>t.trim()).filter(Boolean).some((t)=>{if(t.endsWith("/*")){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t})},[E]),X=h((e)=>{if(e.type)return e.type;let r=(e.name||"").toLowerCase();if(r.endsWith(".png"))return"image/png";if(r.endsWith(".jpg")||r.endsWith(".jpeg"))return"image/jpeg";if(r.endsWith(".webp"))return"image/webp";if(r.endsWith(".gif"))return"image/gif";if(r.endsWith(".bmp"))return"image/bmp";if(r.endsWith(".svg"))return"image/svg+xml";return""},[]),fe=h((e)=>{let r=[...e],t=r.filter((i)=>q(i));if(r.length&&t.length===0){b?.({code:"accept",message:"No files match the accepted types."});return}let n=(i)=>N?i.size<=N:!0,m=t.filter(n);if(t.length>0&&m.length===0){b?.({code:"max_file_size",message:"All files exceed the maximum size."});return}U((i)=>{let v=I?I.uniqueFiles(m,i):m,p=typeof D==="number"?Math.max(0,D-i.length):void 0,H=typeof p==="number"?v.slice(0,p):v;if(typeof p==="number"&&v.length>p)b?.({code:"max_files",message:"Too many files. Some were not added."});let re=[];for(let T of H){let ne=I?.sourcePath(T);re.push({id:crypto.randomUUID(),type:"file",url:URL.createObjectURL(T),mediaType:X(T),filename:T.name,size:T.size,lastModified:T.lastModified,...ne===void 0?{}:{sourcePath:ne}})}return[...i,...re]})},[I,X,q,D,N,b]),ge=h((e)=>U((r)=>{let t=r.find((n)=>n.id===e);if(t?.url)URL.revokeObjectURL(t.url);return r.filter((n)=>n.id!==e)}),[]),be=h(()=>U((e)=>{for(let r of e)if(r.url)URL.revokeObjectURL(r.url);return[]}),[]),J=l?s.attachments.add:fe,L=h((e)=>{let r=[...e],t=r.filter((m)=>!(m.type??"").toLowerCase().startsWith("image/"));if(t.length>0){b?.({code:"unsupported_type",message:`Only image attachments are supported. ${t.length} non-image file(s) were ignored.`});return}let n=r.reduce((m,i)=>m+i.size,0);if(n>0){let m=c.filter((i)=>(i.mediaType??"").toLowerCase().startsWith("image/")).reduce((i,v)=>i+(v.size??0),0);if(Ze(m,n)){b?.({code:"max_total_size",message:`Total image size must not exceed ${ae}MB.`});return}}J(r)},[c,J,b]),K=l?s.attachments.remove:ge,W=l?s.attachments.clear:be,Q=l?s.attachments.openFileDialog:de;F(()=>{if(!l)return;s.__registerFileInput(x,()=>x.current?.click())},[l,s]),F(()=>{if(G&&x.current&&c.length===0)x.current.value=""},[c,G]),F(()=>{let e=w.current;if(!e)return;if(A)return;let r=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault()},t=(n)=>{if(n.dataTransfer?.types?.includes("Files"))n.preventDefault();if(n.dataTransfer?.files&&n.dataTransfer.files.length>0)L(n.dataTransfer.files)};return e.addEventListener("dragover",r),e.addEventListener("drop",t),()=>{e.removeEventListener("dragover",r),e.removeEventListener("drop",t)}},[L,A]),F(()=>{if(!A)return;let e=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault()},r=(t)=>{if(t.dataTransfer?.types?.includes("Files"))t.preventDefault();if(t.dataTransfer?.files&&t.dataTransfer.files.length>0)L(t.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",r),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",r)}},[L,A]),F(()=>()=>{if(!l){for(let e of j.current)if(e.url)URL.revokeObjectURL(e.url)}},[l]);let ve=(e)=>{if(e.currentTarget.files)L(e.currentTarget.files);e.currentTarget.value=""},V=Te(()=>({files:c.map((e)=>({...e,id:e.id})),add:L,remove:K,clear:W,openFileDialog:Q,fileInputRef:x}),[c,L,K,W,Q]),S=M({controller:s,files:c,canSubmit:f});S.current={controller:s,files:c,canSubmit:f};let _=M(!0);F(()=>(_.current=!0,()=>{_.current=!1}),[]);let Y=async(e)=>{let r=f===void 0?!0:f();if(r!==!0)return{status:"blocked",reason:r};if(R.current)return{status:"blocked",reason:"submission_pending"};if(e===null&&g===void 0)throw Error("Awaitable submission requires onSubmitAsync");let t=w.current;if(t===null)return{status:"blocked",reason:"form_unmounted"};let n=l?s.textInput.value:se(t),m=s?.textInput.getRevision?.(),i=c,v=()=>{if(!_.current)return;let p=S.current;if(p.files!==i)return;if(l){if(m===void 0||p.controller===null||p.controller.textInput.getRevision?.()!==m)return;if(p.controller.textInput.clearSubmitted===void 0)p.controller.textInput.clear();else p.controller.textInput.clearSubmitted()}else if(se(t)===n)t.reset();W()};R.current=!0;try{if(d?.(n.trim()))return v(),{status:"accepted"};let p=await Ve(i),H=S.current.canSubmit===void 0?!0:S.current.canSubmit();if(H!==!0)return{status:"blocked",reason:H};if(!_.current)return{status:"blocked",reason:"form_unmounted"};if(p.rejectedCount>0)b?.({code:"accept",message:"One or more images are corrupted and were removed before sending."});if(g!==void 0)await g({text:n,files:p.files});else if(e!==null)await ue({text:n,files:p.files},e);return v(),{status:"accepted"}}finally{R.current=!1}},he=(e)=>{e.preventDefault(),Y(e).catch(y)},Pe=h((e)=>{if(!e.trim())return;if(l&&s)Me(()=>{s.textInput.setInput(e)});w.current?.requestSubmit()},[s,l]),Z=a(B.Provider,{value:()=>Y(null),children:Ee(O.Provider,{value:Pe,children:[a("input",{accept:E,"aria-label":"Upload files",className:"hidden",multiple:ie,onChange:ve,ref:x,title:"Upload files",type:"file"}),a("form",{className:P("w-full",u),onSubmit:he,ref:w,"data-tour":"chat-input",...pe,children:a(ze,{className:P("codex-composer-surface overflow-y-auto has-[[data-slot=input-group-control]:focus-visible]:ring-0",me&&"border! border-[rgb(255,0,135)] has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(255,0,135)] dark:border-[rgb(253,93,177)] dark:has-[[data-slot=input-group-control]:focus-visible]:border-[rgb(253,93,177)]"),children:le})})]})});return l?a(k.Provider,{value:V,children:Z}):a(z.Provider,{value:V,children:Z})};function Re({className:u,...o}){return a("div",{className:P("flex w-full min-w-0 flex-row items-end gap-2",u),...o})}function Ue({className:u,...o}){return a(ee,{align:"block-end",className:P("order-first flex-wrap gap-1 p-2 pb-1.5",u),...o})}function Be({className:u,...o}){return a(ee,{align:"block-end",className:P("mt-3.5 justify-between gap-1 p-0",u),...o})}function Oe({className:u,...o}){return a("div",{className:P("flex items-center gap-1",u),...o})}var We=({variant:u="ghost",className:o,size:I,collapsed:d=!1,...y})=>{let f=d||oe.count(y.children)<=1?"icon-xs":"xs";return a(te,{className:P("h-7 rounded-full text-xs font-medium hover:bg-transparent dark:hover:bg-transparent",(d||oe.count(y.children)<=1)&&"size-7",o),size:f,type:"button",variant:u,...y})},Ge=({className:u,variant:o="ghost",size:I="icon-xs",status:d,children:y,...f})=>{let g=a(Ie,{className:"size-4"});if(d==="submitted")g=a(ye,{className:"size-4 animate-spin"});else if(d==="streaming")g=a(xe,{className:"size-3 fill-current"});else if(d==="error")g=a(Le,{className:"size-4"});return a(te,{"aria-label":"Submit",className:P("bg-foreground text-background hover:bg-foreground/70 size-7 rounded-full p-0 transition-opacity disabled:opacity-50",u),size:I,type:"submit",variant:o,...f,children:y??g})};export{ae as MAX_TOTAL_IMAGE_MB,Ne as PromptInput,Re as PromptInputBody,We as PromptInputButton,Be as PromptInputFooter,Ue as PromptInputHeader,Ge as PromptInputSubmit,Oe as PromptInputTools};
@@ -1 +1 @@
1
- import{Re}from"./chunk-d1xydh51.js";export{Re as ImageLightbox};
1
+ import{ke}from"./chunk-6f7mdmsp.js";export{ke as ImageLightbox};
@@ -1 +1 @@
1
- import{Ae}from"./chunk-51qk29t6.js";import"./chunk-wf194rae.js";import"./chunk-2kjmc9hg.js";import"./chunk-xgy0heva.js";export{Ae as ImagePreviewDialog};
1
+ import{Ke}from"./chunk-3dr41azp.js";import"./chunk-qwe4sfh0.js";import"./chunk-wjejhpgw.js";import"./chunk-qj8r5xvx.js";export{Ke as ImagePreviewDialog};
@@ -1 +1 @@
1
- import{ke}from"../chunk-kew8ef6z.js";export{ke as createCodeHighlighter};
1
+ import{tt}from"../chunk-25na55ve.js";export{tt as createCodeHighlighter};
package/dist/lib/fuzzy.js CHANGED
@@ -1 +1 @@
1
- import{G,Pe}from"../chunk-z3gwnjmk.js";export{Pe as fuzzyFilter,G as fuzzyMatch};
1
+ import{se,Je}from"../chunk-hnt4tt1n.js";export{Je as fuzzyFilter,se as fuzzyMatch};
@@ -1 +1 @@
1
- import{fe}from"../chunk-7471tnsq.js";import"../chunk-nvtvm7jc.js";export{fe as groupBlocksForStyle};
1
+ import{Ue}from"../chunk-s3z33k7f.js";import"../chunk-y2xbq7rb.js";export{Ue as groupBlocksForStyle};
@@ -1 +1 @@
1
- import{Ee}from"../chunk-ta690ra0.js";export{Ee as convertBlobUrlToDataUrl};
1
+ import{Qe}from"../chunk-0e1pdbec.js";export{Qe as convertBlobUrlToDataUrl};
@@ -1 +1 @@
1
- import{kt,Ct,Se,Tt,j}from"../chunk-wbpw278r.js";export{kt as BYTES_PER_MB,Ct as MAX_TOTAL_IMAGE_BYTES,j as MAX_TOTAL_IMAGE_MB,Se as exceedsImageLimit,Tt as formatImageSizeMb};
1
+ import{At,Ft,Ze,Dt,ae}from"../chunk-reqrpvyy.js";export{At as BYTES_PER_MB,Ft as MAX_TOTAL_IMAGE_BYTES,ae as MAX_TOTAL_IMAGE_MB,Ze as exceedsImageLimit,Dt as formatImageSizeMb};
@@ -1 +1 @@
1
- import{K,we}from"../chunk-tm40sncc.js";export{K as cachedMarkdown,we as createMarkdownParser};
1
+ import{ie,Xe}from"../chunk-g20b01rn.js";export{ie as cachedMarkdown,Xe as createMarkdownParser};
@@ -1 +1 @@
1
- import{Ce,W}from"../chunk-aaybyhdj.js";export{Ce as createChatMarkdown,W as isSafeMarkdownUrl};
1
+ import{$e,re}from"../chunk-9me7jmzd.js";export{$e as createChatMarkdown,re as isSafeMarkdownUrl};
@@ -1 +1 @@
1
- import{V}from"../chunk-eyn3tdcs.js";export{V as formatModelName};
1
+ import{oe}from"../chunk-p9wpghey.js";export{oe as formatModelName};
@@ -1 +1 @@
1
- import{Fe}from"../chunk-wf194rae.js";export{Fe as getPointerCenteredScrollPosition};
1
+ import{Ye}from"../chunk-qj8r5xvx.js";export{Ye as getPointerCenteredScrollPosition};
@@ -1 +1 @@
1
- import{Ne}from"../chunk-98t2nc02.js";import"../chunk-ta690ra0.js";export{Ne as preparePromptFiles};
1
+ import{Ve}from"../chunk-src2j5cw.js";import"../chunk-0e1pdbec.js";export{Ve as preparePromptFiles};
@@ -1 +1 @@
1
- import{vt,ve,ot,l,bt}from"../chunk-nvtvm7jc.js";export{vt as STREAM_STYLES,ot as TOOL_CATEGORIES,l as describeToolUse,ve as isCodexLook,bt as toolDotClass};
1
+ import{Ht,et,mt,d,Ot}from"../chunk-y2xbq7rb.js";export{Ht as STREAM_STYLES,mt as TOOL_CATEGORIES,d as describeToolUse,et as isCodexLook,Ot as toolDotClass};
@@ -1,2 +1,2 @@
1
- import{Ce}from"../chunk-aaybyhdj.js";function T(e,o){let t=Object.keys(e);return t.length===Object.keys(o).length&&t.every((r)=>{let i=o[r];return e[r].href===i?.href&&e[r].title===i.title})}function b(e,o){let t=2,r=0;for(let n=e.length-1;n>=0;n-=1){if(e[n].type==="space")continue;if(t-=1,t===0){r=n;break}}let i=0;for(let n=0;n<r;n+=1){let l=e[n];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return i;let k=!1;if(o.walkTokens([e[n]],(a)=>{if(a.type==="html"&&(("inLink"in a)&&a.inLink||("inRawBlock"in a)&&a.inRawBlock))k=!0}),k)return i;if(/\n[\t ]*\n$/.test(e[n].raw))i=n+1}return i}function L(e=Ce()){let o="",t=[],r={},i={};return{parse(n){let l=n.replaceAll(/\r\n|\r/g,`
1
+ import{$e}from"../chunk-9me7jmzd.js";function T(e,o){let t=Object.keys(e);return t.length===Object.keys(o).length&&t.every((r)=>{let i=o[r];return e[r].href===i?.href&&e[r].title===i.title})}function b(e,o){let t=2,r=0;for(let n=e.length-1;n>=0;n-=1){if(e[n].type==="space")continue;if(t-=1,t===0){r=n;break}}let i=0;for(let n=0;n<r;n+=1){let l=e[n];if(l.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(l.raw))return i;let k=!1;if(o.walkTokens([e[n]],(a)=>{if(a.type==="html"&&(("inLink"in a)&&a.inLink||("inRawBlock"in a)&&a.inRawBlock))k=!0}),k)return i;if(/\n[\t ]*\n$/.test(e[n].raw))i=n+1}return i}function L(e=$e()){let o="",t=[],r={},i={};return{parse(n){let l=n.replaceAll(/\r\n|\r/g,`
2
2
  `);if(!l.startsWith(o))o="",t=[],r={},i={};let k=new e.Lexer(e.defaults);k.tokens.links={...r};let a=k.lex(l.slice(o.length)),f=[...t,...a],u=a.links;if(t.length>0&&!T(i,u)){let s=e.lexer(l);f=[...s],u=s.links}i=u;let h=0,d=[];for(let s of f){if(!l.startsWith(s.raw,h))break;d.push(s),h+=s.raw.length}return t=d.slice(0,b(d,e)),o=l.slice(0,t.reduce((s,c)=>s+c.raw.length,0)),r=Object.create(null),e.walkTokens(t,(s)=>{if(s.type!=="def")return;let c=s;if(!Object.hasOwn(r,c.tag))r[c.tag]={href:c.href,title:c.title}}),structuredClone(f)}}}export{L as createStreamingMarkdownLexer};
@@ -1 +1 @@
1
- import{e}from"../chunk-xgy0heva.js";import"../chunk-ake02dgs.js";import{ce}from"../chunk-9cdspnb1.js";import"../chunk-11n6ah6p.js";import{A}from"../chunk-h7y6vmb3.js";import{cn as Y}from"cn";import{SearchIcon as Z}from"lucide-react";import{useCallback as _,useEffect as g,useMemo as z,useRef as v,useState as R}from"react";import{jsxDEV as y,Fragment as et}from"react/jsx-dev-runtime";var D="chat-search",F="chat-search-current",U=150;function it(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var j=12;function J(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let d=o.getBoundingClientRect(),m=l.getBoundingClientRect(),x=r==="start"?j:(l.clientHeight-d.height)/2;l.scrollTo({top:l.scrollTop+(d.top-m.top)-x,behavior:"smooth"})}function q(o){let r=o.startContainer.parentElement;if(!r)return;J(r)}var T=new Map;function Q(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(T.size===0){CSS.highlights.delete(D),CSS.highlights.delete(F);return}let o=[...T.values()];CSS.highlights.set(D,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(F,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function tt(){let o=Symbol();return{clearHighlights:()=>{T.delete(o),Q()},applyHighlights:(r,l)=>{T.set(o,{all:r,current:l}),Q()}}}function ut({getViewport:o,findSourceMatches:r,revealTurn:l,subscribeOpen:d,labels:m,placement:x="header"}){let{clearHighlights:i,applyHighlights:p}=z(tt,[]),S=r!==void 0,[s,w]=R(!1),[u,K]=R(""),h=z(()=>s&&u.trim()&&r?r(u.trim()):[],[r,s,u]),[O,L]=R(0),[V,E]=R(0),C=v([]),H=v(0),a=v(null),P=v(null),G=v(null);g(()=>{if(!d)return;return d(()=>{w(!0);let t=G.current;if(t!==null)t.focus(),t.select()})},[d]);let I=_(async(c,t)=>{let n=h[c];if(n===void 0)return;let f=o();if(f===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let b=f.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(b===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!l)J(b,"start");if(await new Promise((X)=>requestAnimationFrame(()=>X())),t.aborted)return;let B=A(b,u.trim());C.current=B;let N=B[n.occurrenceInTurn];if(p(B,N??null),N!==void 0)q(N)},[p,h,o,u,l]),k=v(I);g(()=>{k.current=I},[I]);let M=_(()=>{w(!1),K(""),H.current=0,a.current?.abort(),a.current=null,i(),C.current=[]},[i]);g(()=>{if(!s)return;let c=(t)=>{if(t.key==="Escape"&&P.current?.contains(document.activeElement))t.preventDefault(),M()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s,M]),g(()=>{if(!s||!u.trim()){i(),C.current=[],L(0),E(0),H.current=0;return}let c=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=A(t,u);if(C.current=n,L(n.length),E(0),p(n,n[0]??null),n[0])q(n[0])},U);return()=>{clearTimeout(c),i()}},[p,i,S,s,u,o]),g(()=>{if(!s||!S||!u.trim())return;let c=new AbortController;a.current?.abort(),a.current=c;let t=setTimeout(()=>{C.current=[],H.current=0,L(h.length),E(0),i(),k.current(0,c.signal)},U);return()=>{if(c.abort(),a.current===c)a.current=null;clearTimeout(t),i()}},[i,h.length,S,s,u]),g(()=>()=>{a.current?.abort(),i()},[i]),g(()=>{if(!s)i()},[i,s]);let W=_((c)=>{if(S){if(h.length===0)return;let n=(H.current+(c?-1:1)+h.length)%h.length;H.current=n,E(n),a.current?.abort();let f=new AbortController;a.current=f,k.current(n,f.signal);return}let t=C.current;if(!t.length)return;E((n)=>{let f=(n+(c?-1:1)+t.length)%t.length,b=t[f];return p(t,b),q(b),f})},[p,h.length,S]);return y(et,{children:[x==="header"&&y(e,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>s?M():w(!0),children:y(Z,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),s&&y("div",{"data-chat-search":!0,ref:P,className:Y("bg-background border-b",x==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[y(ce,{ref:G,value:u,onChange:K,onFind:W,onClose:M,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next},void 0,!1,void 0,this),u.trim()&&y("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:O===0?"0 / 0":`${V+1} / ${O}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{ut as ChatSearch,A as collectMatches,it as findChatScrollContainer,J as scrollChatElementIntoView};
1
+ import{e}from"../chunk-wjejhpgw.js";import"../chunk-1hy64ewz.js";import{xe}from"../chunk-pk9khgvs.js";import"../chunk-qyhgwc51.js";import{A}from"../chunk-rakd7vzb.js";import{cn as Z}from"cn";import{SearchIcon as j}from"lucide-react";import{useCallback as _,useEffect as g,useMemo as z,useRef as v,useState as M}from"react";import{jsx as R,jsxs as J,Fragment as rt}from"react/jsx-runtime";var D="chat-search",F="chat-search-current",U=150;function st(o){let r=o??"";return[...document.querySelectorAll("[data-chat-scroll]")].find((l)=>l.dataset.chatScroll===r)??null}var tt=12;function V(o,r="center"){let l=o.closest("[data-chat-scroll]");if(!l)return;let d=o.getBoundingClientRect(),m=l.getBoundingClientRect(),H=r==="start"?tt:(l.clientHeight-d.height)/2;l.scrollTo({top:l.scrollTop+(d.top-m.top)-H,behavior:"smooth"})}function q(o){let r=o.startContainer.parentElement;if(!r)return;V(r)}var T=new Map;function Q(){if(typeof CSS>"u"||!("highlights"in CSS)||typeof Highlight>"u")return;if(T.size===0){CSS.highlights.delete(D),CSS.highlights.delete(F);return}let o=[...T.values()];CSS.highlights.set(D,new Highlight(...o.flatMap((r)=>r.all))),CSS.highlights.set(F,new Highlight(...o.flatMap((r)=>r.current?[r.current]:[])))}function et(){let o=Symbol();return{clearHighlights:()=>{T.delete(o),Q()},applyHighlights:(r,l)=>{T.set(o,{all:r,current:l}),Q()}}}function at({getViewport:o,findSourceMatches:r,revealTurn:l,subscribeOpen:d,labels:m,placement:H="header"}){let{clearHighlights:i,applyHighlights:p}=z(et,[]),S=r!==void 0,[s,w]=M(!1),[u,K]=M(""),h=z(()=>s&&u.trim()&&r?r(u.trim()):[],[r,s,u]),[O,L]=M(0),[W,y]=M(0),C=v([]),E=v(0),a=v(null),P=v(null),G=v(null);g(()=>{if(!d)return;return d(()=>{w(!0);let t=G.current;if(t!==null)t.focus(),t.select()})},[d]);let I=_(async(c,t)=>{let n=h[c];if(n===void 0)return;let f=o();if(f===null)throw Error("Chat scroll container is missing");if(l)await l(n.turnKey,t);if(t.aborted)return;let b=f.querySelector(`[data-turn-key="${CSS.escape(n.turnKey)}"]`);if(b===null)throw Error(`Codex turn is missing: ${n.turnKey}`);if(!l)V(b,"start");if(await new Promise((Y)=>requestAnimationFrame(()=>Y())),t.aborted)return;let B=A(b,u.trim());C.current=B;let N=B[n.occurrenceInTurn];if(p(B,N??null),N!==void 0)q(N)},[p,h,o,u,l]),k=v(I);g(()=>{k.current=I},[I]);let x=_(()=>{w(!1),K(""),E.current=0,a.current?.abort(),a.current=null,i(),C.current=[]},[i]);g(()=>{if(!s)return;let c=(t)=>{if(t.key==="Escape"&&P.current?.contains(document.activeElement))t.preventDefault(),x()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s,x]),g(()=>{if(!s||!u.trim()){i(),C.current=[],L(0),y(0),E.current=0;return}let c=setTimeout(()=>{if(S)return;let t=o();if(!t)return;let n=A(t,u);if(C.current=n,L(n.length),y(0),p(n,n[0]??null),n[0])q(n[0])},U);return()=>{clearTimeout(c),i()}},[p,i,S,s,u,o]),g(()=>{if(!s||!S||!u.trim())return;let c=new AbortController;a.current?.abort(),a.current=c;let t=setTimeout(()=>{C.current=[],E.current=0,L(h.length),y(0),i(),k.current(0,c.signal)},U);return()=>{if(c.abort(),a.current===c)a.current=null;clearTimeout(t),i()}},[i,h.length,S,s,u]),g(()=>()=>{a.current?.abort(),i()},[i]),g(()=>{if(!s)i()},[i,s]);let X=_((c)=>{if(S){if(h.length===0)return;let n=(E.current+(c?-1:1)+h.length)%h.length;E.current=n,y(n),a.current?.abort();let f=new AbortController;a.current=f,k.current(n,f.signal);return}let t=C.current;if(!t.length)return;y((n)=>{let f=(n+(c?-1:1)+t.length)%t.length,b=t[f];return p(t,b),q(b),f})},[p,h.length,S]);return J(rt,{children:[H==="header"&&R(e,{variant:"ghost",size:"icon-sm",title:m.search,onClick:()=>s?x():w(!0),children:R(j,{})}),s&&J("div",{"data-chat-search":!0,ref:P,className:Z("bg-background border-b",H==="body"?"relative shrink-0":"absolute inset-x-0 top-full z-30"),children:[R(xe,{ref:G,value:u,onChange:K,onFind:X,onClose:x,placeholder:m.placeholder,prevTitle:m.previous,nextTitle:m.next}),u.trim()&&R("div",{className:"text-muted-foreground border-border border-t px-3 py-1 text-[11px]",children:O===0?"0 / 0":`${W+1} / ${O}`})]})]})}export{at as ChatSearch,A as collectMatches,st as findChatScrollContainer,V as scrollChatElementIntoView};
@@ -1 +1 @@
1
- import{A}from"../chunk-h7y6vmb3.js";import"../chunk-11n6ah6p.js";export{A as collectMatches};
1
+ import{A}from"../chunk-rakd7vzb.js";import"../chunk-qyhgwc51.js";export{A as collectMatches};
@@ -1 +1 @@
1
- import{ce}from"../chunk-9cdspnb1.js";import"../chunk-ake02dgs.js";import"../chunk-xgy0heva.js";export{ce as FindBar};
1
+ import{xe}from"../chunk-pk9khgvs.js";import"../chunk-1hy64ewz.js";import"../chunk-wjejhpgw.js";export{xe as FindBar};
@@ -1 +1 @@
1
- import{B,ft}from"../chunk-11n6ah6p.js";export{ft as findTextSourceMatches,B as literalMatches};
1
+ import{q,yt}from"../chunk-qyhgwc51.js";export{yt as findTextSourceMatches,q as literalMatches};
package/dist/ui/badge.js CHANGED
@@ -1 +1 @@
1
- import{ut,ze}from"../chunk-y1cbwywe.js";export{ze as Badge,ut as badgeVariants};
1
+ import{lt,Ae}from"../chunk-341yykkp.js";export{Ae as Badge,lt as badgeVariants};
package/dist/ui/button.js CHANGED
@@ -1 +1 @@
1
- import{mt,e}from"../chunk-xgy0heva.js";export{e as Button,mt as buttonVariants};
1
+ import{ut,e}from"../chunk-wjejhpgw.js";export{e as Button,ut as buttonVariants};
package/dist/ui/card.js CHANGED
@@ -1 +1 @@
1
- import{Ve,Ke,We,qe,Lt,Ge,je}from"../chunk-x6jyxw9c.js";export{Ve as Card,Lt as CardAction,Ge as CardContent,qe as CardDescription,je as CardFooter,Ke as CardHeader,We as CardTitle};
1
+ import{Pe,Ie,Me,Ne,Pt,Se,Ee}from"../chunk-sepy631p.js";export{Pe as Card,Pt as CardAction,Se as CardContent,Ne as CardDescription,Ee as CardFooter,Ie as CardHeader,Me as CardTitle};
@@ -1 +1 @@
1
- import{x}from"../chunk-5hqv4m75.js";export{x as Checkbox};
1
+ import{w}from"../chunk-dj8v2w6n.js";export{w as Checkbox};
package/dist/ui/dialog.js CHANGED
@@ -1 +1 @@
1
- import{P,St,dt,De,ct,I,He,Oe,M,Be}from"../chunk-2kjmc9hg.js";import"../chunk-xgy0heva.js";export{P as Dialog,De as DialogClose,I as DialogContent,Be as DialogDescription,Oe as DialogFooter,He as DialogHeader,ct as DialogOverlay,dt as DialogPortal,M as DialogTitle,St as DialogTrigger};
1
+ import{E,_t,dt,We,ct,R,qe,Ge,L,je}from"../chunk-qwe4sfh0.js";import"../chunk-wjejhpgw.js";export{E as Dialog,We as DialogClose,R as DialogContent,je as DialogDescription,Ge as DialogFooter,qe as DialogHeader,ct as DialogOverlay,dt as DialogPortal,L as DialogTitle,_t as DialogTrigger};
@@ -1 +1 @@
1
- import{v,Et,b,m,y,D,w,N,S,E,J,$e,Ue,s,Rt}from"../chunk-s4w6yjc0.js";export{v as DropdownMenu,J as DropdownMenuCheckboxItem,m as DropdownMenuContent,y as DropdownMenuGroup,w as DropdownMenuItem,D as DropdownMenuLabel,Et as DropdownMenuPortal,$e as DropdownMenuRadioGroup,Ue as DropdownMenuRadioItem,s as DropdownMenuSeparator,Rt as DropdownMenuShortcut,N as DropdownMenuSub,E as DropdownMenuSubContent,S as DropdownMenuSubTrigger,b as DropdownMenuTrigger};
1
+ import{v,Et,x,m,b,H,y,P,I,M,J,Oe,Be,s,Rt}from"../chunk-0m271xz8.js";export{v as DropdownMenu,J as DropdownMenuCheckboxItem,m as DropdownMenuContent,b as DropdownMenuGroup,y as DropdownMenuItem,H as DropdownMenuLabel,Et as DropdownMenuPortal,Oe as DropdownMenuRadioGroup,Be as DropdownMenuRadioItem,s as DropdownMenuSeparator,Rt as DropdownMenuShortcut,P as DropdownMenuSub,M as DropdownMenuSubContent,I as DropdownMenuSubTrigger,x as DropdownMenuTrigger};
package/dist/ui/field.js CHANGED
@@ -1 +1 @@
1
- import{re,oe,Je,et,At,tt,Ft,H,Dt,Ht}from"../chunk-2sc7ppw2.js";import"../chunk-b5srhd6k.js";import"../chunk-pnncsvbz.js";export{et as Field,At as FieldContent,H as FieldDescription,Ht as FieldError,Je as FieldGroup,tt as FieldLabel,oe as FieldLegend,Dt as FieldSeparator,re as FieldSet,Ft as FieldTitle};
1
+ import{Z,Y,Fe,De,It,He,Mt,D,Nt,St}from"../chunk-54h8srdy.js";import"../chunk-bwzjm3g8.js";import"../chunk-wjqqh1d4.js";export{De as Field,It as FieldContent,D as FieldDescription,St as FieldError,Fe as FieldGroup,He as FieldLabel,Y as FieldLegend,Nt as FieldSeparator,Z as FieldSet,Mt as FieldTitle};
@@ -1 +1 @@
1
- import{Xe,Ze,Ye}from"../chunk-t83jwyey.js";export{Xe as HoverCard,Ye as HoverCardContent,Ze as HoverCardTrigger};
1
+ import{Re,Le,_e}from"../chunk-1twg3evk.js";export{Re as HoverCard,_e as HoverCardContent,Le as HoverCardTrigger};
@@ -1 +1 @@
1
- import{ne}from"../chunk-jnx3t913.js";import"../chunk-r9k7kszp.js";export{ne as InputGroupTextarea};
1
+ import{ne}from"../chunk-2r04c28x.js";import"../chunk-d0ptk8x8.js";export{ne as InputGroupTextarea};
@@ -1 +1 @@
1
- import{Qe,ee,te,_t}from"../chunk-pkxfrrwf.js";import"../chunk-xgy0heva.js";import{ne}from"../chunk-jnx3t913.js";import"../chunk-r9k7kszp.js";export{Qe as InputGroup,ee as InputGroupAddon,te as InputGroupButton,_t as InputGroupText,ne as InputGroupTextarea};
1
+ import{ze,ee,te,Lt}from"../chunk-s365bfbf.js";import{ne}from"../chunk-2r04c28x.js";import"../chunk-d0ptk8x8.js";import"../chunk-wjejhpgw.js";export{ze as InputGroup,ee as InputGroupAddon,te as InputGroupButton,Lt as InputGroupText,ne as InputGroupTextarea};
package/dist/ui/input.js CHANGED
@@ -1 +1 @@
1
- import{d}from"../chunk-ake02dgs.js";export{d as Input};
1
+ import{l}from"../chunk-1hy64ewz.js";export{l as Input};
package/dist/ui/label.js CHANGED
@@ -1 +1 @@
1
- import{r}from"../chunk-pnncsvbz.js";export{r as Label};
1
+ import{r}from"../chunk-bwzjm3g8.js";export{r as Label};
@@ -1 +1 @@
1
- import{c,a}from"../chunk-rka1mc9r.js";export{c as RadioGroup,a as RadioGroupItem};
1
+ import{c,a}from"../chunk-zt7a6b1m.js";export{c as RadioGroup,a as RadioGroupItem};
@@ -1 +1 @@
1
- import{R}from"../chunk-b5srhd6k.js";export{R as Separator};
1
+ import{N}from"../chunk-wjqqh1d4.js";export{N as Separator};
package/dist/ui/switch.js CHANGED
@@ -1 +1 @@
1
- import{L}from"../chunk-j63t6dxg.js";export{L as Switch};
1
+ import{S}from"../chunk-kscn218z.js";export{S as Switch};
@@ -1 +1 @@
1
- import{o}from"../chunk-r9k7kszp.js";export{o as Textarea};
1
+ import{o}from"../chunk-d0ptk8x8.js";export{o as Textarea};
@@ -1 +1 @@
1
- import{Ot,ie,ae,se}from"../chunk-qf9n7v84.js";export{ie as Tooltip,se as TooltipContent,Ot as TooltipProvider,ae as TooltipTrigger};
1
+ import{kt,G,j,Q}from"../chunk-vq236zge.js";export{G as Tooltip,Q as TooltipContent,kt as TooltipProvider,j as TooltipTrigger};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwith/module-chat",
3
- "version": "0.1.30",
3
+ "version": "0.1.31",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,2 +0,0 @@
1
- function*B(n,e){if(e.length===0)return;let r=new RegExp(e.replaceAll(/[.*+?^{}()|[\]\\$]/g,String.raw`\$&`),"giu");for(let t of n.matchAll(r))yield{start:t.index,end:t.index+t[0].length}}function ft(n,e){if(e.length===0)return[];let r=[];for(let{turnKey:t,segments:o}of n){let c=0;for(let s of o)for(let a of B(s,e))r.push({turnKey:t,occurrenceInTurn:c}),c+=1}return r}
2
- export{B,ft};
@@ -1,2 +0,0 @@
1
- import{G,Pe}from"./chunk-z3gwnjmk.js";function c(t){return{key:t.name,label:t.name,description:t.description??void 0,payload:t.name}}function q(t,s,o=50){let i=new Set,r=t.filter((n)=>{if(i.has(n.name))return!1;return i.add(n.name),!0});if(!s)return r.slice(0,o).map(c);let l=s.toLowerCase(),e=[];for(let n of r){let a=G(n.name,s);if(a)e.push({c:n,score:a.score});else if(n.description?.toLowerCase().includes(l))e.push({c:n,score:-1})}return e.sort((n,a)=>a.score-n.score),e.slice(0,o).map((n)=>c(n.c))}function wt(t,s,o,i=50){let r=o?`${o.replace(/\/$/,"")}/`:"",l=t.map((e)=>({abs:e,rel:r&&e.startsWith(r)?e.slice(r.length):e}));return Pe(l,s,(e)=>e.rel,i).map(({item:e})=>({key:e.abs,label:e.rel,payload:e.abs}))}
2
- export{q,wt};
@@ -1 +0,0 @@
1
- import{e}from"./chunk-xgy0heva.js";import{Dialog as i}from"@base-ui/react/dialog";import{cn as r}from"cn";import{XIcon as s}from"lucide-react";import{jsxDEV as a}from"react/jsx-dev-runtime";function P({...o}){return a(i.Root,{"data-slot":"dialog",...o},void 0,!1,void 0,this)}function St({...o}){return a(i.Trigger,{"data-slot":"dialog-trigger",...o},void 0,!1,void 0,this)}function dt({...o}){return a(i.Portal,{"data-slot":"dialog-portal",...o},void 0,!1,void 0,this)}function De({...o}){return a(i.Close,{"data-slot":"dialog-close",...o},void 0,!1,void 0,this)}function ct({className:o,...t}){return a(i.Backdrop,{"data-slot":"dialog-overlay",className:r("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",o),...t},void 0,!1,void 0,this)}function I({className:o,children:t,showCloseButton:l=!0,...n}){return a(dt,{children:[a(ct,{},void 0,!1,void 0,this),a(i.Popup,{"data-slot":"dialog-content",className:r("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md",o),...n,children:[t,l&&a(i.Close,{"data-slot":"dialog-close",render:a(e,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm"},void 0,!1,void 0,this),children:[a(s,{},void 0,!1,void 0,this),a("span",{className:"sr-only",children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function He({className:o,...t}){return a("div",{"data-slot":"dialog-header",className:r("flex flex-col gap-2",o),...t},void 0,!1,void 0,this)}function Oe({className:o,showCloseButton:t=!1,children:l,...n}){return a("div",{"data-slot":"dialog-footer",className:r("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),...n,children:[l,t&&a(i.Close,{render:a(e,{variant:"outline"},void 0,!1,void 0,this),children:"Close"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function M({className:o,...t}){return a(i.Title,{"data-slot":"dialog-title",className:r("font-heading leading-none font-medium",o),...t},void 0,!1,void 0,this)}function Be({className:o,...t}){return a(i.Description,{"data-slot":"dialog-description",className:r("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",o),...t},void 0,!1,void 0,this)}export{P,St,dt,De,ct,I,He,Oe,M,Be};
@@ -1 +0,0 @@
1
- import{r}from"./chunk-pnncsvbz.js";import{R}from"./chunk-b5srhd6k.js";import{cva as p}from"class-variance-authority";import{cn as l}from"cn";import{useMemo as u}from"react";import{jsxDEV as t}from"react/jsx-dev-runtime";function re({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},void 0,!1,void 0,this)}function oe({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},void 0,!1,void 0,this)}function Je({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},void 0,!1,void 0,this)}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 et({className:a,orientation:e="vertical",...o}){return t("div",{role:"group","data-slot":"field","data-orientation":e,className:l(c({orientation:e}),a),...o},void 0,!1,void 0,this)}function At({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},void 0,!1,void 0,this)}function tt({className:a,...e}){return t(r,{"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},void 0,!1,void 0,this)}function Ft({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},void 0,!1,void 0,this)}function H({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},void 0,!1,void 0,this)}function Dt({children:a,className:e,...o}){return t("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(R,{className:"absolute inset-0 top-1/2"},void 0,!1,void 0,this),a&&t("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Ht({className:a,children:e,errors:o,...n}){let s=u(()=>{if(e)return e;if(!o?.length)return null;let i=[...new Map(o.map((d)=>[d?.message,d])).values()];if(i?.length==1)return i[0]?.message;return t("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:i.map((d,f)=>d?.message&&t("li",{children:d.message},f,!1,void 0,this))},void 0,!1,void 0,this)},[e,o]);if(!s)return null;return t("div",{role:"alert","data-slot":"field-error",className:l("text-destructive text-sm font-normal",a),...n,children:s},void 0,!1,void 0,this)}export{re,oe,Je,et,At,tt,Ft,H,Dt,Ht};
@@ -1,2 +0,0 @@
1
- import{Fe}from"./chunk-wf194rae.js";import{P,De,I,M}from"./chunk-2kjmc9hg.js";import{cn as p}from"cn";import{XIcon as L}from"lucide-react";import{useCallback as v,useEffect as N,useMemo as j,useRef as y,useState as b}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";function Ae({open:l,onOpenChange:z,url:h,filename:O,scale:d,onScaleChange:f,containerRef:H,containerClassName:T,dialogContentClassName:R,imageClassName:W}){let g=v((e)=>Math.min(4,Math.max(0.25,e)),[]),[Z,S]=b(1),o=g(d??Z),k=y(null),s=H??k,x=y(null),[m,C]=b({width:0,height:0}),[D,E]=b({width:0,height:0}),w=v((e)=>{let n=g(e);if(typeof f==="function"){f(n);return}S(n)},[f,g]);N(()=>{if(!l)return;if(!h)return;if(typeof d==="number")return;S(1)},[l,h,d]),N(()=>{if(!l)return;let e=s.current;if(!e)return;let n=()=>{C({width:e.clientWidth,height:e.clientHeight})};n();let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}},[s,l]);let X=v(()=>{w(1)},[w]),r=j(()=>{let{width:e,height:n}=D,{width:t,height:a}=m;if(e===0||n===0)return{width:0,height:0};if(t===0||a===0)return{width:0,height:0};let c=Math.min(t/e,a/n,1),u=e*c,_=n*c;return{width:u*o,height:_*o}},[o,D,m]);if(!h)return null;return i(P,{open:l,onOpenChange:z,children:i(I,{className:p("top-1/2 left-1/2 h-[90vh] max-h-[90vh] w-[90vw]! max-w-[90vw]! -translate-x-1/2 -translate-y-1/2 gap-0 rounded-none bg-transparent p-0 ring-0 sm:w-[90vw]! sm:max-w-[90vw]!",R),showCloseButton:!1,children:[i(M,{className:"sr-only",children:O||"Image preview"},void 0,!1,void 0,this),i(De,{"aria-label":"Close",className:"absolute top-3 right-3 z-10 flex size-10 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur-sm transition-colors hover:bg-black/75",children:i(L,{className:"size-5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),i("div",{ref:s,onWheel:(e)=>{if(!e.ctrlKey&&!e.metaKey)return;e.preventDefault();let n=e.deltaY>0?o-0.2:o+0.2,t=g(Number.parseFloat(n.toFixed(2)));if(t===o)return;let a=s.current,c=x.current,u=a&&c?Fe({container:a,target:c,clientX:e.clientX,clientY:e.clientY,currentScale:o,nextScale:t}):null;if(w(t),a&&u)requestAnimationFrame(()=>{a.scrollTo(u)})},className:p("h-full w-full scrollbar-thin overflow-auto",T),children:i("div",{className:"grid min-h-full min-w-full place-items-center",style:{width:Math.max(m.width,r.width),height:Math.max(m.height,r.height)},children:i("div",{className:"shrink-0",children:i("img",{alt:O||"image preview",className:p("block object-contain select-none",W),decoding:"async",draggable:!1,ref:x,onDoubleClick:X,onLoad:(e)=>{let n=e.currentTarget;E({width:n.naturalWidth,height:n.naturalHeight});let t=s.current;if(t&&(t.clientWidth||t.clientHeight))C({width:t.clientWidth,height:t.clientHeight})},style:{imageRendering:"auto",width:r.width||void 0,height:r.height||void 0,maxWidth:r.width?"none":"90vw",maxHeight:r.height?"none":"90vh"},src:h},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}
2
- export{Ae};
@@ -1 +0,0 @@
1
- import{Checkbox as e}from"@base-ui/react/checkbox";import{cn as o}from"cn";import{CheckIcon as t}from"lucide-react";import{jsxDEV as i}from"react/jsx-dev-runtime";function x({className:r,...a}){return i(e.Root,{"data-slot":"checkbox",className:o("peer border-input group-has-[:focus-visible]/field-label:not-data-checked:border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3",r),...a,children:i(e.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:i(t,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{x};
@@ -1,2 +0,0 @@
1
- import{PreviewCard as e}from"@base-ui/react/preview-card";import{jsxDEV as o}from"react/jsx-dev-runtime";function Te({open:r,onOpenChange:a,trigger:i,children:t,...n}){return o(e.Root,{open:r,onOpenChange:a,children:[o(e.Trigger,{render:i,delay:700,closeDelay:100},void 0,!1,void 0,this),o(e.Portal,{children:o(e.Positioner,{...n,className:"isolate z-50",children:o(e.Popup,{"data-slot":"codex-hover-card",className:"m-0 outline-hidden",children:t},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
- export{Te};
@@ -1,2 +0,0 @@
1
- import{t}from"./chunk-99xmegcw.js";import{i}from"./chunk-pve9b7z3.js";import{isContentEntry as b,isImage as N,isResourceLink as w}from"@alwith/api";import{ChevronRightIcon as C,ImageIcon as S,LoaderCircleIcon as A,RefreshCwIcon as R}from"lucide-react";import{useEffect as B,useState as v}from"react";import{jsxDEV as o}from"react/jsx-dev-runtime";function f(e){return e.type==="tool_use"&&e.name==="view_image"&&e.status==="completed"}function T(e){let c=[];for(let[l,u]of e.content.entries()){if(!b(u))continue;let n=u.content;if(N(n))c.push({key:`${e.id}:${l}`,src:`data:${n.mimeType};base64,${n.data}`,alt:e.title??""});if(w(n))c.push({key:`${e.id}:${l}`,path:n.uri,alt:n.name})}if(c.length)return c;let s=e.rawInput;if(s!==null&&typeof s==="object"&&"path"in s&&typeof s.path==="string")return[{key:e.id,path:s.path,alt:s.path.split(/[\\/]/).at(-1)??s.path}];throw Error(`Image view ${e.id} has no image source`)}function E({images:e}){let{loadImage:c,openImageGallery:s,openImage:l,t:u}=t(),[n,y]=v({}),[x,I]=v(0),h=JSON.stringify(e);B(()=>{let a=!0,m=JSON.parse(h);y({});for(let r of m)(r.src!==void 0?Promise.resolve(r.src):r.path!==void 0&&c?c(r.path):Promise.reject(Error("Image loading is unavailable"))).then((d)=>{if(a)y((g)=>({...g,[r.key]:{src:d}}))},()=>{if(a)y((d)=>({...d,[r.key]:{error:!0}}))});return()=>{a=!1}},[h,c,x]);let k=e.flatMap((a)=>{let m=n[a.key];return m&&"src"in m?[{src:m.src,alt:a.alt}]:[]});return o("div",{className:"codex-image-thumbnails",children:e.map((a,m)=>{let r=n[a.key];if(!r)return o("div",{className:"codex-image-thumbnail",role:"status","aria-label":u("stream.codex.imageLoading"),children:o(A,{className:"motion-safe:animate-spin","aria-hidden":"true"},void 0,!1,void 0,this)},a.key,!1,void 0,this);if("error"in r)return o("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,"aria-label":u("stream.codex.imageFailed"),onClick:()=>I((p)=>p+1),children:o(R,{"aria-hidden":"true"},void 0,!1,void 0,this)},a.key,!1,void 0,this);return o("button",{type:"button",className:"codex-image-thumbnail",title:a.alt,onClick:()=>{let p=e.slice(0,m).filter((d)=>{let g=n[d.key];return g&&"src"in g}).length;if(s)s(k,p);else l?.(r.src)},children:o("img",{src:r.src,alt:a.alt,draggable:!1},void 0,!1,void 0,this)},a.key,!1,void 0,this)})},void 0,!1,void 0,this)}function be({blocks:e}){let{t:c}=t(),s=e.flatMap(T),[l,u]=i(`image-view:${e[0].id}`,!1);return o("div",{className:"codex-activity-item",children:[o("button",{type:"button",className:"codex-activity-header","data-codex-disclosure":"","aria-expanded":l,onClick:()=>u((n)=>!n),children:[o("span",{className:"codex-activity-label",children:[o(S,{className:"codex-activity-icon","aria-hidden":"true"},void 0,!1,void 0,this),o("span",{className:"codex-activity-leading",children:c("stream.codex.viewedImages",{count:s.length})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),o(C,{className:l?"codex-image-chevron codex-image-chevron-open":"codex-image-chevron","aria-hidden":"true"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),l&&o(E,{images:s},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
- export{f,be};
@@ -1,2 +0,0 @@
1
- import{createContext as r,useContext as s}from"react";import{jsxDEV as i}from"react/jsx-dev-runtime";var n=r(null);function yt({host:o,children:e}){return i(n.Provider,{value:o,children:e},void 0,!1,void 0,this)}function t(){let o=s(n);if(o===null)throw Error("Activity host is missing");return o}function u(o){let{Markdown:e}=t();return i(e,{...o},void 0,!1,void 0,this)}
2
- export{yt,t,u};
@@ -1,2 +0,0 @@
1
- import{e}from"./chunk-xgy0heva.js";import{d}from"./chunk-ake02dgs.js";import{cn as v}from"cn";import{ChevronDownIcon as g,ChevronUpIcon as b,XIcon as z}from"lucide-react";import{useEffect as B,useImperativeHandle as N,useRef as E}from"react";import{jsxDEV as n}from"react/jsx-dev-runtime";function ce({ref:f,value:i,onChange:p,onFind:o,onClose:s,placeholder:m,autoFocusOpen:a=!0,prevTitle:l,nextTitle:c,className:h}){let r=E(null);N(f,()=>{if(r.current===null)throw Error("FindBar input is not mounted");return r.current},[]),B(()=>{if(!a)return;let t=r.current;if(t===null)throw Error("FindBar input is not mounted");t.focus(),t.select()},[a]);let u=!i;return n("div",{className:v("border-border flex h-9 shrink-0 items-center gap-1 border-b px-2",h),children:[n(d,{ref:r,value:i,onChange:(t)=>p(t.target.value),placeholder:m,className:"h-7 text-xs",onKeyDown:(t)=>{if(t.key==="Escape"){t.preventDefault(),s();return}if(t.key==="Enter"){if(t.preventDefault(),i)o(t.shiftKey)}}},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!0),title:l?`${l} (⇧↵)`:"⇧↵",children:n(b,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",disabled:u,onClick:()=>o(!1),title:c?`${c} (↵)`:"↵",children:n(g,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this),n(e,{size:"icon",variant:"ghost",className:"size-6",onClick:s,title:"Esc",children:n(z,{className:"size-3.5"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
- export{ce};
@@ -1 +0,0 @@
1
- import{Input as t}from"@base-ui/react/input";import{cn as n}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function d({className:i,type:e,...r}){return o(t,{type:e,"data-slot":"input",className:n("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-9 w-full min-w-0 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm",i),...r},void 0,!1,void 0,this)}export{d};
@@ -1 +0,0 @@
1
- import{Separator as o}from"@base-ui/react/separator";import{cn as i}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function R({className:a,orientation:r="horizontal",...t}){return e(o,{"data-slot":"separator",orientation:r,className:i("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",a),...t},void 0,!1,void 0,this)}export{R};
@@ -1,2 +0,0 @@
1
- import{CheckCircleIcon as d,CircleIcon as c,LoaderIcon as o}from"lucide-react";import{jsxDEV as e}from"react/jsx-dev-runtime";function k({entries:n}){let t=n.filter((a)=>a.status==="completed").length,s=n.find((a)=>a.status==="in_progress");return e("div",{className:"codex-plan",children:[e("div",{className:"codex-plan-summary",children:[e("span",{children:[t,"/",n.length]},void 0,!0,void 0,this),s!==void 0&&e("span",{className:"codex-plan-active",children:["· ",s.content]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),e("div",{className:"codex-plan-entries",children:n.map((a)=>e("div",{className:"codex-plan-entry","data-status":a.status,children:[a.status==="completed"&&e(d,{"aria-hidden":"true"},void 0,!1,void 0,this),a.status==="in_progress"&&e(o,{className:"codex-plan-spinner","aria-hidden":"true"},void 0,!1,void 0,this),a.status==="pending"&&e(c,{"aria-hidden":"true"},void 0,!1,void 0,this),e("span",{children:a.content},void 0,!1,void 0,this)]},a.content,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}
2
- export{k};
@@ -1,2 +0,0 @@
1
- import{$e,Ue}from"./chunk-s4w6yjc0.js";import{cn as l}from"cn";import{jsxDEV as t}from"react/jsx-dev-runtime";function n({value:a,onValueChange:i,options:o,itemClassName:d}){return t($e,{value:a,onValueChange:(e)=>i(String(e)),children:o.map((e)=>t(Ue,{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?t("div",{className:"min-w-0 flex-1",children:[t("div",{className:"text-xs font-medium",children:e.label},void 0,!1,void 0,this),t("div",{className:"text-muted-foreground text-[11px] font-normal",children:e.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this):t("span",{className:"min-w-0 flex-1 truncate text-start",children:e.label},void 0,!1,void 0,this)]},e.value,!0,void 0,this))},void 0,!1,void 0,this)}
2
- export{n};
@@ -1,2 +0,0 @@
1
- import{createPortal as n}from"react-dom";import{jsxDEV as t}from"react/jsx-dev-runtime";function Re({src:o,alt:e,onClose:i}){return n(t("button",{type:"button",className:"fixed inset-0 z-[1000] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.7)"},onClick:i,children:t("img",{src:o,alt:e,style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:4}},void 0,!1,void 0,this)},void 0,!1,void 0,this),document.body)}
2
- export{Re};
@@ -1,2 +0,0 @@
1
- function le(t){return Object.entries(t.properties??{}).map(([n,e])=>({key:n,property:e}))}function O(t){let{title:n,description:e}=t;return{title:n??void 0,description:e??void 0}}function p(t){return t.type==="array"}function _(t){return(p(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{le,O,p,_};
@@ -1,2 +0,0 @@
1
- function V(r){if(!r.trimStart().toLowerCase().startsWith("gpt"))return r;let a=/^gpt-\d/iu.test(r.trimStart())?" ":"-";return r.split(/(\s+)/).map((i)=>i.trim().length===0?i:i.split("-").map((t,o)=>{if(t.toLowerCase()==="gpt")return"GPT";if(t.toLowerCase()==="oai")return"OAI";return o>0&&t.length>0?`${t[0]?.toUpperCase()}${t.slice(1)}`:t}).join(a).replace(/^GPT (?=\d)/u,"GPT-")).join("")}
2
- export{V};
@@ -1,2 +0,0 @@
1
- import{cn as y}from"cn";import{jsxDEV as r}from"react/jsx-dev-runtime";function Q({name:c,value:o,levels:m,disabled:d,onChange:p}){if(m.length===0)throw Error("EffortSlider requires at least one level");let a=m,l=Math.max(0,a.findIndex((t)=>t.value===o)),u=76,s=14,i=2,n=a.length,h=i+l/Math.max(1,n-1)*(u-s-i*2);return r("div",{className:y("flex items-center justify-between px-2 py-2.5",d&&"opacity-50"),children:[r("span",{className:"text-sm",children:[c," ",r("span",{"data-effort-value":"",style:{fontSize:12},children:["(",a.find((t)=>t.value===o)?.name??o,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),r("button",{type:"button",disabled:d,role:"slider","aria-label":c,"aria-valuemin":0,"aria-valuemax":n-1,"aria-valuenow":l,"aria-valuetext":a.find((t)=>t.value===o)?.name??o,onKeyDown:(t)=>{let e;if(t.key==="ArrowRight"||t.key==="ArrowUp")e=Math.min(n-1,l+1);else if(t.key==="ArrowLeft"||t.key==="ArrowDown")e=Math.max(0,l-1);else if(t.key==="Home")e=0;else if(t.key==="End")e=n-1;else return;if(t.preventDefault(),t.stopPropagation(),!d&&e!==l)p(a[e].value)},className:"relative shrink-0 cursor-pointer overflow-hidden rounded-full border-none p-0 disabled:cursor-default",style:{width:u,height:18,background:"var(--input)"},onClick:(t)=>{let e=t.currentTarget.getBoundingClientRect(),f=t.clientX-e.left,b=u/n,g=Math.min(n-1,Math.max(0,Math.floor(f/b)));p(a[g].value)},children:[r("span",{className:"absolute inset-y-0 left-0 w-full rounded-full",style:{background:"var(--input)"}},void 0,!1,void 0,this),a.map((t,e)=>{let f=i+s/2+e/Math.max(1,n-1)*(u-s-i*2)-2;return r("span",{className:"absolute top-1/2 size-1 -translate-y-1/2 rounded-full",style:{left:f,background:"color-mix(in srgb, var(--muted-foreground) 40%, transparent)"}},t.value,!1,void 0,this)}),r("span",{className:"absolute rounded-full transition-all duration-150",style:{width:s,height:s,top:i,left:h,background:"var(--foreground)",boxShadow:"0 1px 2px #0003"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}
2
- export{Q};
@@ -1 +0,0 @@
1
- import{Switch as a}from"@base-ui/react/switch";import{cn as d}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function L({className:i,size:t="default",...r}){return e(a.Root,{"data-slot":"switch","data-size":t,className:d("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 relative inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:ring-3 aria-invalid:ring-3 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px]",i),...r,children:e(a.Thumb,{"data-slot":"switch-thumb",className:"bg-background dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}export{L};
@@ -1,2 +0,0 @@
1
- import{o}from"./chunk-r9k7kszp.js";import{cn as a}from"cn";import{jsxDEV as e}from"react/jsx-dev-runtime";function ne({className:r,...n}){return e(o,{"data-slot":"input-group-control",className:a("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent",r),...n},void 0,!1,void 0,this)}
2
- export{ne};
@@ -1,2 +0,0 @@
1
- function st(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 Ie(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(st(n,i))}return{imageFiles:e,sawNonImageFile:o}}function Me(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 lt(t){return[...t].filter((e)=>!s(e)).join("")}function rt(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 F(t){let{value:e,selectionStart:o,selectionEnd:i}=t,n=lt(e);if(n===e)return n;if(t.value=n,o!==null&&i!==null){let a=Math.max(0,o-rt(e,o)),r=Math.max(0,i-rt(e,i));requestAnimationFrame(()=>{t.setSelectionRange(a,r)})}return n}
2
- export{st,Ie,Me,lt,rt,F};
@@ -1,2 +0,0 @@
1
- var nt={allow_once:0,allow_always:1,reject_once:2,reject_always:3};function de(e){return[...e].toSorted((o,n)=>(nt[o.kind]??99)-(nt[n.kind]??99))}function pt(e){return e==="allow_once"||e==="allow_always"}function gt(e){return e==="allow_always"||e==="reject_always"}
2
- export{nt,de,pt,gt};
@@ -1 +0,0 @@
1
- import{e}from"./chunk-xgy0heva.js";import{cva as i}from"class-variance-authority";import{cn as r}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function Qe({className:a,...t}){return o("div",{"data-slot":"input-group",role:"group",className:r("group/input-group border-input has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 relative flex h-9 w-full min-w-0 items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...t},void 0,!1,void 0,this)}var p=i("text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function ee({className:a,align:t="inline-start",...s}){return o("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:r(p({align:t}),a),onClick:(n)=>{if(n.target.closest("button"))return;n.currentTarget.parentElement?.querySelector("input")?.focus()},...s},void 0,!1,void 0,this)}var l=i("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function te({className:a,type:t="button",variant:s="ghost",size:n="xs",...u}){return o(e,{type:t,"data-size":n,variant:s,className:r(l({size:n}),a),...u},void 0,!1,void 0,this)}function _t({className:a,...t}){return o("span",{className:r("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...t},void 0,!1,void 0,this)}export{Qe,ee,te,_t};
@@ -1 +0,0 @@
1
- import{cn as a}from"cn";import{jsxDEV as o}from"react/jsx-dev-runtime";function r({className:e,...t}){return o("label",{"data-slot":"label",className:a("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t},void 0,!1,void 0,this)}export{r};