1import{a as A}from"/build/_shared/chunk-WEZH5ZYH.js";import{b as I}from"/build/_shared/chunk-7IRWQSW2.js";import{c as R}from"/build/_shared/chunk-BQGPWCJM.js";import{c as x}from"/build/_shared/chunk-P7PAJD3K.js";import{c as M}from"/build/_shared/chunk-IJY4CDIU.js";import{a as L}from"/build/_shared/chunk-3SHXPYX6.js";import{a as D}from"/build/_shared/chunk-7QENOJF7.js";import{Aa as H,Ia as W,Q as _,S as r,U as t,da as B}from"/build/_shared/chunk-ND5KZ6C6.js";import{a as p}from"/build/_shared/chunk-MUQZVJ74.js";import{a as Y}from"/build/_shared/chunk-QIZ5RRJR.js";import{e as s}from"/build/_shared/chunk-JJCFQLUO.js";var n=s(Y());var d=s(p());function h({attachment:l}){function a(g){return g.split("/")[0]||""}return(0,d.jsx)(L,{to:l.content_url,target:"_blank",prefetch:"none",rel:"noopener",children:a(l.content_type)=="image"?(0,d.jsx)("img",{src:l.content_url,style:{maxWidth:"100%",maxHeight:"200px",height:"100%",borderRadius:"5px 5px 0 0"},alt:l.filename}):(0,d.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:(0,d.jsx)("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round",d:"M4.5 7.5h7m-7 1.97h7m-7 2h7m3-7.27V15c0 .28-.22.5-.5.5H2c-.28 0-.5-.22-.5-.5V1c0-.28.22-.5.5-.5h8.85c.13 0 .26.05.36.15l3.15 3.2c.09.1.14.22.14.35zm-4-3.7V4c0 .28.22.5.5.5h3.5"})})})}var e=s(p()),E=(0,n.forwardRef)(({id:l,fromSupport:a,trustUserContent:g=!0,html_body:m,markdown_body:f,modelName:u,speed:b,cost:w,chatMessageId:z,completionLatency:v,completionTime:T,attachments:k,author_name:N,created_at:S,supportMessageHaveFullWidth:C=!1,supportMessageHaveNoBackground:U=!1,supportMessageHasCreatedAt:P=!0,attachmentsPreviews:V=[],status:F},G)=>{let[$,X]=(0,n.useState)(m||"");function q(o){let y=document.createElement("textarea");return y.innerHTML=o,y.value}(0,n.useEffect)(()=>{typeof window!="undefined"&&m&&X(q(m))},[m]);let i=!a,J=R(u||""),K=(0,n.useContext)(D),{user:O}=K,Q=Boolean(O.system_record);return(0,e.jsxs)(r,{id:l,ref:G,sx:{maxWidth:a&&C?"100%":{xs:"100%",sm:"80%",lg:"70%"},minWidth:"auto",width:a&&C?"100%":"auto",alignSelf:i?"flex-end":"flex-start",display:"flex",flexDirection:"column",gap:.5},children:[(0,e.jsxs)(r,{sx:{display:"flex",flexDirection:"row",gap:1,alignItems:"flex-start",width:"100%"},children:[(0,e.jsx)(r,{sx:{flexShrink:0},children:a&&(0,e.jsx)(_,{src:J,sx:{backgroundColor:"background.body"}})}),(0,e.jsxs)(r,{sx:{width:"100%",maxWidth:"100%",flexGrow:1,overflow:"hidden"},children:[(0,e.jsxs)(W,{direction:"row",spacing:2,sx:{justifyContent:"space-between",mb:.25},children:[(0,e.jsxs)(r,{sx:{display:"flex",flexDirection:"row",gap:.5},children:[(0,e.jsx)(t,{level:"body-xs",children:N}),a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t,{level:"body-xs",children:"|"}),(0,e.jsx)(t,{level:"body-xs",children:u}),b&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t,{level:"body-xs",children:"|"}),(0,e.jsxs)(t,{level:"body-xs",children:["speed: ",x(b)," tokens/s"]})]}),v&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t,{level:"body-xs",children:"|"}),(0,e.jsxs)(t,{level:"body-xs",children:["latency: ",x(v/1e3)," s"]})]}),T&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t,{level:"body-xs",children:"|"}),(0,e.jsxs)(t,{level:"body-xs",children:["time: ",x(T/1e3)," s"]})]})]})]}),a&&P||!a&&(0,e.jsx)(t,{level:"body-xs",children:M(S,"browser")})]}),(0,e.jsx)(r,{sx:{position:"relative",width:"100%"},children:(0,e.jsx)(H,{color:i?"primary":"neutral",variant:i?"solid":"soft",sx:[{borderRadius:"lg",overflow:"hidden",width:"100%",maxWidth:"100%",img:{maxWidth:"95%",maxHeight:"200px",p:2,cursor:"pointer"}},i?{p:1.25}:{p:0},i?{borderTopRightRadius:0}:{borderTopRightRadius:"lg"},i?{borderTopLeftRadius:"lg"}:{borderTopLeftRadius:0},i?{backgroundColor:"primary.500"}:{backgroundColor:U?"background.body":"neutral.200"}],children:(0,e.jsxs)(r,{sx:{width:"100%",maxWidth:"100%",overflowX:"hidden"},children:[f?(0,e.jsx)(A,{content:f,trustInput:a||g,status:F}):(0,e.jsx)(r,{sx:{width:"100%",maxWidth:"100%",overflowWrap:"break-word",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:$},onClick:o=>{o.target.tagName==="IMG"&&window.open(o.target.src,"_blank")}}),k.length>0&&(0,e.jsxs)(r,{children:[(0,e.jsx)(B,{}),k.map(o=>(0,e.jsx)(h,{attachment:o},o.id||o.filename))]})]})})}),Q&&a&&(0,e.jsxs)(r,{sx:{display:"flex",flexDirection:"row",gap:.5,mt:.5,color:"text.tertiary"},children:[(0,e.jsx)(t,{level:"body-xs",children:"System Administrator Info:"}),w&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(t,{level:"body-xs",children:["cost: ",w," USD"]}),(0,e.jsx)(t,{level:"body-xs",children:"|"})]}),(0,e.jsxs)(t,{level:"body-xs",children:["chat_message_id: ",z]}
1)]})]})]}),(0,e.jsx)(r,{sx:{display:"flex",flexDirection:"column",gap:.25},children:V.map((o,y)=>(0,e.jsx)(I,{previewUrl:o.preview_url,fileName:o.file_name,fileSize:o.file_size,onClick:()=>{let c=o.download_url||o.preview_url;c&&!c.includes("flaticon.com")&&window.open(c,"_blank")}},`uploaded-file-${o.file_name}-${o.file_size}`))})]})});E.displayName="Comment";var de=E;export{de as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.