").html(e).find(this.attr.streamItemSelector).toArray().map(function(e){return t("
").append(e).html()})},this.saveLatentItems=function(t,e){var i=this.select("containerSelector");i.attr("data-latent-items",this.latentItems.join("")),i.attr("data-latent-count",this.latentCount)},this.resetLatentItems=function(){var t=this.select("containerSelector"),e=t.attr("data-latent-items");t.removeAttr("data-latent-items"),this.latentItems=this.htmlToItemArray(e),this.latentCount=parseInt(t.attr("data-latent-count"),10)||0,t.removeAttr("data-latent-count")},this.refreshOnNavigate=function(t,e){(this.isPollingStopped||e.fromCache&&this.attr.refreshOnReturn)&&this.trigger("uiTimelineShouldRefresh",{navigated:!0})},this.refreshAndSelectTopTweet=function(t,e){this.trigger("uiTimelineShouldRefresh",{injectImmediately:!0,selectTopTweet:!0,getInitial:this.shouldGetInitialTimeline})},this.injectComposedTweet=function(e,i){if(!i.in_reply_to_status_id&&i.tweet_html){this.injectNewItems();var s=t(i.tweet_html).filter(this.attr.streamItemSelector).first().attr("data-item-id");this.$node.find(".original-tweet[data-tweet-id='"+s+"']:first").length||(this.latentItems=this.htmlToItemArray(i.tweet_html),this.injectNewItems(null,{wasComposedTweet:"dataTweetSuccess"===e.type}),this.composedThenInjectedTweetIds[i.tweet_id]=window.location.href)}},this.refreshAndInjectImmediately=function(t,e){this.trigger("uiTimelineShouldRefresh",{injectImmediately:!0,selectTopTweet:1===this.$selected.length,getInitial:this.shouldGetInitialTimeline})},this.resetCacheOfComposedInjectedTweets=function(t,e){this.composedThenInjectedTweetIds=c={}},this.addPageCount=function(t,e){this.latentCount&&this.trigger("uiAddPageCount",{count:this.latentCount})},this.after("initialize",function(){var t=this;this.latentItems=[],this.latentCount=0,this.isPollingStopped=!1,this.timelineCacheTTLTimer=null,this.shouldGetInitialTimeline=!1,this.composedThenInjectedTweetIds=c,this.resetLatentItems(),this.injectNewItems(null,{wasPushStateInjection:!0}),this.on("uiInjectNewItems",this.injectNewItems),this.on(document,"uiTimelineShouldRefresh",this.getNewItems),this.on(document,"uiBeforePageChanged",function(){t.isPollingStopped?t.resetLatentItems():t.saveLatentItems()}),this.on(document,"uiPageChanged",this.refreshOnNavigate),this.on(document,"uiGotoTopOfScreen",this.refreshAndInjectImmediately),this.on(document,"uiShortcutGotoTopOfScreen",this.refreshAndSelectTopTweet),this.on(document,"dataPageMutated",this.resetCacheOfComposedInjectedTweets),this.on(document,"uiPageNeedsCount",this.addPageCount),this.on(document,"uiPollingStopped",function(){t.isPollingStopped=!0,t.attr.timelineCacheTTLMillis&&(t.timelineCacheTTLTimer=setTimeout(function(){t.resetLatentItems(),clearTimeout(t.timelineCacheTTLTimer),t.timelineCacheTTLTimer=null,t.trigger("uiTimelineCacheInvalidated"),t.shouldGetInitialTimeline=!0},t.attr.timelineCacheTTLMillis))}),this.on(document,"uiPollingStarted",function(){t.isPollingStopped=!1,t.shouldGetInitialTimeline=!1}),this.attr.injectComposedTweets&&this.on(document,"dataTweetSuccess",this.injectComposedTweet)})}var n=i("q9/C"),o=i("VeSc"),r=i("p067"),a=Object.assign||function(t){for(var e=1;e
=this.attr.pollingOptions.pauseItemCount)},this.startPolling=function(){this.pollingTimer&&this.pollingTimer.clear(),this.pollingTimer=Object(n.a)("uiTimelinePollForNewItems",this.attr.pollingWatchNode,this.attr.pollingOptions),this.resetPolling()},this.pausePolling=function(){this.pollingTimer.pause(),this.pollingPaused=!0},this.resetPolling=function(){this.backoffEmptyResponseCount=0,this.pollingPaused=!1,this.trigger("uiPollingStarted")},this.stopPolling=function(){this.pollingTimer&&(this.pollingTimer.clear(),this.trigger("uiPollingStopped"))},this.pollForNewItems=function(t,e){this.trigger("uiTimelineShouldRefresh",{injectImmediately:!1,interval:this.pollingTimer.interval,fromPolling:!0})},this.onGotMoreTimelineItems=function(t,e){if(this.attr.pollingOptions&&this.attr.pollingOptions.pauseAfterBackoff&&e&&e.sourceEventData){if(e.focused_refresh_interval){var i=this.attr.pollingOptions.blurredInterval/this.attr.pollingOptions.focusedInterval;this.stopPolling(),this.attr.pollingOptions.focusedInterval=e.focused_refresh_interval,this.attr.pollingOptions.blurredInterval=e.focused_refresh_interval*i,this.startPolling()}var s=e.sourceEventData;s.fromPolling&&(this.shouldStopPolling(e.new_latent_count)?this.stopPolling():this.isNewItem(e)||s.interval=this.attr.pollingOptions.backoffEmptyResponseLimit&&this.pausePolling())}},this.getNewItemsCountData=function(t){if(this.pollingPaused&&this.attr.pollingOptions)return this.resetPolling(),{count:this.attr.pollingOptions.resumeItemCount}},this.possiblyRefreshBeforeInject=function(t,e,i){return this.pollingPaused&&i&&i.fromClick&&this.trigger("uiTimelineShouldRefresh",{injectImmediately:!0}),t(e,i)},this.around("injectNewItems",this.possiblyRefreshBeforeInject),this.before("teardown",function(){this.stopPolling()}),this.after("initialize",function(){this.attr.pollingEnabled&&(this.on(document,"uiTimelinePollForNewItems",this.pollForNewItems),this.on(document,"dataGotMoreTimelineItems",this.onGotMoreTimelineItems),this.on(document,"uiHasInjectedNewTimeline",this.startPolling),this.startPolling())})}var n=i("11Yp");e.a=s}).call(e,i("4kSj"))},ruJk:function(t,e,i){"use strict";function s(){this.defaultAttrs({itemType:"tweet",tweetSelector:".tweet",ancestorTweetSelector:".tweet.ancestor"}),this.removeAncestors=function(){this.select("ancestorTweetSelector").length||this.$node.remove()},this.after("initialize",function(){this.on("uiTweetRemoved",this.removeAncestors)})}var n=i("4Pj3"),o=i("8hd4"),r=i("G/SW"),a=i("xgWv"),c=i("CNhr");e.a=n.a.mixin(s,o.a,r.a,a.a,c.a)},rz4S:function(t,e,i){"use strict";function s(){this.defaultAttrs({repliesSelector:".replies-to .stream-items .tweet",hasRepliesClass:"has-replies"}),this.updateRepliesState=function(){this.select("repliesSelector").length?this.$node.addClass(this.attr.hasRepliesClass):this.$node.removeClass(this.attr.hasRepliesClass)},this.after("initialize",function(){this.on(document,"uiTweetInserted uiTweetRemoved",this.updateRepliesState)})}var n=i("DBjh");e.a=Object(n.default)(s)},smxC:function(t,e,i){"use strict";function s(t){a.a.attachTo(document),n.a.attachTo(document,{src:t.src,trendsCacheKey:t.trendsCacheKey,trendsModuleEndpoint:t.trendsEndpoint,show_context:t.show_context,profileUserId:t.profile_id,query:t.query}),c.a.attachTo(".module.trends",{loggedIn:t.loggedIn,displaySource:t.src,eventData:{scribeContext:{component:"trends"}}}),o.a.attachTo(document),r.a.attachTo(document),l.a.attachTo("#trends_dialog",{typeaheadData:t.typeaheadData,eventData:{scribeContext:{component:"trends_location_dialog"}}})}e.a=s;var n=i("nD+w"),o=i("nB7e"),r=i("O1q0"),a=i("0iQm"),c=i("ykaF"),l=i("kku7")},wsa9:function(t,e,i){"use strict";function s(){this.defaultAttrs({permalinkPageTweetSelector:".PermalinkOverlay .permalink-tweet",ownTweetSelector:".my-tweet"}),this.triggerBlock=function(){this.triggerBlockActionOnNode(this.select("permalinkPageTweetSelector"),"uiOpenBlockUserDialog")},this.triggerMute=function(){this.triggerBlockActionOnNode(this.select("permalinkPageTweetSelector"),"uiDidMuteUser")},this.after("initialize",function(){this.on(document,"uiShortcutBlock",this.triggerBlock),this.on(document,"uiShortcutMuteUser",this.triggerMute)})}var n=i("DBjh"),o=i("xOPL"),r=i("lRgq");e.a=Object(n.default)(s,o.a,r.a)},yQR6:function(t,e,i){"use strict";(function(t){function s(){this.defaultAttrs({permalinkTweetSelector:".permalink-tweet",permalinkTweetForm:".permalink-tweet-container + .inline-reply-tweetbox-container .inline-reply-tweetbox .tweet-form",permalinkAddAnotherTweetCTA:".addAnotherTweetCTA"}),this.homePath="/",this.handleReply=function(e,i){t(e.target).is(this.attr.permalinkTweetSelector)&&this.select("permalinkTweetForm").length?this.trigger(this.select("permalinkTweetForm"),"uiComposerResetAndFocus"):this.trigger("uiOpenReplyDialog",i)},this.redirectHome=function(t,e){this.$node.find('[data-tweet-id="'+e.sourceEventData.id+'"]').is(this.attr.permalinkTweetSelector)&&window.location.replace(this.homePath)},this.addAnotherTweetToSelfThread=function(e,i){this.trigger("uiAddAnotherTweetClicked"),this.trigger("uiOpenTweetstormDialog",{previousStatusIdInThread:t(e.target).attr("data-reply-to")})},this.after("initialize",function(){this.attr.loggedIn&&(this.on("uiReplyToTweet",this.handleReply),this.on(document,"dataDidDeleteTweet",this.redirectHome),this.on("click",{permalinkAddAnotherTweetCTA:this.addAnotherTweetToSelfThread}))})}var n=i("DBjh"),o=Object(n.default)(s);e.a=o}).call(e,i("4kSj"))},ykaF:function(t,e,i){"use strict";(function(t){function s(){this.defaultAttrs({changeLinkSelector:".change-trends",trendsInnerSelector:".trends-inner",trendItemSelector:".js-trend-item",trendLinkItemSelector:".js-trend-item a",itemType:"trend",displaySource:"module"}),this.openChangeTrendsDialog=function(t){this.trigger("uiShowTrendsLocationDialog"),t.preventDefault()},this.updateModuleContent=function(t,e){if(e.module_html){var i=this.$node.hasClass("hidden"),s=e.source;this.select("trendsInnerSelector").html(e.module_html),this.currentWoeid=e.woeid,this.$node.removeClass("hidden");var n=this.getTrendData(this.select("trendItemSelector"));this.trigger("uiTrendsDisplayed",{items:n,initial:i,source:s,scribeData:{woeid:this.currentWoeid}})}},this.trendSelected=function(e,i){var s=t(i.el).closest(this.attr.trendItemSelector),n=this.getTrendData(s)[0],r=s.index(),a={name:n.name,item_type:o.a.trend,item_query:n.name,position:r,token:n.token,id:n.id},c={position:r,query:n.name,url:s.find("a").attr("href"),woeid:this.currentWoeid};n.promotedTrendId&&(a.promoted_id=n.promotedTrendId,c.promoted=!0),c.items=[a],this.trigger("uiTrendSelected",{isPromoted:!!n.promotedTrendId,promotedTrendId:n.promotedTrendId,scribeContext:{element:"trend"},scribeData:c})},this.getTrendData=function(e){return e.map(function(){var e=t(this);return{name:e.attr("data-trend-name"),promotedTrendId:e.data("promoted-trend-id"),trendingEvent:e.hasClass("event-trend"),token:e.attr("data-trend-token"),id:e.attr("data-trends-id")}}).toArray()},this.after("initialize",function(){this.on(document,"dataTrendsRefreshed",this.updateModuleContent),this.on("click",{changeLinkSelector:this.openChangeTrendsDialog,trendLinkItemSelector:this.trendSelected}),this.trigger("uiRefreshTrends")})}var n=i("DBjh"),o=i("rbkv"),r=i("xgWv");e.a=Object(n.default)(s,r.a)}).call(e,i("4kSj"))},zAui:function(t,e,i){"use strict";(function(t){function s(){this.viewportHelpers=a.a,this.defaultAttrs({tweetSelector:".tweet",cursorSelector:".ThreadedConversation-showMoreThreads",itemType:"tweet",checkVisibilityInterval:500}),this.checkTweetVisibility=function(){var e=this,i=this.allVisibleTweets(),s=i.map(function(t){return this.interactionDataWithCard(t)},this),n=this.select("cursorSelector").filter(function(i,s){a.a.isWithinBounds(e.$window,t(s))}).toArray().map(function(e){return{type:t(e).data("cursor-type-name"),cursor:t(e).find("[data-cursor]").data("cursor")}});this.trigger("uiTweetsVisible",{tweetData:s,cursorData:n})},this.allVisibleTweets=function(){var t=this.select("tweetSelector"),e=this.findVisibleTweet(t);if(-1===e)return[];for(var i=[],s=e;t[s]&&a.a.isWithinBounds(this.$window,t.eq(s));)i.push(t[s]),s--;for(i.reverse(),s=e+1;t[s]&&a.a.isWithinBounds(this.$window,t.eq(s));)i.push(t[s]),s++;return i},this.findVisibleTweet=function(t){var e=a.a.getContainerRect(this.$window);return this.findVisibleTweetRecursive(t.length,0,t,0,e)},this.findVisibleTweetRecursive=function(t,e,i,s,n){var o=Math.floor((t-e)/2+e);return o===e||s>100?-1:a.a.isAboveViewport(this.$window,i.eq(o),0,n)?this.findVisibleTweetRecursive(t,o,i,s+1,n):a.a.isBelowViewport(this.$window,i.eq(o),0,n)?this.findVisibleTweetRecursive(o,e,i,s+1,n):o},this.before("teardown",function(){this.pollingInterval.clear()}),this.after("initialize",function(){this.$window=t(window),this.pollingInterval=r.default.setIntervalEvent("uiCheckTweetVisibility",this.attr.checkVisibilityInterval),this.on(document,"uiCheckTweetVisibility",this.checkTweetVisibility)})}var n=i("DBjh"),o=i("alSu"),r=i("r8Bt"),a=i("/LRg");e.a=Object(n.default)(s,o.a)}).call(e,i("4kSj"))}});