define("app/ui/dialogs/age_gate_dialog",["module","require","exports","core/component","app/ui/with_dialog","core/i18n","core/utils","app/utils/cookie"],function(module, require, exports) {
function ageGateDialog(){this.defaultAttrs({submitButtonSelector:"#age-gate-dialog-submit-button",monthSelector:"#age-gate-month",daySelector:"#age-gate-day",yearSelector:"#age-gate-year",requiredSelector:".age-gate-error",ageGateCookieKey:"age-gated"}),this.setUpDialog=function(a,b){b.ageGated?this.showError():(this.reset(),this.ageData=b,this.setDateOption(),this.open())},this.fillYearSelect=function(){var a=(new Date).getFullYear();for(var b=a;b>a-100;b--)this.yearSelect.options.add(new Option(b,b));this.yearSelect.options.add(new Option(_('Vor {{year}}',{year:b}),b))},this.month={1:_('Januar'),2:_('Februar'),3:_('M\xe4rz'),4:_('April'),5:_('Mai'),6:_('Juni'),7:_('Juli'),8:_('August'),9:_('September'),10:_('Oktober'),11:_('November'),12:_('Dezember')},this.fillMonthSelect=function(){for(var a=1;a<=12;a++)this.monthSelect.options.add(new Option(this.month[a],a))},this.fillDaySelect=function(a,b){a||(a=1),b||(b=31);for(var c=a;c<=b;c++)this.daySelect.options.add(new Option(c,c))},this.resetSelect=function(a,b){a.options.length=0,a.options.add(new Option(b,-1,!0,!0)),a.options[0].disabled=!0},this.reset=function(){this.resetSelect(this.yearSelect,_('Jahr')),this.resetSelect(this.monthSelect,_('Monat')),this.resetSelect(this.daySelect,_('Tag')),this.hideRequired()},this.setDateOption=function(){this.fillYearSelect(),this.fillMonthSelect(),this.fillDaySelect()},this.showRequired=function(){this.select("requiredSelector").removeClass("hidden")},this.hideRequired=function(){this.select("requiredSelector").addClass("hidden")},this.getDateFromSelect=function(){var a={};return a.year=this.yearSelect.options[this.yearSelect.selectedIndex].value,a.month=this.monthSelect.options[this.monthSelect.selectedIndex].value,a.day=this.daySelect.options[this.daySelect.selectedIndex].value,a},this.getNumberOfDaysGivenMonthYear=function(a,b){return b<0&&(b=2012),(new Date(b,a,0)).getDate()},this.validateDate=function(){var a=this.getDateFromSelect(),b=0<a.year&&0<a.month&&a.month<=12&&0<a.day&&a.day<=this.getNumberOfDaysGivenMonthYear(a.month,a.year);return b?new Date(a.year,a.month-1,a.day):(a.year==-1||a.month==-1||a.day==-1?this.showRequired():this.trigger("uiShowMessage",{message:_('Ung\xfcltiges Datum. Bitte gib Dein Geburtsdatum ein.')}),null)},this.updateDays=function(){var a,b=this.getDateFromSelect();this.hideRequired();if(b.month<1||b.month>12)return;this.resetSelect(this.daySelect,"Day"),a=this.getNumberOfDaysGivenMonthYear(b.month,b.year),this.fillDaySelect(1,a),b.day>0&&b.day<=a&&(this.daySelect.selectedIndex=b.day)},this.showError=function(){this.trigger("uiShowMessage",{message:_('Du entsprichst nicht dem erforderlichen Mindestalter, um diesem Account zu folgen.')})},this.setAgeGateCookie=function(){cookie(this.attr.ageGateCookieKey,(new Date).getTime())},this.submitAgeGating=function(){var a=this.validateDate();a&&(a.getTime()<=this.ageData.minBirthDate?this.trigger("uiAgeGatePassed",utils.merge(this.ageData.originalData,{passedAgeGating:!0})):(this.showError(),this.setAgeGateCookie()),this.close())},this.after("initialize",function(){this.monthSelect=this.select("monthSelector")[0],this.daySelect=this.select("daySelector")[0],this.yearSelect=this.select("yearSelector")[0],this.on(document,"uiNeedsAgeGateDialog",this.setUpDialog),this.on("click",{submitButtonSelector:this.submitAgeGating}),this.on("change",{monthSelector:this.updateDays,yearSelector:this.updateDays,daySelector:this.hideRequired})})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),_=require("core/i18n"),utils=require("core/utils"),cookie=require("app/utils/cookie"),AgeGateDialog=defineComponent(ageGateDialog,withDialog);module.exports=AgeGateDialog
});
define("app/utils/is_iframe_message_whitelisted",["module","require","exports"],function(module, require, exports) {
var whitelist=["twitter.com","donate.twitter.com"],absolute=function(a,b){return[a,b].join("//")};module.exports=function(a,b){return whitelist.reduce(function(c,d){return c||a===absolute(b.protocol,d)},a===absolute(b.protocol,b.host))}
});
define("app/utils/with_iframe_height_adjuster",["module","require","exports","app/utils/is_iframe_message_whitelisted"],function(module, require, exports) {
function withIframeHeightAdjuster(){this.fitIframeHeight=function(a,b){if(!a||!b)return;var c=b.iframeSelector||this.attr.iframeSelector,d={};a.originalEvent&&(a=a.originalEvent);if(isIframeMessageWhitelisted(a.origin,window.location)&&typeof a.data=="string"&&$.isFunction(b.isQualified))try{d=JSON.parse(a.data),d&&b.isQualified(d)&&(this.$node.find(c).css("height",d.height+"px"),$.isFunction(b.additonalTreatment)&&b.additonalTreatment(this.$node.find(c)))}catch(e){}}}var isIframeMessageWhitelisted=require("app/utils/is_iframe_message_whitelisted");module.exports=withIframeHeightAdjuster
});
define("app/utils/b2c/with_iframe_events_proxy",["module","require","exports","app/utils/is_iframe_message_whitelisted"],function(module, require, exports) {
function withIframeEventsProxy(){this.proxyIframeEvents=function(a){if(!a)return;var b={};a.originalEvent&&(a=a.originalEvent);if(isIframeMessageWhitelisted(a.origin,window.location)&&typeof a.data=="string")try{b=JSON.parse(a.data),b&&b.name&&b.name==="b2c"&&b.eventName&&this.trigger(b.eventName,b.data)}catch(c){}}}var isIframeMessageWhitelisted=require("app/utils/is_iframe_message_whitelisted");module.exports=withIframeEventsProxy
});
define("app/ui/dialogs/authenticated_webview_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/with_position","app/utils/with_iframe_height_adjuster","app/utils/b2c/with_iframe_events_proxy","app/data/with_card_metadata"],function(module, require, exports) {
function authWebViewDialog(){this.defaultAttrs({authWebViewDialogIframeSelector:".auth-webview-card-iframe",authWebViewDialogTitleSelector:".modal-title",authWebViewActionSelector:".AuthWebViewCard-authWebViewAction",authWebViewCardCtaClass:"AuthWebViewCard-button",authWebViewCardImageClass:"AuthWebViewCard-productImageWrapper",authWebViewTweetSelector:".tweet",commerceCardSelector:".AuthWebViewCard",top:47}),this.openAuthWebViewDialog=function(a,b){if(this.attr.loggedIn){var c=b.webviewUrl;b.tweetId&&(c=this.appendQueryParam(c,"referringTweetId",b.tweetId)),b.impressionId&&(c=this.appendQueryParam(c,"impressionId",b.impressionId)),this.select("authWebViewDialogIframeSelector").attr("src",c),this.select("authWebViewDialogTitleSelector").html(b.webviewTitle),this.open()}else this.trigger(document,"uiOpenSignupDialog")},this.appendQueryParam=function(a,b,c){var d=document.createElement("a");d.href=a;var e=encodeURIComponent(b)+"="+encodeURIComponent(c);d.search===""?d.search=e:d.search+="&"+e;var f=d.href;return d=null,f},this.closeDialog=function(a,b){this.select("authWebViewDialogIframeSelector").attr("src","about:blank"),this.off(window,"message",this.adjustIframeHeight),this.off(window,"message",this.proxyIframeEvents)},this.adjustIframeHeight=function(a){this.fitIframeHeight(a,{iframeSelector:this.attr.authWebViewDialogIframeSelector,isQualified:function(a){return a.name&&a.name==="auth_webview"&&a.height}})},this.setActiveViewSelector=function(a,b){this.activeViewSelector=b.selector||""},this.setupMessageListener=function(){this.on(window,"message",this.adjustIframeHeight),this.on(window,"message",this.proxyIframeEvents)},this.after("initialize",function(){this.activeViewSelector="",this.on("uiDialogOpened",this.setupMessageListener),this.on("uiDialogClosed",this.closeDialog),this.on(window,"uiOpenAuthWebViewDialog",this.openAuthWebViewDialog),this.on(document,"uiCommerceSetActiveViewSelector",this.setActiveViewSelector)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withPosition=require("app/ui/with_position"),withIframeHeightAdjuster=require("app/utils/with_iframe_height_adjuster"),withIframeEventsProxy=require("app/utils/b2c/with_iframe_events_proxy"),withCardMetadata=require("app/data/with_card_metadata"),AuthWebViewDialog=defineComponent(authWebViewDialog,withDialog,withPosition,withIframeHeightAdjuster,withIframeEventsProxy,withCardMetadata);module.exports=AuthWebViewDialog
});
define("app/ui/autoplayable_media",["module","require","exports","core/component","app/utils/viewport_helpers","core/utils"],function(module, require, exports) {
function AutoplayableMedia(){this.viewportHelpers=viewportHelpers,this.defaultAttrs({autoplayableMediaSelector:".has-autoplayable-media",mediaSelector:".animated-gif, .PlayableMedia, .js-macaw-cards-iframe-container",autoplayingMediaDataAttr:"data-autoplaying-media",scrollThrottle:100,watchDocumentScroll:!0}),this.watchContainers=function(){this.$containers=this.select("autoplayableMediaSelector"),this.throttledProcessWatchedContainers()},this.stopAutoplaying=function(){this.$currentlyAutoplayingContainer&&(this.$currentlyAutoplayingContainer.attr(this.attr.autoplayingMediaDataAttr,!1),this.$currentlyAutoplayingMedia.trigger("uiStopAutoplayingMedia"),this.$currentlyAutoplayingContainer=undefined,this.$currentlyAutoplayingMedia=undefined)},this.processWatchedContainers=function(){if(this.$containers.length===0||!this.$viewport)return;var a=this.$containers.find(this.attr.mediaSelector).filter(function(){return this.children.length!=0}),b=this.viewportHelpers.getGlobalNavHeight(),c=this.viewportHelpers.getElementClosestToMiddleOfViewport(this.$viewport,a,b,0);if(c){var d=c.closest(this.attr.autoplayableMediaSelector);d.is(this.$currentlyAutoplayingContainer)||(this.stopAutoplaying(),d.attr(this.attr.autoplayingMediaDataAttr,!0),this.$currentlyAutoplayingContainer=d,this.$currentlyAutoplayingMedia=c,c.trigger("uiAutoplayMedia"))}this.$currentlyAutoplayingMedia&&!this.viewportHelpers.isContainedInViewport(this.$viewport,this.$currentlyAutoplayingMedia,b,0)&&this.stopAutoplaying()},this.resetWatchedContainers=function(){this.$containers=$(),this.stopAutoplaying(),this.watchContainers()},this.cleanup=function(){this.off(document,"uiPageChanged"),this.off(this.$viewport,"resize"),this.$viewport=undefined,this.attr.watchDocumentScroll?this.off(document,"scroll",this.throttledProcessWatchedContainers):this.off("scroll",this.throttledProcessWatchedContainers)},this.before("teardown",function(){this.cleanup()}),this.after("initialize",function(){this.$currentlyAutoplayingContainer=undefined,this.$currentlyAutoplayingMedia=undefined,this.$viewport=$(window),this.$containers=$(),this.throttledProcessWatchedContainers=utils.throttle(this.processWatchedContainers.bind(this),this.attr.scrollThrottle),this.on(document,"uiPageChanged",this.resetWatchedContainers),this.attr.watchDocumentScroll?this.on(document,"scroll",this.throttledProcessWatchedContainers):this.on("scroll",this.throttledProcessWatchedContainers),this.on(this.$viewport,"resize",this.throttledProcessWatchedContainers),this.on(document,"uiDynamicCardLoaded uiDynamicCardUnloaded",this.throttledProcessWatchedContainers),this.on(document,"uiWatchAutoplayMedia uiSwiftLoaded",this.watchContainers),this.on(document,"uiPageHidden",this.stopAutoplaying),this.on(document,"uiPageVisible",this.processWatchedContainers)})}var defineComponent=require("core/component"),viewportHelpers=require("app/utils/viewport_helpers"),utils=require("core/utils");module.exports=defineComponent(AutoplayableMedia)
});
define("app/ui/dialogs/block_dialog",["module","require","exports","core/component","core/i18n","app/ui/with_dialog"],function(module, require, exports) {
function blockDialog(){this.defaultAttrs({blockUserLabelSelector:".block-user-label",blockUserTextSelector:".block-user-text",blockButtonSelector:".block-button",blockInputSelector:"input[name=block_user]"}),this.setUpDialog=function(a,b){this.eventData=b,this.setTriggeredTarget(),this.setScreenNameText(),this.isComplete=!1,this.open()},this.setTriggeredTarget=function(){this.eventData.target==="user"?this.$node.addClass("block-from-user"):this.$node.removeClass("block-from-user")},this.setScreenNameText=function(){var a=this.select("blockUserLabelSelector");a.text(_('@{{screenName}} blockieren?',this.eventData)),this.select("blockUserTextSelector").text(_('@{{screenName}} kann Dir nun nicht l\xe4nger folgen oder Dir Nachrichten senden.',this.eventData))},this.submitBlock=function(){this.trigger("uiBlockAction",{eventData:this.eventData,tweetId:this.eventData.tweetId,userId:this.eventData.userId,screenName:this.eventData.screenName,impressionId:this.eventData.impressionId,disclosureType:this.eventData.disclosureType,scribeContext:{component:"block_dialog",element:this.eventData.target==="user"?"user":"tweet"}}),this.trigger("uiDidTriggerBlockingAction",{userId:this.eventData.userId}),this.isComplete=!0,this.close()},this.around("close",function(a){this.isOpen()&&!this.isComplete&&this.trigger("uiBlockDialogCancel",this.eventData),a()}),this.after("initialize",function(){this.on(document,"uiNeedsBlockDialog",this.setUpDialog),this.on("click",{blockButtonSelector:this.submitBlock})})}var defineComponent=require("core/component"),_=require("core/i18n"),withDialog=require("app/ui/with_dialog"),BlockDialog=defineComponent(withDialog,blockDialog);module.exports=BlockDialog
});
define("app/ui/dialogs/block_or_report",["module","require","exports","core/component","core/i18n","app/ui/with_dialog"],function(module, require, exports) {
function blockOrReportDialog(){this.defaultAttrs({blockUserLabelSelector:".block-user-label",blockUserTextSelector:".block-user-text",blockButtonSelector:".report-tweet-block-button",reportButtonSelector:".report-tweet-report-button",nextButtonSelector:".report-tweet-next-button",harassmentIframeSelector:"#report-harassment-frame",harassmentNextSelector:".harassment-next-button",harassmentBackSelector:".harassment-back-button",harassmentDoneSelector:".harassment-done-button",reportTypeSelector:"input[name=report_type]",abusiveTypeSelector:"input[name=abuse_type]",selectedReportTypeSelector:"input[name=report_type]:checked",selectedAnnoyingSelector:"input[value=annoying]",selectedAbusiveTypeSelector:"input[name=abuse_type]:checked",blockInputSelector:"input[name=block_user]",alsoReportInputSelector:"input[name=also_report]",flagMediaSelector:".flag-media",flagMediaTextSelector:".flag-media-desc",spamTextSelector:".spam-desc",abuseTextSelector:".abuse-desc",annoyingTextSelector:".annoying-desc",impersonationLinkSelector:".report-impersonation-link",privateInformationLinkSelector:".report-private-information-link",harassmentLinkSelector:".report-harassment-link",selfHarmLinkSelector:".report-self-harm-link",adsLinkSelector:".report-ads-link",twitterRulesLinkSelector:".twitter-rules-link",reportFormSelector:".report-form",reportControlSelector:"#report-control",reportTitleSelector:".report-title",harassmentTitleSelector:".harassment-title",harassmentFormSelector:".harassment-form",reporterUserIdSelector:"#current-user-id",abuseLinks:{impersonation:"https://support.twitter.com/forms/impersonation?{{q}}",privateInformation:"https://support.twitter.com/forms/private_information?{{q}}",harassment:"https://support.twitter.com/forms/abusiveuser?{{q}}",selfHarm:"https://support.twitter.com/forms/general?subtopic=self_harm&{{q}}",ads:"https://support.twitter.com/forms/ads?{{q}}"}}),this.setUpDialog=function(a,b){this.reset(),this.eventData=b,this.setAlreadyBlocking(),this.setTriggeredTarget(),this.setScreenNameText(),this.setDescriptionText(),this.setAbuseReportLinks(),this.setFlagMedia(),this.showBlockOrReport(),this.setReportHarassmentContext(),this.setReportAds(),this.open()},this.reset=function(){this.isComplete=!1,this.$node.addClass("block-selected"),this.select("blockInputSelector").attr("checked",!0),this.select("blockButtonSelector").attr("disabled",!1),this.resetReportSection()},this.resetReportSection=function(){this.$node.removeClass("abuse-selected"),this.$node.removeClass("also-report-selected"),this.select("selectedAnnoyingSelector").attr("checked",!0),this.select("alsoReportInputSelector").attr("checked",!1),this.select("selectedAbusiveTypeSelector").attr("checked",!1),this.select("reportButtonSelector").attr("disabled",!0),this.select("nextButtonSelector").attr("disabled",!0),this.select("harassmentDoneSelector").hide()},this.setAlreadyBlocking=function(){this.eventData.viewerBlocksAuthor?(this.$node.addClass("already-blocking"),this.select("blockInputSelector").attr("checked",!1),this.select("alsoReportInputSelector").attr("checked",!0),this.select("reportButtonSelector").attr("disabled",!1),this.updateState()):this.$node.removeClass("already-blocking")},this.setTriggeredTarget=function(){this.eventData.target==="user"?this.$node.addClass("report-user"):this.$node.removeClass("report-user")},this.setReportHarassmentContext=function(){var a=this.select("reporterUserIdSelector").val(),b={baseUrl:"/safety/report_story",reporterId:a,reportedId:this.eventData.userId,reportedTweetId:"",source:""},c="{{baseUrl}}?source={{source}}&reported_user_id={{reportedId}}&reporter_user_id={{reporterId}}&next_view=who_is_harassing";if(this.$node.hasClass("report-user")){b.source="reportprofile";var d=_(c,b);this.select("harassmentIframeSelector").attr("src",d)}else{b.reportedTweetId=this.eventData.tweetId,b.source="reporttweet";var e=c+"&reported_tweet_id={{reportedTweetId}}",f=_(e,b);this.select("harassmentIframeSelector").attr("src",f)}},this.setScreenNameText=function(){var a=this.select("blockUserLabelSelector");a.text(_('@{{screenName}} blockieren',this.eventData)),this.select("blockUserTextSelector").text(_('\n  \n    @{{screenName}} wird nicht l\xe4nger in der Lage sein, Dir zu folgen oder Dir eine Nachricht zuzusenden.',this.eventData))},this.isTriggeredByUser=function(a,b){return b.target==="user"},this.setDescriptionText=function(a,b){var c=this.select("spamTextSelector"),d=this.select("abuseTextSelector"),e=this.select("annoyingTextSelector");this.$node.hasClass("report-user")?(e.text(_('Dieser Account ist nervig')),c.text(_('Das ist ein Spam-Account')),d.text(_('Account'))):(e.text(_('Dieser Tweet ist nervig')),c.text(_('Dieser Tweet ist Spam')),d.text(_('Twittern')))},this.setFlagMedia=function(){var a=this.select("flagMediaSelector");this.eventData.mediaType?(this.eventData.mediaType=="image"?this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise ein sensibles Bild')):this.eventData.mediaType=="video"?this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise ein sensibles Video')):this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise sensible Medien')),a.show()):a.hide()},this.setReportAds=function(){var a="for-promoted-tweet";this.eventData.disclosureType!=="promoted"?this.$node.removeClass(a):this.$node.addClass(a)},this.setAbuseReportLinks=function(){var a="reported_username={{screenName}}&reported_tweet_id={{tweetId}}",b={q:_(a,this.eventData)},c=this.attr.abuseLinks;this.select("impersonationLinkSelector").attr("data-form-link",_(c.impersonation,b)),this.select("privateInformationLinkSelector").attr("data-form-link",_(c.privateInformation,b)),this.select("harassmentLinkSelector").attr("data-form-link",_(c.harassment,b)),this.select("selfHarmLinkSelector").attr("data-form-link",_(c.selfHarm,b)),this.select("adsLinkSelector").attr("data-form-link",_(c.ads,b))},this.updateState=function(){function a(a,b){var c=b?"addClass":"removeClass";this.$node[c](a)}function b(a,b){this.select(a).attr("disabled",!b)}var c=this.blockUserIsChecked(),d=this.alsoReportIsChecked(),e=this.reportType()=="abusive",f=this.select("abusiveTypeSelector").is(":checked"),g=[["block-selected",c],["also-report-selected",d],["abuse-selected",e]];g.forEach(function(b){a.call(this,b[0],b[1])},this);var h=[["blockButtonSelector",c],["reportButtonSelector",d],["nextButtonSelector",f]];h.forEach(function(a){b.call(this,a[0],a[1])},this),d||this.resetReportSection()},this.reportType=function(){return this.select("selectedReportTypeSelector").val()},this.abusiveType=function(){return this.select("selectedAbusiveTypeSelector").val()},this.blockUserIsChecked=function(){return this.select("blockInputSelector").attr("checked")=="checked"},this.alsoReportIsChecked=function(){return this.select("alsoReportInputSelector").attr("checked")=="checked"||this.select("alsoReportInputSelector").length==0},this.submitReport=function(){var a=this.$node.hasClass("report-user")?"uiReportUserAction":"uiDidBlockOrReport",b=this.alsoReportIsChecked()?this.reportType():"";this.trigger(a,{eventData:this.eventData,tweetId:this.eventData.tweetId,userId:this.eventData.userId,screenName:this.eventData.screenName,reportType:b,blockUser:this.blockUserIsChecked(),impressionId:this.eventData.impressionId,disclosureType:this.eventData.disclosureType}),this.blockUserIsChecked()&&(this.trigger("uiDidTriggerBlockingAction",{userId:this.eventData.userId}),this.$node.addClass("already-blocking"),this.select("blockInputSelector").attr("checked",!1))},this.showBlockOrReport=function(){this.$node.removeClass("abuse-dialog")},this.showHarassmentReport=function(){this.$node.addClass("abuse-dialog"),this.select("harassmentBackSelector").show(),this.select("harassmentNextSelector").show()},this.blockOrReport=function(){this.submitReport(),this.completeReport()},this.reportAbuseNext=function(){this.submitReport();if(this.abusiveType()){var a=this.select("selectedAbusiveTypeSelector").attr("data-form-link");this.abusiveType()=="harassment"&&$(this.attr.selectedAbusiveTypeSelector).hasClass("report-flow-v2")?(this.reportAbuseToSupport(),this.showHarassmentReport()):(this.reportAbuseToSupport(),window.open(a,"_blank"),this.completeReport())}},this.reportAbuseToSupport=function(a,b){this.trigger("uiDidBlockOrReportToSupport",{eventData:this.eventData,abuseType:this.abusiveType(),userId:this.eventData.userId})},this.cancelReport=function(){this.trigger("uiDidCancelBlockOrReport",this.eventData)},this.completeReport=function(){this.isComplete=!0,this.close()},this.around("close",function(a){this.isOpen()&&!this.isComplete&&this.cancelReport(),a()}),this.twitterRulesClick=function(){this.trigger("uiDidOpenTwitterRulesLink",{eventData:this.eventData,userId:this.eventData.userId})},this.harassmentFrameNext=function(){var a=this.select("harassmentIframeSelector").contents().find(".email-field").length>0;a?this.validateAndSubmitReportConfirmationEmail():this.select("harassmentIframeSelector").contents().find("#report_webview_form").submit()},this.validateAndSubmitReportConfirmationEmail=function(){var a=this.select("harassmentIframeSelector").contents().find(".email-field").val(),b=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,c=b.test(a);c?this.select("harassmentIframeSelector").contents().find("#report_webview_form").submit():this.select("harassmentIframeSelector").contents().find("#alert").show()},this.harassmentFrameBack=function(){var a=this.select("harassmentIframeSelector").contents().get(0).location.href.indexOf("next_view")<0;a?this.showBlockOrReport():this.select("harassmentIframeSelector").get(0).contentWindow.history.back()},this.checkContentAndUpdate=function(){var a=this.select("harassmentIframeSelector").contents().get(0).location.href.indexOf("/safety/report_story_complete")>=0;a?(this.select("harassmentBackSelector").hide(),this.select("harassmentNextSelector").hide(),this.select("harassmentDoneSelector").show()):this.select("harassmentDoneSelector").hide()},this.after("initialize",function(){this.isComplete=!1,this.on(document,"uiNeedsBlockOrReportDialog",this.setUpDialog);var a=this;this.select("harassmentIframeSelector").load(function(){a.checkContentAndUpdate()}),this.on("click",{blockButtonSelector:this.blockOrReport,reportButtonSelector:this.blockOrReport,nextButtonSelector:this.reportAbuseNext,twitterRulesLinkSelector:this.twitterRulesClick,harassmentNextSelector:this.harassmentFrameNext,harassmentBackSelector:this.harassmentFrameBack,harassmentDoneSelector:this.close}),this.on("change",{blockInputSelector:this.updateState,alsoReportInputSelector:this.updateState,reportTypeSelector:this.updateState,abusiveTypeSelector:this.updateState})})}var defineComponent=require("core/component"),_=require("core/i18n"),withDialog=require("app/ui/with_dialog"),BlockOrReportDialog=defineComponent(withDialog,blockOrReportDialog);module.exports=BlockOrReportDialog
});
define("app/ui/dialogs/block_user_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/dialogs/with_modal_tweet"],function(module, require, exports) {
function blockUserDialog(){this.defaults={cancelSelector:".cancel-action",blockSelector:".block-action"},this.openBlockUser=function(a,b){var c={userOnly:!0,modal:"block"};this.attr.sourceEventData=b,this.displayTweet(b.tweetId,c),this.open()},this.blockUser=function(){this.trigger("uiDidBlockUser",{sourceEventData:this.attr.sourceEventData}),this.close()},this.after("initialize",function(){this.on("click",{cancelSelector:this.close,blockSelector:this.blockUser}),this.on(document,"uiOpenBlockUserDialog",this.openBlockUser)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withModalTweet=require("app/ui/dialogs/with_modal_tweet");module.exports=defineComponent(blockUserDialog,withDialog,withModalTweet)
});
define("app/ui/bouncer_dialog",["module","require","exports","core/component","app/ui/with_dialog"],function(module, require, exports) {
function bouncerDialog(){this.defaultAttrs({safeOrigins:["https://localhost.twitter.com","https://twitter.com"],iframeSelector:"#bouncer-flow",contentSelector:".BouncerContent",spinnerSelector:".BouncerSpinner",dismissButtonSelector:".js-close"}),this.openBouncerDialog=function(a,b){this.select("iframeSelector").attr("src",b.bounce.bounce_location||"/account/access"),this.open()},this.onBeforeIframeUnload=function(){this.setIframeLoading(!0),this.position()},this.onIframeLoad=function(){this.setIframeLoading(!1),this.position()},this.setIframeLoading=function(a){if(a)this.$bouncerContent.hide(),this.$dismissButton.hide(),this.$spinner.show(),this.$bouncerContent.height(this.$spinner.height()),this.$iframe.height(this.$spinner.height());else{this.$spinner.hide(),this.$dismissButton.show(),this.$bouncerContent.show();var b=this.$iframe.contents().find("body").height()+20;b>this.$iframe.height()&&(this.$bouncerContent.height(b),this.$iframe.height(b))}},this.onCancel=function(){this.trigger("uiBouncerCancelled"),this.close()},this.onComplete=function(){this.trigger("uiBouncerCompleted"),this.close()},this.on2FAComplete=function(){this.trigger("uiBouncer2FACompleted"),this.close()},this.aroundAfterClose=function(a){a(),this.reset()},this.reset=function(){this.setIframeLoading(!0)},this.dispatchBouncerMessage=function(a,b){var c=a.originalEvent,d=c&&c.data;if(this.attr.safeOrigins.indexOf(c.origin)==-1)return;if(d&&d.bouncer&&d.event){var e=d.event;e=="beforeunload"?this.onBeforeIframeUnload():e=="load"?this.onIframeLoad():e=="cancel"?this.onCancel():e=="complete"?this.onComplete():e=="2fa_complete"&&this.on2FAComplete()}},this.after("initialize",function(){this.on(document,"dataRequestBounced",this.openBouncerDialog),this.on(document,"uiPreOpenBouncerDialog",this.open),this.on(window,"message",this.dispatchBouncerMessage),this.around("afterClose",this.aroundAfterClose),this.$modalContent=this.select("modalContentSelector"),this.$iframe=this.select("iframeSelector"),this.$bouncerContent=this.select("contentSelector"),this.$spinner=this.select("spinnerSelector"),this.$dismissButton=this.select("dismissButtonSelector"),this.reset()})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),BouncerDialog=defineComponent(bouncerDialog,withDialog);module.exports=BouncerDialog
});
define("app/ui/dialogs/buy_now_dialog",["module","require","exports","core/component","core/utils","app/ui/with_dialog","app/ui/with_position","app/utils/with_iframe_height_adjuster","app/data/with_card_metadata"],function(module, require, exports) {
function buyNowConfirmDialog(){this.defaultAttrs({buyNowDialogIframeSelector:".buy-now-card-iframe",buyNowActionSelector:".BuyNowCard-buyNowAction",buyNowCardCtaClass:"BuyNowCard-button",buyNowCardImageClass:"BuyNowCard-productImageWrapper",buyNowTweetSelector:".tweet",commerceCardSelector:".BuyNowCard",top:47,defaultHeight:"400px",productDetailViewSelector:".BuyNow-productDetailView",paymentInfoViewSelector:".BuyNow-paymentInfoView"}),this.openDialog=function(a,b){if(!this.attr.loggedIn){this.trigger(document,"uiOpenSignupDialog");return}if(b&&b.el){var c=$(b.el).closest(this.attr.buyNowTweetSelector),d=c.data("tweet-id"),e="/i/pay/status/"+d;this.promotedMetadata=this.extractPromotedMetadata(c),this.scribingData=this.getCardDataFromTweet(c),this.trigger("uiBuyNowCardClicked",utils.merge(this.scribingData,this.promotedMetadata,{action:$(b.el).data("action")})),this.select("buyNowDialogIframeSelector").attr("src",e),this.open()}},this.openBuyNowDialogFromId=function(a,b){var c=b.buyNowTweetId;if(!this.attr.loggedIn){this.trigger(document,"uiOpenSignupDialog");return}this.promotedMetadata={impressionId:b.impressionId,disclosureType:b.disclosureType};var d="/i/pay/status/"+c;this.select("buyNowDialogIframeSelector").attr("src",d),this.open()},this.closeDialog=function(a,b){this.activeViewSelector===this.attr.paymentInfoViewSelector?this.trigger("uiCommerceFlowAborted",{component:"store_profile",scribingData:this.scribingData}):this.purchaseSuccess||this.trigger("uiCommerceFlowAborted",{component:"product_detail",scribingData:this.scribingData}),this.purchaseSuccess=!1,this.select("buyNowDialogIframeSelector").attr("src","about:blank"),this.select("buyNowDialogIframeSelector").css("height",this.attr.defaultHeight),this.off(window,"message",this.adjustIframeHeight)},this.adjustIframeHeight=function(a){var b={iframeSelector:this.attr.buyNowDialogIframeSelector,isQualified:function(a){return a.name&&a.name==="buy_now"&&a.height}};this.fitIframeHeight(a,b)},this.showSuccessMessage=function(a,b){this.purchaseSuccess=!0,this.trigger("uiCloseDialog"),this.trigger("uiShowMessage",{message:b.message}),this.trigger("uiCommerceBuyNowSuccess",this.promotedMetadata)},this.setActiveViewSelector=function(a,b){this.activeViewSelector=b.selector||""},this.extractPromotedMetadata=function(a){return{impressionId:a.data("impression-id"),disclosureType:a.data("disclosure-type")}},this.setupMessageListener=function(){this.on(window,"message",this.adjustIframeHeight)},this.after("initialize",function(){this.purchaseSuccess=!1,this.activeViewSelector="",this.on("uiDialogOpened",this.setupMessageListener),this.on("uiDialogClosed",this.closeDialog),this.on(window,"MacawCardOpenBuyNowDialog",this.openBuyNowDialogFromId),this.on(document,"uiCommerceShowSuccessMessage",this.showSuccessMessage),this.on(document,"uiCommerceSetActiveViewSelector",this.setActiveViewSelector),this.on(document,"click",{buyNowActionSelector:this.openDialog})})}var defineComponent=require("core/component"),utils=require("core/utils"),withDialog=require("app/ui/with_dialog"),withPosition=require("app/ui/with_position"),withIframeHeightAdjuster=require("app/utils/with_iframe_height_adjuster"),withCardMetadata=require("app/data/with_card_metadata"),BuyNowConfirmDialog=defineComponent(buyNowConfirmDialog,withDialog,withPosition,withIframeHeightAdjuster,withCardMetadata);module.exports=BuyNowConfirmDialog
});
define("app/data/commerce/buy_now_dialog_scribe",["module","require","exports","core/component","app/data/with_scribe","app/data/with_card_metadata"],function(module, require, exports) {
function buyNowDialogScribe(){this.convertCardDataToScribeData=function(a){return a&&{items:[this.getCard2Item(a)]}},this.scribeFlowAborted=function(a,b){this.scribe({page:"buy_now",component:b.component,action:"exit"},this.convertCardDataToScribeData(b.scribingData))},this.scribeBuyNowCardCtaClicked=function(a,b){var c=this.convertCardDataToScribeData(b);this.scribe({action:b.action},c)},this.after("initialize",function(){this.on("uiCommerceFlowAborted",this.scribeFlowAborted),this.on("uiBuyNowCardClicked",this.scribeBuyNowCardCtaClicked)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),withCardMetadata=require("app/data/with_card_metadata");module.exports=defineComponent(buyNowDialogScribe,withScribe,withCardMetadata)
});
define("app/ui/dialogs/captcha_challenge_dialog",["module","require","exports","core/component","app/ui/with_dialog"],function(module, require, exports) {
function captchaChallengeDialog(){this.defaultAttrs({challengeSelector:"#recaptcha_challenge_field",responseSelector:"#recaptcha_response_field",submitSelector:"#recaptcha_submit",captchaName:"Captcha",bodyTextSelector:".modal-text",captchaFormSelector:"#captcha-challenge-form",recaptchaPublicKey:"6LfbTAAAAAAAAE0hk8Vnfd1THHnn9lJuow6fgulO"}),this.refreshCaptchaDialog=function(a,b){this.reloadCaptcha(),this.open()},this.reloadCaptcha=function(){Recaptcha&&Recaptcha.reload()},this.submitCaptcha=function(){var a=this.select("challengeSelector").val(),b=this.select("responseSelector").val();this.trigger("uiSubmitSpamChallenge",{challenge:a,response:b,challengeName:this.attr.captchaName})},this.getRecaptcha=function(a,b){this.isRecaptchaDefined()&&Recaptcha.create(this.attr.recaptchaPublicKey,"captcha-challenge-form",{theme:"clean",callback:function(){Recaptcha.focus_response_field(),a&&b.select("bodyTextSelector").text(a),b.open()}})},this.isRecaptchaDefined=function(){return typeof Recaptcha!="undefined"},this.openCaptchaDialog=function(a,b){this.getRecaptcha(b.message,this)},this.after("initialize",function(){this.on("click",{submitSelector:this.submitCaptcha}),this.on(document,"uiOpenSpamCaptchaChallenge",this.openCaptchaDialog),this.on(document,"uiCloseSpamCaptchaChallenge",this.blurAndCloseImmediately),this.on(document,"uiRefreshSpamCaptchaChallenge",this.refreshCaptchaDialog)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog");module.exports=defineComponent(captchaChallengeDialog,withDialog)
});
define("app/utils/with_event_params",["module","require","exports","core/parameterize"],function(module, require, exports) {
function withEventParams(){this.rewriteEventName=function(a){var b=[];for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];var d=typeof b[0]=="string"||b[0].defaultBehavior?0:1,e=b[d],f=e.type||e;b[d]=parameterize(f,this.attr.eventParams,!0),e.type&&(e.type=b[d],b[d]=e),a.apply(this,b)},this.around("on",this.rewriteEventName),this.around("off",this.rewriteEventName),this.around("trigger",this.rewriteEventName)}var parameterize=require("core/parameterize");module.exports=withEventParams
});
define("app/ui/dialogs/confirm_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/utils/with_event_params","template"],function(module, require, exports) {
function confirmDialog(){this.defaultAttrs({confirmDialogSelector:"#confirm_dialog",cancelSelector:"#confirm_dialog_cancel_button",submitSelector:"#confirm_dialog_submit_button",modalSizes:{small:"modal-small",medium:"modal-medium",large:"modal-large"}}),this.openWithOptions=function(a,b){if(this.openState)return;this.attr.eventParams={action:b.action},this.attr.top=b.top,this.eventNode=a.target;var c={title_text:b.titleText,body_text:b.bodyText,cancel_text:b.cancelText,submit_text:b.submitText},d=template["dialogs/confirm_dialog"].render(c,template);$("#confirm_dialog").length?$("#confirm_dialog").replaceWith(d):$("body").append(d),this.$dialogContainer=$("#confirm_dialog"),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector);var e=this.attr.modalSizes[b.modalSize];typeof e!="undefined"&&this.$dialog.addClass(e),this.open()},this.submit=function(a,b){this.trigger(this.eventNode,"ui{{action}}Confirm"),this.close()},this.cancel=function(a,b){this.trigger(this.eventNode,"ui{{action}}Cancel"),a.type=="click"&&this.close()},this.after("initialize",function(){this.on(document,"uiOpenConfirmDialog",this.openWithOptions),this.on("click",{submitSelector:this.submit,cancelSelector:this.cancel}),this.on("uiDialogCloseRequested",{confirmDialogSelector:this.cancel})})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withEventParams=require("app/utils/with_event_params"),template=require("template");module.exports=defineComponent(confirmDialog,withDialog,withEventParams)
});
define("app/ui/connect_badge",["module","require","exports","core/component","app/utils/storage/core"],function(module, require, exports) {
function ConnectBadge(){this.defaultAttrs({keepBadgeStorageKey:"keep_badge_until",keepBadgeInterval:1e3}),this.processNewNotifications=function(a,b){b&&b.b&&b.b.status=="ok"&&b.b.response&&this.possiblyUpdateBadgeAndHighlighting(b.b.response)},this.possiblyUpdateBadgeAndHighlighting=function(a){a.show_badge_highlighting&&a.count>=0&&(this.trigger("uiUpdateConnectBadge",a),a.timestamp>=0&&(a.count>0||this.pastStorageTime())&&this.trigger("uiUpdateActivityHighlighting",a.timestamp),this.updateStorageTime())},this.pastStorageTime=function(){var a=(new Date).getTime(),b=this.storage.getItem(this.attr.keepBadgeStorageKey)||{until:0};return b.until<a},this.updateStorageTime=function(){var a=(new Date).getTime(),b=this.storage.getItem(this.attr.keepBadgeStorageKey)||{until:0};this.storage.setItem(this.attr.keepBadgeStorageKey,{until:a+this.attr.keepBadgeInterval})},this.after("initialize",function(){this.storage=new Storage("connect_badge"),this.updateStorageTime(0),this.on(document,"dataNotificationsReceived",this.processNewNotifications)})}var defineComponent=require("core/component"),Storage=require("app/utils/storage/core");module.exports=defineComponent(ConnectBadge)
});
define("app/ui/dialogs/copy_found_media_link_dialog",["module","require","exports","core/component","template","app/ui/with_dialog"],function(module, require, exports) {
function copyFoundMediaLinkDialog(){this.defaultAttrs({copyFoundMediaLinkDialogSelector:"#copy-found-media-link-dialog",foundMediaLinkDestinationSelector:".found-media-link-destination"}),this.openDialog=function(a,b){$(this.attr.copyFoundMediaLinkDialogSelector).remove();var c=template["dialogs/copy_found_media_link"].render({attributionName:b.attribution.name,detailsUrl:b.detailsUrl},template);this.$dialogContainer=$(c).appendTo("body"),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector),this.open(),this.selectLink()},this.after("afterClose",function(){this.$dialogContainer.remove(),this.$dialog=$(),this.$dialogContainer=$()}),this.selectLink=function(){this.select("foundMediaLinkDestinationSelector").focus().select()},this.after("initialize",function(){this.on("click",{foundMediaLinkDestinationSelector:this.selectLink}),this.on(document,"uiNeedsCopyFoundMediaDialog",this.openDialog)})}var defineComponent=require("core/component"),template=require("template"),withDialog=require("app/ui/with_dialog"),CopyFoundMediaLinkDialog=defineComponent(withDialog,copyFoundMediaLinkDialog);module.exports=CopyFoundMediaLinkDialog
});
define("app/ui/compose/updating_text_counter",["module","require","exports","core/component","app/ui/compose/with_text_editor","app/ui/compose/with_character_counter"],function(module, require, exports) {
function updatingTextCounter(){this.after("initialize",function(){this.initTextNode()})}var defineComponent=require("core/component"),withTextEditor=require("app/ui/compose/with_text_editor"),withCharacterCounter=require("app/ui/compose/with_character_counter"),UpdatingTextCounter=defineComponent(updatingTextCounter,withTextEditor,withCharacterCounter);module.exports=UpdatingTextCounter
});
define("app/ui/dialogs/with_create_or_edit_custom_timeline_dialog",["module","require","exports"],function(module, require, exports) {
module.exports=function(){var a=/^\s*$/;this.defaultAttrs({top:90,saveSelector:".update-custom-timeline-button",nameSelector:"[name=name]",descriptionSelector:"[name=custom-timeline-description]",dialogTitleSelector:".modal-title",maxReachedSelector:".max-reached"}),this.params=function(){return{name:this.$name.val(),description:this.$description.val(),order:this.select("orderSelector").val()}},this.saveCustomTimeline=function(a,b){this.disableSaveButton(),this.trigger(this.attr.createOrUpdateEventName,this.params())},this.disableSaveButton=function(){this.$saveButton.attr("disabled",!0)},this.toggleSaveButton=function(b,c){var d=a.test(this.$name.val()),e=this.select("maxReachedSelector").length>0;this.$saveButton.attr("disabled",d||e)},this.after("open",function(){this.$saveButton=this.select("saveSelector"),this.$name=this.select("nameSelector"),this.$description=this.select("descriptionSelector"),this.toggleSaveButton()}),this.after("initialize",function(){this.on(document,"dataCustomTimelineUpdated",this.close),this.on("click",{saveSelector:this.saveCustomTimeline}),this.on("input",{nameSelector:this.toggleSaveButton}),this.on("uiTextChanged",this.toggleSaveButton)})}
});
define("app/ui/dialogs/create_custom_timeline_dialog",["module","require","exports","core/component","app/ui/compose/updating_text_counter","app/ui/with_dialog","app/ui/dialogs/with_create_or_edit_custom_timeline_dialog","template"],function(module, require, exports) {
function createCustomTimelineDialog(){this.defaultAttrs({createOrUpdateEventName:"uiCreateCustomTimeline",orderSelector:"[name=create-timeline-order]:checked"}),this.around("params",function(a){var b=a();return b.tweetId=this.tweetId,b.impressionId=this.impressionId,b}),this.openDialog=function(a,b){this.tweetId=b.tweetId,this.impressionId=b.impressionId;var c={is_create_dialog:!0,id_prefix:"create",curation_reverse_chron:!0},d=template["dialogs/create_or_edit_custom_timeline_dialog"].render(c,template);this.$node.html(d),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector),this.open()},this.after("open",function(){UpdatingTextCounter.attachTo(".custom-timeline-name-field",{maxLength:25,superwarnLength:20,warnLength:15,textSelector:"#custom-timeline-name",counterSelector:".custom-timeline-name-count"}),UpdatingTextCounter.attachTo(".custom-timeline-description-field",{maxLength:160,superwarnLength:150,warnLength:140,textSelector:"#custom-timeline-description",counterSelector:".custom-timeline-description-count"})}),this.after("initialize",function(){this.on(document,"uiOpenCreateCustomTimelineDialog",this.openDialog)})}var defineComponent=require("core/component"),UpdatingTextCounter=require("app/ui/compose/updating_text_counter"),withDialog=require("app/ui/with_dialog"),withCreateOrEditCustomTimelineDialog=require("app/ui/dialogs/with_create_or_edit_custom_timeline_dialog"),template=require("template");module.exports=defineComponent(withDialog,withCreateOrEditCustomTimelineDialog,createCustomTimelineDialog)
});
define("app/ui/with_custom_timeline_create_button",["module","require","exports"],function(module, require, exports) {
module.exports=function(){this.defaultAttrs({createCustomTimelineSelector:".js-create-custom-timeline-button"}),this.openCreateDialog=function(){this.trigger("uiOpenCreateCustomTimelineDialog",{tweetId:this.tweetId,impressionId:this.impressionId})},this.after("initialize",function(){this.on("click",{createCustomTimelineSelector:this.openCreateDialog})})}
});
define("app/ui/dialogs/curate_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/with_custom_timeline_create_button","app/data/with_scribe","template"],function(module, require, exports) {
function curateDialog(){this.defaultAttrs({top:90,closeOnOtherDialogOpened:!0,timelineSelectorSelector:".timeline-selector",wasMemberSelector:".timeline-item .was-member",wasNotMemberSelector:".timeline-item .was-not-member",submitSelector:".js-submit"}),this.openDialog=function(a,b){var c=template["dialogs/curate_dialog"].render({},template);this.$node.html(c),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector),this.tweetId=b.tweetId,this.impressionId=b.impressionId,this.trigger("uiNeedsFullCustomTimelines",{tweetId:b.tweetId}),this.scribe({component:"curate_dialog",action:"open"},b),this.open()},this.renderFullTimelinesList=function(a,b){this.select("timelineSelectorSelector").html(b.html)},this.submitChanges=function(){function a(a){return a.map(function(){return $(this).attr("data-timeline-id")}).get()}this.select("submitSelector").attr("disabled",!0);var b=this.select("wasMemberSelector").filter(":not(:checked)"),c=this.select("wasNotMemberSelector").filter(":checked"),d={removed:a(b),added:a(c),tweetId:this.tweetId,impressionId:this.impressionId};this.trigger("uiCurateTweets",d)},this.after("initialize",function(){this.on(document,"uiOpenCurateDialog",this.openDialog),this.on(document,"dataGotFullCustomTimelines",this.renderFullTimelinesList),this.on(document,"dataTweetsCurated",this.close),this.on("click",{submitSelector:this.submitChanges})})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withCustomTimelineCreateButton=require("app/ui/with_custom_timeline_create_button"),withScribe=require("app/data/with_scribe"),template=require("template");module.exports=defineComponent(withDialog,curateDialog,withCustomTimelineCreateButton,withScribe)
});
define("app/ui/dialogs/delete_tweet_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/dialogs/with_modal_tweet"],function(module, require, exports) {
function deleteTweetDialog(){this.defaultAttrs({cancelSelector:".cancel-action",deleteSelector:".delete-action"}),this.openDeleteTweet=function(a,b){this.attr.sourceEventData=b,this.displayTweet(b.tweetId,{modal:"delete"}),this.id=b.id,this.open()},this.deleteTweet=function(){this.trigger("uiDidDeleteTweet",{id:this.id,sourceEventData:this.attr.sourceEventData})},this.deleteTweetSuccess=function(a,b){this.trigger("uiDidDeleteTweetSuccess",this.attr.sourceEventData),this.close()},this.restoreFocusToTweet=function(a){$(a.target).is(this.$dialog)&&this.activeEl&&this.trigger($(this.activeEl).closest(".tweet"),"uiShouldAddFocusStyle")},this.after("initialize",function(){this.on("click",{cancelSelector:this.close,deleteSelector:this.deleteTweet}),this.on(document,"uiOpenDeleteDialog",this.openDeleteTweet),this.on(document,"dataDidDeleteTweet",this.deleteTweetSuccess),this.on(document,"uiDialogRestorePreviousFocus",this.restoreFocusToTweet),this.on(document,"uiCloseDeleteTweetDialog",this.close)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withModalTweet=require("app/ui/dialogs/with_modal_tweet"),DeleteTweetDialog=defineComponent(deleteTweetDialog,withDialog,withModalTweet);module.exports=DeleteTweetDialog
});
define("app/data/dm/utils",["module","require","exports"],function(module, require, exports) {
var console={log:function(){var a=Array.prototype.slice.call(arguments);alert(a.map(function(a){return JSON.stringify(a)}).join(" "))}};module.exports={triggerFn:function(a,b,c){var b=Array.isArray(b)?b:[b];return function(d){b.forEach(function(b){var e=$.isFunction(b)?b(d):b,f=$.isFunction(c)?c(d):c;e&&$(a).trigger(e,f||d)})}},chain:function(){var a=Array.prototype.slice.call(arguments);return function(){var b=Array.prototype.slice.call(arguments);for(var c in a)$.isFunction(a[c])&&a[c].apply(a[c],b)}}}
});
define("app/data/dm/add_participants",["module","require","exports","core/component","app/data/with_data","app/data/dm/utils"],function(module, require, exports) {
function addParticipants(){this.defaultAttrs({noShowError:!0}),this.addParticipants=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/add_participants",data:{id:b.conversation_id,participant_ids:b.participant_ids},eventData:b,success:triggerFn(a.target,"dataDMConversationResult"),error:triggerFn(a.target,"dataDMError")})},this.after("initialize",function(){this.on("uiAddConversationParticipants",this.addParticipants)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn;module.exports=defineComponent(addParticipants,withData)
});
define("app/utils/dm/dm_utils",["module","require","exports","core/i18n","app/utils/string"],function(module, require, exports) {
var _=require("core/i18n"),StringUtils=require("app/utils/string"),dmUtils={generateConversationName:function(a){if(a.length==1)return a[0].name;if(a.length==2)return _('{{first}}, {{second}}',{first:a[0].name,second:a[1].name});if(a.length>2)return _('{{first}} + {{count}}',{first:a[0].name,count:a.length-1})},generateConversationId:function(a,b){if(a&&b){var c=[a,b];return(StringUtils.compare(c[0],c[1])<0?c:c.reverse()).join("-")}},sortRecipients:function(a){return(a||[]).sort(function(a,b){return StringUtils.compare(a.id,b.id)})}};module.exports=dmUtils
});
define("app/ui/dm/tokenized_multiselect",["module","require","exports","core/component","app/ui/compose/with_text_editor","template","app/utils/keycode_map"],function(module, require, exports) {
function tokenizedMultiselect(){this.keymap=keymap;var a=0,b=1;this.attributes({textSelector:"textarea.TokenizedMultiselect-input",inputContainerSelector:".TokenizedMultiselect-inputContainer",textMinWidth:100,tokenClass:"InputToken",tokenSelector:".InputToken",tokenTemplate:"dm/tokenized_multiselect_token",focusedTokenSelector:".InputToken:focus",tokenDeleteClass:"InputToken-delete",tokenDeleteSelector:".InputToken-delete",highlightedClass:"is-highlighted",highlightedSelector:".is-highlighted",selectedClass:"is-selected",suggestionClass:"TokenizedMultiselect-suggestion",suggestionSelector:".TokenizedMultiselect-suggestion",suggestionsContainerSelector:".TokenizedMultiselect-suggestionsContainer",maxItems:50}),this.handleKeyPress=function(c){if(c.type!="keydown"||c.shiftKey)return;var d=c.which||c.keycode,e=this.select("focusedTokenSelector").length,f=this.select("highlightedSelector").length,g=!this.$text.val();switch(d){case keymap.TAB:e?(c.preventDefault(),c.stopPropagation(),this.focusInput()):f&&(c.preventDefault(),c.stopPropagation(),this.tokenizeHighlightedSuggestion());break;case keymap.ENTER:c.preventDefault(),this.toggleTokenization();break;case keymap.ESC:f&&(c.preventDefault(),c.stopPropagation(),this.clearHighlight());break;case keymap.BACKSPACE:e?(this.removeFocusedToken(),c.preventDefault()):g&&(this.removeLastToken(),c.preventDefault());break;case keymap.DELETE:e&&this.removeFocusedToken();break;case keymap.UP:c.preventDefault(),e&&this.focusInput(),this.moveSuggestionHighlight(b);break;case keymap.DOWN:c.preventDefault(),e&&this.focusInput(),this.moveSuggestionHighlight(a);break;case keymap.LEFT:e?this.focusNeighbor(b):g&&this.focusLastToken();break;case keymap.RIGHT:e&&this.focusNeighbor(a)}},this.focusNeighbor=function(b){var c=b==a?"next":"prev";$focusedToken=this.select("focusedTokenSelector"),$focusedToken.length&&$focusedToken[c]().focus()},this.focusLastToken=function(){this.select("tokenSelector").last().focus()},this.focusInput=function(){this.$text.focus()},this.removeFocusedToken=function(b){var c=this.select("focusedTokenSelector");b&&b.type=="click"?this.focusInput():this.focusNeighbor(a),this.removeToken(c)},this.removeLastToken=function(){this.removeToken(this.select("tokenSelector").last())},this.removeToken=function(a){a.length&&(this.trigger("uiTokenizedMultiselectTokenRemoved",{text:a.attr("data-token-text"),id:a.attr("data-token-id")}),a.remove())},this.getFirstSuggestion=function(){return this.select("suggestionSelector").first()},this.getHighlightedSuggestion=function(){return this.select("highlightedSelector").first()},this.getNeighboringSuggestion=function(b,c){var d=c==a?"nextAll":"prevAll";return b[d](this.attr.suggestionSelector).first()},this.moveSuggestionHighlight=function(a){var b=this.getHighlightedSuggestion(),c=this.getNeighboringSuggestion(b,a);b.length?c.length&&this.setHighlight(c):this.setHighlight(this.getFirstSuggestion())},this.toggleTokenization=function(){var a=this.getHighlightedSuggestion(),b=a.attr("data-token-id");this.isTokenized(a)?(this.removeToken(this.select("tokenSelector").filter('[data-token-id="'+b+'"]')),this.$text.val("").focus()):this.tokenizeHighlightedSuggestion()},this.tokenizeHighlightedSuggestion=function(){var a=this.getHighlightedSuggestion();if(!this.canTokenize(a))return;var b=this.select("tokenSelector").last(),c=$(template[this.attr.tokenTemplate].render({token_class:this.attr.tokenClass,token_delete_class:this.attr.tokenDeleteClass,token_text:a.attr("data-token-text"),token_id:a.attr("data-token-id")},template));a.addClass(this.attr.selectedClass),this.$text.before(c),this.$text.val("").focus(),this.trigger("uiTokenizedMultiselectTokenAdded",{text:c.attr("data-token-text"),id:c.attr("data-token-id")})},this.isTokenized=function(a){return $.inArray(a.attr("data-token-id"),this.getSelectedItemsIds())>=0},this.canTokenize=function(a){var b=this.select("tokenSelector").length>=this.attr.maxItems;return!b&&a.length&&!this.isTokenized(a)},this.getSelectedItemsIds=function(){return $.map(this.select("tokenSelector"),function(a){return $(a).attr("data-token-id")})},this.getSelectedItems=function(){return $.map(this.select("tokenSelector"),function(a){return{id:$(a).attr("data-token-id"),text:$(a).attr("data-token-text")}})},this.handleTextChange=function(a,b){this.trigger("uiTokenizedMultiselectTextChanged",{text:b.text,selected_items:this.getSelectedItemsIds()})},this.handleMouseOver=function(a){this.setHighlight($(a.target).closest(this.attr.suggestionSelector))},this.updateWidth=function(){var a=this.select("tokenSelector").last();if(a.length){var b=this.select("inputContainerSelector").width()-a.position().left-a.outerWidth(!0),c=b<this.attr.textMinWidth?"100%":b;this.$text.outerWidth(c)}this.$text.prop("scrollHeight")>this.$text.prop("clientHeight")&&this.$text.outerWidth("100%")},this.selectedItemsChanged=function(){this.trigger("uiTokenizedMultiselectItemSelectionChanged",{selected_items:this.getSelectedItems()})},this.updateScroll=function(){var a=this.getHighlightedSuggestion(),b=this.select("suggestionsContainerSelector"),c=b.prop("scrollTop"),d=a.position().top+a.outerHeight();if(d>b.height()){var e=d-b.height();b.scrollTop(c+e)}else a.position().top<0&&b.scrollTop(c+a.position().top)},this.reset=function(){this.select("tokenSelector").remove(),this.$text.val("")},this.setMaxItems=function(a){this.attr.maxItems=a.maxItems},this.handleTokenChange=function(){this.updateWidth(),this.selectedItemsChanged()},this.updateSuggestions=function(a,b){var c=b.html,d=b.preserve_previous_hightlight,e=this.select("highlightedSelector").first().attr("data-token-id");this.clearHighlight(),this.select("suggestionsContainerSelector").html(c);if(d){var f=this.select("suggestionSelector").filter('[data-token-id="'+e+'"]').first(),g=f.length?f:this.select("suggestionSelector").first();this.setHighlight(g)}},this.clearHighlight=function(){this.select("suggestionSelector").removeAttr("id aria-selected").removeClass(this.attr.highlightedClass),this.$text.removeAttr("aria-activedescendant")},this.setHighlight=function(a){this.clearHighlight();var b="tokenizedMultiselectHighlight"+Math.floor(Math.random()*1e10).toString();a.addClass(this.attr.highlightedClass).attr({id:b,"aria-selected":!0}),this.$text.attr("aria-activedescendant",b)},this.after("moveSuggestionHighlight",this.updateScroll),this.after("tokenizeHighlightedSuggestion",this.handleTokenChange),this.after("toggleTokenization",this.handleTokenChange),this.after("removeFocusedToken",this.handleTokenChange),this.after("removeLastToken",this.handleTokenChange),this.after("reset",this.handleTokenChange),this.setupAria=function(){var a="TokenizedMultiselectOwns"+Math.floor(Math.random()*1e10).toString();this.select("suggestionsContainer").attr("id",a),this.$text.attr("aria-owns",a)},this.after("initialize",function(){this.initTextNode(),this.attr.placeholderText=this.$text.attr("placeholder"),this.setupAria(),this.on("uiTextChanged",this.handleTextChange),this.on("uiTextChanged",this.updateWidth),this.on("keyup keydown keypress paste",this.handleKeyPress),this.on("uiResetTokenizedMultiselect",this.reset),this.on("uiTokenizedMultiSelectMaxItems",this.setMaxItems),this.on("uiTokenizedMultiselectSuggestions",this.updateSuggestions),this.on("mouseover",{suggestionSelector:this.handleMouseOver}),this.on("click",{suggestionSelector:this.toggleTokenization,tokenDeleteSelector:this.removeFocusedToken})})}var defineComponent=require("core/component"),withTextEditor=require("app/ui/compose/with_text_editor"),template=require("template"),keymap=require("app/utils/keycode_map"),TokenizedMultiselect=defineComponent(tokenizedMultiselect,withTextEditor);module.exports=TokenizedMultiselect
});
define("app/ui/dm/typeahead",["module","require","exports","core/i18n","core/component","app/ui/dm/tokenized_multiselect","template","app/utils/with_no_teardown_child_components"],function(module, require, exports) {
function dmTypeahead(){this.attributes({textSelector:"textarea.TokenizedMultiselect-input",selectedClass:"is-selected",suggestionClass:"DMTypeaheadSuggestion",suggestionSelector:".DMTypeaheadSuggestion",highlightedClass:"is-highlighted",highlightedSelector:".is-highlighted",suggestionsContainerSelector:".DMTypeaheadSuggestionsContainer",tokenIdDelimiter:"::",suggestionsTemplate:"dm/typeahead_suggestions",topAccountsLength:5,accountsDatasource:"dmAccounts",conversationsDatasource:"dmConversations",typeaheadSrc:"compose_message",preselectedItems:[],maxItems:50}),this.buildAccountTemplateData=function(a){var b=this.generateTokenId(this.attr.accountsDatasource,a.id),c=this.isItemSelected(b),d=this.isPreSelected(a.id),e=d?"":this.attr.suggestionClass;return{data_token_id:b,data_token_text:a.name,suggestion_class:e,title:{text:a.name,screen_name:a.screen_name,verified:a.verified},avatar:{images:{src:a.profile_image_url_https,alt:a.name}},selected:c,preselected:d,is_group:!1}},this.buildGroupTemplateData=function(a){return{data_token_id:this.generateTokenId(this.attr.conversationsDatasource,a.id),data_token_text:a.title,suggestion_class:this.attr.suggestionClass,html:a.html,is_group:!0}},this.buildTemplateDataFromDMConversation=function(a){if(a.is_group)return this.buildGroupTemplateData(a);if(a.participants.length==1)return this.buildAccountTemplateData(a.participants[0])},this.processEmptyQuerySuggestions=function(a){var b=a.suggestions.dmConversations||[],c=b.map(this.buildTemplateDataFromDMConversation.bind(this)),d=template["dm/typeahead_initial_suggestions"].render({suggestions:c},template);this.trigger("uiTokenizedMultiselectSuggestions",{html:d,preserve_previous_hightlight:!1})},this.processNonEmptyQuerySuggestions=function(a){var b=(a.suggestions.dmAccounts||[]).map(this.buildAccountTemplateData.bind(this)),c=(a.suggestions.dmConversations||[]).map(this.buildGroupTemplateData.bind(this)),d=c.length?b.slice(0,this.attr.topAccountsLength):b,e=template[this.attr.suggestionsTemplate].render({accounts:d,groups:c,has_accounts:d.length,has_groups:c.length},template);this.trigger("uiTokenizedMultiselectSuggestions",{html:e,preserve_previous_hightlight:!0})},this.processSuggestions=function(a,b){var c=b.queryData&&b.queryData.query;if(!b.suggestions||this.currentQuery!=c)return;c==""?this.processEmptyQuerySuggestions(b):this.processNonEmptyQuerySuggestions(b)},this.requestEmptyQuerySuggestions=function(){var a=this.attr.preselectedItems||[],b={id:this.typeaheadId,queryData:{query:"",dmConversationsOptions:{excludeGroups:this.selectedItems.length||a.length,sortBySortId:!0,excludeOneToOnes:!1}},datasources:[this.attr.conversationsDatasource]};this.trigger("uiNeedsTypeaheadSuggestions",b)},this.requestSuggestions=function(a,b){this.currentQuery=b.text;if(this.currentQuery==""){this.requestEmptyQuerySuggestions();return}var c=this.attr.preselectedItems||[],d=this.selectedItems.length||c.length,e=d?[this.attr.accountsDatasource]:[this.attr.accountsDatasource,this.attr.conversationsDatasource],f={id:this.typeaheadId,queryData:{query:b.text,typeaheadSrc:this.attr.typeaheadSrc,dmConversationsOptions:{excludeGroups:d,sortBySortId:!1,excludeOneToOnes:!d}},datasources:e};this.trigger("uiNeedsTypeaheadSuggestions",f)},this.splitTokenId=function(a){var b=a.split(this.attr.tokenIdDelimiter);return{datasource:b[0],id:b[1]}},this.handleItemSelected=function(a,b){this.selectedItems=b.selected_items||[];var c=this.selectedItems.map(function(a){var b=this.splitTokenId(a.id);return{datasource:b.datasource,id:b.id,text:a.text}},this),d=c.filter(function(a){return a.datasource==this.attr.accountsDatasource},this).map(function(a){return{id:a.id,name:a.text}}),e=c.filter(function(a){return a.datasource==this.attr.conversationsDatasource},this).map(function(a){return{id:a.id,name:a.text}});this.trigger("uiDMTypeaheadSelectedItemsChanged",{accounts:d,groups:e})},this.generateTokenId=function(a,b){return a+this.attr.tokenIdDelimiter+b},this.isItemSelected=function(a){var b=this.selectedItems.map(function(a){return a.id});return $.inArray(a+"",b||[])>=0},this.isPreSelected=function(a){return $.inArray(a+"",this.attr.preselectedItems||[])>=0},this.resetAndInitialize=function(a,b){this.select("suggestionsContainerSelector").empty(),this.trigger("uiResetTokenizedMultiselect"),this.attr.preselectedItems=b&&b.preselectedItems&&b.preselectedItems.length?b.preselectedItems:[],b&&b.maxItems&&(this.attr.maxItems=b.maxItems,this.trigger("uiTokenizedMultiSelectMaxItems",{maxItems:b.maxItems})),this.selectedItems=[],this.requestEmptyQuerySuggestions(),this.currentQuery=""},this.after("handleItemSelected",this.requestEmptyQuerySuggestions),this.handleTokenChangeAccessibility=function(a,b){var c=this.splitTokenId(b.id);if(c.datasource==this.attr.accountsDatasource){var d=a.type=="uiTokenizedMultiselectTokenAdded"?_('{{user}} hinzugef\xfcgt',{user:b.text}):_('{{user}} entfernt',{user:b.text});this.trigger("uiShouldSpeakMessage",{message:d})}},this.after("initialize",function(){this.typeaheadId="dm_typeahead"+Math.floor(Math.random()*1e6),this.attachChild(TokenizedMultiselect,this.$node,this.attr),this.on("uiTokenizedMultiselectTokenAdded uiTokenizedMultiselectTokenRemoved",this.handleTokenChangeAccessibility),this.on("uiTokenizedMultiselectTextChanged",this.requestSuggestions),this.on(document,"dataTypeaheadSuggestionsResults",this.processSuggestions),this.on("uiTokenizedMultiselectItemSelectionChanged",this.handleItemSelected),this.on("uiInitializeDMTypeahead",this.resetAndInitialize),this.selectedItems=[],this.requestEmptyQuerySuggestions()})}var _=require("core/i18n"),defineComponent=require("core/component"),TokenizedMultiselect=require("app/ui/dm/tokenized_multiselect"),template=require("template"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),DMTypeahead=defineComponent(dmTypeahead,withNoTeardownChildComponents);module.exports=DMTypeahead
});
define("app/ui/dm/compose/activity",["module","require","exports","core/component","app/utils/dm/dm_utils","app/utils/guard","app/utils/keycode_map","lib/twitter-text","core/utils","app/ui/dm/typeahead","app/utils/with_no_teardown_child_components"],function(module, require, exports) {
function dmCompose(){this.attributes({nextButtonSelector:".dm-initiate-conversation",dmTypeaheadSelector:".DMDialogTypeahead",maxParticipants:50,currentUserId:null}),this.enable=function(){this.select("nextButtonSelector").removeClass("disabled").attr("disabled",!1)},this.disable=function(){this.select("nextButtonSelector").addClass("disabled").attr("disabled",!0)},this.isGroupSelected=function(a,b){return b&&b.groups&&b.groups.length},this.initiateConversationFromSelectedGroup=function(a,b){var c=b.groups[0];this.initiateConversation("uiRenderConversationView",{conversation_id:c.id,name:c.name})},this.isNextButtonSelected=function(a,b){return a.type=="click"||a.type=="keydown"&&a.which==keymap.ENTER},this.initiateConversationFromSelectedAccounts=function(){var a,b;switch(this.selectedAccounts.length){case 0:a="uiRenderNewConversationView",b={name:"@"+this.manualScreenName,screen_names:this.manualScreenName?[this.manualScreenName]:[]};break;case 1:var c=this.selectedAccounts[0];a="uiRenderConversationView",b={conversation_id:dmUtils.generateConversationId(this.attr.currentUserId,c.id),name:c.name,is_oto:!0};break;default:var d=this.selectedAccounts.map(function(a){return a.id});a="uiRenderNewConversationView",b={name:dmUtils.generateConversationName(this.selectedAccounts),recipient_ids:d}}this.initiateConversation(a,b)},this.reset=function(a,b){this.trigger("uiInitializeDMTypeahead"),this.defaultComposerText=b&&b.default_composer_text||""},this.storeSelectedAccounts=function(a,b){this.selectedAccounts=b.accounts||[]},this.handleTextChange=function(a,b){var c=(b.text||"").replace(/^@/,"");this.manualScreenName=twitterText.isValidUsername("@"+c)?c:""},this.initiateConversation=function(a,b){this.trigger(a,utils.merge(b,{default_composer_text:this.defaultComposerText,retain_tweet_attachment:!0})),this.reset()},this.updateState=function(a,b){var c=this.manualScreenName,d=this.selectedAccounts.length;c||d?this.enable():this.disable()},this.after("handleTextChange",this.updateState),this.after("storeSelectedAccounts",this.updateState),this.after("reset",this.updateState),this.after("initialize",function(){this.attachChild(DMTypeahead,this.$node,{maxItems:this.attr.maxParticipants-1}),this.selectedAccounts=[],this.on("uiDMTypeaheadSelectedItemsChanged",this.storeSelectedAccounts),this.on("uiDMTypeaheadSelectedItemsChanged",guard(this.initiateConversationFromSelectedGroup,this.isGroupSelected)),this.on("uiTextChanged",this.handleTextChange),this.on("click keydown",{nextButtonSelector:guard(this.initiateConversationFromSelectedAccounts,this.isNextButtonSelected)}),this.on(document,"uiOpenNewDM",this.reset)})}var defineComponent=require("core/component"),dmUtils=require("app/utils/dm/dm_utils"),guard=require("app/utils/guard"),keymap=require("app/utils/keycode_map"),twitterText=require("lib/twitter-text"),utils=require("core/utils"),DMTypeahead=require("app/ui/dm/typeahead"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),DMCompose=defineComponent(dmCompose,withNoTeardownChildComponents);module.exports=DMCompose
});
define("app/ui/dm/add_participants/activity",["module","require","exports","core/component","app/ui/dm/typeahead","app/utils/with_no_teardown_child_components"],function(module, require, exports) {
function addParticipants(){this.attributes({addParticipantsSelector:".DMAddParticipants",addParticipantsInputSelector:".TokenizedMultiselect-input",addParticipantsDoneSelector:".DMAddParticipants-done",dialogBodySelector:".DMAddParticipants-content",spinnerSelector:".DMAddParticipants-spinner"}),this.setParticipants=function(a,b){if(!this.conversationId||this.conversationId!=b.conversation_id)return;this.resetDMTypeahead(b),this.select("dialogBodySelector").css("visibility","visible"),this.select("spinnerSelector").addClass("u-hidden"),this.select("addParticipantsInputSelector").focus()},this.resetDMTypeahead=function(a){var b=a||{};this.trigger(this.attr.addParticipantsSelector,"uiInitializeDMTypeahead",{preselectedItems:b.participants,maxItems:b.additional_participants_allowed})},this.prepareAddParticipants=function(a,b){this.conversationId=b.conversation_id,this.select("dialogBodySelector").css("visibility","hidden"),this.select("spinnerSelector").removeClass("u-hidden"),this.resetDMTypeahead(),this.trigger("uiNeedsDMConversation",{conversation_id:b.conversation_id})},this.addParticipants=function(){this.conversationId&&this.selectedAccounts.length&&this.trigger("uiAddConversationParticipants",{conversation_id:this.conversationId,participant_ids:this.selectedAccounts}),this.trigger("uiDMAddParticipantsDone")},this.handleSelectedItems=function(a,b){var c=b&&b.accounts&&b.accounts.length?b.accounts:[];this.selectedAccounts=c.map(function(a){return a.id})},this.possibleAddParticipants=function(a,b){(a.type=="click"||a.type=="keydown"&&a.which==keymap.ENTER)&&this.addParticipants()},this.after("initialize",function(){this.attachChild(DMTypeahead,this.select("addParticipantsSelector")),this.selectedAccounts=[],this.on("uiDMTypeaheadSelectedItemsChanged",this.handleSelectedItems),this.on("dataDMConversationResult",this.setParticipants),this.on("uiAddParticipants",this.prepareAddParticipants),this.on("click keydown",{addParticipantsDoneSelector:this.possibleAddParticipants})})}var defineComponent=require("core/component"),DMTypeahead=require("app/ui/dm/typeahead"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components");module.exports=defineComponent(addParticipants,withNoTeardownChildComponents)
});
define("app/ui/dm/conversation/conversation_actions",["module","require","exports","core/component"],function(module, require, exports) {
function conversationActions(){this.attributes({conversationIdSelector:"[data-conversation-id]",conversationTypeSelector:"[data-is-oto]",addParticipantsSelector:".js-actionAddParticipants",viewParticipantsSelector:".js-actionViewParticipants",editConversationNameSelector:".js-actionEditConversationName",deleteConversationSelector:".js-actionDeleteConversation",reportConversationSelector:".js-actionReportConversation",enableNotificationsSelector:".js-actionEnableNotifications",disableNotificationsSelector:".js-actionDisableNotifications",actionsContainerSelector:".DMConversationActions-content"}),this.getConversationId=function(){return this.select("conversationIdSelector").attr("data-conversation-id")},this.isGroupConversation=function(){return!this.select("conversationTypeSelector").data("is-oto")},this.toggleNotificationsAction=function(a){this.select("enableNotificationsSelector").toggleClass("u-hidden",!!a),this.select("disableNotificationsSelector").toggleClass("u-hidden",!a)},this.toggleNotifications=function(a){this.trigger("uiToggleNotifications",{conversation_id:this.getConversationId(),enable_notifications:a})},this.updateNotificationsState=function(a,b){switch(a.type){case"dataDMConversationResult":b.conversation_actions&&this.getConversationId()==b.conversation_actions.conversation_id&&this.toggleNotificationsAction(b.conversation_actions.notifications);break;case"dataNotificationsEnabled":case"dataNotificationsDisableFailed":this.getConversationId()==b.sourceEventData.conversation_id&&this.toggleNotificationsAction(!0);break;case"dataNotificationsDisabled":case"dataNotificationsEnableFailed":this.getConversationId()==b.sourceEventData.conversation_id&&this.toggleNotificationsAction(!1)}},this.triggerAction=function(a){this.trigger(a,{conversation_id:this.getConversationId(),is_group:this.isGroupConversation()})},this.after("initialize",function(){this.on("uiEnableDMNotifications",this.toggleNotifications.bind(this,!0)),this.on("uiEnableDMNotifications",this.toggleNotificationsAction.bind(this,!0)),this.on("uiDisableDMNotifications",this.toggleNotifications.bind(this,!1)),this.on("uiDisableDMNotifications",this.toggleNotificationsAction.bind(this,!1)),this.on("click",{enableNotificationsSelector:"uiEnableDMNotifications",disableNotificationsSelector:"uiDisableDMNotifications",addParticipantsSelector:this.triggerAction.bind(this,"uiAddParticipants"),viewParticipantsSelector:this.triggerAction.bind(this,"uiViewParticipants"),editConversationNameSelector:this.triggerAction.bind(this,"uiEditConversationName"),deleteConversationSelector:this.triggerAction.bind(this,"uiShowDMDeleteConversationConfirmation"),reportConversationSelector:this.triggerAction.bind(this,"uiShowDMReportConversationConfirmation"),actionsContainerSelector:"uiCloseDropdowns"}),this.on("dataDMConversationResult dataNotificationsEnabled dataNotificationsDisabled dataNotificationsEnableFailed dataNotificationsDisableFailed",this.updateNotificationsState)})}var defineComponent=require("core/component"),ConversationActions=defineComponent(conversationActions);module.exports=ConversationActions
});
define("app/ui/dm/conversation/conversation_history",["module","require","exports","core/component","core/utils"],function(module, require, exports) {
function conversationHistory(){this.requestAnimationFrame=window.requestAnimationFrame.bind(window),this.attributes({conversationContentSelector:".DMConversation-content",pageBackRange:500,scrollContainerSelector:".DMConversation-scrollContainer",spinnerSelector:".DMConversation-spinner"}),this.checkForConversationHistory=function(){this.requestAnimationFrame(function(){var a=!this.$spinner.hasClass("u-hidden")&&this.$scrollContainer.prop("clientHeight")!=0&&(this.$content.prop("clientHeight")<this.$scrollContainer.prop("clientHeight")||this.$scrollContainer.prop("scrollTop")<this.attr.pageBackRange);a&&this.trigger("uiWantsConversationHistory")}.bind(this))},this.after("initialize",function(){this.$content=this.select("conversationContentSelector"),this.$scrollContainer=this.select("scrollContainerSelector"),this.$spinner=this.select("spinnerSelector"),this.on(this.$scrollContainer,"scroll",utils.debounce(this.checkForConversationHistory,250)),this.on("uiDMConversationUpdated",this.checkForConversationHistory)})}var defineComponent=require("core/component"),utils=require("core/utils");module.exports=defineComponent(conversationHistory)
});
define("app/data/dm/dm_info",["module","require","exports"],function(module, require, exports) {
var data={};module.exports={get:function(a){return data[a]},set:function(a){data=a||{}},clear:function(){this.set({})}}
});
define("app/ui/dm/sending_state_indicator",["module","require","exports","core/component","template"],function(module, require, exports) {
function sendStateIndicator(){this.attributes({template:"dm/dm_sending_state_indicator",indicatorDelay:1e3}),this.state={current:0,conversationId:undefined,isVisible:!1,previousInFlight:0,total:0},this.render=function(){this.$node.html(template[this.attr.template].render({total:this.state.total,current:this.state.current},template)),this.state.isVisible?this.timeout=setTimeout(function(){this.state.isVisible?this.$node.slideDown(300):this.$node.hide()}.bind(this),this.attr.indicatorDelay):(clearTimeout(this.timeout),this.$node.slideUp(100))},this.updateCount=function(a,b){var c=b[this.state.conversationId]||0;c==0?(this.state.total=0,this.state.current=0):this.state.previousInFlight==0?(this.state.total=c,this.state.current=1):this.state.previousInFlight<c?this.state.total=this.state.total+1:this.state.previousInFlight>c&&(this.state.current=this.state.current+1),this.state.previousInFlight=c,this.state.isVisible=c>0},this.updateConversationId=function(a,b){this.state={isVisible:!1,total:0,conversationId:b.conversation_id,current:0,previousInFlight:0},this.trigger("uiDMConversationNeedsInFlightState")},this.after("updateCount",this.render),this.after("updateConversationId",this.render),this.after("initialize",function(){this.on(document,"dataDMMessagesInFlight",this.updateCount),this.on(document,"uiRenderConversationView",this.updateConversationId)})}var defineComponent=require("core/component"),template=require("template");module.exports=defineComponent(sendStateIndicator)
});
define("app/ui/dm/conversation/delete_conversation",["module","require","exports","core/component"],function(module, require, exports) {
function deleteConversation(){this.attributes({notice:".DMDeleteConversation",confirm:".DMDeleteConversation-confirm",cancel:".DMDeleteConversation-cancel",groupVariantClass:"DMDeleteConversation--group"}),this.showConfirmation=function(a,b){var c=b&&b.is_group;this.select("notice").toggleClass(this.attr.groupVariantClass,!!c).trigger("uiShowDMNotice")},this.hideConfirmation=function(){this.select("notice").trigger("uiDismissDMNotice")},this.state=function(a,b){return this._state=b||this._state||{},this._state},this.deleteConversation=function(){var a=this.state();this.trigger("uiDeleteConversation",{conversation_id:a.conversation_id}),this.hideConfirmation(),this.trigger("uiDMInboxWantsRefreshed")},this.after("initialize",function(){this.on("uiShowDMDeleteConversationConfirmation",this.state),this.on("uiShowDMDeleteConversationConfirmation",this.showConfirmation),this.on("click",{confirm:this.deleteConversation,cancel:this.hideConfirmation})})}var defineComponent=require("core/component"),DeleteConversation=defineComponent(deleteConversation);module.exports=DeleteConversation
});
define("app/ui/dm/conversation/delete_message",["module","require","exports","core/component"],function(module, require, exports) {
function deleteMessage(){this.attributes({notice:".DMDeleteMessage",confirm:".DMDeleteMessage-confirm",cancel:".DMDeleteMessage-cancel"}),this.showConfirmation=function(){this.select("notice").trigger("uiShowDMNotice")},this.hideConfirmation=function(){this.select("notice").trigger("uiDismissDMNotice")},this.state=function(a,b){return this._state=b||this._state||{},this._state},this.deleteMessage=function(){var a=this.state();this.trigger("uiDMDialogDeleteMessage",{id:a.messageId,conversation_id:a.conversationId}),this.hideConfirmation(),this.trigger("uiDMInboxWantsRefreshed")},this.after("initialize",function(){this.on("uiShowDMDeleteMessageConfirmation",this.state),this.on("uiShowDMDeleteMessageConfirmation",this.showConfirmation),this.on("click",{confirm:this.deleteMessage,cancel:this.hideConfirmation})})}var defineComponent=require("core/component"),DeleteMessage=defineComponent(deleteMessage);module.exports=DeleteMessage
});
define("app/ui/dm/conversation/emoji_bar",["module","require","exports","core/component"],function(module, require, exports) {
function emojiBar(){this.attributes({emojiSuggestionSelector:".EmojiBar-suggestion"}),this.suggest=function(a,b){var c=$(a.target).closest(this.attr.emojiSuggestionSelector).data("text");c&&this.trigger("uiEmojiSuggestion",{text:c})},this.after("initialize",function(){this.on("click",{emojiSuggestionSelector:this.suggest})})}var defineComponent=require("core/component");module.exports=defineComponent(emojiBar)
});
define("app/ui/b2c/feedback_panel",["module","require","exports","core/component","app/utils/b2c/with_iframe_events_proxy","app/utils/with_iframe_height_adjuster","core/i18n"],function(module, require, exports) {
function feedbackPanel(){this.attributes({feedbackDismissSelector:".DMFeedback-dismiss",feedbackSelector:".DMFeedback",feedbackPageFrameSelector:"iframe.B2CFeedback"}),this.showFeedback=function(a){this.$b2cFeedback.is(":visible")||this.$b2cFeedback.show();var b="/i/pages/feedback?cardUri="+encodeURIComponent(a);this.$feedbackIframe.attr("src")!=b&&this.$feedbackIframe.attr("src",b),this.trigger("uiFeedbackPanelOpened")},this.dismissFeedback=function(){var a=this.$feedbackIframe.data("current-view");this.closeFeedback(),this.trigger("uiB2CFeedbackDismiss",{cardName:this.feedback.name,feedbackId:this.feedback.feedback_id,currentView:a})},this.closeFeedback=function(){this.$b2cFeedback.hide(),this.$feedbackIframe.attr("src",""),this.trigger("uiFeedbackPanelClosed")},this.handleFeedbackError=function(a,b){var c=b&&b.errorMessage;this.trigger(document,"uiShowError",{message:c}),this.trigger("dataDMError",{message:c})},this.handleFeedbackTweetBtnClick=function(a,b){this.closeFeedback(),this.trigger(document,"uiOpenTweetDialog",{title:_('Twittere \xfcber Deine Erfahrung'),canTweetDefaultText:!1,text:b&&b.prefilledText})},this.updateFeedbackPanel=function(a,b){b&&b.feedback&&(this.feedback=b.feedback,this.showFeedback(this.feedback.card_uri))},this.handleFeedbackUpdateView=function(a,b){this.$feedbackIframe.data("current-view",b.view)},this.resizeIframe=function(a){this.fitIframeHeight(a,{iframeSelector:this.attr.feedbackPageFrameSelector,isQualified:function(a){return a.name&&a.name==="commerce_page"&&a.height}})},this.after("initialize",function(){this.$b2cFeedback=this.select("feedbackSelector"),this.$feedbackIframe=this.select("feedbackPageFrameSelector"),this.on("uiB2CCloseFeedbackAnchor uiDMDialogClearActions",this.closeFeedback),this.on("uiB2CFeedbackPostError",this.handleFeedbackError),this.on("uiB2CTweetBtnClicked",this.handleFeedbackTweetBtnClick),this.on("uiB2CFeedbackUpdateView",this.handleFeedbackUpdateView),this.on("uiDMConversationUpdated",this.updateFeedbackPanel),this.on(window,"message",this.resizeIframe),this.on(window,"message",this.proxyIframeEvents),this.on("click",{feedbackDismissSelector:this.dismissFeedback})})}var defineComponent=require("core/component"),withIframeEventsProxy=require("app/utils/b2c/with_iframe_events_proxy"),withIframeHeightAdjuster=require("app/utils/with_iframe_height_adjuster"),_=require("core/i18n"),FeedbackPanel=defineComponent(feedbackPanel,withIframeEventsProxy,withIframeHeightAdjuster);module.exports=FeedbackPanel
});
define("app/ui/with_dynamic_stylesheet",["module","require","exports"],function(module, require, exports) {
function withDynamicStylesheet(){this.createStyleSheet=function(a){var b=document.createElement("style");return b.type="text/css",a&&(b.id=a),document.getElementsByTagName("head")[0].appendChild(b),b.sheet||new ShimStyleSheet},this.rules=function(a){return a.cssRules?a.cssRules:a.rules},this.insertCSSRule=function(a,b){return a.insertRule(b,this.rules(a).length)},this.removeCSSRule=function(a,b){a.deleteRule(b)}}module.exports=withDynamicStylesheet;var ShimStyleSheet=function(){function a(){this.cssRules=[]}return a.prototype.insertRule=function(a,b){return this.cssRules[b]={cssText:a},b},a.prototype.deleteRule=function(a){delete this.cssRules[a],this.cssRules=this.cssRules.filter(function(a){a!=null})},a}()
});
define("app/ui/dm/conversation/message_actions",["module","require","exports","core/component","app/ui/with_dynamic_stylesheet"],function(module, require, exports) {
function messageActions(){this.defaultAttrs({deleteSelector:".DMDeleteMessageAction",reportSelector:".DMReportMessageAction"}),this.hideMessage=function(a,b){if(b.report_as!="not_spam"){this.hiddenMessages=this.hiddenMessages||{};var c=".DMConversation [data-message-id='"+b.id+"'] {display: none !important;}";this.hiddenMessages[b.id]=this.insertCSSRule(this.stylesheet,c)}},this.unhideMessage=function(a,b){this.hiddenMessages=this.hiddenMessages||{};var c=this.hiddenMessages[b.id];c!=null&&this.removeCSSRule(this.stylesheet,c)},this.messageAction=function(a,b){var c=$(b.target);this.trigger(a,{messageId:c.closest("[data-message-id]").attr("data-message-id"),conversationId:c.closest("[data-thread-id]").attr("data-thread-id")})},this.after("initialize",function(){this.stylesheet=this.createStyleSheet("hidden-dms"),this.on("uiDMDialogReportDM uiDMDialogDeleteMessage",this.hideMessage),this.on("dataDMDeleteFailed dataDMReportFailed",this.unhideMessage),this.on("click",{deleteSelector:this.messageAction.bind(this,"uiShowDMDeleteMessageConfirmation"),reportSelector:this.messageAction.bind(this,"uiShowDMReportMessageConfirmation")})})}var defineComponent=require("core/component"),withDynamicStylesheet=require("app/ui/with_dynamic_stylesheet"),MessageActions=defineComponent(messageActions,withDynamicStylesheet);module.exports=MessageActions
});
(function(a,b){typeof define=="function"&&define.amd?define(function(){return a.TwitterVideoPlayer=b()}):typeof module=="object"&&module.exports?module.exports=a.TwitterVideoPlayer=b():typeof provide=="function"?provide("bower_components/video-player/src/main/js/video_player",a.TwitterVideoPlayer=b()):a.TwitterVideoPlayer=b()})(this,function(){function f(a){if(a&&a.data&&a.data.params&&a.data.params[0]){var b=a.data.params[0],c=a.data.id;if(b&&b.context&&b.context==="TwitterVideoPlayer"){var d=b.playerId;delete b.playerId,delete b.context;var f=e[d];f&&f.processMessage(a.data.method,b,c)}}}function g(a,b,c){var d=Object.keys(c).filter(function(a){return c[a]!=null}).map(function(a){var b=c[a];return encodeURIComponent(a)+"="+encodeURIComponent(b)}).join("&");return d&&(d="?"+d),a+b+d}function h(b,c,h,i,j){var k=b.ownerDocument,l=k.defaultView;l.addEventListener("message",f),this.playerId=d++;var m={embed_source:"clientlib",player_id:this.playerId,rpc_init:1};this.scribeParams={},this.scribeParams.suppressScribing=i&&i.suppressScribing;if(!this.scribeParams.suppressScribing){if(!i.scribeContext)throw"video_player: Missing scribe context";if(!i.scribeContext.client)throw"video_player: Scribe context missing client property";this.scribeParams.client=i.scribeContext.client,this.scribeParams.page=i.scribeContext.page,this.scribeParams.section=i.scribeContext.section,this.scribeParams.component=i.scribeContext.component}this.scribeParams.debugScribe=i&&i.scribeContext&&i.scribeContext.debugScribing,this.scribeParams.scribeUrl=i&&i.scribeContext&&i.scribeContext.scribeUrl,this.promotedLogParams=i.promotedContext,this.adRequestCallback=i.adRequestCallback,i.languageCode&&(m.language_code=i.languageCode);var n=g(a,c,m);return this.videoIframe=document.createElement("iframe"),this.videoIframe.setAttribute("src",n),this.videoIframe.setAttribute("allowfullscreen",""),this.videoIframe.setAttribute("id",h),this.videoIframe.setAttribute("style","width: 100%; height: 100%; position: absolute; top: 0; left: 0;"),this.domElement=b,this.domElement.appendChild(this.videoIframe),e[this.playerId]=this,this.eventCallbacks={},this.emitEvent=function(a,b){var c=this.eventCallbacks[a];typeof c!="undefined"&&c.forEach(function(a){a.apply(this.playerInterface,[b])}.bind(this))},this.jsonRpc=function(a){var b=this.videoIframe.contentWindow;a.jsonrpc="2.0",b&&b.postMessage&&b.postMessage(JSON.stringify(a),"*")},this.jsonRpcCall=function(a,b){this.jsonRpc({method:a,params:b})},this.jsonRpcResult=function(a,b){this.jsonRpc({result:a,id:b})},this.processMessage=function(a,b,c){switch(a){case"requestPlayerConfig":this.jsonRpcResult({scribeParams:this.scribeParams,promotedLogParams:this.promotedLogParams,squareCorners:i.squareCorners,hideControls:i.hideControls},c);break;case"videoPlayerPlaybackComplete":this.emitEvent("playbackComplete",b);break;case"videoPlayerReady":this.emitEvent("ready",b);break;case"videoView":this.emitEvent("view",b);break;case"debugLoggingEvent":this.emitEvent("logged",b);break;case"requestDynamicAd":typeof this.adRequestCallback=="function"?this.jsonRpcResult(this.adRequestCallback(),c):this.jsonRpcResult({},c)}},this.playerInterface={on:function(a,b){return typeof this.eventCallbacks[a]=="undefined"&&(this.eventCallbacks[a]=[]),this.eventCallbacks[a].push(b),this.playerInterface}.bind(this),off:function(a,b){if(typeof b=="undefined")delete this.eventCallbacks[a];else{var c=this.eventCallbacks[a];if(typeof c!="undefined"){var d=c.indexOf(b);d>-1&&c.splice(d,1)}}return this.playerInterface}.bind(this),play:function(){return this.jsonRpcCall("play"),this.playerInterface}.bind(this),pause:function(){return this.jsonRpcCall("pause"),this.playerInterface}.bind(this),mute:function(){return this.jsonRpcCall("mute"),this.playerInterface}.bind(this),unmute:function(){return this.jsonRpcCall("unmute"),this.playerInterface}.bind(this),playPreview:function(){return this.jsonRpcCall("autoPlayPreview"),this.playerInterface}.bind(this),pausePreview:function(){return this.jsonRpcCall("autoPlayPreviewStop"),this.playerInterface}.bind(this),updatePosition:function(a){return this.jsonRpcCall("updatePosition",[a]),this.playerInterface}.bind(this),teardown:function(){this.eventCallbacks={},b.removeChild(this.videoIframe),this.videoIframe=undefined,delete e[this.playerId]}.bind(this)},this.playerInterface}var a="https://twitter.com",b=/^https?:\/\/([a-zA-Z0-9]+\.)*twitter.com(:\d+)?$/,c={suppressScribing:!1,squareCorners:!1,hideControls:!1},d=0,e={};return{setBaseUrl:function(c){b.test(c)?a=c:window.console.error("newBaseUrl "+c+" not allowed")},createPlayerForTweet:function(a,b,d){var e="/i/videos/tweet/"+b,f="player_tweet_"+b;return new h(a,e,f,d||c)},createPlayerForDm:function(a,b,d){var e="/i/videos/dm/"+b,f="player_dm_"+b;return new h(a,e,f,d||c)},findPlayerForElement:function(a){for(var b in e)if(e.hasOwnProperty(b)){var c=e[b];if(c&&c.domElement===a)return c.playerInterface}return null}}})
define("app/ui/playable_media/playable_media",["module","require","exports","core/component","app/data/with_card_metadata","app/data/client_event","bower_components/video-player/src/main/js/video_player"],function(module, require, exports) {
function PlayableMedia(){this.VideoPlayer=VideoPlayer,this.defaultAttrs({playerSelector:".PlayableMedia-player",autoplayOnHover:!1,playerLoadedClass:"playable-media-loaded"}),this.autoplay=function(){this.player?this.player.playPreview():this.autoplayOnInit=!0},this.autoplayStop=function(){this.player?this.player.pausePreview():this.autoplayOnInit=!1},this.loadMedia=function(){this.$node.addClass(this.attr.playerLoadedClass);var a=this.select("playerSelector"),b;typeof this.tweetId!="undefined"&&(b=this.getDynamicVideoAd.bind(this));var c={scribeContext:this.getScribeContext(),promotedContext:this.getPromotedContext(),squareCorners:a.hasClass("with-square-corners"),hideControls:a.hasClass("hide-controls"),adRequestCallback:b},d=a.get(0),e=this.getPlayerConstructor(d);this.player=e(c).on("playbackComplete",this.trigger.bind(this,"uiPlayableMediaPlaybackComplete")).on("ready",this.onPlayerReady.bind(this,a))},this.getPlayerConstructor=function(a){return typeof this.dmId!="undefined"?this.VideoPlayer.createPlayerForDm.bind(this,a,this.dmId):this.VideoPlayer.createPlayerForTweet.bind(this,a,this.tweetId)},this.getPromotedContext=function(){var a=this.$node.closest("[data-impression-id]").attr("data-impression-id");if(a)return{impressionId:a,disclosureType:this.$node.closest("[data-disclosure-type]").attr("data-disclosure-type")}},this.getScribeContext=function(){var a;return typeof this.tweetId!="undefined"&&(a="tweet"),$.extend({client:"web"},clientEvent.scribeContext,{component:this.$node.closest("[data-component-context]").attr("data-component-context")||a})},this.onPlayerReady=function(a){this.playOnInit||a.hasClass("play-on-init")?this.player.play():(this.autoplayOnInit||this.$node.closest("[data-autoplaying-media=true]").length>0)&&this.player.playPreview(),this.muteOnInit&&this.player.mute(),this.trigger("uiPlayableMediaReady")},this.pauseMedia=function(){this.player?this.player.pause():(this.autoplayOnInit=!1,this.playOnInit=!1)},this.playMedia=function(){this.player?this.player.play():(this.autoplayOnInit=!1,this.playOnInit=!0)},this.muteMedia=function(){this.muteOnInit=!0,this.player&&this.player.mute()},this.unmuteMedia=function(){this.muteOnInit=!1,this.player&&this.player.unmute()},this.getDynamicVideoAd=function(){var a=this.ad;return this.trigger("uiRefreshVideoAdCache",{tweet:{id:this.tweetId},triggerAd:a}),a||{}},this.updateAd=function(a,b){var c=b[this.tweetId];typeof c!="undefined"&&(this.ad=c)},this.resetCachedAd=function(){this.ad=undefined},this.removePlayer=function(){this.$node.removeClass(this.attr.playerLoadedClass),this.player&&(this.player.teardown(),this.player=undefined)},this.before("teardown",function(){this.removePlayer()}),this.teardownIfPresent=function(){this.$node.closest("body").length===0&&this.teardown()},this.updatePosition=function(a,b){this.player&&b.tweetId===this.tweetId&&this.player.updatePosition(b.positionData)},this.after("initialize",function(){this.tweetId=this.$node.closest("[data-tweet-id]").attr("data-tweet-id"),this.dmId=this.$node.closest("[data-message-id]").attr("data-message-id"),this.attr.autoplayOnHover&&(this.on("mouseenter",this.autoplay),this.on("mouseleave",this.autoplayStop)),this.on("uiLoadPlayableMedia",this.loadMedia),this.on("uiUnloadPlayableMedia",this.removePlayer),this.on("uiUnmuteMedia",this.unmuteMedia),this.on("uiMuteMedia",this.muteMedia),this.on("uiPlayMedia",this.playMedia),this.on("uiPauseMedia",this.pauseMedia),this.on("uiAutoplayMedia",this.autoplay),this.on("uiStopAutoplayingMedia",this.autoplayStop),this.on(document,"uiPauseAllMedia",this.pauseMedia),this.on(document,"dataVideoAdResponse",this.updateAd),this.on(document,"uiRefreshVideoAdCache",this.resetCachedAd),this.on(document,"uiPlayableMediaPositionChange",this.updatePosition),this.on(document,"uiWatchPlayableMedia uiOverlayClosed",this.teardownIfPresent)})}var defineComponent=require("core/component"),withCardMetadata=require("app/data/with_card_metadata"),clientEvent=require("app/data/client_event"),VideoPlayer=require("bower_components/video-player/src/main/js/video_player");module.exports=defineComponent(PlayableMedia,withCardMetadata)
});
define("app/ui/playable_media/playable_media_manager",["module","require","exports","core/component","app/utils/viewport_helpers","core/utils","app/ui/playable_media/playable_media"],function(module, require, exports) {
function PlayableMediaManager(){this.viewportHelpers=viewportHelpers,this.utils=utils,this.defaultAttrs({playableMediaContainerSelector:".PlayableMedia",playableMediaLoadThreshold:500,scrollThrottle:100,watchedClass:"watched",watchedSelector:".watched",watchDocumentScroll:!0}),this.updateWatchedMedia=function(){this.$media=this.select("playableMediaContainerSelector");var a=this.$media.not(this.attr.watchedSelector);PlayableMedia.attachTo(a),a.addClass(this.attr.watchedClass),this.throttledProcessWatchedMedia()},this.processWatchedMedia=function(){if(this.isInFullscreen())return;this.$media.each(function(a,b){var c=$(b),d=viewportHelpers.isWithinBounds(this.$container,c,this.attr.playableMediaLoadThreshold),e=c.hasClass("playable-media-loaded");!e&&d?c.trigger("uiLoadPlayableMedia"):e&&!d&&c.trigger("uiUnloadPlayableMedia")}.bind(this))},this.isInFullscreen=function(){return document.webkitFullscreenElement||document.msFullscreenElement||document.fullscreenElement||document.mozFullScreenElement},this.beforeTeardown=function(){this.$media.removeClass(this.attr.watchedClass)},this.before("teardown",this.beforeTeardown),this.after("initialize",function(){this.$container=$(window),this.throttledProcessWatchedMedia=utils.throttle(this.processWatchedMedia.bind(this),this.attr.scrollThrottle),this.on(document,"uiPageChanged uiWatchPlayableMedia",this.updateWatchedMedia),this.on(this.$container,"resize",this.throttledProcessWatchedMedia),this.attr.watchDocumentScroll?this.on(document,"scroll",this.throttledProcessWatchedMedia):this.on("scroll",this.throttledProcessWatchedMedia),this.updateWatchedMedia()})}var defineComponent=require("core/component"),viewportHelpers=require("app/utils/viewport_helpers"),utils=require("core/utils"),PlayableMedia=require("app/ui/playable_media/playable_media");module.exports=defineComponent(PlayableMediaManager)
});
define("app/ui/dm/conversation/report_conversation",["module","require","exports","core/component"],function(module, require, exports) {
function reportConversation(){this.attributes({notice:".DMReportConversation",abuseConfirmation:".DMReportConversation-abuse",spamConfirmation:".DMReportConversation-spam",cancel:".DMReportConversation-cancel",groupVariantClass:"DMReportConversation--group"}),this.showConfirmation=function(a,b){var c=b&&b.is_group;this.select("notice").toggleClass(this.attr.groupVariantClass,!!c).trigger("uiShowDMNotice")},this.hideConfirmation=function(){this.select("notice").trigger("uiDismissDMNotice")},this.state=function(a,b){return this._state=b||this._state||{},this._state},this.reportConversation=function(a){var b=this.state();this.trigger("uiReportConversation",{conversation_id:b.conversation_id,report_as:a}),this.hideConfirmation(),this.trigger("uiDMInboxWantsRefreshed")},this.after("initialize",function(){this.on("uiShowDMReportConversationConfirmation",this.state),this.on("uiShowDMReportConversationConfirmation",this.showConfirmation),this.on("click",{abuseConfirmation:this.reportConversation.bind(this,"abuse"),spamConfirmation:this.reportConversation.bind(this,"spam"),cancel:this.hideConfirmation})})}var defineComponent=require("core/component"),ReportConversation=defineComponent(reportConversation);module.exports=ReportConversation
});
define("app/ui/dm/conversation/report_message",["module","require","exports","core/component"],function(module, require, exports) {
function reportMessage(){this.attributes({notice:".DMReportMessage",abuseConfirmation:".DMReportMessage-abuse",spamConfirmation:".DMReportMessage-spam",cancel:".DMReportMessage-cancel"}),this.showConfirmation=function(){this.select("notice").trigger("uiShowDMNotice")},this.hideConfirmation=function(){this.select("notice").trigger("uiDismissDMNotice")},this.state=function(a,b){return this._state=b||this._state||{},this._state},this.reportMessage=function(a){var b=this.state();this.trigger("uiDMDialogReportDM",{id:b.messageId,conversation_id:b.conversationId,report_as:a}),this.hideConfirmation(),this.trigger("uiDMInboxWantsRefreshed")},this.after("initialize",function(){this.on("uiShowDMReportMessageConfirmation",this.state),this.on("uiShowDMReportMessageConfirmation",this.showConfirmation),this.on("click",{abuseConfirmation:this.reportMessage.bind(this,"abuse"),spamConfirmation:this.reportMessage.bind(this,"spam"),cancel:this.hideConfirmation})})}var defineComponent=require("core/component"),ReportMessage=defineComponent(reportMessage);module.exports=ReportMessage
});
define("app/ui/media/sensitive_media_tweets",["module","require","exports","core/component"],function(module, require, exports) {
function sensitiveMediaTweets(){this.defaultAttrs({mediaNotDisplayedSelector:".media-not-displayed",displayMediaSelector:".display-this-media",alwaysDisplaySelector:".always-display-media",appealNsfwMediaSelector:".appeal-nsfw-media",mediaContainerSelector:".js-media-container, .js-adaptive-media-container, .js-old-media-container",tweetSelector:".tweet",hiddenClass:"hidden"}),this.showMedia=function(a){a=a||this.$node,a.find(this.attr.mediaNotDisplayedSelector).hide(),a.find(this.attr.mediaContainerSelector).removeClass(this.attr.hiddenClass)},this.showLimitedMedia=function(a){a.stopImmediatePropagation();var b=$(a.target).closest(this.attr.tweetSelector);this.trigger("uiShowLimitedMedia"),this.showMedia(b)},this.updateMediaSettings=function(a){a.stopImmediatePropagation(),this.trigger("uiUpdateViewPossiblySensitive",{do_show:!0}),this.showMedia()},this.appealNsfwMedia=function(a){var b=$(a.target).closest(this.attr.mediaNotDisplayedSelector),c=b.find(this.attr.appealNsfwMediaSelector);if(!c.hasClass(this.attr.hiddenClass)){var d=b.closest(this.attr.tweetSelector);this.trigger("uiAppealNsfwMedia",{user_id:d.attr("data-user-id"),tweet_id:d.attr("data-tweet-id"),report_type:"dispute_media"}),b.find(this.attr.appealNsfwMediaSelector).hide()}},this.after("initialize",function(){this.on("click",{displayMediaSelector:this.showLimitedMedia,alwaysDisplaySelector:this.updateMediaSettings,appealNsfwMediaSelector:this.appealNsfwMedia})})}var defineComponent=require("core/component");module.exports=defineComponent(sensitiveMediaTweets)
});
define("app/ui/dm/conversation/suspicious_message",["module","require","exports","core/component"],function(module, require, exports) {
function suspiciousContent(){this.defaultAttrs({warningSelector:".suspicious-content-warning",messageSelector:".dm",conversationSelector:".js-dm-conversation",reportButtonsSelector:".suspicious-content-response",reportAsSpamSelector:".js-message-is-spam",reportAsSafeSelector:".js-message-is-safe"}),this.showMessage=function(a,b){a.preventDefault();var c=$(a.target),d=c.prev(this.attr.messageSelector);c.hide(),d.show()},this.reportMessage=function(a,b,c){var d=$(b.target),e=d.closest(this.attr.messageSelector).attr("data-message-id"),f=d.closest(this.attr.conversationSelector).attr("data-thread-id");this.trigger("uiDMDialogReportDM",{id:e,conversation_id:f,report_as:a}),this.select("reportButtonsSelector").hide(),this.trigger("uiDMInboxWantsRefreshed")},this.after("initialize",function(){this.on("uiRevealSuspiciousDM",this.showMessage),this.on("uiReportDMAsSpam",this.reportMessage.bind(this,"spam")),this.on("uiReportDMAsSafe",this.reportMessage.bind(this,"not_spam")),this.on("click",{warningSelector:"uiRevealSuspiciousDM",reportAsSpamSelector:"uiReportDMAsSpam",reportAsSafeSelector:"uiReportDMAsSafe"})})}var defineComponent=require("core/component"),SuspiciousContent=defineComponent(suspiciousContent);module.exports=SuspiciousContent
});
deferred('$lib/mediaelement.js', function() {
function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}/*!
* MediaElement.js
* HTML5 <video> and <audio> shim and player
* http://mediaelementjs.com/
*
* Creates a JavaScript object that mimics HTML5 MediaElement API
* for browsers that don't understand HTML5 or can't play the provided codec
* Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
*
* Copyright 2010-2014, John Dyer (http://j.hn)
* License: MIT
*
*/var mejs=mejs||{};mejs.version="2.14.2",mejs.meIndex=0,mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo","video/x-vimeo"]}]},mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(a){var b=document.createElement("div");return b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>',b.firstChild.href},getScriptPath:function(a){var b=0,c,d="",e="",f,g,h,i,j,k=document.getElementsByTagName("script"),l=k.length,m=a.length;for(;b<l;b++){h=k[b].src,f=h.lastIndexOf("/"),f>-1?(j=h.substring(f+1),i=h.substring(0,f+1)):(j=h,i="");for(c=0;c<m;c++){e=a[c],g=j.indexOf(e);if(g>-1){d=i;break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){typeof c=="undefined"?c=!1:typeof d=="undefined"&&(d=25);var e=Math.floor(a/3600)%24,f=Math.floor(a/60)%60,g=Math.floor(a%60),h=Math.floor((a%1*d).toFixed(3)),i=(b||e>0?(e<10?"0"+e:e)+":":"")+(f<10?"0"+f:f)+":"+(g<10?"0"+g:g)+(c?":"+(h<10?"0"+h:h):"");return i},timeCodeToSeconds:function(a,b,c,d){typeof c=="undefined"?c=!1:typeof d=="undefined"&&(d=25);var e=a.split(":"),f=parseInt(e[0],10),g=parseInt(e[1],10),h=parseInt(e[2],10),i=0,j=0;return c&&(i=parseInt(e[3])/d),j=f*3600+g*60+h+i,j},convertSMPTEtoSeconds:function(a){if(typeof a!="string")return!1;a=a.replace(",",".");var b=0,c=a.indexOf(".")!=-1?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++)d=1,e>0&&(d=Math.pow(60,e)),b+=Number(a[e])*d;return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);b&&/object|embed/i.test(b.nodeName)&&(mejs.MediaFeatures.isIE?(b.style.display="none",function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))},removeObjectInIE:function(a){var b=document.getElementById(a);if(b){for(var c in b)typeof b[c]=="function"&&(b[c]=null);b.parentNode.removeChild(b)}}},mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];return b[1]=b[1]||0,b[2]=b[2]||0,c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],f,g,h;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){f=this.nav.plugins[a].description;if(f&&(typeof this.nav.mimeTypes=="undefined"||!this.nav.mimeTypes[b]||!!this.nav.mimeTypes[b].enabledPlugin)){e=f.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(g=0;g<e.length;g++)e[g]=parseInt(e[g].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{h=new ActiveXObject(c),h&&(e=d(h))}catch(i){}return e}},mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[],c=a.GetVariable("$version");return c&&(c=c.split(" ")[1].split(","),b=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]),b}),mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(a,b,c,d){while(a.isVersionSupported(b[0]+"."+b[1]+"."+b[2]+"."+b[3]))b[c]+=d;b[c]-=d};return c(a,b,0,1),c(a,b,1,1),c(a,b,2,1e4),c(a,b,2,1e3),c(a,b,2,100),c(a,b,2,10),c(a,b,2,1),c(a,b,3,1),b}),mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,f,g=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null,a.isiPhone=d.match(/iphone/i)!==null,a.isiOS=a.isiPhone||a.isiPad,a.isAndroid=d.match(/android/i)!==null,a.isBustedAndroid=d.match(/android 2\.[12]/)!==null,a.isBustedNativeHTTPS=location.protocol==="https:"&&(d.match(/android [12]\./)!==null||d.match(/macintosh.* version.* safari/)!==null),a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=-1||c.appName.toLowerCase().match(/trident/gi)!==null,a.isChrome=d.match(/chrome/gi)!==null,a.isFirefox=d.match(/firefox/gi)!==null,a.isWebkit=d.match(/webkit/gi)!==null,a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit&&!a.isIE,a.isOpera=d.match(/opera/gi)!==null,a.hasTouch="ontouchstart"in window,a.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(e=0;e<g.length;e++)f=document.createElement(g[e]);a.supportsMediaTag=typeof f.canPlayType!="undefined"||a.isBustedAndroid;try{f.canPlayType("video/mp4")}catch(h){a.supportsMediaTag=!1}a.hasSemiNativeFullScreen=typeof f.webkitEnterFullscreen!="undefined",a.hasNativeFullscreen=typeof f.requestFullscreen!="undefined",a.hasWebkitNativeFullScreen=typeof f.webkitRequestFullScreen!="undefined",a.hasMozNativeFullScreen=typeof f.mozRequestFullScreen!="undefined",a.hasMsNativeFullScreen=typeof f.msRequestFullscreen!="undefined",a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen||a.hasMsNativeFullScreen,a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen,a.hasMozNativeFullScreen?a.nativeFullScreenEnabled=document.mozFullScreenEnabled:a.hasMsNativeFullScreen&&(a.nativeFullScreenEnabled=document.msFullscreenEnabled),a.isChrome&&(a.hasSemiNativeFullScreen=!1),a.hasTrueNativeFullScreen&&(a.fullScreenEventName="",a.hasWebkitNativeFullScreen?a.fullScreenEventName="webkitfullscreenchange":a.hasMozNativeFullScreen?a.fullScreenEventName="mozfullscreenchange":a.hasMsNativeFullScreen&&(a.fullScreenEventName="MSFullscreenChange"),a.isFullScreen=function(){if(f.mozRequestFullScreen)return b.mozFullScreen;if(f.webkitRequestFullScreen)return b.webkitIsFullScreen;if(f.hasMsNativeFullScreen)return b.msFullscreenElement!==null},a.requestFullScreen=function(b){a.hasWebkitNativeFullScreen?b.webkitRequestFullScreen():a.hasMozNativeFullScreen?b.mozRequestFullScreen():a.hasMsNativeFullScreen&&b.msRequestFullscreen()},a.cancelFullScreen=function(){a.hasWebkitNativeFullScreen?document.webkitCancelFullScreen():a.hasMozNativeFullScreen?document.mozCancelFullScreen():a.hasMsNativeFullScreen&&document.msExitFullscreen()}),a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)&&(a.hasNativeFullScreen=!1,a.hasSemiNativeFullScreen=!1)}},mejs.MediaFeatures.init(),mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){var b=this.getElementsByTagName("source");while(b.length>0)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c,d;for(c=0;c<a.length;c++){d=a[c];if(this.canPlayType(d.type)){this.src=d.src;break}}}},setVideoSize:function(a,b){this.width=a,this.height=b}},mejs.PluginMediaElement=function(a,b,c){this.id=a,this.pluginType=b,this.src=c,this.events={},this.attributes={}},mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:!1,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:!0,ended:!1,seeking:!1,duration:0,error:null,tagName:"",muted:!1,volume:1,currentTime:0,play:function(){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?this.pluginApi.playVideo():this.pluginApi.playMedia(),this.paused=!1)},load:function(){this.pluginApi!=null&&(this.pluginType!="youtube"&&this.pluginType!="vimeo"&&this.pluginApi.loadMedia(),this.paused=!1)},pause:function(){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia(),this.paused=!0)},stop:function(){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?this.pluginApi.stopVideo():this.pluginApi.stopMedia(),this.paused=!0)},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably"}return""},positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(a),Math.floor(b),c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if(typeof a=="string")this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a)),this.src=mejs.Utility.absolutizeUrl(a);else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)),this.src=mejs.Utility.absolutizeUrl(a);break}}}},setCurrentTime:function(a){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a),this.currentTime=a)},setVolume:function(a){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a),this.volume=a)},setMuted:function(a){this.pluginApi!=null&&(this.pluginType=="youtube"||this.pluginType=="vimeo"?(a?this.pluginApi.mute():this.pluginApi.unMute(),this.muted=a,this.dispatchEvent("volumechange")):this.pluginApi.setMuted(a),this.muted=a)},setVideoSize:function(a,b){this.pluginElement.style&&(this.pluginElement.style.width=a+"px",this.pluginElement.style.height=b+"px"),this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(!0)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(!1)},addEventListener:function(a,b,c){this.events[a]=this.events[a]||[],this.events[a].push(b)},removeEventListener:function(a,b){if(!a)return this.events={},!0;var c=this.events[a];if(!c)return!0;if(!b)return this.events[a]=[],!0;for(var d=0;d<c.length;d++)if(c[d]===b)return this.events[a].splice(d,1),!0;return!1},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},hasAttribute:function(a){return a in this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){return this.hasAttribute(a)?this.attributes[a]:""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id),mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}},mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b,this.htmlMediaElements[a]=c},unregisterPluginElement:function(a){delete this.pluginMediaElements[a],delete this.htmlMediaElements[a]},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case"flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case"silverlight":b.pluginElement=document.getElementById(b.id),b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,c)}},fireEvent:function(a,b,c){var d,e,f,g=this.pluginMediaElements[a];if(!g)return;d={type:b,target:g};for(e in c)g[e]=c[e],d[e]=c[e];f=c.bufferedTime||0,d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return f},length:1},g.dispatchEvent(d.type,d)}},mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:!1,httpsBasicAuthSite:!1,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:!1,enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:.8,success:function(){},error:function(){}},mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)},mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),f=e==="audio"||e==="video",g=f?d.getAttribute("src"):d.getAttribute("href"),h=d.getAttribute("poster"),i=d.getAttribute("autoplay"),j=d.getAttribute("preload"),k=d.getAttribute("controls"),l,m;for(m in b)c[m]=b[m];return g=typeof g=="undefined"||g===null||g==""?null:g,h=typeof h=="undefined"||h===null?"":h,j=typeof j=="undefined"||j===null||j==="false"?"none":j,i=typeof i!="undefined"&&i!==null&&i!=="false",k=typeof k!="undefined"&&k!==null&&k!=="false",l=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,f,g),l.url=l.url!==null?mejs.Utility.absolutizeUrl(l.url):"",l.method=="native"?(mejs.MediaFeatures.isBustedAndroid&&(d.src=l.url,d.addEventListener("click",function(){d.play()},!1)),this.updateNative(l,c,i,j)):l.method!==""?this.createPlugin(l,c,h,i,j,k):(this.createErrorMessage(l,c,h),this)},determinePlayback:function(a,b,c,d,e){var f=[],g,h,i,j,k,l,m={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},n,o,p,q,r;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")f.push({type:b.type,url:e});else for(g=0;g<b.type.length;g++)f.push({type:b.type[g],url:e});else if(e!==null)l=this.formatType(e,a.getAttribute("type")),f.push({type:l,url:e});else for(g=0;g<a.childNodes.length;g++)k=a.childNodes[g],k.nodeType==1&&k.tagName.toLowerCase()=="source"&&(e=k.getAttribute("src"),l=this.formatType(e,k.getAttribute("type")),r=k.getAttribute("media"),(!r||!window.matchMedia||window.matchMedia&&window.matchMedia(r).matches)&&f.push({type:l,url:e}));!d&&f.length>0&&f[0].url!==null&&this.getTypeFromFile(f[0].url).indexOf("audio")>-1&&(m.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(a.canPlayType=function(a){return a.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""});if(c&&(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="native")&&(!mejs.MediaFeatures.isBustedNativeHTTPS||b.httpsBasicAuthSite!==!0)){d||(q=document.createElement(m.isVideo?"video":"audio"),a.parentNode.insertBefore(q,a),a.style.display="none",m.htmlMediaElement=a=q);for(g=0;g<f.length;g++)if(a.canPlayType(f[g].type).replace(/no/,"")!==""||a.canPlayType(f[g].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""||a.canPlayType(f[g].type.replace(/m4a/,"mp4")).replace(/no/,"")!==""){m.method="native",m.url=f[g].url;break}if(m.method==="native"){m.url!==null&&(a.src=m.url);if(b.mode!=="auto_plugin")return m}}if(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="shim")for(g=0;g<f.length;g++){l=f[g].type;for(h=0;h<b.plugins.length;h++){n=b.plugins[h],o=mejs.plugins[n];for(i=0;i<o.length;i++){p=o[i];if(p.version==null||mejs.PluginDetector.hasPluginVersion(n,p.version))for(j=0;j<p.types.length;j++)if(l==p.types[j])return m.method=n,m.url=f[g].url,m}}}return b.mode==="auto_plugin"&&m.method==="native"?m:(m.method===""&&f.length>0&&(m.url=f[0].url),m)},formatType:function(a,b){var c;return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];var b=a.substring(a.lastIndexOf(".")+1).toLowerCase();return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b)?"video":"audio")+"/"+this.getTypeFromExtension(b)},getTypeFromExtension:function(a){switch(a){case"mp4":case"m4v":case"m4a":return"mp4";case"webm":case"webma":case"webmv":return"webm";case"ogg":case"oga":case"ogv":return"ogg";default:return a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px",e.style.height=d.height+"px"}catch(f){}b.customError?e.innerHTML=b.customError:e.innerHTML=c!==""?'<a href="'+a.url+'"><img src="'+c+'" width="100%" height="100%" /></a>':'<a href="'+a.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>",d.parentNode.insertBefore(e,d),d.style.display="none",b.error(d)},createPlugin:function(a,b,c,d,e,f){var g=a.htmlMediaElement,h=1,i=1,j="me_"+a.method+"_"+mejs.meIndex++,k=new mejs.PluginMediaElement(j,a.method,a.url),l=document.createElement("div"),m,n,o;k.tagName=g.tagName;for(var p=0;p<g.attributes.length;p++){var q=g.attributes[p];q.specified==1&&k.setAttribute(q.name,q.value)}n=g.parentNode;while(n!==null&&n.tagName.toLowerCase()!=="body"&&n.parentNode!=null){if(n.parentNode.tagName.toLowerCase()==="p"){n.parentNode.parentNode.insertBefore(n,n.parentNode);break}n=n.parentNode}a.isVideo?(h=b.pluginWidth>0?b.pluginWidth:b.videoWidth>0?b.videoWidth:g.getAttribute("width")!==null?g.getAttribute("width"):b.defaultVideoWidth,i=b.pluginHeight>0?b.pluginHeight:b.videoHeight>0?b.videoHeight:g.getAttribute("height")!==null?g.getAttribute("height"):b.defaultVideoHeight,h=mejs.Utility.encodeUrl(h),i=mejs.Utility.encodeUrl(i)):b.enablePluginDebug&&(h=320,i=240),k.success=b.success,mejs.MediaPluginBridge.registerPluginElement(j,k,g),l.className="me-plugin",l.id=j+"_container",a.isVideo?g.parentNode.insertBefore(l,g):document.body.insertBefore(l,document.body.childNodes[0]),o=["id="+j,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+h,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+i,"pseudostreamstart="+b.pseudoStreamingStartQueryParam],a.url!==null&&(a.method=="flash"?o.push("file="+mejs.Utility.encodeUrl(a.url)):o.push("file="+a.url)),b.enablePluginDebug&&o.push("debug=true"),b.enablePluginSmoothing&&o.push("smoothing=true"),b.enablePseudoStreaming&&o.push("pseudostreaming=true"),f&&o.push("controls=true"),b.pluginVars&&(o=o.concat(b.pluginVars));switch(a.method){case"silverlight":l.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+j+'" name="'+j+'" width="'+h+'" height="'+i+'" class="mejs-shim">'+'<param name="initParams" value="'+o.join(",")+'" />'+'<param name="windowless" value="true" />'+'<param name="background" value="black" />'+'<param name="minRuntimeVersion" value="3.0.0.0" />'+'<param name="autoUpgrade" value="true" />'+'<param name="source" value="'+b.pluginPath+b.silverlightName+'" />'+"</object>";break;case"flash":mejs.MediaFeatures.isIE?(m=document.createElement("div"),l.appendChild(m),m.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+j+'" width="'+h+'" height="'+i+'" class="mejs-shim">'+'<param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" />'+'<param name="flashvars" value="'+o.join("&amp;")+'" />'+'<param name="quality" value="high" />'+'<param name="bgcolor" value="#000000" />'+'<param name="wmode" value="transparent" />'+'<param name="allowScriptAccess" value="always" />'+'<param name="allowFullScreen" value="true" />'+'<param name="scale" value="default" />'+"</object>"):l.innerHTML='<embed id="'+j+'" name="'+j+'" '+'play="true" '+'loop="false" '+'quality="high" '+'bgcolor="#000000" '+'wmode="transparent" '+'allowScriptAccess="always" '+'allowFullScreen="true" '+'type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" '+'src="'+b.pluginPath+b.flashName+'" '+'flashvars="'+o.join("&")+'" '+'width="'+h+'" '+'height="'+i+'" '+'scale="default"'+'class="mejs-shim"></embed>';break;case"youtube":var r;a.url.lastIndexOf("youtu.be")!=-1?(r=a.url.substr(a.url.lastIndexOf("/")+1),r.indexOf("?")!=-1&&(r=r.substr(0,r.indexOf("?")))):r=a.url.substr(a.url.lastIndexOf("=")+1),youtubeSettings={container:l,containerId:l.id,pluginMediaElement:k,pluginId:j,videoId:r,height:i,width:h},mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case"vimeo":var s=j+"_player";k.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1),l.innerHTML='<iframe src="//player.vimeo.com/video/'+k.vimeoid+"?api=1&portrait=0&byline=0&title=0&player_id="+s+'" width="'+h+'" height="'+i+'" frameborder="0" class="mejs-shim" id="'+s+'"></iframe>';if(typeof $f=="function"){var t=$f(l.childNodes[0]);t.addEvent("ready",function(){function a(a,b,c,d){var e={type:c,target:b};c=="timeupdate"&&(b.currentTime=e.currentTime=d.seconds,b.duration=e.duration=d.duration),b.dispatchEvent(e.type,e)}t.playVideo=function(){t.api("play")},t.pauseVideo=function(){t.api("pause")},t.seekTo=function(a){t.api("seekTo",a)},t.addEvent("play",function(){a(t,k,"play"),a(t,k,"playing")}),t.addEvent("pause",function(){a(t,k,"pause")}),t.addEvent("finish",function(){a(t,k,"ended")}),t.addEvent("playProgress",function(b){a(t,k,"timeupdate",b)}),k.pluginApi=t,mejs.MediaPluginBridge.initPlugin(j)})}else console.warn("You need to include froogaloop for vimeo to work")}return g.style.display="none",g.removeAttribute("autoplay"),k},updateNative:function(a,b,c,d){var e=a.htmlMediaElement,f;for(f in mejs.HtmlMediaElement)e[f]=mejs.HtmlMediaElement[f];return b.success(e,e),e}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="//www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(a){this.isLoaded?this.createIframe(a):(this.loadIframeApi(),this.iframeQueue.push(a))},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c,mejs.MediaPluginBridge.initPlugin(a.pluginId),setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(a){mejs.YouTubeApi.handleStateChange(a.data,c,b)}}})},createEvent:function(a,b,c){var d={type:c,target:b};if(a&&a.getDuration){b.currentTime=d.currentTime=a.getCurrentTime(),b.duration=d.duration=a.getDuration(),d.paused=b.paused,d.ended=b.ended,d.muted=a.isMuted(),d.volume=a.getVolume()/100,d.bytesTotal=a.getVideoBytesTotal(),d.bufferedBytes=a.getVideoBytesLoaded();var e=d.bufferedBytes/d.bytesTotal*d.duration;d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return e},length:1}}b.dispatchEvent(d.type,d)},iFrameReady:function(){this.isLoaded=!0,this.isIframeLoaded=!0;while(this.iframeQueue.length>0){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,c="//www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid="+a.pluginId+"&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(b=document.createElement("div"),a.container.appendChild(b),b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim">'+'<param name="movie" value="'+c+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowScriptAccess" value="always" />'+'<param name="allowFullScreen" value="true" />'+"</object>"):a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" '+'width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim">'+'<param name="allowScriptAccess" value="always">'+'<param name="wmode" value="transparent">'+"</object>"},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c,mejs.MediaPluginBridge.initPlugin(a),c.cueVideoById(b.videoId);var e=b.containerId+"_callback";window[e]=function(a){mejs.YouTubeApi.handleStateChange(a,c,d)},c.addEventListener("onStateChange",e),setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case-1:c.paused=!0,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=!1,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=!1,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"play"),mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=!0,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress");break;case 5:}}},window.mejs=mejs,window.MediaElement=mejs.MediaElement;/*!
 * Adds Internationalization and localization to mediaelement.
 *
 * This file does not contain translations, you have to add the manually.
 * The schema is always the same: me-i18n-locale-[ISO_639-1 Code].js
 *
 * Examples are provided both for german and chinese translation.
 *
 *
 * What is the concept beyond i18n?
 *   http://en.wikipedia.org/wiki/Internationalization_and_localization
 *
 * What langcode should i use?
 *   http://en.wikipedia.org/wiki/ISO_639-1
 *
 *
 * License?
 *
 *   The i18n file uses methods from the Drupal project (drupal.js):
 *     - i18n.methods.t() (modified)
 *     - i18n.methods.checkPlain() (full copy)
 *
 *   The Drupal project is (like mediaelementjs) licensed under GPLv2.
 *    - http://drupal.org/licensing/faq/#q1
 *    - https://github.com/johndyer/mediaelement
 *    - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 *
 * @author
 *   Tim Latz (latz.tim@gmail.com)
 *
 *
 * @params
 *  - context - document, iframe ..
 *  - exports - CommonJS, window ..
 *
 */(function(a,b,c){"use strict";var d={locale:{language:"",strings:{}},methods:{}};d.getLanguage=function(){var a=d.locale.language||window.navigator.userLanguage||window.navigator.language;return a.substr(0,2).toLowerCase()},typeof mejsL10n!="undefined"&&(d.locale.language=mejsL10n.language),d.methods.checkPlain=function(a){var b,c,d={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};a=String(a);for(b in d)d.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,d[b]));return a},d.methods.t=function(a,b){return d.locale.strings&&d.locale.strings[b.context]&&d.locale.strings[b.context][a]&&(a=d.locale.strings[b.context][a]),d.methods.checkPlain(a)},d.t=function(a,b){if(typeof a=="string"&&a.length>0){var c=d.getLanguage();return b=b||{context:c},d.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},b.i18n=d})(document,mejs),function(a,b){"use strict",typeof mejsL10n!="undefined"&&(a[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings);/*!
 * This is a i18n.locale language object.
 *
 * German translation by Tim Latz, latz.tim@gmail.com
 *
 * @author
 *   Tim Latz (latz.tim@gmail.com)
 *
 * @see
 *   me-i18n.js
 *
 * @params
 *  - exports - CommonJS, window ..
 */(function(a,b){"use strict",typeof a.de=="undefined"&&(a.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schließen"})})(mejs.i18n.locale.strings);/*!
 * This is a i18n.locale language object.
 *
 * Traditional chinese translation by Tim Latz, latz.tim@gmail.com
 *
 * @author
 *   Tim Latz (latz.tim@gmail.com)
 *
 * @see
 *   me-i18n.js
 *
 * @params
 *  - exports - CommonJS, window ..
 */(function(a,b){"use strict",typeof a.zh=="undefined"&&(a.zh={Fullscreen:"全螢幕","Go Fullscreen":"全屏模式","Turn off Fullscreen":"退出全屏模式",Close:"關閉"})})(mejs.i18n.locale.strings);/*!
 * MediaElementPlayer
 * http://mediaelementjs.com/
 *
 * Creates a controller bar for HTML5 <video> add <audio> tags
 * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
 *
 * Copyright 2010-2013, John Dyer (http://j.hn/)
 * License: MIT
 *
 */typeof jQuery!="undefined"?mejs.$=jQuery:typeof ender!="undefined"&&(mejs.$=ender),function($){mejs.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return a.duration*.05},defaultSeekForwardInterval:function(a){return a.duration*.05},audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,autosizeProgress:!0,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?a.play():a.pause()}},{keys:[38],action:function(a,b){var c=Math.min(b.volume+.1,1);b.setVolume(c)}},{keys:[40],action:function(a,b){var c=Math.max(b.volume-.1,0);b.setVolume(c)}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a,b){typeof a.enterFullScreen!="undefined"&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}}]},mejs.mepIndex=0,mejs.players={},mejs.MediaElementPlayer=function(a,b){if(this instanceof mejs.MediaElementPlayer){var c=this;return c.$media=c.$node=$(a),c.node=c.media=c.$media[0],typeof c.node.player!="undefined"?c.node.player:(c.node.player=c,typeof b=="undefined"&&(b=c.$node.data("mejsoptions")),c.options=$.extend({},mejs.MepDefaults,b),c.id="mep_"+mejs.mepIndex++,mejs.players[c.id]=c,c.init(),c)}return new mejs.MediaElementPlayer(a,b)},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var a=this,b=mejs.MediaFeatures,c=$.extend(!0,{},a.options,{success:function(b,c){a.meReady(b,c)},error:function(b){a.handleError(b)}}),d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video",a.isDynamic?a.isVideo=a.options.isVideo:a.isVideo=d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls)a.$media.attr("controls","controls"),b.isiPad&&a.media.getAttribute("autoplay")!==null&&a.play();else if(!b.isAndroid||!a.options.AndroidUseNativeControls){a.$media.removeAttr("controls"),a.container=$('<div id="'+a.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'">'+'<div class="mejs-inner">'+'<div class="mejs-mediaelement"></div>'+'<div class="mejs-layers"></div>'+'<div class="mejs-controls"></div>'+'<div class="mejs-clear"></div>'+"</div>"+"</div>").addClass(a.$media[0].className).insertBefore(a.$media),a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){var e=a.$media.clone();a.container.find(".mejs-mediaelement").append(e),a.$media.remove(),a.$node=a.$media=e,a.node=a.media=e[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls"),a.layers=a.container.find(".mejs-layers");var f=a.isVideo?"video":"audio",g=f.substring(0,1).toUpperCase()+f.substring(1);a.options[f+"Width"]>0||a.options[f+"Width"].toString().indexOf("%")>-1?a.width=a.options[f+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.width=a.media.style.width:a.media.getAttribute("width")!==null?a.width=a.$media.attr("width"):a.width=a.options["default"+g+"Width"],a.options[f+"Height"]>0||a.options[f+"Height"].toString().indexOf("%")>-1?a.height=a.options[f+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.height=a.media.style.height:a.$media[0].getAttribute("height")!==null?a.height=a.$media.attr("height"):a.height=a.options["default"+g+"Height"],a.setPlayerSize(a.width,a.height),c.pluginWidth=a.width,c.pluginHeight=a.height}mejs.MediaElement(a.$media[0],c),typeof a.container!="undefined"&&a.controlsAreVisible&&a.container.trigger("controlsshown")},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)return;a?(b.controls.css("visibility","visible").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").css("visibility","visible").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.css("visibility","visible").css("display","block"),b.container.find(".mejs-control").css("visibility","visible").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize()},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible||b.options.alwaysShowControls)return;a?(b.controls.stop(!0,!0).fadeOut(200,function(){$(this).css("visibility","hidden").css("display","block"),b.controlsAreVisible=!1,b.container.trigger("controlshidden")}),b.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){$(this).css("visibility","hidden").css("display","block")})):(b.controls.css("visibility","hidden").css("display","block"),b.container.find(".mejs-control").css("visibility","hidden").css("display","block"),b.controlsAreVisible=!1,b.container.trigger("controlshidden"))},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;b.controlsTimer!==null&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(a,b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay"),f=typeof e!="undefined"&&e!==null&&e!=="false",g,h;if(c.created)return;c.created=!0,c.media=a,c.domNode=b;if((!d.isAndroid||!c.options.AndroidUseNativeControls)&&(!d.isiPad||!c.options.iPadUseNativeControls)&&(!d.isiPhone||!c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media),c.buildkeyboard(c,c.controls,c.layers,c.media),c.buildoverlays(c,c.controls,c.layers,c.media),c.findTracks();for(g in c.options.features){h=c.options.features[g];if(c["build"+h])try{c["build"+h](c,c.controls,c.layers,c.media)}catch(i){}}c.container.trigger("controlsready"),c.setPlayerSize(c.width,c.height),c.setControlsSize(),c.isVideo&&(mejs.MediaFeatures.hasTouch?c.$media.bind("touchstart",function(){c.controlsAreVisible?c.hideControls(!1):c.controlsEnabled&&c.showControls(!1)}):(c.clickToPlayPauseCallback=function(){c.options.clickToPlayPause&&(c.media.paused?c.play():c.pause())},c.media.addEventListener("click",c.clickToPlayPauseCallback,!1),c.container.bind("mouseenter mouseover",function(){c.controlsEnabled&&(c.options.alwaysShowControls||(c.killControlsTimer("enter"),c.showControls(),c.startControlsTimer(2500)))}).bind("mousemove",function(){c.controlsEnabled&&(c.controlsAreVisible||c.showControls(),c.options.alwaysShowControls||c.startControlsTimer(2500))}).bind("mouseleave",function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1e3)})),c.options.hideVideoControlsOnLoad&&c.hideControls(!1),f&&!c.options.alwaysShowControls&&c.hideControls(),c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(a){c.options.videoHeight<=0&&c.domNode.getAttribute("height")===null&&!isNaN(a.target.videoHeight)&&(c.setPlayerSize(a.target.videoWidth,a.target.videoHeight),c.setControlsSize(),c.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1)),a.addEventListener("play",function(){var a;for(a in mejs.players){var b=mejs.players[a];b.id!=c.id&&c.options.pauseOtherPlayers&&!b.paused&&!b.ended&&b.pause(),b.hasFocus=!1}c.hasFocus=!0},!1),c.media.addEventListener("ended",function(a){if(c.options.autoRewind)try{c.media.setCurrentTime(0)}catch(b){}c.media.pause(),c.setProgressRail&&c.setProgressRail(),c.setCurrentRail&&c.setCurrentRail(),c.options.loop?c.play():!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},!1),c.media.addEventListener("loadedmetadata",function(a){c.updateDuration&&c.updateDuration(),c.updateCurrent&&c.updateCurrent(),c.isFullScreen||(c.setPlayerSize(c.width,c.height),c.setControlsSize())},!1),setTimeout(function(){c.setPlayerSize(c.width,c.height),c.setControlsSize()},50),c.globalBind("resize",function(){c.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height),c.setControlsSize()}),c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}f&&a.pluginType=="native"&&c.play(),c.options.success&&(typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c))},handleError:function(a){var b=this;b.controls.hide(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,b){var c=this;typeof a!="undefined"&&(c.width=a),typeof b!="undefined"&&(c.height=b);if(c.height.toString().indexOf("%")>0||c.$node.css("max-width")==="100%"||parseInt(c.$node.css("max-width").replace(/px/,""),10)/c.$node.offsetParent().width()===1||c.$node[0].currentStyle&&c.$node[0].currentStyle.maxWidth==="100%"){var d=c.isVideo?c.media.videoWidth&&c.media.videoWidth>0?c.media.videoWidth:c.options.defaultVideoWidth:c.options.defaultAudioWidth,e=c.isVideo?c.media.videoHeight&&c.media.videoHeight>0?c.media.videoHeight:c.options.defaultVideoHeight:c.options.defaultAudioHeight,f=c.container.parent().closest(":visible").width(),g=c.isVideo||!c.options.autosizeProgress?parseInt(f*e/d,10):e;isNaN(g)&&(g=c.container.parent().closest(":visible").height()),c.container.parent()[0].tagName.toLowerCase()==="body"&&(f=$(window).width(),g=$(window).height()),g!=0&&f!=0&&(c.container.width(f).height(g),c.$media.add(c.container.find(".mejs-shim")).width("100%").height("100%"),c.isVideo&&c.media.setVideoSize&&c.media.setVideoSize(f,g),c.layers.children(".mejs-layer").width("100%").height("100%"))}else c.container.width(c.width).height(c.height),c.layers.children(".mejs-layer").width(c.width).height(c.height);var h=c.layers.find(".mejs-overlay-play"),i=h.find(".mejs-overlay-button");h.height(c.container.height()-c.controls.height()),i.css("margin-top","-"+(i.height()/2-c.controls.height()/2).toString()+"px")},setControlsSize:function(){var a=this,b=0,c=0,d=a.controls.find(".mejs-time-rail"),e=a.controls.find(".mejs-time-total"),f=a.controls.find(".mejs-time-current"),g=a.controls.find(".mejs-time-loaded"),h=d.siblings(),i=h.last(),j=null;if(!a.container.is(":visible")||!d.length||!d.is(":visible"))return;a.options&&!a.options.autosizeProgress&&(c=parseInt(d.css("width")));if(c===0||!c)h.each(function(){var a=$(this);a.css("position")!="absolute"&&a.is(":visible")&&(b+=$(this).outerWidth(!0))}),c=a.controls.width()-b-(d.outerWidth(!0)-d.width());do d.width(c),e.width(c-(e.outerWidth(!0)-e.width())),i.css("position")!="absolute"&&(j=i.position(),c--);while(j!=null&&j.top>0&&c>0);a.setProgressRail&&a.setProgressRail(),a.setCurrentRail&&a.setCurrentRail()},buildposter:function(a,b,c,d){var e=this,f=$('<div class="mejs-poster mejs-layer"></div>').appendTo(c),g=a.$media.attr("poster");a.options.poster!==""&&(g=a.options.poster),g!==""&&g!=null?e.setPoster(g):f.hide(),d.addEventListener("play",function(){f.hide()},!1),a.options.showPosterWhenEnded&&a.options.autoRewind&&d.addEventListener("ended",function(){f.show()},!1)},setPoster:function(a){var b=this,c=b.container.find(".mejs-poster"),d=c.find("img");d.length==0&&(d=$('<img width="100%" height="100%" />').appendTo(c)),d.attr("src",a),c.css({"background-image":"url("+a+")"})},buildoverlays:function(a,b,c,d){var e=this;if(!a.isVideo)return;var f=$('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),g=$('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),h=$('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).bind("click touchstart",function(){e.options.clickToPlayPause&&d.paused&&d.play()});d.addEventListener("play",function(){h.hide(),f.hide(),b.find(".mejs-time-buffering").hide(),g.hide()},!1),d.addEventListener("playing",function(){h.hide(),f.hide(),b.find(".mejs-time-buffering").hide(),g.hide()},!1),d.addEventListener("seeking",function(){f.show(),b.find(".mejs-time-buffering").show()},!1),d.addEventListener("seeked",function(){f.hide(),b.find(".mejs-time-buffering").hide()},!1),d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||h.show()},!1),d.addEventListener("waiting",function(){f.show(),b.find(".mejs-time-buffering").show()},!1),d.addEventListener("loadeddata",function(){f.show(),b.find(".mejs-time-buffering").show()},!1),d.addEventListener("canplay",function(){f.hide(),b.find(".mejs-time-buffering").hide()},!1),d.addEventListener("error",function(){f.hide(),b.find(".mejs-time-buffering").hide(),g.show(),g.find("mejs-overlay-error").html("Error loading this resource")},!1)},buildkeyboard:function(a,b,c,d){var e=this;e.globalBind("keydown",function(b){if(a.hasFocus&&a.options.enableKeyboard)for(var c=0,e=a.options.keyActions.length;c<e;c++){var f=a.options.keyActions[c];for(var g=0,h=f.keys.length;g<h;g++)if(b.keyCode==f.keys[g])return b.preventDefault(),f.action(a,d,b.keyCode),!1}return!0}),e.globalBind("click",function(b){a.hasFocus=$(b.target).closest(".mejs-container").length!=0})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[],b.each(function(b,c){c=$(c),a.tracks.push({srclang:c.attr("srclang")?c.attr("srclang").toLowerCase():"",src:c.attr("src"),kind:c.attr("kind"),label:c.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){this.container[0].className="mejs-container "+a,this.setPlayerSize(this.width,this.height),this.setControlsSize()},play:function(){this.load(),this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||this.media.load(),this.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a=this,b,c;for(b in a.options.features){c=a.options.features[b];if(a["clean"+c])try{a["clean"+c](a)}catch(d){}}a.isDynamic?a.$node.insertBefore(a.container):(a.$media.prop("controls",!0),a.$node.clone().show().insertBefore(a.container),a.$node.remove()),a.media.pluginType!=="native"&&a.media.remove(),delete mejs.players[a.id],typeof a.container=="object"&&a.container.remove(),a.globalUnbind(),delete a.node.player}},function(){function b(b,c){var d={d:[],w:[]};return $.each((b||"").split(" "),function(b,e){var f=e+"."+c;f.indexOf(".")===0?(d.d.push(f),d.w.push(f)):d[a.test(e)?"w":"d"].push(f)}),d.d=d.d.join(" "),d.w=d.w.join(" "),d}var a=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(a,c,d){var e=this;a=b(a,e.id),a.d&&$(document).bind(a.d,c,d),a.w&&$(window).bind(a.w,c,d)},mejs.MediaElementPlayer.prototype.globalUnbind=function(a,c){var d=this;a=b(a,d.id),a.d&&$(document).unbind(a.d,c),a.w&&$(window).unbind(a.w,c)}}(),typeof jQuery!="undefined"&&(jQuery.fn.mediaelementplayer=function(a){return a===!1?this.each(function(){var a=jQuery(this).data("mediaelementplayer");a&&a.remove(),jQuery(this).removeData("mediaelementplayer")}):this.each(function(){jQuery(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))}),this}),$(document).ready(function(){$(".mejs-player").mediaelementplayer()}),window.MediaElementPlayer=mejs.MediaElementPlayer}(mejs.$),function($){$.extend(mejs.MepDefaults,{playpauseText:mejs.i18n.t("Play/Pause")}),$.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,d){var e=this,f=$('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+e.id+'" title="'+e.options.playpauseText+'" aria-label="'+e.options.playpauseText+'"></button>'+"</div>").appendTo(b).click(function(a){return a.preventDefault(),d.paused?d.play():d.pause(),!1});d.addEventListener("play",function(){f.removeClass("mejs-play").addClass("mejs-pause")},!1),d.addEventListener("playing",function(){f.removeClass("mejs-play").addClass("mejs-pause")},!1),d.addEventListener("pause",function(){f.removeClass("mejs-pause").addClass("mejs-play")},!1),d.addEventListener("paused",function(){f.removeClass("mejs-pause").addClass("mejs-play")},!1)}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{stopText:"Stop"}),$.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){var e=this,f=$('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+e.id+'" title="'+e.options.stopText+'" aria-label="'+e.options.stopText+'"></button>'+"</div>").appendTo(b).click(function(){d.paused||d.pause(),d.currentTime>0&&(d.setCurrentTime(0),d.pause(),b.find(".mejs-time-current").width("0px"),b.find(".mejs-time-handle").css("left","0px"),b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0)),b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0)),c.find(".mejs-poster").show())})}})}(mejs.$),function($){$.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,d){$('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(b),b.find(".mejs-time-buffering").hide();var e=this,f=b.find(".mejs-time-total"),g=b.find(".mejs-time-loaded"),h=b.find(".mejs-time-current"),i=b.find(".mejs-time-handle"),j=b.find(".mejs-time-float"),k=b.find(".mejs-time-float-current"),l=function(a){if(a.originalEvent.changedTouches)var b=a.originalEvent.changedTouches[0].pageX;else var b=a.pageX;var c=f.offset(),e=f.outerWidth(!0),g=0,h=0,i=0;d.duration&&(b<c.left?b=c.left:b>e+c.left&&(b=e+c.left),i=b-c.left,g=i/e,h=g<=.02?0:g*d.duration,m&&h!==d.currentTime&&d.setCurrentTime(h),mejs.MediaFeatures.hasTouch||(j.css("left",i),k.html(mejs.Utility.secondsToTimeCode(h)),j.show()))},m=!1,n=!1;f.bind("mousedown touchstart",function(a){if(a.which===1||a.which===0)return m=!0,l(a),e.globalBind("mousemove.dur touchmove.dur",function(a){l(a)}),e.globalBind("mouseup.dur touchend.dur",function(a){m=!1,j.hide(),e.globalUnbind(".dur")}),!1}).bind("mouseenter",function(a){n=!0,e.globalBind("mousemove.dur",function(a){l(a)}),mejs.MediaFeatures.hasTouch||j.show()}).bind("mouseleave",function(a){n=!1,m||(e.globalUnbind(".dur"),j.hide())}),d.addEventListener("progress",function(b){a.setProgressRail(b),a.setCurrentRail(b)},!1),d.addEventListener("timeupdate",function(b){a.setProgressRail(b),a.setCurrentRail(b)},!1),e.loaded=g,e.total=f,e.current=h,e.handle=i},setProgressRail:function(a){var b=this,c=a!=undefined?a.target:b.media,d=null;c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration?d=c.buffered.end(0)/c.duration:c&&c.bytesTotal!=undefined&&c.bytesTotal>0&&c.bufferedBytes!=undefined?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&a.total!=0&&(d=a.loaded/a.total),d!==null&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(b.total.width()*d))},setCurrentRail:function(){var a=this;if(a.media.currentTime!=undefined&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);a.current.width(b),a.handle.css("left",c)}}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"}),$.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,d){var e=this;$('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span>"+"</div>").appendTo(b),e.currenttime=e.controls.find(".mejs-currenttime"),d.addEventListener("timeupdate",function(){a.updateCurrent()},!1)},buildduration:function(a,b,c,d){var e=this;b.children().last().find(".mejs-currenttime").length>0?$(e.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(e.options.duration>0?mejs.Utility.secondsToTimeCode(e.options.duration,e.options.alwaysShowHours||e.media.duration>3600,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time")):(b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),$('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(e.options.duration>0?mejs.Utility.secondsToTimeCode(e.options.duration,e.options.alwaysShowHours||e.media.duration>3600,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>"+"</div>").appendTo(b)),e.durationD=e.controls.find(".mejs-duration"),d.addEventListener("timeupdate",function(){a.updateDuration()},!1)},updateCurrent:function(){var a=this;a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(a.media.currentTime,a.options.alwaysShowHours||a.media.duration>3600,a.options.showTimecodeFrameCount,a.options.framesPerSecond||25))},updateDuration:function(){var a=this;a.container.toggleClass("mejs-long-video",a.media.duration>3600),a.durationD&&(a.options.duration>0||a.media.duration)&&a.durationD.html(mejs.Utility.secondsToTimeCode(a.options.duration>0?a.options.duration:a.media.duration,a.options.alwaysShowHours,a.options.showTimecodeFrameCount,a.options.framesPerSecond||25))}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),$.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,d){if((mejs.MediaFeatures.isAndroid||mejs.MediaFeatures.isiOS)&&this.options.hideVolumeOnTouchDevices)return;var e=this,f=e.isVideo?e.options.videoVolume:e.options.audioVolume,g=f=="horizontal"?$('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+'" aria-label="'+e.options.muteText+'"></button>'+"</div>"+'<div class="mejs-horizontal-volume-slider">'+'<div class="mejs-horizontal-volume-total"></div>'+'<div class="mejs-horizontal-volume-current"></div>'+'<div class="mejs-horizontal-volume-handle"></div>'+"</div>").appendTo(b):$('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+e.id+'" title="'+e.options.muteText+'" aria-label="'+e.options.muteText+'"></button>'+'<div class="mejs-volume-slider">'+'<div class="mejs-volume-total"></div>'+'<div class="mejs-volume-current"></div>'+'<div class="mejs-volume-handle"></div>'+"</div>"+"</div>").appendTo(b),h=e.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),i=e.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),j=e.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),k=e.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),l=function(a,b){if(!h.is(":visible")&&typeof b=="undefined"){h.show(),l(a,!0),h.hide();return}a=Math.max(0,a),a=Math.min(a,1),a==0?g.removeClass("mejs-mute").addClass("mejs-unmute"):g.removeClass("mejs-unmute").addClass("mejs-mute");if(f=="vertical"){var c=i.height(),d=i.position(),e=c-c*a;k.css("top",Math.round(d.top+e-k.height()/2)),j.height(c-e),j.css("top",d.top+e)}else{var m=i.width(),d=i.position(),n=m*a;k.css("left",Math.round(d.left+n-k.width()/2)),j.width(Math.round(n))}},m=function(a){var b=null,c=i.offset();if(f=="vertical"){var e=i.height(),g=parseInt(i.css("top").replace(/px/,""),10),h=a.pageY-c.top;b=(e-h)/e;if(c.top==0||c.left==0)return}else{var j=i.width(),k=a.pageX-c.left;b=k/j}b=Math.max(0,b),b=Math.min(b,1),l(b),b==0?d.setMuted(!0):d.setMuted(!1),d.setVolume(b)},n=!1,o=!1;g.hover(function(){h.show(),o=!0},function(){o=!1,!n&&f=="vertical"&&h.hide()}),h.bind("mouseover",function(){o=!0}).bind("mousedown",function(a){return m(a),e.globalBind("mousemove.vol",function(a){m(a)}),e.globalBind("mouseup.vol",function(){n=!1,e.globalUnbind(".vol"),!o&&f=="vertical"&&h.hide()}),n=!0,!1}),g.find("button").click(function(){d.setMuted(!d.muted)}),d.addEventListener("volumechange",function(a){n||(d.muted?(l(0),g.removeClass("mejs-mute").addClass("mejs-unmute")):(l(d.volume),g.removeClass("mejs-unmute").addClass("mejs-mute")))},!1),e.container.is(":visible")&&(l(a.options.startVolume),a.options.startVolume===0&&d.setMuted(!0),d.pluginType==="native"&&d.setVolume(a.options.startVolume))}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),$.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,buildfullscreen:function(a,b,c,d){if(!a.isVideo)return;a.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){var e=function(b){a.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(a.isNativeFullScreen=!0,a.setControlsSize()):(a.isNativeFullScreen=!1,a.exitFullScreen()))};mejs.MediaFeatures.hasMozNativeFullScreen?a.globalBind(mejs.MediaFeatures.fullScreenEventName,e):a.container.bind(mejs.MediaFeatures.fullScreenEventName,e)}var f=this,g=0,h=0,i=a.container,j=$('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+f.id+'" title="'+f.options.fullscreenText+'" aria-label="'+f.options.fullscreenText+'"></button>'+"</div>").appendTo(b);if(f.media.pluginType==="native"||!f.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)j.click(function(){var b=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen;b?a.exitFullScreen():a.enterFullScreen()});else{var k=null,l=function(){var a=document.createElement("x"),b=document.documentElement,c=window.getComputedStyle,d;return"pointerEvents"in a.style?(a.style.pointerEvents="auto",a.style.pointerEvents="x",b.appendChild(a),d=c&&c(a,"").pointerEvents==="auto",b.removeChild(a),!!d):!1}();if(l&&!mejs.MediaFeatures.isOpera){var m=!1,n=function(){if(m){for(var a in o)o[a].hide();j.css("pointer-events",""),f.controls.css("pointer-events",""),f.media.removeEventListener("click",f.clickToPlayPauseCallback),m=!1}},o={},p=["top","left","right","bottom"],q,r,s=function(){var a=j.offset().left-f.container.offset().left,b=j.offset().top-f.container.offset().top,c=j.outerWidth(!0),d=j.outerHeight(!0),e=f.container.width(),g=f.container.height();for(q in o)o[q].css({position:"absolute",top:0,left:0});o.top.width(e).height(b),o.left.width(a).height(d).css({top:b}),o.right.width(e-a-c).height(d).css({top:b,left:a+c}),o.bottom.width(e).height(g-d-b).css({top:b+d})};f.globalBind("resize",function(){s()});for(q=0,r=p.length;q<r;q++)o[p[q]]=$('<div class="mejs-fullscreen-hover" />').appendTo(f.container).mouseover(n).hide();j.on("mouseover",function(){if(!f.isFullScreen){var b=j.offset(),c=a.container.offset();d.positionFullscreenButton(b.left-c.left,b.top-c.top,!1),j.css("pointer-events","none"),f.controls.css("pointer-events","none"),f.media.addEventListener("click",f.clickToPlayPauseCallback);for(q in o)o[q].show();s(),m=!0}}),d.addEventListener("fullscreenchange",function(a){f.isFullScreen=!f.isFullScreen,f.isFullScreen?f.media.removeEventListener("click",f.clickToPlayPauseCallback):f.media.addEventListener("click",f.clickToPlayPauseCallback),n()}),f.globalBind("mousemove",function(a){if(m){var b=j.offset();if(a.pageY<b.top||a.pageY>b.top+j.outerHeight(!0)||a.pageX<b.left||a.pageX>b.left+j.outerWidth(!0))j.css("pointer-events",""),f.controls.css("pointer-events",""),m=!1}})}else j.on("mouseover",function(){k!==null&&(clearTimeout(k),delete k);var b=j.offset(),c=a.container.offset();d.positionFullscreenButton(b.left-c.left,b.top-c.top,!0)}).on("mouseout",function(){k!==null&&(clearTimeout(k),delete k),k=setTimeout(function(){d.hideFullscreenButton()},1500)})}a.fullscreenBtn=j,f.globalBind("keydown",function(b){(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.keyCode==27&&a.exitFullScreen()})},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var a=this;if(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))return;$(document.documentElement).addClass("mejs-fullscreen"),normalHeight=a.container.height(),normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen)mejs.MediaFeatures.requestFullScreen(a.container[0]),a.isInIframe&&setTimeout(function c(){if(a.isNativeFullScreen){var b=window.devicePixelRatio||1,d=.002,e=b*$(window).width(),f=screen.width,g=Math.abs(f-e),h=f*d;g>h?a.exitFullScreen():setTimeout(c,500)}},500);else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!==""){if(!mejs.MediaFeatures.hasTrueNativeFullScreen){a.pause(),window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}setTimeout(function(){a.isNativeFullScreen||(a.pause(),window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no"))},250)}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),a.containerSizeTimeout=setTimeout(function(){a.container.css({width:"100%",height:"100%"}),a.setControlsSize()},500),a.media.pluginType==="native"?a.$media.width("100%").height("100%"):(a.container.find(".mejs-shim").width("100%").height("100%"),a.media.setVideoSize($(window).width(),$(window).height())),a.layers.children("div").width("100%").height("100%"),a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),a.setControlsSize(),a.isFullScreen=!0},exitFullScreen:function(){var a=this;clearTimeout(a.containerSizeTimeout);if(a.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox){a.media.setFullscreen(!1);return}mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||a.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),$(document.documentElement).removeClass("mejs-fullscreen"),a.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight),a.media.pluginType==="native"?a.$media.width(normalWidth).height(normalHeight):(a.container.find(".mejs-shim").width(normalWidth).height(normalHeight),a.media.setVideoSize(normalWidth,normalHeight)),a.layers.children("div").width(normalWidth).height(normalHeight),a.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),a.setControlsSize(),a.isFullScreen=!1}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),$.extend(MediaElementPlayer.prototype,{hasChapters:!1,buildtracks:function(a,b,c,d){if(a.tracks.length==0)return;var e=this,f,g="";if(e.domNode.textTracks)for(var f=e.domNode.textTracks.length-1;f>=0;f--)e.domNode.textTracks[f].mode="hidden";a.chapters=$('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).hide(),a.captions=$('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>').prependTo(c).hide(),a.captionsText=a.captions.find(".mejs-captions-text"),a.captionsButton=$('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+e.id+'" title="'+e.options.tracksText+'" aria-label="'+e.options.tracksText+'"></button>'+'<div class="mejs-captions-selector">'+"<ul>"+"<li>"+'<input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" />'+'<label for="'+a.id+'_captions_none">'+mejs.i18n.t("None")+"</label>"+"</li>"+"</ul>"+"</div>"+"</div>").appendTo(b);var h=0;for(f=0;f<a.tracks.length;f++)a.tracks[f].kind=="subtitles"&&h++;e.options.toggleCaptionsButtonWhenOnlyOne&&h==1?a.captionsButton.on("click",function(){if(a.selectedTrack==null)var b=a.tracks[0].srclang;else var b="none";a.setTrack(b)}):a.captionsButton.hover(function(){$(this).find(".mejs-captions-selector").css("visibility","visible")},function(){$(this).find(".mejs-captions-selector").css("visibility","hidden")}).on("click","input[type=radio]",function(){lang=this.value,a.setTrack(lang)}),a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("controlsshown",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){d.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")}),a.trackToLoad=-1,a.selectedTrack=null,a.isLoadingTrack=!1;for(f=0;f<a.tracks.length;f++)a.tracks[f].kind=="subtitles"&&a.addTrackButton(a.tracks[f].srclang,a.tracks[f].label);a.loadNextTrack(),d.addEventListener("timeupdate",function(b){a.displayCaptions()},!1),a.options.slidesSelector!=""&&(a.slidesContainer=$(a.options.slidesSelector),d.addEventListener("timeupdate",function(b){a.displaySlides()},!1)),d.addEventListener("loadedmetadata",function(b){a.displayChapters()},!1),a.container.hover(function(){a.hasChapters&&(a.chapters.css("visibility","visible"),a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight()))},function(){a.hasChapters&&!d.paused&&a.chapters.fadeOut(200,function(){$(this).css("visibility","hidden"),$(this).css("display","block")})}),a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")},setTrack:function(a){var b=this,c;if(a=="none")b.selectedTrack=null,b.captionsButton.removeClass("mejs-captions-enabled");else for(c=0;c<b.tracks.length;c++)if(b.tracks[c].srclang==a){b.selectedTrack==null&&b.captionsButton.addClass("mejs-captions-enabled"),b.selectedTrack=b.tracks[c],b.captions.attr("lang",b.selectedTrack.srclang),b.displayCaptions();break}},loadNextTrack:function(){var a=this;a.trackToLoad++,a.trackToLoad<a.tracks.length?(a.isLoadingTrack=!0,a.loadTrack(a.trackToLoad)):(a.isLoadingTrack=!1,a.checkForTracks())},loadTrack:function(a){var b=this,c=b.tracks[a],d=function(){c.isLoaded=!0,b.enableTrackButton(c.srclang,c.label),b.loadNextTrack()};$.ajax({url:c.src,dataType:"text",success:function(a){typeof a=="string"&&/<tt\s+xml/gi.exec(a)?c.entries=mejs.TrackFormatParser.dfxp.parse(a):c.entries=mejs.TrackFormatParser.webvvt.parse(a),d(),c.kind=="chapters"&&b.media.addEventListener("play",function(a){b.media.duration>0&&b.displayChapters(c)},!1),c.kind=="slides"&&b.setupSlides(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){var c=this;b===""&&(b=mejs.language.codes[a]||a),c.captionsButton.find("input[value="+a+"]").prop("disabled",!1).siblings("label").html(b),c.options.startLanguage==a&&$("#"+c.id+"_captions_"+a).click(),c.adjustLanguageBox()},addTrackButton:function(a,b){var c=this;b===""&&(b=mejs.language.codes[a]||a),c.captionsButton.find("ul").append($('<li><input type="radio" name="'+c.id+'_captions" id="'+c.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" />'+'<label for="'+c.id+"_captions_"+a+'">'+b+" (loading)"+"</label>"+"</li>")),c.adjustLanguageBox(),c.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(i=0;i<a.tracks.length;i++)if(a.tracks[i].kind=="subtitles"){b=!0;break}b||(a.captionsButton.hide(),a.setControlsSize())}},displayCaptions:function(){if(typeof this.tracks=="undefined")return;var a=this,b,c=a.selectedTrack;if(c!=null&&c.isLoaded){for(b=0;b<c.entries.times.length;b++)if(a.media.currentTime>=c.entries.times[b].start&&a.media.currentTime<=c.entries.times[b].stop){a.captionsText.html(c.entries.text[b]),a.captions.show().height(0);return}a.captions.hide()}else a.captions.hide()},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(a){if(typeof this.tracks=="undefined"||typeof this.slidesContainer=="undefined")return;var b=this,c=b.slides.entries.text[a],d=b.slides.entries.imgs[a];typeof d=="undefined"||typeof d.fadeIn=="undefined"?b.slides.entries.imgs[a]=d=$('<img src="'+c+'">').on("load",function(){d.appendTo(b.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):!d.is(":visible")&&!d.is(":animated")&&d.fadeIn().siblings(":visible").fadeOut()},displaySlides:function(){if(typeof this.slides=="undefined")return;var a=this,b=a.slides,c;for(c=0;c<b.entries.times.length;c++)if(a.media.currentTime>=b.entries.times[c].start&&a.media.currentTime<=b.entries.times[c].stop){a.showSlide(c);return}},displayChapters:function(){var a=this,b;for(b=0;b<a.tracks.length;b++)if(a.tracks[b].kind=="chapters"&&a.tracks[b].isLoaded){a.drawChapters(a.tracks[b]),a.hasChapters=!0;break}},drawChapters:function(a){var b=this,c,d,e=0,f=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){d=a.entries.times[c].stop-a.entries.times[c].start,e=Math.floor(d/b.media.duration*100);if(e+f>100||c==a.entries.times.length-1&&e+f<100)e=100-f;b.chapters.append($('<div class="mejs-chapter" rel="'+a.entries.times[c].start+'" style="left: '+f.toString()+"%;width: "+e.toString()+'%;">'+'<div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'">'+'<span class="ch-title">'+a.entries.text[c]+"</span>"+'<span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+"</span>"+"</div>"+"</div>")),f+=e}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat($(this).attr("rel"))),b.media.paused&&b.media.play()}),b.chapters.show()}}),mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}},mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(a){var b=0,c=mejs.TrackFormatParser.split2(a,/\r?\n/),d={text:[],times:[]},e,f;for(;b<c.length;b++)if(this.pattern_identifier.exec(c[b])){b++,e=this.pattern_timecode.exec(c[b]);if(e&&b<c.length){b++,f=c[b],b++;while(c[b]!==""&&b<c.length)f=f+"\n"+c[b],b++;f=$.trim(f).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),d.text.push(f),d.times.push({start:mejs.Utility.convertSMPTEtoSeconds(e[1])==0?.2:mejs.Utility.convertSMPTEtoSeconds(e[1]),stop:mejs.Utility.convertSMPTEtoSeconds(e[3]),settings:e[5]})}}return d}},dfxp:{parse:function(a){a=$(a).filter("tt");var b=0,c=a.children("div").eq(0),d=c.find("p"),e=a.find("#"+c.attr("style")),f,g,h,i,j={text:[],times:[]};if(e.length){var k=e.removeAttr("id").get(0).attributes;if(k.length){f={};for(b=0;b<k.length;b++)f[k[b].name.split(":")[1]]=k[b].value}}for(b=0;b<d.length;b++){var l,m={start:null,stop:null,style:null};d.eq(b).attr("begin")&&(m.start=mejs.Utility.convertSMPTEtoSeconds(d.eq(b).attr("begin"))),!m.start&&d.eq(b-1).attr("end")&&(m.start=mejs.Utility.convertSMPTEtoSeconds(d.eq(b-1).attr("end"))),d.eq(b).attr("end")&&(m.stop=mejs.Utility.convertSMPTEtoSeconds(d.eq(b).attr("end"))),!m.stop&&d.eq(b+1).attr("begin")&&(m.stop=mejs.Utility.convertSMPTEtoSeconds(d.eq(b+1).attr("begin")));if(f){l="";for(var n in f)l+=n+":"+f[n]+";"}l&&(m.style=l),m.start==0&&(m.start=.2),j.times.push(m),i=$.trim(d.eq(b).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),j.text.push(i),j.times.start==0&&(j.times.start=2)}return j}},split2:function(a,b){return a.split(b)}},"x\n\ny".split(/\n/gi).length!=3&&(mejs.TrackFormatParser.split2=function(a,b){var c=[],d="",e;for(e=0;e<a.length;e++)d+=a.substring(e,e+1),b.test(d)&&(c.push(d.replace(b,"")),d="");return c.push(d),c})}(mejs.$),function($){$.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){return typeof a.enterFullScreen=="undefined"?null:a.isFullScreen?mejs.i18n.t("Turn off Fullscreen"):mejs.i18n.t("Go Fullscreen")},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?mejs.i18n.t("Unmute"):mejs.i18n.t("Mute")},click:function(a){a.media.muted?a.setMuted(!1):a.setMuted(!0)}},{isSeparator:!0},{render:function(a){return mejs.i18n.t("Download Video")},click:function(a){window.location.href=a.media.currentSrc}}]}),$.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a,b,c,d){a.contextMenu=$('<div class="mejs-contextmenu"></div>').appendTo($("body")).hide(),a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled)return b.preventDefault(),a.renderContextMenu(b.clientX-1,b.clientY-1),!1}),a.container.bind("click",function(){a.contextMenu.hide()}),a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer(),a.contextMenuTimer=setTimeout(function(){a.hideContextMenu(),a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;a!=null&&(clearTimeout(a),delete a,a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,b){var c=this,d="",e=c.options.contextMenuItems;for(var f=0,g=e.length;f<g;f++)if(e[f].isSeparator)d+='<div class="mejs-contextmenu-separator"></div>';else{var h=e[f].render(c);h!=null&&(d+='<div class="mejs-contextmenu-item" data-itemindex="'+f+'" id="element-'+Math.random()*1e6+'">'+h+"</div>")}c.contextMenu.empty().append($(d)).css({top:b,left:a}).show(),c.contextMenu.find(".mejs-contextmenu-item").each(function(){var a=$(this),b=parseInt(a.data("itemindex"),10),d=c.options.contextMenuItems[b];typeof d.show!="undefined"&&d.show(a,c),a.click(function(){typeof d.click!="undefined"&&d.click(c),c.contextMenu.hide()})}),setTimeout(function(){c.killControlsTimer("rev3")},100)}})}(mejs.$),function($){$.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),$.extend(MediaElementPlayer.prototype,{buildpostroll:function(a,b,c,d){var e=this,f=e.container.find('link[rel="postroll"]').attr("href");typeof f!="undefined"&&(a.postroll=$('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+e.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(c).hide(),e.media.addEventListener("ended",function(b){$.ajax({dataType:"html",url:f,success:function(a,b){c.find(".mejs-postroll-layer-content").html(a)}}),a.postroll.show()},!1))}})}(mejs.$)
});
define("app/ui/with_tweet_click_handler",["module","require","exports","$lib/mediaelement.js","app/utils/caret","core/utils","app/utils/cookie","app/utils/scribe_item_types"],function(module, require, exports) {
require("$lib/mediaelement.js");var caret=require("app/utils/caret"),utils=require("core/utils"),cookie=require("app/utils/cookie"),scribeItemTypes=require("app/utils/scribe_item_types");module.exports=function(){this.defaultAttrs({jsMediaPreviewSelector:".js-media-preview",jsTweetSelector:".js-stream-tweet",jsLinkSelector:".js-link",jsPermalinkSelector:".js-permalink",jsDetailsLinkSelector:".js-details",jsAdaptivePhotoSelector:".js-adaptive-photo",quoteTweetSelector:".QuoteTweet-container",quoteTweetClass:"QuoteTweet-container",quoteTweetInnerSelector:".QuoteTweet-innerContainer",pushState:!0,expandoHandleSelector:".js-open-close-tweet span",dropdownSelector:".ProfileTweet-action .dropdown-menu",withheldTweetClass:"withheld-tweet",profileTweetActionButtonSelector:".js-actionButton",profileTweetActionCountSelector:".js-actionCount",tweetMoreButtonSelector:".js-expand-tweet",jsTweetTextContainer:".js-tweet-text-container",jsExpandedTweetTextSelector:".js-expanded-tweet-text",jsTweetText:".js-tweet-text"}),this.shouldNavigateToPermalink=function(a){return this.attr.isMobile||this.isQuoteTweet(a)},this.isQuoteTweet=function(a){return a.hasClass(this.attr.quoteTweetClass)},this.handleMediaPreviewClick=function(a,b){var c=$(b.el),d=c.closest(this.attr.jsTweetSelector);this.shouldExpandWhenTargetIs($(a.target),d)&&(a.preventDefault(),a.stopPropagation(),this.handleClick(a,d,!0))},this.handleQuoteTweetClick=function(a){var b=a.closest("[data-tweet-id]").attr("data-tweet-id"),c=a.find(this.attr.quoteTweetInnerSelector).attr("data-item-id"),d=[{id:b,item_type:scribeItemTypes.tweet},{id:c,item_type:scribeItemTypes.quotedTweet}];this.trigger("uiQuoteTweetClick",{items:d})},this.handleTweetClick=function(a,b){var c=$(b.el);this.isQuoteTweet(c)&&this.handleQuoteTweetClick(c);if(a.type=="uiExpandTweet"||this.shouldExpandWhenTargetIs($(a.target),c))a.preventDefault(),a.stopPropagation(),this.handleClick(a,c,!1)},this.handleClick=function(a,b,c){var d=b.find(this.attr.jsPermalinkSelector),e=d.attr("href"),f=b.closest("[data-impression-id]"),g={impressionId:f.attr("data-impression-id"),disclosureType:f.attr("data-disclosure-type"),impressionCookie:f.attr("data-impression-cookie"),href:e};if(!c&&this.shouldNavigateToPermalink(b)){this.setImpressionCookieOnProfileTweet(b),b.trigger("uiHasClickedTweet",utils.merge(g,{organicExpansion:!0}));var d=b.find(this.attr.jsPermalinkSelector),e=d.attr("href"),h=d.attr("target");this.modifierKey(a)||h==="_blank"?window.open(e,"_blank"):this.trigger("uiNavigate",g)}else this.attr.deciders&&this.attr.deciders.overlayPermalink&&this.trigger("uiHasClickedTweet",utils.merge(g,{organicExpansion:!0})),this.trigger(b.parent(),"uiShouldToggleExpandedState",utils.merge(g,{autoplay:c}))},this.setImpressionCookieOnProfileTweet=function(a){if(a.hasClass("profile-promoted-tweet")){var b=a.closest("[data-impression-cookie]").attr("data-impression-cookie");if(b){var c=new Date,d=1e4,e=new Date(c.getTime()+d);this.setCookie(b,e)}}},this.shouldExpandWhenTargetIs=function(a,b){return this.selectedText()||b.hasClass(this.attr.withheldTweetClass)?!1:this.targetIsWhitelistedToExpandTweet(a,b)||!this.targetIsBlacklistedToExpandTweet(a,b)},this.targetIsWhitelistedToExpandTweet=function(a,b){var c=[this.attr.expandoHandleSelector,this.attr.jsDetailsLinkSelector,this.attr.jsMediaPreviewSelector,this.attr.quoteTweetSelector];return a.closest(c.join(),b).length>0},this.targetIsBlacklistedToExpandTweet=function(a,b){var c=["a","button",this.attr.jsLinkSelector,this.attr.dropdownSelector,this.attr.jsAdaptivePhotoSelector];return a.closest(c.join(),b).length},this.handleMoreClick=function(a,b){var c=$(a.target).closest(this.attr.jsTweetTextContainer),d=c.find(this.attr.jsExpandedTweetTextSelector).html(),e=c.find(this.attr.jsTweetText);e.length&&d.length&&(e.html(d),a.preventDefault(),a.stopPropagation())},this.selectedText=function(){return caret.getSelection()},this.modifierKey=function(a){return a.shiftKey||a.ctrlKey||a.metaKey||a.which>1},this.preventFocusOnClick=function(a){a.preventDefault()},this.setCookie=function(a,b){cookie("ic",a,{expires:b})},this.after("initialize",function(){this.on("click uiExpandTweet",{jsMediaPreviewSelector:this.handleMediaPreviewClick,quoteTweetSelector:this.handleTweetClick,jsTweetSelector:this.handleTweetClick,tweetMoreButtonSelector:this.handleMoreClick}),this.on("uiShortcutEnter",{quoteTweetSelector:this.handleTweetClick}),this.on("mousedown",{profileTweetActionButtonSelector:this.preventFocusOnClick,profileTweetActionCountSelector:this.preventFocusOnClick,quoteTweetSelector:this.preventFocusOnClick})})}
});
define("app/ui/dm/conversation/tweet_attachment",["module","require","exports","core/component","app/ui/with_tweet_click_handler"],function(module, require, exports) {
function tweetAttachment(){this.defaultAttrs({sharedTweetSelector:".DirectMessage-tweet"}),this.openSharedTweet=function(a,b){this.trigger("uiDMDialogSharedTweetClick")},this.after("initialize",function(){this.on("click",{sharedTweetSelector:this.openSharedTweet})})}var defineComponent=require("core/component"),withTweetClickHandler=require("app/ui/with_tweet_click_handler"),TweetAttachment=defineComponent(tweetAttachment,withTweetClickHandler);module.exports=TweetAttachment
});
define("app/ui/dm/conversation/update_conversation_avatar",["module","require","exports","core/component","app/utils/file_selection_error_messages","app/ui/with_file_selection","app/data/with_media_upload"],function(module, require, exports) {
function updateAvatar(){this.attributes({avatarSelector:".DMUpdateAvatar-avatar",popoverSelector:".DMPopover",popoverContentSelector:".DMPopover-content",viewAvatarSelector:".DMUpdateAvatar-view",removeAvatarSelector:".DMUpdateAvatar-remove",changeAvatarSelector:".DMUpdateAvatar-change",spinnerClass:"DMSpinner",fileDataSelector:"input.file-data",fileDataString:"media_data[]",emptyFileDataString:"media_data_empty",fileInputString:"media[]",emptyFileInputString:"media_empty",fileNameSelector:"input.file-name",fileNameString:"media_file_name",fileSelector:"input.file-input",gifSupport:!1,videoSupport:!1,shouldInterceptTab:!1}),this.resetAvatar=function(a,b){this.avatarHTML=undefined,this.fullSizeUrl=undefined,this.conversationId=undefined,this.customAvatar=!1,this.editAllowed=!1,this.isLoading=!1},this.updateAvatar=function(a,b){if(b&&b.html&&this.avatarHTML==b.html)return;this.avatarHTML=b.html,this.fullSizeUrl=b.full_size_url,this.conversationId=b.conversation_id,this.customAvatar=b.is_custom,this.editAllowed=b.is_oto===!1,this.isLoading=!1},this.showAvatar=function(){if(!this.fullSizeUrl)return;this.trigger("uiDMDialogMediaPreview",{imgUrl:this.fullSizeUrl})},this.removeAvatar=function(){this.isLoading=!0,this.trigger("uiDMRemoveConversationAvatar",{conversation_id:this.conversationId})},this.changeAvatar=function(){this.select("fileSelector").click()},this.gotImageData=function(a,b){this.reset(),this.isLoading=!0;var c=b.split(/data:|;base64,/),d={fileData:c[2]},e=function(a){this.trigger("uiDMUpdateConversationAvatar",{conversation_id:this.conversationId,media_id:a})}.bind(this);this.uploadMedia(d).then(e,this.updateFailed.bind(this))},this.updateFailed=function(){this.isLoading=!1},this.addFileError=function(a){var b=genericFileErrorMessage(a);b&&this.trigger("uiShowError",{message:b}),this.updateFailed()},this.toggleSpinner=function(a){this.$avatar.toggleClass(this.attr.spinnerClass,a)},this.disablePopover=function(){this.select("popoverSelector").trigger("uiDisableDMPopover")},this.enablePopover=function(){this.select("popoverSelector").trigger("uiEnableDMPopover")},this.render=function(){this.isLoading?(this.$avatar.empty(),this.toggleSpinner(!0),this.disablePopover()):(this.avatarHTML?this.$avatar.html(this.avatarHTML):this.$avatar.empty(),this.toggleSpinner(!1),this.editAllowed?this.enablePopover():this.disablePopover(),this.$node.attr("data-has-custom-avatar",this.customAvatar))},this.after("resetAvatar",this.render),this.after("updateAvatar",this.render),this.after("removeAvatar",this.render),this.after("gotImageData",this.render),this.after("updateFailed",this.render),this.after("initialize",function(){this.$avatar=this.select("avatarSelector"),this.on("uiDMResetConversationAvatar",this.resetAvatar),this.on("uiDMSetConversationAvatar",this.updateAvatar),this.on("dataDMUpdateConversationAvatarFailed dataDMRemoveConversationAvatarFailed",this.updateFailed),this.on("click",{viewAvatarSelector:this.showAvatar,changeAvatarSelector:this.changeAvatar,removeAvatarSelector:this.removeAvatar,popoverContentSelector:"uiCloseDropdowns"})})}var defineComponent=require("core/component"),genericFileErrorMessage=require("app/utils/file_selection_error_messages"),withFileSelection=require("app/ui/with_file_selection"),withMediaUpload=require("app/data/with_media_upload");module.exports=defineComponent(updateAvatar,withFileSelection,withMediaUpload)
});
define("app/ui/dm/conversation/update_conversation_name",["module","require","exports","core/i18n","core/component","lib/twitter-text","app/ui/input_polling","app/utils/keycode_map"],function(module, require, exports) {
function updateName(){this.attributes({maxCharacters:20,conversationIdSelector:"[data-conversation-id]",displayedNameSelector:".DMUpdateName-name",beginEditModeSelector:".DMUpdateName-name.edit-allowed",confirmButtonSelector:".DMUpdateName-confirm",inputGroupSelector:".DMUpdateName-form",spinnerSelector:".DMUpdateName-spinner",textSelector:".DMUpdateName-input",updateNameContainerSelector:".DMUpdateName-controls",hiddenClass:"u-hidden",invalidInputClass:"is-invalid"}),this.getConversationId=function(){return this.select("conversationIdSelector").attr("data-conversation-id")},this.getCurrentName=function(){return this.select("displayedNameSelector").data("raw-name")},this.handleCommandInputs=function(a,b){switch(a.keyCode){case Keycode.ESC:a.stopPropagation(),this.hideEditMode();break;case Keycode.ENTER:a.stopPropagation(),this.requestUpdateConversationName();break;default:}},this.showEditMode=function(){this.select("displayedNameSelector").addClass(this.attr.hiddenClass),this.select("inputGroupSelector").removeClass(this.attr.hiddenClass),this.select("textSelector").focus().val(this.getCurrentName()),this.inEditMode=!0},this.hideEditMode=function(a,b){this.select("displayedNameSelector").removeClass(this.attr.hiddenClass),this.select("inputGroupSelector").addClass(this.attr.hiddenClass),this.inEditMode=!1},this.showSpinner=function(){this.select("textSelector").unbind("blur"),this.hideEditMode(),this.select("displayedNameSelector").addClass(this.attr.hiddenClass),this.select("spinnerSelector").removeClass(this.attr.hiddenClass)},this.hideSpinner=function(){this.on(this.attr.textSelector,"blur",this.hideEditMode),this.hideEditMode(),this.select("spinnerSelector").addClass(this.attr.hiddenClass),this.select("displayedNameSelector").removeClass(this.attr.hiddenClass)},this.requestUpdateConversationName=function(){if(!this.select("inputGroupSelector").hasClass(this.attr.invalidInputClass)){var a=this.select("textSelector").val();this.trigger("uiUpdateConversationName",{conversation_id:this.getConversationId(),name:a}),this.showSpinner()}},this.updateDisplayedName=function(a,b){this.select("displayedNameSelector").html(b.conversation.title.html),this.hideSpinner()},this.prepareUpdateNameUI=function(a,b){typeof b.is_oto=="undefined"||b.is_oto?(this.hideSpinner(),this.select("updateNameContainerSelector").addClass(this.attr.hiddenClass),this.select("displayedNameSelector").removeClass("edit-allowed js-tooltip").removeAttr("title")):this.inEditMode||(this.hideSpinner(),this.select("updateNameContainerSelector").removeClass(this.attr.hiddenClass),this.select("displayedNameSelector").attr("title",_('Hier klicken, um Gruppenname zu bearbeiten')).addClass("edit-allowed js-tooltip"))},this.handleInputChange=function(a,b){var c=twitterText.getTweetLength(b.text)>this.attr.maxCharacters;this.select("inputGroupSelector").toggleClass(this.attr.invalidInputClass,c)},this.detectInputChange=function(){var a=this.select("textSelector").val();this.previousText!=a&&(this.trigger("uiTextChanged",{text:a}),this.previousText=a)},this.after("initialize",function(){this.on("click",{beginEditModeSelector:this.showEditMode,confirmButtonSelector:this.requestUpdateConversationName}),this.on(this.attr.textSelector,"blur",this.hideEditMode),this.on(this.attr.textSelector,"keydown",this.handleCommandInputs),this.on("uiEditConversationName",this.showEditMode),this.on("uiUpdateConversationType",this.prepareUpdateNameUI),this.on("dataUpdateConversationNameSuccess",this.updateDisplayedName),this.on("dataUpdateConversationNameFailure",this.hideSpinner),this.on("uiTextChanged",this.handleInputChange),this.on("uiInputPoll",this.detectInputChange),InputPolling.attachTo(this.select("textSelector"))})}var _=require("core/i18n"),defineComponent=require("core/component"),twitterText=require("lib/twitter-text"),InputPolling=require("app/ui/input_polling"),Keycode=require("app/utils/keycode_map"),UpdateName=defineComponent(updateName);module.exports=UpdateName
});
define("app/ui/dm/conversation/with_last_read_marker",["module","require","exports","lib/twitter_cldr","template"],function(module, require, exports) {
function lastReadMarker(){this.attributes({markerSelector:".DMConversation-lastReadMarker",markerTemplate:"dm/last_read_marker",messageIdAttr:"data-message-id",receivedMessagesSelector:".DirectMessage--received",scrollContainerSelector:".DMConversation-scrollContainer"}),this.removeMarker=function(){this.select("markerSelector").slideUp({duration:350})},this.applyMarker=function(a){var b=this.findLastReadNode(a),c=b.nextAll().filter(this.attr.receivedMessagesSelector),d=c.first(),e=!!d.length;if(!e)return;d.prev().removeClass("is-rapidFire");var f=c.length,g={unread_count:f};g["unread_count_"+TwitterCldr.PluralRules.rule_for(c.length)]=!0,d.before(template[this.attr.markerTemplate].render(g));var h=d.prop("offsetTop")-this.$scrollContainer.height()*.33;this.$scrollContainer.scrollTop(h)},this.findLastReadNode=function(a){return this.$node.find("["+this.attr.messageIdAttr+"="+a+"]")},this.after("initialize",function(){this.$scrollContainer=this.select("scrollContainerSelector")})}var TwitterCldr=require("lib/twitter_cldr"),template=require("template");module.exports=lastReadMarker
});
define("app/ui/dm/conversation/activity",["module","require","exports","app/utils/string","core/component","core/utils","app/utils/with_no_teardown_child_components","app/ui/dm/conversation/conversation_actions","app/ui/dm/conversation/conversation_history","app/ui/compose/dm_composer","app/data/dm/dm_info","app/ui/dm/sending_state_indicator","app/ui/dm/conversation/delete_conversation","app/ui/dm/conversation/delete_message","app/ui/dm/conversation/emoji_bar","app/ui/b2c/feedback_panel","app/ui/dm/conversation/message_actions","app/ui/playable_media/playable_media_manager","app/ui/dm/conversation/report_conversation","app/ui/dm/conversation/report_message","app/ui/media/sensitive_media_tweets","app/ui/dm/conversation/suspicious_message","app/ui/dm/conversation/tweet_attachment","app/ui/dm/conversation/update_conversation_avatar","app/ui/dm/conversation/update_conversation_name","app/ui/dm/conversation/with_last_read_marker"],function(module, require, exports) {
function dmConversation(){this.attributes({messageClass:"DirectMessage",sentMessageSelector:".DirectMessage--sent",emojiOnlyMessageSelector:".DirectMessage--emoji",receivedMessageSelector:".DirectMessage--received",newMessagesPillSelector:".DMConversation-newMessagesPill",pageBackRange:1e3,dmComposerSelector:".DMComposer",dmComposerSectionSelector:".DMConversation-composer",viewConversation:".DMConversation",conversationContentSelector:".DMConversation-content",conversationScrollContainer:".DMConversation-scrollContainer",conversationActionsDropdownSelector:".DMConversationActions",conversationActionsContentSelector:".DMConversationActions-content",conversationNameSelector:".DMConversation-name",conversationReadonlyClass:"is-readonly",spinnerSelector:".DMConversation-spinner",conversationAvatarSelector:".DMUpdateAvatar",sendingStateSelector:".DMConversation-sendingStateIndicator",maxCharacters:1e4}),this.prepareConversationView=function(a,b){b=b||{};var c=a.type==="uiOpenNewConversationView",d=c&&b.screen_names&&b.screen_names.length===1;this.trigger("uiDMDialogClearActions"),this.trigger("uiUpdateConversationType",{is_oto:b.is_oto}),this.trigger("uiUpdateConversationState",{is_readonly:b.is_readonly}),this.triggerOnConversationAvatar("uiDMResetConversationAvatar");var e=b.name||b.generated_name,f=d?"text":"html";this.$conversationName[f](e),this.$content.empty().removeAttr("data-thread-id").attr("data-thread-id",b.conversation_id),this.$viewConversation.removeAttr("data-thread-id").attr("data-thread-id",b.conversation_id),this.removeConversationActions(),this.hideNewMessagesPill(),c?this.hideSpinner():(this.showSpinner(),this.loadConversationData(b))},this.currentConversationId=function(){return this.$content.attr("data-thread-id")},this.isExistingConversation=function(){return!!this.currentConversationId()},this.isDataForCurrentConversation=function(a){return!this.isExistingConversation()||a.conversation_id==this.currentConversationId()},this.processConversationResult=function(a,b){a&&a.preventDefault();if(!b||!this.isDataForCurrentConversation(b))return;this.isExistingConversation()||this.initializeDMComposer(null,b),this.$content.attr("data-thread-id",b.conversation_id),this.$viewConversation.attr("data-thread-id",b.conversation_id);var c=b.conversation_id;this.$conversationName.empty().removeData("raw-name");if(b.conversation&&b.conversation.title){var d=b.conversation.title;this.$conversationName.html(d.html).data("raw-name",d.raw)}this.updateConversationAvatar(b),this.trigger("uiUpdateConversationType",{is_oto:b.is_oto}),this.trigger("uiUpdateConversationState",{is_readonly:b.is_readonly}),b.conversation_actions?this.updateConversationActions(b.conversation_actions.html):this.removeConversationActions();var e=this.$content.children(),f=e.first().attr("data-message-id"),g=e.last().attr("data-message-id");this.$content.is(":visible")&&b.conversation&&b.conversation.is_unread&&this.trigger("dataMarkDMsAsRead",{last_message_id:b.sort_event_id||-1,recipient_id:b.conversation_id}),this.updateConversationHTML(b,f,g),b.has_more===!1&&this.hideSpinner(),this.trigger("uiDMConversationUpdated",b)},this.processUserUpdatesResult=function(a,b){if(b.should_request_inbox||b.is_empty)return;var c=this.$content.attr("data-thread-id");(b.conversations||[]).forEach(function(a){a.conversation_id==c&&this.processConversationResult(null,a)},this),(b.update_events||[]).filter(function(_){return _.conversation_id==c}).forEach(function(a){switch(a.type){case"conversation_delete":this.trigger("uiCloseDMConversation");break;case"message_delete":this.$content.find('[data-message-id="'+a.message_id+'"]').remove(),this.$content.children().length==0&&this.trigger("uiCloseDMConversation");break;case"mark_spam":case"unmark_spam":a.messages.forEach(function(a){var b=$(a.html);this.$content.find('[data-message-id="'+a.message_id+'"]').replaceWith(b)},this)}},this),this.updateRapidFire()},this.removeAnimationClass=function(a,b){var c=$(a.target).closest(this.attr.emojiOnlyMessageSelector);c.removeClass("is-animating")},this.removeConversationActions=function(){this.$conversationActionsDropdown.addClass("u-hidden"),this.$conversationActionsContent.empty()},this.updateConversationActions=function(a){this.$conversationActionsContent.html(a),this.$conversationActionsDropdown.removeClass("u-hidden")},this.updateConversationState=function(a,b){this.$viewConversation.toggleClass(this.attr.conversationReadonlyClass,!!b.is_readonly)},this.generateConversationHTML=function(a,b,c){var d=a.items,e=Object.keys(d);e.sort(StringUtils.compare);var f=!b||!c,g="",h="",i=e.forEach(function(a){f||StringUtils.compare(a,b)<0?g+=d[a]:StringUtils.compare(a,c)>0&&(h+=d[a])});return{prepend:g,append:h}},this.updateConversationHTML=function(a,b,c){var d=this.generateConversationHTML(a,b,c),e=this.$container[0].scrollHeight-this.$container.scrollTop();this.$content.prepend(d.prepend);var f=this.$container[0].scrollHeight-e;this.$container.scrollTop(f),this.$content.append(d.append),this.updateRapidFire(c),this.addAnimation(c),this.updateScrollPosition(a,c)},this.updateRapidFire=function(a){if(!a)return;var b=this.attr.messageClass,c=this.$content.find('[data-message-id="'+a+'"]').nextAll().addBack();c.each(function(a,c){var d=$(this),e=d.next(),f=d.hasClass(b);if(f&&e.hasClass(b)){var g=d.find("[data-user-id]").attr("data-user-id"),h=d.find("[data-time]").attr("data-time"),i=e.find("[data-user-id]").attr("data-user-id"),j=e.find("[data-time]").attr("data-time");d.css("height"),g==i&&j-h<60&&!d.hasClass("DirectMessage--emoji")&&!e.hasClass("DirectMessage--emoji")?d.addClass("is-rapidFire"):d.removeClass("is-rapidFire")}else f&&!e.hasClass(b)&&d.removeClass("is-rapidFire")})},this.addAnimation=function(a){var b=this.$content.find('[data-message-id="'+a+'"]').nextAll(this.attr.emojiOnlyMessageSelector).addClass("is-animating")},this.requestNextPage=function(){this.trigger("uiNeedsDMConversation",{conversation_id:this.$content.attr("data-thread-id"),max_entry_id:this.$content.children().first().attr("data-message-id")})},this.hideNewMessagesPill=function(){this.$newMessagesPill.addClass("is-hidden")},this.showNewMessagesPill=function(){this.$newMessagesPill.removeClass("is-hidden"),setTimeout(this.hideNewMessagesPill.bind(this),3500)},this.showSpinner=function(){this.$spinner.removeClass("u-hidden")},this.hideSpinner=function(){this.$spinner.addClass("u-hidden")},this.updateScrollPosition=function(a,b){var c=!b,d=a.max_entry_id,e=this.$content.find('[data-message-id="'+b+'"]'),f=e.nextAll(this.attr.sentMessageSelector).length,g=e.nextAll(this.attr.receivedMessageSelector).length;c?(this.$container.scrollTop(this.$container[0].scrollHeight),this.applyMarker(a.last_read_event_id)):g?e.position().top<this.$container[0].clientHeight?this.scrollToBottom():this.showNewMessagesPill():f&&(this.scrollToBottom(),this.removeMarker())},this.scrollToBottom=function(){this.$container.clearQueue().animate({scrollTop:this.$container[0].scrollHeight},800),this.hideNewMessagesPill()},this.initializeDMComposer=function(a,b){this.trigger(this.attr.dmComposerSelector,"uiInitializeDMComposer",b)},this.loadConversationData=function(a){this.$viewConversation.trigger("uiNeedsDMConversation",{conversation_id:a.conversation_id,fromInitData:a.fromInitData})},this.updateConversationAvatar=function(a){var b=a.conversation&&a.conversation.avatar;b?this.triggerOnConversationAvatar("uiDMSetConversationAvatar",{html:b.html,full_size_url:b.full_size_url,conversation_id:a.conversation_id,is_custom:b.is_custom,is_oto:a.is_oto}):this.triggerOnConversationAvatar("uiDMResetConversationAvatar")},this.triggerOnConversationAvatar=function(a,b){this.$avatar.trigger(a,b)},this.showComposeSection=function(){this.select("dmComposerSectionSelector").show()},this.hideComposeSection=function(){this.select("dmComposerSectionSelector").hide(),this.scrollToBottom()},this.after("initialize",function(){this.attachChild(ConversationActions,this.$node),this.attachChild(DeleteConversationUI,this.$node),this.attachChild(DeleteMessageUI,this.$node),this.attachChild(EmojiBar,this.$node.find(".EmojiBar")),this.attachChild(MessageActions,this.$node),this.attachChild(ReportConversationUI,this.$node),this.attachChild(ReportMessageUI,this.$node),this.attachChild(SensitiveMediaTweets,this.$node,{tweetSelector:".DirectMessage-message",mediaNotDisplayedSelector:".Sensitive-warning",mediaContainerSelector:".Sensitive-content",hiddenClass:"u-hidden"}),this.attachChild(SuspiciousMessage,this.$node),this.attachChild(TweetAttachmentUI,this.$node,{eventData:{scribeContext:{component:"dm_existing_conversation_dialog"}}}),this.attachChild(UpdateConversationAvatarUI,this.$node.find(".DMUpdateAvatar")),this.attachChild(UpdateConversationNameUI,this.$node),this.attachChild(DMComposer,this.select("dmComposerSelector"),{defaultText:"",condensedText:"",suppressFlashMessage:!0,eventData:{scribeContext:{component:"tweet_box_dm"}},dmOnly:!0,fileDataString:"media",fileInputString:"media",maxLength:this.attr.maxCharacters,warnLength:this.attr.maxCharacters-20,superwarnLength:this.attr.maxCharacters-10,gifSupport:DMInfo.get("video_gif_upload"),videoSupport:DMInfo.get("video_gif_upload")}),this.attachChild(ConversationHistory,this.$node),this.attachChild(FeedbackPanel,this.$node),this.attachChild(DMSendingStateIndicator,this.select("sendingStateSelector")),this.$avatar=this.select("conversationAvatarSelector"),this.$container=this.select("conversationScrollContainer"),this.$content=this.select("conversationContentSelector"),this.$viewConversation=this.select("viewConversation"),this.$conversationName=this.select("conversationNameSelector"),this.$spinner=this.select("spinnerSelector"),this.$newMessagesPill=this.select("newMessagesPillSelector"),this.$conversationActionsContent=this.select("conversationActionsContentSelector"),this.$conversationActionsDropdown=this.select("conversationActionsDropdownSelector"),this.attachChild(PlayableMediaManager,this.$container,{watchDocumentScroll:!1}),this.on("dataDMConversationResult dataDMSendSuccess",this.processConversationResult),this.on("dataDMDeleteSuccess",this.processUserUpdatesResult),this.on("uiOpenConversationView uiOpenNewConversationView",this.prepareConversationView),this.on("uiOpenConversationView uiOpenNewConversationView",this.initializeDMComposer),this.on("uiUpdateConversationState",this.updateConversationState),this.on("uiWantsConversationHistory",utils.throttle(this.requestNextPage,1e3)),this.on("uiFeedbackPanelOpened",this.hideComposeSection),this.on("uiFeedbackPanelClosed",this.showComposeSection),this.on("click",{newMessagesPillSelector:this.scrollToBottom}),this.on("mouseover",{emojiOnlyMessageSelector:this.removeAnimationClass}),this.on(document,"dataDMUserUpdates",this.processUserUpdatesResult)})}var StringUtils=require("app/utils/string"),defineComponent=require("core/component"),utils=require("core/utils"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),ConversationActions=require("app/ui/dm/conversation/conversation_actions"),ConversationHistory=require("app/ui/dm/conversation/conversation_history"),DMComposer=require("app/ui/compose/dm_composer"),DMInfo=require("app/data/dm/dm_info"),DMSendingStateIndicator=require("app/ui/dm/sending_state_indicator"),DeleteConversationUI=require("app/ui/dm/conversation/delete_conversation"),DeleteMessageUI=require("app/ui/dm/conversation/delete_message"),EmojiBar=require("app/ui/dm/conversation/emoji_bar"),FeedbackPanel=require("app/ui/b2c/feedback_panel"),MessageActions=require("app/ui/dm/conversation/message_actions"),PlayableMediaManager=require("app/ui/playable_media/playable_media_manager"),ReportConversationUI=require("app/ui/dm/conversation/report_conversation"),ReportMessageUI=require("app/ui/dm/conversation/report_message"),SensitiveMediaTweets=require("app/ui/media/sensitive_media_tweets"),SuspiciousMessage=require("app/ui/dm/conversation/suspicious_message"),TweetAttachmentUI=require("app/ui/dm/conversation/tweet_attachment"),UpdateConversationAvatarUI=require("app/ui/dm/conversation/update_conversation_avatar"),UpdateConversationNameUI=require("app/ui/dm/conversation/update_conversation_name"),withLastReadMarker=require("app/ui/dm/conversation/with_last_read_marker"),DMConversation=defineComponent(dmConversation,withNoTeardownChildComponents,withLastReadMarker);module.exports=DMConversation
});
define("app/ui/dm/view_participants/activity",["module","require","exports","core/component"],function(module, require, exports) {
function viewParticipants(){this.attributes({dialogContentSelector:".DMViewParticipants-content",doneButtonSelector:".DMViewParticipants-done",spinnerSelector:".DMViewParticipants-spinner"}),this.prepareViewParticipants=function(){this.select("dialogContentSelector").hide(),this.select("spinnerSelector").show()},this.updateViewParticipants=function(a,b){a&&a.preventDefault(),this.select("dialogContentSelector").html(b.html).show(),this.select("spinnerSelector").hide(),this.trigger("uiDMDialogOpenedViewParticipants")},this.after("initialize",function(){this.on("uiViewParticipants",this.prepareViewParticipants),this.on("dataConversationParticipantsResult",this.updateViewParticipants),this.on("click",{doneButtonSelector:"uiDMViewParticipantsDone"})})}var defineComponent=require("core/component");module.exports=defineComponent(viewParticipants)
});
define("app/ui/dm/conversation/manager",["module","require","exports","core/component","app/utils/with_no_teardown_child_components","app/ui/dm/add_participants/activity","app/ui/dm/conversation/activity","app/ui/dm/view_participants/activity"],function(module, require, exports) {
function conversationManager(){this.attributes({conversation:".DMConversationContainer",groupAvatars:!1,maxCharacters:1e4}),this.openConversation=function(a,b){var c=a.type=="uiRenderNewConversationView"?"uiOpenNewConversationView":"uiOpenConversationView";this.select("conversation").trigger(c,b)},this.after("initialize",function(){this.attachChild(AddParticipantsActivity,this.attr.conversation),this.attachChild(ViewParticipantsActivity,this.attr.conversation),this.attachChild(ConversationActivity,this.attr.conversation,{groupAvatars:this.attr.groupAvatars,maxCharacters:this.attr.maxCharacters}),this.on("uiRenderConversationView uiRenderNewConversationView",this.openConversation)})}var defineComponent=require("core/component"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),AddParticipantsActivity=require("app/ui/dm/add_participants/activity"),ConversationActivity=require("app/ui/dm/conversation/activity"),ViewParticipantsActivity=require("app/ui/dm/view_participants/activity");module.exports=defineComponent(conversationManager,withNoTeardownChildComponents)
});
define("app/data/dm/conversation",["module","require","exports","core/component","app/data/dm/utils","app/data/with_data"],function(module, require, exports) {
function conversation(){this.defaultAttrs({noShowError:!0}),this.conversation=function(a,b){var b=b||{};this.get({url:"/messages/with/conversation",data:{id:b.conversation_id,max_entry_id:b.max_entry_id},eventData:b,success:triggerFn(a.target,"dataDMConversationResult"),error:chain(triggerFn(a.target,"dataDMInvalidConversation",b),triggerFn(a.target,"dataDMError"))})},this.after("initialize",function(){this.on("uiNeedsDMConversation",this.conversation)})}var defineComponent=require("core/component"),utils=require("app/data/dm/utils"),withData=require("app/data/with_data"),triggerFn=utils.triggerFn,chain=utils.chain;module.exports=defineComponent(conversation,withData)
});
define("app/data/dm/with_dm_cursor",["module","require","exports"],function(module, require, exports) {
function withDmCursor(){this.storeDmCursor=function(a,b){b&&b.cursor&&(this.dmCursor=b.cursor,this.trigger("dataDMCursorUpdated",{cursor:this.dmCursor}))},this.storeDmCursorFromUpdates=function(a,b){b&&b.inbox_updates&&b.inbox_updates.cursor&&(this.dmCursor=b.inbox_updates.cursor,this.trigger("dataDMCursorUpdated",{cursor:this.dmCursor}))},this.after("initialize",function(){this.on(document,"dataDMCursor",this.storeDmCursor),this.on(document,"dataDMUserUpdates",this.storeDmCursorFromUpdates)})}module.exports=withDmCursor
});
define("app/data/dm/delete_conversation",["module","require","exports","core/component","app/data/with_data","app/data/dm/with_dm_cursor","app/data/dm/utils"],function(module, require, exports) {
function deleteConversation(){this.defaultAttrs({noShowError:!0}),this.deleteConversation=function(a,b){var b=b||{},c=chain(triggerFn(a.target,"dataConversationDeleted",{conversation_id:b.conversation_id}),triggerFn(a.target,"dataDMUserUpdates")),d=chain(triggerFn(a.target,"dataConversationDeleteFailed",{conversation_id:b.conversation_id}),triggerFn(a.target,"dataDMError"));this.destroy({url:"/messages/with/conversation",data:{id:b.conversation_id,cursor:this.dmCursor},eventData:b,success:c,error:d})},this.after("initialize",function(){this.on("uiDeleteConversation",this.deleteConversation)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),withDmCursor=require("app/data/dm/with_dm_cursor"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn,chain=utils.chain,DeleteConversation=defineComponent(deleteConversation,withData,withDmCursor);module.exports=DeleteConversation
});
define("app/data/dm/delete_message",["module","require","exports","core/component","app/data/dm/utils","app/data/with_data","app/data/dm/with_dm_cursor"],function(module, require, exports) {
function deleteMessage(){this.defaultAttrs({noShowError:!0}),this.deleteMessage=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/destroy",eventData:b,data:{id:b.id,conversation_id:b.conversation_id,cursor:this.dmCursor},success:triggerFn(a.target,["dataDMDeleteSuccess","dataDMUserUpdates"]),error:chain(triggerFn(a.target,"dataDMDeleteFailed",b),triggerFn(a.target,"dataDMError"))})},this.after("initialize",function(){this.on("uiDMDialogDeleteMessage",this.deleteMessage)})}var defineComponent=require("core/component"),utils=require("app/data/dm/utils"),withData=require("app/data/with_data"),withDmCursor=require("app/data/dm/with_dm_cursor"),triggerFn=utils.triggerFn,chain=utils.chain;module.exports=defineComponent(deleteMessage,withData,withDmCursor)
});
define("app/data/dm/report_conversation",["module","require","exports","core/component","app/data/with_data","app/data/dm/with_dm_cursor","app/data/dm/utils"],function(module, require, exports) {
function reportConversation(){this.defaultAttrs({noShowError:!0}),this.reportConversation=function(a,b){var b=b||{},c=chain(triggerFn(a.target,"dataDMUserUpdates"),triggerFn(a.target,"dataConversationReported",{conversation_id:b.conversation_id})),d=chain(triggerFn(a.target,"dataDMError"),triggerFn(a.target,"dataConversationReportFailed",{conversation_id:b.conversation_id}));this.post({url:"/i/direct_messages/report_conversation",data:{conversation_id:b.conversation_id,report_as:b.report_as,cursor:this.dmCursor},success:c,error:d})},this.after("initialize",function(){this.on("uiReportConversation",this.reportConversation)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),withDmCursor=require("app/data/dm/with_dm_cursor"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn,chain=utils.chain,ReportConversation=defineComponent(reportConversation,withData,withDmCursor);module.exports=ReportConversation
});
define("app/data/dm/report_message",["module","require","exports","core/component","app/data/dm/utils","app/data/with_data"],function(module, require, exports) {
function reportMessage(){this.defaultAttrs({noShowError:!0}),this.reportMessage=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/report",data:{id:b.id,conversation_id:b.conversation_id,report_as:b.report_as},eventData:b,success:triggerFn(a.target,["dataDMReportSuccess","dataDMConversationResult"]),error:chain(triggerFn(a.target,"dataDMReportFailed",b),triggerFn(a.target,"dataDMError"))})},this.after("initialize",function(){this.on("uiDMDialogReportDM",this.reportMessage)})}var defineComponent=require("core/component"),utils=require("app/data/dm/utils"),withData=require("app/data/with_data"),triggerFn=utils.triggerFn,chain=utils.chain;module.exports=defineComponent(reportMessage,withData)
});
define("app/utils/promise_queue",["module","require","exports"],function(module, require, exports) {
module.exports=function(){function d(){if(c!="running"&&b.length>0){var a=b.shift();c="running";var e=function(a){return c="idle",d(),a}.bind(this),f=a(),g=f.onCompletePromise;f.queuedPromise().then(e,e).then(g.resolve,g.reject)}}var b=[],c="idle";return{enqueue:function(a){var c=$.Deferred(),e=function(){return{queuedPromise:a,onCompletePromise:c}};return b.push(e),d(),c},numPending:function(){return b.length},numInProgress:function(){return c=="running"?1:0},length:function(){return this.numPending()+this.numInProgress()}}}
});
define("app/data/dm/send_message",["module","require","exports","core/component","core/utils","app/data/dm/utils","app/data/with_data","app/data/with_media_sru_finalize","app/utils/promise_queue"],function(module, require, exports) {
function sendMessage(){this.defaultAttrs({noShowError:!0}),this.sendImage=function(a,b){var c=b.media_data||{},d=function(a){return this.trigger("dataMediaSruComplete",c),utils.merge(b,{media_id:a})}.bind(this),e=triggerFn(a.target,"dataDMError",function(a){return this.trigger("dataMediaSruCancel",c),utils.merge(b,{message:a.message})}.bind(this));return c.uploadId?this.mediaSruFinalize(c).then(d,e):$.Deferred().resolve(b)},this.sendMessage=function(a,b){var c=function(c,d){d&&d.retry&&a.type!="dataDMDialogSendMessageRetry"?setTimeout(function(){this.trigger(c,"dataDMDialogSendMessageRetry",b)}.bind(this),d.delay):this.trigger(c,"dataDMSendSuccess",d)};return this.post({url:"/i/direct_messages/new",data:b,eventData:b,success:c.bind(this,a.target),error:chain(triggerFn(a.target,"dataDMSendFailed",b),triggerFn(a.target,"dataDMError"))})},this.getConversationQueue=function(a){if(!a)return;return this.conversationQueues[a]=this.conversationQueues[a]||promiseQueue(),this.conversationQueues[a]},this.updateInFlight=function(){var a=Object.keys(this.conversationQueues).reduce(function(a,b){return a[b]=this.conversationQueues[b].length(),a}.bind(this),{});this.trigger("dataDMMessagesInFlight",a)},this.enqueueMessage=function(a,b){this.getConversationQueue(a).enqueue(b).always(this.updateInFlight.bind(this)),this.updateInFlight()},this.handleSend=function(a,b){var c=function(){return this.sendImage(a,b).then(this.sendMessage.bind(this,a))}.bind(this),d=b.conversation_id;d?this.enqueueMessage(d,c):c()},this.after("initialize",function(){this.on("uiDMSendMessage dataDMDialogSendMessageRetry",this.handleSend),this.conversationQueues={},this.on("uiDMConversationNeedsInFlightState",this.updateInFlight)})}var defineComponent=require("core/component"),utils=require("core/utils"),dmUtils=require("app/data/dm/utils"),withData=require("app/data/with_data"),withMediaSruFinalize=require("app/data/with_media_sru_finalize"),promiseQueue=require("app/utils/promise_queue"),chain=dmUtils.chain,triggerFn=dmUtils.triggerFn;module.exports=defineComponent(sendMessage,withData,withMediaSruFinalize)
});
define("app/data/dm/suspicious_message_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function suspiciousContentScribe(){this.after("initialize",function(){this.scribeOnEvent("uiRevealSuspiciousDM",{component:"rtf_message",action:"open"}),this.scribeOnEvent("uiReportDMAsSpam",{component:"rtf_message",action:"report_as_spam"}),this.scribeOnEvent("uiReportDMAsSafe",{component:"rtf_message",action:"report_as_ok"})})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),SuspiciousContentScribe=defineComponent(suspiciousContentScribe,withScribe);module.exports=SuspiciousContentScribe
});
define("app/data/dm/toggle_notifications",["module","require","exports","core/component","app/data/with_data","app/data/dm/utils"],function(module, require, exports) {
function toggleNotifications(){this.defaultAttrs({noShowError:!0}),this.toggleNotifications=function(a,b){var b=b||{},c=chain(triggerFn(a.target,"dataDMConversationResult"),triggerFn(a.target,b.enable_notifications?"dataNotificationsEnabled":"dataNotificationsDisabled")),d=triggerFn(a.target,b.enable_notifications?"dataNotificationsEnableFailed":"dataNotificationsDisableFailed");this.post({url:"/i/direct_messages/notifications",data:{id:b.conversation_id,enable_notifications:b.enable_notifications},eventData:b,success:c,error:d})},this.after("initialize",function(){this.on("uiToggleNotifications",this.toggleNotifications)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn,chain=utils.chain,ToggleNotifications=defineComponent(toggleNotifications,withData);module.exports=ToggleNotifications
});
define("app/data/dm/tweet_attachment",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function tweetAttachmentScribe(){this.after("initialize",function(){this.scribeOnEvent("uiDMDialogSharedTweetClick",{element:"shared_tweet_dm",action:"click"})})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),TweetAttachmentScribe=defineComponent(tweetAttachmentScribe,withScribe);module.exports=TweetAttachmentScribe
});
define("app/data/dm/update_conversation_avatar",["module","require","exports","core/component","app/data/with_data","app/data/dm/utils"],function(module, require, exports) {
function updateAvatar(){this.defaultAttrs({noShowError:!0}),this.update=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/update_avatar",data:{conversation_id:b.conversation_id,media_id:b.media_id},success:triggerFn(a.target,"dataDMUpdateConversationAvatarSuccess"),error:triggerFn(a.target,"dataDMUpdateConversationAvatarFailed")})},this.remove=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/update_avatar",data:{conversation_id:b.conversation_id},success:triggerFn(a.target,"dataDMRemoveConversationAvatarSuccess"),error:triggerFn(a.target,"dataDMRemoveConversationAvatarFailed")})},this.after("initialize",function(){this.on("uiDMUpdateConversationAvatar",this.update),this.on("uiDMRemoveConversationAvatar",this.remove)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn;module.exports=defineComponent(updateAvatar,withData)
});
define("app/data/dm/update_conversation_name",["module","require","exports","core/component","app/data/with_data","app/data/dm/utils"],function(module, require, exports) {
function updateName(){this.defaultAttrs({noShowError:!0}),this.updateName=function(a,b){var b=b||{};this.post({url:"/i/direct_messages/update_name",data:{id:b.conversation_id,name:b.name},success:triggerFn(a.target,["dataDMConversationResult","dataUpdateConversationNameSuccess"]),error:triggerFn(a.target,"dataUpdateConversationNameFailure")})},this.after("initialize",function(){this.on("uiUpdateConversationName",this.updateName)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn;module.exports=defineComponent(updateName,withData)
});
define("app/ui/dm/inbox/notifications_permission_request",["module","require","exports","core/component","app/data/with_scribe","core/utils","app/utils/storage/core"],function(module, require, exports) {
function dmNotificationsPermissionRequest(){this.attributes({acceptSelector:".js-prompt-accept",dismissSelector:".js-prompt-later",daysToWaitOnDismiss:30}),this.shouldDisplayRequest=function(){var a="Notification"in window;if(!a)return!1;var b=Notification.permission=="default",c=this.storage.getItem("last_dismissed_timestamp")||0,d=this.now()-c>this.attr.daysToWaitOnDismiss*24*60*60*1e3;return b&&d},this.now=function(){return Date.now()},this.handleAccept=function(){this.trigger("uiRequestNativeNotificationPermission"),this.trigger("uiDismissDMNotice"),this.scribeAction("success")},this.handleDismiss=function(){this.storage.setItem("last_dismissed_timestamp",this.now()),this.trigger("uiDismissDMNotice"),this.scribeAction("dismiss")},this.scribeAction=function(a){this.scribe({component:"dm_conversation_list_dialog",element:"native_notifications_permission_request",action:a})},this.showNotice=function(){this.trigger("uiShowDMNotice")},this.after("initialize",function(){this.storage=new Storage("dm_notifications");if(!this.shouldDisplayRequest())return;this.on("click",{acceptSelector:this.handleAccept,dismissSelector:this.handleDismiss}),this.on(document,"uiSwiftLoaded",utils.once(this.showNotice).bind(this))})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),utils=require("core/utils"),Storage=require("app/utils/storage/core"),DMNotificationsPermissionRequest=defineComponent(dmNotificationsPermissionRequest,withScribe);module.exports=DMNotificationsPermissionRequest
});
define("app/ui/dm/inbox/activity",["module","require","exports","app/utils/string","core/component","core/utils","app/utils/with_no_teardown_child_components","app/ui/dm/inbox/notifications_permission_request"],function(module, require, exports) {
function dmInbox(){this.attributes({inboxSelector:".DMInbox-content",inboxItemSelector:".DMInboxItem",conversationListSelector:".DMInbox-conversations",eventData:{scribeContext:{component:"dm_conversation_list_dialog"}},markAllReadSelector:".mark-all-read",noMessagesSelector:".dm-no-messages",spinnerSelector:".DMInbox-spinner",loadNextPageRange:150,notifications:!1}),this.removeStaleInboxItems=function(a,b){var c=(b||[]).map(function(a){return this.generateInboxItemWithIdSelector(a)},this).join(", ");a.find(c).parent("li").remove()},this.sortInboxClone=function(a){var b=a.children().get();b.sort(function(a,b){var c=$(a).children().first().attr("data-sort-event-id"),d=$(b).children().first().attr("data-sort-event-id");return-1*StringUtils.compare(c,d)});var c=(b||[]).reduce(function(a,b){return a+b.outerHTML},"");a.html(c)},this.getDeletedConversationIDs=function(a){var b=(a||[]).filter(function(a){return a.type==="conversation_delete"}).map(function(a){return a.conversation_id});return b},this.applyUserUpdates=function(a,b){if(b.should_request_inbox)this.trigger("uiNeedsDMConversationList");else if(!b.is_empty){var c=b.inbox_updates,d=b.update_events,e=this.select("conversationListSelector").clone(),f=c&&c.updated_conversation_ids,g=this.getDeletedConversationIDs(d),h=(f||[]).concat(g);this.removeStaleInboxItems(e,h),e.prepend(c&&c.html),this.sortInboxClone(e),this.select("conversationListSelector").replaceWith(e),this.$node.data({markAllReadId:b.mark_all_read_id,maxEntryId:b.max_entry_id})}},this.applyInboxResult=function(a,b){var c=this.$node.data(),d=b.sourceEventData;if(!d||!d.max_entry_id)this.select("conversationListSelector").html(b.html||""),this.trigger("dataDMCursor",{cursor:b.cursor}),this.$node.removeData(),this.$node.data({markAllReadId:b.mark_all_read_id,minEntryId:b.min_entry_id,maxEntryId:b.max_entry_id,hasMore:b.has_more});else if(this.isNextPage(c.minEntryId,b.max_entry_id)){var e=this.select("conversationListSelector").clone();this.removeStaleInboxItems(e,b.threads),e.append(b.html),this.select("conversationListSelector").replaceWith(e),this.$node.data({minEntryId:b.min_entry_id,hasMore:b.has_more})}this.trigger("uiResetDMPoll")},this.isNextPage=function(a,b){return!a||!b?!1:StringUtils.compare(a,b)>=0},this.updateSpinner=function(){this.select("spinnerSelector").toggleClass("u-hidden",!this.$node.data("hasMore"))},this.handleInboxScroll=function(a,b){var c=$(a.currentTarget);c[0].scrollHeight-c.scrollTop()-this.attr.loadNextPageRange<=c.outerHeight()&&this.requestNextPageThrottled()},this.requestNextPage=function(){var a=this.$node.data().hasMore;(typeof a=="undefined"||a)&&this.trigger("uiNeedsDMConversationList",{max_entry_id:this.$node.data("minEntryId")})},this.requestNextPageThrottled=utils.throttle(this.requestNextPage,1e3),this.markAllMessages=function(){this.trigger("dataMarkDMsAsRead",{last_message_id:this.$node.data("markAllReadId")||-1}),this.trigger("uiDMDialogMarkMessage"),this.select("inboxItemSelector").removeClass("is-unread"),this.trigger("uiReadStateChanged",{msgCount:0})},this.generateInboxItemWithIdSelector=function(a){return this.attr.inboxItemSelector+'[data-thread-id="'+a+'"]'},this.markConversationRead=function(a,b){b.recipient_id&&this.$node.find(this.generateInboxItemWithIdSelector(b.recipient_id)+".is-unread").removeClass("is-unread")},this.markConversationUnread=function(a,b){b.sourceEventData&&b.sourceEventData.recipient_id&&this.$node.find(this.generateInboxItemWithIdSelector(b.sourceEventData.recipient_id)).addClass("is-unread")},this.inboxNeedsRefresh=function(a,b){this.$node.addClass("needs-refresh")},this.removeConversation=function(a,b){this.$node.find(this.generateInboxItemWithIdSelector(b.conversation_id)).parent("li").remove(),this.trigger("uiRenderConversationListView")},this.initiateKnownConversation=function(a,b){if(a){var c=$(a.target);if(this.isProfileLink(c))return;if(c.hasClass("DMInboxItem-media"))return}a&&a.preventDefault();var d=$(b.el);this.trigger("uiRenderConversationView",{conversation_id:d.attr("data-thread-id"),name:d.find(".fullname").html(),most_recent_event_id:d.attr("data-last-message-id")})},this.isProfileLink=function(a){return!!a.closest("a.js-user-profile-link").length},this.setEmptyState=function(a,b){switch(a.type){case"dataDMConversationEmptyState":this.$node.toggleClass("is-empty",!0),this.$node.data("hasMore",!1);break;case"dataDMConversationListResult":this.$node.toggleClass("is-empty",!1);break;case"dataDMUserUpdates":b&&b.conversations&&b.conversations.length&&this.$node.toggleClass("is-empty",!1)}},this.after("setEmptyState",this.updateSpinner),this.after("applyInboxResult",this.updateSpinner),this.after("initialize",function(){this.attr.notifications&&this.attachChild(DMNotificationsPermissionRequest,this.$node.find(".DMNotificationsPermissionRequest")),this.on(document,"dataDMConversationListResult",this.applyInboxResult),this.on(document,"dataDMUserUpdates",this.applyUserUpdates),this.on(document,"uiDMInboxWantsRefreshed",this.inboxNeedsRefresh),this.on(this.select("inboxSelector"),"scroll",this.handleInboxScroll),this.on(document,"uiDeleteConversation uiReportConversation",this.removeConversation),this.on(document,"dataConversationDeleteFailed dataConversationReportFailed","uiNeedsDMConversationList"),this.on(document,"dataDMConversationEmptyState dataDMConversationListResult dataDMUserUpdates",this.setEmptyState),this.on(document,"dataMarkDMsAsRead",this.markConversationRead),this.on(document,"dataDMReadError",this.markConversationUnread),this.on(document,"uiCloseDMConversation","uiRenderConversationListView"),this.on("click",{inboxItemSelector:this.initiateKnownConversation,markAllReadSelector:this.markAllMessages})})}var StringUtils=require("app/utils/string"),defineComponent=require("core/component"),utils=require("core/utils"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),DMNotificationsPermissionRequest=require("app/ui/dm/inbox/notifications_permission_request"),DMInbox=defineComponent(dmInbox,withNoTeardownChildComponents);module.exports=DMInbox
});
define("app/data/dm/inbox",["module","require","exports","core/component","app/data/dm/utils","app/data/with_data"],function(module, require, exports) {
function inbox(){this.defaultAttrs({noShowError:!0}),this.inbox=function(a,b){var b=b||{};this.get({url:"/messages",data:{min_entry_id:b.min_entry_id,max_entry_id:b.max_entry_id},eventData:b,success:triggerFn(a.target,function(a){return a.is_empty_state?"dataDMConversationEmptyState":"dataDMConversationListResult"}),error:triggerFn(a.target,"dataDMError")})},this.after("initialize",function(){this.on("uiNeedsDMConversationList",this.inbox)})}var defineComponent=require("core/component"),utils=require("app/data/dm/utils"),withData=require("app/data/with_data"),triggerFn=utils.triggerFn;module.exports=defineComponent(inbox,withData)
});
define("app/data/dm/view_participants",["module","require","exports","core/component","app/data/with_data","app/data/dm/utils"],function(module, require, exports) {
function viewParticipants(){this.defaultAttrs({noShowError:!0}),this.viewParticipants=function(a,b){var b=b||{};this.get({url:"/i/direct_messages/participants",data:{conversation_id:b.conversation_id},eventData:b,success:triggerFn(a.target,"dataConversationParticipantsResult"),error:triggerFn(a.target,"dataDMError")})},this.after("initialize",function(){this.on("uiNeedsConversationParticipants",this.viewParticipants)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("app/data/dm/utils"),triggerFn=utils.triggerFn;module.exports=defineComponent(viewParticipants,withData)
});
define("app/ui/dm/dm_notice",["module","require","exports","core/component"],function(module, require, exports) {
function dmNotice(){this.attributes({notice:".DMNotice",dismiss:".DMNotice-dismiss, .DMNotice-cancel",needsExplicitDismiss:".DMNotice--explicitDismiss"}),this.findNotice=function(a){return this.select("notice").filter(a)},this.show=function(a,b){this.dismissAll(!0);var c=b&&b.notice?this.findNotice(b.notice):$(a.target).closest(this.attr.notice);c.slideDown()},this.dismiss=function(a,b){var c=b&&b.notice?this.findNotice(b.notice):$(a.target).closest(this.attr.notice);c.slideUp()},this.dismissAll=function(a){var b=this.select("notice").not(this.attr.needsExplicitDismiss);a?b.slideUp():b.hide()},this.after("initialize",function(){this.on("uiShowDMNotice",this.show),this.on("uiDismissDMNotice",this.dismiss),this.on(document,"uiDismissAllDMNotices",this.dismissAll.bind(this,!1)),this.on("click",{dismiss:"uiDismissDMNotice"})})}var defineComponent=require("core/component");module.exports=defineComponent(dmNotice)
});
define("app/ui/dm/notifications",["module","require","exports","core/component","app/utils/string","app/utils/storage/core"],function(module, require, exports) {
function notifications(){this.attributes({conversationContentSelector:".DMConversation-content",notificationDisplayDuration:7e3,mostRecentNotifiedMessageKey:"most_recent_notified_message_id",rollingTagPrefix:"twitterDM",maxSimultaneousNotifications:2,notificationType:"direct_message"}),this.processNotifications=function(a,b){if(!b||!b.notifications||!b.notifications.length)return;var c=this.$conversationContainer.attr("data-thread-id"),d=this.isPageFocused()&&this.$conversationContainer.is(":visible"),e=this.storage.getItem(this.attr.mostRecentNotifiedMessageKey)||0,f=b.notifications.length?b.notifications[b.notifications.length-1].id:0;this.storage.setItem(this.attr.mostRecentNotifiedMessageKey,StringUtils.max(f,e));var g=b.notifications.filter(function(a){var b=StringUtils.compare(e,a.id)>=0,f=d&&a.conversation_id==c;return!b&&!f});g.forEach(function(a){this.trigger("uiDisplayNativeNotification",{title:a.title,body:a.body,icon:a.icon,tag:this.getRollingTag(),type:this.attr.notificationType,click:{eventName:"uiDMNotificationClicked",eventData:{conversation_id:a.conversation_id}},displayDuration:this.attr.notificationDisplayDuration})},this)},this.dmNotificationClicked=function(a,b){window.focus(),this.trigger("uiNeedsDMDialog",{conversation_id:b.conversation_id})},this.isPageFocused=function(){return document.hasFocus()},this.getRollingTag=function(){return this.lastTagNumber=this.lastTagNumber||0,this.lastTagNumber=this.lastTagNumber>=this.attr.maxSimultaneousNotifications?1:this.lastTagNumber+1,this.attr.rollingTagPrefix+this.lastTagNumber},this.after("initialize",function(){this.$conversationContainer=this.select("conversationContentSelector"),this.on(document,"dataDMUserUpdates",this.processNotifications),this.on(document,"uiDMNotificationClicked",this.dmNotificationClicked),this.storage=new Storage("dm_notifications")})}var defineComponent=require("core/component"),StringUtils=require("app/utils/string"),Storage=require("app/utils/storage/core"),DMNotifications=defineComponent(notifications);module.exports=DMNotifications
});
define("app/ui/dm/conversation/dm_playable_media_manager",["module","require","exports","core/component","app/utils/viewport_helpers","core/utils"],function(module, require, exports) {
function dmPlayableMediaManager(){this.attributes({scrollContainerSelector:".DMConversation-scrollContainer",videoSelector:".DirectMessage-media video, .dm-media-gallery-overlay video",autoplayVideoSelector:"video[data-autoplay=true]",mediaContainerSelector:".Media",autoPlayThreshold:150}),this.rAF=window.requestAnimationFrame.bind(window),this.getBoundingClientRect=function(a){return a.getBoundingClientRect()},this.handleScroll=function(){this.rAF(function(){var a=this.getBoundingClientRect(this.$scrollContainer[0]),b=this.$autoplayVideos.filter(function(b,c){var d=this.getBoundingClientRect(c);return viewportHelpers.isPartiallyContainedInViewport(undefined,undefined,-1*this.attr.autoPlayThreshold,this.attr.autoPlayThreshold,.01,a,d)}.bind(this));this.$currentlyPlaying.not(b).each(function(){this.pause()}),b.not(this.$currentlyPlaying).each(function(){this.play()}),this.$currentlyPlaying=b}.bind(this))},this.updateMediaList=function(){this.$videos=this.select("videoSelector"),this.$videos.off("pause play playing ended").on("pause play playing ended",this.updatePlayingState.bind(this)),this.$autoplayVideos=this.$videos.filter(this.attr.autoplayVideoSelector)},this.togglePlayback=function(a){var b=$(a.target).closest(this.attr.mediaContainerSelector).find("video")[0];b&&(b.paused?b.play():b.pause())},this.updatePlayingState=function(a){$(a.target).closest(this.attr.mediaContainerSelector).toggleClass("is-playing",!a.target.paused)},this.handleViewChange=function(a,b){(a.type=="uiDMDialogClosed"||b.activity!="conversation")&&this.$videos.each(function(){this.pause()})},this.after("initialize",function(){this.$videos=$(),this.$autoplayVideos=$(),this.$scrollContainer=this.select("scrollContainerSelector"),this.$currentlyPlaying=$(),this.on("uiDMConversationUpdated uiSwiftLoaded",this.updateMediaList),this.select("scrollContainerSelector").scroll(utils.throttle(this.handleScroll.bind(this),500)),this.on("click",{videoSelector:this.togglePlayback}),this.on("uiDMDialogClosed uiDMActivityOpened",this.handleViewChange)})}var defineComponent=require("core/component"),viewportHelpers=require("app/utils/viewport_helpers"),utils=require("core/utils");module.exports=defineComponent(dmPlayableMediaManager)
});
define("app/ui/dm/dm_popover",["module","require","exports","core/component","app/utils/dropdown_close_events"],function(module, require, exports) {
function popover(){this.attributes({popover:".DMPopover",popoverButton:".DMPopover-button",enabledPopoverButton:".DMPopover-button:not(:disabled)",popoverContent:".DMPopover-content",openClass:"is-open",openSelector:".is-open",focusOnOpen:".js-focus-on-open"}),this.getClosestOpenPopover=function(a){return this.getClosestPopover(a).filter(this.attr.openSelector)},this.getClosestPopover=function(a){return $(a).closest(this.attr.popover)},this.toggle=function(a){var b=this.getClosestPopover(a.target);b.hasClass(this.attr.openClass)?this.close(b):(this.closeAll(),b.addClass(this.attr.openClass).find(this.attr.focusOnOpen).focus())},this.closeAll=function(a){this.select("popover").removeClass(this.attr.openClass)},this.close=function(a){a.removeClass(this.attr.openClass).find(this.attr.enabledPopoverButton).focus()},this.disable=function(a){this.getClosestPopover(a.target).find(this.attr.popoverButton).attr("disabled","disabled")},this.enable=function(a){this.getClosestPopover(a.target).find(this.attr.popoverButton).removeAttr("disabled")},this.handleEscape=function(a){var b=this.getClosestOpenPopover(a.target);b.length&&(a.stopImmediatePropagation(),this.close(b))},this.handleBlur=function(a){var b=this.getClosestOpenPopover(a.target);b.length||this.closeAll()},this.after("initialize",function(){this.on(dropdownCloseEvents.GLOBAL_FORCE_CLOSE_EVENTS,this.closeAll),this.on(dropdownCloseEvents.GLOBAL_REQUEST_CLOSE_EVENTS,this.closeAll),this.on("uiShortcutEsc",this.handleEscape),this.on("click",this.handleBlur),this.on("click",{enabledPopoverButton:this.toggle}),this.on("uiDisableDMPopover",this.disable),this.on("uiEnableDMPopover",this.enable)})}var defineComponent=require("core/component"),dropdownCloseEvents=require("app/utils/dropdown_close_events");module.exports=defineComponent(popover)
});
define("app/ui/dm/direct_message_compose_with_intent",["module","require","exports","core/component"],function(module, require, exports) {
function directMessageComposeWithIntent(){this.composeNewDMWithTweet=function(a,b){this.trigger("uiOpenNewDM"),this.trigger("uiComposeWithTweet",b)},this.composeNewDMWithOptions=function(a,b){b.tweetId&&this.trigger("uiComposeWithTweet",{id:b.tweetId}),this.trigger("uiNeedsDMDialog",{id:b.recipientId,default_composer_text:b.defaultComposerText,retain_tweet_attachment:b.tweetId!==undefined}),b.messageMeCardData&&this.trigger("uiAddMessageMeCardData",b.messageMeCardData)},this.after("initialize",function(){this.on("uiComposeNewDMWithTweet",this.composeNewDMWithTweet),this.on(window,"uiComposeNewDMWithOptions",this.composeNewDMWithOptions)})}var defineComponent=require("core/component"),DirectMessageComposeWithIntent=defineComponent(directMessageComposeWithIntent);module.exports=DirectMessageComposeWithIntent
});
define("app/ui/with_item_actions",["module","require","exports","core/compose","app/data/user_info","core/utils","app/data/with_card_metadata","app/ui/with_interaction_data"],function(module, require, exports) {
function withItemActions(){compose.mixin(this,[withInteractionData,withCardMetadata]),this.defaultAttrs({pageContainer:"#doc",nestedContainerSelector:".js-stream-item .in-reply-to, .js-expansion-container",showWithScreenNameSelector:".show-popup-with-screen-name, .twitter-atreply",showWithIdSelector:".show-popup-with-id, .js-user-profile-link",searchtagSelector:".twitter-hashtag, .twitter-cashtag",cashtagSelector:".twitter-cashtag",geoPivotSelector:".js-geo-pivot-link",itemLinkSelector:".twitter-timeline-link,.js-adaptive-photo",mediaForwardSelector:".js-adaptive-photo",cardExternalLinkSelector:".js-card2-external-link",viewMoreItemSelector:".view-more-container",inSnapbackExperiment:!1,snapbackSkipProfilePopup:!1,dismissedTweetSelector:".js-dismissed-tweet",dismissedTweetClass:"js-dismissed-tweet",dismissibleContainerSelector:".dismissible-container"}),this.showProfilePopupWithScreenName=function(a,b){var c=$(a.target).closest(this.attr.showWithScreenNameSelector).text();c[0]==="@"&&(c=c.substring(1));var d={screenName:c},e=this.getCardDataFromTweet($(a.target));b=utils.merge(this.interactionData(a,d),e),this.showProfile(a,b)},this.showProfilePopupWithId=function(a,b){var c=this.getCardDataFromTweet($(a.target));b=utils.merge(this.interactionDataWithCard(a),c),this.showProfile(a,b)},this.showProfile=function(a,b){a.type=="mouseover"?(a.preventDefault(),a.stopImmediatePropagation(),this.trigger(a.target,"uiShowProfileHover",b)):(b.user_id=$(a.target).closest(".twitter-atreply").attr("data-mentioned-user-id")||b.userId,this.trigger(a.target,"uiShowProfileNewWindow",b))},this.hideHover=function(a,b){var c=this.getCardDataFromTweet($(a.target));b=utils.merge(this.interactionData(a),c),this.trigger("uiHideProfileHover",b)},this.searchtagClick=function(a,b){var c=$(a.target),d=c.closest(this.attr.searchtagSelector),e=d.is(this.attr.cashtagSelector)?"uiCashtagClick":"uiHashtagClick",f={query:d.text()};this.trigger(e,this.interactionData(a,f))},this.isCardUrl=function(a){var b=/^(https?:\/\/)?cards(-staging|-beta)?.twitter.com/;return b.test(a)},this.geoPivotClick=function(a,b){var c={placeId:$(b.el).data("place-id")};this.trigger("uiGeoPivotClick",this.interactionData(a,c))},this.itemLinkClick=function(a,b){function c(a){return!!a.parents(".permalink").length}function d(a,b){return a.is(b)?a.closest(".tweet").data("permalink-path"):""}var e=$(a.target).closest(this.attr.itemLinkSelector),f,g=d(e,this.attr.mediaForwardSelector),h={url:e.attr("data-expanded-url")||e.attr("href")||g,tcoUrl:e.attr("href")||g,text:e.text()};h=utils.merge(h,this.getCardDataFromTweet($(a.target))),(h.cardName==="promotion"||h.cardType==="promotions")&&this.isCardUrl(h.url)&&!c($(a.target))&&(a.preventDefault(),f=e.parents(".stream-item"),this.trigger(f,"uiPromotionCardUrlClick")),this.trigger("uiItemLinkClick",this.interactionData(a,h))},this.cardLinkClick=function(a,b,c){var d=$(b.target).closest(this.attr.cardLinkSelector),e=this.getCardDataFromTweet($(b.target));this.trigger(a,this.interactionDataWithCard(b,e))},this.getUserIdFromElement=function(a){return a.length?a.data("user-id"):null},this.itemSelected=function(a,b){var c=this.getCardDataFromTweet($(a.target));b.organicExpansion&&this.trigger("uiItemSelected",utils.merge(this.interactionData(a),c))},this.itemDeselected=function(a,b){var c=this.getCardDataFromTweet($(a.target));this.trigger("uiItemDeselected",utils.merge(this.interactionData(a),c))},this.isNested=function(){return this.$node.closest(this.attr.nestedContainerSelector).length},this.modifierKey=function(a){if(a.shiftKey||a.ctrlKey||a.metaKey||a.which>1)return!0},this.removeTweetsFromUser=function(a,b){var c=this.$node.find("[data-user-id="+b.userId+"].js-stream-tweet"),d=this;$.each(c,function(a,b){var c=$(b).attr("data-tweet-id");d.removeEngagementsOnTweet(c)}),c.parent().remove(),this.trigger("uiRemovedSomeTweets")},this.navigateToViewMoreURL=function(a){var b=$(a.target),c;b.find(this.attr.viewMoreItemSelector).length&&(c=b.find(".view-more-link"),this.trigger(c,"uiNavigate",{href:c.attr("href")}))},this.removeEngagementsOnTweet=function(a){var b=this.$node.find("[data-item-id="+a+"]");b.remove()},this.dismissTweet=function(a,b){var c=$(a.target),d=c.closest(this.attr.tweetContainerSelector),e=d.closest(this.attr.dismissibleContainerSelector);d.addClass(this.attr.dismissedTweetClass).fadeOut(200,function(){d.remove(),e&&e.remove()}),d.prev().removeClass("before-expanded"),d.next().removeClass("after-expanded"),this.trigger("uiTweetDismissed",b)},this.removeAllDismissedTweets=function(){this.select("dismissedTweetSelector").stop().remove()},this.after("initialize",function(){this.isNested()||(this.on("click",{showWithScreenNameSelector:this.showProfilePopupWithScreenName,showWithIdSelector:this.showProfilePopupWithId,searchtagSelector:this.searchtagClick,geoPivotSelector:this.geoPivotClick,itemLinkSelector:this.itemLinkClick,cardExternalLinkSelector:this.cardLinkClick.bind(this,"uiCardExternalLinkClick")}),this.on("uiItemLinkClick",{itemLinkSelector:this.itemLinkClick}),this.on("mouseover",{showWithScreenNameSelector:this.showProfilePopupWithScreenName,showWithIdSelector:this.showProfilePopupWithId}),this.on("mouseout",{showWithScreenNameSelector:this.hideHover,showWithIdSelector:this.hideHover}),this.on("uiHasExpandedTweet uiHasClickedTweet",this.itemSelected),this.on("uiHasCollapsedTweet",this.itemDeselected),this.on("uiRemoveTweetsFromUser",this.removeTweetsFromUser),this.on("uiShortcutEnter",this.navigateToViewMoreURL),this.on("uiDismissTweet",this.dismissTweet),this.on(document,"uiBeforePageChanged",this.removeAllDismissedTweets))})}var compose=require("core/compose"),userInfo=require("app/data/user_info"),utils=require("core/utils"),withCardMetadata=require("app/data/with_card_metadata"),withInteractionData=require("app/ui/with_interaction_data");module.exports=withItemActions
});
define("app/ui/with_timestamp_updating",["module","require","exports","core/i18n","lib/twitter_cldr"],function(module, require, exports) {
function withTimestampUpdating(){this.defaultAttrs({timestampSelector:".tweet-timestamp",relativeTimestampSelector:".js-relative-timestamp",relativeTimestampClass:"js-relative-timestamp"}),this.currentTimeSecs=function(){return new Date/1e3},this.updateAccessibleShortTimestamp=function(a,b){var c=this.currentTimeSecs(),d=Math.floor(c-b);if(d<3)return;var e=TimespanFormatter.format(b-c),f=a.closest(this.attr.timestampSelector),g=f.find(".u-hiddenVisually");g.length||(f.find(this.attr.relativeTimestampSelector).removeAttr("data-aria-label-part").attr("aria-hidden","true"),g=$(HIDDEN_TIMESTAMP),f.append(g)),g.text(e)},this.updateTimestamps=function(){this.select("relativeTimestampSelector").each(function(a,b){var c=$(b),d=c.data("time"),e=this.formatTimestamp(d);e.relative||c.removeClass(this.attr.relativeTimestampClass),c.text(e.text),this.updateAccessibleShortTimestamp(c,d)}.bind(this))},this.formatTimestamp=function(a){var b=this.currentTimeSecs(),c=Math.floor(b-a),d;return c<3?d=NOW_TEXT:(d=TimespanFormatter.format(c,{direction:"none",type:this.timespanType}),this.localizedDigits&&(d=d.replace(/\d/g,function(a){return this.localizedDigits.charAt(a.charCodeAt(0)-"0".charCodeAt(0))}.bind(this)))),{text:d,relative:!0}},this.after("initialize",function(){var a=$("html").attr("lang");this.timespanType=a==="en"?"abbreviated":"short",this.localizedDigits={ar:"٠١٢٣٤٥٦٧٨٩",fa:"۰۱۲۳۴۵۶۷۸۹"}[a],this.on(document,"uiWantsToRefreshTimestamps uiPageChanged",this.updateTimestamps)})}var _=require("core/i18n"),TwitterCldr=require("lib/twitter_cldr"),TimespanFormatter=new TwitterCldr.TimespanFormatter,NOW_TEXT=_('jetzt'),HIDDEN_TIMESTAMP='<span class="u-hiddenVisually" data-aria-label-part="last"></span>';module.exports=withTimestampUpdating
});
define("app/ui/compose/with_tweetbox_initialization",["module","require","exports","core/utils"],function(module, require, exports) {
var utils=require("core/utils");module.exports=function(){this.defaultAttrs({tweetFormSelector:".tweet-form"}),this.initTweetbox=function(a){var b=this.select("tweetFormSelector"),c=this.attr.preexpandTweetbox||!1;this.trigger(b,"uiInitTweetbox",utils.merge({draftTweetId:this.attr.draftTweetId,condensable:!c,preexpandTweetbox:c,suppressSuccessMessage:this.attr.suppressSuccessMessage},{eventData:this.attr.eventData},a))}}
});
define("app/ui/user_actions_dropdown",["module","require","exports","core/component","app/ui/with_dropdownmenu"],function(module, require, exports) {
function userActionsDropdown(){this.defaultAttrs({dropdownThresholdSelector:".dropdown-threshold"}),this.scrollIntoView=function(){var a=this.$node.closest(this.attr.dropdownThresholdSelector),b,c;a.length&&(b=this.$node.find(this.attr.dropDownSelector),c=b.offset().top+b.outerHeight()-(a.offset().top+a.height()),c>0&&a.animate({scrollTop:a.scrollTop()+c}))},this.after("initialize",function(){this.on("uiDropdownOpened",this.scrollIntoView),this.on(document,"uiHasInjectedNewTimeline uiHasInjectedOldTimelineItems uiHasInjectedRangeTimelineItems",this.applyARIAAttrs)})}var defineComponent=require("core/component"),withDropdownMenu=require("app/ui/with_dropdownmenu"),UserActionsDropdown=defineComponent(withDropdownMenu,userActionsDropdown);module.exports=UserActionsDropdown
});
define("app/ui/with_tweet_actions_helper",["module","require","exports","core/utils"],function(module, require, exports) {
function withTweetActionsHelper(){this.preventDefault=function(a,b,c){a.preventDefault()},this.composeHandler=function(){var a=arguments,b={};return function(c,d){for(var e=0,f=a.length;e<f;e++)if(a[e].call(this,c,d,b)==0)break}},this.getTweetForEvent=function(a,b){var c=$(a.target),d;return c.is(this.attr.tweetItemSelector)&&(d=c),d||(d=c[b](this.attr.tweetItemSelector)),d},this.getClosestTweet=function(a,b,c){var d=this.getTweetForEvent(a,"closest"),e=!!d.length;return e&&(c.$tweet=d),e},this.getDataForTweet=function(a){return{id:a.attr("data-tweet-id"),screenName:a.attr("data-screen-name"),isTweetProof:a.attr("data-is-tweet-proof")==="true",viewerFollowsAuthor:a.attr("data-you-follow")==="true",viewerBlocksAuthor:a.attr("data-you-block")==="true",featureContext:a.attr("data-feature-context"),mediaType:this.getMediaType(a),photoCount:a.find(".animated-gif, .js-adaptive-photo, .AdaptiveStreamGridImage").length}},this.getMediaType=function(a){var b="";if(a.find(".js-adaptive-photo"))b="image";else if(a.attr("data-card2-type")=="player")b="video";else if(a.attr("data-has-cards")||a.hasClass("has-content"))b="media";return b},this.mkTweetDataCollector=function(){var a=arguments;return function(b){var c={};for(var d=0,e=a.length;d<e;d++)c=utils.merge(c,a[d].call(this,b));return c=utils.merge(c,this.getDataForTweet(b)),c}.bind(this)},this.mkTweetDataCollectorForAction=function(){var a=this.mkTweetDataCollector.apply(this,arguments);return function(b,c,d){return d.tweetData=a(d.$tweet),!0}.bind(this)},this.triggerTweetAction=function(a){return function(b,c,d){var e=typeof a=="function"?a.call(this,b,c,d):a;this.trigger(d.$tweet,e,d.tweetData)}}}var utils=require("core/utils");module.exports=withTweetActionsHelper
});
define("app/ui/with_user_actions",["module","require","exports","core/compose","core/i18n","core/utils","app/ui/with_interaction_data","app/ui/user_actions_dropdown","app/utils/string","app/utils/user_dom_data","app/ui/with_tweet_actions_helper"],function(module, require, exports) {
function withUserActions(){compose.mixin(this,[withInteractionData,withTweetActionsHelper]),this.defaultAttrs({followButtonSelector:".follow-button, .follow-link, .WebToast-followButton, .ProfileTweet-follow-button",topicLinkSelector:".user-topic-link",userInfoSelector:".user-actions",dropdownSelector:".user-actions .dropdown",dropdownItemSelector:".user-actions .dropdown.open .dropdown-menu li",blockOrReportButtonSelector:".block-or-report-text",tweetItemSelector:".tweet",reportButtonSelector:".blocked-report-text",unmuteButtonSelector:".unmute-button",muteButtonSelector:".mute-button",followStates:["not-following","following","blocked","pending"],userActionClassesToEvents:{"mention-text":["uiMentionAction","mentionUser"],"dm-text":["uiDmAction","dmUser"],"list-text":["uiListAction"],"block-text":["uiNeedsBlockDialog","attachUserData"],"report-text":["uiNeedsReportDialog","attachUserData"],"unblock-text":["uiUnblockAction"],"hide-suggestion-text":["uiHideSuggestionAction"],"retweet-on-text":["uiRetweetOnAction"],"retweet-off-text":["uiRetweetOffAction"],"device-notifications-on-text":["uiDeviceNotificationsOnAction","deviceNotificationsOn"],"device-notifications-off-text":["uiDeviceNotificationsOffAction"],"embed-profile":["uiEmbedProfileAction","redirectToEmbedProfile"]}}),this.getClassNameFromList=function(a,b){var c=b.filter(function(b){return a.hasClass(b)});return c[0]},this.getUserActionEventNameAndMethod=function(a){var b=this.getClassNameFromList(a.closest("li"),Object.keys(this.attr.userActionClassesToEvents));return this.attr.userActionClassesToEvents[b]},this.getFollowState=function(a){return this.getClassNameFromList(a,this.attr.followStates)},this.getInfoElementFromEvent=function(a){var b=$(a.target);return b.closest(this.attr.userInfoSelector)},this.findInfoElementForUser=function(a){var b=this.attr.userInfoSelector+"[data-user-id="+StringUtils.parseBigInt(a)+"]";return this.$node.find(b)},this.getEventName=function(a){var b={"not-following":"uiFollowAction",following:"uiUnfollowAction",blocked:"uiUnblockAction",pending:"uiCancelFollowRequestAction"};return b[a]},this.addCancelHoverStyleClass=function(a){a.addClass("cancel-hover-style"),a.one("mouseleave",function(){a.removeClass("cancel-hover-style")});var b=a.closest(this.attr.userInfoSelector);b.addClass("show-more-actions-button"),a.one("mouseleave",function(){b.removeClass("show-more-actions-button")})},this.handleFollowButtonClick=function(a){a.stopPropagation(),this.trigger($(a.target),"uiCloseDropdowns");var b=this.getInfoElementFromEvent(a),c=$(a.target).closest(this.attr.followButtonSelector),d=this.getTweetForEvent(a,"closest");this.addCancelHoverStyleClass(c);var e=this.getFollowState(b),f=!c.closest(".stream").length;e=="not-following"&&b.data("protected")&&this.trigger("uiShowMessage",{message:_('Eine Followeranfrage wurde an @{{screen_name}} gesendet und die Best\xe4tigung ist ausstehend.',{screen_name:b.data("screen-name")})});var g=this.getEventName(e),h={originalFollowState:e,shouldRefreshTimeline:f,mediaType:this.getMediaType(d)};this.trigger(g,this.interactionDataWithCard(a,h))},this.handleTopicLinkClick=function(a){var b=this.interactionData(a);this.trigger("uiUserTopicClickAction",b)},this.handleLoggedOutFollowButtonClick=function(a){a.stopPropagation(),this.trigger($(a.target),"uiCloseDropdowns"),this.trigger("uiOpenSignupDialog",{signUpOnly:!0,screenName:this.getInfoElementFromEvent(a).data("screen-name")}),this.trigger("uiLoggedOutFollowAttempt",this.interactionData(a))},this.handleBlockOrReportClick=function(a){var b=this.getInfoElementFromEvent(a),c=b.data("screen-name"),d=b.data("user-id").toString(),e=this.getFollowState(b),f=utils.merge(this.interactionData(a),{screenName:c,userId:d,target:"user",viewerFollowsAuthor:e==="following",viewerBlocksAuthor:e==="blocked"});this.trigger("uiNeedsBlockOrReportDialog",f)},this.handleUserAction=function(a){var b=$(a.target),c=this.getUserActionEventNameAndMethod(b);if(!c)return;a.stopPropagation();var d=this.getInfoElementFromEvent(a),e=c[0],f=c[1],g=this.getFollowState(d),h={originalFollowState:g};f&&(h=this[f](d,e,h)),h&&this.trigger(e,this.interactionData(a,h)),this.trigger(b,"uiCloseDropdowns")},this.deviceNotificationsOn=function(a,b,c){return this.attr.deviceEnabled?c:(this.attr.smsDeviceVerified||this.attr.hasPushDevice?this.trigger("uiOpenConfirmDialog",{titleText:_('Mobile Mitteilungen f\xfcr Tweets aktivieren'),bodyText:_('Bevor Du mobile Mitteilungen f\xfcr Tweets von @{{screenName}} empfangen kannst, musst Du die Einstellung f\xfcr Tweet-Mitteilungen aktivieren.',{screenName:a.data("screen-name")}),cancelText:_('Schlie\xdfen'),submitText:_('Mitteilungen \xfcber Tweets aktivieren'),action:this.attr.hasPushDevice?"ShowPushTweetsNotifications":"ShowMobileNotifications",top:this.attr.top}):this.trigger("uiOpenConfirmDialog",{titleText:_('Handy-Mitteilungen einrichten'),bodyText:_('Bevor Du mobile Mitteilungen f\xfcr die Tweets von @{{screenName}} empfangen kannst, musst Du Dein Telefon einrichten.',{screenName:a.data("screen-name")}),cancelText:_('Abbrechen'),submitText:_('Telefon einrichten'),action:"ShowMobileNotifications",top:this.attr.top}),!1)},this.redirectToMobileNotifications=function(){window.location="/settings/devices"},this.redirectToPushNotificationsHelp=function(){window.location="//support.twitter.com/articles/20169887"},this.redirectToEmbedProfile=function(a,b,c){return this.trigger("uiNavigate",{href:"/settings/widgets/new/user?screen_name="+a.data("screen-name")}),!0},this.mentionUser=function(a,b,c){this.trigger("uiOpenTweetDialog",{screenName:a.data("screen-name"),title:_('Tweet an {{name}}',{name:a.data("name")})})},this.attachUserData=function(a,b,c){var d=utils.merge(this.interactionData(c),{screenName:userDomDataUtil.getScreenName(a),userId:userDomDataUtil.getId(a),target:"user"});return d},this.dmUser=function(a,b,c){return this.trigger("uiNeedsDMDialog",{id:userDomDataUtil.getId(a),screen_name:userDomDataUtil.getScreenName(a),name:userDomDataUtil.getName(a),oto_only:!0}),c},this.hideSuggestion=function(a,b,c){return utils.merge(c,{feedbackToken:a.data("feedback-token")})},this.followStateChange=function(a,b){this.updateFollowState(b.userId,b.newState),b.fromShortcut&&(b.newState==="not-following"?this.trigger("uiShowMessage",{message:_('Du hast {{username}} entblockt',{username:b.username})}):b.newState==="blocked"&&this.trigger("uiUpdateAfterBlock",{userId:b.userId}))},this.updateFollowState=function(a,b){var c=this.findInfoElementForUser(a),d=this.getFollowState(c);d&&c.removeClass(d),c.addClass(b),b==="blocked"?this.trigger("uiUpdateAfterBlock",{userId:a}):b==="not-following"&&this.trigger("uiShowProfileTweets")},this.follow=function(a,b){var c=this.findInfoElementForUser(b.userId),d=c.data("protected")?"pending":"following";this.updateFollowState(b.userId,d),c.addClass("including")},this.unfollow=function(a,b){var c=this.findInfoElementForUser(b.userId);this.updateFollowState(b.userId,"not-following"),c.removeClass("including notifying")},this.cancel=function(a,b){var c=this.findInfoElementForUser(b.userId);this.updateFollowState(b.userId,"not-following")},this.block=function(a,b){var c=this.findInfoElementForUser(b.userId);this.trigger("jsClearReinjectionCookiesForUser",{userId:b.userId}),this.updateFollowState(b.userId,"blocked"),c.removeClass("including notifying")},this.unblock=function(a,b){this.updateFollowState(b.userId,"not-following")},this.retweetsOn=function(a,b){var c=this.findInfoElementForUser(b.userId);c.addClass("including")},this.retweetsOff=function(a,b){var c=this.findInfoElementForUser(b.userId);c.removeClass("including")},this.notificationsOn=function(a,b){var c=this.findInfoElementForUser(b.userId),d=c.find(this.attr.deviceFollowCheckboxSelector);c.addClass("notifying"),d.prop("checked",!0)},this.notificationsOff=function(a,b){var c=this.findInfoElementForUser(b.userId),d=c.find(this.attr.deviceFollowCheckboxSelector);c.removeClass("notifying"),d.prop("checked",!1)},this.blockUserConfirmed=function(a,b){a.stopImmediatePropagation(),this.trigger("uiBlockAction",b.sourceEventData)},this.preventFocus=function(a,b){a.preventDefault()},this.handleMuteButtonClick=function(a){return function(b,c){c=this.interactionData(b),c.scribeContext={element:"muted_button"},this.trigger(b.target,a,c)}},this.updateMuteButtonState=function(a,b){var c=this.$node.find(this.attr.userInfoSelector+"[data-user-id="+b.userId+"]"),d=c.find(this.attr.unmuteButtonSelector),e=c.find(this.attr.muteButtonSelector),f=d.is(":focus"),g=e.is(":focus");c[b.modOp](b.modClass),e.removeClass("first-load"),f?e.focus():g&&d.focus()},this.after("initialize",function(){UserActionsDropdown.attachTo(this.$node);if(!this.attr.loggedIn){this.on("click",{followButtonSelector:this.handleLoggedOutFollowButtonClick});return}this.on("click",{followButtonSelector:this.handleFollowButtonClick,topicLinkSelector:this.handleTopicLinkClick,dropdownItemSelector:this.handleUserAction,unmuteButtonSelector:this.handleMuteButtonClick("uiDidUnmuteUser"),muteButtonSelector:this.handleMuteButtonClick("uiDidMuteUser"),blockOrReportButtonSelector:this.handleBlockOrReportClick,reportButtonSelector:this.handleBlockOrReportClick}),this.on("mousedown",{unmuteButtonSelector:this.preventFocus,muteButtonSelector:this.preventFocus}),this.on(document,"uiFollowStateChange dataFollowStateChange dataBulkFollowStateChange",this.followStateChange),this.on(document,"uiFollowAction",this.follow),this.on(document,"uiUnfollowAction",this.unfollow),this.on(document,"uiCancelFollowRequestAction",this.cancel),this.on(document,"uiUnblockAction",this.unblock),this.on(document,"uiRetweetOnAction dataRetweetOnAction",this.retweetsOn),this.on(document,"uiRetweetOffAction dataRetweetOffAction",this.retweetsOff),this.on(document,"uiDeviceNotificationsOnAction dataDeviceNotificationsOnAction",this.notificationsOn),this.on(document,"uiDeviceNotificationsOffAction dataDeviceNotificationsOffAction",this.notificationsOff),this.on(document,"uiShowMobileNotificationsConfirm",this.redirectToMobileNotifications),this.on(document,"uiShowPushTweetsNotificationsConfirm",this.redirectToPushNotificationsHelp),this.on(document,"uiUpdateMuteButtonState",this.updateMuteButtonState),this.on(document,"uiBlockAction",this.block),this.on(document,"uiDidBlockUser",this.blockUserConfirmed),this.on(document,"uiDidTriggerBlockingAction",this.block)})}var compose=require("core/compose"),_=require("core/i18n"),utils=require("core/utils"),withInteractionData=require("app/ui/with_interaction_data"),UserActionsDropdown=require("app/ui/user_actions_dropdown"),StringUtils=require("app/utils/string"),userDomDataUtil=require("app/utils/user_dom_data"),withTweetActionsHelper=require("app/ui/with_tweet_actions_helper");module.exports=withUserActions
});
define("app/ui/dm/direct_message_dialog",["module","require","exports","core/component","app/utils/dm/dm_utils","app/ui/with_dialog","app/ui/with_item_actions","app/ui/with_timestamp_updating","app/ui/compose/with_tweetbox_initialization","app/ui/with_user_actions"],function(module, require, exports) {
function directMessageDialog(){this.defaultAttrs({itemType:"user",dialogSelector:"#dm_dialog",noReposition:!0,disableKeyboardShortcuts:!0,openActivity:".DMActivity--open",openActivityClass:"DMActivity--open",addParticipants:".DMAddParticipants",compose:".DMCompose",conversation:".DMConversation",emptyState:".DMEmptyState",inbox:".DMInbox",viewParticipants:".DMViewParticipants",linksForInbox:".DMActivity-back",linksForCompose:".dm-new-button",toFieldSelector:".dm-to-input",errorBar:".DMErrorBar",errorText:".DMErrorBar-text",mediaPreviewSelector:".DMInboxItem-media, .dm-attached-media"}),this.openDialog=function(a,b){b&&b.fromInitData&&this.on("uiDialogClosed",function(){!this.isDialogNavigation&&!this.isOverlayNavigation&&this.trigger("uiNavigate",{href:"/"}),this.isOverlayNavigation=!1}),this.trigger("uiNeedsDMConversationList"),b&&b.id?this.trigger("uiRenderConversationView",{conversation_id:dmUtils.generateConversationId(this.attr.userId,b.id),name:b.name,is_oto:!0,default_composer_text:b.default_composer_text,retain_tweet_attachment:b.retain_tweet_attachment}):b&&b.conversation_id?this.trigger("uiRenderConversationView",b):b&&b.default_composer_text?this.trigger("uiOpenNewDM",{default_composer_text:b.default_composer_text}):this.renderInbox(),this.open()},this.closeDialog=function(){this.isDialogNavigation=!1,this.close()},this.renderInbox=function(a,b){a&&a.preventDefault(),this.renderView("inbox");var c=this.select("inbox");this.trigger("uiReadStateChanged",{msgCount:0});if(c.hasClass("needs-refresh")){c.removeClass("needs-refresh"),this.trigger("uiNeedsDMConversationList");return}this.trigger("uiDMDialogOpenedConversationList")},this.handleProfileLinkClick=function(){this.isDialogNavigation||(this.isDialogNavigation=this.$dialog.is(":visible"),this.closeImmediately())},this.renderConversationView=function(a,b){this.renderView("conversation"),this.trigger("uiDMDialogOpenedConversation",{recipient:b.conversation_id||b.screen_names})},this.renderCompose=function(a,b){a&&a.preventDefault(),this.renderView("compose"),this.trigger("uiDMDialogOpenedNewConversation"),this.isOpen()||(this.trigger("uiNeedsDMConversationList"),this.open())},this.renderAddParticipants=function(a,b){this.renderView("addParticipants")},this.renderViewParticipants=function(a,b){a&&a.preventDefault(),this.trigger(a.target,"uiNeedsConversationParticipants",{conversation_id:b.conversation_id}),this.renderView("viewParticipants")},this.renderView=function(a){this.trigger("uiDismissAllDMNotices"),this.select("openActivity").removeClass(this.attr.openActivityClass),this.select(a).addClass(this.attr.openActivityClass),this.trigger("uiDMActivityOpened",{activity:a}),this.trigger(this.$dialog,"uiDialogContentChanged"),this.setScribeComponent(a)},this.setScribeComponent=function(a){this.attr.eventData||(this.attr.eventData={});var b;switch(a){case"compose":b="dm_new_conversation_dialog";break;case"conversation":b="dm_existing_conversation_dialog";break;case"inbox":b="dm_conversation_list_dialog";break;case"addParticipants":b="dm_add_participants_dialog";break;case"viewParticipants":b="dm_view_participants_dialog"}b&&(this.attr.eventData.scribeContext={component:b})},this.showError=function(a,b){this.select("errorText").html(b.message||b.error),this.select("errorBar").show(),this.trigger(this.select("toFieldSelector"),"uiTypeaheadIgnoreNextFocus"),this.trigger(this.$dialog,"uiDialogContentChanged")},this.previewMedia=function(a,b){a.preventDefault();var c=$(a.target);this.trigger("uiDMDialogMediaPreview",{imgUrl:c.attr("data-full-img"),dmId:c.closest(".dm").attr("data-message-id")||c.closest(".DMInboxItem").attr("data-last-message-id")})},this.hideDMDialog=function(){this.$dialogContainer.hide(),this.openState=!1},this.showDMDialog=function(a,b){this.$dialogContainer.show(),this.openState=!0},this.restoreDialog=function(){this.isDialogNavigation&&(this.isDialogNavigation=!1,this.open())},this.dismissErrors=function(){this.trigger("uiHideMessage"),this.select("errorBar").trigger("uiDismissDMNotice")},this.setOverlayNavigation=function(){this.isOverlayNavigation=!0},this.after("initialize",function(){this.$dialogContainer=this.select("dialogSelector"),this.on(document,"uiShowProfilePopup",this.handleProfileLinkClick),this.on(document,"uiCloseProfilePopup",this.restoreDialog),this.on(document,"uiNeedsDMDialog",this.openDialog),this.on(document,"uiCloseDMDialog",this.closeDialog),this.on(document,"uiOpenNewDM",this.renderCompose),this.on(document,"uiAddParticipants",this.renderAddParticipants),this.on(document,"uiViewParticipants",this.renderViewParticipants),this.on(document,"uiNavigate","uiCloseDMDialog"),this.on(document,"uiOverlayNavigate",this.setOverlayNavigation),this.on("uiRenderConversationListView",this.renderInbox),this.on("uiRenderConversationView uiRenderNewConversationView",this.renderConversationView),this.on("uiDMViewParticipantsDone uiDMAddParticipantsDone",this.renderView.bind(this,"conversation")),this.on(document,"dataDMSendSuccess dataDMDeleteSuccess","dataDMSuccess"),this.on(document,"dataDMError",this.showError),this.on(document,"uiDMDialogMediaPreview",this.hideDMDialog),this.on(document,"uiDMDialogMediaPreviewClosed",this.showDMDialog),this.on("uiDialogClosed uiDMHideError",this.dismissErrors),this.on("uiDialogClosed","uiDMDialogClosed"),this.on("click",{linksForInbox:this.renderInbox,linksForCompose:"uiOpenNewDM",mediaPreviewSelector:this.previewMedia})})}var defineComponent=require("core/component"),dmUtils=require("app/utils/dm/dm_utils"),withDialog=require("app/ui/with_dialog"),withItemActions=require("app/ui/with_item_actions"),withTimestampUpdating=require("app/ui/with_timestamp_updating"),withTweetboxInitialization=require("app/ui/compose/with_tweetbox_initialization"),withUserActions=require("app/ui/with_user_actions"),DirectMessageDialog=defineComponent(directMessageDialog,withDialog,withTimestampUpdating,withItemActions,withTweetboxInitialization,withUserActions),conversationCache={};module.exports=DirectMessageDialog
});
define("app/ui/dm/direct_message_link_handler",["module","require","exports","core/component","app/utils/user_dom_data"],function(module, require, exports) {
function directMessageLinkHandler(){this.defaultAttrs({dmLinkSelector:".js-dm-dialog, .dm-button, .global-dm-nav"}),this.openDialog=function(a,b){a.preventDefault();var c=$(b.el);b={id:userDomDataUtil.getId(c),screen_name:userDomDataUtil.getScreenName(c),name:userDomDataUtil.getName(c),oto_only:!0},this.trigger("uiNeedsDMDialog",b)},this.after("initialize",function(){this.on(document,"click",{dmLinkSelector:this.openDialog})})}var defineComponent=require("core/component"),userDomDataUtil=require("app/utils/user_dom_data");module.exports=defineComponent(directMessageLinkHandler)
});
define("app/utils/image/image_resizer",["module","require","exports"],function(module, require, exports) {
var imageResizer=function(){var a=300,b=520,c=50;return{galleryWidth:function(a,b){var d=$(window).width()-2*c,e=Math.min(d,a.width());return Math.max(b.width(),e)},resetMinSize:function(c){this.galW=b,this.galH=a,c.width(this.galW),c.css("min-height",this.galH)},resizeMedia:function(a,b,d,e,f){var g=b.find(e).add(b.find(".modal-header")).map(function(){return $(this).outerHeight()}).get().reduce(function(a,b){return a+b}),h=$(window).height()-2*c,i=$(window).width()-2*c,j=this.galH,k=this.galW,l=h-g,m=i,n=a.height(),o=a.width(),p=o/n;d&&(o+=130,n+=100),n>l&&(o=Math.ceil(o*(l/n)),n=l,a.width(o).height(n)),o>m&&(o=m,n=Math.ceil(o/p),a.width(o).height(n));var q=b.find(".GalleryNav").hasClass("enabled");if(!q||o>this.galW)this.galW=o,b.width(this.galW);n+g>this.galH?(this.galH=n+g,b.css("min-height",this.galH),a.css("margin-top",0)):f?b.css("min-height",0):(a.css("margin-top",(this.galH-g-n)/2),a.css("margin-bottom",(this.galH-g-n)/2))}}}();module.exports=imageResizer
});
define("app/ui/dm/direct_message_media_preview",["module","require","exports","core/component","app/ui/with_dialog","app/ui/with_scrollbar_width","app/utils/image/image_resizer"],function(module, require, exports) {
function directMessageMediaPreview(){this.defaultAttrs({dmImagePreviewSelector:".dm-media-preview",dmPreviewSelector:".dm-media"}),this.loadImage=function(a,b){var c=$('<img class="dm-media-image"/>'),d=this.select("dmImagePreviewSelector");d.empty(),c.on("load",function(a){d.empty().append(c),c.attr({"data-height":c[0].height,"data-width":c[0].width}),imageResizer.resizeMedia(c,this.select("dmPreviewSelector")),this.position();var e=parseFloat(c.css("margin-top"));e&&c.css("margin-bottom",e),this.trigger("uiDMMediaLoaded",{url:c.attr("src"),id:b})}.bind(this)),c.on("error",function(a){this.trigger("uiDMMediaFailed",{url:c.attr("src"),id:b})}.bind(this)),c.attr("src",a)},this.openDialog=function(a,b){this.calculateScrollbarWidth(),imageResizer.resetMinSize(this.select("dmPreviewSelector")),this.loadImage(b.imgUrl,b.dmId),this.open()},this.renderConversation=function(a,b){this.trigger("uiDMDialogMediaPreviewClosed")},this.after("initialize",function(){this.on(document,"uiDMDialogMediaPreview",this.openDialog),this.on("uiDialogCloseRequested",this.renderConversation)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withScrollbarWidth=require("app/ui/with_scrollbar_width"),imageResizer=require("app/utils/image/image_resizer");module.exports=defineComponent(directMessageMediaPreview,withDialog,withScrollbarWidth)
});
define("app/data/dm/direct_messages_scribe",["module","require","exports","core/component","app/utils/media_file_types","app/data/with_scribe","app/utils/scribe_item_types"],function(module, require, exports) {
function directMessagesScribe(){this.scribeSendDM=function(a,b){var c=b.conversation_id?"dm_existing_conversation_dialog":"dm_new_conversation_dialog",d=this.buildScribeData(b);this.scribe({component:c,action:"send_dm"},b,d),b.tweet_id&&this.scribe({component:c,action:"send_tweet_dm"},{conversation_id:b.conversation_id||b.recipient_ids,status_id:b.tweet_id},d);if(b.media_data&&b.media_data.fileType==fileTypes.ANIMATED_GIF){var e=!!b.media_data.foundMediaInfo;this.scribe({component:c,element:e?"remote":"local",action:"send_gif_dm"})}},this.buildScribeData=function(a){var b={};if(a.message_me_scribe_data){if(a.message_me_scribe_data.userId){var c={item_type:scribeItemTypes.user,id:a.message_me_scribe_data.userId};b.items=[c]}a.message_me_scribe_data.cardName&&(b.context=a.message_me_scribe_data.cardName),a.message_me_scribe_data.cardUri&&(b.message=a.message_me_scribe_data.cardUri)}return b},this.after("initialize",function(){this.scribeOnEvent("uiComposeNewDMWithTweet","share_via_dm"),this.scribeOnEvent("uiDMDialogOpenedNewConversation","open"),this.scribeOnEvent("uiDMDialogOpenedConversation","open"),this.scribeOnEvent("uiDMDialogOpenedConversationList","open"),this.scribeOnEvent("uiDMDialogDeleteMessage",{component:"dm_existing_conversation_dialog",action:"delete_dm"}),this.scribeOnEvent("uiDMDialogMarkSpam",{component:"dm_existing_conversation_dialog",action:"report_as_spam"}),this.scribeOnEvent("uiDMDialogMarkMessage",{element:"mark_all_as_read",action:"click"}),this.scribeOnEvent("uiDMMediaLoaded","media_preview"),this.scribeOnEvent("uiDMMediaFailed","media_preview"),this.on("uiDMSendMessage",this.scribeSendDM)})}var defineComponent=require("core/component"),fileTypes=require("app/utils/media_file_types"),withScribe=require("app/data/with_scribe"),scribeItemTypes=require("app/utils/scribe_item_types"),DirectMessagesScribe=defineComponent(directMessagesScribe,withScribe);module.exports=DirectMessagesScribe
});
define("app/data/dm/mark_as_read",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function markAsRead(){this.defaultAttrs({noShowError:!0}),this.markDMsAsRead=function(a,b){var b=b||{};b.retry=b.retry||b.retry===undefined;var c=$.noop,d=$.noop;b.from_notification?c=triggerFn(a.target,function(a){return"msgCount"in a?"uiReadStateChanged":null}):(c=function(b){b.text!="success"?d.call(this,b):this.trigger(a.target,"dataDMReadSuccess",b)},d=function(c){b.retry?(b.retry=!1,this.trigger(a.target,"dataMarkDMsAsRead",b)):this.trigger(a.target,"dataDMReadError",c)}),this.post({url:"/i/messages/mark_read",data:{last_message_id:b.last_message_id,recipient_id:b.recipient_id,recipient_name:b.recipient_name,get_count:b.from_notification},eventData:b,success:c.bind(this),error:d.bind(this)})},this.after("initialize",function(){this.on("dataMarkDMsAsRead",this.markDMsAsRead)})}var defineComponent=require("core/component"),withData=require("app/data/with_data");module.exports=defineComponent(markAsRead,withData)
});
define("app/data/dm/open_dm_dialog",["module","require","exports","core/component"],function(module, require, exports) {
function openDMDialog(){this.attributes({open:!1,text:"",conversation:{id:null},compose:{id:null,screenName:null,name:null,avatar:null}}),this.openDMDialog=function(a,b){this.attr.open&&((this.attr.conversation||{}).id?this.openConversation():this.openCompose())},this.openConversation=function(){var a=this.attr.conversation||{};this.trigger("uiNeedsDMDialog",{conversation_id:a.id,default_composer_text:this.attr.text,fromInitData:!0})},this.openCompose=function(){var a=this.attr.compose||{};this.trigger("uiNeedsDMDialog",{id:a.id,screen_name:a.screenName,name:a.name,profile_image_url_https:a.avatar,default_composer_text:this.attr.text,fromInitData:!0})},this.after("initialize",function(){this.on("uiSwiftLoaded uiPopStateNavigate",this.openDMDialog)})}var defineComponent=require("core/component");module.exports=defineComponent(openDMDialog)
});
define("app/data/dm/unread_count",["module","require","exports","core/component"],function(module, require, exports) {
function unreadCount(){var a=0;this.triggerUnreadCount=function(b,c){var c=c||{};a=c.msgCount,a>0?this.trigger(b.target,"dataUserHasUnreadDMsWithCount",{msgCount:a}):this.trigger(b.target,"dataUserHasNoUnreadDMsWithCount")},this.dispatchUnreadNotification=function(a,b){var c=b&&b.d||{};c.status==="ok"&&c.response!=null&&this.triggerUnreadCount(a,{msgCount:c.response})},this.checkForEnvelope=function(b,c){c&&c.section=="profile"&&this.triggerUnreadCount(b,{msgCount:a})},this.after("initialize",function(){this.on("uiReadStateChanged",this.triggerUnreadCount),this.on("dataNotificationsReceived",this.dispatchUnreadNotification),this.on("uiPageChanged",this.checkForEnvelope)})}var defineComponent=require("core/component");module.exports=defineComponent(unreadCount)
});
define("app/utils/storage/indexed_db",["module","require","exports","app/utils/promises"],function(module, require, exports) {
function IndexedDBClient(){var a=Array.prototype.slice.call(arguments);if(!(this instanceof IndexedDBClient))return IndexedDBClient.open.apply(null,a);var b=a[0];this.database=b,this.name=b.name,this.version=b.version,this.stores=getObjectStoreNames(b),b.onversionchange=function(){b.close(),window.location.reload(!0)}}function getObjectStoreNames(a){var b=[],c=a.objectStoreNames;for(var d=0;d<c.length;d++)b.push(c[d]);return b}var Promise=require("app/utils/promises"),Deferred=$.Deferred,IndexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,KeyRange=window.IDBKeyRange||window.webkitIDBKeyRange||window.msIDBKeyRange,Transaction={readwrite:(window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction||{}).READ_WRITE||"readwrite",readonly:(window.IDBTransaction||window.webkitIDBTransaction||window.msIDBTransaction||{}).READ_ONLY||"readonly"};module.exports=IndexedDBClient,IndexedDBClient.KeyRange=KeyRange,IndexedDBClient.deleteDatabase=function(a){return Promise.rescue(function(){var b=Deferred(),c=IndexedDB.deleteDatabase(a);return c.onsuccess=c.onerror=b.resolve,b.promise()})},IndexedDBClient.isSupported=function(){return!!IndexedDB},IndexedDBClient.open=function(a,b,c,d){var e=Promise.log(Deferred(),{title:'IndexedDB "'+a+'" version '+b,enabled:window.DEBUG&&window.DEBUG.enabled});if(!IndexedDBClient.isSupported())return e.reject("not supported");try{var f=b?IndexedDB.open(a,b):IndexedDB.open(a),g;f.onupgradeneeded=function(b){var e=b.target.result,f=Promise.log(Deferred(),{title:'IndexedDB "'+a+'" migration from version '+b.oldVersion+" to "+b.newVersion,enabled:window.DEBUG&&window.DEBUG.enabled});d||getObjectStoreNames(e).forEach(function(a){e.deleteObjectStore(a)});var g=getObjectStoreNames(e),h=(c||[]).map(function(a){return Promise.rescue(function(){var b=a.name,c=a.keyPath,d=a.indexes||[];if(g.indexOf(b)<0){var f=e.createObjectStore(b,{keyPath:c});return d.forEach(function(a){f.createIndex(a.name,a.keyPath,a)}),f}})});Promise.collect(h).then(f.resolve,f.reject).promise()},f.onsuccess=function(a){(g||Deferred().resolve()).then(function(){var b=new IndexedDBClient(a.target.result);return e.resolveWith(b,[b])}).fail(e.reject)},f.onblocked=function(a){e.reject("open blocked",a.target.error)},f.onerror=function(a){e.reject("open error",a.target.error)}}catch(h){e.reject("open exception",h)}return e.promise()},IndexedDBClient.prototype.add=function(a){return this.insert("add",a)},IndexedDBClient.prototype.clear=function(){var a=arguments.length?Array.prototype.slice.call(arguments):this.stores,b=a.map(function(a){return this.transaction(a,Transaction.readwrite,function(b){b.objectStore(a).clear()})},this);return Promise.collect(b,this).promise()},IndexedDBClient.prototype.close=function(){return Promise.rescue(function(){this.database.close()},this)},IndexedDBClient.prototype.destroy=function(a,b){return this.transaction(a,Transaction.readwrite,function(c){c.objectStore(a)["delete"](b)})},IndexedDBClient.prototype.get=function(a,b){return this.transaction(a,Transaction.readonly,function(c){return c.objectStore(a).get(b)}).then(function(a){return a.target.result})},IndexedDBClient.prototype.getAll=function(){var a=Array.prototype.slice.call(arguments).filter(function(a){return a!=null}),b=a.length,c=a[0],d=typeof a[1]=="string"?a[1]:null,e=typeof a[b-1]!="string"?a[b-1]:null;return Promise.rescue(function(){var a=Deferred(),b=this.database.transaction(c,Transaction.readonly),f=d?b.objectStore(c).index(d):b.objectStore(c),g=[],h=f.openCursor(e);return h.onerror=function(){a.rejectWith(this,arguments)}.bind(this),h.onsuccess=function(b){var c=b.target.result;c?(g.push(c.value),c["continue"]()):a.resolveWith(this,[g])}.bind(this),a.promise()},this)},IndexedDBClient.prototype.getByPrefix=function(){var a=Array.prototype.slice.call(arguments).filter(function(a){return a!=null}),b=a[0],c=a.length==3?a[1]:null,d=a[a.length-1];return this.getAll(b,c,KeyRange.bound(d,d+"￿",!1,!1))},IndexedDBClient.prototype.put=function(a){return this.insert("put",a)},IndexedDBClient.prototype.insert=function(a,b){var c=Object.keys(b),d=c.map(function(c){return this.transaction(c,Transaction.readwrite,function(d){var e=d.objectStore(c);b[c].forEach(function(b){e[a](b)})})},this);return Promise.collect(d,this).promise()},IndexedDBClient.prototype.transaction=function(a,b,c){return Promise.rescue(function(){var d=Deferred(),e=this.database.transaction(a,b),f=c(e);return f?(f.onsuccess=function(){d.resolveWith(this,arguments)}.bind(this),f.onerror=function(){d.rejectWith(this,arguments)}.bind(this)):(e.oncomplete=function(){d.resolveWith(this,arguments)}.bind(this),e.onerror=function(){d.rejectWith(this,arguments)}.bind(this)),d.promise()},this)}
});
define("app/data/dm/dm_cursor_storage",["module","require","exports","core/component","app/utils/storage/indexed_db"],function(module, require, exports) {
function dmCursorStorage(){this.storeDMCursor=function(a,b){b&&b.cursor&&this.db.then(function(a){a.put({cursors:[{name:"dm",cursor:b.cursor}]})})},this.openIndexedDB=IndexedDB.open,this.after("initialize",function(){this.db=this.openIndexedDB("notification_cursors",1,[{name:"cursors",keyPath:"name"}]),this.on("dataDMCursorUpdated",this.storeDMCursor)})}var defineComponent=require("core/component"),IndexedDB=require("app/utils/storage/indexed_db");module.exports=defineComponent(dmCursorStorage)
});
define("app/data/b2c/feedback_client",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function feedbackClient(){this.dismiss=function(a,b){this.post({url:["/i/feedback/dismiss/",b.feedbackId,".json"].join(""),success:"dataB2CFeedbackDismissed",error:"dataB2CFeedbackDismissedFailed"}),this.trigger("uiDMHideError")},this.after("initialize",function(){this.on(document,"uiB2CFeedbackDismiss",this.dismiss)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),FeedbackClient=defineComponent(feedbackClient,withData);module.exports=FeedbackClient
});
define("app/data/b2c/feedback_scribe_constants",["module","require","exports"],function(module, require, exports) {
var feedbackNpsCardName="2586390716:feedback_nps",feedbackCsatCardName="2586390716:feedback_csat",feedbackNpsScribeComponentName="nps_feedback_survey",feedbackCsatScribeComponentName="csat_feedback_survey",feedbackScribeConstants={feedbackNpsCardName:feedbackNpsCardName,feedbackCsatCardName:feedbackCsatCardName,feedbackNpsScribeComponentName:feedbackNpsScribeComponentName,feedbackCsatScribeComponentName:feedbackCsatScribeComponentName};module.exports=feedbackScribeConstants
});
define("app/data/b2c/feedback_scribe",["module","require","exports","core/component","app/data/with_scribe","app/data/with_card_metadata","app/utils/scribe_item_types","app/data/b2c/feedback_scribe_constants"],function(module, require, exports) {
function feedbackScribe(){this.getFeedbackItem=function(a){return{id:a,item_type:itemTypes.feedbackRequest}},this.scribeFeedbackDismiss=function(a,b){b&&this.scribe({component:this.getFeedbackComponent[b.cardName],element:b.currentView,action:"dismiss"},{items:[this.getFeedbackItem(b.feedbackId)]})},this.after("initialize",function(){this.getFeedbackComponent={},this.getFeedbackComponent[FeedbackScribeConstants.feedbackNpsCardName]=FeedbackScribeConstants.feedbackNpsScribeComponentName,this.getFeedbackComponent[FeedbackScribeConstants.feedbackCsatCardName]=FeedbackScribeConstants.feedbackCsatScribeComponentName,this.on(document,"uiB2CFeedbackDismiss",this.scribeFeedbackDismiss)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),withCardMetadata=require("app/data/with_card_metadata"),itemTypes=require("app/utils/scribe_item_types"),FeedbackScribeConstants=require("app/data/b2c/feedback_scribe_constants");module.exports=defineComponent(feedbackScribe,withScribe,withCardMetadata)
});
define("app/boot/dm/direct_messages",["module","require","exports","app/data/dm/add_participants","app/ui/dm/compose/activity","app/ui/dm/conversation/manager","app/data/dm/conversation","app/data/dm/delete_conversation","app/data/dm/delete_message","app/data/dm/report_conversation","app/data/dm/report_message","app/data/dm/send_message","app/data/dm/suspicious_message_scribe","app/data/dm/toggle_notifications","app/data/dm/tweet_attachment","app/data/dm/update_conversation_avatar","app/data/dm/update_conversation_name","app/ui/dm/inbox/activity","app/data/dm/inbox","app/data/dm/view_participants","app/data/dm/dm_info","app/ui/dm/dm_notice","app/ui/dm/notifications","app/ui/dm/conversation/dm_playable_media_manager","app/ui/dm/dm_popover","app/ui/dm/direct_message_compose_with_intent","app/ui/dm/direct_message_dialog","app/ui/dm/direct_message_link_handler","app/ui/dm/direct_message_media_preview","app/data/dm/direct_messages_scribe","app/data/dm/mark_as_read","app/data/dm/open_dm_dialog","app/data/dm/unread_count","app/data/dm/dm_cursor_storage","app/data/b2c/feedback_client","app/data/b2c/feedback_scribe"],function(module, require, exports) {
function initialize(a){var b="#dm_dialog";DirectMessageScribe.attachTo(document,a),DirectMessageComposeWithIntent.attachTo(document),DirectMessageDialog.attachTo(b,a,{timestampSelector:".time"}),DirectMessageLinkHandler.attachTo(document,a),DirectMessageMediaPreview.attachTo(".dm-media-container"),UnreadCountData.attachTo(document),MarkAsReadData.attachTo(document),DMCursorStorage.attachTo(document),AddParticipantsData.attachTo(document),ConversationData.attachTo(document),InboxData.attachTo(document),ViewParticipantsData.attachTo(document),InboxActivity.attachTo(".DMInbox",{notifications:DMInfo.get("notifications")}),ComposeActivity.attachTo(".DMCompose",{maxParticipants:DMInfo.get("participant_max")||a.dm_participant_max||50,currentUserId:a.userId}),ConversationManager.attachTo(b),DMInfo.get("notifications")&&DMNotifications.attachTo(document,{conversationSelector:".DMConversation-content"}),DeleteConversationData.attachTo(document),ReportConversationData.attachTo(document),ToggleNotificationsData.attachTo(document),UpdateConversationAvatarData.attachTo(document),UpdateConversationNameData.attachTo(document),DeleteMessageData.attachTo(document),ReportMessageData.attachTo(document),SuspiciousMessageScribe.attachTo(document),TweetAttachmentData.attachTo(document),SendMessageData.attachTo(document),DMNotice.attachTo(document),DMPopover.attachTo(document),DMPlayableMediaManager.attachTo(document);var c=a.dm_options||{};OpenDMDialog.attachTo(document,{open:c.show_dm_dialog,text:c.default_composer_text,conversation:{id:c.conversation_id},compose:{id:c.recipient_id,screenName:c.recipient,name:c.recipient_name,avatar:c.recipient_avatar}}),FeedbackClient.attachTo(document),FeedbackScribe.attachTo(document)}var AddParticipantsData=require("app/data/dm/add_participants"),ComposeActivity=require("app/ui/dm/compose/activity"),ConversationManager=require("app/ui/dm/conversation/manager"),ConversationData=require("app/data/dm/conversation"),DeleteConversationData=require("app/data/dm/delete_conversation"),DeleteMessageData=require("app/data/dm/delete_message"),ReportConversationData=require("app/data/dm/report_conversation"),ReportMessageData=require("app/data/dm/report_message"),SendMessageData=require("app/data/dm/send_message"),SuspiciousMessageScribe=require("app/data/dm/suspicious_message_scribe"),ToggleNotificationsData=require("app/data/dm/toggle_notifications"),TweetAttachmentData=require("app/data/dm/tweet_attachment"),UpdateConversationAvatarData=require("app/data/dm/update_conversation_avatar"),UpdateConversationNameData=require("app/data/dm/update_conversation_name"),InboxActivity=require("app/ui/dm/inbox/activity"),InboxData=require("app/data/dm/inbox"),ViewParticipantsData=require("app/data/dm/view_participants"),DMInfo=require("app/data/dm/dm_info"),DMNotice=require("app/ui/dm/dm_notice"),DMNotifications=require("app/ui/dm/notifications"),DMPlayableMediaManager=require("app/ui/dm/conversation/dm_playable_media_manager"),DMPopover=require("app/ui/dm/dm_popover"),DirectMessageComposeWithIntent=require("app/ui/dm/direct_message_compose_with_intent"),DirectMessageDialog=require("app/ui/dm/direct_message_dialog"),DirectMessageLinkHandler=require("app/ui/dm/direct_message_link_handler"),DirectMessageMediaPreview=require("app/ui/dm/direct_message_media_preview"),DirectMessageScribe=require("app/data/dm/direct_messages_scribe"),MarkAsReadData=require("app/data/dm/mark_as_read"),OpenDMDialog=require("app/data/dm/open_dm_dialog"),UnreadCountData=require("app/data/dm/unread_count"),DMCursorStorage=require("app/data/dm/dm_cursor_storage"),FeedbackClient=require("app/data/b2c/feedback_client"),FeedbackScribe=require("app/data/b2c/feedback_scribe"),hasDialog=!!$("#dm_dialog").length;module.exports=hasDialog?initialize:$.noop
});
define("app/data/dm/dm_background_poller",["module","require","exports","core/clock","core/component"],function(module, require, exports) {
function dmBackgroundPoller(){this.attributes({burstDuration:5,burstPollInterval:3e3,dmToastType:"direct_message",maxPollInterval:6e4,noTeardown:!0}),this.possiblyStartBurstPolling=function(a,b){if(b.should_request_inbox||b.is_empty)return;clearTimeout(this.stopTimeout),this.timer.resume(),this.stopTimeout=setTimeout(this.timer.pause.bind(this.timer),this.attr.burstDuration)},this.after("initialize",function(){this.timer=clock.setIntervalEvent("uiDMRequestUserUpdates",this.attr.burstPollInterval,{},this.attr.noTeardown),this.timer.pause(),clock.setIntervalEvent("uiDMRequestUserUpdates",this.attr.maxPollInterval,{},this.attr.noTeardown),this.on("uiSwiftLoaded","uiDMRequestUserUpdates"),this.on("dataDMUserUpdates",this.possiblyStartBurstPolling)})}var clock=require("core/clock"),defineComponent=require("core/component"),DMBackgroundPoller=defineComponent(dmBackgroundPoller);module.exports=DMBackgroundPoller
});
define("app/data/dm/dm_foreground_poller",["module","require","exports","core/clock","core/component"],function(module, require, exports) {
function dmForegroundPoller(){this.attributes({dmDialogSelector:"#dm_dialog",pollingInterval:3e3,noTeardown:!0}),this.pollIfForeground=function(){this.isDocumentVisible()&&this.isDialogVisible()&&this.trigger("uiDMRequestUserUpdates")},this.isDialogVisible=function(){return this.$dmDialog.is(":visible")},this.isDocumentVisible=function(){return document.visibilityState=="visible"},this.after("initialize",function(){this.$dmDialog=this.select("dmDialogSelector"),this.timer=clock.setIntervalEvent("uiDMForegroundPoll",this.attr.pollingInterval,{},!0),this.on("uiDMForegroundPoll",this.pollIfForeground)})}var clock=require("core/clock"),defineComponent=require("core/component"),DMForegroundPoller=defineComponent(dmForegroundPoller);module.exports=DMForegroundPoller
});
define("app/data/dm/dm_poll",["module","require","exports","app/data/dm/dm_background_poller","app/data/dm/dm_info","app/data/dm/dm_foreground_poller","core/component","app/data/notifications","core/utils","app/data/with_auth_token","app/data/with_data","app/data/dm/with_dm_cursor","app/utils/with_no_teardown_child_components"],function(module, require, exports) {
function dmPoll(){this.defaultAttrs({noShowError:!0,dmDialogSelector:"#dm_dialog",throttleInterval:3e3,foregroundPollInterval:3e3,burstPollInterval:3e3,burstPollDuration:3e5,maxPollInterval:6e4}),this.dispatch=function(a){a&&(notifications.updateNotificationState(a.note),this.trigger("dataNotificationsReceived",a.note))},this.makeToastRequest=function(a,b,c){this.get({url:"/i/toast_poll",data:c,eventData:b,success:this.dispatch.bind(this),returnNotificationData:!0})},this.requestUserUpdates=function(){this.get({url:"/i/direct_messages/user_updates",data:{cursor:this.dmCursor},success:"dataDMUserUpdates"})},this.requestConversationList=function(a,b){var c={};notifications.addDMData(c),this.makeToastRequest(a,b,c)},this.attachBackgroundPoller=utils.once(function(){this.attachChild(DMBackgroundPoller,document,{burstPollInterval:this.attr.burstPollInterval,burstDuration:this.attr.burstPollDuration,maxPollInterval:this.attr.maxPollInterval})}),this.after("initialize",function(){this.attachChild(DMForegroundPoller,document,{dmDialogSelector:this.attr.dmDialogSelector,pollingInterval:this.attr.foregroundPollInterval}),DMInfo.get("notifications")&&"Notification"in window&&Notification.permission=="granted"&&this.attachBackgroundPoller(),this.on("uiNativeNotificationPermissionGranted",this.attachBackgroundPoller),this.on("uiDMPoll",this.requestConversationList),this.on("uiDMRequestUserUpdates",utils.throttle(this.requestUserUpdates,this.attr.throttleInterval))})}var DMBackgroundPoller=require("app/data/dm/dm_background_poller"),DMInfo=require("app/data/dm/dm_info"),DMForegroundPoller=require("app/data/dm/dm_foreground_poller"),defineComponent=require("core/component"),notifications=require("app/data/notifications"),utils=require("core/utils"),withAuthToken=require("app/data/with_auth_token"),withData=require("app/data/with_data"),withDmCursor=require("app/data/dm/with_dm_cursor"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),DMPoll=defineComponent(dmPoll,withData,withAuthToken,withDmCursor,withNoTeardownChildComponents);module.exports=DMPoll
});
define("app/ui/with_drag_events",["module","require","exports","app/utils/drag_drop_helper"],function(module, require, exports) {
function withDragEvents(){this.defaultAttrs({fileTypeRegExp:!1}),this.childHover=function(a){$.contains(this.$node.get(0),a.target)&&(a.stopImmediatePropagation(),this.inChild=a.type==="dragenter")},this.hover=function(a){a.preventDefault();if(this.inChild)return!1;var b=this.prepareData(a);this.trigger(a.type==="dragenter"?"uiDragEnter":"uiDragLeave",b)},this.finish=function(a){a.stopImmediatePropagation(),this.inChild=!1,this.trigger("uiDragLeave")},this.preventDefault=function(a){return a.preventDefault(),!1},this.detectDragEnd=function(a){this.detectingEnd||(this.detectingEnd=!0,$(document.body).one("mousemove",this.dragEnd.bind(this)))},this.dragEnd=function(){this.detectingEnd=!1,this.trigger("uiDragEnd")},this.outOfBounds=function(a){var b=a.originalEvent.pageX,c=a.originalEvent.pageY,d=document.body.clientWidth,e=document.body.clientHeight;(b<=0||c<=0||c>=e||b>=d)&&this.dragEnd()},this.prepareData=function(a){var b=(a.originalEvent||a).dataTransfer,c={};c.types=Array.prototype.slice.call(b.types,0);var d=b.items||b.files;if(!d)c.items=null;else{c.items=[];for(var e=0;e<d.length;++e){var f=d[e];c.items.push({type:f.type})}}return{dataTransfer:c}},this.after("initialize",function(){this.inChild=!1,this.on(document.body,"dragenter dragover",this.detectDragEnd),this.on(document.body,"dragleave",this.outOfBounds),this.on("dragenter dragleave",dragDropHelper.onlyHandleEventsWithFiles(this.hover,this.attr.fileTypeRegExp)),this.on("dragover drop",dragDropHelper.onlyHandleEventsWithFiles(this.preventDefault,this.attr.fileTypeRegExp)),this.on("dragenter dragleave",dragDropHelper.onlyHandleEventsWithFiles(this.childHover,this.attr.fileTypeRegExp)),this.on(document,"uiDragEnd drop",this.finish)})}var dragDropHelper=require("app/utils/drag_drop_helper");module.exports=withDragEvents
});
define("app/ui/drag_state",["module","require","exports","core/component","app/ui/with_drag_events"],function(module, require, exports) {
function dragState(){this.defaultAttrs({draggingClass:"currently-dragging",supportsDraggingClass:"supports-drag-and-drop"}),this.dragEnter=function(){this.$node.addClass(this.attr.draggingClass)},this.dragLeave=function(){this.$node.removeClass(this.attr.draggingClass)},this.addSupportsDraggingClass=function(){this.$node.addClass(this.attr.supportsDraggingClass)},this.hasSupport=function(){return"draggable"in document.createElement("span")&&!$.browser.msie},this.after("initialize",function(){this.hasSupport()&&(this.addSupportsDraggingClass(),this.on("uiDragEnter",this.dragEnter),this.on("uiDragLeave uiDrop",this.dragLeave))})}var defineComponent=require("core/component"),withDragEvents=require("app/ui/with_drag_events");module.exports=defineComponent(dragState,withDragEvents)
});
define("app/data/dynamic_video_ad_fetcher",["module","require","exports","core/component","app/data/with_data","app/data/with_scribe"],function(module, require, exports) {
function dynamicVideoAdFetcher(){this.defaultAttrs({itemSelector:".tweet[data-dynamic-preroll=true]",maxAdRequest:10,tweetIdAttr:"data-tweet-id",impressionIdAttr:"data-impression-id",includeLongVideos:!1}),this.initialAdFetch=function(a,b){var c=this.getTweetInfo(this.select("itemSelector"));this.fetchAdsAndCache(c)},this.timelineAdFetch=function(a,b){var c=this.getTweetInfo($(b.items_html).find(this.attr.itemSelector));this.fetchAdsAndCache(c)},this.getTweetInfo=function(a){return a.map(function(a,b){var c=$(b);return{id:c.attr(this.attr.tweetIdAttr),promoted_id:c.attr(this.attr.impressionIdAttr)}}.bind(this)).get()},this.isMarketplaceTweet=function(a){return!a.promoted_id},this.fetchAdsAndCache=function(a){this.tweetRefreshCache=this.tweetRefreshCache.concat(a.filter(this.isMarketplaceTweet)),a.forEach(function(a){this.isMarketplaceTweet(a)||(this.amplifyTweets[a.id]=a)}.bind(this)),this.fetchAds(a)},this.fetchAds=function(a,b){if(!a||a.length===0)return;var c;for(c=0;c<a.length;c+=this.attr.maxAdRequest){var d=a.slice(c,c+this.attr.maxAdRequest),e=d.map(function(a){return this.requestsInFlight[a.id]=!0,{tweet_id:a.id,impression_id:a.promoted_id}}.bind(this)),f;b&&b.adId&&b.dynamicPrerollType&&(f={preroll_id:b.adId,dynamic_preroll_type:b.dynamicPrerollType}),this.post({url:"/i/videoads/v2/prerolls.json",data:{tweets:JSON.stringify({tweets:e,trigger_preroll:f,include_long_videos:this.attr.includeLongVideos})},success:this.handleSuccess.bind(this,d),error:this.handleError.bind(this,d)})}},this.handleSuccess=function(a,b){var c={},d=b.autoplay_blacklist;this.removeInFlightRequests(a),b.prerolls.forEach(function(a){var b={adId:a.preroll_id,dynamicPrerollType:a.dynamic_preroll_type,autoplayBlacklist:d};a.promoted_content&&(b.promotedContent={impressionId:a.promoted_content.impression_id,disclosureType:a.promoted_content.disclosure_type}),a.media_info&&(b.mediaInfo=a.media_info),this.amplifyTweets[a.tweet_id]&&(this.amplifyTweets[a.tweet_id].adId=a.preroll_id,this.amplifyTweets[a.tweet_id].dynamicPrerollType=a.dynamic_preroll_type),c[a.tweet_id]=b}.bind(this)),this.trigger("dataVideoAdResponse",c)},this.handleError=function(a,b){this.removeInFlightRequests(a);var c=a.map(function(a){return $.extend({error_message:b.message},a)});this.scribe({element:"dynamic_video_ads",action:"dynamic_preroll_request_error"},{items:c})},this.removeInFlightRequests=function(a){a.forEach(function(a){delete this.requestsInFlight[a.id]}.bind(this))},this.refreshCache=function(a,b){b.tweet&&b.tweet.id&&this.requestsInFlight[b.tweet.id]&&this.scribe({element:"dynamic_video_ads",action:"dynamic_preroll_request_late"},{items:[b.tweet]}),Object.keys(this.amplifyTweets).length>0&&setTimeout(function(){this.trigger("dataVideoAdResponse",this.amplifyTweets)}.bind(this),0),this.fetchAds(this.tweetRefreshCache,b.triggerAd)},this.after("initialize",function(){this.tweetRefreshCache=[],this.amplifyTweets={},this.requestsInFlight={},this.on(document,"uiRefreshVideoAdCache",this.refreshCache),this.on(document,"dataGotMoreTimelineItems",this.timelineAdFetch),this.initialAdFetch()})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),withScribe=require("app/data/with_scribe"),DynamicVideoAdFetcher=defineComponent(dynamicVideoAdFetcher,withData,withScribe);module.exports=DynamicVideoAdFetcher
});
define("app/ui/banners/email_banner",["module","require","exports","core/component"],function(module, require, exports) {
function emailBanner(){this.defaultAttrs({emailSettingsLinkSelector:".email-settings-link",phoneSettingsLinkSelector:".phone-settings-link",resendConfirmationEmailLinkSelector:".resend-confirmation-email-link",resetBounceLinkSelector:".reset-bounce-link"}),this.emailSettingsLink=function(){this.trigger("uiClickEmailSettingsLink")},this.phoneSettingsLink=function(){this.trigger("uiClickPhoneSettingsLink")},this.resendConfirmationEmail=function(a,b){this.trigger("uiResendConfirmationEmail",{unsuspend:$(a.target).hasClass("unsuspend-confirmation")})},this.resetBounceLink=function(){this.trigger("uiResetBounceLink")},this.after("initialize",function(){this.on("click",{emailSettingsLinkSelector:this.emailSettingsLink,phoneSettingsLinkSelector:this.phoneSettingsLink,resendConfirmationEmailLinkSelector:this.resendConfirmationEmail,resetBounceLinkSelector:this.resetBounceLink})})}var defineComponent=require("core/component");module.exports=defineComponent(emailBanner)
});
define("app/data/email_banner",["module","require","exports","core/component","app/data/with_data","core/i18n"],function(module, require, exports) {
function emailBannerData(){this.resendConfirmationEmail=function(a,b){var c=function(a){this.trigger("uiShowMessage",{message:a.messageForFlash})},d=function(){this.trigger("uiShowMessage",{message:_('Oops! Beim Senden der Best\xe4tigungsmail ist ein Fehler aufgetreten.')})};this.post({url:"/account/resend_confirmation_email",eventData:null,data:b&&b.unsuspend?{unsuspend:!0}:{},success:c.bind(this),error:d.bind(this)})},this.resetBounceScore=function(){var a=function(){this.trigger("uiShowMessage",{message:_('Ihre E-Mail Benachrichtigungen sollten in K\xfcrze wieder aufgenommen werden.')})},b=function(){this.trigger("uiShowMessage",{message:_('Ups! Beim Senden von E-Mail-Mitteilungen ist ein Fehler aufgetreten.')})};this.post({url:"/bouncers/reset",eventData:null,data:null,success:a.bind(this),error:b.bind(this)})},this.after("initialize",function(){this.on("uiResendConfirmationEmail",this.resendConfirmationEmail),this.on("uiResetBounceLink",this.resetBounceScore)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),_=require("core/i18n");module.exports=defineComponent(emailBannerData,withData)
});
define("app/data/email_banner_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function emailBannerScribe(){this.scribeEmailSettingsClick=function(a,b){this.scribe({page:"self_unsuspend",section:"banner",component:"email_verification",element:"settings",action:"click"})},this.scribePhoneSettingsClick=function(a,b){this.scribe({page:"self_unsuspend",section:"banner",component:"phone_verification",action:"click"})},this.scribeResendConfirmationEmailClick=function(a,b){this.scribe({page:"self_unsuspend",section:"banner",component:"email_verification",element:"resend_confirmation_email",action:"click"})},this.after("initialize",function(){this.on("uiClickEmailSettingsLink",this.scribeEmailSettingsClick),this.on("uiClickPhoneSettingsLink",this.scribePhoneSettingsClick),this.on("uiResendConfirmationEmail",this.scribeResendConfirmationEmailClick)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(emailBannerScribe,withScribe)
});
define("app/data/embed_scribe",["module","require","exports","core/component","app/data/with_scribe","app/data/with_interaction_data_scribe","core/utils"],function(module, require, exports) {
function embedScribe(){this.scribeOpen=function(a,b){this.scribeEmbedAction("open",b)},this.scribeOembedError=function(a,b){this.scribeEmbedAction("request_failed",b)},this.scribeEmbedCopy=function(a,b){this.scribeEmbedAction("copy",b)},this.scribeEmbedError=function(a,b){this.scribeEmbedAction("embed_request_failed")},this.scribeEmbedAction=function(a,b){this.scribeInteraction(a,utils.merge(b,{scribeContext:{component:"embed_tweet_dialog"}}))},this.after("initialize",function(){this.on("uiEmbedRequestFailed",this.scribeEmbedError),this.on("uiNeedsEmbedTweetDialog uiNeedsEmbedVideoDialog",this.scribeOpen),this.on("uiOembedError",this.scribeOembedError),this.on("uiUserCopiedEmbedCode",this.scribeEmbedCopy)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),withInteractionScribe=require("app/data/with_interaction_data_scribe"),utils=require("core/utils");module.exports=defineComponent(embedScribe,withScribe,withInteractionScribe)
});
define("app/data/with_widgets",["module","require","exports","core/component"],function(module, require, exports) {
function withWidgets(){this.widgetsAreLoaded=function(){return!!this.widgets&&!!this.widgets.init},this.getWidgets=function(){window.twttr||this.asyncWidgetsLoader(),this.widgets=window.twttr,window.twttr.ready(this._widgetsReady.bind(this))},this._widgetsReady=function(_){this.widgetsReady&&this.widgetsReady()},this.asyncWidgetsLoader=function(){window.twttr=function(a,b,c){var d=a.getElementsByTagName(b)[0];if(a.getElementById(c))return;var e=a.createElement(b);e.id=c,e.src="//platform.twitter.com/widgets.js",d.parentNode.insertBefore(e,d);var f={_e:[],ready:function(a){f._e.push(a)}};return window.twttr||f}(document,"script","twitter-wjs")}}var defineComponent=require("core/component"),WithWidgets=defineComponent(withWidgets);module.exports=withWidgets
});
define("app/ui/dialogs/embed_tweet",["module","require","exports","core/component","app/ui/with_dialog","app/data/with_card_metadata","app/data/with_widgets"],function(module, require, exports) {
function embedTweetDialog(){this.defaultAttrs({dialogSelector:"#embed-tweet-dialog",dialogContentSelector:"#embed-tweet-dialog .modal-content",previewContainerSelector:".embed-preview",embedFrameSelector:".embed-preview iframe",visibleEmbedFrameSelector:".embed-preview iframe:visible",embedCodeDestinationSelector:".embed-destination",triggerSelector:".js-embed-tweet",overlaySelector:".embed-overlay",spinnerOverlaySelector:".embed-overlay-spinner",errorOverlaySelector:".embed-overlay-error",tryAgainSelector:".embed-overlay-error .retry-embed",includeParentTweetContainerSelector:".embed-include-parent-tweet",includeParentTweetSelector:".include-parent-tweet",includeCardContainerSelector:".embed-include-card",includeCardSelector:".include-card",embedTweetTitleSelector:".embed-tweet-title",embedVideoTitleSelector:".embed-video-title",embedTweetInstructionsSelector:".embed-tweet-instructions",embedVideoInstructionsSelector:".embed-video-instructions",embedWidth:"469px",top:"90px"}),this.cacheKeyForOptions=function(a){return JSON.stringify(a.data)+a.tweetId},this.cacheKeyChanged=function(a){var b=this.cacheKeyForOptions(a);return b!=this.cacheKeyForOptions(this.getOptions())},this.didReceiveEmbedCode=function(a,b){if(this.cacheKeyChanged(b.options))return;this.select("overlaySelector").hide(),this.$embedCodeDestination.val(b.data.html),this.trigger(this.$dialog,"uiDialogContentChanged"),this.selectEmbedCode()},this.retryEmbedCode=function(a,b){if(this.cacheKeyChanged(b))return;this.select("overlaySelector").hide(),this.select("spinnerOverlaySelector").show(),this.trigger("uiOembedError",this.tweetData)},this.failedToReceiveEmbedCode=function(a,b){if(this.cacheKeyChanged(b))return;this.select("overlaySelector").hide(),this.select("embedCodeDestinationSelector").hide(),this.select("errorOverlaySelector").show(),this.clearOembed(),this.trigger(this.$dialog,"uiDialogContentChanged")},this.updateEmbedCode=function(){this.select("embedCodeDestinationSelector").show(),this.select("overlaySelector").hide(),this.trigger("uiNeedsOembed",this.getOptions()),this.trigger(this.$dialog,"uiDialogContentChanged")},this.requestTweetEmbed=function(){if(!this.widgetsAreLoaded())return;var a=this.getOptions(),b=this.cacheKeyForOptions(a);if(this.cachedTweetEmbeds[b]){this.displayCachedTweetEmbed(b);return}this.clearTweetEmbed(),this.widgetType==="tweet"?this.widgets.widgets.createTweet(this.tweetId(),this.select("previewContainerSelector")[0],this.receivedTweetEmbed.bind(this,b),{width:this.attr.embedWidth,conversation:a.data.hide_thread?"none":"all",cards:a.data.hide_media?"hidden":"shown"}):this.widgetType==="video"&&this.widgets.widgets.createVideo(this.tweetId(),this.select("previewContainerSelector")[0],this.receivedTweetEmbed.bind(this,b),{width:this.attr.embedWidth,status:"shown"})},this.clearTweetEmbed=function(){var a=this.select("visibleEmbedFrameSelector");this.stopPlayer(),a.hide()},this.clearOembed=function(){this.$embedCodeDestination.val("")},this.tearDown=function(){this.stopPlayer(),this.clearTweetEmbed(),this.clearOembed()},this.stopPlayer=function(){var a=this.select("embedFrameSelector");a.each(function(a,b){var c=$(b.contentWindow.document),d=c.find("div.media iframe")[0],e;if(!d||!d.src||d.src==document.location.href)return;e=d.src,d.setAttribute("src",""),d.setAttribute("src",e)})},this.displayCachedTweetEmbed=function(a){this.clearTweetEmbed(),$(this.cachedTweetEmbeds[a]).show()},this.receivedTweetEmbed=function(a,b){b?this.cachedTweetEmbeds[a]=b:this.trigger("uiEmbedRequestFailed")},this.embedCodeCopied=function(){this.trigger("uiUserCopiedEmbedCode")},this.includeParentTweet=function(){return this.$includeParentTweet.prop("checked")},this.showCard=function(){return this.$includeCard.prop("checked")},this.getOptions=function(){var a={lang:this.lang};return this.widgetType==="tweet"?(a.hide_thread=!this.includeParentTweet(),a.hide_media=!this.showCard()):this.widgetType==="video"&&(a.widget_type="video"),{data:a,retry:!0,tweetId:this.tweetId(),screenName:this.screenName()}},this.selectEmbedCode=function(){this.$embedCode.select()},this.setUpDialog=function(a,b){this.position(),this.eventData=a,this.tweetData=b,this.toggleIncludeParent(),this.toggleShowCard(),this.toggleTitle(),this.toggleInstructions(),this.resetIncludeParent(),this.resetShowCard(),this.updateEmbedCode(),this.requestTweetEmbed(),this.open(),this.fixPosition(),this.widgetsAreLoaded()||this.getWidgets()},this.setUpDialogForTweet=function(){this.widgetType="tweet",this.setUpDialog.apply(this,arguments)},this.setUpDialogForVideo=function(){this.widgetType="video",this.setUpDialog.apply(this,arguments)},this.fixPosition=function(){this.$dialog.css({position:"relative",top:this.attr.top})},this.resetIncludeParent=function(){var a=this.cacheKeyForOptions(this.getOptions());if(this.cachedTweetEmbeds[a])return;this.$includeParentTweet.prop("checked",!0)},this.resetShowCard=function(){var a=this.cacheKeyForOptions(this.getOptions());if(this.cachedTweetEmbeds[a])return;this.$includeCard.prop("checked",!0)},this.toggleIncludeParent=function(){this.$includeParentCheckboxContainer.toggle(this.widgetType==="tweet"&&!!this.tweetHasParent())},this.toggleShowCard=function(){this.$includeCardCheckboxContainer.toggle(this.widgetType==="tweet"&&!!this.tweetHasCard())},this.toggleTitle=function(){this.$embedTweetTitle.toggle(this.widgetType==="tweet"),this.$embedVideoTitle.toggle(this.widgetType==="video")},this.toggleInstructions=function(){this.$embedTweetInstructions.toggle(this.widgetType==="tweet"),this.$embedVideoInstructions.toggle(this.widgetType==="video")},this.tweetId=function(){return this.tweetData.tweetId},this.tweetHasParent=function(){return this.tweetData.hasParentTweet},this.tweetHasCard=function(){return this.getCardDataFromTweet($(this.eventData.target)).tweetHasCard},this.screenName=function(){return this.tweetData.screenName},this.widgetsReady=function(){this.$dialogContainer&&this.isOpen()&&this.requestTweetEmbed()},this.onOptionChange=function(){this.trigger("uiNeedsOembed",this.getOptions()),this.requestTweetEmbed()},this.restoreFocusToTweet=function(a){$(a.target).is(this.$dialog)&&this.activeEl&&this.trigger($(this.activeEl).closest(".tweet"),"uiShouldAddFocusStyle")},this.after("initialize",function(){this.$includeParentTweet=this.select("includeParentTweetSelector"),this.$embedCodeDestination=this.select("embedCodeDestinationSelector"),this.$includeParentCheckboxContainer=this.select("includeParentTweetContainerSelector"),this.$includeCard=this.select("includeCardSelector"),this.$includeCardCheckboxContainer=this.select("includeCardContainerSelector"),this.$embedCode=this.select("embedCodeDestinationSelector"),this.$embedTweetTitle=this.select("embedTweetTitleSelector"),this.$embedVideoTitle=this.select("embedVideoTitleSelector"),this.$embedTweetInstructions=this.select("embedTweetInstructionsSelector"),this.$embedVideoInstructions=this.select("embedVideoInstructionsSelector"),this.on(document,"uiNeedsEmbedTweetDialog",this.setUpDialogForTweet),this.on(document,"uiNeedsEmbedVideoDialog",this.setUpDialogForVideo),this.on("uiDialogCloseRequested",this.tearDown),this.on(document,"uiBeforePageChanged",this.tearDown),this.on(document,"uiDialogRestorePreviousFocus",this.restoreFocusToTweet),this.on(document,"dataOembedSuccess",this.didReceiveEmbedCode),this.on(document,"dataOembedError",this.failedToReceiveEmbedCode),this.on(document,"dataOembedRetry",this.retryEmbedCode),this.on(this.$embedCodeDestination,"copy cut",this.embedCodeCopied),this.on(this.$embedCode,"click",this.selectEmbedCode),this.on("click",{tryAgainSelector:this.updateEmbedCode}),this.on("change",{includeParentTweetSelector:this.onOptionChange,includeCardSelector:this.onOptionChange}),this.widgetType="tweet",this.lang=document.documentElement.getAttribute("lang"),this.cachedTweetEmbeds={}})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withCardMetadata=require("app/data/with_card_metadata"),withWidgets=require("app/data/with_widgets"),EmbedTweetDialog=defineComponent(embedTweetDialog,withDialog,withCardMetadata,withWidgets);module.exports=EmbedTweetDialog
});
define("app/data/feedback/feedback",["module","require","exports","core/component","app/utils/cookie","app/data/with_data"],function(module, require, exports) {
function feedbackData(){this.defaultAttrs({feedbackCookie:"debug_data",data:{}}),this.getFeedbackData=function(a,b){this.trigger("dataFeedback",this.attr.data)},this.toggleFeedbackCookie=function(a,b){var c=b.enabled?!0:null;cookie(this.attr.feedbackCookie,c),this.refreshPage(),this.checkDebugEnabled()},this.refreshPage=function(){document.location.reload(!0)},this.checkDebugEnabled=function(){this.trigger("dataDebugFeedbackChanged",{enabled:!!cookie(this.attr.feedbackCookie)})},this.addFeedbackData=function(a,b){var c=this.attr.data;for(var d in b)c[d]?c[d]=[].concat.apply(c[d],b[d]):c[d]=b[d]},this.logNavigation=function(a,b){this.addFeedbackData(a,{pushState:[{data:{href:b.href,module:b.module,title:b.title}}]}),b.init_data&&b.init_data.debugData&&this.addFeedbackData(a,b.init_data.debugData.data||{})},this.after("initialize",function(){this.data=this.attr.data||{},this.on("uiNeedsFeedbackData",this.getFeedbackData),this.on("uiToggleDebugFeedback",this.toggleFeedbackCookie),this.on("dataSetDebugData",this.addFeedbackData),this.on("uiPageChanged",this.logNavigation),this.checkDebugEnabled()})}var defineComponent=require("core/component"),cookie=require("app/utils/cookie"),withData=require("app/data/with_data");module.exports=defineComponent(feedbackData,withData)
});
define("app/ui/feedback/feedback_dialog",["module","require","exports","core/component","app/ui/with_dialog"],function(module, require, exports) {
function feedbackDialog(){this.defaultAttrs({pastedContentSelector:".feedback-json-output",debugKeySelectorSelector:"select[name=debug-key]",debugDataText:"",dialogToggleSelector:".feedback-dialog .feedback-data-toggle"}),this.toggleDebugEnabled=function(a,b){this.trigger("uiToggleDebugFeedback",{enabled:$(b.el).is(".off")})},this.prepareDialog=function(a,b){this.trigger("uiNeedsFeedbackData")},this.openDialog=function(a,b){this.debugData=b,this.refreshAvailableDataKeys(),this.open()},this.refreshAvailableDataKeys=function(){var a=this.select("debugKeySelectorSelector");a.empty(),Object.keys(this.debugData).forEach(function(b){var c=$("<option>"+b+"</option>");a.append(c)}),this.refreshDebugJSON()},this.refreshDebugJSON=function(a){var b=this.select("debugKeySelectorSelector").val();if(!b||!this.debugData[b])return;var c=this.debugData[b].map(function(a){return a.data});this.select("pastedContentSelector").html(JSON.stringify(c,undefined,2))},this.after("initialize",function(){this.on(document,"dataFeedback",this.openDialog),this.on(document,"uiPrepareFeedbackDialog",this.prepareDialog),this.on("change",{debugKeySelectorSelector:this.refreshDebugJSON}),this.on("click",{dialogToggleSelector:this.toggleDebugEnabled})})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog");module.exports=defineComponent(feedbackDialog,withDialog)
});
define("app/utils/image/image_loader",["module","require","exports","app/utils/array","app/utils/promises"],function(module, require, exports) {
var ArrayUtils=require("app/utils/array"),Promise=require("app/utils/promises"),imageLoader={load:function(a,b,c){function f(a){e=!0,d.unbind("load"),c()}var d=$("<img/>"),e=!1;d.on("load",function(a){!e&&a.type!="error"&&b(d)}),d.on("error",f),d.on("abort",f),d.attr("src",a)},loadMultiple:function(a){var b=ArrayUtils.unique(a);return Promise.collect($.map(b,function(a){var b=$.Deferred(),c=$("<img>").on("load",function(a){b.resolve({width:c[0].width,height:c[0].height})}).on("error",function(){b.reject()}).attr("src",a);return b})).then(function(a){var c={};return a.forEach(function(a,d){c[b[d]]=a}),c})}};module.exports=imageLoader
});
define("app/ui/with_tweet_translation",["module","require","exports","core/compose","app/ui/with_interaction_data","core/i18n"],function(module, require, exports) {
function withTweetTranslation(){compose.mixin(this,[withInteractionData]),this.defaultAttrs({tweetSelector:"div.tweet",tweetTranslationSelector:".tweet-translation",tweetTranslationTextSelector:".tweet-translation-text",translateTweetSelector:".js-translate-tweet",translateAndExpandTweetSelector:".js-translate-tweet.expand-stream-item",needsTranslationClass:"needs-translation",translateLabelSelector:".translate-label",permalinkContainerSelector:".permalink-tweet-container",permalinkClass:".permalink-tweet",languageSelector:".tweet-language",galleryTranslateButtonSelector:".Gallery .GalleryTweet .tweet .translate-button",translationFeedbackButtonSelector:".js-translation-feedback-button"}),this.translateTweet=function(a){var b=this.tweetFromEvent(a);if(b.find(this.attr.tweetTranslationSelector).hasClass(this.attr.needsTranslationClass)){var c=this.interactionData(b);c.dest=b.find(this.attr.tweetTranslationSelector).data("destLang"),this.trigger(b,"uiNeedsTweetTranslation",c)}},this.showTranslationFeedbackDialog=function(a){var b=this.tweetFromEvent(a),c=b.find(this.attr.tweetTranslationSelector);this.trigger(b,"uiNeedsTranslationFeedbackDialog",{tweetId:b.data("tweetId"),translation:c.data("translationText"),sourceLang:c.data("sourceLang"),destLang:c.data("destLang")})},this.expandTweet=function(a){(!this.attr.deciders||!this.attr.deciders.overlayPermalink)&&this.trigger(this.tweetFromEvent(a),"uiExpandTweet")},this.tweetFromEvent=function(a){return $(a.target).closest(this.attr.tweetSelector)},this.showTweetTranslation=function(a,b){if(b.item_html){var c=this.findTweetById($(a.target),b.id_str),d=c.find(this.attr.tweetTranslationSelector);if(!b.translated_lang){c.find(this.attr.translateTweetSelector).hide();return}d.find(this.attr.languageSelector).html(b.translated_lang),d.data({translationText:b.text,sourceLang:b.source_lang}).removeClass(this.attr.needsTranslationClass).find(this.attr.tweetTranslationTextSelector).html(b.item_html),c.find(this.attr.translateTweetSelector).toArray().forEach(function(a){var b=$(a);(!b.is(this.attr.translateAndExpandTweetSelector)||b.is(this.attr.galleryTranslateButtonSelector))&&b.hide()},this)}},this.findTweetById=function(a,b){var c=this.tweetSelectorById(b);return a.is(c)?a:a.find(c)},this.tweetSelectorById=function(a){return this.attr.tweetSelector+"[data-tweet-id="+a.replace(/\D/g,"")+"]"},this.showError=function(a,b){this.trigger("uiShowMessage",{message:_('Wir k\xf6nnen diesen Tweet leider nicht \xfcbersetzen. Bitte versuche es sp\xe4ter erneut.')})},this.after("initialize",function(){this.on("dataTweetTranslationSuccess",this.showTweetTranslation),this.on("dataTweetTranslationError",this.showError),this.on("click",{translateAndExpandTweetSelector:this.expandTweet,translationFeedbackButtonSelector:this.showTranslationFeedbackDialog,translateTweetSelector:this.translateTweet})})}var compose=require("core/compose"),withInteractionData=require("app/ui/with_interaction_data"),_=require("core/i18n");module.exports=withTweetTranslation
});
define("app/utils/animation",["module","require","exports"],function(module, require, exports) {
var animation={activeAnimations:[],startAnimation:function(){window.requestAnimationFrame(this.tick.bind(this))},tick:function(a){var b=[];this.activeAnimations.forEach(function(c){c.start||(c.start=a);var d=(a-c.start)/c.duration;d<1?b.push(c):d=1,c.fn(d)}),this.activeAnimations=b,this.activeAnimations.length>0&&this.startAnimation()},create:function(a,b){this.activeAnimations.push({start:undefined,duration:a,fn:b}),this.startAnimation()}};module.exports=animation
});
define("app/ui/gallery/with_stickers",["module","require","exports","core/utils","template","app/utils/animation","app/utils/image/image_loader","app/utils/image/image_resizer"],function(module, require, exports) {
var utils=require("core/utils"),template=require("template"),animation=require("app/utils/animation"),imageLoader=require("app/utils/image/image_loader"),imageResizer=require("app/utils/image/image_resizer"),ANIMATION_INITIAL_DELAY=500,ANIMATION_DURATION=380,ANIMATION_STEPS=[{toProgress:50/ANIMATION_DURATION,toScale:.9,easing:function(b){return b*b}},{toProgress:200/ANIMATION_DURATION,toScale:1.3,easing:function(b){return--b*b*b+1}},{toProgress:1,toScale:1,easing:function(b){return--b*b*b+1}}];module.exports=function(){this.defaultAttrs({stickerSelector:".sticker"}),this.tickStickerAnimation=function(b,c,d){var e=b.data("sticker-data"),f,g=0,h=1;c.every(function(b){return d>=g&&d<=b.toProgress?(f=h+(b.toScale-h)*b.easing((d-g)/(b.toProgress-g)),!1):(h=b.toScale,g=b.toProgress,!0)});if(d===1){b.data("animating",!1);var i=b[0].getBoundingClientRect();b.data("tooltip-left",i.left+i.width/2+$(document).scrollLeft()),b.data("tooltip-top",i.top+$(document).scrollTop())}b.attr({transform:this.transformSticker(e,f)})},this.createAnimationForSticker=function(a){if(a.data("animating"))return;a.data("animating",!0),animation.create(ANIMATION_DURATION,function(b){this.tickStickerAnimation(a,ANIMATION_STEPS,b)}.bind(this))},this.animateSticker=function(a){var b=$(a.target);this.createAnimationForSticker(b)},this.transformSticker=function(a,b){return"translate("+a.width/2+", "+a.height/2+")"+"matrix("+a.transform_a+", "+a.transform_b+", "+a.transform_c+", "+a.transform_d+", "+(-a.width/2+a.transform_tx*a.svgWidth)+", "+(-a.height/2+a.transform_ty*a.svgHeight)+")"+"scale("+b+")"+"translate(-"+a.width/2+", -"+a.height/2+")"},this.loadStickersSuccess=function(a,b,c,d){a.attr("loaded",!0);var e=b[c].width,f=b[c].height,g=template["gallery/stickers/svg"].render({image:c,width:e,height:f,stickers:$.map(d,function(a,c){var d=b[a.sticker_url].width,g=b[a.sticker_url].height,h=utils.merge({width:d,height:g,svgWidth:e,svgHeight:f},a),i=this.transformSticker(h,1);return{stickerData:JSON.stringify(h),link:a.link,width:d,height:g,url:a.sticker_url,transform:i}}.bind(this))},template),h=this.select("galleryMediaSelector").html(g).find("svg");h.find(".sticker").each(function(a,b){$(b).attr("data-original-title","By Twitter "+template.verified_account_badge.render({}))});var i=this.select("gallerySelector");imageResizer.resizeMedia(h,i,!1,this.attr.galleryTweetSelector,!0),setTimeout(function(){this.select("stickerSelector").trigger("uiAnimateSticker")}.bind(this),ANIMATION_INITIAL_DELAY),this.$current=a,this.mediaLoaded(a)},this.loadStickersFailed=function(a){this.mediaFailed(a)},this.loadStickers=function(a){this.select("gallerySelector").addClass("stickers");var b=this.getTweetId(a),c=a.data("stickers-json"),d=this.getLargeMediaUrl(a),e=[d];c.forEach(function(a){e.push(a.sticker_url)}),imageLoader.loadMultiple(e).then(function(b){this.loadStickersSuccess(a,b,d,c)}.bind(this)).fail(function(){this.loadStickersFailed(a)}.bind(this))},this.after("initialize",function(){this.on("mouseover uiAnimateSticker",{stickerSelector:this.animateSticker})})}
});
define("app/ui/with_tweet_activity_actions",["module","require","exports"],function(module, require, exports) {
function withTweetActivityActions(){this.defaultAttrs({requestReplyActivitySelector:"",requestRetweetedActivitySelector:".request-retweeted-popup",requestFavoritedActivitySelector:".request-favorited-popup",requestActivitySelectors:".request-retweeted-popup, .request-favorited-popup",requestTaggingActivitySelector:".request-tagging-popup",targetTweetSelector:".tweet",targetTaggedUsersListSelector:".popup-tagged-users-list",targetTitleSelector:"[data-activity-popup-title]",tweetPivotLinkSelector:".tweet-pivot-link",hiddenClass:"hidden"}),this.requestReplyActivity=function(a){this.trigger("uiRequestReplyActivity")},this.requestRetweetedActivity=function(a){this.requestActivityPopup(a),this.trigger("uiRequestRetweetedActivity")},this.requestFavoritedActivity=function(a){this.requestActivityPopup(a),this.trigger("uiRequestFavoritedActivity")},this.requestTaggingActivity=function(a){var b=$(a.target).closest(this.attr.targetTweetSelector),c=b.find(this.attr.targetTaggedUsersListSelector).first();this.requestActivityPopup(a),this.trigger("uiRequestTaggingActivity")},this.requestActivityPopup=function(a,b){var c=$(a.target),d=c.closest(this.attr.targetTitleSelector).attr("data-activity-popup-title"),e=c.closest(this.attr.targetTweetSelector).attr("data-tweet-id"),f=b?b.usersHtml:null,g;a.preventDefault(),a.stopPropagation(),c.closest(this.attr.requestRetweetedActivitySelector).length?g="retweeted_popup":c.closest(this.attr.requestTaggingActivitySelector).length?g="media_tagged_popup":g="favorited_popup",this.trigger("uiRequestActivityPopup",{titleHtml:d,tweetId:e,usersHtml:f,component:g})},this.handleLoggedOutRetweetedActivityClick=function(a,b){this.trigger("uiLoggedOutActionAttempt",{action:"retweeted_activity_attempt"})},this.handleLoggedOutFavoritedActivityClick=function(a,b){this.trigger("uiLoggedOutActionAttempt",{action:"favorited_activity_attempt"})},this.uiOpenSignupDialog=function(a,b,c){this.trigger("uiOpenSignupDialog")},this.uiTweetPivotClick=function(a){var b=$(a.target),c={item_details:{item_type:"0",id:b.attr("data-item-id")},component_details:{id:b.attr("data-entity-id"),name:b.attr("data-name"),description:b.attr("data-id")}};this.trigger("uiTweetPivotClick",c)},this.after("initialize",function(){if(!this.attr.loggedIn){this.on("click",{requestActivitySelectors:this.uiOpenSignupDialog,requestRetweetedActivitySelector:this.handleLoggedOutRetweetedActivityClick,requestFavoritedActivitySelector:this.handleLoggedOutFavoritedActivityClick,requestTaggingActivitySelector:this.requestTaggingActivity});return}this.on("click",{requestReplyActivitySelector:this.requestReplyActivity,requestRetweetedActivitySelector:this.requestRetweetedActivity,requestFavoritedActivitySelector:this.requestFavoritedActivity,requestTaggingActivitySelector:this.requestTaggingActivity,tweetPivotLinkSelector:this.uiTweetPivotClick})})}module.exports=withTweetActivityActions
});
define("app/ui/gallery/gallery",["module","require","exports","core/component","core/i18n","app/utils/image/image_loader","app/utils/image/image_resizer","app/ui/with_item_actions","app/ui/with_tweet_translation","app/ui/with_scrollbar_width","app/ui/gallery/with_stickers","app/ui/with_tweet_activity_actions"],function(module, require, exports) {
function gallery(){this.tweetHtml={},this.tweetPromotedBadgesHtml={},this.defaultAttrs({profileUser:!1,defaultGalleryTitle:_('Medien-Galerie'),mediaSelector:".js-adaptive-photo,.tweet-media-img-placeholder,.AdaptiveStreamGridImage,.ProfileAvatar-container,.ProfileCardMini-avatar",galleryParentSelector:".Gallery",galleryMediaSelector:".Gallery-media",galleryTweetSelector:".GalleryTweet",closeSelector:".js-close, .Gallery-closeTarget",gridSelector:".grid-action",gallerySelector:".Gallery-content",galleryTitleSelector:".modal-title",imageSelector:".media-image",navSelector:".GalleryNav",prevSelector:".GalleryNav--prev",nextSelector:".GalleryNav--next",itemType:"tweet",modalHeaderSelector:".modal-header",tweetlessGalleryClass:"is-tweetless"}),this.isOpen=function(){return this.$node.is(":visible")},this.open=function(a,b){this.calculateScrollbarWidth(),this.fromGrid=b&&!!b.fromGrid,this.title=b&&b.title?b.title:this.attr.defaultGalleryTitle,this.select("galleryTitleSelector").text(this.title),b&&b.showGrid&&b.profileUser?(this.select("gallerySelector").removeClass("no-grid"),this.select("gridSelector").attr("href","/"+b.profileUser.screen_name+"/media"),this.select("gridSelector").find(".visuallyhidden").text(b.profileUser.name),this.select("gridSelector").addClass("js-nav")):(this.select("gallerySelector").addClass("no-grid"),this.select("gridSelector").removeClass("js-nav"));var c=$(a.target).closest(this.attr.mediaSelector);if(this.isOpen()||c.length==0)return;b&&b.timelineSelector?this.$timeline=c.closest(b.timelineSelector):this.$timeline=c.parent(),imageResizer.resetMinSize(this.select("gallerySelector")),this.render(c),$("body").addClass("gallery-enabled"),this.select("gallerySelector").addClass("show-controls"),this.on("mousemove",function(){this.select("gallerySelector").removeClass("show-controls")}.bind(this)),this.trigger("uiGalleryOpened",b)},this.handleClose=function(a){if(!this.isOpen())return;this.fromGrid?this.returnToGrid(!0):(a.stopPropagation(),this.closeGallery())},this.returnToGrid=function(a){this.trigger(this.$current,"uiOpenGrid",{title:this.title,fromGallery:a}),this.closeGallery()},this.closeGallery=function(){$("body").hasClass("gallery-enabled")&&($("body").removeClass("gallery-enabled"),this.select("galleryMediaSelector").empty(),this.hideNav(),this.enableNav(!1,!1),this.off(window,"resize",this.debouncedResize),this.off("mousemove"),delete this.$timeline,delete this.$current,this.trigger("uiGalleryClosed"),this.trigger("uiDialogClosed"))},this.render=function(a){this.clearTweet(),this.$current=a,this.renderNav(),this.trigger(a,"uiGalleryMediaLoad"),this.renderMedia(!0,a)},this.renderNav=function(){if(!this.$current)return;var a,b,c,d;a=this.$timeline.find(this.attr.mediaSelector),d=a.index(this.$current),b=a.slice(0,d),c=a.slice(d+1);var e=c.length>0,f=b.length>0;this.enableNav(e,f),e||f?this.showNav():this.hideNav()},this.preloadNeighbors=function(a){this.preloadRecursive(a,"next",2),this.preloadRecursive(a,"prev",2)},this.clearTweet=function(){this.select("galleryTweetSelector").empty()},this.flushTweet=function(a){var b=this.getTweetId($(a.target));b&&delete this.tweetHtml[b]},this.getTweet=function(a){if(!a)return;if(this.tweetHtml[a])this.renderTweet(a,this.tweetHtml[a]);else{this.$current&&this.getTweetId(this.$current)==a&&this.select("galleryMediaSelector").find(".media-image,iframe").hide();var b={id:a,modal:"gallery"};this.trigger("uiGetTweet",b)}},this.gotTweet=function(a,b){b.id&&b.tweet_html&&(this.tweetHtml[b.id]=b.tweet_html,b.sourceEventData.promotedBadgeHtml&&(this.tweetPromotedBadgesHtml[b.id]=b.sourceEventData.promotedBadgeHtml),this.renderTweet(b.id,b.tweet_html))},this.renderTweet=function(a,b){if(this.$current&&this.getTweetId(this.$current)==a){var c=this.select("galleryTweetSelector"),d=this.select("gallerySelector"),e=this.select("galleryMediaSelector").find(".media-image,iframe");c.html(b);var f=this.tweetPromotedBadgesHtml[a];f&&c.find(".stream-item-footer").prepend($(f)),e.length&&(e.show(),imageResizer.resizeMedia(e,d,!1,this.attr.galleryTweetSelector))}},this.getTweetId=function(a){return a.attr("data-status-id")?a.attr("data-status-id"):a.closest("[data-tweet-id]").attr("data-tweet-id")},this.getAllInDir=function(a,b){var c,d=b=="prev"?-1:1,e=this.$timeline.find(this.attr.mediaSelector),f=e.index(a)+d;return f>-1&&(c=e.slice(f)),c||$()},this.getInDir=function(a,b){return this.getAllInDir(a,b).first()},this.preloadRecursive=function(a,b,c){if(c==0)return;if(this.$timeline.find(this.attr.mediaSelector).length==1)return;if(b=="next"&&this.getAllInDir(a,b).length<c&&!this.$timeline.hasClass("dashboard")){this.trigger("uiNearTheBottom");return}var d=this.getInDir(a,b);if(!d||!d.length)return;d.attr("data-preloading",!0);var e=function(a){d.attr("data-preloaded",!0),this.getTweet(this.getTweetId(d)),this.preloadRecursive(d,b,--c)}.bind(this),f=function(){d.remove(),this.preloadRecursive(d,b,c)}.bind(this);imageLoader.load(this.getLargeMediaUrl(d),e,f)},this.renderMedia=function(a,b){a?(b.attr("data-source-url")?this.loadVideo(b):this.loadImage(b),this.preloadNeighbors(b)):(b.remove(),this.next())},this.mediaLoaded=function(a){var b=this.getTweetId(a),c=this.select("gallerySelector");b?(this.getTweet(b),c.closest(this.attr.galleryParentSelector).removeClass(this.attr.tweetlessGalleryClass)):c.closest(this.attr.galleryParentSelector).addClass(this.attr.tweetlessGalleryClass),this.trigger("uiGalleryMediaLoaded",{url:this.getLargeMediaUrl(a),id:a.attr("data-status-id")})},this.mediaFailed=function(a){this.trigger("uiGalleryMediaFailed",{url:this.getLargeMediaUrl(a),id:a.attr("data-status-id")}),a.remove(),this.next()},this.loadImage=function(a){this.select("gallerySelector").removeClass("video").removeClass("stickers");if(a.data("stickers-json")){this.loadStickers(a);return}var b=a.find("img").attr("alt"),c=$("<img>",{alt:b,addClass:"media-image"});c.on("load",function(b){var d=this.getTweetId(a),e=this.select("gallerySelector");a.attr("loaded",!0),this.select("galleryMediaSelector").html(c),c.attr({"data-height":c[0].height,"data-width":c[0].width}),imageResizer.resizeMedia(c,e,!1,this.attr.galleryTweetSelector,!0),this.$current=a,this.mediaLoaded(a)}.bind(this)),c.on("error",function(){this.mediaFailed(a)}.bind(this)),c.attr("src",this.getLargeMediaUrl(a))},this.fixSnappyUrl=function(a){var b=a.attr("data-source-url"),c=/https:\/\/www.snappytv.com\/tc\/(\d+)\?autoplay=true&h=(\d+)&w=(\d+)/;if(!c.test(b))return;var d=a.attr("data-height")*2,e=a.attr("data-width")*2;b=b.replace(c,"https://www.snappytv.com/tc/$1?autoplay=true&h="+d+"&w="+e),a.attr("data-source-url",b)},this.loadVideo=function(a){var b=$("<iframe>");this.fixSnappyUrl(a),b.height(a.attr("data-height")*2).width(a.attr("data-width")*2).attr("data-height",a.attr("data-height")*2).attr("data-width",a.attr("data-width")*2).attr("src",a.attr("data-source-url")),a.attr("loaded",!0),this.select("galleryMediaSelector").empty().append(b),this.$current=a,this.getTweet(a.attr("data-status-id")),this.select("gallerySelector").addClass("video").removeClass("stickers")},this.prev=function(){this.gotoMedia("prev"),this.trigger("uiGalleryNavigatePrev")},this.next=function(){this.gotoMedia("next"),this.trigger("uiGalleryNavigateNext")},this.gotoMedia=function(a){if(this.$current){var b=this.getInDir(this.$current,a);b.length&&this.render(b)}},this.showNav=function(){this.select("navSelector").show()},this.hideNav=function(){this.select("navSelector").hide()},this.enableNav=function(a,b){a?this.select("nextSelector").addClass("enabled"):this.select("nextSelector").removeClass("enabled"),b?this.select("prevSelector").addClass("enabled"):this.select("prevSelector").removeClass("enabled")},this.getLargeMediaUrl=function(a){var b=a.attr("data-image-url");return a.attr("data-resolved-url-large")||b&&b+":large"},this.throttle=function(a,b,c){var d=!1;return function(){d||(a.apply(c,arguments),d=!0,setTimeout(function(){d=!1},b))}},this.after("initialize",function(){this.on("uiReplyToTweet","uiOpenReplyDialog"),this.on(document,"dataDidDeleteTweet",this.closeGallery),this.on(document,"dataGotMoreMediaTimelineItems",this.renderNav),this.on(document,"uiOpenGallery",this.open),this.on(document,"uiOverlayNavigate uiCloseGallery",this.closeGallery),this.on(document,"uiShortcutEsc",this.handleClose),this.on(window,"popstate",this.closeGallery),this.on(document,"uiShortcutLeft",this.throttle(this.prev,200,this)),this.on(document,"uiShortcutRight",this.throttle(this.next,200,this)),this.on(document,"dataGotTweet",this.gotTweet),this.on("click",{prevSelector:this.prev,nextSelector:this.next,closeSelector:this.handleClose,gridSelector:this.closeGallery}),this.on(document,"uiDidRetweet uiDidUnretweet uiDidFavoriteTweet uiDidUnfavoriteTweet",this.flushTweet)})}var defineComponent=require("core/component"),_=require("core/i18n"),imageLoader=require("app/utils/image/image_loader"),imageResizer=require("app/utils/image/image_resizer"),withItemActions=require("app/ui/with_item_actions"),withTweetTranslation=require("app/ui/with_tweet_translation"),withScrollbarWidth=require("app/ui/with_scrollbar_width"),withStickers=require("app/ui/gallery/with_stickers"),withTweetActivityActions=require("app/ui/with_tweet_activity_actions"),Gallery=defineComponent(gallery,withItemActions,withScrollbarWidth,withStickers,withTweetTranslation,withTweetActivityActions);module.exports=Gallery
});
define("app/data/gallery_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function galleryScribe(){this.scribeGalleryOpened=function(a,b){this.scribe({element:"gallery",action:"open"},b)},this.scribeGalleryClosed=function(a,b){this.scribe({element:"gallery",action:"close"},b)},this.scribeGalleryMediaLoaded=function(a,b){var c={url:b.url,item_ids:[b.id]};this.scribe({element:"photo",action:"impression"},b,c)},this.scribeGalleryMediaFailed=function(a,b){var c={url:b.url,item_ids:[b.id]};this.scribe({element:"photo",action:"error"},b,c)},this.scribeGalleryNavigateNext=function(a,b){this.scribe({element:"next",action:"click"},b)},this.scribeGalleryNavigatePrev=function(a,b){this.scribe({element:"prev",action:"click"},b)},this.scribeGridPaged=function(a,b){this.scribe({element:"grid",action:"page"},b)},this.scribeGridOpened=function(a,b){this.scribe({element:"grid",action:"impression"},b)},this.after("initialize",function(){this.on(document,"uiGalleryOpened",this.scribeGalleryOpened),this.on(document,"uiGalleryClosed",this.scribeGalleryClosed),this.on(document,"uiGalleryMediaLoaded",this.scribeGalleryMediaLoaded),this.on(document,"uiGalleryMediaFailed",this.scribeGalleryMediaFailed),this.on(document,"uiGalleryNavigateNext",this.scribeGalleryNavigateNext),this.on(document,"uiGalleryNavigatePrev",this.scribeGalleryNavigatePrev),this.on(document,"uiGridPaged",this.scribeGridPaged),this.on(document,"uiGridOpened",this.scribeGridOpened)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(galleryScribe,withScribe)
});
define("app/ui/global_loading_indicator",["module","require","exports","core/component"],function(module, require, exports) {
function globalLoadingIndicator(){this.defaultAttrs({birdSelector:"h1.bird-topbar-etched",spinnerContainer:"body",globalHeadingSelector:".global-nav h1",spinnerClass:"pushing-state",spinnerSelector:".pushstate-spinner"}),this.showSpinner=function(a,b){this.select("birdSelector").removeAttr("style"),this.select("spinnerContainer").addClass(this.attr.spinnerClass)},this.hideSpinner=function(a,b){this.select("spinnerContainer").removeClass(this.attr.spinnerClass)},this.addSpinner=function(){this.select("spinnerSelector").length||$('<div class="pushstate-spinner"></div>').insertAfter(this.select("globalHeadingSelector"))},this.after("initialize",function(){this.on("uiSwiftLoaded",this.addSpinner),this.on("uiShowGlobalLoadingIndicator",this.showSpinner),this.on("uiHideGlobalLoadingIndicator",this.hideSpinner)})}var defineComponent=require("core/component"),GlobalLoadingIndicator=defineComponent(globalLoadingIndicator);module.exports=GlobalLoadingIndicator
});
define("app/ui/dialogs/goto_user_dialog",["module","require","exports","core/component","app/ui/typeahead/typeahead_dropdown","app/ui/typeahead/typeahead_input","app/ui/with_dialog"],function(module, require, exports) {
function gotoUserDialog(){this.defaultAttrs({dropdownId:"swift_autocomplete_dropdown_goto_user",inputSelector:"input.username-input",usernameFormSelector:"form.goto-user-form"}),this.focus=function(){this.select("inputSelector").focus()},this.gotoUser=function(a,b){if(b&&b.dropdownId&&b.dropdownId!=this.attr.dropdownId)return;a.preventDefault();if(b&&b.item){this.select("inputSelector").val(b.item.screen_name),this.trigger("uiNavigate",{href:b.href});return}var c=this.select("inputSelector").val().trim();c.substr(0,1)=="@"&&(c=c.substr(1)),this.trigger("uiNavigate",{href:"/"+c})},this.reset=function(){this.select("inputSelector").val(""),this.select("inputSelector").blur(),this.trigger(this.select("inputSelector"),"uiHideAutocomplete")},this.after("initialize",function(){this.on(document,"uiShortcutShowGotoUser",this.open),this.on("uiDialogOpened",this.focus),this.on("uiDialogClosed",this.reset),this.on(this.select("usernameFormSelector"),"submit",this.gotoUser),this.on("uiTypeaheadItemSelected uiTypeaheadSubmitQuery",this.gotoUser),TypeaheadInput.attachTo(this.$node,{inputSelector:this.attr.inputSelector}),TypeaheadDropdown.attachTo(this.$node,{inputSelector:this.attr.inputSelector,autocompleteAccounts:!1,datasourceRenders:[["accounts",["accounts"]]],deciders:this.attr.typeaheadData,eventData:{scribeContext:{component:"goto_user_dialog"}}})})}var defineComponent=require("core/component"),TypeaheadDropdown=require("app/ui/typeahead/typeahead_dropdown"),TypeaheadInput=require("app/ui/typeahead/typeahead_input"),withDialog=require("app/ui/with_dialog"),GotoUserDialog=defineComponent(gotoUserDialog,withDialog);module.exports=GotoUserDialog
});
define("app/ui/dialogs/keyboard_shortcuts_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/utils/cookie","template","app/data/user_info"],function(module, require, exports) {
function keyboardShortcutsDialog(){this.defaultAttrs({showShortcutsBtnSelector:"#show-shortcuts-btn",dismissShortcutsBtnSelector:"#dismiss-shortcuts-btn",suppressSRMsgCookie:"suppress_sr_shortcuts_msg",loggedIn:!1,closeOnOtherDialogOpened:!0}),this.renderSRMessage=function(){if($("#kb-shortcuts-msg").length)return;var a=template.screen_reader_kb_shortcuts_message.render({},template);$(a).insertBefore(document.body.firstChild)},this.addMessage=function(){if(cookie(this.attr.suppressSRMsgCookie))return;this.renderSRMessage()},this.removeMessage=function(){$("#kb-shortcuts-msg").remove(),cookie(this.attr.suppressSRMsgCookie,"1",{expires:Infinity})},this.renderShortcutsDialog=function(){if($("#keyboard-shortcut-dialog").length)return;var a={is_mac:isMac,logged_in:this.attr.loggedIn,moments_experience_enabled:userInfo.getDecider("momentsExperienceEnabled")};$("body").append(template["dialogs/keyboard_shortcuts_dialog"].render(a,template)),this.$dialogContainer=$("#keyboard-shortcut-dialog"),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector)},this.showShortcutsDialog=function(){this.renderShortcutsDialog(),this.open()},this.after("initialize",function(){this.on(document,"click",{showShortcutsBtnSelector:this.showShortcutsDialog,dismissShortcutsBtnSelector:this.removeMessage}),this.on(document,"uiSwiftLoaded",this.addMessage),this.on(document,"uiOpenKeyboardShortcutsDialog",this.showShortcutsDialog)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),cookie=require("app/utils/cookie"),template=require("template"),userInfo=require("app/data/user_info"),KeyboardShortcutsDialog=defineComponent(keyboardShortcutsDialog,withDialog),isMac=navigator.platform.toLowerCase().indexOf("mac")!=-1;module.exports=KeyboardShortcutsDialog
});
/*!
 * xdm.js – Nicolas Gallagher – MIT License
 * easyXDM – Copyright(c) 2009-2011, Øyvind Sean Kinsey, oyvind@kinsey.no – MIT License
 */(function(a){function o(a){return Object.prototype.toString.call(a)==="[object Array]"}function p(a){return typeof a=="undefined"}function q(a){if(!a)throw new Error("url is undefined or empty");if(/^file/.test(a))throw new Error("The file:// protocol is not supported");var b=a.toLowerCase().match(i);if(b){var c=b[2],d=b[3],e=b[4]||"";if(c==="http:"&&e===":80"||c==="https:"&&e===":443")e="";return c+"//"+d+e}return a}function r(a){if(!a)throw new Error("url is undefined or empty");a=a.replace(k,"$1/");if(!a.match(/^(http||https):\/\//)){var b=a.substring(0,1)==="/"?"":location.pathname;b.substring(b.length-1)!=="/"&&(b=b.substring(0,b.lastIndexOf("/")+1)),a=location.protocol+"//"+location.host+b+a}while(j.test(a))a=a.replace(j,"");return a}function s(a,b,c){var d;for(var e in b)b.hasOwnProperty(e)&&(e in a?(d=b[e],typeof d=="object"?s(a[e],d,c):c||(a[e]=b[e])):a[e]=b[e]);return a}function t(a,b){typeof a=="string"&&(a=[a]);var c,d=a.length;while(d--){c=a[d],c=new RegExp(c.substr(0,1)==="^"?c:"^"+c.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$");if(c.test(b))return!0}return!1}function u(a,b){if(!b)throw new Error("parameters is undefined or null");var c=a.indexOf("#"),d=[];for(var e in b)b.hasOwnProperty(e)&&d.push(e+"="+encodeURIComponent(b[e]));return a+(c===-1?"#":"&")+d.join("&")}function v(a){var b=f.cloneNode(!1);s(a.props,{frameBorder:0,allowTransparency:!0,scrolling:"no",width:"100%",src:u(a.remote,{xdm_e:q(location.href),xdm_c:a.channel,xdm_p:1}),name:e+a.channel+"_provider",style:{margin:0,padding:0,border:0}}),b.id=a.props.name,delete a.props.name;if(!a.container)throw new Error('xdm.Rpc() configuration object missing a DOM "container" property');return s(b,a.props),a.container.appendChild(b),a.onLoad&&l(b,"load",a.onLoad),a.html&&(b.contentWindow.document.open(),b.contentWindow.document.write(a.html),b.contentWindow.document.close()),a.iframe=b,b}function w(a){var b;a.isHost=a.isHost||p(n.xdm_p),a.props=a.props||{};if(!a.isHost){a.channel=n.xdm_c.replace(/["'<>\\]/g,""),a.remote=n.xdm_e.replace(/["'<>\\]/g,"");if(a.acl&&!t(a.acl,a.remote))throw new Error("Access denied for "+a.remote)}else a.remote=r(a.remote),a.channel=a.channel||"default"+g++;return b=[new c.stack.PostMessageTransport(a)],b.push(new c.stack.QueueBehavior(!0)),b}function x(a){var b,c,d=a.length,e={incoming:function(a,b){this.up.incoming(a,b)},outgoing:function(a,b){this.down.outgoing(a,b)},callback:function(a){this.up.callback(a)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}};for(c=0;c<d;c++)b=a[c],s(b,e,!0),c!==0&&(b.down=a[c-1]),c!==d-1&&(b.up=a[c+1]);return b}function y(a){a.up.down=a.down,a.down.up=a.up,a.up=a.down=null}"use strict";if(!a.postMessage)return;var b="",c={},d=a.xdm,e="xdm_",f=document.createElement("IFRAME"),g=Math.floor(Math.random()*1e4),h=Function.prototype,i=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,j=/[\-\w]+\/\.\.\//,k=/([^:])\/\//g,l=function(){return a.addEventListener?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)}}(),m=function(){return a.removeEventListener?function(a,b,c){a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent("on"+b,c)}}(),n=function(a){a=a.substring(1,a.length).split("&");var b={},c,d=a.length;while(d--)c=a[d].split("="),b[c[0]]=decodeURIComponent(c[1]);return b}(location.hash);c.version="1.0.1",c.stack={},c.query=n,c.checkAcl=t,c.noConflict=function(f){return a.xdm=d,b=f,b&&(e="xdm_"+b.replace(".","_")+"_"),c},c.Rpc=function(a,b){var d;if(b.local)for(var e in b.local)b.local.hasOwnProperty(e)&&(d=b.local[e],typeof d=="function"&&(b.local[e]={method:d}));var f=x(w(a).concat([new c.stack.RpcBehavior(this,b),{callback:function(b){a.onReady&&a.onReady(b)}}]));this.origin=q(a.remote),this.destroy=function(){f.destroy()},f.init(),this.iframe=a.iframe},c.stack.PostMessageTransport=function(b){function g(a){var d=q(a.origin),e=typeof a.data=="string";d===f&&e&&a.data.substring(0,b.channel.length+1)===b.channel+" "&&c.up.incoming(a.data.substring(b.channel.length+1),d)}function h(f){f.data===b.channel+"-ready"&&("postMessage"in d.contentWindow?e=d.contentWindow:e=d.contentWindow.document,m(a,"message",h),l(a,"message",g),setTimeout(function(){c.up.callback(!0)},0))}var c,d,e,f;return c={outgoing:function(a,c,d){e.postMessage(b.channel+" "+a,c||f),d&&d()},destroy:function(){m(a,"message",h),m(a,"message",g),d&&(e=null,d.parentNode.removeChild(d),d=null)},init:function(){f=q(b.remote),b.isHost?(l(a,"message",h),d=v(b)):(l(a,"message",g),"postMessage"in a.parent?e=a.parent:e=a.parent.document,e.postMessage(b.channel+"-ready",f),setTimeout(function(){c.up.callback(!0)},0))}},c},c.stack.QueueBehavior=function(a){function g(){var e;if(a===!0&&c.length===0){y(b);return}if(d||c.length===0||f)return;d=!0,e=c.shift(),b.down.outgoing(e.data,e.origin,function(a){d=!1,e.callback&&setTimeout(function(){e.callback(a)},0),g()})}var b,c=[],d=!0,e="",f;return b={init:function(){b.down.init()},callback:function(a){d=!1;var c=b.up;g(),c.callback(a)},incoming:function(a,c){b.up.incoming(a,c)},outgoing:function(a,b,d){c.push({data:a,origin:b,callback:d}),g()},destroy:function(){f=!0,b.down.destroy()}},b},c.stack.RpcBehavior=function(a,b){function f(a){a.jsonrpc="2.0",c.down.outgoing(JSON.stringify(a))}function g(a,b){var c=Array.prototype.slice;return function(){var g=arguments.length,h,i={method:b};g>0&&typeof arguments[g-1]=="function"?(g>1&&typeof arguments[g-2]=="function"?(h={success:arguments[g-2],error:arguments[g-1]},i.params=c.call(arguments,0,g-2)):(h={success:arguments[g-1]},i.params=c.call(arguments,0,g-1)),e[""+ ++d]=h,i.id=d):i.params=c.call(arguments,0),a.namedParams&&i.params.length===1&&(i.params=i.params[0]),f(i)}}function i(a,b,c,d){if(!c){b&&f({id:b,error:{code:-32601,message:"Procedure not found."}});return}var e,g;b?(e=function(a){e=h,f({id:b,result:a})},g=function(a,c){g=h;var d={id:b,error:{code:-32099,message:a}};c&&(d.error.data=c),f(d)}):e=g=h,o(d)||(d=[d]);try{var i=c.method.apply(c.scope,d.concat([e,g]));p(i)||e(i)}catch(j){g(j.message)}}var c,d=0,e={};return c={incoming:function(a,c){var d=JSON.parse(a),g;d.method?b.handle?b.handle(d,f):i(d.method,d.id,b.local[d.method],d.params):(g=e[d.id],d.error&&g.error?g.error(d.error):g.success&&g.success(d.result),delete e[d.id])},init:function(){if(b.remote)for(var d in b.remote)b.remote.hasOwnProperty(d)&&(a[d]=g(b.remote[d],d));c.down.init()},destroy:function(){for(var d in b.remote)b.remote.hasOwnProperty(d)&&a.hasOwnProperty(d)&&delete a[d];c.down.destroy()}},c},typeof exports=="object"?module.exports=c:typeof provide=="function"?provide("bower_components/xdm.js/xdm",c):typeof define=="function"&&define.amd?define(function(){return c}):a.xdm=c})(window)
define("app/ui/with_dynamic_video_ads",["module","require","exports"],function(module, require, exports) {
function withDynamicVideoAds(){this.getDynamicVideoAd=function(a){var b=this.ads[a.id];return this.trigger("uiRefreshVideoAdCache",{tweet:a,triggerAd:b}),b||{}},this.updateCachedAds=function(a,b){$.extend(this.ads,b)},this.clearAdCache=function(){this.ads={}},this.after("initialize",function(){this.ads={},this.on(document,"dataVideoAdResponse",this.updateCachedAds),this.on(document,"uiRefreshVideoAdCache",this.clearAdCache)})}module.exports=withDynamicVideoAds
});
define("app/ui/with_card",["module","require","exports","core/compose","core/utils","app/data/user_info","app/data/with_card_metadata","bower_components/xdm.js/xdm","app/ui/with_interaction_data","app/ui/with_dynamic_video_ads","app/utils/params"],function(module, require, exports) {
var compose=require("core/compose"),utils=require("core/utils"),userInfo=require("app/data/user_info"),withCardMetadata=require("app/data/with_card_metadata"),xdm=require("bower_components/xdm.js/xdm"),withInteractionData=require("app/ui/with_interaction_data"),withDynamicVideoAds=require("app/ui/with_dynamic_video_ads"),params=require("app/utils/params");module.exports=function(){compose.mixin(this,[withCardMetadata,withInteractionData,withDynamicVideoAds]),this.defaultAttrs({cardWrapperClass:".js-macaw-cards-iframe-container",tweetIdData:"tweet-id",advertiserIdData:"advertiser-id",itemType:"tweet",fullCardIframeUrl:"data-full-card-iframe-url",srcAttr:"data-src",cardUrl:"data-card-url",publisherId:"data-publisher-id",creatorId:"data-creator-id",srcDataAttr:"src",cardUrlDataAttr:"card-url",publisherIdDataAttr:"publisher-id",creatorIdDataAttr:"creator-id",cardName:"data-card-name",card2TypeAttr:"card2-type",macawCardsUserStyles:"macaw-cards-user-styles"}),this.DEFAULT_SCRIBE_ELEMENT="platform_card",this.DEFAULT_SCRIBE_COMPONENT="tweet",this.DEFAULT_SCRIBE_ACTION="undefined",this.CARDS_REQUIRING_USER_DEFINED_STYLES=["2586390716:message_me"],this.createCard=function(b,c){var d,e=this._getCardWrapper(c||b),f=this._getTweetId(b),g=this._getAdvertiserId(b),h,i,j=b.closest("[data-card-component]").attr("data-card-component"),k={element:this.DEFAULT_SCRIBE_ELEMENT,component:j||this.DEFAULT_SCRIBE_COMPONENT},l={impressionId:b.data("impression-id"),disclosureType:b.data("disclosure-type")};return e&&e.length&&e[0].childNodes.length<2&&(!this.channels[f]||e.context&&e.context.clientHeight===0)&&(h=e.data("src"),$.inArray(this._getCard2Type(b),this.CARDS_REQUIRING_USER_DEFINED_STYLES)>=0&&(h=this._addUserColorToUrl(b,h)),h=this._addHeightToUrl(e,h),d=new xdm.Rpc({remote:h,container:e[0],props:{height:"0",style:{display:"block"}},onReady:function(){b.trigger("uiCardLoaded")}},{local:i=this.localMethods={localMethodNames:function(){return{callMethodByName:!0,cancelFollowUser:!0,favoriteStatus:!0,followAdvertiser:!0,followUser:!0,logPromotedInfo:!0,logPromotedContentEvent:!0,openBuyNowDialog:!0,openLeadGenConfirmDialog:!0,openAuthWebView:!0,openLink:!0,openLinkNoScribe:!0,openMessageMeDialog:!0,openProfile:!0,requestDynamicAd:!0,requestPlayerConfig:!0,resizeCard:!0,retweetStatus:!0,scribe:!0,shareStatus:!0,statusComposeTweet:!0,unblockUser:!0,unfollowAdvertiser:!0,unfollowUser:!0,videoView:!0,subscribeToEvent:!0,unsubscribeFromEvent:!0}}.bind(this),callMethodByName:function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);return i[a].method.apply(this,b)}.bind(this),openBuyNowDialog:function(a){this.trigger("MacawCardOpenBuyNowDialog",{buyNowTweetId:a.tweetId,impressionId:a.impressionId,disclosureType:a.earned?"earned":"_"})}.bind(this),openAuthWebView:function(a){this.trigger("uiOpenAuthWebViewDialog",{impressionId:a.impressionId,webviewUrl:a.webviewUrl,webviewTitle:a.webviewTitle,tweetId:a.tweetId})}.bind(this),openLeadGenConfirmDialog:function(a){a=utils.merge(a,l,{tweetId:b.data(this.attr.tweetIdData),cardUrl:e.attr(this.attr.cardUrl),fullCardIframeUrl:e.attr(this.attr.fullCardIframeUrl),publisherId:e.attr(this.attr.publisherId),creatorId:e.attr(this.attr.creatorId)}),this.trigger(document,"uiOpenLeadGenConfirmDialog",a)}.bind(this),openLink:function(a){var b=l;a.hasOwnProperty("cardEvent")&&(b.cardEvent=a.cardEvent),this.trigger("uiCardUrlClick",b),this.scribeCardInteraction("open_link",this._getCardDataWithScribeContext(e,k))}.bind(this),openLinkNoScribe:function(a){var b=l;a.hasOwnProperty("cardEvent")&&(b.cardEvent=a.cardEvent),a.skipEventUiCardUrlClick||this.trigger("uiCardUrlClick",b)}.bind(this),openMessageMeDialog:function(a){this.trigger("uiComposeNewDMWithOptions",{tweetId:a.tweetId,recipientId:a.recipientId,defaultComposerText:a.defaultComposerText,messageMeCardData:{cardName:e.attr(this.attr.cardName),cardUri:e.attr(this.attr.cardUrl),userId:userInfo.user.id}})}.bind(this),openProfile:function(a){a=utils.merge({userId:a.userId,userScreenName:a.userScreenName,scribeContext:k},this.getCardDataFromTweet(e),l),this.trigger("uiShowProfileNewWindow",a),this.trigger("uiNavigate",{href:"/"+a.userScreenName})}.bind(this),requestDynamicAd:function(){var a=this.getCard2Item(this._getCardDataWithScribeContext(e,k));return this.getDynamicVideoAd(a)}.bind(this),requestPlayerConfig:function(){return{autoPlayPreview:!!b.data("autoplaying-media"),autoPlayPreviewPreroll:userInfo.getDecider("autoplayPreviewPreroll"),useVmapVariants:userInfo.getDecider("useVmapVariants")}}.bind(this),resizeCard:function(a){d.iframe.height=parseInt(a.height,10),e.removeClass("initial-card-height")}.bind(this),statusComposeTweet:function(a){a={defaultText:a.tweetText,canTweetDefaultText:!0},$(document).trigger("uiOpenTweetDialog",a)}.bind(this),retweetStatus:function(a){this._triggerTweetAction(b,"uiOpenRetweetDialog",{id:a.tweetId||f,tweetId:a.tweetId||f})}.bind(this),favoriteStatus:function(a){this._triggerTweetAction(b,"uiDidFavoriteTweet",{id:a.tweetId||f})}.bind(this),shareStatus:function(a){this._triggerTweetAction(b,"uiNeedsShareViaEmailDialog",{id:a.tweetId||f})}.bind(this),followAdvertiser:function(a){g&&this._triggerTweetAction(b,"uiFollowAction",{userId:g})}.bind(this),unfollowAdvertiser:function(a){g&&this._triggerTweetAction(b,"uiFollowAction",{userId:g})}.bind(this),scribe:function(a){var b=this.DEFAULT_SCRIBE_ELEMENT,c=this.DEFAULT_SCRIBE_ACTION,d;a.hasOwnProperty("customScribe")&&(a.customScribe.hasOwnProperty("element")&&(b=a.customScribe.element),a.customScribe.hasOwnProperty("action")&&(c=a.customScribe.action),a.customScribe.hasOwnProperty("itemData")&&(d=a.customScribe.itemData),this.scribeCardInteraction(c,this._getCardDataWithScribeContext(e,k),b,d))}.bind(this),logPromotedInfo:function(a){this.trigger(document,"uiMacawCardClicked",{event:a.event,impressionId:a.impressionId,earned:a.earned,sync:a.sync})}.bind(this),logPromotedContentEvent:function(a){this._triggerTweetAction(b,"uiPlayableMediaEvent",$.extend(this.interactionData(b,a),a))}.bind(this),followUser:function(a){a.userId&&this._triggerTweetAction(b,"uiFollowAction",{userId:a.userId})}.bind(this),unfollowUser:function(a){a.userId&&this._triggerTweetAction(b,"uiUnfollowAction",{userId:a.userId})}.bind(this),unblockUser:function(a){a.userId&&this._triggerTweetAction(b,"uiUnblockAction",{userId:a.userId})}.bind(this),cancelFollowUser:function(a){a.userId&&this._triggerTweetAction(b,"uiCancelFollowRequestAction",{userId:a.userId})}.bind(this),subscribeToEvent:function(a){a&&a.subscribeTo&&(f in this.activeSubscriptions?this.activeSubscriptions[f].push(a.subscribeTo):this.activeSubscriptions[f]=[a.subscribeTo],this._addSubscription(f,a.subscribeTo))}.bind(this),unsubscribeFromEvent:function(a){a&&a.unsubscribeFrom&&this._removeSubscription(f,a.unsubscribeFrom)}.bind(this)},remote:{localMethodNames:{},callVideoPlayerMethod:{},transmitEvent:{}}}),$(d.iframe).attr("allowfullscreen",""),this.channels[f]=d),l},this.destroyCard=function(b){var c=b.data(this.attr.tweetIdData);if(this.channels[c]){this.channels[c].destroy(),delete this.channels[c];var d=this.activeSubscriptions[c];delete this.activeSubscriptions[c];for(eventName in d)this._subscriptionExistsFor(event)||this.off(document,eventName)}},this.destroyAllCards=function(){var b=this.channels;Object.keys(this.channels).forEach(function(a){b[a].destroy()}),this.channels={}},this._getCardWrapper=function(b){return b.find(this.attr.cardWrapperClass)},this._getTweetId=function(b){return b.data(this.attr.tweetIdData)},this._getAdvertiserId=function(b){return b.data(this.attr.advertiserIdData)},this._getUserColor=function(b){var c=$("<a/>").css("display","none").appendTo(b),d=c.css("color");return c.remove(),d},this._getCard2Type=function(b){return b.data(this.attr.card2TypeAttr)},this._addUserColorToUrl=function(b,c){var d=this._getUserColor(b);return d?params.addToUrl(c,{user_color:d}):c},this._addHeightToUrl=function(b,c){var d=b.height();return d?params.addToUrl(c,{card_height:d}):c},this._getCardDataWithScribeContext=function(b,c){return utils.merge(this.getCardDataFromTweet(b),{scribeContext:c})},this._triggerTweetAction=function(b,c,d){b.trigger(c,d)},this._addSubscription=function(a,b){this.on(document,b,function(c,d){var e=this.channels[a];e&&this.activeSubscriptions[a]&&this.activeSubscriptions[a].indexOf(b)>-1&&e.transmitEvent(b,{type:c.type,timestamp:c.timeStamp,data:c.data},d)}.bind(this))},this._removeSubscription=function(a,b){var c=this.activeSubscriptions[a];if(this.channels[a]&&Array.isArray(c)){var d=c.indexOf(b);d>-1&&(c.splice(d,1),c.length>0?this.activeSubscriptions[a]=c:delete this.activeSubscriptions[a],this._subscriptionExistsFor(b)||this.off(document,b))}},this._getAllSubscriptions=function(){return Object.keys(this.activeSubscriptions).map(function(a){return this.activeSubscriptions[a]},this).filter(function(a){return!!a})},this._subscriptionExistsFor=function(a){var b=[];return this._getAllSubscriptions().map(function(a){return a.subscribedTo}).some(function(b){return b.subscribedTo.indexOf(a)>-1})},this.autoplayMedia=function(a){var b=$(a.target).closest(".tweet[data-tweet-id]").attr("data-tweet-id"),c=this.channels[b];c&&c.callVideoPlayerMethod("autoPlayPreview")},this.loadVideoCards=function(a,b){b&&b.tweets&&b.tweets.forEach(function(a){var b=this.$node.find(".tweet[data-tweet-id="+a.tweetId+"]");b.find('[data-card-name=__entity_video][data-has-autoplayable-media="true"]:empty').length&&this.createCard(b)}.bind(this))},this.stopAutoplayingMedia=function(a,b){var c=$(a.target).closest(".tweet[data-tweet-id]").attr("data-tweet-id"),d=this.channels[c];d&&d.callVideoPlayerMethod("autoPlayPreviewStop")},this.pauseMedia=function(a){var b=$(a.target).closest(".tweet[data-tweet-id]").attr("data-tweet-id"),c=this.channels[b];c&&(c.callVideoPlayerMethod("pause"),c.callVideoPlayerMethod("autoPlayPreviewStop"))},this.pauseAllMedia=function(a,b){var c=this.channels;Object.keys(c).forEach(function(a){c[a].callVideoPlayerMethod("pause"),c[a].callVideoPlayerMethod("autoPlayPreviewStop")})},this.updatePosition=function(a,b){var c=b&&b.tweetId&&this.channels[b.tweetId];c&&c.callVideoPlayerMethod("updatePosition",b.positionData)},this.after("initialize",function(){this.channels={},this.activeSubscriptions={},this.before("teardown",this.destroyAllCards),this.on(document,"uiAutoplayMedia",this.autoplayMedia),this.on(document,"uiStopAutoplayingMedia",this.stopAutoplayingMedia),this.on(document,"uiPauseAllMedia",this.pauseAllMedia),this.on(document,"uiPauseMedia",this.pauseMedia),this.on(document,"uiPlayableMediaPositionChange",this.updatePosition),this.on(document,"uiHasInjectedNewTimeline uiHasInjectedOldTimelineItems uiHasInjectedRangeTimelineItems",this.loadVideoCards)})}
});
define("app/ui/dialogs/leadgen_confirm_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/with_card"],function(module, require, exports) {
function leadGenConfirmDialog(){this.defaultAttrs({promoCTASelector:".stream-items .leadgen-card-forward .promotion-cta",leadgenDialogIframeSelector:".cards2-promotion-iframe",tweetSelector:".leadgen-card-forward",macawCardsIframeContainerSelector:".js-macaw-cards-iframe-container"});var a={OPEN_DIALOG:"uiOpenLeadGenConfirmDialog",DIALOG_CLOSED:"uiDialogClosed",EXPANDED_TWEET:"uiHasExpandedTweet",COLLAPSED_TWEET:"uiHasCollapsedTweet"};this.setUpDialogWithElement=function(a,b){this.$tweet=$(b.el).closest(this.attr.tweetSelector);var c=this.$tweet.closest("[data-impression-id]").attr("data-impression-id"),d=this.$tweet.closest("[data-impression-id]").attr("data-disclosure-type"),e=$(b.el).data("card-url");this.leadgenDialogIframe.attr("src",e),this.setUpDialog(a,this.$tweet,c,d)},this.setUpDialogWithData=function(a,b){this.$tweet=$(this.attr.tweetSelector+"[data-tweet-id="+b.tweetId+"]"),this.macawCardsIframeContainer.attr(this.attr.srcAttr,b.fullCardIframeUrl),this.macawCardsIframeContainer.attr(this.attr.cardUrl,b.cardUrl),this.macawCardsIframeContainer.attr(this.attr.publisherId,b.publisherId),this.macawCardsIframeContainer.attr(this.attr.creatorId,b.creatorId),this.leadgenDialogIframe.hide(),this.macawCardsIframeContainer.length&&(this.createCard(this.$tweet,$(this.macawCardsIframeContainer[0].parentElement)),this.setUpDialog(a,this.$tweet,b.impressionId,b.disclosureType))},this.cleanUpDialog=function(a,b){this.macawCardsIframeContainer.removeData(this.attr.srcDataAttr),this.macawCardsIframeContainer.removeData(this.attr.cardUrlDataAttr),this.macawCardsIframeContainer.removeData(this.attr.publisherIdDataAttr),this.macawCardsIframeContainer.removeData(this.attr.creatorIdDataAttr),this.destroyCard(this.$tweet)},this.cleanUpAndScribeClose=function(b,c){this.cleanUpDialog(b,c),this.trigger(this.$tweet,a.COLLAPSED_TWEET)},this.after("initialize",function(){this.leadgenDialogIframe=this.select("leadgenDialogIframeSelector"),this.macawCardsIframeContainer=this.select("macawCardsIframeContainerSelector"),this.on(document,"click",{promoCTASelector:this.setUpDialogWithElement}),this.on(document,a.OPEN_DIALOG,this.setUpDialogWithData),this.on(a.DIALOG_CLOSED,this.cleanUpAndScribeClose)}),this.setUpDialog=function(b,c,d,e){this.trigger(c,a.EXPANDED_TWEET,{organicExpansion:!0,impressionId:d,disclosureType:e}),b.preventDefault(),this.open()}}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withCard=require("app/ui/with_card"),LeadGenConfirmDialog=defineComponent(leadGenConfirmDialog,withDialog,withCard);module.exports=LeadGenConfirmDialog
});
define("app/ui/dialogs/list_membership_dialog",["module","require","exports","core/component","app/ui/with_dialog"],function(module, require, exports) {
function listMembershipDialog(){this.defaultAttrs({top:90,contentSelector:".list-membership-content",createListSelector:".create-a-list",membershipSelector:".list-membership-container li"}),this.openListMembershipDialog=function(a,b){this.userId=b.userId,this.userId&&this.trigger("uiNeedsListMembershipContent",{userId:this.userId}),this.$content.empty(),this.$node.removeClass("has-content"),this.open()},this.addListMembershipContent=function(a,b){this.$node.addClass("has-content"),this.$content.html(b.html)},this.handleNoListMembershipContent=function(a,b){this.close(),this.trigger("uiShowError",b)},this.toggleListMembership=function(a,b){var c=$(a.target),d={userId:c.closest("[data-user-id]").attr("data-user-id"),listId:c.closest("[data-list-id]").attr("data-list-id")},e=$("#list_"+d.listId);if(!e.is(":visible"))return;e.closest(this.attr.membershipSelector).addClass("pending"),e.data("is-checked")?this.trigger("uiRemoveUserFromList",d):this.trigger("uiAddUserToList",d)},this.updateMembershipState=function(a){return function(b,c){var d=$("#list_"+c.sourceEventData.listId);d.closest(this.attr.membershipSelector).removeClass("pending"),d.attr("checked",a?"checked":null),d.data("is-checked",a),d.attr("data-is-checked",a)}.bind(this)},this.openListCreateDialog=function(){this.close(),this.trigger("uiOpenCreateListDialog",{userId:this.userId})},this.after("initialize",function(){this.$content=this.select("contentSelector"),this.on("click",{createListSelector:this.openListCreateDialog,membershipSelector:this.toggleListMembership}),this.on(document,"uiListAction uiOpenListMembershipDialog",this.openListMembershipDialog),this.on(document,"dataGotListMembershipContent",this.addListMembershipContent),this.on(document,"dataFailedToGetListMembershipContent",this.handleNoListMembershipContent),this.on(document,"dataDidAddUserToList dataFailedToRemoveUserFromList",this.updateMembershipState(!0)),this.on(document,"dataDidRemoveUserFromList dataFailedToAddUserToList",this.updateMembershipState(!1))})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),ListMembershipDialog=defineComponent(listMembershipDialog,withDialog);module.exports=ListMembershipDialog
});
define("app/ui/dialogs/list_operations_dialog",["module","require","exports","core/component","app/ui/with_dialog","core/i18n","core/utils"],function(module, require, exports) {
function listOperationsDialog(){this.defaultAttrs({top:90,win:window,saveListSelector:".update-list-button",editorSelector:".list-editor",currentNameSelector:".js-list-details .js-list-name",currentDescSelector:".js-list-details .js-list-desc",nameInputSelector:".list-editor input[name='name']",descriptionSelector:".list-editor textarea[name='description']",privacySelector:".list-editor input[name='mode']"}),this.openListOperationsDialog=function(a,b){b=b||{},this.userId=b.userId,a.type=="uiOpenUpdateListDialog"&&this.modifyDialog(),this.open(),this.$nameInput.focus()},this.modifyDialog=function(){this.$modalTitle=this.select("modalTitleSelector"),this.originalTitle=this.originalTitle||this.$modalTitle.text(),this.$modalTitle.text(_('Liste bearbeiten')),this.$nameInput.val($(this.attr.currentNameSelector).text().trim()),this.$descriptionInput.val($(this.attr.currentDescSelector).text().trim()),this.isPublic||(this.$privacyInput[1].checked=!0),this.$saveButton.attr("data-list-id",this.listId).attr("data-operation","update"),this.toggleSaveButtonDisabled(),this.modified=!0,this.$descriptionInput.on("keyup",this.toggleSaveButtonDisabled.bind(this)),this.$privacyInput.on("change",this.toggleSaveButtonDisabled.bind(this))},this.revertModifications=function(){this.modified&&(this.revertDialog(),this.$editor.find("input,textarea").val(""),this.$descriptionInput.off("keyup"),this.$privacyInput.off("change"),this.modified=!1)},this.revertDialog=function(){this.$modalTitle.text(this.originalTitle),this.$saveButton.removeAttr("data-list-id").removeAttr("data-operation"),this.isPublic||(this.$privacyInput[0].checked=!0)},this.saveList=function(a,b){if(this.requestInProgress)return;this.requestInProgress=!0;var c=$(b.el),d=c.attr("data-operation")=="update"?"uiUpdateList":"uiCreateList",e={name:this.formValue("name"),description:this.formValue("description",{type:"textarea"}),mode:this.formValue("mode",{conditions:":checked"})};c.attr("data-operation")=="update"&&(e=utils.merge(e,{list_id:c.attr("data-list-id")})),this.trigger(d,e),this.$saveButton.attr("disabled",!0)},this.saveListSuccess=function(a,b){this.close();var c=_('Liste gespeichert!');a.type=="dataDidCreateList"?(c=_('Die Liste wurde erstellt!'),this.userId?this.trigger("uiOpenListMembershipDialog",{userId:this.userId}):b&&b.slug&&(this.attr.win.location="/"+this.attr.screenName+"/lists/"+b.slug)):this.revertDialog(),this.$editor.find("input,textarea").val(""),this.trigger("uiShowMessage",{message:c})},this.saveListComplete=function(a,b){this.requestInProgress=!1,this.toggleSaveButtonDisabled()},this.toggleSaveButtonDisabled=function(a,b){this.$saveButton.attr("disabled",this.$nameInput.val()=="")},this.formValue=function(a,b){return b=b||{},b.type=b.type||"input",b.conditions=b.conditions||"",this.$editor.find(b.type+"[name='"+a+"']"+b.conditions).val()},this.disableSaveButton=function(){this.$saveButton.attr("disabled",!0)},this.updateState=function(a,b){this.listId=b.init_data.list_id,this.isPublic=b.init_data.is_public},this.after("initialize",function(){this.listId=this.attr.list_id,this.isPublic=this.attr.is_public,this.$editor=this.select("editorSelector"),this.$nameInput=this.select("nameInputSelector"),this.$descriptionInput=this.select("descriptionSelector"),this.$privacyInput=this.select("privacySelector"),this.$saveButton=this.select("saveListSelector"),this.on("click",{saveListSelector:this.saveList}),this.on("focus blur keyup",{nameInputSelector:this.toggleSaveButtonDisabled}),this.on("uiDialogOpened",this.disableSaveButton),this.on("uiDialogClosed",this.revertModifications),this.on(document,"uiOpenCreateListDialog uiOpenUpdateListDialog",this.openListOperationsDialog),this.on(document,"dataDidCreateList dataDidUpdateList",this.saveListSuccess),this.on(document,"dataDidCreateList dataDidUpdateList dataFailedToCreateList dataFailedToUpdateList",this.saveListComplete),this.on(document,"uiPageChanged",this.updateState)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),_=require("core/i18n"),utils=require("core/utils"),ListOperationsDialog=defineComponent(listOperationsDialog,withDialog);module.exports=ListOperationsDialog
});
define("app/ui/character_counter",["module","require","exports","core/component"],function(module, require, exports) {
function characterCounter(){this.attributes({maxLength:null}),this.render=function(){var a=!this.maxLengthExceeded();this.$node.toggleClass("is-maxExceeded",!a),this.$input.attr("data-valid",a),this.$counter.text(this.getRemainingLength())},this.maxLengthExceeded=function(){return this.getRemainingLength()<0},this.getRemainingLength=function(){var a=this.getLength(this.$input.val());return this.attr.maxLength-a},this.getLength=function(a){return a.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x").length},this.after("initialize",function(){this.$input=this.$node.find(".CharCounter-target"),this.$counter=this.$node.find(".CharCounter-counter"),this.render(),this.on(this.$input,"input",this.render),this.on("uiCharacterCounterUpdate",this.render)})}var defineComponent=require("core/component"),CharacterCounter=defineComponent(characterCounter);module.exports=CharacterCounter
});
define("app/ui/media/with_video",["module","require","exports","core/i18n"],function(module, require, exports) {
function withVideo(){this.defaultAttrs({videoSelector:".VideoTrim-video",playStateSelector:".VideoTrim-playState",audioStateSelector:".VideoTrim-audioState",isPlayingClass:"is-playing",isMutedClass:"is-muted",playVideoPollFreq:30}),this.loadVideo=function(a,b){this.videoDuration=0,this.video.pause(),this.video.src=b.videoSrc,this.video.load()},this.unloadVideo=function(){this.loadVideo(null,{videoSrc:""})},this.playVideo=function(a){a!==undefined&&this.setVideoCurrentTime(a),this.isVideoPlaying()||(clearInterval(this.playbackIntervalId),this.playbackIntervalId=setInterval(function(){this.video.paused?this.pauseVideo():this.isVideoAtEnd()&&this.pauseVideo(this.endTime),this.updateVideoState()}.bind(this),1e3/this.attr.playVideoPollFreq),this.video.play(),this.isProgressVisible=!0)},this.pauseVideo=function(a){this.video.pause(),clearInterval(this.playbackIntervalId),a!==undefined&&(this.isProgressVisible=!1,this.setVideoCurrentTime(a)),this.updateVideoState()},this.isVideoPlaying=function(){return!this.video.paused&&this.video.currentTime>0},this.setVideoMuted=function(a){this.video.muted=a},this.isVideoMuted=function(){return this.video.muted},this.isVideoAtEnd=function(){var a=1/this.attr.playVideoPollFreq;return this.getVideoCurrentTime()>this.endTime-a||this.video.ended},this.getVideoCurrentTime=function(){return this.video.currentTime},this.setVideoCurrentTime=function(a){this.video.currentTime=a},this.updateVideoState=function(){this.$node.toggleClass(this.attr.isPlayingClass,this.isVideoPlaying()).toggleClass(this.attr.isMutedClass,this.isVideoMuted()),this.trigger("uiVideoStateChanged")},this.readVideoMetadata=function(){this.videoDuration=this.video.duration,this.startTime=0,this.endTime=this.videoDuration,this.trigger("uiVideoLoaded"),this.updateVideoState()},this.videoError=function(a){this.trigger("uiVideoError",{message:_('Video ist nicht abspielbar.')})},this.videoUnloaded=function(a){this.videoDuration=0,this.startTime=0,this.endTime=0,this.trigger("uiVideoUnloaded")},this.toggleVideoPlayback=function(){this.videoDuration&&(this.isVideoPlaying()?this.pauseVideo():this.isVideoAtEnd()?this.playVideo(this.startTime):this.playVideo())},this.toggleAudioState=function(){this.setVideoMuted(!this.isVideoMuted()),this.updateVideoState()},this.after("initialize",function(){this.video=this.select("videoSelector")[0],this.on("uiLoadVideo",this.loadVideo),this.on("uiUnloadVideo",this.unloadVideo),this.on(this.video,"loadedmetadata",this.readVideoMetadata),this.on(this.video,"error",this.videoError),this.on(this.video,"emptied",this.videoUnloaded),this.on("click",{videoSelector:this.toggleVideoPlayback,playStateSelector:this.toggleVideoPlayback,audioStateSelector:this.toggleAudioState})}),this.before("teardown",function(){this.unloadVideo()})}var _=require("core/i18n");module.exports=withVideo
});
define("app/ui/media/video_trim",["module","require","exports","core/i18n","core/component","app/ui/media/with_video","app/utils/video","lib/twitter_cldr"],function(module, require, exports) {
function videoTrim(){var a=0,b=1,c=2,d=3,e=4;this.defaultAttrs({timeBubbleSelector:".VideoTrim-timeBubble",timelineSelector:".VideoTrim-timeline",timelineCursorSelector:".VideoTrim-timelineCursor",scrubberSelector:".VideoTrim-scrubber",unplayedScrubberSelector:".VideoTrim-unplayedScrubber",timeSelector:".VideoTrim-time",widestTimeSelector:".VideoTrim-widestTime",selectionSelector:" .VideoTrim-selection",ticksSelector:".VideoTrim-ticks",innerSelectionSelector:".VideoTrim-innerSelection",leftHandleSelector:".VideoTrim-leftHandle",midHandleSelector:".VideoTrim-midHandle",midHandleCursorSelector:".VideoTrim-midHandleCursor",rightHandleSelector:".VideoTrim-rightHandle",shroudSelector:".VideoTrim-shroud",minSelectionDuration:1,maxSelectionDuration:30,maxVisibleDuration:36,defaultSelectionDuration:20,scrollPixels:20,timeToFadeOutBubble:1e3,pixelsBeforeWarningLength:50,maxPixelsPerSecond:30,widthForHandles:42,minWidthForMidHandle:18,dragScrollRepeatInterval:30}),this.setInitialTrimRange=function(a,b){this.initialTrimRange=b.initialTrimRange},this.initAfterVideoLoads=function(){if(this.initialTrimRange){var a=this.initialTrimRange.split("-");this.startTime=+a[0],this.endTime=+a[1]}else this.startTime=(this.videoDuration-this.attr.defaultSelectionDuration)/2,this.endTime=this.startTime+this.attr.defaultSelectionDuration;this.startTime=this.clamp(this.startTime,0,this.videoDuration),this.endTime=this.clamp(this.endTime,0,this.videoDuration),this.visibleWidth=this.$node.width()-this.attr.widthForHandles,this.defaultPixelsPerSecond=this.visibleWidth/Math.min(this.videoDuration,this.attr.maxVisibleDuration),this.timelinePixelsPerSecond=this.$timeline.width()/this.videoDuration,this.generateTicks(),this.zoomToDefault(),this.showSelectionBubble(),this.playVideo(this.startTime),this.notifyTrimRange()},this.generateTicks=function(){var a="";for(var b=0;b<this.videoDuration;b+=1){var c=(100*b/this.videoDuration).toFixed(4),d=b%60?"":video.formatDuration(b);a+='<div style="left:'+c+'%">'+d+"</div>"}this.$ticks.html(a)},this.calculateScale=function(){this.offset=-this.$selection.position().left,this.pixelsPerSecond=this.$innerSelection.width()/this.videoDuration,this.percentPerSecond=100/this.videoDuration,this.minTimeForScrolling=(this.offset-this.attr.scrollPixels)/this.pixelsPerSecond,this.maxTimeForScrolling=(this.offset+this.attr.scrollPixels+this.visibleWidth)/this.pixelsPerSecond},this.formatTimeProgress=function(a){return video.formatDuration(a)+" / "+video.formatDuration(this.videoDuration)},this.updatePositions=function(){this.$mid.toggle(!!this.videoDuration);if(!this.videoDuration)return;this.calculateScale(),this.$mid.css({left:this.startTime*this.percentPerSecond+"%",width:(this.endTime-this.startTime)*this.percentPerSecond+"%"});var a=Math.min(-1,((this.endTime-this.startTime)*this.pixelsPerSecond-this.attr.minWidthForMidHandle)/2);this.$midHandleCursor.css({left:a,right:a});var b=this.isProgressVisible?Math.max(100*(this.getVideoCurrentTime()-this.startTime)/(this.endTime-this.startTime),0):0;this.$unplayedScrubber.css("left",b+"%"),this.$scrubber.css({left:this.startTime*this.percentPerSecond+"%",right:100-this.endTime*this.percentPerSecond+"%"}),this.$widestTime.text(this.formatTimeProgress(this.videoDuration)),this.$time.text(this.formatTimeProgress(this.getVideoCurrentTime())),this.select("timelineSelector"),this.updateBubblePos()},this.showSelectionBubble=function(){var a=Math.max(this.selectionDuration(),this.attr.minSelectionDuration);this.setBubble(this.formatTimeForSelection(a),"mid")},this.setEndBubbleWhileDragging=function(){this.dragMode==d?this.setBubble(video.formatDuration(this.endTime),"right"):this.setBubble(video.formatDuration(this.startTime),"left")},this.selectionDuration=function(){return this.endTime-this.startTime},this.isMaxSelected=function(){return this.selectionDuration()>=this.attr.maxSelectionDuration},this.isMinSelected=function(){return this.selectionDuration()<=this.attr.minSelectionDuration},this.formatTimeForSelection=function(a){var b=Math.floor(a/60),c=Math.floor(a%60),d={minutesWithAbbreviation:this.timespanFormatter.format(b*60,{direction:"none",type:"abbreviated",unit:"minute"}),secondsWithAbbreviation:this.timespanFormatter.format(c,{direction:"none",type:"abbreviated",unit:"second"})};return this.isMaxSelected()?b?_('{{minutesWithAbbreviation}} {{secondsWithAbbreviation}} h\xf6chstens ausgew\xe4hlt',d):_('{{secondsWithAbbreviation}} h\xf6chstens ausgew\xe4hlt',d):this.isMinSelected()?_('{{secondsWithAbbreviation}} mindestens ausgew\xe4hlt',d):b?_('{{minutesWithAbbreviation}} {{secondsWithAbbreviation}} ausgew\xe4hlt',d):_('{{secondsWithAbbreviation}} ausgew\xe4hlt',d)},this.setBubble=function(a,b){this.bubbleMode=b,this.bubbleWidth=this.$timeBubble.attr("data-mode",b||"").text(a||"").css("opacity",0).show().outerWidth(),this.updateBubblePos(),this.$timeBubble.css("opacity",1).delay(this.attr.timeToFadeOutBubble).fadeOut(500)},this.updateBubblePos=function(){var a=null,b,c;switch(this.bubbleMode){case"left":b=0,c=0;break;case"right":b=100,c=-this.bubbleWidth;break;case"mid":b=50;var d=(this.startTime+this.endTime)*this.timelinePixelsPerSecond/2;d<this.bubbleWidth/2?(c=-15,a="left"):d>this.videoDuration*this.timelinePixelsPerSecond-this.bubbleWidth/2?(c=23-this.bubbleWidth,a="right"):c=-this.bubbleWidth/2;break;default:return}this.$timeBubble.css({left:b+"%","margin-left":c}),a?this.$timeBubble.attr("data-clip",a):this.$timeBubble.removeAttr("data-clip")},this.setSelectionView=function(a,b){b?this.$selection.width(b+this.attr.widthForHandles):b=this.$innerSelection.width(),this.$selection.css("left",-this.clamp(a,0,b-this.visibleWidth)),this.updatePositions()},this.zoomToDefault=function(){var a=this.defaultPixelsPerSecond*this.videoDuration,b=(this.defaultPixelsPerSecond*(this.startTime+this.endTime)-this.visibleWidth)/2;b=this.clamp(b,0,a-this.visibleWidth),this.setSelectionView(b,a)},this.playLastFewSeconds=function(a){this.playVideo(a?Math.max(this.endTime-3,this.startTime):this.startTime),this.updatePositions()},this.beginDrag=function(a,c){this.$shroud.toggleClass("is-sideways",a==b||a==d),this.dragMode=a,this.dragStartX=c.clientX,this.dragDirty=!1,this.dragStartOffset=this.offset,this.dragHandlesInView=[a==b||a==e,a==d||a==e];if(a==e){var f=(c.clientX-this.$timeline.offset().left)/this.timelinePixelsPerSecond;if(f<this.startTime||f>this.endTime){var g=this.endTime-this.startTime;this.startTime=this.clamp(f,0,this.videoDuration-g),this.endTime=this.startTime+g}this.$shroud.show(),this.zoomToDefault()}this.$mid.addClass("is-active"),this.isVideoPlaying()||this.setDragPause(),this.updatePositions(),this.setEndBubbleWhileDragging()},this.drag=function(b){if(this.dragMode==a)return;clearTimeout(this.dragTimeoutId);var d=!1;this.$shroud.show(),this.calculateScale(),this.dragMode==c&&(this.dragHandlesInView=this.dragHandlesInView.map(function(a,b){return a||this.scrollShiftForHandle(b)===0},this));var f=b.clientX-this.dragStartX,g;this.dragMode==e?g=this.timelinePixelsPerSecond:(g=this.pixelsPerSecond,f+=this.offset-this.dragStartOffset);var h=this.applyDrag(f/g)*g;h?(this.dragDirty=!0,this.updatePositions(),this.dragStartX+=h,this.setDragPause(),this.setEndBubbleWhileDragging()):Math.abs(f)>this.attr.pixelsBeforeWarningLength&&(this.isMaxSelected()||this.isMinSelected())&&this.showSelectionBubble(),this.dragMode==e?this.zoomToDefault():this.dragHandlesInView.forEach(function(a,b){if(a){var c=this.scrollShiftForHandle(b);c&&(this.setSelectionView(this.offset+c),d=!0)}},this),d&&(this.dragTimeoutId=setTimeout(this.drag.bind(this,b),this.attr.dragScrollRepeatInterval))},this.endDrag=function(){if(this.dragMode){this.$shroud.hide(),this.updatePositions();var b=this.dragMode==d;this.dragDirty&&this.showSelectionBubble(),this.isVideoPlaying()?this.doubleClickTimeoutId||(this.doubleClickTimeoutId=setTimeout(function(){this.doubleClickTimeoutId=null,this.playLastFewSeconds(b)}.bind(this),300)):this.playLastFewSeconds(b),this.$mid.removeClass("is-active"),this.dragMode=a,clearTimeout(this.dragTimeoutId),this.notifyTrimRange()}},this.setDragPause=function(a){this.pauseVideo(this.dragMode==d?this.endTime:this.startTime)},this.calculateDrag=function(a,c,f){return a=this.clamp(a+c,0,this.videoDuration),this.dragMode==b?a=this.clamp(a,this.endTime-this.attr.maxSelectionDuration,this.endTime-this.attr.minSelectionDuration):this.dragMode==d&&(a=this.clamp(a,this.startTime+this.attr.minSelectionDuration,this.startTime+this.attr.maxSelectionDuration)),this.dragMode!=e&&this.dragHandlesInView[f]&&(a=this.clamp(a,this.minTimeForScrolling,this.maxTimeForScrolling)),a},this.applyDragLeft=function(a){var b=this.startTime;return this.startTime=this.calculateDrag(this.startTime,a,0),this.startTime-b},this.applyDragRight=function(a){var b=this.endTime;return this.endTime=this.calculateDrag(this.endTime,a,1),this.endTime-b},this.applyDrag=function(a){return this.dragMode==b?this.applyDragLeft(a):this.dragMode==d?this.applyDragRight(a):a<0?this.applyDragRight(this.applyDragLeft(a)):this.applyDragLeft(this.applyDragRight(a))},this.scrollShiftForHandle=function(a){var b=(a?this.endTime:this.startTime)*this.pixelsPerSecond;return this.clamp(this.offset,b-this.visibleWidth,b)-this.offset},this.hoverSideHandle=function(b){this.dragMode==a&&$(b.target).toggleClass("is-hover",b.type=="mouseenter")},this.hoverMidHandle=function(b){this.dragMode==a&&this.$left.add(this.$right).toggleClass("is-hover",b.type=="mouseenter")},this.hoverSelectionBubble=function(){this.dragMode==a&&this.showSelectionBubble()},this.notifyTrimRange=function(){var a=this.endTime-this.startTime>this.videoDuration-.01;this.trigger("uiTrimRangeChanged",{trimStart:this.startTime,trimEnd:this.endTime,trimRange:a?"":this.startTime.toFixed(3)+"-"+this.endTime.toFixed(3)})},this.clamp=function(a,b,c){return Math.max(b,Math.min(c,a))},this.after("initialize",function(){this.timespanFormatter=new TwitterCldr.TimespanFormatter,this.dragMode=a,this.$timeBubble=this.select("timeBubbleSelector"),this.$timeline=this.select("timelineSelector"),this.$scrubber=this.select("scrubberSelector"),this.$unplayedScrubber=this.select("unplayedScrubberSelector"),this.$time=this.select("timeSelector"),this.$widestTime=this.select("widestTimeSelector"),this.$selection=this.select("selectionSelector"),this.$ticks=this.select("ticksSelector"),this.$innerSelection=this.select("innerSelectionSelector"),this.$left=this.select("leftHandleSelector"),this.$mid=this.select("midHandleSelector"),this.$midHandleCursor=this.select("midHandleCursorSelector"),this.$right=this.select("rightHandleSelector"),this.$shroud=this.select("shroudSelector"),this.on("uiLoadVideo",this.setInitialTrimRange),this.on("uiVideoLoaded uiVideoUnloaded",this.initAfterVideoLoads),this.on("uiVideoStateChanged",this.updatePositions),this.on("mousedown",{leftHandleSelector:this.beginDrag.bind(this,b),rightHandleSelector:this.beginDrag.bind(this,d),midHandleCursorSelector:this.beginDrag.bind(this,c),timelineSelector:this.beginDrag.bind(this,e)}),this.on(window,"mousemove",this.drag),this.on(window,"mouseup",this.endDrag),this.on(this.$midHandleCursor,"mouseenter mouseleave",this.hoverMidHandle),this.on(this.$right.add(this.$left),"mouseenter mouseleave",this.hoverSideHandle),this.on(this.select("timelineCursorSelector").add(this.$mid),"mouseenter",this.hoverSelectionBubble)})}var _=require("core/i18n"),defineComponent=require("core/component"),withVideo=require("app/ui/media/with_video"),video=require("app/utils/video"),TwitterCldr=require("lib/twitter_cldr");module.exports=defineComponent(videoTrim,withVideo)
});
define("app/ui/dialogs/media_edit_dialog",["module","require","exports","app/ui/character_counter","core/component","app/utils/file","app/utils/shared_objects","template","app/ui/media/video_trim","app/ui/with_dialog","app/utils/with_no_teardown_child_components","core/i18n"],function(module, require, exports) {
function mediaEditDialog(){this.defaultAttrs({doneTargetSelector:".js-done",closeTargetSelector:".js-close",photoSectionSelector:".MediaEditDialog-photoSection",photoContainerSelector:".MediaEditDialog-photoContainer",videoSectionSelector:".MediaEditDialog-videoSection",previewContainerSelector:".MediaEditDialog-previewContainer",videoTrimSelector:".VideoTrim",videoTitleSelector:".MediaEditForm-title",videoDescriptionSelector:".MediaEditForm-description",videoCtaSelectSelector:".MediaEditForm-ctaSelect",videoCtaUrlSelector:".MediaEditForm-ctaUrl",videoEmbeddableSelector:".MediaEditForm-embeddable",videoTitleCharCounterSelector:".MediaEditForm-titleCharCounter",videoDescriptionCharCounterSelector:".MediaEditForm-descriptionCharCounter",videoTitleMaxLength:70,videoDescriptionMaxLength:200,hasAdvancedFeatures:!1}),this.fileId=0,this.renderMediaEditDialog=function(){if(this.$node.children().length)return;var a=template["dialogs/media_edit_dialog"].render({hasAdvancedFeatures:this.attr.hasAdvancedFeatures},template);this.$node.html(a),this.attachChild(VideoTrim,this.select("videoTrimSelector")),this.attachChild(CharacterCounter,this.select("videoTitleCharCounterSelector"),{maxLength:this.attr.videoTitleMaxLength}),this.attachChild(CharacterCounter,this.select("videoDescriptionCharCounterSelector"),{maxLength:this.attr.videoDescriptionMaxLength})},this.openMediaEditDialog=function(a,b){this.renderMediaEditDialog(),this.fileId=b.fileId,this.uploadId=b.uploadId;var c=sharedObjects.get(this.fileId),d=file.getFileInfo(c.name,c,{});this.isVideo=d.isVideo,this.isGif=d.isGif,this.isImage=d.isImage,this.mediaObjectUrl=file.getObjectUrl(c),this.thumbnailUrl=b.thumbnailUrl,this.select("videoSectionSelector").toggleClass("u-hidden",!this.isVideo),this.select("photoSectionSelector").toggleClass("u-hidden",this.isVideo),this.setTitle(),this.$dialog=this.$dialogContainer.find(this.attr.modalSelector),this.$dialog.toggleClass("isPhoto",!this.isVideo),this.on(this.select("videoDescriptionSelector"),"focus",this.expandVideoDescription),this.open(),this.trigger("uiMediaEditDialogOpened",{uploadId:b.uploadId})},this.updateMediaEditDialog=function(a,b){this.uploadId==b.uploadId&&(this.isVideo?(this.loadVideo(b.trimRange),this.select("videoTitleSelector").val(b.title),this.select("videoDescriptionSelector").val(b.description),this.select("videoEmbeddableSelector").prop("checked",b.embeddable=="1"||b.embeddable==""),this.select("videoCtaSelectSelector").val(b.ctaType),this.select("videoCtaUrlSelector").val(b.ctaUrl).toggleClass("u-hidden",b.ctaType==""),this.trigger(this.select("videoTitleCharCounterSelector"),"uiCharacterCounterUpdate"),this.trigger(this.select("videoDescriptionCharCounterSelector"),"uiCharacterCounterUpdate")):this.loadPhoto())},this.loadVideo=function(a){this.trigger(this.select("videoTrimSelector"),"uiLoadVideo",{videoSrc:this.mediaObjectUrl,initialTrimRange:a}),$(document).trigger("uiPauseAllMedia")},this.loadPhoto=function(){var a=!this.isVideo&&!this.isGif&&this.thumbnailUrl||this.mediaObjectUrl,b=$("<img>",{"class":"MediaEditDialog-photo",src:a,on:{load:this.position.bind(this)}});this.select("photoContainerSelector").html(b).css("background-image",'url("'+a+'")')},this.expandVideoDescription=function(){var a=3,b=parseInt(this.select("videoDescriptionSelector").css("line-height"))*a;this.off(this.select("videoDescriptionSelector"),"focus",this.expandVideoDescription),this.select("videoDescriptionSelector").height(b)},this.setTitle=function(){var a;this.isVideo?a=this.attr.hasAdvancedFeatures?EDIT_TITLE:TRIM_TITLE:this.isGif?a=GIF_TITLE:this.isImage&&(a=PHOTO_TITLE),this.select("modalTitleSelector").text(a)},this.displayVideoCtaUrl=function(){var a=this.select("videoCtaSelectSelector").val()==="";this.select("videoCtaSelectSelector").toggleClass("u-inactive",a),this.select("videoCtaUrlSelector").toggleClass("u-hidden",a),a?this.select("videoCtaUrlSelector").removeAttr("data-valid"):(this.validateVideoCtaUrl(),this.select("videoCtaUrlSelector").focus()),this.trigger("uiValidateForm")},this.validateForm=function(){var a=this.isValidInput("videoCtaUrlSelector"),b=this.isValidInput("videoTitleSelector")&&this.isValidInput("videoDescriptionSelector")&&a;return b?this.select("doneTargetSelector").removeAttr("disabled"):(this.select("doneTargetSelector").attr("disabled",""),!a&&this.select("videoCtaUrlSelector").val().length&&(this.trigger(document,"uiShowMessage",{message:INVALID_URL_MESSAGE}),this.select("videoCtaUrlSelector").focus())),b},this.isValidInput=function(a){return this.select(a).attr("data-valid")!=="false"},this.validateVideoCtaUrl=function(){var a=this.select("videoCtaUrlSelector").val(),b=this.isValidUrl(a);return this.select("videoCtaUrlSelector").attr("data-valid",b),this.trigger("uiValidateForm"),b},this.isValidUrl=function(a){return URL_RE.test(a.trim())},this.editDone=function(){var a={fileId:this.fileId,uploadId:this.uploadId,trimStart:this.trimStart,trimEnd:this.trimEnd,trimRange:this.trimRange};this.attr.hasAdvancedFeatures&&(a.advanced={title:this.select("videoTitleSelector").val(),description:this.select("videoDescriptionSelector").val(),ctaType:this.select("videoCtaSelectSelector").val(),ctaUrl:this.select("videoCtaUrlSelector").val(),embeddable:this.select("videoEmbeddableSelector").is(":checked")|0}),this.trigger("uiMediaEditDialogDone",a)},this.closeMediaEditDialog=function(a,b){this.isVideo&&this.trigger(this.select("videoTrimSelector"),"uiUnloadVideo"),this.mediaObjectUrl&&(file.revokeObjectUrl(this.mediaObjectUrl),this.mediaObjectUrl=null),this.close(),this.activeEl?$(this.activeEl).closest(".tweet-form, .modal").find(".tweet-box").focus():this.restorePreviousFocus()},this.updateTrimRange=function(a,b){this.trimStart=b.trimStart,this.trimEnd=b.trimEnd,this.trimRange=b.trimRange},this.after("initialize",function(){this.on(document,"uiMediaEditDialogOpen",this.openMediaEditDialog),this.on(document,"uiMediaEditDialogFill",this.updateMediaEditDialog),this.on("uiShortcutEsc uiDialogClosed uiMediaEditDialogDone",this.closeMediaEditDialog),this.on("uiTrimRangeChanged",this.updateTrimRange),this.on("click",{doneTargetSelector:this.editDone,closeTargetSelector:this.closeMediaEditDialog}),this.on("uiShortcutCmdEnter",this.editDone),this.on("change",{videoTitleSelector:this.validateForm,videoDescriptionSelector:this.validateForm,videoCtaSelectSelector:this.displayVideoCtaUrl,videoCtaUrlSelector:this.validateVideoCtaUrl}),this.on("uiValidateForm",this.validateForm)})}var CharacterCounter=require("app/ui/character_counter"),defineComponent=require("core/component"),file=require("app/utils/file"),sharedObjects=require("app/utils/shared_objects"),template=require("template"),VideoTrim=require("app/ui/media/video_trim"),withDialog=require("app/ui/with_dialog"),withNoTeardownChildComponents=require("app/utils/with_no_teardown_child_components"),_=require("core/i18n"),MediaEditDialog=defineComponent(mediaEditDialog,withDialog,withNoTeardownChildComponents,CharacterCounter),URL_RE=/^(https?:\/\/)?[a-z0-9-\.]+\.[a-z]+\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/,INVALID_URL_MESSAGE=_('URL ist nicht g\xfcltig'),EDIT_TITLE=_('Bearbeiten'),TRIM_TITLE=_('Zuschneiden'),GIF_TITLE=_('GIF'),PHOTO_TITLE=_('Foto');module.exports=MediaEditDialog
});
define("app/utils/serialize_client_rect",["module","require","exports"],function(module, require, exports) {
module.exports=function(b){return{top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.width,height:b.height}}
});
define("app/ui/media_viewport_position_monitor",["module","require","exports","core/component","app/utils/viewport_helpers","core/utils","app/utils/serialize_client_rect"],function(module, require, exports) {
function MediaViewportPositionMonitor(){this.defaultAttrs({scrollThrottleMs:200,mediaSelectors:".OldMedia-videoContainer, .AdaptiveMedia-videoContainer",tweetIdDataAttr:"data-tweet-id",tweetsSelector:".tweet",permalinkOverlaySelector:".PermalinkOverlay"}),this.notifyViewportPositionChange=function(){var a=viewportHelpers.getVisibleViewport();this.watchedMedia.filter(function(a){return a.mediaElement.children.length!=0}).filter(function(a){return this.permalinkOpen===a.inPermalink}.bind(this)).map(function(b){var c=b.mediaElement.getBoundingClientRect();return{tweetId:b.tweetId,parentViewportSize:a,positionInParent:serializeClientRect(c),videoHidden:this.pageHidden||this.modalWithinPermalinkOpen||this.modalOpen&&!b.inPermalink}}.bind(this)).forEach(function(a){this.notifyViewportPositionChangeForElement(a.tweetId,a.parentViewportSize,a.positionInParent,a.videoHidden)}.bind(this))},this.notifyViewportPositionChangeForElement=function(a,b,c,d){var e={parentViewportSize:b,positionInParent:serializeClientRect(c),videoHidden:d};this.trigger("uiPlayableMediaPositionChange",{tweetId:a,positionData:e})},this.isMediaElementWithinPermalink=function(a){var b=a.closest(this.attr.permalinkOverlaySelector);return b.length>0},this.updateTweetList=function(){this.watchedMedia=this.select("mediaSelectors").map(function(a,b){var c=$(b),d=this.modalOpen&&this.isMediaElementWithinPermalink(c);return{mediaElement:b,tweetId:c.closest(this.attr.tweetsSelector).attr(this.attr.tweetIdDataAttr),inPermalink:d}}.bind(this)).get(),this.updatePermalinkVisibility(),this.throttledNotifyViewportPositionChange()},this.updatePermalinkVisibility=function(){this.permalinkOpen=this.$permalink.is(":visible")},this.updatePageVisibility=function(){var a=!document.hasFocus()||document.hidden;a!=this.pageHidden&&(this.pageHidden=a,this.throttledNotifyViewportPositionChange())},this.setModalOpen=function(){this.permalinkOpen?this.modalWithinPermalinkOpen=!0:this.modalOpen=!0,this.throttledNotifyViewportPositionChange()},this.setModalClosed=function(){this.modalWithinPermalinkOpen?this.modalWithinPermalinkOpen=!1:this.modalOpen=!1,this.updateTweetList()},this.after("initialize",function(){this.watchedMedia=[],this.pageHidden=!1,this.modalOpen=!1,this.permalinkOpen=!1,this.modalWithinPermalinkOpen=!1,this.throttledNotifyViewportPositionChange=utils.throttle(this.notifyViewportPositionChange.bind(this),this.attr.scrollThrottleMs),this.on(document,"scroll uiDynamicCardLoaded uiDynamicCardUnloaded",this.throttledNotifyViewportPositionChange),this.on(window,"resize",this.throttledNotifyViewportPositionChange),this.on(document,"uiPageHidden uiPageVisible",this.updatePageVisibility),this.on(window,"focus focusin blur focusout",this.updatePageVisibility),this.$permalink=this.select("permalinkOverlaySelector"),this.$permalink.on("scroll",this.throttledNotifyViewportPositionChange),this.on(document,"uiDialogOpened",this.setModalOpen),this.on(document,"uiDialogClosed",this.setModalClosed),this.on(document,"uiWatchPlayableMedia",this.updateTweetList),this.updateTweetList()})}var defineComponent=require("core/component"),viewportHelpers=require("app/utils/viewport_helpers"),utils=require("core/utils"),serializeClientRect=require("app/utils/serialize_client_rect");module.exports=defineComponent(MediaViewportPositionMonitor)
});
define("app/utils/moments/media_crop_util",["module","require","exports"],function(module, require, exports) {
var MediaCropUtil={cropRatioThreshold:.05,calculateCrop:function(a,b,c){var d=a.width/a.height,e=b.width/b.height,f=c.width/c.height,g=(e-f)/e;Math.abs(g)>this.cropRatioThreshold&&(c=this.getDefaultCropRect(a,e),f=c.width/c.height);var h=a.width/c.width*100,i=a.height/c.height*100,j=c.x/c.width*100,k=c.y/c.width*100;return{width:h+"%",height:i+"%",marginLeft:-1*j+"%",marginTop:-1*k+"%"}},getDefaultCropRect:function(a,b){var c=b.width/b.height,d=c<1,e=c>1,f;if(d){var g=a.height*c;f={width:g,height:a.height}}else if(e){var h=a.width/c;f={width:a.width,height:h}}else{var i=Math.min(a.width,a.height);f={width:i,height:i}}var j=1;return f.width>a.width?j=a.width/f.width:f.height>a.height&&(j=a.height/f.height),f.width=f.width*j,f.height=f.height*j,f.x=(a.width-f.width)*.5,f.y=(a.height-f.height)*.5,["width","height","x","y"].forEach(function(a){f[a]=Math.round(f[a])}),f}};module.exports=MediaCropUtil
});
define("app/ui/moments/media_loader",["module","require","exports","core/component","app/utils/moments/media_crop_util"],function(module, require, exports) {
function mediaLoader(){this.defaultAttrs({mediaItemSelector:".MomentMediaItem",mediaEntitySelector:".MomentMediaItem-entity",dataLoadedAttr:"data-loaded",dataCropAspectRatio:"data-crop-aspect-ratio",dataAlwaysCropAttr:"data-always-crop",cropSquare:"square",cropPortrait:"portrait"}),this.loadAllMedia=function(){var a=this.select("mediaItemSelector").filter(':not([data-loaded="true"])');a.each(this.loadMedia.bind(this))},this.loadMedia=function(a,b){var c=$(b),d=c.find(this.attr.mediaEntitySelector);!!d.length&&!!c.length&&d.css(this.getCssForLoading(c,d)),c.attr(this.attr.dataLoadedAttr,!0)},this.getCssForLoading=function(a,b){var c=this.getMediaDimensions(b),d=a.attr(this.attr.dataCropAspectRatio),e=a.attr(this.attr.dataAlwaysCropAttr),f=c.width/c.height<.75,g=d===this.attr.cropSquare,h=d===this.attr.cropPortrait&&(f||e),i=this.getTargetData(a,h);if(g||h){var j=this.getCropData(b,c,d)||MediaCropUtil.getDefaultCropRect(c,i);return MediaCropUtil.calculateCrop(c,i,j)}return this.calculateScalingCss(i,c)},this.getTargetData=function(a,b){var c=a.width(),d=a.height();return!d&&b&&(d=c/3*4,a.height(d)),{width:c,height:d}},this.getCropData=function(a,b,c){var d={x:parseInt(a.data(c+"-crop-x"),10),y:parseInt(a.data(c+"-crop-y"),10),width:parseInt(a.data(c+"-crop-width"),10),height:parseInt(a.data(c+"-crop-height"),10)},e=a.data("width"),f=a.data("height"),g=b.width===e&&b.height===f;if(g&&this.validateCropData(d))return d},this.validateCropData=function(a){return Object.keys(a).every(function(b){return!isNaN(a[b])})},this.getMediaDimensions=function(a){var b=a.get(0).nodeName.toLowerCase()==="img";return b?this.getImageDimensions(a):this.getIframeDimensions(a)},this.getImageDimensions=function(a){var b=a.get(0);return{width:b.naturalWidth||a.data("width"),height:b.naturalHeight||a.data("height")}},this.getIframeDimensions=function(a){return{width:a.data("width"),height:a.data("height")}},this.calculateScalingCss=function(a,b){var c=a.width/b.width*b.height;return{width:"100%",height:c+"px"}},this.after("initialize",function(){this.loadAllMedia(),this.on("uiMomentMediaLoadAllMedia",this.loadAllMedia)})}var defineComponent=require("core/component"),MediaCropUtil=require("app/utils/moments/media_crop_util");module.exports=defineComponent(mediaLoader)
});
define("app/ui/moments/maker/moment_summary_list_dialog",["module","require","exports","core/component","app/ui/moments/media_loader","app/ui/with_dialog","bower_components/flight-with-child-components/lib/flight-with-child-components","template"],function(module, require, exports) {
function momentSummaryListDialog(){this.defaultAttrs({top:80,closeOnOtherDialogOpened:!0,momentListContainerSelector:".timeline-selector",capsuleSelector:".MomentGuideVTwoCapsuleSummary",spinnerSelector:".spinner"}),this.renderMomentsList=function(a,b){var c=this.select("momentListContainerSelector");this.select("spinnerSelector").hide(),c.html(b.html),c.trigger("uiMomentMediaLoadAllMedia")},this.around("open",function(a,b,c){this.tweetId=c.tweet_id,this.trigger("uiNeedsFullUserMoments"),a()}),this.handleCapsuleClick=function(a,b){a.preventDefault(),a.stopPropagation();var c=$(a.target).closest(this.attr.capsuleSelector).data("moment-id");this.trigger("uiMomentMakerAddTweet",{moment_id:c,tweet_id:this.tweetId}),this.close()},this.after("initialize",function(){this.tweetId=undefined,this.on(document,"uiOpenAddToMomentDialog",this.open),this.on(document,"dataGotFullUserMoments",this.renderMomentsList),this.on("click",{capsuleSelector:this.handleCapsuleClick}),this.attachChild(MediaLoader,this.attr.momentListContainerSelector)})}var defineComponent=require("core/component"),MediaLoader=require("app/ui/moments/media_loader"),withDialog=require("app/ui/with_dialog"),withChildComponents=require("bower_components/flight-with-child-components/lib/flight-with-child-components"),template=require("template");module.exports=defineComponent(withDialog,withChildComponents,momentSummaryListDialog)
});
define("app/utils/find_tweet",["module","require","exports"],function(module, require, exports) {
function findTweet(a,b,c){var d=b.split(",").map(function(a){return a+"[data-tweet-id="+c+"]"}).join();return a.find(d)}module.exports=findTweet
});
define("app/ui/moments/maker/with_moment_curation",["module","require","exports"],function(module, require, exports) {
function withMomentCuration(){this.defaultAttrs({momentItemSelector:".MomentCurationMenuItem",addTweetFromMomentSelector:".MomentCurationMenuItem:not(.is-member)",removeTweetFromMomentSelector:".MomentCurationMenuItem.is-member",addTweetToOtherMomentSelector:".js-actionMomentMakerAddTweetToOtherMoment",momentMemberClass:"is-member"}),this.renderUserMomentsList=function(a,b){this.select("momentItemSelector").remove(),this.select("addTweetToOtherMomentSelector").before(b.html)},this.setCurationClassValue=function(a){return function(b,c){this.select("momentItemSelector").filter("[data-moment-id="+c.moment_id+"]").toggleClass(this.attr.momentMemberClass,a)}.bind(this)},this.triggerMomentCurationEvent=function(a){return function(b,c,d){var e=$(c.el),f=e.data("moment-id"),g=e.hasClass(this.attr.momentMemberClass),h=d.$tweet.attr("data-tweet-id");this.trigger(a,{moment_id:f,tweet_id:h}),this.trigger("uiCloseDropdowns")}},this.getMomentsWithEvent=function(a){return function(b,c,d){var e=d.$tweet.attr("data-tweet-id");this.trigger(a,{tweet_id:e})}},this.after("initialize",function(){if(!this.attr.loggedIn)return;this.on("click",{addTweetFromMomentSelector:this.composeHandler(this.getClosestTweet,this.triggerMomentCurationEvent("uiMomentMakerAddTweet")),removeTweetFromMomentSelector:this.composeHandler(this.getClosestTweet,this.triggerMomentCurationEvent("uiMomentMakerRemoveTweet")),addTweetToOtherMomentSelector:this.composeHandler(this.getClosestTweet,this.getMomentsWithEvent("uiOpenAddToMomentDialog"))}),this.on("uiDropdownOpened",this.composeHandler(this.getClosestTweet,this.getMomentsWithEvent("uiNeedsUserMoments"))),this.on(document,"dataMomentMakerAddTweetSuccess",this.setCurationClassValue(!0)),this.on(document,"dataMomentMakerRemoveTweetSuccess",this.setCurationClassValue(!1)),this.on(document,"dataGotUserMoments",this.renderUserMomentsList)})}module.exports=withMomentCuration
});
define("app/ui/more_tweet_actions_dropdown",["module","require","exports","core/i18n","core/component","app/utils/find_tweet","app/ui/with_dropdownmenu","app/ui/with_interaction_data","app/ui/with_navigation_links_scribing","app/ui/with_tweet_actions_helper","app/ui/moments/maker/with_moment_curation"],function(module, require, exports) {
function moreTweetActionsDropdown(){this.defaultAttrs({tweetItemSelector:".tweet",deleteSelector:".js-actionDelete",shareViaDMSelector:".js-actionShareViaDM",copyLinkToTweetSelector:".js-actionCopyLinkToTweet",embedTweetSelector:".js-actionEmbedTweet",embedVideoSelector:".js-actionEmbedVideo",openAdsInfoLinkSelector:".js-actionOpenAdsInfoPage",blockOrReportTweetSelector:".js-actionBlockOrReport",blockTweetSelector:".js-actionBlock",reportTweetSelector:".js-actionReport",unblockTweetSelector:".js-actionUnblock",userTogglePinTweetSelector:".js-actionPinTweet",curateTweetSelector:".js-actionCurateTweet",curateToOtherSelector:".js-actionCurateTweetOther",curateToNewTimelineSelector:".js-actionCurateTweetNewTimeline",removeMediaTagSelector:".js-actionRemoveTag",tweetContainerSelector:".js-stream-item",mediaTagContainerSelector:".media-tags-container",pinnedTweetClass:"user-pinned",hasTimelinesClass:"has-timelines"}),this.renderCustomTimelinesList=function(a,b){var c=this.select("curateToOtherSelector");this.select("curateTweetSelector").remove(),c.before(b.html),this.select("curateTweetSelector").length>0&&c.addClass(this.attr.hasTimelinesClass)},this.curateTweet=function(a,b,c){var d=$(b.el),e=d.attr("data-timeline-id"),f=d.data("is-member"),g=c.tweetData;g.timelineId=e,f?this.trigger("uiCurateRemoveTweet",g):this.trigger("uiCurateAddTweet",g),this.trigger("uiCloseDropdowns")},this.getCustomTimelines=function(a,b,c){var d=c.$tweet.attr("data-tweet-id");this.trigger("uiNeedsCustomTimelines",{tweetId:d})},this.confirmRemoveMediaTag=function(a){this.trigger(a.target,"uiOpenConfirmDialog",{titleText:_('Foto-Markierung von Tweet entfernen?'),bodyText:_('Bist Du sicher, dass Du Deine Foto-Markierung von diesem Tweet entfernen willst?'),cancelText:_('Abbrechen'),submitText:_('Okay'),action:"MediaTagRemove"})},this.removeMediaTag=function(a,b,c){this.trigger(document,"uiDidRemoveMediaTag",c.tweetData)},this.handleRemoveMediaTagSuccess=function(a,b){var c=findTweet(this.$node,this.attr.tweetItemSelector,b.id_str);c.find(this.attr.mediaTagContainerSelector).html(b.item_html),this.trigger("uiShowMessage",{message:_('Foto-Markierung entfernt')})},this.handleRemoveMediaTagFailure=function(a){this.trigger("uiShowMessage",{message:_('Die Markierung kann nicht entfernt werden. Bitte versuche es sp\xe4ter erneut.')})},this.showConfirmPinDialog=function(a){a.stopImmediatePropagation(),this.trigger(a.target,"uiOpenConfirmDialog",{titleText:_('Diesen Tweet ganz oben auf Deinem Profil anheften'),bodyText:_('Dies wird jeden zuvor angehefteten Tweet ersetzen. Bist Du sicher?'),cancelText:_('Abbrechen'),submitText:_('Anheften'),action:"UserPinTweetToggle"})},this.showConfirmUnPinDialog=function(a){a.stopImmediatePropagation(),this.trigger(a.target,"uiOpenConfirmDialog",{titleText:_('Von Deinem Profil entfernen'),bodyText:_('Bist Du sicher?'),cancelText:_('Abbrechen'),submitText:_('Pin entfernen'),action:"UserPinTweetToggle"})},this.showUserPinToggledMessage=function(a,b){this.trigger("uiShowStickyMessage",b)},this.unpinOtherTweets=function(a,b){this.select("tweetItemSelector").removeClass(this.attr.pinnedTweetClass),this.handleTransition("addClass",this.attr.pinnedTweetClass).call(this,a,b)},this.handleTransition=function(a,b){return function(c,d){var e=d.id||d.sourceEventData.id,f=findTweet(this.$node,this.attr.tweetItemSelector,e);f[a](b)}},this.confirmPinToggle=function(a,b,c){var d=c.$tweet.hasClass(this.attr.pinnedTweetClass)?"uiNeedUserUnpinTweetConfirm":"uiNeedUserPinTweetConfirm";this.trigger(c.$tweet,d)},this.togglePinnedTweet=function(a,b,c){return c.$tweet.hasClass(this.attr.pinnedTweetClass)?"uiDidUserUnpinTweet":"uiDidUserPinTweet"},this.unblockFromTweetAction=function(a,b){this.trigger("uiCloseDropdowns"),this.trigger("uiUnblockAction",b)},this.openAdsInfoLink=function(a,b){var c="https://business.twitter.com/help/how-twitter-ads-work";window.open(c,"_blank"),this.trigger("uiCloseDropdowns")},this.after("initialize",function(){var a=this.mkTweetDataCollectorForAction(this.interactionDataWithCard);this.on("click",{embedTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsEmbedTweetDialog")),embedVideoSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsEmbedVideoDialog")),copyLinkToTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsCopyLinkToTweetDialog")),openAdsInfoLinkSelector:this.openAdsInfoLink});if(!this.attr.loggedIn)return;this.on("click",{deleteSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiOpenDeleteDialog")),userTogglePinTweetSelector:this.composeHandler(this.getClosestTweet,this.confirmPinToggle),shareViaDMSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiComposeNewDMWithTweet")),curateTweetSelector:this.composeHandler(this.getClosestTweet,a,this.curateTweet),curateToOtherSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiOpenCurateDialog")),curateToNewTimelineSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiOpenCreateCustomTimelineDialog")),removeMediaTagSelector:this.confirmRemoveMediaTag,blockOrReportTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsBlockOrReportDialog")),blockTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsBlockDialog")),unblockTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiDidUnblockFromTweet")),reportTweetSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiNeedsReportDialog"))}),this.on("uiDropdownOpened",this.composeHandler(this.getClosestTweet,this.getCustomTimelines)),this.on("uiUserPinTweetToggleConfirm",this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction(this.togglePinnedTweet.bind(this)))),this.on("uiMediaTagRemoveConfirm",this.composeHandler(this.getClosestTweet,a,this.removeMediaTag)),this.on(document,"uiHasInjectedNewTimeline uiHasInjectedOldTimelineItems uiHasInjectedRangeTimelineItems",this.applyARIAAttrs),this.on(document,"dataGotCustomTimelines",this.renderCustomTimelinesList),this.on(document,"uiNeedUserPinTweetConfirm",this.showConfirmPinDialog),this.on(document,"uiNeedUserUnpinTweetConfirm",this.showConfirmUnPinDialog),this.on(document,"uiDidUnblockFromTweet",this.unblockFromTweetAction),this.on(document,"dataDidUserPinTweet dataDidUserUnpinTweet",this.showUserPinToggledMessage),this.on(document,"dataDidUserPinTweet",this.unpinOtherTweets),this.on(document,"uiDidUserPinTweet dataFailedToUserUnpinTweet",this.handleTransition("addClass",this.attr.pinnedTweetClass)),this.on(document,"uiDidUserUnpinTweet dataFailedToUserPinTweet",this.handleTransition("removeClass",this.attr.pinnedTweetClass)),this.on(document,"dataMediaTagRemoveSuccess",this.handleRemoveMediaTagSuccess),this.on(document,"dataMediaTagRemoveFailure",this.handleRemoveMediaTagFailure)})}var _=require("core/i18n"),defineComponent=require("core/component"),findTweet=require("app/utils/find_tweet"),withDropdownMenu=require("app/ui/with_dropdownmenu"),withInteractionData=require("app/ui/with_interaction_data"),withNavigationLinks=require("app/ui/with_navigation_links_scribing"),withTweetActionsHelper=require("app/ui/with_tweet_actions_helper"),withMomentCuration=require("app/ui/moments/maker/with_moment_curation"),MoreTweetActionsDropdown=defineComponent(moreTweetActionsDropdown,withDropdownMenu,withTweetActionsHelper,withInteractionData,withNavigationLinks,withMomentCuration);module.exports=MoreTweetActionsDropdown
});
define("app/utils/multiline_text_range",["module","require","exports"],function(module, require, exports) {
function MultilineTextRange(a){function c(){var b=document.createRange(),c=a.contents(),d=a.contents().last()[0];return c.length>0&&(b.setStart(c[0],0),b.setEnd(d,g(d))),b}function d(a){return a.nodeType==3||a.nodeType==4}function e(){var a=f(),b=null,c=null,d=null,e=null;for(var g=0;g<a.length;g++){var h=a[g];if(c===null||h.bottom>c)c=h.bottom;if(b===null||h.top<b)b=h.top;if(d===null||h.left<d)d=h.left;if(e===null||h.right>e)e=h.right}return{top:b,bottom:c,left:d,right:e,width:Math.abs(e-d),height:Math.abs(c-b)}}function f(){var a=b.getClientRects(),c=[];for(var d=0;d<a.length;d++)c.push(a[d]);return c.filter(function(a){return a.width>0})}function g(a){return d(a)?a.nodeValue.length:a.childNodes.length}function h(){return a.width()-i()}function i(){var a=e(),b=f(),c=b[b.length-1];return b.length==0?0:c.right-a.left}function j(a){var b=a.match(WORD_BREAKS_REGEX);if(b!==null){var c=b[b.length-1],d=a.lastIndexOf(c);return{startIndex:d,endIndex:d+c.length}}return null}function k(a){return!!a.match(WORD_BREAK_REGEX)}function l(a){return(a.match(CHARS_REGEX)||[]).length}var b=c();this.shortenToVisibleContent=function(){var c=a.contents();for(var e=c.length-1;e>=0;e--){var f=c[e];if(d(f))for(var g=f.nodeValue.length;g>=0;g--){b.setEnd(f,g);if(!this.hasOverflow())return}else{b.setEnd(f,f.childNodes.length);if(!this.hasOverflow())return}}},this.shortenToNearestWordBreak=function(a){var c=b.endContainer,e=a.maxCharsToRemove;if(!d(c)||!c.nodeValue.match(NEW_LINE_ONLY_REGEX)&&(b.endOffset===c.nodeValue.length||k(c.nodeValue[b.endOffset])))return;var f=c.nodeValue.slice(0,b.endOffset),g=j(f);if(g===null)return;if(e!==undefined&&l(f.substring(g.endIndex))>e)return;b.setEnd(c,g.startIndex)},this.ensureLastLineAvailableWidth=function(a){while(h(b)<=a){var c=b.endContainer;if(d(c)&&b.endOffset>1)b.setEnd(c,b.endOffset-1);else{var e=c.previousSibling;if(e===null)break;b.setEnd(e,g(e))}}},this.hasOverflow=function(){var b=e(),c=parseFloat(a.css("line-height"));return Math.round(b.height/c)>Math.round(a.height()/c)},this.toDocumentFragment=function(){return b.cloneContents()},this.setEnd=function(a,c){b.setEnd(a,c)}}var CHARS_REGEX=/([\uD800-\uDBFF][\uDC00-\uDFFF]|[\S\s])/g,WORD_BREAK_REGEX=/\s/,WORD_BREAKS_REGEX=/\s+/g,NEW_LINE_ONLY_REGEX=/^\n$/;module.exports=MultilineTextRange
});
define("app/ui/multiline_ellipses",["module","require","exports","core/component","app/utils/multiline_text_range"],function(module, require, exports) {
function multilineEllipses(){this.defaultAttrs({unEllipsifiedTextClass:"js-ellipsis",unEllipsifiedTextSelector:".js-ellipsis",maxCharsRemoveEnsureEndOnWordBreak:5}),this.after("initialize",function(){if(typeof document.createRange=="undefined")return;this.on(document,"uiSwiftLoaded uiPageChanged uiHasInjectedNewTimeline uiHasInjectedOldTimelineItems uiHasInjectedRangeTimelineItems dataTweetConversationResult uiOverlayUpdate uiTrendsDisplayed uiShowMoreTrends uiCommerceTabToggled",this.addEllipses)}),this.addEllipses=function(){var a=this.select("unEllipsifiedTextSelector").filter(":visible");a.removeClass(this.attr.unEllipsifiedTextClass),a.each(this.addEllipsis.bind(this))},this.addEllipsis=function(a,b){var c=$(b),d=this.createRange(c);if(!d.hasOverflow())return;c.data("full-text",c.text()),d.shortenToVisibleContent(),d.ensureLastLineAvailableWidth(this.maxEllipsisWidth(c)),d.shortenToNearestWordBreak({maxCharsToRemove:this.attr.maxCharsRemoveEnsureEndOnWordBreak});var e=d.toDocumentFragment();e.appendChild(document.createTextNode("…")),c.html(e),this.trigger(c,"uiEllipsisAdded")},this.maxEllipsisWidth=function(a){var b=parseInt(a.css("font-size"));return b*2},this.createRange=function(a){return new MultilineTextRange(a)}}var defineComponent=require("core/component"),MultilineTextRange=require("app/utils/multiline_text_range");module.exports=defineComponent(multilineEllipses)
});
define("app/ui/native_notifications",["module","require","exports","core/component"],function(module, require, exports) {
function nativeNotifications(){this.attributes({defaultDisplayDuration:5e3}),this.displayNotification=function(a,b){if(!b||Notification.permission!=="granted")return;var c=new Notification(b.title,{body:b.body,icon:b.icon,tag:b.tag});this.trigger("uiNativeNotificationTriggered",{type:b.type}),c.onclick=this.clickCallback.bind(this,b.click,b.type),c.onerror=this.errorCallback.bind(this,b.error,b.type),setTimeout(c.close.bind(c),b.displayDuration||this.attr.defaultDisplayDuration)},this.clickCallback=function(a,b){this.trigger("uiNativeNotificationClicked",{type:b}),this.triggerEventWithData(a)},this.errorCallback=function(a,b){this.trigger("uiNativeNotificationError",{type:b}),this.triggerEventWithData(a)},this.triggerEventWithData=function(a){a&&a.eventName&&this.trigger(a.eventName,a.eventData||{})},this.requestPermission=function(){Notification.requestPermission(function(a){switch(a){case"granted":this.trigger("uiNativeNotificationPermissionGranted");break;case"denied":this.trigger("uiNativeNotificationPermissionDenied");break;case"default":this.trigger("uiNativeNotificationPermissionDismissed")}}.bind(this)),this.trigger("uiNativeNotificationPermissionRequested")},this.after("initialize",function(){if(!("Notification"in window))return;this.on("uiRequestNativeNotificationPermission",this.requestPermission),this.on("uiDisplayNativeNotification",this.displayNotification)})}var defineComponent=require("core/component"),NativeNotifications=defineComponent(nativeNotifications);module.exports=NativeNotifications
});
define("app/data/native_notifications_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function nativeNotificationsScribe(){this.after("initialize",function(){this.scribeOnEvent("uiNativeNotificationPermissionGranted",{page:"",section:"",component:"native_notifications",element:"permission",action:"success"}),this.scribeOnEvent("uiNativeNotificationPermissionDenied",{page:"",section:"",component:"native_notifications",element:"permission",action:"failure"}),this.scribeOnEvent("uiNativeNotificationPermissionDismissed",{page:"",section:"",component:"native_notifications",element:"permission",action:"dismiss"}),this.scribeOnEvent("uiNativeNotificationPermissionRequested",{page:"",section:"",component:"native_notifications",element:"permission",action:"impression"}),this.scribeOnEvent("uiNativeNotificationTriggered",{page:"",section:"",component:"native_notifications",element:"notification",action:"show"}),this.scribeOnEvent("uiNativeNotificationClicked",{page:"",section:"",component:"native_notifications",element:"notification",action:"click"}),this.scribeOnEvent("uiNativeNotificationError",{page:"",section:"",component:"native_notifications",element:"notification",action:"error"})})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),NativeNotificationsScribe=defineComponent(nativeNotificationsScribe,withScribe);module.exports=NativeNotificationsScribe
});
define("app/utils/setup_polling_with_backoff",["module","require","exports","core/clock","core/utils"],function(module, require, exports) {
function setupPollingWithBackoff(a,b,c){var d={focusedInterval:3e4,blurredInterval:9e4,backoffFactor:2};c=utils.merge(d,c);var e=clock.setIntervalEvent(a,c.focusedInterval,c.eventData);return $(document).on("uiPageHidden",e.backoff.bind(e,c.blurredInterval,c.backoffFactor)),$(document).on("uiPageVisible",e.cancelBackoff.bind(e)),e}var clock=require("core/clock"),utils=require("core/utils");module.exports=setupPollingWithBackoff
});
define("app/data/notification_listener",["module","require","exports","core/component","app/utils/setup_polling_with_backoff","app/data/notifications"],function(module, require, exports) {
function notificationListener(){this.pollForNotifications=function(a,b){notifications.shouldPoll()&&this.trigger("uiDMPoll")},this.resetDMs=function(a,b){notifications.resetDMState(a,b)},this.notifications=notifications,this.after("initialize",function(){notifications.init(this.attr),this.on(document,"uiResetDMPoll",this.resetDMs),this.on(document,"uiPollForNotifications",this.pollForNotifications),this.timer=setupPollingWithBackoff("uiPollForNotifications")})}var defineComponent=require("core/component"),setupPollingWithBackoff=require("app/utils/setup_polling_with_backoff"),notifications=require("app/data/notifications"),NotificationListener=defineComponent(notificationListener);module.exports=NotificationListener
});
define("app/data/oembed",["module","require","exports","core/component","app/data/with_data","core/utils"],function(module, require, exports) {
function OembedData(){this.requestEmbedCode=function(a,b){var c=this.cacheKeyForOptions(b),d=this.cachedEmbedCodes[c],e=this.receivedEmbedCode.bind(this,b),f=this.failedToReceiveEmbedCode.bind(this,b);if(d){this.receivedEmbedCode(b,d);return}this.get({dataType:"jsonp",url:this.embedCodeUrl(),data:utils.merge({id:b.tweetId},b.data),eventData:{},success:e,error:f})},this.embedCodeUrl=function(){return"//api.twitter.com/1/statuses/oembed.json"},this.receivedEmbedCode=function(a,b){var c=this.cacheKeyForOptions(a);this.cachedEmbedCodes[c]=b,this.trigger("dataOembedSuccess",{options:a,data:b})},this.failedToReceiveEmbedCode=function(a){a.retry?(a.retry=!1,this.trigger("dataOembedRetry",a),this.requestEmbedCode({},a)):this.trigger("dataOembedError",a)},this.cacheKeyForOptions=function(a){return JSON.stringify(a.data)+a.tweetId},this.after("initialize",function(){this.on("uiNeedsOembed",this.requestEmbedCode),this.cachedEmbedCodes={}})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),utils=require("core/utils");module.exports=defineComponent(OembedData,withData)
});
define("app/data/oembed_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function oembedScribe(){this.scribeError=function(a,b){this.scribe({component:"oembed",action:"request_failed"})},this.scribeRetry=function(a,b){this.scribe({component:"oembed",action:"retry"})},this.scribeRequest=function(a,b){this.scribe({component:"oembed",action:"request"},b)},this.scribeSuccess=function(a,b){this.scribe({component:"oembed",action:"success"},b)},this.after("initialize",function(){this.on("dataOembedError",this.scribeError),this.on("dataOembedRetry",this.scribeRetry),this.on("dataOembedRequest",this.scribeRequest),this.on("dataOembedSuccess",this.scribeSuccess)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(oembedScribe,withScribe)
});
define("app/ui/commerce/with_email_confirmation",["module","require","exports","core/i18n"],function(module, require, exports) {
function withEmailConfirmation(){this.defaultAttrs({emailNotConfirmedClass:"email-not-confirmed",confirmDialogOptionData:{titleText:_('E-Mail Adresse best\xe4tigen'),bodyText:_('Um fortzufahren, musst Du erst Deine E-Mail Adresse in Deinen Account-Einstellungen best\xe4tigen.'),cancelText:_('Abbrechen'),submitText:_('Zu den Einstellungen'),action:"CommerceUserWantToVerifyEmail"}}),this.isEmailConfirmedOrHandle=function(a){var b=$(a).closest(this.attr.commerceCardSelector);return b.hasClass(this.attr.emailNotConfirmedClass)?(this.trigger("uiOpenConfirmDialog",this.attr.confirmDialogOptionData),!1):!0},this.goToVerifyEmail=function(){window.location.href="/settings/account"},this.after("initialize",function(){this.on("uiCommerceUserWantToVerifyEmailConfirm",this.goToVerifyEmail)})}var _=require("core/i18n");module.exports=withEmailConfirmation
});
define("app/ui/dialogs/offers_dialog",["module","require","exports","core/component","core/i18n","app/ui/with_dialog","app/ui/with_position","app/ui/commerce/with_email_confirmation","app/utils/with_iframe_height_adjuster"],function(module, require, exports) {
function offersConfirmDialog(){var a;this.defaultAttrs({offersDialogIframeSelector:".offers-card-iframe",offersActionSelector:".OffersCard-offersAction",tweetSelector:".tweet",commerceCardSelector:".OffersCard",top:47,defaultHeight:"600px"}),this.openDialog=function(a,b){var c;b&&b.retweetId?c="/i/redeem/status/"+b.retweetId:b&&b.tweetId&&(c="/i/redeem/status/"+b.tweetId),c&&(this.trigger("uiOffersCardClicked",b),this.select("offersDialogIframeSelector").attr("src",c),this.open())},this.closeDialog=function(a,b){this.select("offersDialogIframeSelector").attr("src","about:blank"),this.select("offersDialogIframeSelector").css("height",this.attr.defaultHeight),this.off(window,"message",this.adjustIframeHeight)},this.adjustIframeHeight=function(a){var b={iframeSelector:this.attr.offersDialogIframeSelector,isQualified:function(a){return a.name&&a.name==="offers"&&a.height}};this.fitIframeHeight(a,b)},this.offersActionClicked=function(b,c){var d=$(c.el).closest(this.attr.tweetSelector);a={tweetId:d.data("tweet-id"),retweetId:d.data("retweet-id"),impressionId:d.data("impression-id"),disclosureType:d.data("disclosure-type")},this.trigger("uiNeedsOffersDialog",a)},this.onSuccess=function(b,c){this.trigger("uiCloseDialog"),this.trigger("uiOffersSaveSuccess",a),setTimeout(function(a){a.trigger("uiShowMessage",{message:_('Angebot genutzt! Die Details der R\xfcckzahlung werden Dir in K\xfcrze per E-Mail zugesandt.')})},200,this)},this.setupMessageListener=function(){this.on(window,"message",this.adjustIframeHeight)},this.after("initialize",function(){this.on("uiDialogOpened",this.setupMessageListener),this.on("uiDialogClosed",this.closeDialog),this.on(document,"uiOffersSaveComplete",this.onSuccess),this.on("uiNeedsOffersDialog",this.openDialog),this.on(document,"click",{offersActionSelector:this.offersActionClicked})})}var defineComponent=require("core/component"),_=require("core/i18n"),withDialog=require("app/ui/with_dialog"),withPosition=require("app/ui/with_position"),withEmailConfirmation=require("app/ui/commerce/with_email_confirmation"),withIframeHeightAdjuster=require("app/utils/with_iframe_height_adjuster"),OffersConfirmDialog=defineComponent(offersConfirmDialog,withDialog,withPosition,withIframeHeightAdjuster,withEmailConfirmation);module.exports=OffersConfirmDialog
});
define("app/ui/page_title",["module","require","exports","core/component"],function(module, require, exports) {
function pageTitle(){this.addCount=function(a,b){this.trigger(document,{type:"uiUpdatePageCount",defaultBehavior:this.updateCount.bind(this,b)})},this.updateCount=function(a){a.count&&(document.title="("+a.count+") "+this.title)},this.removeCount=function(a,b){document.title=this.title},this.setTitle=function(a,b){var c=b||a.originalEvent.state;c&&c.title&&(document.title=this.title=c.title)},this.after("initialize",function(){this.title=document.title,this.on("uiAddPageCount",this.addCount),this.on("uiHasInjectedNewTimeline",this.removeCount),this.on(document,"uiBeforePageChanged uiUpdatePageTitle",this.setTitle)})}var defineComponent=require("core/component"),PageTitle=defineComponent(pageTitle);module.exports=PageTitle
});
define("app/ui/page_visibility",["module","require","exports","core/clock","core/component"],function(module, require, exports) {
function PageVisibility(){this.defaultAttrs({heartBeat:0,doc:document,isIe:$.browser.msie});var a,b=!1;this.visibilityChange=function(c){var d;switch(c.type){case"focus":case"focusin":d=!1;break;case"blur":case"focusout":d=!0;break;case"beforeunload":case"uiBeforeUnload":this.trigger("uiPageUnload");break;default:a&&(d=this.attr.doc[a])}d===!0?(b=!0,this.trigger("uiPageHidden")):d===!1&&(b=!1,this.trigger("uiPageVisible"))},this.focusTick=function(){b||this.trigger("uiPageVisible")},this.after("initialize",function(){var b={hidden:"visibilitychange",mozHidden:"mozvisibilitychange",webkitHidden:"webkitvisibilitychange",msHidden:"msvisibilitychange"},c=!1;for(var d in b)d in this.attr.doc&&(a=d,this.on(this.attr.doc,b[a],this.visibilityChange),c=!0);c||(this.attr.isIe?this.on(this.attr.doc,"focusin focusout",this.visibilityChange):this.on(window,"focus focusin blur focusout",this.visibilityChange)),this.on(window,"beforeunload uiBeforeUnload",this.visibilityChange),this.attr.heartBeat&&(this.timer=clock.setIntervalEvent("uiPageFocusTick",this.attr.heartBeat),this.on("uiPageFocusTick",this.focusTick))})}var clock=require("core/clock"),defineComponent=require("core/component");module.exports=defineComponent(PageVisibility)
});
define("app/ui/dialogs/payment_order_dialog",["module","require","exports","core/component","app/ui/with_dialog"],function(module, require, exports) {
function paymentsOrderDialog(){this.defaultAttrs({isLoadingClass:"PaymentOrderDialog-isLoading",isLoadedClass:"PaymentOrderDialog-isLoaded",isFailedClass:"PaymentOrderDialog-isFailed",containerSelector:".PaymentOrderDialog-orderDetails",spinnerSelector:".spinner-bigger",errorAlertSelector:".alert"}),this.setLoading=function(){this.select("modalBodySelector").addClass(this.attr.isLoadingClass).removeClass(this.attr.isLoadedClass).removeClass(this.attr.isFailedClass)},this.setLoaded=function(){this.select("modalBodySelector").removeClass(this.attr.isLoadingClass).addClass(this.attr.isLoadedClass).removeClass(this.attr.isFailedClass)},this.setFailed=function(){this.select("modalBodySelector").removeClass(this.attr.isLoadingClass).removeClass(this.attr.isLoadedClass).addClass(this.attr.isFailedClass)},this.openDialog=function(a,b){this.setLoading(),this.open(),this.trigger("uiShowPaymentOrderDetail",{orderId:b.orderId})},this.populateDialog=function(a,b){this.setLoaded(),this.select("modalBodySelector").addClass(this.attr.isLoadedClass),this.select("containerSelector").html(b.html),this.position()},this.after("initialize",function(){this.on(document,"uiRequestPaymentOrderDetail",this.openDialog),this.on(document,"dataCommercePaymentOrderDetailFetched",this.populateDialog),this.on(document,"dataCommercePaymentOrderDetailFetchFailed",this.setFailed)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),PaymentsOrderDialog=defineComponent(paymentsOrderDialog,withDialog);module.exports=PaymentsOrderDialog
});
define("app/data/with_perftown_scribe",["module","require","exports","app/data/scribe_transport","app/utils/time"],function(module, require, exports) {
function withPerftownScribe(){this.scribeTransport=scribeTransport,this.scribePerftown=function(a,b,c){var d={product:"webclient",description:a,duration_ms:b,start_time_ms:this.startTime,metadata:JSON.stringify(c)};this.scribeTransport.send(d,"perftown")},this.after("initialize",function(){this.startTime=time.now()})}var scribeTransport=require("app/data/scribe_transport"),time=require("app/utils/time");module.exports=withPerftownScribe
});
define("app/data/performance_stats_scribe",["module","require","exports","core/component","app/data/with_perftown_scribe","app/data/user_info","app/utils/browser"],function(module, require, exports) {
function PerformanceStatsScribe(){this.scribeAjaxDuration=function(a,b){if(!b.statsName)throw new Error("statsName is required for stats logging.");var c=["stats","ajax","perf",b.statsName];b.statsSubcategory&&c.push(b.statsSubcategory);var d=b.requestData||{};d.interval?c.push("polling"):d.min_position?c.push("newer"):d.max_position&&c.push("older"),b.status&&c.push(b.status);var e=c.join(":"),f={url:b.url,browser:browser($.browser),response_size:(b.responseText||{}).length};this.scribePerftown(e,b.duration,f)},this.after("initialize",function(){userInfo.getDecider("web_perftown_stats")&&this.on("dataAjaxDuration",this.scribeAjaxDuration)})}var defineComponent=require("core/component"),withPerftownScribe=require("app/data/with_perftown_scribe"),userInfo=require("app/data/user_info"),browser=require("app/utils/browser");module.exports=defineComponent(PerformanceStatsScribe,withPerftownScribe)
});
define("app/data/lists",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function listsData(){this.listMembershipContent=function(a,b){this.get({url:"/i/"+b.userId+"/lists",dataType:"json",data:{},eventData:b,success:"dataGotListMembershipContent",error:"dataFailedToGetListMembershipContent"})},this.addUserToList=function(a,b){this.post({url:"/i/"+b.userId+"/lists/"+b.listId+"/members",dataType:"json",data:{},eventData:b,success:"dataDidAddUserToList",error:"dataFailedToAddUserToList"})},this.removeUserFromList=function(a,b){this.destroy({url:"/i/"+b.userId+"/lists/"+b.listId+"/members",dataType:"json",data:{},eventData:b,success:"dataDidRemoveUserFromList",error:"dataFailedToRemoveUserFromList"})},this.createList=function(a,b){this.post({url:"/i/lists/create",dataType:"json",data:b,eventData:b,success:"dataDidCreateList",error:"dataFailedToCreateList"})},this.after("initialize",function(){this.on("uiNeedsListMembershipContent",this.listMembershipContent),this.on("uiAddUserToList",this.addUserToList),this.on("uiRemoveUserFromList",this.removeUserFromList),this.on("uiCreateList",this.createList)})}var defineComponent=require("core/component"),withData=require("app/data/with_data");module.exports=defineComponent(listsData,withData)
});
define("app/data/profile_edit_btn_scribe",["module","require","exports","core/component","core/utils","app/data/with_scribe"],function(module, require, exports) {
function profileEditBtnScribe(){this.defaultAttrs({editButtonSelector:".edit-profile-btn",scribeContext:{}}),this.scribeAction=function(a){var b=utils.merge(this.attr.scribeContext,{action:a});return function(a,c){b.element=$(a.target).attr("data-scribe-element"),this.scribe(b)}},this.after("initialize",function(){this.on("click",{editButtonSelector:this.scribeAction("click")})})}var defineComponent=require("core/component"),utils=require("core/utils"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(profileEditBtnScribe,withScribe)
});
define("app/ui/with_hover_card",["module","require","exports","core/compose","app/ui/with_position"],function(module, require, exports) {
function withHoverCard(){compose.mixin(this,[withPosition]),this.defaultAttrs({hoverContentSelector:".hovercard",hoverContainerClasses:"hovercard",showDelay:600,hideDelay:100}),this.prepareHover=function(a){this.currentKey!==a&&this.forceHide(!1),this.openTimer=setTimeout(this.timerSaysOK.bind(this),this.attr.showDelay)},this.timerSaysOK=function(){this.okToOpen=!0,this.queuedOpen&&this.queuedOpen()},this.showHTML=function(a,b,c,d){d=d||{},d.id=a;if(this.currentKey==a&&this.timeout){clearTimeout(this.timeout),this.timeout=null;return}if(!this.okToOpen){this.queuedOpen=function(){this.showHTML(a,b,c,d)};return}this.queuedOpen=null,this.forceHide(),this.currentKey=a,this.$hoverContent=$(b),this.$hoverContent.addClass(this.attr.hoverContainerClasses),this.$node.html(this.$hoverContent),this.pos=this.adjacent(this.$node,$(c),{gravity:"vertical"}),this.$hoverContent.addClass("gravity-"+this.pos.gravity),this.$hoverContent.addClass("weight-"+this.pos.weight),this.pos.gravity=="south"&&(this.pos.top-=10),this.$node.css({top:this.pos.top,left:this.pos.left});var e=function(){var a=this.pos.top,b=this.pos.top+(this.pos.gravity=="north"?20:-20);this.$node.css({top:b,opacity:0}),this.$node.show(),this.$node.animate({top:a,opacity:1},150,"easeOutQuad"),this.trigger("uiHoverShown",d)}.bind(this),f=this.$hoverContent.find("img.banner");f.length>0?f.load(e):e()},this.forceHide=function(a){if(this.currentKey===null&&!a)return;this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.openTimer&&(clearTimeout(this.openTimer),this.openTimer=null),this.currentKey=null,this.$hoverContent&&this.$node.fadeOut({duration:100,complete:function(){this.$hoverContent&&(this.$hoverContent.remove(),this.$hoverContent=null)}.bind(this),easing:"easeOutQuad"})},this.hide=function(){this.okToOpen=!1,this.queuedOpen=null,clearTimeout(this.openTimer),this.openTimer=null,this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.forceHide.bind(this,!1),this.attr.hideDelay)},this.mouseOverContent=function(){if(this.timeout){clearTimeout(this.timeout),this.timeout=null;return}},this.after("initialize",function(){this.on(document,"uiOverlayNavigate uiBeforePageChanged uiShortcutEsc",this.forceHide.bind(this,!0)),this.on(document,"mouseover",{hoverContentSelector:this.mouseOverContent}),this.on(document,"mouseout",{hoverContentSelector:this.hide}),$.extend($.easing,{def:"easeOutQuad",easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}})})}var compose=require("core/compose"),withPosition=require("app/ui/with_position");module.exports=withHoverCard
});
define("app/ui/profile_hovercard",["module","require","exports","core/component","app/utils/cookie","app/ui/with_hover_card","app/ui/with_user_actions","app/ui/navigation_links"],function(module, require, exports) {
function profileHovercard(){this.defaultAttrs({excludedContainerSelector:".modal-container, .Gallery, .ProfileCard",profileLinkSelector:"a.profile-picture, .fullname a",itemType:"user",subTargetClass:".username"}),this.openProfileHover=function(a,b){if(cookie("disable_profile_hovers")=="true")return;b.screenName&&delete b.userId;if(this.skipScreenName&&b.screenName&&b.screenName.toLowerCase()==this.skipScreenName.toLowerCase()||this.skipUserId&&b.userId==this.skipUserId)return;b.isHoverRequest=!0;if(a.target&&$(a.target).closest(this.attr.excludedContainerSelector).length>0)return;this.refEventData=b,this.refEl=$(a.target).find(this.attr.subTargetClass)[0]||a.target,this.lastRequested=b.screenName?b.screenName.toLowerCase():b.userId,this.prepareHover(this.lastRequested),this.$node.attr("data-associated-tweet-id",b.tweetId||null),this.$node.attr("data-impression-id",b.impressionId||null),this.$node.attr("data-disclosure-type",b.disclosureType||null),this.$node.attr("data-impression-cookie",b.impressionCookie||null),this.trigger("uiWantsProfilePopup",b)},this.dataAvailable=function(a,b){if((!b.screen_name||this.lastRequested!=b.screen_name.toLowerCase())&&this.lastRequested!=b.user_id)return;this.$node.attr("data-screen-name",b.screen_name||null),this.$node.attr("data-user-id",b.user_id||null),$html=$(b.html),$html.find("a[href^='/"+b.screen_name+"']").attr("data-send-impression-cookie","true"),this.showHTML(b.user_id,$html,$(this.refEl),this.refEventData)},this.after("initialize",function(a,b){NavigationLinks.attachTo(this.$node,{eventData:{scribeContext:{component:"profile_hover"}}}),b.profile_user&&(this.skipScreenName=b.profile_user.screen_name,this.skipUserId=b.profile_user.id_str),this.on(document,"dataProfilePopupSuccess",this.dataAvailable),this.on(document,"uiShowProfileHover",this.openProfileHover),this.on(document,"uiHideProfileHover",this.hide)})}var defineComponent=require("core/component"),cookie=require("app/utils/cookie"),withHoverCard=require("app/ui/with_hover_card"),withUserActions=require("app/ui/with_user_actions"),NavigationLinks=require("app/ui/navigation_links"),ProfileHovercard=defineComponent(profileHovercard,withHoverCard,withUserActions);module.exports=ProfileHovercard
});
define("app/ui/with_profile_stats",["module","require","exports"],function(module, require, exports) {
function withProfileStats(){this.defaultAttrs({}),this.updateProfileStats=function(a,b){if(!b.stats||!b.stats.length)return;$.each(b.stats,function(a,b){var c=this.statNode(b.user_id,b.stat);this.isCompact(c)||c.html(b.html)}.bind(this))},this.statSelector=function(a,b){return'.stats[data-user-id="'+a+'"] a[data-element-term="'+b+'_stats"]'},this.statNode=function(a,b){return this.$node.find(this.statSelector(a,b))},this.isCompact=function(a){return a.data("is-compact")===!0},this.after("initialize",function(){this.on(document,"dataGotProfileStats",this.updateProfileStats)})}module.exports=withProfileStats
});
define("app/ui/with_handle_overflow",["module","require","exports"],function(module, require, exports) {
function withHandleOverflow(){this.defaultAttrs({heightOverflowClassName:"height-overflow"}),this.checkForOverflow=function(a){a=a||this.$node;if(!a||!a.length)return;a[0].scrollHeight>a.height()?a.addClass(this.attr.heightOverflowClassName):a.removeClass(this.attr.heightOverflowClassName)}}module.exports=withHandleOverflow
});
define("app/ui/profile_popup",["module","require","exports","core/component","app/ui/with_dialog","app/ui/with_user_actions","app/ui/with_item_actions","app/ui/with_profile_stats","app/ui/with_handle_overflow"],function(module, require, exports) {
function profilePopup(){this.defaultAttrs({dialogContentSelector:".profile-modal",profileHeaderInnerSelector:".profile-header-inner",socialProofSelector:".social-proof",locationSelector:".location a",slideDuration:100,top:47,bottom:10,tweetMinimum:2,itemType:"user"}),this.slideInContent=function(a){var b=this.$dialog.height(),c=$(a);this.addHeaderImage(c),this.$contentContainer.html(c),this.$node.addClass("has-content"),this.removeTweets();var d=this.$dialog.height();this.$dialog.height(b),this.$dialog.animate({height:d},this.attr.slideDuration,this.slideInComplete.bind(this))},this.removeTweets=function(){var a=this.select("tweetSelector");for(var b=a.length-1;b>this.attr.tweetMinimum-1;b--){if(!this.isTooTall())return;a.eq(b).remove()}},this.getWindowHeight=function(){return $(window).height()},this.isTooTall=function(){return this.$dialog.height()+this.attr.top+this.attr.bottom>this.getWindowHeight()},this.addHeaderImage=function(a){var b=a.find(this.attr.profileHeaderInnerSelector);b.hasClass("no-image")?b.css("background-color",b.attr("data-background-color")):b.css("background-image",b.attr("data-background-image"))},this.slideInComplete=function(){this.checkForOverflow(this.select("profileHeaderInnerSelector")),this.trigger(this.$dialog,"uiDialogContentChanged")},this.clearPopup=function(){this.$dialog.height("auto"),this.$node.removeClass("muting"),this.$contentContainer.empty()},this.openProfilePopup=function(a,b){b.screenName&&delete b.userId;if(b.userId&&b.userId===this.currentUserId()||b.screenName&&b.screenName===this.currentScreenName())return;this.open(),this.clearPopup(),this.$node.removeClass("has-content"),this.$node.attr("data-associated-tweet-id",b.tweetId||null),this.$node.attr("data-impression-id",b.impressionId||null),this.$node.attr("data-disclosure-type",b.disclosureType||null),this.$node.attr("data-impression-cookie",b.impressionCookie||null),this.trigger("uiWantsProfilePopup",b)},this.closeProfilePopup=function(a){this.clearPopup(),this.trigger("uiCloseProfilePopup",{userId:this.currentUserId(),screenName:this.currentScreenName()})},this.fillProfile=function(a,b){this.$node.attr("data-screen-name",b.screen_name||null),this.$node.attr("data-user-id",b.user_id||null),this.slideInContent(b.html)},this.removeSocialProof=function(a,b){this.select("socialProofSelector").remove()},this.addSocialProof=function(a,b){b.html?(this.select("socialProofSelector").html(b.html),this.trigger("uiHasPopupSocialProof")):this.removeSocialProof()},this.showError=function(a,b){var c=['<div class="profile-modal-header error"><p>',b.message,"</p></div>"].join("");this.slideInContent(c)},this.getPopupData=function(a){return!this.isOpen()||!this.$node.hasClass("has-content")?null:this.$node.attr(a)},this.currentScreenName=function(){return this.getPopupData("data-screen-name")},this.currentUserId=function(){return this.getPopupData("data-user-id")},this.locationClicked=function(a,b){var c=$(a.target),d=c.data("place-id"),e={scribeData:{message:d}};this.trigger("uiPopupLocationClicked",e)},this.after("initialize",function(){this.$contentContainer=this.select("dialogContentSelector"),this.on(document,"uiShowProfilePopup",this.openProfilePopup),this.on(document,"dataProfilePopupSuccess",this.fillProfile),this.on(document,"dataProfilePopupFailure",this.showError),this.on(document,"dataSocialProofSuccess",this.addSocialProof),this.on(document,"dataSocialProofFailure",this.removeSocialProof),this.on(document,"uiOpenConfirmDialog uiNeedsBlockOrReportDialog uiNeedsBlockDialog uiNeedsReportDialog uiOpenTweetDialog uiNeedsDMDialog uiListAction uiOpenSignupDialog uiEmbedProfileAction",this.close),this.on("uiDialogClosed",this.closeProfilePopup),this.on("click",{locationSelector:this.locationClicked})})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withUserActions=require("app/ui/with_user_actions"),withItemActions=require("app/ui/with_item_actions"),withProfileStats=require("app/ui/with_profile_stats"),withHandleOverflow=require("app/ui/with_handle_overflow"),ProfilePopup=defineComponent(profilePopup,withDialog,withUserActions,withItemActions,withProfileStats,withHandleOverflow);module.exports=ProfilePopup
});
define("app/data/profile_popup",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function profilePopupData(){this.defaultAttrs({hoverFetchDelay:100,noShowError:!0,statsName:"swift_profile_popup"}),this.userCache={screenNames:Object.create(null),ids:Object.create(null)},this.socialProofCache={screenNames:Object.create(null),ids:Object.create(null)},this.saveToCache=function(a,b){a.ids[b.user_id]=b,a.screenNames[b.screen_name]=b},this.retrieveFromCache=function(a,b){var c;return b.userId?c=a.ids[b.userId]:b.user_id?c=a.ids[b.user_id]:b.screenName?c=a.screenNames[b.screenName]:b.screen_name&&(c=a.screenNames[b.screen_name]),c},this.invalidateCaches=function(a,b){var c,d,e;b.userId?(c=b.userId,e=this.userCache.ids[c],d=e&&e.screen_name):(d=b.screenName,e=this.userCache.screenNames[d],c=e&&e.user_id),c&&delete this.userCache.ids[c],c&&delete this.socialProofCache.ids[c],d&&delete this.userCache.screenNames[d],d&&delete this.socialProofCache.screenNames[d]},this.getProfilePopupMain=function(a,b){var c=function(a){this.saveToCache(this.userCache,a),this.trigger("dataProfilePopupSuccess",a);var b=this.retrieveFromCache(this.socialProofCache,a);b&&this.trigger("dataSocialProofSuccess",b)}.bind(this),d=function(a){this.trigger("dataProfilePopupFailure",a)}.bind(this),e=this.retrieveFromCache(this.userCache,a);if(e){e.sourceEventData=a,c(e);return}var f=function(){this.pendingRemoteRequest=null,this.get({url:"/i/profiles/popup",data:b,eventData:a,cache:!1,success:c,error:d})}.bind(this);b.wants_hovercard?this.pendingRemoteRequest=setTimeout(f,this.attr.hoverFetchDelay):f()},this.getProfilePopup=function(a,b){var c={};b.screenName?c.screen_name=b.screenName:b.userId&&(c.user_id=b.userId),b.isHoverRequest&&(c.wants_hovercard=!0),this.getProfilePopupMain(b,c)},this.hideProfileHover=function(){this.pendingRemoteRequest&&(clearTimeout(this.pendingRemoteRequest),this.pendingRemoteRequest=null)},this.after("initialize",function(){this.on("uiWantsProfilePopup",this.getProfilePopup),this.on("uiHideProfileHover",this.hideProfileHover),this.on(document,"dataFollowStateChange dataUserActionSuccess dataDidMuteUser dataDidUnmuteUser",this.invalidateCaches)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),ProfilePopupData=defineComponent(profilePopupData,withData);module.exports=ProfilePopupData
});
define("app/data/profile_popup_scribe",["module","require","exports","core/component","core/utils","app/data/with_interaction_data_scribe","app/data/client_event"],function(module, require, exports) {
function profilePopupScribe(){this.defaultAttrs({scribeContext:{component:"profile_hover"}}),this.scribeProfilePopupOpen=function(a,b){if(!b.isHoverRequest)return;b.user_id=b.user_id||$(a.target).attr("data-user-id");if(["profile","me"].indexOf(this.clientEvent.scribeContext.page)===-1||!this.clientEvent.scribeData.profile_id)this.clientEvent.scribeData.profile_id=b.user_id;var c=utils.merge(this.attr.scribeContext,{action:"open"});this.scribeInteraction(c,b)},this.cleanupProfilePopupScribing=function(a,b){this.clientEvent.scribeData.profile_id&&["profile","me"].indexOf(this.clientEvent.scribeContext.page)===-1&&delete this.clientEvent.scribeData.profile_id},this.after("initialize",function(){this.clientEvent=clientEvent,this.on(document,"uiHideProfileHover",this.cleanupProfilePopupScribing),this.on(document,"uiHoverShown",this.scribeProfilePopupOpen)})}var defineComponent=require("core/component"),utils=require("core/utils"),withInteractionDataScribe=require("app/data/with_interaction_data_scribe"),clientEvent=require("app/data/client_event");module.exports=defineComponent(profilePopupScribe,withInteractionDataScribe)
});
define("app/data/user",["module","require","exports","core/component","core/utils","app/utils/cookie","app/data/with_data"],function(module, require, exports) {
function userData(){this.defaultAttrs({urlToActionMap:{"/i/user/follow":"follow","/i/user/unfollow":"unfollow","/i/user/block":"block","/i/user/unblock":"unblock","/i/user/hide":"dismiss"},millisecInDay:864e5,ageGateingErrorCode:250,ageGateCookieKey:"age-gated"}),this.hasBeenAgeGatedWithin24Hr=function(){var a=cookie(this.attr.ageGateCookieKey);return a?(new Date).getTime()-parseInt(a,10)<this.attr.millisecInDay:!1},this.getUserAction=function(a){return this.attr.urlToActionMap[a]},this.updateFollowStatus=function(a,b){function c(c){c.message&&this.trigger("uiShowMessage",c),this.trigger("dataFollowStateChange",utils.merge(c,a,{userId:a.userId,newState:c.new_state,requestUrl:b,isFollowBack:c.is_follow_back,action:this.getUserAction(b)})),this.trigger(document,"dataGotProfileStats",{stats:c.profile_stats})}function d(c){var d=a.userId,e=a.originalFollowState,f=c&&c.data&&c.data.code==this.attr.ageGateingErrorCode;c.new_state&&(e=c.new_state),this.trigger("dataFollowStateChange",utils.merge(c,{userId:d,newState:e,action:this.getUserAction(b)})),f&&this.trigger("uiNeedsAgeGateDialog",{originalData:a,newState:e,ageGated:this.hasBeenAgeGatedWithin24Hr(),minBirthDate:parseInt(c.data.timestamp,10)})}var e=a.disclosureType?a.disclosureType=="earned":undefined,f={user_id:a.userId,impression_id:a.impressionId,earned:e,fromShortcut:a.fromShortcut,handles_challenges:1};a.lifeline&&(f.lifeline=1),f.challenges_passed=!!a.passedAgeGating,this.post({url:b,data:f,eventData:a,success:c.bind(this),error:d.bind(this),retryIfUnavailable:!0})},this.reversibleAjaxCall=function(a,b,c){function d(c){this.trigger("dataUserActionSuccess",$.extend({},c,{userId:a.userId,requestUrl:b,action:this.getUserAction(b)})),c.message&&this.trigger("uiShowMessage",c)}function e(b){this.trigger(c,a)}this.post({url:b,data:{user_id:a.userId,impression_id:a.impressionId},eventData:a,success:d.bind(this),error:e.bind(this)})},this.normalAjaxCall=function(a,b,c){function d(c){this.trigger("dataUserActionSuccess",$.extend({},c,{userId:a.userId,requestUrl:b,action:this.getUserAction(b)})),c.message&&this.trigger("uiShowMessage",c)}var e=$.extend({user_id:a.userId,token:a.feedbackToken,impression_id:a.impressionId},c);this.post({url:b,data:e,eventData:a,success:d.bind(this),error:"dataUserActionError"})},this.followAction=function(a,b){var c="/i/user/follow";this.updateFollowStatus(b,c)},this.unfollowAction=function(a,b){var c="/i/user/unfollow";this.updateFollowStatus(b,c)},this.cancelAction=function(a,b){var c="/i/user/cancel";this.updateFollowStatus(b,c)},this.blockAction=function(a,b){var c="/i/user/block";this.updateFollowStatus(b,c)},this.unblockAction=function(a,b){var c="/i/user/unblock";this.updateFollowStatus(b,c)},this.reportSpamAction=function(a,b){this.normalAjaxCall(b,"/i/user/report_spam",{screen_name:b.screenName,report_type:b.reportType,block_user:b.blockUser,impression_id:b.impressionId})},this.hideSuggestionAction=function(a,b){this.normalAjaxCall(b,"/i/user/hide")},this.retweetOnAction=function(a,b){this.reversibleAjaxCall(b,"/i/user/retweets_on","dataRetweetOffAction")},this.retweetOffAction=function(a,b){this.reversibleAjaxCall(b,"/i/user/retweets_off","dataRetweetOnAction")},this.deviceNotificationsOnAction=function(a,b){this.reversibleAjaxCall(b,"/i/user/device_notifications_on","dataDeviceNotificationsOffAction")},this.deviceNotificationsOffAction=function(a,b){this.reversibleAjaxCall(b,"/i/user/device_notifications_off","dataDeviceNotificationsOnAction")},this.after("initialize",function(){this.on(document,"uiFollowAction",this.followAction),this.on(document,"uiUnfollowAction",this.unfollowAction),this.on(document,"uiCancelFollowRequestAction",this.cancelAction),this.on(document,"uiBlockAction",this.blockAction),this.on(document,"uiUnblockAction",this.unblockAction),this.on(document,"uiReportSpamAction uiReportUserAction",this.reportSpamAction),this.on(document,"uiHideSuggestionAction",this.hideSuggestionAction),this.on(document,"uiRetweetOnAction",this.retweetOnAction),this.on(document,"uiRetweetOffAction",this.retweetOffAction),this.on(document,"uiDeviceNotificationsOnAction",this.deviceNotificationsOnAction),this.on(document,"uiDeviceNotificationsOffAction",this.deviceNotificationsOffAction),this.on(document,"uiAgeGatePassed",this.followAction)})}var defineComponent=require("core/component"),utils=require("core/utils"),cookie=require("app/utils/cookie"),withData=require("app/data/with_data"),UserData=defineComponent(userData,withData);module.exports=UserData
});
define("app/data/commerce/discovery_profile_cta_scribe",["module","require","exports","core/component","app/utils/scribe_item_types","core/utils","app/data/with_scribe"],function(module, require, exports) {
function discoveryProfileCtaScribe(){this.defaultAttrs({popupCommerceButtonSelector:".CommerceDiscoveryProfileButton",fullCommerceButtonSelector:".CommerceDiscovery-profileButton",fullCommerceImageSelector:".CommerceDiscovery-image",commerceCtaSelector:".js-commerce-cta",scribeContext:{}}),this.getCommerceCollectionItem=function(a){var b=a.data("collection-id");return{id:b,item_type:itemTypes.customTimeline,token:"commerce_collection"}},this.scribeCommercePopupImpression=function(){var a=this.select("popupCommerceButtonSelector");if(a.length>0){var b={items:[this.getCommerceCollectionItem(a)]};this.scribe(utils.merge(this.attr.scribeContext,{element:"commerce",action:"impression"}),b)}},this.scribeCommerceClick=function(a,b){var c=$(a.target).closest(this.attr.commerceCtaSelector),d=c.data("scribe-element");if(d){var e={items:[this.getCommerceCollectionItem(c)]};this.scribe(utils.merge(this.attr.scribeContext,{element:d,action:"click"}),e)}},this.after("initialize",function(){this.on(document,"dataProfilePopupSuccess",this.scribeCommercePopupImpression),this.on("click",this.scribeCommerceClick)})}var defineComponent=require("core/component"),itemTypes=require("app/utils/scribe_item_types"),utils=require("core/utils"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(discoveryProfileCtaScribe,withScribe)
});
define("app/boot/profile_popup",["module","require","exports","app/data/lists","app/data/profile_edit_btn_scribe","app/ui/profile_hovercard","app/ui/profile_popup","app/data/profile_popup","app/data/profile_popup_scribe","app/data/user","core/utils","app/data/commerce/discovery_profile_cta_scribe"],function(module, require, exports) {
function initialize(a){ProfileHovercard.attachTo("#profile-hover-container",utils.merge(a,{eventData:{scribeContext:{component:"profile_hover"}}})),ProfilePopupData.attachTo(document,utils.merge(a,{eventData:{scribeContext:{component:"profile_dialog"}}})),UserData.attachTo(document,a),Lists.attachTo(document,a),ProfilePopup.attachTo("#profile_popup",utils.merge(a,{eventData:{scribeContext:{component:"profile_dialog"}}})),ProfileEditBtnScribe.attachTo("#profile_popup",{scribeContext:{component:"profile_dialog"}}),CommerceDiscoveryCtaScribe.attachTo("#profile_popup",utils.merge(a,{scribeContext:{component:"profile_dialog"}})),ProfilePopupScribe.attachTo(document,a)}var Lists=require("app/data/lists"),ProfileEditBtnScribe=require("app/data/profile_edit_btn_scribe"),ProfileHovercard=require("app/ui/profile_hovercard"),ProfilePopup=require("app/ui/profile_popup"),ProfilePopupData=require("app/data/profile_popup"),ProfilePopupScribe=require("app/data/profile_popup_scribe"),UserData=require("app/data/user"),utils=require("core/utils"),CommerceDiscoveryCtaScribe=require("app/data/commerce/discovery_profile_cta_scribe"),hasPopup=$("#profile_popup").length>0;module.exports=hasPopup?initialize:$.noop
});
define("app/ui/profile/profile_navigation",["module","require","exports","core/component"],function(module, require, exports) {
function profileNavigation(){this.defaultAttrs({currentUserPath:""}),this.navigateToProfilePath=function(){this.trigger("uiNavigate",{href:this.attr.currentUserPath})},this.after("initialize",function(){this.on("uiNavigateToProfile",this.navigateToProfilePath)})}var component=require("core/component"),ProfileNavigation=component(profileNavigation);module.exports=ProfileNavigation
});
define("app/data/promptbird/promptbird",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function promptbirdData(){this.postFunction=function(a,b,c,d,e){var f={prompt_id:e.prompt_id};this.post({url:"/i/users/prompts/"+a,eventData:f,data:f,success:b,error:c})},this.after("initialize",function(){this.on("uiPromptbirdDismissPrompt",this.postFunction.bind(this,"dismiss","dataPromptbirdPromptDismissed","dataPromptbirdPromptDismissalError")),this.on("uiPromptbirdClick",this.postFunction.bind(this,"click","dataPromptbirdPromptClicked","dataPromptbirdPromptClickError")),this.on("uiPromptbirdPromptWasShown uiInlinePromptScrolledIn",this.postFunction.bind(this,"impress","dataPromptbirdPromptImpressed","dataPromptbirdPromptImpressError")),this.on("uiPromptbirdPromptWasShown uiInlinePromptScrolledIn","uiItemsInjected")})}var defineComponent=require("core/component"),withData=require("app/data/with_data");module.exports=defineComponent(promptbirdData,withData)
});
define("app/data/promptbird/promptbird_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function promptbirdScribe(){this.after("initialize",function(){this.scribeOnEvent("uiPromptbirdPromptWasShown",{action:"impression"}),this.scribeOnEvent("uiInlinePromptScrolledIn",{action:"impression"}),this.scribeOnEvent("uiPromptbirdClick",{action:"click"}),this.scribeOnEvent("uiPromptbirdDismissPrompt",{action:"dismiss"}),this.scribeOnEvent("uiPromptbirdPreviewPromotedAccount",{action:"preview"}),this.scribeOnEvent("uiShowDashboardProfilePromptbird",{action:"show"})})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(promptbirdScribe,withScribe)
});
define("app/ui/promptbird/with_promptbird_user_actions",["module","require","exports"],function(module, require, exports) {
function promptbirdUserActions(){this.renderActionPrompt=function(a,b,c){this.renderDelayedPromptForAction(c.sourceEventData.id,a)},this.renderDelayedPromptForAction=function(a,b){var c=this.getDelayedPromptForAction(b);c&&(c.pointerTweetId=a,this.renderPrompt(c))},this.getDelayedPromptForAction=function(a){var b=this.attr.delayedPrompts.filter(function(b){return b.trigger==a})[0];if(b){var c=this.attr.delayedPrompts.indexOf(b);this.attr.delayedPrompts.splice(c,1)}return b},this.after("initialize",function(){this.on(document,"dataDidRetweet",this.renderActionPrompt.bind(this,"retweet")),this.on(document,"dataDidFavoriteTweet",this.renderActionPrompt.bind(this,"favorite"))})}module.exports=promptbirdUserActions
});
define("app/ui/promptbird/promptbird_manager",["module","require","exports","core/component","app/ui/promptbird/with_promptbird_user_actions"],function(module, require, exports) {
function promptbirdManager(){this.defaultAttrs({delayedPrompts:[],tweetItemSelector:'.js-stream-item[data-item-type="tweet"]:visible',originalTweetSelector:".js-original-tweet",promotedTweetClass:"promoted-tweet",immediateTriggers:[]}),this.initPage=function(){this.trigger("uiPromptbirdManagerWantsPrompts",{tweetIds:this.getTweetIds()})},this.renderImmediatePrompts=function(a){var b=a.filter(function(a){return this.shouldRenderPromptImmediately(a)},this);b.forEach(this.renderPrompt,this)},this.renderPrompt=function(a){this.trigger("uiPromptbirdShouldRenderPrompt",{prompt:a})},this.saveDelayedPrompts=function(a){var b=a.filter(function(a){return!this.shouldRenderPromptImmediately(a)},this);this.attr.delayedPrompts=b},this.refreshPrompts=function(a,b){var c=b.prompts||[];this.renderImmediatePrompts(b.prompts),this.saveDelayedPrompts(b.prompts)},this.shouldRenderPromptImmediately=function(a){return!a.trigger||this.attr.immediateTriggers.indexOf(a.trigger)>-1},this.getTweetIds=function(){var a=this.select("tweetItemSelector").filter(function(a,b){return!$(b).find(this.attr.originalTweetSelector).hasClass(this.attr.promotedTweetClass)}.bind(this)).map(function(){return $(this).data("item-id")}).toArray();return a.join(",")},this.after("initialize",function(){this.on(document,"uiSwiftLoaded uiPageChanged",this.initPage),this.on("dataPromptbirdManagerHasPrompts",this.refreshPrompts)})}var defineComponent=require("core/component"),withPromptbirdUserActions=require("app/ui/promptbird/with_promptbird_user_actions");module.exports=defineComponent(promptbirdManager,withPromptbirdUserActions)
});
define("app/data/promptbird/promptbird_manager",["module","require","exports","core/component","app/data/with_data","app/utils/querystring"],function(module, require, exports) {
function promptbirdManagerData(){this.defaultAttrs({endpoint:"/i/users/prompts",format:""}),this.fetchPrompts=function(a,b){b=b||{};var c={format:this.attr.format,tweet_ids:b.tweetIds,force_prompt_id:this.getForcePromptIdParam()};this.get({url:this.attr.endpoint,eventData:c,data:c,success:"dataPromptbirdManagerHasPrompts",error:"dataPromptbirdManagerPollFailure"})},this.getForcePromptIdParam=function(){return queryString.decode(window.location.search.replace(/^\?/,"")).force_prompt_id},this.after("initialize",function(){this.on("uiPromptbirdManagerWantsPrompts",this.fetchPrompts)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),queryString=require("app/utils/querystring");module.exports=defineComponent(promptbirdManagerData,withData)
});
define("app/utils/promptbird/prompt_util",["module","require","exports","template"],function(module, require, exports) {
var template=require("template"),PromptUtil={PROFILE_FORMATS:["ProfileOther","ProfileSelf"],TIMELINE_LAYOUT_TYPES:["inline","inline_pointer"],timelinePromptOptions:function(a){return this.isProfileFormat(a)?{timelineSelector:".GridTimeline-items",promptOptions:{streamItemSelector:".Grid .Grid-cell .js-stream-item",streamItemContainerSelector:"> .Grid"}}:{timelineSelector:"#stream-items-id",promptOptions:{streamItemSelector:"> .js-stream-item",streamItemContainerSelector:"> .js-stream-item"}}},getPromptLayout:function(a,b){var c;return this.hasTimelineLayout(a)?c=this.isProfileFormat(b)?"grid_timeline_layout":"list_timeline_layout":c="default_layout",c},getPromptHtml:function(a,b){var c=this.getPromptLayout(a.type,b),d=template["promptbird/prompts/"+c].render(a.renderData,template),e=template["promptbird/prompts/"+a.template].render(a.renderData,template),f=$("<div></div>");return f.html(d),f.find(".js-prompt-layout-content").html(e),f.html()},isProfileFormat:function(a){return this.PROFILE_FORMATS.indexOf(a)>-1},hasTimelineLayout:function(a){return this.TIMELINE_LAYOUT_TYPES.indexOf(a)>-1}};module.exports=PromptUtil
});
define("app/ui/promptbird/prompts/base_prompt",["module","require","exports","core/component","app/utils/promptbird/prompt_util"],function(module, require, exports) {
function basePrompt(){this.defaultAttrs({promptType:null,promptSelector:".PromptbirdPrompt",actionSelector:".js-promptAction",dismissSelector:".js-promptDismiss",promptLayoutContainerSelector:".js-prompt-layout-container",promptBirdStreamItemSelector:".PromptbirdPrompt-streamItem",isStickyClass:"js-isSticky",triggerImpressionOnInsert:!0}),this.insertPrompt=function(a){},this.removePrompt=function(a){a.closest(this.attr.promptLayoutContainerSelector).remove()},this.showPrompt=function(a,b){var c=this.filterPrompt(b.prompt);c&&(c.html=PromptUtil.getPromptHtml(c,this.attr.format),this.insertPrompt(c),this.bootPrompt(c),this.attr.triggerImpressionOnInsert&&this.trigger("uiPromptbirdPromptWasShown",this.scribeData(c.id)))},this.bootPrompt=function(a){if(!a.js_boot)return;using(a.js_boot,function(b){b({promptElement:this.getPromptByPromptId(a.id)})}.bind(this))},this.filterPrompt=function(a){if(this.attr.promptType===a.type)return a},this.actionClicked=function(a,b){this.triggerPromptAction(b.el,"uiPromptbirdClick");var c=$(b.el);c.hasClass(this.attr.isStickyClass)||this.removePrompt(this.getPromptFromChild(b.el))},this.dismissClicked=function(a,b){a.preventDefault(),this.dismissPrompt(b.el)},this.dismissPrompt=function(a){this.triggerPromptAction(a,"uiPromptbirdDismissPrompt");var b=$(a).closest(this.attr.promptBirdStreamItemSelector);this.trigger(b,"uiRemoveClassBeforePromptbird"),this.removePrompt(this.getPromptFromChild(a))},this.triggerPromptAction=function(a,b){var c=this.getPromptFromChild(a),d=c.data("prompt-intent"),e=c.data("prompt-intent-params"),f=parseInt(c.data("prompt-id"),10);this.trigger(b,this.scribeData(f,d,e))},this.scribeData=function(a,b,c){return{scribeContext:{component:"promptbird_"+a},prompt_id:a,intent:b,intent_params:c}},this.getPromptFromChild=function(a){return $(a).closest(this.attr.promptSelector)},this.getPromptByPromptId=function(a,b){var c=this.attr.promptSelector+'[data-prompt-id="'+a+'"]',d=this.$node.find(c).addBack(c);return b?d.closest(this.attr.promptLayoutContainerSelector):d},this.getPromptIdFromNode=function(a){var b=a.is(this.attr.promptSelector)?a:a.find(this.attr.promptSelector);return b.data("prompt-id")},this.after("initialize",function(){this.on(document,"uiPromptbirdShouldRenderPrompt",this.showPrompt),this.on("click",{actionSelector:this.actionClicked,dismissSelector:this.dismissClicked})})}var defineComponent=require("core/component"),PromptUtil=require("app/utils/promptbird/prompt_util");module.exports=defineComponent(basePrompt)
});
define("app/ui/promptbird/prompts/with_insert_slidedown",["module","require","exports"],function(module, require, exports) {
function withInsertSlideDown(){this.after("insertPrompt",function(){this.select("promptSelector").slideDown()})}module.exports=withInsertSlideDown
});
define("app/ui/promptbird/prompts/with_remove_slideup",["module","require","exports"],function(module, require, exports) {
function withRemoveSlideUp(){this.defaultAttrs({removePromptDuration:400}),this.around("removePrompt",function(a,b){b.slideUp(this.attr.removePromptDuration,function(){a(b)})})}module.exports=withRemoveSlideUp
});
define("app/ui/promptbird/prompts/above_timeline_prompt",["module","require","exports","app/ui/promptbird/prompts/base_prompt","app/ui/promptbird/prompts/with_insert_slidedown","app/ui/promptbird/prompts/with_remove_slideup"],function(module, require, exports) {
function aboveTimelinePrompt(){this.defaultAttrs({promptType:"above_timeline"}),this.insertPrompt=function(a){this.$node.html(a.html)}}var BasePrompt=require("app/ui/promptbird/prompts/base_prompt"),withInsertSlideDown=require("app/ui/promptbird/prompts/with_insert_slidedown"),withRemoveSlideUp=require("app/ui/promptbird/prompts/with_remove_slideup");module.exports=BasePrompt.mixin(aboveTimelinePrompt,withInsertSlideDown,withRemoveSlideUp)
});
define("app/ui/promptbird/prompts/dashboard_profile_prompt",["module","require","exports","app/ui/promptbird/prompts/base_prompt","app/ui/promptbird/prompts/with_remove_slideup"],function(module, require, exports) {
function dashboardProfilePrompt(){this.defaultAttrs({promptType:"dashboard_profile"}),this.insertPrompt=function(a){this.$node.html(a.html)}}var BasePrompt=require("app/ui/promptbird/prompts/base_prompt"),withRemoveSlideUp=require("app/ui/promptbird/prompts/with_remove_slideup");module.exports=BasePrompt.mixin(dashboardProfilePrompt,withRemoveSlideUp)
});
define("app/ui/promptbird/prompts/base_prompt_inline",["module","require","exports","app/ui/promptbird/prompts/base_prompt","app/ui/promptbird/prompts/with_remove_slideup","core/utils","app/utils/viewport_helpers"],function(module, require, exports) {
function basePromptInline(){this.defaultAttrs({streamItemSelector:"> .js-stream-item",streamItemContainerSelector:"> .js-stream-item",scrollDebounceInterval:100}),this.enabledScrollCheck=function(a){var b=this.getPromptIdFromNode(a);setTimeout(function(){this.updateVisibility(a)}.bind(this),0),this.on(window,"scroll.prompt"+b,utils.debounce(this.updateVisibility.bind(this,a),this.attr.scrollDebounceInterval))},this.disableScrollCheck=function(a){var b=a.data("prompt-id");this.off(window,"scroll.prompt"+b)},this.updateVisibility=function(a,b,c){var d=viewportHelpers.isWithinBounds($(window),a),e=this.getPromptIdFromNode(a);!this.promptVisibility[e]&&d&&this.trigger("uiInlinePromptScrolledIn",this.scribeData(e)),this.promptVisibility[e]=d},this.insertPromptAtIndex=function(a,b,c){var d=c?"before":"after",e=$(a.html),f=this.select("streamItemContainerSelector").eq(b);f[d](e),this.enabledScrollCheck(e)},this.before("removePrompt",this.disableScrollCheck),this.after("initialize",function(){this.attr.triggerImpressionOnInsert=!1,this.promptVisibility={}})}var BasePrompt=require("app/ui/promptbird/prompts/base_prompt"),withRemoveSlideUp=require("app/ui/promptbird/prompts/with_remove_slideup"),utils=require("core/utils"),viewportHelpers=require("app/utils/viewport_helpers");module.exports=BasePrompt.mixin(basePromptInline,withRemoveSlideUp)
});
define("app/ui/promptbird/prompts/inline_prompt",["module","require","exports","app/ui/promptbird/prompts/base_prompt_inline","app/ui/promptbird/prompts/with_insert_slidedown"],function(module, require, exports) {
function inlinePrompt(){this.defaultAttrs({promptType:"inline",promptItemSelector:".PromptbirdPrompt--inline",defaultInsertionIndex:0}),this.insertPrompt=function(a){var b=a.renderData.insertionIndex||this.attr.defaultInsertionIndex,c=a.renderData.shouldInsertAbove||!1;this.insertPromptAtIndex(a,b,c)}}var BasePromptInline=require("app/ui/promptbird/prompts/base_prompt_inline"),withInsertSlideDown=require("app/ui/promptbird/prompts/with_insert_slidedown");module.exports=BasePromptInline.mixin(inlinePrompt,withInsertSlideDown)
});
define("app/ui/promptbird/prompts/inline_pointer_prompt",["module","require","exports","app/ui/promptbird/prompts/base_prompt_inline","app/ui/promptbird/prompts/with_insert_slidedown"],function(module, require, exports) {
function inlinePointerPrompt(){this.defaultAttrs({promptType:"inline_pointer",promptItemSelector:".PromptbirdPrompt--inlinePointer",pointerArrowSelector:".PromptbirdPrompt-arrow",pointerTargetSelectors:{favorite_action:".ProfileTweet-action .js-actionFavorite .Icon, .ProfileTweet-action .js-actionFavorite .HeartAnimation",reply_action:".ProfileTweet-action .js-actionReply .Icon",retweet_action:".ProfileTweet-action .js-actionRetweet .Icon",more_action:".ProfileTweet-action .js-dropdown-toggle .Icon"}}),this.insertPrompt=function(a){this.trigger("uiPromptNeedsInsertionIndex",{prompt:a})},this.insertPromptWithIndex=function(a,b){var c=b.prompt;this.insertPromptAtIndex(c,b.insertionIndex,b.shouldInsertAbove),this.setPointerArrowOffset(c)},this.setPointerArrowOffset=function(a){var b=this.attr.pointerTargetSelectors[a.renderData.pointerTarget],c=this.getPromptByPromptId(a.id,!0),d=c.find(this.attr.pointerArrowSelector),e=c.prev(),f=e.find(b),g=f.offset().left-e.offset().left;g<=c.width()&&d.css({left:g+"px"})},this.after("initialize",function(){this.on("uiPromptHasInsertionIndex",this.insertPromptWithIndex)})}var BasePromptInline=require("app/ui/promptbird/prompts/base_prompt_inline"),withInsertSlideDown=require("app/ui/promptbird/prompts/with_insert_slidedown");module.exports=BasePromptInline.mixin(inlinePointerPrompt,withInsertSlideDown)
});
define("app/ui/promptbird/intents/base_intent",["module","require","exports","core/component"],function(module, require, exports) {
function baseIntent(){this.defaultAttrs({intent:null}),this.action=function(){},this.checkIntents=function(a,b){this.attr.intent==b.intent&&this.action(b.intent_params)},this.after("initialize",function(){this.on(document,"uiPromptbirdClick",this.checkIntents)})}var defineComponent=require("core/component");module.exports=defineComponent(baseIntent)
});
define("app/ui/promptbird/intents/post_then_trigger_intent",["module","require","exports","app/ui/promptbird/intents/base_intent","app/utils/querystring","app/data/with_data"],function(module, require, exports) {
function postThenTriggerIntent(){this.defaultAttrs({intent:"post_then_trigger"}),this.action=function(a){var b=queryString.decode(a),c=b.post_path,d=b.success_event_name,e=b.fail_event_name,f=this.tryParseData(b.post_data),g=this.tryParseData(b.success_event_data),h=this.tryParseData(b.fail_event_data);this.post({url:c,data:f}).then(function(){this.trigger(d,g)}.bind(this)).fail(function(){!e||this.trigger(e,h)}.bind(this))},this.tryParseData=function(a){var b;try{b=JSON.parse(a)}catch(c){b={}}return b}}var PromptbirdBaseIntent=require("app/ui/promptbird/intents/base_intent"),queryString=require("app/utils/querystring"),withData=require("app/data/with_data");module.exports=PromptbirdBaseIntent.mixin(postThenTriggerIntent,withData)
});
define("app/ui/promptbird/intents/tweet_compose_intent",["module","require","exports","app/ui/promptbird/intents/base_intent","app/utils/querystring"],function(module, require, exports) {
function tweetComposeIntent(){this.defaultAttrs({intent:"tweet"}),this.action=function(a){var b=qs.decode(a);b.canTweetDefaultText=!0,this.trigger("uiOpenTweetDialog",b)}}var PromptbirdBaseIntent=require("app/ui/promptbird/intents/base_intent"),qs=require("app/utils/querystring");module.exports=PromptbirdBaseIntent.mixin(tweetComposeIntent)
});
define("app/ui/promptbird/promptbird_tweet_selection_helper",["module","require","exports","core/component"],function(module, require, exports) {
function promptbirdTweetSelectionHelper(){this.defaultAttrs({streamItemSelector:".js-stream-item",promotedTweetSelector:".promoted-tweet",originalTweetSelector:".js-original-tweet",favoritedClass:"favorited",favoriteCountSelector:".ProfileTweet-action--favorite .ProfileTweet-actionCount",tweetStatCountSelector:"tweet-stat-count",tweetSelectionAlgorithmMap:{most_favorited:"getMostFavoritedTweet",mutual_follow:"getMutualFollowTweet",not_following:"getNotFollowingTweet"}}),this.getInsertionIndex=function(a,b){var c=b.prompt,d=this.getInsertionIndexForPrompt(c);if(d<0){console.warn("Could not find tweet associated with inline pointer prompt. Skipping prompt",c);return}this.trigger("uiPromptHasInsertionIndex",{prompt:c,insertionIndex:d})},this.getEligibleTweets=function(){var a=this.attr.promotedTweetSelector;return this.select("streamItemSelector").filter(function(b,c){return $(c).find(a).length==0})},this.getInsertionIndexForPrompt=function(a){var b=a.renderData.pointerTweetId||this.getTweetIdForPrompt(a),c=this.select("streamItemSelector").map(function(){return $(this).data("item-id").toString()}).toArray();return c.indexOf(b)},this.getTweetIdForPrompt=function(a){var b=this.attr.tweetSelectionAlgorithmMap[a.renderData.pointerTweetSelection];if(!this[b]){console.warn("Could not find tweet selection algorithm for inline pointer prompt. Skipping selection",a);return}var c=this[b]();if(c.size()>0)return c.data("item-id").toString()},this.getMutualFollowTweet=function(){return this.getEligibleTweets().filter(function(a,b){var c=$(b).find(this.attr.originalTweetSelector);return c.data("you-follow")&&c.data("follows-you")}.bind(this)).eq(0)},this.getNotFollowingTweet=function(){return this.getEligibleTweets().filter(function(a,b){return!$(b).find(this.attr.originalTweetSelector).data("you-follow")}.bind(this)).eq(0)},this.getMostFavoritedTweet=function(){var a=this.getEligibleTweets().filter(function(a,b){return!$(b).find(this.attr.originalTweetSelector).hasClass(this.attr.favoritedClass)}.bind(this));return a.sort(function(a,b){var c=function(a){return $(a).find(this.attr.favoriteCountSelector).data(this.attr.tweetStatCountSelector)}.bind(this);return c(b)-c(a)}.bind(this)).eq(0)},this.after("initialize",function(){this.on("uiPromptNeedsInsertionIndex",this.getInsertionIndex)})}var defineComponent=require("core/component");module.exports=defineComponent(promptbirdTweetSelectionHelper)
});
define("app/ui/promptbird/prompts/modal_prompt",["module","require","exports","app/ui/promptbird/prompts/base_prompt","app/ui/with_dialog"],function(module, require, exports) {
function modalPrompt(){this.defaultAttrs({promptType:"modal",backgroundCloseTarget:".close-modal-background-target",top:120,width:590,blockClickDuration:2e3}),this.insertPrompt=function(a){this.disableBackgroundClicks(),this.select("modalContentSelector").html(a.html),this.open(),this.adjustCloseBtnPosition()},this.removePrompt=function(){},this.disableBackgroundClicks=function(){var a=function(a){a.stopImmediatePropagation()},b=this.select("backgroundCloseTarget");b.on("click",a),setTimeout(function(){b.off("click",a)},this.attr.blockClickDuration)},this.adjustCloseBtnPosition=function(){this.select("closeButtonSelector").remove(),this.select("promptSelector").append(this.$modalCloseBtn)},this.dismissPromptOnDismissDialog=function(){this.isOpen()&&this.dismissPrompt(this.select("promptSelector"))},this.onUiShortcutEsc=function(){this.isOpen()&&this.trigger("uiPromptbirdModalPromptKeyboardDismiss"),this.dismissPromptOnDismissDialog()},this.after("initialize",function(){this.$modalCloseBtn=this.select("closeButtonSelector").clone(!1),this.on(document,"uiShortcutEsc",this.onUiShortcutEsc),this.on("click",{backgroundCloseTarget:this.dismissPromptOnDismissDialog,actionSelector:this.close})})}var BasePrompt=require("app/ui/promptbird/prompts/base_prompt"),withDialog=require("app/ui/with_dialog");module.exports=BasePrompt.mixin(modalPrompt,withDialog)
});
define("app/boot/promptbird",["module","require","exports","app/data/promptbird/promptbird","app/data/promptbird/promptbird_scribe","app/ui/promptbird/promptbird_manager","app/data/promptbird/promptbird_manager","app/ui/promptbird/prompts/above_timeline_prompt","app/ui/promptbird/prompts/dashboard_profile_prompt","app/ui/promptbird/prompts/inline_prompt","app/ui/promptbird/prompts/inline_pointer_prompt","app/ui/promptbird/intents/post_then_trigger_intent","app/ui/promptbird/intents/tweet_compose_intent","app/ui/promptbird/promptbird_tweet_selection_helper","app/ui/promptbird/prompts/modal_prompt","app/utils/promptbird/prompt_util","core/utils"],function(module, require, exports) {
var PromptbirdData=require("app/data/promptbird/promptbird"),PromptbirdScribe=require("app/data/promptbird/promptbird_scribe"),PromptbirdManager=require("app/ui/promptbird/promptbird_manager"),PromptbirdManagerData=require("app/data/promptbird/promptbird_manager"),PromptbirdAboveTimelinePrompt=require("app/ui/promptbird/prompts/above_timeline_prompt"),PromptbirdDashboardProfilePrompt=require("app/ui/promptbird/prompts/dashboard_profile_prompt"),PromptbirdInlinePrompt=require("app/ui/promptbird/prompts/inline_prompt"),PromptbirdInlinePointerPrompt=require("app/ui/promptbird/prompts/inline_pointer_prompt"),PromptbirdPostThenTriggerIntent=require("app/ui/promptbird/intents/post_then_trigger_intent"),PromptbirdTweetComposeIntent=require("app/ui/promptbird/intents/tweet_compose_intent"),PromptbirdTweetSelectionHelper=require("app/ui/promptbird/promptbird_tweet_selection_helper"),PromptbirdModalPrompt=require("app/ui/promptbird/prompts/modal_prompt"),PromptUtil=require("app/utils/promptbird/prompt_util"),utils=require("core/utils");module.exports=function(b){var c=b.promptbirdData||{};if(!c.promptbirdEnabled)return;PromptbirdData.attachTo(document),PromptbirdScribe.attachTo(document),PromptbirdManager.attachTo(document,c),PromptbirdManagerData.attachTo(document,c),PromptbirdTweetComposeIntent.attachTo(document,PromptbirdData),PromptbirdPostThenTriggerIntent.attachTo(document,PromptbirdData),PromptbirdAboveTimelinePrompt.attachTo("#above-timeline-prompt",c),PromptbirdDashboardProfilePrompt.attachTo("#dashboard-profile-prompt",c),PromptbirdModalPrompt.attachTo("#promptbird-modal-prompt",c);var d=PromptUtil.timelinePromptOptions(c.format),e=utils.merge(c,d.promptOptions);PromptbirdTweetSelectionHelper.attachTo(d.timelineSelector,e),PromptbirdInlinePrompt.attachTo(d.timelineSelector,utils.merge(e,{actionSelector:".PromptbirdPrompt--inline .js-promptAction",dismissSelector:".PromptbirdPrompt--inline .js-promptDismiss"})),PromptbirdInlinePointerPrompt.attachTo(d.timelineSelector,utils.merge(e,{actionSelector:".PromptbirdPrompt--inlinePointer .js-promptAction",dismissSelector:".PromptbirdPrompt--inlinePointer .js-promptDismiss"}))}
});
define("app/data/push_subscription_manager",["module","require","exports","core/component","app/utils/storage/custom","app/data/with_data"],function(module, require, exports) {
function pushSubscriptionManager(){this.defaultAttrs({userHasPushTarget:!1,serviceWorkerPath:"/service_worker.js",pushCheckinTTL:864e5}),this.subscriptionChangeRequested=function(a,b){if(!this.serviceWorkerRegistration)return;var c=!this.subscription&&b.subscribe,d=this.subscription&&!b.subscribe;if(c)this.subscribe(this.serviceWorkerRegistration);else if(d){var e=function(){this.subscription=null,this.storeUnregister(),this.sendCurrentStatus()}.bind(this);this.subscription.unsubscribe().then(e,e)}},this.subscribe=function(a){var b=this.getNotificationPermission()=="granted";b?this.trigger("uiBrowserSilentSubscribeAttempt"):this.trigger("uiBrowserPushPromptImpression"),a.pushManager.subscribe({userVisibleOnly:!0}).then(this.subscribeSuccess.bind(this,b),this.subscribeFailure.bind(this,b))},this.subscribeSuccess=function(a,b){a?this.trigger("uiBrowserSilentSubscribeSuccess"):this.trigger("uiBrowserPushPromptAllow"),this.subscription=b,this.storeSubscription(this.subscription,!0),this.sendCurrentStatus()},this.subscribeFailure=function(a){this.getNotificationPermission()==="denied"?this.trigger("uiBrowserPushPromptDeny"):this.getNotificationPermission()==="default"?this.trigger("uiBrowserPushPromptDismiss"):a?this.trigger("uiBrowserSilentSubscribeError"):this.trigger("uiBrowserPushPromptError")},this.isSupported=function(){var a="PushManager"in window,b=this.getNotificationPermission()!=="denied",c="serviceWorker"in navigator,d=c&&"showNotification"in ServiceWorkerRegistration.prototype;return d&&a&&b&&c},this.serviceWorkerReady=function(a){this.serviceWorkerRegistration=a,this.serviceWorkerRegistration.pushManager.getSubscription().then(function(b){this.subscription=b,this.getNotificationPermission()=="granted"&&!b&&this.userHasPushTarget?this.subscribe(a):this.sendCurrentStatus(),this.storeSubscription(this.subscription)}.bind(this))},this.getNotificationPermission=function(){return Notification&&Notification.permission},this.storeSubscription=function(a,b){if(!a||this.storage.getItem("isSaved")&&!b)return;var c={subscribe:!0,token:a.endpoint};a.subscriptionId&&a.endpoint.indexOf(a.subscriptionId)==-1&&(c.token=a.endpoint+"/"+a.subscriptionId),this.post({url:"/i/push_destinations",data:c,success:function(){this.userHasPushTarget=!0,this.storage.setItem("isSaved",!0,this.attr.pushCheckinTTL)}.bind(this),error:$.noop})},this.storeUnregister=function(){this.userHasPushTarget=!1,this.storage.clear(),this.post({url:"/i/push_destinations/destroy",success:$.noop,error:$.noop})},this.sendCurrentStatus=function(){this.trigger("dataPushSubscriptionState",{supported:this.supported,subscribed:!!this.subscription})},this.after("initialize",function(){this.serviceWorkerRegistration=null,this.subscription=null,this.userHasPushTarget=this.attr.userHasPushTarget,this.supported=this.isSupported();if(this.supported){var a=customStorage({withExpiry:!0});this.storage=new a("push_notifications"),this.on("uiWantsPushSubscriptionState",this.sendCurrentStatus),this.on("uiPushSubscriptionChangeRequested",this.subscriptionChangeRequested);var b=navigator.serviceWorker;b.register(this.attr.serviceWorkerPath).then(function(){return b.ready}).then(this.serviceWorkerReady.bind(this)).then(undefined,function(){this.supported=!1,this.sendCurrentStatus()}.bind(this))}else this.sendCurrentStatus()})}var defineComponent=require("core/component"),customStorage=require("app/utils/storage/custom"),withData=require("app/data/with_data");module.exports=defineComponent(pushSubscriptionManager,withData)
});
define("app/data/push_subscription_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function pushSubscriptionScribe(){this.after("initialize",function(){this.scribeOnEvent("uiPushPromptShown",{component:"push_manager",element:"soft_prompt",action:"impression"}),this.scribeOnEvent("uiPushPromptClick",{component:"push_manager",element:"soft_prompt",action:"click"}),this.scribeOnEvent("uiPushPromptDismiss",{component:"push_manager",element:"soft_prompt",action:"dismiss"}),this.scribeOnEvent("uiBrowserPushPromptImpression",{component:"push_manager",element:"browser_prompt",action:"impression"}),this.scribeOnEvent("uiBrowserPushPromptAllow",{component:"push_manager",element:"browser_prompt",action:"permissions_granted"}),this.scribeOnEvent("uiBrowserPushPromptDeny",{component:"push_manager",element:"browser_prompt",action:"permissions_denied"}),this.scribeOnEvent("uiBrowserPushPromptDismiss",{component:"push_manager",element:"browser_prompt",action:"dismiss"}),this.scribeOnEvent("uiBrowserPushPromptError",{component:"push_manager",element:"browser_prompt",action:"permissions_error"}),this.scribeOnEvent("uiBrowserSilentSubscribeAttempt",{component:"push_manager",element:"silent_subscribe",action:"impression"}),this.scribeOnEvent("uiBrowserSilentSubscribeError",{component:"push_manager",element:"silent_subscribe",action:"error"}),this.scribeOnEvent("uiBrowserSilentSubscribeSuccess",{component:"push_manager",element:"silent_subscribe",action:"success"})})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(withScribe,pushSubscriptionScribe)
});
define("app/ui/dialogs/quick_promote_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/utils/with_iframe_height_adjuster","app/ui/with_position","app/data/with_scribe"],function(module, require, exports) {
function quickPromoteDialog(){"use strict",this.defaultAttrs({quickPromoteIframeSelector:".quick-promote-iframe",cancelButtonSelector:".cancel-action",top:47}),this.openDialog=function(a,b){var c=$(a.target),d=c.attr("data-tfb-view");this.select("quickPromoteIframeSelector").attr("src",d),this.open(),this.scribeDialogOpenInteraction(a)},this.closeDialog=function(a,b){this.select("quickPromoteIframeSelector").removeAttr("src style"),this.off(window,"message",this.postMessageHandler)},this.postMessageHandler=function(a){var b=a.originalEvent,c=!1;if(b.origin===window.location.protocol+"//"+window.location.host){if(typeof b.data=="string"&&b.data!="undefined")try{c=JSON.parse(b.data)}catch(d){}if(c&&c.name&&c.name==="quick_promote")if(c.type==="resize")this.adjustIframeHeight(b);else if(c.type==="scribe"){var e=c.scribeData||{};this.scribeUiInteraction(e.uiEvent,e.data)}else c.type==="close"&&this.close()}},this.scribeDialogOpenInteraction=function(a){this.scribe({component:"tweet",element:"view_tweet_analytics",action:"navigate"})},this.scribeUiInteraction=function(a,b){a=a&&a.toLowerCase();var c=["click","confirm"];c.indexOf(a)>=0&&this.scribe({component:"tweet",element:"quick_promote",action:a})},this.adjustIframeHeight=function(a){var b={iframeSelector:this.attr.quickPromoteIframeSelector,isQualified:function(a){return a.height}};this.fitIframeHeight(a,b)},this.setupMessageListener=function(){this.on(window,"message",this.postMessageHandler)},this.after("initialize",function(){this.on("click",{cancelButtonSelector:this.close}),this.on("uiDialogOpened",this.setupMessageListener),this.on(document,"uiOpenQuickPromoteDialog",this.openDialog),this.on("uiDialogClosed",this.closeDialog),this.on(window,"message",this.postMessageHandler)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withIframeHeightAdjuster=require("app/utils/with_iframe_height_adjuster"),withPosition=require("app/ui/with_position"),withScribe=require("app/data/with_scribe"),QuickPromoteDialog=defineComponent(quickPromoteDialog,withDialog,withPosition,withIframeHeightAdjuster,withScribe);module.exports=QuickPromoteDialog
});
define("app/ui/dialogs/report_dialog",["module","require","exports","core/component","core/i18n","app/ui/with_dialog"],function(module, require, exports) {
function reportDialog(){this.defaultAttrs({reportButtonSelector:".report-tweet-report-button",nextButtonSelector:".report-tweet-next-button",harassmentIframeSelector:"#report-harassment-frame",harassmentNextSelector:".harassment-next-button",harassmentBackSelector:".harassment-back-button",harassmentDoneSelector:".harassment-done-button",newReportFlowFormSelector:".new-report-flow-form",newReportFlowIframeSelector:"#new-report-flow-frame",newReportFlowNextSelector:".new-report-flow-next-button",newReportFlowBackSelector:".new-report-flow-back-button",newReportFlowCloseSelector:".new-report-flow-close-button",newReportFlowDoneSelector:".new-report-flow-done-button",reportTypeSelector:"input[name=report_type]",abusiveTypeSelector:"input[name=abuse_type]",selectedReportTypeSelector:"input[name=report_type]:checked",selectedAnnoyingSelector:"input[value=annoying]",selectedAbusiveTypeSelector:"input[name=abuse_type]:checked",flagMediaSelector:".flag-media",flagMediaTextSelector:".flag-media-desc",spamTextSelector:".spam-desc",abuseTextSelector:".abuse-desc",annoyingTextSelector:".annoying-desc",impersonationLinkSelector:".report-impersonation-link",privateInformationLinkSelector:".report-private-information-link",harassmentLinkSelector:".report-harassment-link",selfHarmLinkSelector:".report-self-harm-link",adsLinkSelector:".report-ads-link",twitterRulesLinkSelector:".twitter-rules-link",reportFormSelector:".report-form",reportControlSelector:"#report-control",reportTitleSelector:".report-title",harassmentTitleSelector:".harassment-title",harassmentFormSelector:".harassment-form",reporterUserIdSelector:"#current-user-id",abuseLinks:{impersonation:"https://support.twitter.com/forms/impersonation?{{q}}",privateInformation:"https://support.twitter.com/forms/private_information?{{q}}",harassment:"https://support.twitter.com/forms/abusiveuser?{{q}}",selfHarm:"https://support.twitter.com/forms/general?subtopic=self_harm&{{q}}",ads:"https://support.twitter.com/forms/ads?{{q}}"}}),this.setUpDialog=function(a,b){this.reset(),this.eventData=b,this.setTriggeredTarget(),this.setDescriptionText(),this.setAbuseReportLinks(),this.setFlagMedia(),this.showNativeReport(),this.select("newReportFlowFormSelector").length!=0?(this.setNewReportFlowContext(),this.showNewReportFlow()):(this.setReportHarassmentContext(),this.setReportAds()),this.open()},this.reset=function(){this.isComplete=!1,this.resetReportSection()},this.resetReportSection=function(){this.$node.removeClass("abuse-selected"),this.select("selectedAnnoyingSelector").attr("checked",!0),this.select("selectedAbusiveTypeSelector").attr("checked",!1),this.select("nextButtonSelector").attr("disabled",!0),this.select("harassmentDoneSelector").hide(),this.select("newReportFlowDoneSelector").hide()},this.setTriggeredTarget=function(){this.eventData.target==="user"?this.$node.addClass("report-user"):this.$node.removeClass("report-user")},this.setReportSourceParams=function(a,b){return this.$node.hasClass("report-user")?(b.source="reportprofile",_(a,b)):(b.reportedTweetId=this.eventData.tweetId,b.source="reporttweet",_(a+"&reported_tweet_id={{reportedTweetId}}",b))},this.setReportHarassmentContext=function(){var a=this.select("reporterUserIdSelector").val(),b={baseUrl:"/safety/report_story",reporterId:a,reportedId:this.eventData.userId,reportedTweetId:"",source:""},c="{{baseUrl}}?source={{source}}&reported_user_id={{reportedId}}&reporter_user_id={{reporterId}}&next_view=who_is_harassing";this.select("harassmentIframeSelector").attr("src",this.setReportSourceParams(c,b))},this.setNewReportFlowContext=function(){var a=this.select("reporterUserIdSelector").val(),b=(!!this.eventData.mediaType).toString(),c=(this.eventData.disclosureType=="promoted").toString(),d={baseUrl:"/i/safety/report_story",reporterId:a,reportedId:this.eventData.userId,reportedTweetId:"",source:"",is_media:b,is_promoted:c},e="{{baseUrl}}?next_view=report_story_start&source={{source}}&reported_user_id={{reportedId}}&reporter_user_id={{reporterId}}&is_media={{is_media}}&is_promoted={{is_promoted}}";this.select("newReportFlowIframeSelector").attr("src",this.setReportSourceParams(e,d))},this.setDescriptionText=function(a,b){var c=this.select("spamTextSelector"),d=this.select("abuseTextSelector"),e=this.select("annoyingTextSelector");this.$node.hasClass("report-user")?(e.text(_('Dieser Account ist nervig')),c.text(_('Das ist ein Spam-Account')),d.text(_('Account'))):(e.text(_('Dieser Tweet ist nervig')),c.text(_('Dieser Tweet ist Spam')),d.text(_('Twittern')))},this.setFlagMedia=function(){var a=this.select("flagMediaSelector");this.eventData.mediaType?(this.eventData.mediaType=="image"?this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise ein sensibles Bild')):this.eventData.mediaType=="video"?this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise ein sensibles Video')):this.select("flagMediaTextSelector").text(_('Dieser Tweet enth\xe4lt m\xf6glicherweise sensible Medien')),a.show()):a.hide()},this.setReportAds=function(){var a="for-promoted-tweet";this.eventData.disclosureType!=="promoted"?this.$node.removeClass(a):this.$node.addClass(a)},this.setAbuseReportLinks=function(){var a="reported_username={{screenName}}&reported_tweet_id={{tweetId}}",b={q:_(a,this.eventData)},c=this.attr.abuseLinks;this.select("impersonationLinkSelector").attr("data-form-link",_(c.impersonation,b)),this.select("privateInformationLinkSelector").attr("data-form-link",_(c.privateInformation,b)),this.select("harassmentLinkSelector").attr("data-form-link",_(c.harassment,b)),this.select("selfHarmLinkSelector").attr("data-form-link",_(c.selfHarm,b)),this.select("adsLinkSelector").attr("data-form-link",_(c.ads,b))},this.updateState=function(){function a(a,b){var c=b?"addClass":"removeClass";this.$node[c](a)}function b(a,b){this.select(a).attr("disabled",!b)}var c=this.reportType()=="abusive",d=this.select("abusiveTypeSelector").is(":checked"),e=[["abuse-selected",c]];e.forEach(function(b){a.call(this,b[0],b[1])},this);var f=[["nextButtonSelector",d]];f.forEach(function(a){b.call(this,a[0],a[1])},this)},this.reportType=function(){return this.select("selectedReportTypeSelector").val()},this.abusiveType=function(){return this.select("selectedAbusiveTypeSelector").val()},this.submitReport=function(){var a=this.$node.hasClass("report-user")?"uiReportUserAction":"uiDidReportTweet",b=this.reportType();this.trigger(a,{eventData:this.eventData,tweetId:this.eventData.tweetId,userId:this.eventData.userId,screenName:this.eventData.screenName,reportType:b,blockUser:!1,impressionId:this.eventData.impressionId,disclosureType:this.eventData.disclosureType})},this.showNativeReport=function(){this.$node.removeClass("abuse-dialog")},this.showHarassmentReport=function(){this.$node.addClass("abuse-dialog"),this.select("harassmentBackSelector").show(),this.select("harassmentNextSelector").show()},this.showNewReportFlow=function(){this.$node.addClass("new-report-flow-dialog"),this.$node.attr("aria-hidden",!1),this.select("newReportFlowBackSelector").hide(),this.select("newReportFlowNextSelector").show()},this.submitAndCompleteReport=function(){this.submitReport(),this.completeReport()},this.reportAbuseNext=function(){this.submitReport();if(this.abusiveType()){var a=this.select("selectedAbusiveTypeSelector").attr("data-form-link");this.abusiveType()=="harassment"&&$(this.attr.selectedAbusiveTypeSelector).hasClass("report-flow-v2")?(this.reportAbuseToSupport(),this.showHarassmentReport()):(this.reportAbuseToSupport(),window.open(a,"_blank"),this.completeReport())}},this.reportAbuseToSupport=function(a,b){this.trigger("uiDidReportToSupport",{eventData:this.eventData,abuseType:this.abusiveType(),userId:this.eventData.userId})},this.cancelReport=function(){this.trigger("uiDidCancelReport",this.eventData)},this.completeReport=function(){this.isComplete=!0,this.close()},this.around("close",function(a){this.isOpen()&&!this.isComplete&&this.cancelReport(),this.select("newReportFlowIframeSelector").attr("src",""),a()}),this.twitterRulesClick=function(){this.trigger("uiDidOpenTwitterRulesLink",{eventData:this.eventData,userId:this.eventData.userId})},this.harassmentFrameNext=function(){this.select("harassmentIframeSelector").contents().find("#report_webview_form").submit()},this.harassmentFrameBack=function(){var a=this.select("harassmentIframeSelector").contents().get(0).location.href.indexOf("next_view")<0;a?this.showNativeReport():this.select("harassmentIframeSelector").get(0).contentWindow.history.back()},this.checkContentAndUpdate=function(){var a=this.select("harassmentIframeSelector").contents().get(0).location.href.indexOf("/safety/report_story_complete")>=0;a?(this.select("harassmentBackSelector").hide(),this.select("harassmentNextSelector").hide(),this.select("harassmentDoneSelector").show()):this.select("harassmentDoneSelector").hide()},this.newReportFlowFrameNext=function(){this.select("newReportFlowIframeSelector").contents().find("#report_webview_form").submit()},this.newReportFlowFrameBack=function(){var a=this.select("newReportFlowIframeSelector").contents().get(0).location.href.indexOf("next_view")<0;a?this.showNativeReport():this.select("newReportFlowIframeSelector").get(0).contentWindow.history.back()},this.checkNewReportFlowContentAndUpdate=function(){var a=this.select("newReportFlowIframeSelector").contents().get(0).location,b=a.href.indexOf("report_story_start")>=0,c=a.href.indexOf("/i/safety/report_story_complete")>=0;if(b)this.select("newReportFlowBackSelector").hide(),this.select("newReportFlowDoneSelector").hide(),this.select("newReportFlowCloseSelector").hide();else if(c){this.select("newReportFlowBackSelector").hide(),this.select("newReportFlowNextSelector").hide(),this.select("newReportFlowDoneSelector").show();var d=a.search.match(/\baction=([^&]+)/);if(d!=null){var e={userId:this.eventData.userId,impressionId:this.eventData.impressionId,disclosureType:this.eventData.disclosureType,skipScribe:!0},f=d[1].toLowerCase();if(f=="error")this.select("newReportFlowCloseSelector").show(),this.select("newReportFlowBackSelector").hide(),this.select("newReportFlowDoneSelector").hide();else{var g;f=="mute"?g="uiDidMuteUser":f=="block"?g="uiBlockAction":f=="unfollow"&&(g="uiUnfollowAction"),g!=undefined&&this.trigger(g,e),this.completeReport()}}}else this.select("newReportFlowBackSelector").show(),this.select("newReportFlowDoneSelector").hide(),this.select("newReportFlowCloseSelector").hide()},this.after("initialize",function(){this.isComplete=!1,this.on(document,"uiNeedsReportDialog",this.setUpDialog);var a=this;this.select("harassmentIframeSelector").load(function(){a.checkContentAndUpdate()}),this.select("newReportFlowIframeSelector").load(function(){a.checkNewReportFlowContentAndUpdate()}),this.on("click",{reportButtonSelector:this.submitAndCompleteReport,nextButtonSelector:this.reportAbuseNext,twitterRulesLinkSelector:this.twitterRulesClick,harassmentNextSelector:this.harassmentFrameNext,harassmentBackSelector:this.harassmentFrameBack,harassmentDoneSelector:this.close,newReportFlowNextSelector:this.newReportFlowFrameNext,newReportFlowBackSelector:this.newReportFlowFrameBack,newReportFlowDoneSelector:this.close,newReportFlowCloseSelector:this.close}),this.on("change",{reportTypeSelector:this.updateState,abusiveTypeSelector:this.updateState})})}var defineComponent=require("core/component"),_=require("core/i18n"),withDialog=require("app/ui/with_dialog"),ReportDialog=defineComponent(withDialog,reportDialog);module.exports=ReportDialog
});
define("app/ui/responsive_dashboard_width",["module","require","exports","core/component","core/utils"],function(module, require, exports) {
function responsiveDashboardWidth(){this.defaultAttrs({leftDashboardSelector:".dashboard-left",rightDashboardSelector:".dashboard-right",roamingSelector:".roaming-module:not(.roaming-top-module)",roamingTopSelector:".roaming-module.roaming-top-module",threeColWidth:1236}),this.setWindowWidth=function(a){this.windowWidth=this.$window.width();if(this.windowWidth<this.attr.threeColWidth){if(this.threeCol||a)this.$dashboardLeft.prepend(this.$dashboardRight.find(this.attr.roamingTopSelector)),this.$dashboardLeft.append(this.$dashboardRight.find(this.attr.roamingSelector)),this.$body.removeClass("three-col"),this.threeCol=!1}else if(!this.threeCol||a)this.$dashboardRight.prepend(this.$dashboardLeft.find(this.attr.roamingTopSelector)),this.$dashboardRight.append(this.$dashboardLeft.find(this.attr.roamingSelector)),this.$body.addClass("three-col"),this.threeCol=!0},this.after("initialize",function(){this.$dashboardRight=this.select("rightDashboardSelector"),this.$dashboardRight.length&&(this.$window=$(window),this.$body=$(document.body),this.$dashboardLeft=this.select("leftDashboardSelector"),this.threeCol=!1,this.setWindowWidth(!0),this.on(window,"resize",utils.debounce(this.setWindowWidth.bind(this),100)))})}var defineComponent=require("core/component"),utils=require("core/utils");module.exports=defineComponent(responsiveDashboardWidth)
});
define("app/ui/compose/retweet_with_comment",["module","require","exports","core/i18n","core/component","app/ui/compose/with_condensing","app/ui/compose/with_character_counter","app/ui/compose/with_draft_tweets","app/ui/compose/with_rtl_tweet_box","app/ui/compose/with_text_editor","app/ui/compose/with_rich_editor","app/ui/compose/with_typeahead"],function(module, require, exports) {
function composeRetweetWithComment(){this.defaultAttrs({tweetActionSelector:".retweet-action",tweetboxId:"retweet",isWithCommentClass:"is-withComment"}),this.dmRegex=/^\s*(?:d|m|dm)\s+[@＠]?(\S+)\s*(.*)/i,this.createDataForSending=function(){var a={status:this.addRetweet(this.getVisibleText()),impression_id:this.impressionId,earned:this.earned};return a},this.addRetweet=function(a){return a+" "+this.urlToRetweet},this.isEmpty=function(){return!this.getVisibleText().trim()},this.hasAttachment=function(){return!0},this.sendRetweet=function(){this.detectUpdatedText();if(this.isEmpty())return;this.trigger("uiSendTweet",{tweetboxId:this.attr.tweetboxId,tweetData:this.createDataForSending()}),this.$node.addClass("tweeting"),this.disable()},this.updateTweetStateOnTextChanged=function(a){var b=!this.isEmpty();this.maxReached()||this.$node.hasClass("tweeting")||this.getVisibleText().match(this.dmRegex)?this.disable():this.enable(),this.$node.toggleClass(this.attr.isWithCommentClass,b),this.trigger("uiDialogUpdateTitle",{title:b?_('Tweet zitieren'):_('Retweet an Deine Follower senden?')})},this.retweetSent=function(a,b){var c=b.tweetboxId||b.sourceEventData.tweetboxId;if(c!=this.attr.tweetboxId)return;this.trigger("uiShowMessage",{message:_('Dein Tweet wurde gesendet!')}),this.trigger("uiRetweetWithCommentSuccess",b),this.$node.removeClass("tweeting"),this.clear()},this.retweetError=function(a,b){var c=b.tweetboxId||b.sourceEventData.tweetboxId;if(c!=this.attr.tweetboxId)return;this.$node.removeClass("tweeting"),this.enable()},this.enable=function(){this.$tweetButton.removeClass("disabled").attr("disabled",!1)},this.disable=function(){this.$tweetButton.addClass("disabled").attr("disabled",!0)},this.clear=function(){this.reset()},this.reset=function(){this.resetTweetText()},this.resetAndFocus=function(){this.reset(),this.focus()},this.resetTweetText=function(){this.trigger("uiClearUndoState"),this.setVisibleText("")},this.handleCmdEnterSubmit=function(){this.$tweetButton.hasClass("disabled")||this.$tweetButton.click()},this.overrideOptions=function(a,b){this.urlToRetweet=b.urlToRetweet,this.impressionId=b.impressionId,this.earned=b.earned},this.after("initialize",function(){this.$tweetButton=this.select("tweetActionSelector"),this.on("uiTextChanged",this.updateTweetStateOnTextChanged),this.on("uiComposerResetAndFocus",this.resetAndFocus),this.initDraftTweets(),this.initTextNode(),this.on(this.$tweetButton,"click",this.sendRetweet),this.on("uiShortcutCmdEnter",this.handleCmdEnterSubmit),this.on(document,"dataTweetSuccess",this.retweetSent),this.on(document,"dataTweetError",this.retweetError),this.on("uiOverrideTweetBoxOptions",this.overrideOptions),this.reset()})}var _=require("core/i18n"),defineComponent=require("core/component"),withCondensing=require("app/ui/compose/with_condensing"),withCounter=require("app/ui/compose/with_character_counter"),withDraftTweets=require("app/ui/compose/with_draft_tweets"),withRTL=require("app/ui/compose/with_rtl_tweet_box"),withTextEditor=require("app/ui/compose/with_text_editor"),withRichEditor=require("app/ui/compose/with_rich_editor"),withTypeahead=require("app/ui/compose/with_typeahead");module.exports=defineComponent(composeRetweetWithComment,withCondensing,withTextEditor,withRichEditor,withCounter,withRTL,withDraftTweets,withTypeahead)
});
define("app/ui/dialogs/retweet_dialog",["module","require","exports","core/component","app/ui/with_dialog","app/ui/dialogs/with_modal_tweet","app/ui/compose/retweet_with_comment"],function(module, require, exports) {
function retweetDialog(){this.defaults={retweetSelector:".retweet-action",tweetBoxSelector:"form.tweet-form",isWithCommentClass:"is-withComment",maxTweetComposeCharacters:140,composeIgnoreAttachmentText:!1,top:"20%"},this.openRetweet=function(a,b){this.tweetBoxReady||(ComposeRetweetWithComment.attachTo(this.$tweetBox,{condensable:!0,modal:!0,condenseContainer:".RetweetDialog-commentBox",typeaheadData:this.attr.typeaheadData,noTeardown:this.attr.noTeardown,maxLength:this.attr.maxTweetComposeCharacters,warnLength:this.attr.maxTweetComposeCharacters-20,superwarnLength:this.attr.maxTweetComposeCharacters-10,countUp:this.attr.maxTweetComposeCharacters>140,ignoreAttachmentText:this.attr.composeIgnoreAttachmentText||this.attr.maxTweetComposeCharacters>140,hashflagsEnabled:!0}),this.tweetBoxReady=!0),this.trigger(this.$tweetBox,"uiOverrideTweetBoxOptions",{draftTweetId:"retweet_"+b.tweetId,urlToRetweet:["https://twitter.com",b.screenName,"status",b.id].join("/"),impressionId:b.impressionId,earned:b.disclosureType?b.disclosureType=="earned":undefined}),this.sourceEventData=b,this.displayTweet(b.id,{modal:"retweet",disableLinks:!0}),this.open()},this.retweet=function(){this.$tweetBox.hasClass(this.attr.isWithCommentClass)||this.trigger("uiDidRetweet",this.sourceEventData)},this.retweetSuccess=function(a,b){this.sourceEventData!=undefined&&(this.trigger("uiDidRetweetSuccess",this.sourceEventData),a.type=="uiRetweetWithCommentSuccess"&&this.trigger("uiDidRetweetWithCommentSuccess",this.sourceEventData)),this.close(),this.sourceEventData=undefined},this.restoreFocusToTweet=function(a){$(a.target).is(this.$dialog)&&this.activeEl&&(a.preventDefault(),this.trigger($(this.activeEl).closest(".tweet"),"uiShouldAddFocusStyle"),this.activeEl.focus())},this.updateTitle=function(a,b){b&&b.title&&this.select("modalTitleSelector").text(b.title)},this.after("initialize",function(a){this.$tweetBox=this.select("tweetBoxSelector"),this.on("click",{retweetSelector:this.retweet}),this.on(document,"uiOpenRetweetDialog",this.openRetweet),this.on(document,"uiRetweetWithCommentSuccess dataDidRetweet",this.retweetSuccess),this.on(document,"uiDialogRestorePreviousFocus",this.restoreFocusToTweet),this.on("uiDialogUpdateTitle",this.updateTitle)})}var defineComponent=require("core/component"),withDialog=require("app/ui/with_dialog"),withModalTweet=require("app/ui/dialogs/with_modal_tweet"),ComposeRetweetWithComment=require("app/ui/compose/retweet_with_comment");module.exports=defineComponent(retweetDialog,withDialog,withModalTweet)
});
define("app/data/saved_searches",["module","require","exports","core/component","app/data/with_data","app/data/with_auth_token"],function(module, require, exports) {
function savedSearches(){this.saveSearch=function(a,b){this.post({url:"/i/saved_searches/create.json",data:b,eventData:{scribeComponent:b.scribeComponent,scribeAction:"add"},success:"dataAddedSavedSearch",error:"dataSavedSearchError"})},this.removeSavedSearch=function(a,b){this.post({url:"/i/saved_searches/destroy/"+encodeURIComponent(b.id)+".json",data:"",eventData:{scribeComponent:b.scribeComponent,scribeAction:"remove"},success:"dataRemovedSavedSearch",error:"dataSavedSearchError"})},this.after("initialize",function(){this.on("uiAddSavedSearch",this.saveSearch),this.on("uiRemoveSavedSearch",this.removeSavedSearch)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),withAuthToken=require("app/data/with_auth_token");module.exports=defineComponent(savedSearches,withData,withAuthToken)
});
define("app/data/saved_searches_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function savedSearchesScribe(){this.scribeSavedSearchAction=function(a,b){this.scribe({component:b.sourceEventData.scribeComponent,element:"saved_search",action:b.sourceEventData.scribeAction})},this.after("initialize",function(){this.on("dataAddedSavedSearch dataRemovedSavedSearch",this.scribeSavedSearchAction)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(savedSearchesScribe,withScribe)
});
define("app/ui/search_query_source",["module","require","exports","core/component","app/utils/storage/custom"],function(module, require, exports) {
function searchQuerySource(){this.defaultAttrs({querySourceLinkSelector:"a[data-query-source]",querySourceDataAttr:"data-query-source",storageExpiration:6e4}),this.saveQuerySource=function(a){this.storage.setItem("source",{source:{value:a,expire:Date.now()+this.attr.storageExpiration}},this.attr.storageExpiration)},this.catchLinkClick=function(a,b){var c=$(b.el).attr(this.attr.querySourceDataAttr);c&&this.saveQuerySource(c)},this.saveTypedQuery=function(a,b){if(b.source!=="search")return;this.saveQuerySource("typed_query")},this.after("initialize",function(){var a=customStorage({withExpiry:!0});this.storage=new a("searchQuerySource"),this.on("click",{querySourceLinkSelector:this.catchLinkClick}),this.on("uiSearchQuery",this.saveTypedQuery)})}var defineComponent=require("core/component"),customStorage=require("app/utils/storage/custom");module.exports=defineComponent(searchQuerySource)
});
define("app/data/sms_confirmation_data",["module","require","exports","core/component","app/data/with_data"],function(module, require, exports) {
function smsConfirmationData(){this.smsConfirmationAjaxCall=function(a,b,c){function d(a){a.error?this.trigger("uiAlertBanner",a):this.trigger(c,{message:a.message})}var e=$.extend({user_id:a.userId},a);this.post({url:b,data:e,success:d.bind(this),error:"dataUserActionError"})},this.sendPinAction=function(a,b){var c={phone_number:b.phone_number,country_code:b.country_code};this.smsConfirmationAjaxCall(c,"/i/devices/sms_confirmation_begin","dataSendPinSuccess")},this.resendPinAction=function(a,b){var c={phone_number:b.phone_number,country_code:b.country_code,resend:!0};this.smsConfirmationAjaxCall(c,"/i/devices/sms_confirmation_begin","dataResendPinSuccess")},this.verifyPinAction=function(a,b){var c={numeric_pin:b.numeric_pin,phone_number:b.phone_number,country_code:b.country_code};this.smsConfirmationAjaxCall(c,"/i/devices/sms_confirmation_complete","dataVerifyPinSuccess")},this.after("initialize",function(){this.on(document,"uiSendPinAction",this.sendPinAction),this.on(document,"uiResendPinAction",this.resendPinAction),this.on(document,"uiVerifyPinAction",this.verifyPinAction)})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),SmsConfirmationData=defineComponent(smsConfirmationData,withData);module.exports=SmsConfirmationData
});
define("app/ui/forms/select_box",["module","require","exports","core/component"],function(module, require, exports) {
function selectBox(){this.clickItems=function(a,b){this.trigger("uiItemClick")},this.itemSelect=function(){var a,b={index:this.node.selectedIndex},c;if(this.node.selectedIndex>=0){c=this.node.options[this.node.selectedIndex];for(var d=0;d<c.attributes.length;d++)a=c.attributes[d].name,b[a]=c.attributes[d].value;b.text=c.innerHTML}this.trigger("uiItemSelect",b)},this.setItems=function(a,b){this.$node.empty(),b.items&&b.items.forEach(function(a){var b=$("<option />");for(var c in a)c=="text"?b.html(a[c]):b.attr(c,a[c]);b.appendTo(this.$node)}.bind(this)),this.itemSelect()},this.after("initialize",function(){this.node.jquery&&(this.node=this.node[0]),this.attr.items&&this.node.trigger("setItems",{items:this.attr.items}),this.on("setItems",this.setItems),this.on("change",this.itemSelect),this.on("mousedown",this.clickItems)})}var defineComponent=require("core/component");module.exports=defineComponent(selectBox)
});
define("app/ui/with_phone_pin_verification",["module","require","exports","core/i18n","app/ui/forms/select_box"],function(module, require, exports) {
function withPhonePinVerification(){this.defaultAttrs({countryCodeDisplaySelector:"#country_code_display",countryCodeSelector:"#country_code",countryNameSelector:"#device_country_code",phoneNumberSelector:"#phone_number",pinCodeSelector:"#numeric_pin",pinCodeSelectorRaw:"#numeric_pin_raw",submitRegisterButtonSelector:"#send_verification_pin",submitVerifyButtonSelector:"#device_verify"}),this.updateCountryCode=function(a,b){countryCode=b.value,this.select("countryCodeDisplaySelector").html("+"+countryCode),this.select("countryCodeSelector").val(countryCode),this.select("phoneNumberSelector").val()!=""&&this.callbackIfValidPhoneNumber(this.clearInvalidPhoneMessage)},this.callbackIfValidPhoneNumber=function(a){var b=this.select("countryCodeSelector").val(),c=this.select("phoneNumberSelector").val(),d=this.validatePhoneNumber(b,c);d?a.call(this):this.showInvalidPhoneMessage(b)},this.showInvalidPhoneMessage=function(a){var b=_('US und kanadische Telefonnummern m\xfcssen 11 Zeichen haben.'),c=_('Dies scheint eine ung\xfcltige Telefonnummer zu sein.'),d=a==="1"?b:c;d+=_('Bitte gib eine g\xfcltige Telefonnummer ein.'),this.trigger("uiAlertBanner",{message:d})},this.clearInvalidPhoneMessage=function(){this.trigger("uiAlertBannerClose")},this.validatePhoneNumber=function(a,b){var c=/\(*\)*\+*-*#* */g,d=b.replace(c,""),e=/^\d{11}$/;return a!="1"&&(e=/^\d{10,15}$/),e.test(a+d)},this.enableIfValue=function(a){return function(b,c){var d=b.target||b.srcElement;this.select(a).attr("disabled",d.value==="")}},this.stripPin=function(a){return a.replace(/[^a-zA-Z0-9]/g,"")},this.after("initialize",function(){SelectBox.attachTo(this.attr.countryNameSelector),this.on(this.attr.countryNameSelector,"uiItemSelect",this.updateCountryCode),this.on("input",{phoneNumberSelector:this.enableIfValue("submitRegisterButtonSelector"),pinCodeSelectorRaw:this.enableIfValue("submitVerifyButtonSelector")})})}var _=require("core/i18n"),SelectBox=require("app/ui/forms/select_box");module.exports=withPhonePinVerification
});
define("app/ui/dialogs/sms_confirmation_dialog",["module","require","exports","core/component","core/i18n","app/ui/with_dialog","app/ui/with_phone_pin_verification"],function(module, require, exports) {
function smsConfirmationDialog(){this.defaultAttrs({phoneNumberInputModalSelector:"#sms-confirmation-begin-modal",pinVerificationModalSelector:"#sms-confirmation-complete-modal",alertBoxSelector:"#sms-alert-box",alertMessageSelector:"#sms-alert-message",alertBoxCloseSelector:"#sms-alert-close",authenticityTokenSelector:"#authenticity_token",resendCodeSelector:"#resend_code"}),this.setUpDialog=function(a,b){this.reset(),this.open()},this.reset=function(){this.select("pinVerificationModalSelector").hide(),this.select("phoneNumberSelector").val(""),this.savedPhoneNumber="",this.savedCountryCode=""},this.afterOpen=function(){this.position(),this.select("alertBoxSelector").hide()},this.alertBannerHandler=function(a,b){this.showAlert(b.message)},this.showAlert=function(a){this.select("alertBoxSelector").show(),this.select("alertMessageSelector").text(a)},this.hideAlert=function(){this.select("alertBoxSelector").hide(),this.select("alertMessageSelector").text("")},this.sendPinCode=function(a,b){a.preventDefault(),this.callbackIfValidPhoneNumber(function(){var a=this.select("phoneNumberSelector").val(),b=this.select("countryCodeSelector").val();this.savedPhoneNumber=a,this.savedCountryCode=b,this.trigger("uiSendPinAction",{phone_number:a,country_code:b})})},this.resendPinCode=function(){this.trigger("uiResendPinAction",{phone_number:this.savedPhoneNumber,country_code:this.savedCountryCode})},this.verifyPinCode=function(a,b){a.preventDefault();var c=this.stripPin(this.select("pinCodeSelectorRaw").val());if(!c){this.showAlert(_('Falscher Code. Bitte versuche es erneut oder fordere einen neuen an.'));return}this.trigger("uiVerifyPinAction",{numeric_pin:c,phone_number:this.savedPhoneNumber,country_code:this.savedCountryCode})},this.sendPinSuccess=function(a,b){this.select("phoneNumberInputModalSelector").remove(),this.hideAlert();var c=this.trimSavedPhoneNumber();this.select("pinVerificationModalSelector").find("#phone_number_to_verify").html(c),this.select("pinVerificationModalSelector").show(),this.trigger("uiVerifyPinFormImpression")},this.trimSavedPhoneNumber=function(){var a=/\(*\)*\+*-*#* */g,b=this.savedPhoneNumber.replace(a,"");return this.savedCountryCode+b},this.verifyPinSuccess=function(a,b){this.isCompleted=!0,this.close(),this.trigger("uiShowMessage",{message:_('Dein Account ist entsperrt.')})},this.resendPinSuccess=function(a,b){this.showAlert(b.message)},this.updateSmsConfirmationCountryCode=function(a,b){this.trigger("uiSmsConfirmationCountryChange")},this.phoneNumberInput=function(a,b){this.startedPhoneInput||(this.trigger("uiSmsConfirmationPhoneNumberInput"),this.startedPhoneInput=!0)},this.pinInput=function(a,b){this.startedPinInput||(this.trigger("uiSmsConfirmationPinCodeInput"),this.startedPinInput=!0)},this.around("close",function(a){this.isOpen()&&!this.isCompleted&&this.trigger("uiCancelSmsConfirmationDialog"),a()}),this.after("initialize",function(){this.on(document,"uiNeedsSmsConfirmationDialog",this.setUpDialog),this.on("uiDialogOpened",this.afterOpen),this.on(document,"dataSendPinSuccess",this.sendPinSuccess),this.on(document,"dataResendPinSuccess",this.resendPinSuccess),this.on(document,"dataVerifyPinSuccess",this.verifyPinSuccess);var a=this.attr.show_sms_confirmation_dialog;a&&this.trigger("uiNeedsSmsConfirmationDialog"),this.on("click",{submitRegisterButtonSelector:this.sendPinCode,submitVerifyButtonSelector:this.verifyPinCode,alertBoxCloseSelector:this.clearInvalidPhoneMessage,resendCodeSelector:this.resendPinCode}),this.on("uiAlertBanner",this.alertBannerHandler),this.on("uiAlertBannerClose",this.hideAlert),this.on("submit",{phoneNumberInputModalSelector:this.sendPinCode,pinVerificationModalSelector:this.verifyPinCode}),this.on("change",{countryNameSelector:this.updateSmsConfirmationCountryCode}),this.on("input",{phoneNumberSelector:this.phoneNumberInput,pinCodeSelectorRaw:this.pinInput}),this.startedPhoneInput=!1,this.startedPinInput=!1,this.isCompleted=!1})}var defineComponent=require("core/component"),_=require("core/i18n"),withDialog=require("app/ui/with_dialog"),withPhonePinVerification=require("app/ui/with_phone_pin_verification"),SmsConfirmationDialog=defineComponent(withDialog,withPhonePinVerification,smsConfirmationDialog);module.exports=SmsConfirmationDialog
});
define("app/data/sms_confirmation_scribe",["module","require","exports","core/component","app/data/with_scribe"],function(module, require, exports) {
function smsConfirmationScribe(){this.scribeDialogImpression=function(a,b){this.scribe({component:"sms_confirmation_dialog",action:"impression"},b)},this.scribeCountryChange=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"mobile_country_code",action:"change"},b)},this.scribePhoneNumberInput=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"phone_number",action:"change"},b)},this.scribeSendPinClick=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"activate_mobile",action:"click"},b)},this.scribeVerifyPinFormImpression=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"verify_pin",action:"impression"},b)},this.scribePinCodeInput=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"verify_pin",action:"input"},b)},this.scribeVerifyButtonClick=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"verify_pin",action:"click"},b)},this.scribeResendPinCodeButtonClick=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"resend_pin",action:"click"},b)},this.scribeDialogCancelClick=function(a,b){this.scribe({component:"sms_confirmation_dialog",action:"cancel"},b)},this.scribeUnlockSuccessImpression=function(a,b){this.scribe({component:"sms_confirmation_dialog",element:"verify_pin",action:"success"},b)},this.after("initialize",function(){this.on("dataVerifyPinSuccess",this.scribeUnlockSuccessImpression),this.on("uiCancelSmsConfirmationDialog",this.scribeDialogCancelClick),this.on("uiNeedsSmsConfirmationDialog",this.scribeDialogImpression),this.on("uiResendPinAction",this.scribeResendPinCodeButtonClick),this.on("uiSendPinAction",this.scribeSendPinClick),this.on("uiSmsConfirmationCountryChange",this.scribeCountryChange),this.on("uiSmsConfirmationPhoneNumberInput",this.scribePhoneNumberInput),this.on("uiSmsConfirmationPinCodeInput",this.scribePinCodeInput),this.on("uiVerifyPinAction",this.scribeVerifyButtonClick),this.on("uiVerifyPinFormImpression",this.scribeVerifyPinFormImpression)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe");module.exports=defineComponent(smsConfirmationScribe,withScribe)
});
define("app/data/spam_challenge",["module","require","exports","core/component","core/i18n","app/data/with_data"],function(module, require, exports) {
function spamChallenge(){this.defaultAttrs({supportedChallengeTypes:["Captcha"],captchaName:"Captcha",defaultCompletionMessage:_('Aufgabe abgeschlossen.'),recaptchaLoadTime:100,maxCaptchaLoadRetries:3}),this.hitChallengeEndpoint=function(a){this.get({url:"/account/challenge",data:{challenge:a.challenge,response:a.response,challenge_name:a.challengeName},success:this.handleSuccessResponse.bind(this),error:this.handleErrorResponse.bind(this)})},this.handleErrorResponse=function(a){this.closeCurrentChallenge(),this.resetChallengeParams()},this.closeCurrentChallenge=function(){this.currentChallenge&&this.trigger("uiCloseSpam"+this.currentChallenge+"Challenge")},this.allChallengesCompleted=function(a){return!a.challengeName},this.isValidChallengeType=function(a){return this.attr.supportedChallengeTypes.indexOf(a.challengeName)!==-1},this.needToRefreshCaptchaChallenge=function(a){return this.currentChallenge===this.attr.captchaName&&a.challengeName===this.attr.captchaName},this.handleSuccessResponse=function(a){this.allChallengesCompleted(a)?(this.closeCurrentChallenge(),this.sendCompletionMessage(),this.resetChallengeParams()):this.needToRefreshCaptchaChallenge(a)?this.trigger("uiRefreshSpamCaptchaChallenge"):this.isValidChallengeType(a)?(this.closeCurrentChallenge(),this.setAndOpenNewChallenge(a)):(this.closeCurrentChallenge(),this.resetChallengeParams())},this.setAndOpenNewChallenge=function(a){this.setChallengeParams(a.challengeName,a.completionMessage),this.trigger("uiOpenSpam"+this.currentChallenge+"Challenge",a)},this.sendCompletionMessage=function(){this.trigger("uiShowMessage",{message:this.getCompletionMessage()})},this.getCompletionMessage=function(){return this.completionMessage||this.attr.defaultCompletionMessage},this.createInitialChallenge=function(a,b){this.needToCreateRecaptchaWidget(b)?this.fetchRecaptchaScript(a,b):this.setAndOpenNewChallenge(b)},this.needToCreateRecaptchaWidget=function(a){return a.challengeName===this.attr.captchaName&&!this.isRecaptchaObjectDefined()},this.isRecaptchaObjectDefined=function(){return typeof Recaptcha!="undefined"},this.fetchScriptDone=function(a,b,c){c=="success"?this.ensureRecaptchaCreatedAndLoadChallenge(a):this.trigger(document,"uiShowError",{message:"Internal server error."})},this.fetchScriptFailure=function(a,b,c){this.trigger(document,"uiShowError",{message:"Internal server error."})},this.fetchRecaptchaScript=function(a,b){$.getScript(this.attr.recaptchaApiUrl).done(this.fetchScriptDone.bind(this,b)).fail(this.fetchScriptFailure.bind(this))},this.ensureRecaptchaCreatedAndLoadChallenge=function(a){if(this.isRecaptchaObjectDefined()){this.setAndOpenNewChallenge(a);return}this.loadAttempts=this.attr.maxCaptchaLoadRetries,this.recaptchaLoadInterval=setInterval(this.checkIfRecaptchaCreated.bind(this,a),this.attr.recaptchaLoadTime)},this.clearRecaptchLoadInterval=function(){clearInterval(this.recaptchaLoadInterval)},this.clearLoadAttempts=function(){this.loadAttempts=undefined},this.isLoadAttemptsDefined=function(){return typeof this.loadAttempts!="undefined"},this.checkIfRecaptchaCreated=function(a){this.isLoadAttemptsDefined()&&this.loadAttempts--,this.isRecaptchaObjectDefined()&&(this.clearRecaptchLoadInterval(),this.setAndOpenNewChallenge(a),this.clearLoadAttempts());if(!this.isLoadAttemptsDefined()||this.loadAttempts<=0)this.clearRecaptchLoadInterval(),this.clearLoadAttempts(),this.trigger(document,"uiShowError",{message:"Internal server error."})},this.submitChallenge=function(a,b){this.hitChallengeEndpoint(b)},this.resetChallengeParams=function(){this.setChallengeParams()},this.setChallengeParams=function(a,b){this.currentChallenge=a,this.completionMessage=b},this.after("initialize",function(){this.on("uiSubmitSpamChallenge",this.submitChallenge),this.on("dataInitialChallengeNeeded",this.createInitialChallenge)})}var defineComponent=require("core/component"),_=require("core/i18n"),withData=require("app/data/with_data");module.exports=defineComponent(spamChallenge,withData)
});
define("app/ui/spoonbill",["module","require","exports","core/component","template","app/ui/with_user_actions","app/ui/with_item_actions","app/ui/with_interaction_data","app/data/with_interaction_data_scribe"],function(module, require, exports) {
function Spoonbill(){this.defaultAttrs({eventData:{scribeContext:{component:"spoonbill"}},toastClass:"WebToast",toastSelector:".WebToast",closeButtonSelector:".WebToast-closeButton",headerSelector:".WebToast-header",toastfollowButtonSelector:".WebToast-followButton",fullnameSelector:".WebToast-fullname",usernameSelector:".WebToast-username",avatarSelector:".WebToast-avatar",excerptSelector:".WebToast-tweetExcerpt",actionBarSelector:".WebToast-actionBar",tweetTextSelector:".tweet-text",inlineReplySelector:".js-inlineReply",tweetFormSelector:".WebToast-box .tweet-form",redirectToNotificationsSelector:'.WebToast[data-redirect-to="notifications"]'}),this.elementIsClickableTarget=function(a){var b=["a","b","button","strong"];return a&&a.tagName&&b.indexOf(a.tagName.toLowerCase())>-1},this.hasAncestorWithClickableTarget=function(a,b){var c=!1;while(a){this.elementIsClickableTarget(a)&&(c=!0);if(c||a==b)break;a=a.parentElement}return c},this.redirectToNotifications=function(a,b){if(this.hasAncestorWithClickableTarget(a.target,a.currentTarget))return;this.trigger("uiNavigate",{href:"/i/notifications"})},this.renderSpoonbillNotification=function(a,b){var c="spoonbill_"+(new Date).getTime(),d=$(template["spoonbill/"+b.type].render(b,template));this.$node.empty(),this.$node.append(d),d.fadeIn(),this.setupUIElementsForSpoonbill(d,b),d.attr("id",c),b.elementId=c,this.trigger("uiSpoonbillDidShow",b),this.scribeInteraction({action:"impression"},this.interactionData(d))},this.spoonbillDismiss=function(a,b){this.markDMRead(),this.scribeInteraction({action:"dismiss"},this.interactionData(a)),this.trigger("uiNotificationDismissed",{}),a.stopPropagation()},this.replyClick=function(){var a=this.$node.data("reply_data");a&&this.trigger(document,"uiOpenReplyDialog",a)},this.setupMentionUIForSpoonbill=function(a,b){this.$node.data("reply_data",{id:b.tweet_id,screenNames:[b.user_screen_name].concat(b.mentions),impressionId:b.impression_id}),this.defaultItemType="tweet"},this.markDMRead=function(){this.dmData&&this.dmData.tweet_id&&this.trigger("dataMarkDMsAsRead",{last_message_id:this.dmData.tweet_id,recipient_id:this.dmData.user_id,recipient_name:this.dmData.user_screen_name,from_notification:!0}),this.dmData=null},this.setupDMUIForSpoonbill=function(a,b){this.dmData=b,b.media_upload_domain=this.attr.uploadDomain,b.hide_button_labels=!0,$(template.swift_dm_box.render(b,template)).appendTo(this.select("inlineReplySelector"));var c=this.select("tweetFormSelector");c.trigger("uiInitTweetbox",{noTeardown:!0,suppressFlashMessage:!0,eventData:{scribeContext:{component:"spoonbill"}},dmOnly:!0,fileDataString:"media",fileInputString:"media"}),this.defaultItemType="tweet"},this.setupFollowUIForSpoonbill=function(a,b){this.defaultItemType="user"},this.setupFavoriteUIForSpoonbill=function(a,b){this.defaultItemType="activity"},this.setupRetweetUIForSpoonbill=function(a,b){this.defaultItemType="activity"},this.setupUIElementsForSpoonbill=function(a,b){b.type=="mention"?this.setupMentionUIForSpoonbill(a,b):b.type=="dm"?this.setupDMUIForSpoonbill(a,b):b.type=="follow"?this.setupFollowUIForSpoonbill(a,b):b.type=="favorite"?this.setupFavoriteUIForSpoonbill(a,b):b.type=="retweet"&&this.setupRetweetUIForSpoonbill(a,b)},this.dmScreenName=function(){return this.select("toastSelector").data("screen-name")},this.sendDM=function(a,b){this.markDMRead(),this.attr.sentTweetboxId=b.tweetboxId,a.stopPropagation(),a.preventDefault(),this.trigger("uiDMDialogSendMessage",{tweetboxId:b.tweetboxId,screen_name:this.dmScreenName(),text:b.tweetData.status,source:"spoonbill"}),this.trigger("uiNotificationComposeActive",b)},this.sendDMWithMedia=function(a,b){this.markDMRead(),b.recipient=this.dmScreenName(),this.attr.sentTweetboxId=b.tweetboxId,this.trigger("uiNotificationComposeActive",b)},this.sendTweet=function(a,b){this.attr.sentTweetboxId=b.tweetboxId,this.trigger("uiNotificationComposeActive",b)},this.resetOnSend=function(){this.attr.sentTweetboxId=undefined,this.trigger("uiNotificationComposeComplete")},this.sendDMSuccess=function(a,b){b.sourceEventData.tweetboxId==this.attr.sentTweetboxId&&this.resetOnSend()},this.sendTweetSuccess=function(a,b){b.tweetboxId==this.attr.sentTweetboxId&&this.resetOnSend()},this.resumeRotation=function(a,b){this.trigger("uiResumeSpoonbillRotation")},this.after("initialize",function(){this.on(document,"uiRequestSpoonbillRender",this.renderSpoonbillNotification),this.on("uiReplyToTweet",this.replyClick),this.on("uiSendDM",this.sendDM),this.on("uiSendDMWithMedia",this.sendDMWithMedia),this.on("uiSendTweet",this.sendTweet),this.on(document,"dataDMSuccess",this.sendDMSuccess),this.on(document,"dataTweetSuccess",this.sendTweetSuccess),this.on(document,"dataTweetError dataDMError",this.resumeRotation),this.on("click",{closeButtonSelector:this.spoonbillDismiss,redirectToNotificationsSelector:this.redirectToNotifications})})}var defineComponent=require("core/component"),template=require("template"),withUserActions=require("app/ui/with_user_actions"),withItemActions=require("app/ui/with_item_actions"),withInteractionData=require("app/ui/with_interaction_data"),withInteractionDataScribe=require("app/data/with_interaction_data_scribe");module.exports=defineComponent(Spoonbill,withUserActions,withItemActions,withInteractionData,withInteractionDataScribe)
});
define("app/ui/spoonbill_producer",["module","require","exports","core/component","app/utils/storage/core"],function(module, require, exports) {
function SpoonbillProducer(){this.defaultAttrs({spoonbillDuration:{mention:8e3,dm:8e3,follow:8e3,normal:5e3},betweenInterval:2e3,eventTypeMapper:{direct_message:"dm",favorited:"favorite",favorited_mention:"favorite",favorited_retweet:"favorite",followed:"follow",followed_request:"follow",retweeted:"retweet",retweeted_mention:"retweet",retweeted_retweet:"retweet"},acceptEventTypes:["dm","favorite","follow","retweet","mention"],queue:[],toastClass:"WebToast",toastSelector:".WebToast",tweetFormSelector:".WebToast-box .tweet-form",closeButtonSelector:".WebToast-close",displayState:undefined}),this.incomingSpoonbills=function(a,b){if(!b||typeof b!="object"||!Array.isArray(b.toasts))return;b.force&&(this.latestNotificationTimestamp=0),this.normalizeSpoonbills(b.toasts).forEach(function(a){this.attr.eventTypeMapper.hasOwnProperty(a.type)&&(a.type=this.attr.eventTypeMapper[a.type]);if(this.attr.acceptEventTypes.indexOf(a.type)<0)return;this.addSpoonbill(a)},this),this.latestNotificationTimestamp=++b.latest,storage.setItem("latestNotificationTimestamp",this.latestNotificationTimestamp)},this.addSpoonbill=function(a){if(!a.timestamp||a.timestamp<this.latestNotificationTimestamp)return;this.attr.queue.push(a),this.displayState==DisplayState.None&&this.showSpoonbill()},this.showSpoonbill=function(){var a=this.getNext();if(!a){this.displayState=DisplayState.None;return}this.displayState=DisplayState.Visible,this.removeMouseBindings(),this.trigger("uiRequestSpoonbillRender",a)},this.getPath=function(){return location.pathname},this.getNext=function(){var a=this.attr.queue.shift();if(this.getPath()=="/i/notifications")while(a&&(a.type=="retweet"||a.type=="favorite"))a=this.attr.queue.shift();return a&&a.type=="follow"&&(a.with_block_username=!0),a},this.normalizeSpoonbills=function(a){return a.filter(function(a){return a.timestamp}).sort(function(a,b){return a.timestamp-b.timestamp})},this.removeMouseBindings=function(){this.select("toastSelector").unbind("mouseenter",this.notificationMouseEnterHandler),this.select("toastSelector").unbind("mouseleave",this.notificationMouseLeaveHandler)},this.clearTimers=function(a){a.forEach(function(a){this[a]&&(clearTimeout(this[a]),delete this[a])}.bind(this))},this.purgeNotifications=function(a){this.removeMouseBindings(),this.clearTimers(["rotateTimer","updateTimer"]),this.attr.queue=[],this.fadeOut()},this.fadeOut=function(){this.select("toastSelector").animate({opacity:0},function(){this.select("tweetFormSelector").trigger("uiAllowTeardown",{}),this.select("toastSelector").remove(),this.displayState=DisplayState.Between,this.clearTimers(["rotateTimer"]),this.rotateTimer=setTimeout(this.showSpoonbill.bind(this),this.attr.betweenInterval)}.bind(this))},this.updateNotificationDisplay=function(a){this.checkForUserData(),this.displayState>DisplayState.Visible?this.monitorVisibleSpoonbill(a):this.displayState==DisplayState.Visible&&this.fadeOut()},this.monitorVisibleSpoonbill=function(a){this.clearTimers(["updateTimer"]),this.updateTimer=setTimeout(this.updateNotificationDisplay.bind(this,a),this.getRotateInterval(a.type))},this.getRotateInterval=function(a){return this.attr.spoonbillDuration.hasOwnProperty(a)?this.attr.spoonbillDuration[a]:this.attr.spoonbillDuration.normal},this.checkForUserData=function(){if(this.displayState>DisplayState.Composing)return;var a=this.$node.find(".tweet-button"),b=a.is(":visible")&&a.find("button.primary-btn").attr("disabled")!="disabled"&&a.find("button.primary-btn.disabled").length==0,c=$.contains(this.$node[0],document.activeElement);b||c?this.displayState=DisplayState.Composing:this.displayState>DisplayState.Visible&&(this.displayState=DisplayState.Visible)},this.spoonbillDidShow=function(a,b){var c=$("#"+b.elementId);this.notificationMouseEnterHandler=this.handleMouseEnterForNotifications.bind(this),this.notificationMouseLeaveHandler=this.handleMouseLeaveForNotifications.bind(this),c.bind("mouseenter",this.notificationMouseEnterHandler),c.bind("mouseleave",this.notificationMouseLeaveHandler),this.monitorVisibleSpoonbill(b)},this.processNewNotifications=function(a,b){b&&b.n&&b.n.status=="ok"&&b.n.response&&typeof b.n.response=="object"&&this.trigger("uiNewSpoonbillsArrived",b.n.response)},this.composeActive=function(a,b){this.displayState=DisplayState.Composing},this.composeComplete=function(a,b){this.fadeOut()},this.handleMouseEnterForNotifications=function(a,b){this.displayState=DisplayState.Focused},this.handleMouseLeaveForNotifications=function(a,b){this.displayState=DisplayState.Visible},this.handleImagePickerClick=function(a,b){this.displayState=DisplayState.Attaching},this.after("initialize",function(){this.displayState=DisplayState.None,this.on(document,"uiNotificationComposeActive",this.composeActive),this.on(document,"uiNotificationComposeComplete",this.composeComplete),this.on(document,"uiNewSpoonbillsArrived",this.incomingSpoonbills),this.on(document,"uiSpoonbillDidShow",this.spoonbillDidShow),this.on(document,"uiNotificationRotate",this.showSpoonbill),this.on(document,"dataNotificationsReceived",this.processNewNotifications),this.on("uiImagePickerClick",this.handleImagePickerClick),this.on("uiNotificationDismissed",this.purgeNotifications),this.on("mouseenter",this.handleMouseEnterForNotifications),this.on("mouseleave",this.handleMouseLeaveForNotifications)})}var defineComponent=require("core/component"),Storage=require("app/utils/storage/core");module.exports=defineComponent(SpoonbillProducer);var storage=new Storage("DM"),DisplayState={None:1,Between:2,Visible:3,Composing:4,Focused:5,Attaching:6}
});
define("app/data/sru_stats_scribe",["module","require","exports","core/component","app/data/with_perftown_scribe","app/data/user_info","app/utils/browser"],function(module, require, exports) {
function SruStatsScribe(){this.scribeSruStats=function(a,b){var c=["stats","sru",b.mediaCategory,b.command,b.status],d={browser:browser($.browser),append_byte_size:b.appendByteSize,total_duration_ms:b.totalDuration,total_byte_size:b.totalByteSize};this.scribePerftown(c.join(":"),b.duration,d)},this.after("initialize",function(){userInfo.getDecider("web_sru_stats")&&this.on("dataSruStats",this.scribeSruStats)})}var defineComponent=require("core/component"),withPerftownScribe=require("app/data/with_perftown_scribe"),userInfo=require("app/data/user_info"),browser=require("app/utils/browser");module.exports=defineComponent(SruStatsScribe,withPerftownScribe)
});
define("app/ui/tco_preconnector",["module","require","exports","core/component"],function(module, require, exports) {
function tCoPreconnector(){this.defaultAttrs({tcoSelector:".js-display-url",appendTarget:"head"}),this.preconnect=function(a){var b=a.target.parentNode,c=b&&b.href,d=b&&b.getAttribute("data-expanded-url");d&&c&&c.indexOf("https://t.co/")===0&&$('<link rel="preconnect">').attr({href:d}).appendTo(this.attr.appendTarget)},this.after("initialize",function(){this.on("click",{tcoSelector:this.preconnect})})}var defineComponent=require("core/component"),TCoPreconnector=defineComponent(tCoPreconnector);module.exports=TCoPreconnector
});
define("app/ui/dialogs/translation_feedback_dialog",["module","require","exports","core/component","app/data/with_data","app/ui/with_dialog","app/ui/dialogs/with_modal_tweet","app/ui/compose/with_text_editor"],function(module, require, exports) {
function translationFeedbackDialog(){this.defaultAttrs({width:590,sourceLangSelector:".TranslationFeedbackDialog-sourceLanguage select",translationInputSelector:".TranslationFeedbackDialog-translationInput",submitSelector:".modal-submit"}),this.openDialog=function(a,b){this.resetDialog(),this.displayTweet(b.tweetId,{modal:"translation_feedback",disableLinks:!0}),this.tweetId=b.tweetId,this.destLang=b.destLang,this.select("sourceLangSelector").val(b.sourceLang),this.setVisibleText(this.unescapeHtml(b.translation)),this.open()},this.resetDialog=function(){this.enableSubmitButton()},this.unescapeHtml=function(a){return $("<div/>").html(a).text()},this.submit=function(){this.disableSubmitButton();var a={id:this.tweetId,source:this.select("sourceLangSelector").val(),dest:this.destLang,translation:this.getVisibleText()};this.trigger("uiSuggestTweetTranslation",a)},this.enableSubmitButton=function(){this.select("submitSelector").removeAttr("disabled")},this.disableSubmitButton=function(){this.select("submitSelector").attr("disabled",!0)},this.isEmpty=function(){return!this.getVisibleText().trim()},this.updateSubmitButton=function(){this.isEmpty()?this.disableSubmitButton():this.enableSubmitButton()},this.translationSubmitted=function(a,b){this.enableSubmitButton(),this.close()},this.submissionError=function(a,b){this.enableSubmitButton(),this.close()},this.after("initialize",function(){this.attr.textSelector=this.attr.translationInputSelector,this.initTextNode(),this.on(document,"uiNeedsTranslationFeedbackDialog",this.openDialog),this.on(document,"dataTweetTranslationSuggestionSuccess",this.translationSubmitted),this.on(document,"dataTweetTranslationSuggestionError",this.submissionError),this.on("uiTextChanged",this.updateSubmitButton),this.on("click",{submitSelector:this.submit})})}var defineComponent=require("core/component"),withData=require("app/data/with_data"),withDialog=require("app/ui/with_dialog"),withModalTweet=require("app/ui/dialogs/with_modal_tweet"),withTextEditor=require("app/ui/compose/with_text_editor");module.exports=defineComponent(translationFeedbackDialog,withDialog,withTextEditor,withModalTweet,withData)
});
define("app/ui/with_profile_tweet_stat_count_data",["module","require","exports"],function(module, require, exports) {
function withProfileTweetStatCountData(){this.before("toggleFavorite",function(a,b,c){c.tweetData.tweetStatCount=c.$tweet.find(".ProfileTweet-action--favorite .ProfileTweet-actionCount").attr("data-tweet-stat-count")}),this.before("toggleRetweet",function(a,b,c){c.tweetData.tweetStatCount=c.$tweet.find(".ProfileTweet-action--retweet .ProfileTweet-actionCount").attr("data-tweet-stat-count")})}module.exports=withProfileTweetStatCountData
});
define("app/ui/with_tweet_action_animation",["module","require","exports"],function(module, require, exports) {
function withTweetActionAnimation(){this.defaultAttrs({tweetActionContainerSelector:".ProfileTweet-action",animationStateClass:"is-animating",animationTweetSelector:".tweet",animationName:"heart-burst"}),this.getTweetActions=function(a){return a.find(this.attr.tweetActionContainerSelector)},this.isTweetAnimating=function(a){return this.getTweetActions(a).find(this.animationStateClass)},this.cleanupAnimation=function(a){this.isTweetAnimating(a)&&(this.getTweetActions(a).removeClass(this.attr.animationStateClass),this.trigger("uiAnimationEnd"))},this.completeAnimation=function(a){a.originalEvent&&a.originalEvent.animationName===this.attr.animationName&&this.cleanupAnimation($(a.target).closest(this.attr.animationTweetSelector))},this.unfavoriteHandler=function(a){this.cleanupAnimation($(a.target))},this.animateAction=function(a,b){this.getTweetActions($(a.target)).addClass(this.attr.animationStateClass)},this.after("initialize",function(){this.on(document,"uiDidFavoriteTweet",this.animateAction),this.on(document,"uiDidUnfavoriteTweet",this.unfavoriteHandler),this.on("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationend",{animationTweetSelector:this.completeAnimation})})}module.exports=withTweetActionAnimation
});
define("app/ui/with_hover_state_removal",["module","require","exports"],function(module, require, exports) {
function withHoverStateRemoval(){this.addCancelHoverStyleClass=function(a,b,c){var d=$(a.target).closest(this.attr.tweetItemSelector),e=$(a.target).closest(this.attr.toggleContainerSelector);if(a.type!="click"||d.hasClass(this.attr.favoritedTweetClass)||d.hasClass(this.attr.retweetedTweetClass)){e.removeClass("is-hoverStateCancelled");return}e.addClass("is-hoverStateCancelled"),e.one("mouseleave",function(){e.removeClass("is-hoverStateCancelled")}.bind(this))},this.after("toggleFavorite",this.addCancelHoverStyleClass),this.after("toggleRetweet",this.addCancelHoverStyleClass)}module.exports=withHoverStateRemoval
});
define("app/ui/tweet_actions",["module","require","exports","core/component","app/utils/find_tweet","app/utils/tweet_helper","core/utils","app/ui/with_tweet_actions_helper","app/ui/with_interaction_data","app/ui/with_profile_tweet_stat_count_data","app/ui/with_tweet_action_animation","app/ui/with_hover_state_removal"],function(module, require, exports) {
function tweetActions(){this.defaultAttrs({favoriteSelector:".js-toggle-fav a, .js-actionFavorite",replySelector:".js-actionReply",retweetSelector:".js-toggleRt a:not([aria-disabled=true]), .js-actionRetweet:not(:disabled)",quickPromoteSelector:".js-actionQuickPromote",permalinkSelector:".tweet .js-permalink",tweetItemSelector:".tweet",retweetInlineSelector:".js-actionInlineRetweet",togglableTweetActionsSelector:"a:visible",toggleContainerSelector:".js-toggleState",anyLoggedInActionSelector:".js-toggleRt a:not([aria-disabled=true]), .js-toggle-fav a, .js-actionReply, .js-actionRetweet, .js-actionFavorite, .js-actionCount",favoritedTweetClass:"favorited",retweetedTweetClass:"retweeted"}),this.handleTransition=function(a,b){return function(c,d){var e=d.id||d.sourceEventData.id,f=findTweet(this.$node,this.attr.tweetItemSelector,e),g=f[0],h=document.activeElement,i;g&&$.contains(g,h)&&(i=$(h).closest(this.attr.toggleContainerSelector)),f[a](b),i&&i.find(this.attr.togglableTweetActionsSelector).focus()}},this.getDataForReply=function(a){return{screenNames:tweetHelper.extractMentionsForReply(a,this.attr.screenName),replyLinkClick:!0}},this.toggleFavorite=function(a,b,c){var d=c.$tweet.hasClass(this.attr.favoritedTweetClass)?"uiDidUnfavoriteTweet":"uiDidFavoriteTweet";this.trigger(c.$tweet,d,c.tweetData)},this.toggleRetweet=function(a,b,c){var d=c.$tweet.hasClass(this.attr.retweetedTweetClass)?"uiDidUnretweet":"uiOpenRetweetDialog";this.trigger(c.$tweet,d,c.tweetData)},this.uiOpenSignupDialog=function(a,b,c){var d=$(b.el),e;d.is(this.attr.replySelector)?e="reply":d.is(this.attr.retweetSelector)?e="retweet":d.is(this.attr.favoriteSelector)?e="favorite":e="default",this.trigger("uiOpenSignupDialog",{screenName:c.tweetData.screenName,action:e})},this.handleLoggedOutFavoriteClick=function(a,b,c){this.trigger("uiLoggedOutActionAttempt",utils.merge(c.tweetData,{action:"favorite_attempt"}))},this.handleLoggedOutRetweetClick=function(a,b,c){this.trigger("uiLoggedOutActionAttempt",utils.merge(c.tweetData,{action:"retweet_attempt"}))},this.handleLoggedOutReplyClick=function(a,b,c){this.trigger("uiLoggedOutActionAttempt",utils.merge(c.tweetData,{action:"reply_attempt"}))},this.after("initialize",function(){var a=this.mkTweetDataCollectorForAction(this.interactionDataWithCard);if(!this.attr.loggedIn){this.on("click",{anyLoggedInActionSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.uiOpenSignupDialog),favoriteSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.handleLoggedOutFavoriteClick),retweetSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.handleLoggedOutRetweetClick),replySelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.handleLoggedOutReplyClick)});return}var b=this.mkTweetDataCollectorForAction(this.interactionDataWithCard,this.getDataForReply);this.on("click",{favoriteSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.toggleFavorite),retweetSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,a,this.toggleRetweet),replySelector:this.composeHandler(this.preventDefault,this.getClosestTweet,b,this.triggerTweetAction("uiReplyToTweet")),quickPromoteSelector:this.composeHandler(this.preventDefault,this.getClosestTweet,this.triggerTweetAction("uiOpenQuickPromoteDialog")),permalinkSelector:this.composeHandler(this.getClosestTweet,a,this.triggerTweetAction("uiPermalinkClick"))}),this.on(document,"uiDidFavoriteTweet dataFailedToUnfavoriteTweet",this.handleTransition("addClass",this.attr.favoritedTweetClass)),this.on(document,"uiDidUnfavoriteTweet dataFailedToFavoriteTweet",this.handleTransition("removeClass",this.attr.favoritedTweetClass)),this.on(document,"uiDidRetweet dataFailedToUnretweet",this.handleTransition("addClass",this.attr.retweetedTweetClass)),this.on(document,"uiDidUnretweet dataFailedToRetweet",this.handleTransition("removeClass",this.attr.retweetedTweetClass))})}var defineComponent=require("core/component"),findTweet=require("app/utils/find_tweet"),tweetHelper=require("app/utils/tweet_helper"),utils=require("core/utils"),withTweetActionsHelper=require("app/ui/with_tweet_actions_helper"),withInteractionData=require("app/ui/with_interaction_data"),withTweetStatCountData=require("app/ui/with_profile_tweet_stat_count_data"),withTweetActionAnimation=require("app/ui/with_tweet_action_animation"),withHoverStateRemoval=require("app/ui/with_hover_state_removal"),TweetActions=defineComponent(tweetActions,withTweetActionsHelper,withInteractionData,withTweetStatCountData,withTweetActionAnimation,withHoverStateRemoval);module.exports=TweetActions
});
define("app/ui/tweet_state_updater",["module","require","exports","core/component"],function(module, require, exports) {
function tweetStateUpdater(){this.updateRetweetState=function(a,b){var c=this.$node.find('[data-tweet-id="'+b.tweet_id+'"]');c.each(function(){$(this).attr("data-my-retweet-id",b.retweet_id)})},this.updateUnRetweetState=function(a,b){var c=this.$node.find('[data-tweet-id="'+b.tweet_id+'"]');c.each(function(){$(this).removeAttr("data-my-retweet-id")})},this.after("initialize",function(){if(!this.attr.loggedIn)return;this.on(document,"dataDidRetweet",this.updateRetweetState),this.on(document,"dataDidUnretweet",this.updateUnRetweetState)})}var defineComponent=require("core/component"),TweetStateUpdater=defineComponent(tweetStateUpdater);module.exports=TweetStateUpdater
});
define("app/data/typeahead/with_cache",["module","require","exports"],function(module, require, exports) {
function WithCache(){this.defaultAttrs({cache_limit:10}),this.getCachedSuggestions=function(a){return this.cache[a]?this.cache[a].value:null},this.clearCache=function(){this.cache={NEWEST:null,OLDEST:null,COUNT:0,LIMIT:this.attr.cache_limit}},this.deleteCachedSuggestions=function(a){return this.cache[a]?(this.cache.COUNT>1&&(a==this.cache.NEWEST.query?(this.cache.NEWEST=this.cache.NEWEST.before,this.cache.NEWEST.after=null):a==this.cache.OLDEST.query?(this.cache.OLDEST=this.cache.OLDEST.after,this.cache.OLDEST.before=null):(this.cache[a].after.before=this.cache[a].before,this.cache[a].before.after=this.cache[a].after)),delete this.cache[a],this.cache.COUNT-=1,!0):!1},this.setCachedSuggestions=function(a,b){if(this.cache.LIMIT===0)return;this.deleteCachedSuggestions(a),this.cache.COUNT>=this.cache.LIMIT&&this.deleteCachedSuggestions(this.cache.OLDEST.query),this.cache.COUNT==0?(this.cache[a]={query:a,value:b,before:null,after:null},this.cache.NEWEST=this.cache[a],this.cache.OLDEST=this.cache[a]):(this.cache[a]={query:a,value:b,before:this.cache.NEWEST,after:null},this.cache.NEWEST.after=this.cache[a],this.cache.NEWEST=this.cache[a]),this.cache.COUNT+=1},this.aroundGetSuggestions=function(a,b,c){var d=c.id+":"+c.query,e=this.getCachedSuggestions(d);if(e){this.triggerSuggestionsEvent(c.id,c.query,e);return}a(b,c)},this.afterTriggerSuggestionsEvent=function(a,b,c,d){if(d)return;var e=a+":"+b;this.setCachedSuggestions(e,c)},this.after("triggerSuggestionsEvent",this.afterTriggerSuggestionsEvent),this.around("getSuggestions",this.aroundGetSuggestions),this.after("initialize",function(){this.clearCache(),this.on("uiTypeaheadDeleteRecentSearch",this.clearCache)})}module.exports=WithCache
});
define("app/data/with_datasource_helpers",["module","require","exports","app/data/user_info"],function(module, require, exports) {
function withDatasourceHelpers(){this.prefetch=function(a,b,c,d){var e={prefetch:!0,result_type:b,count:this.getPrefetchCount(),media_tagging_in_prefetch:this.shouldIncludeCanMediaTag()};this.storage&&(e[b+"_cache_age"]=this.storage.getCacheAge(this.attr.storageHash,this.attr.ttl_ms));var f=this.get({url:a,data:e,eventData:{},success:c,error:d});return f},this.useStaleData=function(){this.storage&&(this.extendTTL(),this.getDataFromLocalStorage())},this.extendTTL=function(){var a=this.getStorageKeys();for(var b=0;b<a.length;b++)this.storage.updateTTL(a[b],this.attr.ttl_ms)},this.loadData=function(a,b){var c=this.getStorageKeys().some(function(a){return this.storage.isExpired(a)},this);c||this.isMetadataExpired()?this.prefetch(a,b,this.processResults.bind(this),this.useStaleData.bind(this)):this.getDataFromLocalStorage()},this.isIE8=function(){return $.browser.msie&&parseInt($.browser.version,10)===8},this.getProtocol=function(){return window.location.protocol},this.shouldIncludeCanMediaTag=function(){return userInfo.getDecider("enable_media_tag_prefetch")}}var userInfo=require("app/data/user_info");module.exports=withDatasourceHelpers
});
define("app/data/typeahead/accounts_datasource",["module","require","exports","app/utils/typeahead_helpers","app/utils/storage/custom","app/data/with_data","app/data/with_scribe","core/compose","core/utils","app/data/with_datasource_helpers"],function(module, require, exports) {
function accountsDatasource(a){this.attr={id:null,ttl_ms:1728e5,localStorageCount:1200,ie8LocalStorageCount:1e3,limit:6,version:4,localQueriesEnabled:!1,remoteQueriesEnabled:!1,onlyDMable:!1,onlyShowUsersWithCanMediaTag:!1,currentUserId:null,storageAdjacencyList:"userAdjacencyList",storageHash:"userHash",storageProtocol:"protocol",storageVersion:"userVersion",remotePath:"/i/search/typeahead.json",remoteType:"users",prefetchPath:"/i/search/typeahead.json",prefetchType:"users",storageBlackList:"userBlackList",maxLengthBlacklist:100},this.attr=util.merge(this.attr,a),this.after=$.noop,this.defaultAttrs=$.noop,compose.mixin(this,[withData,withDatasourceHelpers,withScribe]),this.getPrefetchCount=function(){return this.isIE8()&&this.attr.localStorageCount>this.attr.ie8LocalStorageCount?this.attr.ie8LocalStorageCount:this.attr.localStorageCount},this.isMetadataExpired=function(){var a=this.storage.getItem(this.attr.storageVersion),b=this.storage.getItem(this.attr.storageProtocol);return a==this.attr.version&&b==this.getProtocol()?!1:!0},this.getStorageKeys=function(){return[this.attr.storageVersion,this.attr.storageHash,this.attr.storageAdjacencyList,this.attr.storageProtocol]},this.getDataFromLocalStorage=function(){this.userHash=this.storage.getItem(this.attr.storageHash)||this.userHash,this.adjacencyList=this.storage.getItem(this.attr.storageAdjacencyList)||this.adjacencyList},this.processResults=function(a){if(!a||!a[this.attr.prefetchType]){this.useStaleData();return}a[this.attr.prefetchType].forEach(function(a){if(this.isAccountMalformedAndScribe(a,"typeahead_local"))return;a.tokens=a.tokens.map(function(a){return typeof a=="string"?a:a.token}),a.prefetched=!0,this.userHash[a.id]=a,a.tokens.forEach(function(b){var c=helpers.getFirstChar(b);c.trim().length&&(this.adjacencyList[c]===undefined&&(this.adjacencyList[c]=[]),this.adjacencyList[c].indexOf(a.id)===-1&&this.adjacencyList[c].push(a.id))},this)},this),this.storage.setItem(this.attr.storageHash,this.userHash,this.attr.ttl_ms),this.storage.setItem(this.attr.storageAdjacencyList,this.adjacencyList,this.attr.ttl_ms),this.storage.setItem(this.attr.storageVersion,this.attr.version,this.attr.ttl_ms),this.storage.setItem(this.attr.storageProtocol,this.getProtocol(),this.attr.ttl_ms)},this.getLocalSuggestions=function(a,b){if(!this.attr.localQueriesEnabled){b([]);return}var c=helpers.tokenizeText(a.query.replace("@","")),d=this.getPotentiallyMatchingIds(c),e=this.getAccountsFromIds(d),f=e.filter(this.matcher(c));f.sort(this.sorter),f=f.slice(0,this.attr.limit),b(f)},this.getPotentiallyMatchingIds=function(a){var b=[];return a.map(function(a){var c=this.adjacencyList[helpers.getFirstChar(a)];c&&(b=b.concat(c))},this),b=util.uniqueArray(b),b},this.getAccountsFromIds=function(a){var b=[];return a.forEach(function(a){var c=this.userHash[a];c&&b.push(c)},this),b},this.matcher=function(a){return function(b){var c=b.tokens,d=[];if(this.attr.onlyDMable&&!b.is_dm_able)return!1;if(!this.isEligibleForMediaTagSuggestion(b))return!1;var e=a.every(function(a){var b=c.filter(function(b){return b.indexOf(a)===0});return b.length});if(e)return b}.bind(this)},this.sorter=function(a,b){function e(a,b){var c=a.score_boost?a.score_boost:0,d=b.score_boost?b.score_boost:0,e=a.rounded_score?a.rounded_score:0,f=b.rounded_score?b.rounded_score:0;return f+d-(e+c)}var c=a.prefetched,d=b.prefetched;return c&&!d?-1:d&&!c?1:e(a,b)},this.processRemoteSuggestions=function(a,b,c){var d=c[this.attr.id]||[],e={};return d.forEach(function(a){e[a.id_str]=!0},this),this.requiresRemoteSuggestions(a.queryData)&&b[this.attr.remoteType]&&b[this.attr.remoteType].forEach(function(a){var b=!e[a.id_str]&&(!this.attr.onlyDMable||a.is_dm_able)&&this.isEligibleForMediaTagSuggestion(a)&&!this.isAccountMalformedAndScribe(a,"typeahead_remote");b&&d.push(a)},this),c[this.attr.id]=d.slice(0,this.attr.limit),c[this.attr.id].forEach(function(a){this.removeBlacklistSocialContext(a)},this),c},this.removeBlacklistSocialContext=function(a){a.first_connecting_user_id in this.socialContextBlackList&&(a.first_connecting_user_name=undefined,a.first_connecting_user_id=undefined)},this.requiresRemoteSuggestions=function(a){return!a||!a.query?!1:a.accountsWithoutAtSignLocalOnly?this.attr.remoteQueriesEnabled&&(helpers.getFirstChar(a.query)=="@"||a.atSignRemoved):this.attr.remoteQueriesEnabled},this.isEligibleForMediaTagSuggestion=function(a){return!this.attr.onlyShowUsersWithCanMediaTag||a.can_media_tag||a.id==this.attr.currentUserId},this.isAccountMalformedAndScribe=function(a,b){var c=helpers.isAccountMalformed(a);return c&&this.scribe({component:"local_storage",element:b,action:"empty"}),c},this.initialize=function(){var a=customStorage({withExpiry:!0});this.storage=new a("typeahead"),this.adjacencyList={},this.userHash={},this.attr.localQueriesEnabled&&this.loadData(this.attr.prefetchPath,this.attr.prefetchType),this.socialContextBlackList=this.storage.getItem(this.attr.storageBlackList)||{}},this.initialize()}var helpers=require("app/utils/typeahead_helpers"),customStorage=require("app/utils/storage/custom"),withData=require("app/data/with_data"),withScribe=require("app/data/with_scribe"),compose=require("core/compose"),util=require("core/utils"),withDatasourceHelpers=require("app/data/with_datasource_helpers");module.exports=accountsDatasource
});
define("app/data/typeahead/accounts_datasource_async",["module","require","exports","app/utils/array","app/utils/storage/indexed_db","app/utils/promises","app/utils/typeahead_helpers","app/data/with_data","app/data/with_scribe","core/compose","core/utils","app/data/with_datasource_helpers","app/utils/storage/custom"],function(module, require, exports) {
function accountsDatasourceAsync(a,b){this.attr={id:null,ttlMilliseconds:1728e5,itemCount:1e3,limit:6,version:1,localQueriesEnabled:!1,remoteQueriesEnabled:!1,onlyDMable:!1,onlyShowUsersWithCanMediaTag:!1,currentUserId:null,remotePath:"/i/search/typeahead.json",remoteType:"users",prefetchPath:"/i/search/typeahead.json",prefetchType:"users",storageBlackList:"userBlackList",maxLengthBlacklist:100,dbName:b.dbName||"accounts_typeahead",dbVersion:20150128,datastores:{MetadataStore:{name:"MetadataStore",keyPath:"key"},AccountTokensToIds:{name:"AccountTokensToIds",keyPath:"token"},IdsToAccounts:{name:"IdsToAccounts",keyPath:"id"}}},this.attr=util.merge(this.attr,a),this.after=$.noop,this.defaultAttrs=$.noop,compose.mixin(this,[withData,withDatasourceHelpers,withScribe]),this.initialize=function(a){var b=a||this.openIndexedDB.bind(this);this.isUsingIndexedDB=!0,this.initializeSocialContextBlacklist();var c=[this.attr.datastores.MetadataStore,this.attr.datastores.AccountTokensToIds,this.attr.datastores.IdsToAccounts];return b(this.attr.dbName,this.attr.dbVersion,c).then(this.checkIfLocalDataHasExpired.bind(this)).then(this.fetchDataIfExpired.bind(this)).then(this.repopulateDataStore.bind(this)).then(function(){return this}).fail(this.onInitializationError.bind(this))},this.openIndexedDB=function(a,b,c){return IndexedDB.open(a,b,c).then(function(a){this.database=a}.bind(this))},this.close=function(){this.database&&this.database.close()},this.checkIfLocalDataHasExpired=function(){return this.getData(this.attr.datastores.MetadataStore.name,this.attr.datastores.MetadataStore.keyPath).then(function(a){return this.isMetadataExpired(a)}.bind(this))},this.fetchDataIfExpired=function(a){return a&&this.attr.localQueriesEnabled&&this.prefetch(this.attr.prefetchPath,this.attr.prefetchType)},this.getData=function(a,b){return this.database.get(a,b)},this.repopulateDataStore=function(a){return a&&this.database.clear().then(this.populateDataStore.bind(this,a))},this.populateDataStore=function(a){return a&&this.database.put(this.processData(a))},this.onInitializationError=function(a){!this.isHttpError(a)&&this.close()},this.getPrefetchCount=function(){return this.attr.itemCount},this.initializeSocialContextBlacklist=function(){var a=customStorage({withExpiry:!0});this.storage=new a("typeahead"),this.socialContextBlackList=this.storage.getItem(this.attr.storageBlackList)||{}},this.isMetadataExpired=function(a){if(!a)return!0;var b=a.version!==this.attr.version,c=this.hasTTLExpired(a.expirationTime),d=a.protocol!==this.getProtocol();return b||c||d},this.processData=function(a){var b=a[this.attr.prefetchType].filter(function(a){return!this.isAccountMalformedAndScribe(a,"typeahead_local")},this);a[this.attr.prefetchType]=b;var c={};return c[this.attr.datastores.AccountTokensToIds.name]=this.createItemsForAccountTokensToIdsObjectstore(a),c[this.attr.datastores.IdsToAccounts.name]=this.createItemsForIdsToAccountsObjectstore(a),c[this.attr.datastores.MetadataStore.name]=this.createItemsForMetadataObjectstore(a),c},this.createItemsForIdsToAccountsObjectstore=function(a){var b=a[this.attr.prefetchType].map(function(a){a.prefetched=!0;var b={};return b[this.attr.datastores.IdsToAccounts.keyPath]=a.id,b.account=a,b},this);return b},this.createItemsForAccountTokensToIdsObjectstore=function(a){var b=this.attr.datastores.AccountTokensToIds.keyPath,c={},d=[];a[this.attr.prefetchType].forEach(function(a){a.tokens.forEach(function(b){var d=b.token;d!=""&&(Array.isArray(c[d])?c[d].push(a.id):c[d]=[a.id])},this)},this);for(token in c)if(c.hasOwnProperty(token)){var e={};e.ids=c[token],e[b]=token,d.push(e)}return d},this.createItemsForMetadataObjectstore=function(a){var b={};return b[this.attr.datastores.MetadataStore.keyPath]=this.attr.datastores.MetadataStore.keyPath,b.expirationTime=this.attr.ttlMilliseconds+(new Date).getTime(),b.version=this.attr.version,b.protocol=this.getProtocol(),[b]},this.addAccount=function(a){return this.getTokenIdsForAccount(a).then(this.addTokenIdsForAccount.bind(this,a)).then(this.addToIdsToAccounts.bind(this,a))},this.getTokenIdsForAccount=function(a){a=a.account||a;var b=a.tokens.map(function(a){var b=this.standardizeToken(a);return this.database.get(this.attr.datastores.AccountTokensToIds.name,b)},this);return Promise.collect(b)},this.addTokenIdsForAccount=function(a,b){var c=ArrayUtils.compact(b);c=this.addNewTokenIds(a,c),c=this.addIdToTokenIds(a,c);var d={};return d[this.attr.datastores.AccountTokensToIds.name]=c,this.database.put(d)},this.standardizeToken=function(a){return typeof a=="string"?a:a.token},this.addNewTokenIds=function(a,b){var c=[];return a.tokens.forEach(function(a){var d=b.some(function(b){return b.token==a});d||c.push(this.createTokenId(a))},this),b.concat(c)},this.addIdToTokenIds=function(a,b){return b.forEach(function(b){b.ids.push(a.id)}),b},this.createTokenId=function(a){return tokenItem={},tokenItem[this.attr.datastores.AccountTokensToIds.keyPath]=a,tokenItem.ids=[],tokenItem},this.removeAccount=function(a){return this.database.destroy(this.attr.datastores.IdsToAccounts.name,a)},this.createAddAccountOptions=function(a){var b={},c={};return b[this.attr.datastores.IdsToAccounts.keyPath]=a.id,b.account=a,c[this.attr.datastores.IdsToAccounts.name]=[b],c},this.addToIdsToAccounts=function(a){var b=this.createAddAccountOptions(a);return this.database.put(b)},this.getLocalSuggestions=function(a,b){var c=helpers.tokenizeText(a.query.replace("@",""));if(!this.attr.localQueriesEnabled||a.query===""){b([]);return}this.search(c).always(function(a){b(a)})},this.search=function(a){return this.getIds(a).then(this.filterForRelevantIds.bind(this)).then(this.getAccounts.bind(this)).then(this.filterAndSortAccounts.bind(this))},this.filterForRelevantIds=function(a){if(a.length==0)return[];var b=this.createIdGroups(a),c=util.uniqueArray(b.candidateIds);return this.getCandidateIdsFoundInAllTermGroups(c,b.allIdGroupsByTerm)},this.getAccounts=function(a){var b=a.map(function(a){return this.database.get(this.attr.datastores.IdsToAccounts.name,a)},this);return Promise.collect(b)},this.filterAndSortAccounts=function(a){var b=ArrayUtils.compact(a),c=b.map(function(a){return a.account}),a=c.filter(function(a){return this.attr.onlyDMable&&!a.is_dm_able?!1:this.isEligibleForMediaTagSuggestion(a)?!0:!1},this);return a.sort(this.sorter),a.slice(0,this.attr.limit)},this.sorter=function(a,b){function e(a,b){var c=a.score_boost?a.score_boost:0,d=b.score_boost?b.score_boost:0,e=a.rounded_score?a.rounded_score:0,f=b.rounded_score?b.rounded_score:0;return f+d-(e+c)}var c=a.prefetched,d=b.prefetched;return c&&!d?-1:d&&!c?1:e(a,b)},this.getIds=function(a){var b=a.map(function(a){return this.database.getByPrefix(this.attr.datastores.AccountTokensToIds.name,a)},this);return Promise.collect(b)},this.getCandidateIdsFoundInAllTermGroups=function(a,b){return a.filter(function(a){return b.every(function(b){return b.indexOf(a)!==-1})})},this.createIdGroups=function(a){var b=[],c=[];return a.forEach(function(a){var d=[];a.forEach(function(a){b=b.concat(a.ids),d=d.concat(a.ids)}),c.push(d)}),{candidateIds:b,allIdGroupsByTerm:c}},this.processRemoteSuggestions=function(a,b,c){var d=c[this.attr.id]||[],e={};return d.forEach(function(a){e[a.id_str]=!0},this),this.requiresRemoteSuggestions(a.queryData)&&b[this.attr.remoteType]&&b[this.attr.remoteType].forEach(function(a){var b=!e[a.id_str]&&(!this.attr.onlyDMable||a.is_dm_able)&&this.isEligibleForMediaTagSuggestion(a)&&!this.isAccountMalformedAndScribe(a,"typeahead_remote");b&&d.push(a)},this),c[this.attr.id]=d.slice(0,this.attr.limit),c[this.attr.id].forEach(function(a){this.removeBlacklistSocialContext(a)},this),c},this.requiresRemoteSuggestions=function(a){return!a||!a.query?!1:a.accountsWithoutAtSignLocalOnly?this.attr.remoteQueriesEnabled&&(helpers.getFirstChar(a.query)=="@"||a.atSignRemoved):this.attr.remoteQueriesEnabled},this.isHttpError=function(a){return a&&a.status&&a.status>=400&&a.status<600},this.hasTTLExpired=function(a){return a-this.now()<=0},this.now=function(){return(new Date).getTime()},this.removeBlacklistSocialContext=function(a){a.first_connecting_user_id in this.socialContextBlackList&&(a.first_connecting_user_name=undefined,a.first_connecting_user_id=undefined)},this.isEligibleForMediaTagSuggestion=function(a){return!this.attr.onlyShowUsersWithCanMediaTag||a.can_media_tag||a.id==this.attr.currentUserId},this.isAccountMalformedAndScribe=function(a,b){var c=helpers.isAccountMalformed(a);return c&&this.scribe({component:"indexeddb",element:b,action:"empty"}),c}}var ArrayUtils=require("app/utils/array"),IndexedDB=require("app/utils/storage/indexed_db"),Promise=require("app/utils/promises"),helpers=require("app/utils/typeahead_helpers"),withData=require("app/data/with_data"),withScribe=require("app/data/with_scribe"),compose=require("core/compose"),util=require("core/utils"),withDatasourceHelpers=require("app/data/with_datasource_helpers"),customStorage=require("app/utils/storage/custom");module.exports=accountsDatasourceAsync
});
define("app/data/typeahead/dm_conversations_datasource_async",["module","require","exports","app/utils/array","app/utils/storage/indexed_db","app/utils/promises","core/compose","app/utils/typeahead_helpers","core/utils","app/data/with_data","app/data/user_info","app/utils/string"],function(module, require, exports) {
function dmConversationsDatasourceAsync(a,b){var b=b||{};this.attr={url:"/i/direct_messages/typeahead",dbName:b.dbName||"dm_typeahead",dbVersion:b.dbVersion||20150710,metadata:{name:"metadata",keyPath:"key"},conversations:{name:"conversations",keyPath:"id",indexes:[{name:"title",keyPath:"title",unique:!1}]},users:{name:"users",keyPath:"id",indexes:[{name:"name_lowercase",keyPath:"name_lowercase",unique:!1},{name:"screen_name",keyPath:"screen_name",unique:!0}]}},this.attr=util.merge(this.attr,a),this.after=$.noop,this.defaultAttrs=$.noop,compose.mixin(this,[withData]),this.initialize=function(){this.isUsingIndexedDB=!0;var a=[this.attr.metadata,this.attr.conversations,this.attr.users];return this.openIndexedDB(this.attr.dbName,this.attr.dbVersion,[this.attr.metadata,this.attr.users,this.attr.conversations]).then(this.ensureLocalDataBelongsToCurrentUser.bind(this,UserInfo.user.id)).then(this.checkIfLocalDataHasExpired.bind(this)).then(this.fetchDataIfExpired.bind(this)).then(this.ensureDataAndSchemaVersionMatch.bind(this)).then(this.repopulateDataStore.bind(this)).then(function(){return this}).fail(this.onInitializationError.bind(this))},this.getLocalSuggestions=function(a,b){var c=$.Deferred(),d=b||c.resolve,e=helpers.tokenizeText(a.query),f=Promise.pluralize(this.search,this),g=a.dmConversationsOptions||{};return f(e).then(function(a){return g.excludeGroups?this.removeGroups(a):a}.bind(this)).then(function(a){return g.excludeOneToOnes?this.removeOneToOnes(a):a}.bind(this)).then(function(a){return g.sortBySortId?this.sortBySortId(a):a}.bind(this)).always(function(a){d(a||[])}),c.promise()},this.repopulateIfStale=function(a){var a=a||[];if(!a.length)return $.Deferred().reject();var b=IndexedDB.KeyRange.bound(a[0],a[a.length-1],!1,!1);return this.database.getAll(this.attr.conversations.name,b).then(function(b){return b.length<a.length}).then(function(a){return a&&this.database.clear(this.attr.metadata.name)}.bind(this)).then(function(){return this.initialize()}.bind(this))},this.removeGroups=function(a){return(a||[]).filter(function(a){return a&&!a.is_group})},this.removeOneToOnes=function(a){return(a||[]).filter(function(a){return a&&a.is_group})},this.sortBySortId=function(a){return(a||[]).sort(function(a,b){return StringUtils.compare(b.sort_id,a.sort_id)})},this.openIndexedDB=function(a,b,c){return IndexedDB.open(a,b,c).then(function(a){this.database=a}.bind(this))},this.ensureLocalDataBelongsToCurrentUser=function(a){return this.database.get(this.attr.metadata.name,"user").then(function(b){return b&&b.id==a}).then(function(a){return a||this.database.clear()}.bind(this))},this.checkIfLocalDataHasExpired=function(){var a=this.now();return this.database.get(this.attr.metadata.name,"ttl").then(function(b){return b&&b.expires?b.expires<a:!0})},this.fetchDataIfExpired=function(a){return a&&this.get({url:this.attr.url})},this.ensureDataAndSchemaVersionMatch=function(a){if(a){var b=(a.metadata||[]).reduce(function(a,b){return b.version||a},0);if(this.database.version==b)return a}},this.repopulateDataStore=function(a){return a&&this.database.clear().then(this.populateDataStore.bind(this,a))},this.populateDataStore=function(a){return a&&this.database.add(a)},this.onInitializationError=function(a){this.database&&this.database.close()},this.hydrateParticipantsForOneToOnes=function(a){var b=a.map(function(a){return a.is_group?a:this.hydrateParticipants(a)}.bind(this));return Promise.collect(b)},this.hydrateParticipants=function(a){var b=Promise.pluralize(this.getUserById,this);return b(a.participants).then(function(b){return a.participants=b,a})},this.getUserById=function(a){return this.database.get(this.attr.users.name,a)},this.search=function(a){var b=this.searchUsers(a),c=this.searchConversations(a),d=Promise.pluralize(this.getConversation,this);return Promise.collect([b,c]).then(flatten).then(unique).then(d).then(this.hydrateParticipantsForOneToOnes.bind(this))},this.searchUsers=function(a){var b=this.database.getByPrefix(this.attr.users.name,"name_lowercase",a),c=this.database.getByPrefix(this.attr.users.name,"screen_name",a),d=Promise.collect([b,c]).then(flatten);return d.then(function(a){return a.map(function(a){return a.conversations})}).then(flatten)},this.searchConversations=function(a){var b=this.database.getByPrefix(this.attr.conversations.name,"title",a);return b.then(function(a){return a.map(function(a){return a.id})})},this.getConversation=function(a){return this.database.get(this.attr.conversations.name,a)},this.now=function(){return(new Date).getTime()}}var ArrayUtils=require("app/utils/array"),IndexedDB=require("app/utils/storage/indexed_db"),Promise=require("app/utils/promises"),compose=require("core/compose"),helpers=require("app/utils/typeahead_helpers"),util=require("core/utils"),withData=require("app/data/with_data"),UserInfo=require("app/data/user_info"),StringUtils=require("app/utils/string"),flatten=ArrayUtils.flatten,unique=ArrayUtils.unique;module.exports=dmConversationsDatasourceAsync
});
define("app/data/typeahead/saved_searches_datasource",["module","require","exports","core/utils"],function(module, require, exports) {
function savedSearchesDatasource(a){this.attr={id:null,items:[],limit:0,searchPathWithQuery:"/search?src=savs&q=",querySource:"saved_search_click"},this.attr=util.merge(this.attr,a),this.getRemoteSuggestions=function(a,b,c){return c},this.requiresRemoteSuggestions=function(a){return!1},this.getLocalSuggestions=function(a,b){if(!a||!a.query)b(this.attr.items);else{var c=this.attr.items.filter(function(b){return b.name.indexOf(a.query)==0}).slice(0,this.attr.limit);b(c)}},this.addSavedSearch=function(a){if(!a||!a.query)return;this.attr.items.push({id:a.id,id_str:a.id_str,name:a.name,query:a.query,saved_search_path:this.attr.searchPathWithQuery+encodeURIComponent(a.query),search_query_source:this.attr.querySource})},this.removeSavedSearch=function(a){if(!a||!a.query)return;var b=this.attr.items;for(var c=0;c<b.length;c++)if(b[c].query===a.query||b[c].name===a.query){b.splice(c,1);return}}}var util=require("core/utils");module.exports=savedSearchesDatasource
});
define("app/data/typeahead/recent_searches_datasource",["module","require","exports","core/utils","app/utils/storage/custom"],function(module, require, exports) {
function recentSearchesDatasource(a){this.attr={id:null,limit:4,storageList:"recentSearchesList",maxLength:100,ttl_ms:12096e5,searchPathWithQuery:"/search?src=typd&q=",querySource:"typed_query"},this.attr=util.merge(this.attr,a),this.getRemoteSuggestions=function(a,b,c){return c},this.requiresRemoteSuggestions=function(){return!1},this.removeAllRecentSearches=function(){this.items=[],this.updateStorage()},this.getLocalSuggestions=function(a,b){if(!a||a.query==="")b(this.items.slice(0,this.attr.limit));else{var c=this.items.filter(function(b){return b.name.indexOf(a.query)==0}).slice(0,this.attr.limit);b(c)}},this.updateStorage=function(){this.storage.setItem(this.attr.storageList,this.items,this.attr.ttl_ms)},this.removeOneRecentSearch=function(a){this.removeRecentSearchFromList(a.query),this.updateStorage()},this.addRecentSearch=function(a){if(!a||!a.query)return;a.query=a.query.trim(),this.updateRecentSearchList(a),this.updateStorage()},this.updateRecentSearchList=function(a){var b=this.items,c={normalized_name:a.query.toLowerCase(),name:a.query,recent_search_path:this.attr.searchPathWithQuery+encodeURIComponent(a.query),search_query_source:this.attr.querySource};this.removeRecentSearchFromList(a.query),b.unshift(c),b.length>this.attr.maxLength&&b.pop()},this.removeRecentSearchFromList=function(a){var b=this.items,c=-1,d=a.toLowerCase();for(var e=0;e<b.length;e++)if(b[e].normalized_name===d){c=e;break}c!==-1&&b.splice(c,1)},this.initialize=function(){var a=customStorage({withExpiry:!0});this.storage=new a("typeahead"),this.items=this.storage.getItem(this.attr.storageList)||[]},this.initialize()}var util=require("core/utils"),customStorage=require("app/utils/storage/custom");module.exports=recentSearchesDatasource
});
define("app/data/typeahead/with_external_event_listeners",["module","require","exports","app/utils/typeahead_helpers","app/utils/array"],function(module, require, exports) {
function WithExternalEventListeners(){this.defaultAttrs({weights:{CACHED_PROFILE_VISIT:10,UNCACHED_PROFILE_VISIT:75,FOLLOW:100}}),this.cleanupUserData=function(a){this.shouldUseIndexedDB()?this.removeAccountAsync(parseInt(a,10)):this.removeAccount(a),this.addToUserBlacklist(a)},this.onFollowStateChange=function(a,b){if(!b.userId)return;switch(b.newState){case"blocked":this.cleanupUserData(b.userId);break;case"not-following":this.cleanupUserData(b.userId);break;case"following":b.user&&(this.adjustScoreBoost(b.user,this.attr.weights.FOLLOW),this.shouldUseIndexedDB()?this.addAccountForFollowAsync(b.user):this.addAccount(b.user,"following"),this.removeUserFromBlacklist(b.userId))}this.shouldUseIndexedDB()||this.updateLocalStorage()},this.onProfileVisit=function(a,b){this.shouldUseIndexedDB()?this.handleProfileVisitAsync(b):this.handleProfileVisitSync(b)},this.handleProfileVisitAsync=function(a){this.datasources.accounts.getAccounts([a.id]).then(this.processUserAsync.bind(this,a)).then(this.datasources.accounts.addAccount.bind(this.datasources.accounts))},this.processUserAsync=function(a,b){b=ArrayUtils.compact(b);var c=b.length!=0,d=c?this.attr.weights.CACHED_PROFILE_VISIT:this.attr.weights.UNCACHED_PROFILE_VISIT,e=c?b[0].account:a;return this.adjustScoreBoost(e,d),c||(e.tokens=["@"+e.screen_name,e.screen_name].concat(helpers.tokenizeText(e.name))),e},this.handleProfileVisitSync=function(a){var b=this.datasources.accounts.userHash[a.id];this.processUserSync(a,b)},this.processUserSync=function(a,b){b?this.adjustScoreBoost(b,this.attr.weights.CACHED_PROFILE_VISIT):(this.adjustScoreBoost(a,this.attr.weights.UNCACHED_PROFILE_VISIT),this.addAccount(a,"visit")),this.updateLocalStorage()},this.updateLocalStorage=function(){this.datasources.accounts.storage.setItem("userHash",this.datasources.accounts.userHash,this.datasources.accounts.attr.ttl),this.datasources.accounts.storage.setItem("adjacencyList",this.datasources.accounts.adjacencyList,this.datasources.accounts.attr.ttl),this.datasources.accounts.storage.setItem("version",this.datasources.accounts.attr.version,this.datasources.accounts.attr.ttl)},this.removeAccount=function(a){if(!this.datasources.accounts.userHash[a])return;var b=this.datasources.accounts.userHash[a].tokens;b.forEach(function(b){var c=this.datasources.accounts.adjacencyList[b.charAt(0)];if(!c)return;var d=c.indexOf(a);if(d===-1)return;c.splice(d,1)},this),delete this.datasources.accounts.userHash[a]},this.removeAccountAsync=function(a){this.datasources.accounts.removeAccount(a)},this.adjustScoreBoost=function(a,b){a.score_boost?a.score_boost+=b:a.score_boost=b},this.addAccount=function(a,b){this.datasources.accounts.userHash[a.id]=a,a.tokens=["@"+a.screen_name,a.screen_name].concat(helpers.tokenizeText(a.name)),a.social_proof=b==="following"?1:0,a.tokens.forEach(function(b){var c=b.charAt(0);if(!b.trim().length)return;if(!this.datasources.accounts.adjacencyList[c]){this.datasources.accounts.adjacencyList[c]=[a.id];return}this.datasources.accounts.adjacencyList[c].indexOf(a.id)===-1&&this.datasources.accounts.adjacencyList[c].push(a.id)},this)},this.addAccountForFollowAsync=function(a){a.tokens=["@"+a.screen_name,a.screen_name].concat(helpers.tokenizeText(a.name)),a.social_proof=1,this.datasources.accounts.addAccount(a)},this.removeOldAccountsInBlackList=function(){var a,b,c=0,d=this.datasources.accounts.attr.maxLengthBlacklist||100,e=this.datasources.accounts.socialContextBlackList,f=(new Date).getTime(),g=this.datasources.accounts.attr.ttl_ms;for(b in e){var h=e[b]+g;h<f?delete e[b]:(a=a||b,a=e[a]>e[b]?b:a,c+=1)}d<c&&delete e[a]},this.updateBlacklistLocalStorage=function(a){this.datasources.accounts.storage.setItem("userBlackList",a,this.attr.ttl)},this.addToUserBlacklist=function(a){var b=this.datasources.accounts.socialContextBlackList;b[a]=(new Date).getTime(),this.removeOldAccountsInBlackList(),this.updateBlacklistLocalStorage(b)},this.removeUserFromBlacklist=function(a){var b=this.datasources.accounts.socialContextBlackList;this.removeOldAccountsInBlackList(),b[a]&&(delete b[a],this.updateBlacklistLocalStorage(b))},this.checkItemTypeForRecentSearch=function(a){return a==="saved_search"||a==="topics"||a==="recent_search"?!0:!1},this.addSavedSearch=function(a,b){this.datasources.savedSearches.addSavedSearch(b)},this.removeSavedSearch=function(a,b){this.datasources.savedSearches.removeSavedSearch(b)},this.addRecentSearch=function(a,b){b.source==="search"?this.datasources.recentSearches.addRecentSearch({query:b.query}):this.checkItemTypeForRecentSearch(b.source)&&b.isSearchInput&&this.datasources.recentSearches.addRecentSearch({query:b.query})},this.removeRecentSearch=function(a,b){b.deleteAll?this.datasources.recentSearches.removeAllRecentSearches():this.datasources.recentSearches.removeOneRecentSearch(b),$(a.target).trigger("dataTypeaheadRecentSearchDeleted")},this.updateSelectedUsers=function(a,b){this.datasources.selectedUsers.updateSelectedUsers(b)},this.setTrendLocations=function(a,b){this.datasources.trendLocations.setTrendLocations(b)},this.updatePrefill=function(a,b){this.datasources.prefillUsers.updateRecentlySelectedUsers(b)},this.checkDMConversationFreshness=function(a,b){this.datasources.dmConversations.repopulateIfStale(b&&b.groups)},this.setupEventListeners=function(a){switch(a){case"accounts":this.on("dataFollowStateChange",this.onFollowStateChange),this.on("profileVisit",this.onProfileVisit);break;case"savedSearches":this.on(document,"dataAddedSavedSearch",this.addSavedSearch),this.on(document,"dataRemovedSavedSearch",this.removeSavedSearch);break;case"recentSearches":this.on("uiSearchQuery uiTypeaheadItemSelected",this.addRecentSearch),this.on("uiTypeaheadDeleteRecentSearch",this.removeRecentSearch);break;case"trendLocations":this.on(document,"dataLoadedTrendLocations",this.setTrendLocations);break;case"selectedUsers":this.on("uiUpdatedSelectedUsers",this.updateSelectedUsers);break;case"prefillUsers":this.on("uiUpdateRecentTags",this.updatePrefill);break;case"dmConversations":this.on("dataDMConversationListResult",this.checkDMConversationFreshness)}}}var helpers=require("app/utils/typeahead_helpers"),ArrayUtils=require("app/utils/array");module.exports=WithExternalEventListeners
});
define("app/data/typeahead/topics_datasource",["module","require","exports","app/utils/typeahead_helpers","app/data/with_data","core/compose","core/utils","app/data/with_datasource_helpers","core/i18n"],function(module, require, exports) {
function topicsDatasource(a){this.attr={id:null,ttl_ms:216e5,limit:4,version:4,storageAdjacencyList:"topicsAdjacencyList",storageHash:"topicsHash",storageVersion:"topicsVersion",prefetchLimit:500,localQueriesEnabled:!1,remoteQueriesEnabled:!1,remotePath:"/i/search/typeahead.json",remoteType:"topics",prefetchPath:"/i/search/typeahead.json",prefetchType:"topics",basePath:"/search?",modePathMap:{images:"f=images",videos:"f=videos",news:"f=news"},querySourcePathTypeahead:"src=tyah"},this.attr=util.merge(this.attr,a),this.after=$.noop,this.defaultAttrs=$.noop,compose.mixin(this,[withData,withDatasourceHelpers]),this.getLocalSuggestions=function(a,b){b([])},this.getTopicObjectsFromStrings=function(a){var b=[];return a.forEach(function(a){var c=this.topicsHash[a];c&&b.push(c)},this),b},this.requiresRemoteSuggestions=function(a){var b=helpers.getFirstChar(a.query),c=a.topicsMustStartWithHashtag&&HASHTAG_CHARS.indexOf(b)===-1;return!a||!a.query||c?!1:this.attr.remoteQueriesEnabled},this.processRemoteSuggestions=function(a,b,c){var d=c[this.attr.id]||[],e={};return d.forEach(function(a){var b=a.topic||a.hashtag;e[b.toLowerCase()]=!0},this),b[this.attr.remoteType]&&b[this.attr.remoteType].forEach(function(a){var b=a.topic||a.hashtag;a.searchPath=this.constructSearchPath(b,a.filter),e[b.toLowerCase()]||d.push(a)},this),c[this.attr.id]=d.slice(0,this.attr.limit),c},this.constructSearchPath=function(a,b){var c=["q="+encodeURIComponent(a)],d=b?this.attr.modePathMap[b]:"";return d&&c.push(d),c.push(this.attr.querySourcePathTypeahead),this.attr.basePath+c.join("&")},this.initialize=function(){},this.initialize()}var helpers=require("app/utils/typeahead_helpers"),withData=require("app/data/with_data"),compose=require("core/compose"),util=require("core/utils"),withDatasourceHelpers=require("app/data/with_datasource_helpers"),_=require("core/i18n"),HASHTAG_CHARS=["$","#","＃"];module.exports=topicsDatasource
});
define("app/data/typeahead/trend_locations_datasource",["module","require","exports","core/utils","core/i18n"],function(module, require, exports) {
function trendLocationsDatasource(a){var b={woeid:-1,placeTypeCode:-1,name:_('Deine Suche ergab keine Treffer. Versuche die Auswahl aus einer Liste.')};this.attr={id:null,items:[],limit:10},this.attr=util.merge(this.attr,a),this.getRemoteSuggestions=function(a,b,c){return c},this.requiresRemoteSuggestions=function(a){return!1},this.getLocalSuggestions=function(a,c){var d=this.attr.items,e=function(a){return a.replace(/\s+/g,"").toLowerCase()};if(a&&a.query){var f=e(a.query);d=this.attr.items.filter(function(a){return e(a.name).indexOf(f)==0})}d.length?c(d.slice(0,this.attr.limit)):c([b])},this.setTrendLocations=function(a){this.attr.items=a.trendLocations}}var util=require("core/utils"),_=require("core/i18n");module.exports=trendLocationsDatasource
});
define("app/data/typeahead/concierge_datasource",["module","require","exports","core/compose","core/utils","core/i18n","app/utils/storage/custom","app/data/with_data","app/data/with_datasource_helpers"],function(module, require, exports) {
function conciergeDatasource(a){this.attr={id:null,ttl_ms:216e5,limit:3,version:1,storageList:"conciergeList",storageVersion:"conciergeVersion",prefetchLimit:3,localQueriesEnabled:!1,remoteQueriesEnabled:!1,prefetchPath:"/i/search/typeahead.json",prefetchType:"oneclick",remotePath:"/i/search/typeahead.json",remoteType:"oneclick",basePath:"/search?",scribeMap:{images:"photos",videos:"video",news:"news",users:"people"},nameMap:{"images near":_('Fotos aus Deiner N\xe4he'),"images follow":_('Fotos von Personen, denen Du folgst'),"videos near":_('Videos aus Deiner N\xe4he'),"videos follow":_('Videos von Personen, denen Du folgst'),"news near":_('Neuigkeiten aus Deiner N\xe4he'),"news follow":_('Neuigkeiten, die von Leuten geteilt wurden, denen Du folgst'),"users near":_('Personen aus Deiner N\xe4he')},modePathMap:{images:"mode=photos",videos:"mode=videos",news:"mode=news",users:"mode=users"},locationFilterPath:"near=me",followFilterPath:"f=follows",querySourcePath:"src=taoc",querySource:"typeahead_oneclick"},this.attr=util.merge(this.attr,a),this.after=$.noop,this.defaultAttrs=$.noop,compose.mixin(this,[withData,withDatasourceHelpers]),this.getStorageKeys=function(){return[this.attr.storageVersion,this.attr.storageList]},this.getPrefetchCount=function(){return this.attr.prefetchLimit},this.isMetadataExpired=function(){var a=this.storage.getItem(this.attr.storageVersion);return a!==this.attr.version},this.getDataFromLocalStorage=function(){this.conciergeList=this.storage.getItem(this.attr.storageList)||this.conciergeList},this.processResults=function(a){if(!a||!a[this.attr.prefetchType]){this.useStaleData();return}a[this.attr.prefetchType].forEach(function(a){var b=this.constructConciergeSuggestion(a);b&&this.conciergeList.push(b)},this),this.storage.setItem(this.attr.storageList,this.conciergeList,this.attr.ttl_ms),this.storage.setItem(this.attr.storageVersion,this.attr.version,this.attr.ttl_ms)},this.getLocalSuggestions=function(a,b){!a||a.query===""?b(this.conciergeList.slice(0,this.attr.limit)):b([])},this.requiresRemoteSuggestions=function(a){return a&&a.query===""?this.attr.remoteQueriesEnabled:!1},this.processRemoteSuggestions=function(a,b,c){var d=c[this.attr.id]||[];if(b[this.attr.remoteType]){var e=b[this.attr.remoteType];for(var f=0;f<e.length;f++){var g=this.constructConciergeSuggestion(e[f]);if(g){var h=d.push(g);if(h>=this.attr.limit)break}}}return c[this.attr.id]=d.slice(0,this.attr.limit),c},this.constructConciergeSuggestion=function(a){var b=a.filter,c=!!a.location,d=!!a.follow,e=a.topic,f=this.constructName(b,c,d,e);return f?{topic:e,searchPath:this.constructSearchPath(b,c,d,e),name:f,querySource:this.attr.querySource,searchDetails:this.constructScribeDetails(b,c,d,e)}:null},this.constructName=function(a,b,c,d){var e=b?" near":"",f=c?" follow":"",g=d||this.attr.nameMap[a+e+f];return g},this.constructSearchPath=function(a,b,c,d){var e=[this.attr.querySourcePath],f=a?this.attr.modePathMap[a]:"";return f&&e.push(f),b&&e.push(this.attr.locationFilterPath),c&&e.push(this.attr.followFilterPath),d&&e.push("q="+encodeURIComponent(d)),this.attr.basePath+e.join("&")},this.constructScribeDetails=function(a,b,c,d){var e={result_type:this.attr.scribeMap[a]||"everything",social_filter:c?"following":"all"};return d&&(e.query=d),b&&(e.near="me"),e},this.initialize=function(){var a=customStorage({withExpiry:!0});this.storage=new a("typeahead"),this.conciergeList=[],this.attr.localQueriesEnabled&&this.loadData(this.attr.prefetchPath,this.attr.prefetchType)},this.initialize()}var compose=require("core/compose"),util=require("core/utils"),_=require("core/i18n"),customStorage=require("app/utils/storage/custom"),withData=require("app/data/with_data"),withDatasourceHelpers=require("app/data/with_datasource_helpers");module.exports=conciergeDatasource
});
define("app/data/typeahead/selected_users_datasource",["module","require","exports","core/utils"],function(module, require, exports) {
function selectedUsersDatasource(a){this.attr={id:null,maxLength:100,querySource:"typed_query",items:[]},this.attr=util.merge(this.attr,a),this.getRemoteSuggestions=function(a,b,c){return c},this.requiresRemoteSuggestions=function(){return!1},this.removeAllSelectedUsers=function(){this.attr.items=[]},this.getLocalSuggestions=function(a,b){b(this.attr.items.slice(0,this.attr.maxLength))},this.updateSelectedUsers=function(a){this.attr.items=a.items}}var util=require("core/utils");module.exports=selectedUsersDatasource
});
define("app/data/typeahead/prefill_users_datasource",["module","require","exports","core/utils","app/utils/storage/custom"],function(module, require, exports) {
function prefillUsersDatasource(a){this.attr={id:null,maxLength:10,querySource:"typed_query",customItems:[],ttl_ms:12096e5,storageList:"recentlySelectedList"},this.attr=util.merge(this.attr,a),this.getRemoteSuggestions=function(a,b,c){return c},this.requiresRemoteSuggestions=function(){return!1},this.updateStorage=function(){this.storage.setItem(this.attr.storageList,this.storageItems,this.attr.ttl_ms)},this.updateRecentlySelectedUsers=function(a){var b=this.storageItems;a.items.forEach(function(a){this.removeRecentUserFromList(a),b.unshift(a),b.length>this.attr.maxLength&&(this.storageItems=b.slice(0,this.attr.maxLength))},this),this.updateStorage()},this.removeRecentUserFromList=function(a){var b=this.storageItems,c=this.getSuggestionIndexById(a,b);c!=-1&&b.splice(c,1)},this.getSuggestionIndexById=function(a,b){for(var c=0;c<b.length;c++)if(b[c].id==a.id)return c;return-1},this.getLocalSuggestions=function(a,b){var c=this.storageItems.slice(0,this.attr.maxLength);for(var d=0;c.length<this.attr.maxLength&&d<this.attr.customItems.length;d++){var e=this.attr.customItems[d];this.getSuggestionIndexById(c,e)==-1&&c.push(e)}b(c)},this.updateCustomItems=function(a){this.attr.customItems=a.items},this.initialize=function(){var a=customStorage({withExpiry:!0});this.storage=new a("typeahead"),this.storageItems=this.storage.getItem(this.attr.storageList)||[]},this.initialize()}var util=require("core/utils"),customStorage=require("app/utils/storage/custom");module.exports=prefillUsersDatasource
});
define("app/utils/storage/indexed_db_legacy_adaptor",["module","require","exports","app/utils/storage/indexed_db"],function(module, require, exports) {
function IndexedDBAdaptor(){var a=Array.prototype.slice.call(arguments);if(!(this instanceof IndexedDBAdaptor)){var b=a[0],c=b.dbName,d=b.dbVersion,e=IndexedDB.open(c,d),f=e.then(function(a){return new IndexedDBAdaptor(a)});return withCallbacks(f,b)}this.database=a[0]}function withCallbacks(a,b){var b=b||{};return a.then(b.onSuccess||$.noop,b.onFailure||$.noop)}var IndexedDB=require("app/utils/storage/indexed_db");module.exports=IndexedDBAdaptor,IndexedDBAdaptor.prototype.closeConnection=function(){this.database.close()},IndexedDBAdaptor.prototype.getItemByKey=function(a){var b=this.database.get(a.objectStoreName,a.key);return withCallbacks(b,a)},IndexedDBAdaptor.prototype.getItemsByPrefix=function(a){var b=this.database.getByPrefix(a.objectStoreName,a.index,a.prefix);return withCallbacks(b,a)},IndexedDBAdaptor.prototype.addItems=function(a){var b={};return b[a.objectStoreName]=a.items,withCallbacks(this.database.add(b),a)},IndexedDBAdaptor.prototype.upsertItems=function(a){var b={};return b[a.objectStoreName]=a.items,withCallbacks(this.database.put(b),a)},IndexedDBAdaptor.prototype.createObjectStore=function(a){var b=this.database.name,c=this.database.version;this.database.close();var d={name:a.objectStoreName,keyPath:a.keyPathName,indexes:a.indexes||[]},e=IndexedDB.open(b,c+1,[d],!0);return withCallbacks(e.then(function(a){this.database=a}.bind(this)),a)},IndexedDBAdaptor.prototype.deleteItem=function(a){var b=this.database.destroy(a.objectStoreName,a.key);return withCallbacks(b,a)},IndexedDBAdaptor.prototype.clearObjectStore=function(a){var b=this.database.clear(a.objectStoreName);return withCallbacks(b,a)},IndexedDBAdaptor.prototype.clearAllObjectStores=function(a){var b=this.database.clear();return withCallbacks(b,a)},IndexedDBAdaptor.prototype.checkIfObjectStoreExists=function(a){return this.database.stores.indexOf(a)>-1}
});
define("app/data/typeahead/typeahead",["module","require","exports","core/component","core/utils","app/data/with_data","app/data/typeahead/with_cache","app/data/with_scribe","app/data/typeahead/accounts_datasource","app/data/typeahead/accounts_datasource_async","app/data/typeahead/dm_conversations_datasource_async","app/data/typeahead/saved_searches_datasource","app/data/typeahead/recent_searches_datasource","app/data/typeahead/with_external_event_listeners","app/data/typeahead/topics_datasource","app/data/typeahead/trend_locations_datasource","app/data/typeahead/concierge_datasource","app/data/typeahead/selected_users_datasource","app/data/typeahead/prefill_users_datasource","app/utils/storage/indexed_db","app/utils/storage/indexed_db_legacy_adaptor","app/utils/promises"],function(module, require, exports) {
function typeahead(){this.defaultAttrs({limit:10,remoteDebounceInterval:300,remoteThrottleInterval:300,outstandingRemoteRequestCount:0,queuedRequestData:!1,outstandingRemoteRequestMax:6,useThrottle:!1,tweetContextEnabled:!1,topicsWithFiltersEnabled:!1}),this.triggerSuggestionsEvent=function(a,b,c){this.trigger("dataTypeaheadSuggestionsResults",{suggestions:c,queryData:b,id:a})},this.hasAnySuggestions=function(a,b){return b.some(function(b){return a[b]&&a[b].length})},this.needsRemoteRequest=function(a,b){return b.some(function(b){return this.datasources[b]&&this.datasources[b].requiresRemoteSuggestions&&this.datasources[b].requiresRemoteSuggestions(a)},this)},this.getLocalSuggestions=function(a,b,c){function f(){e++,e==b.length&&c(d)}var d={},e=0;b.forEach(function(b){this.datasources[b]?this.datasources[b].getLocalSuggestions(a,function(a){a.length&&(a.forEach(function(a){a.origin="prefetched"}),d[b]=a),f()}):f()},this)},this.processRemoteSuggestions=function(a){this.adjustRequestCount(-1);var b=a.sourceEventData,c=b.suggestions||{};b.datasources.forEach(function(d){var e=d.processRemoteSuggestions(b,a,c);if(e[d.attr.id]&&e[d.attr.id].length){for(var f in e)e[f].forEach(function(a){a.origin=a.origin||"remote"});b.suggestions[d.attr.id]=e[d.attr.id]}},this),this.processSuggestionsByDataset(c),this.triggerSuggestionsEvent(b.id,b.queryData,c),this.makeQueuedRemoteRequestIfPossible()},this.getRemoteSuggestions=function(a,b,c,d){if(!b||!this.needsRemoteRequest(b,d))return;this.request[a]||(this.attr.useThrottle?this.request[a]=utils.throttle(this.splitRemoteRequests.bind(this),this.attr.remoteThrottleInterval):this.request[a]=utils.debounce(this.splitRemoteRequests.bind(this),this.attr.remoteDebounceInterval)),b.query.indexOf("@")===0&&b.typeaheadSrc==="COMPOSE"&&(b.query=b.query.substring(1),b.atSignRemoved=!0),this.request[a](a,b,c,d)},this.makeQueuedRemoteRequestIfPossible=function(){if(this.attr.outstandingRemoteRequestCount===this.attr.outstandingRemoteRequestMax-1&&this.attr.queuedRequestData){var a=this.attr.queuedRequestData;this.getRemoteSuggestions(a.id,a.queryData,a.suggestions,a.datasources),this.attr.queuedRequestData=!1}},this.adjustRequestCount=function(a){this.attr.outstandingRemoteRequestCount+=a},this.canMakeRemoteRequest=function(a){return this.attr.outstandingRemoteRequestCount<this.attr.outstandingRemoteRequestMax?!0:(this.attr.queuedRequestData=a,!1)},this.processRemoteRequestError=function(){this.adjustRequestCount(-1),this.makeQueuedRemoteRequestIfPossible()},this.splitRemoteRequests=function(a,b,c,d){var e={};d.forEach(function(a){if(this[a]&&this[a].requiresRemoteSuggestions&&this[a].requiresRemoteSuggestions(b)){var c=this[a];e[c.attr.remotePath]?e[c.attr.remotePath].push(c):e[c.attr.remotePath]=[c]}},this.datasources);for(var f in e){this.executeRemoteRequest(a,b,c,e[f]);break}},this.executeRemoteRequest=function(a,b,c,d){var e={id:a,queryData:b,suggestions:c,datasources:d};if(!this.canMakeRemoteRequest(e))return;if(!this.attr.tweetContextEnabled||b.tweetContext&&b.tweetContext.length>1e3)b.tweetContext=undefined;this.adjustRequestCount(1),this.get({url:d[0].attr.remotePath,data:{q:b.query,tweet_context:b.tweetContext,count:this.attr.limit,result_type:d.map(function(a){return a.attr.remoteType}).join(","),filters:this.attr.topicsWithFiltersEnabled,src:b.typeaheadSrc},eventData:e,success:this.processRemoteSuggestions.bind(this),error:this.processRemoteRequestError.bind(this)})},this.truncateTopicsWithRecentSearches=function(a){if(!a.topics||!a.recentSearches)return;var b=a.recentSearches.length,c=4-b;a.topics=a.topics.slice(0,c)},this.dedupSuggestions=function(a,b,c){function e(){return b.some(function(a){return a in c})}function f(a){var b=a.topic||a.name;return!d[b.toLowerCase()]}if(!c[a]||!e())return;var d={};c[a].forEach(function(a){var b=a.name||a.topic;d[b.toLowerCase()]=!0}),b.forEach(function(a){a in c&&(c[a]=c[a].filter(f))})},this.processSuggestionsByDataset=function(a){this.dedupSuggestions("recentSearches",["topics"],a),this.truncateTopicsWithRecentSearches(a)},this.getSuggestions=function(a,b){if(typeof b=="undefined")throw"No parameters specified";if(!b.datasources)throw"No datasources specified";if(typeof b.queryData=="undefined")throw"No query data specified";if(typeof b.queryData.query=="undefined")throw"No query specified";if(!b.id)throw"No id specified";this.getLocalSuggestions(b.queryData,b.datasources,function(a){this.processSuggestionsByDataset(a);var c=b.queryData.query!=="@"&&this.needsRemoteRequest(b.queryData,b.datasources);(this.hasAnySuggestions(a,b.datasources)||!c)&&this.triggerSuggestionsEvent(b.id,b.queryData,a),c&&this.getRemoteSuggestions(b.id,b.queryData,a,b.datasources)}.bind(this))},this.getGlobalDatasources=function(){return globalDataSources},this.setGlobalDatasources=function(a){globalDataSources=a},this.addSynchronousDatasource=function(a,b,c){var d=c[b]||{};if(!this.isDatasourceEnabled(b))return;globalDataSources.hasOwnProperty(b)?this.datasources[b]=globalDataSources[b]:globalDataSources[b]=this.datasources[b]=new a(utils.merge(d,{id:b})),this.setupEventListeners(b)},this.addAsynchronousDatasource=function(a){var b=$.Deferred(),a=a||{},c=a.dsName,d=this.componentOptions[c]||{},e=new a.datasource(utils.merge(d,{id:c}),a);return e.initialize().then(function(a){return globalDataSources[c]=this.datasources[c]=e,a}.bind(this))},this.initializeLocalData=function(a){this.addDatasourcesNotUsingIndexedDB();var b=this.shouldUseIndexedDB()?this.addAsynchronousDatasources():this.addSynchronousDatasources(),c=this.addDMTypeaheadDatasources();$.when(b,c).always(a)},this.isDatasourceEnabled=function(a){var b=this.componentOptions[a]||{};return!!b.enabled},this.isBrowserSafari=function(){return $.browser.safari},this.shouldUseIndexedDB=function(){return IndexedDB.isSupported()&&this.attr.useIndexedDB&&!this.isBrowserSafari()},this.addAsync=function(a){var b=a.dsName,c=a.dbName,d=a.datasource,e=Promise.log($.Deferred(),{title:"Typeahead ("+b+")",enabled:window.DEBUG&&window.DEBUG.enabled});return this.isDatasourceEnabled(b)?this.addAsynchronousDatasource({dbName:c,dsName:b,datasource:d,indexedDBWrapper:IndexedDBWrapper}).then(function(a){this.setupEventListeners(b),this.addDBHandleToGlobals(c,a),e.resolve(b,c,a)}.bind(this)).fail(function(){this.indexedDBInitializationFailed=!0,e.reject.apply(null,arguments)}.bind(this)):e.resolve(),e.promise()},this.addDBHandleToGlobals=function(a,b){b&&(window.globalIndexedDBs[a]=b)},this.addDMTypeaheadDatasources=function(){return this.addAsync({dsName:"dmConversations",dbName:"dm_typeahead",datasource:dmConversationsDatasourceAsync})},this.addAsynchronousDatasources=function(){return Promise.chain([this.addAsync.bind(this,{dsName:"accounts",dbName:"accounts",datasource:accountsDatasourceAsync}),this.addAsync.bind(this,{dsName:"dmAccounts",dbName:"accounts",datasource:accountsDatasourceAsync}),this.addAsync.bind(this,{dsName:"mediaTagAccounts",dbName:"accounts",datasource:accountsDatasourceAsync})])},this.addDatasourcesNotUsingIndexedDB=function(){this.addSynchronousDatasource(savedSearchesDatasource,"savedSearches",this.componentOptions),this.addSynchronousDatasource(topicsDatasource,"topics",this.componentOptions),this.addSynchronousDatasource(topicsDatasource,"hashtags",utils.merge(this.componentOptions,{hashtags:{remoteType:"hashtags"}},!0)),this.addSynchronousDatasource(trendLocationsDatasource,"trendLocations",this.componentOptions),this.addSynchronousDatasource(selectedUsersDatasource,"selectedUsers",this.componentOptions),this.addSynchronousDatasource(prefillUsersDatasource,"prefillUsers",this.componentOptions),this.addSynchronousDatasource(recentSearchesDatasource,"recentSearches",this.componentOptions),this.addSynchronousDatasource(conciergeDatasource,"concierge",this.componentOptions)},this.addSynchronousDatasources=function(){return this.addSynchronousDatasource(accountsDatasource,"accounts",this.componentOptions),this.addSynchronousDatasource(accountsDatasource,"dmAccounts",this.componentOptions),this.addSynchronousDatasource(accountsDatasource,"mediaTagAccounts",this.componentOptions),$.Deferred().resolve()},this.possiblyScribeIndexedDB=function(){if(!this.shouldUseIndexedDB())return;var a=this.indexedDBInitializationFailed?"failure":"success";this.scribe({component:"indexeddb",action:a})},this.after("initialize",function(a,b){this.datasources={},this.request={},this.componentOptions=b,this.initializeLocalData(function(){this.on("uiNeedsTypeaheadSuggestions",this.getSuggestions),this.possiblyScribeIndexedDB()}.bind(this))})}var defineComponent=require("core/component"),utils=require("core/utils"),withData=require("app/data/with_data"),withCache=require("app/data/typeahead/with_cache"),withScribe=require("app/data/with_scribe"),accountsDatasource=require("app/data/typeahead/accounts_datasource"),accountsDatasourceAsync=require("app/data/typeahead/accounts_datasource_async"),dmConversationsDatasourceAsync=require("app/data/typeahead/dm_conversations_datasource_async"),savedSearchesDatasource=require("app/data/typeahead/saved_searches_datasource"),recentSearchesDatasource=require("app/data/typeahead/recent_searches_datasource"),withExternalEventListeners=require("app/data/typeahead/with_external_event_listeners"),topicsDatasource=require("app/data/typeahead/topics_datasource"),trendLocationsDatasource=require("app/data/typeahead/trend_locations_datasource"),conciergeDatasource=require("app/data/typeahead/concierge_datasource"),selectedUsersDatasource=require("app/data/typeahead/selected_users_datasource"),prefillUsersDatasource=require("app/data/typeahead/prefill_users_datasource"),IndexedDB=require("app/utils/storage/indexed_db"),IndexedDBWrapper=require("app/utils/storage/indexed_db_legacy_adaptor"),Promise=require("app/utils/promises");module.exports=defineComponent(typeahead,withData,withCache,withExternalEventListeners,withScribe),window.globalIndexedDBs={};var globalDataSources={}
});
define("app/data/typeahead/typeahead_scribe",["module","require","exports","core/component","app/data/with_scribe","lib/twitter-text","app/utils/scribe_item_types"],function(module, require, exports) {
function typeaheadScribe(){this.defaultAttrs({tweetboxSelector:".tweet-box-shadow"}),this.storeCompletionData=function(a,b){if(b.scribeContext&&b.scribeContext.component=="tweet_box"){var c=b.source=="account"?"@"+b.display:b.display;this.completions.push(c)}},this.handleTweetCompletion=function(a,b){if(b.scribeContext.component!="tweet_box")return;var c=$(a.target).find(this.attr.tweetboxSelector).val(),d=twitterText.extractEntitiesWithIndices(c).filter(function(a){return a.screenName||a.cashtag||a.hashtag});d=d.map(function(a){return c.slice(a.indices[0],a.indices[1])});var e=d.filter(function(a){return this.completions.indexOf(a)>=0},this);this.completions=[];if(d.length==0)return;var f={query:b.query,message:d.length,event_info:e.length,format_version:2};this.scribe("entities",b,f)},this.scribeSelection=function(a,b){if(b.fromSelectionEvent&&a.type=="uiTypeaheadItemComplete")return;var c={element:"typeahead_"+b.source,action:"select"},d;a.type=="uiTypeaheadItemComplete"?d="autocomplete":b.isClick?d="click":a.type=="uiTypeaheadItemSelected"&&(d="key_select");var e={position:b.index,description:d};b.source=="account"?(e.item_type=itemTypes.user,e.id=b.query):b.source=="topics"?(e.item_type=itemTypes.search,e.item_query=b.query):b.source=="saved_search"?(e.item_type=itemTypes.savedSearch,e.item_query=b.query):b.source=="recent_search"?(e.item_type=itemTypes.search,e.item_query=b.query):b.source=="trend_location"?(e.item_type=itemTypes.trend,e.item_query=b.item.woeid,b.item.woeid==-1&&(c.action="no_results")):b.source=="concierge"&&(e.item_type=itemTypes.search,e.item_query=b.query||b.item.name);var f={message:b.input,items:[e],format_version:2,event_info:b.item?b.item.origin:null,search_details:b.item?b.item.searchDetails:null};this.scribe(c,b,f)},this.scribeMalformedAccount=function(){this.scribe({element:"typeahead_account",action:"empty"})},this.after("initialize",function(){this.completions=[],this.on("uiTypeaheadItemComplete uiTypeaheadItemSelected",this.storeCompletionData),this.on("uiTypeaheadItemComplete uiTypeaheadItemSelected",this.scribeSelection),this.on("uiTweetboxTweetSuccess uiTweetboxReplySuccess",this.handleTweetCompletion),this.on("uiTypeaheadAccountMalformed",this.scribeMalformedAccount)})}var defineComponent=require("core/component"),withScribe=require("app/data/with_scribe"),twitterText=require("lib/twitter-text"),itemTypes=require("app/utils/scribe_item_types");module.exports=defineComponent(typeaheadScribe,withScribe)
});
define("app/data/url_command",["module","require","exports","app/utils/querystring","core/component"],function(module, require, exports) {
var querystring=require("app/utils/querystring"),defineComponent=require("core/component");module.exports=defineComponent(function(){this.triggerCommand=function(){var b=this.attr.href,c=querystring.queryMap(b);switch(c.action){case"compose":this.trigger("uiOpenTweetDialog",this._trimParams(["action","mode"],c)),this._removeQueryStringFromUrl();break;case"overlay":c.screen_name&&c.tweet_id&&(this.trigger("uiOverlayNavigate",{href:c.screen_name+"/status/"+c.tweet_id}),this._removeQueryStringFromUrl())}},this._removeQueryStringFromUrl=function(){if(window.history&&history.replaceState){var b=window.location.href.replace(/\?[^#]*/,"");history.replaceState({title:document.title},document.title,b)}},this._trimParams=function(b,c){var d={};return Object.getOwnPropertyNames(c).forEach(function(a){b.indexOf(a)>=0&&(d[a]=c[a])}),d},this.after("initialize",function(){typeof this.attr.href=="string"&&this.on("uiSwiftLoaded",this.triggerCommand)})})
});
define("app/ui/dialogs/uz_survey",["module","require","exports","core/component","app/data/user_info"],function(module, require, exports) {
function uzSurvey(){this.defaultAttrs({backgroundSelector:"#uz_bg",containerSelector:"#uz_popup_container",backgroundParentSelector:"body",blockUserSurveyClass:"uz_block_user_survey"}),this.fadeoutSurvey=function(a){$(this.attr.containerSelector).fadeOut(500)},this.openSurvey=function(){window._uzactions=window._uzactions||[];var a=this.overrideCookie?this.overrideCookie:"twittersurvey"+this.surveyId;_uzactions.push(["_setCookie",a]),_uzactions.push(["_setCustomVar",["userID",userInfo.user.id]]),_uzactions.push(["_setCustomVar",["guestId",userInfo.user.guestId]]),_uzactions.push(["_start"]);var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore($.extend(document.createElement("script"),{type:"text/javascript",async:!0,id:"injected_uz_survey_script",charset:"utf-8",src:"https://cdn5.userzoom.com/files/js/"+this.surveyId+".js?t=uz_til&cuid=2BA733EB49F6DF1188490022196C4538"}),b)},this.onBlockAction=function(){this.$node.hasClass(this.attr.blockUserSurveyClass)&&this.openSurvey()},this.after("initialize",function(){this.surveyId=this.$node.attr("data-survey-id"),this.overrideCookie=this.$node.attr("data-override-cookie"),this.$node.attr("data-show")&&this.openSurvey(),this.on(document,"uiOpenSurvey",this.openSurvey),this.on(this.attr.backgroundParentSelector,"click",{backgroundSelector:this.fadeoutSurvey}),this.on(document,"uiBlockAction",this.onBlockAction)})}var defineComponent=require("core/component"),userInfo=require("app/data/user_info");module.exports=defineComponent(uzSurvey)
});
define("app/ui/with_inline_retweet",["module","require","exports","core/i18n"],function(module, require, exports) {
function withInlineRetweet(){this.handleSuccessfulRetweet=function(a,b){this.retweetEventInfo!==undefined&&this.trigger("uiDidRetweetSuccess",this.retweetEventInfo),delete this.retweetEventInfo},this.around("toggleRetweet",function(a,b,c,d){var e=d.$tweet.hasClass(this.attr.retweetedTweetClass),f=e?"uiDidUnretweet":"uiDidRetweet",g=e?_('Retweeten'):_('Retweetet');e||(this.retweetEventInfo=d.tweetData),this.trigger(d.$tweet,f,d.tweetData),this.select("retweetSelector").find(".u-hiddenVisually").text(g)}),this.after("initialize",function(){if(!this.attr.loggedIn)return;this.on(document,"dataDidRetweet",this.handleSuccessfulRetweet)})}var _=require("core/i18n");module.exports=withInlineRetweet
});
define("app/data/with_scribe_item_position",["module","require","exports"],function(module, require, exports) {
function withScribeItemPosition(){this.getItemPosition=function(a){return $(this.attr.genericInteractionItemSelector).index(a.closest(this.attr.genericInteractionItemSelector))}}module.exports=withScribeItemPosition
});
define("app/boot/app",["module","require","exports","app/ui/dialogs/age_gate_dialog","app/ui/dialogs/authenticated_webview_dialog","app/ui/autoplayable_media","app/ui/dialogs/block_dialog","app/ui/dialogs/block_or_report","app/ui/dialogs/block_user_dialog","app/boot/common","app/ui/bouncer_dialog","app/ui/dialogs/buy_now_dialog","app/data/commerce/buy_now_dialog_scribe","app/ui/dialogs/captcha_challenge_dialog","app/ui/dialogs/confirm_dialog","app/ui/connect_badge","app/ui/dialogs/copy_found_media_link_dialog","app/ui/dialogs/create_custom_timeline_dialog","app/ui/dialogs/curate_dialog","app/ui/dialogs/delete_tweet_dialog","app/boot/dm/direct_messages","app/data/dm/dm_info","app/data/dm/dm_poll","app/ui/drag_state","app/data/dynamic_video_ad_fetcher","app/ui/banners/email_banner","app/data/email_banner","app/data/email_banner_scribe","app/data/embed_scribe","app/ui/dialogs/embed_tweet","app/data/feedback/feedback","app/ui/feedback/feedback_dialog","app/ui/gallery/gallery","app/data/gallery_scribe","app/ui/global_chrome_offset_refresher","app/ui/global_loading_indicator","app/ui/dialogs/goto_user_dialog","app/ui/dialogs/keyboard_shortcuts_dialog","app/ui/dialogs/leadgen_confirm_dialog","app/ui/dialogs/list_membership_dialog","app/ui/dialogs/list_operations_dialog","app/ui/dialogs/media_edit_dialog","app/ui/media_viewport_position_monitor","app/ui/moments/maker/moment_summary_list_dialog","app/ui/more_tweet_actions_dropdown","app/ui/multiline_ellipses","app/ui/native_notifications","app/data/native_notifications_scribe","app/ui/navigation_links","app/data/notification_listener","app/data/oembed","app/data/oembed_scribe","app/ui/dialogs/offers_dialog","app/ui/page_title","app/ui/page_visibility","app/ui/dialogs/payment_order_dialog","app/data/performance_stats_scribe","app/ui/playable_media/playable_media_manager","app/boot/profile_popup","app/ui/profile/profile_navigation","app/boot/promptbird","app/data/push_subscription_manager","app/data/push_subscription_scribe","app/ui/dialogs/quick_promote_dialog","app/ui/dialogs/report_dialog","app/ui/responsive_dashboard_width","app/ui/dialogs/retweet_dialog","app/data/saved_searches","app/data/saved_searches_scribe","app/ui/search_query_source","app/utils/setup_polling_with_backoff","app/data/sms_confirmation_data","app/ui/dialogs/sms_confirmation_dialog","app/data/sms_confirmation_scribe","app/data/spam_challenge","app/ui/spoonbill","app/ui/spoonbill_producer","app/data/sru_stats_scribe","app/ui/tco_preconnector","app/ui/dialogs/translation_feedback_dialog","app/ui/tweet_actions","app/ui/tweet_state_updater","app/data/typeahead/typeahead","app/data/typeahead/typeahead_scribe","app/data/user_info","app/data/url_command","app/ui/dialogs/uz_survey","app/ui/with_inline_retweet","app/data/with_scribe_item_position"],function(module, require, exports) {
var AgeGateDialog=require("app/ui/dialogs/age_gate_dialog"),AuthenticatedWebViewDialog=require("app/ui/dialogs/authenticated_webview_dialog"),AutoplayableMedia=require("app/ui/autoplayable_media"),BlockDialog=require("app/ui/dialogs/block_dialog"),BlockOrReportDialog=require("app/ui/dialogs/block_or_report"),BlockUserDialog=require("app/ui/dialogs/block_user_dialog"),bootCommon=require("app/boot/common"),BouncerDialog=require("app/ui/bouncer_dialog"),BuyNowConfirmDialog=require("app/ui/dialogs/buy_now_dialog"),BuyNowDialogScribe=require("app/data/commerce/buy_now_dialog_scribe"),CaptchaChallengeDialog=require("app/ui/dialogs/captcha_challenge_dialog"),ConfirmDialog=require("app/ui/dialogs/confirm_dialog"),ConnectBadge=require("app/ui/connect_badge"),CopyFoundMediaLinkDialog=require("app/ui/dialogs/copy_found_media_link_dialog"),CreateCustomTimelineDialog=require("app/ui/dialogs/create_custom_timeline_dialog"),CurateDialog=require("app/ui/dialogs/curate_dialog"),DeleteTweetDialog=require("app/ui/dialogs/delete_tweet_dialog"),directMessages=require("app/boot/dm/direct_messages"),DMInfo=require("app/data/dm/dm_info"),DMPoll=require("app/data/dm/dm_poll"),DragState=require("app/ui/drag_state"),DynamicVideoAdFetcher=require("app/data/dynamic_video_ad_fetcher"),EmailBanner=require("app/ui/banners/email_banner"),EmailBannerData=require("app/data/email_banner"),EmailBannerScribe=require("app/data/email_banner_scribe"),EmbedScribe=require("app/data/embed_scribe"),EmbedTweetDialog=require("app/ui/dialogs/embed_tweet"),Feedback=require("app/data/feedback/feedback"),FeedbackDialog=require("app/ui/feedback/feedback_dialog"),Gallery=require("app/ui/gallery/gallery"),GalleryScribe=require("app/data/gallery_scribe"),GlobalChromeOffsetRefresher=require("app/ui/global_chrome_offset_refresher"),GlobalLoadingIndicator=require("app/ui/global_loading_indicator"),GotoUserDialog=require("app/ui/dialogs/goto_user_dialog"),KeyboardShortcutsDialog=require("app/ui/dialogs/keyboard_shortcuts_dialog"),LeadGenConfirmDialog=require("app/ui/dialogs/leadgen_confirm_dialog"),ListMembershipDialog=require("app/ui/dialogs/list_membership_dialog"),ListOperationsDialog=require("app/ui/dialogs/list_operations_dialog"),MediaEditDialog=require("app/ui/dialogs/media_edit_dialog"),MediaViewportPositionMonitor=require("app/ui/media_viewport_position_monitor"),MomentsSummaryListDialog=require("app/ui/moments/maker/moment_summary_list_dialog"),MoreTweetActionsDropdown=require("app/ui/more_tweet_actions_dropdown"),MultilineEllipses=require("app/ui/multiline_ellipses"),NativeNotifications=require("app/ui/native_notifications"),NativeNotificationsScribe=require("app/data/native_notifications_scribe"),NavigationLinks=require("app/ui/navigation_links"),NotificationListener=require("app/data/notification_listener"),OembedData=require("app/data/oembed"),OembedScribe=require("app/data/oembed_scribe"),OffersConfirmDialog=require("app/ui/dialogs/offers_dialog"),PageTitle=require("app/ui/page_title"),PageVisibility=require("app/ui/page_visibility"),PaymentOrderDialog=require("app/ui/dialogs/payment_order_dialog"),PerformanceStatsScribe=require("app/data/performance_stats_scribe"),PlayableMediaManager=require("app/ui/playable_media/playable_media_manager"),profilePopup=require("app/boot/profile_popup"),ProfileNavigation=require("app/ui/profile/profile_navigation"),promptbirdBoot=require("app/boot/promptbird"),PushSubscriptionManager=require("app/data/push_subscription_manager"),PushSubscriptionScribe=require("app/data/push_subscription_scribe"),QuickPromoteDialog=require("app/ui/dialogs/quick_promote_dialog"),ReportDialog=require("app/ui/dialogs/report_dialog"),ResponsiveDashboardWidth=require("app/ui/responsive_dashboard_width"),RetweetDialog=require("app/ui/dialogs/retweet_dialog"),SavedSearchesData=require("app/data/saved_searches"),SavedSearchesScribe=require("app/data/saved_searches_scribe"),SearchQuerySource=require("app/ui/search_query_source"),setupPollingWithBackoff=require("app/utils/setup_polling_with_backoff"),SmsConfirmationData=require("app/data/sms_confirmation_data"),SmsConfirmationDialog=require("app/ui/dialogs/sms_confirmation_dialog"),SmsConfirmationScribe=require("app/data/sms_confirmation_scribe"),SpamChallengeData=require("app/data/spam_challenge"),Spoonbill=require("app/ui/spoonbill"),SpoonbillProducer=require("app/ui/spoonbill_producer"),SruStatsScribe=require("app/data/sru_stats_scribe"),TCoPreconnector=require("app/ui/tco_preconnector"),TranslationFeedbackDialog=require("app/ui/dialogs/translation_feedback_dialog"),TweetActionsUI=require("app/ui/tweet_actions"),TweetStateUpdater=require("app/ui/tweet_state_updater"),TypeaheadData=require("app/data/typeahead/typeahead"),TypeaheadScribe=require("app/data/typeahead/typeahead_scribe"),userInfo=require("app/data/user_info"),UrlCommand=require("app/data/url_command"),uzSurvey=require("app/ui/dialogs/uz_survey"),withInlineRetweet=require("app/ui/with_inline_retweet"),withScribeItemPosition=require("app/data/with_scribe_item_position");module.exports=function(b){DMInfo.set(b.dm),bootCommon(b),PageTitle.attachTo(document,{noTeardown:!0}),ResponsiveDashboardWidth.attachTo(document),DragState.attachTo("body"),GlobalChromeOffsetRefresher.attachTo(document),SearchQuerySource.attachTo("body",{noTeardown:!0}),ConfirmDialog.attachTo(document,{noTeardown:!0}),CaptchaChallengeDialog.attachTo("#spam_challenge_dialog",{noTeardown:!0}),SpamChallengeData.attachTo(document,b,{noTeardown:!0});if(b.loggedIn){NotificationListener.attachTo(document,b,{noTeardown:!0});var c=DMInfo.get("poll_options");c?DMPoll.attachTo(document,{foregroundPollInterval:c.foreground_poll_interval,burstPollInterval:c.burst_poll_interval,burstPollDuration:c.burst_poll_duration,maxPollInterval:c.max_poll_interval,noTeardown:!0}):DMPoll.attachTo(document,{foregroundPollInterval:b.deciders.dm_polling_frequency_in_seconds*1e3,noTeardown:!0}),ListMembershipDialog.attachTo("#list-membership-dialog",b,{noTeardown:!0}),ListOperationsDialog.attachTo("#list-operations-dialog",b,{noTeardown:!0}),CreateCustomTimelineDialog.attachTo("#create-custom-timeline-dialog",b),CurateDialog.attachTo("#curate-dialog",b),MomentsSummaryListDialog.attachTo("#moments-summary-list-dialog",b),directMessages(b),EmailBanner.attachTo(document,{noTeardown:!0}),EmailBannerScribe.attachTo(document,{noTeardown:!0}),EmailBannerData.attachTo(document,{noTeardown:!0}),ProfileNavigation.attachTo(document,{currentUserPath:b.routes.profile,noTeardown:!0})}userInfo.getDecider("native_notifications")&&(NativeNotifications.attachTo(document),NativeNotificationsScribe.attachTo(document)),TypeaheadScribe.attachTo(document,{noTeardown:!0}),TypeaheadData.attachTo(document,b.typeaheadData,{noTeardown:!0}),SavedSearchesScribe.attachTo(document,{noTeardown:!0}),SavedSearchesData.attachTo(document,{noTeardown:!0}),GotoUserDialog.attachTo("#goto-user-dialog",b),profilePopup({profile_user:b.profile_user,deviceEnabled:b.deviceEnabled,deviceVerified:b.deviceVerified,formAuthenticityToken:b.formAuthenticityToken,loggedIn:b.loggedIn}),GalleryScribe.attachTo(document,{noTeardown:!0});var d={itemType:"tweet",noTeardown:!0,loggedIn:b.loggedIn,eventData:{scribeContext:{component:"gallery"}}};Gallery.attachTo(".Gallery",b,d),TweetActionsUI.attachTo(".Gallery",b,d),MoreTweetActionsDropdown.attachTo(".Gallery",b,d),OembedScribe.attachTo(document,{noTeardown:!0}),OembedData.attachTo(document,b),KeyboardShortcutsDialog.attachTo(document,b,{noTeardown:!0,loggedIn:b.loggedIn}),CopyFoundMediaLinkDialog.attachTo(document,b,{noTeardown:!0}),RetweetDialog.attachTo("#retweet-tweet-dialog",b,{noTeardown:!0}),DeleteTweetDialog.attachTo("#delete-tweet-dialog",b,{noTeardown:!0}),QuickPromoteDialog.attachTo("#quick-promote-dialog",b,{noTeardown:!0}),BlockUserDialog.attachTo("#block-user-dialog",b,{noTeardown:!0}),EmbedScribe.attachTo(document,{noTeardown:!0}),EmbedTweetDialog.attachTo("#embed-tweet-dialog",b,{noTeardown:!0}),BlockOrReportDialog.attachTo("#block-or-report-dialog",b,{noTeardown:!0}),BlockDialog.attachTo("#block-dialog",b,{noTeardown:!0}),ReportDialog.attachTo("#report-dialog",b,{noTeardown:!0}),AgeGateDialog.attachTo("#age-gate-dialog",b,{noTeardown:!0}),LeadGenConfirmDialog.attachTo("#leadgen-confirm-dialog",b),setupPollingWithBackoff("uiWantsToRefreshTimestamps"),PageVisibility.attachTo(document),PerformanceStatsScribe.attachTo(document,{noTeardown:!0}),SruStatsScribe.attachTo(document,{noTeardown:!0}),TranslationFeedbackDialog.attachTo("#translation-feedback-dialog",b,{noTeardown:!0}),MediaEditDialog.attachTo("#media-edit-dialog",{hasAdvancedFeatures:b.whitelistedVideoUser,noTeardown:!0}),NavigationLinks.attachTo(".dashboard",{eventData:{scribeContext:{component:"dashboard_nav"}}}),FeedbackDialog.attachTo("#feedback_dialog",b.debugData,{noTeardown:!0}),Feedback.attachTo(document,b.debugData,{noTeardown:!0}),$(".uz_block_user_survey")[0]&&uzSurvey.attachTo(".uz_block_user_survey"),Spoonbill.attachTo("#spoonbill-outer",b,{noTeardown:!0}),TweetActionsUI.mixin(withScribeItemPosition,withInlineRetweet).attachTo("#spoonbill-outer",b,{eventData:{scribeContext:{component:"spoonbill"}},tweetItemSelector:".WebToast",favoriteSelector:".js-actionFavorite",replySelector:".js-actionReply",retweetSelector:".js-actionInlineRetweet",noTeardown:!0}),SpoonbillProducer.attachTo("#spoonbill-outer",b,{noTeardown:!0}),promptbirdBoot(b),GlobalLoadingIndicator.attachTo(document,b,{noTeardown:!0}),ConnectBadge.attachTo(document,b,{noTeardown:!0}),BouncerDialog.attachTo("#bouncer-dialog",b,{noTeardown:!0}),BuyNowConfirmDialog.attachTo("#buy-now-dialog",b,{noTeardown:!0}),BuyNowDialogScribe.attachTo(document,{noTeardown:!0}),OffersConfirmDialog.attachTo("#offers-dialog",b,{noTeardown:!0}),PaymentOrderDialog.attachTo("#payment-order-detail-dialog",b,{noTeardown:!0}),AuthenticatedWebViewDialog.attachTo("#auth-webview-dialog",b,{noTeardown:!0}),MultilineEllipses.attachTo(document),TweetStateUpdater.attachTo(document,b,{noTeardown:!0}),SmsConfirmationData.attachTo("#sms-confirmation-dialog"),SmsConfirmationDialog.attachTo("#sms-confirmation-dialog",b,{noTeardown:!0}),SmsConfirmationScribe.attachTo(document),DynamicVideoAdFetcher.attachTo(document,{includeLongVideos:userInfo.getDecider("dynamic_video_ads_include_long_videos")}),userInfo.getDecider("enableNativePush")&&(PushSubscriptionScribe.attachTo(document),PushSubscriptionManager.attachTo(document,{noTeardown:!0})),UrlCommand.attachTo(document,b,{noTeardown:!0}),TCoPreconnector.attachTo(document,{noTeardown:!0}),AutoplayableMedia.attachTo("#page-container"),PlayableMediaManager.attachTo("#page-container"),MediaViewportPositionMonitor.attachTo(document)}
});define("template", ["module"], function(module) {
var Templates = {};
Templates['composer_errors'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"tweet-compose-errors\">\n  <span class=\"Icon Icon--small Icon--circleError tweet-compose-error-icon\"></span>\n  <span class=\"tweet-compose-error-text\">\n");if(t.s(t.f("too_many_hashtags",c,p,1),c,p,0,222,474,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      \n        ");if(t.s(t.f("hashtag_count_one",c,p,1),c,p,0,260,314,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many hashtags! Just one hashtag per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("        ");if(t.s(t.f("hashtag_count_other",c,p,1),c,p,0,369,438,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many hashtags! Just ");t.b(t.v(t.f("hashtag_count",c,p,0)));t.b(" hashtags per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("      \n");});c.pop();}if(!t.s(t.f("too_many_hashtags",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("too_many_mentions",c,p,1),c,p,0,552,816,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        \n          ");if(t.s(t.f("mention_count_one",c,p,1),c,p,0,594,649,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many mentions! Just one @mention per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("          ");if(t.s(t.f("mention_count_other",c,p,1),c,p,0,706,776,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many mentions! Just ");t.b(t.v(t.f("mention_count",c,p,0)));t.b(" @mentions per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("        \n");});c.pop();}if(!t.s(t.f("too_many_mentions",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("too_many_links",c,p,1),c,p,0,895,1140,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          \n            ");if(t.s(t.f("link_count_one",c,p,1),c,p,0,938,986,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many links! Just one link per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("            ");if(t.s(t.f("link_count_other",c,p,1),c,p,0,1039,1099,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Too many links! Just ");t.b(t.v(t.f("link_count",c,p,0)));t.b(" links per Tweet, please.");});c.pop();}t.b("\n" + i);t.b("          \n");});c.pop();}};};t.b("  </span>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['create_custom_timeline_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<button type=\"button\" class=\"btn-link js-create-custom-timeline-button\" data-element-term=\"create_custom_timeline_button\">Neue Sammlung erstellen</button>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['dismiss_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<button type=\"button\" class=\"preview-overlay dismiss js-dismiss\" tabindex=\"-1\">\n  <span class=\"icon dismiss-white\">\n    <span class=\"visuallyhidden\">\n      Verwerfen\n    </span>\n  </span>\n</button>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['emojified_name'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b(t.v(t.f("name",c,p,0)));return t.fl(); },partials: {}, subs: {  }});
Templates['learn_more_link'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<a href=\"https://support.twitter.com/articles/");t.b(t.v(t.f("article_number",c,p,0)));t.b("#import-web\" target=\"_blank\">Mehr erfahren</a>");return t.fl(); },partials: {}, subs: {  }});
Templates['nux_recommendation_user_stream_item'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"NuxRecommendationStreamItem js-stream-item stream-item\n  data-recommendation-source=\"");t.b(t.v(t.f("recommendation_source",c,p,0)));t.b("\"\n  data-recommendation-token=\"");t.b(t.v(t.f("recommendation_token",c,p,0)));t.b("\">\n  <div class=\"NuxRecommendationStreamItem-accountFollow\">\n    <div class=\"NuxRecommendationStreamItem-dismissAction\">\n      <label class=\"t1-label contact-select-box\">\n        <span class=\"u-hiddenVisually\">");t.b(t.v(t.f("screen_name",c,p,0)));t.b(" folgen</span>\n        <span class=\"Checkbox\">\n          <input class=\"Checkbox-original js-action-checkbox\" type=\"checkbox\" id=\"contact-box-");t.b(t.v(t.f("id",c,p,0)));t.b("\" value=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" ");if(t.s(t.f("is_custom",c,p,1),c,p,0,579,586,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("checked");});c.pop();}t.b(">\n          <span class=\"Checkbox-fake\">\n            <span class=\"Icon Icon--check Icon--small\"></span>\n          </span>\n        </span>\n      </label>\n    </div>\n");t.b(t.rp("<stream_user0",c,p,"    "));t.b("  </div>\n\n  <div class=\"NuxRecommendationStreamItem-accountUnfollow\">\n    <div class=\"content\">\n");t.b(t.rp("<user_item_action1",c,p,"      "));t.b("      <span class=\"NuxRecommendationStreamItem-followText\">Du bist ");t.b(t.v(t.f("screen_name",c,p,0)));t.b(" gefolgt</span>\n      <span class=\"NuxRecommendationStreamItem-pendingText\">Deine Follower-Anfrage für ");t.b(t.v(t.f("screen_name",c,p,0)));t.b(" steht noch aus.</span>\n    </div>\n  </div>\n</li>\n");return t.fl(); },partials: {"<stream_user0":{name:"stream_user", partials: {}, subs: {  }},"<user_item_action1":{name:"user_item_action", partials: {}, subs: {  }}}, subs: {  }});
Templates['pill_list_item'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<label class=\"PillList-item\">\n  <input type=\"checkbox\" name=\"");t.b(t.v(t.f("name",c,p,0)));t.b("\" value=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" data-type=\"");t.b(t.v(t.f("item_type",c,p,0)));t.b("\" ");if(t.s(t.f("is_custom",c,p,1),c,p,0,126,133,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("checked");});c.pop();}t.b(">\n  <span class=\"PillList-label ");if(t.s(t.f("has_children",c,p,1),c,p,0,196,218,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("PillList-label--parent");});c.pop();}t.b(" ");if(t.s(t.f("is_custom",c,p,1),c,p,0,250,265,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("PillList-custom");});c.pop();}t.b("\">\n      ");t.b(t.v(t.f("name",c,p,0)));t.b("<span class=\"Icon Icon--check Icon--smallest\"></span>");if(t.s(t.f("has_children",c,p,1),c,p,0,366,417,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("<span class=\"Icon Icon--add Icon--smallest\"></span>");});c.pop();}t.b("\n" + i);t.b("  </span>\n</label>\n");if(t.s(t.f("has_children",c,p,1),c,p,0,471,841,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <div class=\"PillList-children\">\n");if(t.s(t.f("children",c,p,1),c,p,0,523,818,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <label class=\"PillList-item\">\n        <input type=\"checkbox\" name=\"");t.b(t.v(t.f("name",c,p,0)));t.b("\" value=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" data-type=\"");t.b(t.v(t.f("item_type",c,p,0)));t.b("\">\n        <span class=\"PillList-label PillList-label--child\">\n            ");t.b(t.v(t.f("name",c,p,0)));t.b("<span class=\"Icon Icon--check Icon--smallest\"></span>\n        </span>\n      </label>\n");});c.pop();}t.b("  </div>\n");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['prefilled_tweetbox_content'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("screen_names_for_tweet_box",c,p,1),c,p,0,31,232,"{{ }}")){t.rs(c,p,function(c,p,t){if(!t.s(t.f("condensed_tweet_box",c,p,1),c,p,1,0,0,"")){t.b(t.v(t.f("screen_names_for_tweet_box",c,p,0)));t.b("&nbsp;");};if(t.s(t.f("condensed_tweet_box",c,p,1),c,p,0,155,202,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Antwort an ");t.b(t.v(t.f("screen_names_for_tweet_box",c,p,0)));t.b("&nbsp;");});c.pop();}});c.pop();}if(t.s(t.f("second_session_profile_prefilled_text",c,p,1),c,p,0,311,352,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("second_session_profile_prefilled_text",c,p,0)));});c.pop();}if(!t.s(t.f("second_session_profile_prefilled_text",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("first_tweet_prefilled_text",c,p,1),c,p,0,481,511,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("first_tweet_prefilled_text",c,p,0)));});c.pop();}};return t.fl(); },partials: {}, subs: {  }});
Templates['screen_reader_kb_shortcuts_message'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"kb-shortcuts-msg\" class=\"visuallyhidden\">\n  <h2>Tastatur Kurzbefehle</h2>\n  <p>\n    Tastatur Kurzbefehle sind verfügbar für häufige Aktionen und Seitennavigation.\n");t.b("    <button id=\"show-shortcuts-btn\" type=\"button\" tabindex=\"-1\">Tastatur Kurzbefehle anzeigen</button>\n    <button id=\"dismiss-shortcuts-btn\" type=\"button\" tabindex=\"-1\">Nachricht verwerfen</button>\n  </p>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['stream_end'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"stream-end\">\n  <div class=\"stream-end-inner\">\n");if(t.s(t.f("show_stream_end_bird",c,p,1),c,p,0,87,148,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <span class=\"Icon Icon--large Icon--logo\"></span>\n");});c.pop();}t.b("\n" + i);t.b("    <p class=\"empty-text\">\n");if(!t.s(t.f("is_unavailable",c,p,1),c,p,1,0,0,"")){t.b("        ");t.b(t.v(t.f("empty_text",c,p,0)));t.b("\n" + i);};if(t.s(t.f("is_unavailable",c,p,1),c,p,0,302,351,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<unavailable_timeline_message0",c,p,"        "));});c.pop();}t.b("\n" + i);if(t.s(t.f("on_adaptive_search",c,p,1),c,p,0,401,592,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("exception_message",c,p,1),c,p,0,432,473,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          ");t.b(t.v(t.f("exception_message",c,p,0)));t.b("\n" + i);});c.pop();}if(!t.s(t.f("exception_message",c,p,1),c,p,1,0,0,"")){t.b("          Keine Ergebnisse.\n");};});c.pop();}t.b("    </p>\n\n");if(!t.s(t.f("exception_message",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("show_stream_end",c,p,1),c,p,0,679,773,"{{ }}")){t.rs(c,p,function(c,p,t){if(!t.s(t.f("hide_back_to_top",c,p,1),c,p,1,0,0,"")){t.b(t.rp("<back_to_top1",c,p,"          "));};});c.pop();}};t.b("\n" + i);if(t.s(t.f("end_text",c,p,1),c,p,0,839,872,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <p>");t.b(t.t(t.f("end_text",c,p,0)));t.b("</p>\n");});c.pop();}t.b("  </div>\n</div>\n");return t.fl(); },partials: {"<unavailable_timeline_message0":{name:"unavailable_timeline_message", partials: {}, subs: {  }},"<back_to_top1":{name:"back_to_top", partials: {}, subs: {  }}}, subs: {  }});
Templates['stream_loading'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"stream-loading\">\n  <div class=\"stream-end-inner\">\n    <span class=\"spinner\" title=\"Lädt...\"></span>\n  </div>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['stream_user'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("is_withheld",c,p,1),c,p,0,16,45,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<stream_user_withheld0",c,p,"  "));});c.pop();}if(!t.s(t.f("is_withheld",c,p,1),c,p,1,0,0,"")){t.b("\n" + i);t.b("<div class=\"account ");if(t.s(t.f("promoted_content",c,p,1),c,p,0,121,138,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("promoted-account ");});c.pop();}t.b(" ");t.b("js-actionable-user js-profile-popup-actionable ");if(t.s(t.f("hidden_by_activity",c,p,1),c,p,0,250,273,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" sub-stream-item-hidden");});c.pop();}t.b("\" ");t.b("data-screen-name=\"");t.b(t.v(t.f("screen_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" ");t.b("data-feedback-token=\"");t.b(t.v(t.f("feedback_token",c,p,0)));t.b("\" data-impression-id=\"");t.b(t.v(t.f("account_impression_id",c,p,0)));t.b("\" ");if(t.s(t.f("impression_cookie",c,p,1),c,p,0,495,541,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("data-impression-cookie=\"");t.b(t.v(t.f("impression_cookie",c,p,0)));t.b("\"");});c.pop();}t.b(">\n\n");if(t.s(t.f("user_milestone_context",c,p,1),c,p,0,595,863,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <div class=\"context\">\n");t.b(t.rp("<user_milestone_context1",c,p,"      "));if(t.s(t.f("is_milestone_item_view",c,p,1),c,p,0,689,822,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <div class=\"MilestoneHeadline-UserContext\">\n");t.b(t.rp("<notifications/milestones/milestone_headline2",c,p,"          "));t.b("        </div>\n");});c.pop();}t.b("    </div>\n");});c.pop();}t.b("\n" + i);t.b(t.rp("<profile_actions3",c,p,"  "));t.b("\n" + i);t.b("  <div class=\"activity-user-profile-content\">\n    <div class=\"content\">\n      <div class=\"stream-item-header\">\n        <a class=\"account-group js-user-profile-link");if(t.s(t.f("embedded_by_activity",c,p,1),c,p,0,1104,1115,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" js-tooltip");});c.pop();}t.b("\" ");t.b("href=\"");t.b(t.v(t.f("profile_path",c,p,0)));t.b("\" ");if(t.s(t.f("embedded_by_activity",c,p,1),c,p,0,1209,1226,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" title=\"");t.b(t.v(t.f("name",c,p,0)));t.b("\"");});c.pop();}t.b(">\n          <img class=\"avatar js-action-profile-avatar ");t.b(t.v(t.f("avatar_size_class",c,p,0)));if(t.s(t.f("embedded_by_activity",c,p,1),c,p,0,1353,1384,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b("js-tooltip");});c.pop();}t.b(" ");if(t.s(t.f("circular_avatar",c,p,1),c,p,0,1430,1446,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("avatar--circular");});c.pop();}t.b("\" ");t.b("src=\"");if(t.s(t.f("embedded_by_activity",c,p,1),c,p,0,1518,1546,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("bigger_profile_image_url",c,p,0)));});c.pop();}if(!t.s(t.f("embedded_by_activity",c,p,1),c,p,1,0,0,"")){t.b(t.v(t.f("profile_image_url",c,p,0)));};t.b("\" alt=\"\" data-user-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\"/>\n          <strong class=\"fullname js-action-profile-name\">");t.b(t.rp("<emojified_name4",c,p,""));t.b("</strong>");if(t.s(t.f("verified",c,p,1),c,p,0,1810,1837,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<verified_account_badge5",c,p,""));});c.pop();}t.b("\n" + i);if(t.s(t.f("is_mobile",c,p,1),c,p,0,1875,2069,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("            <div id =\"profile-name\">\n              <span class=\"username js-action-profile-name\">@");t.b(t.v(t.f("screen_name",c,p,0)));t.b("</span>\n");t.b(t.rp("<protected_account_badge6",c,p,"              "));t.b("            </div>\n");});c.pop();}if(!t.s(t.f("is_mobile",c,p,1),c,p,1,0,0,"")){t.b("            <span class=\"username js-action-profile-name\">@");t.b(t.v(t.f("screen_name",c,p,0)));t.b("</span>\n");t.b(t.rp("<protected_account_badge7",c,p,"            "));};t.b("        </a>\n      </div>\n");if(!t.s(t.f("with_followers_count",c,p,1),c,p,1,0,0,"")){if(!t.s(t.f("no_description",c,p,1),c,p,1,0,0,"")){t.b("          <p class=\"bio ");if(t.s(t.f("description_is_rtl",c,p,1),c,p,0,2390,2409,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("bio-description-rtl");});c.pop();}t.b("\">\n");if(!t.s(t.f("not_linked_description",c,p,1),c,p,1,0,0,"")){t.b(t.rp("<linkified_description_partial8",c,p,"              "));};if(t.s(t.f("not_linked_description",c,p,1),c,p,0,2603,2646,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("              ");t.b(t.v(t.f("description",c,p,0)));t.b("\n" + i);});c.pop();}t.b("          </p>\n");};};if(t.s(t.f("with_followers_count",c,p,1),c,p,0,2780,2850,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <div class=\"followers-count\">");t.b(t.t(t.f("follower_stat",c,p,0)));t.b("</div>\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("mini_social_proof",c,p,1),c,p,0,2932,2994,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <p class=\"metadata\">");t.b(t.rp("<mini_social_proof9",c,p,""));t.b("</p>\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("is_sponsored",c,p,1),c,p,0,3041,3563,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("promoted_account_context",c,p,1),c,p,0,3079,3151,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          <p class=\"metadata\">");t.b(t.v(t.f("promoted_account_context",c,p,0)));t.b("</p>\n");});c.pop();}t.b("        <span class=\"metadata with-icn\">\n          <a class=\"js-promoted-badge js-user-profile-link js-tooltip js-disclosure\" href=\"");t.b(t.v(t.f("profile_path",c,p,0)));t.b("\" ");t.b("data-user-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" title=\"");if(t.s(t.f("promoted_content",c,p,1),c,p,0,3401,3420,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("disclosure_text",c,p,0)));});c.pop();}t.b("\">");t.b("<span class=\"");t.b(t.v(t.f("promoted_badge_class",c,p,0)));t.b(" Icon Icon--small\"></span>Gesponsert</a>\n        </span>\n");});c.pop();}t.b("    </div>\n  </div>\n</div>\n\n");};return t.fl(); },partials: {"<stream_user_withheld0":{name:"stream_user_withheld", partials: {}, subs: {  }},"<user_milestone_context1":{name:"user_milestone_context", partials: {}, subs: {  }},"<notifications/milestones/milestone_headline2":{name:"notifications/milestones/milestone_headline", partials: {}, subs: {  }},"<profile_actions3":{name:"profile_actions", partials: {}, subs: {  }},"<emojified_name4":{name:"emojified_name", partials: {}, subs: {  }},"<verified_account_badge5":{name:"verified_account_badge", partials: {}, subs: {  }},"<protected_account_badge6":{name:"protected_account_badge", partials: {}, subs: {  }},"<protected_account_badge7":{name:"protected_account_badge", partials: {}, subs: {  }},"<linkified_description_partial8":{name:"linkified_description_partial", partials: {}, subs: {  }},"<mini_social_proof9":{name:"mini_social_proof", partials: {}, subs: {  }}}, subs: {  }});
Templates['swift_dm_box'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<form class=\"DMComposer tweet-form\" target=\"dm-post-iframe\" action=\"//");t.b(t.v(t.f("media_upload_domain",c,p,0)));t.b("/i/media/upload.iframe\" method=\"post\" enctype=\"multipart/form-data\">\n  <input type=\"hidden\" name=\"authenticity_token\" class=\"auth-token\">\n\n  <div class=\"DMComposer-container u-borderUserColorLighter\">\n    <div class=\"DMComposer-attachment\">\n      <div class=\"DMComposer-tweet\">\n");t.b(t.rp("<dm/dm_composer_tweet_attachment0",c,p,"        "));t.b("      </div>\n\n      <div class=\"DMComposer-media\">\n");t.b(t.rp("<thumbnail_container1",c,p,"        "));t.b("      </div>\n    </div>\n\n    <div class=\"DMComposer-editor tweet-box rich-editor js-initial-focus is-showPlaceholder ");if(t.s(t.f("emoji_bar",c,p,1),c,p,0,631,644,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("with-emojiBar");});c.pop();}t.b("\" data-default-placeholder=\"Neue Nachricht beginnen\" data-attachment-placeholder=\"Kommentar hinzufügen...\" data-from-message-me-card-placeholder=\"Private Nachricht senden\" id=\"");t.b(t.v(t.f("tweet_box_id",c,p,0)));t.b("\" aria-label=\"Direktnachricht SMS\" contenteditable=\"true\" spellcheck=\"true\" role=\"textbox\" aria-multiline=\"false\"></div>\n\n");if(t.s(t.f("emoji_bar",c,p,1),c,p,0,990,1058,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <div class=\"DMComposer-emojiBar\">");t.b(t.rp("<dm/emoji_bar2",c,p,""));t.b("</div>\n");});c.pop();}t.b("  </div>\n\n  <div class=\"TweetBoxExtras\">\n");if(t.s(t.f("dm_found_media_enabled",c,p,1),c,p,0,1145,1268,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <div class=\"DMComposer-gifSearch TweetBoxExtras-item\">\n");t.b(t.rp("<found_media/found_media_search3",c,p,"        "));t.b("      </div>\n");});c.pop();}t.b("\n" + i);t.b("    <div class=\"DMComposer-mediaPicker TweetBoxExtras-item\">\n");t.b(t.rp("<media/media_picker4",c,p,"      "));t.b("    </div>\n  </div>\n\n  <div class=\"DMComposer-send\">\n    <button class=\"btn tweet-action primary-btn messaging tweet-btn disabled\" type=\"button\">\n      <span class=\"button-text messaging-text\">Senden</span>\n    </button>\n  </div>\n</form>\n");return t.fl(); },partials: {"<dm/dm_composer_tweet_attachment0":{name:"dm/dm_composer_tweet_attachment", partials: {}, subs: {  }},"<thumbnail_container1":{name:"thumbnail_container", partials: {}, subs: {  }},"<dm/emoji_bar2":{name:"dm/emoji_bar", partials: {}, subs: {  }},"<found_media/found_media_search3":{name:"found_media/found_media_search", partials: {}, subs: {  }},"<media/media_picker4":{name:"media/media_picker", partials: {}, subs: {  }}}, subs: {  }});
Templates['swift_tweet_box'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<form class=\"t1-form tweet-form\n        ");if(t.s(t.f("condensed_tweet_box",c,p,1),c,p,0,64,73,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("condensed");});c.pop();}t.b("\n" + i);t.b("        ");if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,132,154,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("is-minimalButtonLabels");});c.pop();}t.b("\"\n      method=\"post\"\n      target=\"tweet-post-iframe\"\n");if(t.s(t.f("screen_names_for_tweet_box",c,p,1),c,p,0,272,411,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        data-default-text=\"");t.b(t.v(t.f("screen_names_for_tweet_box",c,p,0)));t.b(" \"\n        data-condensed-text=\"Antwort an ");t.b(t.v(t.f("screen_names_for_tweet_box",c,p,0)));t.b("\"\n");});c.pop();}if(t.s(t.f("condensed_tweet_box_text",c,p,1),c,p,0,478,544,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        data-condensed-text=\"");t.b(t.v(t.f("condensed_tweet_box_text",c,p,0)));t.b("\"\n");});c.pop();}t.b("      action=\"//");t.b(t.v(t.f("upload_domain",c,p,0)));t.b("/i/tweet/create_with_media.iframe\"\n      enctype=\"multipart/form-data\"\n");if(t.s(t.f("enable_more_poll_options",c,p,1),c,p,0,713,756,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        data-poll-composer-rows=\"3\"\n");});c.pop();}if(t.s(t.f("enable_poll_duration",c,p,1),c,p,0,817,878,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        data-poll-duration=\"");t.b(t.v(t.f("enable_poll_duration",c,p,0)));t.b("\"\n");});c.pop();}t.b("      >\n\n");if(t.s(t.f("use_tweet_ui_metrics",c,p,1),c,p,0,940,1008,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <input type=\"hidden\" value=\"\" name=\"use_tweet_ui_metrics\">\n");});c.pop();}if(t.s(t.f("current_user",c,p,1),c,p,0,1053,1156,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <img class=\"inline-reply-user-image avatar size32\" src=\"");t.b(t.v(t.f("profile_image_absolute_url",c,p,0)));t.b("\" alt=\"\">\n");});c.pop();}t.b("  <span class=\"inline-reply-caret\">\n    <span class=\"caret-inner\"></span>\n  </span>\n\n  <div class=\"tweet-content\">\n");if(t.s(t.f("include_photo_intent",c,p,1),c,p,0,1318,1370,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <div class=\"TweetBox-photoIntent\"></div>\n");});c.pop();}t.b("    <div class=\"icon add-photo-icon hidden\"></div>\n");t.b("    <span class=\"icon nav-tweet hidden\"></span>\n    <div class=\"tweet-drag-help tweet-drag-photo-here hidden\"></div>\n    <span class=\"visuallyhidden\" id=\"");t.b(t.v(t.f("tweet_box_id",c,p,0)));t.b("-label\">Text twittern</span>\n\n");t.b(t.rp("<compose/rich_editor_prefix0",c,p,"    "));t.b("    <div aria-labelledby=\"");t.b(t.v(t.f("tweet_box_id",c,p,0)));t.b("-label\" name=\"tweet\" id=\"");t.b(t.v(t.f("tweet_box_id",c,p,0)));t.b("\" class=\"tweet-box rich-editor\" contenteditable=\"true\" spellcheck=\"true\" role=\"textbox\"\n      aria-multiline=\"true\" data-placeholder-default=\"Was gibt's Neues?\" data-placeholder-poll-composer-on=\"Stelle eine Frage…\">");t.b(t.rp("<prefilled_tweetbox_content1",c,p,""));t.b("</div>\n");t.b(t.rp("<compose/rich_editor_suffix2",c,p,"    "));t.b("\n" + i);t.b(t.rp("<swift_typeahead_dropdown3",c,p,"    "));t.b("\n" + i);t.b("    <textarea aria-hidden=\"true\" class=\"tweet-box-shadow hidden\" name=\"status\"></textarea>\n\n");if(t.s(t.f("include_rescuebird_alert_composer",c,p,1),c,p,0,2472,2521,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<compose/rescuebird_alert_compose4",c,p,"      "));});c.pop();}t.b("\n" + i);t.b(t.rp("<thumbnail_container5",c,p,"    "));t.b("\n" + i);t.b("    <div class=\"CardComposer\">\n");if(t.s(t.f("include_polling_card_composer",c,p,1),c,p,0,2728,2771,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<card/poll_compose_view6",c,p,"        "));});c.pop();}t.b("    </div>\n\n");if(t.s(t.f("whitelisted_video_user",c,p,1),c,p,0,2849,3890,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <div class=\"TweetBox-advanced\">\n        <div class=\"TweetBox-advancedTitle\"></div>\n        <input class=\"TweetBox-advancedTitleInput\" name=\"advanced_title\" type=\"hidden\" />\n        <div class=\"TweetBox-advancedDescription\"></div>\n        <input class=\"TweetBox-advancedDescriptionInput\" name=\"advanced_description\" type=\"hidden\" />\n        <div class=\"TweetBox-advancedCta\">\n            <span class=\"TweetBox-advancedCtaType\"></span>\n            <input class=\"TweetBox-advancedCtaTypeInput\" name=\"advanced_cta_type\" type=\"hidden\" />\n            <span class=\"TweetBox-advancedCtaUrl\"></span>\n            <input class=\"TweetBox-advancedCtaUrlInput\" name=\"advanced_cta_url\" type=\"hidden\" />\n        </div>\n        <div class=\"TweetBox-advancedEmbeddable\">\n          <span class=\"TweetBox-advancedEmbeddableLabel\">Video-Einbettung:</span>\n          <span class=\"TweetBox-advancedEmbeddableValue\"></span>\n          <input class=\"TweetBox-advancedEmbeddableInput\" name=\"advanced_embeddable\" type=\"hidden\" />\n        </div>\n      </div>\n");});c.pop();}t.b("\n" + i);t.b("    <div class=\"tweet-box-overlay\"></div>\n  </div>\n\n  <div class=\"TweetBoxToolbar\">\n    <div class=\"TweetBoxExtras tweet-box-extras\">\n");if(t.s(t.f("geo_picker_in_front",c,p,1),c,p,0,4192,4334,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("include_geo_picker",c,p,1),c,p,0,4224,4304,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          <span class=\"TweetBoxExtras-item\">");t.b(t.rp("<geo/geo_picker7",c,p,""));t.b("</span>\n");});c.pop();}});c.pop();}t.b("\n" + i);if(t.s(t.f("include_rescuebird_alert_composer",c,p,1),c,p,0,4404,4456,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<compose/rescuebird_alert_button8",c,p,"        "));});c.pop();}t.b("\n" + i);if(t.s(t.f("include_image_picker",c,p,1),c,p,0,4527,4628,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <span class=\"TweetBoxExtras-item TweetBox-mediaPicker\">");t.b(t.rp("<media/media_picker9",c,p,""));t.b("</span>\n");});c.pop();}t.b("\n" + i);if(!t.s(t.f("geo_picker_in_front",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("include_geo_picker",c,p,1),c,p,0,4717,4797,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          <span class=\"TweetBoxExtras-item\">");t.b(t.rp("<geo/geo_picker10",c,p,""));t.b("</span>\n");});c.pop();}};t.b("\n" + i);if(t.s(t.f("found_media_enabled",c,p,1),c,p,0,4883,4975,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <span class=\"TweetBoxExtras-item\">");t.b(t.rp("<found_media/found_media_search11",c,p,""));t.b("</span>\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("include_polling_card_composer",c,p,1),c,p,0,5041,5127,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <span class=\"TweetBoxExtras-item\">");t.b(t.rp("<card/poll_creator_button12",c,p,""));t.b("</span>\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("content_view",c,p,1),c,p,0,5186,5366,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("include_lifeline_alert_status",c,p,1),c,p,0,5229,5325,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          <span class=\"TweetBoxExtras-item\">");t.b(t.rp("<lifeline/lifeline_alert_status13",c,p,""));t.b("</span>\n");});c.pop();}});c.pop();}t.b("\n" + i);t.b(t.rp("<tweetbox/upload_progress14",c,p,"      "));t.b("    </div>\n    <div class=\"TweetBoxToolbar-tweetButton tweet-button\">\n      <span class=\"spinner\"></span>\n      <span class=\"tweet-counter\">140</span>\n");t.b(t.rp("<tweet_button15",c,p,"      "));t.b("    </div>\n  </div>\n</form>\n");return t.fl(); },partials: {"<compose/rich_editor_prefix0":{name:"compose/rich_editor_prefix", partials: {}, subs: {  }},"<prefilled_tweetbox_content1":{name:"prefilled_tweetbox_content", partials: {}, subs: {  }},"<compose/rich_editor_suffix2":{name:"compose/rich_editor_suffix", partials: {}, subs: {  }},"<swift_typeahead_dropdown3":{name:"swift_typeahead_dropdown", partials: {}, subs: {  }},"<compose/rescuebird_alert_compose4":{name:"compose/rescuebird_alert_compose", partials: {}, subs: {  }},"<thumbnail_container5":{name:"thumbnail_container", partials: {}, subs: {  }},"<card/poll_compose_view6":{name:"card/poll_compose_view", partials: {}, subs: {  }},"<geo/geo_picker7":{name:"geo/geo_picker", partials: {}, subs: {  }},"<compose/rescuebird_alert_button8":{name:"compose/rescuebird_alert_button", partials: {}, subs: {  }},"<media/media_picker9":{name:"media/media_picker", partials: {}, subs: {  }},"<geo/geo_picker10":{name:"geo/geo_picker", partials: {}, subs: {  }},"<found_media/found_media_search11":{name:"found_media/found_media_search", partials: {}, subs: {  }},"<card/poll_creator_button12":{name:"card/poll_creator_button", partials: {}, subs: {  }},"<lifeline/lifeline_alert_status13":{name:"lifeline/lifeline_alert_status", partials: {}, subs: {  }},"<tweetbox/upload_progress14":{name:"tweetbox/upload_progress", partials: {}, subs: {  }},"<tweet_button15":{name:"tweet_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['swift_typeahead_accounts'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("\n" + i);t.b("<ul role=\"presentation\" class=\"typeahead-items typeahead-accounts js-typeahead-accounts\">\n");t.b("  <li role=\"presentation\" data-user-id=\"\" data-user-screenname=\"\" data-remote=\"true\" data-score=\"\" class=\"typeahead-item typeahead-account-item js-selectable\">\n");t.b("    <a role=\"option\" class=\"js-nav\" data-query-source=\"typeahead_click\" data-search-query=\"\" data-ds=\"account\">\n      <img class=\"avatar size32\" alt=\"\">\n      <span class=\"typeahead-user-item-info\">\n        <span class=\"fullname\"></span>\n        <span class=\"js-verified hidden\">");t.b(t.rp("<verified_account_badge0",c,p,""));t.b("</span>\n        <span class=\"username\"><s>@</s><b></b></span>\n      </span>\n    </a>\n  </li>\n  <li role=\"presentation\" class=\"js-selectable typeahead-accounts-shortcut js-shortcut\"><a role=\"option\" class=\"js-nav\" href=\"\" data-search-query=\"\" data-query-source=\"typeahead_click\" data-shortcut=\"true\" data-ds=\"account_search\"></a></li>\n</ul>\n");return t.fl(); },partials: {"<verified_account_badge0":{name:"verified_account_badge", partials: {}, subs: {  }}}, subs: {  }});
Templates['swift_typeahead_dropdown'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("\n" + i);t.b("<div role=\"listbox\" class=\"dropdown-menu typeahead\">\n  <div aria-hidden=\"true\" class=\"dropdown-caret\">\n    <div class=\"caret-outer\"></div>\n    <div class=\"caret-inner\"></div>\n  </div>\n  <div role=\"presentation\" class=\"dropdown-inner js-typeahead-results\">\n");if(t.s(t.f("typeahead_recent_searches",c,p,1),c,p,0,369,407,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<swift_recent_searches0",c,p,"      "));});c.pop();}t.b(t.rp("<swift_saved_searches1",c,p,"    "));if(t.s(t.f("typeahead_concierge",c,p,1),c,p,0,496,538,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<swift_typeahead_concierge2",c,p,"      "));});c.pop();}t.b(t.rp("<swift_typeahead_topics3",c,p,"    "));t.b(t.rp("<swift_typeahead_accounts4",c,p,"    "));t.b(t.rp("<swift_typeahead_trend_locations5",c,p,"    "));t.b(t.rp("<swift_typeahead_select_users6",c,p,"    "));t.b(t.rp("<swift_typeahead_dm_conversations7",c,p,"    "));t.b("  </div>\n</div>\n");return t.fl(); },partials: {"<swift_recent_searches0":{name:"swift_recent_searches", partials: {}, subs: {  }},"<swift_saved_searches1":{name:"swift_saved_searches", partials: {}, subs: {  }},"<swift_typeahead_concierge2":{name:"swift_typeahead_concierge", partials: {}, subs: {  }},"<swift_typeahead_topics3":{name:"swift_typeahead_topics", partials: {}, subs: {  }},"<swift_typeahead_accounts4":{name:"swift_typeahead_accounts", partials: {}, subs: {  }},"<swift_typeahead_trend_locations5":{name:"swift_typeahead_trend_locations", partials: {}, subs: {  }},"<swift_typeahead_select_users6":{name:"swift_typeahead_select_users", partials: {}, subs: {  }},"<swift_typeahead_dm_conversations7":{name:"swift_typeahead_dm_conversations", partials: {}, subs: {  }}}, subs: {  }});
Templates['swift_typeahead_topics'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<ul role=\"presentation\" class=\"typeahead-items typeahead-topics\">\n");t.b("  <li role=\"presentation\" class=\"typeahead-item typeahead-topic-item\">\n    <a role=\"option\" class=\"js-nav\" href=\"\" data-search-query=\"\" data-query-source=\"typeahead_click\" data-ds=\"topics\" tabindex=\"-1\"></a>\n  </li>\n</ul>");return t.fl(); },partials: {}, subs: {  }});
Templates['timeline_end'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"stream-footer ");if(t.s(t.f("show_stream_top",c,p,1),c,p,0,46,56,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("stream-top");});c.pop();}t.b("\">\n  <div class='timeline-end ");if(t.s(t.f("has_items",c,p,1),c,p,0,120,129,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("has-items");});c.pop();}t.b(" ");if(t.s(t.f("has_more_items",c,p,1),c,p,0,163,177,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("has-more-items");});c.pop();}t.b("'>\n");t.b(t.rp("<stream_end0",c,p,"    "));t.b(t.rp("<stream_loading1",c,p,"    "));t.b("  </div>\n</div>\n<div class=\"stream-fail-container\">\n");if(t.s(t.f("show_stream_top",c,p,1),c,p,0,317,346,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<stream_whale_top2",c,p,"    "));});c.pop();}if(t.s(t.f("show_stream_end",c,p,1),c,p,0,389,418,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<stream_whale_end3",c,p,"    "));});c.pop();}t.b("</div>\n");return t.fl(); },partials: {"<stream_end0":{name:"stream_end", partials: {}, subs: {  }},"<stream_loading1":{name:"stream_loading", partials: {}, subs: {  }},"<stream_whale_top2":{name:"stream_whale_top", partials: {}, subs: {  }},"<stream_whale_end3":{name:"stream_whale_end", partials: {}, subs: {  }}}, subs: {  }});
Templates['tweet_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<button class=\"btn primary-btn tweet-action");if(!t.s(t.f("enable_tweet_button",c,p,1),c,p,1,0,0,"")){t.b(" disabled");};t.b(" tweet-btn js-tweet-btn\" type=\"button\" ");if(!t.s(t.f("enable_tweet_button",c,p,1),c,p,1,0,0,"")){t.b("disabled");};t.b(">\n  <span class=\"button-text tweeting-text\">\n    <span class=\"Icon Icon--tweet\"></span>\n    ");if(t.s(t.f("second_session_profile",c,p,1),c,p,0,314,353,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Twittern & weiter");});c.pop();}if(!t.s(t.f("second_session_profile",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("first_tweet_button_text",c,p,1),c,p,0,457,510,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("first_tweet_button_text",c,p,0)));});c.pop();}if(!t.s(t.f("first_tweet_button_text",c,p,1),c,p,1,0,0,"")){t.b("Twittern");};};t.b("\n" + i);t.b("  </span>\n  <span class=\"button-text messaging-text\">\n    <span class=\"Icon Icon--dm Icon--small\"></span>\n    Nachricht senden\n  </span>\n</button>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['user_css_color'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<style id=\"user-style-");t.b(t.v(t.f("style_namespace",c,p,0)));t.b("\">\n");t.b("\n" + i);if(t.s(t.f("user_color",c,p,1),c,p,0,320,1184,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  a,\n  a:hover,\n  a:focus,\n  a:active {\n    color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(";\n  }\n\n  .u-textUserColor,\n  .u-textUserColorHover:hover,\n  .u-textUserColorHover:focus {\n    color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(" !important;\n  }\n\n  .u-borderUserColor,\n  .u-borderUserColorHover:hover,\n  .u-borderUserColorHover:focus {\n    border-color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(" !important;\n  }\n\n  .u-bgUserColor,\n  .u-bgUserColorHover:hover,\n  .u-bgUserColorHover:focus {\n    background-color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(" !important;\n  }\n\n\n  .u-dropdownUserColor > li:hover,\n  .u-dropdownUserColor > li:focus,\n  .u-dropdownUserColor > li > button:hover,\n  .u-dropdownUserColor > li > button:focus {\n    color: #fff !important;\n    background-color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(" !important;\n  }\n\n  .u-boxShadowInsetUserColorHover:hover,\n  .u-boxShadowInsetUserColorHover:focus {\n    box-shadow: inset 0 0 0 5px #");t.b(t.v(t.f("user_color",c,p,0)));t.b(" !important;\n  }\n\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_light",c,p,1),c,p,0,1274,1634,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-textUserColorLight {\n    color: #");t.b(t.v(t.f("user_color_light",c,p,0)));t.b(" !important;\n  }\n\n  .u-borderUserColorLight,\n  .u-borderUserColorLightFocus:focus,\n  .u-borderUserColorLightHover:hover,\n  .u-borderUserColorLightHover:focus {\n    border-color: #");t.b(t.v(t.f("user_color_light",c,p,0)));t.b(" !important;\n  }\n\n  .u-bgUserColorLight {\n    background-color: #");t.b(t.v(t.f("user_color_light",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("rgba_user_color_lighter",c,p,1),c,p,0,1744,1894,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-boxShadowUserColorLighterFocus:focus {\n    box-shadow: 0 0 8px rgba(0, 0, 0, 0.05), inset 0 1px 2px ");t.b(t.v(t.f("rgba_user_color_lighter",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_lightest",c,p,1),c,p,0,2003,2267,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-textUserColorLightest {\n    color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(" !important;\n  }\n\n  .u-borderUserColorLightest {\n    border-color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(" !important;\n  }\n\n  .u-bgUserColorLightest {\n    background-color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_lighter",c,p,1),c,p,0,2370,2628,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-textUserColorLighter {\n    color: #");t.b(t.v(t.f("user_color_lighter",c,p,0)));t.b(" !important;\n  }\n\n  .u-borderUserColorLighter {\n    border-color: #");t.b(t.v(t.f("user_color_lighter",c,p,0)));t.b(" !important;\n  }\n\n  .u-bgUserColorLighter {\n    background-color: #");t.b(t.v(t.f("user_color_lighter",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_dark",c,p,1),c,p,0,2724,2901,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-bgUserColorDarkHover:hover {\n    background-color: #");t.b(t.v(t.f("user_color_dark",c,p,0)));t.b(" !important;\n  }\n\n  .u-borderUserColorDark {\n    border-color: #");t.b(t.v(t.f("user_color_dark",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_darker",c,p,1),c,p,0,2998,3098,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .u-bgUserColorDarkerActive:active {\n    background-color: #");t.b(t.v(t.f("user_color_darker",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n");t.b("\n" + i);t.b("\n");t.b("\n" + i);t.b("\n" + i);t.b("a,\n.btn-link,\n.btn-link:focus,\n.icon-btn,\n");t.b(".pretty-link b,\n.pretty-link:hover s,\n.pretty-link:hover b,\n.pretty-link:focus s,\n.pretty-link:focus b,\n/* Account Group */\n.metadata a:hover,\n.metadata a:focus,\n");t.b(".account-group:hover .fullname,\n.account-group:focus .fullname,\n.account-summary:focus .fullname,\n");t.b(".message .message-text a,\n.stats a strong,\n.plain-btn:hover,\n.plain-btn:focus,\n.dropdown.open .user-dropdown.plain-btn,\n.open > .plain-btn,\n#global-actions .new:before,\n.module .list-link:hover,\n.module .list-link:focus,\n");t.b(".stats a:hover,\n.stats a:hover strong,\n.stats a:focus,\n.stats a:focus strong,\n");t.b(".profile-modal-header .fullname a:hover,\n.profile-modal-header .username a:hover,\n.profile-modal-header .fullname a:focus,\n.profile-modal-header .username a:focus,\n");t.b(".find-friends-sources li:hover .source,\n\n");t.b("\n" + i);t.b(".stream-item a:hover .fullname,\n.stream-item a:focus .fullname,\n");t.b(".stream-item .view-all-supplements:hover,\n.stream-item .view-all-supplements:focus,\n");t.b(".tweet .time a:hover,\n.tweet .time a:focus,\n.tweet .details.with-icn b,\n.tweet .details.with-icn .Icon,\n.tweet .tweet-geo-text a:hover,\n");t.b(".stream-item:hover .original-tweet .details b,\n.stream-item .original-tweet.focus .details b,\n.stream-item.open .original-tweet .details b,\n");t.b(".client-and-actions a:hover,\n.client-and-actions a:focus,\n");t.b(".dismiss-btn:hover b,\n");t.b(".tweet .context .pretty-link:hover s,\n.tweet .context .pretty-link:hover b,\n.tweet .context .pretty-link:focus s,\n.tweet .context .pretty-link:focus b,\n");t.b(".list .username a:hover,\n.list .username a:focus,\n.list-membership-container .create-a-list,\n.list-membership-container .create-a-list:hover,\n\n");t.b(".card .list-details a:hover,\n.card .list-details a:focus,\n.card .card-body:hover .attribution,\n.card .card-body .attribution:focus,\n.new-tweets-bar,\n.onebox .soccer ul.ticker a:hover,\n.onebox .soccer ul.ticker a:focus,\n\n");t.b(".remove-background-btn,\n\n");t.b(".stream-item-activity-notification .latest-tweet .tweet-row a:hover,\n.stream-item-activity-notification .latest-tweet .tweet-row a:focus,\n.stream-item-activity-notification .latest-tweet .tweet-row a:hover b,\n.stream-item-activity-notification .latest-tweet .tweet-row a:focus b {\n");if(t.s(t.f("profile_link_color",c,p,1),c,p,0,6544,6583,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n");});c.pop();}if(!t.s(t.f("profile_link_color",c,p,1),c,p,1,0,0,"")){t.b("    color: #0084B4;\n");};t.b("}\n\n");if(t.s(t.f("profile_link_color",c,p,1),c,p,0,6795,11446,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("logged_in",c,p,1),c,p,0,6812,7390,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    #global-actions > li > a {\n      border-bottom-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n    }\n\n    #global-actions > li:hover > a,\n    #global-actions > li > a:focus,\n    .nav.right-actions > li > a:hover,\n    .nav.right-actions > li > button:hover,\n    .nav.right-actions > li > a:focus,\n    .nav.right-actions > li > button:focus {\n      color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n    }\n\n");if(t.s(t.f("web_notifications_badge_on",c,p,1),c,p,0,7222,7356,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    /* Surpress the new connect glow if in experiment. */\n     #global-actions .people.new:before {\n       content: none;\n     }\n");});c.pop();}});c.pop();}t.b("\n" + i);t.b("  /* hover state for found media items */\n  .FoundMediaSearch--keyboard .FoundMediaSearch-focusable.is-focused {\n    border-color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(";\n  }\n\n  /* hover state for photo select button*/\n  .photo-selector:hover .btn,\n  .icon-btn:hover,\n  .icon-btn:active,\n  .icon-btn.active,\n  .icon-btn.enabled {\n    border-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n    border-color: rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(",.5);\n    color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  /* hover state for photo select button*/\n  .photo-selector:hover .btn,\n  .icon-btn:hover {\n    background-image: linear-gradient(rgba(255,255,255,0), rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(",.1));\n    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00FFFFFF', endColorstr='#19");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b("'); /* IE8-9 */\n  }\n\n  .icon-btn.disabled,\n  .icon-btn.disabled:hover,\n  .icon-btn[disabled],\n  .icon-btn[aria-disabled=true] {\n    color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  /* tweet-btn can have primary-btn class as well so the following rules ensure that the correct background color is applied */\n  .tweet-btn,\n  .tweet-btn:focus {\n    background-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n    background: rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(",");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(",.8);\n  }\n\n  .tweet-btn:hover,\n  .tweet-btn:active,\n  .tweet-btn.active {\n    background-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  .tweet-btn.btn.disabled,\n  .tweet-btn.btn.disabled:hover,\n  .tweet-btn.btn[disabled],\n  .tweet-btn.btn[aria-disabled=true] {\n    background: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  .btn:focus,\n  .btn.focus,\n  .Button:focus {\n    box-shadow:\n      0 0 0 1px #fff,\n      0 0 0 3px rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", 0.5);\n  }\n\n  .selected-stream-item:focus {\n    box-shadow: 0 0 0 3px rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", 0.5);\n  }\n\n  /* highlighting when navigate through timeline stream table view with j & k. */\n  .js-navigable-stream.stream-table-view .selected-stream-item[tabindex=\"-1\"]:focus {\n    outline: 3px solid rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", 0.5) !important;\n  }\n\n  /* box-shadow does not work with table tr element */\n  .js-navigable-stream.stream-table-view .selected-stream-item:focus {\n    box-shadow: none;\n  }\n\n  /**\n   * 1. Bring actionable tweet to top when active to ensure border\n   *    highlighting wraps entire tweet. Value must be at least at if not\n   *    higher than the z-index value of ProfileHeading to ensure first\n   *    tweet in timeline receives border on all four sides.\n   *    NOTE: z-index should be 2 to avoid conflicts with .ProfileCanopy and .ProfileCard-avatarLink\n   */\n\n  .js-stream-item.is-selected:focus .ProfileCard,\n  .QuoteTweet:hover,\n  .QuoteTweet:focus,\n  .QuoteTweet:active,\n  .activity-user-profile-content:hover,\n  .activity-user-profile-content:focus,\n  .activity-user-profile-content:active {\n    border-color: rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", 0.5);\n    z-index: 2; /* 1 */\n  }\n\n  .global-dm-nav.new.with-count .dm-new {\n    background: #fff;\n  }\n\n  .global-dm-nav.new.with-count .dm-new .count-inner {\n    background: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  .global-nav .people .count .count-inner {\n    background: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n  }\n\n  .dropdown-menu li > a:hover,\n  .dropdown-menu li > a:focus,\n  .dropdown-menu .dropdown-link:hover,\n  .dropdown-menu .dropdown-link:focus,\n  .dropdown-menu .dropdown-link.is-focused,\n  .dropdown-menu li:hover .dropdown-link,\n  .dropdown-menu li:focus .dropdown-link,\n  .dropdown-menu .typeahead-recent-search-item.selected,\n  .dropdown-menu .typeahead-saved-search-item.selected,\n  .dropdown-menu .selected a,\n  .dropdown-menu .dropdown-link.selected {\n    background-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(" !important;\n  }\n");});c.pop();}t.b("\n" + i);t.b("/* give tweet boxes 10% of the users link color as background */\n.home-tweet-box,\n.RetweetDialog-commentBox,\n.WebToast-box--altColor,\n.content-main .conversations-enabled .expansion-container .inline-reply-tweetbox {\n  background-color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(";\n}\n\n.conversations-enabled .inline-reply-caret .caret-inner {\n  border-bottom-color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(";\n}\n.top-timeline-tweetbox .timeline-tweet-box .tweet-form.condensed .tweet-box {\n  color: #");t.b(t.v(t.f("user_color",c,p,0)));t.b(";\n}\n/* give tweet box containers an outline using the users link color */\n.RichEditor {\n  border-color: #");t.b(t.v(t.f("user_color_lighter",c,p,0)));t.b(";\n}\n/* give tweet boxes an outline using the users link color */\n.tweet-compose-errors {\n  border-color: ");t.b(t.v(t.f("rgba_user_color_lighter",c,p,0)));t.b(";\n}\n\ninput:focus,\ntextarea:focus,\ndiv[contenteditable=\"true\"]:focus,\ndiv[contenteditable=\"true\"].fake-focus {\n  border-color: #");t.b(t.v(t.f("profile_pretty_link_color",c,p,0)));t.b(";\n  box-shadow: inset 0 0 0 1px rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", 0.7);\n}\n\n.tweet-box textarea:focus,\n.tweet-box input[type=text],\n.currently-dragging .tweet-form.is-droppable .tweet-drag-help,\n.tweet-box[contenteditable=\"true\"]:focus,\n.RichEditor.is-fakeFocus {\n  border-color: #");t.b(t.v(t.f("user_color_light",c,p,0)));t.b(";\n  box-shadow: none;\n}\n\n");t.b("\n" + i);t.b("s,\n.pretty-link:hover s,\n.pretty-link:focus s,\n.stream-item-activity-notification .latest-tweet .tweet-row a:hover s,\n.stream-item-activity-notification .latest-tweet .tweet-row a:focus s {\n");if(t.s(t.f("profile_link_color",c,p,1),c,p,0,13053,13092,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n");});c.pop();}if(!t.s(t.f("profile_link_color",c,p,1),c,p,1,0,0,"")){t.b("    color: #66B5D2;\n");};t.b("}\n\n");t.b(".vellip,\n.vellip:before,\n.vellip:after,\n.conversation-module > li:after,\n.conversation-module > li:before,\n.ThreadedConversation-tweet ~ .ThreadedConversation-tweet:before,\n.ThreadedConversation-tweet:after,\n.ThreadedConversation-viewOther:before,\n.ThreadedConversation-unavailableTweet:before,\n.ThreadedConversation-unavailableTweet:after {\n");if(t.s(t.f("profile_pretty_link_color",c,p,1),c,p,0,13653,13710,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    background-color: #");t.b(t.v(t.f("profile_pretty_link_color",c,p,0)));t.b(";\n");});c.pop();}if(!t.s(t.f("profile_pretty_link_color",c,p,1),c,p,1,0,0,"")){t.b("    background-color: #66B5D2;\n");};t.b("}\n\n");t.b(".tweet .sm-reply,\n.tweet .sm-rt,\n.tweet .sm-fav,\n.tweet .sm-image,\n.tweet .sm-video,\n.tweet .sm-audio,\n.tweet .sm-geo,\n.tweet .sm-in,\n.tweet .sm-trash,\n.tweet .sm-more,\n.tweet .sm-page,\n.tweet .sm-embed,\n.tweet .sm-summary,\n.tweet .sm-chat,\n");t.b(".timelines-navigation .active .profile-nav-icon,\n.timelines-navigation .profile-nav-icon:hover,\n.timelines-navigation .profile-nav-link:focus .profile-nav-icon,\n");t.b(".sm-top-tweet,\n");t.b(".metadata a.tweet-geo-text:hover .sm-geo {\n");if(t.s(t.f("profile_link_color",c,p,1),c,p,0,14579,14629,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    background-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n");});c.pop();}if(!t.s(t.f("profile_link_color",c,p,1),c,p,1,0,0,"")){t.b("    background-color: #6684B4;\n");};t.b("}\n\n");if(t.s(t.f("mini_profile_banner_url_for_web",c,p,1),c,p,0,14775,14896,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(".enhanced-mini-profile .mini-profile .profile-summary {\n  background-image: url(");t.b(t.v(t.f("mini_profile_banner_url_for_web",c,p,0)));t.b(");\n}\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("profile_banner_url_for_web",c,p,1),c,p,0,14965,15095,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(".wrapper-profile .profile-card.profile-header .profile-header-inner {\n  background-image: url(");t.b(t.v(t.f("profile_banner_url_for_web",c,p,0)));t.b(");\n}\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("profile_link_color_rgb",c,p,1),c,p,0,15155,15550,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  #global-tweet-dialog .modal-header {\n    border-bottom: solid 1px rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", .25);\n  }\n\n  #global-tweet-dialog .modal-tweet-form-container {\n    background-color: #");t.b(t.v(t.f("profile_link_color",c,p,0)));t.b(";\n    background: rgba(");t.b(t.v(t.d("profile_link_color_rgb.r",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.g",c,p,0)));t.b(", ");t.b(t.v(t.d("profile_link_color_rgb.b",c,p,0)));t.b(", .1);\n  }\n");});c.pop();}t.b("\n" + i);if(t.s(t.f("user_color_lightest",c,p,1),c,p,0,15603,15683,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  .inline-reply-tweetbox {\n    background-color: #");t.b(t.v(t.f("user_color_lightest",c,p,0)));t.b(";\n  }\n");});c.pop();}t.b("\n" + i);t.b("</style>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['user_recommendations_group'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<fieldset class=\"StartFindFriends-checkboxGroup ");if(t.s(t.f("is_custom",c,p,1),c,p,0,62,71,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("is-custom");});c.pop();}t.b("\">\n  <div class=\"StartFindFriends-timelineHeader u-cf\">\n");t.b(t.rp("<start/select_all_checkbox0",c,p,"    "));t.b("    <h5>");t.b(t.v(t.f("title",c,p,0)));t.b("</h5>\n  </div>\n");if(t.s(t.f("nux_recommendation_user_items",c,p,1),c,p,0,244,330,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<swift_stream_items/nux_recommendation/nux_recommendation_user_stream_item1",c,p,"    "));});c.pop();}t.b("</fieldset>");return t.fl(); },partials: {"<start/select_all_checkbox0":{name:"start/select_all_checkbox", partials: {}, subs: {  }},"<swift_stream_items/nux_recommendation/nux_recommendation_user_stream_item1":{name:"swift_stream_items/nux_recommendation/nux_recommendation_user_stream_item", partials: {}, subs: {  }}}, subs: {  }});
Templates['verified_account_badge'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"Icon Icon--verified Icon--small\">\n  <span class=\"u-hiddenVisually\">Verifizierter Account</span>\n</span>");return t.fl(); },partials: {}, subs: {  }});
Templates['compose/hashflag'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<span class=\"RichEditor-pictographText\" title=\"Twitter Emoji\" aria-label=\"Twitter Emoji\" ");t.b("data-pictograph-text=\"\" data-pictograph-image=\"");t.b(t.v(t.f("imageUrl",c,p,0)));t.b("\">&nbsp;</span>");return t.fl(); },partials: {}, subs: {  }});
Templates['compose/pictographs'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("pictographs",c,p,1),c,p,0,16,132,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("<img class=\"RichEditor-pictographImage\" src=\"");t.b(t.v(t.f("imageUrl",c,p,0)));t.b("\" style=\"top:");t.b(t.v(t.f("top",c,p,0)));t.b("px;left:");t.b(t.v(t.f("left",c,p,0)));t.b("px;\" draggable=\"false\">");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['dialogs/block_list_export_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"block-list-export-dialog\" class=\"modal-container\">\n  <div class=\"close-modal-background-target\"></div>\n  <div class=\"modal modal-medium draggable\">\n    <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"      "));t.b("      <div class=\"modal-header\">\n        <h3 class=\"modal-title export-list-title\">Deine Liste exportieren</h3>\n        <br><br>\n        <strong class=\"export-header-title\">\n          ");if(!t.s(t.f("on_imported_tab",c,p,1),c,p,1,0,0,"")){t.b("Bestätige die Accounts, die Du exportieren möchtest");};t.b("\n" + i);t.b("          ");if(t.s(t.f("on_imported_tab",c,p,1),c,p,0,527,597,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Möchtest Du alle Deine importierten, blockierten Accounts exportieren?");});c.pop();}t.b("\n" + i);t.b("        </strong>\n        <br><br>\n        <p class='export-header-text'>Wir werden eine .csv Datei erstellen und diese auf Deinen Computer speichern. Du kannst die Datei teilen, und andere können diese Liste blockierter Accounts importieren.</p>\n      </div>\n      <br>\n      <div class=\"modal-body users-section\">\n        <div class=\"stream-container\" data-cursor=\"");t.b(t.v(t.f("cursor",c,p,0)));t.b("\">\n");if(!t.s(t.f("on_imported_tab",c,p,1),c,p,1,0,0,"")){t.b("            <span class=\"user-timeline\">\n              <label class=\"t1-label\" for=\"include-imported-block\">\n                <input id=\"include-imported-block\" type=\"checkbox\" value=\"include_imported_block\" checked>\n                <span id=\"include-imported-block-text\">Alle meine importierten, blockierten Accounts inkludieren</span>\n              </label>\n              <ol class=\"stream-items js-navigable-stream\" id=\"stream-items-id\"></ol>\n");t.b(t.rp("<timeline_end1",c,p,"              "));t.b("            </span>\n");};t.b("          <span class=\"processing-bar\">\n            <span class=\"spinner\" title=\"Lädt...\"></span>\n          </span>\n        </div>\n      </div>\n      <div class=\"modal-footer\">\n        <button class=\"btn primary-btn export-action\">Exportieren</button>\n        <button class=\"btn primary-btn js-close done-btn\">Fertig</button>\n        <button class=\"btn cancel-action js-close\">Abbrechen</button>\n      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }},"<timeline_end1":{name:"timeline_end", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/close_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<button type=\"button\" class=\"modal-btn modal-close js-close\">\n  <span class=\"Icon Icon--close Icon--medium\">\n    <span class=\"visuallyhidden\">Schließen</span>\n  </span>\n</button>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['dialogs/confirm_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"confirm_dialog\" class=\"modal-container\">\n  <div class=\"close-modal-background-target\"></div>\n  <div class=\"modal draggable\">\n    <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"      "));t.b("      <div class=\"modal-header\">\n        <h3 class=\"modal-title\">");t.b(t.v(t.f("title_text",c,p,0)));t.b("</h3>\n      </div>\n");if(t.s(t.f("body_text",c,p,1),c,p,0,316,426,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <div class=\"modal-body\">\n          <p class=\"modal-body-text\">");t.b(t.v(t.f("body_text",c,p,0)));t.b("</p>\n        </div>\n");});c.pop();}t.b("      <div class=\"modal-footer\">\n        <button class=\"btn js-close\" id=\"confirm_dialog_cancel_button\">");t.b(t.v(t.f("cancel_text",c,p,0)));t.b("</button>\n        <button id=\"confirm_dialog_submit_button\" class=\"btn primary-btn modal-submit\">");t.b(t.v(t.f("submit_text",c,p,0)));t.b("</button>\n      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/copy_found_media_link'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"copy-found-media-link-dialog\" class=\"modal-container\">\n  <div class=\"close-modal-background-target\"></div>\n  <div class=\"modal modal-medium draggable\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"    "));t.b("    <div class=\"modal-content\">\n      <div class=\"modal-header\">\n        <h3 class=\"modal-title\">GIF zur Verfügung gestellt von <span class=\"provided-by\">");t.b(t.v(t.f("attributionName",c,p,0)));t.b("</span></h3>\n      </div>\n      <div class=\"modal-body\">\n        <div class=\"copy-found-media-link-container\">\n          <textarea class=\"found-media-link-destination js-initial-focus u-dir\" readonly>");t.b(t.v(t.f("detailsUrl",c,p,0)));t.b("</textarea>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/create_or_edit_custom_timeline_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"close-modal-background-target\"></div>\n<div class=\"modal modal-medium draggable\">\n  <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"    "));t.b("    <div class=\"modal-header\">\n      <h3 class=\"modal-title\">\n        ");if(t.s(t.f("is_create_dialog",c,p,1),c,p,0,244,272,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Eine neue Sammlung erstellen");});c.pop();}t.b("\n" + i);t.b("        ");if(!t.s(t.f("is_create_dialog",c,p,1),c,p,1,0,0,"")){t.b("Sammlung bearbeiten");};t.b("\n" + i);t.b("      </h3>\n    </div>\n\n    <div class=\"modal-body\">\n      <div class=\"custom-timeline-editor\">\n        ");if(t.s(t.f("is_create_dialog",c,p,1),c,p,0,489,714,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("<p class=\"explanation\">\n          Sammlungen sind öffentliche Ansammlungen von Tweets, die Du unter Kontrolle hast.\n          <br />\n          Erstelle eine Sammlung, füge Tweets hinzu und teile sie mit der Welt.\n        </p>");});c.pop();}t.b("\n");t.b("\n" + i);t.b("        <div class=\"field custom-timeline-name-field\">\n          <label class=\"t1-label\" for=\"custom-timeline-name\">Name der Sammlung</label>\n          <input type=\"text\" class=\"text\" name=\"name\" id=\"custom-timeline-name\" value=\"");t.b(t.v(t.f("timeline_name",c,p,0)));t.b("\" aria-describedby=\"custom-timeline-name-help\" />\n          <p class=\"help-text\">\n            <span id=\"custom-timeline-name-help\">25 Zeichen</span>\n            <span class=\"custom-timeline-name-count\">25</span>\n          </p>\n        </div>\n        <hr/>\n\n        <div class=\"field custom-timeline-description-field\">\n          <label class=\"t1-label\" for=\"custom-timeline-description\">Beschreibung</label>\n          <textarea name=\"custom-timeline-description\" id=\"custom-timeline-description\" aria-describedby=\"custom-timeline-description-help\">");t.b(t.v(t.f("timeline_description",c,p,0)));t.b("</textarea>\n          <p class=\"help-text\">\n            <span id=\"custom-timeline-description-help\">160 Zeichen, optional</span>\n            <span class=\"custom-timeline-description-count\">160</span>\n          </p>\n        </div>\n        <hr/>\n\n        <fieldset class=\"field\">\n          <legend class=\"t1-legend\">Reihenfolge der Sammlung</legend>\n          <div class=\"options\">\n            <label class=\"t1-label u-block\">\n              <input class=\"radio u-inlineBlock\" type=\"radio\" name=\"");t.b(t.v(t.f("id_prefix",c,p,0)));t.b("-timeline-order\" value=\"curation_reverse_chron\"");if(t.s(t.f("curation_reverse_chron",c,p,1),c,p,0,2135,2153,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" checked=\"checked\"");});c.pop();}t.b(" />\n              <b>Zuletzt Hinzugefügte zuerst</b>\n            </label>\n            <label class=\"t1-label u-block\">\n              <input class=\"radio u-inlineBlock\" type=\"radio\" name=\"");t.b(t.v(t.f("id_prefix",c,p,0)));t.b("-timeline-order\" value=\"tweet_chron\"");if(t.s(t.f("tweet_chron",c,p,1),c,p,0,2432,2450,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" checked=\"checked\"");});c.pop();}t.b(" />\n              <b>Älteste zuerst</b>\n            </label>\n            <label class=\"t1-label u-block\">\n              <input class=\"radio u-inlineBlock\" type=\"radio\" name=\"");t.b(t.v(t.f("id_prefix",c,p,0)));t.b("-timeline-order\" value=\"tweet_reverse_chron\"");if(t.s(t.f("tweet_reverse_chron",c,p,1),c,p,0,2721,2739,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" checked=\"checked\"");});c.pop();}t.b(" />\n              <b>Neueste zuerst</b>\n            </label>\n          </div>\n        </fieldset>\n        <hr/>\n\n        <div class=\"custom-timeline-editor-save\">\n          <button type=\"button\" class=\"btn btn-primary update-custom-timeline-button\" data-custom-timeline-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\" disabled>\n            ");if(t.s(t.f("is_create_dialog",c,p,1),c,p,0,3088,3106,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Sammlung erstellen");});c.pop();}t.b("\n" + i);t.b("            ");if(!t.s(t.f("is_create_dialog",c,p,1),c,p,1,0,0,"")){t.b("Sammlung speichern");};t.b("\n" + i);t.b("          </button>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/curate_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"close-modal-background-target\"></div>\n<div class=\"modal modal-medium draggable\">\n  <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"    "));t.b("    <div class=\"modal-header\">\n      <h3 class=\"modal-title\">Tweet zur Sammlung hinzufügen</h3>\n    </div>\n    <div class=\"modal-body\">\n      <div class=\"timeline-selector\"></div>\n    </div>\n    <div class=\"modal-footer\">\n");t.b(t.rp("<create_custom_timeline_button1",c,p,"      "));t.b("\n" + i);t.b("      <button type=\"button\" class=\"btn js-close\">Abbrechen</button>\n      <button type=\"button\" class=\"btn primary-btn modal-submit js-submit\">Änderungen speichern</button>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }},"<create_custom_timeline_button1":{name:"create_custom_timeline_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/home_nav_follow_popover'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("is_first_follow",c,p,1),c,p,0,20,790,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <p>\n");if(t.s(t.f("total_num_one",c,p,1),c,p,0,49,129,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      Tweets von <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong> sind jetzt in Deiner Timeline.\n");});c.pop();}if(t.s(t.f("total_num_two",c,p,1),c,p,0,170,281,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      Tweets von <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong> und <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> sind jetzt in Deiner Timeline.\n");});c.pop();}if(t.s(t.f("total_num_three",c,p,1),c,p,0,324,454,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      Tweets von <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong>, <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> und 1 weiteren Person sind jetzt in Deiner Timeline.\n");});c.pop();}if(t.s(t.f("total_num_other",c,p,1),c,p,0,499,635,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      Tweets von <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong>, <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> und ");t.b(t.v(t.f("num_others",c,p,0)));t.b(" weiteren sind jetzt in Deiner Timeline.\n");});c.pop();}t.b("  </p>\n  <p>\n    <small>Wenn Du allen Personen gefolgt bist, klicke auf Startseite, um zu Deiner Timeline zu gelangen.</small>\n  </p>\n");});c.pop();}if(!t.s(t.f("is_first_follow",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("total_num_one",c,p,1),c,p,0,852,900,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    Du folgst nun <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong>\n");});c.pop();}if(t.s(t.f("total_num_two",c,p,1),c,p,0,939,1020,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    Du bist <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong> und <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> gefolgt\n");});c.pop();}if(t.s(t.f("total_num_three",c,p,1),c,p,0,1061,1160,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    Du bist <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong>, <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> und 1 anderen Person gefolgt\n");});c.pop();}if(t.s(t.f("total_num_other",c,p,1),c,p,0,1203,1308,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    Du bist <strong>");t.b(t.v(t.f("user1",c,p,0)));t.b("</strong>, <strong>");t.b(t.v(t.f("user2",c,p,0)));t.b("</strong> und ");t.b(t.v(t.f("num_others",c,p,0)));t.b(" anderen gefolgt\n");});c.pop();}};return t.fl(); },partials: {}, subs: {  }});
Templates['dialogs/home_nav_headlined_popover'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<h2>Deine Timeline ist bereit!</h2>\n<p>Klicke auf Startseite, wann immer Du zu Deiner Timeline gelangen möchtest</p>");return t.fl(); },partials: {}, subs: {  }});
Templates['dialogs/keyboard_shortcuts_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div id=\"keyboard-shortcut-dialog\" class=\"modal-container\">\n  <div class=\"close-modal-background-target\"></div>\n  <div class=\"modal modal-large draggable\">\n    <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"      "));t.b("\n" + i);t.b("      <div class=\"modal-header\">\n        <h3 class=\"modal-title\">Tastaturkürzel</h3>\n      </div>\n\n");t.b("      <div class=\"modal-body\">\n\n        <div class=\"keyboard-shortcuts clearfix\" id=\"keyboard-shortcut-menu\">\n          <p class=\"visuallyhidden\">\n            Hinweis: Nutzer von Bildschirmleseprogrammen müssen eventuell die virtuelle Navigation deaktivieren, um diese Kurzbefehle verwenden zu können.\n          </p>\n");if(t.s(t.f("logged_in",c,p,1),c,p,0,725,7549,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          <table class=\"modal-table\" summary=\"Kurzbefehle für häufige Aktionen.\">\n            <thead>\n              <tr>\n                <th colspan=\"2\">Aktionen</th>\n              </tr>\n            </thead>\n            <tbody>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">n</b>\n                </td>\n                <td class=\"shortcut-label\">Neuer Tweet</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">l</b>\n                </td>\n                <td class=\"shortcut-label\">Gefällt mir</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">r</b>\n                </td>\n                <td class=\"shortcut-label\">Antworten</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">t</b>\n                </td>\n                <td class=\"shortcut-label\">Retweeten</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">m</b>\n                </td>\n                <td class=\"shortcut-label\">Direktnachricht</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">u</b>\n                </td>\n                <td class=\"shortcut-label\">Nutzer stummschalten</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">b</b>\n                </td>\n                <td class=\"shortcut-label\">Nutzer blockieren</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">Enter</b>\n                </td>\n                <td class=\"shortcut-label\">Tweet-Details öffnen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">c</b>\n                </td>\n                <td class=\"shortcut-label\">Alle geöffneten Tweets schließen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">o</b>\n                </td>\n                <td class=\"shortcut-label\">Foto anzeigen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">/</b>\n                </td>\n                <td class=\"shortcut-label\">Suchen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">");if(t.s(t.f("is_mac",c,p,1),c,p,0,3315,3318,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("Cmd");});c.pop();}if(!t.s(t.f("is_mac",c,p,1),c,p,1,0,0,"")){t.b("Ctrl");};t.b("</b>\n                  <b class=\"sc-key\">Enter</b>\n                </td>\n                <td class=\"shortcut-label\">Tweet senden</td>\n              </tr>\n            </tbody>\n          </table>\n          <table class=\"modal-table\" summary=\"Kurzbefehle, um zwischen Elementen in den Timelines zu navigieren.\">\n            <thead>\n              <tr>\n                <th colspan=\"2\">Navigation</th>\n              </tr>\n            </thead>\n            <tbody>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">?</b>\n                </td>\n                <td class=\"shortcut-label\">Dieses Menü</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">j</b>\n                </td>\n                <td class=\"shortcut-label\">Nächster Tweet</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">k</b>\n                </td>\n                <td class=\"shortcut-label\">Vorheriger Tweet</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">Space</b>\n                </td>\n                <td class=\"shortcut-label\">Weiterblättern</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">.</b>\n                </td>\n                <td class=\"shortcut-label\">Neue Tweets laden</td>\n              </tr>\n            </tbody>\n          </table>\n          <table class=\"modal-table\" summary=\"Kurzbefehle, um zwischen verschiedenen Timelines oder Seiten zu navigieren.\">\n            <thead>\n              <tr>\n                <th colspan=\"2\">Timelines</th>\n              </tr>\n            </thead>\n            <tbody>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">h</b>\n                </td>\n                <td class=\"shortcut-label\">Startseite</td>\n              </tr>\n");if(t.s(t.f("moments_experience_enabled",c,p,1),c,p,0,5418,5687,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("                <tr>\n                  <td class=\"shortcut\">\n                    <b class=\"sc-key\">g</b> <b class=\"sc-key\">o</b>\n                  </td>\n                  <td class=\"shortcut-label\">Moments</td>\n                </tr>\n                <tr>\n");});c.pop();}t.b("                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">n</b>\n                </td>\n                <td class=\"shortcut-label\">Mitteilungen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">r</b>\n                </td>\n                <td class=\"shortcut-label\">Erwähnungen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">p</b>\n                </td>\n                <td class=\"shortcut-label\">Profil</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">l</b>\n                </td>\n                <td class=\"shortcut-label\">Gefällt mir</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">i</b>\n                </td>\n                <td class=\"shortcut-label\">Listen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">m</b>\n                </td>\n                <td class=\"shortcut-label\">Nachrichten</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">s</b>\n                </td>\n                <td class=\"shortcut-label\">Einstellungen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">u</b>\n                </td>\n                <td class=\"shortcut-label\">Gehe zu Nutzer...</td>\n              </tr>\n            </tbody>\n          </table>\n");});c.pop();}if(!t.s(t.f("logged_in",c,p,1),c,p,1,0,0,"")){t.b("          <table class=\"modal-table\">\n            <tbody>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">Enter</b>\n                </td>\n                <td class=\"shortcut-label\">Tweet-Details öffnen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">o</b>\n                </td>\n                <td class=\"shortcut-label\">Foto anzeigen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">g</b> <b class=\"sc-key\">u</b>\n                </td>\n                <td class=\"shortcut-label\">Gehe zu Nutzer...</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">?</b>\n                </td>\n                <td class=\"shortcut-label\">Dieses Menü</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">j</b>\n                </td>\n                <td class=\"shortcut-label\">Nächster Tweet</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">k</b>\n                </td>\n                <td class=\"shortcut-label\">Vorheriger Tweet</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">Space</b>\n                </td>\n                <td class=\"shortcut-label\">Weiterblättern</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">/</b>\n                </td>\n                <td class=\"shortcut-label\">Suchen</td>\n              </tr>\n              <tr>\n                <td class=\"shortcut\">\n                  <b class=\"sc-key\">.</b>\n                </td>\n                <td class=\"shortcut-label\">Neue Tweets laden</td>\n              </tr>\n            </tbody>\n          </table>\n");};t.b("        </div>\n      </div>\n    </div>\n  </div>\n</div>\n\n\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/media_edit_dialog'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"modal draggable MediaEditDialog\">\n  <div class=\"modal-content\">\n");t.b(t.rp("<dialogs/close_button0",c,p,"    "));t.b("    <div class=\"modal-header\">\n      <h3 class=\"modal-title\"></h3>\n    </div>\n    <div class=\"MediaEditDialog-videoSection\">\n      <div class=\"modal-body\">\n");t.b(t.rp("<media/video_trim1",c,p,"        "));if(t.s(t.f("hasAdvancedFeatures",c,p,1),c,p,0,324,2003,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <form class=\"MediaEditForm form-horizontal\">\n          <div class=\"control-group\">\n            <div class=\"MediaEditForm-titleCharCounter CharCounter\">\n              <input class=\"MediaEditForm-title CharCounter-target js-initial-focus\" type=\"text\" name=\"video_metadata[title]\" placeholder=\"Gib hier den Titel Deines Videos ein\" />\n              <div class=\"CharCounter-counter\"></div>\n            </div>\n          </div>\n          <div class=\"control-group\">\n            <div class=\"MediaEditForm-descriptionCharCounter CharCounter\">\n              <textarea class=\"MediaEditForm-description CharCounter-target\" name=\"video_metadata[description]\" placeholder=\"Gib hier eine kurze Beschreibung ein.\"></textarea>\n              <div class=\"CharCounter-counter\"></div>\n            </div>\n          </div>\n          <div class=\"control-group MediaEditForm-ctaContainer\">\n            <select class=\"MediaEditForm-ctaSelect u-inactive t1-select\" name=\"video_metadata[cta]\">\n              <option value=\"\">Choose a call to action</option>\n              <option value=\"visit_site\">Visit site:</option>\n              <option value=\"watch_now\">Watch now:</option>\n            </select>\n            <input class=\"MediaEditForm-ctaUrl u-hidden\" type=\"text\" name=\"video_metadata[cta_url]\" placeholder=\"Webseite\" />\n          </div>\n          <div class=\"control-group\">\n            <div class=\"checkbox\">\n              <label>\n                <input class=\"MediaEditForm-embeddable\" type=\"checkbox\" name=\"video_metadata[embeddable]\" value=\"true\" checked>\n                Erlaube Einbettung des Videos\n              </label>\n            </div>\n          </div>\n        </form>\n");});c.pop();}t.b("      </div>\n      <div class=\"modal-footer text-right\">\n        <button type=\"button\" class=\"btn primary-btn js-done\">\n          Fertig\n        </button>\n      </div>\n    </div>\n    <div class=\"MediaEditDialog-photoSection\">\n      <div class=\"modal-body\"><div class=\"MediaEditDialog-photoContainer\"></div></div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }},"<media/video_trim1":{name:"media/video_trim", partials: {}, subs: {  }}}, subs: {  }});
Templates['dialogs/media_thumbnail'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"preview\" data-upload-id=\"");t.b(t.v(t.f("upload_id",c,p,0)));t.b("\" data-file-id=\"");t.b(t.v(t.f("file_id",c,p,0)));t.b("\">\n");t.b(t.rp("<dismiss_button0",c,p,"  "));if(t.s(t.f("is_video",c,p,1),c,p,0,117,578,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <button type=\"button\" class=\"preview-overlay edit js-edit\" tabindex=\"-1\">\n");if(t.s(t.f("whitelisted_video_user",c,p,1),c,p,0,229,255,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        Bearbeiten\n");});c.pop();}if(!t.s(t.f("whitelisted_video_user",c,p,1),c,p,1,0,0,"")){t.b("        Zuschneiden\n");};t.b("    </button>\n    <div class=\"preview-overlay duration-badge\"></div>\n    <div class=\"play-button\">\n      <div class=\"Icon Icon--playButton\"><span class=\"u-hiddenVisually\">Abspielen</span></div>\n    </div>\n");});c.pop();}t.b("  <span class=\"filename\">");t.b(t.v(t.f("file_name",c,p,0)));t.b("</span>\n");if(t.s(t.f("is_gif",c,p,1),c,p,0,651,762,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <div class=\"Badge Badge--icon\">\n      <span class=\"Icon Icon--medium Icon--gifBadge\"></span>\n    </div>\n");});c.pop();}t.b("  <button class=\"js-show-preview\" type=\"button\" draggable=\"false\" style=\"height:");t.b(t.v(t.f("preview_button_height",c,p,0)));t.b("px;width:");t.b(t.v(t.f("preview_button_width",c,p,0)));t.b("px\">\n    <img src=\"");t.b(t.v(t.f("src",c,p,0)));t.b("\" style=\"");t.b(t.v(t.f("offset_styles",c,p,0)));t.b("\" draggable=\"false\" data-original-width=\"");t.b(t.v(t.f("original_width",c,p,0)));t.b("\" data-original-height=\"");t.b(t.v(t.f("original_height",c,p,0)));t.b("\">\n  </button>\n</div>");return t.fl(); },partials: {"<dismiss_button0":{name:"dismiss_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['dm/dm_avatar'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"DMAvatar DMAvatar--");if(t.s(t.f("image_count",c,p,1),c,p,0,47,62,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("image_count",c,p,0)));});c.pop();}if(!t.s(t.f("image_count",c,p,1),c,p,1,0,0,"")){t.b("1");};t.b(" u-chromeOverflowFix\">\n");if(t.s(t.f("images",c,p,1),c,p,0,147,263,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <span class=\"DMAvatar-container\">\n      <img class=\"DMAvatar-image\" src=\"");t.b(t.v(t.f("src",c,p,0)));t.b("\" alt=\"");t.b(t.v(t.f("alt",c,p,0)));t.b("\">\n    </span>\n");});c.pop();}t.b("</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['dm/dm_sending_state_indicator'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"DMSendingStateIndicator\">\n  <span>Nachricht ");t.b(t.v(t.f("current",c,p,0)));t.b(" von ");t.b(t.v(t.f("total",c,p,0)));t.b(" wird gesendet</span>\n  <span>...</span>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['dm/dm_typeahead_account_suggestion'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"DMTokenizedMultiselectSuggestion ");t.b(t.v(t.f("suggestion_class",c,p,0)));t.b(" ");if(t.s(t.f("preselected",c,p,1),c,p,0,81,95,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("is-preselected");});c.pop();}t.b(" ");if(t.s(t.f("selected",c,p,1),c,p,0,125,136,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("is-selected");});c.pop();}t.b("\" data-token-id=\"");t.b(t.v(t.f("data_token_id",c,p,0)));t.b("\" data-token-text=\"");t.b(t.v(t.f("data_token_text",c,p,0)));t.b("\" role=\"option\" tabindex=\"-1\">\n  <div class=\"DMTokenizedMultiselectSuggestion-body\">\n");t.b(t.rp("<dm/dm_typeahead_item0",c,p,"    "));t.b("  </div>\n  <div class=\"DMTokenizedMultiselectSuggestion-state\">\n    <span class=\"DMTokenizedMultiselectSuggestion-selectedIndicator Icon Icon--check\"></span>\n    <span class=\"DMTokenizedMultiselectSuggestion-preselectedIndicator\">In der Gruppe</span>\n  </div>\n</li>\n");return t.fl(); },partials: {"<dm/dm_typeahead_item0":{name:"dm/dm_typeahead_item", partials: {}, subs: {  }}}, subs: {  }});
Templates['dm/dm_typeahead_group_suggestion'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"DMTokenizedMultiselectSuggestion ");t.b(t.v(t.f("suggestion_class",c,p,0)));t.b("\" data-token-id=\"");t.b(t.v(t.f("data_token_id",c,p,0)));t.b("\" data-token-text=\"");t.b(t.v(t.f("data_token_text",c,p,0)));t.b("\" role=\"option\" tabindex=\"-1\">\n  <div class=\"DMTokenizedMultiselectSuggestion-body\">\n    ");t.b(t.t(t.f("html",c,p,0)));t.b("\n" + i);t.b("  </div>\n</li>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['dm/dm_typeahead_item'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"DMTypeaheadItem\">\n  <div class=\"DMTypeaheadItem-avatar\" aria-hidden=\"true\">\n");if(t.s(t.f("avatar",c,p,1),c,p,0,103,120,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<dm/dm_avatar0",c,p,""));});c.pop();}t.b("  </div>\n\n  <div class=\"DMTypeaheadItem-title\">\n");if(t.s(t.f("title",c,p,1),c,p,0,194,407,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <b class=\"fullname\">");if(t.s(t.f("rich_text",c,p,1),c,p,0,235,254,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<emojified_text1",c,p,""));});c.pop();}if(!t.s(t.f("rich_text",c,p,1),c,p,1,0,0,"")){t.b(t.v(t.f("text",c,p,0)));};t.b("</b>\n");if(t.s(t.f("verified",c,p,1),c,p,0,328,355,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<verified_account_badge2",c,p,""));});c.pop();}t.b(t.rp("<dm/screen_name_partial3",c,p,"      "));});c.pop();}t.b("  </div>\n</div>\n");return t.fl(); },partials: {"<dm/dm_avatar0":{name:"dm/dm_avatar", partials: {}, subs: {  }},"<emojified_text1":{name:"emojified_text", partials: {}, subs: {  }},"<verified_account_badge2":{name:"verified_account_badge", partials: {}, subs: {  }},"<dm/screen_name_partial3":{name:"dm/screen_name_partial", partials: {}, subs: {  }}}, subs: {  }});
Templates['dm/last_read_marker'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"DMConversation-lastReadMarker\">\n  <div class=\"DMLastReadMarker\">\n    <div class=\"DMDivider\">\n      <span class=\"DMDivider-text\">\n        \n          ");if(t.s(t.f("unread_count_one",c,p,1),c,p,0,181,197,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("1 unread message");});c.pop();}t.b("\n" + i);t.b("          ");if(t.s(t.f("unread_count_other",c,p,1),c,p,0,252,284,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.v(t.f("unread_count",c,p,0)));t.b(" unread messages");});c.pop();}t.b("\n" + i);t.b("        \n      </span>\n    </div>\n  </div>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['dm/screen_name_partial'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("screen_name",c,p,1),c,p,0,16,71,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("<small class=\"username\"><s>@</s>");t.b(t.v(t.f("screen_name",c,p,0)));t.b("</small>");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['dm/tokenized_multiselect_token'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"");t.b(t.v(t.f("token_class",c,p,0)));t.b("\" tabindex=\"-1\" data-token-id=\"");t.b(t.v(t.f("token_id",c,p,0)));t.b("\" data-token-text=\"");t.b(t.v(t.f("token_text",c,p,0)));t.b("\" aria-label=\"");t.b(t.v(t.f("token_text",c,p,0)));t.b("\">\n  ");t.b(t.v(t.f("token_text",c,p,0)));t.b("\n" + i);t.b("  <span class=\"");t.b(t.v(t.f("token_delete_class",c,p,0)));t.b(" Icon Icon--close\" aria-hidden=\"true\"></span>\n</li>");return t.fl(); },partials: {}, subs: {  }});
Templates['dm/typeahead_initial_suggestions'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"DMTypeaheadHeader\">\n  <span>Kürzlich</span>\n</li>\n");if(t.s(t.f("suggestions",c,p,1),c,p,0,77,228,"{{ }}")){t.rs(c,p,function(c,p,t){if(t.s(t.f("is_group",c,p,1),c,p,0,93,138,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<dm/dm_typeahead_group_suggestion0",c,p,"    "));});c.pop();}if(!t.s(t.f("is_group",c,p,1),c,p,1,0,0,"")){t.b(t.rp("<dm/dm_typeahead_account_suggestion1",c,p,"    "));};});c.pop();}return t.fl(); },partials: {"<dm/dm_typeahead_group_suggestion0":{name:"dm/dm_typeahead_group_suggestion", partials: {}, subs: {  }},"<dm/dm_typeahead_account_suggestion1":{name:"dm/dm_typeahead_account_suggestion", partials: {}, subs: {  }}}, subs: {  }});
Templates['dm/typeahead_suggestions'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("has_accounts",c,p,1),c,p,0,45,113,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <li class=\"DMTypeaheadHeader\">\n    <span>Personen</span>\n  </li>\n");});c.pop();}if(t.s(t.f("accounts",c,p,1),c,p,0,144,187,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<dm/dm_typeahead_account_suggestion0",c,p,"  "));});c.pop();}t.b("\n" + i);if(t.s(t.f("has_groups",c,p,1),c,p,0,242,309,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <li class=\"DMTypeaheadHeader\">\n    <span>Gruppen</span>\n  </li>\n");});c.pop();}if(t.s(t.f("groups",c,p,1),c,p,0,336,377,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<dm/dm_typeahead_group_suggestion1",c,p,"  "));});c.pop();}return t.fl(); },partials: {"<dm/dm_typeahead_account_suggestion0":{name:"dm/dm_typeahead_account_suggestion", partials: {}, subs: {  }},"<dm/dm_typeahead_group_suggestion1":{name:"dm/dm_typeahead_group_suggestion", partials: {}, subs: {  }}}, subs: {  }});
Templates['found_media/attribution'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("\n" + i);t.b("  via &nbsp;\n");if(t.s(t.f("image",c,p,1),c,p,0,26,91,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <span class=\"provider provider--");t.b(t.v(t.f("image",c,p,0)));t.b("\"></span> &nbsp;\n");});c.pop();}t.b("  ");t.b(t.v(t.f("name",c,p,0)));t.b("\n");t.b("\n");return t.fl(); },partials: {}, subs: {  }});
Templates['found_media/unavailable'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"FoundMediaSearch-noResults\">\n  <p>Huch! GIFs laden gerade nicht.</p>\n  <button type=\"button\" class=\"btn js-found-media-reload-search-trigger\">Erneut laden</button>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/disabled_dropdown'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div tabindex=\"-1\">\n  <div class=\"dropdown-caret\">\n    <span class=\"caret-outer\"></span>\n    <span class=\"caret-inner\"></span>\n  </div>\n  <ul>\n    <li class=\"geo-not-enabled-yet\">\n      <h2>Füge einen Standort zu Deinen Tweets hinzu</h2>\n      <p>\n        Twitter speichert Deine Standortangaben.&#32;\n        Du kannst die Standortangabe vor jedem Tweet ein- oder ausschalten und Du hast jederzeit die Möglichkeit, Standortangaben nachträglich zu löschen.\n        <a href=\"http://support.twitter.com/forums/26810/entries/78525\" target=\"_blank\">Mehr erfahren</a>\n      </p>\n      <div>\n        <button type=\"button\" class=\"geo-turn-on btn primary-btn\">Standortangabe einschalten</button>\n        <button type=\"button\" class=\"geo-not-now btn-link\">Nicht jetzt</button>\n      </div>\n    </li>\n  </ul>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/dropdown_places'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("places",c,p,1),c,p,0,11,242,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <li class=\"dropdown-link GeoSearch-focusable GeoSearch-result GeoSearch-result--place\" data-result-type=\"place\" data-place-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\">");if(t.s(t.f("is_first_place",c,p,1),c,p,0,168,204,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("<span class=\"icon checkmark\"></span>");});c.pop();}t.b(t.v(t.f("full_name",c,p,0)));t.b("</li>\n");});c.pop();}t.b("<li class=\"GeoSearch-result--place dropdown-divider\"></li>");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/dropdown_search_results'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("places",c,p,1),c,p,0,11,170,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <li class=\"dropdown-link GeoSearch-focusable GeoSearch-result GeoSearch-result--search\" data-result-type=\"search\" data-place-id=\"");t.b(t.v(t.f("id",c,p,0)));t.b("\">");t.b(t.v(t.f("full_name",c,p,0)));t.b("</li>\n");});c.pop();}if(!t.s(t.f("places",c,p,1),c,p,1,0,0,"")){t.b("  <li class=\"dropdown-link GeoSearch-focusable GeoSearch-result GeoSearch-result--search GeoSearch-noResults\">Keine Suchergebnisse</li>\n");};t.b("<li class=\"GeoSearch-result--search dropdown-divider\"></li>");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/enabled_dropdown'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div tabindex=\"-1\">\n  <div class=\"dropdown-caret\">\n    <span class=\"caret-outer\"></span>\n    <span class=\"caret-inner\"></span>\n  </div>\n  <div>\n    <div class=\"geo-query-location\">\n      <input class=\"GeoSearch-queryInput\" type=\"text\" autocomplete=\"off\" placeholder=\"Suche nach Stadtteil oder Stadt\">\n      <span class=\"icon generic-search\"></span>\n    </div>\n    <div class=\"geo-dropdown-status\"></div>\n    <ul class=\"GeoSearch-dropdownMenu\"></ul>\n  </div>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/geo_picker'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"geo-picker dropdown\">\n  <button class=\"btn js-geo-search-trigger geo-picker-btn icon-btn ");if(t.s(t.f("hide_button_labels",c,p,1),c,p,0,124,134,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}if(!t.s(t.f("hide_button_labels",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,206,216,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}};t.b("\" type=\"button\" data-delay=\"150\">\n    <span class=\"Icon Icon--geo\"></span>\n    <span class=\"text geo-status");if(t.s(t.f("hide_button_labels",c,p,1),c,p,0,395,412,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" u-hiddenVisually");});c.pop();}t.b("\">\n");if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,470,494,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        Standort\n");});c.pop();}if(!t.s(t.f("minimal_button_labels",c,p,1),c,p,1,0,0,"")){t.b("        Standort hinzufügen\n");};t.b("    </span>\n  </button>\n  <span class=\"dropdown-container dropdown-menu\"></span>\n  <input type=\"hidden\" name=\"place_id\">\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['geo/turn_off_location'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"dropdown-link geo-turn-off-item GeoSearch-focusable\" id=");t.b(t.v(t.f("id",c,p,0)));t.b(" role=\"option\">\n  <span class=\"icon close\"></span>Standort ausschalten\n</li>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['highline/user_location'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("place_id",c,p,1),c,p,0,13,103,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <a href=\"/search?q=place%3A");t.b(t.v(t.f("place_id",c,p,0)));t.b("\" data-place-id=\"");t.b(t.v(t.f("place_id",c,p,0)));t.b("\">");t.b(t.v(t.f("location",c,p,0)));t.b("</a>\n");});c.pop();}if(!t.s(t.f("place_id",c,p,1),c,p,1,0,0,"")){t.b("  ");t.b(t.v(t.f("location",c,p,0)));t.b("\n" + i);};return t.fl(); },partials: {}, subs: {  }});
Templates['media/media_picker'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"photo-selector\">\n  <button aria-hidden=\"true\" class=\"btn icon-btn ");if(t.s(t.f("hide_button_labels",c,p,1),c,p,0,101,111,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}if(!t.s(t.f("hide_button_labels",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,183,193,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}};t.b("\" type=\"button\" tabindex=\"-1\" data-original-title=\"Foto hinzufügen\">\n    <span class=\"tweet-camera Icon Icon--camera\"></span>\n    <span class=\"text add-photo-label");if(t.s(t.f("hide_button_labels",c,p,1),c,p,0,428,445,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" u-hiddenVisually");});c.pop();}t.b("\">\n");if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,503,525,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        Medien\n");});c.pop();}if(!t.s(t.f("minimal_button_labels",c,p,1),c,p,1,0,0,"")){t.b("        Foto hinzufügen\n");};t.b("    </span>\n  </button>\n  <div class=\"image-selector\">\n    <input type=\"hidden\" name=\"media_data_empty\" class=\"file-data\">\n    <div class=\"multi-photo-data-container hidden\">\n    </div>\n    <label class=\"t1-label\">\n      <span class=\"visuallyhidden\">\n");if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,927,964,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("          Medien hinzufügen\n");});c.pop();}if(!t.s(t.f("minimal_button_labels",c,p,1),c,p,1,0,0,"")){t.b("          Foto hinzufügen\n");};t.b("      </span>\n      <input type=\"file\" name=\"media_empty\" accept=\"image/gif,image/jpeg,image/jpg,image/png\"\n          class=\"file-input ");if(t.s(t.f("hide_button_labels",c,p,1),c,p,0,1246,1256,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}if(!t.s(t.f("hide_button_labels",c,p,1),c,p,1,0,0,"")){if(t.s(t.f("minimal_button_labels",c,p,1),c,p,0,1328,1338,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-tooltip");});c.pop();}};t.b("\" data-original-title=\"Foto hinzufügen\" data-delay=\"150\">\n    </label>\n    <div class=\"swf-container\"></div>\n  </div>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['media/video_trim'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"VideoTrim\">\n  <div class=\"VideoTrim-shroud\"></div>\n  <div class=\"VideoTrim-videoContainer\">\n    <video class=\"VideoTrim-video\" preload=\"auto\"></video>\n    <div class=\"VideoTrim-controls\">\n      <span class=\"VideoTrim-playState\">\n        <span class=\"Icon Icon--play\"></span>\n        <span class=\"Icon Icon--pause\"></span>\n      </span>\n      <div class=\"VideoTrim-timeline\">\n        <div class=\"VideoTrim-timelineCursor\"></div>\n        <div class=\"VideoTrim-scrubber\">\n          <div class=\"VideoTrim-timeBubble\"></div>\n          <div class=\"VideoTrim-unplayedScrubber\"></div>\n        </div>\n      </div>\n      <span class=\"VideoTrim-timeContainer\">\n        <span class=\"VideoTrim-time\"></span>\n        <span class=\"VideoTrim-widestTime\" aria-hidden=\"true\"></span>\n      </span>\n      <span class=\"VideoTrim-audioState\">\n        <span class=\"Icon Icon--soundOn\"></span>\n        <span class=\"Icon Icon--soundOff\"></span>\n      </span>\n    </div>\n  </div>\n  <div class=\"VideoTrim-selection\">\n    <div class=\"VideoTrim-ticks\"></div>\n    <div class=\"VideoTrim-innerSelection\">\n      <div class=\"VideoTrim-midHandle\">\n        <div class=\"VideoTrim-hideTicks\"></div>\n        <div class=\"VideoTrim-leftHandle\"></div>\n        <div class=\"VideoTrim-midHandleCursor\"></div>\n        <div class=\"VideoTrim-midHandleInner\">\n          <div class=\"VideoTrim-midHandleGrip\"></div>\n        </div>\n        <div class=\"VideoTrim-rightHandle\"></div>\n      </div>\n    </div>\n  </div>\n</div>\n\n\n");return t.fl(); },partials: {}, subs: {  }});
Templates['moments/moment_share_embed_content'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b(t.rp("<dialogs/close_button0",c,p,""));t.b("<div class=\"modal-header\">\n  <h3 class=\"modal-title\">\n    Diesen Moment einbetten\n  </h3>\n</div>\n<div class=\"modal-body\">\n");if(t.s(t.f("is_loading",c,p,1),c,p,0,165,272,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("    <div class=\"MomentShareDialog-loading\">\n      <span class=\"u-hiddenVisually\">Lädt</span>\n    </div>\n");});c.pop();}if(!t.s(t.f("is_loading",c,p,1),c,p,1,0,0,"")){t.b("    <p class=\"MomentShareDialog-description\">\n      Füge diesen Moment zu Deiner Webseite hinzu, indem Du den untenstehenden Code kopierst. <a target=\"_blank\" href=\"");t.b(t.v(t.f("help_url",c,p,0)));t.b("\">Mehr erfahren</a>\n    </p>\n    <textarea class=\"MomentShareDialog-url MomentShareDialog-url--embed js-initial-focus u-dir\" dir=\"ltr\" readonly>");t.b(t.v(t.f("url",c,p,0)));t.b("</textarea>\n");};t.b("</div>");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['moments/moment_share_link_content'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b(t.rp("<dialogs/close_button0",c,p,""));t.b("<div class=\"modal-header\">\n  <h3 class=\"modal-title\">\n    Link zum Moment kopieren\n  </h3>\n</div>\n<div class=\"modal-body\">\n  <p class=\"MomentShareDialog-description\">\n    Die URL dieses Moments steht unten. Einfach kopieren und mit Freunden teilen.\n  </p>\n  <textarea class=\"MomentShareDialog-url MomentShareDialog-url--link js-initial-focus u-dir\" dir=\"ltr\" readonly>");t.b(t.v(t.f("url",c,p,0)));t.b("</textarea>\n</div>");return t.fl(); },partials: {"<dialogs/close_button0":{name:"dialogs/close_button", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/dm'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast dm-notification\" data-item-id=\"");t.b(t.v(t.f("tweet_id",c,p,0)));t.b("\" data-tweet-id=\"");t.b(t.v(t.f("tweet_id",c,p,0)));t.b("\" data-screen-name=\"");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-name=\"");t.b(t.v(t.f("user_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\" data-retweeter=\"");t.b(t.v(t.f("retweeter",c,p,0)));t.b("\" data-mentions=\"");t.b(t.v(t.f("mentions",c,p,0)));t.b("\" data-item-type=\"tweet\">\n  <div class=\"WebToast-box\">\n");t.b(t.rp("<spoonbill/notification_box_close0",c,p,"    "));t.b("\n" + i);t.b("    <div class=\"WebToast-header u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <span class=\"Icon Icon--message Icon--small u-floatRight\"></span>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        Direktnachricht\n      </div>\n    </div>\n");t.b(t.rp("<spoonbill/tweet1",c,p,"    "));t.b("  </div>\n\n  <div class=\"WebToast-line\"></div>\n\n  <div class=\"WebToast-box WebToast-box--altColor js-inlineReply\">\n");t.b("  </div>\n</div>\n");return t.fl(); },partials: {"<spoonbill/notification_box_close0":{name:"spoonbill/notification_box_close", partials: {}, subs: {  }},"<spoonbill/tweet1":{name:"spoonbill/tweet", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/favorite'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast is-actionable\" data-redirect-to=\"notifications\">\n  <div class=\"WebToast-box u-cf\">\n");t.b(t.rp("<spoonbill/notification_box_close0",c,p,"    "));t.b("\n" + i);t.b("    <div class=\"WebToast-header u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <span class=\"Icon Icon--heartBadge Icon--small u-floatRight\"></span>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        Dein Tweet gefällt jemandem\n      </div>\n    </div>\n\n    <div class=\"u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <a class=\"js-user-profile-link js-action-profile-avatar\" tabindex=\"-1\" href=\"/");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\">\n          <img class=\"WebToast-avatar\" width=\"32\" height=\"32\" src=\"");t.b(t.v(t.f("user_avatar",c,p,0)));t.b("\" alt=\"\">\n        </a>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        ");t.b(t.rp("<spoonbill/user_identity_fullname_link1",c,p,""));t.b(" gefällt ");t.b(t.rp("<spoonbill/tweet_excerpt2",c,p,""));t.b("\n" + i);t.b("      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<spoonbill/notification_box_close0":{name:"spoonbill/notification_box_close", partials: {}, subs: {  }},"<spoonbill/user_identity_fullname_link1":{name:"spoonbill/user_identity_fullname_link", partials: {}, subs: {  }},"<spoonbill/tweet_excerpt2":{name:"spoonbill/tweet_excerpt", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/follow'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast\">\n  <div class=\"WebToast-box u-cf\">\n");t.b(t.rp("<spoonbill/notification_box_close0",c,p,"    "));t.b("\n" + i);t.b("    <div class=\"WebToast-header u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <span class=\"Icon Icon--follower Icon--small u-floatRight\"></span>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        Neuer Follower\n      </div>\n    </div>\n\n    <div class=\"u-cf\">\n");if(t.s(t.f("show_follow_button",c,p,1),c,p,0,417,490,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("        <div class=\"u-floatRight\">");t.b(t.rp("<spoonbill/follow_btn1",c,p,""));t.b("</div>\n");});c.pop();}t.b(t.rp("<spoonbill/user_identity2",c,p,"      "));t.b("    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<spoonbill/notification_box_close0":{name:"spoonbill/notification_box_close", partials: {}, subs: {  }},"<spoonbill/follow_btn1":{name:"spoonbill/follow_btn", partials: {}, subs: {  }},"<spoonbill/user_identity2":{name:"spoonbill/user_identity", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/follow_btn'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"user-actions ");t.b(t.v(t.f("follow_state",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\" data-screen-name=\"");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-name=\"");t.b(t.v(t.f("user_name",c,p,0)));t.b("\" data-protected=\"");t.b(t.v(t.f("user_protected",c,p,0)));t.b("\" data-item-type=\"user\">\n  <button class=\"Button WebToast-followButton\">\n    <span class=\"follow-text button-text\">\n      <span class=\"Icon Icon--follow Icon--medium\"></span>\n      <span class=\"u-hiddenVisually\">@");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b(" folgen</span>\n    </span>\n    <span class=\"following-text button-text\">\n      <span class=\"Icon Icon--following Icon--medium\"></span>\n      <span class=\"u-hiddenVisually\">Folge @");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("</span>\n    </span>\n    <span class=\"unfollow-text button-text\">\n      <span class=\"Icon Icon--unfollow Icon--medium\"></span>\n      <span class=\"u-hiddenVisually\">@");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b(" entfolgen</span>\n    </span>\n    <span class=\"pending-text button-text\">\n      Ausstehend\n      <span class=\"u-hiddenVisually\">Ausstehend @");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("</span>\n    </span>\n    <span class=\"blocked-text button-text\">\n      Blockiert\n      <span class=\"u-hiddenVisually\">@");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b(" blockiert</span>\n    </span>\n  </button>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['spoonbill/mention'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast original-tweet\" data-item-id=\"");t.b(t.v(t.f("tweet_id",c,p,0)));t.b("\" data-tweet-id=\"");t.b(t.v(t.f("tweet_id",c,p,0)));t.b("\" data-screen-name=\"");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-name=\"");t.b(t.v(t.f("user_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\" data-retweeter=\"");t.b(t.v(t.f("retweeter",c,p,0)));t.b("\" data-mentions=\"");t.b(t.v(t.f("mentions",c,p,0)));t.b("\" data-item-type=\"tweet\">\n  <div class=\"WebToast-box\">\n");t.b(t.rp("<spoonbill/notification_box_close0",c,p,"    "));t.b("\n" + i);t.b(t.rp("<spoonbill/tweet1",c,p,"    "));t.b("  </div>\n\n  <div class=\"WebToast-line\"></div>\n\n");t.b(t.rp("<spoonbill/tweet_actions2",c,p,"  "));t.b("</div>\n");return t.fl(); },partials: {"<spoonbill/notification_box_close0":{name:"spoonbill/notification_box_close", partials: {}, subs: {  }},"<spoonbill/tweet1":{name:"spoonbill/tweet", partials: {}, subs: {  }},"<spoonbill/tweet_actions2":{name:"spoonbill/tweet_actions", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/notification_box_close'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast-close\">\n  <button class=\"WebToast-closeButton\" type=\"button\">\n    <span class=\"Icon Icon--close\"></span>\n    <span class=\"u-hiddenVisually\">Schließen</span>\n  </button>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['spoonbill/retweet'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast is-actionable\" data-redirect-to=\"notifications\">\n  <div class=\"WebToast-box u-cf\">\n");t.b(t.rp("<spoonbill/notification_box_close0",c,p,"    "));t.b("\n" + i);t.b("    <div class=\"WebToast-header u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <span class=\"Icon Icon--retweeted Icon--small u-floatRight\"></span>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        Retweetet\n      </div>\n    </div>\n\n    <div class=\"u-cf\">\n      <div class=\"WebToast-imageBox u-floatLeft\">\n        <a class=\"js-user-profile-link js-action-profile-avatar\" tabindex=\"-1\" href=\"/");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\">\n          <img class=\"WebToast-avatar\" width=\"32\" height=\"32\" src=\"");t.b(t.v(t.f("user_avatar",c,p,0)));t.b("\" alt=\"\">\n        </a>\n      </div>\n      <div class=\"WebToast-contentBox\">\n        ");t.b(t.rp("<spoonbill/user_identity_fullname_link1",c,p,""));t.b(" hat ");t.b(t.rp("<spoonbill/tweet_excerpt2",c,p,""));t.b(" retweetet\n      </div>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<spoonbill/notification_box_close0":{name:"spoonbill/notification_box_close", partials: {}, subs: {  }},"<spoonbill/user_identity_fullname_link1":{name:"spoonbill/user_identity_fullname_link", partials: {}, subs: {  }},"<spoonbill/tweet_excerpt2":{name:"spoonbill/tweet_excerpt", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/tweet'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"u-cf u-textBreak\">\n");t.b(t.rp("<spoonbill/user_identity0",c,p,"  "));t.b("\n" + i);t.b("  <div class=\"WebToast-contentBox\">\n    <div class=\"WebToast-tweetExcerpt tweet-text u-dir\" dir=\"ltr\">");t.b(t.t(t.f("tweet_html",c,p,0)));t.b("</div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<spoonbill/user_identity0":{name:"spoonbill/user_identity", partials: {}, subs: {  }}}, subs: {  }});
Templates['spoonbill/tweet_actions'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast-actionBar\">\n  <ul class=\"Arrange Arrange--equal\">\n    <li class=\"Arrange-sizeFill\">\n      <button class=\"WebToast-action WebToast-action--reply js-actionReply\" type=\"button\">\n        <span class=\"Icon Icon--reply u-block\"></span>\n        <span class=\"u-hiddenVisually\">Antworten</span>\n      </button>\n    </li>\n    <li class=\"Arrange-sizeFill\">\n      <button class=\"WebToast-action WebToast-action--retweet js-actionInlineRetweet\" type=\"button\">\n        <span class=\"Icon Icon--retweet u-block\"></span>\n        <span class=\"u-hiddenVisually\">Retweeten</span>\n      </button>\n    </li>\n    <li class=\"Arrange-sizeFill\">\n      <button class=\"WebToast-action WebToast-action--heart js-actionFavorite\" type=\"button\">\n        <span class=\"Icon Icon--heart u-block\"></span>\n        <span class=\"u-hiddenVisually\">Gefällt mir</span>\n      </button>\n    </li>\n  </ul>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['spoonbill/tweet_excerpt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"WebToast-tweetExcerpt u-dir u-textBreak\" dir=\"ltr\">\n  ");t.b(t.t(t.f("tweet_html",c,p,0)));t.b("\n" + i);t.b("</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['spoonbill/user_identity'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"");if(!t.s(t.f("with_block_username",c,p,1),c,p,1,0,0,"")){t.b("u-inline");};t.b("\">\n  <a class=\"WebToast-accountLink u-linkComplex js-action-profile-name js-user-profile-link\" href=\"/");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\">\n    <span class=\"WebToast-imageBox u-floatLeft\">\n      <img class=\"WebToast-avatar\" width=\"32\" height=\"32\" src=\"");t.b(t.v(t.f("user_avatar",c,p,0)));t.b("\" alt=\"\">\n    </span>\n\n    <span class=\"WebToast-contentBox u-block\">\n      <b class=\"WebToast-fullname u-linkComplex-target ");if(t.s(t.f("with_block_username",c,p,1),c,p,0,496,510,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("u-block u-nbfc");});c.pop();}t.b("\">");t.b(t.v(t.f("user_name",c,p,0)));t.b("</b>\n      ");if(!t.s(t.f("with_block_username",c,p,1),c,p,1,0,0,"")){t.b("<span>&rlm;</span>");};t.b("\n" + i);t.b("      <span class=\"WebToast-username u-dir\" dir=\"ltr\">\n        <span class=\"at\">@</span>");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\n" + i);t.b("      </span>\n    </span>\n  </a>\n</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['spoonbill/user_identity_fullname_link'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<a class=\"WebToast-accountLink js-user-profile-link js-action-profile-name\" href=\"/");t.b(t.v(t.f("user_screen_name",c,p,0)));t.b("\" data-user-id=\"");t.b(t.v(t.f("user_id",c,p,0)));t.b("\">");t.b("<b class=\"WebToast-fullname\">");t.b(t.v(t.f("user_name",c,p,0)));t.b("</b>");t.b("</a>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['start/custom_interest'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"StartCheckboxList-item\">\n  <label class=\"t1-label\">\n    <span class=\"Checkbox\">\n      <input class=\"Checkbox-original js-action-checkbox\" type=\"checkbox\" name=\"custom\" value=\"");t.b(t.v(t.f("name",c,p,0)));t.b("\" checked>\n      <span class=\"Checkbox-fake\">\n        <span class=\"Icon Icon--check Icon--small\"></span>\n      </span>\n    </span>\n    <span class=\"StartCheckboxList-label\">");t.b(t.v(t.f("name",c,p,0)));t.b("</span>\n  </label>\n</li>");return t.fl(); },partials: {}, subs: {  }});
Templates['start/select_all_checkbox'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"u-floatRight\">\n  <label class=\"t1-label\">\n    Alle auswählen\n    <span class=\"Checkbox\">\n      <input class=\"Checkbox-original js-select-all\" type=\"checkbox\" checked>\n      <span class=\"Checkbox-fake\">\n        <span class=\"Icon Icon--check Icon--small\"></span>\n      </span>\n    </span>\n  </label>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['start/wtf_follow_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("num_users_selected",c,p,1),c,p,0,23,69,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  ");t.b(t.v(t.f("num_users_selected",c,p,0)));t.b(" folgen & fortfahren\n");});c.pop();}if(!t.s(t.f("num_users_selected",c,p,1),c,p,1,0,0,"")){t.b("  Weiter\n");};return t.fl(); },partials: {}, subs: {  }});
Templates['gallery/stickers/svg'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://www.w3.org/2000/svg\"\n    class=\"media-image\" viewBox=\"0 0 ");t.b(t.v(t.f("width",c,p,0)));t.b(" ");t.b(t.v(t.f("height",c,p,0)));t.b("\" width=\"");t.b(t.v(t.f("width",c,p,0)));t.b("\" height=\"");t.b(t.v(t.f("height",c,p,0)));t.b("\">\n  <g>\n    <g>\n      <image xlink:href=\"");t.b(t.v(t.f("image",c,p,0)));t.b("\" src=\"");t.b(t.v(t.f("image",c,p,0)));t.b("\" width=\"");t.b(t.v(t.f("width",c,p,0)));t.b("\" height=\"");t.b(t.v(t.f("height",c,p,0)));t.b("\" />\n    </g>\n");if(t.s(t.f("stickers",c,p,1),c,p,0,314,609,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <a xlink:href=\"");t.b(t.v(t.f("link",c,p,0)));t.b("\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n        <image xlink:href=\"");t.b(t.v(t.f("url",c,p,0)));t.b("\" src=\"");t.b(t.v(t.f("url",c,p,0)));t.b("\" x=\"0\" y=\"0\" width=\"");t.b(t.v(t.f("width",c,p,0)));t.b("\" height=\"");t.b(t.v(t.f("height",c,p,0)));t.b("\"\n            transform=\"");t.b(t.v(t.f("transform",c,p,0)));t.b("\" class=\"sticker js-tooltop\" data-sticker-data=\"");t.b(t.v(t.f("stickerData",c,p,0)));t.b("\" />\n      </a>\n");});c.pop();}t.b("  </g>\n</svg>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['highline/components/color_picker'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"ColorPicker dropdown-menu\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"color-picker\">");t.b("<fieldset>");t.b("<legend id=\"color-picker\" class=\"u-hiddenVisually\">Farbauswahl</legend>");t.b("<div class=\"dropdown-caret\">");t.b("<span class=\"caret-outer\"></span>");t.b("<span class=\"caret-inner\"></span>");t.b("</div>");t.b("<div class=\"ColorPicker-colorList\">");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#ff691f\" style=\"background-color: #ff691f\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">orange</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#fab81e\" style=\"background-color: #fab81e\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">gelb</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#7fdbb6\" style=\"background-color: #7fdbb6\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">gelbgrün</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#19cf86\" style=\"background-color: #19cf86\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">grün</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#91d2fa\" style=\"background-color: #91d2fa\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">blau</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#1b95e0\" style=\"background-color: #1b95e0\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">marineblau</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#abb8c2\" style=\"background-color: #abb8c2\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">grau</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#e81c4f\" style=\"background-color: #e81c4f\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">rot</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#f58ea8\" style=\"background-color: #f58ea8\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">rosa</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-color\" data-color=\"#981ceb\" style=\"background-color: #981ceb\">");t.b("<label class=\"Icon Icon--smallest\">");t.b("<span class=\"u-hiddenVisually\">violett</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-transparent\">");t.b("<div class=\"ColorPicker-item ColorPicker-more\" style=\"background-color: #f0f0f0\">");t.b("<label class=\"Icon Icon--smallest Icon--add\">");t.b("<span class=\"u-hiddenVisually\">mehr</span>");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("</div>");t.b("</div>");t.b("<div class=\"ColorPicker-item ColorPicker-hex\" data-color=\"#f0f0f0\" data-original-color=\"#f0f0f0\" style=\"background-color: #f0f0f0\">");t.b("<label class=\"Icon Icon--smallest Icon--discover\">");t.b("<input class=\"u-hiddenVisually\" type=\"radio\" name=\"ColorPicker-colorGroup\">");t.b("</label>");t.b("<input type=\"text\" class=\"ColorPicker-hexInput\" aria-labelledby=\"js-userColorButton\" placeholder=\"\" maxlength=\"6\">");t.b("</div>");t.b("</div>");t.b("</fieldset>");t.b("</div>\n");return t.fl(); },partials: {}, subs: {  }});
Templates['highline/components/iframe_async_media_upload'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"IframeAsyncMediaUpload u-hidden\">\n  <iframe name=\"IframeAsyncMediaUpload-iframe--");t.b(t.v(t.f("upload_id",c,p,0)));t.b("\" src=\"about:blank;\"></iframe>\n  <form method=\"post\" action=\"");t.b(t.v(t.f("form_action",c,p,0)));t.b("\" target=\"IframeAsyncMediaUpload-iframe--");t.b(t.v(t.f("upload_id",c,p,0)));t.b("\" ");if(!t.s(t.f("media_data",c,p,1),c,p,1,0,0,"")){t.b("enctype=\"multipart/form-data\"");};t.b(">\n    <input type=\"hidden\" name=\"authenticity_token\" value=\"");t.b(t.v(t.f("auth_token",c,p,0)));t.b("\">\n    <input type=\"hidden\" name=\"origin\" value=\"");t.b(t.v(t.f("origin",c,p,0)));t.b("\">\n    <input type=\"hidden\" name=\"upload_id\" value=\"");t.b(t.v(t.f("upload_id",c,p,0)));t.b("\">\n");if(t.s(t.f("media_data",c,p,1),c,p,0,517,586,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <input type=\"hidden\" name=\"media\" value=\"");t.b(t.v(t.f("media_data",c,p,0)));t.b("\">\n");});c.pop();}t.b("  </form>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/prompts/above_timeline_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--aboveTimeline\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\">\n  <div class=\"PromptbirdPrompt-content ");t.b(t.v(t.f("prompt_css_class",c,p,0)));t.b(" ");if(t.s(t.f("background_image_url",c,p,1),c,p,0,179,189,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("with-image");});c.pop();}t.b("\"\n    ");if(t.s(t.f("data_attributes",c,p,1),c,p,0,240,260,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" ");t.b(t.v(t.f("key",c,p,0)));t.b("=\"");t.b(t.v(t.f("value",c,p,0)));t.b("\"");});c.pop();}t.b("\n" + i);t.b("    ");if(t.s(t.f("background_image_url",c,p,1),c,p,0,310,367,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(" style=\"background-image: url(");t.b(t.v(t.f("background_image_url",c,p,0)));t.b(");\"");});c.pop();}t.b(">\n\n");t.b(t.rp("<promptbird/templates/dismiss_button0",c,p,"    "));t.b(t.rp("<promptbird/templates/title1",c,p,"    "));t.b(t.rp("<promptbird/templates/explanation2",c,p,"    "));t.b(t.rp("<promptbird/templates/call_to_action3",c,p,"    "));t.b("  </div>\n</div>");return t.fl(); },partials: {"<promptbird/templates/dismiss_button0":{name:"promptbird/templates/dismiss_button", partials: {}, subs: {  }},"<promptbird/templates/title1":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation2":{name:"promptbird/templates/explanation", partials: {}, subs: {  }},"<promptbird/templates/call_to_action3":{name:"promptbird/templates/call_to_action", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/account_health_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--");if(t.s(t.f("is_modal",c,p,1),c,p,0,60,65,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("modal");});c.pop();}if(t.s(t.f("is_above_timeline",c,p,1),c,p,0,100,113,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("aboveTimeline");});c.pop();}t.b(" ");t.b(t.v(t.f("health_prompt_custom_class",c,p,0)));t.b("\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\">\n");if(t.s(t.f("is_above_timeline",c,p,1),c,p,0,224,272,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<promptbird/templates/dismiss_button0",c,p,"    "));});c.pop();}if(t.s(t.f("is_modal",c,p,1),c,p,0,310,348,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<promptbird/templates/icon1",c,p,"    "));});c.pop();}t.b(t.rp("<promptbird/templates/title2",c,p,"  "));t.b(t.rp("<promptbird/templates/explanation3",c,p,"  "));t.b(t.rp("<promptbird/templates/call_to_action4",c,p,"  "));t.b(t.rp("<promptbird/templates/second_call_to_action5",c,p,"  "));t.b("</div>");return t.fl(); },partials: {"<promptbird/templates/dismiss_button0":{name:"promptbird/templates/dismiss_button", partials: {}, subs: {  }},"<promptbird/templates/icon1":{name:"promptbird/templates/icon", partials: {}, subs: {  }},"<promptbird/templates/title2":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation3":{name:"promptbird/templates/explanation", partials: {}, subs: {  }},"<promptbird/templates/call_to_action4":{name:"promptbird/templates/call_to_action", partials: {}, subs: {  }},"<promptbird/templates/second_call_to_action5":{name:"promptbird/templates/second_call_to_action", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/dashboard_profile_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--dashboardProfile\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\">\n  <span class=\"PromptbirdPrompt-arrow\"></span>\n");t.b(t.rp("<promptbird/templates/dismiss_button0",c,p,"  "));t.b(t.rp("<promptbird/templates/title1",c,p,"  "));t.b("  <p class=\"PromptbirdPrompt-explanation\">\n    <a class=\"js-promptAction\" href=\"");t.b(t.v(t.f("call_to_action_url",c,p,0)));t.b("\" target=\"_blank\">\n      ");t.b(t.v(t.f("call_to_action_text",c,p,0)));t.b("\n" + i);t.b("    </a>\n    ");t.b(t.v(t.f("explanation",c,p,0)));t.b("\n" + i);t.b("    <button type=\"button\" class=\"btn-link js-previewAccount\">");t.b(t.v(t.f("preview_text",c,p,0)));t.b("</button>\n  </p>\n</div>\n");return t.fl(); },partials: {"<promptbird/templates/dismiss_button0":{name:"promptbird/templates/dismiss_button", partials: {}, subs: {  }},"<promptbird/templates/title1":{name:"promptbird/templates/title", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/default_layout'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"js-prompt-layout-container\">\n  <div class=\"js-prompt-layout-content\"></div>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/prompts/grid_timeline_layout'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"Grid js-prompt-layout-container\" data-component-context=\"prompt\" role=\"presentation\">\n  <div class=\"Grid-cell\" role=\"presentation\">\n    <div class=\"PromptbirdPrompt-streamItem StreamItem js-stream-item js-prompt-layout-content separated-module\" data-item-type=\"prompt\" data-item-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\" role=\"listitem\"></div>\n  </div>\n</div>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/prompts/inline_pointer_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--inlinePointer\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\" data-prompt-intent=\"");t.b(t.v(t.f("prompt_intent",c,p,0)));t.b("\">\n  <span class=\"PromptbirdPrompt-arrow\"></span>\n");t.b(t.rp("<promptbird/templates/dismiss_button0",c,p,"  "));t.b(t.rp("<promptbird/templates/icon1",c,p,"  "));t.b(t.rp("<promptbird/templates/title2",c,p,"  "));t.b(t.rp("<promptbird/templates/explanation3",c,p,"  "));t.b("</div>\n");return t.fl(); },partials: {"<promptbird/templates/dismiss_button0":{name:"promptbird/templates/dismiss_button", partials: {}, subs: {  }},"<promptbird/templates/icon1":{name:"promptbird/templates/icon", partials: {}, subs: {  }},"<promptbird/templates/title2":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation3":{name:"promptbird/templates/explanation", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/inline_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--inline\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\" data-prompt-intent=\"");t.b(t.v(t.f("prompt_intent",c,p,0)));t.b("\" data-prompt-intent-params=\"");t.b(t.v(t.f("prompt_intent_params",c,p,0)));t.b("\">\n");t.b(t.rp("<promptbird/templates/dismiss_button0",c,p,"  "));t.b(t.rp("<promptbird/templates/icon1",c,p,"  "));t.b(t.rp("<promptbird/templates/title2",c,p,"  "));t.b(t.rp("<promptbird/templates/explanation3",c,p,"  "));t.b(t.rp("<promptbird/templates/call_to_action4",c,p,"  "));t.b("</div>\n");return t.fl(); },partials: {"<promptbird/templates/dismiss_button0":{name:"promptbird/templates/dismiss_button", partials: {}, subs: {  }},"<promptbird/templates/icon1":{name:"promptbird/templates/icon", partials: {}, subs: {  }},"<promptbird/templates/title2":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation3":{name:"promptbird/templates/explanation", partials: {}, subs: {  }},"<promptbird/templates/call_to_action4":{name:"promptbird/templates/call_to_action", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/list_timeline_layout'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<li class=\"PromptbirdPrompt-streamItem js-stream-item js-prompt-layout-container separated-module\" data-item-type=\"prompt\" data-item-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\">\n  <div class=\"js-prompt-layout-content\"></div>\n</li>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/prompts/make_disco_modal_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--modal\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\">\n  <div id=\"make-disco-dialog-content\">\n    <img src=\"");t.b(t.v(t.f("redisco_cover_img",c,p,0)));t.b("\" alt=\"Hilf Deinen Freunden, Dich zu finden.\" class=\"PromptbirdPrompt-redisco-cover\">\n");t.b(t.rp("<promptbird/templates/title0",c,p,"    "));t.b(t.rp("<promptbird/templates/explanation1",c,p,"    "));t.b("    <div class=\"PromptbirdPrompt-action\">\n      <button type=\"button\" class=\"btn primary-btn js-close js-promptMakeDiscoAction js-promptAction\">\n        ");t.b(t.v(t.f("call_to_action_text",c,p,0)));t.b("\n" + i);t.b("      </button>\n    </div>\n    <div class=\"PromptbirdPrompt-action\">\n      <button type=\"button\" class=\"btn-link js-promptMakeDiscoDontConnect\">\n        ");t.b(t.v(t.f("second_call_to_action_text",c,p,0)));t.b("\n" + i);t.b("      </button>\n    </div>\n  </div>\n  <div id=\"make-disco-confirmation-content\" class=\"u-hidden\">\n    <img src=\"");t.b(t.v(t.f("redisco_cover_img",c,p,0)));t.b("\" alt=\"Hilf Deinen Freunden, Dich zu finden.\" class=\"PromptbirdPrompt-redisco-cover\">\n");if(t.s(t.f("confirmation_content",c,p,1),c,p,0,933,1020,"{{ }}")){t.rs(c,p,function(c,p,t){t.b(t.rp("<promptbird/templates/title2",c,p,"      "));t.b(t.rp("<promptbird/templates/explanation3",c,p,"      "));});c.pop();}t.b("    <div class=\"PromptbirdPrompt-action\">\n      <button type=\"button\" class=\"btn-link js-close js-promptMakeDiscoConfirmationYes js-promptDismiss\">\n        Ja\n      </button>\n    </div>\n    <div class=\"PromptbirdPrompt-action\">\n      <button type=\"button\" class=\"btn primary-btn js-promptMakeDiscoConfirmationCancel\">\n        Nein, Abbrechen\n      </button>\n    </div>\n  </div>\n</div>\n");return t.fl(); },partials: {"<promptbird/templates/title0":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation1":{name:"promptbird/templates/explanation", partials: {}, subs: {  }},"<promptbird/templates/title2":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation3":{name:"promptbird/templates/explanation", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/prompts/modal_prompt'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<div class=\"PromptbirdPrompt PromptbirdPrompt--modal\" data-prompt-id=\"");t.b(t.v(t.f("prompt_id",c,p,0)));t.b("\" data-prompt-intent=\"");t.b(t.v(t.f("prompt_intent",c,p,0)));t.b("\">\n");t.b(t.rp("<promptbird/templates/icon0",c,p,"  "));t.b(t.rp("<promptbird/templates/title1",c,p,"  "));t.b(t.rp("<promptbird/templates/explanation2",c,p,"  "));t.b(t.rp("<promptbird/templates/call_to_action3",c,p,"  "));t.b("</div>\n");return t.fl(); },partials: {"<promptbird/templates/icon0":{name:"promptbird/templates/icon", partials: {}, subs: {  }},"<promptbird/templates/title1":{name:"promptbird/templates/title", partials: {}, subs: {  }},"<promptbird/templates/explanation2":{name:"promptbird/templates/explanation", partials: {}, subs: {  }},"<promptbird/templates/call_to_action3":{name:"promptbird/templates/call_to_action", partials: {}, subs: {  }}}, subs: {  }});
Templates['promptbird/templates/call_to_action'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("call_to_action_text",c,p,1),c,p,0,96,540,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <div class=\"PromptbirdPrompt-action\">\n");if(t.s(t.f("call_to_action_url",c,p,1),c,p,0,164,292,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <a href=\"");t.b(t.v(t.f("call_to_action_url",c,p,0)));t.b("\" class=\"btn primary-btn js-promptAction\">\n        ");t.b(t.v(t.f("call_to_action_text",c,p,0)));t.b("\n" + i);t.b("      </a>\n");});c.pop();}if(!t.s(t.f("call_to_action_url",c,p,1),c,p,1,0,0,"")){t.b("      <button type=\"button\" class=\"btn primary-btn js-promptAction ");if(t.s(t.f("sticky_cta",c,p,1),c,p,0,426,437,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("js-isSticky");});c.pop();}t.b("\">\n        ");t.b(t.v(t.f("call_to_action_text",c,p,0)));t.b("\n" + i);t.b("      </button>\n");};t.b("  </div>\n");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/templates/dismiss_button'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<button type=\"button\" class=\"PromptbirdPrompt-dismiss js-promptDismiss\" tabindex=\"-1\">\n  <span class=\"Icon Icon--close Icon--smallest\">\n    <span class=\"visuallyhidden\">\n      Verwerfen\n    </span>\n  </span>\n</button>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/templates/explanation'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<p class=\"PromptbirdPrompt-explanation\">");t.b(t.v(t.f("explanation",c,p,0)));t.b("</p>");return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/templates/icon'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("icon_class",c,p,1),c,p,0,15,99,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <span class=\"PromptbirdPrompt-icon Icon Icon--extraLarge ");t.b(t.v(t.f("icon_class",c,p,0)));t.b("\"></span>\n");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/templates/second_call_to_action'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");if(t.s(t.f("second_call_to_action_text",c,p,1),c,p,0,247,603,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("  <div class=\"PromptbirdPrompt-action\">\n");if(t.s(t.f("second_call_to_action_url",c,p,1),c,p,0,322,563,"{{ }}")){t.rs(c,p,function(c,p,t){t.b("      <a href=\"");t.b(t.v(t.f("second_call_to_action_url",c,p,0)));t.b("\" class=\"btn-link js-promptAction ");t.b(t.v(t.f("custom_js_class",c,p,0)));t.b("\" data-scribe-component=\"");t.b(t.v(t.f("scribe_component",c,p,0)));t.b("\" data-scribe-element=\"");t.b(t.v(t.f("scribe_element",c,p,0)));t.b("\">\n        ");t.b(t.v(t.f("second_call_to_action_text",c,p,0)));t.b("\n" + i);t.b("      </a>\n");});c.pop();}t.b("  </div>\n");});c.pop();}return t.fl(); },partials: {}, subs: {  }});
Templates['promptbird/templates/title'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("<h3 class=\"PromptbirdPrompt-title\">");t.b(t.v(t.f("title",c,p,0)));t.b("</h3>");return t.fl(); },partials: {}, subs: {  }});
module.exports = Templates; });define("lib/twitter_cldr",["module","require","exports"],function(a,b,c){(function(){var a,b,d,e;a={},a.is_rtl=!1,a.Utilities=function(){function a(){}return a.from_char_code=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10),56320+(a&1023
))):String.fromCharCode(a)},a.char_code_at=function(a,b){var c,d,e,f,g,h;a+="",d=a.length,h=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;while(h.exec(a)!==null){f=h.lastIndex;if(!(f-2<b))break;b+=1}return b>=d||b<0?NaN:(c=a.charCodeAt(b),55296<=c&&c<=56319?(e=c,g=a.charCodeAt
(b+1),(e-55296)*1024+(g-56320)+65536):c)},a.unpack_string=function(a){var b,c,d,e,f;d=[];for(c=e=0,f=a.length;0<=f?e<f:e>f;c=0<=f?++e:--e){b=this.char_code_at(a,c);if(!b)break;d.push(b)}return d},a.pack_array=function(a){var b;return function(){var c,d,e;e=
[];for(c=0,d=a.length;c<d;c++)b=a[c],e.push(this.from_char_code(b));return e}.call(this).join("")},a.arraycopy=function(a,b,c,d,e){var f,g,h,i,j;j=a.slice(b,b+e);for(f=h=0,i=j.length;h<i;f=++h)g=j[f],c[d+f]=g},a.max=function(a){var b,c,d,e,f,g,h,i;d=null;for(
e=f=0,h=a.length;f<h;e=++f){b=a[e];if(b!=null){d=b;break}}for(c=g=e,i=a.length;e<=i?g<=i:g>=i;c=e<=i?++g:--g)a[c]>d&&(d=a[c]);return d},a.min=function(a){var b,c,d,e,f,g,h,i;d=null;for(e=f=0,h=a.length;f<h;e=++f){b=a[e];if(b!=null){d=b;break}}for(c=g=e,i=a
.length;e<=i?g<=i:g>=i;c=e<=i?++g:--g)a[c]<d&&(d=a[c]);return d},a.is_even=function(a){return a%2===0},a.is_odd=function(a){return a%2===1},a}(),a.PluralRules=function(){function a(){}return a.rules={keys:["one","other"],rule:function(a){return function(){
return a==1?"one":"other"}()}},a.all=function(){return this.rules.keys},a.rule_for=function(a){var b;try{return this.rules.rule(a)}catch(c){return b=c,"other"}},a}(),a.TimespanFormatter=function(){function b(){this.approximate_multiplier=.75,this.default_type="default"
,this.tokens={ago:{second:{"default":{one:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Sekunde",type:"plaintext"}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Sekunden",type:"plaintext"}]}}
,minute:{"default":{one:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Minute",type:"plaintext"}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Minuten",type:"plaintext"}]}},hour:{"default":{one
:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Stunde",type:"plaintext"}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Stunden",type:"plaintext"}]}},day:{"default":{one:[{value:"Vor ",type:"plaintext"
},{value:"{0}",type:"placeholder"},{value:" Tag",type:"plaintext"}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Tagen",type:"plaintext"}]}},week:{"default":{one:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"
},{value:" Woche",type:"plaintext"}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Wochen",type:"plaintext"}]}},month:{"default":{one:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Monat",type:"plaintext"
}],other:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Monaten",type:"plaintext"}]}},year:{"default":{one:[{value:"Vor ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Jahr",type:"plaintext"}],other:[{value:"Vor ",
type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Jahren",type:"plaintext"}]}}},until:{second:{"default":{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Sekunde",type:"plaintext"}],other:[{value:"In ",type:"plaintext"
},{value:"{0}",type:"placeholder"},{value:" Sekunden",type:"plaintext"}]}},minute:{"default":{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Minute",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"
},{value:" Minuten",type:"plaintext"}]}},hour:{"default":{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Stunde",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Stunden",type
:"plaintext"}]}},day:{"default":{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Tag",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Tagen",type:"plaintext"}]}},week:{"default"
:{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Woche",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Wochen",type:"plaintext"}]}},month:{"default":{one:[{value:"In ",type:"plaintext"
},{value:"{0}",type:"placeholder"},{value:" Monat",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Monaten",type:"plaintext"}]}},year:{"default":{one:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"
},{value:" Jahr",type:"plaintext"}],other:[{value:"In ",type:"plaintext"},{value:"{0}",type:"placeholder"},{value:" Jahren",type:"plaintext"}]}}},none:{second:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Sekunde",type:"plaintext"}],other:[{value
:"{0}",type:"placeholder"},{value:" Sekunden",type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"},{value:" Sek.",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Sek.",type:"plaintext"}]},abbreviated:{one:[{value:"{0}",type
:"placeholder"},{value:"s",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:"s",type:"plaintext"}]}},minute:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Minute",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value
:" Minuten",type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"},{value:" Min.",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Min.",type:"plaintext"}]},abbreviated:{one:[{value:"{0}",type:"placeholder"},{value:"m",type:"plaintext"
}],other:[{value:"{0}",type:"placeholder"},{value:"m",type:"plaintext"}]}},hour:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Stunde",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Stunden",type:"plaintext"}]},"short":{one
:[{value:"{0}",type:"placeholder"},{value:" Std.",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Std.",type:"plaintext"}]},abbreviated:{one:[{value:"{0}",type:"placeholder"},{value:"h",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"
},{value:"h",type:"plaintext"}]}},day:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Tag",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Tage",type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"},{value:" Tag"
,type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Tage",type:"plaintext"}]},abbreviated:{one:[{value:"{0}",type:"placeholder"},{value:"d",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:"d",type:"plaintext"}]}},week:{"default"
:{one:[{value:"{0}",type:"placeholder"},{value:" Woche",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Wochen",type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"},{value:" Woche",type:"plaintext"}],other:[{value:"{0}",type
:"placeholder"},{value:" Wochen",type:"plaintext"}]}},month:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Monat",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Monate",type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"
},{value:" Monat",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Monate",type:"plaintext"}]}},year:{"default":{one:[{value:"{0}",type:"placeholder"},{value:" Jahr",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Jahre"
,type:"plaintext"}]},"short":{one:[{value:"{0}",type:"placeholder"},{value:" Jahr",type:"plaintext"}],other:[{value:"{0}",type:"placeholder"},{value:" Jahre",type:"plaintext"}]}}}},this.time_in_seconds={second:1,minute:60,hour:3600,day:86400,week:604800,month
:2629743.83,year:31556926}}return b.prototype.format=function(b,c){var d,e,f,g,h,i;c==null&&(c={}),g={};for(d in c)f=c[d],g[d]=f;g.direction||(g.direction=b<0?"ago":"until");if(g.unit===null||g.unit===void 0)g.unit=this.calculate_unit(Math.abs(b),g);return g
.type||(g.type=this.default_type),g.number=this.calculate_time(Math.abs(b),g.unit),e=this.calculate_time(Math.abs(b),g.unit),g.rule=a.PluralRules.rule_for(e),h=function(){var a,b,c,d;c=this.tokens[g.direction][g.unit][g.type][g.rule],d=[];for(a=0,b=c.length
;a<b;a++)i=c[a],d.push(i.value);return d}.call(this),h.join("").replace(/\{[0-9]\}/,e.toString())},b.prototype.calculate_unit=function(a,b){var c,d,e,f;b==null&&(b={}),f={};for(c in b)e=b[c],f[c]=e;return f.approximate==null&&(f.approximate=!1),d=f.approximate?
this.approximate_multiplier:1,a<this.time_in_seconds.minute*d?"second":a<this.time_in_seconds.hour*d?"minute":a<this.time_in_seconds.day*d?"hour":a<this.time_in_seconds.week*d?"day":a<this.time_in_seconds.month*d?"week":a<this.time_in_seconds.year*d?"month"
:"year"},b.prototype.calculate_time=function(a,b){return Math.round(a/this.time_in_seconds[b])},b}(),e=typeof c!="undefined"&&c!==null?c:(this.TwitterCldr={},this.TwitterCldr);for(b in a)d=a[b],e[b]=d}).call(this)})