import{j as u,r as $}from"./iframe-B8FSoBNY.js";import{c as y}from"./compiler-runtime-BXE7OOXE.js";import{A as w}from"./attachment-list-1p1601I5.js";import{C as f}from"./chat-input-B-915nCM.js";import"./preload-helper-PPVm8Dsz.js";import"./resource-badge-Bw5UoU4J.js";import"./createLucideIcon-CcBBUKX8.js";import"./file-text-D5m8MJlG.js";import"./tooltip-DZxUoouw.js";import"./portal-CZHfPTRw.js";import"./index-DaXC_qY_.js";import"./index-DpB4ozcR.js";import"./normalize-props-D7NI5JRu.js";import"./factory-BR3bc_RM.js";import"./tooltip-C_a-XGZ8.js";import"./create-slot-recipe-context-DAhDE6G_.js";import"./factory-DAJZwK4o.js";import"./create-recipe-context-BU56IzEo.js";import"./use-presence-context-DK2PGZth.js";import"./create-split-props-u5h9OPvL.js";import"./computed-style-C0hzrq9-.js";import"./overflow-CkG1DOya.js";import"./index-cFwdnc0b.js";import"./icon-button-DHiUe7rR.js";import"./button-C7it2n8t.js";import"./spinner-ZYH_gvW-.js";import"./index-CXwl6T4k.js";import"./x-D42ziktz.js";import"./stack-CN4X31TA.js";import"./collaborative-markdown-editor-Bj0GvTvv.js";import"./rich-text-theme-Bkhh9rAZ.js";import"./flex-DAJL4AFZ.js";import"./CodeBlockPlugin-C3OWpvP8.js";import"./index-B0y2_lLF.js";import"./textarea-rqmaWSc5.js";import"./use-field-context-DoxKQlMm.js";import"./table-BKNSzs2r.js";import"./FloatingTextFormatToolbarPlugin-B6jc8xvg.js";import"./markdown-editor-Y4eMsgVb.js";import"./LexicalHistoryPlugin.prod-BQAibkDj.js";import"./TreeViewPlugin-CyVKCrKJ.js";import"./markdown-BLUemkxK.js";import"./prompt-input-BLCttowi.js";import"./rich-message-BIkzo1SM.js";import"./h-stack-DWHd8f97.js";const xt={title:"Chat UI/Chat Input",component:f,parameters:{layout:"centered",actions:{argTypesRegex:"^on(?!Change)[A-Z].*"}}},g=JSON.stringify({root:{children:[{children:[{detail:0,format:0,mode:"normal",style:"",text:"",type:"text",version:1}],direction:"ltr",format:"",indent:0,type:"paragraph",version:1}],direction:"ltr",format:"",indent:0,type:"root",version:1}},null,2),p={args:{defaultState:g,placeholder:"Ask me something...",onSubmit:(e,t)=>{console.log("Submitted text:",e),t.length>0&&console.log("Submitted attachments:",t),alert(`Submitted: ${e}${t.length>0?` with ${t.length} attachments`:""}`)}}};function C(e){const t=y.c(16);let o,a,r;t[0]!==e?({attachedResources:r,onClearAttachments:o,...a}=e,t[0]=e,t[1]=o,t[2]=a,t[3]=r):(o=t[1],a=t[2],r=t[3]);let i;t[4]!==r?(i=r===void 0?[]:r,t[4]=r,t[5]=i):i=t[5];const x=i,[n,S]=$.useState(x);let m;t[6]===Symbol.for("react.memo_cache_sentinel")?(m=b=>{S(A=>A.filter(R=>R!==b))},t[6]=m):m=t[6];let c;t[7]!==n?(c=u.jsx(w,{attachments:n,onSelect:v,onRemove:m}),t[7]=n,t[8]=c):c=t[8];const d=c;let s;t[9]!==o?(s=()=>{S([]),o?.()},t[9]=o,t[10]=s):s=t[10];let l;return t[11]!==n||t[12]!==d||t[13]!==a||t[14]!==s?(l=u.jsx(f,{...a,attachedResources:n,attachmentList:d,onClearAttachments:s}),t[11]=n,t[12]=d,t[13]=a,t[14]=s,t[15]=l):l=t[15],l}function v(e){return console.log("Selected:",e)}const h={render:e=>{const t={...e??{},defaultState:e?.defaultState??g,attachedResources:e?.attachedResources??[]};return u.jsx(C,{...t})},args:{defaultState:g,placeholder:"Summarize the attached files...",attachedResources:["workspace/customer-data.csv","workspace/analysis-report.md"],onSubmit:(e,t)=>{console.log("Submitted text:",e),console.log("Submitted attachments:",t),alert(`Submitted: ${e}${t.length>0?` with ${t.length} attachments`:""}`)}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
  args: {
    defaultState: initialState,
    placeholder: "Ask me something...",
    onSubmit: (text: string, attachments: string[]) => {
      console.log("Submitted text:", text);
      if (attachments.length > 0) {
        console.log("Submitted attachments:", attachments);
      }
      alert(\`Submitted: \${text}\${attachments.length > 0 ? \` with \${attachments.length} attachments\` : ""}\`);
    }
  }
}`,...p.parameters?.docs?.source}}};h.parameters={...h.parameters,docs:{...h.parameters?.docs,source:{originalSource:`{
  render: args => {
    const rendererArgs: ChatInputProps = {
      ...(args ?? {}),
      defaultState: args?.defaultState ?? initialState,
      attachedResources: args?.attachedResources ?? []
    };
    return <WithAttachmentsRenderer {...rendererArgs} />;
  },
  args: {
    defaultState: initialState,
    placeholder: "Summarize the attached files...",
    attachedResources: ["workspace/customer-data.csv", "workspace/analysis-report.md"],
    onSubmit: (text: string, attachments: string[]) => {
      console.log("Submitted text:", text);
      console.log("Submitted attachments:", attachments);
      alert(\`Submitted: \${text}\${attachments.length > 0 ? \` with \${attachments.length} attachments\` : ""}\`);
    }
  }
}`,...h.parameters?.docs?.source}}};const bt=["Default","WithAttachments"];export{p as Default,h as WithAttachments,bt as __namedExportsOrder,xt as default};
