1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2705],{315:(e,l,t)=>{t.d(l,{A:()=>o});var s=t(37876),a=t(14232),n=t(32428);let o=e=>{let{images:l=[],postedBy:t,fromScroll:o=!1}=e;if(!(null==l?void 0:l.length))return null;let r=l[0],[i,d]=(0,a.useState)(null);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{role:"button",onClick:e=>{e.stopPropagation(),d(0)},onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),d(0))},tabIndex:0,className:"w-fit",children:(0,s.jsx)("img",{src:r,alt:"Scroll ".concat(null==t?void 0:t.firstName," ").concat(null==t?void 0:t.lastName),className:"".concat(o?"h-[120px] rounded-lg":"max-h-[400px] w-auto rounded-2xl"," mt-2 object-cover border border-primaryBorder hover:opacity-90 transition-all ease-in-out duration-200")})},r),Number.isInteger(i)&&(0,s.jsx)(n.A,{slides:l.map(e=>({img:e})),showOverlay:Number.isInteger(i),selectedSlide:i,setShowOverlay:d})]})}},5332:(e,l,t)=>{t.d(l,{A:()=>D});var s=t(37876),a=t(48230),n=t.n(a),o=t(14232),r=t(2171),i=t(5078),d=t(95993),u=t(56542),c=t(16495),m=t(63819),p=t(4755),x=t(28857),h=t(89311),v=t(43271),f=t(78063),g=t(445),y=t(71297),j=t(34321),N=t(68827),C=t(16592),w=t(46667),A=t(315),b=t(49202),T=t(83872),P=t(5357);let S=(0,o.forwardRef)((e,l)=>{var t,a,S,D,E,O,k,I,B,L,H,_,M,R,F,Q,U;let{postComment:z,post:V,commentType:q=null,isForScrollFeed:K=!1,onCommentUpdate:W=()=>{},onCommentDelete:Y=()=>{},onCommentInputChange:G=()=>{},isOwner:X=!1,isPinComment:J=!1,handlePinComment:$=()=>{},isOwnerOfEntity:Z=!1}=e,{handlePublishTrigger:ee}=(0,i.A)(),el=(0,r.useSelector)(d.oz),[et,es]=(0,o.useState)(),[ea,en]=(0,o.useState)(!1),[eo,er]=(0,o.useState)(!1),[ei,ed]=(0,o.useState)(!1),eu=(null==z?void 0:z.replyTo)!==null,ec=(0,u.K)({comment:z}),em=async e=>{if(await ee()){if(eo){er(!1),G(!0);return}G(!1),er(!0),es({name:"".concat(e.firstName," ").concat(e.lastName),username:e.profileHandle,pid:e.id})}},ep=async e=>{if(await ee()&&e){var l,t,s,a,n;let o=e.isLiked,r=e.id,i=o?c.COMMENT_OPERATIONS.UNLIKE:c.COMMENT_OPERATIONS.LIKE;try{let s=e.likeCount||0,a={...e,isLiked:!e.isLiked,likeCount:Math.max(0,o?s-1:s+1)};W(a,!0);let n=await j.Fm.likeUnlikeComment(r,i),d=null==n||null==(t=n.data)||null==(l=t.data)?void 0:l.comment;d&&(d.isLiked!==a.isLiked||d.likeCount!==a.likeCount)&&W(d,!0)}catch(l){K&&W(e),y.A.ErrorToast((null==l||null==(n=l.response)||null==(a=n.data)||null==(s=a.error)?void 0:s.message)||N.A.GLOBAL.wrong)}}},ex=async e=>{let l=e.id;try{await j.Fm.deleteComment(l),Y(l)}catch(e){var t,s,a;y.A.ErrorToast((null==e||null==(a=e.response)||null==(s=a.data)||null==(t=s.error)?void 0:t.message)||N.A.GLOBAL.wrong)}},eh=async()=>{ed(!0)};if(null==z?void 0:z.isDeleted)return(0,s.jsx)("div",{className:K?"":"pb-4 px-4 lg:px-6",children:(0,s.jsx)(w.A,{})});if(ei)return(0,s.jsx)("div",{className:"".concat(eu?"pl-12":"pl-0"," pb-4 px-4 lg:px-6"),children:(0,s.jsx)(C.A,{postId:V.id,selectedMention:et,setShowReplyCommentBox:ed,autofocusArea:!1,commentType:q,smallerSize:!0,autoHideCommentBox:!0,editableValue:z,onCommentUpdate:W,isHQ:(null==V?void 0:V.hq)||!1})});let ev=K?m.default.getCroppedRichText({htmlString:m.default.removeEmptySpaceFromRichText(null==z?void 0:z.comment),addReadMoreText:!0,maxSliceEnd:180,customReadMoreAttr:'data-comment="comment"'}).htmlString:z.comment,ef=K?p.Ay.Smaller:p.Ay.Small;return(null==z||null==(t=z.owner)?void 0:t.firstName)?(0,s.jsxs)("div",{className:K?"":"pb-4 px-4 lg:px-6",ref:l,children:[J?(0,s.jsx)(b.A,{}):null,(0,s.jsx)("div",{className:"flex items-start justify-between ".concat(eu?"pl-12":"pl-0"),children:(0,s.jsxs)("div",{className:"flex w-full",children:[(0,s.jsx)(x.A,{profileHandle:(null==z||null==(a=z.owner)?void 0:a.profileHandle)||(null==z||null==(S=z.owner)?void 0:S.username),children:(0,s.jsx)(n(),{href:c.APP_PATHS.userProfile({profileHandle:(null==z||null==(D=z.owner)?void 0:D.profileHandle)||(null==z||null==(E=z.owner)?void 0:E.username)}),children:(0,s.jsx)(ef,{image:(null==z||null==(O=z.owner)?void 0:O.profilePicture)||c.CDNImage.emptyUserDP,alt:"".concat(z.owner.firstName," ").concat(null==z||null==(k=z.owner)?void 0:k.lastName),verified:null==z||null==(I=z.owner)?void 0:I.verified,idVerified:null==z||null==(B=z.owner)?void 0:B.idVerifiedAt,className:"hover:opacity-80 curs
1or-pointer"})})}),(0,s.jsxs)("div",{className:"ml-2 w-full",children:[(0,s.jsxs)("div",{className:"flex items-baseline",children:[(0,s.jsx)(x.A,{profileHandle:(null==z||null==(L=z.owner)?void 0:L.profileHandle)||(null==z||null==(H=z.owner)?void 0:H.username),children:(0,s.jsx)(n(),{href:c.APP_PATHS.userProfile({profileHandle:(null==z||null==(_=z.owner)?void 0:_.profileHandle)||(null==z||null==(M=z.owner)?void 0:M.username)}),children:(0,s.jsxs)(h.default.SemiBoldText,{sm:!0,className:"hover:underline",children:[z.owner.firstName," ",z.owner.lastName]})})}),(0,s.jsxs)("div",{className:"flex items-center ml-2",children:[(0,s.jsx)(h.default.MutedText,{xxs:!0,className:"leading-140",children:(0,m.timeSince)(null==z?void 0:z.createdAt)}),(null==z||null==(R=z.owner)?void 0:R.id)===(null==V||null==(F=V.postedBy)?void 0:F.id)||Z?(0,s.jsx)(P.A.AuthorTag,{}):null,(null==z?void 0:z.editedAt)?(0,s.jsxs)(h.default.MutedText,{xxs:!0,className:"leading-140",children:[(0,s.jsx)(h.default.Dot,{}),"(edited)"]}):null,(0,s.jsx)(v.A.PostedFromApp,{post:z,xxs:!0})]})]}),(null==z?void 0:z.isProbableSpam)&&!ea?(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsxs)(h.default.MutedText,{xs:!0,className:"flex items-center gap-1 cursor-pointer hover:underline ease-in-out duration-200",onClick:()=>en(e=>!e),children:[(0,s.jsx)(T.ClosedEyeIcon,{size:16}),"Probable spam"]})}):(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{children:(0,s.jsx)(x.f,{wrapperId:null==z?void 0:z.id,children:(0,s.jsx)(f.default,{html:ev,id:"comment-body",className:"text-gray-1k text-sm rich-text-paragraph-regular link-break"})})}),(null==z||null==(Q=z.images)?void 0:Q.length)>0&&(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)(A.A,{images:z.images,postedBy:null==z?void 0:z.owner,fromScroll:K})})]}),(0,s.jsxs)("div",{className:"flex -ml-2 items-center gap-2 mt-1",children:[(0,s.jsx)(g.B9.CommentLike,{isActive:z.isLiked,reactionCount:null==z?void 0:z.likeCount,onClick:()=>ep(z)}),(0,s.jsx)(g.B9.CommentReply,{onClick:()=>em(null==z?void 0:z.owner),reactionCount:null==z?void 0:z.childCount}),(0,s.jsx)(g.B9.CommentControls,{showEdit:ec,isOwner:(null==el?void 0:el.id)===(null==z||null==(U=z.owner)?void 0:U.id),onDelete:()=>ex(z),canPinComment:!(null==z?void 0:z.replyTo)&&X,onPinComment:()=>$(z),postComment:z,onEdit:()=>{et&&es(null),eh(z)},onCopyLink:async()=>{let e=(()=>{var e,l,t;switch(q){case c.COMMENT_TYPES.PROJECTS:return c.APP_PATHS.projectComment({projectUrl:m.default.getProjectURL({username:null==V||null==(e=V.createdBy)?void 0:e.profileHandle,slug:null==V?void 0:V.slug}),commentId:null==z?void 0:z.id,absolute:!0});case c.COMMENT_TYPES.BLOG:return c.APP_PATHS.blogComment({blogURL:c.APP_PATHS.userBlogPage({profileHandle:null==V||null==(l=V.creator)?void 0:l.profileHandle,slug:null==V?void 0:V.slug}),commentId:null==z?void 0:z.id,absolute:!0});default:return c.APP_PATHS.postComment({postId:null==V?void 0:V.id,commentId:null==z?void 0:z.id,absolute:!0,profileHandle:null==V||null==(t=V.postedBy)?void 0:t.profileHandle})}})();await navigator.clipboard.writeText(e),y.A.SuccessToast("Comment link copied")}})]}),eo?(0,s.jsx)("div",{className:"mt-2 w-full",children:(0,s.jsx)(C.A,{postId:V.id,commentId:(null==z?void 0:z.replyTo)||(null==z?void 0:z.id)||null,selectedMention:et,setShowReplyCommentBox:er,autofocusArea:!1,commentType:q,smallerSize:!0,autoHideCommentBox:!0,onCommentUpdate:W,isHQ:(null==V?void 0:V.hq)||!1})}):null]})]})})]}):null}),D=(0,o.memo)(S)},16592:(e,l,t)=>{t.d(l,{A:()=>h});var s=t(37876),a=t(14232),n=t(34321),o=t(68827),r=t(63819),i=t(65777),d=t(70657),u=t(94296),c=t(16495),m=t(78063),p=t(5078),x=t(71297);let h=(0,a.memo)(function(e){let{postId:l,commentId:t,selectedMention:h,setShowReplyCommentBox:v=()=>{},autofocusArea:f,commentType:g,smallerSize:y=!1,autoHideCommentBox:j=!1,editableValue:N,onCommentUpdate:C=()=>{},isHQ:w=!1}=e,A=(0,a.useRef)(),[b,T]=(0,a.useState)(!1),{handlePublishTrigger:P}=(0,p.A)(),S=async(e,s)=>{var a,i,p,h,f,y;if(await P()&&((0,r.validateRichText)({htmlText:e||""})||s))try{let o,r;T(!0);let x={activityId:l,comment:e?(0,m.sanitizeRichText)(e):null,replyTo:t,type:g};s&&(x.images=[s]);let h=(null==(o=(null==N?void 0:N.id)?await n.Fm.editComment({activityId:l,comment:e?(0,m.sanitizeRichText)(e):null,id:N.id,type:g}):await n.Fm.addComment(x))||null==(i=o.data)||null==(a=i.data)?void 0:a.comment)||void 0;h&&C(h,!!(null==N?void 0:N.id)),null==A||null==(p=A.current)||p.clearContent(),j&&v(!1),g===c.COMMENT_TYPES.PROJECTS&&(r=u.Ay.COMMENTED_PROJECT),g===c.COMMENT_TYPES.SCROLL&&(r=u.Ay.COMMENTED_POST),g===c.COMMENT_TYPES.BLOG&&(r=u.Ay.COMMENTED_ON_ARTICLE),r&&d.A.capture(r,{from:c.SCROLL_CONSTANTS.POSTED_FROM.WEB,source:g===c.COMMENT_TYPES.SCROLL&&w?c.SCROLL_CONSTANTS.HQ:null})}catch(e){x.A.ErrorToast((null==e||null==(y=e.response)||null==(f=y.data)||null==(h=f.error)?void 0:h.message)||o.A.GLOBAL.wrong)}finally{T(!1)}};return(0,s.jsx)("div",{className:y?"":"bg-gray-00 box-border px-4 py-4 sm:px-6",children:(0,s.jsx)(i.A,{id:t?"reply-comment-box":"create-comment-box",uniqueId:(null==N?void 0:N.id)||t||l,ref:A,smallerSize:y,autofocusArea:f,selectedMention:h,postComment:S,loading:b,editableValue:N,showImageUploader:!0,placeholder:g===c.COMMENT_TYPES.SCROLL?"Post your comment":"Share your feedback!"})})})},42705:(e,l,t)=>{t.d(l,{A:()=>x});var s=t(37876),a=t(67768),n=t(74359),o=t(19635),r=t.n(o),i=t(14232),d=t(89099),u=t(16495),c=t(10986),m=t(17175),p=t(93257);let x=e=>{var l,t,o;let{postId:x,postData:h=null,isFromPostDetailsPage:v=!1,showFullPost:f=!1,feedType:g,followedPostId:y=null,setFollowedPostId:j=()=>{},followerIds:N=[],setFollowerIds:C=()=>{},storeScrollState:w=()=>{},isReadOnly:A=!1,removeBottomBorder:b=!1,analyticsEventSource:T,teamA
1ccessFeature:P,expandComments:S}=e;if(!x||"TBH_BANNER"===x||"PROJECT_RECOMMENDATIONS"===x)return null;let D=(0,d.useRouter)(),E=(0,a.jE)(),[O,k]=(0,i.useState)(!1),[I,B]=(0,i.useState)(()=>f||v),{data:L}=(0,n.I)({queryKey:m.l.post(x),enabled:!h,initialData:()=>E.getQueryData(m.l.post(x)),staleTime:1/0}),H=h||L;if(!H||!H.id)return null;let _=(null==H?void 0:H.ogPost)||H;if(!_||!_.id||!_.postedBy||!_.postedBy.profileHandle)return null;let M=null==H||!H.ogPost||(null==H||null==(l=H.ogPost)?void 0:l.deleted)?null:r()(H,["postedBy","id","createdAt","reshared","resharedByList"]),R=e=>{var l,t,s,a,n,o,r,i;let d=(null==e||null==(t=e.target)||null==(l=t.dataset)?void 0:l.read)&&(null==e||null==(a=e.target)||null==(s=a.dataset)?void 0:s.comment);if(v)return;if(e.target.closest("a")||e.target.closest("#context-tag")||e.target.closest("#create-comment-box")||e.target.closest("#reaction-box")&&!d)return void e.stopPropagation();if((null==e||null==(o=e.target)||null==(n=o.dataset)?void 0:n.read)&&!(null==e||null==(i=e.target)||null==(r=i.dataset)?void 0:r.comment)){B(!0),e.stopPropagation();return}w();let c=u.APP_PATHS.postDetails(_.id,A);return A?void window.open(c,"_blank"):e.target.closest('[data-section="upvoters-info"]')?void D.push("".concat(c,"?showUpvote=1")):void D.push(c)},F=async()=>{if(A){let e=u.APP_PATHS.postDetails(_.id,A);window.open(e,"_blank");return}v||k(e=>!e)},Q=(0,c._c)({caption:null==_?void 0:_.caption,showFullCaption:I,charLimits:400}),U=y===(null==_?void 0:_.id)||(null==_||null==(t=_.postedBy)?void 0:t.follower)===!1&&!(null==N?void 0:N.includes(null==_||null==(o=_.postedBy)?void 0:o.id));return g===c.ji.TRENDING?(0,s.jsx)(p.rq,{showFullCaption:I,isFromPostDetailsPage:v,navigateToPostDetails:R,feedType:g,postCaption:Q,postData:H,showCommentsSection:O,handleCommentClick:F,resharedBy:M,showFollowBtn:U,setFollowedPostId:j,setFollowerIds:C,isReadOnly:A,analyticsEventSource:T,expandComments:S}):(0,s.jsx)(p.Hs,{showFullCaption:I,isFromPostDetailsPage:v,navigateToPostDetails:R,feedType:g,postCaption:Q,postData:H,showCommentsSection:O,handleCommentClick:F,resharedBy:M,showFollowBtn:U,setFollowedPostId:j,setFollowerIds:C,isReadOnly:A,removeBottomBorder:b,analyticsEventSource:T,teamAccessFeature:P,expandComments:S})}},46667:(e,l,t)=>{t.d(l,{A:()=>a});var s=t(37876);let a=()=>(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-full bg-gray-200"}),(0,s.jsxs)("div",{className:"ml-2",children:[(0,s.jsx)("div",{className:"w-40 h-4 bg-gray-200 rounded"}),(0,s.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:"This comment has been deleted by the user."})]})]})})},49202:(e,l,t)=>{t.d(l,{A:()=>o});var s=t(37876),a=t(83872),n=t(89311);let o=()=>(0,s.jsxs)("div",{className:"pl-2.5 flex gap-1 items-start",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-gray-500",children:(0,s.jsx)(a.PinIcon,{size:16})}),(0,s.jsx)("div",{className:"h-3 w-0.5 bg-gradient-to-b from-gray-400 to-gray-400/5"})]}),(0,s.jsx)(n.default.NormalText,{xxs:!0,textColor:"text-gray-500",children:"Pinned"})]})},56542:(e,l,t)=>{t.d(l,{K:()=>n,a:()=>o});var s=t(38234),a=t(16495);let n=e=>{let{comment:l,hour:t=a.SCROLL_CONSTANTS.CAPTION_EDIT_HOUR}=e;return!!l&&!!(null==l?void 0:l.comment)&&!!s.A.lessThanHourAgo(l.createdAt,t)},o={NEWEST:"NEWEST",OLDEST:"OLDEST"}},68024:(e,l,t)=>{t.d(l,{A:()=>p});var s=t(37876),a=t(48230),n=t.n(a),o=t(89311),r=t(29133),i=t(16495),d=t(63819),u=t(83872),c=t(78004),m=t.n(c);let p=e=>{var l,t,a,c;let{postTitle:p,videos:x,resharedVideo:h,metaData:v,showOnlyThumbnail:f=!1}=e,g=h&&(null==v?void 0:v.videos)||[],y=(null==x?void 0:x.length)?x:g,j={...null==y||null==(l=y[0])?void 0:l.metaData,title:p},N=((null==j?void 0:j.width)||16)/((null==j?void 0:j.height)||9)<1?1:16/9;if(f&&(null==y?void 0:y.length)){let e=d.default.getThumbnailFromMUX(null==y||null==(c=y[0])?void 0:c.playbackId);return(0,s.jsxs)("div",{className:"relative bg-black rounded-2xl overflow-hidden flex items-center mb-2",style:{aspectRatio:N},children:[(0,s.jsx)("img",{alt:p,src:e,className:"mx-auto"}),(0,s.jsx)("div",{className:"w-16 h-16 text-white rounded-full py-3 pl-3.5 pr-2.5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",style:{background:m().gray.gray1kTransparent},children:(0,s.jsx)("div",{className:"p-2",children:(0,s.jsx)(u.PlayIcon,{size:24})})})]})}return(null==y?void 0:y.length)?(0,s.jsxs)("div",{className:"flex flex-col gap-2 mb-2",children:[(0,s.jsx)("div",{role:"none",onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,s.jsx)(r.A,{playbackId:null==y||null==(t=y[0])?void 0:t.playbackId,metaData:j})}),h&&(null==v?void 0:v.postedBy)?(0,s.jsxs)(o.default.NormalText,{xs:!0,textColor:"text-gray-400",className:"self-end",children:["Video by"," ",(0,s.jsx)(o.default.SemiBoldText,{as:n(),xs:!0,textColor:"text-gray-700",className:"inline hover:underline",href:i.APP_PATHS.postDetails(null==v?void 0:v.id),children:null==v||null==(a=v.postedBy)?void 0:a.displayName})]}):null]}):null}},74025:(e,l,t)=>{t.d(l,{A:()=>p});var s=t(37876),a=t(14232),n=t(63819),o=t(83872),r=t(71297),i=t(21639),d=t(38243),u=t(1245),c=t(20841);let m={DOWNLOAD:"DOWNLOAD",COPY:"COPY"},p=(0,a.forwardRef)((e,l)=>{let{imageName:t,children:p,optionButtons:x,showModal:h,setShowModal:v,onScreenshot:f=()=>{},...g}=e,[y,j]=(0,a.useState)({}),N=async e=>{let s=e=>()=>{j(l=>({...l,[e]:!1}));
1let l=e===m.DOWNLOAD?"Downloaded screenshot successfully.":"Copied screenshot to clipboard.";r.A.SuccessToast(l)};switch(j(l=>({...l,[e]:!0})),f(),e){case m.DOWNLOAD:await (0,c.GV)(l.current,{imageName:t},s(e));break;case m.COPY:await (0,c.qp)(l.current,{},s(e))}};return(0,s.jsxs)(d.Ay,{showModal:h,setShowModal:v,showClose:!1,extraLarge:!0,...g,children:[p,(0,s.jsx)("div",{className:"bg-gray-00 p-2 rounded-2xl absolute top-1/2 -translate-y-1/2 -right-16",children:(0,s.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[x,(0,s.jsx)(i.Ay.Primary,{circular:!0,onClick:()=>N(m.DOWNLOAD),loading:y[m.DOWNLOAD],title:"Download Screenshot","data-tip":!0,"data-for":"download-screenshot",children:(0,s.jsx)(o.DownloadIcon,{size:"20"})}),(0,s.jsx)(u.A,{id:"download-screenshot",text:"Download Screenshot",place:"left"}),(0,n.isSafariBrowser)()?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Ay.CarbonOutline,{circular:!0,onClick:()=>N(m.COPY),loading:y[m.COPY],title:"Copy to clipboard","data-tip":!0,"data-for":"copy-clipboard",children:(0,s.jsx)(o.CopyIcon,{size:20})}),(0,s.jsx)(u.A,{id:"copy-clipboard",text:"Copy to clipboard",place:"left"})]})]})})]})})},77638:(e,l,t)=>{t.d(l,{A:()=>h});var s=t(67768),a=t(40097),n=t(34321),o=t(16495),r=t(71297),i=t(68827),d=t(70657),u=t(94296),c=t(17175),m=t(63819),p=t(10986);let x=e=>{Object.values(p.ji).forEach(l=>{e.invalidateQueries({queryKey:c.l.scrollFeed(l),exact:!0})})},h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,l=(()=>{let e=(0,s.jE)(),l=(0,a.n)({mutationFn:async e=>e,onMutate:async l=>{let{postId:t,comment:s,isEdit:a}=l;if(!t||!s||!s.id)return;let n=null;await e.cancelQueries(c.l.post(t));let{post:o}=n={post:e.getQueryData(c.l.post(t))};if(o){let l,n=o.comments||[],r=n.some(e=>e.id===s.id),i=o.commentCount||0;r||a?l=n.map(e=>e.id===s.id?{...e,...s}:e):(l=(null==s?void 0:s.replyTo)?[...n,s]:[s,...n],i+=1);let d=m.default.groupComments(l);e.setQueryData(c.l.post(t),{...o,comments:d,commentCount:i})}return{snapshots:n}},onError:(l,t,s)=>{let{postId:a}=t;s.snapshots.post&&e.setQueryData(c.l.post(a),s.snapshots.post),r.A.ErrorToast("Failed to add comment. Please try again.")}}),t=(0,a.n)({mutationFn:async e=>e,onMutate:async l=>{let{postId:t,commentId:s}=l;await e.cancelQueries(c.l.post(t));let a={post:e.getQueryData(c.l.post(t))},n=e.getQueryData(c.l.post(t));return n&&e.setQueryData(c.l.post(t),{...n,comments:n.comments.filter(e=>e.id!==s),commentCount:Math.max(0,(n.commentCount||0)-1)}),a},onError:(l,t,s)=>{let{postId:a}=t;e.setQueryData(c.l.post(a),s.snapshot.post),r.A.ErrorToast("Failed to delete comment. Please try again.")},onSuccess:(l,t)=>{let{postId:s}=t;e.invalidateQueries(c.l.post(s))}});return{updateComment:l.mutate,deleteComment:t.mutate}})(),t=(()=>{let e=(0,s.jE)(),l=l=>e.getQueryData(c.l.post(l)),t=(l,t)=>{e.setQueryData(c.l.post(l),e=>e?{...e,...t}:e)},m=(l,t)=>{e.setQueryData(c.l.scrollFeed(l),e=>(null==e?void 0:e.pages)?{...e,pages:e.pages.map(t)}:e)},p=(0,a.n)({mutationFn:async e=>{let{post:l}=e;return(null==l?void 0:l.isUpvoted)?await n.mi.removePostUpvote(l.id):await n.mi.upvotePost(l.id)},onMutate:async s=>{let{post:a,userShortProfile:n}=s;await e.cancelQueries(c.l.post(a.id));let o=e.getQueryData(c.l.post(a.id));o||e.setQueryData(c.l.post(a.id),a);let r=l(a.id)||a;if(!r)return{snapshot:o};let i=r.isUpvoted||!1,d=i?(r.upvotedBy||[]).filter(e=>e.id!==n.id):[n,...r.upvotedBy||[]],u={isUpvoted:!i,upvoteCount:i?Math.max(0,(r.upvoteCount||0)-1):(r.upvoteCount||0)+1,upvotedBy:d};return t(a.id,u),{snapshot:o}},onError:(l,t,s)=>{let{post:a}=t;e.setQueryData(c.l.post(a.id),s.snapshot)}}),h=(0,a.n)({mutationFn:async l=>{let{postId:t,isAlreadyReshared:s,repostData:a}=l;s?(await n.mi.deletePost("".concat(t,"&reshared=",!0)),x(e)):await n.mi.post({context:o.SCROLL_CONSTANTS.CONTEXT.SHOW,data:a})},onMutate:async l=>{let{postId:s,isAlreadyReshared:a,originalPost:n,userData:o,feedType:r}=l;await e.cancelQueries(c.l.post(s));let i={post:e.getQueryData(c.l.post(s)),feed:e.getQueryData(c.l.scrollFeed(r))},d=(null==n?void 0:n.resharedByList)||[];if(t(s,{isReshared:!a,resharedCount:a?(n.resharedCount||0)-1:(n.resharedCount||0)+1,resharedByList:a?d.filter(e=>e.id!==o.id):[o,...d]}),a)m(r,e=>({...e,postIds:e.postIds.filter(e=>e!==s)}));else{let l="repost-".concat(s),t={id:l,createdAt:new Date().toISOString(),postedBy:o,ogPost:{...n,isReshared:!0,resharedCount:((null==n?void 0:n.resharedCount)||0)+1},resharedByList:[o,...(null==n?void 0:n.resharedByList)||[]]};e.setQueryData(c.l.post(l),t),m(r,e=>({...e,postIds:[l,...e.postIds]}))}return i},onError:(l,t,s)=>{var a,n;Object.entries(s.snapshot).forEach(l=>{let[t,s]=l;e.setQueryData(t,s)}),r.A.ErrorToast((null==l||null==(n=l.response)||null==(a=n.data)?void 0:a.message)||i.A.GLOBAL.wrong)}}),v=(0,a.n)({mutationFn:async e=>{let{entityId:l,isProjectBookmark:t,isBookmarked:s,isHQ:a}=e,r=t?{projectId:l}:{activityId:l};return s?(await n.E4.delete(r),d.A.capture(u.Ay.DELETED_BOOKMARKED_SCROLL)):(await n.E4.add(r),d.A.capture(u.Ay.BOOKMARKED_SCROLL,{source:a?o.SCROLL_CONSTANTS.HQ:null}
1)),{entityId:l,isBookmarked:!s}},onMutate:async l=>{let{entityId:s,isBookmarked:a}=l;await e.cancelQueries(c.l.post(s));let n=e.getQueryData(c.l.post(s));return t(s,{isBookmarked:!a}),{snapshot:n}},onError:(l,t,s)=>{e.setQueryData(c.l.post(t.entityId),s.snapshot),r.A.ErrorToast(t.isBookmarked?"Could not remove bookmark. Some error occurred.":"Could not bookmark. Some error occurred.")}});return{upvotePost:p.mutate,repost:h.mutate,bookmark:v.mutate,getPostFromCache:l,updatePostInCache:t}})(),h=(()=>{let e=(0,s.jE)(),l=l=>e.getQueryData(c.l.post(l)),t=(0,a.n)({mutationFn:l=>{e.getQueriesData(["scrollFeed"]).forEach(t=>{let[s,a]=t;(null==a?void 0:a.pages)&&e.setQueryData(s,{...a,pages:a.pages.map(e=>{var t;return{...e,postIds:null==e||null==(t=e.postIds)?void 0:t.filter(e=>e!==l)}})})})}});return{deletePost:(0,a.n)({mutationFn:async l=>{await n.mi.deletePost(l),x(e)},onMutate:async t=>{await Promise.all([e.cancelQueries({queryKey:c.l.post(t),exact:!0}),...Object.values(p.ji).map(l=>e.cancelQueries({queryKey:c.l.scrollFeed(l),exact:!0}))]);let s={post:e.getQueryData(c.l.post(t)),feeds:Object.fromEntries(Object.values(p.ji).map(l=>[l,e.getQueryData(c.l.scrollFeed(l))]))};return e.removeQueries({queryKey:c.l.post(t),exact:!0}),e.removeQueries({queryKey:c.l.post("repost-".concat(t)),exact:!0}),Object.values(p.ji).forEach(s=>{let a=e.getQueryData(c.l.scrollFeed(s));(null==a?void 0:a.pages)&&e.setQueryData(c.l.scrollFeed(s),{...a,pages:a.pages.map(e=>{var s;return{...e,postIds:(null==(s=e.postIds)?void 0:s.filter(e=>{var s;let a=l(e);return e!==t&&e!=="repost-".concat(t)&&(null==a||null==(s=a.ogPost)?void 0:s.id)!==t}))||[]}})})}),s},onError:(l,t,s)=>{var a,n;s.snapshot.post&&e.setQueryData(c.l.post(t),s.snapshot.post),Object.entries(s.snapshot.feeds).forEac
1h(l=>{let[t,s]=l;s&&e.setQueryData(c.l.scrollFeed(t),s)}),r.A.ErrorToast((null==l||null==(n=l.response)||null==(a=n.data)?void 0:a.message)||i.A.GLOBAL.wrong)}}).mutate,removeSinglePostMutation:t,getPostFromCache:l}})();return{updateComment:l.updateComment,deleteComment:l.deleteComment,upvotePost:t.upvotePost,repost:l=>t.repost({...l,feedType:e}),bookmark:t.bookmark,deletePost:h.deletePost,getPostFromCache:t.getPostFromCache,updatePostInCache:t.updatePostInCache,removeSinglePostMutation:h.removeSinglePostMutation}}},93257:(e,l,t)=>{t.d(l,{id:()=>ej,Hs:()=>eC,rq:()=>eN});var s=t(37876),a=t(28857),n=t(78063),o=t(89311),r=t(16495),i=t(63819),d=t(83872),u=t(4755);let c=e=>{var l,t;let{totalCommentsCount:a,comments:n=[]}=e;if(!a||!n.length)return null;let c=a,m=new Set,p=n.filter(e=>{var l,t;return m.has(null==e||null==(l=e.owner)?void 0:l.id)?(c-=1,!1):(m.add(null==e||null==(t=e.owner)?void 0:t.id),!0)});return c=[...p].length,(0,s.jsxs)("div",{className:"pl-3 flex gap-1 items-start",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-blue-400",children:(0,s.jsx)(d.CommentIcon,{size:16})}),(0,s.jsx)("div",{className:"h-3 w-0.5 bg-gradient-to-b from-gray-400 to-gray-400/5"})]}),(0,s.jsxs)(o.default.NormalText,{xxs:!0,textColor:"text-gray-700",children:["New"," ",i.default.addPlural({word:"comment",count:c})," ","by"]}),(0,s.jsxs)("div",{className:"flex ml-1 items-center cursor-pointer",children:[p.map(e=>{var l;return(0,s.jsx)("div",{className:"-ml-1",children:(0,s.jsx)(u.Ay.Tiny,{image:(null==e||null==(l=e.owner)?void 0:l.profilePicture)||r.CDNImage.emptyUserDP,alt:"".concat(i.default.getDisplayName(null==e?void 0:e.owner)," profile")})},null==e?void 0:e.id)}),(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsxs)(o.default.NormalText,{xxs:!0,className:"ml-1 group-hover:underline",children:[(0,s.jsx)("strong",{children:null==(t=p[0])||null==(l=t.owner)?void 0:l.firstName}),c>1?(0,s.jsxs)("span",{children:[" ","&"," ",(0,s.jsxs)("strong",{children:[c-1," ",i.default.addPlural({word:"other",count:c-1})]})]}):null," "]})})]})]})},m=()=>(0,s.jsxs)("div",{className:"pl-3 flex gap-1 items-start",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center",children:[(0,s.jsx)("span",{className:"text-green-300",children:(0,s.jsx)(d.HandWaveIcon,{size:16})}),(0,s.jsx)("div",{className:"h-3 w-0.5 bg-gradient-to-b from-gray-400 to-gray-400/5"})]}),(0,s.jsx)(o.default.NormalText,{xxs:!0,textColor:"text-gray-700",children:"First post on Peerlist!"})]});var p=t(14232),x=t(94296),h=t(70657),v=t(21639),f=t(38243),g=t(74025),y=t(445),j=t(10986);let N=e=>{var l;let{post:t}=e,[a,n]=(0,p.useState)(!1),[u,c]=(0,p.useState)(!1),m=(0,p.useRef)(null),N=(0,i.removeHTMLFromString)(null==t?void 0:t.caption).length>400,C=(0,j._c)({caption:null==t?void 0:t.caption,showFullCaption:u,charLimits:400});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.B9.Screenshot,{onClick:()=>{h.A.capture(x.Ay.CLICKED_ON_SCREENSHOT_SHARE),n(!0)}}),(0,s.jsx)(g.A,{showModal:a,setShowModal:n,ref:m,imageName:"Peerlist-Post-".concat(t.id||"",".png"),optionButtons:N?(0,s.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,s.jsx)(v.Ay.CarbonTransparent,{circular:!0,onClick:()=>c(!1),title:"Short Description",children:(0,s.jsx)(d.ShortAnswerIcon,{size:20})}),(0,s.jsx)(v.Ay.CarbonTransparent,{circular:!0,onClick:()=>c(!0),title:"Full Description",children:(0,s.jsx)(d.LongAnswerIcon,{size:20})}),(0,s.jsx)("div",{className:"border border-primaryBorder m-1"})]}):null,children:(0,s.jsx)(f.Ep.Body,{defaultClasses:"p-0 w-full",children:(0,s.jsx)("div",{className:"rounded-2xl overflow-hidden",children:(0,s.jsxs)("div",{className:"pt-16 pb-6 px-20 bg-[linear-gradient(180deg,_#FAFBFC_0%,_#E1E4E8_100%)] dark:bg-[linear-gradient(180deg,_#171717_0%,_#262626_100%)]",ref:m,children:[(0,s.jsxs)("div",{className:"relative shadow-postCardScreenshot rounded-2xl overflow-hidden",children:[(0,s.jsx)(ej,{showFullCaption:u,isFromPostDetailsPage:!1,postCaption:C,postData:t,showCommentsSection:!1,hideReactionBar:!0,showPeerlistLogo:!0,border:"border-b-0"}),(0,s.jsx)("div",{className:"absolute w-full h-full top-0 bg-transparent z-50"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 justify-center mt-6",children:[(0,s.jsxs)(o.default.NormalText,{base:!0,textColor:"text-gray-500",children:["Posted by @",null==t||null==(l=t.postedBy)?void 0:l.profileHandle," on"]}),(0,s.jsx)("img",{src:r.CDNImage.peerlistFullNameDarkLogo,width:75,height:16,className:"mb-0.5 dark:invert",alt:"Peerlist Logo"})]})]})})})})]})};
1var C=t(35433),w=t(78207),A=t(71410),b=t(2171),T=t(5078),P=t(34321),S=t(71297),D=t(68827),E=t(82669),O=t(95993),k=t(77638);let I=e=>{let{metaData:l,updatePostStateOnLocal:t=()=>{},postedBy:a,postId:n}=e,r=(0,b.useSelector)(O.oz),{updatePostInCache:i}=(0,k.A)(),{handlePublishTrigger:d}=(0,T.A)(),c=(null==l?void 0:l.option)?Object.entries(null==l?void 0:l.option):[],[m,x]=(0,p.useState)(!1),h=async(e,l)=>{var s,a,o,r;if(e.stopPropagation(),e.preventDefault(),await d())try{x({key:l});let e={postId:n,votedOption:l},o=await P.mi.giveVoteOnPoll(e);t("ASK_POLL_VOTES",{...e,option:o.data.data}),i(n,{metaData:null==o||null==(a=o.data)||null==(s=a.data)?void 0:s.metaData})}catch(e){S.A.ErrorToast((null==e||null==(r=e.response.data)||null==(o=r.error)?void 0:o.message)||D.A.GLOBAL.wrong)}finally{x(!1)}},v=new Date>new Date(l.endOn),f=0;c.forEach(e=>{f+=Number((null==e?void 0:e.votes)||0)}),f||(f=(null==l?void 0:l.totalVotes)||0);let g=(null==l?void 0:l.voted)||v||(null==a?void 0:a.id)===r.id;return(null==l?void 0:l.option)&&(null==c?void 0:c.length)!==0?(0,s.jsxs)("div",{className:"mb-2",children:[g?(0,s.jsx)("div",{children:(0,s.jsx)("ul",{className:"",children:c.map(e=>{let[t,a]=e,n=a.votes&&f?(a.votes/f*100).toFixed(0):0,i="bg-gray-200";return 0!==n&&(i=t===(null==l?void 0:l.voted)?"bg-blue-400":"bg-gray-1k"),(0,s.jsxs)("li",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)(o.default.NormalText,{className:"w-14",children:[n,"%"]}),(0,s.jsxs)("div",{className:"w-full flex flex-col col-span-11 ml-2",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(o.default.SemiBoldText,{xs:!0,children:a.label}),t===l.voted&&(null==r?void 0:r.profilePicture)&&(0,s.jsx)("div",{className:"ml-2",children:(0,s.jsx)(u.Ay.Smallest,{image:null==r?void 0:r.profilePicture,widthClass:"w-4",height
1Class:"h-4"})})]}),(0,s.jsx)("div",{style:{width:0!==n?"".concat(n,"%"):"16px"},className:"h-1 w-full animate-poll-option\n rounded-full mt-2 ".concat(i)})]})]},t)})})}):(0,s.jsx)("ul",{children:c.map(e=>{let[l,t]=e;return(0,s.jsx)("li",{className:"w-full mb-2",children:(0,s.jsx)("button",{type:"button",onClick:e=>h(e,l),className:"w-full flex items-center justify-center bg-gray-00 text-center border border-primaryBorder rounded-xl font-semibold text-xs px-4 py-2 hover:bg-gray-00 hover:shadow-10 transition",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"mr-2",children:t.label}),m.key===l&&(0,s.jsx)(E.A,{})]})})},l)})}),(0,s.jsxs)("div",{className:"mt-6 flex justify-between items-center",children:[(0,s.jsxs)(o.default.MutedText,{xxs:!0,children:["Total"," ",(0,s.jsx)(o.default.SemiBoldText,{as:"span",xxs:!0,children:f})," ",1===f?"vote":"votes"]}),!v&&(0,s.jsxs)(o.default.MutedText,{xxs:!0,children:[" ",(e=>{if(new Date>new Date(e))return null;let l=(0,w.A)((0,A.A)(e),new Date,{addSuffix:!0});return"".concat(l," left")})(l.endOn)]})]})]}):null};var B=t(48230),L=t.n(B),H=t(69963),_=t(78004),M=t.n(_);let R=e=>{var l;let{metaData:t,postedBy:a,postId:n,updatePostStateOnLocal:c=()=>{}}=e,m=(0,b.useSelector)(O.oz),x=(null==t?void 0:t.option)?Object.values(null==t?void 0:t.option):[],h=(null==t||null==(l=t.topics)?void 0:l.length)?t.topics:[],v=(null==t?void 0:t.totalAnswers)||0,f=(null==t?void 0:t.totalCorrectAnswers)||0,g=(null==m?void 0:m.id)===(null==a?void 0:a.id),y=null==t?void 0:t.selectedAnswer,{updatePostInCache:j}=(0,k.A)(),{handlePublishTrigger:N}=(0,T.A)(),[C,w]=(0,p.useState)(null),A=async e=>{var l,t,s,a,o,r;if(await N()&&!y&&!g)try{w(e);let a=await P.mi.answerQuiz({postId:n,answeredOption:"option".concat(e+1)});(null==a||null==(l=a.data)?void 0:l.data)&&(c("ANSWERED_QUIZ",a.data.data),j(n,{metaData:null==a||null==(s=a.data)||null==(t=s.data)?void 0:t.metaData}))}catch(e){S.A.ErrorToast((null==e||null==(r=e.response)||null==(o=r.data)||null==(a=o.error)?void 0:a.message)||D.A.GLOBAL.wrong)}finally{w(!1)}};return(null==t?void 0:t.option)&&(null==x?void 0:x.length)!==0?(0,s.jsxs)("div",{className:"mb-4 flex flex-col gap-4",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2",children:x.map((e,l)=>{let t=y||g,a=e.isAnswer&&t,n=y===l+1&&!e.isAnswer&&t,c=e.totalAttempts||0;return(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-between text-left w-full px-2 rounded-lg border py-1.5 transition-all ease-in-out duration-150 ".concat((e=>{let{isCorrectAnswer:l,isWrongAnswer:t,alreadyKnowsAnswer:s,isQuizCreator:a}=e;return l?"border-green-100 bg-green-00 dark:bg-green-300/20 dark:border-green-500 cursor-default":t?"border-red-200 bg-red-00 dar
1k:bg-red-300/20 dark:border-red-600 cursor-default":a||!s||l||t?s?s?"bg-gray-50 border-primaryBorder cursor-default dark:hover:bg-gray-200 dark:hover:border-gray-300":"bg-gray-50 border-primaryBorder ":"hover:bg-gray-00 hover:border-gray-400 bg-gray-00 border-primaryBorder":"bg-gray-100 dark:bg-gray-25 opacity-50 border-primaryBorder"})({isCorrectAnswer:a,isQuizCreator:g,isWrongAnswer:n,alreadyKnowsAnswer:t})," \n "),onClick:e=>{e.stopPropagation(),e.preventDefault(),A(l)},children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[a?(0,s.jsx)(d.CheckRoundedIcon,{size:20,background:M().green.bright,color:M().white.DEFAULT,checkColor:M().white.DEFAULT}):null,n?(0,s.jsx)(d.CloseXRoundedIcon,{size:20,background:"#EB5757",color:"#EB5757",crossColor:"white"}):null,a||n?null:(0,s.jsx)("div",{className:"w-5 h-5 rounded-[4px] bg-gray-200 flex items-center justify-center",children:(0,s.jsx)(o.default.SemiBoldText,{xs:!0,children:String.fromCharCode(65+l)})}),(0,s.jsx)(o.default.SemiBoldText,{xs:!0,children:e.label})]}),g?(0,s.jsxs)(o.default.NormalText,{sm:!0,children:[((e,l)=>l?Math.round(e/l*100):0)(c,v),"%"]}):null,y&&y===l+1&&!g?(0,s.jsx)(u.Ay.TinyPlus,{image:(null==m?void 0:m.profilePicture)||r.CDNImage.emptyUserDP,alt:"".concat(i.default.getDisplayName(m)," profile")}):null,C===l?(0,s.jsx)("div",{className:"my-0.5 ml-auto",children:(0,s.jsx)(E.A,{})}):null]},"".concat(e.label.slice(0,5),"-option-").concat(l+1))})}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[h.length?(0,s.jsxs)(o.default.MutedText,{xxs:!0,className:"flex items-center flex-wrap gap-1",children:[(0,s.jsx)("strong",{children:"Topics:"}),h.map((e,l)=>(0,s.jsxs)("span",{className:"flex items-center gap-px text-gray-1k",children:[(0,s.jsx)(H.$,{skill:e,imageSize:12})," ",e.name,l<h.length-1?",":""]},e.name))]}):null,v&&f?(0,s.jsx)(L(),{href:{pathname:r.APP_PATHS.postDetails(n),query:{showAnswers:1}},className:"cursor-pointer hover:underline",children:(0,s.jsxs)(o.default.NormalText,{xxs:!0,textColor:"text-gray-700",children:[(0,s.jsxs)("strong",{children:[f," / ",v]})," ","Answered Correctly"]})}):null,v&&0===f?(0,s.jsxs)(o.default.NormalText,{xxs:!0,textColor:"text-gray-700",children:[(0,s.jsxs)("strong",{children:[f," / ",v]})," ","Answered Correctly"]}):null]})]}):null},F=e=>{let{metaData:l,embedType:t,postContext:a,originalPost:n,updatePostStateOnLocal:
1o,mediaCount:i=0}=e,d=a;if(null==l?void 0:l.deleted)return(0,s.jsx)("div",{className:"border border-primaryBorder rounded-lg p-4 mb-4",children:(0,s.jsx)("p",{className:"text-gray-500 text-xs",children:"The original post is not available."})});switch(r.SCROLL_CONSTANTS.CONTEXT.ASK===a&&!(null==l?void 0:l.option)&&(d=r.SCROLL_CONSTANTS.CONTEXT.SHOW),d){case r.SCROLL_CONSTANTS.CONTEXT.BOOK:return(0,s.jsx)(C.EmbedCard.Book,{data:l});case r.SCROLL_CONSTANTS.CONTEXT.ASK:return(0,s.jsx)(I,{metaData:l,postedBy:null==n?void 0:n.postedBy,postId:null==n?void 0:n.id,updatePostStateOnLocal:o});case r.SCROLL_CONSTANTS.CONTEXT.QUIZ:return(0,s.jsx)(R,{metaData:l,postedBy:null==n?void 0:n.postedBy,postId:null==n?void 0:n.id,updatePostStateOnLocal:o});default:if(t===r.SCROLL_CONSTANTS.EMBEDS.PROJECT&&!(null==l?void 0:l.reshared)){var u;return(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)(C.EmbedCard.LinkPreview,{data:{title:(null==l?void 0:l.title)||null,description:(null==l?void 0:l.tagline)||(null==l?void 0:l.description)||null,image:(null==l?void 0:l.image)||(null==l||null==(u=l.images)?void 0:u[0])||(null==l?void 0:l.logo)||null,link:(null==l?void 0:l.link)||((null==l?void 0:l.projectURL)?"".concat("https://peerlist.io").concat(l.projectURL):null)}})})}if(t||(null==l?void 0:l.reshared))return(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)(C.default,{embedData:l,embedType:t||(null==l?void 0:l.embed),originalPost:n,renderAsLink:!0})});if(!t&&!i)return(0,s.jsx)(C.LinkBasedEmbeds,{embedData:l});return null}};var Q=t(32238),U=t(61794),z=t(66038);let V=e=>{let{postData:l,onCommentClick:t=()=>{},isFromPostDetailsPage:a=!1,isReadOnly:n=!1}=e,{handlePublishTrigger:o}=(0,T.A)(),r=(0,U.A)(),i=(0,b.useSelector)(O.oz),[d,u]=(0,p.useState)(!1),{getPostFromCache:c,updatePostInCache:m}=(0,k.A)(),x=c(l.id)||l,h=async e=>{e.stopPropagation(),(n||a||await o())&&t(e)};return(0,p.useEffect)(()=>{if(!r||!(null==i?void 0:i.id)||!(null==x?void 0:x.id))return;let e=e=>{(null==e?void 0:e.userId)!==i.id&&Number.isInteger(null==e?void 0:e.commentCount)&&x.id===(null==e?void 0:e.postId)&&(m(e.postId,{commentCount:e.commentCount}),u(!0),setTimeout(()=>u(!1),500))};return r.bind(z.w.POST_COMMENTED,e),()=>{null==r||r.unbind(z.w.POST_COMMENTED,e)}},[r,null==i?void 0:i.id,null==x?void 0:x.id]),(0,s.jsx)(y.B9.Comment,{onClick:h,iconSize:14,reactionCount:(null==x?void 0:x.commentCount)||0,highlight:d,isDisabled:n})};var q=t(54587),K=t.n(q),W=t(43271),Y=t(94277),G=t(50629),X=t(442),J=t(1245);let $=e=>{let{post:l,showPeerlistLogo:t=!1,showMoreOptions:n=!1,showFollowBtn:d=!1,setFollowedPostId:c=()=>{},setFollowerIds:m=()=>{},isReadOnly:p=!1}=e;if(!l||!l.id)return null;let x=l.postedBy||{profileHandle:"unknown",firstName:"Unknown",lastName:"User",profilePicture:r.CDNImage.emptyUserDP,verified:!1,idVerifiedAt:null};return(0,s.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(a.A,{profileHandle:x.profileHandle,children:(0,s.jsx)(L(),{prefetch:!1,href:r.APP_PATHS.userProfile({profileHandle:x.profileHandle,absolute:p}),className:"flex items-center",children:(0,s.jsx)("div",{className:"w-10 h-10 relative",children:(0,s.jsx)(u.Ay.Small,{alt:"".concat(x.firstName," ").concat(x.lastName),image:x.profilePicture||r.CDNImage.emptyUserDP,verified:x.verified,idVerified:x.idVerifiedAt,className:"hover:opacity-80 cursor-pointer"})})})}),(0,s.jsxs)("div",{className:"ml-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center whitespace-nowrap gap-2",children:[(0,s.jsx)(a.A,{profileHandle:x.profileHandle,children:(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(L(),{href:r.APP_PATHS.userProfile({profileHandle:x.profileHandle,absolute:p}),className:"flex items-center",prefetch:!1,children:(0,s.jsx)(o.default.SemiBoldText,{as:"h3",sm:!0,className:"hover:underline transition",children:"".concat(x.firstName," ").concat(x.lastName)})}),p?null:(0,s.jsx)(G.S0,{projectURL:x.launchDetails})]})}),d?(0,s.jsx)("div",{role:"none",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(Y.A,{profileData:x,username:x.profileHandle,as:"button",secondaryAs:"button",relation:i.default.getUserRelation(x),onFollow:()=>{c(null==l?void 0:l.id),m(e=>[...e,x.id])},onUnfollow:()=>{c(null),m(e=>e.filter(e=>e!==x.id))},className:"text-blue-400 text-xs hover:underline font-bold",secondaryClassName:"text-gray-500 text-xs hover:underline hover:text-gray-1k font-bold flex items-center",small:""})}):null]}),(0,s.jsx)("div",{className:"text-gray-500 text-xs leading-4",children:(0,s.jsxs)("div",{className:"flex items-center flex-wrap",children:[x.profileHandle&&"unknown"!==x.profileHandle?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L(),{href:r.APP_PATHS.userProfile({profileHandle:x.profileHandle,absolute:p}),prefetch:!1,children:(0,s.jsxs)("span",{children:["@",x.profileHandle]})}),(0,s.jsx)(o.default.Dot,{})]}):null,(0,s.jsxs)("span",{className:"inline-flex items-center",children:[(0,j.Bc)({post:l,absolute:p})," ",(null==l?void 0:l.contextIcon)?(0,s.jsx)(K(),{width:14,height:14,src:l.contextIcon,alt:(null==l?void 0:l.context)||r.SCROLL_CONSTANTS.CONTEXT.SHOW,className:"inline-block ml-1"}):null]}),(0,s.jsx)(o.default.Dot,{}),(null==l?void 0:l.availableAt)||(null==l?void 0:l.createdAt)?(0,s.jsx)("span",{children:(0,i.timeSince)((null==l?void 0:l.availableAt)||(null==l?void 0:l.createdAt))}):null,(0,s.jsx)(W.A.PostedFromApp,{post:l,as:"span"}),(null==l?void 0:l.editedAt)?(0,s.jsx)("span",{className:"ml-1",children:"(edited)"}):null]})})]})]}),(null==l?void 0:l.hq)&&n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{"data-tip":!0,"data-for":"".concat(l.id,"-hq-post"),children:(0,s.jsx)(X.z5,{})}),(0,s.jsx)(J.A,{id:"".concat(l.id,"-hq-post"),text:"This post is marked as High Quality."})]}):null,t?(0,s.jsx)("div",{className:"flex items-start mb-2",children:(0,s.jsx)(K(),{src:r.CDNImage.peerlistFavicon,width:32,height:32,alt:"peerlist logo"})}):null]})};var Z=t(11023),ee=t(14291);let el=e=>{var l,t,a,n,r,i,u,c,m,x,h;let{data:v,disable:f,feedType:g}=e,j=(0,b.useSelector)(O.oz),{repost:N}=(0,k.A)(g),{handlePublishTrigger:C}=(0,T.A)(),[w,A]=(0,p.useState)(!1),[P,S]=(0,p.useState)(!1),D=!!(null==v?void 0:v.isReshared),E=async()=>{var e,l,t,s;let a={reshared:!P,resharedContext:v.context};a.id=P&&(null==v?void 0:v.resharedVideo)?null==v||null==(e=v.metaData)?void 0:e.id:null==v?void 0:v.id,a.originalPoster=P&&(null==v?void 0:v.resharedVideo)?null==v||null==(t=v.metaData)||null==(l=t.postedBy)?void 0:l.id:null==v||null==(s=v.postedBy)?void 0:s.id,await N({postId:v.id,isAlreadyReshared:D,originalPost:v,feedType:g,userData:{id:j.id,firstName:j.firstName,lastName:j.lastName,profileHandle:j.profileHandle,profilePicture:j.profilePicture},repostData:a})},I=[{icon:(0,s.jsx)(d.ReshareIcon,{size:16}),label:D?"Undo Reshare":"Reshare",subText:D?"Undo reshare this post.":"Simply reshare the original post.",onClick:E,isActive:D},{icon:(0,s.jsx)(d.EditPencilIcon,{size:16}),label:"Repost",subText:"Add your thoughts and share.",onClick:()=>A(!0)}];((null==v||null==(l=v.videos)?void 0:l.length)||(null==v||null==(a=v.metaData)||null==(t=a.videos)?void 0:t.length))&&I.push({icon:(0,s.jsx)(d.VideoIcon,{size:16}),label:"Post Video",subText:"Share this video in your post.",onClick:()=>{var e,l,t;((null==v||null==(e=v.videos)?void 0:e.length)||(null==v||null==(t=v.metaData)||null==(l=t.videos)?void 0:l.length))&&(A(!0),S(!0))}});let B={repostAPIData:{reshared:!P,resharedContext:v.context,id:P&&(null==v?void 0:v.resharedVideo)?null==v||null==(n=v.metaData)?void 0:n.id:null==v?void 0:v.id,originalPoster:P&&(null==v?void 0:v.resharedVideo)?null==v||null==(i=v.metaData)||null==(r=i.postedBy)?void 0:r.id:null==v||null==(u=v.postedBy)?void 0:u.id},shareVideo:P?{videoBy:(null==v?void 0:v.resharedVideo)?null==v||null==(m
1=v.metaData)||null==(c=m.postedBy)?void 0:c.displayName:null==v||null==(x=v.postedBy)?void 0:x.displayName}:null,postData:v};return(0,s.jsxs)("div",{role:"none",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(Z.A,{position:"left",width:"w-64",dropdownButton:(0,s.jsx)(y.B9.Repost,{isActive:D,isDisabled:f,onClick:async e=>{await C()||e.stopPropagation()},reactionCount:null!=(h=null==v?void 0:v.resharedCount)?h:0}),disabledDropdown:f,children:I.map(e=>(0,s.jsxs)(Z.e.Item,{onClick:async()=>{await C()&&e.onClick()},className:"flex items-center gap-2",children:[e.icon,(0,s.jsxs)("div",{children:[(0,s.jsx)(o.default.SemiBoldText,{xs:!0,children:e.label}),(0,s.jsx)(o.default.MutedText,{xs:!0,children:e.subText})]})]},e.label))}),w?(0,s.jsx)(ee.A.CreatePostWithContext,{showModal:w,setShowModal:A,shareData:B,fromShareModal:!0}):null]})},et=e=>{let{resharedBy:l,resharedByList:t=[],createdAt:n,margin:d="ml-3"}=e,c=Array.from(new Map((l?[l,...t]:[...t]).map(e=>[e.id,e])).values()),m=c.length;return 0===m?null:(0,s.jsxs)("div",{className:"flex items-center gap-1 ".concat(d),children:[(0,s.jsx)("div",{className:"flex gap-1",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("div",{className:"flex items-center",children:c.slice(0,3).map((e,l)=>(0,s.jsx)(a.A,{profileHandle:e.profileHandle,position:"-left-36",children:(0,s.jsx)("div",{className:l>0?"-ml-1":"",children:(0,s.jsx)(L(),{href:r.APP_PATHS.userProfile({profileHandle:e.profileHandle}),children:(0,s.jsx)(u.Ay.Tiny,{image:e.profilePicture||r.CDNImage.emptyUserDP})})})},e.id))}),(0,s.jsx)("div",{className:"ml-[7px] h-2 w-0.5 bg-gradient-to-b from-gray-400 to-gray-400/5"})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-1 mb-2",children:[(0,s.jsxs)(o.default.MutedText,{xxs:!0,children:[(0,s.jsx)(L(),{href:r.APP_PATHS.userProfile({profileHandle:c[0].profileHandle}),className:"hover:underline",children:(0,s.jsx)("strong",{children:i.default.getDisplayName(c[0])})}),m>1&&(0,s.jsxs)("span",{children:[" ","&"," ",(0,s.jsxs)("strong",{children:[m-1," ",i.default.addPlural({word:"other",count:m-1})]})]})," ","reshared"," "]}),n&&(0,s.jsxs)(o.default.MutedText,{xxs:!0,children:["⢠",(0,i.timeSince)(n)]})]})]})},es=e=>{let{postData:l,isReadOnly:t=!1}=e,{handlePublishTrigger:a}=(0,T.A)(),n=(0,U.A)(),o=(0,b.useSelector)(O.oz),[i,d]=(0,p.useState)(),u={firstName:o.firstName,lastName:o.lastName,profilePicture:o.profilePicture,profileHandle:o.profileHandle,id:o.id},{upvotePost:c,getPostFromCache:m,updatePostInCache:x}=(0,k.A)(),h=m(l.id)||l,v=async e=>{var s,n,o;if(e.stopPropagation(),h){if(t){let e=r.APP_PATHS.postDetails(l.id,t);window.open(e,"_blank");return}if(await a()&&(await c({post:h,userShortProfile:u}),(null==h?void 0:h.embed)===r.SCROLL_CONSTANTS.EMBEDS.ARTICLE&&(null==h||null==(s=h.metaData)?void 0:s.id)&&(null==h||null==(n=h.metaData)?void 0:n.autoShared)))try{await P.JH.upvote({articleId:null==h||null==(o=h.metaData)?void 0:o.id,fromSharedPost:!0})}catch(e){}}};return(0,p.useEffect)(()=>{if(!n||!(null==o?void 0:o.id))return;let e=e=>{(null==e?void 0:e.userId)!==(null==o?void 0:o.id)&&Number.isInteger(null==e?void 0:e.upvoteCount)&&h.id===(null==e?void 0:e.postId)&&(x(e.postId,{upvoteCount:e.upvoteCount}),d(!0),setTimeout(()=>d(!1),500))};return n.bind(z.w.POST_UPVOTED,e),()=>null==n?void 0:n.unbind(z.w.POST_UPVOTED,e)},[n,null==o?void 0:o.id,null==h?void 0:h.id]),(0,s.jsx)(y.B9.UpVote,{isActive:null==h?void 0:h.isUpvoted,iconSize:14,reactionCount:null==h?void 0:h.upvoteCount,onClick:v,highlight:i,isDisabled:t})};var ea=t(68024),en=t(74359),eo=t(5332),er=t(16592),ei=t(17175);let ed=e=>{let{postId:l,showCommentsSection:t,expandComments:a}=e,{data:n}=(0,en.I)({queryKey:ei.l.post(l),staleTime:1/0}),o=(null==n?void 0:n.commentCount)||0,{updateComment:i,deleteComment:d}=(0,k.A)(),[u,c]=(0,p.useState)([]),[m,x]=(0,p.useState)(!1);(0,p.useEffect)(()=>{l&&t&&o>1&&(x(!0),a(l).then(e=>{c(e||[]),x(!1)}))},[l,t,o]);let h=(null==n?void 0:n.comments)||[],v=(0,p.useMemo)(()=>1===o?h:t&&u.length>0?u.map(e=>h.find(l=>l.id===e.id)||e):h,[o,t,u,h]);if(!l||0===v.length&&!t)return null;let f=(e,t)=>{i({postId:l,comment:e,isEdit:t})},g=e=>{d(e)};return(0,s.jsxs)("div",{className:"flex flex-col gap-4 mt-4",children:[v.map(e=>{var l,t;let a=(null==e||null==(l=e.owner)?void 0:l.id)===(null==n||null==(t=n.postedBy)?void 0:t.id);return(0,s.jsx)(eo.A,{postComment:e,post:n,commentType:r.COMMENT_TYPES.SCROLL,onCommentUpdate:f,onCommentDelete:g,isForScrollFeed:!0,isOwnerOfEntity:a},e.id)}),m&&t&&(0,s.jsx)("div",{className:"flex flex-col gap-4",children:Array.from({length:Math.min(2,o)}).map((e,l)=>(0,s.jsxs)("div",{className:"animate-pulse flex items-start gap-2",children:[(0,s.jsx)("div",{className:"w-6 h-6 rounded-full bg-gray-200"}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsx)("div",{className:"w-full max-w-[100px] h-2 bg-gray-200 rounded"}),(0,s.jsx)("div",{className:"w-full max-w-md h-2 bg-gray-200 rounded my-2"})]})]},"comment-loader-".concat(l)))}),t?(0,s.jsx)(er.A,{postId:l,autofocusArea:!0,smallerSize:!0,commentType:r.COMMENT_TYPES.SCROLL,onCommentUpdate:f,onCommentDelete:g,isHQ:(null==n?void 0:n.hq)||!1}):null]})};var eu=t(89099),ec=t(860),em=t(60383),ep=t(98221),ex=t(67470);let eh=e=>{let{entityId:l,isBookmark:t=!1,feedType:a,isReadOnly:n=!1,isHQ:o=!1}=e,[i,u]=(0,p.useState)(!!t),{handlePublishTrigger:c}=(0,T.A)(),{bookmark:m}=(0,k.A)(a),x=async e=>{if(e.preventDefault(),l){if(n){let e=r.APP_PATHS.postDetails(l,n);window.open(e,"_blank");return}try{if(!await c())return;await m({entityId:l,isBookmarked:i,isHQ:o}),u(e=>!e)}catch(e){}}};return l?(0,s.jsxs)(Z.e.Item,{onClick:x,className:"flex items-center gap-2 text-xs",children:[(0,s.jsx)(d.BookmarkIcon,{size:14,background:i?M().cyan.light:"none",color:i?M().cyan.DEFAULT:M().current}),i?"Bookmarked":"Bookmark"]}):null},ev=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=>{let{userId:l,postId:t,username:s,width:a="350",height:n}=e,o=new URL(r.APP_PATHS.getAbsolutePath("/embeds/posts"));return t?o.searchParams.append("postId",t):l?o.searchParams.append("userId",l):s&&o.searchParams.append("username",s),{iframeEmbed:'<iframe\n id="peerlist-post"\n src="'.concat(o.toString(),'"\n width="').concat(a,'"\n ').
1concat(n?'height="'.concat(n,'"'):"","\n frameborder=\"0\"\n allowfullscreen\n></iframe>\n\x3c!-- script to set height dynamically, remove this script if you want to set height manually --\x3e\n<script>\n window.addEventListener('message', function (event) {\n if (event.data?.type === 'setHeight') {\n const iframe = document.getElementById('peerlist-post');\n if (iframe) {\n iframe.style.height = ''+ event.data.height + 'px';\n }\n }\n });\n <\/script>\n"),scriptEmbed:"<div id=\"peerlist-post-embed\"></div>\n<script>\n (function() {\n var iframe = document.createElement('iframe');\n iframe.id = 'peerlist-post';\n iframe.src = '".concat(o.toString(),"';\n iframe.width = '").concat(a,"';\n iframe.height = '").concat(n,"';\n iframe.frameBorder = '0';\n iframe.allowFullscreen = true;\n document.getElementById('peerlist-post-embed').appendChild(iframe);\n })();\n\n window.addEventListener('message', function (event) {\n if (event.data?.type === 'setHeight') {\n const iframe = document.getElementById('peerlist-post');\n if (iframe) {\n iframe.style.height = ''+ event.data.height + 'px';\n }\n }\n });\n<\/script>"),embedUrl:o.toString()}})({postId:e,...l})},ef=function(e){let{post:l,isReadOnly:t}=e,a=(0,eu.useRouter)(),n=l.id,{postedBy:o}=l,i=j.f3.postCanEdit({post:l}),u=(0,b.useSelector)(O.B$),{deletePost:c,removeSinglePostMutation:m}=(0,k.A)(),x=(0,ep.A)(),{handlePublishTrigger:h}=(0,T.A)(),[f,g]=(0,p.useState)(!1),[y,N]=(0,p.useState)(!1),[C,w]=(0,p.useState)(!1),A=async()=>{c(n,{onSuccess:()=>{a.asPath===r.APP_PATHS.postDetails(n)&&a.push(r.APP_PATHS.scroll)}})},D=async e=>{let{hide:l,unhide:t}=e;try{x&&(await ex.Lu.hide({postId:n,hide:l,unhide:t}),m.mutate(n),S.A.SuccessToast(l?"Post hidden!":"Post unhidden!"))}catch(e){S.A.ErrorToast(l?"Failed to hide!":"Failed to unhide!")}},E=async()=>{try{x&&(await ex.Lu.suspend(n),m.mutate(n),S.A.SuccessToast("Post suspended successfully!"))}catch(e){S.A.ErrorToast("Failed to suspend the Post!")}},I=async()=>{try{x&&(await ex.Lu.markHighQuality(n),S.A.SuccessToast("Post marked as high quality!"))}catch(e){S.A.ErrorToast("Failed to mark as high quality Post!")}},B=async()=>{try{x&&(await ex.Lu.markLowQuality(n),S.A.SuccessToast("Post marked as low quality!"))}catch(e){S.A.ErrorToast("Failed to mark as low quality Post!")}},L=async()=>{if(await h())try{u&&(await P.F7.markNotInterested({context:r.REPORT_CONTEXTS.POST,typeId:n}),m.mutate(n),S.A.SuccessToast("Post marked as not interested!"))}catch(e){S.A.ErrorToast("Failed to mark as not interested!")}},H=r.APP_PATHS.postDetails(n,!0),_=async()=>{await navigator.clipboard.writeText(H),S.A.SuccessToast("Link copied")},M=async()=>{let{iframeEmbed:e}=ev(n);await navigator.clipboard.writeText(e),S.A.SuccessToast("Embed code copied")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{role:"none",onClick:e=>e.stopPropagation(),children:(0,s.jsxs)(Z.A,{width:"w-40",position:"left-0",className:"max-h-[calc(100vh-230px)] overflow-y-auto hide-scrollbar",align:"end",dropdownButton:(0,s.jsx)(v.Ay.CarbonTransparent,{small:!0,circular:!0,children:(0,s.jsx)(d.MoreVerticalIcon,{size:14})}),children:[(0,s.jsx)(eh,{entityId:n,isBookmark:l.isBookmarked,isReadOnly:t,isHQ:(null==l?void 0:l.hq)||!1}),(0,s.jsxs)(Z.e.Item,{onClick:_,className:"flex items-center text-xs gap-2",children:[(0,s.jsx)(d.LinkIcon,{size:"16"}),"Copy Link"]}),(0,s.jsxs)(Z.e.Item,{onClick:M,className:"flex items-center text-xs gap-2",children:[(0,s.jsx)(d.CodeIcon,{size:"16"}),"Embed Code"]}),u===(null==o?void 0:o.id)?(0,s.jsxs)(s.Fragment,{children:[i?(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2",onClick:()=>g(!0),children:[(0,s.jsx)(d.EditPencilIcon,{size:16}),"Edit"]}):null,(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2",onClick:()=>N(!0),children:[(0,s.jsx)(d.TrashIcon,{size:16}),"Delete"]})]}):t?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2",onClick:L,children:[(0,s.jsx)(d.ThumbsDownIcon,{size:16}),"Not interested"]}),(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2",onClick:()=>{h(),u&&w(!0)},children:[(0,s.jsx)(d.FlagIcon,{size:16}),"Report"]})]}),x?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2 text-green",onClick:()=>I(),children:[(0,s.jsx)(d.ThumbsUpIcon,{size:16}),"Mark as HQ"]}
1),(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2 text-orange",onClick:()=>B(),children:[(0,s.jsx)(d.ThumbsDownIcon,{size:16}),"Mark as LQ"]}),(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2 text-red",onClick:()=>D({hide:!0}),children:[(0,s.jsx)(d.ClosedEyeIcon,{size:16}),"Hide"]}),(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2 text-red",onClick:()=>E(),children:[(0,s.jsx)(d.BlockIcon,{size:16}),"Suspend"]}),(0,s.jsxs)(Z.e.Item,{className:"text-xs flex items-center gap-2 !text-blue",onClick:()=>D({unhide:!0}),children:[(0,s.jsx)(d.OpenEyeIcon,{size:16}),"Unhide"]})]}):null]})}),(0,s.jsx)(ec.A,{showModal:C,setShowModal:()=>w(!1),context:r.REPORT_CONTEXTS.POST,entityId:n}),(0,s.jsx)(em.A,{deleteText:"Are you sure?",subText:"It will be permanently removed and cannot be undone.",showModal:y,setShowModal:N,confirm:()=>A(n)}),f?(0,s.jsx)(ee.A.CreatePostWithContext,{showModal:f,editable:l,setShowModal:()=>{g(!1)}}):null]})},eg=e=>{var l,t,a,n,c;let{post:m}=e;if(!m)return null;let p=(0,b.useSelector)(O.B$)===(null==m||null==(t=m.upvotedBy)||null==(l=t[0])?void 0:l.id)?"You":null==m||null==(n=m.upvotedBy)||null==(a=n[0])?void 0:a.firstName;return!((null==m?void 0:m.commentCount)<2)||(null==m?void 0:m.upvoteCount)?(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(null==m?void 0:m.commentCount)>1?(0,s.jsx)("div",{children:(0,s.jsxs)(o.default.MutedText,{xxs:!0,className:"hover:underline items-center cursor-pointer sm:flex hidden group",children:[(0,s.jsx)("span",{children:"View all "}),(0,s.jsxs)("strong",{children:["\xa0",null==m?void 0:m.commentCount,"\xa0",i.default.addPlural({word:"comment",count:null==m?void 0:m.commentCount})]}),(0,s.jsx)("span",{className:"group-hover:translate-x-0.5 ml-0.5 transition-all",children:(0,s.jsx)(d.ArrowRightIcon,{size:12})})]})}):null,(null==m||null==(c=m.upvotedBy)?void 0:c.length)?(0,s.jsxs)(L(),{"data-section":"upvoters-info",className:"flex ml-1 items-center cursor-pointer group",href:{pathname:null===r.APP_PATHS||void 0===r.APP_PATHS?void 0:r.APP_PATHS.postDetails(null==m?void 0:m.id),query:{showUpvote:!0}},children:[m.upvotedBy.slice(-7).map(e=>(0,s.jsx)("div",{className:"-ml-1",children:(0,s.jsx)(u.Ay.Tiny,{image:(null==e?void 0:e.profilePicture)||r.CDNImage.emptyUserDP,alt:"".concat(null==e?void 0:e.firstName," ").concat(null==e?void 0:e.lastName," profile")})},null==e?void 0:e.id)),(0,s.jsxs)(o.default.MutedText,{xxs:!0,className:"ml-1 group-hover:underline",children:[(0,s.jsx)("strong",{children:p}),(null==m?void 0:m.upvoteCount)>1?(0,s.jsxs)("span",{children:[" ","&"," ",(0,s.jsxs)("strong",{children:[m.upvoteCount-1," ",i.default.addPlural({word:"other",count:m.upvoteCount-1})]})]}):null," ","upvoted"]})]}):null]}):null};var ey=t(5357);let ej=e=>{var l,t,r,i;let{isFromPostDetailsPage:d=!1,navigateToPostDetails:u=()=>{},postCaption:c="",postData:m,handleCommentClick:p=()=>{},showCommentsSection:x=!1,postIndicators:h=null,hideReactionBar:v=!1,showPeerlistLogo:f=!1,showFollowBtn:g=!1,setFollowedPostId:y=()=>{},setFollowerIds:C=()=>{},isReadOnly:w=!1,border:A="border-b border-primaryBorder",analyticsEventSource:b,feedType:T,teamAccessFeature:P,expandComments:S}=e;if(!m)return null;let D=null==m?void 0:m.id,E=(null==m?void 0:m.ogPost)||m;if(!E||!E.id||!E.postedBy)return null;let O=(null==E||null==(l=E.videos)?void 0:l.length)||(null==E?void 0:E.resharedVideo)&&(null==E||null==(r=E.metaData)||null==(t=r.videos)?void 0:t.length);return(0,s.jsxs)("article",{role:"none",className:"bg-gray-00 px-4 mob:px-6 py-4 border-b border-primaryBorder ".concat(d?"":"hover:bg-gray-25 cursor-pointer group/post-card"," ").concat(A),onClick:e=>u(e,E),children:[d?null:h,(0,s.jsx)("div",{className:"flex items-center justify-between mb-0.5",children:(0,s.jsx)($,{post:E,showPeerlistLogo:f,showMoreOptions:!f,showFollowBtn:g,setFollowedPostId:y,setFollowerIds:C,isReadOnly:w})}),(0,s.jsxs)("div",{className:"ml-12",children:[(null==E?void 0:E.postTitle)?(0,s.jsx)(o.default.SemiBoldText,{sm:!0,as:d?"h1":"p",className:"mb-2 ".concat(d?"text-base mt-2":"text-sm"),textColor:"text-gray-1k",children:E.postTitle}):null,c?(0,s.jsx)(a.f,{wrapperId:D,children:(0,s.jsx)(n.default,{html:c,className:"post-caption font-normal rich-text-paragraph-regular text-sm mb-2"})}):null,O?null:(0,s.jsx)(Q.A,{postedBy:E.postedBy,scrollMedia:(null==E?void 0:E.media)||[]}),(0,s.jsx)(ea.A,{post:E,postTitle:null==E?void 0:E.postTitle,videos:null==E?void 0:E.videos,resharedVideo:null==E?void 0:E.resharedVideo,metaData:null==E?void 0:E.metaData,showOnlyThumbnail:v}),!O||E.reshared?(0,s.jsx)(F,{metaData:{...E.metaData,reshared:!!(null==E?void 0:E.reshared)},embedType:E.embed||null,postContext:E.context,originalPost:E,mediaCount:(null==E||null==(i=E.media)?void 0:i.length)||0}):null]}),T===j.ji.FOR_YOU&&(null==E?void 0:E.reason)&&P?(0,s.jsx)(ey.A.Gray,{className:"text-xs ml-12 font-normal mb-2",children:(null==E?void 0:E.reason)||"No reason"}):null,v?null:(0,s.jsxs)("div",{className:"w-full pl-12",children:[(0,s.jsxs)("div",{id:"reaction-box",className:"flex cursor-default justify-between gap-4 mob:gap-0 items-center",children:[(0,s.jsxs)("div",{className:"flex justify-between gap-4 mob:gap-4 sm:gap-8 items-center",children:[(0,s.jsx)(V,{postData:E,isReadOnly:w,onCommentClick:p,isFromPostDetailsPage:d}),(0,s.jsx)(el,{data:E,disable:w}),(0,s.jsx)(es,{postData:E,isReadOnly:w,analyticsEventSource:b})]}),(0,s.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,s.jsx)("div",{className:"hidden md:block",children:(0,s.jsx)(N,{post:E})}),f?null:(0,s.jsx)("div",{role:"none",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(ef,{post:E,isReadOnly:w})})]})]}),d||w?null:(0,s.jsx)(eg,{post:E,isReadOnly:w}),d||w?null:(0,s.jsx)(ed,{postId:D,showCommentsSection:x,expandComments:S})]})]})},eN=e=>{let{postData:l,resharedBy:t}=e;return(0,s.jsx)(ej,{...e,postIndicators:(null==t?void 0:t.postedBy)?null:(0,s.jsx)(c,{totalCommentsCount:null==l?void 0:l.commentCount,comments:null==l?void 0:l.comments})})},eC=e=>{var l;let{postData:t,resharedBy:a,removeBottomBorder:n=!1}=e;return(0,s.jsx)(ej,{...e,border:n&&"border-b-0",postIndicators:(null==t||null==(l=t.resharedByList)?void 0:l.length)||(null==a?void 0:a.postedBy)?(0,s.jsx)(et,{resharedBy:null==a?void 0:a.postedBy,resharedByList:null==t?void 0:t.resharedByList,createdAt:null==a?void 0:a.createdAt}):(0,s.jsx)("div",{children:(null==t?void 0:t.isUsersFirstPost)?(0,s.jsx)(m,{}):null})})}}}]);
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.