"use strict";(self.webpackChunkhhgDiscoverV1=self.webpackChunkhhgDiscoverV1||[]).push([[5960],{moTl:function(e,t,i){i.d(t,{J:function(){return TableOfContent}});var o=i("BGKE"),n=i("+OUp"),a=i("rBCA"),l=i("iBNF");let r=(0,a.A)("div",{target:"e16c9ozp0"})("display:flex;flex-wrap:wrap;align-items:center;.organisation{color:",l.w.colors.gray500,";a,a:visited{text-decoration:none;}a[href]{color:",l.w.colors.gray500,";text-decoration:underline;}}--font-weight-lg:",l.w.sizes.fwBold,";--font-weight-md:",l.w.sizes.fwSemiBold,";--font-weight-sm:",l.w.sizes.fwRegular,";&[data-size='lg']{font-size:18px;font-weight:var(--font-weight-lg);line-height:26px;}&[data-size='md']{font-size:16px;font-weight:var(--font-weight-md);line-height:24px;}&[data-size='sm']{font-size:14px;font-weight:var(----font-weight-sm);line-height:22px;}"),c=(0,a.A)("span",{target:"e16c9ozp1"})("p{color:",l.w.colors.gray500,";}"),d=(0,a.A)("a",{target:"e16c9ozp2"})("color:",l.w.colors.secondaryBase,";text-decoration:auto;"),s=(0,a.A)("span",{target:"e16c9ozp3"})("margin:0 0.4em;color:",l.w.colors.neutral300,";"),TableOfContent=e=>{let{className:t,size:i="md",contents:a,separator:l="|",contentClassName:p}=e;return(0,o.Y)(r,{className:t,"data-size":i,children:a.map((e,t)=>e?(0,o.FD)(n.Fragment,{children:[e&&"object"==typeof e&&"label"in e&&"id"in e?(0,o.Y)(d,{href:"#".concat(e.id),className:p,children:e.label}):(0,o.Y)(c,{className:p,children:e}),t+1 *:first-of-type,*/\n > mention:first-of-type ~ *{&:not(ul),&:not(ol){display:inline-block;}}> mention:first-of-type{margin-right:5px;}&.has-see-more{*:last-child{&:not(ul),&:not(ol){display:inline;}}}img{width:100%;height:unset;}ul,ol{display:block;padding-left:1rem;list-style-position:inside;}ol{list-style-type:decimal;}ul{list-style-type:disc;}mention{padding-right:4px;color:#1890ff;:hover{text-decoration:underline;}}}.see-more-text{cursor:pointer;}"),b=(0,o.A)("div",{target:"e1c6pofg13"})("display:flex;justify-content:space-between;padding:14px 16px;.like-comment{display:flex;.action{display:flex;align-items:center;margin-right:24px;color:",a.w.colors.gray800,";text-decoration:none;background:transparent;img{width:24px;height:24px;margin-right:4px;cursor:pointer;}}}.write-comment{display:flex;align-items:center;color:",a.w.colors.primaryActive,";cursor:pointer;font-size:14px;font-weight:bold;line-height:22px;text-decoration:none;img{width:18px;height:18px;}}"),f=(0,o.A)("div",{target:"e1c6pofg14"})("display:inline-block;width:3px;height:3px;margin-bottom:calc(0.5em - 3px);background-color:",a.w.colors.gray400,";border-radius:50%;")},"19xK":function(e,t,i){i.r(t),i.d(t,{EmbeddedCommunity:function(){return EmbeddedCommunity}});var o=i("BGKE"),n=i("+OUp"),a=i("NQBa"),l=i("U+Ez"),r=i("iBNF"),c=i("+YhV"),d=i("ysNr"),s=i("8BcA"),p=i.n(s),m=i("JOt+"),u=i("ROQx"),g=i("LSb+"),h=i("VnHZ"),v=i("imPi"),x=i("tuDO"),b=i("dDsW"),f=i("ECoa"),y=i("bPK4"),w=i("Pvbb"),T=i("AG8C"),Y=i("/GlT"),C=i("n/tb");let CommunityCard=e=>{let{communityInfo:t,isFollowing:i,joinCommunity:a,isLoading:d,isMobile:s,isHome:p=!1}=e,{formatMessage:m}=(0,b.A)(),{state:u}=(0,n.useContext)(h.B),{isLoggedIn:g}=u,{locale:v}=(0,T.$)();return(0,o.Y)(C.Z9,{"data-home":p,style:{position:"relative"},children:t?(0,o.FD)(o.FK,{children:[(0,o.Y)("a",{href:"/community/".concat(null==t?void 0:t.slug),children:(0,o.Y)(C.U9,{"data-home":p,style:{backgroundImage:"url('".concat(encodeURI((s?null==t?void 0:t.mobileCoverImage:null==t?void 0:t.coverImage)||""),"')")},children:(0,o.Y)("div",{className:"thumbnail-container",children:(0,o.Y)("img",{loading:"lazy",className:"thumbnail",src:null==t?void 0:t.thumbnail,alt:t.name})})})}),(0,o.FD)(C.cT,{"data-home":p,children:[(0,o.Y)("a",{href:"/community/".concat(null==t?void 0:t.slug),children:(0,o.Y)(l.H,{tag:"h5",children:null==t?void 0:t.name})}),(0,o.FD)("div",{className:"statictis",children:[(0,o.FD)("div",{className:"statictis-item",children:[(0,o.Y)(c.T,{className:"number",size:"c1",color:r.w.colors.gray800,type:"bold",children:(0,Y.$t)(null==t?void 0:t.topicsCount)}),(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray600,children:m({id:"embedCommunity.card.topics",defaultMessage:"Topics"})})]}),(0,o.FD)("div",{className:"statictis-item",children:[(0,o.Y)(c.T,{className:"number",size:"c1",color:r.w.colors.gray800,type:"bold",children:(0,Y.$t)(null==t?void 0:t.postsCount)}),(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray600,children:m({id:"embedCommunity.card.posts",defaultMessage:"Posts"})})]}),(null==t?void 0:t.membersCount)>=1e3&&(0,o.FD)("div",{className:"statictis-item",children:[(0,o.Y)(c.T,{className:"number",size:"c1",color:r.w.colors.gray800,type:"bold",children:(0,Y.$t)(null==t?void 0:t.membersCount)}),(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray600,children:m({id:"embedCommunity.card.members",defaultMessage:"Members"})})]})]}),i?(0,o.Y)("a",{href:"/community/".concat(null==t?void 0:t.slug),className:"no-replace-click",style:{textDecoration:"none"},children:(0,o.Y)(x.B,{className:"button",size:"md",children:m({id:"together.embed.topicCard.joined",defaultMessage:"You joined"})})}):(0,o.Y)(x.B,{dataEventCategory:"Together",dataEventAction:"Join Community",dataEventLabel:"".concat((0,y.oN)(v),"/community/").concat(null==t?void 0:t.slug),className:"button",size:"md",isDisabled:d,onClick:()=>{g?a():(0,w.YA)("".concat((0,y.oN)(v),"/community/on-boarding/?returnUrl=/").concat(null==t?void 0:t.slug),"communities","embeddedarticle",null==t?void 0:t.slug)},children:m({id:"together.embed.topicCard.joinNow",defaultMessage:"Join now"})})]})]}):(0,o.Y)(f.A,{height:383})})};var N=i("P+HS"),M=i("D7zM"),D=i("moTl"),A=i("/sjq"),E=i("9brV"),S=i("/zZM"),k=i.n(S),z=i("johO"),F=i("rBCA"),P=i("CL9C");let O=(0,F.A)("div",{target:"eleu5sp0"})("position:fixed;left:50%;width:343px;background-color:",r.w.colors.white,";border-radius:",r.w.borderRadius,";box-shadow:0px 0px 4px ",r.w.colors.gray200,";transform:translate(-50%,-50%);transition:all 0.5s ease-in-out;",P.M.mbUp,"{width:450px;}&[data-animation='true']{transition:all 0.5s ease-in-out;}&[data-open='true']{z-index:400;top:50%;opacity:1;visibility:visible;}&[data-open='false']{top:-50%;}.popup-content{position:relative;z-index:111;height:100%;.button-see-more{margin:32px 0;text-align:center;}}.close-button{position:absolute;z-index:100;top:10px;right:10px;cursor:pointer;img{width:100%;height:100%;border-radius:50%;}}.main-info{margin-bottom:32px;background:url(./images/expert-background.svg) no-repeat center top / cover;border-radius:",r.w.borderRadius,";.border-banner{position:absolute;width:100%;height:200px;margin-top:96px;background:#ffffff;border-radius:20px 20px 0px 0px;}.avatar-title{position:relative;width:100%;padding-top:46px;text-align:center;}}"),H=(0,F.A)("div",{target:"eleu5sp1"})("position:fixed;z-index:110;top:0;left:0;width:100%;height:100%;align-items:center;background:rgba(38,38,38,0.3);&[data-open='false']{display:none;}"),_=(0,F.A)("div",{target:"eleu5sp2"})(".image-container{.badge-avatar{position:absolute;right:0;bottom:0;}}display:flex;justify-content:center;padding-bottom:15px;text-align:center;.profile-image{width:100px;height:100px;border-radius:50%;object-fit:cover;}.badge-avatar{width:24px;height:24px;}"),U=(0,F.A)("div",{target:"eleu5sp3"})("position:relative;z-index:9;.specialty{display:flex;flex-wrap:wrap;justify-content:center;}padding:0px 16px;text-align:center;.specialty{justify-content:center;}.experience{padding:0px 15px;text-align:left;}"),I=(0,F.A)("span",{target:"eleu5sp4"})("display:flex;flex-direction:column;justify-content:center;margin:0 0.4em;color:",r.w.colors.neutral300,";"),R=(0,F.A)("div",{target:"eleu5sp5"})("display:inline-block;width:3px;height:3px;margin:0;background-color:",r.w.colors.gray400,";border-radius:50%;"),j=(0,F.A)("div",{target:"eleu5sp6"})("display:flex;margin-top:8px;.bullet-point{width:24px;height:24px;}"),PopupExpert=e=>{let{isOpen:t=!0,onClose:i,enableAnimation:a=!0,expertId:d}=e,{formatMessage:s}=(0,b.A)(),[p,u]=(0,n.useState)(null),[h,v]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(t&&d&&String(null==p?void 0:p.user_id)!==String(d)){v(!0);try{u(null),(0,m.callApiNew)(g.PATHS.EXPERT.GET_EXPERT,{params:{slug:d}}).then(e=>{u(null==e?void 0:e.data)})}catch(e){console.error(e)}v(!1)}},[t,d,null==p?void 0:p.user_id]),(0,o.FD)(o.FK,{children:[(0,o.Y)(O,{"data-open":t,"data-animation":a,onClick:e=>e.stopPropagation(),children:h||!p?(0,o.Y)(z.R,{}):(0,o.FD)("div",{className:"popup-content",children:[(0,o.Y)("div",{className:"close-button",onClick:i,children:(0,o.Y)("img",{src:"/images/closeLight.svg",style:{width:20,height:20},alt:"close-icon",loading:"lazy"})}),(0,o.FD)("div",{className:"main-info",children:[(0,o.Y)("div",{className:"border-banner"}),(0,o.FD)("div",{className:"avatar-title",children:[(0,o.Y)(_,{children:(0,o.Y)("div",{className:"image-container",children:(0,o.FD)("div",{style:{position:"relative"},children:[(0,o.Y)("img",{src:(null==p?void 0:p.avatar)?p.avatar:"/images/avatar-default.png",className:"profile-image",loading:"lazy",alt:"avatar"}),(null==p?void 0:p.role)&&(0,o.Y)("img",{className:"badge-avatar",src:"/images/reviewer-".concat(p.role,".svg"),alt:"badge",loading:"lazy"})]})})}),(0,o.FD)(U,{children:[(0,o.Y)(l.H,{tag:"h3",className:"full-name",children:null==p?void 0:p.display_name}),(0,o.FD)("div",{className:"specialty",children:[(0,o.Y)(c.T,{size:"p4",color:r.w.colors.gray800,children:null==p?void 0:p.specialty}),(0,o.Y)(I,{children:(0,o.Y)(R,{})}),(0,o.Y)(c.T,{size:"p4",className:"organisation",color:r.w.colors.gray500,children:(0,o.Y)("a",{href:null==p?void 0:p.organisation_url,className:"organisation",target:"_blank",children:(0,o.Y)("span",{children:null==p?void 0:p.organisation})})})]})]})]})]}),(0,o.Y)(U,{children:(0,o.FD)("div",{className:"experience",children:[(0,o.Y)(c.T,{type:"bold",size:"p4",color:r.w.colors.gray400,children:s({id:"expert.content.experiences",defaultMessage:"Experiences"}).toUpperCase()}),(0,o.Y)("div",{className:"list-items",children:null!=p&&!!p.experiences&&p.experiences.slice(0,3).map((e,t)=>(0,o.FD)(j,{children:[(0,o.Y)("img",{className:"bullet-point",src:"/svg/bullet-point.svg",alt:"point",loading:"lazy"}),(0,o.FD)("div",{className:"text-contain",children:[(0,o.Y)(l.H,{tag:"h6",color:r.w.colors.gray800,children:(0,o.Y)("span",{dangerouslySetInnerHTML:{__html:(null==e?void 0:e.title)||""}})}),(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray500,dangerouslySetInnerHTML:{__html:(null==e?void 0:e.organization)||""}})]})]},t))})]})}),(0,o.Y)("div",{className:"button-see-more",children:(0,o.Y)(k(),{prefetch:!1,href:(null==p?void 0:p.profile_url)||"#",children:(0,o.Y)(x.B,{size:"lg",color:"secondary",children:s({id:"home.seeMore"})})})})]})}),(0,o.Y)(H,{"data-open":t,onClick:e=>{e.stopPropagation(),i()}})]})};var G=i("S7Sk");let CardPostContent=e=>{let{className:t,style:i,replyingTo:a,mentionedUser:l,description:r,disableShortenContent:c,mentions:d=[],postUrl:s,isMobile:p}=e,{locale:m}=(0,T.$)(),{state:u}=(0,n.useContext)(h.B),{userInfo:g}=u,[v,x]=(0,n.useState)(!1),{formatMessage:f}=(0,b.A)(),[Y,N]=(0,n.useState)(!1),M=(0,G.V5)((0,G.EC)(r||"","display"),d),D=p?70:200,E=(0,n.useMemo)(()=>{let e=(0,G.aj)(M||"");if(c||v)return{showContent:e,hasSeeMore:!1};let t=e.slice(0,D),i=D-((t.match(/<\/div>/g)||[]).length-1)*27,o=(t||"").slice(0,i<40?40:i),n=(0,G.aj)(o.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=n.lengthN(!1),expertId:String(null==l?void 0:l.partnerId)}),(0,o.FD)(C.JV,{className:"".concat(t," no-replace-click"),style:i,children:[S&&(0,o.FD)("span",{onClick:()=>k&&N(!0),className:"post-content-replying",children:["@",S]}),(null==r?void 0:r.startsWith("[mention+id="))&&(0,o.Y)("span",{className:"post-content-replying tag-only",children:"@"}),(0,o.Y)("span",{dangerouslySetInnerHTML:{__html:E.showContent},className:"post-content ".concat(E.hasSeeMore?"has-see-more":"")}),E.hasSeeMore&&!v&&(0,o.FD)("span",{children:["... ",(0,o.Y)("span",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(A.domainLocales[m]).concat(s),onClick:e=>{e.preventDefault(),e.stopPropagation(),(null==g?void 0:g.id)?x(!0):(0,w.YA)("".concat((0,y.at)(m),"/community/on-boarding?return=").concat(encodeURIComponent((s||"").replace("/community",""))),"communities")},className:"see-more-text pointer-event-child-none",children:f({id:"home.seeMore",defaultMessage:"See more"})})]})]})]})},PostCard=e=>{var t,i;let{communityInfo:d,post:s,isMobile:p,isFollowing:m}=e,{state:u}=(0,n.useContext)(h.B),{locale:g}=(0,T.$)(),{formatMessage:v}=(0,b.A)(),{isLoggedIn:x}=u,onClickPost=e=>{e.preventDefault(),x?window.location.href="/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug):E.dX?M.u.getState().triggerLogin({returnUrl:"".concat((0,y.oN)(g),"/community/on-boarding/?returnUrl=/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug,"?source=communities&action=embeddedarticle&campaign=").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug)}):window.location.href=(0,y.gQ)("".concat((0,y.oN)(g),"/community/on-boarding/?returnUrl=/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug,"?source=communities&action=embeddedarticle&campaign=").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug))},w=(null==s?void 0:s.liked)?"".concat(E.Mp,"/comment-heart.svg"):"".concat(E.Mp,"/heart.svg"),Y=m?"".concat(E.nS,"/writePen.svg"):"".concat(E.nS,"/chevronLeftBlue.svg");return(0,o.Y)(C.Z9,{children:s?(0,o.FD)(o.FK,{children:[(0,o.FD)(C.TF,{children:[(0,o.Y)("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(A.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),style:{textDecoration:"none"},className:"pointer-event-child-none",children:(0,o.Y)(C.D1,{children:(0,o.FD)(C.fO,{children:[(0,o.Y)("div",{className:"avatar-container",children:(0,o.Y)(N.Avatar,{radius:"xl",src:null==s?void 0:null===(t=s.author)||void 0===t?void 0:t.avatar,size:40,color:r.w.colors.secondaryBase})}),(0,o.FD)("div",{className:"author-info",children:[(0,o.Y)("div",{className:"author-name",children:(0,o.Y)(c.T,{size:"md",type:"bold",children:null==s?void 0:null===(i=s.author)||void 0===i?void 0:i.name})}),(0,o.Y)("div",{className:"speciality",children:(0,o.Y)(D.J,{size:"md",contents:[(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray500,type:"bold",className:"community-name",children:null==d?void 0:d.name},"1"),(0,o.Y)(c.T,{size:"p3",color:r.w.colors.gray500,className:"create-time",children:null==s?void 0:s.createdTime},"2")],separator:(0,o.Y)(C.kt,{}),className:"position-container"})})]})]})})}),(0,o.FD)("div",{className:"content",children:[(0,o.Y)("a",{href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),style:{textDecoration:"none"},"data-event-category":"Together","data-event-action":"Click Post","data-event-label":"https://".concat(A.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"pointer-event-child-none",children:(0,o.Y)(l.H,{tag:"h6",className:"post-title",children:null==s?void 0:s.title})}),(0,o.Y)(CardPostContent,{className:"post-content-wrapper",description:s.description,disableShortenContent:!1,postUrl:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),isMobile:p,mentions:null==s?void 0:s.mentions})]})]}),(0,o.Y)(a.D,{type:"solid",className:"post-divider"})," ",(0,o.FD)(C.dr,{children:[(0,o.FD)("div",{className:"like-comment",children:[(0,o.FD)("a",{"data-event-category":"Together","data-event-action":"Like Click","data-event-label":"https://".concat(A.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"action action-like pointer-event-child-none",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,o.Y)("img",{loading:"lazy",src:w,alt:"heart-icon"}),null==s?void 0:s.likesCount]}),(0,o.FD)("a",{"data-event-category":"Together","data-event-action":"Comment Icon Click","data-event-label":"https://".concat(A.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"action action-comment",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,o.Y)("img",{loading:"lazy",src:"".concat(E.Mp,"/comment.svg"),alt:"comment-icon"}),null==s?void 0:s.commentsCount]})]}),(0,o.FD)("a",{"data-event-category":"Together","data-event-action":"Comment Text Click","data-event-label":"https://".concat(A.domainLocales[g],"/community/").concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),className:"write-comment pointer-event-child-none",href:"/community/".concat(null==d?void 0:d.slug,"/").concat(null==s?void 0:s.slug),onClick:onClickPost,children:[(0,o.Y)("img",{loading:"lazy",src:Y,alt:"left-chevron"}),v({id:"embedCommunity.card.comment",defaultMessage:"Comment"})]})]})]}):(0,o.Y)(f.A,{height:383})})},TopicCard=e=>{let{communityInfo:t,topics:i,leaveTopic:a,joinTopic:r,isLoading:d,selectedTopic:s,topicShows:p}=e,{state:m}=(0,n.useContext)(h.B),{isLoggedIn:u}=m,{locale:g}=(0,T.$)(),{formatMessage:v}=(0,b.A)();return(0,o.Y)(C.Z9,{children:t?(0,o.FD)(o.FK,{children:[(0,o.Y)(l.H,{tag:"h5",style:{padding:"16px 16px 8px 16px"},children:v({id:"together.embed.topicCard.title",defaultMessage:"{name} Topics"},{name:null==t?void 0:t.name})}),i.slice(0,p).map((e,i)=>(0,o.FD)(C.Zu,{"data-custom":!0,"data-has-followed":null==e?void 0:e.joined,children:[(0,o.FD)("a",{className:"info",href:"/community/".concat(null==t?void 0:t.slug,"/").concat(null==e?void 0:e.slug),children:[(0,o.Y)("img",{loading:"lazy",src:null==e?void 0:e.thumbnail,className:"topic-thumbnail",alt:null==e?void 0:e.name}),(0,o.Y)(c.T,{size:"label2",type:"bold",className:"title",children:null==e?void 0:e.name})]}),(0,o.Y)(x.B,{dataEventCategory:"Together",dataEventAction:"Join Topic",dataEventLabel:"".concat((0,y.oN)(g),"/community/").concat(null==t?void 0:t.slug,"/").concat(null==e?void 0:e.slug),size:"md",color:"tertiary",className:"follow-btn",isDisabled:d&&s===(null==e?void 0:e.id),onClick:()=>{u?(null==e?void 0:e.joined)?a(null==e?void 0:e.id):r(null==e?void 0:e.id):(0,w.YA)("".concat((0,y.oN)(g),"/community/on-boarding/?returnUrl=/").concat(null==t?void 0:t.slug,"/").concat(null==e?void 0:e.slug),"communities","embeddedarticle","".concat(null==t?void 0:t.slug,"/").concat(null==e?void 0:e.slug))},children:(null==e?void 0:e.joined)?(0,o.FD)(o.FK,{children:[(0,o.Y)("img",{loading:"lazy",src:"".concat(E.nS,"/checkLight.svg"),alt:"check-icon"})," ",v({id:"together.embed.topicCard.following",defaultMessage:"Following"})]}):v({id:"together.embed.topicCard.follow",defaultMessage:"Follow"})})]},i)),i.length-p>0&&(0,o.FD)(C.Pe,{"data-event-category":"Together","data-event-action":"Join Topic","data-event-label":"".concat((0,y.oN)(g),"/community/").concat(null==t?void 0:t.slug),href:"/community/".concat(null==t?void 0:t.slug,"/#topic"),className:"pointer-event-child-none",children:[(0,o.Y)(c.T,{size:"p3",children:v({id:"together.embed.topicCard.seeMore",defaultMessage:"See all topics"})}),(0,o.Y)("img",{loading:"lazy",src:"".concat(E.nS,"/chevronRightBlue.svg"),style:{width:"18px",height:"18px"},alt:"chevron-right"})]})]}):(0,o.Y)(f.A,{height:383})})},EmbeddedCommunity=e=>{let{titleMember:t,titleGuest:i,descriptionMember:s,descriptionGuest:x,communityId:b,isMobile:f,columns:y,showSeparatedLine:w=!0,isSpotlightLandingPage:T=!1}=e,{state:Y}=(0,n.useContext)(h.B),{isLoggedIn:N}=Y||{},[M,D]=(0,n.useState)(null),[A,E]=(0,n.useState)([]),[S,k]=(0,n.useState)([]),[z,F]=(0,n.useState)(!1),[P,O]=(0,n.useState)(-1),[H,_]=(0,n.useState)(!1),[U,I]=(0,n.useState)(null),R=f?4:5,fetchCommunityGuest=async()=>{var e,t,i,o;let n=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_COMMUNITY_DETAIL,{params:{communityId:b}},"together"),a=(null==n?void 0:n.data)?(0,u.z1)(null==n?void 0:n.data):{};D(a);let l=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_TOPICS,{params:{communityId:b}},"together");E(((null==l?void 0:null===(t=l.data)||void 0===t?void 0:null===(e=t.topics)||void 0===e?void 0:e.map(e=>(0,u.LW)(e)))||[]).filter(e=>null==e?void 0:e.isActive));let r=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_POST_LIST,{params:{communityId:b,sortBy:"popularity",reportStartDate:p()().subtract(6,"month").format("YYYY-MM-DD"),reportEndDate:p()().format("YYYY-MM-DD"),userType:1}},"together");k((null==r?void 0:null===(o=r.data)||void 0===o?void 0:null===(i=o.posts)||void 0===i?void 0:i.map(e=>(0,u.S3)(e)))||[])},fetchCommunityMember=async()=>{var e,t,i,o;let n=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_COMMUNITY_DETAIL,{params:{communityId:b}},"together"),a=(null==n?void 0:n.data)?(0,u.z1)(null==n?void 0:n.data):{};D(a),F(a.joined);let l=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_TOPICS,{params:{communityId:b}},"together");E(((null==l?void 0:null===(t=l.data)||void 0===t?void 0:null===(e=t.topics)||void 0===e?void 0:e.map(e=>(0,u.LW)(e)))||[]).filter(e=>null==e?void 0:e.isActive));let r=await (0,m.callApiNew)(g.PATHS.TOGETHER.GET_TOGETHER_POST_LIST,{params:{communityId:b,sortBy:"popularity"}},"together");k((null==r?void 0:null===(o=r.data)||void 0===o?void 0:null===(i=o.posts)||void 0===i?void 0:i.map(e=>(0,u.S3)(e)))||[])};(0,n.useEffect)(()=>{N?fetchCommunityMember():fetchCommunityGuest()},[]),(0,n.useEffect)(()=>{v.$.measure(()=>{var e;let t=null===(e=document.getElementsByClassName("embed-community-".concat(b)))||void 0===e?void 0:e[0];(null==t?void 0:t.clientWidth)&&I((null==t?void 0:t.clientWidth)/2+10)})},[f]);let joinCommunity=async()=>{_(!0);let e=await (0,m.callApiNew)(g.PATHS.TOGETHER.POST_TOGETHER_JOIN_COMMUNITY,{method:"POST",data:{ids:[b]}},"together");(null==e?void 0:e.status)===1&&F(!0),_(!1)},joinTopic=async e=>{if(_(!0),O(e),z){let t=await (0,m.callApiNew)(g.PATHS.TOGETHER.POST_TOGETHER_JOIN_TOPIC,{method:"POST",data:{ids:[e]}},"together");(null==t?void 0:t.status)===1&&(fetchCommunityMember(),_(!1))}else{let t=await (0,m.callApiNew)(g.PATHS.TOGETHER.POST_TOGETHER_JOIN_COMMUNITY,{method:"POST",data:{ids:[b]}},"together");if((null==t?void 0:t.status)===1){let t=await (0,m.callApiNew)(g.PATHS.TOGETHER.POST_TOGETHER_JOIN_TOPIC,{method:"POST",data:{ids:[e]}},"together");(null==t?void 0:t.status)===1&&(fetchCommunityMember(),_(!1))}}},leaveTopic=async e=>{_(!0),O(e);let t=await (0,m.callApiNew)(g.PATHS.TOGETHER.POST_TOGETHER_LEAVE_TOPIC,{method:"POST",data:{ids:[e]}},"together");(null==t?void 0:t.status)===1&&(fetchCommunityMember(),_(!1))},j=y||(f?1:2),G=f?283:352,L=y?void 0:U||G;return b?(0,o.FD)(C.Se,{className:"embed-community-".concat(b),children:[w&&(0,o.Y)(a.D,{type:"solid",className:"big-divider"}),T?(0,o.Y)(C.QP,{children:(0,o.Y)("h5",{children:z?t:i})}):(0,o.FD)(o.FK,{children:[(0,o.FD)(C.QP,{children:[(0,o.Y)("div",{className:"line"}),(0,o.Y)(l.H,{tag:"h5",color:r.w.colors.secondaryBase,children:z?t:i})]}),(0,o.Y)(c.T,{size:"md",color:r.w.colors.gray800,style:{marginTop:16},children:z?s:x})]}),(0,o.FD)(C.yR,{"data-custom-columns":void 0!==y,"data-column-count":j,children:[!N&&(0,o.FD)(d.S,{column:j,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!f&&j<3,mode:f?"snapped":"infinity",type:"separated",isArrowShown:!f,customPageWidth:L,children:[(0,o.Y)(CommunityCard,{communityInfo:M,isFollowing:z,isLoading:H,joinCommunity:joinCommunity,isMobile:f}),(0,o.Y)(TopicCard,{communityInfo:M,topics:A,selectedTopic:P,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:H,topicShows:R}),(0,o.Y)(PostCard,{communityInfo:M,isFollowing:z,isMobile:f,post:null==S?void 0:S[0]})]}),N&&!z&&(0,o.FD)(d.S,{column:j,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!f,mode:f?"snapped":"infinity",type:"separated",isArrowShown:!f,customPageWidth:L,children:[(0,o.Y)(CommunityCard,{communityInfo:M,isFollowing:z,isLoading:H,joinCommunity:joinCommunity,isMobile:f}),(0,o.Y)(TopicCard,{communityInfo:M,topics:A,selectedTopic:P,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:H,topicShows:R}),(0,o.Y)(PostCard,{communityInfo:M,isFollowing:z,isMobile:f,post:null==S?void 0:S[0]})]}),N&&z&&(0,o.FD)(d.S,{column:j,row:1,distanceOverlappedLeft:{amount:16,unit:"pixel"},isDotsShown:!f,mode:f?"snapped":"infinity",type:"separated",isArrowShown:!f,customPageWidth:L,children:[(0,o.Y)(PostCard,{communityInfo:M,isFollowing:z,isMobile:f,post:null==S?void 0:S[0]}),(0,o.Y)(PostCard,{communityInfo:M,isFollowing:z,isMobile:f,post:null==S?void 0:S[1]}),(0,o.Y)(TopicCard,{communityInfo:M,topics:A,selectedTopic:P,leaveTopic:leaveTopic,joinTopic:joinTopic,isLoading:H,topicShows:R})]})]}),w&&(0,o.Y)(a.D,{type:"solid",className:"big-divider"})]}):null}}}]);