PageSourceSearch

https://www.theunionsports.com/9133.fe5a3fe262b4bb17.js

js theunionsports.com collected 2026-10-04 06:37:27 UTC 54,347 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkthe_union_gk=self.webpackChunkthe_union_gk||[]).push([[9133],{69133:(Jt,U,l)=>{l.d(U,{b:()=>Ht});var D=l(38023),K=l(65598),P=l(13528),W=l(27969),M=l(88692),N=l(75728),m=l(20092),p=l(59302),B=l(67030),H=l(42384),I=l(22274),n=l(59735),w=l(49371),G=l(36001),$=l(49893),V=l(76492),Z=l(87578),R=l(81037),Y=l(35050),J=l(16852),Q=l(36705),k=l(96630),j=l(98895),z=l(78974),X=l(40774),q=l(35556),tt=l(68977),st=l(871),et=l(99558),F=l(84539),T=l(96993),ot=l(1244),C=l(86370),it=l(53778),at=l(65737),rt=l(62439),v=l(35699),nt=l(67246),ct=l(28141),S=l(26877),lt=l(59792),A=l(11031),pt=l(56732),_t=l(48720),mt=l(94999),ht=l(70221),dt=l(60949),ut=l(22157),gt=l(44689),o=l(64537),ft=l(22864),Pt=l(3942),Et=l(59622),Ct=l(54592),yt=l(50668),Mt=l(76553),kt=l(38182),vt=l(33219),Lt=l(57520),Tt=l(79417),St=l(7741);const xt=["overlay"],bt=["fundContributeModal"],Ot=["giveawayResponse"],It=["giveawayAnswer"];function wt(_,d){if(1&_){const c=o.EpF();o.TgZ(0,"app-post-card",17),o.NdJ("navigateToProfile",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.navigateToProfile(null==s.post||null==s.post.user?null:s.post.user.user_name))})("followUser",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(s.follow?e.followModal(null==s.post?null:s.post.user):e.unfollowModal(null==s.post?null:s.post.user))})("savePost",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.savedPost(s.event,s.pk,s.sk))})("showCollabs",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.showCollabs(s.post))})("blockUser",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.blockUser(s.post))})("reportPost",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.reportPost(s.post))})("seeLessMore",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.seeLessMore(s))})("translationChanged",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.onTranslationChanged(s.item,s.event))})("showInappropriateContent",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.showInappropriateContent(s))})("likePost",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.likePost(s.event,s.sourceItem))})("commentToggle",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.onComments(s.sourceItem))})("sharePost",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.shareModal(s.post))})("sendTip",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.sendTipModal(s.post))})("showLikes",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.showLikes(s.post))})("openSubscription",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.openSubscriptionOptionPopup(s.post,s.index))})("payIndividualPrice",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.payIndividualPrice(s.post,s.index))})("unlockWithNft",function(){o.CHM(c);const s=o.oxw(2);return o.KtG(s.unlockWithNft())})("unlockWithPoints",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.openUnlockWithPointsModal(s.post,s.index))})("openNftModal",function(){o.CHM(c);const s=o.oxw(2);return o.KtG(s.unlockWithNft())})("openPostDetail",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.goToPostDetail(s.sourceItem,s.index))})("pollVote",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.getAnswer(s.item,s.option,s.event))})("contributeNow",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.handleContributeNow(s.post,s.selectedLevelIndex))})("openUrl",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.openUrl(s.post))})("goToDownloadableStore",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.openUrl(s.post))})("joinLivestream",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.goToPostDetail(s.sourceItem,s.index))})("audioStart",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.startAudio(s.post))})("getCommentEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.getCommentEvent(s))})("getReplyCommentEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.getReplyCommentEvent(s))})("commentLikeStatusEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.commentLikeStatusEvent(s))})("commentWithoutImageEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.commentWithoutImageEvent(s))})("commentWithImageEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.commentWithImageEvent(s))})("replyWithoutImageEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.replyWithoutImageEvent(s))})("replyWithImageEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.replyWithImageEvent(s))})("getReplyPagesEmit",function(s){o.CHM(c);const e=o.oxw(2);return o.KtG(e.getReplyPagesEvent(s))}),o.qZA()}if(2&_){const c=d.$implicit,t=d.index,s=o.oxw(2);o.Q6J("post",null==c?null:c.post)("sourceItem",c)("feedType","search")("postIndex",t)("userProfile",s.userProfile)("isWhiteLabelWebsite",s.isWhiteLabelWebsite)("isLikeDisabled",s.isLikeDisabled)("disableShare",s.isForumPost(c))("disableSendTip",s.isForumPost(c))}}function Rt(_,d){if(1&_&&(o.TgZ(0,"div",18),o._UZ(1,"app-circle-background-icon",19),o.TgZ(2,"p"),o._uU(3),o.qZA()()),2&_){const c=o.oxw(2);o.xp6(3),o.Oqu(c.noPostFoundMsg)}}function Ft(_,d){1&_&&o._UZ(0,"app-loader")}function At(_,d){1&_&&o._UZ(0,"app-skyscraper-preview-modal",21),2&_&&o.Q6J("adData",d.$implicit)("isFromHomePage",!0)("from","")}function Ut(_,d){if(1&_&&(o.TgZ(0,"div"),o.YNc(1,At,1,3,"app-skyscraper-preview-modal",20),o.qZA()),2&_){const c=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",c.skyscraperAds)}}function Dt(_,d){if(1&_){const c=o.EpF();o.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"a",11),o.NdJ("click",function(){o.CHM(c);const s=o.oxw();return o.KtG(s.goToBack())}),o._UZ(5,"em",12),o.qZA(),o.TgZ(6,"p")(7,"span"),o._uU(8,"Back"),o.qZA()()(),o.TgZ(9,"div")(10,"p"),o._uU(11),o.qZA()()(),o.TgZ(12,"div"),o.YNc(13,wt,1,9,"app-post-card",13),o.YNc(14,Rt,4,1,"div",14),o.qZA(),o.YNc(15,Ft,1,0,"app-loader",15),o.qZA(),o.TgZ(16,"div",16),o.YNc(17,Ut,2,1,"div",15),o.qZA()()}if(2&_){const c=o.oxw();o.xp6(11),o.hij('Search Results for: "',c.searchText,'"'),o.xp6(2),o.Q6J("ngForOf",c.postList),o.xp6(1),o.Q6J("ngIf",!c.apiCalled&&!c.postList.length),o.xp6(1),o.Q6J("ngIf",c.loadmoreLoader),o.xp6(2),o.Q6J("ngIf",(null==c.skyscraperAds?null:c.skyscraperAds.length)>0)}}function Kt(_,d){1&_&&o._UZ(0,"app-at-tagging-user",22),2&_&&o.Q6J("mentionListTemplate",d.item)}function Wt(_,d){if(1&_){const c=o.EpF();o.TgZ(0,"app-fund-contribute-modal",23,24),o.NdJ("confirmed",function(s){o.CHM(c);const e=o.oxw();return o.KtG(e.onFundContributeConfirmed(s))})("canceled",function(){o.CHM(c);const s=o.oxw();return o.KtG(s.onFundContributeCanceled())}),o.qZA()}}function Nt(_,d){if(1&_){const c=o.EpF();o.TgZ(0,"app-giveaway-answer-modal",25,26),o.NdJ("success",function(){o.CHM(c);const s=o.oxw();return o.KtG(s.giveAwayResponseSubmitted())})("canceled",function(){o.CHM(c);const s=o.oxw();return o.KtG(s.closeGiveawayModal())}),o.qZA()}if(2&_){const c=o.oxw();o.Q6J("giveAwayData",c.giveAwayData)}}function Bt(_,d){if(1&_){const c=o.EpF();o.TgZ(0,"app-giveaway-response-modal",27,28),o.NdJ("canceled",function(){o.CHM(c);const s=o.oxw();return o.KtG(s.closeGiveawayResponseModal())}),o.qZA()}if(2&_){const c=o.oxw();o.Q6J("giveAwayData",c.giveAwayData)}}let Ht=(()=>{const d=class{getEncodedEmail(t){return this.cs.encodeToUTF(t.split("#")[n.Mx.ONE])}constructor(t,s,e,i,a,r,h,g,x,L,E,y,b,Gt,$t,Vt,Zt,Yt){this.router=t,this._location=s,this.ds=e,this.store=i,this.modal=a,this.fb=r,this.mediaService=g,this.engagementService=x,this.authService=L,this.document=E,this.shareDialogService=y,this.modalHandlerService=b,this.mbs=Gt,this.fundraiserService=$t,this.myProfile=Vt,this.isPostCollaborator=Zt,this.ps=Yt,this.postList=[],this.skyscraperAds=[],this.subscriptionList=[],this.onFirstLoad=!0,this.HOME_STRING=C._u,this.createPostType=p.cT,this.feedMessages=C.M3,this.noPostFoundMsg=T.i4.noPostFoundMsg,this.comments=[],this.commentPages={nextPage:n.Mx.ONE,previousPage:n.Mx.ZERO,total:n.Mx.ZERO,totalPages:n.Mx.ZERO,sk:""},this.replyCommentsPages={nextPage:n.Mx.ONE,previousPage:n.Mx.ZERO,total:n.Mx.ZERO,totalPages:n.Mx.ZERO,sk:""},this.fileObject={},this.userProfile={},this.replyComments=[],this.isLikeDisabled=!1,this.isCommentLiked=!1,this.pUserSubscriptionList=[],this.isReplyLoader=!1,this.postTypeKey=
1F.iR,this.taggingUsers=[],this.users=[],this.showReplyInput=!1,this.hashTagList=[],this.Fields=F.Iv,this.LOCKED_POST_MESSAGES=C.mA,this.PERMISSION_TYPE=at.BX,this.permissionKeys=it.S,this.previewImages=[],this.inAppropriateArticleButton={type:"button",label:v.ss.READ_ARTICLE,class:"btn btn-primary"},this.inAppropriateLinkButton={type:"button",label:v.ss.OPEN_URL,class:"btn btn-primary"},this.inAppropriateGiveawayButton={type:"button",label:v.ss.VIEW_GIVEAWAY,class:"btn btn-primary"},this.inAppropriateFundraiserButton={type:"button",label:v.ss.SEE_POST,class:"btn btn-primary"},this.destroy$=new D.x,this.restrictedImages=[],this.currentFundraiserPost=null,this.currentSelectedLevel=null,this.getUrlExtension=this.mediaService.getUrlExtension,this.isWhiteLabelWebsite=this.authService.isWhiteLabelWebsite(),this.giveAwayData=null,this.hasImageMedia=u=>{const f=u?.media_url??u?.media;return!!Array.isArray(f)&&f.some(O=>"image"===this.getUrlExtension(O))},this.hasVideoMedia=u=>{const f=u?.media_url??u?.media;return!!Array.isArray(f)&&f.some(O=>"video"===this.getUrlExtension(O))},this.onMentionUserSelect=u=>(this.setTeggedUsers(u),`@${u.first_name} ${u.last_name} `),this.onMentionHashtagSelect=u=>`#${u?.tag_name?.replaceAll(/\s/g,"")??""} `,this.setTeggedUsers=u=>{const f=Object.assign({user_name:u.user_name,email:u.email,first_name:u.first_name,last_name:u.last_name,profile_pic:u.profile_image_url,pk:u.pk,sk:u.sk});this.taggingUsers=[...this.taggingUsers||[],f]},this.cs=h.get(H.v),this.uploadService=h.get(Q.C),this.apiCallService=h.get(B.F),this.apiCacheService=h.get(gt.G),this.authService=h.get(I.AuthService),this.modalService=h.get(N.tT)}ngOnInit(){const t=this.cs.getWhiteLabelConfiguration();
1t&&(this.whiteLabelConfigData=t.data),this.initCommentForm(),this.initReplyForm(),this.getAllSubscriptionListOfParentUser(),this.searchUsers(),this.getHashTags(),this.cs.isBrowser&&this.getSkyscraperAds()}getAllSubscriptionListOfParentUser(){if(this.authService.isAuthenticated()){let t=`${p.Y9.user_subscribe}?is_white_label=false&hostName=null`;this.whiteLabelConfigData&&(t=`${p.Y9.user_subscribe}?is_white_label=true&hostName=${this.cs.getHostUrl}`),this.apiCallService.get(t,!1).subscribe({next:s=>{s.status&&(this.pUserSubscriptionList=s.data)},error:s=>{this.pUserSubscriptionList=[],this.cs.showErrorMessage(s.message)}})}}onClick(t){if(t.target.classList.value?.includes("clickToNavigate&")){let e=`${t.target.classList.value.split("&")[n.Mx.ONE]}`;this.navigateToUser(e)}else if(t.target.classList.value?.includes("clickToHashTag@#")){const s=t.target.classList.value.split("@#")[n.Mx.ONE];this.router.navigate(["/dashboard/search-result/hashtag",s.trim()])}}initCommentForm(){const t=new m.p4("",[m.kI.required]);this.commentForm=this.fb.group({reply_tag:new m.p4(null),image_url:new m.p4(""),comment:t});const s=this.ds.onSearch(t);this.subscriptionList.push(s)}initReplyForm(){const t=new m.p4("",[m.kI.required]);this.replyForm=this.fb.group({reply_tag:new m.p4(null,[m.kI.required]),image_url:new m.p4(""),forum_user:new m.p4("",[m.kI.required]),comment:t});const s=this.ds.onSearch(t);this.subscriptionList.push(s)}ngOnChanges(t){t&&t.searchText&&t.searchText.currentValue&&(this.searchText=t.searchText.currentValue,this.apiCalled=!0,this.cs.postStatus.value||this.fetchPostList(),this.userProfileSubscription())}ngAfterViewInit(){this.getStoredPost()}getStoredPost(){if(this.cs.postStatus.value){const t=this.cs.postdata.pipe((0,K.q)(n.Mx.ONE)).subscribe(s=>{this.postList=s.posts,setTimeout(()=>{this.cs.isBrowser&&this.document.getElementById(`searched-post-${s?.idx}`).scrollIntoView(),this.cs.setScrolledPostStatus(!1),this.fetchStatusForSelectedPost(s?.idx)},n.Mx.INTERVAL_TWO_THOUSAND)});this.subscriptionList.push(t)}}userProfileSubscription(){const t=this.store.select(Z.SJ).pipe((0,P.R)(this.destroy$)).subscribe(s=>{s&&(this.userProfile=s)});this.subscriptionList.push(t)}goToBack(){this._location.back()}showLoginAlertPopup(){this.modalService.show(w.D,{})}isForumPost(t){return t?.sk?.startsWith("FORUM#POST#")}fetchPostList(t=!1){let s;if(this.loadmoreLoader=t,t){const e=this.cs.encodeToUTF(this.nextPage.pk),i=this.cs.encodeToUTF(this.nextPage.sk);s=`${p.Y9.hashtagPost}${this.cs.encodeToUTF(this.searchText.split(" ").join(""))}&last_evaluated_key_pk=${e}&last_evaluated_key_sk=${i}`}else s=`${p.Y9.hashtagPost}${this.cs.encodeToUTF(this.searchText.split(" ").join(""))}${this.authService.isWhiteLabelWebsite()?"&WhiteLabel="+JSON.parse(this.cs.getValueFromLocalStorage("gsi4pk")):""}`;if(this.whiteLabelConfigData)if(t){const e=this.cs.encodeToUTF(this.nextPage.pk),i=this.cs.encodeToUTF(this.nextPage.sk);s=`${p.Y9.hashtagPost}${this.cs.encodeToUTF(this.searchText.split(" ").join(""))}&WhiteLabel=${this.userProfile?.gsi4pk}&last_evaluated_key_pk=${e}&last_evaluated_key_sk=${i}`}else s=`${p.Y9.hashtagPost}${this.cs.encodeToUTF(this.searchText.split(" ").join(""))}${"&WhiteLabel="+JSON.parse(this.cs.getValueFromLocalStorage("gsi4pk"))}`;this.apiCallService.get(s,!t).subscribe({next:e=>{this.loadmoreLoader=!1,this.apiCalled=!1,e.status?this.handleResponse(e,t):(this.postList=[],this.nextPage=null)},error:e=>{this.loadmoreLoader=!1,this.apiCalled=!1,this.cs.showErrorMessage(e.message)}})}unlockWithNft(){return this.modalService.show(st.s,{backdrop:"static"})}openUnlockWithPointsModal(t,s){this.authService.isAuthenticated()?this.ps.checkDelegateUserPermission((()=>{const i=t?.user?.gsi4pk;if(!(t?.sk&&i&&this.userProfile?.gsi4pk&&t?.loyalty_points))return;const a=this.getCreatorUserForLoyaltyPayment(t),r=this.getPostPlainDescriptionSnippet(t);this.modalService.show(dt.B,{initialState:{headerTitle:this.LOCKED_POST_MESSAGES.UNLOCK_POST_WITH_POINTS_MODAL_HEADER,contentTitle:t?.name||t?.description?.slice?.(0,80)||"",contentDescription:r,pointsCost:t.loyalty_points,creatorId:i,fanId:this.userProfile.gsi4pk,onUnlockSuccess:()=>{this.apiCacheService.clearAllCache(),this.refreshPostLockAfterPointsUnlock(t,s)},creatorUserForPayment:a,loyaltyPointsPurchaseReturnUrl:this.router.url,createLoyaltyPaymentOrder:()=>this.apiCallService.post(p.Y9.subscribeUserPlan,{post_id:t.sk,type:"individual",plan_id:"",plan_user_id:`USER#${i}`,plan_discount:n.Mx.ZERO,user:t?.user,is_loyalty_points_payment:!0},!1).pipe((0,W.U)(h=>({status:h?.status,order_sk:h?.data?.orderSK,message:h?.message})))},class:"modal-dialog-centered unlock-with-points-modal-bs"})}).bind(this)):this.showLoginAlertPopup()}getPostPlainDescriptionSnippet(t){const e=(0,S.gU)(t?.cta_title||t?.description||t?.text||"").trim();return(0,S.Nt)(e,4,280).trim()}getCreatorUserForLoyaltyPayment(t){const s=t?.user,e=s?.gsi4pk;return e?{gsi4pk:e,first_name:s.first_name,last_name:s.last_name,user_name:s.user_name}:null}refreshPostLockAfterPointsUnlock(t,s){const e=t?.user?.gsi4pk;if(!t?.sk||!e)return;const i=p.$_.fetchPostStatus(this.cs.encodeToUTF(t.sk),e);this.apiCallService.get(i,!1).pipe((0,P.R)(this.destroy$)).subscribe({next:a=>{if(!a?.status)return;const r=this.postList[s];!r||r.post?.sk!==t.sk||(r.post.media_url=a.media_url||r.post.media_url,r.post.is_locked=!!a.is_locked,r.post.unlocked_by=r.post.is_locked?null:a.unlocked_by,r.post.lock_status={...r.post.lock_status,is_unlocked:!a.is_locked,unlocked_by:a.unlocked_by,media_url:a.media_url??r.post.lock_status?.media_url},r.post.isSync=!0)},error:()=>{}})}handleResponse(t,s){this.nextPage=t?.LastEvaluatedKey||null,this.postList=s?[...this.postList,...t.data]:t.data,this.postList.forEach(e
1=>{e.post.isComment=!1,e.post.isSync=!1}),this.authService.isAuthenticated()&&this.fetchPostStatus()}onScroll(){this.cs.isBrowser&&(window.innerHeight+window.scrollY+n.Mx.ONE_HUNDRED>=document.body.offsetHeight&&!this.emitted?(this.emitted=!0,this.nextPage&&this.fetchPostList(!0)):window.innerHeight+window.scrollY+n.Mx.ONE_HUNDRED<document.body.offsetHeight&&(this.emitted=!1))}fetchPostStatus(){this.postList.forEach(t=>{t.post.is_locked&&!t.post.isSync&&(t.post.isSync=!0,t.post.media_url=t?.post?.lock_status?.media_url?t?.post?.lock_status?.media_url:t.post.media_url,t.post.is_locked=!t?.post?.lock_status?.is_unlocked,t.post.unlocked_by=t.post.is_locked?null:t?.post?.lock_status?.unlocked_by)})}fetchStatusForSelectedPost(t){this.postList.forEach((s,e)=>{t===e&&s.post.is_locked&&(s.post.isSync=!0,s.post.media_url=s?.post?.lock_status?.media_url?s?.post?.lock_status?.media_url:s.post.media_url,s.post.is_locked=!s?.post?.lock_status?.is_unlocked,s.post.unlocked_by=s.post.is_locked?null:s?.post?.lock_status?.unlocked_by)})}navigateToProfile(t){this.authService.isAuthenticated(),this.router.navigate(["",t])}followModal(t){this.authService.isAuthenticated()?(this.onFirstLoad=!1,this.modalRef=this.modalService.show(G.B,{initialState:{...t,dynamicClass:"follow-modal"},backdrop:"static"}),this.modalRef.onHide.subscribe(()=>{})):this.showLoginAlertPopup()}unfollowModal(t){this.authService.isAuthenticated()?(this.onFirstLoad=!1,this.modalRef=this.modalService.show($.n,{initialState:{...t,dynamicClass:"unfollow-modal"},backdrop:"static"}),this.modalRef.onHide.subscribe(()=>{})):this.showLoginAlertPopup()}savedPost(t,s,e){if(this.authService.isAuthenticated()){const i={creator_user_id:s,post_id:e};t.target.checked?this.savedUserPost(i):this.unsavedUserPost(i)}else t.target.checked=!1,this.showLoginAlertPopup()}savedUserPost(t){this.apiCallService.post(p.Y9.savedPost,t,!0).subscribe({next:s=>{if(s.status){const e=this.postList?.find(i=>i.sk===t?.post_id);e&&(Array.isArray(e.savedPostUserList)||(e.savedPostUserList=[]),e.savedPostUserList.push(t.creator_user_id)),this.refreshPosts()}else this.cs.showErrorMessage(s.message)},error:s=>{this.cs.showErrorMessage(s.message)}})}unsavedUserPost(t){this.apiCallService.delete(p.$_.unSavedPost(this.cs.encodeToUTF(t.post_id)),!0).subscribe({next:s=>{if(s.status){const e=this.postList?.find(i=>i.sk===t?.post_id);if(e&&Array.isArray(e.savedPostUserList)){const i=e.savedPostUserList.findIndex(a=>a===t.creator_user_id);i>=n.Mx.ZERO&&e.savedPostUserList.splice(i,n.Mx.ONE)}this.refreshPosts()}else this.cs.showErrorMessage(s.message)},error:s=>{this.cs.showErrorMessage(s.message)}})}refreshPosts(){this.onFirstLoad=!1}blockUser(t){if(this.authService.isAuthenticated()){const s=Object.assign({first_name:t?.user?.first_name,last_name:t?.user?.last_name,email:t?.user?.email,userId:t?.user?.gsi4pk});this.modalRef=this.modalService.show(j.V,{initialState:s,class:"modal-sm",backdrop:"static"}),this.modalRef.onHidden.subscribe(e=>{"success"===e&&(this.postList=this.postList.filter(i=>i?.post?.user?.email!==t?.post?.user?.email))})}else this.showLoginAlertPopup()}deletePost(t){if(this.authService.isAuthenticated()){const s=this.cs.encodeToUTF(t?.post?.sk),e=this.isForumPost(t?.post)?"forum-post":"post",i=Object.assign({postId:s,type:e,forumUser:this.cs.encodeToUTF(t?.post?.forum_owner)});this.modalRef=this.modalService.show(R.y,{initialState:i,backdrop:"static"}),this.modalRef.onHide.subscribe(a=>{if(!0===a){const r=this.postList.findIndex(h=>h.post.sk===t?.post?.sk);r!==n.Mx.MINUS_ONE&&this.postList.splice(r,n.Mx.ONE)}})}else this.showLoginAlertPopup()}goToPostDetail(t,s){if(this.cs.isBrowser){if(this.mbs.isMobileApp&&t?.post?.type===this.postTypeKey.REEL)return void this.mbs.sendMessage(A.iJ.REELS_MOBILE_FEED,{pk:t.post?.user?.gsi4pk,sk:t.post?.sk,source:A.Ah.HASHTAG});if((1===t?.post?.media?.length||1===t?.post?.media_url?.length)&&window.screen.width<992&&t?.post?.type===this.postTypeKey.VIDEO)return;(t?.post?.media?.length>1||t?.post?.media_url?.length>1||window.screen.width>992||t?.post?.type===this.postTypeKey.REEL||t?.post?.type===this.createPostType.fundraiser||t?.post?.type===this.postTypeKey.ARTICLE)&&(this.authService.isAuthenticated()?(this.savePostInCs(s),t?.sk?.startsWith("FORUM#POST#")?this.cs.navigateToPostDetail("/post/forum",t?.post?.forum_owner?.user_name,t.post.sk,t?.post?.forum_owner?.gsi4pk):this.cs.navigateToPostDetail("/post",t.post?.user?.user_name,t.post.sk,t.post?.user?.gsi4pk)):this.showLoginAlertPopup())}}payIndividualPrice(t,s){this.authService.isAuthenticated()?this.subscribePost({post_id:t.post.sk,type:"individual",plan_id:"",plan_user_id:`USER#${t.post?.user?.gsi4pk}`,amount:t.post?.individual_price,plan_discount:n.Mx.ZERO,user:t?.post?.user},t,s):this.showLoginAlertPopup()}openSubscriptionOptionPopup(t,s){if(this.authService.isAuthenticated()){const e=this.modal.open(Y.o,{modalDialogClass:"modal-sm",backdrop:"static"});e.componentInstance.data={...t.post,label:"Post",subscribedPlan:this.pUserSubscriptionList},e.result.then(i=>{i&&this.subscribePost(i,t,s)}).catch(()=>{})}else this.showLoginAlertPopup()}subscribePost(t,s,e){this.savePostInCs(e),this.apiCallService.post(p.Y9.subscribeUserPlan,t,!0).subscribe({next:i=>{i.status&&(t.plan_name=s.post?.name,this.cs.subscriptionPaymentData.next({...t,orderSK:i?.data?.orderSK,callType:"post"}),this.router.navigate(["dashboard/make-payment"],{queryParams:{redirect:"searchPost",url:this.router.url}}))},error:i=>{this.cs.showErrorMessage(i.message)}})}getAnswer(t,s,e){this.authService.isAuthenticated()?this.pollAnswerLoggedInUser(t,s,e):(e.target.checked=!1,this.showLoginAlertPopup())}pollAnswerLoggedInUser(t,s,e){t.is_locked||t.is_expired?(e.target.checked=!1,this.openUrl(t)):(t.is_expired=!1,t.isSaving=!0,this.apiCallService.put(p.$_.pollAnswer(this.cs.encodeToUTF(t.sk),this.cs.encodeToUTF(t?.user?.gsi4pk)),{option_id:s.id},!1).pipe((0,P.R)(this.destroy$)).subscribe({next:i=>{t.isSaving=!1,i.status?(this.handlePollanswerResponse(t,s),t.is_expired=!0):(e.target.checked=!1,t.is_expired=!1,this.cs.showErrorMessage(i.message))},error:i=>{t.isSaving=!1,e.target.checked=!1,t.is_expired=!1,this.cs.showErrorMessage(i.message)}}))}
1handlePollanswerResponse(t,s){const i=this.cs.getLoggedInUser()?.gsi4pk;this.postList?.forEach(a=>{a.post.sk===t.sk&&(a.post.total_votes=(a.post.total_votes||n.Mx.ZERO)+n.Mx.ONE,a.post.voted_users||(a.post.voted_users=[]),i&&!a.post.voted_users.includes(i)&&a.post.voted_users.push(i),a.post.options.forEach(r=>{r.id===s.id&&(r.count=(r.count||n.Mx.ZERO)+n.Mx.ONE,r.voted_users||(r.voted_users=[]),i&&!r.voted_users.includes(i)&&r.voted_users.push(i))}),a.post.is_expire=!0,this.cs.pollUpdate$.next({postSk:a.post.sk,post:{...a.post}}))})}likePost(t,s){if(this.authService.isAuthenticated()){const e=this.cs.encodeToUTF(s?.post?.sk),i=this.cs.encodeToUTF(s?.post?.user?.gsi4pk);this.isLikeDisabled=!0,this.isForumPost(s?.post)?t.target.checked?this.likeForumPost(t,e,s?.post?.sk):this.deslikeForumPost(t,e,s?.post?.sk):t.target.checked?this.likeUserPost(t,i,e,s?.post?.sk):this.deslikeUserPost(t,i,e,s?.post?.sk)}else t.target.checked=!1,this.showLoginAlertPopup()}likeUserPost(t,s,e,i){this.ds.likeUserPost(s,e,i).then(a=>{a&&(this.isLikeDisabled=!1,this.postList.forEach(r=>{r.post.sk===i&&(r.post.likes_count=r.post.likes_count+n.Mx.ONE)}))}).catch(()=>(this.isLikeDisabled=!1,t.target.checked=!t.target.checked,!1))}deslikeUserPost(t,s,e,i){this.ds.deslikeUserPost(s,e).then(a=>{a&&(this.isLikeDisabled=!1,this.postList.forEach(r=>{r.post.sk===i&&(r.post.likes_count-=n.Mx.ONE)}))}).catch(()=>(this.isLikeDisabled=!1,t.target.checked=!t.target.checked,!1))}likeForumPost(t,s,e){this.apiCallService.put(p.$_.forumLike(this.cs.encodeToUTF(this.userProfile.gsi4pk),s),status,!1).subscribe({next:i=>{i&&(this.isLikeDisabled=!1,this.postList.forEach(a=>{a.post.sk===e&&(a.post.likes_count=a.post.likes_count+n.Mx.ONE)}))},error:()=>(this.isLikeDisabled=!1,t.target.checked=!t.target.checked,!1)})}deslikeForumPost(t,s,e){this.apiCallService.delete(p.$_.forumDislike(this.cs.encodeToUTF(this.userProfile.gsi4pk),s),!1).subscribe({next:i=>{i&&(this.isLikeDisabled=!1,this.postList.forEach(a=>{a.post.sk===e&&(a.post.likes_count-=n.Mx.ONE)}))},error:()=>(this.isLikeDisabled=!1,t.target.checked=!t.target.checked,!1)})}onComments(t){this.authService.isAuthenticated()?(this.commentForm.reset(),this.getComment(t),this.commentForm.get("comment").addValidators([m.kI.required]),this.commentForm.get("comment").updateValueAndValidity(),this.commentForm.get("reply_tag").patchValue(null),this.isCommentLoaderFalse(t?.post?.sk,!t?.post?.isComment)):this.showLoginAlertPopup()}getActiveSearchItem(){return this.postList?.find(t=>t?.post?.isComment)}getCommentEvent(t){const s=t.items,e=this.getActiveSearchItem(),i=this.isForumPost(s)?p.$_.getForumComments(t.encSK,s?.forum_owner?.gsi4pk,t.page):p.$_.getComment(t.encSK,t.page);this.apiCallService.get(i,t.isLoader||!1).subscribe({next:a=>{a.status?(this.cs.getCommentHandling.next({data:a.data,status:!0,items:s,isLoadMore:t.isLoadMore}),e?.post?.sk===s?.sk&&(e.post.comments_count=a?.data?.comments_count)):(this.cs.getCommentHandling.next({status:!1,items:s}),this.cs.showErrorMessage(a.message))},error:a=>{this.cs.getCommentHandling.next({status:!1,items:s}),this.cs.showErrorMessage(a.message)}})}getReplyCommentEvent(t){const s=this.getActiveSearchItem(),e=this.isForumPost(s?.post)?p.$_.replyForumComment(t.commentId):p.$_.replyGetComments(t.commentId);this.apiCallService.get(e,!1).subscribe({next:i=>{i.status?this.cs.getReplyCommentHandling.next({data:i.data,status:!0,commentId:t.commentId,commentKey:t.commentKey}):(this.cs.getReplyCommentHandling.next({status:!1,commentId:t.commentId,commentKey:t.commentKey}),this.cs.showErrorMessage(i.message))},error:i=>{this.cs.getReplyCommentHandling.next({status:!1,commentId:t.commentId,commentKey:t.commentKey}),this.cs.showErrorMessage(i.message)}})}commentLikeStatusEvent(t){const s=this.getActiveSearchItem();let e;e=t.checkbox.target.checked?this.isForumPost(s?.post)?this.apiCallService.put(p.$_.likeForumComment(t.postId,t.commentId),{post_creator_id:s?.post?.user?.email},!1):this.apiCallService.put(p.$_.commentLike(t.postId,t.commentId),{post_creator_id:s?.post?.user?.email},!1):this.isForumPost(s?.post)?this.apiCallService.delete(p.$_.unlikeForumComment(t.postId,t.commentId),!1):this.apiCallService.delete(p.$_.commentUnLike(t.postId,t.commentId),!1),e.subscribe(i=>{i.status?this.cs.commentLikeStatus.next({event:t.checkbox,commentKey:t.commentKey,status:!0}):(this.cs.commentLikeStatus.next({event:t.checkbox,commentKey:t.commentKey,status:!1}),this.cs.showErrorMessage(i.message))},i=>{this.cs.commentLikeStatus.next({event:t.checkbox,commentKey:t.commentKey,status:!1}),this.cs.showErrorMessage(i.message)})}commentWithoutImageEvent(t){const s=this.getActiveSearchItem(),e=s?.post;if(!e)return;const i=this.isForumPost(e)?p.$_.commentOnForumPost(this.getEncodedEmail(e?.pk),t.encSK):p.$_.comment(this.cs.encodeToUTF(e?.user?.gsi4pk),t.encSK);this.apiCallService.put(i,t.formData,!1).subscribe({next:a=>{a.status?(s?.post?.sk===t.sk&&(s.post.comments_count=(s.post.comments_count||0)+n.Mx.ONE),this.cs.commentWithoutImage.next({status:!0,data:a})):(this.cs.commentWithoutImage.next({status:!1,data:a}
1),this.cs.showErrorMessage(a.message))},error:a=>{this.cs.commentWithoutImage.next({status:!1}),this.cs.showErrorMessage(a.message)}})}commentWithImageEvent(t){const s=this.getActiveSearchItem(),e=s?.post;if(!e)return;const i=this.isForumPost(e)?p.$_.commentOnForumPost(this.getEncodedEmail(e?.pk),t.encSK):p.$_.comment(this.cs.encodeToUTF(e?.user?.gsi4pk),t.encSK);this.apiCallService.put(i,t.formData,!1).subscribe({next:a=>{a.status?(s?.post?.sk===t.sk&&(s.post.comments_count=(s.post.comments_count||0)+n.Mx.ONE),this.cs.commentWithImage.next({status:!0,data:a})):(this.cs.commentWithImage.next({status:!1}),this.cs.showErrorMessage(a.message))},error:a=>{this.cs.commentWithImage.next({status:!1}),this.cs.showErrorMessage(a.message)}})}replyWithoutImageEvent(t){const s=this.getActiveSearchItem(),e=s?.post;if(!e)return;const i=this.isForumPost(e)?p.$_.replyOnForumComment(t.encPostId,t.encCommentId):p.$_.replyComments(t.encPostId,t.encCommentId,e?.user?.gsi4pk);this.apiCallService.put(i,t.formData,!1).subscribe({next:a=>{a.status?(s?.post?.sk===t.postSK&&(s.post.comments_count=(s.post.comments_count||n.Mx.ZERO)+Number(n.Mx.ONE)),this.cs.replyWithoutImage.next({status:!0,data:a,postSK:t.postSK,encCommentId:t.encCommentId})):(this.cs.replyWithoutImage.next({status:!1,postSK:t.postSK}),this.cs.showErrorMessage(a.message))},error:a=>{this.cs.replyWithoutImage.next({status:!1,postSK:t.postSK}),this.cs.showErrorMessage(a.message)}})}replyWithImageEvent(t){const s=this.getActiveSearchItem(),e=s?.post;if(!e)return;const i=this.isForumPost(e)?p.$_.replyOnForumComment(t.encPostId,t.encCommentId):p.$_.replyComments(t.encPostId,t.encCommentId,e?.user?.gsi4pk);this.apiCallService.put(i,t.formData,!1).subscribe({next:a=>{a.status?(s?.post?.sk===t.postSK&&(s.post.comments_count=(s.post.comments_count||n.Mx.ZERO)+Number(n.Mx.ONE)),this.cs.replyWithImage.next({status:!0,postSK:t.postSK,data:a,encCommentId:t.encCommentId})):(this.cs.replyWithImage.next({status:!1,postSK:t.postSK,encCommentId:t.encCommentId}),this.cs.showErrorMessage(a.message))},error:a=>{this.cs.replyWithImage.next({status:!1,postSK:t.postSK,encCommentId:t.encCommentId}),this.cs.showErrorMessage(a.message)}})}getReplyPagesEvent(t){const s=this.getActiveSearchItem(),e=this.isForumPost(s?.post)?p.$_.replyForumComment(this.cs.encodeToUTF(t.commentId),t.pageNumber):p.$_.replyGetComments(this.cs.encodeToUTF(t.commentId),t.pageNumber);this.apiCallService.get(e,!1).subscribe({next:i=>{i.status?this.cs.getReplyPages.next({res:i,commentId:t.commentId,status:!0}):(this.cs.getReplyPages.next({res:i,commentId:t.commentId,status:!1}),this.cs.showErrorMessage(i.message))},error:i=>{this.cs.showErrorMessage(i.message)}})}getComment(t){this.comments=[];const s=this.cs.encodeToUTF(t?.post?.sk),e=this.isForumPost(t?.post)?p.$_.getForumComments(s,t?.post?.forum_owner?.gsi4pk):p.$_.getComment(s),i=this.apiCallService.get(e,!0).subscribe({next:a=>{a.status?(this.isCommentLoaderFalse(t?.post?.sk,!1),this.comments.push(...[...a.data.items].reverse()),this.commentPages={nextPage:a.data.nextPage,previousPage:a.data.previousPage,total:a.data.total,totalPages:a.data.totalPages,sk:t?.post?.sk},this.comments.forEach(r=>{r.isReplyLoader=!1}),this.postList?.forEach(r=>{r.sk===t.sk&&(r.post.comments_count=a?.data?.comments_count)})):(this.isCommentLoaderFalse(t?.post?.sk,!1),this.cs.showErrorMessage(a.message))},error:a=>{this.isCommentLoaderFalse(t?.post?.sk,!1),this.cs.showErrorMessage(a.message)}});this.subscriptionList.push(i)}startAudio(t){if(this.authService.isAuthenticated()){if(this.cs.isBrowser){const s=document.getElementsByTagName("audio");for(let e=0,i=s.length;e<i;e++)s[e].src!==t.media_url[n.Mx.ZERO]&&s[e].pause()}this.apiCallService.post(p.Y9.userEngagement,this.engageData(t),!1).subscribe({next:s=>{s.status||this.cs.showErrorMessage(s.message)},error:s=>{this.cs.showErrorMessage(s.message)}})}}engageData(t){return{post_creator_id:t?.user?.gsi4pk,post_id:t?.sk,type:"AudioPlayed"}}shareModal(t){const s=Object.assign({isMyProfile:!1,gsi4pk:t.user?.gsi4pk,otherUserEmail:t.user.email,username:t.user.user_name,firstName:t.user.first_name,lastName:t.user.last_name,pk:t.pk,sk:t.sk,image:t?.media_url?.length?t?.media_url[n.Mx.ZERO]:"",is_private:t?.user?.is_private}),e=this.shareDialogService.openShareDialog(s,{backdrop:"static"});e&&(this.modalRef=e)}sendTipModal(t){if(this.authService.isAuthenticated()){const s=this.modal.open(J.k,{backdrop:"static"});s.componentInstance.data=t,s.componentInstance.loggedInUserData=this.userProfile,s.result.then(e=>{e&&(this.cs.subscriptionPaymentData.next({type:"",post_id:t.sk,plan_id:"",post_user_id:t.user.gsi4pk,comment:e.msg,amount:e.amount,fullName:`${t.user.first_name} ${t.user.last_name}`,profileImg:t.user.profile_image_url,from:"post",currency_symbol:e.currencySymbol,localPrice
1:e.localPrice,exchangeRateUSD:e.exchangeRateUSD,currencyInfo:e.currencyInfo,callType:"tip"}),this.router.navigate(["dashboard/make-payment"],{queryParams:{redirect:"posts",url:"posts/follow"}}))}).catch(()=>{})}else this.showLoginAlertPopup()}isCommentLoaderFalse(t,s){this.postList.forEach(s?e=>{e.post.sk===t?(e.post.isComment=!0,e.post.isCommentLoader=!0):(e.post.isComment=!1,e.post.isCommentLoader=!1)}:e=>{e.post.sk===t&&(e.post.isCommentLoader=!1)})}commentOnPost(t){this.authService.isAuthenticated()?(this.commentForm.get("comment")?.disable(),this.isCommentLoaderFalse(t?.post?.sk,!0),this.cs.setGTag("total-comments","comments"),Object.keys(this.fileObject).length===n.Mx.ZERO?this.commentWithoutImage(t):this.commentWithImage(t)):this.showLoginAlertPopup()}commentWithoutImage(t){const s=this.cs.encodeToUTF(t.post.sk),e=this.getEncodedEmail(t?.post?.pk),i=this.cs.encodeToUTF(t?.post?.user?.gsi4pk),a=this.isForumPost(t?.post)?p.$_.commentOnForumPost(e,s):p.$_.comment(i,s);this.apiCallService.put(a,this.commentForm.getRawValue(),!1).subscribe({next:r=>{this.commentForm.get("comment")?.enable(),r.status?(this.isCommentLoaderFalse(t?.post?.sk,!1),this.setNewComment(r,t?.post?.sk)):(this.isCommentLoaderFalse(t?.post?.sk,!1),this.cs.showErrorMessage(r.message))},error:r=>{this.commentForm.get("comment")?.enable(),this.isCommentLoaderFalse(t?.post?.sk,!1),this.cs.showErrorMessage(r.message)}})}setNewComment(t,s){const e={comment:this.commentForm.value.comment,image_url:this.commentForm.value.image_url,reply_tag:this.commentForm.value.reply_tag,user_tag:t?.data?.user_tag??[],created_at:Date.now(),pk:t.pk,sk:t.sk,user:this.userProfile,is_subscriber:t?.data?.is_subscriber};this.comments.push(e),this.postList.forEach(i=>{i.post.sk===s&&(i.post.comments_count=i.post.comments_count+n.Mx.ONE)}),this.commentForm.reset()}commentWithImage(t){this.restrictedImages=[],this.uploadService.uploadFileData(p.Y9.uploadFile,this.fileObject).pipe((0,P.R)(this.destroy$)).subscribe({next:s=>{const e=t?.post?.sk;if(s.progressStatus===n.Mx.RESTRICTED&&s.restrictedImage)return this.restrictedImages.push(s.restrictedImage),this.isCommentLoaderFalse(e,!1),this.modalHandlerService.showRestrictedContentCarouselModal(this.restrictedImages),void this.commentForm.get("comment")?.enable();if(s.progressStatus===n.Mx.COMPLETED){this.commentForm.patchValue({image_url:s.data});const i=this.cs.encodeToUTF(t?.post?.user?.gsi4pk),a=this.cs.encodeToUTF(t.post.sk),r=this.getEncodedEmail(t?.post?.pk),h=this.isForumPost(t?.post)?p.$_.commentOnForumPost(r,a):p.$_.comment(i,a);this.apiCallService.put(h,this.commentForm.getRawValue(),!1).subscribe({next:g=>{this.commentForm.get("comment")?.enable(),this.isCommentLoaderFalse(e,!1),this.setCommentResponse(g,e,s)},error:g=>{this.commentForm.get("comment")?.enable(),this.isCommentLoaderFalse(e,!1),this.cs.showErrorMessage(g.message)}})}},error:s=>{const e=t?.post?.sk;this.commentForm.get("comment")?.enable(),this.isCommentLoaderFalse(e,!1),s?.statusCode!==T.SM.RESTRICTED_CONTENT&&this.cs.showErrorMessage(k.Vm.SOMETHING_WENT_WRONG)}})}setCommentResponse(t,s,e){t.status?(this.setNewComment(t,s),this.fileObject={},this.commentPreview="",this.commentForm.get("comment").addValidators([m.kI.required]),this.commentForm.get("comment").updateValueAndValidity(),this.replyForm.get("comment").addValidators([m.kI.required]),this.replyForm.get("comment").updateValueAndValidity()):this.cs.showErrorMessage(e.message)}uploadComment(t,s,e=!1){if(e){const i=t?.map(a=>(0,S.qM)(a.uri,a.fileName));this.handleUploadComment(i,s)}else this.handleUploadComment(t.target.files,s)}handleUploadComment(t,s){this.commentForm.get("comment").removeValidators(m.kI.requiredTrue),this.replyForm.get("comment").removeValidators(m.kI.requiredTrue),this.fileObject={};const e=t[n.Mx.ZERO],i=this.cs.isValidFile(e);this.uploadSelectedComment(e,s,i)}uploadSelectedComment(t,s,e){e?("reply"===s?(this.isReplyImage=!0,this.replyForm.get("comment").removeValidators([m.kI.required]),this.replyForm.get("comment").updateValueAndValidity()):(this.isReplyImage=!1,this.commentForm.get("comment").removeValidators([m.kI.required]),this.commentForm.get("comment").updateV
1alueAndValidity()),this.uploadService.uploadImageCompress(t).then(i=>{const a=i,r=new FileReader;r.onload=g=>{this.commentPreview=g.target.result},r.readAsDataURL(a);const h=`${n.Mx.COMMENT+Date.now()}_${this.userProfile?.gsi4pk}_${a.name.toLowerCase().split(" ").join("_")}`;this.fileObject={file:a,fileName:h,folder:n.D4.ProfileFolder}}).catch(()=>{this.cs.showErrorMessage(k.Vm.SOMETHING_WENT_WRONG)})):(this.removePreview(),this.cs.showErrorMessage(k.Vm.INVALID_FILE_TYPE))}removePreview(){this.authService.isAuthenticated()?(this.fileObject={},this.commentPreview="",this.commentForm.get("comment").addValidators([m.kI.required]),this.commentForm.get("comment").updateValueAndValidity(),this.replyForm.get("comment").addValidators([m.kI.required]),this.replyForm.get("comment").updateValueAndValidity()):this.showLoginAlertPopup()}deleteComment(t,s,e,i){if(this.authService.isAuthenticated()){const a=this.cs.encodeToUTF("reply"===t?i.pk:e.pk),r=this.cs.encodeToUTF("reply"===t?i.sk:e.sk),h="reply"===t?this.cs.encodeToUTF(e.pk):void 0,g=this.isForumPost(s)?"reply"===t?"forum-reply":"forum-comment":t,x=Object.assign({email:s.user?.gsi4pk,postId:a,commentId:r,type:g,replyId:h,forumUserEmail:this.cs.encodeToUTF(s?.forum_owner?.email)});this.modalRef=this.modalService.show(R.y,{initialState:x,backdrop:"static"}),this.modalRef.onHide.subscribe(L=>{if(!0===L&&"comment"===t){const E=(e.reply_count??n.Mx.ZERO)+n.Mx.ONE;s.comments_count-=E,s?.comments_count<n.Mx.ZERO&&(s.comments_count=n.Mx.ZERO),this.commentPages.total-=E,this.commentPages?.total<n.Mx.ZERO&&(this.commentPages.total=n.Mx.ZERO);const y=this.comments.findIndex(b=>b.sk===e.sk);this.comments.splice(y,n.Mx.ONE)}else if(!0===L&&"reply"===t){s.comments_count--,s?.comments_count<n.Mx.ZERO&&(s.comments_count=n.Mx.ZERO),e.reply_count--,e?.reply_count<n.Mx.ZERO&&(e.reply_count=n.Mx.ZERO),this.commentPages.total--,this.commentPages?.total<n.Mx.ZERO&&(this.commentPages.total=n.Mx.ZERO);const E=this.replyComments.findIndex(y=>y.sk===i.sk);this.replyComments.splice(E,n.Mx.ONE)}})}else this.showLoginAlertPopup()}showLikes(t){if(this.authService.isAuthenticated()){if(t?.likes_count){const s=this.cs.encodeToUTF(t.sk);this.modalRef=this.modalService.show(X.R,{initialState:s,backdrop:"static",class:"modal-sm"}),this.modalRef.onHidden.subscribe(()=>{})}}else this.showLoginAlertPopup()}onCommentLike(t,s,e){if(this.authService.isAuthenticated()){this.cs.setGTag("comment-likes","commentLike");const i=this.cs.encodeToUTF(e.pk),a=this.cs.encodeToUTF(e.sk);let r;this.isCommentLiked=!0,r=t.target.checked?this.isForumPost(s?.post)?this.apiCallService.put(p.$_.likeForumComment(i,a),{post_creator_id:s?.post?.user?.email},!1):this.apiCallService.put(p.$_.commentLike(i,a),{post_creator_id:s?.post?.user?.email},!1):this.isForumPost(s?.post)?this.apiCallService.delete(p.$_.unlikeForumComment(i,a),!1):this.apiCallService.delete(p.$_.commentUnLike(i,a),!1),this.handleSubscription(r,e.sk,t)}else this.showLoginAlertPopup()}handleSubscription(t,s,e){t.subscribe(i=>{i.status?(this.isCommentLiked=!1,this.comments.forEach(a=>{a.sk===s&&this.handleCommentLikeStatus(e,a)})):(this.isCommentLiked=!1,e.target.checked=!e.target.checked,this.cs.showErrorMessage(i.message))},i=>{this.isCommentLiked=!1,e.target.checked=!e.target.checked,this.cs.showErrorMessage(i.message)})}handleCommentLikeStatus(t,s){t.target.checked?s.likes_count=(s.likes_count||n.Mx.ZERO)+n.Mx.ONE:s?.likes_count>n.Mx.ZERO&&(s.likes_count=(s.likes_count||n.Mx.ZERO)-n.Mx.ONE)}onTaggedUserSelect(t,s,e){if(t?.gsi4pk){const i=s?.get(e);if(i instanceof m.TO){const a=i.value||[];a?.find(h=>h.user_name==t?.user_name)||(a.push({first_name:t?.first_name,last_name:t?.last_name,sk:t?.sk,pk:t?.pk,user_name:t?.user_name,profile_pic:t?.profile_image_url}),i.patchValue(a))}}}searchUsers(){const t=this.ds.atTaggingUsers.subscribe(s=>{this.users=s});this.subscriptionList.push(t)}getHashTags(){this.ds.fetchHashTagList().subscribe(t=>{this.hashTagList=t.data})}checkValue(t){t.value.comment>n.Mx.ONE_THOUSAND&&(t.addValidators(m.kI.requiredTrue),t.get("comment").updateValueAndValidity()),this.taggingUsers.length&&this.taggingUsers.forEac
1h(s=>{if(t.value.comment?.includes(`@${s.first_name} ${s.last_name}`))return!1;{t.patchValue({description:t.value.comment?.replaceAll(`@${s.first_name} ${s.last_name}`,"").replace(/\s{2,}/g," ").trim()});const e=this.taggingUsers?.filter(i=>i.user_name!==s.user_name);return this.taggingUsers=e||[],this.taggingUsers}})}replyComment(t,s,e,i=!1){this.authService.isAuthenticated()?(this.isReplyLoader=!0,this.selectedCommentForReply=s,this.getReplyComments(t,e),this.replyForm.get("comment").addValidators([m.kI.required]),this.replyForm.get("comment").patchValue(`@${s.user?.first_name} ${s.user?.last_name} `),this.replyForm.get("reply_tag").patchValue([{first_name:s.user?.first_name,last_name:s.user?.last_name,email:s.user?.email,user_name:s.user?.user_name,profile_pic:s.user?.profile_image_url,pk:s.user?.pk,sk:s.user?.sk}]),this.replyForm.get("forum_user").patchValue(t?.post?.user?.gsi4pk),this.replyForm.get("comment").updateValueAndValidity(),this.comments.forEach(a=>{a.isReply=a.sk===e}),this.showReplyInput=i):this.showLoginAlertPopup()}getReplyComments(t,s){this.isReplyLoader=!0;const e=this.cs.encodeToUTF(s),i=this.isForumPost(t?.post)?p.$_.replyForumComment(e):p.$_.replyGetComments(e),a=this.apiCallService.get(i,!1).subscribe({next:r=>{r.status?(this.isReplyLoader=!1,this.replyComments=[...r.data.items].reverse(),this.replyCommentsPages={nextPage:r.data.nextPage,previousPage:r.data.previousPage,total:r.data.total,totalPages:r.data.totalPages,sk:s}):(this.isReplyLoader=!1,this.cs.showErrorMessage(r.message))},error:r=>{this.isReplyLoader=!1,this.cs.showErrorMessage(r.message)}});this.subscriptionList.push(a)}onCommentsPages(t){const s=this.cs.encodeToUTF(t?.post?.sk),e=this.commentPages.sk!=t?.post?.sk?n.Mx.ONE:this.commentPages.nextPage,i=this.isForumPost(t?.post)?p.$_.getForumComments(s,t?.post?.forum_owner?.gsi4pk,e):p.$_.getComment(s,e),a=this.apiCallService.get(i,!0).subscribe({next:r=>{r.status?(this.comments.unshift(...[...r.data.items].reverse()),this.commentPages={nextPage:r.data.nextPage,previousPage:r.data.previousPage,total:r.data.total,totalPages:r.data.totalPages,sk:t?.post?.sk}):this.cs.showErrorMessage(r.message)},error:r=>{this.cs.showErrorMessage(r.message)}});this.subscriptionList.push(a)}showCollabs(t){const e=[{first_name:t?.user?.first_name,last_name:t?.user?.last_name,email:t?.user?.email,user_name:t?.user?.user_name,profile_pic:t?.user?.profile_image_url},...t?.collaborating_creatory];this.modalRef=this.modalService.show(q.F,{initialState:e,backdrop:"static",class:"modal-sm"})}reportPost(t){const s=this.isForumPost(t?.post)?"FORUM":"POST";this.reportUserAsInappropiateDialog(s,{post:t},t.user)}reportComment(t,s){const e=this.isForumPost(t?.post)?"FORUM_COMMENT":"COMMENT";this.reportUserAsInappropiateDialog(e,{post:t,comment:s},s.user)}reportReply(t,s,e){const i=this.isForumPost(t?.post)?"FORUM_REPLY":"REPLY";this.reportUserAsInappropiateDialog(i,{post:t,comment:s,reply:e},e.user)}reportUserAsInappropiateDialog(t,s,e){this.authService.isAuthenticated()?this.modalRef=this.modalService.show(z.Q,{initialState:{type:t,data:s,user:e},backdrop:"static"}):this.showLoginAlertPopup()}navigateToUser(t){this.router.navigate([t])}openGiveAwayAnswerModal(t){this.myProfile.transform(t?.user?.gsi4pk)||this.isPostCollaborator.transform(t?.collaborating_creatory)?t.answerCount>0&&(this.giveAwayData=t,this.giveawayResponseModal?.openModal()):t.submitted||(this.giveAwayData=t,this.giveawayAnswerModal?.openModal())}closeGiveawayResponseModal(){this.giveAwayData=null,this.giveawayResponseModal?.closeModal()}closeGiveawayModal(){this.giveawayAnswerModal?.closeModal()}openUrl(t){if(this.authService.isAuthenticated())if(t?.is_locked){const s=Object.assign({data:t,userId:this.userProfile?.email,type:this.cs.navigateToPostDetail("/post",t.user_name,t.sk,t.pk,!1)});this.modalRef=this.modalService.show(tt.G,{initialState:s,class:"modal-sm"})}else{if(t?.type===this.createPostType.giveAway)return void this.openGiveAwayAnswerModal(t);this.cs.openUrl(t.link),this.engagementService.engagementOnOpenURL(t?.user?.gsi4pk,t?.original_sk?t?.original_sk:t?.sk)}else this.showLoginAlertPopup()}replyOnComment(t,s){this.isReplyLoader=!0,this.replyForm.get("comment")?.disable();const e=this.cs.encodeToUTF(s.pk),i=this.cs.encodeToUTF(s.sk);Object.keys(this.fileObject).length===n.Mx.ZERO?this.replyWithoutImage(t,e,i):this.replyWithImage(t,e,i)}replyWithImage(t,s,e){this.restrictedImages=[],this.uploadService.uploadFileData(p.Y9.uploadFile,this.fileObject).pipe((0,P.R)(this.destroy$)).subscribe({next:i=>{const a=t?.post?.sk;if(i.progressStatus===n.Mx.RESTRICTED&&i.restrictedImage)return this.restrictedImages.push(i.restrictedImage),this.isReplyLoader=!1,this.modalHandlerService.showRestrictedContentCarouselModal(this.restrictedImages),void this.replyForm.get("comment")?.enable();if(i.progressStatus===n.Mx.COMPLETED){this.replyForm.patchValue({image_url:i.data});const r=this.isForumPost(t)?p.$_.replyOnForumComment(s,e):p.$_.replyComments(s,e,t?.post?.user?.gsi4pk);this.apiCallService.put(r,this.replyForm.getRawValue(),!0).subscribe({next:h=>{this.replyForm.get("comment")?.enable(),h.status?(this.setReplyComment(h,e,a),this.isReplyLoader=!1,this.fileObject={},this.commentPreview="",this.commentForm.get("comment").addValidators([m.kI.required]),this.commentForm.get("comment").updateV
1alueAndValidity(),this.replyForm.get("comment").addValidators([m.kI.required]),this.replyForm.get("comment").updateValueAndValidity()):(this.isReplyLoader=!1,this.cs.showErrorMessage(h.message))},error:h=>{this.replyForm.get("comment")?.enable(),this.isReplyLoader=!1,this.cs.showErrorMessage(h.message)}})}},error:i=>{this.replyForm.get("comment")?.enable(),this.isReplyLoader=!1,i?.statusCode!==T.SM.RESTRICTED_CONTENT&&this.cs.showErrorMessage(k.Vm.SOMETHING_WENT_WRONG)}})}replyWithoutImage(t,s,e){const i=this.isForumPost(t)?p.$_.replyOnForumComment(s,e):p.$_.replyComments(s,e,t?.post?.user?.gsi4pk);this.apiCallService.put(i,this.replyForm.getRawValue(),!0).subscribe({next:a=>{this.replyForm.get("comment")?.enable(),a.status?(this.isReplyLoader=!1,this.setReplyComment(a,e,t?.post?.sk)):this.cs.showErrorMessage(a.message)},error:a=>{this.replyForm.get("comment")?.enable(),this.isReplyLoader=!1,this.cs.showErrorMessage(a.message)}})}setReplyComment(t,s,e){this.selectedCommentForReply=void 0;const i={comment:this.replyForm.value.comment,image_url:this.replyForm.value.image_url,reply_tag:this.replyForm.value.reply_tag??[],user_tag:t?.data?.user_tag??[],pk:t.pk,sk:t.sk,user:this.userProfile,is_subscriber:t?.data?.is_subscriber};this.comments.filter(a=>{this.cs.encodeToUTF(a.sk)===s&&(a.reply_count=(a.reply_count||n.Mx.ZERO)+n.Mx.ONE)}),this.postList.forEach(a=>{a.sk===e&&(a.comments_count=(a.comments_count||n.Mx.ZERO)+Number(n.Mx.ONE))}),Array.isArray(this.replyComments)||(this.replyComments=[]),this.replyComments.push(i),this.replyForm.reset()}getReplyPages(t,s){this.isReplyLoader=!0;const e=this.replyCommentsPages.sk!=s?n.Mx.ONE:this.replyCommentsPages.nextPage,i=this.isForumPost(t.post)?p.$_.replyForumComment(this.cs.encodeToUTF(s),e):p.$_.replyGetComments(this.cs.encodeToUTF(s),e),a=this.apiCallService.get(i,!1).subscribe({next:r=>{r.status?(this.isReplyLoader=!1,this.replyComments.unshift(...[...r.data.items].reverse()),this.replyCommentsPages={nextPage:r.data.nextPage,previousPage:r.data.previousPage,total:r.data.total,totalPages:r.data.totalPages,sk:s}):(this.isReplyLoader=!1,this.cs.showErrorMessage(r.message))},error:r=>{this.isReplyLoader=!1,this.cs.showErrorMessage(r.message)}});this.subscriptionList.push(a)}seeLessMore(t){this.postList=this.postList.map(s=>s.sk===t.sk&&t?.description?.length?{...s,post:{...s.post,isMore:!s.post.isMore}}:s)}getSkyscraperAds(){this.apiCallService.get(`${p.Y9.getSkyscraperAds}?limit=${n.Mx.ONE}&ad_format=${_t.B.AD_FORMAT_SKYSCRAPER}`,!1).pipe((0,P.R)(this.destroy$)).subscribe({next:s=>{s.status&&s.data?.ads?.length>0&&(this.skyscraperAds=s.data.ads)}})}ngOnDestroy(){this.subscriptionList.forEach(t=>t.unsubscribe()),this.destroy$.next(),this.destroy$.complete()}savePostInCs(t){this.cs.setScrolledPost({idx:t,posts:this.postList}),this.cs.setScrolledPostStatus(!0)}showInappropriateContent(t){t.appropriate_content=!t.appropriate_content}openImagePreview(t){this.previewImages=[],this.previewImages.push({url:t}),this.overlay&&this.overlay.openOverlay()}handleContributeNow(t,s){if(!this.authService.isAuthenticated())return void this.loginDialog();if(!t?.contribution_levels||t.contribution_levels.length===n.Mx.ZERO)return void this.cs.showErrorMessage(C._u.NO_CONTRIBUTION_LEVELS_AVAILABLE);if(null==s||s<n.Mx.ZERO||s>=t.contribution_levels.length)return void this.cs.showErrorMessage(C._u.PLEASE_SELECT_VALID_CONTRIBUTION_LEVEL);const e=t.contribution_levels[s];this.currentFundraiserPost=t,this.currentSelectedLevel=e;const i=this.fundraiserService.generateContributionTitle(e.amount,t.user?.first_name||"",t.user?.last_name||"",e.level_name||e.title||"");this.fundContributeModal&&this.fundContributeModal.openModal(void 0,i)}loginDialog(t){this.modalRef=this.modalService.show(w.D,{initialState:Object.assign({status:t})})}onFundContributeConfirmed(t){!this.currentFundraiserPost||!this.currentSelectedLevel||this.createFundraiserPaymentIntent(this.currentFundraiserPost,this.currentSelectedLevel,t)}onFundContributeCanceled(){this.currentFundraiserPost=null,this.currentSelectedLevel=null,this.fundContributeModal&&this.fundContributeModal.resetProcessing()}createFundraiserPaymentIntent(t,s,e){this.fundraiserService.contributeToFundraiser(t,s,e,()=>{this.fundContributeModal&&(this.fundContributeModal.closeModal(),this.fundContributeModal.resetProcessing())},()=>{this.fundContributeModal&&this.fundContributeModal.resetProcessing()},this.destroy$),this.currentFundraiserPost=null,this.currentSelectedLevel=null}};let _=d;return d.\u0275fac=function(s){return new(s||d)(o.Y36(ft.F0),o.Y36(M.Ye),o.Y36(V.w),o.Y36(Pt.yh),o.Y36(Et.FF),o.Y36(m.QS),o.Y36(o.zs3),o.Y36(et.y),o.Y36(ot.M),o.Y36(I.AuthService),o.Y36(M.K0),o.Y36(nt.h),o.Y36(ct.Y),o.Y36(lt.N),o.Y36(pt.R),o.Y36(mt.F),o.Y36(ht.f),o.Y36(ut.$))},d.\u0275cmp=o.Xpm({type:d,selectors:[["app-searched-post-list"]],viewQuery:function(s,e){if(1&s&&(o.Gf(xt,5),o.Gf(bt,5),o.Gf(Ot,5),o.Gf(
1It,5)),2&s){let i;o.iGM(i=o.CRH())&&(e.overlay=i.first),o.iGM(i=o.CRH())&&(e.fundContributeModal=i.first),o.iGM(i=o.CRH())&&(e.giveawayAnswerModal=i.first),o.iGM(i=o.CRH())&&(e.giveawayResponseModal=i.first)}},hostBindings:function(s,e){1&s&&o.NdJ("click",function(a){return e.onClick(a)})("scroll",function(a){return e.onScroll(a)},!1,o.Jf7)},inputs:{searchText:"searchText"},features:[o.TTD],decls:8,vars:5,consts:[["class","main-content",4,"ngIf"],["mentionListTemplate",""],[3,"images"],["overlay",""],[3,"confirmed","canceled",4,"ngIf"],[3,"giveAwayData","success","canceled",4,"ngIf"],[3,"giveAwayData","canceled",4,"ngIf"],[1,"main-content"],[1,"inner-content"],[1,"inside-header","back-inside-header","justify-content-between","gap-2"],[1,"d-inline-flex","align-items-center"],[3,"click"],[1,"icon-arrow-back"],[3,"post","sourceItem","feedType","postIndex","userProfile","isWhiteLabelWebsite","isLikeDisabled","disableShare","disableSendTip","navigateToProfile","followUser","savePost","showCollabs","blockUser","reportPost","seeLessMore","translationChanged","showInappropriateContent","likePost","commentToggle","sharePost","sendTip","showLikes","openSubscription","payIndividualPrice","unlockWithNft","unlockWithPoints","openNftModal","openPostDetail","pollVote","contributeNow","openUrl","goToDownloadableStore","joinLivestream","audioStart","getCommentEmit","getReplyCommentEmit","commentLikeStatusEmit","commentWithoutImageEmit","commentWithImageEmit","replyWithoutImageEmit","replyWithImageEmit","getReplyPagesEmit",4,"ngFor","ngForOf"],["class","not-found-pane card-not-found",4,"ngIf"],[4,"ngIf"],[1,"sidebar-creator","d-none","d-lg-block"],[3,"post","sourceItem","feedType","postIndex","userProfile","isWhiteLabelWebsite","isLikeDisabled","disableShare","disableSendTip","navigateToProfile","followUser","savePost","showCollabs","blockUser","reportPost","seeLessMore","translationChanged","showInappropriateContent","likePost","commentToggle","sharePost","sendTip","showLikes","openSubscription","payIndividualPrice","unlockWithNft","unlockWithPoints","openNftModal","openPostDetail","pollVote","contributeNow","openUrl","goToDownloadableStore","joinLivestream","audioStart","getCommentEmit","getReplyCommentEmit","commentLikeStatusEmit","commentWithoutImageEmit","commentWithImageEmit","replyWithoutImageEmit","replyWithImageEmit","getReplyPagesEmit"],[1,"not-found-pane","card-not-found"],["icomoonClassName","icon-litefi-ic-illustration"],[3,"adData","isFromHomePage","from",4,"ngFor","ngForOf"],[3,"adData","isFromHomePage","from"],[3,"mentionListTemplate"],[3,"confirmed","canceled"],["fundContributeModal",""],[3,"giveAwayData","success","canceled"],["giveawayResponse",""],[3,"giveAwayData","canceled"],["giveawayAnswer",""]],template:function(s,e){1&s&&(o.YNc(0,Dt,18,5,"div",0),o.YNc(1,Kt,1,1,"ng-template",null,1,o.W1O),o._UZ(3,"app-image-overlay",2,3),o.YNc(5,Wt,2,0,"app-fund-contribute-modal",4),o.YNc(6,Nt,2,1,"app-giveaway-answer-modal",5),o.YNc(7,Bt,2,1,"app-giveaway-response-modal",6)),2&s&&(o.Q6J("ngIf",e.cs.isBrowser),o.xp6(3),o.Q6J("images",e.previewImages),o.xp6(2),o.Q6J("ngIf",e.cs.isBrowser),o.xp6(1),o.Q6J("ngIf",e.cs.isBrowser),o.xp6(1),o.Q6J("ngIf",e.cs.isBrowser))},dependencies:[Ct.a,M.sg,M.O5,rt.e,yt.z,Mt.R,kt.H,vt.k,Lt.i,Tt.N,St.K],styles:[".custom-links[_ngcontent-%COMP%]   .icon-litelock-filled-white-new1[_ngcontent-%COMP%]:before{font-size:22px;color:var(--configButtonTextColor);line-height:0}.icon-liteclock_icon[_ngcontent-%COMP%]{font-size:25px;color:var(--configPostTextColor)!important;background:var(--configBgColor);border-radius:50%;padding:7px}.icon-subsribe[_ngcontent-%COMP%]{color:var(--theme-interactive-link);font-size:16px;margin-top:2px}.profileImage-title[_ngcontent-%COMP%]{display:flex;gap:6px;justify-content:flex-end}.sensitive-content-disclamer[_ngcontent-%COMP%]   .icon-liteicons-close-eye-64[_ngcontent-%COMP%]{margin-bottom:20px;font-size:18px}"]}),_})()}}]);

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.