@alifd/chat 0.3.61 → 0.3.62

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 (47) hide show
  1. package/dist/docs/ai-loading/main.js +1 -1
  2. package/dist/docs/balloon/main.js +1 -1
  3. package/dist/docs/button/main.js +1 -1
  4. package/dist/docs/card/main.js +1 -1
  5. package/dist/docs/card-loading/main.js +1 -1
  6. package/dist/docs/checkbox/main.js +1 -1
  7. package/dist/docs/checkbox-group/main.js +1 -1
  8. package/dist/docs/code-view/main.js +1 -1
  9. package/dist/docs/collapse/main.js +1 -1
  10. package/dist/docs/date-picker/main.js +1 -1
  11. package/dist/docs/document/main.js +1 -1
  12. package/dist/docs/drawer/main.js +1 -1
  13. package/dist/docs/error-notice/main.js +1 -1
  14. package/dist/docs/feedback/main.js +1 -1
  15. package/dist/docs/flip/main.js +1 -1
  16. package/dist/docs/float-button/main.js +1 -1
  17. package/dist/docs/form/main.js +1 -1
  18. package/dist/docs/html-render/main.js +1 -1
  19. package/dist/docs/icon/main.js +1 -1
  20. package/dist/docs/image-preview/main.js +1 -1
  21. package/dist/docs/img/main.js +1 -1
  22. package/dist/docs/input/main.js +1 -1
  23. package/dist/docs/list/main.js +1 -1
  24. package/dist/docs/loading/main.js +1 -1
  25. package/dist/docs/markdown/main.js +1 -1
  26. package/dist/docs/mermaid-view/main.js +1 -1
  27. package/dist/docs/message/main.js +1 -1
  28. package/dist/docs/origin/main.js +1 -1
  29. package/dist/docs/person-picker/main.js +1 -1
  30. package/dist/docs/radio/main.js +1 -1
  31. package/dist/docs/radio-group/main.js +1 -1
  32. package/dist/docs/recommend/main.js +1 -1
  33. package/dist/docs/reference/main.js +1 -1
  34. package/dist/docs/rich-text-input/main.js +1 -1
  35. package/dist/docs/select/main.js +1 -1
  36. package/dist/docs/step/main.js +1 -1
  37. package/dist/docs/stop-generate/main.js +1 -1
  38. package/dist/docs/table/main.js +1 -1
  39. package/dist/docs/tag/main.js +1 -1
  40. package/dist/docs/text/main.js +1 -1
  41. package/dist/docs/time-picker/main.js +1 -1
  42. package/dist/docs/tool-status/main.js +1 -1
  43. package/es/index.js +1 -1
  44. package/es/markdown/index.js +3 -2
  45. package/lib/index.js +1 -1
  46. package/lib/markdown/index.js +3 -2
  47. package/package.json +1 -1
