12 |
- "use strict";(self.webpackChunk_twitter_responsive_web=self.webpackChunk_twitter_responsive_web||[]).push([["shared~ondemand.inlineTombstoneHandler~ondemand.tweetHandler"],{22185:(e,t,o)=>{o.d(t,{ZP:()=>f,Zq:()=>C});o(6886);var n=o(2784),i=o(94407),s=o(25686),r=o(36934),l=o(27519),a=o(12408),c=o(29496),d=o(88990),h=o(73186),u=o(35235),p=o(35131);const _=o.p+"illustration-toxicity-spam.15a7f91a.png";var m=o(60673);const w="Relevant to you",b="All Replies",C=Object.freeze({relevant:"relevant",all:"all"}),g=Object.freeze({relevant:w,all:b}),v={page:"tweet",component:"tweet"};class y extends n.PureComponent{constructor(...e){super(...e),this.state={isReplyDropdownPopover:!1,showReplyDropdownInfo:!1},this._renderReplyDropdownContent=(e,t)=>{const{replyDropdownSelection:o}=this.props,i=e=>n.createElement(r.ZP,{weight:"bold"},e);return n.createElement(n.Fragment,null,n.createElement(r.ZP,{size:"title3",style:k.header,weight:"heavy"},"Sort replies"),n.createElement(n.Fragment,null,n.createElement(l.Z,{actionSubText:"Replies from people you follow and other replies likely to be most interesting to you",actionText:i(w),isSelected:C.relevant===o,onClick:this._createClickHandler(C.relevant,e),selectable:!0,style:k.menuOption}),n.createElement(l.Z,{actionSubText:"All replies, including those that may be potentially spammy, harmful, or offensive",actionText:i(b),isSelected:C.all===o,onClick:this._createClickHandler(C.all,e),selectable:!0,style:k.menuOption}),n.createElement(r.ZP,{color:"link",onClick:this._createInfoClickHandler(t,e),style:k.link,weight:"bold"},"Get more info")))},this._createClickHandler=(e,t)=>()=>{const{changeDropdownState:o}=this.props;o&&(o(e),this._scribe({element:e===C.relevant?"reply_selector_top_replies":"reply_selector_all_replies",action:"select"}),t())},this._createInfoClickHandler=(e,t)=>()=>{this.setState({isReplyDropdownPopover:"popover"===e,showReplyDropdownInfo:!0}),this._scribe({element:"reply_selector_all_replies_more_info",action:"click"}),t()},this._scribe=e=>{const{analytics:t}=this.props;t.scribe({...v,...e})},this._handleScribeReplySortingOpen=()=>{this._scribe({element:"reply_selection_dropdown",action:"click"})},this._handleScribeReplySortingDismiss=()=>{this._scribe({element:"reply_selector",action:"dismiss"})},this._handleReplyDropdownInfoClose=()=>{this.setState({showReplyDropdownInfo:!1}),this._scribe({element:"reply_selector_education_sheet",action:"dismiss"})},this._handleReplyDropdownShown=()=>this._scribe({element:"reply_selection_dropdown",action:"impression"})}componentDidMount(){this._handleReplyDropdownShown()}render(){const{replyDropdownSelection:e}=this.props,{showReplyDropdownInfo:t}=this.state;return n.createElement(s.Z,{style:k.container},n.createElement(a.Z,{onDismiss:this._handleScribeReplySortingDismiss,renderContent:this._renderReplyDropdownContent},n.createElement(c.ZP,{icon:n.createElement(u.Z,{style:k.filterIcon}),onPress:this._handleScribeReplySortingOpen,type:"onMediaWhiteFilled"},g[e],n.createElement(p.Z,{style:k.arrowIcon})),t?this._renderReplyDropdownInfo():null))}_renderReplyDropdownInfo(){const{isReplyDropdownPopover:e}=this.state,t=n.createElement(s.Z,null,n.createElement(r.ZP,{style:e?k.infoPaddingTop32:k.infoPaddingVertical12},"Replies from people you follow and others likely to be most interesting to you will appear first."),n.createElement(r.ZP,{style:e?k.infoPaddingVertical20:k.infoPaddingVertical8},"You can also view other replies, including those that may be potentially spammy, harmful, or offensive."));return n.createElement(d.Z,{actionLabel:"Got it",graphic:({style:e})=>n.createElement(i.Z,{accessibilityLabel:"",source:_,style:e}),graphicDisplayMode:"illustration",headline:b,onAction:this._handleReplyDropdownInfoClose,onClose:this._handleReplyDropdownInfoClose,subtext:t,withCloseButton:!1})}}y.defaultProps={replyDropdownSelection:C.relevant};const k=h.Z.create((e=>({container:{alignItems:"flex-start",marginStart:e.spaces.space16,marginTop:e.spaces.space16},header:{paddingTop:e.spaces.space32,paddingBottom:e.spaces.space16,paddingStart:e.spaces.space32},menuOption:{paddingHorizontal:e.spaces.space32,paddingVertical:e.spaces.space16},link:{paddingStart:e.spaces.space32,paddingBottom:e.spaces.space32},infoPaddingTop32:{paddingTop:e.spaces.space32},infoPaddingVertical12:{paddingVertical:e.spaces.space12},infoPaddingVertical8:{paddingVertical:e.spaces.space8},infoPaddingVertical20:{paddingVertical:e.spaces.space20},filterIcon:{marginEnd:0,paddingEnd:e.spaces.space8},arrowIcon:{paddingStart:e.spaces.space16}}))),f=(0,m.Z)(y,v)},47965:(e,t,o)=>{o.d(t,{Z9:()=>Oe,ZP:()=>Ve});var n=o(7896),i=(o(6886),o(36728),o(14121),o(60523),o(2784)),s=o(25686),r=o(22685),l=o(47701),a=o(22398),c=o(81133),d=o(79404),h=o.n(d),u=o(16587),p=o(32307),_=o(70151),m=o(73036),w=o(75297),b=o(92482),C=o(59311),g=o(29279),v=o(9739),y=o(92187),k=o(23021),f=o(49916),T=o(23301),A=o(45855),D=o(36840),I=o(2422),S=o(76275),E=o(19661),x=o(6614),P=o(60673),R=o(76687),M=o(29170),Z=o(19313),F=o(22185),U=o(10023),L=o(56499),B=o(81010);const H=(0,L.Z)({loader:()=>Promise.all([o.e("shared~bundle.Conversation"),o.e("shared~bundle.MultiAccount~bundle.Birdwatch~bundle.BookmarkFolders~bundle.Communities~ondemand.ComposeSchedul"),o.e("shared~loader.Typeahead~loader.DMDrawer~bundle.AudioSpaceDiscovery~bundle.Communities~bundle.Compose~bundle.R"),o.e("shared~loader.Typeahead~loader.DMDrawer~bundle.Communities~bundle.Compose~bundle.RichTextCompose~bundle.Deleg"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DMRichTextCompose~b"),o.e("shared~loader.DMDrawer~bundle.Birdwatch~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DM"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DMRichTextCompose~l"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DMRichTextCompose~bundle.DirectMessages~b"),o.e("shared~bundle.Compose~bundle.RichTextCompose~bundle.Ocf~bundle.PlainTextCompose"),o.e("shared~bundle.Compose~bundle.RichTextCompose~bundle.PlainTextCompose"),o.e("bundle.PlainTextCompose")]).then(o.bind(o,45181)),renderPlaceholder:(e,t)=>i.createElement(B.Z,{hasError:e,onRetry:t})}),N=(0,L.Z)({loader:()=>Promise.all([o.e("shared~bundle.Conversation"),o.e("shared~loader.AudioDock~loader.DMDrawer~bundle.AudioSpacePeek~bundle.AudioSpaceAnalytics~bundle.AudioSpaceRep"),o.e("shared~bundle.Articles~bundle.AudioSpaceDetail~bundle.AudioSpaceDiscovery~bundle.AudioSpacebarScreen~bundle.B"),o.e("shared~loader.AudioDock~bundle.AudioSpacePeek~bundle.AudioSpaceAnalytics~bundle.AudioSpaceReport~bundle.Birdw"),o.e("shared~bundle.Birdwatch~bundle.Compose~bundle.RichTextCompose~bundle.Settings~bundle.Display~bundle.Ocf~bundl"),o.e("shared~bundle.MultiAccount~bundle.Birdwatch~bundle.BookmarkFolders~bundle.Communities~ondemand.ComposeSchedul"),o.e("shared~loader.Typeahead~loader.DMDrawer~bundle.AudioSpaceDiscovery~bundle.Communities~bundle.Compose~bundle.R"),o.e("shared~loader.Typeahead~loader.DMDrawer~bundle.Communities~bundle.Compose~bundle.RichTextCompose~bundle.Deleg"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DMRichTextCompose~b"),o.e("shared~loader.DMDrawer~bundle.Birdwatch~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DM"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DirectMessages~bundle.DMRichTextCompose~l"),o.e("shared~loader.DMDrawer~bundle.Compose~bundle.RichTextCompose~bundle.DMRichTextCompose~bundle.DirectMessages~b"),o.e("shared~bundle.RichTextCompose~bundle.DMRichTextCompose~bundle.TwitterArticles~ondemand.RichText~ondemand.Twee"),o.e("shared~bundle.Compose~bundle.RichTextCompose~bundle.Ocf~bundle.PlainTextCompose"),o.e("shared~bundle.Compose~bundle.RichTextCompose~bundle.PlainTextCompose"),o.e("shared~bundle.Compose~bundle.RichTextCompose"),o.e("bundle.RichTextCompose")]).then(o.bind(o,16457)),renderPlaceholder:(e,t)=>i.createElement(B.Z,{hasError:e,onRetry:t})});var O=o(44836),V=o(57751),q=o(25494),K=o(23335),z=o(90968),W=o(72599),j=o(46110),G=o(92160),$=o(96702),Q=o(21906),J=o(8038),Y=o(72314),X=o(35555),ee=o(15934),te=o(70083),oe=o(67935),ne=o(24433),ie=o(38926),se=o(99629),re=o(73738),le=o(30102),ae=o(57659);const ce=(e,t)=>(0,X.MW)(e,t.tweetId),de=(e,t)=>t.tweetId,he=(e,t)=>t.contextTweetId,ue=(e,t)=>{const{promotedContent:o,tweetId:n}=t;if(o&&o.advertiser)return ae.ZP.select(e,o.advertiser.id_str);if(o&&q.Z.isPromoted(o)){const{advertiser_name:e}=o;(0,W.ZP)("No advertiser info for non-URT promoted tweet",{extra:{advertiser_name:e,tweetId:n}})}},pe=(e,t)=>t.socialContext,_e=(e,{socialContext:t})=>{const o=t&&t.topicContext;return o?re.Z.select(e,o.topicId):void 0},me=(e,t)=>{const o=le.ZP.createHydratedTweetSelector(de)(e,t);return null!=o&&o.community_id_str?Y.ZP.select(e,null==o?void 0:o.community_id_str):void 0},we=(e,t)=>{const o=le.ZP.createHydratedTweetSelector(de)(e,t),n=null==o?void 0:o.quoted_status,i=null==n?void 0:n.community_id_str;return i?Y.ZP.select(e,i):void 0},be=(e,t)=>"PUSH"===t.history.action,Ce=(e,t)=>(0,M.t5)(e,M.qj),ge=(e,t)=>(0,M.O7)(e,M.qj),ve=(0,G.Z)().propsFromState((()=>({adFreeArticleDomains:$.W$,articleDomains:J.cb,community:me,contextTweet:le.ZP.createHydratedTweetSelector(he),daysSinceDownvoteEducation:ge,displaySensitiveMedia:ne.f1,explicitSocialContext:pe,isForwardNavigation:be,isNsfwUser:ne.EF,isPinned:ce,loggedInUser:ae.ZP.selectLoggedInUser,promotedContentAdvertiser:ue,quoteTweetCommunity:we,shouldShowDownvoteFullscreenEducation:Ce,topic:_e,tweet:le.ZP.createHydratedTweetSelector(de),userCountry:oe.GG,userLanguage:oe.VT}))).adjustStateProps((({adFreeArticleDomains:e,articleDomains:t,community:o,contextTweet:n,daysSinceDownvoteEducation:i,displaySensitiveMedia:s,explicitSocialContext:r,isForwardNavigation:l,isNsfwUser:a,isPinned:c,loggedInUser:d,promotedContentAdvertiser:h,quoteTweetCommunity:u,shouldShowDownvoteFullscreenEducation:p,topic:_,tweet:m,userCountry:w,userLanguage:b})=>{var C,g,v;const y=n?(0,j.D$)(n,null==d?void 0:d.id_str,o):m?(0,j.D$)(m,null==d?void 0:d.id_str,o):void 0,k=null==m||null==(C=m.card)||null==(g=C.binding_values)||null==(v=g.domain)?void 0:v.string_value,f=(0,J.ex)(t,k),T=null==m?void 0:m.quoted_status,A=T?(0,j.D$)(T,null==d?void 0:d.id_str,u):void 0,D=A&&(0,j.rl)(A),I=(0,z.uA)(null==o?void 0:o.role),S=r||y;return{adFreeArticleDomains:e,community:o,contextTweet:n,daysSinceDownvoteEducation:i,displaySensitiveMedia:s,isCardArticle:f,isForwardNavigation:l,isNsfwUser:a,isPinned:c,loggedInUser:d,promotedContentAdvertiser:h,quoteTweetSocialContextProps:D,shouldShowDownvoteFullscreenEducation:p,socialContext:S,socialContextColor:(0,z.J2)(o,S),topic:_,tweet:m,userCountry:w,userLanguage:b,withCommunityModerationAuthority:I}})).propsFromActions((()=>({addFlag:M.pj,addToast:se.fz,block:ae.ZP.block,createLocalApiErrorHandler:(0,K.createLocalApiErrorHandlerWithContextFactory)("TWEET_DETAIL_CONTAINER"),fetchAdFreeToken:$.EC,fetchCommunityIfNeeded:Y.ZP.fetchOneIfNeeded,fetchSettings:ie.wv,fetchTopicIfNeeded:re.Z.fetchOneIfNeeded,loadAdFreeArticleDomainsFromPersistence:$.xs,log:ee.cM,mute:te.r,updateHeadsUp:le.ZP.updateHeadsUp,updateLongformNotesLearnMoreBanner:le.ZP.updateLongformNotesLearnMoreBanner,richScribeAction:Q.richScribeAction,setArticlesVisited:J.Ji,unblock:ae.ZP.unblock,undoTopicNotInterested:re.Z.undoNotInterested,unmute:ae.ZP.unmute}))),ye=(0,L.Z)({loader:()=>o.e("ondemand.DownvoteEducation").then(o.bind(o,75203))});var ke=o(23507),fe=o(73186),Te=o(13286);const Ae=h().c9370e46,De=h().b4e042ba,Ie=h().i859a9d4,Se=fe.Z.create((e=>({root:{borderTopWidth:e.borderWidths.small,borderColor:e.colors.borderColor,borderStyle:"solid"},callout:{margin:e.spaces.space8,width:"auto"}}))),Ee=e=>{const{onAction:t,onClose:o}=e,n=(0,P.z)();i.useEffect((()=>{n.scribe({section:"reply_voting_nux",element:"pre_downvote",action:"impression"})}),[n]);const r=i.createElement(h().I18NFormatMessage,{$i18n:"id9ba4fb"},i.createElement(Te.Z,{accessibilityLabel:De}));return i.createElement(s.Z,{style:Se.root},i.createElement(ke.Z,{action:{label:Ie,link:""},headline:Ae,onAction:t,onClose:o,style:Se.callout,text:r,withCloseButton:!0}))};var xe=o(52820),Pe=o(65526);const Re=h().de21174c,Me=h().haebcf52,Ze=h().i859a9d4,Fe=fe.Z.create((e=>({callout:{marginVertical:e.spaces.space8,marginHorizontal:e.spaces.space16}}))),Ue=()=>{const e=(0,P.z)();return(0,Pe.q)((()=>{e.scribe({element:"left_conversation_banner",action:"impression"})})),i.createElement(s.Z,{style:Fe.callout},i.createElement(ke.Z,{Icon:xe.Z,action:{label:Ze,link:"https://help.twitter.com/using-twitter/mentions-and-replies#mention-control"},headline:Re,text:Me,type:"primary"}))},Le=h().f277e94a,Be=h().da59404c;class He extends i.Component{constructor(...e){var t,o;super(...e),this.state={displayReported:!1,enableKeyboardShortcuts:!1,showDownvoteFullscreenFromInline:!1,replyPressToggle:!1,showBlockOrUnblockConfirmation:!1},this._shouldDisable=U.$y.bind(null,this.context.featureSwitches),this._downvoteEnabled=this.context.featureSwitches.isTrue("rweb_reply_downvote_enabled"),this._isArticleNudgeEnabled=this.context.featureSwitches.isTrue("responsive_web_article_nudge_enabled"),this._isCommunitiesEnabled=this.context.featureSwitches.isTrue("c9s_enabled"),this._hasClaimsForAdFreeArticles=null==(t=this.context.userClaims)?void 0:t.isTrueAndEnabled("subscriptions_feature_1006"),this._conversationHeadsUpFSValue=null==(o=this.context.featureSwitches)?void 0:o.getStringValue("conversational_safety_heads_up_treatment_A_enabled"),this._downvoteNuxDays=this.context.featureSwitches.getNumberValue("rweb_reply_downvote_nux_inline_days"),this._twitterArticleLearnMoreBannerEnabled=this.context.featureSwitches.isTrue("responsive_web_twitter_article_view_enabled"),this._isEditTweetConsumptionEnabled=()=>this.context.featureSwitches.isTrue("responsive_web_edit_tweet_enabled")||this.context.featureSwitches.isTrue("subscriptions_feature_labs_1004"),this._getScribeData=(0,u.Z)(((e,t,o)=>{const n=function(e,t,o){return{...o||{},items:S.Z.addTweetToItems((null==o?void 0:o.items)||[],e,t)}}(e,t,o);return this._cachedScribeData&&(0,p.Z)(n,this._cachedScribeData)||(this._cachedScribeData=n),this._cachedScribeData})),this._renderConversationControlsTooltip=()=>{const{loggedInUserId:e}=this.context,{tweet:t}=this.props;if(!t)return!1;const o=r.Z.getOriginalTweet(t),n=!!o.community_id_str,i=o.user.id_str===e,s=o.reply_count>0;return i&&s&&!o.in_reply_to_status_id_str&&!n},this._renderBlockOrUnblockConfirmationSheet=()=>{const{tweet:e}=this.props;if(!e)return null;const{user:t}=e;return(0,k.ed)({confirmation:(0,k.LI)(t),onClose:this._handleBlockOrUnblockConfirmClose,handleConfirm:this._handleBlockOrUnblockUserConfirm})},this._shouldShowDownvoteInlineEducation=()=>{const{daysSinceDownvoteEducation:e}=this.props;return this._allowDownvoteEducations()&&null!==e&&e>=this._downvoteNuxDays},this._shouldShowDownvoteFullscreenEducation=()=>{const{isForwardNavigation:e,shouldShowDownvoteFullscreenEducation:t}=this.props;return e&&this._allowDownvoteEducations()&&t},this._allowDownvoteEducations=()=>{const{loggedInUser:e,tweet:t}=this.props,o=new Date;o.setDate(o.getDate()-14);const n=e&&new Date(null==e?void 0:e.created_at)<o;return this._downvoteEnabled&&e&&n&&t&&t.reply_count>=10&&!t.self_thread&&!t.softIntervention&&!t.tombstoneInfo},this._getInlineCalloutInfo=()=>{const{analytics:e,displaySensitiveMedia:t,isNsfwUser:o,tweet:n,userCountry:i,userLanguage:s}=this.props,{featureSwitches:r,loggedInUserId:l}=this.context;if(n&&(0,x.pG)({displaySensitiveMedia:t,featureSwitches:r,isNsfwUser:o,loggedInUserId:l,tweet:n,userCountry:i,userLanguage:s}))return(0,x.Mt)(n,e.contextualScribeNamespace,r)},this._handleReplyPress=()=>{this.setState({replyPressToggle:!this.state.replyPressToggle})},this._handleModeratedIconClick=()=>this._scribeAction({element:"moderated_replies_icon",action:"click"}),this._handleModeratedIconShown=()=>this._scribeAction({element:"moderated_replies_icon",action:"impression"}),this._handleBirdwatchNotesIconClick=()=>this._scribeAction({element:"birdwatch_notes_icon",action:"click"}),this._handleBirdwatchNotesIconShown=()=>this._scribeAction({element:"birdwatch_notes_icon",action:"impression"}),this._handleFocus=()=>{this.setState({enableKeyboardShortcuts:!0})},this._handleBlur=()=>{this.setState({enableKeyboardShortcuts:!1})},this._handleShowReportedTweet=()=>{this.setState({displayReported:!0})},this._getShortcutKeyHandlers=()=>{const{onClick:e,shortcutKey:t}=this._getMuteOrUnmuteAction(),{shortcutKey:o}=this._getBlockOrUnblockAction(),{loggedInUserId:n}=this.context,{tweet:i}=this.props;if(!i)return{};const s=i.user.id_str===n;return{...t&&{[t]:e},...o&&!s&&{[o]:this._handleBlockOrUnblockConfirmOpen}}},this._handleBlockOrUnblockConfirmOpen=()=>{this.setState({showBlockOrUnblockConfirmation:!0})},this._handleBlockOrUnblockConfirmClose=()=>{this.setState({showBlockOrUnblockConfirmation:!1})},this._handleBlockOrUnblockUserConfirm=()=>{const{onClick:e}=this._getBlockOrUnblockAction();this._handleBlockOrUnblockConfirmClose(),e&&e()},this._getBlockOrUnblockAction=()=>{const{addToast:e,block:t,contextualBehavioralEventInfo:o,createLocalApiErrorHandler:n,promotedContent:i,tweet:s,unblock:r}=this.props;if(!s)return{};const{user:l}=s,a={addToast:e,behavioralEventEntityToken:null==o?void 0:o.entityToken,createLocalApiErrorHandler:n,scribeAction:({element:e})=>{this._scribeAction({element:e,action:"click"})}};return(0,O.Z)({...a,block:t,unblock:r,user:l,promotedContent:i})},this._getMuteOrUnmuteAction=()=>{const{addToast:e,contextualBehavioralEventInfo:t,createLocalApiErrorHandler:o,mute:n,promotedContent:i,tweet:s,unmute:r}=this.props;if(!s)return{};const{user:l}=s,a={addToast:e,behavioralEventEntityToken:null==t?void 0:t.entityToken,createLocalApiErrorHandler:o,scribeAction:({element:e})=>{this._scribeAction({element:e,action:"click"})}};return(0,V.Z)({...a,mute:n,unmute:r,user:l,promotedContent:i})},this._getRenderCurationActionMenu=(0,u.Z)(((e,t,o,n,s,l,a,c,d,h,u,p,_,m,w,b,C,g)=>()=>!!u&&i.createElement(y.Z,{behavioralEventEntityToken:b,feedbackItems:e,forwardPivotDisplayType:t,isNsfwUser:n,isPinned:s,onDeleteTweet:()=>{const{fromApp:e,usedFallback:t}=l.state||{},n=u&&r.Z.getOriginalTweet(u).isEdited;e&&!t&&!n?o.goBack():o.push("/")},onMenuClick:a,onTweetDismiss:c,onTweetReport:d,promotedContent:h,tweet:u,userCountry:C,userLanguage:g,withChangeConversationControls:p,withChangeConversationControlsTooltip:_,withCommunityModerationAuthority:w,withHideReply:m,withMuteConversation:!0,withViewHiddenReplies:!0}))),this._scribeAction=(e,t,o,n)=>{const{analytics:i,promotedContent:s,richScribeAction:r,tweet:l}=this.props,a=i.contextualScribeNamespace,c=l?S.Z.forTweet(l,s):void 0,d=n?{...c,article_details:{is_ad_free:n}}:c;r({...a,...e},{items:d?[d]:[],...(0,_.Z)(o?{click_tracking_embed_details:o}:null),...t})},this._handleReplyContextClick=(e,t)=>{this._scribeAction({element:"reply_context",action:"click"},{event_value:t})},this._handlePromotedIndicatorClick=()=>{this._handleAsyncPromotedEvent(T.dx.FOOTER_PROFILE)},this._handleQuoteTweetClick=()=>{const{addToast:e,tweet:t}=this.props;if(t){var o;null!=(o=r.Z.getOriginalTweet(t).quoted_status)&&o.isStaleEdit&&this._isEditTweetConsumptionEnabled()&&e({text:Be})}},this._handleMediaClick=()=>{this._scribeAction({element:"platform_photo_card",action:"click"}),this._handleAsyncPromotedEvent(T.dx.EMBEDDED_MEDIA)},this._handleEntityClick=(e,t,o)=>{const{adFreeArticleDomains:n,createLocalApiErrorHandler:i,fetchAdFreeToken:s,tweet:r}=this.props,c=T._4[t],d=I.Z[t],h=S.Z.getClickTrackingEmbedDetails(this.props.promotedContent,o);if(c){const t=c===T.dx.URL_CLICK&&e.currentTarget instanceof window.HTMLElement?{url:e.currentTarget.href}:void 0;this._handleAsyncPromotedEvent(c,t)}t===l.Z.URL&&h&&this._scribeAction({action:a.bQ.CLICK_ID_EMBED},void 0,h);let u=!1;if(this._hasClaimsForAdFreeArticles&&null!=o&&o.expandedUrl){const t=new URL(o.expandedUrl).hostname,[l,a]=new f.p3(s,i()).getAdFreeArticlesClickHandler({destinationUrl:o.embeddedUrl,linkDomain:t,adFreeArticleDomains:n,tweetAuthorUserId:null==r?void 0:r.user.id_str});l&&(a(e),u=!0)}return t===l.Z.INTERACTIVE_HIGHLIGHT&&void 0!==(null==o?void 0:o.id)?this._scribeAction({element:"interactive_text",action:d},{interactive_text_details:{id:o.id}},void 0,u):t===l.Z.INTERACTIVE_CONVERSATION&&void 0!==(null==o?void 0:o.id)?this._scribeAction({element:"interactive_conversation",action:d},{interactive_conversation_details:{id:o.id,original_tweet_id:null==r?void 0:r.id_str}},void 0,u):void(d&&this._scribeAction({action:d},void 0,void 0,u))},this._handlePromotedDisclaimerLearnMoreClick=e=>()=>{this._scribeAction({component:e,element:"learn_more",action:"click"})},this._handlePoliticalSponsorWebsiteClick=()=>{this._scribeAction({component:"political_ad",element:"organization_website",action:"click"})},this._handleAnalyticsClick=()=>{this._scribeAction({element:"analytics",action:"click"})},this._handlePromoteButtonClick=()=>{this._scribeAction({element:"promote",action:"click"})},this._handlePromoteAgainButtonClick=()=>{this._scribeAction({element:"promote_again",action:"click"})},this._handleAvatarClick=()=>{const{tweet:e}=this.props;this._scribeAction({element:"avatar",action:"profile_click"},{profile_id:`${e?e.user.id:""}`}),this._handleAsyncPromotedEvent(T.dx.PROFILE_IMAGE_CLICK)},this._handleScreenNameClick=()=>{const{tweet:e}=this.props;this._scribeAction({element:"user",action:"profile_click"},{profile_id:`${e?e.user.id:""}`}),this._handleAsyncPromotedEvent(T.dx.SCREEN_NAME_CLICK)},this._handleCaretClick=()=>{this._scribeAction({element:"caret",action:"click"})},this._handleCommunityFetch=()=>{const{createLocalApiErrorHandler:e,fetchCommunityIfNeeded:t,tweet:o}=this.props;if(o&&this._isCommunitiesEnabled){var n;const i=o.community_id_str,s=null==(n=o.quoted_status)?void 0:n.community_id_str;i&&t(i).catch(e()),s&&t(s).catch(e())}},this._handleHeadsUpRender=()=>{const{conversationAnnotation:e,tweet:t,updateHeadsUp:o}=this.props;if(!t)return null;const n=r.Z.getOriginalTweet(t),i=(null==n?void 0:n.reply_count)>20;if(!("Political"===(null==e?void 0:e.conversation_annotation_type)&&i))return null;o(n.id_str)},this._handleLongformNotesLearnMoreRender=()=>{const{tweet:e,updateLongformNotesLearnMoreBanner:t}=this.props;if(e){const o=r.Z.getOriginalTweet(e),n=r.Z.hasLongformNoteUrl(o);this._twitterArticleLearnMoreBannerEnabled&&n&&t(o.id_str)}},this._handleTopicFetch=()=>{var e;const{createLocalApiErrorHandler:t,fetchTopicIfNeeded:o,socialContext:n}=this.props,i=null==n||null==(e=n.topicContext)?void 0:e.topicId;i&&o(i).catch(t())},this._handleUndoTopicNotInterested=()=>{const{createLocalApiErrorHandler:e,topic:t,undoTopicNotInterested:o}=this.props;this._scribeAction({element:"topic",action:"un_not_interested"}),t&&o(t.id).catch(e())},this._handleUserFollowIndicator=()=>{this._scribeAction({component:"super_follower_educaton",element:"indicator",action:"click"})},this._handleUserFollowIndicatorDismiss=()=>{this._scribeAction({component:"super_follower_education",action:"dismiss"})},this._handleUserFollowIndicatorLearnMoreClick=()=>{this._scribeAction({component:"super_follower_education",element:"learn_more",action:"click"})},this._handleCardLinkClick=e=>{var t;const{adFreeArticleDomains:o,createLocalApiErrorHandler:n,fetchAdFreeToken:i,isCardArticle:s,setArticlesVisited:r,tweet:l}=this.props;if(this._isArticleNudgeEnabled&&s){var a;const e=null==l||null==(a=l.card)?void 0:a.url;var d;if(e)r(e),this._scribeAction({component:"article_nudge",element:"read_article",action:"click"},{items:[{token:null==l||null==(d=l.card)?void 0:d.url,in_reply_to_tweet_id:null==l?void 0:l.id_str}]})}const h=null==l||null==(t=l.card)?void 0:t.binding_values;if(this._hasClaimsForAdFreeArticles&&h){const[t,s]=new f.p3(i,n()).getAdFreeArticlesClickHandler({destinationUrl:c.Z.getBindingValue(h,"card_url"),linkDomain:c.Z.getBindingValue(h,"domain"),adFreeArticleDomains:o});t&&s(e)}},this._handleLatestEditLinkClick=()=>this._scribeAction({action:"view_edit_history"}),this._handleStaleEditLinkClick=()=>this._scribeAction({action:"view_latest_tweet"}),this._handleVibeClick=()=>{var e,t;const{tweet:o}=this.props;o&&this._scribeAction({element:"vibe_pill",action:"click"},{items:[{id:o.id_str,vibe_details:{vibe_text:null==(e=o.vibe)?void 0:e.text,...null==(t=o.vibe)?void 0:t.annotation}}]})},this._handleMediaHashtagHighlightClick=()=>{this._handleAsyncPromotedEvent(T.dx.HASHTAG_CLICK)},this._handleFetchUserSettings=()=>{this.props.fetchSettings().catch(this.props.createLocalApiErrorHandler())},this._handleReplyFilterInlineCalloutImpression=()=>{this._scribeAction({element:"callout_reply_filter_on",action:"show"})}}componentDidMount(){this._handleTopicFetch(),this._handleCommunityFetch(),this._handleHeadsUpRender(),this._handleLongformNotesLearnMoreRender(),this._hasClaimsForAdFreeArticles&&this.props.loadAdFreeArticleDomainsFromPersistence(),this._fetchUserSettingsTimer=new E.Z(18e5).interval((()=>{this._handleFetchUserSettings()})),this._fetchUserSettingsTimer.start()}componentDidUpdate(e){if(this.props.tweet&&e.tweet&&!e.tweet.user.blocking&&this.props.tweet.user.blocking){const{history:e}=this.props;e.goBack({backLocation:"/"})}this.props.conversationAnnotation!==e.conversationAnnotation&&this._handleHeadsUpRender()}componentWillUnmount(){const{addFlag:e}=this.props;this._shouldShowDownvoteInlineEducation()&&e(M.qj,{updateTimestamp:!0}),this._fetchUserSettingsTimer&&this._fetchUserSettingsTimer.stop()}render(){const{loggedInUserId:e}=this.context,{tweet:t}=this.props;if(!t)return null;const o=t.user.id_str===e,n=(0,C.j)(t.withheld_scope),r=(0,D.G$)(t)&&!this.state.displayReported;return i.createElement(i.Fragment,null,n?i.createElement(s.Z,null,this._renderWithheldTweet(),o?this._renderTweetComponent():null):r?this._renderReportedTombstone():this._renderTweetComponent(),this._renderIntentPrompt(),this.state.showBlockOrUnblockConfirmation&&!o?this._renderBlockOrUnblockConfirmationSheet():null)}_renderIntentPrompt(){const{forwardPivotInfo:e,history:t,nudges:o,tweet:n}=this.props;if(n&&t.location.pathname.indexOf("/intent/")>-1)return i.createElement(g.Z,{forwardPivotInfo:e,history:t,location:t.location,nudges:o,tweetId:n.id_str})}_renderTweetComponent(){var e,t;const{allowDownvote:o,analytics:s,changeDropdownState:l,contextTweet:a,contextualBehavioralEventInfo:c,conversationAnnotation:d,feedbackItems:h,forwardPivotInfo:u,hasModeratedReplies:p,history:_,innerForwardPivotInfo:m,innerNudges:C,isNsfwUser:g,isPinned:v,location:y,loggedInUser:k,nudges:f,onTweetDismiss:T,onTweetReport:D,promotedContent:I,promotedContentAdvertiser:S,quoteTweetSocialContextProps:E,quotedTweetTombstoneInfo:x,readerModeAvailable:P,replyBadge:R,replyDropdownSelection:M,rootTweetAuthorId:Z,showReplyFilterInlineCallout:U,socialContext:L,socialContextColor:B,topic:H,topicFollowPrompt:N,tweet:O,userCountry:V,userLanguage:q,withActions:K,withCommunityModerationAuthority:z,withHideReply:W,withInlineMedia:j,withSocialContext:G}=this.props;if(!O)return null;const{loggedInUserId:$}=this.context,{enableKeyboardShortcuts:Q}=this.state,J=r.Z.getOriginalTweet(O),Y={allowDownvote:o,contextTweet:a,enableKeyboardShortcuts:Q,forwardPivotInfo:u,hasModeratedReplies:p,handleReplyFilterInlineCalloutImpression:this._handleReplyFilterInlineCalloutImpression,showReplyFilterInlineCallout:U,innerForwardPivotInfo:m,loggedInUser:k,promotedContent:I,promotedContentAdvertiser:S,quotedTweetTombstoneInfo:x,quoteTweetSocialContextProps:E,readerModeAvailable:P,socialContext:L,socialContextColor:B,topic:H,topicFollowPrompt:N,tweet:O,replyBadge:R,rootTweetAuthorId:Z,withActions:K,withInlineMedia:j,withSocialContext:G,nudges:f,innerNudges:C,withDeviceFollow:!$&&this.context.featureSwitches.isTrue("responsive_web_logged_out_device_follow_is_enabled_on_tdp")},X=J.user.id_str===$,ee=!J.in_reply_to_status_id_str&&X&&!J.community_id_str,te=this._renderConversationControlsTooltip(),oe=!!J.in_reply_to_status_id_str,ne=(null==J?void 0:J.reply_count)>20,ie="Political"===(null==d?void 0:d.conversation_annotation_type)&&(null==(e=O.headsUp)?void 0:e.showBanner)&&!oe&&ne,se=null==(t=J.longformNotesLearnMore)?void 0:t.showBanner,re=this.context.featureSwitches.isTrue("responsive_web_deamplification_replies_dropdown_selector_enabled")&&O.reply_count>0;return i.createElement(A.nO,{data:this._getScribeData(O.retweeted_status||O,I,s.contextualScribeData)},i.createElement(w.Z,{enabled:!!Q,handlers:this._getShortcutKeyHandlers()},this._renderLeftConversationBanner(),i.createElement(b.Z,(0,n.Z)({},Y,{inlineCalloutInfo:this._getInlineCalloutInfo(),isFocal:!0,onAnalyticsClick:this._handleAnalyticsClick,onAvatarClick:this._handleAvatarClick,onBirdwatchNotesIconClick:this._handleBirdwatchNotesIconClick,onBirdwatchNotesIconShown:this._handleBirdwatchNotesIconShown,onBlur:this._handleBlur,onCardLinkClick:this._handleCardLinkClick,onEntityClick:this._handleEntityClick,onFocus:this._handleFocus,onLatestEditLinkClick:this._handleLatestEditLinkClick,onMediaClick:this._handleMediaClick,onMediaHashtagHighlightClick:this._handleMediaHashtagHighlightClick,onModeratedIconClick:this._handleModeratedIconClick,onModeratedIconShown:this._handleModeratedIconShown,onPoliticalSponsorWebsiteClick:this._handlePoliticalSponsorWebsiteClick,onPromoteAgainButtonClick:this._handlePromoteAgainButtonClick,onPromoteButtonClick:this._handlePromoteButtonClick,onPromotedDisclaimerLearnMoreClick:this._handlePromotedDisclaimerLearnMoreClick,onPromotedIndicatorClick:this._handlePromotedIndicatorClick,onQuoteTweetClick:this._handleQuoteTweetClick,onReplyContextClick:this._handleReplyContextClick,onReplyPress:this._handleReplyPress,onScreenNameClick:this._handleScreenNameClick,onStaleEditLinkClick:this._handleStaleEditLinkClick,onUndoTopicNotInterestedClick:this._handleUndoTopicNotInterested,onUserFollowIndicatorClick:this._handleUserFollowIndicator,onUserFollowIndicatorDismissClick:this._handleUserFollowIndicatorDismiss,onUserFollowIndicatorLearnMoreClick:this._handleUserFollowIndicatorLearnMoreClick,onVibeClick:this._handleVibeClick,renderCurationActionMenu:this._getRenderCurationActionMenu(h,null==u?void 0:u.displayType,_,g,v,y,this._handleCaretClick,T,D,I,r.Z.getOriginalTweet(O),ee,te,W,z,null==c?void 0:c.entityToken,V,q),showConversationHeadsUp:ie,showLongformNotesLearnMoreBanner:se})),re?i.createElement(F.ZP,{changeDropdownState:l,replyDropdownSelection:M}):null,this._renderInlineReply(),this._renderDownvoteEducation()))}_renderLeftConversationBanner(){var e;const{tweet:t}=this.props,{loggedInUserId:o}=this.context;return(null==t||null==(e=t.unmentioned_user_ids)?void 0:e.includes(o))?i.createElement(Ue,null):null}_renderDownvoteEducation(){const{addFlag:e}=this.props,{showDownvoteFullscreenFromInline:t}=this.state;return i.createElement(i.Fragment,null,t||this._shouldShowDownvoteFullscreenEducation()?i.createElement(ye,{onDismiss:()=>{t?this.setState({showDownvoteFullscreenFromInline:!1}):e(M.qj)}}):null,this._shouldShowDownvoteInlineEducation()?i.createElement(Ee,{onAction:()=>{this.setState({showDownvoteFullscreenFromInline:!0})},onClose:()=>{e(M.qj,{updateTimestamp:!0})}}):null)}_renderInlineReply(){const{history:e,location:t,tweet:o,tweetId:n}=this.props,{replyPressToggle:s}=this.state,{loggedInUserId:r}=this.context;if(!o)return null;const l=r&&!this._shouldDisable(o,U.d.Reply),a=m.ZP.isMobileOS()?H:N;return l?i.createElement(a,{history:e,location:t,parentTweetId:n,replyPressToggle:s}):null}_renderWithheldTweet(){const{tweet:e}=this.props;return!!e&&i.createElement(C.Z,{displayTextRange:e.display_text_range,entities:e.withheld_entities||e.entities,lang:e.lang,text:e.withheld_text||e.text})}_renderReportedTombstone(){const{tweet:e}=this.props;if(e){const t=r.Z.getOriginalTweet(e),o=(0,D.jD)(t.reportingVisibility);return i.createElement(v.Z,{actionText:Le,lang:e.lang,onClick:this._handleShowReportedTweet},o)}}_handleAsyncPromotedEvent(e,t){const{createLocalApiErrorHandler:o,log:n,promotedContent:i,tweet:s}=this.props;if(s&&i){const{disclosure_type:r,impression_id:l}=i;n({disclosureType:r,itemId:s.id_str,itemType:"tweet",params:{event:e,impression_id:l,...t}}).catch(o())}}}He.contextType=Z.rC;const Ne=(0,R.ZP)(ve(He)),Oe=(0,P.Z)(Ne),Ve=(0,P.Z)(Ne,{component:"tweet"})},35235:(e,t,o)=>{o.d(t,{Z:()=>l});var n=o(2784),i=o(90601),s=o(73569);const r=(e={})=>(0,i.Z)("svg",{...e,accessibilityRole:e.accessibilityLabel?e.accessibilityRole||"img":void 0,accessibilityHidden:void 0===e.accessibilityLabel,style:[s.Z.root,e.style],viewBox:"0 0 24 24",children:n.createElement("g",null,n.createElement("path",{d:"M14 6V3h2v8h-2V8H3V6h11zm7 2h-3.5V6H21v2zM8 16v-3h2v8H8v-3H3v-2h5zm13 2h-9.5v-2H21v2z"}))});r.metadata={width:24,height:24};const l=r}}]);
- //# sourceMappingURL=https://ton.local.twitter.com/responsive-web-internal/sourcemaps/client-web/shared~ondemand.inlineTombstoneHandler~ondemand.tweetHandler.c6bc8f2a.js.map
|