1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9040],{79040:(e,t,s)=>{s.d(t,{A:()=>N});var r=s(95155),a=s(12115),n=s(20063),l=s(75557),i=s(28990),c=s(15992),d=s(7220),o=s(37772),m=s(18514),h=s(71360),x=s(97003),u=s(82180),p=s(91787),g=s(71761),j=s(41180);function y(e){let{projectId:t,projectName:s,dataTestId:a,onProjectClick:n}=e,l="font-medium text-card-foreground text-right truncate min-w-0 max-w-full block",i="summary-project-".concat(a||"0"),c=t?(0,r.jsx)("button",{type:"button",onClick:n,className:"".concat(l," hover:text-brand-primary cursor-pointer transition-colors"),"data-testid":i,children:s}):(0,r.jsx)("span",{className:l,"data-testid":i,children:s});return(0,r.jsxs)(u.Tooltip,{delayDuration:200,children:[(0,r.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,r.jsx)("span",{className:"min-w-0 flex-1 flex justify-end ml-4",children:c})}),(0,r.jsx)(u.TooltipContent,{side:"top",sideOffset:6,children:s})]})}function N(e){let{title:t,content:s,lastUpdated:u,updatedBy:N,project_id:f,project_name:b,isAISummary:v=!1,aiBadgeText:w="AI reviewed",maxContentLength:k=100,bg:A,dataTestId:z,allowEdit:C=!1,onEdit:Z,onDelete:$,documentUrl:S,documentName:T,documentTestId:D,onProjectClick:I,onViewMore:_}=e,E=(0,n.useRouter)(),[L,M]=(0,a.useState)(!1),q=s.length>k,B=L?s:s.slice(0,k)+(q?"...":"");return(0,r.jsxs)("div",{className:"border border-gray-200 rounded-lg ".concat(A||""," hover:bg-bg-card transition-colors group relative"),style:{padding:v?"25px 16px 16px 16px":"16px"},"data-testid":z,children:[v&&(0,r.jsx)("div",{className:"absolute left-[2px] top-[2px] z-10",children:(0,r.jsx)(g.A,{showBackground:!1,showTooltip:!1,text:w})}),(0,r.jsxs)("div",{className:"space-y-3",children:[t&&(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h4",{className:"font-medium text-sm text-text-primary","data-testid":"summary-title-".concat((null==z?void 0:z.split("-").pop())||"0"),children:t}),C&&(Z||$)?(0,r.jsxs)(d.DropdownMenu,{modal:!1,children:[(0,r.jsx)(d.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsx)(x.Button,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100 transition-opacity text-text-primary hover:text-text-primary","data-testid":"summary-menu-".concat(t),"aria-label":"Summary options",children:(0,r.jsx)(o.A,{className:"h-4 w-4"})})}),(0,r.jsxs)(d.DropdownMenuContent,{align:"end",className:"w-40 z-9999",children:[Z?(0,r.jsxs)(d.DropdownMenuItem,{onClick:Z,className:"cursor-pointer","data-testid":"edit-summary-".concat(t),children:[(0,r.jsx)(m.A,{className:"h-4 w-4"}),"Edit"]}):null,$?(0,r.jsxs)(d.DropdownMenuItem,{onClick:()=>{var e;if(!$)return;let s="summary-delete-confirm-".concat(null!=(e=null!=z?z:t)?e:"item");j.Lx.openDialog("confirmation",{id:s,title:"Delete Note",data:{message:"Are you sure you want to delete this note? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",onConfirm:()=>{$()},onCancel:()=>{}},size:"sm"})},className:"cursor-pointer text-destructive focus:text-white","data-testid":"delete-summary-".concat(t),children:[(0,r.jsx)(h.A,{className:"h-4 w-4"}),"Delete"]}):null]})]}):null]}),S&&(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)(i.A,{icon:"".concat(c.cZ,"#document_icon"),width:20,height:20,color:"var(--color-secondary-text)"})}),(0,r.jsx)("div",{className:"text-sm text-text-placeholder hover:text-text-primary cursor-pointer",children:(0,r.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"hover:underline","data-testid":D||"summary-document-link",children:T||"Document"})})]}),(0,r.jsxs)("div",{className:"text-sm text-secondary-text leading-relaxed","data-testid":v?"ai-summary-content":"summary-description-".concat((null==z?void 0:z.split("-").pop())||"0"),children:[(0,r.jsx)(p.A,{content:B,dataTestId:v?"ai-summary-rich-content":"summary-rich-content-".concat((null==z?void 0:z.split("-").pop())||"0")}),q&&(0,r.jsx)("button",{className:"text-sm font-medium text-text-primary hover:text-primary-text cursor-pointer ml-1 transition-colors",onClick:()=>{_?_():M(!L)},"data-testid":"summary-view-more-button-".concat(t||"ai"),"aria-expanded":L,"aria-label":L?"Show less ".concat(t||"AI summary"," content"):"Show more ".concat(t||"AI summary"," content"),children:L?"view less":"view more"})]}),(0,r.jsxs)("div",{className:"space-y-1",children:[u&&(0,l.Lo)(u)&&(0,r.jsxs)("div",{className:"flex justify-between items-center text-[11px] text-secondary-text",children:[(0,r.jsx)("span",{"data-testid":"last-updated-label",children:"Last Updated"}),(0,r.jsx)("span",{className:"font-medium text-card-foreground","data-testid":"last-updated-date",children:(0,l.Lo)(u)})]}),N&&(0,r.jsxs)("div",{className:"flex justify-between items-center text-[11px] text-secondary-text",children:[(0,r.jsx)("span",{"data-testid":"summary-updated-by-label-".concat((null==z?void 0:z.split("-").pop())||"0"),children:"Updated By"}),(0,r.jsx)("span",{className:"font-medium text-card-foreground","data-testid":"summary-updated-by-".concat((null==z?void 0:z.split("-").pop())||"0"),children:N})]}),b&&(0,r.jsxs)("div",{className:"flex justify-between items-center gap-2 text-xs text-secondary-text min-w-0",children:[(0,r.jsx)("span",{className:"shrink-0","data-testid":"project-label-".concat(z||"0"),children:"Engagement"}),(0,r.jsx)(y,{projectId:f,projectName:b,dataTestId:z,onProjectClick:()=>{f&&(I&&I(),E.push("/projects/".concat(f)))}})]})]})]})]})}},91787:(e,t,s)=>{s.d(t,{A:()=>d});var r=s(95155),a=s(12115),n=s(99620),l=s(5134),i=s(34217),c=s(23255);
1function d(e){let{content:t,className:s="",dataTestId:d}=e;if(!t||""===t.trim())return null;let o=(e=>{if(!e)return e;let t=e;return(t=(t=(t=(t=t.replace(/\\n/g,"\n")).replace(/^#n#(\d+)\.\s+(.*)$/gm,"$1. $2")).replace(/^(\w+)#(\s+[^\n]+)$/gm,(e,t,s)=>["quote","text","heading","title"].includes(t.toLowerCase())||t.length<=10&&/^[a-zA-Z]+$/.test(t)?"#".concat(s):e)).replace(/^[ \t]+(#{1,6}\s+)/gm,"$1")).replace(/\+\+([^+]+)\+\+/g,(e,t)=>"<u>".concat(t,"</u>"))})(t),m=(e=>{if(!e||""===e.trim())return"plain";let t=e.trim(),s=t.includes("\n"),r=0;[/<[a-zA-Z][a-zA-Z0-9]*[^>]*>/g,/<\/[a-zA-Z][a-zA-Z0-9]*>/g,/<[a-zA-Z][a-zA-Z0-9]*\s*\/>/g,/&[a-zA-Z0-9#]+;/g].forEach(e=>{let s=t.match(e);s&&(r+=s.length)});let a=0;[/^#{1,6}\s+/gm,/^\*\s+/gm,/^-\s+/gm,/^\+\s+/gm,/^\d+\.\s+/gm,/^#n#\d+\.\s+/gm,/^\>\s+/gm,/\[([^\]]+)\]\(([^)]+)\)/g,/!\[([^\]]*)\]\(([^)]+)\)/g,/\*\*([^*]+)\*\*/g,/\*([^*]+)\*/g,/\+\+([^+]+)\+\+/g,/~~([^~]+)~~/g,/`([^`]+)`/g,/^```[\s\S]*?^```/gm,/^---$/gm,/^\*\*\*$/gm].forEach(e=>{let s=t.match(e);s&&(a+=s.length)});let n=/<[a-zA-Z][a-zA-Z0-9]*[^>]*>.*<\/[a-zA-Z][a-zA-Z0-9]*>/.test(t),l=/^#{1,6}\s+|^\*\s+|^-\s+|^\d+\.\s+|^#n#\d+\.\s+|^\>\s+|\[.*\]\(.*\)|\*\*.*\*\*|\*.*\*|\+\+.*\+\+|~~.*~~|`.*`/.test(t),i=/^<[^>]*>[\s\S]*<\/[^>]*>$/.test(t),c=/^#{1,6}\s+[\s\S]*$|^\*\s+[\s\S]*$|^-\s+[\s\S]*$|^\d+\.\s+[\s\S]*$/.test(t);return i&&!l?"html":c&&!n?"markdown":r>2*a?"html":a>2*r?"markdown":n&&!l?"html":l&&!n||s&&/\n\n/.test(t)||s&&!n&&!l?"markdown":"plain"})(o),h={fontSize:"14px",lineHeight:"1.6",color:"var(--color-secondary-text)"};if("html"===m)return(0,r.jsx)("div",{className:"rich-text-display ".concat(s),"data-testid":d,style:h,dangerouslySetInnerHTML:{__html:o}});if("markdown"===m)return(0,r.jsx)("div",{className:"rich-text-display ".concat(s),"data-testid":d,style:h,children:(0,r.jsx)(n.oz,{remarkPlugins:[l.A,i.A],rehypePlugins:[c.A],components:{h1:e=>{let{children:t}=e;return(0,r.jsx)("h1",{className:"editor-heading-h1",children:t})},h2:e=>{let{children:t}=e;return(0,r.jsx)("h2",{className:"editor-heading-h2",children:t})},h3:e=>{let{children:t}=e;return(0,r.jsx)("h3",{className:"editor-heading-h3",children:t})},h4:e=>{let{children:t}=e;return(0,r.jsx)("h4",{className:"editor-heading-h4",children:t})},h5:e=>{let{children:t}=e;return(0,r.jsx)("h5",{className:"editor-heading-h5",children:t})},h6:e=>{let{children:t}=e;return(0,r.jsx)("h6",{className:"editor-heading-h6",children:t})},p:e=>{let{children:t}=e;return(0,r.jsx)("p",{className:"editor-paragraph",children:t})},ul:e=>{let{children:t}=e;return(0,r.jsx)("ul",{className:"editor-list-ul",children:t})},ol:e=>{let{children:t}=e;return(0,r.jsx)("ol",{className:"editor-list-ol",children:t})},li:e=>{let{children:t}=e;return(0,r.jsx)("li",{className:"editor-listitem",children:t})},blockquote:e=>{let{children:t}=e;return(0,r.jsx)("blockquote",{className:"editor-quote",children:t})},code:e=>{let{children:t,className:s}=e;return s?(0,r.jsx)("code",{className:"editor-code",children:t}):(0,r.jsx)("code",{className:"editor-text-code",children:t})},pre:e=>{let{children:t}=e;return(0,r.jsx)("pre",{className:"bg-bg-nav p-3 rounded overflow-x-auto",children:t})},a:e=>{let{href:t,children:s}=e;return(0,r.jsx)("a",{href:t,target:(null==t?void 0:t.startsWith("http"))?"_blank":void 0,rel:(null==t?void 0:t.startsWith("http"))?"noopener noreferrer":void 0,className:"editor-link",children:s})},strong:e=>{let{children:t}=e;return(0,r.jsx)("strong",{className:"editor-text-bold",children:t})},em:e=>{let{children:t}=e;return(0,r.jsx)("em",{className:"editor-text-italic",children:t})},u:e=>{let{children:t}=e;return(0,r.jsx)("u",{className:"editor-text-underline",children:t})},del:e=>{let{children:t}=e;return(0,r.jsx)("del",{className:"editor-text-strikethrough",children:t})},div:e=>{let{children:t,className:s,style:a,...n}=e;return(0,r.jsx)("div",{className:s,style:a,...n,children:t})},span:e=>{let{children:t,className:s,style:a,...n}=e;return(0,r.jsx)("span",{className:s,style:a,...n,children:t})},table:e=>{let{children:t}=e;return(0,r.jsx)("table",{className:"min-w-full border-collapse border border-stroke-light",children:t})},thead:e=>{let{children:t}=e;return(0,r.jsx)("thead",{className:"bg-gray-200",children:t})},tbody:e=>{let{children:t}=e;return(0,r.jsx)("tbody",{children:t})},tr:e=>{let{children:t}=e;return(0,r.jsx)("tr",{className:"border-b border-stroke-light",children:t})},th:e=>{let{children:t}=e;return(0,r.jsx)("th",{className:"border border-stroke-light px-3 py-2 text-left font-semibold text-brand-primary",children:t})},td:e=>{let{children:t}=e;return(0,r.jsx)("td",{className:"border border-stroke-light px-3 py-2",children:t})}},children:o})});let x=o.split("\n"),u=o.split(/\n\s*\n/);return(0,r.jsx)("div",{className:"rich-text-display ".concat(s),"data-testid":d,style:h,children:u.length>1?u.map((e,t)=>(0,r.jsx)("p",{className:"editor-paragraph",children:e.split("\n").map((t,s)=>(0,r.jsxs)(a.Fragment,{children:[t,s<e.split("\n").length-1&&(0,r.jsx)("br",{})]},s))},t)):x.map((e,t)=>(0,r.jsxs)(a.Fragment,{children:[e,t<x.length-1&&(0,r.jsx)("br",{})]},t))})}}}]);
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.