import{s as e}from"./chunk-Bj-mKKzh.js";import{t}from"./react-CClhXMB2.js";import{c as n,i as r}from"./uiIdentityOverlay-Ba7GNj7m.js";import{t as i}from"./jsx-runtime-CyI9ICYU.js";import{s as a}from"./lib--QVjyxmL.js";import{r as o}from"./chunk-BO2N2NFS-D0LvxnhU.js";import{_ as s,f as c,v as l,y as u}from"./index-CxCnkDVM.js";var d=e(t(),1),f=i(),p=800,m=/https:\/\/diashort\.apps\.quickable\.co\/(?:d|e)\/[A-Za-z0-9_-]+(?:\?[^\s<]*)?/g;function h(e){let t=e.match(m)??[];return[...new Set(t)]}var g=(0,d.memo)(function({message:e}){let t=r({id:`message.assistant.response`,c3ComponentId:`c3-111`,c3ComponentLabel:`messages`}),i=e.text.length>p,d=h(e.text),m=(0,f.jsx)(`div`,{className:`text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-none space-y-4`,children:(0,f.jsx)(o,{components:s(),linkSafety:{enabled:!1},remarkPlugins:[a,c],children:e.text})});return(0,f.jsxs)(`div`,{className:`w-full max-w-full`,...n(t),children:[i?(0,f.jsx)(u,{type:`markdown`,title:`Response`,defaultExpanded:!0,chrome:`inline`,controlsVisibility:`hover-or-touch`,bodyClassName:`p-0`,rawContent:e.text,children:m}):m,d.length>0?(0,f.jsx)(`div`,{className:`mt-4 space-y-3`,children:d.map((t,n)=>(0,f.jsx)(u,{type:`embed`,title:`Embedded Diagram`,defaultExpanded:!0,rawContent:t,children:(0,f.jsx)(l,{format:`diashort`,source:t})},`${e.id}-diashort-${n}`))}):null]})});export{g as TextMessage};