1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7235],{6993:(e,l,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/inbox/[username]",function(){return n(89930)}])},20185:(e,l,n)=>{"use strict";n.d(l,{A:()=>a});var s=n(37876),t=n(83872),i=n(38243),o=n(89311),r=n(21639);let a=e=>{let{confirmNavigation:l,showWarningModal:n,setShowWarningModal:a}=e;return(0,s.jsxs)(i.Ay,{showModal:n,setShowModal:a,children:[(0,s.jsxs)(i.Ep.Body,{className:"flex flex-col gap-4 items-center text-center",children:[(0,s.jsx)(t.WarningTriangleIcon,{}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(o.default.SemiBoldText,{sm:!0,children:"Unsaved Changes"}),(0,s.jsxs)(o.default.MutedText,{children:["Your recent changes haven't been saved.",(0,s.jsx)("br",{})," Leaving this page will discard any unsaved changes."]})]})]}),(0,s.jsxs)(i.Ep.Footer,{className:"justify-between",children:[(0,s.jsx)(r.Ay.CarbonOutline,{onClick:()=>a(!1),className:"mr-8",small:!0,children:"Continue Editing"}),(0,s.jsx)(r.Ay.Carbon,{onClick:l,small:!0,children:"Discard Changes"})]})]})}},89930:(e,l,n)=>{"use strict";n.r(l),n.d(l,{default:()=>O});var s=n(37876);n(13588);var t=n(48230),i=n.n(t),o=n(89099),r=n(14232),a=n(2171),d=n(88798),u=n(67768),c=n(19596),v=n(77328),m=n.n(v),x=n(87399),h=n(31232),f=n(14360),g=n(34321),p=n(16495),j=n(20185),y=n(83872),N=n(21639),b=n(82669),w=n(38243),A=n(89311),S=n(55733),T=n(73279),M=n(27252),E=n(93988),C=n(63819);let I=r.forwardRef((e,l)=>(0,s.jsx)("div",{...e,ref:l,className:"flex flex-col gap-2.5"})),B=r.forwardRef((e,l)=>(0,s.jsx)("div",{...e,ref:l,className:(()=>{var l,n,s,t,i;let o=null==e||null==(n=e.context)||null==(l=n.selectedMedia)?void 0:l.type;return(null==e||null==(s=e.context)?void 0:s.isVideoAdded)?"pb-60":o?(null==e||null==(i=e.context)||null==(t=i.selectedMedia)?void 0:t.type)==="application/pdf"?"pb-46":"pb-60":"pb-38"})()})),k=()=>{var e,l,n,t,v,y,N,w,k,U,R,P;let D=(0,u.jE)(),O=(0,a.useDispatch)(),q=(0,o.useRouter)(),W=(0,h.A)(),F=(0,r.useRef)(),[H,L]=(0,r.useState)(!1),[V,X]=(0,r.useState)(1e5),[Y,K]=(0,r.useState)(null),[Q,z]=(0,r.useState)(!1),{nextCursor:J,globalCursor:G}=(0,a.useSelector)(e=>e.Inbox),{primaryUserData:Z,loading:$}=(0,a.useSelector)(e=>e.PrimaryUserData),[ee,el]=(0,r.useState)(!1),en=(0,r.useRef)(null),es=function(){var e,l;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"smooth";null==F||null==(l=F.current)||null==(e=l.scrollToIndex)||e.call(l,{index:"LAST",align:"end",behavior:n})},{currentConversation:et,handleMuteConversation:ei,canSendMsg:eo,handleSendingMessage:er,handleEditMessage:ea,handleMessageReaction:ed,setEditMsg:eu,editMsg:ec,replyToMsg:ev,setReplyToMsg:em,showWarningModal:ex,setShowWarningModal:eh,confirmNavigation:ef,error:eg,loading:ep}=(0,x.A)({profileHandle:null==q||null==(e=q.query)?void 0:e.username,onSend:()=>{setTimeout(()=>{es()},10)},setShowMsgLimitErrModal:L}),ej=(0,c.q)({queryKey:p.inboxQueryKeys.conversations(null==q||null==(l=q.query)?void 0:l.username),enabled:!!(null==q||null==(t=q.query)||null==(n=t.username)?void 0:n.length)&&!!(null==et||null==(v=et.id)?void 0:v.length),getNextPageParam:e=>null==e?void 0:e.timeSince,queryFn:async e=>{var l,n,s,t,i,o;let{pageParam:r}=e,a={timeSince:r||Date.now()};(null==et?void 0:et.id)&&(a.inboxId=null==et?void 0:et.id),(null==a?void 0:a.id)||(a.withUsername=null==q||null==(o=q.query)?void 0:o.username);let d=await g.vj.getConversations(a),u=(null==d||null==(n=d.data)||null==(l=n.data)?void 0:l.conversations)||[],c=null,v=u[0];(null==u?void 0:u.length)&&(null==v?void 0:v.timestamp)&&(c=new Date(null==v?void 0:v.timestamp).getTime()-1);let m={conversations:r?[...u,...(null==et?void 0:et.conversations)||[]]:u,totalCount:null==d||null==(t=d.data)||null==(s=t.data)?void 0:s.totalCount};return D.setQueryData(p.inboxQueryKeys.chat(null==q||null==(i=q.query)?void 0:i.username),e=>{if(e){var l,n,s;let t=null==(l=e.conversations)?void 0:l.some(e=>null==e?void 0:e.localMediaPath);return(null==e||null==(n=e.conversations)?void 0:n.length)===1&&(null==(s=m.conversations)?void 0:s.length)===1&&t?{...e,...m,conversations:null==e?void 0:e.conversations}:{...e,...m}}return e}),r&&X(e=>e-((null==u?void 0:u.length)||0)),{timeSince:c}}}),ey={id:null==Z?void 0:Z.id,name:"You",profileHandle:Z.profileHandle,profilePicture:null==Z?void 0:Z.profilePicture},eN=et?null==et?void 0:et.conversations:[];(0,r.useEffect)(()=>{var e;null!==et&&W&&null!==G&&J!==G&&et&&(null==et||null==(e=et.conversations)?void 0:e.length)>=p.CONVERSATIONS_SAVED_IN_INBOX&&O(f.W3.updateCursor(G))},[et,eo]),(0,r.useEffect)(()=>{var e;(null==et||null==(e=et.id)?void 0:e.length)&&setTimeout(()=>{es("auto")},10)},[null==et?void 0:et.id,q.query]),(0,r.useEffect)(()=>{var e;((null==Y||null==(e=Y.type)?void 0:e.length)||Q)&&setTimeout(()=>{es("auto")},50)},[Y,Q]),(0,r.useEffect)(()=>{en.current&&setTimeout(()=>{var e;null==F||null==(e=F.current)||e.getState(e=>{en.current.getBoundingClientRect().height-(e.scrollTop+window.innerHeight)<100&&es("smooth")})},500)},[null==et?void 0:et.conversations,en]);let eb=(null==et?void 0:et.conversations)?[...(et.conversations||[]).map((e,l)=>({...e,index:l}))]:[],ew=(null==eb?void 0:eb.length)<2||(null==eN?void 0:eN.length)===1&&(null==eb||null==(y=eb[0])?void 0:y.from)!==ey.id,eA=null==et||null==(N=et.conversations)?void 0:N.filter(e=>!(null==e?void 0:e.readAt)&&(null==e?void 0:e.from)!==(null==Z?void 0:Z.id)),eS=!!(null==eA?void 0:eA.length);if(!et)return(0,s.jsx)(S.A,{});let eT=()=>C.default.getDisplayName(null==et?void 0:et.withUser),eM="Inbox | Interact with professionals";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m(),{children:(0,s.jsx)("title",{children:eT()?"".concat(eT()," | ").concat(eM):eM})}),(0,s.jsxs)("div",{className:"w-full relative",children:[eg?(0,s.jsx)(A.default.ErrorText,{children:eg}):null,ep||!(null==Z?void 0:Z.id)&&$?(0,s.jsx)("div",{className:"flex items-center justify-center my-28",children:(0,s.jsx)(b.A,{})}):null,et?(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"fixed top-14 bg-gray-00 z-50 w-full lg:w-[640px] box-border border-r border-b border-primaryBorder",children:(0,s.jsx)(T.A.UserProfile,{user:et.withUser,className:"py-2 px-6 box-border",showFull:!0,as:i(),more:!0,inboxId:null==et?void 0:et.id,muteAction:ei,isMuted:null==et?void 0:et.isMuted,canUnblock:(null==et?void 0:et.isBlocked)===void 0?void 0:!!(null==et?void 0:et.canUnblock),isBlocked:null==et?void 0:et.isBlocked})}),(0,s.jsxs)("div",{ref:en,className:"lg:mt-14 mt-28 px-4 sm:px-6 flex flex-col gap-4",children:[(null==eb?void 0:eb.length)?(0,s.jsx)("ul",{className:"h-full",children:(0,s.jsx)(d.aY,{ref:F,data:eb,useWindowScroll:!0,startReached:()=>{ej.hasNextPage&&ej.fetchNextPage()},reversed:!0,itemContent:(e,l)=>{var n;let t=null==l?void 0:l.index;if(!(null==et?void 0:et.withUser))return null;let i=(null==eb?void 0:eb[t+1])||null,o=(null==eb?void 0:eb[t-1])||null,{day:r,prefix:a,showSeparator:d}=(0,M.W3)({currentTimetamp:null==l?void 0:l.timestamp,prevTimestamp:null==o?void 0:o.timestamp});return(0,s.jsx)("div",{className:"flex flex-col-reverse",children:(0,s.jsxs)("div",{children:[d?(0,s.jsxs)("div",{className:"bg-gray-00 w-full flex items-center justify-center py-4",children:[(0,s.jsx)("span",{className:"border-b border-primaryBorder flex-1"}),(0,s.jsxs)("span",{className:"text-xxs font-normal text-gray-500 flex-1 max-w-fit border border-primaryBorder rounded-xl px-2 py-0.5",children:[a?(0,s.jsxs)("span",{children:[a," - "]}):"",r]}),(0,s.jsx)("span",{className:"border-b border-primaryBorder flex-1"})]}):null,(0,s.jsx)(T.A.Message,{conversation:l,withUser:null==et?void 0:et.withUser,previous:o,next:i,shouldBeInFocus:((null==et||null==(n=et.conversations)?void 0:n.length)||0)-1===t,primaryUser:ey,onEdit:()=>{eu(l),em(null)},onReply:()=>{em(l),eu(null)},onReaction:e=>ed({reaction:e,message:l})})]})})}
1,firstItemIndex:V,initialTopMostItemIndex:((null==eb?void 0:eb.length)||0)-1,components:{List:I,Footer:B},context:{selectedMedia:Y,isVideoAdded:Q},isScrolling:e=>{if(!e){var l;null==F||null==(l=F.current)||l.getState(e=>{en.current.getBoundingClientRect().height-(e.scrollTop+window.innerHeight)>20?el(!0):el(!1)})}},overscan:{main:200,reverse:200}})}):null,(null==eb?void 0:eb.length)||ep?null:(0,s.jsx)("div",{className:"w-full h-[calc(100%-56px)] flex justify-center items-center sm:mt-[30%] lg:mt-[50%] mt-[50%]",children:(0,s.jsx)("div",{className:"h-full flex items-center",children:(0,s.jsxs)("div",{className:"md:px-28 mx-auto text-center flex flex-col gap-4 items-center justify-center",children:[(0,s.jsx)(E.A,{src:p.CDNImage.emptyChatImage,width:80,height:80}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-1k",children:"This is the beginning!"}),(0,s.jsx)(A.default.MutedText,{children:"Remember, the key is to build a connection by showing genuine interest and respect for the person you are contacting."})]})]})})})]})]}):null,(0,s.jsx)(T.A.BlockedUser,{conversation:et,isBlocked:null==et?void 0:et.isBlocked,canUnblock:null==et?void 0:et.canUnblock}),(null==Z||null==(w=Z.inboxPreferences)?void 0:w.allowMsgFrom)===p.INBOX_PREFERENCES.NOONE?(0,s.jsx)(T.A.DMSTurnedOff,{}):null,(null==et?void 0:et.isBlocked)||!1===eo?null:(0,s.jsx)(T.A.WriteMessage,{onSubmit:(null==ec?void 0:ec.id)?ea:er,conversationWithName:"".concat(null==et||null==(k=et.withUser)?void 0:k.firstName," ").concat(null==et||null==(U=et.withUser)?void 0:U.lastName),isDeleted:null==et||null==(R=et.withUser)?void 0:R.isDeleted,editMsg:ec,replyToMsg:ev,clearReply:()=>em(null),clearEdit:()=>eu(null),isFirstMessage:ew,selectedMedia:Y,setSelectedMedia:K,isVideoAdded:Q,setVideoAdded:z,activeInbox:et,showNewMessageButton:ee&&eS,scrollToBottom:es}),H?(0,s.jsx)(_,{showModal:H,setShowModal:L,name:null==Z?void 0:Z.firstName}):null,ex?(0,s.jsx)(j.A,{showWarningModal:ex,setShowWarningModal:eh,confirmNavigation:ef}):null]},null==q||null==(P=q.query)?void 0:P.username)]})},_=e=>{let{showModal:l,setShowModal:n,name:t="there"}=e;return(0,s.jsxs)(w.Ay,{showModal:l,setShowModal:n,showClose:!1,children:[(0,s.jsxs)(w.Ep.Body,{className:"text-center",children:[(0,s.jsx)("div",{className:"mx-auto max-w-fit mb-4",children:(0,s.jsx)(y.WarningTriangleIcon,{})}),(0,s.jsx)(A.default.SemiBoldText,{className:"mb-4",children:"You've hit your daily message limit."}),(0,s.jsxs)(A.default.NormalText,{sm:!0,children:["Hey ",t,"! Just a heads-up, Peerlist lets you start up to"," ",p.DAILY_NEW_INBOX_LIMIT," new conversations a day. This helps keep our community spam-free."]})]}),(0,s.jsx)(w.Ep.Footer,{children:(0,s.jsx)(N.Ay.Carbon,{className:"ml-auto",onClick:()=>n(!1),small:!0,children:"Okay"})})]})};var U=n(21926),R=n(63096),P=n(47553);function D(){return(0,s.jsx)(k,{})}D.getLayout=e=>(0,s.jsx)(R.A,{children:(0,s.jsx)(U.A,{children:e})});let O=(0,P.A)(D)}},e=>{e.O(0,[8798,5733,1926,636,6593,8792],()=>e(e.s=6993)),_N_E=e.O()}]);
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.