1"use strict";(self.webpackChunksonarlabs_ai=self.webpackChunksonarlabs_ai||[]).push([[37],{5958(e,s,t){t.d(s,{A:()=>a});t(5043);const a=t.p+"static/media/altRoute.0f165b0da26672bedd13e209ba61d141.svg"},1684(e,s,t){t.d(s,{A:()=>a});t(5043);const a=t.p+"static/media/docx.b6ee20e3b50866900e3bba87fb97fdae.svg"},5208(e,s,t){t.d(s,{A:()=>a});t(5043);const a=t.p+"static/media/pdf.a402b82aff8fb14ec86bc810c0097f24.svg"},8477(e,s,t){t.d(s,{A:()=>a});t(5043);const a=t.p+"static/media/tenancy.cbb8d2b2da18a5a5258a2607220e4f50.svg"},4420(e,s,t){t.d(s,{A:()=>r});t(5043);var a=t(820),l=t(621),i=t(5355),n=t(579);const r=function(e){let{isFileIndexing:s,setFetchingResult:t,fetchingResult:r,_handleKeyDown:d,searchValue:o,setSearchValue:c,fetchQueryReq:m,setIsFocusModeOn:u,setActAnimation:h,isFocusModeOn:p,actAnimation:f}=e;return(0,n.jsx)("div",{className:"single-file-search ".concat(r&&"hide-animate"),children:(0,n.jsx)("div",{className:"single-search-box",children:s?(0,n.jsx)("p",{children:l.Ay.ANALYZING_THE_DOCUMENT}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:l.Ay.ASK_QUESTIONS_FOR_CLARITY}),(0,n.jsxs)("div",{className:"search-box-input",children:[(0,n.jsx)(i.A,{position:"top",setIsFocusModeOn:u,setActAnimation:h,isFocusModeOn:p,actAnimation:f}),(0,n.jsx)("input",{type:"text",placeholder:"Search ",onChange:e=>c(e.target.value),onKeyDown:d,value:o}),(0,n.jsx)(a.h,{className:"".concat(!o&&"image"),onClick:()=>{t(!0),m()}})]})]})})})}},925(e,s,t){t.d(s,{A:()=>n});t(5043);var a=t(621),l=t(8477),i=t(579);const n=function(){return(0,i.jsxs)("div",{className:"after-file-search-matches",children:[(0,i.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,i.jsx)("img",{src:l.A,alt:"not-found"}),(0,i.jsx)("p",{className:"result-title",children:a.Ay.SOURCES})]}),(0,i.jsx)("div",{className:"result-vertical-wrap",children:[1,2,3,4].map((e=>(0,i.jsx)("div",{className:"single-record-card animate-answer-in color-effect-animation",children:(0,i.jsx)("div",{className:"single-record-card-header"})},e)))})]})}},8037(e,s,t){t.r(s),t.d(s,{default:()=>$});var a=t(9379),l=t(5043),i=(t(5331),t(820)),n=t(8477),r=t(9106),d=t(5958),o=t(1712),c=t(621),m=t(2113),u=(t(4420),t(5416)),h=t(6747),p=t(6815),f=t(5355),g=t(579);const x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.length>110?e.slice(0,110)+"...":e};var v=t(1404),j=t(9285),_=t(3216),b=t(5475),y=t(3491);const N=t.p+"static/media/generate.6fc6f831bb48b6d4bdbe70f8cdf46594.svg";var A=t(811),w=t(3217),S=t(8606);const F=(0,t(9662).A)((0,g.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked");const k=function(e){let{pdfFileColors:s,imageData:t,selectedFile:a,setSelectedFile:i,selectedFileCount:r,setSelectedFileCount:d}=e;const[m,u]=(0,l.useState)([]);return(0,g.jsx)(g.Fragment,{children:t.length>0&&t.map(((e,t)=>(0,g.jsx)("div",{children:(0,g.jsxs)("div",{className:"after-file-search-matches",children:[(0,g.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,g.jsx)("img",{src:n.A,alt:"not-found"}),(0,g.jsx)("p",{className:"result-title",children:c.Ay.SOURCES})]}),s.length>0&&s.map(((l,n)=>{let c={};if(n===t){var h,p;const n=[];var f;if(Object.keys(l).forEach((e=>{let s={};s.pdfName=e,s.pdfColor=l[e],"filesLength"!==e&&n.push(s)})),null!==e&&void 0!==e&&null!==(h=e.answer)&&void 0!==h&&h.result_data&&(null===e||void 0===e||null===(p=e.answer)||void 0===p?void 0:p.result_data.length)>0)null===e||void 0===e||null===(f=e.answer)||void 0===f||f.result_data.forEach(((e,s)=>{c[e.file_name]||(c[e.file_name]=[]),c[e.file_name].push(e)}));return(0,g.jsx)(g.Fragment,{children:n.map(((e,l)=>{var n,h,p;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{style:{display:"flex",justifyContent:"start",alignItems:"center",gap:"0.5rem",margin:"0.5rem 0px"},children:(0,g.jsxs)("div",{className:"indexing-status collapsable-div",style:{padding:"0.3rem 0.5em",paddingRight:"1rem",paddingLeft:"0.5rem"},onClick:()=>{((e,s)=>{let t=JSON.parse(JSON.stringify(m));t[e]&&t[e][s]?t[e][s]=!1:t[e]={[s]:!0},u((e=>t))})(t,e.pdfName)},children:[(0,g.jsx)("div",{className:"ready-to-search",style:{backgroundColor:e.pdfColor,width:"0.8rem",height:"0.8rem",padding:"0.1rem",display:"flex",justifyContent:"center",alignItems:"center"},children:(null===(n=r[e.pdfName])||void 0===n?void 0:n.length)>0&&(0,g.jsx)("span",{style:{fontWeight:"bold",fontSize:"0.7rem"},children:null===(h=r[e.pdfName])||void 0===h?void 0:h.length})}),e.pdfName,(0,g.jsx)("img",{src:o.A,alt:"noImageFound",style:{transform:m[t]&&m[t][e.pdfName]?"rotate(270deg)":"rotate(180deg)",marginLeft:"2rem",width:"6.3px",transition:"0.2s ease-in-out"}})]})}),(0,g.jsx)("div",{className:"result-vertical-wrap",style:{marginTop:"0.8rem",display:m[t]&&m[t][e.pdfName]?"flex":"none"},children:c[e.pdfName]&&c[e.pdfName].length>0&&c[e.pdfName].slice(0,null===(p=c[e.pdfName])||void 0===p?void 0:p.length).map(((l,n)=>{let o=s[t];if(e.pdfName===l.file_name)return(0,g.jsxs)("div",{className:"single-record-card animate-answer-in ".concat(a.includes(l.serial_number)&&"active-single-record-card"),style:{minWidth:"200px"},onClick:()=>{let s=[];a.includes(l.serial_number)?a.forEach((e=>{e!==l.serial_number&&s.push(e)})):(s=[...a],s.push(l.serial_number)),i((e=>s));let t=r;if(t[e.pdfName]&&0!==t[e.pdfName].length)if(t[e.pdfName].includes(l.serial_number)){let s=[];t[e.pdfName].forEach((e=>{e!==l.serial_number&&s.push(e)})),t[e.pdfName]=s}else t[e.pdfName].push(l.serial_number);else t[e.pdfName]=[l.serial_number];d((e=>t))},children:[(0,g.jsxs)("div",{className:"single-record-card-header",children:[(0,g.jsxs)("div",{className:"card-match-percentage",style:{backgroundColor:o[l.file_name]},children:["PAGE - ",null===l||void 0===l?void 0:l.page_num]}),(0,g.jsx)("div",{className:"card-match-page",children:(0,g.jsx)(w.A,{icon:(0,g.jsx)(F,{}),checkedIcon:(0,g.jsx)(S.A,{}),checked:a.includes(l.serial_number),sx:{color:"#1F5D5E","&.Mui-checked":{color:"#1F5D5E"},padding:"0px"}})})]}),(0,g.jsxs)("span",{style:{fontSize:"11px",fontWeight:"300",color:"black"},children:[" ",null===l||void 0===l?void 0:l.text_to_highlight.substring(0,72)," "]})]},l.page_num+n)}))})]})}))})}}))]})},t+"answer")))})};
1var C=t(9859),E=t(5865),I=t(824),D=t(6178),O=t.n(D);const R={fontFamily:"Plus Jakarta Sans",color:"rgb(27, 46, 49)",fontSize:"16px","& .MuiInputBase-input.Mui-disabled":{WebkitTextFillColor:"black",backgroundColor:"#f3f3f3"},margin:"0.1rem"};const M=function(e){let{projectName:s,error:t,setError:i,setUserFormData:n,userFormData:r}=e;const d=I.s.getUserData(),o=(e,s)=>{n((t=>(0,a.A)((0,a.A)({},t),{},{[e]:s}))),i(s?s=>(0,a.A)((0,a.A)({},s),{},{[e]:""}):s=>(0,a.A)((0,a.A)({},s),{},{[e]:c.Ay.REQUIRED_FIELD_ERROR_MSG}))};return(0,l.useEffect)((()=>{n({rfi_number:"",project_name:s,submitted_by:d.first_name+" "+d.last_name,submitted_to:"",date:O()(new Date).format("MM/DD/YYYY")})}),[]),(0,g.jsx)("div",{style:{padding:"0px 1.8rem"},children:(0,g.jsxs)("div",{style:{flex:1},children:[(0,g.jsxs)("div",{className:"flex-input-box",style:{marginTop:"1rem"},children:[(0,g.jsx)(E.A,{className:"input-label",sx:(0,a.A)({},R),children:"RFI number"}),(0,g.jsx)(C.A,{size:"small",sx:(0,a.A)({},R),placeholder:"RFI number",fullWidth:!0,error:t.isError&&t.rfi_number,required:!0,value:r.rfi_number,className:"outline-input-customized",onChange:e=>o("rfi_number",e.target.value)}),t.isError&&t.rfi_number&&(0,g.jsx)("span",{style:{fontSize:"12px",color:"red",display:"flex",justifyContent:"start",padding:"0.3rem 0rem"},children:t.rfi_number})]}),(0,g.jsxs)("div",{className:"flex-input-box",style:{marginTop:"1rem"},children:[(0,g.jsx)(E.A,{className:"input-label",sx:(0,a.A)({},R),children:"Project name"}),(0,g.jsx)(C.A,{size:"small",sx:(0,a.A)({},R),placeholder:"Project name",fullWidth:!0,error:t.isError&&t.project_name,required:!0,value:r.project_name,className:"outline-input-customized",onChange:e=>o("project_name",e.target.value),disabled:!0}),t.isError&&t.project_name&&(0,g.jsx)("span",{style:{fontSize:"12px",color:"red",display:"flex",justifyContent:"start",padding:"0.3rem 0rem"},children:t.project_name})]}),(0,g.jsxs)("div",{className:"flex-input-box",style:{marginTop:"1rem"},children:[(0,g.jsx)(E.A,{className:"input-label",sx:(0,a.A)({},R),children:"Date"}),(0,g.jsx)(C.A,{size:"small",sx:(0,a.A)({},R),placeholder:"Project name",fullWidth:!0,error:t.isError&&t.date,required:!0,value:r.date,className:"outline-input-customized",disabled:!0})]}),(0,g.jsxs)("div",{className:"flex-input-box",style:{marginTop:"1rem"},children:[(0,g.jsx)(E.A,{className:"input-label",sx:(0,a.A)({},R),children:"Submitted to"}),(0,g.jsx)(C.A,{size:"small",sx:(0,a.A)({},R),placeholder:"Submitted to",fullWidth:!0,error:t.isError&&t.submitted_to,required:!0,value:r.submitted_to,onChange:e=>o("submitted_to",e.target.value),className:"outline-input-customized"}),t.isError&&t.submitted_to&&(0,g.jsx)("span",{style:{fontSize:"12px",color:"red",display:"flex",justifyContent:"start",padding:"0.3rem 0rem"},children:t.submitted_to})]}),(0,g.jsxs)("div",{className:"flex-input-box",style:{marginTop:"1rem"},children:[(0,g.jsx)(E.A,{className:"input-label",sx:(0,a.A)({},R),children:"Submitted by"}),(0,g.jsx)(C.A,{size:"small",sx:(0,a.A)({},R),placeholder:"Submitted by",fullWidth:!0,error:t.isError&&t.submitted_to,required:!0,value:r.submitted_by,className:"outline-input-customized",disabled:!0}),t.isError&&t.submitted_by&&(0,g.jsx)("span",{style:{fontSize:"12px",color:"red",display:"flex",justifyContent:"start",padding:"0.3rem 0rem"},children:t.submitted_by})]})]})})};const T=t.p+"static/media/tenancyWhite.c1baf308171b0c50f2a19a10225966e1.svg";const z=t.p+"static/media/db.535c2b847cb9ab7dec7e72c66bd899af.svg";const L=t.p+"static/media/dbWhite.c44935c00fb7a93fc190299df4232671.svg";var W=t(8904),P=t(7510),B=t(8585),q=t(7718),V=t(5208),H=t(1684);const U=function(e){let{setIsModalOpen:s,isModalOpen:t,pdfFileColors:i,imageData:r,projectName:d,projectId:o}=e;const[m,h]=(0,l.useState)(1),[p,f]=(0,l.useState)(!1),[x,v]=(0,l.useState)([]),[j,_]=(0,l.useState)({}),[b,y]=(0,l.useState)({}),N=()=>{p||s(!1)},[w,S]=(0,l.useState)({isError:!1,rfi_number:"",project_name:"",submitted_to:"",submitted_by:"",date:""}),[F,C]=(0,l.useState)({rfi_number:"",project_name:"",submitted_to:"",submitted_by:"",date:""}),E=()=>{const e=(e=>{const s={isError:!1,rfi_number:"",project_name:"",submitted_to:"",submitted_by:"",date:""};return Object.entries(e).forEach((e=>
1{let[t,a]=e;a||(s[t]=c.Ay.REQUIRED_FIELD_ERROR_MSG,s.isError=!0)})),s})(F);if(S(e),e.isError)return;const s={project_id:o,result_data:[],highlight_data:[],response:r[0].answer_given||r[0].response,subject:r[0].searchValue,rfi_number:F.rfi_number,submitted_to:F.submitted_to,submitted_by:F.submitted_by};Object.keys(r[0].answer).forEach((e=>{"result_data"!==e&&"highlight_data"!==e||r[0].answer[e].forEach((t=>{x.includes(t.serial_number)&&s[e].push(t)}))})),f(!0),(0,q.G)(s).then((e=>{if(e){const s=(0,u.$B)(e),t=JSON.parse(s);v((e=>[])),h((e=>3)),f(!1),y(null===t||void 0===t?void 0:t.rfi_details)}else f(!1)}))};return(0,g.jsx)("div",{className:"pdf-side-view-modal-absolute",style:{width:t?"100%":"0px",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"0px",height:"calc(100vh)"},onClick:N,children:(0,g.jsx)("div",{className:"pdf-side-view-modal pdf-side-view-modal-absolute",style:{width:t?"600px":"0px",height:"calc(100vh - 0.2rem)"},onClick:e=>e.stopPropagation(),children:t&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"pdf-side-view-modal-header",children:[(0,g.jsx)("div",{className:"double-arrow-with-title",children:(0,g.jsx)("p",{children:"Generate Template "})}),(0,g.jsx)("img",{src:A.A,style:{width:"0.8rem",cursor:"pointer"},alt:"not-found",onClick:N})]}),m<=2&&(0,g.jsxs)("div",{className:"rfi-bread-crumb",children:[(0,g.jsxs)("div",{className:"generate-left-container",style:{gap:"0.5rem",cursor:"default"},children:[(0,g.jsx)("img",{src:1===m?T:n.A,alt:"no",className:"bread-crumb-img",style:{backgroundColor:1===m?"black":"white"}}),(0,g.jsx)("p",{style:{color:1===m?"black":"#6D6D6D"},children:"Select source"})]}),(0,g.jsx)("img",{src:W.A,alt:"no"}),(0,g.jsxs)("div",{className:"generate-left-container",style:{gap:"0.5rem",cursor:"default"},children:[(0,g.jsx)("img",{src:2===m?L:z,alt:"no",className:"bread-crumb-img",style:{backgroundColor:2===m?"black":"white"}}),(0,g.jsx)("p",{style:{color:2===m?"black":"#6D6D6D"},children:"Additional details "})]})]}),(0,g.jsx)("div",{className:"project-level-history",children:p?(0,g.jsxs)("div",{className:"no-projects-found",children:[(0,g.jsxs)("p",{style:{fontSize:"14px",textAlign:"center",lineHeight:"1.2rem"},children:["Your RFI is currently being generated. ",(0,g.jsx)("br",{}),"Please do not refresh or close the page."]}),(0,g.jsxs)("div",{class:"loading-dots",children:[(0,g.jsx)("div",{class:"dot"}),(0,g.jsx)("div",{class:"dot"}),(0,g.jsx)("div",{class:"dot"})]})]}):(0,g.jsx)(g.Fragment,{children:1===m?(0,g.jsxs)("div",{style:{padding:"0rem 1rem"},children:[(0,g.jsx)("p",{children:"Select the sources you would like to add for reference"}),(0,g.jsx)(k,{pdfFileColors:i,imageData:r,selectedFile:x,setSelectedFile:v,selectedFileCount:j,setSelectedFileCount:_})]}):2===m?(0,g.jsx)(M,{projectName:d,userFormData:F,setUserFormData:C,error:w,setError:S}):(0,g.jsxs)("div",{className:"no-projects-found",style:{gap:"0.5rem"},children:[(0,g.jsx)("p",{style:{fontSize:"18px",textAlign:"center",lineHeight:"1.2rem"},children:"Your RFI has been generated"}),(0,g.jsxs)("div",{className:"generate-left-container generate-left-container-hover-effect",style:{width:"150px"},onClick:()=>{window.open(null===b||void 0===b?void 0:b.pdf_url,"_blank")},children:[(0,g.jsx)("img",{src:V.A,alt:"no"}),(0,g.jsx)("p",{children:"Download as PDF"})]}),(0,g.jsxs)("div",{className:"generate-left-container generate-left-container-hover-effect",style:{width:"150px"},onClick:()=>{window.open(null===b||void 0===b?void 0:b.docx_url,"_blank")},children:[(0,g.jsx)("img",{src:H.A,alt:"no"}),(0,g.jsx)("p",{children:"Download as docx"})]})]})})}),m<=2&&(0,g.jsxs)("div",{className:"rfi-footer-section",children:[m>1&&!p?(0,g.jsxs)("div",{className:"generate-left-container",style:{gap:"0.5rem",cursor:"pointer"},onClick:()=>{h((e=>e-1))},children:[(0,g.jsx)("img",{src:W.A,alt:"no",style:{transform:"rotate(180deg)"}}),(0,g.jsx)("p",{style:{color:"black",fontSize:"14px",margin:"0"},children:"Back"})]}):(0,g.jsx)("div",{}),(0,g.jsx)(P.A,{size:"small",sx:(0,a.A)((0,a.A)({},B.sO),{},{width:"120px",height:"40px"}),onClick:()=>{2===m?E():h((e=>e+1))},disabled:x.length<2||p,children:1===m?"Proceed":"Generate"})]})]})})})},G=["RFI"];const Y=function(e){let{pdfFileColors:s=[],imageData:t=[],projectName:a="",questionIndex:i,projectId:n}=e;const[r,d]=(0,l.useState)(""),[o,c]=(0,l.useState)(!1);return(0,g.jsxs)("div",{className:"rfi-main-container",style:{width:"fit-content",gap:"2rem",marginLeft:"-12px",marginTop:"1rem",marginBottom:"1.2rem"},children:[(0,g.jsx)(U,{setIsModalOpen:d,isModalOpen:Boolean(r),pdfFileColors:[s[i]]||0,imageData:[t[i]]||0,projectName:a||" ",projectId:n}),(0,g.jsxs)("div",{className:"generate-left-container generate-left-container-hover-effect",onClick:()=>c((e=>!e)),children:[(0,g.jsx)("img",{src:N,alt:"no"}),(0,g.jsxs)("p",{children:["Generate",(0,g.jsx)("span",{style:{fontSize:"10px",marginLeft:"0.3rem"},children:"(beta)"})," "]})]}),o&&(0,g.jsx)("div",{className:"generate-right-container",children:G.map(((e,s)=>(0,g.jsx)("p",{onClick:()=>d(e),className:"right-container-option right-container-option-hover-effect",children:e})))})]})};var J=t(5332),K=t(925),Q=t(274);
1const Z={0:"#ABF5D1",1:"#A0E9FF",2:"#DFCCFB",3:"#F9A03F",4:"#FFC400",5:"#FFBDAD",6:"#DE350B",7:"#006D6B",8:"#FFB4B4"};const $=function(e){let{setIsPdfViewOpen:s,setSelectedFile:t,multiSearchValue:N,setMultiSearchValue:A,selectedFile:w,projectName:S,setHighlightedPdf:F,setIsFetchTriggered:k,documentType:C,isFocusModeOn:E,setIsFocusModeOn:D,actAnimation:O,setActAnimation:R}=e;const M=(0,_.Zp)(),[T,z]=(0,l.useState)(null),L=I.s.getUserData(),{sendMessage:W,lastMessage:P,readyState:B,getWebSocket:q}=(0,J.Ay)("wss://us-api.sonarlabs.ai/api/multi-search/ws",{shouldReconnect:()=>!0,onOpen:()=>console.log("WebSocket connected"),onClose:()=>console.log("WebSocket closed"),onError:e=>console.error("WebSocket error:",e)}),V=(0,l.useCallback)((async e=>{z({}),B!==J.vj.OPEN&&B!==J.vj.OPEN&&await new Promise((e=>setTimeout(e,500))),W(JSON.stringify((0,a.A)((0,a.A)({},e),{},{access_token:L.access_token})))}),[B]);(0,l.useEffect)((()=>{const e=q();if(null!==P&&P.data)try{const s=P.data,t=JSON.parse(s);"stop"===(null===t||void 0===t?void 0:t.reason)&&z((e=>(0,a.A)((0,a.A)({},e),{},{isDone:!0}))),t.text?z((e=>(0,a.A)((0,a.A)({},e),{},{text:e.text?(null===e||void 0===e?void 0:e.text)+(null===t||void 0===t?void 0:t.text):t.text}))):t.result_data&&(we(t),z((e=>null)),e&&e.close()),4003===t.status&&(I.s.removeUserData(),(0,Q.Yj)(Q.vA),M("/"),window.location.replace("".concat("https://www.nps.sonarlabs.ai","?type=logout")))}catch(s){console.log(s)}B!==J.vj.CLOSING&&B!==J.vj.CLOSED||e.close()}),[P]);const[H,U]=(0,b.ok)();let G=H.get("threadId");const $=(0,_.g)(),{projectId:X}=$;let ee=(0,l.useRef)(null);const[se,te]=(0,l.useState)(!1),[ae,le]=(0,l.useState)([]),[ie,ne]=(0,l.useState)([]),[re,de]=(0,l.useState)(""),[oe,ce]=(0,l.useState)(""),[me,ue]=(0,l.useState)([]),[he,pe]=(0,l.useState)({}),[fe,ge]=(0,l.useState)(!1),[xe,ve]=(0,l.useState)([]),[je,_e]=(0,l.useState)(!1),[be,ye]=(0,l.useState)(!1),[Ne,Ae]=(0,l.useState)([]),we=e=>{if(e){var s;let n={response:"",answer:{result_data:[]},highlight_data:"",thread_data:{},related_doc_ids:"",searchValue:oe,focus_type:[]};const r=e;if(n.focus_type=r.focus_type||[],r.highlight_data){let e=[];Ne.length>0&&Ne.forEach((s=>{e.push(s)})),e.push(r.highlight_data),Ae(e)}if(r&&null!==r&&void 0!==r&&r.result_data){var t,l;if(n.response=r.response,n.highlight_data=r.highlight_data?r.highlight_data:[],n.answer.result_data=null!==r&&void 0!==r&&r.result_data?null===r||void 0===r?void 0:r.result_data:[],n.related_doc_ids=r.related_doc_ids?r.related_doc_ids:null,n.thread_data=r.thread_data?r.thread_data:{},null!==n&&void 0!==n&&null!==(t=n.answer)&&void 0!==t&&t.result_data&&(null===n||void 0===n||null===(l=n.answer)||void 0===l?void 0:l.result_data.length)>0){var i;let e={};null===n||void 0===n||null===(i=n.answer)||void 0===i||i.result_data.forEach((s=>{var t,a,l,i,n;e[(null===(t=s.file_details)||void 0===t?void 0:t.file_id)+(null===r||void 0===r||null===(a=r.thread_data)||void 0===a?void 0:a.answer_id)]||(e[(null===(l=s.file_details)||void 0===l?void 0:l.file_id)+(null===r||void 0===r||null===(i=r.thread_data)||void 0===i?void 0:i.answer_id)]=null===(n=s.file_details)||void 0===n?void 0:n.file_url)})),pe((s=>(0,a.A)((0,a.A)({},s),e)))}n.related_doc_ids}else null!==e&&void 0!==e&&e.response&&(n.response=null===e||void 0===e?void 0:e.response);let d={filesLength:0};null===n||void 0===n||null===(s=n.answer)||void 0===s||s.result_data.forEach((e=>{d[e.file_name]||(d[e.file_name]=Z[d.filesLength],d.filesLength+=1)})),ve((e=>[...e,d])),le((e=>[...e,n])),Se(),A((e=>"")),k(Math.floor(100*Math.random()))}};(0,l.useEffect)((()=>{N&&(Ae((()=>[])),pe((()=>({}))),z((()=>null)),le((()=>[])),ve((()=>[])),ue((()=>[])),Fe(N,!0),ce(N)),s(!1)}),[N]),(0,l.useEffect)((()=>{G&&(_e(!0),(e=>{te(!0),ue((()=>[])),(0,m.VZ)(e).then((s=>{if(s){te(!1);const t=(0,u.$B)(s),l=JSON.parse(t);let i={};if(l){let s=[];const t=l.map(((t,a)=>{var l,n,r,d,o;return s.push(null===t||void 0===t||null===(l=t.answer)||void 0===l?void 0:l.highlight_data),t.thread_data={thread_id:e,answer_id:null===t||void 0===t||null===(n=t.answer)||void 0===n?void 0:n.answer_id},t.response=null===t||void 0===t||null===(r=t.answer)||void 0===r?void 0:r.answer_given,t.searchValue=null===(d=t.question)||void 0===d?void 0:d.question_asked,null===t||void 0===t||null===(o=t.answer)||void 0===o||o.result_data.forEach((e=>{var s,a,l,n,r;e.file_details&&(i[(null===(s=e.file_details)||void 0===s?void 0:s.file_id)+(null===(a=t.answer)||void 0===a?void 0:a.answer_id)]||(i[(null===(l=e.file_details)||void 0===l?void 0:l.file_id)+(null===(n=t.answer)||void 0===n?void 0:n.answer_id)]=null===(r=e.file_details)||void 0===r?void 0:r.file_url))})),t}));if(Ae(s),t.sort(((e,s)=>e.id-s.id)),t.length>0){let e=[];t.forEach((s=>{let t={filesLength:0};s.answer.result_data.forEach((e=>{t[e.file_name]||(t[e.file_name]=Z[t.filesLength],t.filesLength+=1)})),e.push(t)})),ve(e)}le(t)}pe((e=>(0,a.A)((0,a.A)({},e),i))),_e(!1),Se()}}))})(G))}),[G]);const Se=()=>{ee.current&&ee.current.scrollIntoView({behavior:"smooth",block:"end"})},Fe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Se();const t={project_id:X,user_question:e||re,document_type:C,recent_file:!0};s||(t.thread_id=G||ae.length>0&&ae[0].thread_data.thread_id),V(t)};return(0,l.useEffect)((()=>{document.getElementById("search-input-inside").focus()}),[]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",width:"100%",gap:"0.5rem",padding:"1rem 0rem 0.5rem 0rem"},children:[(0,g.jsx)("img",{src:y.A,alt:"not-found",width:"20px",style:{cursor:"pointer"},onClick:()=>{H.set("activeTab",c.Ay.FILES_AND_FOLDERS),H.delete("threadId"),U(H)}}),(0,g.jsx)("span",{children:S})]}),(0,g.jsxs)("div",{className:"project-file-result",style:{minHeight:"calc(100vh - 5rem)"},children:[(0,g.jsxs)("div",{className:"result-after-fetch-data",children:[!je&&ae.length>0&&ae.map(((e,a)=>{var i,d;return(0,g.jsxs)(l.Fragment,{children:[(0,g.jsxs)("p",{className:"result-question",style:{marginTop:0!==a&&"1rem"},children:[e.searchValue,e.focus_type&&e.focus_type.length>1&&(0,g.jsxs)("div",{className:"focus-mode-status",children:[(0,g.jsx)(p.h,{style:{padding:"0px",height:"0.7rem"},className:"select-search-type-img"}),"Focus"]})]}),(0,g.jsx)("div",{className:"result-vertical-wrap",children:0===(null===e||void 0===e||null===(i=e.answer)||void 0===i||null===(d=i.result_data)||void 0===d?void 0:d.length)&&(0,g.jsx)("p",{style:{fontSize:"14px",whiteSpace:"wrap",margin:"0",lineHeight:"22px",color:"#6D6D6D",fontWeight:500},children:"No source found"})}),(0,g.jsxs)("div",{className:"after-file-search-matches",children:[(0,g.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",marginTop:"1rem"},children:[(0,g.jsx)("img",{src:r.A,alt:"not-found",width:"22px"}),(0,g.jsx)("p",{className:"result-title",children:c.Ay.ANSWER})]}),(0,g.jsx)(v.o,{remarkPlugins:[[j.A]],className:"mark-up",children:e.response})]}),(0,g.jsxs)("div",{className:"after-file-search-matches",style:{borderBottom:ae.length-1!==a&&"2px solid #ECF0F3"},children:[(0,g.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,g.jsx)("img",{src:n.A,alt:"not-found"}),(0,g.jsx)("p",{className:"result-title",children:c.Ay.SOURCES})]}),xe.length>0&&xe.map(((l,i)=>{let n={};if(i===a){const i=[];return Object.keys(l).forEach((e=>{let s={};s.pdfName=e,s.pdfColor=l[e],"filesLength"!==e&&i.push(s)})),null!==e&&void 0!==e&&e.answer&&(null===e||void 0===e?void 0:e.answer.result_data.length)>0&&(null===e||void 0===e||e.answer.result_data.forEach(((e,s)=>{n[e.file_name]||(n[e.file_name]=[]),n[e.file_name].push(e)}))),(0,g.jsx)(g.Fragment,{children:i.map(((i,r)=>{var d;return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)("div",{className:"indexing-status collapsable-div",style:{margin:"0.5rem 0px",padding:"0.3rem 0px",paddingRight:"1rem",paddingLeft:"0.5rem",marginTop:0!==r&&"1.3rem"},onClick:()=>{((e,s)=>{let t=JSON.parse(JSON.stringify(me));t[e]&&t[e][s]?t[e][s]=!1:t[e]={[s]:!0},ue((e=>t))})(a,i.pdfName)},children:[(0,g.jsx)("div",{className:"ready-to-search",style:{backgroundColor:i.pdfColor,width:"0.5rem",height:"0.5rem"}}),i.pdfName,(0,g.jsx)("img",{src:o.A,alt:"noImageFound",style:{transform:me[a]&&me[a][i.pdfName]?"rotate(270deg)":"rotate(180deg)",marginLeft:"2rem",width:"6.3px",transition:"0.2s ease-in-out"}})]}),(0,g.jsxs)("div",{className:"result-vertical-wrap",style:{display:me[a]&&me[a][i.pdfName]?"flex":"none"},children:[n[i.pdfName]&&n[i.pdfName].length>0&&n[i.pdfName].slice(0,be?null===(d=n[i.pdfName])||void 0===d?void 0:d.length:3).map(((l,n)=>{let r=xe[a];var d;if(i.pdfName===l.file_name)return(0,g.jsxs)("div",{className:"single-record-card animate-answer-in ".concat((null===w||void 0===w?void 0:w.index)===(null===(d=l.file_details)||void 0===d?void 0:d.file_id)+(null===e||void 0===e?void 0:e.thread_data.answer_id)+n&&"active-single-record-card"),style:{minWidth:"45%"},onClick:()=>{var i,r;const d=(null===(i=l.file_details)||void 0===i?void 0:i.file_id)+(null===(r=e.thread_data)||void 0===r?void 0:r.answer_id);if(he[d]){var o;let e={};
1Ne[a].forEach((s=>{s.serial_number===l.serial_number&&(e=s)})),F(null===(o=e)||void 0===o?void 0:o.highlight_url),t({file_name:l.file_name,s3_url:he[d],bypassPageNumber:!0,page_no:parseInt(l.page_num),index:d+n}),s(!0)}},children:[(0,g.jsxs)("div",{className:"single-record-card-header",children:[(0,g.jsxs)("div",{className:"card-match-percentage",style:{backgroundColor:r[l.file_name]},children:["PAGE - ",null===l||void 0===l?void 0:l.page_num]}),(0,g.jsx)("div",{className:"card-match-page"})]}),(0,g.jsxs)("span",{style:{fontSize:"11px",fontWeight:"300",color:"black"},children:[" ",x(null===l||void 0===l?void 0:l.text_to_highlight)," "]})]},l.page_num+n)})),n[i.pdfName]&&n[i.pdfName].length>3&&(0,g.jsxs)("div",{className:"single-record-card animate-answer-in",onClick:()=>ye((e=>!e)),children:[(0,g.jsx)("div",{className:"single-record-card-header",style:{justifyContent:"flex-start",gap:"0.4rem"},children:!be&&(0,g.jsxs)("div",{className:"card-match-percentage",style:{backgroundColor:l[i.pdfName]},children:["+ ",n[i.pdfName].length-3]})}),(0,g.jsxs)("div",{className:"view-more-result-text",children:[be&&(0,g.jsx)("img",{src:o.A,alt:"noImageFound"}),(0,g.jsx)("span",{children:be?c.Ay.SHOW_LESS_MATCHES:c.Ay.VIEW_ALL_MATCHES}),!be&&(0,g.jsx)("img",{src:o.A,alt:"noImageFound",style:{transform:"rotate(180deg)"}})]})]})]})]})}))})}})),(0,g.jsx)(Y,{projectId:X,questionIndex:a,projectName:S,pdfFileColors:xe,imageData:ae})]})]},a+"answer")})),!fe&&!se&&ie.length>0&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:"after-file-search-matches",children:(0,g.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[(0,g.jsx)("img",{src:d.A,alt:"not-found",width:"22px"}),(0,g.jsx)("p",{className:"result-title",children:"Related questions"})]})}),ie.map((e=>(0,g.jsxs)("div",{className:"related-question-as-suggestion",onClick:()=>{Fe(e),ce(e)},children:[(0,g.jsx)("p",{style:{fontSize:"14px",whiteSpace:"wrap",margin:"0",lineHeight:"22px",color:"#6D6D6D",fontWeight:500},children:e}),(0,g.jsx)("img",{src:h.A,alt:"not-found"})]})))]}),(se||T)&&(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)("p",{className:"result-question",style:{marginTop:"1.5rem"},children:oe}),(0,g.jsxs)("div",{className:"after-file-search-matches",children:[(0,g.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",marginTop:"1rem"},children:[(0,g.jsx)("img",{src:r.A,alt:"not-found",width:"22px",className:"rotate-animation-around-class"}),(0,g.jsx)("p",{className:"result-title",children:c.Ay.ANSWER})]}),null!==T&&void 0!==T&&T.text?(0,g.jsx)(v.o,{remarkPlugins:[[j.A]],className:"mark-up",children:null===T||void 0===T?void 0:T.text}):(0,g.jsxs)("div",{className:"answer-skelton-loader color-effect-animation",children:[(0,g.jsx)("div",{className:"skelton-line-1"},"skelton-line-1"),(0,g.jsx)("div",{className:"skelton-line-2"},"skelton-line-2"),(0,g.jsx)("div",{className:"skelton-line-3"},"skelton-line-3"),(0,g.jsx)("div",{className:"skelton-line-4"},"skelton-line-4")]})]}),T?(0,g.jsx)(g.Fragment,{children:(null===T||void 0===T?void 0:T.isDone)&&(0,g.jsx)(K.A,{})}):(0,g.jsx)(K.A,{})]},"loading-answer"),(0,g.jsx)("div",{ref:ee})]}),(0,g.jsxs)("div",{className:"search-box-input-inside",children:[(0,g.jsx)(f.A,{position:"top",setIsFocusModeOn:D,setActAnimation:R,isFocusModeOn:E,actAnimation:O}),(0,g.jsx)("input",{id:"search-input-inside",type:"text",placeholder:"Search",onChange:e=>de(e.target.value),onKeyDown:e=>{re.trim()&&!se&&(e=>{"Enter"===e.key&&(ce(re),Fe(),de(""))})(e)},value:re,autocomplete:"off"}),(0,g.jsx)(i.h,{className:"".concat(!re.trim()&&"image"),style:{cursor:re&&"pointer"},onClick:()=>{re.trim()&&!se&&(ce(re),Fe(),de(""))}})]})]})]})}},7718(e,s,t){t.d(s,{G:()=>r,f:()=>d});var a=t(4345),l=t(8395),i=t(6394),n=t(5416);const r=async e=>{const s=(0,n.yi)(e),t=(0,i.T9)("instance"),r=(0,a.V4)(t);return await l.nC.post(r.GENERATE_RFI,s).then((e=>e.data)).catch((e=>((0,l.yH)(e),e)))},d=async e=>{const s=(0,i.T9)("instance"),t=(0,a.V4)(s);return await l.nC.get(t.RFI_HISTORY+e).then((e=>e.data)).catch((e=>((0,l.yH)(e),e)))}}}]); 2//# sourceMappingURL=37.d7d20c3f.chunk.js.map
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.