/*!CK:1093586465!*//*1459381587,*/

if (self.CavalryLogger) { CavalryLogger.start_js(["RO6CV"]); }

__d('ReactComposerMemePickerActionType',['keyMirror'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();f.exports=c('keyMirror')({SET_MEME_WAS_SELECTED:null,SET_SHOULD_SHOW_MEME_PICKER_DIALOG:null});},null);
__d('ReactComposerMemePickerLogger',['FunnelLogger'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='WWW_MEME_PICKER_DIALOG_FUNNEL',i='meme_prompt_clicked',j='meme_picker_opened',k='meme_selected',l='meme_posted',m='spanish',n=false,o={_log:function(p){if(!n){n=true;c('FunnelLogger').startFunnel(h);c('FunnelLogger').addFunnelTag(h,m);}c('FunnelLogger').appendAction(h,p);},logMemePromptClicked:function(){this._log(i);},logMemePickerOpened:function(){this._log(j);},logMemeSelected:function(){this._log(k);},logMemePosted:function(){this._log(l);}};f.exports=o;},null);
__d('ReactComposerMemePickerLoggingStore',['ReactComposerActionTypes','ReactComposerMemePickerActionType','ReactComposerMemePickerLogger','ReactComposerStoreBase'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('ReactComposerStoreBase'));i=h&&h.prototype;function j(){'use strict';var k;i.constructor.call(this,function(){return {memeWasSelected:false};},function(l){switch(l.type){case c('ReactComposerMemePickerActionType').SET_MEME_WAS_SELECTED:k&&k.$ReactComposerMemePickerLoggingStore1(l);break;case c('ReactComposerActionTypes').POST_STARTED:k&&k.$ReactComposerMemePickerLoggingStore2(l);break;}});k=this;}j.prototype.memeWasSelected=function(k){'use strict';return this.getComposerData(k).memeWasSelected;};j.prototype.$ReactComposerMemePickerLoggingStore1=function(k){'use strict';var l=this.validateAction(k,['composerID','memeWasSelected']),m=l[0],n=l[1],o=this.getComposerData(m);o.memeWasSelected=n;if(n)c('ReactComposerMemePickerLogger').logMemeSelected();};j.prototype.$ReactComposerMemePickerLoggingStore2=function(k){'use strict';var l=this.validateAction(k,'composerID');if(this.memeWasSelected(l))c('ReactComposerMemePickerLogger').logMemePosted();};f.exports=new j();},null);
__d('ReactComposerMemePickerStore',['ReactComposerMemePickerActionType','ReactComposerStoreBase'],function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('ReactComposerStoreBase'));i=h&&h.prototype;function j(){'use strict';var k;i.constructor.call(this,function(){return {shouldShowMemePickerDialog:false};},function(l){switch(l.type){case c('ReactComposerMemePickerActionType').SET_SHOULD_SHOW_MEME_PICKER_DIALOG:k&&k.$ReactComposerMemePickerStore1(l);break;}});k=this;}j.prototype.shouldShowMemePickerDialog=function(k){'use strict';return this.getComposerData(k).shouldShowMemePickerDialog;};j.prototype.$ReactComposerMemePickerStore1=function(k){'use strict';var l=this.validateAction(k,['composerID','shouldShowMemePickerDialog']),m=l[0],n=l[1],o=this.getComposerData(m);o.shouldShowMemePickerDialog=n;this.emitChange(m);};f.exports=new j();},null);
__d('ReactComposerMemePickerActions',['ReactComposerMemePickerActionType','ReactComposerDispatcher','ReactComposerMemePickerStore','ReactComposerMemePickerLoggingStore'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();c('ReactComposerMemePickerStore');c('ReactComposerMemePickerLoggingStore');h.prototype.setMemeWasSelected=function(i,j){'use strict';c('ReactComposerDispatcher').dispatch({composerID:i,type:c('ReactComposerMemePickerActionType').SET_MEME_WAS_SELECTED,memeWasSelected:j});};h.prototype.setShouldShowMemePickerDialog=function(i,j){'use strict';c('ReactComposerDispatcher').dispatch({composerID:i,type:c('ReactComposerMemePickerActionType').SET_SHOULD_SHOW_MEME_PICKER_DIALOG,shouldShowMemePickerDialog:j});};function h(){'use strict';}f.exports=new h();},null);
__d('ReactComposerMemePickerDialog.react',['cx','fbt','AccessibleLayer','Grid.react','Image.react','LayerFadeOnHide','LayerHideOnEscape','ReactComponentWithPureRenderMixin','React','XUIDialog.react','XUIDialogBody.react','XUIDialogTitle.react'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('Grid.react').GridItem,k=c('React').PropTypes,l=640,m=304,n=c('React').createClass({displayName:'ReactComposerMemePickerDialog',mixins:[c('ReactComponentWithPureRenderMixin')],propTypes:{memeURLs:k.arrayOf(k.string).isRequired,onMemeSelected:k.func.isRequired,onToggle:k.func.isRequired,shown:k.bool.isRequired},render:function(){var o=this.props.memeURLs.map(function(p,q){return (c('React').createElement(j,{key:q},c('React').createElement(c('Image.react'),{className:"_3ih0",onClick:function(r){return this.props.onMemeSelected(r);}.bind(this),src:p,width:m})));}.bind(this));return (c('React').createElement(c('XUIDialog.react'),{behaviors:{AccessibleLayer:c('AccessibleLayer'),LayerFadeOnHide:c('LayerFadeOnHide'),LayerHideOnEscape:c('LayerHideOnEscape')},fixedTopPosition:100,onToggle:function(p){return this.props.onToggle(p);}.bind(this),shown:this.props.shown,width:l},c('React').createElement(c('XUIDialogTitle.react'),null,c('React').createElement('span',null,i._("Pick a Meme"))),c('React').createElement(c('XUIDialogBody.react'),null,c('React').createElement(c('Grid.react'),{cols:2,spacing:"_2phz"},o))));}});f.exports=n;},null);
__d('ReactComposerMemePickerDialogContainer.react',['invariant','ReactComposerAttachmentActions','ReactComposerAttachmentType','ReactComposerContextMixin','ReactComposerMemePickerDialog.react','ReactComposerMemePickerActions','ReactComposerMemePickerLogger','ReactComposerMemePickerStore','ReactComposerPropsAndStoreBasedStateMixin','ReactComposerScrapedAttachmentActions','ReactComposerStatusUtils','ReactComponentWithPureRenderMixin','React'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'ReactComposerMemePickerDialogContainer',mixins:[c('ReactComposerContextMixin'),c('ReactComposerPropsAndStoreBasedStateMixin')(c('ReactComposerMemePickerStore')),c('ReactComponentWithPureRenderMixin')],propTypes:{memeURLs:i.arrayOf(i.string).isRequired},statics:{calculateState:function(k){return {shown:c('ReactComposerMemePickerStore').shouldShowMemePickerDialog(k)};}},componentDidMount:function(){if(this.state.shown)c('ReactComposerMemePickerLogger').logMemePickerOpened();},componentDidUpdate:function(k,l){if(!l.shown&&this.state.shown)c('ReactComposerMemePickerLogger').logMemePickerOpened();},render:function(){return (c('React').createElement(c('ReactComposerMemePickerDialog.react'),{memeURLs:this.props.memeURLs,onMemeSelected:this._onMemeSelected,onToggle:this._onToggle,shown:this.state.shown}));},_onMemeSelected:function(k){c('ReactComposerMemePickerActions').setShouldShowMemePickerDialog(this.context.composerID,false);c('ReactComposerAttachmentActions').selectAttachment(this.context.composerID,c('ReactComposerAttachmentType').STATUS,true);c('ReactComposerScrapedAttachmentActions').setScrapedAttachment(this.context.composerID,null,{});!(k.target.src!=null)?h(0):void 0;c('ReactComposerStatusUtils').scrapeLink(this.context.composerID,this.context.targetID,k.target.src,this.context.composerType,this.context.actorID);c('ReactComposerMemePickerActions').setMemeWasSelected(this.context.composerID,true);},_onToggle:function(k){c('ReactComposerMemePickerActions').setShouldShowMemePickerDialog(this.context.composerID,k);}});f.exports=j;},null);