@@ -133,4 +133,4 @@ ${t.map(e=>{let{variableName:t,uniqueLocalName:n}=e;return` reactHotLoader.regi
133
133
  \`\`\`
134
134
  ${l}
135
135
  \`\`\`
136
- 如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=["link-reference-group"],jf=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:(e=>{let t=e;try{jh.forEach(e=>{t=t.replace(RegExp(`<${e}[^>]*\\/>`,"g"),`<${e} ...></${e}>`)})}catch(e){}return t})(e.render(k)),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),j_=p8.config(jf),jg=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jy=p8.config(jg),jb=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jv=p8.config(jb),jE=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jS=p8.config(jE),jT=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jC=p8.config(jT),jk=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jx=p8.config(jk);var jw=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jN="停止生成",jD=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jw.Generating,stopText:a=jN,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jw.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jN]}),i===jw.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jO=p8.config(jD),jM=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jA=p8.config(jM),jR=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jI=p8.config(jR),jL=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jP=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jF=p8.config(jP),jY=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jj=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jY,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jB=p8.config(jj),jU=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jB,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jz=p8.config(jU),jV=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jH=p8.config(jV),jG=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jH,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jW=p8.config(jG),jK=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jq=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),j$=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":o)?(0,e3.jsx)(jK,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jq,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),jQ=p8.config(j$),jJ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,e5.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jX=p8.config(jJ),jZ=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),j1=p8.config(jZ),j0=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j2=p8.config(j0),j3=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j3.displayName="Table";let j5=p8.config(j3),j4=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j4.displayName="ErrorNotice";let j6=p8.config(j4),j9=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j9.displayName="Empty";let j8=p8.config(j9),j7=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j8,{})})})]})});j7.displayName="Document";let Be=p8.config(j7),Bt="0.3.61",Bn=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Br=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Loading } from "@alifd/chat";\nimport "@alifd/chat/es/loading/style";\nReactDOM.render(\n <div>\n <div\n style={{\n display: "flex",\n justifyContent: "space-around",\n marginBottom: "50px",\n }}\n >\n <Loading>\n <div>default</div>\n </Loading>\n <Loading shape="dot">\n <div>dot</div>\n </Loading>\n <Loading shape="bar">\n <div>bar</div>\n </Loading>\n </div>\n <div\n style={{\n display: "flex",\n justifyContent: "space-around",\n }}\n >\n <Loading size="medium">\n <div>default</div>\n </Loading>\n <Loading shape="dot" size="medium"></Loading>\n <Loading shape="dot" size="medium">\n <div>dot</div>\n </Loading>\n <Loading shape="bar" size="medium">\n <div>bar</div>\n </Loading>\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"Loading 组件的基本用法。\n- Basic usage of `Loading`"},{tag:"@demo",content:"基本使用"},{tag:"@en",content:"Basic"},{tag:"@order",content:"1"}]}}},s=[{tag:"@remarks",content:"同 Next Loading- Same as Next Loading component."},{tag:"@component",content:"加载"},{tag:"@en",content:"Loading\n*"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:""}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Br,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bn,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
136
+ 如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=["link-reference-group"],jf=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:(e=>{let t=e;try{jh.forEach(e=>{t=t.replace(RegExp(`<${e}([^>]*)\\/?>`,"g"),`<${e}$1></${e}>`)})}catch(e){}return t})(e.render(k)),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),j_=p8.config(jf),jg=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jy=p8.config(jg),jb=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jv=p8.config(jb),jE=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jS=p8.config(jE),jT=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jC=p8.config(jT),jk=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jx=p8.config(jk);var jw=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jN="停止生成",jD=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jw.Generating,stopText:a=jN,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jw.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jN]}),i===jw.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jO=p8.config(jD),jM=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jA=p8.config(jM),jR=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jI=p8.config(jR),jL=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jP=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jF=p8.config(jP),jY=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jj=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jY,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jB=p8.config(jj),jU=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jB,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jz=p8.config(jU),jV=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jH=p8.config(jV),jG=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jH,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jW=p8.config(jG),jK=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jq=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),j$=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":o)?(0,e3.jsx)(jK,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jq,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),jQ=p8.config(j$),jJ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,e5.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jX=p8.config(jJ),jZ=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),j1=p8.config(jZ),j0=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j2=p8.config(j0),j3=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j3.displayName="Table";let j5=p8.config(j3),j4=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j4.displayName="ErrorNotice";let j6=p8.config(j4),j9=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j9.displayName="Empty";let j8=p8.config(j9),j7=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j8,{})})})]})});j7.displayName="Document";let Be=p8.config(j7),Bt="0.3.62",Bn=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Br=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Loading } from "@alifd/chat";\nimport "@alifd/chat/es/loading/style";\nReactDOM.render(\n <div>\n <div\n style={{\n display: "flex",\n justifyContent: "space-around",\n marginBottom: "50px",\n }}\n >\n <Loading>\n <div>default</div>\n </Loading>\n <Loading shape="dot">\n <div>dot</div>\n </Loading>\n <Loading shape="bar">\n <div>bar</div>\n </Loading>\n </div>\n <div\n style={{\n display: "flex",\n justifyContent: "space-around",\n }}\n >\n <Loading size="medium">\n <div>default</div>\n </Loading>\n <Loading shape="dot" size="medium"></Loading>\n <Loading shape="dot" size="medium">\n <div>dot</div>\n </Loading>\n <Loading shape="bar" size="medium">\n <div>bar</div>\n </Loading>\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"Loading 组件的基本用法。\n- Basic usage of `Loading`"},{tag:"@demo",content:"基本使用"},{tag:"@en",content:"Basic"},{tag:"@order",content:"1"}]}}},s=[{tag:"@remarks",content:"同 Next Loading- Same as Next Loading component."},{tag:"@component",content:"加载"},{tag:"@en",content:"Loading\n*"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:""}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Br,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bn,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
@@ -133,4 +133,4 @@ ${t.map(e=>{let{variableName:t,uniqueLocalName:n}=e;return` reactHotLoader.regi
133
133
  \`\`\`
134
134
  ${l}
135
135
  \`\`\`
136
- 如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=["link-reference-group"],jf=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:(e=>{let t=e;try{jh.forEach(e=>{t=t.replace(RegExp(`<${e}[^>]*\\/>`,"g"),`<${e} ...></${e}>`)})}catch(e){}return t})(e.render(k)),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),j_=p8.config(jf),jg=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jy=p8.config(jg),jb=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jv=p8.config(jb),jE=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jS=p8.config(jE),jT=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jC=p8.config(jT),jk=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jx=p8.config(jk);var jw=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jN="停止生成",jD=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jw.Generating,stopText:a=jN,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jw.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jN]}),i===jw.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jO=p8.config(jD),jM=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jA=p8.config(jM),jR=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jI=p8.config(jR),jL=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jP=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jF=p8.config(jP),jY=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jj=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jY,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jB=p8.config(jj),jU=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jB,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jz=p8.config(jU),jV=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jH=p8.config(jV),jG=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jH,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jW=p8.config(jG),jK=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jq=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),j$=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":o)?(0,e3.jsx)(jK,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jq,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),jQ=p8.config(j$),jJ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,e5.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jX=p8.config(jJ),jZ=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),j1=p8.config(jZ),j0=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j2=p8.config(j0),j3=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j3.displayName="Table";let j5=p8.config(j3),j4=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j4.displayName="ErrorNotice";let j6=p8.config(j4),j9=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j9.displayName="Empty";let j8=p8.config(j9),j7=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j8,{})})})]})});j7.displayName="Document";let Be=p8.config(j7),Bt="0.3.61",Bn=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Br=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={"ai-news-overview":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst aiNewsOverviewContent = `基于我收集到的信息,以下是近1个月AI方向上的重要新闻和进展。\n# 近1个月AI方向重要新闻概览\n\n---\n\n## 一、国家战略层面重大进展\n\n### 《关于深入实施"人工智能+"行动的意见》正式发布\n\n8月26日,国务院印发了《关于深入实施"人工智能+"行动的意见》,明确了实施"人工智能+"行动的总体要求、发展目标和重点方向。这份文件是中国AI发展的重要"路线图",具有里程碑意义。\n\n**主要内容包括:**\n\n- **阶段性目标**:\n - **到2027年:** 新一代智能终端、智能体等应用普及率超70%\n - **到2030年:** 应用普及率超90%,智能经济成为重要增长极\n - **到2035年:** 全面步入智能经济和智能社会发展新阶段\n\n- **三大重点行动**:\n - "人工智能+"科学技术\n - "人工智能+"产业发展\n - "人工智能+"消费提质\n\n---\n\n## 二、国际AI大会成果\n\n### 2025世界人工智能大会成果丰硕\n\n............\n`;\nconst MarkdownAiNewsDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n return (\n <div style={{ padding: "20px", maxWidth: "1000px", margin: "0 auto" }}>\n <div className="demo-mobile-wrap">\n <Markdown\n content={aiNewsOverviewContent}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("AI新闻概览Markdown已准备就绪")}\n />\n </div>\n </div>\n );\n};\nReactDOM.render(<MarkdownAiNewsDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 在渲染复杂文档结构方面的能力,包括标题层级、列表、引用等。"},{tag:"@demo",content:"AI新闻概览"},{tag:"@en",content:"AI News Overview"},{tag:"@order",content:"2"}]}},basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport copy from "copy-to-clipboard";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/html-render/style";\nimport "@alifd/chat/es/code-view/style";\nimport "@alifd/chat/es/mermaid-view/style";\nimport "@alifd/chat/es/loading/style";\nconst content = `## Markdown 基础语法\n\n这是一个段落文本,展示 **加粗**、*斜体* 和 [链接](https://www.example.com) 的用法。\n\n这是一个引用<link-reference data-source-icon="icon" data-title="https://www.baidu.com"><a><span>1</span></a></link-reference>\n\n这是一个引用组<link-reference-group data-sources=\'[{"icon":"https://img.alicdn.com/imgextra/i3/O1CN01wr6j1b1m7SWWlmw8E_!!6000000004907-2-tps-144-144.png","title":"一文读懂上下文工程:理论结合实践","href":"https://ata.atatech.org/articles/12020447623","sourceZh":"ATA技术文章"},{"icon":"https://img.alicdn.com/imgextra/i2/O1CN012TVVIG1gj7R18QwxM_!!6000000004177-2-tps-200-200.png","title":"“上下文工程”硅谷爆火,Karpathy亲自站台!","href":"https://m.thepaper.cn/newsDetail_forward_31117705?commTag=true","sourceZh":"澎湃新闻"}]\'/>\n\n### 列表展示\n- 产品特点\n - 简单易用\n - 功能强大\n- 技术支持\n - 在线文档\n - 技术社区\n\n### 引用文本\n> Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档。\n\n### 代码展示\n\\`\\`\\`javascript\n// 一个简单的函数示例\nfunction greeting(name) {\n return \\`Hello, \\${name}!\\`;\n}\n\\`\\`\\`\n\n### 表格展示\n\n#### 基础表格\n| 功能特性 | 支持状态 | 说明 |\n| :- | :-: | -: |\n| 基础语法 | ✅ 支持 | 标题、段落、列表等 |\n| 代码高亮 | ✅ 支持 | 支持多种编程语言 |\n| 表格渲染 | ✅ 支持 | 支持对齐和样式 |\n| 图片预览 | ✅ 支持 | 点击放大查看 |\n| 链接处理 | ✅ 支持 | 自动识别和图标显示 |\n\n#### 复杂表格示例\n| 项目 | 进度 | 负责人 | 截止日期 | 状态 |\n| :- | :-: | :-: | -: | :-: |\n| 需求分析 | 100% | 张三 | 2025-01-15 | <font color=common_green1_color>已完成</font> |\n| UI设计 | 80% | 李四 | 2025-01-20 | <font color=common_blue1_color>进行中</font> |\n| 后端开发 | 60% | 王五 | 2025-01-25 | <font color=common_orange1_color>开发中</font> |\n| 前端开发 | 40% | 赵六 | 2025-01-30 | <font color=common_yellow1_color>待开始</font> |\n| 测试验收 | 0% | 钱七 | 2025-02-05 | <font color=common_gray1_color>未开始</font> |\n\n### 链接图标功能演示\n\n#### 普通链接示例\n点击 [百度搜索](https://www.baidu.com) 或 [GitHub](https://github.com) 访问外部网站,这些链接会显示链接图标。\n\n#### 自动链接示例\n直接输入网址 https://www.baidu.com 或 https://github.com,会自动识别为链接并显示链接图标。\n\n#### 复制功能链接\n点击 [复制 "Hello World"](copy://Hello%20World) 将文本复制到剪贴板。\n\n点击 [复制代码片段](copy://function%20test()%20%7B%0A%20%20console.log(\'Hello%20World!\');%0A%20%20return%20true;%0A%7D) 复制 JavaScript 代码。\n\n点击 [复制配置信息](copy://服务器地址:192.168.1.100%0A端口:8080%0A用户名:admin) 复制服务器配置。\n\n#### 消息功能链接\n点击 [发送问候消息](message://你好!欢迎使用我们的Markdown编辑器) 发送问候消息。\n\n点击 [发送提醒通知](message://提醒:您的会议将在10分钟后开始,请做好准备) 发送会议提醒。\n\n点击 [发送状态更新](message://任务状态已更新为:已完成) 发送任务状态更新。\n\n#### 钉钉协议链接\n点击 [钉钉发送消息](dingtalk://dingtalkclient/sendMessage?content=测试消息) 通过钉钉发送消息。\n\n点击 [钉钉打开群聊](dingtalk://dingtalkclient/action/openGroup?groupId=123456) 打开指定群聊。\n\n点击 [钉钉打开会话](dingtalk://dingtalkclient/action/openConversation?conversationId=conv_123) 打开指定会话。\n\n#### DTMD 协议链接\n点击 [DTMD 打开文档](dtmd://document/open?id=doc_123&title=项目文档) 打开指定文档。\n\n点击 [DTMD 打开任务](dtmd://task/view?id=task_456&assignee=user_789) 查看指定任务。\n\n点击 [DTMD 打开会议](dtmd://meeting/join?id=meeting_101&password=123456) 加入指定会议。\n\n#### 图片类型链接\n[![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)](https://github.com)\n\n### 图标功能说明\n- \uD83D\uDD17 **普通链接**:显示链接图标,帮助用户识别外部链接\n- \uD83D\uDD17 **自动链接**:直接输入的网址会自动识别并显示链接图标\n- \uD83D\uDCCB **复制链接**:显示复制图标,表示点击后会复制内容到剪贴板\n- \uD83D\uDCAC **消息链接**:显示消息图标,表示点击后会发送消息\n- \uD83D\uDCF1 **钉钉链接**:显示钉钉图标,表示点击后会调用钉钉客户端功能\n- \uD83D\uDCC4 **DTMD 链接**:显示文档图标,表示点击后会打开 DTMD 相关功能\n- \uD83D\uDDBC️ **图片链接**:显示图片图标,表示点击后会预览图片\n\n**注意**:这些特殊的链接格式(copy://、message://、dingtalk://、dtmd://、image://)是由 HTMLRenderer 组件处理的,Markdown 组件会将这些链接传递给底层的 HTML 渲染器。自动链接功能由 MarkdownIt 的 linkify 插件提供支持。\n`;\nconst MarkdownDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n const sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n };\n const copyText = (text) => {\n return () => {\n copy(text);\n };\n };\n const handleOpenLink = (url) => {\n window.open(url, "_blank");\n };\n return (\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("Markdown 已准备就绪")}\n sendTextMessage={sendTextMessage}\n copyText={copyText}\n handleOpenLink={handleOpenLink}\n enableSourcePos\n />\n </div>\n );\n};\nReactDOM.render(<MarkdownDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 基础语法,包括标题、段落、强调和链接等。"},{tag:"@demo",content:"基础语法"},{tag:"@en",content:"Basic Syntax"},{tag:"@order",content:"1"}]}},generating:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `# AI 生成内容示例\n\n## 排序算法说明\n\n1. **冒泡排序**(Bubble Sort)\n - 通过重复遍历要排序的数列\n - 比较每对相邻元素并交换位置\n\n2. **快速排序**(Quick Sort)\n - 选择基准值分割数据\n - 递归排序子序列`;\nReactDOM.render(\n <div>\n <h5>生成中状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating content={content} />\n </div>\n\n <h5 style={{ marginTop: 20 }}>已完成状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating={false} content={content} />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 内容生成过程中的状态。"},{tag:"@demo",content:"生成态"},{tag:"@en",content:"Generating State"},{tag:"@order",content:"4"}]}},interactive:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 交互功能展示\n\n### 链接类型\n1. [普通链接](https://www.example.com)\n2. [复制文本](copy://这是要复制的文本内容)\n3. [发送消息](dtmd://dingtalkclient/sendMessage?content=测试消息)\n\n### 代码复制\n\\`\\`\\`javascript\nconst greeting = "Hello, World!";\nconsole.log(greeting);\n\\`\\`\\`\n\n### 生成状态\n正在生成的内容会显示动画效果...`;\nReactDOM.render(\n <div>\n <h4>普通状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n\n <h4 style={{ marginTop: 20 }}>生成状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n generating\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 组件的交互功能,包括链接处理、文本复制和生成状态等。"},{tag:"@demo",content:"交互功能"},{tag:"@en",content:"Interactive Features"},{tag:"@order",content:"4"}]}},mermaid:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/mermaid-view/style";\nconst content = `## Mermaid 图表展示\n所有支持的图表请查看 [Mermaid 官方文档](https://mermaid.js.org/syntax/classDiagram.html)。\n\n### 类图示例\n\\`\\`\\`mermaid\n---\ntitle: Animal example\n---\nclassDiagram\n note "From Duck till Zebra"\n Animal <|-- Duck\n note for Duck "can fly\\ncan swim\\ncan dive\\ncan help in debugging"\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n\\`\\`\\`\n\n### 流程图示例\n\\`\\`\\`mermaid\ngraph TD\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e D\n C --\x3e H[结束]\n\\`\\`\\`\n\n### 甘特图示例\n\\`\\`\\`mermaid\ngantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1, 20d\n section Another\n Task in Another :2014-01-12, 12d\n another task :24d\n\\`\\`\\`\n\n### 时间线示例\n\\`\\`\\`mermaid\ntimeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : YouTube\n 2006 : Twitter\n\\`\\`\\`\n\n## Mermaid 论文逻辑图\n\n\\`\\`\\`mermaid\ngraph TB\n A[动机: 序列建模的局限] --\x3e B[提出Transformer]\n B --\x3e C1[架构: Encoder-Decoder]\n B --\x3e C2[核心机制: Multi-Head Attention, Positional Encoding]\n B --\x3e C3[优势: 并行度高, 路径短, 复杂度低]\n C1 --\x3e D1[Encoder: 自注意力 + 前馈网络 \xd76层]\n C1 --\x3e D2[Decoder: Masked 自注意力 + 编码器-解码器注意力 + 前馈 \xd76层]\n C2 --\x3e D3[Scaled Dot-Product Attention: 缩放点积]\n C2 --\x3e D4[Multi-Head Attention: 多头并行子空间表示]\n C2 --\x3e D5[Positional Encoding: 正弦/余弦函数注入位置信息]\n C3 --\x3e D6[可解释性: 注意力权重揭示语义/句法]\n B --\x3e E[实验]\n E --\x3e E1[机器翻译: 英德28.4 BLEU, 英法41.8 BLEU]\n E --\x3e E2[句法分析: WSJ上优于大多数模型]\n B --\x3e F[结论与展望]\n F --\x3e F1[首次纯注意力实现序列建模]\n F --\x3e F2[启发BERT等后续模型]\n F --\x3e F3[拓展至多模态任务]\n\\`\\`\\`\n\n\n### mermaid渲染错误示例\n\\`\\`\\`mermaid\ngraph TB\n subgraph "前端 (wa-taskide-ui)"\n A[页面初始化] --\x3e B{检测WA_ENGINE_SSO_UUID Cookie}\n B --\x3e|不存在| C[调用/logout接口登出]\n C --\x3e D[重新登录流程]\n D --\x3e E[/sendBucSSOToken.do回调]\n E --\x3e F[生成UUID并缓存SSO Token]\n F --\x3e G[设置Cookie: WA_ENGINE_SSO_UUID]\n \n H[工具调用检测] --\x3e I{需要SSO处理?}\n I --\x3e|是| J[调用SSO Ticket生成接口]\n J --\x3e K[缓存SSO Ticket到后端]\n end\n \n subgraph "后端 (wa-engine)"\n L[SSO Token管理服务] --\x3e M[Redis缓存]\n N[SSO Ticket生成服务] --\x3e O[调用BUC接口]\n P[工具参数处理器] --\x3e Q[轮询获取SSO Ticket]\n Q --\x3e R[URL参数追加]\n \n S[Celery定时任务] --\x3e T[SSO Token刷新]\n T --\x3e U[BUC心跳接口]\n end\n \n subgraph "外部服务"\n V[BUC登录服务]\n W[浏览器工具Provider]\n end\n \n F --\x3e L\n K --\x3e N\n O --\x3e V\n R --\x3e W\n T --\x3e V\n\\`\\`\\`\n\n### mermaid 截断示例\n\\`\\`\\`mermaid\ngraph TB\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e \n`;\nconst sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n};\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} sendTextMessage={sendTextMessage} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中 Mermaid 图表的使用方法,包括流程图、时序图等。"},{tag:"@demo",content:"Mermaid 图表"},{tag:"@en",content:"Mermaid Diagrams"},{tag:"@order",content:"5"}]}},"rich-text":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 文本样式展示\n\n### 颜色文本\n<font color=common_red1_color>错误提示文本</font>\n<font color=common_green1_color>成功提示文本</font>\n<font color=common_blue1_color>链接文本颜色</font>\n\n### 标题样式\n<font sizeToken=common_h3_text_style__font_size colorTokenV2=common_blue1_color>自定义大小和颜色的标题</font>\n\n### 组合样式示例\n普通文本和 <font color=common_red1_color>**重要提示**</font> 的组合使用\n\n### 应用场景\n- <font color=common_green1_color>✓ 已完成的任务</font>\n- <font color=common_blue1_color>○ 进行中的任务</font>\n- <font color=common_red1_color>\xd7 未完成的任务</font>\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中的富文本样式,包括文本颜色、字体大小等特性。"},{tag:"@demo",content:"富文本样式"},{tag:"@en",content:"Rich Text Styles"},{tag:"@order",content:"2"}]}},"tables-images":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 数据展示\n\n### 项目进度表\n| 项目阶段 | 开始时间 | 状态 | 负责人 |\n| :- | :-: | -: | :-: |\n| 需求分析 | 2025-06-01 | <font color=common_green1_color>已完成</font> | 张三 |\n| 设计阶段 | 2025-06-10 | <font color=common_blue1_color>进行中</font> | 李四 |\n| 开发阶段 | 2025-06-20 | <font color=common_grey1_color>未开始</font> | 王五 |\n\n### 图片展示\n产品预览图:\n![产品预览](https://img.alicdn.com/imgextra/i1/O1CN01OvFLW11mWeIU13AMp_!!6000000004962-0-tps-1002-1238.jpg)\n\n### 组合展示\n| 功能模块 | 效果预览 | 状态 |\n| :- | :-: | -: |\n| 首页布局 | ![布局](https://img.alicdn.com/imgextra/i4/O1CN01dTkCbh2ABAQjD7Qgm_!!6000000008164-2-tps-219-48.png) | <font color=common_green1_color>已完成</font> |\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n imagePreview\n handleImageClick={(url) => {\n Message.notice(`点击了图片: ${url}`);\n }}\n />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中表格和图片的使用方法,包括表格对齐和图片预览功能。"},{tag:"@demo",content:"表格与图片"},{tag:"@en",content:"Tables and Images"},{tag:"@order",content:"3"}]}}},s=[{tag:"@remarks",content:"Markdown 组件用于解析和渲染 Markdown 文本内容。 - Markdown component used to parse and render Markdown text content."},{tag:"@component",content:"Markdown"},{tag:"@en",content:"Markdown"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:"需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content."}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Br,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bn,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();
136
+ 如何解决这个问题?如果你能提供修复方案,请保持简洁。`;i&&i(e)}},children:"使用对话修复"})})]})})}):(0,e3.jsx)("div",{className:"ct-mermaid-view-content",children:(0,e3.jsx)("div",{ref:a,className:"ct-mermaid-view-chart"})}),d&&(0,e3.jsx)("div",{className:"ct-mermaid-view-loading",children:(0,e3.jsx)(E4,{size:"medium"})})]})});jc.displayName="MermaidView";let ju=p8.config(jc),jd=[{emotionVersion:"75",emotionId:"emotion_180001",dynamicEmotionId:"",showType:1,skinList:[],name:"[魔法棒]",names:{en_US:"[Magic Wand]",ja_JP:"[魔棒]",vi_VN:"[đũa ph\xe9p]",zh_CN:"[魔法棒]",zh_HK:"[魔法棒]",zh_TW:"[魔法棒]"},url:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",staticURL:"https://img.alicdn.com/imgextra/i4/O1CN01a4VODa1vAyAFlqg4H_!!6000000006133-2-tps-96-96.png",fallbacks:[]}],jp="",jm=["img","code","pre","link-reference","link-reference-group"],jh=["link-reference-group"],jf=AG((0,e5.forwardRef)(e=>{let{className:t,onReady:n,content:o,needCodeHeader:i=!0,theme:a="light",enableSourcePos:s=!1,sendTextMessage:l,...u}=e,[d,p]=(0,e5.useState)([]);function m(e,t){let n;if(!e)return[];let o=[...jm,...t||[]],i=/\[[^\]]*\]\([^)]*\)/g,a=o.length>0?RegExp(`<(${o.join("|")}).*?>.*?<\\/\\1>`,"gs"):null,s=[],l=0,u=[];for(;null!==(n=i.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});if(a)for(a.lastIndex=0;null!==(n=a.exec(e));)u.push({start:n.index,end:n.index+n[0].length,content:n[0]});for(let t of(u.sort((e,t)=>e.start-t.start),u))t.start>l&&s.push(...e.substring(l,t.start).split("")),s.push(t.content),l=t.end;return l<e.length&&s.push(...e.substring(l).split("")),s}(0,e5.useEffect)(()=>{Y7(),je().then(e=>{p(()=>[...jd,...e])}),null==n||n()},[n]);let h=(0,e5.useRef)(null),[f,_]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?jp:o),[g,y]=(0,e5.useState)(()=>(null==u?void 0:u.typewriterEffect)?m(o,u.whitelistTags):[]),[b,E]=(0,e5.useState)(0),S=(0,e5.useRef)(null),T=()=>{S.current&&(clearTimeout(S.current),S.current=null)};(0,e5.useEffect)(()=>{if(T(),!(null==u?void 0:u.typewriterEffect)){_(o),y([]);return}let e=m(o,u.whitelistTags);if(b>=e.length)_(o),E(e.length),y([]);else{let t=e.slice(0,b),n=e.slice(b);_(t.join("")),y(n)}},[o,null==u?void 0:u.typewriterEffect,null==u?void 0:u.whitelistTags]),(0,e5.useEffect)(()=>{if(!(null==u?void 0:u.typewriterEffect)||0===g.length)return void T();let e=Math.max(Math.floor(g.length/10),2),t=()=>{y(t=>{if(0===t.length)return t;let n=t.slice(0,e),o=t.slice(e);return _(e=>e+n.join("")),E(t=>t+e),o})};return T(),t(),S.current=setTimeout(()=>{let e=()=>{t(),S.current=setTimeout(e,50)};e()},50),T},[g.length,null==u?void 0:u.typewriterEffect]);let C=(0,e5.useMemo)(()=>{jp=f;let e={common_hypertitle_text_style__font_size:"h1",common_largetitle_text_style__font_size:"h1",common_h1_text_style__font_size:"h1",common_h2_text_style__font_size:"h2",common_h3_text_style__font_size:"h3",common_h4_text_style__font_size:"h4",common_h5_text_style__font_size:"h5",common_body_text_style__font_size:"span",common_footnote_text_style__font_size:"span"};return f.replace(/<font\s+([^>]+)>([^<]+)<\/font>/g,(t,n,o)=>{let i="",a="",s="",l=n.match(/sizeToken=([\w_]+)/),u=n.match(/colorTokenV2=([\w_]+)/),d=n.match(/color=([\w_]+)/),p=n.match(/color=(?:"|')?(#[0-9a-fA-F]{3,8})(?:"|')?/);l&&(i=l[1].replace(/-/g,"_")),u&&(a=u[1].replace(/-/g,"_")),!a&&d&&(a=d[1].replace(/-/g,"_")),!a&&p&&(s=p[1]);let m=[];i&&m.push(`font-size: var(--${i})`),a?m.push(`color: var(--${a})`):s&&m.push(`color: ${s}`);let h=m.join("; "),f=e[i]||"span";return`<${f} style="${h}" class="markdownFont">${o}</${f}>`})},[f]),k=(0,e5.useMemo)(()=>jt(C,{genFrame:(e,t)=>({htmlTag:"img",selfClose:!0,attr:{draggable:"false",style:"vertical-align: text-center; display: inline-block; pointer-events: none;",class:"emoji",title:`[${e}]`,src:t.url||t.staticURL||"",alt:e}}),emotionList:d}),[C,d]),x=(0,e5.useMemo)(()=>{let e=new Fp({html:!0,xhtmlOut:!0,breaks:!0,langPrefix:"language-",linkify:!0,typographer:!0,highlight:(e,t)=>{if(t&&(null==jr?void 0:jr.getLanguage(t)))try{return null==jr?void 0:jr.highlight(t,e,!0).value}catch(e){}return""}});if(s&&e.use(e=>{e.core.ruler.push("add_source_pos",e=>{e.tokens.forEach(e=>{if(e.map){let[t,n]=e.map;e.attrSet("data-source-start-line",String(t)),e.attrSet("data-source-end-line",String(n))}})})}),e.linkify.add("dingtalk:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),e.linkify.add("dtmd:",{validate:/^[^\s]+/,normalize:e=>{e.url=e.raw}}),k=(k=(k=k.replace(/&#x2F;/g,"/")).replace(/&#39;/g,"'")).replace(/(!\[[^\]]*\]\((\/\/[^\s)]+)\))/g,(e,t,n)=>e.replace(n,`https:${n}`)),!i)return{html:e.render(k),codeBlocks:[]};let t=[],n=0;return e.renderer.rules.fence=(e,o)=>{let i=e[o],a=i.info.trim()||"plaintext",s=i.content,l=`code-block-${n++}`,u=!0,d=i.map;d&&(k.split("\n")[d[1]-1].trim().endsWith("```")||(u=!1));let p="mermaid"===a?"mermaid":"code";return t.push({language:a,code:s,id:l,isComplete:u}),`<div data-code-block-id="${l}" data-block-type="${p}"></div>`},{html:(e=>{let t=e;try{jh.forEach(e=>{t=t.replace(RegExp(`<${e}([^>]*)\\/?>`,"g"),`<${e}$1></${e}>`)})}catch(e){}return t})(e.render(k)),codeBlocks:t}},[k,i,s]),w=(null==u?void 0:u.generating)?"ct-markdown generating":"ct-markdown";return(0,e3.jsxs)("div",{ref:h,className:uj()(w,`ct-hljs-${a}`,t),children:[(()=>{if(!i||0===x.codeBlocks.length)return(0,e3.jsx)(Lr,{...u,children:x.html});let e=x.html.split(/(<div[^>]*data-code-block-id="[^"]*"[^>]*><\/div>)/),t=[],n=0;for(let o of e)if(o.includes("data-code-block-id")){let e=x.codeBlocks[n];e&&("mermaid"===e.language?t.push((0,e3.jsxs)("div",{children:[e.isComplete&&(0,e3.jsx)(ju,{code:e.code,showCopyButton:!1,theme:a,sendTextMessage:l}),(0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)]},e.id)):t.push((0,e3.jsx)(ji,{code:e.code,language:e.language,showCopyButton:!0,theme:a},e.id)),n++)}else o.trim()&&t.push((0,e3.jsx)(Lr,{...u,children:o},`html-${t.length}`));return(0,e3.jsx)(e3.Fragment,{children:t})})(),(()=>{let{generating:e}=u||{};return!e||x.html?null:(0,e3.jsx)("img",{width:20,height:10,src:"https://img.alicdn.com/imgextra/i1/O1CN01wdlADU1WCvOLNSB3w_!!6000000002753-1-tps-530-255.gif",alt:""})})()]})}),{displayName:"Markdown"}),j_=p8.config(jf),jg=AG((0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()("ct-card-loading",n),children:"卡片加载中"})}),{displayName:"CardLoading"}),jy=p8.config(jg),jb=AG((0,e5.forwardRef)((e,t)=>{let{className:n,text:o}=e;return(0,e3.jsx)("div",{className:uj()("ct-origin",n),children:(0,e3.jsx)("div",{className:"origin-tip-inner",children:o})})}),{displayName:"Origin"}),jv=p8.config(jb),jE=AG((0,e5.forwardRef)((e,t)=>{let{className:n,indicator:o,shape:i="default",size:a="large",...s}=e,l={...s,size:a};if(!o&&i&&"default"!==i){let e=`load-container ${i}`;l.indicator=(0,e3.jsx)("div",{className:e,children:(0,e3.jsx)("div",{className:"loader"})})}return(0,e3.jsx)(E4,{...l,ref:t,className:uj()(`ct-loading ${a} ${i}`,n)})}),{displayName:"Loading"}),jS=p8.config(jE),jT=AG((0,e5.forwardRef)((e,t)=>{let{className:n,headerStyle:o,children:i,footer:a,footerClassName:s,placement:l,...u}=e;return(0,e3.jsxs)(vB,{...u,v2:!0,ref:t,placement:l,headerStyle:{"border-bottom:":"1px solid var(--40gmM)",...o},className:uj()(`ct-drawer ${l}`,n),children:[i,a&&a.length&&(0,e3.jsx)("div",{className:uj()("draw-footer",s),children:a})]})}),{displayName:"Drawer"}),jC=p8.config(jT),jk=AG((0,e5.forwardRef)((e,t)=>{let{className:n,shape:o="dot",showStatus:i=!0,current:a=0,stepsList:s=[],defaultCollapsed:l=!1,collapsedSteps:u=1,collapsedMore:d=(0,e3.jsxs)("div",{children:["查看更多",(0,e3.jsx)(h2,{type:"arrow-down",size:"xxs",style:{marginLeft:2}})]}),size:p="large",...m}=e,[h,f]=(0,e5.useState)([]),[_,g]=(0,e5.useState)(l);return((0,e5.useEffect)(()=>{f(s.map((e,t)=>_&&u<t+1?null:(0,e3.jsx)(TK.Item,{title:e.title,content:e.content,status:i?void 0:"wait"},t)))},[_,u,s]),0===s.length)?null:(0,e3.jsx)("div",{className:uj()("ct-step",`ct-step-${p}`,n,_&&"ct-step-collapsed"),...m,ref:t,children:(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(TK,{current:a,shape:o,labelPlacement:"hoz",direction:"ver",readOnly:!0,children:h}),_&&s.length>u&&(0,e3.jsx)("div",{className:"ct-step-collapsed-more",onClick:()=>g(!_),children:(0,e3.jsx)("div",{className:"ct-step-collapsed-more-content",children:d})})]})})}),{displayName:"Step"}),jx=p8.config(jk);var jw=((eC={}).Generating="generating",eC.Stopped="stopped",eC);let jN="停止生成",jD=AG((0,e5.forwardRef)((e,t)=>{let{className:n,show:o=!0,status:i=jw.Generating,stopText:a=jN,stopIcon:s,stoppedText:l,onStop:u}=e;return o?(0,e3.jsxs)("div",{className:uj()("ct-stop-generate",n),children:[i===jw.Generating&&(0,e3.jsxs)("div",{className:"stop-generate-area",onClick:()=>{u&&u()},children:[(0,e3.jsx)("img",{src:s||"https://img.alicdn.com/imgextra/i2/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg"}),a||jN]}),i===jw.Stopped&&(0,e3.jsx)("div",{className:"stopped-generate-text",children:l||"已停止生成"})]}):null}),{displayName:"StopGenerate"}),jO=p8.config(jD),jM=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i,listItems:a=[],onExpandedClick:s,onItemClick:l,mode:u="simple",onHeaderClose:d,onHeaderClick:p,onContentClick:m,expanded:h}=e,[f,_]=(0,e5.useState)(h||o);(0,e5.useEffect)(()=>{void 0!==h&&h!==f&&_(h)},[h]);let g=(e,t,n)=>{if(n.stopPropagation(),l){null==l||l(e,t);return}(null==e?void 0:e.url)&&window.open(null==e?void 0:e.url,"_blank")},y=f?"expand":"";return(0,e3.jsxs)("div",{className:uj()(`ct-reference ${u} ${y}`,n),ref:t,children:[(()=>{if(!1===i)return null;if("detail"===u){if(!1===i)return null;let e=(null==i?void 0:i.icon)||"close",t=(null==i?void 0:i.title)||"引用信息";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,children:[(0,e3.jsx)("div",{className:"reference-text",children:t}),(0,e3.jsx)("div",{className:"reference-close",onClick:()=>{null==d||d()},children:AX(e,"xs")})]})}let e=(null==i?void 0:i.icon)||"https://img.alicdn.com/imgextra/i3/O1CN01hpxNXz26hRw9Jz4O1_!!6000000007693-55-tps-200-200.svg";return(0,e3.jsxs)("div",{className:`reference-header ${u}`,onClick:e=>{(e.stopPropagation(),p)?p(!f):_(!f)},children:[(0,e3.jsxs)("div",{className:"reference-name",children:[AX(e),(0,e3.jsx)("div",{className:"reference-title",children:null==i?void 0:i.title})]}),(0,e3.jsx)("div",{className:"reference-operate",onClick:e=>{(e.stopPropagation(),s)?s(!f):_(!f)},children:(0,e3.jsx)(AJ,{type:f?"arrow-up":"arrow-down",size:"xs"})})]})})(),a&&0!==a.length&&(f||"simple"!==u)?(0,e3.jsxs)("div",{className:`reference-list ${u}`,onClick:e=>{e.stopPropagation(),null==m||m(f)},children:[f&&"simple"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("div",{className:"reference-text",onClick:n=>g(e,t,n),children:null==e?void 0:e.name}),(null==e?void 0:e.modifyTime)&&!1]},t)),"detail"===u&&a.map((e,t)=>(0,e3.jsxs)("div",{className:"reference-item",onClick:n=>g(e,t,n),children:[(0,e3.jsxs)("div",{className:"reference-title",children:[(0,e3.jsxs)("div",{className:"reference-name",children:[(0,e3.jsx)("span",{className:"reference-item-index",children:t+1}),(null==e?void 0:e.sourceIcon)&&AX(null==e?void 0:e.sourceIcon),(0,e3.jsx)("span",{children:null==e?void 0:e.name})]}),(null==e?void 0:e.modifyTime)&&!1]}),(null==e?void 0:e.content)&&(0,e3.jsx)("div",{className:"reference-content",children:null==e?void 0:e.content})]},t))]}):null]})}),jA=p8.config(jM),jR=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsxs)("div",{children:["相关问题",(0,e3.jsx)(h2,{type:"arrow-right",size:"xxs",style:{marginLeft:2}})]}),expanded:a,recommendList:s=[],onToggle:l,onItemClick:u}=e,[d,p]=(0,e5.useState)(o),m=void 0!==a?a:d;return(0,e3.jsxs)("div",{className:uj()("ct-recommend",n),ref:t,children:[(0,e3.jsx)("div",{className:"recommend-header",onClick:()=>{void 0===a&&p(!m),null==l||l(!m)},children:i}),(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:0,exit:400},classNames:"recommend-list",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:"recommend-list",children:s.map((e,t)=>(0,e3.jsx)("div",{className:"recommend-container",children:(0,e3.jsx)(hk.CSSTransition,{in:m,timeout:{enter:100*t,exit:0},classNames:"recommend-item",unmountOnExit:!0,appear:!0,children:(0,e3.jsx)("div",{className:"recommend-item",onClick:()=>{null==u||u(e,t)},children:e.title||e.name||e.text})},t)}))})})]})}),jI=p8.config(jR),jL=(0,e5.forwardRef)((e,t)=>{let{className:n,header:o,footer:i,position:a="bottom",value:s,onChange:l,onFocus:u,onBlur:d,onKeyDown:p,enableQuerySug:m,querySugList:h,onQuerySugClick:f}=e,[_,g]=(0,e5.useState)(!1),y=m&&_&&h&&h.length>0;return(0,e3.jsxs)("div",{ref:t,className:uj()("ct-rich-text-input",n),children:[(0,e3.jsx)("div",{className:"header",children:o}),(0,e3.jsxs)("div",{className:uj()("input-container",{focus:_}),children:[(0,e3.jsx)("div",{className:"rich-text-input",contentEditable:!0,onFocus:e=>{g(!0),null==u||u(e)},onBlur:e=>{g(!1),null==d||d(e)},onChange:e=>{null==l||l(e.target.innerText)}}),(0,e3.jsx)("div",{className:"input-footer",children:i}),(0,e3.jsx)(hk.CSSTransition,{in:y,timeout:300,classNames:"query-sug",unmountOnExit:!0,children:(0,e3.jsx)("div",{className:uj()("query-sug",a),children:(0,e3.jsx)("div",{className:"query-sug-list",children:null==h?void 0:h.map((e,t)=>(0,e3.jsx)("div",{className:"query-sug-item",onClick:()=>{null==f||f(e,t)},children:e.label},e.value))})})})]})]})}),jP=(0,e5.forwardRef)((e,t)=>{let{className:n}=e;return(0,e3.jsx)("div",{className:uj()(n,"ct-ai-loading"),ref:t,children:(0,e3.jsxs)("div",{className:uj()("loading-container","short-container"),children:[(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"0s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"1s"}}),(0,e3.jsx)("div",{className:uj()("short-bar","short-to-long"),style:{animationDelay:"2s"}})]})})}),jF=p8.config(jP),jY=()=>(0,e3.jsx)("div",{className:"radio-item-icon",children:(0,e3.jsx)("div",{className:"radio-item-circle"})}),jj=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-radio",{"ct-radio-disabled":o},a),style:s,...l,children:t.map(e=>(0,e3.jsx)("div",{className:uj()("radio-item",{active:e.value===n,disabled:o||e.disabled}),onClick:()=>{var t;return t=e.value,void(!o&&!e.disabled&&i&&i(t))},onKeyDown:t=>{var n;return n=e.value,void(!o&&!e.disabled&&("Enter"===t.key||" "===t.key)&&(t.preventDefault(),i&&i(n)))},role:"radio",tabIndex:o||e.disabled?-1:0,"aria-checked":e.value===n,"aria-disabled":o||e.disabled,children:(0,e3.jsxs)("div",{className:"radio-item-content",children:[(0,e3.jsx)("div",{className:"radio-item-icon-column",children:(0,e3.jsx)(jY,{})}),(0,e3.jsx)("div",{className:"radio-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"radio-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"radio-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"radio-item-text-column",children:[(0,e3.jsx)("div",{className:"radio-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"radio-item-desc",children:e.description})]})]})},e.value))}):null}),{displayName:"Radio"}),jB=p8.config(jj),jU=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||"");e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=!!t,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-radio-group ct-radio-group-list ${i?"ct-radio-group-disabled":""}`,children:[(0,e3.jsx)(jB,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"RadioGroup"}),jz=p8.config(jU),jV=AG((0,e5.forwardRef)(e=>{let{options:t,value:n,disabled:o,onChange:i,className:a,style:s,...l}=e;return t&&0!==t.length?(0,e3.jsx)("div",{className:uj()("ct-checkbox",{"ct-checkbox-disabled":o},a),style:s,...l,children:t.map(e=>{let t=(n||[]).indexOf(e.value)>-1;return(0,e3.jsx)("div",{className:uj()("checkbox-item",{active:t,disabled:o||e.disabled}),onClick:()=>((e,t)=>{if(o||t.disabled)return;let a=n||[],s=a.indexOf(e)>-1?a.filter(t=>t!==e):[...a,e];i&&i(s)})(e.value,e),children:(0,e3.jsxs)("div",{className:"checkbox-item-content",children:[(0,e3.jsx)("div",{className:"checkbox-item-checkbox-column",children:(0,e3.jsx)(f7,{className:"checkbox-item-checkbox",checked:t,disabled:o||e.disabled})}),(0,e3.jsx)("div",{className:"checkbox-item-image-column",children:e.image&&(0,e3.jsx)("div",{className:"checkbox-item-image",children:(0,e3.jsx)("img",{src:e.image,alt:"",className:"checkbox-item-image-inner"})})}),(0,e3.jsxs)("div",{className:"checkbox-item-text-column",children:[(0,e3.jsx)("div",{className:"checkbox-item-title",children:e.label}),e.description&&(0,e3.jsx)("div",{className:"checkbox-item-desc",children:e.description})]})]})},e.value)})}):null}),{displayName:"Checkbox"}),jH=p8.config(jV),jG=AG((0,e5.forwardRef)(e=>{if(!e.options||0===e.options.length)return null;let[t,n]=(0,e5.useState)(e.value||[]);e4().useEffect(()=>{void 0!==e.value&&n(e.value)},[e.value]);let o=t.length>0,i=e.disabled;return(0,e3.jsxs)("div",{className:`ct-checkbox-group ct-checkbox-group-list ${i?"ct-checkbox-group-disabled":""}`,children:[(0,e3.jsx)(jH,{options:e.options,value:t,onChange:t=>{!e.disabled&&(n(t),e.onChange&&e.onChange(t))},disabled:i}),(0,e3.jsx)(A3,{type:"primary",className:"confirm-button",size:"medium",disabled:!o||e.disabled,onClick:()=>{!e.disabled&&t.length>0&&e.onConfirm&&e.onConfirm(t)},children:e.confirmButtonText||"确 认"})]})}),{displayName:"CheckboxGroup"}),jW=p8.config(jG),jK=RF(e=>{let{className:t,dataSource:n,mode:o="single",buttonCols:i=2,value:a,size:s="medium",onChange:l}=e,[u,d]=(0,e5.useState)(a),p=Array.from({length:Math.ceil(((null==n?void 0:n.length)||0)/i)},(e,t)=>{let a=t*i,p=Math.min(a+i,(null==n?void 0:n.length)||0),m=null==n?void 0:n.slice(a,p);return(null==m?void 0:m.length)?(0,e3.jsx)("div",{className:"select-row-container",children:m&&m.length?m.map((e,t)=>{if(!e)return null;let{value:n,label:a,disabled:p}=e,m="normal";"string"==typeof u&&u===n||Array.isArray(u)&&u.includes(n)?m="selected":"object"==typeof u&&"value"in u&&u.value===n&&(m="selected");let h=p;return u&&"single"===o&&"normal"===m&&(h=!0),(0,e3.jsx)(_A,{onClick:()=>((e,t)=>{if("multiple"===o)if(Array.isArray(u)){let n="normal"===t?[...u,null==e?void 0:e.value]:u.filter(t=>t!==(null==e?void 0:e.value));d(n),null==l||l(n,"itemClick")}else{let t=[null==e?void 0:e.value];d(t),null==l||l(t,"itemClick")}if("single"===o){let n="normal"===t?e:void 0;d(n),null==l||l(n,"itemClick")}})(e,m),type:"normal",disabled:h,className:`select-item ${m} row${i}`,size:s,children:a},`select_${t}`)}):null},`row_${t}`):null});return(0,e3.jsx)("div",{className:uj()("ct-select",t),children:p})},{coverStyle:!1,labelLayout:"vertical",enableHoverState:!1}),jq=RF((0,e5.forwardRef)((e,t)=>{let{className:n,size:o="medium",mode:i="single",onChange:a,...s}=e;return(0,e3.jsx)(gU,{...s,className:uj()("ct-select",n),size:o,ref:t,mode:i,onChange:a})})),j$=AG((0,e5.forwardRef)((e,t)=>{let{className:n,display:o="select",buttonCols:i=2,dataSource:a,mode:s="single",onChange:l,...u}=e;return"button"===((null==a?void 0:a.length)&&(null==a?void 0:a.length)>6?"select":o)?(0,e3.jsx)(jK,{className:n,dataSource:a,mode:s,buttonCols:i,value:u.value,onChange:l,label:u.label,required:u.required,size:"medium"}):(0,e3.jsx)(jq,{...u,className:uj()("ct-select",n),dataSource:a,ref:t,mode:s,onChange:l,label:u.label,required:u.required,size:"medium",popupClassName:uj()("ct-select-popup",u.popupClassName)})}),{displayName:"Select"}),jQ=p8.config(j$),jJ=(0,e5.forwardRef)((e,t)=>{let{className:n,defaultExpanded:o=!1,header:i=(0,e3.jsx)("div",{children:"折叠面板头部"}),customHeader:a,expanded:s,onToggle:l,animated:u=!0,children:d=(0,e3.jsxs)("div",{children:[(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"}),(0,e3.jsx)("div",{children:"折叠面板内容"})]})}=e,p=(0,e5.useRef)(null),m=(0,e5.useRef)(null),[h,f]=(0,e5.useState)(o),[_,g]=(0,e5.useState)(o),y=void 0!==s?s:h,b=(e,t)=>{var n;if(!u)return void(t?(e.style.height="auto",e.style.width="auto",g(!0)):(e.style.height="0",g(!1)));let o=e.getBoundingClientRect().height,i=e.getBoundingClientRect().width,a=(null==(n=m.current)?void 0:n.getBoundingClientRect().width)||i;if(t){e.style.height="0",e.style.width=`${a}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),e.style.height="auto";let t=e.getBoundingClientRect().height,n=e.getBoundingClientRect().width;e.style.height="0",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height=`${t}px`,e.style.width=`${n}px`});let o=()=>{e.style.height="auto",e.style.width="auto",g(!0),e.removeEventListener("transitionend",o)};e.addEventListener("transitionend",o)}else{e.style.height=`${o}px`,e.style.width=`${i}px`,e.style.transition="height 0.3s ease, width 0.3s ease",e.getBoundingClientRect(),requestAnimationFrame(()=>{e.style.height="0",e.style.width=`${a}px`});let t=()=>{g(!1),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)}};return(0,e5.useEffect)(()=>{let e=p.current;e&&(y?(g(!0),u?Promise.resolve().then(()=>{b(e,!0)}):(e.style.height="auto",e.style.width="auto")):u?b(e,!1):(e.style.height="0",g(!1)))},[y,u]),(0,e3.jsxs)("div",{className:uj()("ct-flip",n),ref:t,children:[(0,e3.jsx)("div",{className:"flip-header-container",ref:m,children:a||(0,e3.jsxs)("div",{className:"flip-header",onClick:()=>{let e=!y;null==l||l(e),void 0===s&&f(e)},children:[i,(0,e3.jsx)("span",{className:"flip-header-icon",children:(0,e3.jsx)(AJ,{type:y?"arrow-up":"arrow-down",size:"xs"})})]})}),(0,e3.jsx)("div",{className:"flip-content",ref:p,style:{height:o?"auto":0,width:o?"auto":"100%",overflow:"hidden",transition:u?void 0:"none"},children:_&&d})]})}),jX=p8.config(jJ),jZ=(0,e5.forwardRef)((e,t)=>{let{useText:n="使用",name:o,className:i,selected:a=!1,status:s,onToolClick:l,authInfo:u,fullWidth:d,param:p,groupName:m,disabled:h=!1}=e,f=a?"selected":"";return f=d?`${f} full-width`:`${f}`,f=l?`${f} enable-click`:`${f}`,(0,e3.jsxs)("div",{className:uj()(`ct-tool-status ${f} ${s} ${h?"disabled":""}`,i),ref:t,onClick:t=>{h||(t.stopPropagation(),null==l||l(e))},children:[(0,e3.jsx)(AJ,{size:"xs",type:"failed"===s?"icon-cross1":"completed"===s?"icon-check":"loading"}),u&&"auth"===s&&(0,e3.jsx)("div",{className:"next-btn-text next-btn-primary",onClick:t=>{var n;t.stopPropagation(),null==u||null==(n=u.onAuthClick)||n.call(u,e)},children:null==u?void 0:u.content}),(0,e3.jsxs)("div",{className:"content-container",children:[(0,e3.jsx)("div",{className:"content-use-tips",children:n}),m&&(0,e3.jsx)("div",{className:"content-group",children:m}),o&&(0,e3.jsx)("div",{className:"content-name",children:o}),p&&(0,e3.jsx)("div",{className:"content-detail",children:p})]})]})}),j1=p8.config(jZ),j0=AG((0,e5.forwardRef)(e=>{let{className:t,children:n,...o}=e;return(0,e3.jsx)(yJ,{...o,className:uj()("ct-collapse",t),children:n})}),{displayName:"Collapse",Panel:yJ.Panel}),j2=p8.config(j0),j3=(0,e5.forwardRef)((e,t)=>{let{className:n,size:o="small",hasBorder:i=!0,title:a,showCopyButton:s,...l}=e,[u,d]=(0,e5.useState)(!1);return(0,e3.jsxs)("div",{className:"ct-table-container",children:[a?(0,e3.jsxs)("div",{className:"ct-table-header",children:[a&&(0,e3.jsx)("div",{className:"ct-table-title",children:a}),s?(0,e3.jsx)("div",{className:"ct-table-copy-button",onClick:()=>{d(!0),setTimeout(()=>{d(!1)},3e3)},children:(0,e3.jsx)(AJ,{size:16,type:u?"icon-check":"fuzhi3"})}):null]}):null,(0,e3.jsx)(ko,{...l,ref:t,className:uj()("ct-table",{[`ct-table-${o}`]:o,"ct-table-no-border":!i},n),size:o})]})});j3.displayName="Table";let j5=p8.config(j3),j4=(0,e5.forwardRef)((e,t)=>{let{className:n,text:o,...i}=e;return(0,e3.jsxs)("div",{...i,className:uj()("ct-error-notice",n),ref:t,children:[(0,e3.jsx)("div",{className:"ct-error-notice-icon",children:(0,e3.jsx)(h2,{size:16,type:"prompt"})}),(0,e3.jsx)("span",{className:"ct-error-notice-text",children:o})]})});j4.displayName="ErrorNotice";let j6=p8.config(j4),j9=(0,e5.forwardRef)((e,t)=>{let{className:n,...o}=e;return(0,e3.jsx)("div",{...o,className:uj()("ct-document-empty",n),ref:t,children:Array.from({length:4},(e,t)=>(0,e3.jsx)("div",{className:"ct-empty-line"},t))})});j9.displayName="Empty";let j8=p8.config(j9),j7=(0,e5.forwardRef)((e,t)=>{let{className:n,title:o="",content:i,generating:a=!0,onPreview:s,onCopy:l,onDownload:u,renderDownloadAction:d,showPreviewButton:p=!0,showCopyButton:m=!0,showDownloadButton:h=!0,contentHeight:f=128,..._}=e,g=f-25,y=(0,e5.useRef)(null),[b,E]=(0,e5.useState)(0),[S,T]=(0,e5.useState)(!1),[C,k]=(0,e5.useState)(()=>f>128?128:f),x=e=>{let t=Array.from(e.children);return 0===t.length?e:x(t[t.length-1])},w=(0,e5.useCallback)(()=>{let e=y.current;if(!e)return;let t=e.getBoundingClientRect(),n=x(e);if(!n)return;let o=n.getBoundingClientRect(),i=o.top-t.top,s=a?i+o.height:i+o.height+20;if(f>128&&C<f){let e=C-25;if(s>e)return void k(Math.min(f,C+(s-e)))}if(!(s+b<g&&i+b>0))return void E(-i)},[b,f,C,a]),N=Rv(w,200);(0,e5.useEffect)(()=>{w()},[a]),(0,e5.useEffect)(()=>{if("string"==typeof i)return void N();if(!y.current)return;let e=new MutationObserver(()=>{N()});return e.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{e.disconnect()}},[i,N]);let D=e=>{o&&p&&s&&(e.stopPropagation(),null==s||s())},O=e=>{e.stopPropagation()};return(0,e3.jsxs)("div",{..._,className:uj()("ct-document",{"ct-document-generating":a},n),ref:t,onClick:D,children:[o?(0,e3.jsxs)("div",{className:"ct-document-header",children:[(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)(AJ,{type:"document",className:"ct-document-header-icon"}),(0,e3.jsx)("span",{className:uj()("ct-document-header-title"),children:o})]}),(0,e3.jsxs)("div",{className:uj()("ct-document-header-actions"),children:[(0,e3.jsxs)("div",{className:uj()("ct-document-header-preview",{"ct-document-header-preview-display-none":!p||!s,"ct-document-header-preview-generating":a}),onClick:D,children:[(0,e3.jsx)(AJ,{type:"preview",className:"ct-document-header-preview-icon"}),(0,e3.jsx)("span",{className:"ct-document-header-preview-text",children:"预览"})]}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-copy",{"ct-document-header-action-copy-generating":a,"ct-document-header-action-copy-display-none":!m||!l}),onClick:e=>{e.stopPropagation(),null==l||l(),T(!0),setTimeout(()=>{T(!1)},3e3)},title:"复制",children:(0,e3.jsx)(AJ,{type:S?"icon-check":"fuzhi3",className:"ct-document-header-action-icon"})}),(0,e3.jsx)("div",{className:uj()("ct-document-header-action","ct-document-header-action-download",{"ct-document-header-action-download-generating":a,"ct-document-header-action-download-display-none":!h||!d&&!u}),onClick:d?O:e=>{e.stopPropagation(),null==u||u()},title:d?void 0:"下载",children:d?d():(0,e3.jsx)(AJ,{type:"download",className:"ct-document-header-action-icon"})})]})]}):(0,e3.jsx)("div",{className:"ct-document-header",children:(0,e3.jsxs)("div",{className:"ct-document-header-left",children:[(0,e3.jsx)("div",{className:"ct-document-header-left-icon-empty"}),(0,e3.jsx)("div",{className:"ct-document-header-left-title-empty"})]})}),i?(0,e3.jsxs)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),style:{height:C},children:[(0,e3.jsx)("div",{className:"ct-document-mask"}),(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)("div",{ref:y,className:"ct-document-content-text",style:{transform:`translateY(${a?b:0}px)`},onClick:O,children:i})})]}):(0,e3.jsx)("div",{className:uj()("ct-document-content",{"ct-document-content-generating":a}),children:(0,e3.jsx)("div",{className:"ct-document-content-inner",children:(0,e3.jsx)(j8,{})})})]})});j7.displayName="Document";let Be=p8.config(j7),Bt="0.3.62",Bn=e=>{let{globalExpandCode:t}=e,[n,o]=(0,e5.useState)(!1),[i,a]=(0,e5.useState)(t);(0,e5.useEffect)(()=>{o(!0)},[]),(0,e5.useEffect)(()=>{a(t)},[t]);let s=e.docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{}),l=(0,iZ.kebabCase)(e.demoKey),d=`${l}-container`;return(0,e3.jsxs)("div",{id:d,className:"next-demo-item scroll-count-item",children:[(0,e3.jsxs)("div",{id:`${l}-desc`,className:"demo-item-desc markdown",children:[(0,e3.jsx)(i1,{id:d,title:s["@demo"],component:"h3"}),(0,e3.jsx)("div",{className:"demo-item-desc-body markdown",children:(0,e3.jsx)(ob,{remarkPlugins:[iA],children:s["@remarks"]})})]}),(0,e3.jsxs)(uR,{disabled:e.disabled,code:e.sourceCode,scope:{mountNode:document.querySelector(`#${l}-mount`),require:e=>{let t={"@alifd/chat":e2,"@alifd/next":e$,"react-dom":e6,"styled-components":eQ,react:e4(),classnames:uj()},n=e.match(/^@alifd\/chat\/(es|lib)\/(.*)\/style$/);return n&&u(64615)(`./${n[2]}/style`),t[e]}},noInline:!0,children:[(0,e3.jsx)("div",{id:`${l}-mount`,className:"next-demo-mount",children:n?(0,e3.jsx)(uL,{}):null}),n?(0,e3.jsx)(uF,{}):null,(0,e3.jsx)("div",{id:`${l}-operations`,className:"demo-item-operations",style:{borderBottom:"1px dashed rgb(238, 238, 238)"},children:(0,e3.jsx)("div",{id:`${l}-fold-code`,className:"code-box-code-action code-expand-icon-hide",children:(0,e3.jsxs)(fl.Tooltip,{align:"b",style:{maxWidth:400},trigger:(0,e3.jsx)("span",{id:`${l}-icon-hide`,onClick:()=>{a(!i)},children:(0,e3.jsx)("svg",{width:20,height:20,viewBox:"0 0 20 20",style:{fill:"#3B9AFF"},children:(0,e3.jsx)("path",{transform:"translate(10.457453, 10.101961) rotate(90.000000) translate(-10.457453, -10.101961)",d:"M14.4307124,13.5667899 L15.1349452,14.276759 L10.7473676,18.6288871 L6.42783259,14.2738791 L7.13782502,13.5696698 L10.7530744,17.2147744 L14.4307124,13.5667899 Z M4.79130753,8.067524 L16.3824174,11.1733525 L16.1235984,12.1392784 L4.53248848,9.03344983 L4.79130753,8.067524 Z M10.8154102,1.57503552 L15.1349452,5.93004351 L14.4249528,6.63425282 L10.809949,2.98914817 L7.13206544,6.6371327 L6.42783259,5.92716363 L10.8154102,1.57503552 Z"})})}),children:["收起代码",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),"小提示:",(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"1. 点击一下代码,试一试在线编辑预览吧!"}),(0,e3.jsx)("br",{}),(0,e3.jsx)("br",{}),(0,e3.jsx)("strong",{children:"2. 页面右上方 有 全局代码展开 及 开启在线编辑 模式哟~"})]})})}),(0,e3.jsx)("div",{id:`${l}-body`,className:"next-demo-body",style:{display:i?"block":"none"},children:(0,e3.jsx)("div",{id:`${l}-live-editor`,children:(0,e3.jsx)("div",{id:`${l}-live-body`,className:"react-live-body",children:(0,e3.jsx)(uI,{theme:{plain:{},styles:[{types:[],style:{}}]}})})})})]})]})},Br=e=>{let{defaultLiveDemo:t=!0,defaultExpandCode:n=!0,onToggleExpandCode:o,onToggleLiveDemo:i,data:a=[]}=e,[s,l]=(0,e5.useState)(n),[u,d]=(0,e5.useState)(t),p={viewBox:"0 0 16 16",focusable:"false",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true","aria-haspopup":"true","aria-expanded":"false",style:{width:20,height:20,padding:2}};return(0,e3.jsxs)("div",{className:"demo-index",children:[(0,e3.jsxs)("span",{id:"global-control",className:"all-demo-box-controls",children:[(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"live-demo",role:"img","aria-label":"edit",className:"code-box-expand-trigger",onClick:()=>{d(!u),"function"==typeof i&&i(!u)},children:[(0,e3.jsx)("svg",{...p,"data-icon":"edit",id:"live-on",style:{...p.style,display:u?"none":"block"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})}),(0,e3.jsx)("svg",{...p,id:"live-off","data-icon":"edit",style:{...p.style,display:u?"block":"none"},children:(0,e3.jsx)("path",{d:"M9.69559557,3.62666667 L2.20866223,11.1146667 L1.8673289,12.3562667 L3.1153289,12.0181333 L10.6011956,4.53226667 L9.69559557,3.62666667 Z M10.4497289,2.87253333 L11.3553289,3.77813333 L12.2673289,2.86613333 C12.4290988,2.70436348 12.4922771,2.46857876 12.4330652,2.24759702 C12.3738533,2.02661528 12.201247,1.85400889 11.9802652,1.79479701 C11.7592835,1.73558513 11.5234988,1.79876346 11.3617289,1.96053333 L10.4497289,2.87253333 L10.4497289,2.87253333 Z M13.0203956,1.20639113 C13.3405419,1.52647328 13.5204044,1.96062968 13.5204044,2.41333333 C13.5204044,2.86603699 13.3405419,3.30019339 13.0203956,3.62026667 L3.6689289,12.9728 L0.346262232,13.8741333 L1.25506223,10.5589333 L10.6075956,1.20639113 C10.9276688,0.886253633 11.3618252,0.706391131 11.8145289,0.706391131 C12.2672326,0.706391131 12.701389,0.886253633 13.0214622,1.20639113 L13.0203956,1.20639113 Z M1,15 L11,15 L11,16 L1,16 L1,15 Z"})})]}),children:"使用预览模式"}),(0,e3.jsx)(fl.Tooltip,{trigger:(0,e3.jsxs)("span",{id:"expand-all",role:"img","aria-label":"code",className:"code-box-expand-trigger","aria-haspopup":"true","aria-expanded":"false",onClick:()=>{l(!s),"function"==typeof o&&o(!s)},children:[(0,e3.jsx)("svg",{...p,id:"all-not-expand","data-icon":"code",style:{...p.style,display:s?"none":"block"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})}),(0,e3.jsx)("svg",{...p,id:"all-expanded","data-icon":"code",style:{...p.style,display:s?"block":"none"},children:(0,e3.jsx)("path",{d:"M16,0 L16,16 L0,16 L0,0 L16,0 Z M15,1 L1,1 L1,15 L15,15 L15,1 Z M13,11 L13,12 L8,12 L8,11 L13,11 Z M3.33419059,3.86073652 L7.22040532,7.74695124 L3.33419127,11.6331801 L2.62708313,10.9260747 L5.806,7.747 L2.62708313,4.5678433 L3.33419059,3.86073652 Z"})})]}),children:"展开所有代码"})]}),(0,e3.jsx)("ul",{className:"demo-index-list",children:a.map(e=>(0,e3.jsx)("li",{className:"demo-index-item","data-id":e.id,children:(0,e3.jsx)("a",{href:`#${e.id}`,children:e.title})},e.id))})]})};e6.render((0,e3.jsx)(()=>{var e;let[t,n]=(0,e5.useState)(!0),[o,i]=(0,e5.useState)(!1),a={"ai-news-overview":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst aiNewsOverviewContent = `基于我收集到的信息,以下是近1个月AI方向上的重要新闻和进展。\n# 近1个月AI方向重要新闻概览\n\n---\n\n## 一、国家战略层面重大进展\n\n### 《关于深入实施"人工智能+"行动的意见》正式发布\n\n8月26日,国务院印发了《关于深入实施"人工智能+"行动的意见》,明确了实施"人工智能+"行动的总体要求、发展目标和重点方向。这份文件是中国AI发展的重要"路线图",具有里程碑意义。\n\n**主要内容包括:**\n\n- **阶段性目标**:\n - **到2027年:** 新一代智能终端、智能体等应用普及率超70%\n - **到2030年:** 应用普及率超90%,智能经济成为重要增长极\n - **到2035年:** 全面步入智能经济和智能社会发展新阶段\n\n- **三大重点行动**:\n - "人工智能+"科学技术\n - "人工智能+"产业发展\n - "人工智能+"消费提质\n\n---\n\n## 二、国际AI大会成果\n\n### 2025世界人工智能大会成果丰硕\n\n............\n`;\nconst MarkdownAiNewsDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n return (\n <div style={{ padding: "20px", maxWidth: "1000px", margin: "0 auto" }}>\n <div className="demo-mobile-wrap">\n <Markdown\n content={aiNewsOverviewContent}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("AI新闻概览Markdown已准备就绪")}\n />\n </div>\n </div>\n );\n};\nReactDOM.render(<MarkdownAiNewsDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 在渲染复杂文档结构方面的能力,包括标题层级、列表、引用等。"},{tag:"@demo",content:"AI新闻概览"},{tag:"@en",content:"AI News Overview"},{tag:"@order",content:"2"}]}},basic:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown, Message } from "@alifd/chat";\nimport copy from "copy-to-clipboard";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/html-render/style";\nimport "@alifd/chat/es/code-view/style";\nimport "@alifd/chat/es/mermaid-view/style";\nimport "@alifd/chat/es/loading/style";\nconst content = `## Markdown 基础语法\n\n这是一个段落文本,展示 **加粗**、*斜体* 和 [链接](https://www.example.com) 的用法。\n\n这是一个引用<link-reference data-source-icon="icon" data-title="https://www.baidu.com"><a><span>1</span></a></link-reference>\n\n这是一个引用组<link-reference-group data-sources=\'[{"icon":"https://img.alicdn.com/imgextra/i3/O1CN01wr6j1b1m7SWWlmw8E_!!6000000004907-2-tps-144-144.png","title":"一文读懂上下文工程:理论结合实践","href":"https://ata.atatech.org/articles/12020447623","sourceZh":"ATA技术文章"},{"icon":"https://img.alicdn.com/imgextra/i2/O1CN012TVVIG1gj7R18QwxM_!!6000000004177-2-tps-200-200.png","title":"“上下文工程”硅谷爆火,Karpathy亲自站台!","href":"https://m.thepaper.cn/newsDetail_forward_31117705?commTag=true","sourceZh":"澎湃新闻"}]\'/>\n\n### 列表展示\n- 产品特点\n - 简单易用\n - 功能强大\n- 技术支持\n - 在线文档\n - 技术社区\n\n### 引用文本\n> Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档。\n\n### 代码展示\n\\`\\`\\`javascript\n// 一个简单的函数示例\nfunction greeting(name) {\n return \\`Hello, \\${name}!\\`;\n}\n\\`\\`\\`\n\n### 表格展示\n\n#### 基础表格\n| 功能特性 | 支持状态 | 说明 |\n| :- | :-: | -: |\n| 基础语法 | ✅ 支持 | 标题、段落、列表等 |\n| 代码高亮 | ✅ 支持 | 支持多种编程语言 |\n| 表格渲染 | ✅ 支持 | 支持对齐和样式 |\n| 图片预览 | ✅ 支持 | 点击放大查看 |\n| 链接处理 | ✅ 支持 | 自动识别和图标显示 |\n\n#### 复杂表格示例\n| 项目 | 进度 | 负责人 | 截止日期 | 状态 |\n| :- | :-: | :-: | -: | :-: |\n| 需求分析 | 100% | 张三 | 2025-01-15 | <font color=common_green1_color>已完成</font> |\n| UI设计 | 80% | 李四 | 2025-01-20 | <font color=common_blue1_color>进行中</font> |\n| 后端开发 | 60% | 王五 | 2025-01-25 | <font color=common_orange1_color>开发中</font> |\n| 前端开发 | 40% | 赵六 | 2025-01-30 | <font color=common_yellow1_color>待开始</font> |\n| 测试验收 | 0% | 钱七 | 2025-02-05 | <font color=common_gray1_color>未开始</font> |\n\n### 链接图标功能演示\n\n#### 普通链接示例\n点击 [百度搜索](https://www.baidu.com) 或 [GitHub](https://github.com) 访问外部网站,这些链接会显示链接图标。\n\n#### 自动链接示例\n直接输入网址 https://www.baidu.com 或 https://github.com,会自动识别为链接并显示链接图标。\n\n#### 复制功能链接\n点击 [复制 "Hello World"](copy://Hello%20World) 将文本复制到剪贴板。\n\n点击 [复制代码片段](copy://function%20test()%20%7B%0A%20%20console.log(\'Hello%20World!\');%0A%20%20return%20true;%0A%7D) 复制 JavaScript 代码。\n\n点击 [复制配置信息](copy://服务器地址:192.168.1.100%0A端口:8080%0A用户名:admin) 复制服务器配置。\n\n#### 消息功能链接\n点击 [发送问候消息](message://你好!欢迎使用我们的Markdown编辑器) 发送问候消息。\n\n点击 [发送提醒通知](message://提醒:您的会议将在10分钟后开始,请做好准备) 发送会议提醒。\n\n点击 [发送状态更新](message://任务状态已更新为:已完成) 发送任务状态更新。\n\n#### 钉钉协议链接\n点击 [钉钉发送消息](dingtalk://dingtalkclient/sendMessage?content=测试消息) 通过钉钉发送消息。\n\n点击 [钉钉打开群聊](dingtalk://dingtalkclient/action/openGroup?groupId=123456) 打开指定群聊。\n\n点击 [钉钉打开会话](dingtalk://dingtalkclient/action/openConversation?conversationId=conv_123) 打开指定会话。\n\n#### DTMD 协议链接\n点击 [DTMD 打开文档](dtmd://document/open?id=doc_123&title=项目文档) 打开指定文档。\n\n点击 [DTMD 打开任务](dtmd://task/view?id=task_456&assignee=user_789) 查看指定任务。\n\n点击 [DTMD 打开会议](dtmd://meeting/join?id=meeting_101&password=123456) 加入指定会议。\n\n#### 图片类型链接\n[![GitHub Logo](https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png)](https://github.com)\n\n### 图标功能说明\n- \uD83D\uDD17 **普通链接**:显示链接图标,帮助用户识别外部链接\n- \uD83D\uDD17 **自动链接**:直接输入的网址会自动识别并显示链接图标\n- \uD83D\uDCCB **复制链接**:显示复制图标,表示点击后会复制内容到剪贴板\n- \uD83D\uDCAC **消息链接**:显示消息图标,表示点击后会发送消息\n- \uD83D\uDCF1 **钉钉链接**:显示钉钉图标,表示点击后会调用钉钉客户端功能\n- \uD83D\uDCC4 **DTMD 链接**:显示文档图标,表示点击后会打开 DTMD 相关功能\n- \uD83D\uDDBC️ **图片链接**:显示图片图标,表示点击后会预览图片\n\n**注意**:这些特殊的链接格式(copy://、message://、dingtalk://、dtmd://、image://)是由 HTMLRenderer 组件处理的,Markdown 组件会将这些链接传递给底层的 HTML 渲染器。自动链接功能由 MarkdownIt 的 linkify 插件提供支持。\n`;\nconst MarkdownDemo = () => {\n const getCurrentTheme = () => {\n const darkThemes = [\n "@alife/theme-132027",\n "@alife/theme-130507",\n "@alife/theme-132134",\n ];\n const styleSheets = Array.from(document.styleSheets);\n const isDark = styleSheets.some((sheet) => {\n try {\n const href = sheet.href || "";\n return darkThemes.some((theme) => href.includes(theme));\n } catch (error) {\n return false;\n }\n });\n return isDark ? "dark" : "light";\n };\n const sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n };\n const copyText = (text) => {\n return () => {\n copy(text);\n };\n };\n const handleOpenLink = (url) => {\n window.open(url, "_blank");\n };\n return (\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n theme={getCurrentTheme()}\n onReady={() => Message.notice("Markdown 已准备就绪")}\n sendTextMessage={sendTextMessage}\n copyText={copyText}\n handleOpenLink={handleOpenLink}\n enableSourcePos\n />\n </div>\n );\n};\nReactDOM.render(<MarkdownDemo />, mountNode);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 基础语法,包括标题、段落、强调和链接等。"},{tag:"@demo",content:"基础语法"},{tag:"@en",content:"Basic Syntax"},{tag:"@order",content:"1"}]}},generating:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `# AI 生成内容示例\n\n## 排序算法说明\n\n1. **冒泡排序**(Bubble Sort)\n - 通过重复遍历要排序的数列\n - 比较每对相邻元素并交换位置\n\n2. **快速排序**(Quick Sort)\n - 选择基准值分割数据\n - 递归排序子序列`;\nReactDOM.render(\n <div>\n <h5>生成中状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating content={content} />\n </div>\n\n <h5 style={{ marginTop: 20 }}>已完成状态:</h5>\n <div className="demo-mobile-wrap">\n <Markdown generating={false} content={content} />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 内容生成过程中的状态。"},{tag:"@demo",content:"生成态"},{tag:"@en",content:"Generating State"},{tag:"@order",content:"4"}]}},interactive:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 交互功能展示\n\n### 链接类型\n1. [普通链接](https://www.example.com)\n2. [复制文本](copy://这是要复制的文本内容)\n3. [发送消息](dtmd://dingtalkclient/sendMessage?content=测试消息)\n\n### 代码复制\n\\`\\`\\`javascript\nconst greeting = "Hello, World!";\nconsole.log(greeting);\n\\`\\`\\`\n\n### 生成状态\n正在生成的内容会显示动画效果...`;\nReactDOM.render(\n <div>\n <h4>普通状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n\n <h4 style={{ marginTop: 20 }}>生成状态:</h4>\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n generating\n handleOpenLink={(url) => {\n Message.notice(`点击了链接: ${url}`);\n }}\n copyText={(text) => {\n Message.notice(`复制了文本: ${text}`);\n }}\n />\n </div>\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 组件的交互功能,包括链接处理、文本复制和生成状态等。"},{tag:"@demo",content:"交互功能"},{tag:"@en",content:"Interactive Features"},{tag:"@order",content:"4"}]}},mermaid:{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nimport "@alifd/chat/es/mermaid-view/style";\nconst content = `## Mermaid 图表展示\n所有支持的图表请查看 [Mermaid 官方文档](https://mermaid.js.org/syntax/classDiagram.html)。\n\n### 类图示例\n\\`\\`\\`mermaid\n---\ntitle: Animal example\n---\nclassDiagram\n note "From Duck till Zebra"\n Animal <|-- Duck\n note for Duck "can fly\\ncan swim\\ncan dive\\ncan help in debugging"\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }\n\\`\\`\\`\n\n### 流程图示例\n\\`\\`\\`mermaid\ngraph TD\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e D\n C --\x3e H[结束]\n\\`\\`\\`\n\n### 甘特图示例\n\\`\\`\\`mermaid\ngantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1, 20d\n section Another\n Task in Another :2014-01-12, 12d\n another task :24d\n\\`\\`\\`\n\n### 时间线示例\n\\`\\`\\`mermaid\ntimeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : YouTube\n 2006 : Twitter\n\\`\\`\\`\n\n## Mermaid 论文逻辑图\n\n\\`\\`\\`mermaid\ngraph TB\n A[动机: 序列建模的局限] --\x3e B[提出Transformer]\n B --\x3e C1[架构: Encoder-Decoder]\n B --\x3e C2[核心机制: Multi-Head Attention, Positional Encoding]\n B --\x3e C3[优势: 并行度高, 路径短, 复杂度低]\n C1 --\x3e D1[Encoder: 自注意力 + 前馈网络 \xd76层]\n C1 --\x3e D2[Decoder: Masked 自注意力 + 编码器-解码器注意力 + 前馈 \xd76层]\n C2 --\x3e D3[Scaled Dot-Product Attention: 缩放点积]\n C2 --\x3e D4[Multi-Head Attention: 多头并行子空间表示]\n C2 --\x3e D5[Positional Encoding: 正弦/余弦函数注入位置信息]\n C3 --\x3e D6[可解释性: 注意力权重揭示语义/句法]\n B --\x3e E[实验]\n E --\x3e E1[机器翻译: 英德28.4 BLEU, 英法41.8 BLEU]\n E --\x3e E2[句法分析: WSJ上优于大多数模型]\n B --\x3e F[结论与展望]\n F --\x3e F1[首次纯注意力实现序列建模]\n F --\x3e F2[启发BERT等后续模型]\n F --\x3e F3[拓展至多模态任务]\n\\`\\`\\`\n\n\n### mermaid渲染错误示例\n\\`\\`\\`mermaid\ngraph TB\n subgraph "前端 (wa-taskide-ui)"\n A[页面初始化] --\x3e B{检测WA_ENGINE_SSO_UUID Cookie}\n B --\x3e|不存在| C[调用/logout接口登出]\n C --\x3e D[重新登录流程]\n D --\x3e E[/sendBucSSOToken.do回调]\n E --\x3e F[生成UUID并缓存SSO Token]\n F --\x3e G[设置Cookie: WA_ENGINE_SSO_UUID]\n \n H[工具调用检测] --\x3e I{需要SSO处理?}\n I --\x3e|是| J[调用SSO Ticket生成接口]\n J --\x3e K[缓存SSO Ticket到后端]\n end\n \n subgraph "后端 (wa-engine)"\n L[SSO Token管理服务] --\x3e M[Redis缓存]\n N[SSO Ticket生成服务] --\x3e O[调用BUC接口]\n P[工具参数处理器] --\x3e Q[轮询获取SSO Ticket]\n Q --\x3e R[URL参数追加]\n \n S[Celery定时任务] --\x3e T[SSO Token刷新]\n T --\x3e U[BUC心跳接口]\n end\n \n subgraph "外部服务"\n V[BUC登录服务]\n W[浏览器工具Provider]\n end\n \n F --\x3e L\n K --\x3e N\n O --\x3e V\n R --\x3e W\n T --\x3e V\n\\`\\`\\`\n\n### mermaid 截断示例\n\\`\\`\\`mermaid\ngraph TB\n A[开始] --\x3e B{是否登录?}\n B --\x3e|是| C[显示主页]\n B --\x3e|否| D[跳转登录页]\n D --\x3e E[用户登录]\n E --\x3e F{登录成功?}\n F --\x3e|是| C\n F --\x3e|否| G[显示错误信息]\n G --\x3e \n`;\nconst sendTextMessage = (message) => {\n Message.success(`消息已发送: ${message}`);\n};\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} sendTextMessage={sendTextMessage} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中 Mermaid 图表的使用方法,包括流程图、时序图等。"},{tag:"@demo",content:"Mermaid 图表"},{tag:"@en",content:"Mermaid Diagrams"},{tag:"@order",content:"5"}]}},"rich-text":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 文本样式展示\n\n### 颜色文本\n<font color=common_red1_color>错误提示文本</font>\n<font color=common_green1_color>成功提示文本</font>\n<font color=common_blue1_color>链接文本颜色</font>\n\n### 标题样式\n<font sizeToken=common_h3_text_style__font_size colorTokenV2=common_blue1_color>自定义大小和颜色的标题</font>\n\n### 组合样式示例\n普通文本和 <font color=common_red1_color>**重要提示**</font> 的组合使用\n\n### 应用场景\n- <font color=common_green1_color>✓ 已完成的任务</font>\n- <font color=common_blue1_color>○ 进行中的任务</font>\n- <font color=common_red1_color>\xd7 未完成的任务</font>\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown content={content} />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中的富文本样式,包括文本颜色、字体大小等特性。"},{tag:"@demo",content:"富文本样式"},{tag:"@en",content:"Rich Text Styles"},{tag:"@order",content:"2"}]}},"tables-images":{sourceCode:'import React from "react";\nimport ReactDOM from "react-dom";\nimport { Markdown } from "@alifd/chat";\nimport { Message } from "@alifd/next";\nimport "@alifd/chat/es/markdown/style";\nconst content = `## 数据展示\n\n### 项目进度表\n| 项目阶段 | 开始时间 | 状态 | 负责人 |\n| :- | :-: | -: | :-: |\n| 需求分析 | 2025-06-01 | <font color=common_green1_color>已完成</font> | 张三 |\n| 设计阶段 | 2025-06-10 | <font color=common_blue1_color>进行中</font> | 李四 |\n| 开发阶段 | 2025-06-20 | <font color=common_grey1_color>未开始</font> | 王五 |\n\n### 图片展示\n产品预览图:\n![产品预览](https://img.alicdn.com/imgextra/i1/O1CN01OvFLW11mWeIU13AMp_!!6000000004962-0-tps-1002-1238.jpg)\n\n### 组合展示\n| 功能模块 | 效果预览 | 状态 |\n| :- | :-: | -: |\n| 首页布局 | ![布局](https://img.alicdn.com/imgextra/i4/O1CN01dTkCbh2ABAQjD7Qgm_!!6000000008164-2-tps-219-48.png) | <font color=common_green1_color>已完成</font> |\n`;\nReactDOM.render(\n <div className="demo-mobile-wrap">\n <Markdown\n content={content}\n imagePreview\n handleImageClick={(url) => {\n Message.notice(`点击了图片: ${url}`);\n }}\n />\n </div>,\n mountNode,\n);\n',docInfo:{summary:"",tags:[{tag:"@remarks",content:"展示 Markdown 中表格和图片的使用方法,包括表格对齐和图片预览功能。"},{tag:"@demo",content:"表格与图片"},{tag:"@en",content:"Tables and Images"},{tag:"@order",content:"3"}]}}},s=[{tag:"@remarks",content:"Markdown 组件用于解析和渲染 Markdown 文本内容。 - Markdown component used to parse and render Markdown text content."},{tag:"@component",content:"Markdown"},{tag:"@en",content:"Markdown"},{tag:"@type",content:"通用 - General"},{tag:"@when",content:"需要解析和渲染 Markdown 文本内容时使用。 - Use when you need to parse and render Markdown text content."}].reduce((e,t)=>(e[t.tag]=t.content,e),{}),l={id:"demo-list",title:"代码演示"},u=Object.keys(a).sort((e,t)=>{var n,o,i,s;return parseInt((null==(o=a[e].docInfo.tags)||null==(n=o.find(e=>"@order"===e.tag))?void 0:n.content)||"0")-parseInt((null==(s=a[t].docInfo.tags)||null==(i=s.find(e=>"@order"===e.tag))?void 0:i.content)||"0")}),d=[...s["@when"]?[{id:"何时使用",title:"何时使用"}]:[],l,...u.map(e=>{let t=(0,iZ.kebabCase)(e);return{id:`${t}-container`,title:a[e].docInfo.tags.reduce((e,t)=>(e[t.tag]=t.content,e),{})["@demo"]}})];return(0,e3.jsxs)("div",{className:"demo-wrapper",children:[(0,e3.jsx)("div",{className:"demo-title markdown",children:(0,e3.jsx)("h1",{children:s["@en"]})}),(0,e3.jsx)(Br,{defaultExpandCode:o,defaultLiveDemo:t,onToggleLiveDemo:n,onToggleExpandCode:i,data:d}),(0,e3.jsx)("div",{className:"demo-head",children:(0,e3.jsxs)("div",{id:"demo-area",className:"next-demo-section",children:[(0,e3.jsxs)("div",{id:"md-area-former",className:"markdown-body markdown",children:[(0,e3.jsx)("div",{id:"demo-guide",className:"scroll-count-item active"}),(0,e3.jsx)("p",{children:i2(s["@remarks"])}),(e=s["@when"])?(0,e3.jsxs)(e3.Fragment,{children:[(0,e3.jsx)(i1,{id:"何时使用",title:"何时使用"}),(0,e3.jsx)("ul",{children:(0,e3.jsx)("li",{children:i2(e)})})]}):null,(0,e3.jsx)(i1,{...l})]}),u.map((e,n)=>(0,e5.createElement)(Bn,{disabled:!t,globalExpandCode:o,...a[e],demoKey:e,key:n})),(0,e3.jsx)("div",{id:"md-area-latter",className:"markdown-body markdown",children:(0,e3.jsxs)("div",{id:"demo-api","data-scroll-id":"demo-api",className:"scroll-count-item active",children:[(0,e3.jsx)(i1,{id:"API",title:"API"}),[].map(e=>(0,e5.createElement)(i0,{...e,key:e.title})),s["@others"]?(0,e3.jsx)(ob,{remarkPlugins:[iA],rehypePlugins:[iq,[ij,{behavior:"append",content:()=>[iX("span",{},["#"])],properties:{className:"header-anchor scroll-count-item"}}]],children:s["@others"]}):null]})})]})})]})},{}),document.getElementById("root"))})()})();