text: /*!CK:2563853765!*//*1442197952,*/
  
  if (self.CavalryLogger) { CavalryLogger.start_js(["Bo\/YG"]); }
  
  __d('MercuryAudioPlayer',['Event','Arbiter','DOM','Flash','UserAgent_DEPRECATED'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m=200;function n(){if(l.webkit()&&!l.chrome())return false;var w=j.create('audio'),x=false;try{if(!!w.canPlayType)if(w.canPlayType('video/mp4;').replace(/^no$/,''))x=true;}finally{return x;}}function o(){return k.isAvailable();}var p=function(){this.interval=null;this.arbiterInstance=null;this.audio=j.create('audio');h.listen(this.audio,'playing',(function(){this.informAttachment('playing',this.audio.currentTime);this.interval=setInterval((function(){this.informAttachment('playing',this.audio.currentTime);}).bind(this),m);}).bind(this));h.listen(this.audio,'ended',(function(){clearInterval(this.interval);this.informAttachment('finished');}).bind(this));};Object.assign(p.prototype,{setAudio:function(w,x){this.audio.setAttribute('src',w);this.arbiterInstance=x;},informAttachment:function(w,x){if(this.arbiterInstance)this.arbiterInstance.inform(w,x);},play:function(){this.audio.play();this.informAttachment('played');},resume:function(){this.audio.play();this.informAttachment('played');},pause:function(){this.audio.pause();clearInterval(this.interval);this.informAttachment('paused');},getType:function(){return 'html5';}});var q=function(){this.src=null;this.arbiterInstance=null;var w=j.create('div');document.body.appendChild(w);this.swf=k.embed('/swf/SoundStreamPlayer.swf',w,null,{});this.interval=null;i.subscribe('soundstream/finished',(function(){clearInterval(this.interval);this.informAttachment('finished');}).bind(this));};Object.assign(q.prototype,{setAudio:function(w,x){this.src=w;this.arbiterInstance=x;},informAttachment:function(w,x){if(this.arbiterInstance)this.arbiterInstance.inform(w,x);},play:function(){this.swf.playSound(this.src);this.interval=setInterval((function(){var w=this.swf.getCurrentTime();this.informAttachment('playing',w);}).bind(this),m);this.informAttachment('played');},resume:function(){this.swf.resume();this.informAttachment('played');},pause:function(){clearInterval(this.interval);this.swf.pause();this.informAttachment('paused');},getType:function(){return 'flash';}});function r(){if(n()){return new p();}else if(o())return new q();return false;}var s=null,t=null,u=0;function v(w,x){this.src=w;this.arbiterInstance=x;this.audio_id=++u;s!==null||(s=r());if(!s)return false;}Object.assign(v.prototype,{getType:function(){if(!s){return false;}else return s.getType();},play:function(w){if(w&&t==this.audio_id){s.resume();}else{this.pause();t=this.audio_id;s.setAudio(this.src,this.arbiterInstance);s.play();}},pause:function(){s.pause();}});f.exports=v;},null);
  __d('MercuryAttachmentAudioClip.react',['Arbiter','ArbiterMixin','MercuryAudioPlayer','CurrentUser','JSLogger','LeftRight.react','MercuryConfig','MercuryShareAttachmentRenderLocations','React','SubscriptionsHandler','cx','fbt','joinClasses','shield'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){if(c.__markCompiled)c.__markCompiled();var v=p.PropTypes,w='MercuryAttachmentAudioClip/play',x=l.create('mercury_audio_clip'),y=p.createClass({displayName:'AudioClip',mixins:[i],propTypes:{duration:v.number,location:v.oneOf(o.getValues()),rootClassName:v.string,showHelp:v.bool,src:v.string.isRequired,width:v.number},getInitialState:function(){this.logged=false;return {time:0,playing:false,started:false,duration:this.props.duration,audioPlayer:new j(this.props.src,this)};},componentDidMount:function(){this._subscriptionsHandler=new q();this._subscriptionsHandler.addSubscriptions(this.subscribe('playing',this.updateTime),this.subscribe('played',u(this.setState,this,{playing:true,started:true})),this.subscribe('paused',u(this.setState,this,{playing:false})),this.subscribe('finished',u(this.setState,this,{playing:false,started:false,time:this.props.duration})),h.subscribe(w,(function(z,aa){if(this.props.src!=aa)this.setState({time:0});}).bind(this)));},componentWillUnmount:function(){this._subscriptionsHandler&&this._subscriptionsHandler.release();},updateTime:function(z,aa){this.setState({time:aa});},play:function(){if(this.state.playing){this.state.audioPlayer.pause();}else{this.state.audioPlayer.play(this.state.started);h.inform(w,this.props.src);if(!this.logged){this.logged=true;x.log('play',{uid:k.getID(),duration:this.props.duration});}}},_formatSeconds:function(z){if(z){z=Math.ceil(z);var aa=z%60;if(aa<10)aa='0'+aa;var ba=Math.floor(z/60);return ba+':'+aa;}else return null;},_renderPlayer:function(z,aa){return (p.createElement('a',{className:"_1miz"+(' '+"_2e-1")+(n.ChatTabMessengerStyle?' '+"_3_om":''),href:'#',style:{width:z},onClick:this.play},p.createElement('span',{className:"_1mi- _2e-2"},p.createElement('i',{className:"_1mi_ _2e-3"})),p.createElement('span',{className:"_1mj0 _2e-4 _3oh-"},aa),p.createElement('div',{className:"_1mj1 _2e-5"})));},render:function(){var z=this.state.time,aa=this.state.playing,ba=this._formatSeconds(this.state.duration),ca=this.props.location===o.MESSENGER,da=this.props.width||170;if(ca){var ea=this.props.duration;if(ea>10){da=240;}else if(ea>5){da=200;}else if(ea>2){da=160;}else da=120;}var fa=null,ga=Math.ceil(z*(da+2)/this.state.duration);if(ca)ga=Math.ceil(z*(da+24)/this.state.duration);if(this.state.audioPlayer&&this.state.audioPlayer.getType()){var ha=this._renderPlayer(da,ba),ia=this._renderPlayer(da,ba),ja="_1mj2"+(' '+"_2e-6")+(aa&&z!==0?' '+"_1mj3":'')+(aa&&z===0?' '+"_4g4x":'');fa=p.createElement('div',{className:ja},ha,p.createElement('div',{className:"_1mj4 _2e-7",style:{width:ga}},ia));}else fa=p.createElement('div',{className:"_1mj2"},p.createElement('div',{className:"_1miz"},p.createElement(m,null,p.createElement('a',{className:"_1mj5",href:this.props.src},p.createElement('span',{className:"_3qi6"},p.createElement('i',{className:"_1mj6"})),p.createElement('span',{className:"_1mj7"},s._("Voice Message")),p.createElement('span',{className:"_1mj8"},ba)),p.createElement('a',{href:this.props.src,className:"_1mj9"},p.createElement('i',{className:"_1mja"})))));return (p.createElement('div',{className:t("_1mjb"+(ca?' '+"_454y":''),this.props.rootClassName)},fa));}});f.exports=y;},null);
  __d("MercuryAttachmentConstants",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={SIDE_LENGTH:9};f.exports=h;},null);
  __d('MercuryAttachmentFile.react',['Image.react','LeftRight.react','Link.react','MercuryAttachment','ReactComponentWithPureRenderMixin','React','ix','cx','joinClasses','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();'use strict';var r=m.PropTypes,s=m.createClass({displayName:'MercuryAttachmentFile',propTypes:{name:r.string.isRequired,open_url:r.string,rel:r.string,type:r.string.isRequired,url:r.string},mixins:[l],_renderFileLinks:function(){if(this.props.open_url)return (m.createElement('div',{className:"_59gs"},m.createElement(j,{target:'_blank',href:this.props.open_url},q._("open")),' ','·',' ',m.createElement(j,{href:this.props.url},q._("download"))));return m.createElement('div',null);},render:function(){var t=p(k.getAttachIconClass(this.props.type),"_59go _59gq");if(this.props.url)return (m.createElement(i,{className:t},m.createElement(j,{href:this.props.url},m.createElement(i,null,m.createElement(h,{src:n('/images/messaging/docs/generic.png')}),m.createElement('span',{className:"_59gp"},this.props.name))),this._renderFileLinks()));return (m.createElement(i,{className:t},m.createElement(h,{src:n('/images/messaging/docs/generic.png')}),m.createElement('span',{className:"_59gp"},this.props.name)));}});f.exports=s;},null);
  __d('MercuryAttachmentMalicious.react',['XUINotice.react','XUIText.react','React','fbt'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();'use strict';var l=j.createClass({displayName:'MercuryAttachmentMalicious',render:function(){return (j.createElement(h,{use:'warn'},j.createElement(i,{size:'small'},k._("This attachment has been marked as malicious."))));}});f.exports=l;},null);
  __d('ChatImageArrowDirection',['keyMirror'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();'use strict';var i=h({BOTH:null,LEFT:null,RIGHT:null});f.exports=i;},null);
  __d('ChatImageWithArrow.react',['BackgroundImage.react','ChatImageArrowDirection','Link.react','MercuryAttachmentConstants','MercuryConfig','React','XUISpinner.react','cx','getVendorPrefixedName','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();'use strict';var r=m.PropTypes,s=30,t=15,u=m.createClass({displayName:'ChatImageWithArrow',propTypes:{arrowDirection:r.oneOf(Object.keys(i)),onClick:r.func,height:r.number.isRequired,isLoading:r.bool,rootClassName:r.string,sideLength:r.number,source:r.string,width:r.number.isRequired},getDefaultProps:function(){return {sideLength:k.SIDE_LENGTH,isLoading:false};},render:function(){this._arrowWidth=Math.floor(this.props.sideLength/Math.sqrt(2));this._extendedPhotoWidth=Math.ceil(this._getWidth()+this._arrowWidth);if(this.props.isLoading)return this._renderUploadingBubble();var v=q("_4yp6"+(this.props.arrowDirection!==i.BOTH&&!l.ChatTabMessengerStyle?' '+"_2nlo":''),this.props.rootClassName),w,x;switch(this.props.arrowDirection){case i.BOTH:w=[this._renderArrowWithBorder(i.LEFT),this._renderArrowWithBorder(i.RIGHT)];x=[this._renderArrowWithNoBorder(i.LEFT),this._renderArrowWithNoBorder(i.RIGHT)];break;case i.LEFT:case i.RIGHT:w=this._renderArrowWithBorder(this.props.arrowDirection);x=this._renderArrowWithNoBorder(this.props.arrowDirection);break;}return this._renderLink(m.createElement('div',{className:v},l.ChatTabMessengerStyle?null:w,m.createElement('div',{className:"_52kr"+(l.ChatTabMessengerStyle?' '+"_3_om":''),style:{width:this._getWidth(),height:this._getHeight()}},m.createElement('div',{className:"_4yp9",style:{backgroundImage:'url('+this.props.source+')',width:this._extendedPhotoWidth,height:this._getHeight()}})),l.ChatTabMessengerStyle?null:x));},_getWidth:function(){return Math.max(this.props.width,t);},_getHeight:function(){return Math.max(this.props.height,s);},_renderLink:function(v){if(this.props.onClick)return (m.createElement(j,{onClick:this.props.onClick},v));return v;},_calculateArrowTransform:function(v,w,x,y){if(w===i.LEFT){return 'translate('+x+'px, '+y+'px)'+'rotate(45deg)';}else return 'translate('+(v-x)+'px, '+y+'px)'+'rotate(45deg)';},_calculateArrowImageTransform:function(v,w,x,y){if(w===i.LEFT){return 'rotate(-45deg)'+'translate(-'+(this._arrowWidth+x)+'px,'+'-'+y+'px)';}else return 'rotate(-45deg)'+'translate(-'+(v-x)+'px, -'+y+'px)';},_renderUploadingBubble:function(){var v={width:this.props.sideLength,height:this.props.sideLength};if(this.props.source)v.backgroundImage='url('+this.props.source+')';var w={width:this.props.sideLength,height:this.props.sideLength};if(this.props.source)w.opacity=0;var x=p('transform');if(x){v[x]=this._calculateArrowTransform(this._getWidth(),this.props.arrowDirection,0,this.props.sideLength);w[x]=this._calculateArrowTransform(this._getWidth(),this.props.arrowDirection,0,Math.floor(this.props.sideLength-this._getHeight()));}var y={width:this._getWidth(),height:this._getHeight()};if(this.props.source){y.backgroundImage='url('+this.props.source+')';y.backgroundSize='cover';}return (m.createElement('div',{className:"_4yp6"},m.createElement('div',{className:"_4ypa",style:v}),m.createElement('div',{className:"_4ypb",style:y},m.createElement(n,{size:'small'})),m.createElement('div',{className:"_4ype",style:w})));},_renderArrowWithBorder:function(v){var w={width:this.props.sideLength,height:this.props.sideLength},x={},y=p('transform');if(y){w[y]=this._calculateArrowTransform(this._getWidth(),v,0,this.props.sideLength);x[y]=this._calculateArrowImageTransform(this._getWidth(),v,0,this.props.sideLength);return (m.createElement('div',{className:"_4ypf"+(v===i.LEFT?' '+"_2nlp":'')+(v===i.RIGHT?' '+"_2nlq":''),key:'border:'+v,style:w},m.createElement(h,{backgroundSize:'cover',className:"_4ypg",height:this._getHeight(),src:this.props.source,style:x,width:this._extendedPhotoWidth})));}},_renderArrowWithNoBorder:function(v){var w={width:this.props.sideLength,height:this.props.sideLength},x={},y=1,z=p('transform');if(z){w[z]=this._calculateArrowTransform(this._getWidth(),v,y,this.props.sideLength-this._getHeight());x[z]=this._calculateArrowImageTransform(this._getWidth(),v,y,this.props.sideLength);}return (m.createElement('div',{className:"_4yph"+(v===i.LEFT?' '+"_2nlp":'')+(v===i.RIGHT?' '+"_2nlq":''),key:'noBorder:'+v,style:w},m.createElement(h,{backgroundSize:'cover',className:"_4ypg",height:this._getHeight(),src:this.props.source,style:x,width:this._extendedPhotoWidth})));}});f.exports=u;},null);
  __d('MercuryAttachmentPhoto.react',['ChatImageArrowDirection','ChatImageWithArrow.react','MercuryMessageInfo','MessagesViewer','React'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();'use strict';var m=l.PropTypes,n=l.createClass({displayName:'MercuryAttachmentPhoto',propTypes:{height:m.number,image:m.object.isRequired,message:m.object.isRequired,onAttachmentLoad:m.func,width:m.number},componentDidMount:function(){k.preload();this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.props.height);},_handleClickPicture:function(o){var p=this.props.image;k.bootstrapWithConfig({src:p.preview_url,endpoint:p.url,fbid:p.metadata.fbid,dimensions:p.metadata.dimensions,disablePaging:true},null);},render:function(){var o=j.isInbound(this.props.message);return (l.createElement(i,{arrowDirection:o?h.LEFT:h.RIGHT,source:this.props.image.preview_url,height:this.props.height,width:this.props.width,onClick:this._handleClickPicture,isLoading:!!this.props.image.preview_uploading}));}});f.exports=n;},null);
  __d('ChatGridImage.react',['Link.react','React','cx'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();'use strict';var k=i.PropTypes,l=i.createClass({displayName:'ChatGridImage',propTypes:{isLoading:k.bool,onClick:k.func,size:k.number.isRequired,source:k.string},render:function(){if(this.props.isLoading)return (i.createElement('div',{className:"_4ypb",style:{width:this.props.size,height:this.props.size}}));return (i.createElement(h,{onClick:this.props.onClick},i.createElement('div',{className:"_332l",style:{backgroundImage:'url('+this.props.source+')',width:this.props.size,height:this.props.size}})));}});f.exports=l;},null);
  __d('MercuryAttachmentPhotoGrid.react',['ChatGridImage.react','ChatImageArrowDirection','ChatImageWithArrow.react','Grid.react','MercuryAttachmentType','MercuryMessageInfo','MessagesViewer','React','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();'use strict';var q=k.GridItem,r=o.PropTypes,s=o.createClass({displayName:'MercuryAttachmentPhotoGrid',propTypes:{images:r.arrayOf(r.object).isRequired,size:r.number.isRequired,message:r.object.isRequired},componentDidMount:function(){n.preload();},_generateClickHandler:function(t){var u=this.props.images.some(function(v){return v.attach_type===l.ANIMATED_IMAGE;});return (function(v){n.bootstrapWithConfig({src:t.preview_url,endpoint:t.url,fbid:t.metadata.fbid,dimensions:t.metadata.dimensions,disablePaging:u},null);});},render:function(){var t=this.props.images,u=t.length,v=u==2||u==4?2:3,w=Math.floor(this.props.size/v),x=m.isInbound(this.props.message),y=x?0:v-1,z=[];for(var aa=0;aa<t.length;aa++)if(aa===y){z.push(o.createElement(q,{key:aa},o.createElement(j,{arrowDirection:x?i.LEFT:i.RIGHT,source:t[aa].preview_url,height:w,width:w,isLoading:!!t[aa].preview_uploading,onClick:this._generateClickHandler(t[aa])})));}else z.push(o.createElement(q,{key:aa},o.createElement(h,{isLoading:!!t[aa].preview_uploading,onClick:this._generateClickHandler(t[aa]),size:w,source:t[aa].preview_url})));return (o.createElement(k,{cols:v,className:"_5b2w",spacing:"_5b2x",alignh:'right'},z));}});f.exports=s;},null);
  __d('MercuryAttachmentAttribution.react',['Image.react','ImmutableObject','ReactComponentWithPureRenderMixin','React','cx','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();'use strict';var n=k.PropTypes,o=k.createClass({displayName:'MercuryAttachmentAttribution',mixins:[j],propTypes:{attachment:n.instanceOf(i)},render:function(){var p=this._getAttribution();if(!p)return null;return (k.createElement('div',{className:m(this.props.className,"_29ew")},k.createElement(h,{src:p.icon_url,className:"_29ex"}),k.createElement('span',{className:"_29ey"},p.name)));},_getAttribution:function(){return this.props.attachment&&this.props.attachment.app_attribution;}});f.exports=o;},null);
  __d('ChatAttachmentAttribution.react',['ImmutableObject','MercuryAttachmentAttribution.react','MercuryConfig','React','cx'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();'use strict';var m=k.PropTypes,n=k.createClass({displayName:'ChatAttachmentAttribution',propTypes:{attachment:m.instanceOf(h)},render:function(){return (k.createElement(i,{attachment:this.props.attachment,className:"_1ekr"+(j.ChatTabMessengerStyle?' '+"_4i_6":'')}));}});f.exports=n;},null);
  __d('ChatSpeakingSticker.react',['React','ReactDOM','ReactComponentWithPureRenderMixin'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();'use strict';var k=h.PropTypes,l=h.createClass({displayName:'ChatSpeakingSticker',mixins:[j],propTypes:{videoURI:k.string.isRequired,videoSize:k.shape({height:k.number,width:k.number}).isRequired},_handleStickerClick:function(){var m=i.findDOMNode(this.refs.stickerVideo);m.play();},render:function(){return (h.createElement('div',{onClick:this._handleStickerClick},h.createElement('video',{height:this.props.videoSize.height,ref:"stickerVideo",width:this.props.videoSize.width},h.createElement('source',{src:this.props.videoURI}))));}});f.exports=l;},null);
  __d('MercuryAttachmentVideo.react',['ChatAttachmentAttribution.react','ChatImageArrowDirection','ChatImageWithArrow.react','ChatSpeakingSticker.react','CenteredContainer.react','FBOverlayBase.react','FBOverlayContainer.react','FBOverlayElement.react','Image.react','ImmutableObject','MercuryAttachment','MessagesViewer','React','Vector','cx','ix'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){if(c.__markCompiled)c.__markCompiled();var x=t.PropTypes,y=t.createClass({displayName:'MercuryAttachmentVideo',propTypes:{attachment:x.instanceOf(q),duration:x.number.isRequired,isChat:x.bool,isInbound:x.bool,name:x.string.isRequired,onAttachmentLoad:x.func,pageID:x.number,thumbSize:x.shape({height:x.number,width:x.number}).isRequired,thumbnail:x.string.isRequired,videoSize:x.shape({height:x.number,width:x.number}).isRequired,videoID:x.string.isRequired,videoURI:x.string.isRequired},componentDidMount:function(){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.props.thumbSize.height);s.preload();},_formatDuration:function(){var z=this.props.duration,aa=Math.floor(z/60),ba=z%60;if(ba<10)return aa+':0'+ba;return aa+':'+ba;},openViewer:function(){var z=this.props,aa=z.pageID,ba=z.videoID,ca=z.videoSize,da=z.videoURI;ca=new u(ca.width,ca.height);s.renderVideo({pageID:aa,videoID:ba,videoSize:ca,videoURI:da});},_renderImage:function(){if(this.props.isChat){return (t.createElement('div',null,t.createElement(j,{arrowDirection:this.props.isInbound?i.LEFT:i.RIGHT,height:this.props.thumbSize.height,key:'previewImage',source:this.props.thumbnail,width:this.props.thumbSize.width}),t.createElement(h,{attachment:this.props.attachment,key:'chatAttribution'})));}else return (t.createElement(p,{height:this.props.thumbSize.height,width:this.props.thumbSize.width,src:this.props.thumbnail}));},_getStyle:function(){if(this.props.isChat)return {};return this.props.thumbSize;},render:function(){if(this.props.attachment.metadata&&this.props.attachment.metadata.render_as_sticker&&this.props.isChat)return (t.createElement(k,{videoURI:this.props.videoURI,videoSize:this.props.videoSize}));var z=r.hasAttribution(this.props.attachment),aa="clearfix"+(' '+"_zow")+(' '+"_59go")+(z?' '+"_4yjw":'')+(this.props.isChat?' '+"_3ds5":''),ba=t.createElement(n,{className:aa,key:'overlayContainer',onClick:this.openViewer,style:this._getStyle()},t.createElement(m,null,this._renderImage()),t.createElement(o,null,t.createElement('div',{className:(!this.props.isChat?"_zox":'')+(z?' '+"_jt3":'')},t.createElement('span',{className:"_zoz"},this._formatDuration()))),t.createElement(o,null,t.createElement(l,{className:z?"_jt3":'',vertical:true},t.createElement(p,{src:w('/images/chat/chat_play_icon.png')}))));if(this.props.isChat)return ba;return (t.createElement('div',null,ba,t.createElement(h,{attachment:this.props.attachment,key:'inboxAttribution'})));}});f.exports=y;},null);
  __d('MercuryFileUploader',['ArbiterMixin','CSS','Dialog','DOM','Event','FileForm','FileFormResetOnSubmit','FileInput','FormSubmitOnChange','MercuryAttachment','MercuryAttachmentTemplates','MercuryConstants','PhotosUploadID','SubscriptionsHandler','csx','fbt','getObjectValues','mixin','shield'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){if(c.__markCompiled)c.__markCompiled();var aa,ba;aa=babelHelpers.inherits(ca,y(h));ba=aa&&aa.prototype;function ca(ea,fa,ga,ha){'use strict';ba.constructor.call(this);this.$MercuryFileUploader1=ea;this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader7={};this.$MercuryFileUploader8={};this.$MercuryFileUploader9={};this.$MercuryFileUploader10={};this.updateElements(fa,ga,ha);}ca.prototype.updateElements=function(ea,fa,ga){'use strict';this.$MercuryFileUploader11&&this.$MercuryFileUploader11.release();this.$MercuryFileUploader11=new u();this.$MercuryFileUploader12&&this.$MercuryFileUploader12.destroy();this.$MercuryFileUploader12=new m(ea,[p,n]);this.$MercuryFileUploader12.setAllowCrossOrigin(true);this.$MercuryFileUploader12.setUploadInParallel(true);var ha=k.find(ea,"._4q60"),ia=k.find(ha,"._4q61");new o(ha,ia,fa);this.$MercuryFileUploader11.addSubscriptions(this.$MercuryFileUploader12.subscribe('submit',(function(){var ja={count:0,file_sizes:[],files:[]};if(fa.files){for(var ka=0;ka<fa.files.length;ka++)if(fa.files[ka].size>s.AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var la={};for(var ma=0;ma<fa.files.length;ma++){var na=this.$MercuryFileUploader13();this.$MercuryFileUploader14(na,fa.files[ma].name);ja.count++;ja.file_sizes.push(fa.files[ma].size);la[na]=fa.files[ma];ja.files.push({upload_id:na,metadata:fa.files[ma]});}this.$MercuryFileUploader12.setFiles(la);}else{ga.value=this.$MercuryFileUploader13();this.$MercuryFileUploader14(ga.value,fa.value);ja.count=1;}this.inform('submit',ja);}).bind(this)),this.$MercuryFileUploader12.subscribe('success',this.$MercuryFileUploader15.bind(this)),this.$MercuryFileUploader12.subscribe('failure',this.$MercuryFileUploader16.bind(this)),l.listen(ia,'click',z(this.inform,this,'open')));};ca.prototype.showAttachmentSizeErrorDialog=function(){'use strict';this.$MercuryFileUploader12.abort();this.$MercuryFileUploader12.clear();new j().setTitle(w._("The file you have selected is too large")).setBody(w._("The file you have selected is too large. The maximum size is 25MB.")).setButtons(j.OK).setSemiModal(true).show();};ca.prototype.addDroppedFiles=function(ea){'use strict';if(!this.$MercuryFileUploader12||!this.$MercuryFileUploader12.canUseXHR())return;var fa={},ga={count:0,file_sizes:[],files:[]};for(var ha=0;ha<ea.length;ha++){var ia=ea[ha];if(ia.size>s.AttachmentMaxSize){this.showAttachmentSizeErrorDialog();return false;}var ja=this.$MercuryFileUploader13();this.$MercuryFileUploader14(ja,ia.name);fa[ja]=ia;ga.file_sizes.push(ia.size);ga.count++;ga.files.push({upload_id:ja,metadata:ia});}this.$MercuryFileUploader12.setFiles(fa);this.$MercuryFileUploader12.forceSendViaXHR();this.inform('submit',ga);};ca.prototype.isUploading=function(){'use strict';return !!Object.keys(this.$MercuryFileUploader8).length;};ca.prototype.addCachedAttachments=function(ea){'use strict';ea.forEach((function(fa){var ga=this.$MercuryFileUploader13();this.$MercuryFileUploader14(ga,fa.filename);this.$MercuryFileUploader17(ga,fa);}).bind(this));};ca.prototype.addCachedImageFiles=function(ea){'use strict';var fa=w._("Photo");ea.forEach((function(ga){var ha=this.$MercuryFileUploader13();this.$MercuryFileUploader14(ha,fa);this.$MercuryFileUploader17(ha,{filename:ga,image_id:ga,filetype:'image/jpeg'});}).bind(this));};ca.prototype.getAttachments=function(){'use strict';return x(this.$MercuryFileUploader2);};ca.prototype.getImageFiles=function(){'use strict';var ea=Object.keys(this.$MercuryFileUploader3).sort(),fa=[];ea.forEach((function(ga){return fa.push(this.$MercuryFileUploader3[ga]);}).bind(this));return fa;};ca.prototype.getAnimatedImageFiles=function(){'use strict';return x(this.$MercuryFileUploader4);};ca.prototype.getVideoFiles=function(){'use strict';return x(this.$MercuryFileUploader5);};ca.prototype.getAudioFiles=function(){'use strict';return x(this.$MercuryFileUploader6);};ca.prototype.getFiles=function(){'use strict';return x(this.$MercuryFileUploader7);};ca.prototype.removeOneAttachment=function(ea){'use strict';this.$MercuryFileUploader18(ea);};ca.prototype.removeAttachments=function(){'use strict';if(this.$MercuryFileUploader1)k.empty(this.$MercuryFileUploader1);this.$MercuryFileUploader2={};this.$MercuryFileUploader3={};this.$MercuryFileUploader4={};this.$MercuryFileUploader5={};this.$MercuryFileUploader6={};this.$MercuryFileUploader7={};this.$MercuryFileUploader9={};this.$MercuryFileUploader8={};this.$MercuryFileUploader10={};if(this.$MercuryFileUploader1)i.hide(this.$MercuryFileUploader1);this.inform('dom-updated');};ca.prototype.destroy=function(){'use strict';this.$MercuryFileUploader11&&this.$MercuryFileUploader11.release();this.$MercuryFileUploader12&&this.$MercuryFileUploader12.destroy();this.removeAttachments();};ca.prototype.$MercuryFileUploader14=function(ea,fa){'use strict';var ga=r[':fb:mercury:upload-file-row'].build(),ha={};this.$MercuryFileUploader9[ea]=ga;this.$MercuryFileUploader8[ea]=true;this.$MercuryFileUploader10[ea]=Date.now();var ia=da(fa);k.appendContent(ga.getNode('iconText'),ia);ha.fileName=ia;l.listen(ga.getNode('closeFileUpload'),'click',this.$MercuryFileUploader18.bind(this,ea));if(this.$MercuryFileUploader1){k.appendContent(this.$MercuryFileUploader1,ga.getRoot());i.show(this.$MercuryFileUploader1);}this.inform('dom-updated',ha);};ca.prototype.$MercuryFileUploader18=function(ea,event){'use strict';if(this.$MercuryFileUploader8[ea]){this.inform('upload-canceled-during-upload');}else if(this.$MercuryFileUploader2[ea]||this.$MercuryFileUploader3[ea]||this.$MercuryFileUploader4[ea]||this.$MercuryFileUploader5[ea]||this.$MercuryFileUploader6[ea]||this.$MercuryFileUploader7[ea])this.inform('upload-canceled-after-uploaded');delete this.$MercuryFileUploader2[ea];delete this.$MercuryFileUploader3[ea];delete this.$MercuryFileUploader4[ea];delete this.$MercuryFileUploader5[ea];delete this.$MercuryFileUploader6[ea];delete this.$MercuryFileUploader7[ea];delete this.$MercuryFileUploader8[ea];delete this.$MercuryFileUploader10[ea];var fa=this.$MercuryFileUploader9[ea];delete this.$MercuryFileUploader9[ea];if(fa){k.remove(fa.getRoot());this.inform('dom-updated');}this.inform('upload-canceled');return false;};ca.prototype.$MercuryFileUploader19=function(ea,fa){'use strict';var ga=this.$MercuryFileUploader9[ea],ha=q.getAttachIconClassByMime(fa);i.addClass(ga.getNode('iconText'),ha);i.addClass(ga.getRoot(),'done');};ca.prototype.$MercuryFileUploader17=function(ea,fa){'use strict';if(this.$MercuryFileUploader8[ea]){delete this.$MercuryFileUploader8[ea];if(fa.image_id){this.$MercuryFileUploader3[ea]=fa.image_id;}else if(fa.gif_id){this.$MercuryFileUploader4[ea]=fa.gif_id;}else if(fa.video_id){this.$MercuryFileUploader5[ea]=fa.video_id;}else if(fa.audio_id){this.$MercuryFileUploader6[ea]=fa.audio_id;}else if(fa.file_id){this.$MercuryFileUploader7[ea]=fa.file_id;}else this.$MercuryFileUploader2[ea]=fa;this.$MercuryFileUploader19(ea,fa.filetype);this.inform('one-upload-completed',{upload_time_ms:Date.now()-this.$MercuryFileUploader10[ea],upload_id:ea,metadata:fa});}if(!this.isUploading())this.inform('all-uploads-completed',{count:this.getAttachments().length});};ca.prototype.$MercuryFileUploader15=function(event,ea){'use strict';var fa=ea.response.getPayload();this.$MercuryFileUploader17(this.$MercuryFileUploader20(ea),fa.metadata[0]);};ca.prototype.$MercuryFileUploader16=function(event,ea){'use strict';this.inform('one-upload-failed');this.$MercuryFileUploader18(this.$MercuryFileUploader20(ea),event);};ca.prototype.$MercuryFileUploader13=function(){'use strict';return 'upload_'+t.getNewID();};ca.prototype.$MercuryFileUploader20=function(ea){'use strict';var fa=ea.response.getPayload();if(ea.upload){return ea.upload.getName();}else return fa.uploadID;};function da(ea){if(ea&&ea.startsWith('C:\\fakepath\\'))return ea.substring(12);return ea;}f.exports=ca;},null);
  __d('VaultEditableGrid',['Event','Arbiter','AsyncRequest','CSS','DOM','Scroll','$','csx','ge','removeFromArray'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();var r={};function s(t,u,v,w){r[t.id]=this;this._grid=t;this._gridID=t.id;this._dialogEndpoint=u;this._collapseWhenEmpty=v;this._attachmentCount=w;this._selectedVaultImageIDs=[];i.subscribe('multi-upload/image-removed/'+this._gridID,(function(x,y){q(this._selectedVaultImageIDs,y);this.updateAttachmentCount(this._attachmentCount-1);}).bind(this));i.subscribe('multi-upload/composer-reset/'+this._gridID,(function(x,y){this.removeImages();}).bind(this));i.subscribe(['multi-upload/images-upload-start/'+this._gridID,'multi-upload/video-added/'+this._gridID],(function(){this.updateAttachmentCount(this._attachmentCount+1);}).bind(this));i.inform('fbVaultEditableGrid/created/'+t.id,this,i.BEHAVIOR_PERSISTENT);i.subscribe('multi-upload/images-upload-start/'+this._gridID,this._scrollToRight.bind(this));this.updateAttachmentCount(this._attachmentCount);}Object.assign(s,{VAULT_IMAGE:'vault_image',getInstance:function(t){return r[t];},registerDialogWithGrid:function(t,u,v){i.subscribe(['multi-upload/images-upload-start/'+t,'multi-upload/video-added/'+t],v.hide.bind(v));i.subscribe('fbVaultEditableGrid/created/'+t,function(w,x){x._registerDialogWithGrid(u,v);});},onImagesSelected:function(t,u,v){r[t]._onImagesSelected(u,v);}});Object.assign(s.prototype,{getRoot:function(){var t=p(this._gridID);if(t){return t;}else return this._grid;},_registerDialogWithGrid:function(t,u){this._dialog=u;var v=this.getMoreLink();v&&h.listen(v,'click',function(){u.show();return false;});u.subscribe('aftershow',(function(){var w=[];l.scry(n(this._gridID),'input[type="hidden"]').forEach(function(y){if(y.name.match('composer_vault_images')||y.name.match('composer_unpublished_photo'))w.push(y.value);});var x=t.getGrid();x.bulkChange(function(){var y=x.getSelectionSet();y.clear();y.addAll(w);});}).bind(this));},updateAttachmentCount:function(t){this._attachmentCount=t;if(this._collapseWhenEmpty)k.conditionShow(this._grid,this._attachmentCount>0);},getID:function(){return this._gridID;},_onImagesSelected:function(t,u){var v=l.find(this.getRoot(),"._577");this.removeImages();this._selectedVaultImageIDs=u;t.forEach(function(w){l.insertBefore(v,w);});i.inform('multi-upload/images-added/'+this._gridID,{fbids:u});this._scrollToRight();},removeImages:function(){l.scry(this.getRoot(),'.fbVaultGridItem').forEach(function(t){if(!k.hasClass(t,'fbVaultEditableGridMoreLink'))l.remove(t);});this._selectedVaultImageIDs=[];i.inform('multi-upload/all-images-removed/'+this._gridID);this.updateAttachmentCount(0);},_scrollToRight:function(){var t=this.getRoot(),u=l.find(t,'.fbScrollableAreaWrap');m.setLeft(u,Math.max(0,l.find(t,'.fbScrollableAreaBody').offsetWidth-u.offsetWidth));},showDialog:function(t,u){if(this._dialog){this._dialog.show();}else j.bootstrap(this._dialogEndpoint,t);},getMoreLink:function(){return l.scry(this.getRoot(),'.fbVaultEditableGridMoreLink')[0];}});f.exports=s;},null);
  __d('BasePhotoUploader',['Arbiter','ArbiterMixin','CSS','DOM','PhotosMultiUploadInput','VaultEditableGrid','TimelineMapScrollableArea','mixin','getObjectValues'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();var q,r;q=babelHelpers.inherits(s,o(i));r=q&&q.prototype;function s(t,u){'use strict';r.constructor.call(this);new n(t,{verticalscroll:true});this.$BasePhotoUploader1=t;this.$BasePhotoUploader2=this.$BasePhotoUploader3();this.$BasePhotoUploader4=false;this.$BasePhotoUploader5=null;u.addSubscriptions(h.subscribe('multi-upload/images-added/'+this.$BasePhotoUploader1.id,(function(v,w){var x=Object.assign({},w.fbids);Object.assign(this.$BasePhotoUploader2,x);this.$BasePhotoUploader6();this.inform('upload-completed',{fbids:p(x)});}).bind(this)),h.subscribe('multi-upload/image-removed/'+this.$BasePhotoUploader1.id,(function(v,w){for(var x in this.$BasePhotoUploader2)if(this.$BasePhotoUploader2[x]===w){delete this.$BasePhotoUploader2[x];break;}this.$BasePhotoUploader6();}).bind(this)),h.subscribe('multi-upload/images-upload-start/'+this.$BasePhotoUploader1.id,(function(v,w){j.show(this.$BasePhotoUploader1);this.$BasePhotoUploader4=true;this.inform('dom-updated');this.inform('upload-started',w);}).bind(this)),h.subscribe('multi-upload/composer-reset/'+this.$BasePhotoUploader1.id,this.clear.bind(this)),h.subscribe('multi-upload/all-images-removed/'+this.$BasePhotoUploader1.id,this.$BasePhotoUploader7.bind(this)),h.subscribe('multi-upload/images-upload-completed/'+this.$BasePhotoUploader1.id,(function(v){this.$BasePhotoUploader4=false;this.inform('all-uploads-completed');this.$BasePhotoUploader6();}).bind(this)));j.conditionShow(this.$BasePhotoUploader1,Object.keys(this.$BasePhotoUploader2).length);}s.prototype.getSelectedFBIDs=function(){'use strict';var t=Object.keys(this.$BasePhotoUploader2).sort();return t.map((function(u){return this.$BasePhotoUploader2[u];}).bind(this));};s.prototype.isUploading=function(){'use strict';return this.$BasePhotoUploader4;};s.prototype.clear=function(){'use strict';var t=m.getInstance(this.$BasePhotoUploader1.id);t&&t.removeImages();};s.prototype.getWaterfallID=function(){'use strict';return l.getWaterfallID(this.$BasePhotoUploader1.id);};s.prototype.$BasePhotoUploader7=function(){'use strict';this.$BasePhotoUploader2={};this.$BasePhotoUploader4=false;j.hide(this.$BasePhotoUploader1);this.inform('all-uploads-completed');this.inform('dom-updated');};s.prototype.$BasePhotoUploader3=function(){'use strict';var t={},u=-10000;k.scry(this.$BasePhotoUploader1,'input[type="hidden"]').forEach(function(v){if(v.name.match('composer_vault_images')){t[u]=v.value;u--;}});return t;};s.prototype.$BasePhotoUploader6=function(){'use strict';j.conditionShow(this.$BasePhotoUploader1,Object.keys(this.$BasePhotoUploader2).length>0);this.inform('dom-updated');};s.prototype.setCurrentMethod=function(t){'use strict';this.$BasePhotoUploader5=t;};s.prototype.getCurrentMethod=function(){'use strict';return this.$BasePhotoUploader5;};f.exports=s;},null);
  __d('MercuryPhotoUploader',['Arbiter','AsyncRequest','DOM','FileInput','Parent','PhotosMultiUploadInput','PUWMethods','VaultEditableGrid','Focus','csx','cx','Event','BasePhotoUploader'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){if(c.__markCompiled)c.__markCompiled();var u,v;u=babelHelpers.inherits(w,t);v=u&&u.prototype;function w(x,y,z,aa){'use strict';v.constructor.call(this,x,z);this.$MercuryPhotoUploader1=x.id;this.$MercuryPhotoUploader2=false;h.subscribe('PhotosMultiUploadInput/loaded/'+x.id,(function(){this.$MercuryPhotoUploader2=true;}).bind(this));h.subscribe('MercuryPhotoUploader/initUploadButton/'+x.id,function(){var ba=j.scry(y,'input[type="file"]')[0];if(!ba)ba=j.create('input',{accept:'image/*',type:'file',className:"_n",name:'composer_unpublished_photo[]',multiple:1});var ca=l.byClass(y,"_9_h"),da=new k(ca,j.find(ca,"._214"),ba);da.subscribe('change',m.doFileUpload.bind(null,x.id,da));});h.subscribe('MercuryPhotoUploader/registerPhotoMenu/'+x.id,(function(ba,ca){var da=ca.menu.getRoot();ca.menu.setContext(y);var ea=j.scry(da,"._d2p"),fa=ea&&ea[0];fa&&s.listen(fa,'click',(function(){o.getInstance(x.id).showDialog(fa,o.VAULT_IMAGE);this.setCurrentMethod(n.VAULT);this.inform('selection-start',{method:n.VAULT});}).bind(this));s.listen(y,'click',(function(){if(!this.$MercuryPhotoUploader2)return;if(!ca.menu.isShown()){var ha=j.scry(ca.menu.getContentRoot(),'li');this.inform('menu-show');ca.menu.show();if(ha)p.setWithoutOutline(ha[0]);}else{this.inform('menu-hide');ca.menu.hide();}}).bind(this));s.listen(document.documentElement,'click',(function(event){if(!j.contains(y,event.getTarget())&&!j.contains(fa,event.getTarget())){if(ca.menu.isShown())this.inform('menu-hide');ca.menu.hide();}}).bind(this));var ga=j.find(da,"._9_h");s.listen(ga,'click',(function(){this.setCurrentMethod(n.FILE_SELECTOR);this.inform('selection-start',{method:n.FILE_SELECTOR});}).bind(this));}).bind(this));aa&&m.initDragDrop(x.id,aa);}w.prototype.uploadPastedFile=function(x){'use strict';m.onFilesDrop(this.$MercuryPhotoUploader1,[x]);};w.prototype.addCachedPhotos=function(x){'use strict';i.post('/ajax/vault/selected.php',{max_select:10,grid_id:this.$MercuryPhotoUploader1,source:'messenger',image_ids:x});};Object.assign(w,{initUploadButton:function(x){h.inform('MercuryPhotoUploader/initUploadButton/'+x,{},h.BEHAVIOR_PERSISTENT);},registerPhotoMenu:function(x,y){h.inform('MercuryPhotoUploader/registerPhotoMenu/'+x,{menu:y},h.BEHAVIOR_PERSISTENT);}});f.exports=w;},null);
  __d('MercuryShareLinkUploader',['ArbiterMixin','AsyncRequest','CSS','DOM','Event','Form','URLScraper','WebMessengerEvents','mixin','isEmpty'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();var r,s;r=babelHelpers.inherits(t,p(h));s=r&&r.prototype;function t(){'use strict';s.constructor.call(this);this.__initialize.apply(this,arguments);}t.prototype.__initialize=function(u,v,w,x,y){'use strict';this.$MercuryShareLinkUploader1=u;this.$MercuryShareLinkUploader2=v;this.$MercuryShareLinkUploader3=w;this.$MercuryShareLinkUploader4=y;this.$MercuryShareLinkUploader5=false;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7=null;l.listen(x,'click',this.close.bind(this));l.listen(y,'keyup',(function(){!y.value.length&&this.$MercuryShareLinkUploader8.enable();}).bind(this));this.$MercuryShareLinkUploader8=new n(y);this.$MercuryShareLinkUploader8.subscribe('match',(function(z,aa){this.loadShare(aa&&aa.url);}).bind(this));};t.prototype.getAttachData=function(){'use strict';return this.loadAttachData(this.$MercuryShareLinkUploader5,this.$MercuryShareLinkUploader1,this.$MercuryShareLinkUploader4);};t.prototype.getShareDataFromStage=function(u,v){'use strict';var w=m.serialize(v),x=w.attachment&&w.attachment.params;if(!x)return null;if(x instanceof Object){var y=[];y.push(x[0]);y.push(x[1]);x=y;}return {params:x,type:w.attachment.type};};t.prototype.loadAttachData=function(u,v,w,x){'use strict';if(u){var y=m.serialize(v),z=y.attachment&&y.attachment.params,aa=y.link_metrics?y.link_metrics.no_image:true;if(!z||q(z))return null;var ba=x?x():w.value;if(ba.indexOf(z.url)===-1)return y;if(!z.summary&&!z.favicon&&aa&&z.title&&z.url&&z.url.substr(0,z.title.length)===z.title)return null;return y;}return null;};t.prototype.check=function(){'use strict';this.$MercuryShareLinkUploader8.check();};t.prototype.close=function(){'use strict';this.$MercuryShareLinkUploader9();this.$MercuryShareLinkUploader8.disable();this.inform('closed');};t.prototype.clear=function(){'use strict';this.$MercuryShareLinkUploader9();this.$MercuryShareLinkUploader8.enable();};t.prototype.enable=function(){'use strict';this.$MercuryShareLinkUploader8.enable();};t.prototype.disable=function(){'use strict';this.$MercuryShareLinkUploader8.disable();};t.prototype.loadShare=function(u){'use strict';this.$MercuryShareLinkUploader6=u;this.$MercuryShareLinkUploader7&&this.$MercuryShareLinkUploader7.abort();this.$MercuryShareLinkUploader7=new i().setMethod('POST').setURI('/ajax/share_scrape.php').setData({u:u}).setHandler(this.$MercuryShareLinkUploader10.bind(this).bind(null,u)).setStatusElement(this.$MercuryShareLinkUploader3);this.$MercuryShareLinkUploader7.send();this.inform('link-detected');};t.prototype.$MercuryShareLinkUploader10=function(u,v){'use strict';if(this.$MercuryShareLinkUploader6!==u)return;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7=null;j.show(this.$MercuryShareLinkUploader1);k.empty(this.$MercuryShareLinkUploader2);k.setContent(this.$MercuryShareLinkUploader2,v.payload);this.$MercuryShareLinkUploader5=true;if(!this.getAttachData()){this.close();return;}o.detailDOMChanged();};t.prototype.$MercuryShareLinkUploader9=function(){'use strict';j.hide(this.$MercuryShareLinkUploader1);this.$MercuryShareLinkUploader5=false;this.$MercuryShareLinkUploader6=null;this.$MercuryShareLinkUploader7&&this.$MercuryShareLinkUploader7.abort();this.$MercuryShareLinkUploader7=null;this.$MercuryShareLinkUploader8.reset();o.detailDOMChanged();};f.exports=t;},null);
  __d('MessengerHotLikePreview.react',['Animation','HotLikeSound','Image.react','MessengerHotLikePreviewEvents','MessengerHotLikeUtils','React','ReactDOM','StickerConstants','SubscriptionsHandler','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();'use strict';var r=m.PropTypes,s=m.createClass({displayName:'MessengerHotLikePreview',propTypes:{customLike:r.string,since:r.number},componentDidMount:function(){this._subscriptions=new p();this._subscriptions.addSubscriptions(k.addListener(k.STOP,this._snapToStickerSize),k.addListener(k.POP,this._pop));i.start();this._growthAnimation=new h(n.findDOMNode(this)).to('width',80).to('height',80).duration(3000).go();this._setUpRotationAnimation();},componentWillUnmount:function(){this._subscriptions&&this._subscriptions.release();},render:function(){if(this.props.customLike)return (m.createElement('div',{className:"_4a9g _383m"},m.createElement(j,{src:this.props.customLike})));return (m.createElement('div',{className:"_4a9g _576q"}));},_setUpRotationAnimation:function(){this._rotateAnimation=new h(n.findDOMNode(this));this._rotateHotLike(-2,2,150,1000);this._rotateHotLike(-4,4,100,1000);this._rotateHotLike(-10,10,75,1000);this._rotateAnimation.go();},_rotateHotLike:function(t,u,v,w){var x=Math.floor(w/v),y=null;for(var z=0;z<x;z++){y=z%2?t:u;this._rotateAnimation.to('rotateZ',y).duration(v).checkpoint();}},_snapToStickerSize:function(t){if(this._snapped)return;this._snapped=true;var u=Date.now()-this.props.since,v=l.getStickerIDForTime(u);if(v){i.snap(v);var w=l.getMetadataForHotLike(v);this._rotateAnimation.stop();var x=30,y=-10;if(v===o.HOT_LIKE_SMALL_STICKER_ID){x=0;y=0;}this._growthAnimation.stop().to('width',w.width*1.2).to('height',w.height*1.2).to('rotateZ',x).duration(100).checkpoint().to('width',w.width*.9).to('height',w.height*.9).to('rotateZ',y).duration(100).checkpoint().to('width',w.width).to('height',w.height).to('rotateZ',0).duration(100).ondone(function(){k.emit(k.FINISH_ANIMATION,t,v);}).go();}},_pop:function(t){i.pop();this._growthAnimation.stop().to('width',0).to('height',0).duration(100).ondone(function(){k.emit(k.REMOVE,t);}).go();}});f.exports=s;},null);
  __d('MercuryDrafts',['CacheStorage','MercurySingletonMixin','isEmpty'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();function k(l){'use strict';this.$MercuryDrafts1=l;this.$MercuryDrafts2=new h('localstorage','mercury-drafts:'+this.$MercuryDrafts1);}k.prototype.saveDraft=function(l,m){'use strict';if(this.isMessageEmpty(m)){this.removeDraft(l);}else this.$MercuryDrafts2.set(l,this.$MercuryDrafts3(l,m));};k.prototype.removeDraft=function(l){'use strict';this.$MercuryDrafts2.remove(l);};k.prototype.getDraft=function(l){'use strict';var m=this.$MercuryDrafts2.get(l,{});return m.message;};k.prototype.isMessageEmpty=function(l){'use strict';return j(l)||j(l.body)&&j(l.content_attachment)&&j(l.raw_attachments)&&j(l.photo_fbids)&&j(l.image_ids);};k.prototype.$MercuryDrafts3=function(l,m){'use strict';return {thread_id:l,message:m};};Object.assign(k,i);f.exports=k;},null);
  __d('MercuryDraftsController',['Input','MercurySingletonMixin','isEmpty','MercuryDrafts'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryDrafts').get();function l(m){'use strict';this.$MercuryDraftsController1;}l.prototype.clearDraft=function(m){'use strict';if(this.canSaveDrafts(m))k.removeDraft(m);};l.prototype.saveDraft=function(m,n,o,p,q){'use strict';if(!this.canSaveDrafts(m))return;var r={body:h.getValue(n)};if(!j(o.getAttachments())){r.has_attachment=true;r.raw_attachments=o.getAttachments();}if(!j(o.getImageFiles())){r.has_attachment=true;r.image_ids=o.getImageFiles();}if(q&&!j(q.getSelectedFBIDs())){r.has_attachment=true;r.photo_fbids=q.getSelectedFBIDs();}if(p.getAttachData()){r.has_attachment=true;r.content_attachment=p.getAttachData();}k.saveDraft(m,r);};l.prototype.loadDraft=function(m,n,o,p,q){'use strict';if(!this.canSaveDrafts(m)||this.$MercuryDraftsController2(n,o,p,q))return;var r=k.getDraft(m);if(!j(r)){if(r.body){n.focus();h.setValue(n,r.body);}if(!j(r.raw_attachments))o.addCachedAttachments(r.raw_attachments);if(!j(r.image_ids))o.addCachedImageFiles(r.image_ids);if(!j(r.content_attachment))p.loadShare(r.content_attachment.attachment.params.url);if(q&&!j(r.photo_fbids))q.addCachedPhotos(r.photo_fbids);this.clearDraft(m);}};l.prototype.canSaveDrafts=function(m){'use strict';return !!m;};l.prototype.$MercuryDraftsController2=function(m,n,o,p){'use strict';return !h.isEmpty(m)||!j(n.getAttachments())||!j(n.getImageFiles())||p&&!j(p.getSelectedFBIDs())||o.getAttachData();};l.prototype.toString=function(){'use strict';return '[object MercuryDraftsController:'+this.$MercuryDraftsController1+']';};Object.assign(l,i);f.exports=l;},null);
  __d('MercuryShareAttachmentSnippet.react',['MercuryShareAttachmentReactShape','MercuryShareStyleMap','React'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();'use strict';var k=j.PropTypes,l=j.createClass({displayName:'MercuryShareAttachmentSnippet',propTypes:{attachment:h,isSenderViewer:k.bool,senderName:k.string},render:function(){var m=i.getStyleFactory(this.props.attachment);if(m.factory&&!!m.factory.getSnippetComponent){var n=m.factory.getSnippetComponent();return (j.createElement(n,babelHelpers._extends({},this.props,{attachment:m.attachment})));}return null;}});f.exports=l;},null);
  __d('MercuryAttachmentSnippet.react',['EmoticonsList','Image.react','MercuryAttachment','MercuryAttachmentSnippetRenderer','MercuryAttachmentSnippetType','MercuryAttachmentType','MercuryIDs','P2PMercuryAttachmentSnippet.react','MercuryShareAttachmentSnippet.react','MercuryParticipants','React','StickerConstants','TextWithEmoticons.react','cx','ix','fbt','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){if(c.__markCompiled)c.__markCompiled();'use strict';var y=r.PropTypes,z=r.createClass({displayName:'MercuryAttachmentSnippet',propTypes:{thread:y.object.isRequired,viewer:y.string.isRequired},componentWillMount:function(){this._ensureParticipant(this.props.thread.snippet_sender);this._setVariables(this.props);},componentWillReceiveProps:function(ca){this._ensureParticipant(ca.thread.snippet_sender);this._setVariables(ca);},componentWillUnmount:function(){this._cancelParticipantFetch();},render:function(){var ca=this._getSenderName(),da=k.getAttachmentSnippetType(this._attachments);switch(da){case l.PHOTO:return this._renderPhotoSnippet(ca);case l.GIF:return this._renderAnimatedImageSnippet(ca);case l.VIDEO:return this._renderVideoSnippet(ca);case l.AUDIO_CLIP:return this._renderAudioClipSnippet(ca);case l.STICKER:return this._renderStickerSnippet(ca);case l.ORION:return this._renderOrionSnippet(ca);case l.SHARE:return this._renderShareSnippet(ca);case l.ERROR:return this._renderError(ca);default:return this._renderMixedSnippet(ca);}},_renderPhotoSnippet:function(ca){return this._renderSnippet(k.renderAttachmentSnippetText(l.PHOTO,this._isViewerSender,ca,this._attachments));},_renderAnimatedImageSnippet:function(ca){return this._renderSnippet(k.renderAttachmentSnippetText(l.GIF,this._isViewerSender,ca,this._attachments));},_renderVideoSnippet:function(ca){return this._renderSnippet(k.renderAttachmentSnippetText(l.VIDEO,this._isViewerSender,ca));},_renderAudioClipSnippet:function(ca){return this._renderSnippet(k.renderAttachmentSnippetText(l.AUDIO_CLIP,this._isViewerSender,ca));},_renderStickerSnippet:function(ca){if(aa(this._attachments[0].metadata.stickerID)){var da=r.createElement(t,{renderEmoticons:true,text:h.symbols.like});if(this._isViewerSender){return (r.createElement('span',null,w._("You: {conversation_snippet}",[w.param('conversation_snippet',da)])));}else return (r.createElement('span',null,w._("{sender name}: {conversation_snippet}",[w.param('sender name',ca),w.param('conversation_snippet',da)])));}else return (r.createElement('span',null,k.renderAttachmentSnippetText(l.STICKER,this._isViewerSender,ca)));},_renderOrionSnippet:function(ca){return (r.createElement('span',null,r.createElement(o,this._attachments[0].metadata)));},_renderShareSnippet:function(ca){if(!!this._attachments[0].share)return (r.createElement(p,{attachment:this._attachments[0].share,senderName:ca,isViewerSender:this._isViewerSender}));return this._renderSnippet(k.renderAttachmentSnippetText(l.SHARE,this._isViewerSender,ca));},_renderMixedSnippet:function(ca){return (r.createElement('span',null,this._attachments.filter(function(da){return (da.attach_type===m.FILE||da.attach_type===m.PHOTO||da.attach_type===m.VIDEO);}).map((function(da,ea){return this._renderSnippet(da.name,da.icon_type,ea);}).bind(this))));},_renderSnippet:function(ca,da,ea){var fa=j.getAttachIconClass(da||this._attachments[0].icon_type),ga=x(fa,"uiIconText _3l6h");return (r.createElement('span',{className:ga,key:ea},r.createElement(i,{src:v('/images/messaging/docs/generic.png')}),ca));},_renderError:function(ca){var da=k.renderAttachmentSnippetText(l.ERROR,this._isViewerSender,ca);return this._renderSnippet(da);},_setVariables:function(ca){this._viewer=ca.viewer;this._sender=ca.thread.snippet_sender;this._attachments=ca.thread.snippet_attachments;this._isViewerSender=ba(this._sender,this._viewer);},_getSenderName:function(){if(!this._sender||this._isViewerSender)return null;var ca=q.getNow(this._sender);if(!ca)return null;return ca.short_name;},_ensureParticipant:function(ca){if(!ca)return;this._cancelParticipantFetch();if(!q.getNow(ca))this._sub=q.get(ca,(function(da){return this.forceUpdate();}).bind(this));},_cancelParticipantFetch:function(){this._sub&&this._sub.remove();}});function aa(ca){return (ca==s.LIKE_STICKER_ID||ca==s.HOT_LIKE_SMALL_STICKER_ID||ca==s.HOT_LIKE_MEDIUM_STICKER_ID||ca==s.HOT_LIKE_LARGE_STICKER_ID);}function ba(ca,da){return !!(ca&&n.getParticipantIDFromUserID(da)==ca);}f.exports=z;},null);
  __d('MercuryParticipantsImage.react',['MercuryParticipants','React','SplitImage.react','areEqual'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();'use strict';var l=i.PropTypes,m=i.createClass({displayName:'MercuryParticipantsImage',_bigImageToken:null,propTypes:{participants:l.array.isRequired,size:l.number},getInitialState:function(){return {participantImages:[]};},componentDidMount:function(){this._getParticipantImages(this.props);},componentWillReceiveProps:function(n){this._getParticipantImages(n);},componentWillUnmount:function(){this._bigImageToken&&this._bigImageToken.remove();},shouldComponentUpdate:function(n,o){return (n.size!==this.props.size||!o||!k(o.participantImages,this.state.participantImages));},render:function(){if(this.state.participantImages.length>0)return (i.createElement(j,{border:true,className:this.props.className,srcs:this.state.participantImages,size:this.props.size}));return null;},_getParticipantImages:function(n){this._bigImageToken&&this._bigImageToken.remove();this._bigImageToken=h.getOrderedBigImageMulti(n.participants,(function(o){this.isMounted()&&this.setState({participantImages:o});}).bind(this));}});f.exports=m;},null);
  __d('MercuryThreadImage.react',['ImmutableObject','MercuryIDs','MercuryParticipantsImage.react','MercuryParticipantsConstants','Pixelz.react','React','areEqual'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();'use strict';var o=m.PropTypes,p=m.createClass({displayName:'MercuryThreadImage',propTypes:{thread:o.instanceOf(h).isRequired,viewer:o.string.isRequired,size:o.number,useBackground:o.bool},shouldComponentUpdate:function(q,r){return (q.thread.image_src!==this.props.thread.image_src||!n(q.thread.participants,this.props.thread.participants)||q.size!==this.props.size||q.viewer!==this.props.viewer||q.useBackground!==this.props.useBackground);},render:function(){var q=this.props.size||k.BIG_IMAGE_SIZE,r=this.props.thread.image_src;if(r){if(this.props.useBackground)return (m.createElement('div',{style:{height:q,backgroundImage:'url('+r+')',backgroundPosition:'50% 50%',backgroundRepeat:'no-repeat',backgroundSize:'cover',width:q}}));return (m.createElement(l,{alt:'',height:q,resizeMode:'cover',src:r,width:q}));}var s=i.getParticipantIDFromUserID(this.props.viewer),t=this.props.thread.participants.filter(function(v){return v!==s;}),u=[];if(!t.length){u=[s];}else if(t.length==1){u=t;}else u=t.slice(0,3);return (m.createElement(j,{participants:u,size:q}));}});f.exports=p;},null);
  __d('MercuryShareAttachment.react',['BootloadedComponent.react','MercuryShareAttachmentReactShape','MercuryShareAttachmentRenderLocations','MercuryShareStyleMap','React','ReactDOM','cx','emptyFunction','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();'use strict';var q=l.PropTypes,r=l.createClass({displayName:'MercuryShareAttachment',propTypes:{attachment:i,location:q.oneOf(j.getValues()),onComponentLoaded:q.func.isRequired},getDefaultProps:function(){return {onComponentLoaded:o};},componentDidMount:function(){this._handleComponentLoad();},_renderComponent:function(s,t){if(this.props.location===j.MESSENGER)t=p("_52mr _2poz _ui9",t);return !!t?l.createElement('div',{className:t},s):s;},render:function(){var s=k.getStyleFactory(this.props.attachment);if(!s)return null;var t=s.attachment,u=s.factory;return (this._renderComponent(l.createElement(h,babelHelpers._extends({},this.props,{attachment:t,bootloadLoader:u.componentLoader,bootloadPlaceholder:l.createElement('div',null),module:u.componentName,onComponentLoad:this._handleComponentLoad})),u.cx&&u.cx.get(this.props.location)));},_handleComponentLoad:function(){var s=m.findDOMNode(this).children,t=0;for(var u=0;u<s.length;u++)t+=s[u].offsetHeight;this.props.onComponentLoaded(t);}});f.exports=r;},null);
  __d('Sticker.react',['Arbiter','Image.react','React','ReactDOM','StickerConfig','StickerConstants','cx','emptyFunction','getElementPosition','getObjectValues','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){if(c.__markCompiled)c.__markCompiled();'use strict';var s=j.PropTypes,t=83,u=5000,v=10,w={CLICK:'click',HOVER:'hover',LOAD_AND_HOVER:'load_and_hover'},x=j.createClass({displayName:'Sticker',propTypes:{animationTrigger:s.oneOf(q(w)),customLike:s.string,forceCursorPointer:s.bool,frameCount:s.number.isRequired,frameRate:s.number,framesPerCol:s.number.isRequired,framesPerRow:s.number.isRequired,onAttachmentLoad:s.func,onStickerClick:s.func,packID:s.string,sourceURI:s.string.isRequired,sourceWidth:s.number.isRequired,sourceHeight:s.number.isRequired,spriteURI:s.string,stickerID:s.string,subscribedThreadID:s.string,testID:s.string},getInitialState:function(){return {index:0,hasAnimated:false,unsubscribeID:null};},getDefaultProps:function(){return {forceCursorPointer:false,frameRate:t,onStickerClick:o,packID:null};},componentDidMount:function(){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(this.props.sourceHeight);this._stopIntervalID=0;if(this.props.animationTrigger===w.LOAD_AND_HOVER&&this.props.frameCount>1&&this.props.spriteURI)this.startAnimation();if(this.props.subscribedThreadID&&this.props.frameCount>1){var y=h.subscribe(this.props.subscribedThreadID,(function(z,aa){this.isScrolledIntoView(aa.scrollTop,aa.viewHeight,aa.top);}).bind(this));this.setState({unsubscribeID:y});}},componentWillUnmount:function(){if(this.state.unsubscribeID)h.unsubscribe(this.state.unsubscribeID);if(this.isAnimating())clearInterval(this._stopIntervalID);},isAnimating:function(){return !!this._stopIntervalID;},getWidth:function(){return Math.floor(this.props.sourceWidth);},getHeight:function(){return Math.floor(this.props.sourceHeight);},preloadSprite:function(){var y=new window.Image();y.onload=(function(){if(this.isMounted()&&!this.state.hasAnimated){this.setState({hasAnimated:true});this._stopIntervalID=setInterval(this.incrementFrameIndex,this.props.frameRate);}}).bind(this);if(l.ChatPaddedAnimatedStickerGK&&this.props.paddedSpriteURI){y.src=this.props.paddedSpriteURI;}else y.src=this.props.spriteURI;},isScrolledIntoView:function(y,z,aa){var ba=p(k.findDOMNode(this)),ca=y+ba.y-aa,da=y+z,ea=ca+ba.height;if(this.props.frameCount>1&&!this.state.hasAnimated&&ea-v<=da&&ca+v>=y)this.startAnimation();},startAnimation:function(){if(!this.state.hasAnimated&&this.props.spriteURI){this.preloadSprite();}else if(!this.isAnimating()){this.setState({hasAnimated:true});this._stopIntervalID=setInterval(this.incrementFrameIndex,this.props.frameRate);}},stopAnimation:function(){this.setState({index:0});clearInterval(this._stopIntervalID);this._stopIntervalID=0;},toggleAnimation:function(){if(this.isAnimating()){this.stopAnimation();}else this.startAnimation();},shouldStopAnimating:function(){var y=this.state.index%this.props.frameCount;if(!(y===0&&this.state.index*this.props.frameRate>u))return false;if(this.props.animationTrigger===w.CLICK)return true;return !this.state.isHovered;},incrementFrameIndex:function(){if(this.shouldStopAnimating()){this.stopAnimation();}else this.setState({index:this.state.index+1});},getStyle:function(){var y=0,z=this.props.spriteURI;if(l.ChatPaddedAnimatedStickerGK&&this.props.paddedSpriteURI){z=this.props.paddedSpriteURI;var aa=240/Math.min(this.getHeight(),this.getWidth());y=Math.floor(m.SPRITE_PADDING/aa);}var ba=this.state.index%this.props.frameCount,ca=ba%this.props.framesPerRow*(this.getWidth()+y*2)+y,da=Math.floor(ba/this.props.framesPerRow)*(this.getHeight()+y*2)+y,ea=this.props.frameCount>1&&this.props.animationTrigger===w.CLICK||this._isStickerClickable(this.props.packID),fa=this.props.forceCursorPointer||ea?'pointer':'default';if(!this.state.hasAnimated||!this.props.spriteURI){return {backgroundImage:this._isHotLike()?null:'url('+this.props.sourceURI+')',backgroundRepeat:'no-repeat',backgroundSize:this.getWidth()+'px '+this.getHeight()+'px',cursor:fa,height:this.getHeight(),width:this.getWidth()};}else return {backgroundImage:'url('+z+')',backgroundPosition:-ca+'px '+ -da+'px',backgroundSize:(this.getWidth()+y*2)*this.props.framesPerRow+'px '+(this.getHeight()+y*2)*this.props.framesPerCol+'px',cursor:fa,height:this.getHeight(),width:this.getWidth()};},_isStickerClickable:function(y){return y&&y!=m.MOBILE_LIKE_STICKER_PACK_ID&&y!=m.GRAVEYARD_PACK_ID;},onStickerClick:function(){if(!this._isStickerClickable(this.props.packID))return;if(this.props.onStickerClick)this.props.onStickerClick(this.props.packID,this.props.stickerID);},mouseLeft:function(){this.setState({isHovered:false});},mouseEntered:function(){this.setState({isHovered:true});if(!this.isAnimating())this.startAnimation();},tabFocusSelected:function(){this.setState({isHovered:true});if(!this.isAnimating())this.startAnimation();},tabFocusUnselected:function(){this.setState({isHovered:false});},render:function(){var y,z;if(this.props.animationTrigger===w.CLICK&&this.props.frameCount>1&&this.props.spriteURI){y=true;}else if((this.props.animationTrigger===w.HOVER||this.props.animationTrigger===w.LOAD_AND_HOVER)&&this.props.frameCount>1&&this.props.spriteURI)z=true;var aa=y?this.toggleAnimation:null;if(this.props.packID)aa=this.onStickerClick;var ba=this.props.className;if(this._isHotLike()){if(this.props.customLike){ba=r(ba,"_383m");return (j.createElement('div',{className:ba,'data-testid':this.props.testID,tabIndex:'0',onClick:aa,onMouseEnter:z?this.mouseEntered:null,onMouseLeave:z?this.mouseLeft:null,onFocus:this.tabFocusSelected,onBlur:this.tabFocusUnselected},j.createElement(i,{src:this.props.customLike})));}ba=r(ba,"_576q");}return (j.createElement('div',{className:ba,'data-testid':this.props.testID,tabIndex:'0',style:this.getStyle(),onClick:aa,onMouseEnter:z?this.mouseEntered:null,onMouseLeave:z?this.mouseLeft:null,onFocus:this.tabFocusSelected,onBlur:this.tabFocusUnselected}));},_isHotLike:function(){if(!!document.createElementNS&&!!document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect)return (this.props.stickerID===m.HOT_LIKE_SMALL_STICKER_ID||this.props.stickerID===m.HOT_LIKE_MEDIUM_STICKER_ID||this.props.stickerID===m.HOT_LIKE_LARGE_STICKER_ID);return false;}});f.exports=x;},null);
  __d("StickerUtils",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={getScaledDimensions:function(i,j,k){var l,m,n;if(j>i){n=k/j;l=i*n;m=j*n;}else{n=k/i;l=i*n;m=j*n;}return {height:Math.round(l),width:Math.round(m)};},capitalizeWords:function(i){var j=i.split(" ");for(var k=0;k<j.length;k++){var l=j[k].charAt(0).toUpperCase();j[k]=l+j[k].substr(1);}return j.join(" ");}};f.exports=h;},null);
  __d('MercuryAttachmentRenderer',['MercuryAttachmentAudioClip.react','ChatAttachmentAttribution.react','ImmutableObject','MercuryAttachment','MercuryAttachmentFile.react','MercuryAttachmentPhoto.react','MercuryAttachmentPhotoGrid.react','MercuryAttachmentVideo.react','MercuryMessageInfo','MercuryShareAttachment.react','MercuryShareAttachmentRenderLocations','MessengerHotLikeUtils','React','Sticker.react','StickerAssetType','StickerConstants','StickerImages','StickerUtils','cx','XStickerAssetController'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){if(c.__markCompiled)c.__markCompiled();'use strict';var ba={renderFile:function(ca,da){return (t.createElement(l,{name:ca.name,open_url:da?null:ca.open_url,rel:ca.rel,type:ca.icon_type,url:ca.url}));},renderAudioClip:function(ca,da){var ea=ca.metadata.duration/1000,fa=100,ga=da?160:400,ha=100;if(ea>=5)ha=(1-Math.pow(10,(ea-5)/-30))*(ga-fa)+fa;return [t.createElement(h,{duration:ca.metadata.duration/1000,key:'audioClip',rootClassName:k.hasAttribution(ca)?"_4yjw":'',showHelp:false,src:ca.url,width:ha}),t.createElement(i,{attachment:new j(ca),key:'audioAttribution'})];},renderVideo:function(ca,da,ea,fa){var ga=da?ca.metadata.chat_size:ca.metadata.inbox_size,ha=da?ca.metadata.chat_preview:ca.metadata.inbox_preview;return (t.createElement(o,{attachment:new j(ca),duration:ca.metadata.duration,isInbound:p.isInbound(ea),isChat:da,name:ca.name,onAttachmentLoad:fa,pageID:ca.metadata.pageid,thumbSize:ga,thumbnail:ha,videoSize:ca.metadata.dimensions,videoID:ca.metadata.fbid,videoURI:ca.url}));},constructStickerComponent:function(ca,da,ea,fa,ga,ha){var ia=fa?'chatScrolled/':'messengerScrolled/';ia+=ca.thread_id;if(!da){da=s.getMetadataForHotLike(ca.sticker_id);if(!da){var ja=x.getSticker(ca.sticker_id),ka=Object.assign({},ja),la=ja?y.getScaledDimensions(ja.height,ja.width,w.THREAD_SIZE):{height:w.THREAD_SIZE,width:w.THREAD_SIZE},ma=la.height,na=la.width;ka.height=ma;ka.width=na;ka.stickerID=ca.sticker_id;ka.spriteURI='';ka.spriteURI2x='';ka.paddedSpriteURI='';ka.paddedSpriteURI2x='';da=ka;}}var oa=null;if(da.stickerID){oa=da.stickerID.toString();}else if(ca.sticker_id)oa=ca.sticker_id.toString();var pa=null;if(da.packID)pa=da.packID.toString();var qa=aa.getURIBuilder().setInt('sticker_id',oa),ra=null,sa=null;if(window.devicePixelRatio&&window.devicePixelRatio>1){sa=da.paddedSpriteURI2x;ra=da.spriteURI2x;}else{sa=da.paddedSpriteURI;ra=da.spriteURI;}return (t.createElement(u,{animationTrigger:'hover',className:'mvs',customLike:ga,frameCount:da.frameCount||1,frameRate:da.frameRate||83,framesPerCol:da.framesPerCol||1,framesPerRow:da.framesPerRow||1,onAttachmentLoad:ha,onStickerClick:ea,packID:pa,paddedSpriteURI:sa,sourceHeight:da.height,sourceURI:qa.setEnum('image_type',v.IMAGE).getURI().toString(),sourceWidth:da.width,spriteURI:ra,stickerID:oa,subscribedThreadID:ia}));},renderPhotoAttachments:function(ca,da,ea,fa){var ga=ca.length;if(!ga)return null;if(ga===1){var ha=ca[0],ia=k.resizeContain({width:ea,height:ea},{width:ha.preview_width,height:ha.preview_height});return (t.createElement('div',{className:"_55pk"+(' '+"_59go")+(k.hasAttribution(ha)?' '+"_4yjw":'')},t.createElement(m,{image:ha,width:ia.width,height:ia.height,message:da,onAttachmentLoad:fa}),t.createElement(i,{attachment:new j(ca[0])})));}return (t.createElement('div',{className:"_55pk"},t.createElement(n,{images:ca,size:ea,message:da})));},sortAttachmentsStablyByType:function(ca){var da=[k.isPhotoAttachment,k.isShareAttachment,k.isFileAttachment,k.isErrorAttachment];da.push(function(fa){return true;});var ea=da.map(function(fa){return [];});ca.forEach(function(fa){for(var ga=0;ga<da.length;ga++)if(da[ga](fa)){ea[ga].push(fa);break;}});return Array.prototype.concat.apply([],ea);},constructStoryBasedShareAttachment:function(ca,da,ea,fa,ga){var ha=ea?r.CHAT:r.WEB_INBOX;return (t.createElement('div',{className:!!ca.body&&ea?"_r38":''},t.createElement(q,{attachment:da.share,location:ha,maxWidth:fa,onComponentLoaded:ga})));}};f.exports=ba;},null);
  __d('MercuryAttachments.react',['MercuryAttachmentRenderer','ImmutableObject','MercuryAttachment','MercuryAttachmentMalicious.react','MessengerHotLikePreview.react','React','SubscriptionsHandler','emptyFunction'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();'use strict';var p=m.PropTypes,q=m.createClass({displayName:'MercuryAttachments',propTypes:{attachments:p.array.isRequired,customLike:p.string,maxWidth:p.number.isRequired,message:p.instanceOf(i).isRequired,isChat:p.bool,onAttachmentLoad:p.func,onStickerClick:p.func},getDefaultProps:function(){return {isChat:false,onAttachmentLoad:o,onStickerClick:o};},_onAttachmentLoad:function(r){this.props.onAttachmentLoad&&this.props.onAttachmentLoad(r);},_subscriptionsHandler:null,componentDidMount:function(){this._subscriptionsHandler=new n();},componentWillUnmount:function(){this._subscriptionsHandler&&this._subscriptionsHandler.release();},_renderAttachment:function(r){if(j.isStickerAttachment(r)){return h.constructStickerComponent(this.props.message,this.props.attachments[0].metadata,this.props.onStickerClick,this.props.isChat,this.props.customLike,this._onAttachmentLoad);}else if(j.isVoiceAttachment(r)){return h.renderAudioClip(this.props.attachments[0],this.props.isChat);}else if(j.isVideoAttachment(r)){return h.renderVideo(r,this.props.isChat,this.props.message,this._onAttachmentLoad);}else if(j.isShareAttachment(r)){return h.constructStoryBasedShareAttachment(this.props.message,r,this.props.isChat,this.props.maxWidth,this._onAttachmentLoad);}else if(j.isFileAttachment(r))return h.renderFile(r,this.props.isChat);return m.createElement(k,null);},render:function(){if(this.props.message.is_like_preview)return (m.createElement(l,{isChat:this.props.isChat,key:'hlp:'+this.props.message.like_preview_since,since:this.props.message.like_preview_since,customLike:this.props.customLike}));if(this.props.attachments.length===0)return m.createElement('div',this.props);var r=h.renderPhotoAttachments(this.props.attachments.filter(j.isPhotoAttachment),this.props.message,this.props.maxWidth,this._onAttachmentLoad),s=h.sortAttachmentsStablyByType(this.props.attachments.filter(function(t){return !j.isPhotoAttachment(t);})).map((function(t,u){return (m.createElement('span',{key:u},this._renderAttachment(t)));}).bind(this));return (m.createElement('div',this.props,r,s));}});f.exports=q;},null);
  __d('MercuryDataSources',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={},i={add:function(j,k){h[j]=k;},get:function(j){!h[j];return h[j];}};f.exports=i;},null);
  __d('MercuryTypeahead',['Event','ArbiterMixin','DOM','DOMDimensions','Input','Keys','MercuryTypeaheadTemplates','Tokenizer','Typeahead','TypeaheadCore','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){if(c.__markCompiled)c.__markCompiled();var s=function(t,u){this._domElement=null;this._typeahead=null;this._tokenizer=null;this._placeholder='';this._exclusions=[];this._viewNodeOrID=null;this._viewOptions={renderer:'compact',autoSelect:true};this._tokenizerBehaviors=[];this._heightPrev=null;this._dataSource=t;this._view=u;};Object.assign(s.prototype,i);Object.assign(s.prototype,{setPlaceholder:function(t){this._placeholder=t;return this;},setExcludedParticipantsFromThreadMeta:function(t){if(!t)return;if(!t.former_participants){this.setExcludedParticipants(t.participants);return;}var u=t.former_participants.filter(function(v){return v.is_friend===false;}).map(function(v){return v.id;});this.setExcludedParticipants(u.concat(t.participants));},setExcludedParticipants:function(t){this._exclusions=[];t.forEach((function(u){var v=u.indexOf(':');if(u.substr(0,v)=='fbid')this._exclusions.push(u.substr(v+1));}).bind(this));return this;},setViewNodeID:function(t){this._viewNodeOrID=t;},setViewNode:function(t){this._viewNodeOrID=t;},setFullWidthView:function(t){var u=j.create('div',{className:"_4ck uiTypeaheadView"});j.setContent(t,u);this.setViewNode(u);},setViewOption:function(t,u){this._viewOptions[t]=u;},addTokenizerBehavior:function(t){this._tokenizerBehaviors.push(t);},build:function(t){if(this._domElement)return;var u=n[':fb:mercury:tokenizer'].build(),v=n[':fb:mercury:typeahead'].build();this._domElement=u.getRoot();j.appendContent(this._domElement,v.getRoot());var w=v.getNode('textfield');l.setPlaceholder(w,this._placeholder);w.setAttribute('data-placeholder',this._placeholder);this._input=w;var x={node_id:this._viewNodeOrID,ctor:this._view,options:this._viewOptions},y={ctor:q,options:{setValueOnSelect:true}};this._typeahead=new p(this._dataSource,x,y,v.getRoot());this._typeahead.init();var z={inline:true,behaviors:this._tokenizerBehaviors};this._tokenizer=new o(this._domElement,this._typeahead);this._tokenizer.init(u.getNode('tokenarea'),'participants',[],z);this._tokenizer.subscribe(['addToken','removeToken','removeAllTokens'],this._tokensChanged.bind(this));this._tokenizer.subscribe('resize',(function(){this.inform('resize');}).bind(this));h.listen(w,'focus',(function(){this._resetDataSource();this._typeahead.init();}).bind(this));h.listen(this._domElement,'click',this.focus.bind(this));h.listen(w,'keydown',this.keydown.bind(this));this._heightPrev=k.getElementDimensions(this._domElement).height;},getElement:function(){return this._domElement;},getSelectedParticipantIDs:function(){var t=[];if(this._tokenizer)(this._tokenizer.getTokenValues()||[]).forEach(function(u){t.push('fbid:'+u);});return t;},getTokens:function(){var t=[];if(this._tokenizer)t=this._tokenizer.getTokens();return t;},getTokenizer:function(){return this._tokenizer;},keydown:function(event){if(this._tokenizer.inline&&event.keyCode==m.ESC){if(l.isEmpty(this._input)){var t=this._tokenizer.getLastToken();if(t&&t.isRemovable()){this._tokenizer.removeToken(t);event.stopPropagation();return;}}else{this._typeahead.getCore().reset();event.stopPropagation();return;}this.inform('esc-pressed');return;}if(l.isEmpty(this._input)&&this._tokenizer.inline&&event.keyCode===m.RETURN){event.preventDefault();return this.inform('tokens-return');}},reset:function(){this._tokenizer&&this._tokenizer.removeAllTokens();this._typeahead&&this._typeahead.getCore().reset();},focus:function(){this._tokenizer&&this._tokenizer.focusInput();},getTypeahead:function(){return this._typeahead;},_resetDataSource:function(){this._dataSource.setExclusions(this._exclusions);},_tokensChanged:function(){this.inform('tokens-changed');}});f.exports=s;},null);
  __d('MercuryTypeaheadRenderer',['Event','Badge.react','CSS','DOM','Image.react','MercuryTypeaheadConstants','MercuryParticipantsConstants','React','ReactDOM','MercuryTypeaheadTemplates','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){if(c.__markCompiled)c.__markCompiled();function s(u,v){var w;switch(u.type){case m.HEADER_TYPE:w=q[':fb:mercury:typeahead:header'].build();s.renderHeader(w,u);break;case m.USER_TYPE:case m.PAGE_TYPE:w=q[':fb:mercury:typeahead:result'].build();s.renderPerson(w,u);break;default:throw new Error('Unsupported result type: '+u.type);}return w.getRoot();}Object.assign(s,{renderHeader:function(u,v){if(v.disabled){j.hide(u.getRoot());return;}var w=v.getLinkHandler&&v.getLinkHandler();if(w){var x=u.getNode('link');k.setContent(x,v.linkText);h.listen(x,'click',w);}else j.hide(u.getNode('link'));u.setNodeContent('text',v.text);},renderPersonWithBigPhoto:function(u,v){t(u,v,n.BIG_IMAGE_SIZE);},renderPerson:function(u,v){t(u,v,n.IMAGE_SIZE);},renderPage:function(u,v){t(u,v,n.IMAGE_SIZE);}});function t(u,v,w){if(v.photo){var x=o.createElement(l,{width:w,height:w,src:v.photo});p.render(x,u.getNode('image'));}if(v.text){k.setContent(u.getNode('name'),v.text);u.getRoot().setAttribute('aria-label',v.text);}var y=[];if(v.subtext||v.category){if(v.subtext)y.push(v.subtext);if(v.category)y.push(v.category);k.appendContent(u.getNode('snippet'),y.join(" \u00b7 "));}var z=null;if(v.is_verified){z=o.createElement(i,{type:'verified',size:'xsmall'});p.render(z,u.getNode('badge'));}else if(v.is_work_user){z=o.createElement(i,{type:'work',size:'xsmall'});p.render(z,u.getNode('badge'));}if(v.non_employee){if(y.length)k.prependContent(u.getNode('snippet')," \u00b7 ");var aa=k.create('span',{className:"_52l8 highlight"},'(Non-Employee)');k.prependContent(u.getNode('snippet'),aa);}}f.exports=s;},null);
  __d('WebMessengerAddPeopleToConversationDialog',['ContextualTypeaheadView','Dialog','DOM','MercuryAPIArgsSource','MercuryDataSources','MercuryIDs','MercuryLogMessageType','MercurySourceType','MercuryTypeahead','MercuryTypeaheadConstants','MercuryTypeaheadRenderer','WebMessengerTemplates','WorkModeConfig','fbt','MercuryMessageObject','MercuryMessageActions','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){if(c.__markCompiled)c.__markCompiled();var v=c('MercuryMessageObject').get(),w=c('MercuryMessageActions').get(),x=c('MercuryThreads').get(),y={show:function(aa){var ba=u._("Add People"),ca={};ca[q.FRIEND_TYPE]={uid:q.FRIEND_TYPE,type:q.HEADER_TYPE,disabled:true};ca[q.NON_FRIEND_TYPE]={uid:q.NON_FRIEND_TYPE,text:u._("Other People"),type:q.HEADER_TYPE};var da=new p(l.get('MercuryRecipientsDataSource'),h);da.setViewOption('renderer',r);da.setViewOption('typeObjects',ca);var ea=t.is_work_user?u._("Add co-workers to this chat"):u._("Add friends to this chat");da.setPlaceholder(ea);var fa=[];fa.push({name:'subscribe',label:ba,handler:z.bind(null,aa,da)});fa.push(i.CANCEL);var ga=s[':fb:web-messenger:add-people-dialog'].build(),ha=new i().setTitle(ba).setBody(ga.getRoot()).setButtons(fa).showLoading();x.getThreadMeta(aa,function(ia){da.setFullWidthView(ga.getNode('participantsTypeahead'));da.setExcludedParticipantsFromThreadMeta(ia);da.build();j.appendContent(ga.getNode('participantsTypeahead'),da.getElement());ha.show();da.focus();},k.WEBMESSENGER);}};function z(aa,ba){var ca=ba.getTokens(),da=ca.map(function(ea){return m.getParticipantIDFromUserID(ea.getValue());});if(!da.length)return false;w.send(v.constructLogMessageObject(o.TITAN_WEB,aa,n.SUBSCRIBE,{added_participants:da}),null,k.WEBMESSENGER);return true;}f.exports=y;},null);
  __d("Autosize",["CSS","cx","DOM","Style"],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();var l=['fontFamily','fontStyle','fontVariant','fontWeight','letterSpacing','textDecoration','textIndent','textTransform','whiteSpace','wordSpacing','wordWrap'],m=/^[0-9]+$/;function n(s){var t=s.cloneNode(true);h.addClass(t,"_4g");var u=s.clientWidth-k.getFloat(s,'paddingLeft')-k.getFloat(s,'paddingRight');k.set(t,'width',u+'px');var v=s.clientHeight-k.getFloat(s,'paddingTop')-k.getFloat(s,'paddingBottom');k.set(t,'height',v+'px');j.insertAfter(s,t);return t;}function o(s,t,u,v,w){var x=s.style.fontSize,y=s.style.height;k.set(s,"height","auto");if(t!==null){var z=s.style.width;k.set(s,"width","auto");}var aa=0,ba=w.length-1;while(aa<ba){var ca=Math.ceil((aa+ba)/2);k.set(s,"font-size",w[ca]+v);if(u!==null&&s.scrollHeight>u||t!==null&&s.scrollWidth>t){ba=ca-1;}else aa=ca;}s.style.fontSize=x;s.style.height=y;if(t!==null)s.style.width=z;return w[aa]+v;}function p(s,t,u,v,w,x){var y=s.style.fontSize,z=s.style.height;k.set(s,"height","auto");if(t!==null){var aa=s.style.width;k.set(s,"width","auto");}k.set(s,"font-size",x+v);if((u===null||s.scrollHeight<=u)&&(t===null||s.scrollWidth<=t)){s.style.fontSize=y;s.style.height=z;if(t!==null)s.style.width=aa;return x+v;}k.set(s,"font-size",w+v);if(u!==null&&s.scrollHeight>u||t!==null&&s.scrollWidth>t){s.style.fontSize=y;s.style.height=z;if(t!==null)s.style.width=aa;return w+v;}while(w+1<x){var ba=Math.ceil((w+x)/2);k.set(s,"font-size",ba+v);if(u!==null&&s.scrollHeight>u||t!==null&&s.scrollWidth>t){x=ba;}else w=ba;}s.style.fontSize=y;s.style.height=z;if(t!==null)s.style.width=aa;return w+v;}function q(s,t){this._wrap=s;this._attr=t;if(this._attr.sizes){var u=this._attr.sizes;for(var v=1,w=u.length;v<w;v++){if(u[v-1]<=u[v])continue;u.sort(function(y,z){return y-z;});break;}}else if(t.min>t.max){var x=t.min;t.min=t.max;t.max=x;}this.fit();}q.prototype.fit=function(s,t){var u=this._wrap;if(!u.clientWidth){r.push(this);return;}var v=n(u);if(typeof s==="undefined")s=this._attr.width;if(m.test(s)){v.style.width=s+"px";}else if(s!==null&&s!=="auto")v.style.width=s;if(typeof t==="undefined")t=this._attr.height;if(m.test(t)){v.style.height=t+"px";}else if(t!==null&&t!=="auto")v.style.height=t;var w=null;if(!this._attr.wrap)w=v.clientWidth;var x=null;if(this._attr.wrap||t!==null)x=v.clientHeight;var y;if(this._attr.sizes){y=o(v,w,x,"px",this._attr.sizes);}else y=p(v,w,x,"px",this._attr.min,this._attr.max);j.remove(v);k.set(u,"font-size",y);h.removeClass(u,"invisible_elem");};var r=[];q.onNodeInserted=function(){var s=r;r=[];s.forEach(function(t){t.fit();});};f.exports=q;},null);
  __d('MercuryPresence',['Arbiter','AvailableListConstants','DOM','CSS','requireWeak','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n={},o={},p={updateOnPresenceChanges:function(v,w){o[w.tagName]=true;n[v]=true;k.addClass(w,'presenceListener_'+v);var x=q(v);r(w,x.classes);s(w,x.label);}};function q(v){var w=u(v),x={presenceActive:false,presenceMobile:false},y=null;switch(w){case i.ACTIVE:x.presenceActive=true;y=m._("Active");break;case i.MOBILE:x.presenceMobile=true;y=m._("Mobile");break;default:break;}return {classes:x,label:y};}function r(v,w){for(var x in w)k.conditionClass(v,x,w[x]);}function s(v,w){if(v&&w){var x=j.create('span',{className:'accessible_elem'},w);j.setContent(v,x);}}function t(){for(var v in n){var w=q(v);for(var x in o){var y=j.scry(document,x+'.presenceListener_'+v);for(var z=0;z<y.length;z++){r(y[z],w.classes);s(y[z],w.label);}}}}var u=function(v){return i.OFFLINE;};l('AvailableList',function(v){u=v.get;t();});h.subscribe(i.ON_AVAILABILITY_CHANGED,t);f.exports=p;},null);
  __d('WebMessengerStateConstants',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={STATE_CHANGE_EVENT:'state-changed',DETAIL:{COMPOSE_MAIN:'compose-main',COMPOSE_TYPEAHEAD_RESULTS:'compose-typeahead-results',COMPOSE_ALL_PEOPLE_RESULTS:'compose-all-people-results',RECENT_MESSAGES:'recent-messages',SEARCH_CONTEXT:'search-context',SEARCH_SNIPPET:'search-snippet',SEARCH_THREAD_SNIPPET:'search-thread-snippet',SHARED_PHOTOS:'shared-photos'},MASTER:{RECENT_THREADS:'recent-threads',SEARCH:'search'},MESSAGE_ACTION:{DELETE:'delete'}};f.exports=h;},null);
  __d('WebMessengerOldToNewPermalink',['WebMessengerPermalinkConstants','WebMessengerStateConstants'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();function j(o){if(!k(o))return o;l(o);n(o);m(o);return o;}function k(o){var p=o.getQueryData();if(p.sk)switch(p.sk){case 'inbox':o.setPath(h.BASE_PATH);o.removeQueryData('sk');break;case 'other':o.setPath(h.OTHER_PATH);o.removeQueryData('sk');break;default:return false;}return true;}function l(o){var p=o.getQueryData();switch(p.action){case 'read':if(!p.tid){o.addQueryData({action:i.DETAIL.RECENT_MESSAGES});}else o.removeQueryData('action');break;}}function m(o){var p=o.getQueryData();if(p.tid){o.setPath(h.getURIPathForThreadID(p.tid,o.getPath()));o.removeQueryData('tid');}}function n(o){var p=o.getQueryData();if(!o.getPath().match(h.SEARCH_POSTFIX_PATH)&&p.action!=i.DETAIL.SEARCH_SNIPPET&&!p.mid){var q=p.query;if(p.query){var r=/\bis:(archived|spam)\b(.*)/,s=r.exec(p.query);if(s){switch(s[1]){case 'archived':o.setPath(h.ARCHIVED_PATH);break;case 'spam':o.setPath(h.SPAM_PATH);break;}var t=p.query.substr(0,p.query.length-s[0].length),u=s[2];q=(t.trim()+' '+u.trim()).trim();}}if(p.thread_query){o.setPath(o.getPath()+h.SEARCH_POSTFIX_PATH);o.setQueryData({query:p.thread_query});}else if(q){o.setPath(o.getPath()+h.SEARCH_POSTFIX_PATH);o.addQueryData({query:q});}else o.removeQueryData('query');}}f.exports=j;},null);
  __d('WebMessengerStateStore',['MercuryAssert','PresenceState'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=null;function k(){var m=i.get();if(m&&m.wml)return m.wml;return {};}i.registerStateStorer(function(m){if(j)m.wml=j;j=null;});var l={getLastSeenThreadID:function(){var m=k();return m.thread_id||null;},getLastSeenFolder:function(){var m=k();return m.folder||null;},setLastSeen:function(m,n){n&&h.isThreadID(n);j={folder:m,thread_id:n||null};i.doSync();}};f.exports=l;},null);
  __d('WebMessengerPermalinks',['MercuryAPIArgsSource','MercuryConfig','MercuryFilters','MercuryIDs','MercuryParticipants','MercuryParticipantTypes','MercuryTypeaheadConstants','MessagingTag','WebMessengerOldToNewPermalink','WebMessengerPermalinkConstants','WebMessengerStateConstants','WebMessengerStateStore','Token','URI','WebMessengerPreferences','WWWBase','MercuryUnreadState','isWebMessengerURI','goURI','MercuryThreadIDMap','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){if(c.__markCompiled)c.__markCompiled();var aa=c('MercuryThreadIDMap').get(),ba=c('MercuryThreads').get(),ca='(/|\\?|$)',da={getDefaultURI:function(){var qa=new u(w.uri);qa.setPath(q.BASE_PATH);return qa;},goNextURI:function(qa,ra,sa,ta){if(ma(qa,ra,sa)){var ua=da.getURI(qa,ra,sa);z(ua,false,ta);return true;}return false;},getURI:function(qa,ra,sa){var ta=da.getDefaultURI();if(!qa||!ra||!sa)return ta;switch(sa.folder){case o.OTHER:ta.setPath(q.OTHER_PATH);break;case o.ACTION_ARCHIVED:ta.setPath(q.ARCHIVED_PATH);break;case o.SPAM:ta.setPath(q.SPAM_PATH);break;case o.PENDING:i.CoreGraphEnabled&&ta.setPath(q.PENDING_PATH);break;}if(sa.filter&&sa.filter!=j.ALL)ta.addQueryData({filter:sa.filter});var ua;switch(qa){case r.MASTER.SEARCH:ua=false;ta.setPath(ta.getPath()+q.SEARCH_POSTFIX_PATH);break;}switch(ra){case r.DETAIL.COMPOSE_MAIN:case r.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:case r.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:ta.setPath(ta.getPath()+q.COMPOSE_POSTFIX_PATH);ua=false;break;case r.DETAIL.RECENT_MESSAGES:ua=!sa.thread_id;break;case r.DETAIL.SEARCH_CONTEXT:case r.DETAIL.SHARED_PHOTOS:ua=false;break;default:ua=true;break;}if(ua)ta.addQueryData({action:ra});if(sa.thread_id){var va=k.getUserIDFromThreadID(sa.thread_id),wa=va&&l.getNow(k.getParticipantIDFromUserID(va));if(wa&&wa.type!==m.EVENT){var xa=wa&&wa.vanity||va;ta.setPath(q.getURIPathForIDOrVanity(xa,ta.getPath()));}else{var ya=aa.getServerIDFromClientIDNow(sa.thread_id),za=ya?ya:sa.thread_id;ta.setPath(q.getURIPathForThreadID(za,ta.getPath()));}}if(sa.query)ta.addQueryData({query:sa.query});if(sa.message_query)ta.addQueryData({mquery:sa.message_query});if(sa.message_id)ta.addQueryData({mid:sa.message_id});if(sa.reuse_composer)ta.addQueryData({rc:true});if(sa.isStandaloneMode)ta.addQueryData({standalone:true});return ta;},processURI:function(qa){qa=p(qa);if(!y(qa))return false;var ra,sa=na(qa),ta=!sa.master_state||!sa.detail_state;if(ta){ra=oa(qa);}else{ra={data:{folder:ka(qa),filter:la(qa)},redirect:false,master_state:sa.master_state,detail_state:sa.detail_state};if(qa.getQueryData().rc)ra.data.reuse_composer=true;ra=ha(qa,ra);}ra.data.isStandaloneMode=qa.getQueryData().standalone;if(ta)return ra;switch(sa.detail_state){case r.DETAIL.RECENT_MESSAGES:return ja(qa,ra);case r.DETAIL.COMPOSE_MAIN:return ea(qa,ra);case r.DETAIL.SEARCH_SNIPPET:ra=ia(qa,ra);return ra;case r.DETAIL.SEARCH_CONTEXT:ra=ja(qa,ra);ra=ia(qa,ra);return ga(qa,ra);}ra.redirect=true;ra.detail_state=null;return ra;}};function ea(qa,ra){var sa=null;if(qa.getQueryData().to)sa=[].concat(qa.getQueryData().to);return fa(sa,ra);}function fa(qa,ra){if(qa){ra.data.new_tokens=[];qa.forEach(function(sa){var ta=l.getNow(k.getParticipantIDFromUserID(sa));if(ta){var ua={uid:sa,text:ta.name,type:n.USER_TYPE};ra.data.new_tokens.push(new t(ua));}});}ra.data.start=true;return ra;}function ga(qa,ra){var sa=qa.getQueryData().mid;if(sa){ra.data.message_id=sa;}else ra.redirect=true;return ra;}function ha(qa,ra){var sa=qa.getQueryData().query;ra.data.query=sa;return ra;}function ia(qa,ra){var sa=qa.getQueryData().mquery;ra.data.message_query=sa;return ra;}function ja(qa,ra){var sa=q.getThreadIDFromURI(qa);if(sa){var ta=k.isValidThreadID(sa)?sa:aa.getClientIDFromServerIDNow(sa);if(ta){ra.data.thread_id=ta;}else ra.redirect=true;}else{var ua=q.getUserIDOrVanity(qa.getPath());if(ua){var va=l.getIDFromVanityOrFBID(ua),wa=va&&ba.getCanonicalThreadToParticipant(va,null,h.WEBMESSENGER);if(wa){if(wa.timestamp){ra.data.thread_id=wa.thread_id;}else{ra.detail_state=r.DETAIL.COMPOSE_MAIN;ra=fa([k.getUserIDFromParticipantID(va)],ra);}}else ra.redirect=true;}}return ra;}function ka(qa,ra){var sa=qa.getPath();if(sa.match('^'+q.ARCHIVED_PATH+ca))return o.ACTION_ARCHIVED;if(sa.match('^'+q.OTHER_PATH+ca))return o.OTHER;if(sa.match('^'+q.SPAM_PATH+ca))return o.SPAM;if(i.CoreGraphEnabled&&sa.match('^'+q.PENDING_PATH+ca))return o.PENDING;if(ra!==undefined)return ra;return o.INBOX;}function la(qa){return qa.getQueryData().filter||j.ALL;}function ma(qa,ra,sa){if(ra===r.DETAIL.SEARCH_CONTEXT||ra===r.DETAIL.SEARCH_THREAD_SNIPPET||ra===r.DETAIL.SHARED_PHOTOS)return false;if(sa&&sa.no_uri===true){delete sa.no_uri;return false;}var ta=ra==r.DETAIL.COMPOSE_MAIN||ra==r.DETAIL.COMPOSE_TYPEAHEAD_RESULTS||ra==r.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;if(ta&&(!sa.start||sa.new_tokens))return false;if(!qa||!ra||!sa)return true;if(sa.bug_reporting_enabled)return false;return !sa.message_action;}function na(qa){var ra={},sa=qa.getPath(),ta=qa.getQueryData(),ua=sa.match(q.BASE_PATH+'(/[^/]+)?'+q.SEARCH_POSTFIX_PATH+ca);ra.master_state=ua&&ta.query?r.MASTER.SEARCH:r.MASTER.RECENT_THREADS;if(ta.action){ra.detail_state=ta.action;return ra;}if(sa.match('(?:'+q.BASE_PATH+'|'+q.OTHER_PATH+')'+'(/[^/]+)?'+q.COMPOSE_POSTFIX_PATH+ca)){ra.detail_state=r.DETAIL.COMPOSE_MAIN;return ra;}if(sa.match(q.TID_POSTFIX_PARTIAL_PATH)||q.getUserIDOrVanity(sa)){if(ta.mid&&ta.mquery){ra.detail_state=r.DETAIL.SEARCH_CONTEXT;}else ra.detail_state=r.DETAIL.RECENT_MESSAGES;}else if(ta.mquery)ra.detail_state=r.DETAIL.SEARCH_SNIPPET;return ra;}function oa(qa){var ra=ka(qa,null)||s.getLastSeenFolder(),sa=s.getLastSeenThreadID()||pa(ra||o.INBOX),ta=x.get();if(ra===o.OTHER&&ta.getUnreadCount(ra)===0){var ua=o.INBOX;if(ta.exceedsMaxCount(ua)||ta.getUnreadCount(ua)>0)ra=ua;}var va={redirect:!!sa||!!ra,replace:true,master_state:r.MASTER.RECENT_THREADS,detail_state:r.DETAIL.RECENT_MESSAGES,data:{folder:ra||o.INBOX,filter:j.ALL,thread_id:sa}};return va;}function pa(qa){var ra=v.lastReadThreadForFolder[qa];if(ra){var sa=ra.other_user_fbid||ra.thread_fbid;return aa.getClientIDFromServerIDNow(sa);}else return null;}f.exports=da;},null);
  __d('WebMessengerStateManager',['Arbiter','CurrentUser','Dialog','Focus','JSLogger','MercuryFilters','MessagingTag','WebMessengerPermalinks','WebMessengerStateConstants'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();var q=l.create('wm_state_manager'),r=i.getID(),s=false,t=Object.assign(new h(),{getCurrentUserID:function(){return r;},getCurrentMasterState:function(){return w;},getCurrentDetailState:function(){return x;},getCurrentStateData:function(){return y;},getStandaloneMode:function(){return s;},setUserID:function(aa){r=aa||i.getID();},setStandaloneMode:function(aa){s=Boolean(aa);},updateMasterState:function(aa,ba){t.updateAllStates(aa,x,ba);},updateDetailState:function(aa,ba){t.updateAllStates(w,aa,ba);},updateAllStates:function(aa,ba,ca){for(var da=0;da<z.length;da++)if(z[da]){var ea=z[da](aa,ba,ca);if(ea){q.log('confirmation_dialog',{master_state:w,detail_state:x,data:y,new_master_state:aa,new_detail_state:ba,new_data:ca});ea.setHandler(u.bind(null,aa,ba,ca)).show();var fa=ea.getButtonElement(j.OK.label);fa&&k.set(fa);return;}}u(aa,ba,ca);},updateStateOnURI:function(aa,ba,ca){v(aa,ba,ca);},registerConfirmationBeforeStateUpdate:function(aa){var ba=z.length;z.push(aa);return ba;},unregisterConfirmationBeforeStateUpdate:function(aa){delete z[aa];}});function u(aa,ba,ca){if(!ca.folder)ca.folder=y.folder;if(!ca.filter)ca.filter=y.filter;ca.isStandaloneMode=t.getStandaloneMode();if(!o.goNextURI(aa,ba,ca))v(aa,ba,ca);}function v(aa,ba,ca){w=aa;x=ba;y=ca;var da=babelHelpers._extends({},y);da.new_tokens=[];(y.new_tokens||[]).forEach(function(ea){da.new_tokens.push(ea.getInfo());});da.new_tokens=[];q.log('state_updated',{master_state:w,detail_state:x,data:da});t.inform(p.STATE_CHANGE_EVENT);}var w=p.MASTER.RECENT_THREADS,x=p.DETAIL.RECENT_MESSAGES,y={thread_id:null,folder:n.INBOX,filter:m.ALL},z=[undefined];f.exports=t;},null);
  __d('MercurySeenByAll',['CSS','DataStore','MercuryDelayedRoger','DOM','MercuryIDs','MercuryViewer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n=c('MercuryThreads').get(),o={},p={updateOnSeenChange:function(r,s,t){o[r.tagName]=true;i.set(r,'thread-id',s.thread_id);h.addClass(r,'seenByListener');q(r,s,t);}};function q(r,s,t){var u=null;if(t){u=l.getParticipantIDFromUserID(t);}else u=m.getID();var v=s.participants.filter(function(x){return x!==u;}),w=s.participants.length>0&&s.participants[0]===u;h.conditionClass(r,'repliedLast',w);h.conditionClass(r,'seenByAll',w&&j.getSeenBy(s.thread_id).length===v.length);}j.subscribe('state-changed',function(r,s){for(var t in o){var u=k.scry(document.body,t+'.seenByListener');for(var v=0;v<u.length;v++){var w=u[v],x=i.get(w,'thread-id');if(s[x])n.getThreadMeta(x,function(y){q(w,y);});}}});f.exports=p;},null);
  __d('MercuryThreadMetadataRenderer',['CSS','DOM','Emoji','HTML','JSLogger','MercuryAttachmentType','MercuryIDs','MercuryMessageSourceTags','MercurySingletonMixin','MercuryThreadImage.react','MercuryThreadIDMap','MercuryThreadMetadataRawRenderer','MercuryThreadTitle.react','MercuryParticipants','React','ReactDOM','MercurySeenByAll','MercuryServerRequests','Style','MercuryThreads','Tooltip','URI','WebMessengerThreadPermalinks','arrayContains','createArrayFromMixed','cx','formatDate','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia){if(c.__markCompiled)c.__markCompiled();var ja=l.create('wm_timestamp');function ka(pa){this._fbid=pa;this._serverRequests=y.getForFBID(pa);this._threads=aa.getForFBID(pa);this._threadIDMap=r.getForFBID(pa);}Object.assign(ka,p);Object.assign(ka.prototype,{renderTimestamp:function(pa,qa,ra,sa){if(sa){if(!qa){ja.warn('no_title');qa=new Date(sa).toLocaleDateString();}pa.setAttribute('title',qa);pa.setAttribute('data-utime',sa/1000);if(!ra){ja.warn('no_display');ra=ha(new Date(sa),'g:ia');}i.setContent(pa,ra);h.show(pa);}},renderMessageSourceTags:function(pa,qa,ra,sa){var ta='',ua='',va='';if(ea(ra,o.MESSENGER)){ta=ia._("Sent from Messenger");ua=new ca('/mobile/messenger');va="_9g";}else if(ea(ra,o.MOBILE)){ta=ia._("Sent from Mobile");ua=new ca('/mobile/');va="_9j";}else if(ea(ra,o.CHAT)){ta=ia._("Sent from chat");va="_9h";}else if(ea(ra,o.EMAIL)){if(sa){ta=ia._("Sent from {email}",[ia.param('email',sa)]);}else ta=ia._("Sent from email");va="_9i";}if(va){ba.set(pa,ta);h.addClass(qa,va);if(ua){pa.setAttribute('href',ua);}else pa.removeAttribute('href');}else h.hide(pa);},renderSpoofWarning:function(pa,qa,ra){if(qa){h.addClass(pa,"_sa");ba.set(pa,ia._("Unable to confirm {name_or_email} as the sender.",[ia.param('name_or_email',ra.name)]));}},renderChatSpoofWarning:function(pa,qa,ra){if(qa)i.appendContent(pa,ia._("Unable to confirm {name_or_email} as the sender.",[ia.param('name_or_email',ra.name)]));},renderCoreThreadlist:function(pa,qa,ra,sa,ta){sa=sa||{};this.renderThreadImage(pa,qa.getNode('image'));var ua=qa.getNode('accessibleName'),va=[qa.getNode('name')];if(ua)va.push(ua);oa(this,pa,va,sa);if(pa.folder&&ta)na(qa.getNode('folderBadge'),pa.folder);var wa=qa.getNode('timestamp');this.renderTimestamp(wa,pa.timestamp_absolute,pa.timestamp_relative,pa.timestamp);this.renderSnippet(pa,qa.getNode('snippet'));ma(qa,pa);ra(qa,pa);},renderAndSeparatedParticipantList:function(pa,qa,ra){ra=ra||{};ra.last_separator_uses_and=true;this._threads.getThreadMeta(pa,(function(sa){oa(this,sa,qa,ra);}).bind(this));},renderSnippet:function(pa,qa){var ra=false,sa=i.create('span');h.addClass(sa,'MercuryRepliedIndicator');i.appendContent(qa,sa);x.updateOnSeenChange(sa,pa,this._fbid);var ta=pa.snippet;if(ta){if(pa.snippet_has_attachment)i.appendContent(qa,i.create('span',{className:'MercuryAttachmentIndicator'}));if(ta.substr(0,4)=='?OTR'){ta=ia._("[encrypted message]");}else ta=ta.replace(/\r\n|[\r\n]/g," ");ta=k(j.htmlEmojiAndEmote(ta));}else if(pa.snippet_has_attachment&&pa.snippet_attachments&&pa.snippet_attachments.length){ra=true;ta=i.create('span');e(['MercuryAttachmentSnippet.react'],(function(wa){w.render(v.createElement(wa,{thread:pa,viewer:this._fbid}),ta);}).bind(this));}var ua=pa.participants.length;if(pa.is_subscribed)ua--;var va=pa.snippet_sender;if(!ra&&va&&n.getParticipantIDFromUserID(this._fbid)!=va&&ua>1){u.get(va,function(wa){if(wa.short_name){i.appendContent(qa,ia._("{name}: {conversation_snippet}",[ia.param('name',wa.short_name),ia.param('conversation_snippet',ta)]));}else i.appendContent(qa,ta);});}else i.appendContent(qa,ta);},renderWebMessengerLink:function(pa,qa,ra,sa){da.getThreadURI(pa,function(ta){qa.setAttribute('href',ta);ra&&ra();},sa);},renderThreadImage:function(pa,qa){w.render(v.createElement(q,{thread:pa,viewer:this._fbid}),qa);},renderParticipantList:function(pa,qa,ra,sa){return s.renderRawParticipantList(this._threadIDMap.getServerIDFromClientIDNow(pa),qa,ra,sa);},renderThreadNameAndParticipantList:function(pa,qa,ra,sa){var ta=s.renderRawParticipantList(this._threadIDMap.getServerIDFromClientIDNow(pa),qa,ra,sa),ua=this._threads.getThreadMetaNow(pa);if(!ua.name)return ta;return ia._("{conversation_name} [with {participant_list}]",[ia.param('conversation_name',ua.name),ia.param('participant_list',ta)]);},renderParticipantCount:function(pa,qa){return s.renderRawParticipantCount(qa);}});function la(pa){if(!pa.snippet_attachments)return [];return pa.snippet_attachments.filter(function(qa){return qa.attach_type===m.PHOTO;});}function ma(pa,qa){var ra=la(qa);if(ra.length===0)return;var sa=ra[0].thumbnail_url;if(!sa)return;var ta=ra.length==1?'snippet-thumbnail-single':'snippet-thumbnail-multiple',ua=pa.getNode(ta);if(!ua)return;var va=i.find(ua,'i');z.set(va,'background-image','url('+sa+')');h.show(ua);}function na(pa,qa){fa(pa).forEach(function(ra){i.setContent(ra,qa);});}function oa(pa,qa,ra,sa){ra=fa(ra);var ta=pa._fbid;if(qa.name){ra.forEach(function(va){w.render(v.createElement(t,{thread:qa,viewer:ta,showUnreadCount:!!sa.show_unread_count}),va);});return;}var ua=qa.participants;if(qa.participants.length>1)ua=qa.participants.filter(function(va){return va!=n.getParticipantIDFromUserID(ta);});u.getMulti(ua,function(va){s.renderParticipantListWithNoThreadName(pa._threadIDMap.getServerIDFromClientIDNow(qa.thread_id),qa,ua,va,ra,sa);});}f.exports=ka;},null);
  __d('WebMessengerDetailViewHeaderControl',['WebMessengerAddPeopleToConversationDialog','Autosize','AvailableListConstants','Bootloader','ContextualDialog','CSS','DOM','WebMessengerEditThreadDialog','Event','HovercardLink','HoverFlyout','JSXDOM','LastMobileActiveTimes','LayerFadeOnHide','LayerFadeOnShow','LayerHideOnTransition','MercuryAPIArgsSource','MercuryIDs','MercuryThreadInfo','MercuryViewer','MercuryParticipants','MercuryPresence','ScrollableArea','WebMessengerStateConstants','WebMessengerStateManager','Style','WebMessengerTemplates','Tooltip','WebMessengerConstants','WebMessengerEvents','WebMessengerSubscriptionsHandler','csx','cx','curry','fbt','MercuryThreadInformer','MercuryThreadMetadataRenderer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa){if(c.__markCompiled)c.__markCompiled();var qa=c('MercuryThreadInformer').get(),ra=c('MercuryThreadMetadataRenderer').get(),sa=c('MercuryThreads').get(),ta=null;function ua(bb){'use strict';this._rootElement=bb;n.empty(this._rootElement);this._renderHeaderBar();}ua.prototype.hideView=function(){'use strict';m.hide(this._rootElement);};ua.prototype.updateView=function(){'use strict';m.removeClass(this._rootElement,'hasMultiChatThreadActions');m.show(this._rootElement);if(this._listener){qa.unsubscribe(this._listener);this._listener=null;}var bb=ea;switch(fa.getCurrentDetailState()){case bb.DETAIL.RECENT_MESSAGES:case bb.DETAIL.SEARCH_CONTEXT:case bb.DETAIL.SEARCH_THREAD_SNIPPET:case bb.DETAIL.SHARED_PHOTOS:this.setThreadID(fa.getCurrentStateData().thread_id);break;default:this.setThreadID(null);break;}ka.detailDOMChanged();};ua.prototype.setThreadID=function(bb){'use strict';this._threadID=bb;if(this._threadID){this._listener=qa.listen(this._threadID,this.updateView.bind(this));la.addSubscriptions(this._listener);}bb&&sa.getThreadMeta(bb,(function(cb){if(this._threadID==bb)m.conditionClass(this._rootElement,'hasMultiChatThreadActions',!cb.is_canonical&&z.canReply(cb));}).bind(this));};ua.prototype._renderHeaderBar=function(){'use strict';this._headerBar=ha[':fb:web-messenger:read-view:header'].build();n.appendContent(this._rootElement,this._headerBar.getRoot());var bb=this._headerBar.getNode('editThreadName'),cb=this._headerBar.getNode('addPeopleToThread'),db=new o();this._title_node_wrapper=this._headerBar.getNode('headerName');this._relationship_status=this._headerBar.getNode('relationshipStatus');la.addSubscriptions(p.listen(this._headerBar.getNode('closeButton'),'click',function(){var eb=babelHelpers._extends({},fa.getCurrentStateData(),{all_people_query:undefined});fa.updateDetailState(ea.DETAIL.COMPOSE_MAIN,eb);}),p.listen(bb,'click',(function(event){this._threadID&&db.toggleShown(this._headerBar.getNode('headerName'),this._threadID);return true;}).bind(this)),p.listen(cb,'click',(function(event){this._threadID&&h.show(this._threadID);return true;}).bind(this)),ka.subscribe(ka.DETAIL_DOM_CHANGED,this.updateHeaderBar.bind(this)));};ua.prototype.updateHeaderBar=function(){'use strict';var bb=this._headerBar.getNode('headerButtons');this._title_node_wrapper.style.fontSize='';var cb=s.span(null);n.setContent(this._title_node_wrapper,cb);var db=this._headerBar.getNode('webMessengerRecIndicator');db&&m.hide(db);var eb=fa.getCurrentDetailState(),fb=eb==ea.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;m.conditionShow(this._headerBar.getNode('closeButton'),fb);m.conditionClass(this._title_node_wrapper,'allPeopleResults',fb);m.hide(this._relationship_status);m.removeClass(this._title_node_wrapper,"_50jz");var gb,hb;switch(eb){case ea.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:hb=fa.getCurrentStateData().all_people_query;gb=pa._("People matching {query}",[pa.param('query',n.create('strong',{},hb))]);break;case ea.DETAIL.COMPOSE_MAIN:case ea.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:gb=pa._("New Message");break;case ea.DETAIL.SEARCH_SNIPPET:hb=fa.getCurrentStateData().message_query;if(hb)gb=pa._("Messages with word: {query}",[pa.param('query',hb)]);break;}var ib=!gb&&!this._threadID;if(ib)gb=pa._("No Selection");m.conditionClass(this._title_node_wrapper,"_3jd",ib);if(gb){n.setContent(cb,gb);ab(this._title_node_wrapper,this._threadID,bb,db);return;}ra.renderAndSeparatedParticipantList(this._threadID,cb,{check_length:false,names_renderer:(function(jb){var kb=jb.map((function(mb){var nb=jb.length===1?mb.name:mb.short_name,ob=mb.id?y.getUserIDFromParticipantID(mb.id):null;if(ob&&mb.href){var pb=s.a({href:mb.href},nb);if(jb.length===1)pb.setAttribute('data-hovercard',q.constructEndpoint({id:ob}));if(fa.getStandaloneMode())pb.setAttribute('target','_blank');return pb;}else return nb;}).bind(this));if(jb.length===1&&jb[0].fbid!==null){var lb=s.span(null);n.setContent(lb,kb[0]);wa(jb[0],lb);kb[0]=lb;}return kb;}).bind(this)});if(db)sa.getThreadMeta(this._threadID,function(jb){xa(jb,db);});this.renderParticipantListFlyout(cb);this.renderNamedThreadParticipantCount(cb);ab(this._title_node_wrapper,this._threadID,bb,db);new i(this._title_node_wrapper,{min:11,max:16,height:100,width:this._title_node_wrapper.offsetWidth,wrap:false});};ua.prototype.renderNamedThreadParticipantCount=function(bb){'use strict';sa.getThreadMeta(this._threadID,function(cb){if(cb.name){var db=ra.renderParticipantCount(cb.thread_id,{count:cb.participants.length}),eb=n.create('span',{className:"_1us"},pa._("({participants})",[pa.param('participants',db)]));n.appendContent(bb,eb);}},x.WEBMESSENGER);};ua.prototype.renderParticipantListFlyout=function(bb){'use strict';this._dialog&&this._dialog.destroy();delete this._dialog;this._flyout&&this._flyout.destroy();delete this._flyout;var cb=this._threadID;sa.getThreadMeta(this._threadID,(function(db){var eb=db.participants;if(!db.name){eb=eb.filter(function(fb){return fb!==aa.getID();});if(eb.length<=1)return;}ba.getMulti(eb,(function(fb){if(this._threadID!=cb)return;var gb=0,hb=ha[':fb:web-messenger:flyoutlist'].build();for(var ib in fb){if(!fb.hasOwnProperty(ib))continue;var jb=fb[ib],kb=ha[':fb:web-messenger:flyoutlist-profile-item'].build();kb.getNode('profilePhoto').setAttribute('src',jb.image_src);var lb=kb.getNode('title');if(jb.href){var mb=s.a({href:jb.href});n.setContent(lb,mb);lb=mb;var nb=kb.getNode('profilePhoto'),ob=s.a({href:jb.href});n.replace(nb,ob);n.setContent(ob,nb);if(fa.getStandaloneMode()){mb.setAttribute('target','_blank');ob.setAttribute('target','_blank');}}n.setContent(lb,jb.name);wa(jb,kb.getNode('title'));n.setContent(kb.getNode('infoLine'),za(jb));gb++;n.appendContent(hb.getNode('list'),kb.getRoot());}var pb=hb.getRoot();this._dialog=new l({context:bb,position:'below',addedBehaviors:[u,v,w]},pb);this._flyout=new r();this._flyout.init(this._dialog);this._flyout.initNode(bb);ya(this._flyout,pb,gb);}).bind(this));}).bind(this),x.WEBMESSENGER);};ua.prototype.destroy=function(){'use strict';};function va(bb,cb,db){var eb=t.getShortDisplay(db);if(!eb||bb.get(db)!==j.MOBILE){ia.remove(cb);return;}ia.set(cb,pa._("Last active {time} ago",[pa.param('time',eb)]),'right');}function wa(bb,cb){var db=y.getUserIDFromParticipantID(bb.id);if(!db)return;var eb=s.span(null);ca.updateOnPresenceChanges(db,eb);if(n.isNode(cb)){k.loadModules(["PresenceStatus","ChatOpenTab"],function(fb,gb){p.listen(eb,'mouseenter',oa(va,fb,eb,db));p.listen(eb,'click',gb.openUserTab.bind(null,db,'web messenger header'));});n.appendContent(cb,eb);}}function xa(bb,cb){if(cb)ba.getMulti(bb.participants,function(db){var eb=true;for(var fb in db)if(db.hasOwnProperty(fb))eb=eb&&db[fb].employee;m.conditionShow(cb,eb);});}function ya(bb,cb,db){if(db<=ja.MAX_VISIBLE_IN_FLYOUT)return;var eb=da.fromNative(cb,{fade:true});cb.style.height=ja.PARTICIPANTS_FLYOUT_HEIGHT+'px';bb.subscribe('show',function(){eb.showScrollbar(false);});}function za(bb){var cb=bb.social_snippets||{},db=Object.keys(cb);if(db.length>0){var eb=db.slice(0,1).map(function(jb){return cb[jb];});return eb;}var fb=bb.networks||{},gb=Object.keys(fb),hb=gb.length>0,ib=2;if(hb){var eb=gb.slice(0,ib).map(function(jb){return fb[jb];});return eb.join(' \u00b7 ');}return '';}function ab(bb,cb,db,eb){var fb=db.offsetWidth;if(eb){ta=ta||eb.offsetWidth;fb+=ta;}var gb=n.scry(document.body,"div._2nd");if(gb.length)fb+=gb[0].offsetWidth;var hb=bb.parentNode.offsetWidth;if(hb>fb)ga.set(bb,'max-width',hb-fb+'px');}f.exports=ua;},null);
  __d('WebMessengerFlexibleArea',['Event','ArbiterMixin','CSS','cx','DOM','Style','throttle','Vector','createArrayFromMixed','mixin'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();var r,s,t=[];function u(){t.forEach(function(w){w.draw();});}h.listen(window,'resize',n(u,50));r=babelHelpers.inherits(v,q(i));s=r&&r.prototype;function v(w){'use strict';s.constructor.call(this);this.minFlexAreaHeight=0;this.flexArea=w;this.container=null;this.padding=0;this.sizeToFit=false;t.push(this);}v.prototype.setContainer=function(w){'use strict';this.container=w;return this;};v.prototype.setPadding=function(w){'use strict';this.padding=w;return this;};v.prototype.setMinFlexAreaHeight=function(w){'use strict';this.minFlexAreaHeight=w;return this;};v.prototype.setSizeToFit=function(w){'use strict';this.sizeToFit=w;return this;};v.prototype.draw=function(){'use strict';if(this.flexArea){var w=this._flexHeight;this.inform('predraw',{old_height:w});var x=o.getViewportDimensions().y-this.padding;x-=o.getElementPosition(this.container||this.flexArea).y;if(this.container){p(this.container.childNodes).forEach(function(y){x-=o.getElementDimensions(y).y;});x+=o.getElementDimensions(this.flexArea).y;}if(this.sizeToFit)x=Math.min(x,this._getNaturalHeight());if(x<this.minFlexAreaHeight)x=this.minFlexAreaHeight;if(isNaN(x)||x<0)x=0;if(x!==w){m.set(this.flexArea,'height',x+'px');this._flexHeight=x;this.inform('height_changed',{height:x,old_height:w});}}return this;};v.prototype.destroy=function(){'use strict';var w=t.indexOf(this);w>=0&&t.splice(w,1);u();};v.prototype._getNaturalHeight=function(){'use strict';var w=this.flexArea.cloneNode(true);j.addClass(w,"_2ys");m.set(w,'height','auto');l.insertAfter(this.flexArea,w);var x=o.getElementDimensions(w).y;l.remove(w);return x;};v.prototype._getFlexHeight=function(){'use strict';if(isNaN(this._flexHeight))this._flexHeight=o.getElementDimensions(this.flexArea).y;return this._flexHeight;};f.exports=v;},null);
  __d('WebMessengerFlexibleScrollArea',['CSS','DOMQuery','ScrollableArea','Style','WebMessengerFlexibleArea','throttle'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n,o;n=babelHelpers.inherits(p,l);o=n&&n.prototype;function p(q,r){'use strict';o.constructor.call(this,q);this._scroll=j.fromNative(q,r);this._scrollBody=i.find(this.flexArea,'.uiScrollableAreaBody');var s=i.scry(this.flexArea,'.uiScrollableAreaShadow');this._shadow=s.length?s[0]:null;this._scrollContent=i.find(this.flexArea,'.uiScrollableAreaContent');this._scrollCallbacks=[];this._drawSubscription=this.subscribe('height_changed',this.poke.bind(this));this._scrollSub=this._scroll.subscribe('scroll',m(this._onScroll,50,this));this._nearTop=false;this._nearBottom=false;}p.prototype.showAtTop=function(q){'use strict';if(q){k.set(this._scrollContent,'top','0');k.set(this._scrollContent,'bottom','');}else{k.set(this._scrollContent,'top','');k.set(this._scrollContent,'bottom','0');}};p.prototype.setBottomAligned=function(q){'use strict';var r=q!==false;if(this._bottomEdgeBias===r)return;h.conditionClass(this.flexArea,'uiScrollableAreaBottomAligned',r);this._bottomEdgeBias=r;if(this._bottomEdgeBias){this.scrollToBottom(false);}else this.scrollToTop(false);setTimeout(this.poke.bind(this),0);return this;};p.prototype.setInfiniteScrollHandler=function(q,r){'use strict';if(r){this._infiniteUpwardScrollHandler=q;}else this._infiniteDownScrollHandler=q;return this;};p.prototype.addScrollCallback=function(q){'use strict';this._scrollCallbacks.push(q);return this;};p.prototype.setTabbable=function(q){'use strict';this._scroll._wrap.setAttribute('tabindex',q?'0':'-1');};p.prototype.poke=function(q,r){'use strict';var s=this._scrollHeight,t=this._scroll.getScrollTop();this._scrollHeight=this._getScrollHeight();if(typeof s=='undefined'||r&&!r.old_height){this._bottomEdgeBias&&this._setShadowHeight();return;}var u=this._scrollHeight-s;if(this._bottomEdgeBias){var v=r?r.height-r.old_height:0;clearTimeout(this._pollTimer);this._pollTimer=setTimeout(this.poke.bind(this),200);var w,x=u-v;if(this._scrollHeight>this._getFlexHeight()){w=t+x;w=w<0?0:w;}else w=0;x>0&&this._setShadowHeight();if(w!==t)this._scroll.setScrollTop(w,false);x<0&&this._setShadowHeight();}else if(u)this._scroll.setScrollTop(t,false);};p.prototype.setScrollTop=function(q,r){'use strict';this._scroll.setScrollTop(q,r);};p.prototype.getScrollableArea=function(){'use strict';return this._scroll;};p.prototype.isScrolledToBottom=function(){'use strict';return this._scroll.isScrolledToBottom();};p.prototype.scrollToBottom=function(q){'use strict';this._scroll.scrollToBottom(q);if(this._bottomEdgeBias)this._scrollBottom=0;};p.prototype.isScrolledToTop=function(){'use strict';return this._scroll.getScrollTop()===0;};p.prototype.scrollToTop=function(q){'use strict';this._scroll.scrollToTop(q);};p.prototype.scrollIntoView=function(q,r){'use strict';this._scroll.scrollIntoView(q,r);};p.prototype.destroy=function(){'use strict';this._scrollSub&&this._scrollSub.unsubscribe();this.unsubscribe(this._drawSubscription);clearTimeout(this._pollTimer);o.destroy.call(this);this._scroll.destroy();};p.prototype._getScrollHeight=function(){'use strict';if(this._bottomEdgeBias){return this._scrollContent.offsetHeight;}else return this._scroll.getScrollHeight();};p.prototype._setShadowHeight=function(){'use strict';var q=this._shadowHeight;this._shadowHeight=this._scrollHeight-this._getFlexHeight();if(this._shadowHeight<0)this._shadowHeight=0;if(this._shadowHeight!==q)k.set(this._shadow,'height',this._shadowHeight+'px');};p.prototype._onScroll=function(){'use strict';var q=this._scroll.getScrollTop(),r=this._getScrollHeight();if(q<this._getFlexHeight()){if(!this._nearTop){this._nearTop=true;this._infiniteUpwardScrollHandler&&this._infiniteUpwardScrollHandler();}}else this._nearTop=false;if(q+2*this._getFlexHeight()>r){if(!this._nearBottom){this._nearBottom=true;this._infiniteDownScrollHandler&&this._infiniteDownScrollHandler();}}else this._nearBottom=false;this._scrollCallbacks.forEach((function(s){return s(this._scroll);}).bind(this));};f.exports=p;},null);
  __d("ListInputTargetTracker",[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(){"use strict";this._index=undefined;this._items=[];}h.prototype.getIndex=function(){"use strict";return this._index;};h.prototype.setIndex=function(i){"use strict";this._index=Math.max(0,Math.min(i,this._items.length-1));};h.prototype.getNumItems=function(){"use strict";return this._items.length;};h.prototype.getItem=function(){"use strict";if(this._index!==undefined)return this._items[this._index];};h.prototype.setTargetItem=function(i){"use strict";this.updateIndex(this._items,i);};h.prototype.addItem=function(i){"use strict";this._items.push(i);};h.prototype.removeItemAtIndex=function(i){"use strict";this._items.splice(i,1);};h.prototype.removeItemByValue=function(i){"use strict";var j=this._items.indexOf(i);this.removeItemAtIndex(j);};h.prototype.moveUp=function(){"use strict";if(this._index===undefined||this._index===0){if(this._items.length){this._index=this._items.length-1;return true;}}else if(this._index>0){this._index--;return true;}return false;};h.prototype.moveDown=function(){"use strict";if(this._index===undefined||this._index===this._items.length-1){if(this._items.length){this._index=0;return true;}}else if(this._index<this._items.length-1){this._index++;return true;}return false;};h.prototype.updateIndex=function(i,j){"use strict";this._items=i||[];if(j){var k=this._items.indexOf(j);if(k>=0){this._index=k;}else if(this._index!==undefined)if(this._items.length>0){this._index=Math.min(this._index,this._items.length-1);}else this._index=undefined;}else this._index=undefined;return this._index;};f.exports=h;},null);
  __d('WebMessengerShortcuts',['DialogX','DOM','KeyEventController','LayerHideOnEscape','ListInputTargetTracker','MercuryAPIArgsSource','MessagingTag','Parent','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','UserAgent_DEPRECATED','WebMessengerEvents','BanzaiODS','arrayContains','csx','cx','fbt','ge','shield','MercuryThreadActions','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa){if(c.__markCompiled)c.__markCompiled();var ba=c('MercuryThreadActions').get(),ca=c('MercuryThreads').get(),da=null,ea=null,fa=null,ga={g:{callback:ma,description:y._("Search conversations"),section:'searchAndHelp',uses_meta:true},m:{callback:la,description:y._("Start a new message"),section:'navigation',uses_meta:true},i:{callback:ua.bind(null,n.INBOX),description:y._("Go to Inbox"),section:'navigation',uses_meta:true},u:{callback:ua.bind(null,n.OTHER),description:y._("Go to Other"),section:'navigation',uses_meta:true},z:{callback:oa,description:y._("Archive\/unarchive conversation"),otherKeys:['y'],section:'conversation',uses_meta:true},r:{callback:pa,description:y._("Mark message as read\/unread"),section:'conversation',uses_meta:true},UP:{callback:qa,description:y._("Select next conversation"),section:'navigation',uses_meta:false},DOWN:{callback:ra,description:y._("Select previous conversation"),section:'navigation',uses_meta:false},q:{callback:aa(wa),description:y._("Show\/hide keyboard shortcuts"),section:'searchAndHelp',uses_meta:true}},ha={registerGeneralShortcuts:function(){ea=new l();for(var xa in ga){var ya=ga[xa],za=[xa];if(ya.otherKeys)za=ya.otherKeys.concat(za);for(var ab=0;ab<za.length;ab++)j.registerKey(za[ab],ya.callback,ka.bind(null,ya.uses_meta));}},updateThreadlistIndex:function(xa,ya,za){da=xa;if(ea){if(!v(ya,za))za=null;ea.updateIndex(ya,za);}},openSearchThread:function(){var xa=ta(),ya=q.getCurrentMasterState();if(xa&&ya==p.MASTER.SEARCH)da.openSearchThread(xa);},showOrHideShortcuts:wa};function ia(){return s.osx()?'CTRL':'ALT';}function ja(xa){function ya(){if(!fa){var za=i.find(document.body,"._ksg");fa=[];do{za=za.parentNode;fa.push(za);}while(za&&za!==document.body);}return fa;}if(!o.byClass(xa,"_ksg"))if(!v(ya(),xa))if(!i.scry(xa,"._5hu2").length)return false;return true;}function ka(xa,event,ya){if(!j.filterEventTypes(event,ya))return false;if(!ja(event.getTarget()))return false;var za;if(xa)switch(ia()){case 'CTRL':za='ctrlKey';break;case 'ALT':za='altKey';break;}var ab=['ctrlKey','metaKey','altKey','shiftKey'];for(var bb=0;bb<ab.length;bb++)if(ab[bb]!==za&&event[ab[bb]])return false;return !xa||event[za];}function la(){u.bumpEntityKey('kbshorts_messenger','kbshorts.compose');q.updateDetailState(p.DETAIL.COMPOSE_MAIN,{start:true});return false;}function ma(){u.bumpEntityKey('kbshorts_messenger','kbshorts.search');t.focusAndSelectSearch();return false;}function na(xa){var ya;if(ea.getNumItems()>1){var za=ea.getIndex();ea.setIndex(za===0?1:za-1);ya=ta();}xa();q.updateDetailState(p.DETAIL.RECENT_MESSAGES,{folder:q.getCurrentStateData().folder,thread_id:ya});if(ya)da._manager.scrollIntoView(z(ea.getItem()),false);}function oa(){u.bumpEntityKey('kbshorts_messenger','kbshorts.toggle_archive');var xa=ta();if(xa){ca.getThreadMeta(xa,function(ya){if(ya.folder==n.SPAM)return;na(function(){if(ya.is_archived){ba.unarchive(ya.thread_id);}else ba.archive(ya.thread_id);});},m.WEBMESSENGER);return false;}}function pa(){var xa=ta();u.bumpEntityKey('kbshorts_messenger','kbshorts.toggle_read_status');if(xa){ca.getThreadMeta(xa,function(ya){var za=!ya.unread_count;za?ba.markUnread(xa):ba.markRead(xa);},m.WEBMESSENGER);return false;}}function qa(){u.bumpEntityKey('kbshorts_messenger','kbshorts.go_to_next');if(ea)if(ea.getIndex()===0){switch(q.getCurrentMasterState()){case p.MASTER.SEARCH:ea.moveUp();sa();da._manager.scrollToBottom(false);break;default:da._manager.scrollToTop(false);t.focusSearch();}}else{if(ea.getItem()){ea.moveUp();}else ea.moveDown();sa();}return false;}function ra(){u.bumpEntityKey('kbshorts_messenger','kbshorts.go_to_previous');var xa=q.getCurrentMasterState();if(ea&&(xa!==p.MASTER.RECENT_THREADS||ea.getIndex()<ea.getNumItems()-1)){ea.moveDown();sa();}return false;}function sa(){var xa=ta();if(xa){var ya=q.getCurrentMasterState();if(ya==p.MASTER.SEARCH){da.updateKeyboardSelection(xa);t.focusSearch();}else q.updateDetailState(p.DETAIL.RECENT_MESSAGES,{thread_id:xa});if(ea)if(ea.getIndex()===0){da._manager.scrollToTop(false);}else da._manager.scrollIntoView(z(ea.getItem()),false);}}function ta(){var xa=ea&&ea.getItem();if(typeof xa==='string'&&xa.indexOf(':')!==-1)return xa.substr(xa.indexOf(':')+1);return null;}function ua(xa){if(xa===n.INBOX){u.bumpEntityKey('kbshorts_messenger','kbshorts.go_to_inbox');}else if(xa===n.OTHER)u.bumpEntityKey('kbshorts_messenger','kbshorts.go_to_other');var ya=q.getCurrentMasterState(),za=ya==p.MASTER.SEARCH?null:q.getCurrentStateData().thread_id;q.updateMasterState(p.MASTER.RECENT_THREADS,{thread_id:za,folder:xa});}var va;function wa(xa){u.bumpEntityKey('kbshorts_messenger','kbshorts.show_or_hide_shortcuts');if(!va){var ya={};for(var za in ga){var ab=ga[za];if(!ab.uses_meta)continue;var bb=r[':fb:web-messenger:shortcuts-dialog:row'].build(),cb=[za],db=[];if(ab.otherKeys)cb=ab.otherKeys.concat(cb);for(var eb=0;eb<cb.length;eb++){var fb=r[':fb:web-messenger:shortcuts-dialog:key'].build();fb.setNodeContent('meta',ia());fb.setNodeContent('key',cb[eb]);db.push(fb.getRoot());}bb.setNodeContent('keys',db);bb.setNodeContent('description',ab.description);if(!ya[ab.section])ya[ab.section]=[];ya[ab.section].push(bb.getRoot());}var gb=r[':fb:web-messenger:shortcuts-dialog'].build();for(var hb in ya)gb.setNodeContent(hb,ya[hb]);var ib=i.scry(gb.getRoot(),"._1yw")[0],jb=null;if(ib)jb=i.getID(ib);va=new h({modal:true,titleID:jb,width:565},gb.getRoot());va.enableBehavior(k);}if(va.isShown()){va.hide();}else{va.show();if(typeof xa==='function')va.subscribeOnce('hide',xa);}return false;}f.exports=ha;},null);
  __d('WebMessengerActionsMenuItem',['CSS','MenuItem','WebMessengerStateManager'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k,l;k=babelHelpers.inherits(m,i);l=k&&k.prototype;function m(n){'use strict';n.href=n.href||'#';l.constructor.call(this,n);this.setOnClickHandler(this.handleMenuItemClick);this.showFn=this._data.should_show_fn;this.hasAction=(function(){return !this._data.hideManually;}).bind(this);}m.prototype.handleMenuItemClick=function(){'use strict';var n=j.getCurrentStateData().thread_id;n&&this._data.onclick(n);};m.prototype.updateShownState=function(n){'use strict';if(this.showFn){this._isHidden=!this.showFn(n);if(this._root)h.conditionShow(this._root,!this._isHidden);}};m.prototype.isShown=function(n){'use strict';var o=this.showFn?this.showFn(n):true;return o;};m.prototype.render=function(){'use strict';var n=l.render.call(this);if(this._isHidden)h.hide(n);return n;};f.exports=m;},null);
  __d("XMessagingLeaveConversationDialogController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/leave_conversation\/",{__asyncDialog:{type:"Int"}});},null,{});
  __d('WebMessengerDetailViewActionsMenuControl',['WebMessengerAddPeopleToConversationDialog','AsyncDialog','AsyncRequest','Bootloader','ChatOpenTab','ContextualDialogArrow','CSS','CurrentUser','WebMessengerDeleteThreadDialog','DOM','WebMessengerEditThreadDialog','Event','FBRTCCore','FBRTCCallabilityStore','Input','Keys','Menu','MenuSeparator','MercuryAPIArgsSource','MercuryIDs','MercuryLogMessageType','MercuryParticipants','MercurySourceType','MercuryThreadInfo','MercuryThreadMuter','MercuryViewer','MessagingTag','MercuryParticipants','Popover','PopoverMenu','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','Toggler','URI','WebMessengerActionsMenuItem','WebMessengerSubscriptionsHandler','XMessagingLeaveConversationDialogController','XUIMenuTheme','XNFXStartForMessageThreadController','MercuryMessengerBlockingUtils','emptyFunction','fbt','goURI','MercuryBlockedParticipants','MercuryThreadIDMap','MercuryMessageObject','MercuryMessageActions','MercuryThreadActions','MercuryThreadInformer','MercuryThreads','WebMessengerDetailViewCallButtonManager'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za){if(c.__markCompiled)c.__markCompiled();var ab=c('MercuryBlockedParticipants').get(),bb=c('MercuryThreadIDMap').get(),cb=c('MercuryMessageObject').get(),db=c('MercuryMessageActions').get(),eb=c('MercuryThreadActions').get(),fb=c('MercuryThreadInformer').get(),gb=c('MercuryThreads').get(),hb=c('WebMessengerDetailViewCallButtonManager').module;function ib(ad,bd){'use strict';this._rootElement=ad;this._headerControl=bd;this._menuTemplate=oa[':fb:web-messenger:actions-menu'].build();this._newMessageButton=this._menuTemplate.getNode('newMessageButton');this._actionsMenu=this._menuTemplate.getNode('menu');this._searchThreadInput=this._menuTemplate.getNode('searchThreadInput');this._searchThreadButton=this._menuTemplate.getNode('searchThreadButton');this._searchCloseButton=this._menuTemplate.getNode('searchCloseButton');this._videoCallButton=this._menuTemplate.getNode('videoCallButton');var cd=this._menuTemplate.getNode('actionsButton'),dd=(function(event){if(!this._searchMode){kb(this,true);}else{var ed=v.getValue(this._searchThreadInput);if(ed){var fd=babelHelpers._extends({},na.getCurrentStateData(),{message_query:ed});na.updateDetailState(ma.DETAIL.SEARCH_THREAD_SNIPPET,fd);this._searchThreadInput.focus();}else kb(this,false);}event.kill();}).bind(this);sa.addSubscriptions(fb.subscribe('threads-updated',(function(ed,fd){fd[this._threadID]&&this.updateView();}).bind(this)),s.listen(this._menuTemplate.getNode('newMessageButton'),'click',function(){na.updateDetailState(ma.DETAIL.COMPOSE_MAIN,babelHelpers._extends({},na.getCurrentStateData(),{start:true,thread_id:undefined}));}),s.listen(this._actionsMenu,'keydown',function(event){if(event.keyCode===w.ESC){cd.focus();event.preventDefault();}}),s.listen(this._searchThreadButton,'mousedown',dd),s.listen(this._searchThreadButton,'keydown',function(event){if(event.keyCode===w.RETURN||event.keyCode===w.SPACE)dd(event);}),s.listen(this._searchThreadButton,'click',xa.thatReturnsFalse),s.listen(this._searchCloseButton,'keydown',(function(event){if(event.keyCode===w.RETURN||event.keyCode===w.SPACE){mb(this);this._menuTemplate.getNode('searchThreadButton').focus();}}).bind(this)),s.listen(this._searchCloseButton,'mousedown',(function(event){mb(this);}).bind(this)),s.listen(this._searchThreadInput,'blur',(function(event){var ed=v.getValue(this._searchThreadInput);if(!ed)kb(this,false);}).bind(this)),s.listen(this._searchThreadInput,'keyup',(function(event){var ed=v.getValue(this._searchThreadInput),fd=babelHelpers._extends({},na.getCurrentStateData(),{message_query:ed});if(event.keyCode==w.RETURN&&ed)na.updateDetailState(ma.DETAIL.SEARCH_THREAD_SNIPPET,fd);if(event.keyCode==w.ESC)v.reset(this._searchThreadInput);}).bind(this)),s.listen(this._videoCallButton,'click',(function(){hb.onCallClicked(this._threadID);}).bind(this)),u.addListener((function(){hb.updateVideoCallButton(this._videoCallButton,this._threadID);}).bind(this)));this.initItems();q.setContent(this._rootElement,this._menuTemplate.getRoot());}ib.prototype.initItems=function(){'use strict';var ad=this._menuTemplate.getNode('actionsButton'),bd=this._menuTemplate.getNode('newMessageButton'),cd=function(){ad.focus();},dd=function(){bd.focus();};this.menuItems=[];this.menuItems.push({ctor:ra,label:ya._("Add People..."),onclick:ic,should_show_fn:ob},{ctor:ra,label:ya._("Edit Participants..."),onclick:jc,should_show_fn:ob},{ctor:ra,hideManually:true,label:ya._("Edit Conversation Name..."),onclick:lc.bind(null,this),should_show_fn:ob},{ctor:ra,hideManually:true,label:ya._("Edit Conversation Picture..."),onclick:lc.bind(null,this),should_show_fn:ob},{ctor:ra,label:ya._("Leave Conversation..."),onclick:kc,should_show_fn:ob},{ctor:y,should_show_fn:ob});this.menuItems.push({ctor:ra,hideManually:true,label:ya._("Open in Chat"),onclick:pb,should_show_fn:l.canOpenTab},{ctor:ra,label:ya._("View Photos in Thread"),onclick:gc},{ctor:ra,label:ya._("Mark as Read"),onclick:uc.bind(null,cd),should_show_fn:cc},{ctor:ra,label:ya._("Mark as Unread"),onclick:tc.bind(null,cd),should_show_fn:xb(cc)});this.menuItems.push({ctor:y},{ctor:ra,label:ya._("Move to Work Account"),onclick:vb,should_show_fn:ub},{ctor:ra,label:ya._("Archive"),onclick:oc.bind(null,dd),should_show_fn:xb(bc)},{ctor:ra,label:ya._("Unarchive"),onclick:pc.bind(null,dd),should_show_fn:bc},{ctor:ra,label:ya._("Mute Conversation..."),onclick:function(ed){fa.showMuteChangeDialog(ed,ad);},should_show_fn:xb(ea.isMuted)},{ctor:ra,label:ya._("Unmute Conversation"),onclick:lb.bind(null,cd),should_show_fn:ea.isMuted},{ctor:ra,label:ya._("Move to Inbox"),onclick:rb.bind(null,dd,ha.INBOX),should_show_fn:qb.bind(null,ha.OTHER)},{ctor:ra,hideManually:true,label:ya._("Delete Conversation..."),onclick:wb},{ctor:ra,label:ya._("Delete Messages..."),onclick:vc});this.menuItems.push({ctor:y},{ctor:ra,label:ya._("Create Group..."),onclick:rc,should_show_fn:sb},{ctor:ra,label:ya._("Create Event..."),onclick:sc,should_show_fn:tb},{ctor:ra,label:ya._("Block Messages..."),onclick:ec.bind(null),should_show_fn:yb},{ctor:ra,label:ya._("Unblock Messages..."),onclick:mc.bind(null),should_show_fn:zb},{ctor:ra,label:ya._("Report Spam or Abuse..."),onclick:fc.bind(null,cd),should_show_fn:xb(ac)},{ctor:ra,label:ya._("Not Spam"),onclick:hc.bind(null,dd),should_show_fn:ac},{ctor:ra,hideManually:true,label:ya._("Keyboard Shortcuts"),onclick:zc.bind(null,cd)},{ctor:ra,label:ya._("Feedback"),onclick:za.bind(null,'/help/?page=134259426717336')});if(nb())this.menuItems.push({ctor:y},{ctor:ra,label:'Enable bug reporting',onclick:wc.bind(null,cd),should_show_fn:xb(dc)},{ctor:ra,label:'Disable bug reporting',onclick:xc.bind(null,cd),should_show_fn:dc});this._menu=new x(this.menuItems,{theme:ua});new ka(new ja(ad.parentNode,ad,[m],{alignh:'right'}),ad,this._menu);};ib.prototype.hideView=function(){'use strict';n.hide(this._rootElement);};ib.prototype.updateView=function(){'use strict';this.hideView();var ad=na.getCurrentDetailState(),bd=false,cd=false,dd=false,ed=false,fd=false,gd=false;switch(ad){case ma.DETAIL.COMPOSE_MAIN:case ma.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:case ma.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:jb(this);this._threadID=null;break;case ma.DETAIL.RECENT_MESSAGES:case ma.DETAIL.SEARCH_CONTEXT:if(this._state!==ad)jb(this);var hd=na.getCurrentStateData().thread_id;bd=true;if(this._searchMode&&this._threadID===hd){ed=true;}else{jb(this);cd=true;dd=true;}this._threadID=hd;if(this._threadID)fd=true;break;case ma.DETAIL.SEARCH_THREAD_SNIPPET:var id=na.getCurrentStateData();v.setValue(this._searchThreadInput,id.message_query);this._threadID=id.thread_id;bd=true;ed=true;gd=true;break;case ma.DETAIL.SHARED_PHOTOS:var jd=na.getCurrentStateData();this._threadID=jd.thread_id;bd=true;cd=true;dd=true;fd=true;break;default:jb(this);bd=true;cd=true;this._threadID=null;break;}this._state=ad;n.conditionShow(this._searchThreadInput,ed);n.conditionShow(this._searchThreadButton,fd);n.conditionShow(this._searchCloseButton,gd);n.conditionShow(this._newMessageButton,cd);n.conditionShow(this._rootElement,bd);hb.updateVideoCallButton(this._videoCallButton,this._threadID);n.conditionShow(this._videoCallButton,hb.isVideoCallableThread(this._threadID)&&!this._searchMode&&t.shouldEnableVideoCalling());this._threadSubscription&&gb.unsubscribe(this._threadSubscription);if(dd&&this._threadID){this._threadSubscription=gb.getThreadMeta(this._threadID,(function(kd){this._menu.forEachItem(function(ld){return ld.updateShownState&&ld.updateShownState(kd);});n.show(this._menuTemplate.getNode('menu'));n.show(this._rootElement);}).bind(this),z.WEBMESSENGER);}else n.hide(this._menuTemplate.getNode('menu'));};ib.prototype.destroy=function(){'use strict';};function jb(ad){ad._searchMode=false;v.reset(ad._searchThreadInput);}function kb(ad,bd){if(bd){ad._searchMode=true;}else jb(ad);n.conditionShow(ad._newMessageButton,!bd);n.conditionShow(ad._videoCallButton,!bd&&hb.isVideoCallableThread(ad._threadID));n.conditionShow(ad._actionsMenu,!bd);n.conditionShow(ad._searchThreadInput,bd);if(bd){ad._searchThreadInput.focus();pa.hide(this._actionsMenu);}}function lb(ad,bd){eb.unmute(bd);pa.hide();ad();}function mb(ad){kb(ad,false);n.conditionShow(ad._searchThreadButton,true);n.conditionShow(ad._searchCloseButton,false);var bd=na.getCurrentDetailState();if(bd!==ma.DETAIL.RECENT_MESSAGES)na.updateDetailState(ma.DETAIL.RECENT_MESSAGES,{thread_id:na.getCurrentStateData().thread_id});}function nb(){var ad=ia.getNow(ga.getID());return ad&&ad.employee;}function ob(ad){return !ad.is_canonical&&ad.is_subscribed&&!ad.has_email_participant&&!ad.read_only;}function pb(ad){pa.hide();l.openThread(ad,'WebMessengerDetailViewActionsMenuControl');}function qb(ad,bd){return !bd.is_archived&&bd.folder==ad;}function rb(ad,bd,cd){eb.changeFolder(cd,bd);yc();ad();}function sb(ad){var bd=qc(ad.participants);return bd.length>2;}function tb(ad){var bd=qc(ad.participants);return bd.length>2;}function ub(ad){if(!o.isEmployee()||!o.hasWorkUser()||!aa.isGroupChat(ad.thread_id))return false;var bd=ad.participants;for(var cd=0;cd<bd.length;++cd)if(!ia.getNow(bd[cd]).employee)return false;return true;}function vb(ad){if(!gb.isEmptyLocalThread(ad)){var bd=cb.constructLogMessageObject(da.MESSENGER_WEB,ad,ba.SWITCH_TO_WORK,{removed_participants:[ga.getID()]});db.send(bd,null,z.WEBMESSENGER);yc();}return true;}function wb(ad){pa.hide();na.updateDetailState(ma.DETAIL.RECENT_MESSAGES,na.getCurrentStateData());p.show(ad);}function xb(ad){return function(){return !ad.apply(this,arguments);};}function yb(ad){return ad.is_canonical&&wa.gk_result&&!ab.isMessageBlocked(ad);}function zb(ad){return ad.is_canonical&&wa.gk_result&&ab.isMessageBlocked(ad);}function ac(ad){return ad.folder===ha.SPAM;}function bc(ad){return ad.is_archived;}function cc(ad){return ad.unread_count>0;}function dc(){return na.getCurrentStateData().bug_reporting_enabled;}function ec(ad){eb.blockMessages(ad);}function fc(ad,bd){bb.getServerIDFromClientID(bd,function(cd){var dd=va.getURIBuilder().setString('thread_fbid',cd).getURI();i.send(new j(dd));});}function gc(ad){na.updateDetailState(ma.DETAIL.SHARED_PHOTOS,babelHelpers._extends({},na.getCurrentStateData()));}function hc(ad,bd){eb.unmarkSpam(bd);yc();ad();}function ic(ad){h.show(ad);}function jc(ad){bb.getServerIDFromClientID(ad,function(bd){i.send(new j(new qa('/ajax/browser/dialog/multichat_members/').addQueryData({id:bd})));});}function kc(ad){var bd=ta.getURIBuilder().getURI();i.send(new j(bd),function(cd){cd.subscribe('confirm',function(){nc(ad);cd.hide();});});}function lc(ad,bd){pa.hide();var cd=new r();cd.toggleShown(ad._headerControl?ad._headerControl._headerBar.getNode('headerName'):ad._rootElement,bd);}function mc(ad){var bd=gb.getThreadMetaNow(ad),cd=aa.getParticipantIDFromFromThreadID(ad);ca.get(cd,function(dd){k.loadModules(["MessageBlockedDialog"],function(ed){ed.show(ad,bd.can_reply,ab.isMessageBlocked(bd),dd.short_name);});});}function nc(ad){db.send(cb.constructLogMessageObject(da.TITAN_WEB,ad,ba.UNSUBSCRIBE,{removed_participants:[ga.getID()]}),null,z.WEBMESSENGER);return true;}function oc(ad,bd){eb.archive(bd);yc();ad();}function pc(ad,bd){eb.unarchive(bd);yc();ad();}function qc(ad){var bd=[];for(var cd=0;cd<ad.length;cd++){var dd=ad[cd];if(/^fbid:\d+$/.test(dd))bd.push(dd.substr(5));}return bd;}function rc(ad){gb.getThreadMeta(ad,function(bd){var cd=qc(bd.participants),dd=new qa('/ajax/groups/create_get.php').addQueryData({ref:'web_messenger',members:cd,parent_id:'0'});i.send(new j(dd));},z.WEBMESSENGER);}function sc(ad){gb.getThreadMeta(ad,function(bd){var cd=qc(bd.participants),dd=new qa('/ajax/plans/create/dialog.php').addQueryData({invite_ids:cd,eventname:bd.name,group_chat:true});i.send(new j(dd));},z.WEBMESSENGER);}function tc(ad,bd){eb.markUnread(bd);pa.hide();ad();}function uc(ad,bd){eb.markRead(bd);pa.hide();ad();}function vc(){var ad=babelHelpers._extends({},na.getCurrentStateData(),{message_action:ma.MESSAGE_ACTION.DELETE});na.updateDetailState(na.getCurrentDetailState(),ad);}function wc(ad){var bd=babelHelpers._extends({},na.getCurrentStateData(),{bug_reporting_enabled:true});pa.hide();na.updateDetailState(na.getCurrentDetailState(),bd);ad();}function xc(ad){var bd=babelHelpers._extends({},na.getCurrentStateData(),{bug_reporting_enabled:false});pa.hide();na.updateDetailState(na.getCurrentDetailState(),bd);ad();}function yc(){na.updateDetailState(ma.DETAIL.RECENT_MESSAGES,{folder:na.getCurrentStateData().folder});}function zc(ad){pa.hide();la.showOrHideShortcuts(ad);}f.exports=ib;},null);
  __d('ExpandableDataSource',['DataSource'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i,j;i=babelHelpers.inherits(k,h);j=i&&i.prototype;function k(l,m,n){'use strict';l=l||{};l.maxResults=m;j.constructor.call(this,l);this._initialLimit=m;this._moreResultsLimit=n;this._states={};}k.prototype.query=function(l,m,n){'use strict';this.setQueryData({offset:0,limit:this._initialLimit});j.query.call(this,l,m,n);};k.prototype.fetchHandler=function(l,m){'use strict';var n=l.getPayload(),o=m.value;this.getState('is_loading_more_per_query')[o]=false;this.getState('total_results_count_per_query')[o]=n.total_count;j.fetchHandler.call(this,l,m);};k.prototype.loadMore=function(){'use strict';if(this.value&&!this.hasLoadedAllResults()){var l=this.getState('max_results_per_query');if(!l[this.value])l[this.value]=this._initialLimit;this.setQueryData({offset:l[this.value],limit:this._moreResultsLimit});l[this.value]+=this._moreResultsLimit;if(l[this.value]>this._maxResults)this._maxResults=l[this.value];this.getState('is_loading_more_per_query')[this.value]=true;this.fetch(this.queryEndpoint,this.getQueryData(this.value,this.buildUids(this.value)),{value:this.value});}};k.prototype.isLoadingMore=function(){'use strict';return this.getState('is_loading_more_per_query')[this.value];};k.prototype.hasLoadedAllResults=function(){'use strict';var l=this.getState('total_results_count_per_query')[this.value],m=(this.buildQueryResults(this.value)||[]).length;return l&&m>=l;};k.prototype.getStates=function(){'use strict';return this._states;};k.prototype.getState=function(l){'use strict';var m=this.getStates();if(!m[l])m[l]={};return m[l];};k.prototype.getQueryCache=function(){'use strict';return this.getState('query_cache');};f.exports=k;},null);
  __d('WebMessengerDetailViewAllPeopleResultsControl',['Event','CSS','DataStore','DOM','ExpandableDataSource','MercuryIDs','Parent','WebMessengerStateConstants','WebMessengerStateManager','Token','WebMessengerEvents','cx','WebMessengerSubscriptionsHandler','WebMessengerTemplates'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){if(c.__markCompiled)c.__markCompiled();var v=5,w=5;function x(ca){'use strict';this._rootElement=ca;k.empty(this._rootElement);var da=u[':fb:web-messenger:all-people-results'].build();k.setContent(this._rootElement,da.getRoot());this._loadingSpinner=da.getNode('loadingSpinner');this._peopleResults=da.getNode('results');this._loadMoreButton=da.getNode('loadMoreButton');this._loadMoreLink=da.getNode('loadMoreLink');t.addSubscriptions(h.listen(this._loadMoreLink,'click',(function(){i.addClass(this._loadMoreButton,'async_saving');this._peopleDataSource&&this._peopleDataSource.loadMore();}).bind(this)));}x.prototype.hideView=function(){'use strict';i.hide(this._rootElement);};x.prototype.updateView=function(){'use strict';var ca=p.getCurrentDetailState();if(ca==o.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS){i.show(this._rootElement);y(this);r.detailDOMChanged();}};x.prototype.destroy=function(){'use strict';};function y(ca){i.show(ca._loadingSpinner);i.hide(ca._peopleResults);i.hide(ca._loadMoreButton);var da=p.getCurrentStateData(),ea=da.all_people_query||'';z(ca);var fa=(da.participants||[]).map(function(ga){return m.tokenize(ga).value;});ca._peopleDataSource.setExclusions(fa);ca._peopleDataSource.query(ea);}function z(ca){if(!ca._peopleDataSource){ca._peopleDataSource=new l({queryEndpoint:'/ajax/mercury/search_people.php'},v,w);ca._peopleDataSource.init();t.addSubscriptions(ca._peopleDataSource.subscribe('respond',aa.bind(null,ca)),h.listen(ca._rootElement,'click',function(event){var da=event.getTarget().parentNode;if(i.hasClass(da,"_4wt"))ba(event.getTarget(),ca._peopleDataSource);}));}}function aa(ca,da,ea){var fa=p.getCurrentDetailState(),ga=p.getCurrentStateData();if(fa==o.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS&&ga.all_people_query==ea.value){k.empty(ca._peopleResults);i.show(ca._peopleResults);ea.results.forEach(function(ha){var ia=k.create('div',{className:'personResult'},ha.detail_markup);j.set(ia,'uid',ha.uid);k.appendContent(ca._peopleResults,ia);});if(ea.results.length){i.hide(ca._loadingSpinner);i.conditionShow(ca._loadMoreButton,!ca._peopleDataSource.hasLoadedAllResults());i.conditionClass(ca._loadMoreButton,'async_saving',ca._peopleDataSource.isLoadingMore());}}}function ba(ca,da){var ea=n.byClass(ca,'personResult'),fa=da.getEntry(j.get(ea,'uid')),ga=babelHelpers._extends({},p.getCurrentStateData(),{new_tokens:[new q(fa)],start:false});p.updateDetailState(o.DETAIL.COMPOSE_MAIN,ga);}f.exports=x;},null);
  __d('WebMessengerComposerTypeaheadView',['BucketedTypeaheadView','CSS','DataStore','MercuryTypeaheadConstants','WebMessengerStateConstants','WebMessengerStateManager','cx','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p,q;p=babelHelpers.inherits(r,h);q=p&&p.prototype;function r(v,w){'use strict';q.constructor.call(this,v,w);this.typeObjects={};this.typeObjects[k.FRIEND_TYPE]={disabled:true,uid:k.FRIEND_TYPE,type:k.HEADER_TYPE};this.typeObjects[k.THREAD_TYPE]={uid:k.THREAD_TYPE,text:o._("Group Conversations"),type:k.HEADER_TYPE,linkText:o._("Show More"),getLinkHandler:u.bind(null,this)};this.typeObjects[k.PAGE_TYPE]={uid:k.PAGE_TYPE,text:o._("Businesses"),type:k.HEADER_TYPE};this.typeObjects[k.FB4C_TYPE]={uid:k.THREAD_TYPE,text:o._("Co-workers"),type:k.HEADER_TYPE};this.typeObjects[k.NON_FRIEND_TYPE]={uid:k.NON_FRIEND_TYPE,text:o._("Other People"),type:k.HEADER_TYPE,linkText:o._("Show All"),getLinkHandler:(function(){return (function(){t(this.value);}).bind(this);}).bind(this)};}r.prototype.setTypeahead=function(v){'use strict';q.setTypeahead.call(this,v);var w=j.get(v,'Typeahead');w.subscribe('loading',(function(x,y){var z=w.getData();if(this._threadHeader)i.conditionClass(this._threadHeader,"_355",z.isLoadingMore(this.value));}).bind(this));};r.prototype.setNewHeader=function(v,w){'use strict';if(w.uid===k.THREAD_TYPE)this._threadHeader=v;};r.prototype.mouseover=function(event){'use strict';if(!s(this,event))q.mouseover.call(this,event);};r.prototype.mouseup=function(event){'use strict';if(!s(this,event))q.mouseup.call(this,event);};r.prototype.clearSelected=function(){'use strict';this.index=-1;this.highlight(-1);};function s(v,event){var w=v.getIndex(event);return w>=0&&w<v.results.length&&v.results[w].type==k.HEADER_TYPE;}function t(v){var w=babelHelpers._extends({},m.getCurrentStateData(),{all_people_query:v,start:false});m.updateDetailState(l.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS,w);}function u(v){var w=j.get(v.typeahead,'Typeahead'),x=w.getData();if(x.hasLoadedInitialResults(v.value)&&!x.hasLoadedAllResults(v.value))return x.loadMore.bind(x);}f.exports=r;},null);
  __d('MercuryDataSourceHelper',['MercuryPayloadSource','MercuryTypeaheadConstants','MercuryThreadMetadataRawRenderer','MercuryServerPayloadPreprocessor','MercuryThreadMetadataRenderer'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryServerPayloadPreprocessor').get(),l=c('MercuryThreadMetadataRenderer').get(),m={updateMercuryOnFetchComplete:function(n){n.subscribe('fetchComplete',function(o,p){var q={participants:[],threads:[],pages:[],payload_source:h.SERVER_SEARCH};p.response.getPayload().entries.forEach(function(r){if(r.type==i.THREAD_TYPE){q.threads=q.threads.concat(r.mercury_thread);q.participants=q.participants.concat(r.participants_to_render);}else if(r.type==i.PAGE_TYPE)q.pages=q.pages.concat(r);});if(q.threads.length){k.handleUpdate(q);p.response.getPayload().entries.forEach(function(r){if(r.mercury_thread)r.text=l.renderThreadNameAndParticipantList(r.mercury_thread.thread_id,r.participants_to_render,r.mercury_thread.participants.length,{last_separator_uses_and:false,names_renderer:j.renderShortNames});});}});}};f.exports=m;},null);
  __d('MercuryExpandableDataSource',['MercuryTypeaheadDataSource'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i,j;i=babelHelpers.inherits(k,h);j=i&&i.prototype;function k(l,m,n){'use strict';l=l||{};l.maxResults=m;j.constructor.call(this,l);this.$MercuryExpandableDataSource1=m;this.$MercuryExpandableDataSource2=n;this.$MercuryExpandableDataSource3={};}k.prototype.query=function(l,m,n){'use strict';this.setQueryData({offset:0,limit:this.$MercuryExpandableDataSource1});return j.query.call(this,l,m,n);};k.prototype.fetchHandler=function(l,m){'use strict';var n=l.getPayload(),o=m.value;this.getState('is_loading_more_per_query')[o]=false;this.getState('total_results_count_per_query')[o]=n.total_count;j.fetchHandler.call(this,l,m);};k.prototype.loadMore=function(){'use strict';if(this.value&&!this.hasLoadedAllResults()){var l=this.getState('max_results_per_query');if(!l[this.value])l[this.value]=this.$MercuryExpandableDataSource1;this.setQueryData({offset:l[this.value],limit:this.$MercuryExpandableDataSource2});l[this.value]+=this.$MercuryExpandableDataSource2;if(l[this.value]>this.$MercuryExpandableDataSource4)this.$MercuryExpandableDataSource4=l[this.value];this.getState('is_loading_more_per_query')[this.value]=true;this.fetch(this.queryEndpoint,this.getQueryData(this.value,this.buildUids(this.value)),{value:this.value});}};k.prototype.isLoadingMore=function(){'use strict';return this.getState('is_loading_more_per_query')[this.value];};k.prototype.hasLoadedAllResults=function(){'use strict';var l=this.getState('total_results_count_per_query')[this.value],m=(this.buildQueryResults(this.value)||[]).length;return l&&m>=l;};k.prototype.getStates=function(){'use strict';return this.$MercuryExpandableDataSource3;};k.prototype.getState=function(l){'use strict';var m=this.getStates();if(!m[l])m[l]={};return m[l];};f.exports=k;},null);
  __d('WebMessengerTypeaheadDataSource',['MercuryExpandableDataSource','MercuryIDs','MercuryParticipants','MercuryTypeaheadConstants','WebMessengerStateManager'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m,n;m=babelHelpers.inherits(o,h);n=m&&m.prototype;function o(r){'use strict';r=r||{};r.kanaNormalization=true;n.constructor.call(this,r,k.COMPOSER_THREADS_INITIAL_LIMIT,k.COMPOSER_SHOW_MORE_LIMIT);this.setMaxResults(k.COMPOSER_WM_MAX);}o.prototype.bootstrap=function(){'use strict';if(!n.bootstrap.call(this))this.fetchEntryBigProfilePic();};o.prototype.updateBootstrapData=function(){'use strict';n.updateBootstrapData.call(this);this.fetchEntryBigProfilePic();};o.prototype.buildData=function(r){'use strict';var s=[],t=[],u=[],v=[],w=[];r.forEach(function(y){var z=n.getEntry.call(this,y);switch(z.render_type){case k.FRIEND_TYPE:if(s.length<k.COMPOSER_FRIENDS_MAX)s.push(y);break;case k.THREAD_TYPE:var aa=z.mercury_thread.thread_fbid;z.uid=aa;n.setEntry.call(this,aa,z);if(p().length===0)t.push(aa);break;case k.NON_FRIEND_TYPE:if(u.length<k.COMPOSER_NON_FRIENDS_MAX)u.push(y);break;case k.FB4C_TYPE:if(v.length<k.COMPOSER_FB4C_MAX)v.push(y);break;case k.PAGE_TYPE:if(w.length<k.COMPOSER_PAGES_MAX&&p().length===0)w.push(y);break;}},this);var x=s.concat(v,t,w,u);return n.buildData.call(this,x);};o.prototype.query=function(r,s,t){'use strict';this.value=r;if(!n.query.call(this,r,s,t)){if(this.getState('loaded_all_threads_per_query')[r]==null)this.getState('loaded_all_threads_per_query')[r]=true;this.getState('loaded_initial_per_query')[r]=true;}this.logQuery({event:'query_web_messenger',query:r});};o.prototype.respond=function(r,s,t){'use strict';var u=n.respond.call(this,r,s,t);this.logResponse({event:'query_response_web_messenger',response_query:r,response_uids:s});return u;};o.prototype.getQueryData=function(r,s){'use strict';var t=n.getQueryData.call(this,r,s);t.existing_token_ids=p();return t;};o.prototype.fetchHandler=function(r,s){'use strict';this.getState('loaded_all_threads_per_query')[s.value]=r.getPayload().end_of_threads;this.getState('loaded_initial_per_query')[s.value]=true;n.fetchHandler.call(this,r,s);};o.prototype.hasLoadedInitialResults=function(r){'use strict';if(r===undefined)r=this.value;return this.getState('loaded_initial_per_query')[r]||r&&r.length<=1;};o.prototype.hasLoadedAllResults=function(r){'use strict';if(r===undefined)r=this.value;return this.getState('loaded_all_threads_per_query')[r];};o.prototype.fetchEntryBigProfilePic=function(){'use strict';var r=this.getCachedShortProfileIDs().map(function(s){return i.getParticipantIDFromUserID(s);});j.getBigImageMulti(r,q.bind(this));};o.prototype.loadMore=function(){'use strict';this.setMaxResults(this.buildQueryResults(this.value).length+k.COMPOSER_SHOW_MORE_LIMIT*2);n.loadMore.call(this);};function p(){var r=l.getCurrentStateData();return (r.participants||[]).map(function(s){return i.tokenize(s).value;});}function q(r){for(var s in r)if(r.hasOwnProperty(s)){var t=this.getEntry(i.getUserIDFromParticipantID(s));if(t)t.photo=r[s];}if(this.value)this.query(this.value);}f.exports=o;},null);
  __d('WebMessengerTypeaheadRenderer',['CurrentUser','DOM','ImmutableObject','MercuryAPIArgsSource','MercuryThreadImage.react','MercuryTypeaheadConstants','MercuryTypeaheadRenderer','React','ReactDOM','WebMessengerTemplates','MercuryThreadMetadataRawRenderer','MercuryThreadIDMap','MercuryThreadMetadataRenderer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r){if(c.__markCompiled)c.__markCompiled();var s=c('MercuryThreadIDMap').get(),t=c('MercuryThreadMetadataRenderer').get(),u=c('MercuryThreads').get(),v=50;function w(y,z){var aa;switch(y.type){case m.HEADER_TYPE:aa=q[':fb:web-messenger:typeahead-header'].build();n.renderHeader(aa,y);if(this.setNewHeader)this.setNewHeader(aa.getRoot(),y);break;case m.USER_TYPE:case m.PAGE_TYPE:aa=q[':fb:web-messenger:threadlist-row'].build();n.renderPersonWithBigPhoto(aa,y);break;case m.THREAD_TYPE:aa=q[':fb:web-messenger:threadlist-row'].build();x(aa,y);break;default:return i.create('div');}return aa.getRoot();}function x(y,z){var aa=s.getClientIDFromServerIDNow(z.uid),ba=o.createElement(l,{size:v,thread:new j(z.mercury_thread),viewer:h.getID()});p.render(ba,y.getNode('image'));var ca=t.renderThreadNameAndParticipantList(aa,z.participants_to_render,z.mercury_thread.participants.length,{last_separator_uses_and:false,names_renderer:r.renderShortNames});i.setContent(y.getNode('name'),ca);y.getRoot().setAttribute('aria-label',ca);u.getThreadMeta(aa,function(da){t.renderSnippet(da,y.getNode('snippet'));t.renderTimestamp(y.getNode('timestamp'),da.timestamp_absolute,da.timestamp_relative,da.timestamp);},k.WEBMESSENGER);}f.exports=w;},null);
  __d('WebMessengerDetailViewComposeTypeaheadControl',['Event','WebMessengerComposerTypeaheadView','CSS','DOM','MercuryFolders','Keys','MercuryDataSourceHelper','MercuryIDs','MercuryTypeahead','MercuryTypeaheadConstants','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerEvents','WebMessengerTypeaheadDataSource','WebMessengerSubscriptionsHandler','WebMessengerTypeaheadRenderer','fbt','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){if(c.__markCompiled)c.__markCompiled();var z=c('MercuryThreads').get();function aa(ea,fa){'use strict';this._typeaheadRoot=ea;this._resultsRoot=fa;k.empty(this._typeaheadRoot);k.empty(this._resultsRoot);}aa.prototype.hideView=function(){'use strict';j.hide(this._typeaheadRoot);j.hide(this._resultsRoot);};aa.prototype.updateView=function(){'use strict';var ea=r;switch(s.getCurrentDetailState()){case ea.DETAIL.COMPOSE_MAIN:this.renderComposeTypeahead();j.hide(this._resultsRoot);break;case ea.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:this.renderComposeTypeahead();j.show(this._resultsRoot);break;}u.detailDOMChanged();};aa.prototype.renderComposeTypeahead=function(){'use strict';var ea=s.getCurrentStateData();j.show(this._typeaheadRoot);j.show(this._resultsRoot);if(!this._initiated){var fa=t[':fb:web-messenger:read-view:compose:typeahead'].build();k.setContent(this._typeaheadRoot,fa.getRoot());var ga=t[':fb:web-messenger:read-view:compose:typeahead:results'].build();k.setContent(this._resultsRoot,ga.getRoot());this._initialResultsLoadingSpinner=ga.getNode('initialResultsLoadingSpinner');this._typeaheadFooter=ga.getNode('typeaheadFooter');this._moreResultsLink=ga.getNode('moreResultsLink');this._typeaheadCaption=ga.getNode('caption');this.buildTypeahead(ga.getNode('results'));k.appendContent(fa.getNode('typeahead'),this._typeahead.getElement());this._initiated=true;}if(ea.start){if(!ea.participants)this._typeahead.reset();this._typeahead.focus();var ha=this._typeahead.getTypeahead().getCore();ha.getElement().removeAttribute('disabled');}ca(this);if(ea.start)s.updateDetailState(s.getCurrentDetailState(),babelHelpers._extends({},s.getCurrentStateData(),{start:false,new_tokens:undefined}));};aa.prototype.buildTypeahead=function(ea){'use strict';if(this._typeahead)return;var fa=new v({queryEndpoint:'/ajax/mercury/composer_query.php'});n.updateMercuryOnFetchComplete(fa);var ga=new p(fa,i);ga.setPlaceholder(y._("Name"));ga.setViewNodeID(ea);ga.setViewOption('renderer',x);w.addSubscriptions(ga.subscribe('tokens-changed',this.onTokensChanged.bind(this)));ga.build();w.addSubscriptions(ga.getTypeahead().subscribe(['respond','focus'],function(){ba(!!ga.getTypeahead().getCore().getValue());}),ga.getTypeahead().subscribe(['reset','blur'],function(){ba(false);}),ga.getTypeahead().subscribe('render',(function(ha,ia){da(this,ia.length);}).bind(this)),ga.getTypeahead().subscribe('reset',(function(){da(this,false);}).bind(this)),ga.getTypeahead().subscribe('query',(function(ha,ia){k.setContent(this._moreResultsLink,y._("See more results for {query}",[y.param('query',ia.value)]));}).bind(this)),h.listen(ga.getElement(),'keydown',function(ha){if(ha.keyCode===m.TAB&&!ha.getModifiers().any){u.focusComposer();return false;}}),h.listen(this._typeaheadFooter,'mousedown',function(){return false;}),h.listen(this._moreResultsLink,'click',(function(){var ha=this._typeahead.getTypeahead().getCore().getValue(),ia=babelHelpers._extends({},s.getCurrentStateData(),{all_people_query:ha,start:false});s.updateDetailState(r.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS,ia);}).bind(this)),h.listen(this._typeaheadFooter,'mouseover',(function(){this._typeahead.getTypeahead().getView().clearSelected();}).bind(this)));this._typeahead=ga;};aa.prototype.onTokensChanged=function(){'use strict';var ea=s.getCurrentDetailState();if(ea==r.DETAIL.COMPOSE_MAIN||ea==r.DETAIL.COMPOSE_TYPEAHEAD_RESULTS||ea==r.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS){var fa=this._typeahead,ga=fa.getTokens(),ha=ga[ga.length-1];if(ha&&ha.getInfo().mercury_thread){var ia=ha.getInfo().mercury_thread.thread_id,ja=l.getFromMeta(z.getThreadMetaNow(ia));s.updateDetailState(r.DETAIL.RECENT_MESSAGES,{thread_id:ia,folder:ja,reuse_composer:true});}else{var ka=ga.map(function(ma){if(ma.getInfo().type===q.PAGE_TYPE){var na=fa.getTypeahead().getCore();na.getElement().setAttribute('disabled','disabled');}return o.getParticipantIDFromUserID(ma.getValue());}),la=s.getCurrentStateData();if(!la.start||(ka||[]).length)s.updateDetailState(r.DETAIL.COMPOSE_MAIN,babelHelpers._extends({},la,{participants:ka}));}}};aa.prototype.destroy=function(){'use strict';};function ba(ea){var fa=s.getCurrentDetailState(),ga=r;if(fa!=ga.DETAIL.COMPOSE_MAIN&&fa!=ga.DETAIL.COMPOSE_TYPEAHEAD_RESULTS)return;var ha;if(ea){ha=ga.DETAIL.COMPOSE_TYPEAHEAD_RESULTS;}else if(fa==ga.DETAIL.COMPOSE_TYPEAHEAD_RESULTS){ha=ga.DETAIL.COMPOSE_MAIN;}else ha=fa;if(ha!=fa){var ia=babelHelpers._extends({},s.getCurrentStateData(),{start:false,new_tokens:undefined});s.updateDetailState(ha,ia);}}function ca(ea){var fa=s.getCurrentStateData();if(fa.new_tokens){var ga=ea._typeahead.getTypeahead().getCore();ga.reset();fa.new_tokens.forEach(function(ha){ea._typeahead.getTokenizer().addToken(ha);});}}function da(ea,fa){var ga=ea._typeahead.getTypeahead(),ha=ga.getCore().getValue(),ia=ga.getData().hasLoadedInitialResults(ha);j.conditionShow(ea._initialResultsLoadingSpinner,!ia);j.conditionShow(ea._moreResultsLink,ia&&fa);if(!fa&&ia){k.setContent(ea._typeaheadCaption,y._("No results found"));}else k.setContent(ea._typeaheadCaption,y._("Displaying top results"));}f.exports=aa;},null);
  __d('WebMessengerUnseenMessageNoticeRenderer',['JSXDOM','ContextualLayer','LayerFadeOnHide','cx','fbt','Event'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n={renderNoticeTooltip:function(p,q){var r=h.div({className:"_40p"},o(p),h.i({className:"_40q"})),s=new i(q||{},r).enableBehavior(j);return s;}};function o(p){var q=h.div({className:"_40r"},l._("You have new messages"));m.listen(q,'click',p);return q;}f.exports=n;},null);
  __d('WebMessengerMessagesNotice',['LayerDestroyOnHide','MercuryViewer','WebMessengerUnseenMessageNoticeRenderer'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();function k(){'use strict';this._notice=null;this._noticeContextNode=null;this._active=false;}k.prototype.getActive=function(){'use strict';return this._active;};k.prototype.showMessageNotice=function(l,m){'use strict';if(!this._active)return;if(!this._notice)this._notice=j.renderNoticeTooltip(l,{context:this._noticeContextNode,offsetY:2,position:m,alignment:'center'});this._notice.show();};k.prototype.hideMessageNotice=function(){'use strict';this._notice&&this._notice.hide();};k.prototype.removeMessageNotice=function(){'use strict';if(this._notice){this._notice.enableBehavior(h).hide();this._notice=null;}};k.prototype.setNoticeContextNode=function(l){'use strict';this._noticeContextNode=l;};k.prototype.hideView=function(){'use strict';this._active=false;this.hideMessageNotice();};k.prototype.updateView=function(){'use strict';this._active=true;};k.prototype.destroy=function(){'use strict';this._active=false;this.removeMessageNotice();};k.prototype.onlyReceivedFromSelf=function(l){'use strict';for(var m in l){if(!l.hasOwnProperty(m))continue;for(var n=0,o=l[m].length;n<o;n++)if(l[m][n].author!==i.getID())return false;}return true;};f.exports=k;},null);
  __d('WebMessengerDetailViewUnreadMessagesNotice',['MercuryThreadlistConstants','WebMessengerStateManager','throttle','UserActivity','WebMessengerMessagesNotice','WebMessengerSubscriptionsHandler','MercuryThreadInformer','MercuryThreadActions'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n,o,p=c('MercuryThreadInformer').get(),q=c('MercuryThreadActions').get(),r=h.MESSAGE_NOTICE_INACTIVITY_THRESHOLD;n=babelHelpers.inherits(s,l);o=n&&n.prototype;function s(t){'use strict';o.constructor.call(this);this._manager=t;m.addSubscriptions(p.subscribe('thread-read-changed',this._updateReadStatus.bind(this)));this._manager.addScrollCallback(j.withBlocking((function(u){if(this._shouldMarkAsRead(u)){this.removeMessageNotice();if(k.isActive(5000)){var v=i.getCurrentStateData().thread_id;q.markRead(v);}else k.subscribeOnce((function(){if(this._shouldMarkAsRead(u)){var w=i.getCurrentStateData().thread_id;q.markRead(w);}}).bind(this));}}).bind(this),100,null));}s.prototype.updateOnMessagesReceived=function(t,u,v,w){'use strict';var x=!k.isActive(r);if(!o.getActive.call(this))return;if(x||o.onlyReceivedFromSelf.call(this,w)){this.removeMessageNotice();this._manager.scrollToBottom(true);}else if(!this._manager.isScrolledToBottom()){var y=v-(u-t);this._manager.setScrollTop(y,false);this.showMessageNotice();}};s.prototype.showMessageNotice=function(){'use strict';var t=(function(){this._manager.scrollToBottom();}).bind(this);o.showMessageNotice.call(this,t,'above');};s.prototype._shouldMarkAsRead=function(t){'use strict';var u=i.getCurrentStateData().thread_id;return u&&o.getActive.call(this)&&t.isScrolledToBottom();};s.prototype._updateReadStatus=function(t,u){'use strict';var v=i.getCurrentStateData().thread_id;if(v&&u[v]&&u[v].mark_as_read)this.removeMessageNotice();};f.exports=s;},null);
  __d('MercuryListUpdateRenderer',['DOM','ge'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={updateList:function(k,l,m,n,o){var p=[];for(var q=0;q<l.length;q++){if(o){var r=o(q);r&&p.push(r);}var s=i(l[q]);if(s&&m(q)){p.push(s);}else p.push(n(q));}h.setContent(k,p);}};f.exports=j;},null);
  __d('WebMessengerMessageIDFinder',['DataStore','DOM','csx'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k={find:function(l,m){var n=m?i.find(l,m):l,o=h.get(n,'MessageRenderer:messageID');return o;},findAll:function(l){var m=i.scry(l,"._53"),n=[];if(m.length){var o=m[0];for(var p=0;p<o.childNodes.length;p++)n.push(h.get(o.childNodes[p],'MessageRenderer:messageID'));}return n;}};f.exports=k;},null);
  __d('WebMessengerMessagesSelection',['CSS','csx','DOM','getObjectValues','WebMessengerMessageIDFinder'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m={};function n(q,r){var s=q,t=r;if(s==t)return 0;while(true){s=s.nextSibling;t=t.nextSibling;if(!s||t==q){return 1;}else if(!t||s==r)return -1;}}function o(q,r){var s=q.id,t=j.scry(q,"._yh input")[0];if(r){m[s]=q;h.addClass(q,'selected');t.checked=true;}else{delete m[s];h.removeClass(q,'selected');t.checked=false;}}var p={clear:function(){for(var q in m)o(m[q],false);},selectClick:function(q){o(q,!(q.id in m));},getSelectedMessageIDs:function(){var q=k(m);q.sort(n);var r=[];q.forEach(function(s){r=r.concat(l.findAll(s));});return r;}};f.exports=p;},null);
  __d('MessagingConst',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={APP_ID:313785040330,XD_MESSAGE:{SANDBOX_READY:'sandbox_ready',SET_CONTENT:'set_content',HTML_SIZE:'html_size',REFRESH_SIZE:'refresh_size'},SHINGLE_SCROLL_TRIGGER:5,EVENTS:{MESSAGE_SENT:'messaging/message_sent'},initConstants:function(i){Object.assign(h,i);}};f.exports=h;},null);
  __d('MessagingXD',['Event','DOM','MercuryConstants','MessagingConst','URI'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();function m(n){this._listeners=[h.listen(window,'message',this._onPostMessage.bind(this))];this._iframes={};this._contentWindows={};this._messageHandler=n;}Object.assign(m.prototype,{unload:function(){this._listeners.forEach(function(n){n.remove();});},createIframe:function(n,o,p){var q=new l(p);this._iframes[o]=i.create('iframe',{name:o,frameBorder:0,src:q.toString()});i.appendContent(n,this._iframes[o]);this._contentWindows[o]=this._iframes[o].contentWindow;return this._iframes[o];},sendMessage:function(n,o){var p=Array.prototype.slice.apply(arguments);p[0]=k.APP_ID;var q=this._iframes[n].contentWindow||this._contentWindows[n];q.postMessage(p.join(','),j.Sandbox.ORIGIN);},_onPostMessage:function(event){if(event.origin!==j.Sandbox.ORIGIN||!event.data.split)return;var n=event.data.split(','),o=unescape(n[1]);this._contentWindows[o]=event.source;this._messageHandler(o,n);}});f.exports=m;},null);
  __d('HTMLEmailRenderer',['CSS','MessagingConst','MessagingXD','emptyFunction','fbt','MercuryConstants'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();function n(o,p){this._resizeContent=o.resizeContent||k;this._richMap={};this._useFBStyle=p;this._xdc=new j(this.onXDMessage.bind(this));this._maxWidth=0;}Object.assign(n.prototype,{onXDMessage:function(o,p){if(p[0]!=i.APP_ID.toString())return;if(this._richMap&&this._richMap[o])if(p[2]==i.XD_MESSAGE.SANDBOX_READY){return this.setIframeContent(o);}else if(p[2]==i.XD_MESSAGE.HTML_SIZE)return this._resizeContent(o,parseInt(p[3],10),parseInt(p[4],10),p[5]=='true',p[6]=='true');},setIframeContent:function(o,p){this._xdc.sendMessage(o,i.XD_MESSAGE.SET_CONTENT,escape(this._richMap[o]),this._useFBStyle?'useFBStyle':'',p?'forceDialogOnWide':'',escape(l._("Show Hidden Text")),escape(l._("Hide")),this._maxWidth);},makeRich:function(o,p,q,r){var s=this._xdc.createIframe(p,o,m.Sandbox.PAGE_URL);h.addClass(s,'xdIframe');this._richMap[o]=q;this._maxWidth=r||0;},updateRichMap:function(o,p){this._richMap[o]=p;},unload:function(){this._xdc.unload();}});f.exports=n;},null);
  __d('UntrustedLink',['DOM','Event','URI','UserAgent_DEPRECATED'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();function l(m,n,o,p){this.dom=m;this.url=m.href;this.hash=n;this.func_get_params=p||function(){return {};};i.listen(this.dom,'click',this.onclick.bind(this));i.listen(this.dom,'mousedown',this.onmousedown.bind(this));i.listen(this.dom,'mouseup',this.onmouseup.bind(this));i.listen(this.dom,'mouseout',this.onmouseout.bind(this));this.onmousedown(i.$E(o));}l.bootstrap=function(m,n,o,p){if(m.__untrusted)return;m.__untrusted=true;new l(m,n,o,p);};l.prototype.getRewrittenURI=function(){var m=babelHelpers._extends({u:this.url,h:this.hash},this.func_get_params(this.dom)),n=new j('/l.php').setSubdomain('www');if(new j(this.url).getProtocol()=='https'){return n.setQueryData(m).setProtocol('https');}else return n.setQueryData(m).setProtocol('http');};l.prototype.onclick=function(){setTimeout((function(){this.setHref(this.url);}).bind(this),100);this.setHref(this.getRewrittenURI());};l.prototype.onmousedown=function(m){if(m.button==2)this.setHref(this.getRewrittenURI());};l.prototype.onmouseup=function(){this.setHref(this.getRewrittenURI());};l.prototype.onmouseout=function(){this.setHref(this.url);};l.prototype.setHref=function(m){if(k.ie()<9){var n=h.create('span');h.appendContent(this.dom,n);this.dom.href=m;h.remove(n);}else this.dom.href=m;};f.exports=l;},null);
  __d('DOMHyperlink',['Env','JSXDOM','TransformTextToDOMMixin','UntrustedLink','URI','URLScraper','isFacebookURI','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p={MAX_ITEMS:40,match:function(q,r){var s=m.match(q);if(!s)return false;var t=q.indexOf(s),u=t+s.length;return {startIndex:t,endIndex:u,element:this._element(s,r)};},_element:function(q,r){var s=q,t=s.replace(/"/g,'%22');if(!/^[a-z][a-z0-9\-+.]+:\/\//i.test(q))t='http://'+t;if(!l.isValidURI(t))return s;var u=i.a({className:"_553k",href:t,target:"_blank",rel:"nofollow"},s);if(r&&!n(new l(t)))u.onmousedown=function(v){k.bootstrap(this,h.lhsh,v);};return u;}};f.exports=Object.assign(p,j);},null);
  __d('MercuryMessageRenderer',['DOM','DOMEmoji','DOMEmote','DOMHyperlink','isFacebookURI','JSXDOM','URI','transformTextToDOM'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p={formatMessageBody:function(t,u,v){var w=(t||'').replace(/\s+$/,'');if(!u)return s(w,false,v);var x=Object.keys(u).map(function(aa){return window.parseInt(aa);}).sort(function(aa,ba){return aa-ba;}),y=[],z=0;x.forEach(function(aa){var ba=w.slice(z,aa);if(ba)y.push(s(ba,false,v));z=aa+u[aa].length;var ca=w.slice(aa,z);if(ca)y.push(s(ca,true,v));});if(z<w.length)y.push(s(w.slice(z),false,v));return y.length===0?null:y.length===1?y[0]:h.create('span',{},y);}};function q(t,u){var v=u(t);if(Array.isArray(v))v.forEach(function(w){if(w.href){var x=new n(w.href);if(l(x)&&!x.getFragment())w.href=x.addQueryData({__mref:'message'}).toString();}});return v;}function r(t,u){var v=t.replace(/\r\n?/g,'\n').split(/\n{2,}/);return v.filter(function(w){return w.length;}).map(function(w){return m.p(null,q(w,u));});}function s(t,u,v){if(t.length===0&&!u)return null;var w=function(x){return o(x,[k.params(true),i,j]);};return (m.span({className:u?'highlight':null},v?r(t,w):q(t,w)));}f.exports=p;},null);
  __d('WebMessengerThreadMessagesRenderer',['AsyncRequest','MercuryAttachment','CSS','DataStore','DOM','Event','HovercardLink','HTMLEmailRenderer','Image.react','ImmutableObject','LinkController','MercuryLogMessageRenderer','MercuryActionType','MercuryAttachments.react','MercuryAttachmentType','MercuryErrorInfo','MercuryIDs','MercuryMessageError.react','MercuryMessageGroup','MercuryTimePassed','MercuryViewer','MercuryMessageRenderer','WebMessengerMessagesSelection','Parent','MercuryParticipants','MercuryParticipantsConstants','React','ReactDOM','WebMessengerStateManager','MercuryStatusTemplates','Style','WebMessengerTemplates','Vector','WebMessengerConstants','WebMessengerEvents','WebMessengerSubscriptionsHandler','csx','cx','formatDate','ge','isRTL','fbt','MercuryMessages','MercuryThreadMetadataRenderer'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa){if(c.__markCompiled)c.__markCompiled();'use strict';var xa=c('MercuryMessages').get(),ya=c('MercuryThreadMetadataRenderer').get(),za={updateSelection:function(bb){var cb=ja.getCurrentStateData().message_action;j.conditionClass(bb,'selectionEnabled',cb);},setupSelectionListener:function(bb){r.registerHandler(function(cb){var db=ja.getCurrentStateData().message_action;if(db&&ea.byClass(cb,'webMessengerMessageGroup'))return false;});qa.addSubscriptions(m.listen(bb,'click',function(event){var cb=ja.getCurrentStateData().message_action;if(cb){var db=null;for(var eb=event.getTarget();eb;eb=eb.parentNode)if(j.hasClass(eb,'webMessengerMessageGroup'))db=eb;db&&da.selectClick(db);}}));},renderForwardedMessages:function(bb,cb){var db=z.calculateMessageGroups(cb),eb=null;db.forEach(function(fb){var gb=za.renderMessageGroup(fb,true);l.appendContent(bb,gb.getRoot());eb=fb[fb.length-1];});},renderMessageGroup:function(bb,cb,db){var eb=bb[0],fb=eb.action_type==t.LOG_MESSAGE,gb=fb?ma[':fb:web-messenger:read-view:log-message'].build():ma[':fb:web-messenger:read-view:message-group'].build();gb.getRoot().setAttribute('id',(db||'wm:')+eb.message_id);if(fb){za.renderSingleLogMessage(gb,eb);}else fa.get(eb.author,function(hb){za.renderSingleMessage(gb,eb,hb,cb);for(var ib=1;ib<bb.length;ib++)za.appendMessageToGroup(gb,bb[ib]);});return gb;},appendMessageToGroup:function(bb,cb){var db=ma[':fb:web-messenger:read-view:message'].build();if(cb.is_filtered_content_bh){var eb=ka[':fb:mercury:filtered-message-blackholefilter'].build();db.setNodeContent('message',eb.getRoot());}else if(cb.is_filtered_content_account){var fb=ka[':fb:mercury:filtered-message-account'].build();db.setNodeContent('message',fb.getRoot());}else if(cb.is_filtered_content_quasar){var gb=ka[':fb:mercury:filtered-message-quasar'].build();db.setNodeContent('message',gb.getRoot());}else if(cb.is_filtered_content_invalid_app){var hb=ka[':fb:mercury:filtered-message-invalid-app'].build();db.setNodeContent('message',hb.getRoot());}else if(cb.is_filtered_content){var ib=ka[':fb:mercury:filtered-message'].build();db.setNodeContent('message',ib.getRoot());}else db.setNodeContent('message',ca.formatMessageBody(cb.body,null,true));ia.render(ha.createElement(y,{message:new q(cb)}),db.getNode('status'));var jb=db.getRoot();k.set(jb,'MessageRenderer:messageID',cb.message_id);j.addClass(db.getNode('message'),va(cb.body)?'direction_rtl':'direction_ltr');l.appendContent(bb.getNode('bodyDiv'),jb);fa.get(ba.getID(),function(kb){if(kb.employee){var lb=ma[':fb:web-messenger:bug-reporting'].build();lb.getNode('fbtrace').setAttribute('data-timestamp',cb.timestamp);lb.getNode('brokenheart').setAttribute('data-timestamp',cb.timestamp);l.setContent(db.getNode('bugReporting'),lb.getRoot());}});},renderSingleLogMessage:function(bb,cb){var db=bb.getNode('attachment');s.renderLegacy(bb.getNode('icon'),bb.getNode('message'),db,cb);za.renderStatus(bb,cb);ya.renderTimestamp(bb.getNode('timestamp'),cb.timestamp_absolute,cb.timestamp_relative,cb.timestamp);},renderMessageSeparator:function(bb){var cb=ma[':fb:mercury:timestamp'].render();cb.removeAttribute('title');var db=bb.timestamp_absolute;if(!db)db=ta(new Date(bb.timestamp),{withinWeek:'l',withinYear:'F jS',older:'F jS, Y'});if(xa.isFirstMessage(bb))if(bb.timestamp_time_passed===aa.TODAY){db=wa._("Conversation started today");}else db=wa._("Conversation started {timestamp}",[wa.param('timestamp',db)]);l.setContent(cb,db);j.show(cb);return l.create('li',{className:"_2n3"},cb);},renderMessageSeparatorForIndex:function(bb,cb){var db=bb[cb][0];if(cb){var eb=db.timestamp,fb=bb[cb-1],gb=fb[fb.length-1].timestamp,hb=oa.READ_VIEW_SEPARATOR_TIME_LIMIT;if(eb-gb<hb)return false;}return za.renderMessageSeparator(db);},renderRawAttachments:function(bb,cb){var db=i.convertRaw(cb.raw_attachments||[]),eb=(cb.photo_fbids?cb.photo_fbids.length:0)+(cb.image_ids?cb.image_ids.length:0);for(var fb=0;fb<eb;fb++)db.push({attach_type:v.PHOTO,preview_width:206,preview_height:206});if(cb.sticker_id)db.push({attach_type:v.STICKER});za.renderAttachments(bb,db,cb);},renderAttachments:function(bb,cb,db){ia.render(ha.createElement(u,{attachments:cb,maxWidth:450,message:db,isChat:false,onStickerClick:pa.stickerClicked.bind(pa)}),bb);},renderStatus:function(bb,cb){if(w.hasErrorStatus(cb)){var db=ha.createElement(y,{message:new q(cb)}),eb=bb.getNode('statusContainer');if(eb&&db){ia.render(db,eb);j.show(eb);}}},renderSingleMessage:function(bb,cb,db,eb){if(cb.html_body){var fb=bb.getNode('fbml');m.listen(fb,'click',function(){new h().setURI('/ajax/messaging/async.php').setReadOnly(true).setMethod('GET').setData({action:'htmlDialog',mid:cb.message_id}).send();return false;});j.show(fb);var gb=bb.getNode('bodyDiv'),hb=l.create('div',{className:"_5xl"}),ib=l.create('div',{className:"_5xm"},hb);l.setContent(gb,ib);k.set(ib,'MessageRenderer:messageID',cb.message_id);var jb=new o({resizeContent:ab}),kb=function(){jb.makeRich(cb.message_id,hb,cb.html_body);};setTimeout(kb,0);za.renderStatus(bb,cb);}else za.appendMessageToGroup(bb,cb);var lb;if(db.href){lb=l.create('a',{href:db.href},db.name);if(ja.getStandaloneMode())lb.setAttribute('target','_blank');var mb=x.getUserIDFromParticipantID(db.id);if(mb)lb.setAttribute('data-hovercard',n.constructEndpoint({id:mb}));}else lb=db.name;bb.setNodeContent('authorName',lb);var nb=bb.getNode('image');j.removeClass(nb,'MercuryThreadImage');var ob=ha.createElement(p,{alt:db.name,width:ga.IMAGE_SIZE,height:ga.IMAGE_SIZE,src:db.image_src,className:"_50dv"});if(db.href)ob=ha.createElement('a',{href:db.href},ob);ob=ia.render(ob,nb);var pb;if(cb.timestamp_time_passed===aa.TODAY){pb='g:ia';}else pb='n/j, g:ia';var qb=ta(new Date(cb.timestamp),pb);ya.renderTimestamp(bb.getNode('timestamp'),cb.timestamp_absolute,qb,cb.timestamp);ya.renderMessageSourceTags(bb.getNode('tooltipForSource'),bb.getNode('sourceIcon'),cb.source_tags||[],cb.author_email);ya.renderSpoofWarning(bb.getNode('spoofWarning'),cb.is_spoof_warning,db);if(cb.subject)bb.setNodeContent('subject',cb.subject);if(cb.has_attachment){var rb=bb.getNode('attachments');if(cb.attachments&&cb.attachments.length===0){za.renderRawAttachments(rb,cb);}else if(cb.attachments!==null&&cb.attachments.length>0){za.renderAttachments(rb,cb.attachments,cb);}else if(cb.raw_attachments!=null&&cb.raw_attachments.length>0)za.renderRawAttachments(rb,cb.raw_attachments);}var sb=bb.getNode('forwards'),tb=cb.forward_count&&xa.getMessagesFromIDs(cb.forward_message_ids);if(tb)za.renderForwardedMessages(sb,tb);j.conditionShow(sb,tb);}};function ab(bb,cb,db){var eb=ua(bb),fb=l.find(eb,'iframe'),gb=l.find(fb,"^._5xm"),hb=gb.firstChild;la.set(fb,'width',cb+'px');la.set(fb,'height',db+1+'px');fb.setAttribute('scrolling','no');var ib=eb&&na.getElementDimensions(eb).x/cb;if(ib&&ib<1){la.set(gb,'height',Math.round(ib*(db+1))+'px');var jb=fb.style,kb=['transform','WebkitTransform','msTransform','MozTransform','OTransform'],lb;while(lb=kb.shift())if(typeof jb[lb]!=='undefined'){la.set(fb,lb,'scale('+ib+','+ib+')');return;}la.set(hb,'zoom',ib);}}f.exports=za;},null);
  __d('WebMessengerInfoBoxRenderer',['Event','cx','DOM','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();var l={render:function(m,n){var o=j.create('div',{className:"_4rk"},m),p=j.create('div',{}),q=true;n.forEach(function(r){if(!q){var s=j.create('span',{className:"_4rl"},'\u00b7');j.appendContent(p,s);}q=false;var t=j.create('a',{},r.text);if(r.handler)k.addSubscriptions(h.listen(t,'click',r.handler));j.appendContent(p,t);});return j.create('div',{className:"_4rh"},[o,p]);}};f.exports=l;},null);
  __d('MercurySearchContextResults',['KeyedCallbackManager','MercuryAPIArgsSource','MercuryIDs','MercuryThreadlistConstants','RangedCallbackManager','MercuryServerDispatcher','WebMessengerConstants','MercuryThreadIDMap','MercuryServerPayloadPreprocessor'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();var o=c('MercuryThreadIDMap').get(),p=c('MercuryServerPayloadPreprocessor').get(),q=new h(),r=k.WEBMESSENGER_SEARCH_SNIPPET_COUNT,s=n.MORE_SEARCH_CONTEXT_COUNT,t={getSearchContext:function(x,y,z){if(x){var aa=q.executeOrEnqueue(x,function(fa){var ga=v(fa,x);z(ga);}),ba=q.getUnavailableResources(aa);if(ba.length){var ca={message_id:x,limit:r+1},da=o.getServerIDFromClientIDNow(y),ea=j.tokenize(y);if(ea.type=='user'){ca.other_user_fbid=da;}else ca.thread_fbid=da;w(ca);}return aa;}},getMoreSearchContext:function(x,y,z,aa){if(x){var ba=q.getResource(x);if(ba){var ca=z==n.MORE_SEARCH_CONTEXT_UP?ba.up_message_ids:ba.down_message_ids,da=ca.getCurrentArraySize()+s,ea=ca.executeOrEnqueue(0,da,function(){var ja=v(ba,x);aa(ja);}),fa=ca.getUnavailableResources(ea);if(fa.length){var ga={message_id:x,limit:da,direction:z},ha=o.getServerIDFromClientIDNow(y),ia=j.tokenize(y);if(ia.type=='user'){ga.other_user_fbid=ha;}else ga.thread_fbid=ha;w(ga);}return ea;}}},handleUpdate:function(x){if(x.mercury_payload)p.handleUpdate(x.mercury_payload);var y=x.search_context||{};for(var z in y){var aa=y[z],ba=aa.other_user_fbid||aa.thread_fbid,ca=o.getClientIDFromServerIDNow(ba),da=!q.getResource(z),ea=da?{thread_id:ca,up_message_ids:new l(),down_message_ids:new l()}:q.getResource(z),fa=da?r+1:s;if(aa.up_message_ids&&(ea.up_message_ids.getCurrentArraySize()===0||aa.up_message_ids.length>=ea.up_message_ids.getCurrentArraySize()))u(ea.up_message_ids,aa.up_message_ids,fa);if(aa.down_message_ids&&(ea.down_message_ids.getCurrentArraySize()===0||aa.down_message_ids.length>=ea.down_message_ids.getCurrentArraySize()))u(ea.down_message_ids,aa.down_message_ids,fa);if(da)q.setResource(z,ea);}},unsubscribe:function(x,y,z){if(y){var aa=q.getResource(y);if(aa){if(z==n.MORE_SEARCH_CONTEXT_UP){aa.up_message_ids.unsubscribe(x);}else aa.down_message_ids.unsubscribe(x);}else q.unsubscribe(x);}}};function u(x,y,z){var aa=x.getCurrentArraySize(),ba=y.length<aa+z;if(y.length){x.removeAllResources();x.addResourcesWithoutSorting(y,0);}if(ba)x.setReachedEndOfArray();}function v(x,y){var z=x.up_message_ids.hasReachedEndOfArray(),aa=x.up_message_ids.getAllResources();if(!z)aa.shift();var ba=x.down_message_ids.hasReachedEndOfArray(),ca=x.down_message_ids.getAllResources();if(!ba)ca.pop();return {thread_id:x.thread_id,message_id:y,up_message_ids:aa,up_exhausted:z,down_message_ids:ca,down_exhausted:ba};}function w(x){x.client=i.WEBMESSENGER;m.trySend('/ajax/mercury/search_context.php',x);}m.registerEndpoints({'/ajax/mercury/search_context.php':{mode:m.IMMEDIATE,handler:t.handleUpdate}});f.exports=t;},null);
  __d('MercurySearchSnippetResults',['MercuryAPIArgsSource','MercuryIDs','MercurySingletonMixin','MercuryThreadlistConstants','MercuryThreadIDMap','RangedCallbackManager','MercuryServerDispatcher','MercuryServerPayloadPreprocessor'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p={},q={},r=null,s=k.WEBMESSENGER_SEARCH_SNIPPET_COUNT,t=k.WEBMESSENGER_SEARCH_SNIPPET_LIMIT,u=k.WEBMESSENGER_SEARCH_SNIPPET_MORE;function v(fa){'use strict';this.$MercurySearchSnippetResults1=fa;this.$MercurySearchSnippetResults2=o.getForFBID(fa);n.registerEndpoints({'/ajax/mercury/search_snippets.php':{request_user_id:fa,mode:n.IMMEDIATE,handler:(function(ga){this.handleUpdate(ga);}).bind(this)}});this.$MercurySearchSnippetResults3=l.getForFBID(fa);}v.prototype.getFBID=function(){'use strict';return this.$MercurySearchSnippetResults1;};v.prototype.getThreadIDMap=function(){'use strict';return this.$MercurySearchSnippetResults3;};v.prototype.getAllThreadSearchResults=function(fa,ga){'use strict';if(fa)w(this.$MercurySearchSnippetResults1,fa,t,0,ga);};v.prototype.getAllThreadSearchMoreResults=function(fa,ga){'use strict';if(fa){var ha=p[fa];if(ha){var ia=ha.getCurrentArraySize();w(this.$MercurySearchSnippetResults1,fa,u,ia,ga);}}};v.prototype.getSingleThreadSearchResults=function(fa,ga,ha){'use strict';if(!fa||!ga)return;x.call(this,fa,ga,s,0,ha);};v.prototype.getSingleThreadSearchMoreResults=function(fa,ga,ha){'use strict';if(!fa||!ga)return;if(!q[ga])return;var ia=q[ga][fa];if(ia){var ja=ia.num_total_snippets,ka=ia.snippets_cbm.getCurrentArraySize(),la=ja-ka;if(la>0){var ma=la>u?u:la;x.call(this,fa,ga,ma,ka,ha);}}};v.prototype.countSnippetsMatchingQueryInThread=function(fa,ga){'use strict';var ha=q[ga][fa];if(ha)return ha.num_total_snippets;};v.prototype.findIndexOfSnippet=function(fa,ga,ha,ia){'use strict';var ja=da(fa,ga),ka=ja.getAllResources();for(var la=0;la<ka.length;la++)if(ha===ka[la].message_id)return la;};v.prototype.findSnippetAtIndex=function(fa,ga,ha,ia){'use strict';aa(fa,ga,ha);ba.call(this,fa,ga,ha,ia);};v.prototype.handleUpdate=function(fa){'use strict';if(fa.mercury_payload)this.$MercurySearchSnippetResults2.handleUpdate(fa.mercury_payload);var ga=fa.search_snippets||{};Object.keys(ga).filter(function(va){return !!ga[va];}).forEach(function(va){Object.keys(ga[va]).forEach(function(wa){ga[va][wa].snippets.forEach(function(xa){xa.matched_keywords=y(xa.matched_keywords);});});});var ha=fa.offset,ia=[];for(var ja in ga){var ka=ga[ja];for(var la in ka){var ma=ka[la],na=fa.other_user_fbid||fa.thread_fbid,oa=this.$MercurySearchSnippetResults3.getClientIDFromServerIDNow(la),pa=ma.snippets,qa=da(ja,oa),ra=qa.getCurrentArraySize();if(!na){ia.push(oa);if(ra)continue;}else if(ha!=ra)continue;var sa=q[oa][ja];sa.num_total_snippets=ma.num_total_snippets;qa.addResourcesWithoutSorting(pa,ra);if(!na||fa.limit>pa.length)if(qa.getCurrentArraySize()==sa.num_total_snippets)qa.setReachedEndOfArray();}if(!na){var ta=ca(ja),ua=ta.getCurrentArraySize();if(ha==ua){ta.addResourcesWithoutSorting(ia,ua);if(fa.limit>ia.length)ta.setReachedEndOfArray();}}}};function w(fa,ga,ha,ia,ja){z();var ka=ca(ga),la=ia+ha,ma=ka.executeOrEnqueue(0,la,function(pa){var qa={};for(var ra=0;ra<pa.length;ra++){var sa=pa[ra],ta=q[sa][ga];qa[sa]={num_total_snippets:ta.num_total_snippets,snippets:ta.snippets_cbm.getAllResources()};}var ua=ka.hasReachedEndOfArray();ja(qa,ua);}),na=ka.getUnavailableResources(ma);if(na.length){r={query:ga,thread_id:null,subscriber_id:ma};var oa={query:ga,offset:ia,limit:ha+1,snippetLimit:s};oa.identifier='thread_fbid';ea(oa,fa);}}function x(fa,ga,ha,ia,ja){z();var ka=da(fa,ga),la=ia+ha,ma=ka.executeOrEnqueue(0,la,function(){var sa=ka.getAllResources(),ta=q[ga][fa].num_total_snippets;ja(sa,ta);}),na=ka.getUnavailableResources(ma);if(na.length){r={query:fa,thread_id:ga,subscriber_id:ma};var oa={query:fa,snippetOffset:ia,snippetLimit:ha},pa=this.getThreadIDMap().getServerIDFromClientIDNow(ga),qa=i.tokenize(ga),ra=qa.type;if(ra=='user'){oa.other_user_fbid=pa;}else oa.thread_fbid=pa;oa.identifier='thread_fbid';ea(oa,this.getFBID());}}function y(fa){if(fa instanceof Array){var ga={};for(var ha=0;ha<fa.length;ha++)ga[ha.toString()]=fa[ha];return ga;}else return fa;}function z(){if(r){if(r.thread_id){var fa=da(r.query,r.thread_id);fa.unsubscribe(r.subscriber_id);}else{var ga=ca(r.query);ga.unsubscribe(r.subscriber_id);}r=null;}}function aa(fa,ga,ha){}function ba(fa,ga,ha,ia){var ja=q[ga][fa],ka=ja.snippets_cbm.getAllResources(),la=ja.num_total_snippets,ma=ka.length;if(ha<ma){ia(ka[ha].message_id);return;}var na=la-ma,oa=na>u?u:na;x.call(this,fa,ga,oa,ma,function(pa,qa){ba.call(this,fa,ga,ha,ia);});}function ca(fa){if(!p[fa])p[fa]=new m();return p[fa];}function da(fa,ga){if(!q[ga])q[ga]={};var ha=q[ga][fa];if(!ha){ha={num_total_snippets:-1,snippets_cbm:new m()};q[ga][fa]=ha;}return ha.snippets_cbm;}function ea(fa,ga){fa.client=h.WEBMESSENGER;n.trySend('/ajax/mercury/search_snippets.php',fa,null,ga);}Object.assign(v,j);f.exports=v;},null);
  __d('WebMessengerDetailViewSearchContextControl',['Event','CSS','DOM','MercuryMessageGroup','WebMessengerMessagesSelection','MercurySearchContextResults','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadMessagesRenderer','WebMessengerConstants','fbt','WebMessengerSubscriptionsHandler','MercuryMessages','MercurySearchSnippetResults'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t){if(c.__markCompiled)c.__markCompiled();var u=c('MercuryMessages').get(),v=c('MercurySearchSnippetResults').get();function w(ga,ha,ia){'use strict';this._manager=ga;this._rootElement=ha;this._paginationBox=ia;j.empty(this._rootElement);var ja=p[':fb:web-messenger:read-view:search-context'].build(),ka=p[':fb:web-messenger:read-view:search-pagination-box'].build();j.setContent(this._rootElement,ja.getRoot());j.setContent(this._paginationBox,ka.getRoot());this._messagelistRoot=ja.getRoot();this._loadingSpinner=ja.getNode('loadingSpinner');this._messageList=ja.getNode('messagelist');this._loadMoreButton=ja.getNode('loadMoreButton');this._loadMoreLink=ja.getNode('loadMoreLink');this._downMoreButton=ja.getNode('downMoreButton');this._downMoreLink=ja.getNode('downMoreLink');this._nextSnippet=ka.getNode('nextSnippet');this._previousSnippet=ka.getNode('previousSnippet');this._backToSnippetsButton=ka.getNode('backToSnippetsButton');this._snippetCountDescription=ka.getNode('snippetCountDescription');this._paginationBoxCloseButton=ka.getNode('paginationBoxCloseButton');this._state=null;this._threadID=null;this._messageID=null;q.setupSelectionListener(this._messageList);t.addSubscriptions(h.listen(this._loadMoreLink,'click',(function(){i.addClass(this._loadMoreButton,'async_saving');ea(this,r.MORE_SEARCH_CONTEXT_UP);}).bind(this)),h.listen(this._downMoreLink,'click',(function(){i.addClass(this._downMoreButton,'async_saving');ea(this,r.MORE_SEARCH_CONTEXT_DOWN);}).bind(this)),h.listen(this._nextSnippet,'click',x.bind(null,this,1)),h.listen(this._previousSnippet,'click',x.bind(null,this,-1)),h.listen(this._backToSnippetsButton,'click',function(){var la=o.getCurrentStateData(),ma=la.single_thread_search?n.DETAIL.SEARCH_THREAD_SNIPPET:n.DETAIL.SEARCH_SNIPPET,na={folder:la.folder,message_query:la.message_query,query:la.query};if(la.single_thread_search)na.thread_id=la.thread_id;o.updateDetailState(ma,na);}),h.listen(this._paginationBoxCloseButton,'click',(function(){o.updateDetailState(n.DETAIL.RECENT_MESSAGES,{thread_id:o.getCurrentStateData().thread_id});}).bind(this)));}w.prototype.hideView=function(){'use strict';i.hide(this._rootElement);i.hide(this._paginationBox);};w.prototype.updateView=function(){'use strict';i.show(this._rootElement);i.show(this._paginationBox);var ga=aa(this);ba(this);l.clear();if(ga)da(this);};w.prototype.destroy=function(){'use strict';z(this);};function x(ga,ha){var ia=o.getCurrentStateData(),ja=v.findIndexOfSnippet(ga._messageQuery,ia.thread_id,ia.message_id),ka=ja+ha;i.hide(ga._messageList);i.hide(ga._loadMoreButton);i.hide(ga._downMoreButton);i.show(ga._loadingSpinner);v.findSnippetAtIndex(ga._messageQuery,ia.thread_id,ka,function(la){i.show(ga._messageList);y(ia,la);});}function y(ga,ha){var ia={folder:ga.folder,message_id:ha,message_query:ga.message_query,query:ga.query,single_thread_search:ga.single_thread_search,thread_id:ga.thread_id};o.updateDetailState(o.getCurrentDetailState(),ia);}function z(ga){ga._searchContextSubscription&&m.unsubscribe(ga._searchContextSubscription.subscriber_id,ga._searchContextSubscription.message_id,ga._searchContextSubscription.direction);ga._searchThreadsSubscription=null;}function aa(ga){var ha=o.getCurrentStateData();if(ga._threadID!=ha.thread_id)return true;if(ga._messageQuery!=ha.message_query)return true;if(ga._messageID!=ha.message_id)return true;return false;}function ba(ga){var ha=o.getCurrentStateData();ga._state=o.getCurrentDetailState();ga._threadID=ha.thread_id;ga._messageQuery=ha.message_query;ga._messageID=ha.message_id;ga._selectionEnabled=!!ha.message_action;q.updateSelection(ga._messageList);i.conditionClass(ga._messageList,'bugReportingEnabled',ha.bug_reporting_enabled);}function ca(ga,ha){j.setAttributes(ga,{disabled:ha});var ia=j.find(ga,'^label');i.conditionClass(ia,'uiButtonDisabled',ha);}function da(ga){var ha=j.create('strong',{},ga._messageQuery),ia=v.countSnippetsMatchingQueryInThread(ga._messageQuery,ga._threadID),ja=v.findIndexOfSnippet(ga._messageQuery,ga._threadID,ga._messageID),ka=ja+1,la=s._({"*":"{index} of {count} results for {query}"},[s.param('index',ka),s.param('count',ia,[0]),s.param('query',ha)]);j.setContent(ga._snippetCountDescription,la);ca(ga._previousSnippet,ja===0);ca(ga._nextSnippet,ja===ia-1);j.empty(ga._messageList);i.show(ga._loadingSpinner);i.hide(ga._loadMoreButton);i.hide(ga._downMoreButton);z(ga);if(ga._threadID&&ga._messageID){var ma=m.getSearchContext(ga._messageID,ga._threadID,function(na){i.hide(ga._loadingSpinner);fa(ga,na);});if(ma)ga._searchContextSubscription={subscriber_id:ma,message_id:ga._messageID};}}function ea(ga,ha){z(ga);if(ga._threadID&&ga._messageID){var ia=m.getMoreSearchContext(ga._messageID,ga._threadID,ha,function(ja){if(ha==r.MORE_SEARCH_CONTEXT_UP){i.removeClass(ga._loadMoreButton,'async_saving');}else i.removeClass(ga._downMoreButton,'async_saving');fa(ga,ja);});if(ia)ga._searchContextSubscription={subscriber_id:ia,message_id:ga._messageID,direction:ha};}}function fa(ga,ha){i.conditionShow(ga._loadMoreButton,!ha.up_exhausted);i.conditionShow(ga._downMoreButton,!ha.down_exhausted);var ia=ha.up_message_ids.concat([ha.message_id],ha.down_message_ids),ja=u.getMessagesFromIDs(ia);j.empty(ga._messageList);var ka=k.calculateMessageGroups(ja);ka.forEach(function(la,ma){var na=q.renderMessageSeparatorForIndex(ka,ma);if(na)j.appendContent(ga._messageList,na);var oa=q.renderMessageGroup(la,false,'context:').getRoot(),pa=la.some(function(qa){return qa.message_id==ha.message_id;});if(pa)i.addClass(oa,'selectedHighlight');j.appendContent(ga._messageList,oa);});}f.exports=w;},null);
  __d('WebMessengerSearchSnippetsRenderer',['Event','CSS','DOM','Image.react','MercuryMessageRenderer','MercuryParticipants','MercuryParticipantsConstants','React','ReactDOM','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','cx','fbt','MercurySearchSnippetResults','MercuryThreadMetadataRenderer'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){if(c.__markCompiled)c.__markCompiled();var v=c('MercurySearchSnippetResults').get(),w=c('MercuryThreadMetadataRenderer').get(),x={renderMultipleSnippetBlocks:function(da,ea,fa){fa=fa||{};var ga=true;for(var ha in fa){ga=false;var ia=s[':fb:web-messenger:read-view:search-snippets-block'].build();j.appendContent(da,ia.getRoot());x.renderSingleSnippetBlock(ia,ea,ha,fa[ha]);}if(ga)ca(da);},renderThreadSnippetBlock:function(da,ea,fa,ga,ha){if(!ga||!ga.length){ca(da);return;}var ia=s[':fb:web-messenger:read-view:search-snippets-block'].build();j.appendContent(da,ia.getRoot());i.hide(ia.getNode('searchThreadName'));y(ia,ea,fa,ga,ha);},renderSingleSnippetBlock:function(da,ea,fa,ga){var ha=da.getNode('searchThreadName'),ia=j.create('h3');j.setContent(ha,ia);w.renderAndSeparatedParticipantList(fa,ia);y(da,ea,fa,ga.snippets,ga.num_total_snippets);},renderMultipleSnippets:function(da,ea,fa,ga){(ga||[]).forEach(function(ha){var ia=s[':fb:web-messenger:read-view:search-snippet'].build();j.appendContent(da,ia.getRoot());m.get(ha.author,function(ja){x.renderSingleSnippet(ia,ea,fa,ha,ja);});});},renderSingleSnippet:function(da,ea,fa,ga,ha){da.setNodeProperty('bodyDiv','id','snippet:'+ga.message_id);var ia=ga.matched_keywords||undefined,ja=l.formatMessageBody(ga.body,ia);da.setNodeContent('body',ja);var ka=da.getNode('image');i.removeClass(ka,'MercuryThreadImage');i.addClass(ka,'MercuryMediumThreadImage');var la=o.createElement(k,{width:n.IMAGE_SIZE,height:n.IMAGE_SIZE,src:ha.image_src});if(ha.href)la=o.createElement('a',{href:ha.href},la);p.render(la,ka);var ma=ha.short_name;da.setNodeContent('shortName',u._("{name}:",[u.param('name',ma)])+' ');w.renderTimestamp(da.getNode('timestamp'),ga.timestamp_absolute,ga.timestamp_relative,ga.timestamp);var na=da.getNode('seeContext');h.listen(na,'click',function(){var oa=r.getCurrentStateData(),pa={message_query:ea,query:oa.query,thread_id:fa,message_id:ga.message_id},qa=r.getCurrentDetailState();if(qa===q.DETAIL.SEARCH_THREAD_SNIPPET)pa.single_thread_search=true;r.updateDetailState(q.DETAIL.SEARCH_CONTEXT,pa);return false;});}};function y(da,ea,fa,ga,ha){var ia=da.getNode('snippetList');x.renderMultipleSnippets(ia,ea,fa,ga);var ja=ha-ga.length;z(da,ea,fa,ha,ja);}function z(da,ea,fa,ga,ha){var ia=da.getNode('totalSnippetsCount'),ja=da.getNode('moreSnippetsLink');i.conditionShow(ja,ha>0);if(ha>0){var ka=ba(ha);j.setContent(ja,ka);}j.setContent(ia,aa(ga));if(ha>0)h.listen(ja,'click',function(){v.getSingleThreadSearchMoreResults(ea,fa,function(la){j.empty(da.getNode('snippetList'));y(da,ea,fa,la,ga);});});}function aa(da){if(da==1){return u._("1 result in total");}else return u._({"*":"{count} results in total"},[u.param('count',da,[0])]);}function ba(da){if(da==1){return u._("Show 1 more result");}else return u._({"*":"Show {count} more results"},[u.param('count',da,[0])]);}function ca(da){var ea=u._("No results"),fa=j.create('div',{className:"_2n4"},ea);j.setContent(da,fa);}f.exports=x;},null);
  __d('WebMessengerDetailViewSearchSnippetsControl',['JSXDOM','Event','CSS','DOM','WebMessengerSearchSnippetsRenderer','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerPermalinks','WebMessengerSubscriptionsHandler','cx','fbt','MercurySearchSnippetResults'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){if(c.__markCompiled)c.__markCompiled();var t=c('MercurySearchSnippetResults').get();function u(z,aa){'use strict';this._manager=z;this._rootElement=aa;k.empty(this._rootElement);var ba=o[':fb:web-messenger:read-view:search-snippets'].build();k.setContent(this._rootElement,ba.getRoot());this._loadingSpinner=ba.getNode('loadingSpinner');this._messageList=ba.getNode('messagelist');this._downMoreButton=ba.getNode('downMoreButton');this._downMoreLink=ba.getNode('downMoreLink');this._state=null;this._messageQuery=null;this._threadID=null;j.hide(this._downMoreButton);q.addSubscriptions(i.listen(this._downMoreLink,'click',(function(){j.addClass(this._downMoreButton,'async_saving');y(this);}).bind(this)));}u.prototype.hideView=function(){'use strict';j.hide(this._rootElement);};u.prototype.updateView=function(){'use strict';j.show(this._rootElement);var z=v(this);w(this);if(z)x(this);};u.prototype.destroy=function(){'use strict';};function v(z){var aa=n.getCurrentDetailState();if(z._state!=aa)return true;var ba=n.getCurrentStateData();if(z._messageQuery!=ba.message_query)return true;if(aa==m.DETAIL.SEARCH_THREAD_SNIPPET)if(z._threadID!=ba.thread_id)return true;return false;}function w(z){z._state=n.getCurrentDetailState();var aa=n.getCurrentStateData();z._threadID=aa.thread_id;z._messageQuery=aa.message_query;}function x(z){j.hide(z._downMoreButton);k.empty(z._messageList);if(z._messageQuery){j.show(z._loadingSpinner);if(z._state===m.DETAIL.SEARCH_THREAD_SNIPPET&&z._threadID){t.getSingleThreadSearchResults(z._messageQuery,z._threadID,function(aa,ba){j.hide(z._loadingSpinner);l.renderThreadSnippetBlock(z._messageList,z._messageQuery,z._threadID,aa,ba);var ca=h.a({className:"_4-ii"},s._("Search all conversations for \"{query}\"",[s.param('query',z._messageQuery)])),da=p.getURI(m.MASTER.SEARCH,m.DETAIL.SEARCH_SNIPPET,{query:z._messageQuery,message_query:z._messageQuery});ca.setAttribute('href',da);k.prependContent(z._messageList,h.div({className:"_4-ij"},ca));});}else t.getAllThreadSearchResults(z._messageQuery,function(aa,ba){j.hide(z._loadingSpinner);l.renderMultipleSnippetBlocks(z._messageList,z._messageQuery,aa);j.conditionShow(z._downMoreButton,!ba);});}}function y(z){if(z._messageQuery)t.getAllThreadSearchMoreResults(z._messageQuery,function(aa,ba){j.removeClass(z._downMoreButton,'async_saving');k.empty(z._messageList);l.renderMultipleSnippetBlocks(z._messageList,z._messageQuery,aa);j.conditionShow(z._downMoreButton,!ba);});}f.exports=u;},null);
  __d('Ellipsizer',['CSS','Style','UserAgent_DEPRECATED','cx','getElementText'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();'use strict';var m=1;function n(o){this.elements=[];this.descend=true;o.forEach(function(p){h.addClass(p,"_6qy");this.elements.push({node:p});},this);return this;}n.prototype.setDescend=function(o){this.descend=o;return this;};n.prototype.$Ellipsizer1=function(){var o;this.elements.forEach(function(p){o=p.node;if(this.descend)while(o.children.length===1)o=o.children[0];if(o===p.node)i.set(o,'width','');j.ie()&&i.set(o,'position','absolute');p.width=o.offsetWidth;j.ie()&&i.set(o,'position','');},this);this.elements.sort(function(p,q){return p.width-q.width;});};n.prototype.confineWithin=function(o,p){p=p||m;this.$Ellipsizer1();var q=o;this.elements.forEach(function(r,s){var t=Math.floor(q/(this.elements.length-s));if(r.width<=t||r.width<=0||t<=0||r.width<=t*p&&q>=t*p){h.removeClass(r.node,"_6s5");i.set(r.node,'width','');q-=r.width;if(r.titleSet){r.node.setAttribute('title','');r.titleSet=false;}}else{h.addClass(r.node,"_6s5");i.set(r.node,'width',t+'px');q-=t;if(!r.titleSet&&!r.node.getAttribute('title')){r.node.setAttribute('title',l(r.node));r.titleSet=true;}}},this);};f.exports=n;},null);
  __d('MercuryReadOnlyReason',['React','fbt'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j={getReason:function(k){if(k.has_email_participant){return i._("Sorry, this conversation isn't active anymore because messages can no longer be sent to email addresses. Messages sent to facebook.com email addresses will now be forwarded to primary email addresses, so you can continue this conversation over email. {Learn more}.",[i.param('Learn more',h.createElement('a',{href:'/help/224049364288051'},i._("Learn more")))]);}else return i._("You cannot reply to this conversation.");}};f.exports=j;},null);
  __d('MessagesEmoticonView',['DOM','EmoticonsList','Event','Focus','InputSelection','Keys','Parent','SubscriptionsHandler','TextAreaControl','Toggler','UserAgent_DEPRECATED','cx'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){if(c.__markCompiled)c.__markCompiled();var t=i.symbols;function u(x){return n.byClass(x,"_5r8h");}function v(x,y,z,aa){var ba=n.byClass(x,'emoticon');if(!ba)return;var ca='emoticon_',da=null;ba.className.split(' ').forEach(function(ka){if(ka.startsWith(ca))da=ka.substring(ca.length);});if(!t[da])return;if(!aa)return true;var ea=p.getInstance(y),fa=ea.getValue(),ga=t[da],ha=fa.substring(0,z.start),ia=fa.substring(z.end);if(z.start>0&&!ha.endsWith(' '))ga=' '+ga;if(!ia.startsWith(' '))ga+=' ';var ja=ha+ga+ia;z.start+=ga.length;z.end=z.start;ea.setValue(ja);l.set(y,z.start,z.end);return true;}function w(x,y){var z={start:0,end:0};function aa(){z=l.get(y);}var ba=h.find(x,'.uiToggleFlyout');this._subscriptions=new o();this._subscriptions.addSubscriptions(q.subscribe('show',function(ca,da){if(da.active&&h.contains(x,da.active)){l.set(y,z.start,z.end);var ea=h.scry(ba,'a.emoticon')[0];ea&&k.setWithoutOutline(ea);}}),j.listen(ba,'click',function(event){v(event.getTarget(),y,z,true);}),j.listen(ba,'keyup',function(event){if(event.keyCode===m.ESC){q.hide(x);l.set(y,z.start,z.end);}}),j.listen(y,'keyup',aa),j.listen(y,'click',aa));if(r.chrome()||r.ie()||r.opera())this._subscriptions.addSubscriptions(j.listen(ba,'mousedown',(function(event){var ca=j.listen(document.documentElement,'click',function(event){var da=event.getTarget(),ea=v(da,y,z,false),fa=u(da);!ea&&!fa&&q.show(x);ca.remove();});}).bind(this)));}Object.assign(w.prototype,{destroy:function(){this._subscriptions&&this._subscriptions.release();this._subscriptions=null;}});Object.assign(w,{create:function(x,y){return new w(x,y);}});f.exports=w;},null);
  __d('MessagesEmoticons.react',['Grid.react','React','cx','emptyFunction','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m=h.GridItem,n=i.PropTypes,o=8,p={smile:l._("smile"),frown:l._("frown"),tongue:l._("tongue"),grin:l._("grin"),gasp:l._("gasp"),wink:l._("wink"),pacman:l._("pacman"),grumpy:l._("grumpy"),unsure:l._("unsure"),cry:l._("cry"),kiki:l._("kiki"),glasses:l._("glasses"),sunglasses:l._("sunglasses"),heart:l._("heart"),devil:l._("devil"),angel:l._("angel"),squint:l._("squint"),confused:l._("confused"),upset:l._("upset"),colonthree:l._("colonthree"),like:l._("like")},q=i.createClass({displayName:'MessagesEmoticons',propTypes:{onEmoticonSelect:n.func},getDefaultProps:function(){return {onEmoticonSelect:k};},getEmoticons:function(){return Object.keys(p).map((function(r){return (i.createElement(m,{key:r},i.createElement('div',{className:"panelCell"},i.createElement('a',{'aria-label':p[r],className:'emoticon emoticon_'+r,onClick:(function(){return this.props.onEmoticonSelect(r);}).bind(this)}))));}).bind(this));},render:function(){return (i.createElement('div',{className:"emoticonsTable"},i.createElement(h,{cols:o,alignv:'middle',alignh:'center',spacing:'pam'},this.getEmoticons())));}});f.exports=q;},null);
  __d('StickersFlyoutPackSelector.react',['Animation','ImmutableObject','Locale','React','ReactDOM','Image.react','StickerActions','StickerConfig','StickerConstants','StickerInterfaces','StickerState','StickerStoreController','XUIBadge.react','cx','emptyFunction','fbt','ix','getObjectValues'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){if(c.__markCompiled)c.__markCompiled();'use strict';var z=k.PropTypes,aa=4,ba=200,ca=w._("Sticker Store"),da=k.createClass({displayName:'StickersFlyoutPackSelector',propTypes:{stickerInterface:z.oneOf(y(q)),numNewPacks:z.number,packs:z.arrayOf(z.instanceOf(i)).isRequired,onPackClick:z.func,selectedPackID:z.string,resetTagSelectorFunc:z.func},getInitialState:function(){return {animating:false,page:0};},getDefaultProps:function(){return {stickerInterface:q.MESSAGES,numNewPacks:0};},shouldComponentUpdate:function(fa,ga){return !ga.animating;},onFlyoutShown:function(){if(this.props.packs.length>0){var fa=this._calculatePageForPack(this.props.selectedPackID);if(this.state.page!==fa)this._setPage(fa,0);}},_calculatePageForPack:function(fa){for(var ga=0;ga<this.props.packs.length;ga++)if(this.props.packs[ga].id==fa)return ga<=aa?0:Math.floor((ga-1)/aa);return 0;},_setPage:function(fa,ga){if(this.state.animating)return;this.setState({animating:true,page:fa},function(){var ha=l.findDOMNode(this.refs.positioner),ia=this._calculatePosition(fa);new h(ha).to(ia.reference,ia.offset+'px').ondone((function(){return this.setState({animating:false});}).bind(this)).duration(ga).go();});},_calculatePosition:function(fa){var ga=l.findDOMNode(this.refs.positioner),ha=ga.childNodes[fa].offsetLeft;if(j.isRTL()){var ia=ga.offsetWidth,ja=ga.childNodes[fa].offsetWidth;return {reference:'right',offset:ha+ja-ia};}return {reference:'left',offset:-ha};},_numPages:function(){return Math.max(1,Math.ceil((this.props.packs.length-1)/aa));},_canGoPrev:function(){return this.state.page>0;},_canGoNext:function(){return this.state.page+1<this._numPages();},_goPrev:function(){this._canGoPrev()&&this._setPage(this.state.page-1,ba);},_goNext:function(){this._canGoNext()&&this._setPage(this.state.page+1,ba);},_openStore:function(){n.resetNumNewPacks();var fa=this.props.stickerInterface==q.COMPOSER;s.showStore(null,fa);},render:function(){return (k.createElement('div',{className:"_5r85"},this._renderStoreButton(),this._renderPrevArrow(),this._renderNextArrow(),k.createElement('div',{className:"_5r88"},k.createElement('div',{className:"_5r89",ref:'positioner'},this._renderPages()))));},_selectPack:function(fa){var ga=r.getPack(fa);if(ga&&ga.isPromoted)n.addPack(fa);if(fa===p.SEARCH_PACK_ID)this.props.resetTagSelectorFunc();n.selectPack(fa);},_renderPages:function(){var fa=this.props.packs.map((function(ja,ka){return (k.createElement(ea,{key:ja.id,onClick:(function(){return this._selectPack(ja.id);}).bind(this),pack:ja,selected:this.props.selectedPackID===ja.id,index:ka,isComments:this.props.stickerInterface==q.COMMENTS}));}).bind(this)),ga=[];for(var ha=0;ha<fa.length;ha+=aa){var ia=ha;ha===0&&ha++;ga.push(k.createElement('div',{className:"_5r81",key:ha},fa.slice(ia,ha+aa)));}return ga;},_renderStoreButton:function(){return (k.createElement('a',{'aria-label':ca,className:"_5r86 rfloat",'data-hover':'tooltip',onClick:this._openStore},k.createElement(m,{className:"_5r87",src:x('/images/messaging/stickers/selector/sticker_store.png')}),this._renderJewel()));},_renderJewel:function(){var fa=this.props.numNewPacks;if(!fa)return null;return (k.createElement(t,{className:"rfloat _3fhs",count:fa,maxcount:9,type:'special'}));},_renderPrevArrow:function(){if(!this._canGoPrev())return null;var fa=j.isRTL()?x('/images/messaging/stickers/selector/right.png'):x('/images/messaging/stickers/selector/left.png');return (k.createElement('a',{className:"_37wu"+(' '+"lfloat"),onClick:this._goPrev},k.createElement(m,{className:"_5r84",src:fa})));},_renderNextArrow:function(){if(!this._canGoNext())return null;var fa=j.isRTL()?x('/images/messaging/stickers/selector/left.png'):x('/images/messaging/stickers/selector/right.png');return (k.createElement('a',{className:"_37wv"+(' '+"rfloat"),onClick:this._goNext},k.createElement(m,{className:"_5r84",src:fa})));}}),ea=k.createClass({displayName:'PackIcon',propTypes:{index:z.number,isComments:z.bool,onClick:z.func,pack:z.instanceOf(i).isRequired,selected:z.bool},getDefaultProps:function(){return {isComments:false,onClick:v};},_getPackIcon:function(fa){if(fa.id==p.SEARCH_PACK_ID)return x('/images/messaging/stickers/icons/search.png');if(fa.id==p.MRU_STICKER_PACK)return x('/images/messaging/stickers/icons/recent.png');if(fa.id==p.EMOTICON_PACK_ID)return x('/images/messaging/stickers/icons/emoji.png');return fa.icon;},render:function(){var fa=this.props.pack,ga=o.WebStickerSearch?this.props.index===1||this.props.index===2:this.props.index===1,ha="_5r8a"+(this.props.selected?' '+"_5r8b":'')+(fa.id==p.MRU_STICKER_PACK?' '+"_5qcj":'')+(fa.id==p.SEARCH_PACK_ID?' '+"_5qck":'')+(ga?' '+"_eb3":''),ia=this.props.isComments&&!fa.isCommentsCapable,ja=w._("This pack is only available in photos"),ka=w._("This pack is only available in messages"),la=ia?v:(function(){return this.props.onClick(fa.id);}).bind(this),ma=this._getPackIcon(fa);if(ma===null)return null;var na=ka;if(!fa.isMessengerCapable&&fa.isComposerCapable)na=ja;return (k.createElement('a',{'aria-label':ia?na:fa.name,className:ha,'data-id':fa.id,'data-hover':'tooltip',ref:'search_icon',onClick:la,tabIndex:'0'},k.createElement(m,{className:(ia?"_2ji6":'')+(' '+"_5r8c")+(o.WebStickerSearch?' '+"_1viy":''),src:ma})));}});f.exports=da;},null);
  __d('StickerSearch',['StickerServerRequests'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();'use strict';var i,j,k={},l={requestStickersForQuery:function(m,n){i=m;h.getStickersForQuery(m,function(o){return i===m&&n(o.payload);});},prepareTagsData:function(){if(!j)j=h.fetchTagData(function(m){k=m;});return j;},getTagByName:function(m){return k[m];},getTagsIndex:function(){return k;}};f.exports=l;},null);
  __d('StickersFlyoutStickerSelector.react',['BanzaiLogger','Grid.react','Image.react','ScrollableArea.react','React','Sticker.react','StickerConstants','StickerConfig','StickerImages','StickerInterfaces','StickerSearch','StickerState','StickerUtils','XUISpinner.react','cx','debounce','emptyFunction','fbt','getObjectValues','ix','throttle'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba){if(c.__markCompiled)c.__markCompiled();'use strict';var ca=i.GridItem,da=l.PropTypes,ea=320,fa=278,ga=n.MRU_STICKER_PACK,ha=44,ia=112,ja=w(function(la,ma){if(!la)return;h.log('StickersLoggerConfig',{event:'search_sticker',searchtoken:la,numsearchresults:ma.length});},1000),ka=l.createClass({displayName:'StickersFlyoutStickerSelector',propTypes:{height:da.number,stickerInterface:da.oneOf(z(q)),onScroll:da.func,packID:da.string,singleWordTags:da.array,typeaheadTags:da.array,userInput:da.string},getDefaultProps:function(){return {stickerInterface:q.MESSAGES,onScroll:x};},getInitialState:function(){return {loading:false,stickers:[]};},componentDidMount:function(){if(this.props.packID){this.requestStickersForPack(this.props.packID);return;}if(this.props.userInput)this.requestStickersForQuery(this.props.userInput);},componentWillReceiveProps:function(la){if(la.packID&&la.packID!==this.props.packID){this.requestStickersForPack(la.packID);}else if(la.userInput!==this.props.userInput)this.requestStickersForQuery(la.userInput);},requestStickersForQuery:function(la){this.setState({loading:true});r.requestStickersForQuery(la,(function(ma){ma.map(function(na){return p.cacheSticker(na);});if(!this.props.tagChosen)ja(la,ma);if(this.props.stickerInterface==q.COMPOSER)ma=ma.filter(function(na){return na.isComposerCapable;});if(this.props.stickerInterface==q.COMMENTS)ma=ma.filter(function(na){return na.isCommentsCapable;});if(this.props.stickerInterface==q.MESSAGES)ma=ma.filter(function(na){return na.isMessengerCapable;});if(this.isMounted())this.setState({loading:false,stickers:ma});}).bind(this));},requestStickersForPack:function(la){this.setState({loading:true});p.requestStickersForPack(la,n.TRAY_SIZE,(function(ma){if(la==ga){ma=s.getMRUStickerPack(ma);if(this.props.stickerInterface==q.COMPOSER)ma=ma.filter(function(na){return na.isComposerCapable;});if(this.props.stickerInterface==q.COMMENTS)ma=ma.filter(function(na){return na.isCommentsCapable;});if(this.props.stickerInterface==q.MESSAGES)ma=ma.filter(function(na){return na.isMessengerCapable;});}this.setState({loading:false,stickers:ma});}).bind(this));},renderStickers:function(){return this.state.stickers.map(function(la){var ma=t.getScaledDimensions(la.height,la.width,n.TRAY_SIZE);return (l.createElement(ca,{key:la.id},l.createElement('div',{className:"_5r8h",'data-id':la.id},l.createElement(m,{animationTrigger:'hover',className:"_5r8i",forceCursorPointer:true,frameCount:la.frameCount,frameRate:la.frameRate||83,framesPerCol:la.framesPerCol,framesPerRow:la.framesPerRow,sourceHeight:ma.height,sourceURI:la.sourceURI,sourceWidth:ma.width,spriteURI:la.spriteURI,paddedSpriteURI:la.paddedSpriteURI,stickerID:la.id}))));});},_onScroll:function(){var la=this.refs.stickerScrollable;if(la){var ma=la.getArea().getScrollTop();this.props.onScroll(ma);}},render:function(){if(this.state.loading){return (l.createElement('div',{className:"_e0r"},l.createElement(u,{size:'large'})));}else if(this.state.stickers.length===0){var la=(ea-ha*2-ia)/2+"px";return (l.createElement('div',{className:"_5jdt",style:{marginTop:la}},l.createElement(j,{src:aa("/images/messaging/stickers/icons/sad_face.png")}),l.createElement('p',null,y._("No Stickers to Show"))));}return (l.createElement(k,{ref:'stickerScrollable',height:this.props.height||ea,onScroll:ba(this._onScroll,200),width:fa,fade:true},l.createElement('div',{className:"_5r8k"},l.createElement(i,{cols:4,fixed:true},this.renderStickers()))));}});f.exports=ka;},null);
  __d('StickersFlyoutTagSelector.react',['BanzaiLogger','Grid.react','ScrollableArea.react','Parent','React','ReactDOM','Image.react','StickerConfig','StickerConstants','StickersFlyoutStickerSelector.react','StickerInterfaces','StickerSearch','StickerState','StickerUtils','Toggler','XUIButton.react','XUICloseButton.react','XUITextInput.react','cx','emptyFunction','fbt','getObjectValues'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca){if(c.__markCompiled)c.__markCompiled();'use strict';var da=i.GridItem,ea=l.PropTypes,fa=320,ga=278,ha=44,ia=l.createClass({displayName:'StickersFlyoutTagSelector',propTypes:{trigger:ea.string,stickerInterface:ea.oneOf(ca(r)),resetTrigger:ea.func,onSelectSticker:ea.func},getInitialState:function(){return {input:'',isScrolling:false,tagChosen:false};},getDefaultProps:function(){return {trigger:null,stickerInterface:r.MESSAGES,resetTrigger:aa,onSelectSticker:aa};},componentDidMount:function(){var ja=k.byClass(m.findDOMNode(this),'uiToggle');if(ja)this._togglerSub=v.listen('show',ja,(function(){this.isMounted()&&this.focusInput();}).bind(this));this.focusInput();this.selectTrigger(this.props.trigger);},componentWillUnmount:function(){this._togglerSub&&this._togglerSub.unsubscribe();},componentWillReceiveProps:function(ja){this.selectTrigger(ja.trigger);},focusInput:function(){this.refs.inputField.focusInput&&this.refs.inputField.focusInput();},_inputChanged:function(ja){this.setState({input:ja.target.value,tagChosen:false,isScrolling:false});},_normalizeInput:function(ja){return ja.trim().replace(/\s+/,' ').toLowerCase();},_handleResetButtonClick:function(ja){ja.preventDefault();this.reset();},reset:function(){this.setState(this.getInitialState());},renderContentArea:function(){if(this.state.tagChosen||this._normalizeInput(this.state.input).length>1){return this.renderStickers();}else return this.renderTags();},render:function(){return (l.createElement('div',{className:"_217a"+(this.state.isScrolling?' '+"_1hg1":'')},l.createElement('div',{className:"_5jdr"},l.createElement('span',{className:"_5jds"}),l.createElement(y,{onChange:this._inputChanged,ref:'inputField',placeholder:ba._("Search stickers"),value:this.state.input}),l.createElement(x,{size:'small',onClick:this._handleResetButtonClick,className:this.state.input.length===0?"hidden_elem":''})),this.renderContentArea()));},selectTag:function(ja){h.log('StickersLoggerConfig',{event:'select_tag',tagid:ja.id});this.setState({tagChosen:true,input:u.capitalizeWords(ja.name)});this.focusInput();},selectTrigger:function(ja){if(ja!==null){var ka=s.getTagByName(ja);this.setState({tagChosen:true,input:u.capitalizeWords(ka.name)});this.props.resetTrigger();}},_onScroll:function(ja){this.setState({isScrolling:!!ja});},renderStickers:function(){var ja=this._normalizeInput(this.state.input);return (l.createElement(q,{ref:'selector',height:fa-ha,userInput:ja,onScroll:this._onScroll,stickerInterface:this.props.stickerInterface,tagChosen:this.state.tagChosen}));},renderTags:function(){var ja=t.getFeaturedTags().filter(function(ka){return ka.sourceURI!==null;}).sort(function(ka,la){return ka.order-la.order;}).map((function(ka,la){return (l.createElement(da,{key:la},l.createElement('div',{className:"_t5c"+(la<2?' '+"_1b27":'')+(la%2===0?' '+"_t5d":'')+(la%2!==0?' '+"_t5e":'')},l.createElement(w,{image:l.createElement(n,{src:ka.sourceURI}),label:ka.name,onClick:this.selectTag.bind(this,ka),className:"_5jdu",style:{background:'#'+ka.color_code},disabled:this._normalizeInput(this.state.input).length===1}))));}).bind(this));return (l.createElement(j,{height:fa-ha,width:ga-16,shadow:true,fade:true,className:"_5jei"},l.createElement(i,{spacing:'pas',cols:2,fixed:true,ref:'grid'},ja)));}});f.exports=ia;},null);
  __d('StickersFlyout.react',['BanzaiLogger','Event','Keys','MessagesEmoticons.react','Parent','ReactComponentWithPureRenderMixin','React','ReactDOM','StickerConstants','StickerConfig','StickersFlyoutPackSelector.react','StickersFlyoutStickerSelector.react','StickersFlyoutTagSelector.react','StickerInterfaces','StickerState','StickerStateStore','StoreAndPropBasedStateMixin','SubscriptionsHandler','Toggler','XUISpinner.react','cx','getObjectValues','joinClasses'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da){if(c.__markCompiled)c.__markCompiled();'use strict';var ea=n.PropTypes,fa=p.SEARCH_PACK_ID,ga=n.createClass({displayName:'StickersFlyout',mixins:[m,x(w)],statics:{calculateState:function(ha){var ia=w.getState(ha.stickerInterface);return {dataReady:ia.trayDataReady,packID:ia.packID,numNewPacks:ia.numNewPacks,packs:ia.trayPacks};}},propTypes:{stickerInterface:ea.oneOf(ca(u)),onStickerSelect:ea.func.isRequired,onEmoticonSelect:ea.func,onShown:ea.func,onHidden:ea.func,onEscKeyDown:ea.func,onPackSelect:ea.func,shown:ea.bool},getDefaultProps:function(){return {stickerInterface:u.MESSAGES,shown:false,packSelectorClass:r,tagSelectorClass:t,glyphProvider:null};},getInitialState:function(){return {trigger:null};},componentDidMount:function(){if(q.LoadStickerEarly&&!this.state.dataReady)this.loadTrayData();this._toggle=l.byClass(o.findDOMNode(this),'uiToggle');this._subscriptions=new y();if(this._toggle)this._subscriptions.addSubscriptions(z.listen('show',this._toggle,this._onShownWrapper),z.listen('hide',this._toggle,this._onHidden));this._subscriptions.addSubscriptions(i.listen(o.findDOMNode(this),'keydown',this._onKeyDown));if(this.props.shown)this._onShown();},_onShownWrapper:function(){if(this.props.onShown){this.props.onShown(this._onShown);}else this._onShown();},_onShown:function(){h.log('StickersLoggerConfig',{event:'open_tray'});if(!q.LoadStickerEarly&&!this.state.dataReady)this.loadTrayData();if(this.state.packID===fa)this.refs.tagSelector&&this.refs.tagSelector.focusInput();this.refs.packSelector.onFlyoutShown();},_onHidden:function(){this.resetTagSelector();this.props.onHidden&&this.props.onHidden();},componentWillUnmount:function(){this._subscriptions.release();},componentWillReceiveProps:function(ha){if(!this.state.dataReady&&ha.shown)this.loadTrayData();},componentDidUpdate:function(ha){if(!ha.shown&&this.props.shown){this._onShown();}else if(ha.shown&&!this.props.shown)this._onHidden();},_onKeyDown:function(event){if(event.keyCode===j.ESC&&this.props.onEscKeyDown){this.props.onEscKeyDown();event.kill();}if(event.keyCode===j.RETURN&&this.props.stickerInterface===u.COMMENTS)this.selectedSticker(event);},resetTagSelector:function(){this.refs.tagSelector&&this.refs.tagSelector.reset();},loadTrayData:function(){v.onTrayDataReady((function(){}).bind(this));},loadPack:function(){if(!this.state.dataReady)return (n.createElement('div',{className:"_e0r"},n.createElement(aa,{size:'large'})));if(this.state.packID===p.EMOTICON_PACK_ID)return (n.createElement('div',{className:"_5r8l",'data-id':this.state.packID},n.createElement(k,{onEmoticonSelect:this.props.onEmoticonSelect})));if(this.state.packID===fa&&q.WebStickerSearch){var ha=this.props.tagSelectorClass;return (n.createElement('div',{className:"_5r8l"},n.createElement(ha,{ref:'tagSelector',className:"fbStickersFlyoutTagSelector",trigger:this.state.trigger,resetTrigger:(function(){return this.setState({trigger:null});}).bind(this),stickerInterface:this.props.stickerInterface,onSelectSticker:this.onSelectSticker})));}return (n.createElement('div',{className:"_5r8l",'data-id':this.state.packID},n.createElement(s,{ref:'selector',packID:this.state.packID,stickerInterface:this.props.stickerInterface})));},onSelectSticker:function(ha,event){if(ha){v.updateRecentlyUsed(ha);this.props.onStickerSelect(ha,event);v.clearShowStickerReplyNUX();}},selectedSticker:function(event){var ha=l.byClass(event.target,"_5r8h");if(ha){var ia=ha.getAttribute('data-id');this.onSelectSticker(ia,event);}},render:function(){var ha=this.props.packSelectorClass;return (n.createElement('div',{className:da(this.props.className,"_5r8f")},n.createElement('div',{className:"_5r8e"},n.createElement(ha,{ref:'packSelector',numNewPacks:this.state.numNewPacks,onPackClick:this.props.onPackSelect,selectedPackID:this.state.packID,packs:this.state.packs,stickerInterface:this.props.stickerInterface,resetTagSelectorFunc:this.resetTagSelector,glyphProvider:this.props.glyphProvider})),n.createElement('div',{className:"_5r8m",onClick:this.selectedSticker},this.loadPack())));}});f.exports=ga;},null);
  __d('TabIndexDelegator',['CSS','DOM','Event','Focus','JSXDOM'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();function m(n,o){'use strict';this._placeholder=o||l.button(null);this._placeholder.setAttribute('aria-hidden',true);h.addClass(this._placeholder,'accessible_elem');this._listener=j.listen(this._placeholder,'click',function(){n.click();});k.relocate(this._placeholder,n);this.enable();}m.prototype.enable=function(){'use strict';h.show(this._placeholder);};m.prototype.disable=function(){'use strict';h.hide(this._placeholder);};m.prototype.getPlaceholder=function(){'use strict';return this._placeholder;};m.prototype.destroy=function(){'use strict';this._listener.remove();i.remove(this._placeholder);};f.exports=m;},null);
  __d('UnsentMessageDialog',['Dialog','WebMessengerEvents','fbt'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k={get:function(){var l=[{label:j._("Don't Send"),name:h.OK.name},{label:j._("Stay on Message"),name:h.CANCEL.name,className:h.CANCEL.className}];return new h().setTitle(j._("Don't Send Message?")).setBody(j._("If you leave this page, your message won't be sent.")).setButtons(l).setCloseHandler(i.inform.bind(i,i.FOCUS_COMPOSER)).setModal(true);}};f.exports=k;},null);
  __d("XMessagingSetPreferencesController",["XController"],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/messaging\/preferences\/",{send_on_enter:{type:"Bool",defaultValue:false}});},null,{});
  __d('WebMessengerDetailViewBottomShelfControl',['ARIA','Arbiter','AsyncDialog','AsyncRequest','BanzaiLogger','Bootloader','Button','CSS','MercuryConstants','DOM','WebMessengerDeleteThreadDialog','Ellipsizer','Event','Focus','MercuryFolders','Input','Keys','Locale','MercuryAPIArgsSource','MercuryIDs','MercuryConfig','MercuryFileUploader','MercuryMessengerBlockingUtils','MercuryParticipants','MercuryPhotoUploader','MercuryReadOnlyReason','MercuryShareLinkUploader','MercurySourceType','MercuryThreadInfo','MessagesEmoticonView','MessagingTag','PUWMethods','PagesEventObserver','PagesEventType','PhotosUploadWaterfall','WebMessengerPreferences','React','ReactDOM','Run','Set','WebMessengerStateConstants','WebMessengerStateManager','StickerActions','StickersFlyout.react','StickerState','StickerStoreController','Style','TabIndexDelegator','WebMessengerTemplates','TextAreaControl','Toggler','UnsentMessageDialog','URI','UserAgent_DEPRECATED','VaultBoxURI','Vector','WebMessengerEvents','WebMessengerSubscriptionsHandler','XMessagingSetPreferencesController','arrayContains','csx','csx','fbt','isWebMessengerURI','MercuryDraftsController','MercuryBlockedParticipants','MercuryThreadIDMap','MercuryThreadActions','MercuryMessageObject','MercuryMessageActions','MercuryThreadInformer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,ab,bb,cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb){if(c.__markCompiled)c.__markCompiled();var tb=c('MercuryDraftsController').get(),ub=c('MercuryBlockedParticipants').get(),vb=c('MercuryThreadIDMap').get(),wb=c('MercuryThreadActions').get(),xb=c('MercuryMessageObject').get(),yb=c('MercuryMessageActions').get(),zb=c('MercuryThreadInformer').get(),ac=c('MercuryThreads').get(),bc="_1rh";function cc(gd,hd){'use strict';this._manager=gd;this._rootElement=hd;this._sendOnEnterDefault=qa.sendOnEnter;q.empty(this._rootElement);var id=db[':fb:web-messenger:read-view:bottom-shelf'].build();q.setContent(this._rootElement,id.getRoot());this._bottomShelfToolbar=id.getNode('toolbar');this._bottomShelfComposer=id.getNode('composer');this._bottomShelfButtons=id.getNode('buttons');this._bottomPendingActions=id.getNode('pendingActions');this._autogrowContainer=id.getNode('autogrowContainer');this._composerBox=id.getNode('composerTextarea');this._composerGrid=id.getNode('composerGrid');this._sendContainer=id.getNode('sendContainer');this._replyButton=id.getNode('replyButton');this._uploadingWarning=id.getNode('uploadingWarning');this._replyButtonLabel=q.find(this._sendContainer,"._1ri");this._sendOnEnterButton=id.getNode('sendOnEnterButton');this._loadingIndicator=id.getNode('loadingIndicator');this._cannotReplyAlert=id.getNode('noReplyMessage');this._ariaOwns=this._composerBox.getAttribute('aria-owns');mb.addSubscriptions(t.listen(this._autogrowContainer,'click',this.focusComposer.bind(this)),lb.subscribe(lb.UPDATE_SELECTION,fd.bind(null,this)),lb.subscribe(lb.FOCUS_COMPOSER,this.focusComposer.bind(this)));this._emoteWrapper=id.getNode('emoteWrapper');this._stickersFlyoutToggler=id.getNode('emoticons');this._emoticonsPanel=new ka(this._stickersFlyoutToggler,this._composerBox);var jd=id.getNode('stickers');if(jd){this._stickersFlyout=sa.render(ra.createElement(ya,{onStickerSelect:(function(nd){rc(this,nd);}).bind(this)}),jd);mb.addSubscriptions(lb.subscribe(lb.STICKER_CLICKED,this._onStickerClick.bind(this)));}this._messageSent=false;this._fileUploader=new ca(id.getNode('attachmentShelf'),id.getNode('attachButtonForm'),id.getNode('fileInput'),id.getNode('attachID'));this._shareLinkUploader=new ha(id.getNode('shareStage'),id.getNode('shareStageContent'),id.getNode('shareStageLoadingIndicator'),id.getNode('shareStageCloseButton'),this._composerBox);u.relocate(this._replyButton,this._replyButtonLabel);this._delegator=new cb(this._replyButtonLabel);q.prependContent(this._bottomShelfToolbar,this._delegator.getPlaceholder());e(['TypingDetectorController'],(function(nd){this._typingDetector=new nd(null,this._composerBox,'web-messenger',null,null);ed(this);}).bind(this));this._photoUploader=new fa(this._composerGrid,id.getNode('photoButton'),mb,id.getNode('composer'));var kd=false;mb.addSubscriptions(this._photoUploader.subscribe('dom-updated',lb.detailDOMChanged.bind(lb)),this._photoUploader.subscribe('menu-show',(function(nd,od){if(!kd){this.waterfallStep(pa.BEGIN,od);kd=true;}}).bind(this)),this._photoUploader.subscribe('selection-start',(function(nd,od){this.waterfallStep(pa.SELECT_START,od);}).bind(this)),this._photoUploader.subscribe('upload-started',(function(nd,od){this.waterfallStep(pa.IMAGES_SELECTED,{method:od.method||this._photoUploader.getCurrentMethod()});this.waterfallStep(pa.UPLOAD_START,{count:od.imageCount});}).bind(this)),this._photoUploader.subscribe('upload-completed',(function(nd,od){var pd=this._photoUploader.getCurrentMethod();if(pd!==ma.FILE_SELECTOR)this.waterfallStep(pa.IMAGES_SELECTED,{method:pd});for(var qd=0;qd<od.fbids.length;++qd)this.waterfallStep(pa.ONE_UPLOAD_DONE);this._composerBox.focus();var rd=rb._("A photo has been attached to your message.");h.notify(rd);}).bind(this)),this._photoUploader.subscribe('all-uploads-completed',(function(nd,od){if(this._blockedOnUpload){vc(this,false);sc(this);}this.waterfallStep(pa.ALL_UPLOADS_DONE,od);}).bind(this)));var ld=q.scry(this._bottomShelfToolbar,"._6q-");ld.push(id.getNode('sendOnEnterButtonLabel'));this._ellipsizer=new s(ld);mb.addSubscriptions(this._fileUploader.subscribe('all-uploads-completed',(function(){if(this._blockedOnUpload){vc(this,false);sc(this);}}).bind(this)),this._fileUploader.subscribe('upload-canceled',vc.bind(null,this,false)),this._fileUploader.subscribe('dom-updated',lb.detailDOMChanged.bind(lb)));this._confirmationSubscription=wa.registerConfirmationBeforeStateUpdate((function(nd,od,pd){if(!tb.canSaveDrafts(this._threadID)&&zc(this)&&dc(this,od,pd))return gb.get();return false;}).bind(this));ad(this);mb.addSubscriptions(i.subscribe('page_transition',(function(nd,od){if(sb(od.uri))ad(this);}).bind(this)),this._shareLinkUploader.subscribe('link-detected',lb.detailDOMChanged.bind(lb)),this._shareLinkUploader.subscribe('closed',this.focusComposer.bind(this)));eb.getInstance(this._composerBox).subscribe('resize',(function(){lb.detailDOMChanged();}).bind(this));dd(this);mb.addSubscriptions(t.listen(this._replyButtonLabel,'click',sc.bind(null,this)),t.listen(this._replyButton,'keydown',gc.bind(null,this)),t.listen(this._composerBox,'keydown',gc.bind(null,this)),t.listen(this._composerBox,'paste',hc.bind(null,this)),t.listen(this._sendOnEnterButton,'click',jc.bind(null,this)),t.listen(id.getNode('cancelButton'),'click',wc),t.listen(id.getNode('deleteButton'),'click',xc.bind(null,this)),lb.subscribe(lb.DETAIL_DOM_CHANGED,ic.bind(null,this)));if(ba.CoreGraphEnabled)mb.addSubscriptions(t.listen(id.getNode('deletePendingButton'),'click',(function(){wa.updateDetailState(va.DETAIL.RECENT_MESSAGES,wa.getCurrentStateData());r.show(this._threadID);}).bind(this)),t.listen(id.getNode('replyPendingButton'),'click',(function(){o.hide(this._bottomPendingActions);o.show(this._bottomShelfComposer);o.removeClass(this._bottomShelfComposer,'invisible_elem');}).bind(this)));mb.addSubscriptions(zb.subscribe('threads-updated',(function(nd,od){od[this._threadID]&&this.updateView();}).bind(this)));this._replySet=new ua();var md=new hb(window.location.href);this._uriData=md.getQueryData();this._shouldLogMessageSend=!!this._uriData.loggedoutpage;}cc.prototype._logMessageSend=function(){'use strict';na.notify(oa.MESSAGES_SEND_ENTRY_POINT,this._uriData.loggedoutpage,{was_logged_out:true});};cc.prototype._onStickerClick=function(gd,hd){'use strict';if(!hd||!hd.packID)return;var id=hd.packID,jd=hd.stickerID;l.log('StickersLoggerConfig',{event:'click_sticker',packid:id,stickerid:jd});za.onTrayDataReady((function(){if(ob(za.getPackIDsInTray(),id)){var kd=za.getPack(id);if(kd&&kd.isPromoted)xa.addPack(id);var ld=this._stickersFlyout,md=this._stickersFlyoutToggler;if(!md||!ld||!ld.isMounted())return;xa.selectPack(id);fb.show(md);}else ab.showStore(id);}).bind(this));};cc.prototype.waterfallStep=function(gd,hd){'use strict';var id=this._photoUploader.getWaterfallID();if(!id)return;pa.sendSignal(babelHelpers._extends({qn:id,step:gd,uploader:pa.APP_MESSENGER},hd||{}));};cc.prototype.hideView=function(){'use strict';o.hide(this._rootElement);};cc.prototype.updateView=function(){'use strict';var gd=wa.getCurrentDetailState();o.show(this._rootElement);var hd=wa.getCurrentStateData();dc(this,gd,hd)&&uc(this);o.hide(this._bottomShelfComposer);o.removeClass(this._bottomShelfComposer,'invisible_elem');o.hide(this._bottomShelfButtons);o.show(this._sendOnEnterButton);o.hide(this._cannotReplyAlert);lc(this,this._sendOnEnterDefault);switch(gd){case va.DETAIL.RECENT_MESSAGES:case va.DETAIL.SEARCH_CONTEXT:this._threadID=hd.thread_id;if(hd.message_action==va.MESSAGE_ACTION.DELETE){o.hide(this._bottomPendingActions);bd(this,hd.message_action);}else if(this._threadID)ac.getThreadMeta(this._threadID,(function(id){if(ba.CoreGraphEnabled&&!this._replySet.has(this._threadID)&&id&&id.folder===la.PENDING){cd(this);}else if(ja.showComposer(id)){o.show(this._bottomShelfComposer);dd(this);tb.loadDraft(this._threadID,this._composerBox,this._fileUploader,this._shareLinkUploader,this._photoUploader);this._shareLinkUploader.check();}else{sa.render(ra.createElement('span',null,ga.getReason(id)),this._cannotReplyAlert);o.show(this._cannotReplyAlert);}fc(this,id);}).bind(this));break;case va.DETAIL.COMPOSE_MAIN:this._threadID=null;o.show(this._bottomShelfComposer);dd(this);fc(this,null);break;default:this._threadID=null;break;}ec(this,gd,hd);ed(this);lb.detailDOMChanged();this._state=gd;};cc.prototype.focusComposer=function(){'use strict';this._composerBox.focus();};cc.prototype.submitReply=function(){'use strict';sc(this);};cc.prototype.destroy=function(){'use strict';this._emoticonsPanel&&this._emoticonsPanel.destroy();this._fileUploader.destroy();wa.unregisterConfirmationBeforeStateUpdate(this._confirmationSubscription);};cc.prototype.getStickersFlyoutToggler=function(){'use strict';return this._stickersFlyoutToggler;};function dc(gd,hd,id){switch(hd){case va.DETAIL.RECENT_MESSAGES:case va.DETAIL.SEARCH_CONTEXT:return !id.reuse_composer&&(gd._threadID!=id.thread_id||gd._state!=hd);case va.DETAIL.COMPOSE_MAIN:return id.start;case va.DETAIL.SEARCH_SNIPPET:case va.DETAIL.SEARCH_THREAD_SNIPPET:case va.DETAIL.SHARED_PHOTOS:return true;}return false;}function ec(gd,hd,id){var jd=id.participants&&id.participants.length>0;o.conditionClass(gd._replyButtonLabel,'uiButtonDisabled',hd==va.DETAIL.COMPOSE_MAIN&&!jd);}function fc(gd,hd){var id,jd;if(!hd){id=rb._("Send");jd=rb._("Write a message...");}else if(hd.participants&&hd.participants.length<=2){id=rb._("Reply");jd=rb._("Write a reply...");}else{id=rb._("Reply All");jd=rb._("Write a reply...");}if(gd._composerBox.getAttribute('placeholder')!=jd)w.setPlaceholder(gd._composerBox,jd);n.setLabel(gd._replyButton,id);oc(gd);}function gc(gd,event){var hd=event.getModifiers();if(hd.any&&event.keyCode!==x.RETURN)return;var id=false;switch(event.keyCode){case x.ESC:var jd=gd.getStickersFlyoutToggler();fb.hide(jd);return;case x.SPACE:id=event.getTarget()===gd._replyButton;break;case x.RETURN:var kd=!o.hasClass(gd._bottomShelfComposer,bc),ld=event.getTarget()===gd._replyButton,md=false;if(!kd){if(ib.windows()){md=hd.control;}else if(ib.osx()){md=hd.meta;}else md=hd.control||hd.meta;}else if(event.getModifiers().any)return;id=ld||kd||md;break;case x.UP:case x.DOWN:var nd=wa.getCurrentDetailState();if(gd._composerBox.value||nd!=va.DETAIL.RECENT_MESSAGES)event.stop();break;}if(id){sc(gd);gd.focusComposer();return false;}}function hc(gd,event){if(ib.chrome()){var hd=event.clipboardData||event.originalEvent.clipboardData;if(!hd||!hd.items||hd.items.length<1)return;var id=hd.items[0].type;if(id!=='image/png')return;if(hd.items[0].getAsFile){var jd=hd.items[0].getAsFile();gd._photoUploader.uploadPastedFile(jd);}}}function ic(gd){dd(gd);mc(gd);}function jc(gd){kc(gd);var hd=!gd._sendOnEnterDefault;gd.focusComposer();gd._sendOnEnterDefault=hd;qa.sendOnEnter=hd;var id=nb.getURIBuilder().setBool('send_on_enter',hd).getURI();new k(id).send();}function kc(gd){o.toggleClass(gd._bottomShelfComposer,bc);if(o.hasClass(gd._bottomShelfComposer,bc)){gd._sendOnEnterButton.setAttribute('aria-checked','false');}else gd._sendOnEnterButton.setAttribute('aria-checked','true');oc(gd,true);lb.detailDOMChanged();}function lc(gd,hd){if(hd==o.hasClass(gd._bottomShelfComposer,bc))kc(gd);}function mc(gd){var hd;if(o.hasClass(gd._bottomShelfComposer,bc)){hd=nc(gd);}else hd=0;var id=kb.getElementDimensions(gd._bottomShelfToolbar).x;gd._ellipsizer.confineWithin(id-hd-120,1.3);}function nc(gd){return kb.getElementDimensions(gd._replyButtonLabel).x+20;}function oc(gd,hd){var id='',jd='';if(!o.hasClass(gd._bottomShelfComposer,bc)){jd=nc(gd)+'px';id='-1';gd._delegator.disable();}else gd._delegator.enable();o.conditionClass(gd._sendContainer,'transition',hd);gd._replyButton.setAttribute('tabindex',id);bb.set(gd._sendContainer,y.isRTL()?'right':'left',jd);}function pc(gd){var hd=wa.getCurrentStateData(),id=xb.constructUserGeneratedMessageObject(w.getValue(gd._composerBox),ia.TITAN_WEB,hd.thread_id,hd.participants),jd=gd._fileUploader.getAttachments();if(jd&&jd.length){id.has_attachment=true;id.raw_attachments=jd;}var kd=gd._photoUploader.getSelectedFBIDs();if(kd.length>0){id.has_attachment=true;id.photo_fbids=kd;}var ld=gd._fileUploader.getImageFiles();if(ld.length>0){id.has_attachment=true;id.image_ids=ld;}var md=gd._fileUploader.getAnimatedImageFiles();if(md.length>0){id.has_attachment=true;id.gif_ids=md;}var nd=gd._fileUploader.getVideoFiles();if(nd.length>0){id.has_attachment=true;id.video_ids=nd;}var od=gd._fileUploader.getAudioFiles();if(od.length>0){id.has_attachment=true;id.audio_ids=od;}var pd=gd._fileUploader.getFiles();if(pd.length>0){id.has_attachment=true;id.file_ids=pd;}if(gd._shareLinkUploader.getAttachData()){id.has_attachment=true;id.content_attachment=gd._shareLinkUploader.getAttachData();}id.force_sms=true;id.ui_push_phase=p.UIPushPhase;return id;}function qc(gd,hd,id){var jd=gd._threadID&&ac.getThreadMetaNow(gd._threadID);if(jd&&jd.is_canonical&&!ja.canReply(jd)&&da.gk_result){tc(gd._threadID,jd);if(o.hasClass(gd._bottomShelfComposer,bc)){o.hide(gd._loadingIndicator);o.show(gd._replyButtonLabel);gd._composerBox.removeAttribute('disabled');}return;}gd.waterfallStep(pa.SESSION_POSTED);if(ba.CoreGraphEnabled&&gd._threadID)gd._replySet.add(gd._threadID);gd._sendSubscription=yb.send(hd,function(kd){gd.waterfallStep(pa.POST_PUBLISHED);if(!id){tb.clearDraft(kd);uc(gd);}gd._messageSent=true;if(gd._shouldLogMessageSend)gd._logMessageSend();var ld=gd.getStickersFlyoutToggler(),md=false;if(ld)md=fb.isShown(ld);var nd=v.getFromMeta(ac.getThreadMetaNow(kd));if(ba.CoreGraphEnabled&&nd===la.PENDING)wb.movePendingToInbox(kd);var od=va.DETAIL.RECENT_MESSAGES;if(wa.getCurrentDetailState()!==od)wa.updateDetailState(od,{thread_id:kd,folder:nd,reuse_composer:id});gd._messageSent=false;if(ld&&md)fb.show(ld);},z.WEBMESSENGER);gd.focusComposer();}function rc(gd,hd){var id=wa.getCurrentStateData(),jd=xb.constructUserGeneratedMessageObject('',ia.TITAN_WEB,id.thread_id,id.participants);if(!jd.thread_id&&!jd.specific_to_list.length)return;jd.has_attachment=true;jd.sticker_id=hd;qc(gd,jd,true);}function sc(gd){if(gd._fileUploader.isUploading()||gd._photoUploader.isUploading()){vc(gd,true);return;}var hd=pc(gd),id=w.isEmpty(gd._composerBox);if(id&&!hd.has_attachment||!hd.thread_id&&!hd.specific_to_list.length)return;if(o.hasClass(gd._bottomShelfComposer,bc)){o.show(gd._loadingIndicator);o.hide(gd._replyButtonLabel);gd._composerBox.setAttribute('disabled','disabled');}qc(gd,hd);}function tc(gd,hd){var id=aa.getParticipantIDFromFromThreadID(gd);ea.get(id,function(jd){m.loadModules(["MessageBlockedDialog"],function(kd){kd.show(hd.thread_id,hd.can_reply,ub.isMessageBlocked(hd),jd.short_name);});});}function uc(gd){w.reset(gd._composerBox);dd(gd);gd._typingDetector&&gd._typingDetector.resetState();gd._fileUploader.removeAttachments();gd._shareLinkUploader.clear();if(gd._photoUploader.getSelectedFBIDs().length>0)gd._photoUploader.clear();o.hide(gd._loadingIndicator);o.show(gd._replyButtonLabel);gd._composerBox.removeAttribute('disabled');if(gd._sendSubscription)gd._sendSubscription=null;vc(gd,false);}function vc(gd,hd){o.conditionShow(gd._uploadingWarning,hd);gd._blockedOnUpload=hd;}function wc(){var gd=wa.getCurrentDetailState(),hd=wa.getCurrentStateData();delete hd.message_action;wa.updateDetailState(gd,hd);}function xc(gd){var hd=gd._manager.getSelectedMessageIDs().length;j.send(new k('/ajax/mercury/delete_messages_dialog.php').setData({count:hd}),function(id){id.subscribe('confirm',yc.bind(null,gd,id));});}function yc(gd,hd){var id=gd._manager.getSelectedMessageIDs();yb['delete'](gd._threadID,id);hd.hide();var jd=wa.getCurrentStateData();if(jd.message_action){var kd=babelHelpers._extends({},jd);delete kd.message_action;wa.updateDetailState(wa.getCurrentDetailState(),kd);}}function zc(gd){if(gd._messageSent)return false;if(!w.isEmpty(gd._composerBox))return true;var hd=gd._fileUploader.getAttachments();if(hd&&hd.length||gd._fileUploader.getImageFiles().length>0||gd._fileUploader.getAnimatedImageFiles().length>0||gd._fileUploader.getVideoFiles().length>0||gd._fileUploader.getAudioFiles().length>0||gd._fileUploader.getFiles().length>0||gd._shareLinkUploader.getAttachData()||gd._photoUploader.getSelectedFBIDs().length>0)return true;var id=wa.getCurrentStateData(),jd=wa.getCurrentDetailState(),kd=jd==va.DETAIL.COMPOSE_MAIN||jd==va.DETAIL.COMPOSE_TYPEAHEAD_RESULTS||jd==va.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS;if(kd&&!id.start&&(id.participants||[]).length)return true;return false;}function ad(gd){ta.onBeforeUnload(function(){var hd=hb.getNextURI();if(!hd.getQueryData().hasOwnProperty('theater')&&!jb.isVaultBoxURI(hd))tb.saveDraft(gd._threadID,gd._composerBox,gd._fileUploader,gd._shareLinkUploader,gd._photoUploader);if(!sb(hd)&&!hd.getQueryData().hasOwnProperty('theater')&&!jb.isVaultBoxURI(hd)&&zc(gd))return rb._("You haven't sent your message.");},true);ta.onBeforeUnload(function(){if(sb(hb.getNextURI())&&zc(gd))return rb._("You haven't sent your message.");},false);ta.onUnload(function(){tb.saveDraft(gd._threadID,gd._composerBox,gd._fileUploader,gd._shareLinkUploader,gd._photoUploader);});}function bd(gd,hd){o.show(gd._bottomShelfComposer);o.addClass(gd._bottomShelfComposer,'invisible_elem');o.conditionClass(gd._bottomShelfButtons,'delete',hd==va.MESSAGE_ACTION.DELETE);o.show(gd._bottomShelfButtons);}function cd(gd){o.show(gd._bottomShelfComposer);o.addClass(gd._bottomShelfComposer,'invisible_elem');o.show(gd._bottomPendingActions);}function dd(gd){bb.set(gd._emoteWrapper,y.isRTL()?'right':'left',gd._composerBox.clientWidth+22+'px');}function ed(gd){if(gd._typingDetector){var hd=gd._threadID,id=null;if(hd){id=aa.getUserIDFromThreadID(hd);var jd=ac.getThreadMetaNow(hd);if((!jd||jd.is_canonical)&&!id)hd=null;}if(!hd){gd._typingDetector.setUserAndThread(id,hd);return;}vb.getServerIDFromClientID(hd,function(kd){gd._typingDetector.setUserAndThread(id,kd);});}}function fd(gd,hd,id){if(q.contains(gd._ariaOwns,id))gd._composerBox.setAttribute('aria-activedescendant',id);}f.exports=cc;},null);
  __d('WebMessengerSharedPhotos.react',['AsyncRequest','Grid.react','immutable','LoadingIndicator.react','MessagesViewer','MessagesViewerSetID','Pixelz.react','React','Image.react','WebMessengerStateConstants','WebMessengerStateManager','URI','XUIButton.react','cx','fbt','glyph'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w){if(c.__markCompiled)c.__markCompiled();var x=o.PropTypes,y=i.GridItem,z=v._("Return to Conversation"),aa=42,ba=o.createClass({displayName:'WebMessengerSharedPhotos',propTypes:{threadID:x.string.isRequired,totalWidth:x.number.isRequired},getInitialState:function(){return {isLoadingMore:true,moreImages:true,imagesData:j.List()};},componentDidMount:function(){this.requestImages();l.preload();},componentDidUpdate:function(){if(!this.isVisible())this.requestImages();},componentWillReceiveProps:function(ca){if(ca.threadID&&ca.threadID!==this.props.threadID)this.setState({isLoadingMore:true,moreImages:true,imagesData:j.List()});},isVisible:function(){return !(this.state.isLoadingMore&&this.state.moreImages&&this.state.imagesData.isEmpty());},loadMoreImages:function(){if(this.state.moreImages&&!this.state.isLoadingMore){this.setState({isLoadingMore:true});this.requestImages();}},renderImages:function(){var ca=Math.floor((this.props.totalWidth-aa)/3),da=this.state.imagesData,ea=da.map((function(fa){return (o.createElement(y,{key:fa.fbid},o.createElement('div',{className:"_5dq3",onClick:this.viewFullImage.bind(null,fa)},o.createElement(n,{upscale:true,width:ca,height:ca,resizeMode:'cover',src:fa.uri,borderRadius:1,insetBorderColor:'rgba(0, 0, 0, 0.1)'}))));}).bind(this));return ea;},viewFullImage:function(ca){var da=new s('/ajax/messaging/attachments/sharedphotos.php').setQueryData({thread_id:this.props.threadID,image_id:ca.fbid});l.bootstrapWithConfig({fbid:ca.fbid,dimensions:ca.dim,src:ca.uri,disablePaging:this.state.imagesData.size===1,endpoint:da,setID:m.MESSAGES_VIEW_ALL_IN_THREAD});},requestImages:function(){new h().setURI('/ajax/messaging/attachments/sharedphotos.php').setMethod('POST').setData({thread_id:this.props.threadID,offset:this.state.imagesData.size,limit:30}).setHandler((function(ca){var da=ca.getPayload();if(!Array.isArray(da.imagesData))da.imagesData=Object.keys(da.imagesData).map(function(ea){return {fbid:ea,dim:da.imagesData[ea].dim,uri:da.imagesData[ea].URI};});this.setState({isLoadingMore:false,moreImages:da.moreImagesToLoad,imagesData:this.state.imagesData.concat(da.imagesData)});}).bind(this)).send();},returnToThread:function(){var ca=babelHelpers._extends({},r.getCurrentStateData());r.updateDetailState(q.DETAIL.RECENT_MESSAGES,ca);},render:function(){var ca=o.createElement('div',{className:(this.isVisible()?"_5dq2":'')+(!this.isVisible()?' '+"_5dq1":'')+(!this.isVisible()?' '+"_5dpz":'')},o.createElement(k,{color:'white',size:'large'}));if(!this.isVisible()){return ca;}else if(!this.state.isLoadingMore)ca=null;return (o.createElement('div',{className:"_5dpz"},o.createElement('div',{className:"_5dp-"},o.createElement(t,{image:o.createElement(p,{src:w('back')}),label:z,size:'medium',onClick:this.returnToThread})),o.createElement('div',{className:"_5dq0"},o.createElement(i,{cols:3,fixed:false},this.renderImages()),ca)));}});f.exports=ba;},null);
  __d('WebMessengerDetailViewSharedPhotosControl',['CSS','DOM','ReactComponentRenderer','WebMessengerSharedPhotos.react','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerEvents','WebMessengerSubscriptionsHandler','MercuryThreadIDMap'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p=c('MercuryThreadIDMap').get();function q(r,s){'use strict';this.manager=r;this.rootElement=s;this.renderer=null;this.serverID=null;this.state=null;this.threadID=null;i.empty(this.rootElement);o.addSubscriptions(this.manager.subscribe('scrolledNearBottom',this.notifyImageRequest.bind(this)),n.subscribe(n.DETAIL_DOM_CHANGED,this.render.bind(this)));}q.prototype.hideView=function(){'use strict';h.hide(this.rootElement);};q.prototype.updateView=function(){'use strict';h.show(this.rootElement);this.updateStateAndData();this.render();};q.prototype.destroy=function(){'use strict';o.release();};q.prototype.updateStateAndData=function(){'use strict';this.state=m.getCurrentDetailState();var r=m.getCurrentStateData();this.threadID=r.thread_id;};q.prototype.render=function(){'use strict';this.serverID=p.getServerIDFromClientIDNow(this.threadID);if(!this.serverID)return;if(!this.renderer){this.renderer=new j(k,this.rootElement);this.renderer.setProps({threadID:this.serverID,totalWidth:this.rootElement.clientWidth});}else this.renderer.setProps({threadID:this.serverID,totalWidth:this.rootElement.clientWidth});};q.prototype.notifyImageRequest=function(){'use strict';var r=m.getCurrentDetailState();if(r===l.DETAIL.SHARED_PHOTOS&&this.renderer)this.renderer.component.loadMoreImages();};f.exports=q;},null);
  __d('MercurySheetPolicy',[],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={canReplaceOpenSheet:function(i,j){if(i.isSheetWithInput&&i.isSheetWithInput())return j.getType()!=i.getType()&&j.isSheetWithInput&&j.isSheetWithInput();if(i.getType()==j.getType())return false;if(i.isPermanent()&&!j.isPermanent())return false;if(i.getType()==='message-blocked')return false;return true;}};f.exports=h;},null);
  __d('MercurySheetView',['Animation','ArbiterMixin','MercurySheetPolicy','CSS','DOM','Style','MercurySheetTemplates','Vector','cx','setTimeoutAcrossTransitions'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){if(c.__markCompiled)c.__markCompiled();var r=5000,s=function(t,u,v){this._threadID=t;this._rootElement=u;this._tabMainElement=v;this._openSheet=null;};Object.assign(s.prototype,i,{destroy:function(){l.empty(this._rootElement);},_openCommon:function(t,u){if(this._openSheet&&!j.canReplaceOpenSheet(this._openSheet,t)){if(t.couldNotReplace)t.couldNotReplace();return;}this.clear((function(){this._openSheet=t;var v=n[':fb:mercury:tab-sheet:loading'].build().getRoot();l.setContent(this._rootElement,v);k.show(v);k.show(this._rootElement);t.render();if(u){k.addClass(this._tabMainElement,'sheetSlide');k.addClass(this._tabMainElement,"_1sk4");var w=o.getElementDimensions(this._rootElement).y;m.set(this._rootElement,'bottom',w+'px');this.resize();this._animation=new h(this._rootElement).to('bottom',0).duration(150).ease(h.ease.both).ondone((function(){k.removeClass(this._tabMainElement,'sheetSlide');k.removeClass(this._tabMainElement,"_1sk4");this.resize();}).bind(this)).go();}else this.resize();if(!t.isPermanent()){var x=r;if(t.getCloseTimeout)x=t.getCloseTimeout();var y=this.getAutoCloseCallback(t);this._sheetCloseHandler=q(this.close.bind(this,t,y),x);if(t.timeoutCanBeReset)t.setResetTimeoutCallback(this.resetTimeout.bind(this));}}).bind(this));},getAutoCloseCallback:function(t){if(!t.autoCloseCallback)return null;return t.autoCloseCallback.bind(t);},resetTimeout:function(t,u){clearTimeout(this._sheetCloseHandler);var v=this.getAutoCloseCallback(t);this._sheetCloseHandler=q(this.close.bind(this,t,v),u);},set:function(t){return this._openCommon(t,false);},open:function(t){return this._openCommon(t,true);},close:function(t,u){if(this._openSheet!=t)return;if(!this._openSheet){u&&u();return;}if(this._animation)this._animation.stop();if(this._sheetCloseHandler){clearTimeout(this._sheetCloseHandler);this._sheetCloseHandler=null;}k.addClass(this._tabMainElement,'sheetSlide');k.addClass(this._tabMainElement,"_1sk4");var v=o.getElementDimensions(this._rootElement).y;this.resize();this._animation=new h(this._rootElement).to('bottom',v+'px').duration(100).ease(h.ease.begin).ondone((function(){l.empty(this._rootElement);k.hide(this._rootElement);k.removeClass(this._tabMainElement,'sheetSlide');k.removeClass(this._tabMainElement,"_1sk4");this._openSheet=null;this.resize();u&&u();}).bind(this)).go();},clear:function(t){this.close(this._openSheet,t);},resize:function(){this.inform('resize');}});f.exports=s;},null);
  __d('WebMessengerEmployeeAwaySheet',['ArbiterMixin','DOM','mixin','WebMessengerTemplates'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();var l,m;l=babelHelpers.inherits(n,j(h));m=l&&l.prototype;function n(o,p,q){'use strict';m.constructor.call(this);this.$WebMessengerEmployeeAwaySheet1=o;this.$WebMessengerEmployeeAwaySheet2=p;this.$WebMessengerEmployeeAwaySheet3=q;}n.prototype.render=function(){'use strict';var o=k[':fb:mercury:employee-away-sheet'].build();i.setContent(this.$WebMessengerEmployeeAwaySheet2,o.getRoot());};n.prototype.isPermanent=function(){'use strict';return true;};n.prototype.getType=function(){'use strict';return 'employee-away';};n.prototype.open=function(){'use strict';this.$WebMessengerEmployeeAwaySheet3.open(this);};n.prototype.close=function(){'use strict';this.$WebMessengerEmployeeAwaySheet3.close(this);};f.exports=n;},null);
  __d('WebMessengerIsMessageBlockedSheet',['ArbiterMixin','DOM','Event','WebMessengerTemplates','fbt','mixin'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n,o;n=babelHelpers.inherits(p,m(h));o=n&&n.prototype;function p(q,r,s){'use strict';o.constructor.call(this);this.$WebMessengerIsMessageBlockedSheet1=q;this.$WebMessengerIsMessageBlockedSheet2=r;this.$WebMessengerIsMessageBlockedSheet3=s;}p.prototype.render=function(){'use strict';var q=k[':fb:mercury:messages-blocked-sheet'].build(),r=l._("Messages from this recipient are blocked.");i.setContent(this.$WebMessengerIsMessageBlockedSheet2,q.getRoot());i.setContent(q.getNode('text'),r+' ');j.listen(q.getNode('unblockButton'),'click',(function(){this.inform('clicked',this.$WebMessengerIsMessageBlockedSheet1);}).bind(this));};p.prototype.isPermanent=function(){'use strict';return true;};p.prototype.getType=function(){'use strict';return 'message-blocked';};p.prototype.open=function(){'use strict';this.$WebMessengerIsMessageBlockedSheet3.open(this);};p.prototype.close=function(){'use strict';this.$WebMessengerIsMessageBlockedSheet3.close(this);};f.exports=p;},null);
  __d('WebMessengerThreadIsMutedTabSheet',['Event','ArbiterMixin','DOM','WebMessengerTemplates','fbt','mixin'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n,o;n=babelHelpers.inherits(p,m(i));o=n&&n.prototype;function p(q,r){'use strict';o.constructor.call(this);this._rootElement=q;this._sheetView=r;}p.prototype.render=function(){'use strict';var q=k[':fb:web-messenger:read-view:message-mute-sheet'].build();j.setContent(q.getNode('text'),l._("This conversation is muted. Chat tabs will not pop up for it and push notifications are off."));j.setContent(this._rootElement,q.getRoot());h.listen(q.getNode('unmuteButton'),'click',(function(){this.inform('clicked',null);}).bind(this));};p.prototype.isPermanent=function(){'use strict';return false;};p.prototype.getType=function(){'use strict';return 'wb-thread-is-muted';};p.prototype.open=function(){'use strict';this._sheetView.open(this);};p.prototype.close=function(){'use strict';this._sheetView.close(this);};f.exports=p;},null);
  __d('WebMessengerDetailViewSheetControl',['DOM','ArbiterMixin','WebMessengerStateManager','MercurySheetView','MercuryThreadInfo','WebMessengerTemplates','WebMessengerEmployeeAwaySheet','ChatEmployeeAwayWarning','WebMessengerIsMessageBlockedSheet','WebMessengerThreadIsMutedTabSheet','WebMessengerSubscriptionsHandler','mixin','MercuryBlockedParticipants','MercuryThreadInformer','MercuryThreadActions','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){if(c.__markCompiled)c.__markCompiled();var t,u,v=c('MercuryBlockedParticipants').get(),w=c('MercuryThreadInformer').get(),x=c('MercuryThreadActions').get(),y=c('MercuryThreads').get();t=babelHelpers.inherits(z,s(i));u=t&&t.prototype;function z(aa){'use strict';u.constructor.call(this);this._template=m[':fb:web-messenger:tab-sheet-container'].build();this._rootElement=this._template.getNode('sheet');this._threadID=j.getCurrentStateData().thread_id;this._sheetView=new k(this._threadID,this._rootElement,aa);this._threadIsMessageBlockedSheet=new p(this._threadID,this._rootElement,this._sheetView);this._employeeAwaySheet=new n(this._threadID,this._rootElement,this._sheetView);this._threadIsMutedTabSheet=new q(this._rootElement,this._sheetView);this._muteSetting=undefined;h.setContent(aa,this._template.getRoot());this._threadMessageBlockedSub=this._threadIsMessageBlockedSheet.subscribe('clicked',(function(){x.unblockMessages(this._threadID);}).bind(this));this._threadIsMutedClickSub=this._threadIsMutedTabSheet.subscribe('clicked',(function(){x.unmute(this._threadID);}).bind(this));r.addSubscriptions(this._sheetView.subscribe('resize',this.inform.bind(this,'resize')),w.subscribe('threads-updated',(function(ba,ca){if(this._threadID&&ca[this._threadID])this.updateTabSheet(false);}).bind(this)));this.updateTabSheet(true);}z.prototype.updateView=function(){'use strict';var aa=j.getCurrentStateData().thread_id;if(this._threadID!=aa){this._threadID=aa;this.updateTabSheet(true);}};z.prototype.updateTabSheet=function(aa){'use strict';if(!this._threadID)return;y.getThreadMeta(this._threadID,(function(ba){var ca=l.getMuteSetting(ba);if(ca!=this._muteSetting||aa){if(ca){this._threadIsMutedTabSheet.open();}else this._threadIsMutedTabSheet.close();this._muteSetting=ca;}if(v.isMessageBlocked(ba)){this._threadIsMessageBlockedSheet.open();}else this._threadIsMessageBlockedSheet.close();o.updateEmployeeAwayWarning(ba,(function(){this._employeeAwaySheet.open();}).bind(this),(function(){this._employeeAwaySheet.close();}).bind(this));}).bind(this));};z.prototype.destroy=function(){'use strict';this._threadIsMutedClickSub&&this._threadIsMutedClickSub.unsubscribe();this._employeeAwaySheet&&this._employeeAwaySheet.close();};f.exports=z;},null);
  __d('WebMessengerDetailViewControlManager',['Event','ArbiterMixin','CSS','WebMessengerDetailViewHeaderControl','DOM','WebMessengerFlexibleScrollArea','WebMessengerDetailViewActionsMenuControl','WebMessengerDetailViewAllPeopleResultsControl','WebMessengerDetailViewComposeTypeaheadControl','WebMessengerDetailViewRecentMessagesControl','WebMessengerDetailViewSearchContextControl','WebMessengerDetailViewSearchSnippetsControl','WebMessengerDetailViewBottomShelfControl','WebMessengerDetailViewSharedPhotosControl','MercuryConfig','MercuryIDs','WebMessengerMessagesSelection','Parent','WebMessengerDetailViewSheetControl','WebMessengerStateManager','WebMessengerStateConstants','Style','UserAgent_DEPRECATED','WebMessengerEvents','WebMessengerSubscriptionsHandler','WebMessengerTemplates','mixin','getElementPosition'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea,fa,ga,ha,ia){if(c.__markCompiled)c.__markCompiled();var ja,ka;ja=babelHelpers.inherits(la,ha(i));ka=ja&&ja.prototype;function la(ma){'use strict';ka.constructor.call(this);this._rootElement=ma;l.empty(this._rootElement);var na=ga[':fb:web-messenger:read-view'].build();l.setContent(this._rootElement,na.getRoot());this._readContainer=na.getNode('readContainer');this._headerControl=new k(na.getNode('detailViewHeader'));this._actionsMenuControl=new n(na.getNode('detailViewActionsMenu'),this._headerControl);this._allPeopleResultsControl=new o(na.getNode('detailViewAllPeopleResults'));this._composeTypeaheadControl=new p(na.getNode('detailViewComposeTypeahead'),na.getNode('detailViewComposeTypeaheadResults'));this._searchContextControl=new r(this,na.getNode('detailViewSearchContext'),na.getNode('snippetPaginationControlBox'));this._searchSnippetsControl=new s(this,na.getNode('detailViewSearchSnippets'));this._sharedPhotosControl=new u(this,na.getNode('detailViewSharedPhotos'));this._sheetControl=new z(na.getNode('detailViewSheetTab'));var oa=na.getNode('detailViewBottomShelf');this._bottomShelfControl=new t(this,oa);this._detailViewScroller=na.getNode('readMessagesScroller');fa.addSubscriptions(h.listen(this._detailViewScroller,'click',(function(qa){if(y.byTag(qa.getTarget(),'a')||l.getSelection())return;this._bottomShelfControl.focusComposer();}).bind(this)));var pa={fade:!!da.osx(),persistent:true};this._flexArea=new m(this._detailViewScroller,pa).setBottomAligned(false).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearTop'),true).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearBottom')).setContainer(this._rootElement).setMinFlexAreaHeight(200).draw();fa.addSubscriptions(ea.subscribe(ea.DETAIL_DOM_CHANGED,this._flexArea.draw.bind(this._flexArea)),ea.subscribe(ea.SUBMIT_REPLY,this._bottomShelfControl.submitReply.bind(this._bottomShelfControl)),aa.subscribe(ba.STATE_CHANGE_EVENT,this.updateOnStateChange.bind(this)));fa.addSubscriptions(this._sheetControl.subscribe('resize',this._flexArea.draw.bind(this._flexArea)));this._recentMessagesControl=new q(this,na.getNode('detailViewRecentMessages'),na.getNode('loadingSpinner'),na.getNode('noSelectedConversation'),na.getNode('newMessageLink'),na.getNode('showUnreadLink'),na.getNode('contextBanner'),oa);this._stateData={};this._resizeNodes=[this._rootElement,this._detailViewScroller,l.find(this._detailViewScroller,'div.uiScrollableAreaBody')];}la.prototype.updateOnStateChange=function(){'use strict';var ma=aa.getCurrentDetailState(),na=this._stateData;this._stateData=aa.getCurrentStateData();this._flexArea.setTabbable(ma!==ba.DETAIL.COMPOSE_MAIN);this._allPeopleResultsControl.hideView();this._composeTypeaheadControl.hideView();this._recentMessagesControl.hideView();this._searchContextControl.hideView();this._searchSnippetsControl.hideView();this._sharedPhotosControl.hideView();j.removeClass(this._readContainer,'blankComposeState');j.conditionClass(this._readContainer,'blankComposeState',ma===ba.DETAIL.COMPOSE_MAIN);this._bottomShelfControl.updateView();this._actionsMenuControl.updateView();this._headerControl.updateView();switch(ma){case ba.DETAIL.RECENT_MESSAGES:this._recentMessagesControl.updateView();this._sheetControl.updateView();break;case ba.DETAIL.COMPOSE_ALL_PEOPLE_RESULTS:this._allPeopleResultsControl.updateView();this._composeTypeaheadControl.updateView();break;case ba.DETAIL.COMPOSE_MAIN:this._composeTypeaheadControl.updateView();break;case ba.DETAIL.COMPOSE_TYPEAHEAD_RESULTS:this._composeTypeaheadControl.updateView();break;case ba.DETAIL.SHARED_PHOTOS:this._sharedPhotosControl.updateView();break;case ba.DETAIL.SEARCH_SNIPPET:case ba.DETAIL.SEARCH_THREAD_SNIPPET:this._searchSnippetsControl.updateView();break;case ba.DETAIL.SEARCH_CONTEXT:this._searchContextControl.updateView();break;}switch(ma){case ba.DETAIL.RECENT_MESSAGES:case ba.DETAIL.SEARCH_CONTEXT:if(na.thread_id!=this._stateData.thread_id)this._bottomShelfControl.focusComposer();break;}};la.prototype.hideAll=function(){'use strict';this._headerControl.hideView();this._actionsMenuControl.hideView();this._allPeopleResultsControl.hideView();this._composeTypeaheadControl.hideView();this._recentMessagesControl.hideView();this._searchContextControl.hideView();this._searchSnippetsControl.hideView();this._sharedPhotosControl.hideView();this._bottomShelfControl.hideView();};la.prototype.getSelectedMessageIDs=function(){'use strict';var ma=aa.getCurrentDetailState();switch(ma){case ba.DETAIL.RECENT_MESSAGES:case ba.DETAIL.SEARCH_CONTEXT:return x.getSelectedMessageIDs();}return [];};la.prototype.scrollIntoView=function(ma){'use strict';this._flexArea&&this._flexArea.scrollIntoView(ma);};la.prototype.setScrollTop=function(ma,na){'use strict';this._flexArea&&this._flexArea.setScrollTop(ma,na);};la.prototype.isScrolledToBottom=function(){'use strict';return this._flexArea&&this._flexArea.isScrolledToBottom();};la.prototype.scrollToBottom=function(ma){'use strict';this._flexArea&&this._flexArea.scrollToBottom(ma);};la.prototype.draw=function(){'use strict';this._flexArea&&this._flexArea.draw();};la.prototype.poke=function(){'use strict';this._flexArea&&this._flexArea.poke();};la.prototype.addScrollCallback=function(ma){'use strict';this._flexArea&&this._flexArea.addScrollCallback(ma);};la.prototype.getFlexAreaBoundingClientRect=function(){'use strict';return ia(this._flexArea.flexArea);};la.prototype.resizeTo=function(ma){'use strict';if(ma!==null){ma=ma.toString();if(!ma.endsWith('%')||ma.endsWith('px'))ma=ma+'px';}this._resizeNodes.forEach(function(na){ca.set(na,'width',ma);});ea.detailDOMChanged();};la.prototype.destroy=function(){'use strict';this._headerControl.destroy();this._actionsMenuControl.destroy();this._allPeopleResultsControl.destroy();this._composeTypeaheadControl.destroy();this._recentMessagesControl.destroy();this._searchContextControl.destroy();this._searchSnippetsControl.destroy();this._bottomShelfControl.destroy();this._sharedPhotosControl.destroy();this._flexArea.destroy();this._sheetControl.destroy();};f.exports=la;},null);
  __d('WebMessengerAuxMenu',['SelectableMenu','MenuSelectableItem','MenuTheme','PopoverMenuOverlappingBorder','Popover','PopoverMenu'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();function n(o,p){'use strict';this._menu=new h([],{className:p,theme:j});var q=new l(o.parentNode,o,null,{alignh:'right'});new m(q,o,this._menu,[k]);}n.prototype.addOption=function(o,p){'use strict';var q=new i({markup:o,title:''});q.setOnClickHandler(p);this._menu.addItem(q);return q;};n.prototype.destroy=function(){'use strict';};f.exports=n;},null);
  __d('WebMessengerMenuFolderControl',['WebMessengerAuxMenu','CSS','Parent','WebMessengerTemplates','Toggler','cx','WebMessengerSubscriptionsHandler'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();var o,p;function q(s){return j.byClass(s,"_282");}function r(s,t,u){'use strict';var v=!o||o!=t;o=t;this._template=k[':fb:web-messenger:master-view:tab-bar:menu-option'].build();this._template.setNodeContent('folderLabel',s);if(!p||v){p=new h(o,"_1j");i.show(q(o));n.addSubscriptions(l.subscribe(['show','hide'],function(w,x){var y=x.getActive(),z=y&&j.byClass(y,"_282");if(z)i.conditionClass(z,"_50p_",w==='show');}));}this._menuItem=p.addOption(this._template.getRoot(),u);this._menuItem.getRoot();}r.prototype.getCountBadge=function(){'use strict';return this._template.getNode('count');};r.prototype.setSelected=function(s){'use strict';i.conditionClass(q(o),'selectedFolder',s);if(s){this._menuItem.select();}else this._menuItem.deselect();};r.prototype.destroy=function(){'use strict';p&&p.destroy();};f.exports=r;},null);
  __d('MessagingFilteringNux',['Arbiter','AsyncRequest','LayerDestroyOnHide','LayerHideOnTransition','MercuryConfig','isWebMessengerURI'],function a(b,c,d,e,f,g,h,i,j,k,l,m){if(c.__markCompiled)c.__markCompiled();var n=null,o,p={ACCEPTED_EVENT:'filtering/accepted',DIALOG_REGISTERED_EVENT:'filtering/dialog-registered',tryShow:function(q){h.subscribe(p.DIALOG_REGISTERED_EVENT,function(){if(!n)return;n.setContext(q);n.show();n=null;},h.SUBSCRIBE_ALL);},registerDialog:function(q){n=q.disableBehavior(j).disableBehavior(k);o=h.subscribe('page_transition',function(r,s){if(!m(s.uri)){q&&q.destroy();o.unsubscribe();}},h.SUBSCRIBE_NEW);if(q)q.subscribe('confirm',function(){l.filtering_active=true;new i('/ajax/web_messenger/dismiss_filtering_nux.php').send();q.hide();h.inform(p.ACCEPTED_EVENT,{});});h.inform(p.DIALOG_REGISTERED_EVENT,{},h.BEHAVIOR_PERSISTENT);}};f.exports=p;},null);
  __d('WebMessengerTabbedFolderControl',['Event','CSS','WebMessengerTemplates'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();function k(l,m,n,o){'use strict';this._template=j[':fb:web-messenger:master-view:tab-bar:folder'].build();this._template.setNodeContent('folderLabel',l);this._listener=h.listen(this._template.getNode('link'),'click',n);if(o)this._countListener=h.listen(this._template.getNode('count'),'click',o);m.push(this._template.getRoot());}k.prototype.getCountBadge=function(){'use strict';return this._template.getNode('count');};k.prototype.setSelected=function(l){'use strict';i.conditionClass(this._template.getRoot(),'selectedFolder',l);};k.prototype.getElement=function(){'use strict';this._template.getRoot();};k.prototype.destroy=function(){'use strict';this._listener.remove();this._countListener&&this._countListener.remove();};f.exports=k;},null);
  __d('WebMessengerEditFilteringSettingDialog',['AsyncDialog','AsyncRequest','MercuryConstants','DOM','csx'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m='/ajax/mercury/edit_filtering_type.php',n='/ajax/mercury/change_filtering_type.php',o={show:function(){var p=function(r){var s=r.getRoot(),t=k.find(s,"._cq6").checked,u=k.find(s,"._cq7").checked,v='';if(t){v=j.MessagingFilteringType.MODERATE;}else if(u)v=j.MessagingFilteringType.STRICT;new i(n).setData({filtering_type:v}).send();r.hide();},q=function(r){r.subscribe('confirm',p.bind(null,r));r.show();};h.send(new i(m),q);}};f.exports=o;},null);
  __d('WebMessengerMercury',['MercuryMessages','MercuryOrderedThreadlist','MercuryServerRequests','WebMessengerStateManager','MercuryThreadInformer','MercuryThreadActions','MercuryThreads','MercuryUnreadState','MercuryUnseenState'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();var q={getMessages:function(){return h.getForFBID(r());},getOrderedThreadlist:function(){return i.getForFBID(r());},getServerRequests:function(){return j.getForFBID(r());},getThreadInformer:function(){return l.getForFBID(r());},getThreadActions:function(){return m.getForFBID(r());},getThreads:function(){return n.getForFBID(r());},getUnreadState:function(){return o.getForFBID(r());},getUnseenState:function(){return p.getForFBID(r());}};function r(){return k.getCurrentUserID();}f.exports=q;},null);
  __d('MercuryLocalThreadResults',['MercuryFolders','MercuryIDs','MercurySingletonMixin','MercuryOrderedThreadlist','MercuryParticipants','MercuryThreadSearchUtils','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();function o(p){'use strict';this.$MercuryLocalThreadResults1=p;this.$MercuryLocalThreadResults2=k.getForFBID(this.$MercuryLocalThreadResults1);this.$MercuryLocalThreadResults3=n.getForFBID(this.$MercuryLocalThreadResults1);}o.prototype.findMatchingThreadsFromIds=function(p,q){'use strict';return q.filter((function(r){var s=this.$MercuryLocalThreadResults3.getThreadMetaNow(r);return this.$MercuryLocalThreadResults4(s,p);}).bind(this));};o.prototype.findMatchingThreads=function(p){'use strict';var q=[];h.getSupportedFolders().forEach((function(r){q=q.concat(this.$MercuryLocalThreadResults2.getThreadlistUntilTimestamp(0,r));}).bind(this));return this.findMatchingThreadsFromIds(p,q);};o.prototype.$MercuryLocalThreadResults4=function(p,q){'use strict';var r=this.$MercuryLocalThreadResults5(p.participants),s=m.wordsInString(q),t=null;l.getMulti(r,function(u){t=r.map(function(v){return u[v];});});if(!t)return false;return m.allMatchPredicate(s,function(u){var v=m.anyMatchPredicate(t,function(x){return x&&x.name&&m.queryWordMatchesAnyNameWord(u,m.wordsInString(x.name));}),w=p.name&&m.queryWordMatchesAnyNameWord(u,m.wordsInString(p.name));return v||w;});};o.prototype.$MercuryLocalThreadResults5=function(p){'use strict';if(p.length===1&&i.tokenize(p[0]).value===this.$MercuryLocalThreadResults1)return p;return p.filter((function(q){var r=i.tokenize(q).value;return r!==this.$MercuryLocalThreadResults1;}).bind(this));};Object.assign(o,j);f.exports=o;},null);
  __d('MercurySearchThreadResults',['KeyedCallbackManager','MercuryAPIArgsSource','MercurySingletonMixin','MercuryThreadlistConstants','MercuryThreadIDMap','RangedCallbackManager','MercuryServerDispatcher','MercuryServerPayloadPreprocessor'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o){if(c.__markCompiled)c.__markCompiled();var p=new h(),q=k.WEBMESSENGER_THREAD_COUNT,r=k.WEBMESSENGER_MORE_COUNT;function s(t){'use strict';this.$MercurySearchThreadResults1=t;this.$MercurySearchThreadResults2=o.getForFBID(this.$MercurySearchThreadResults1);this.$MercurySearchThreadResults3=l.getForFBID(this.$MercurySearchThreadResults1);n.registerEndpoints({'/ajax/mercury/search_threads.php':{request_user_id:t,mode:n.IMMEDIATE,handler:(function(u){this.handleUpdate(u);}).bind(this)}});}s.prototype.getThreadlist=function(t,u){'use strict';if(t){var v=p.executeOrEnqueue(t,function(y){var z=y.getAllResources(),aa=y.hasReachedEndOfArray();u(z,aa);}),w=p.getUnavailableResources(v),x=i.WEBMESSENGER;if(w.length)this.$MercurySearchThreadResults4({client:x,query:t,offset:0,limit:q+1});return v;}};s.prototype.isExhausted=function(t){'use strict';var u=p.getResource(t);return u?u.hasReachedEndOfArray():false;};s.prototype.getCachedThreadlist=function(t){'use strict';var u=p.getResource(t);return u?u.getAllResources():null;};s.prototype.cacheThreadlist=function(t,u){'use strict';p.getResource(t);var v=new m();v.addResourcesWithoutSorting(u,0);v.setReachedEndOfArray();p.setResource(t,v);};s.prototype.getMoreThreadlist=function(t,u){'use strict';if(t){var v=p.getResource(t);if(v){var w=v.getCurrentArraySize(),x=r,y=v.executeOrEnqueue(0,w+x,function(){var aa=v.getAllResources(),ba=v.hasReachedEndOfArray();u(aa,ba);}),z=v.getUnavailableResources(y);if(z.length)this.$MercurySearchThreadResults4({query:t,offset:w,limit:x+1});return y;}}};s.prototype.handleUpdate=function(t){'use strict';if(t.mercury_payload)this.$MercurySearchThreadResults2.handleUpdate(t.mercury_payload);var u=t.search_threads||{};for(var v in u){var w=u[v]||[],x=w.map((function(z){return this.$MercurySearchThreadResults3.getClientIDFromServerIDNow(z);}).bind(this)),y=p.getResource(v);if(y){this.$MercurySearchThreadResults5(y,x,r+1);}else{y=new m();this.$MercurySearchThreadResults5(y,x,q+1);p.setResource(v,y);}}};s.prototype.unsubscribe=function(t,u){'use strict';if(u){var v=p.getResource(u);if(v){v.unsubscribe(t);}else p.unsubscribe(t);}};s.prototype.setInitialCount=function(t){'use strict';q=t;};s.prototype.$MercurySearchThreadResults5=function(t,u,v){'use strict';var w=t.getCurrentArraySize(),x=u.length<v;if(!x)u.pop();t.addResourcesWithoutSorting(u,w);if(x)t.setReachedEndOfArray();};s.prototype.$MercurySearchThreadResults4=function(t){'use strict';t.client=i.WEBMESSENGER;t.index='fbid';n.trySend('/ajax/mercury/search_threads.php',t,null,this.$MercurySearchThreadResults1);};Object.assign(s,j);f.exports=s;},null);
  __d('MercurySearchThreadsStrategy',['WebMessengerConstants','MercuryLocalThreadResults','MercurySingletonMixin','MercurySearchThreadResults','createObjectFrom'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m=null,n=null,o=h.SEARCH_THREAD_DELAY;function p(q){'use strict';this.$MercurySearchThreadsStrategy1=q;this.$MercurySearchThreadsStrategy2=i.getForFBID(this.$MercurySearchThreadsStrategy1);this.$MercurySearchThreadsStrategy3=k.getForFBID(this.$MercurySearchThreadsStrategy1);}p.prototype.clearTimer=function(){'use strict';m=null;clearTimeout(n);n=null;};p.prototype.search=function(q,r,s,t){'use strict';if(q!=m){m=q;clearTimeout(n);n=null;}var u=this.$MercurySearchThreadsStrategy2.findMatchingThreads(q),v=this.$MercurySearchThreadsStrategy3.getCachedThreadlist(q);if(v){var w=this.$MercurySearchThreadsStrategy4(u,v);r(w);s([],this.$MercurySearchThreadsStrategy3.isExhausted(q));t(null,q);return;}var x=this.$MercurySearchThreadsStrategy5(q),y=this.$MercurySearchThreadsStrategy4(u,x.thread_ids);if(x.from_exhausted_remote_results){this.$MercurySearchThreadsStrategy3.cacheThreadlist(q,y);r(y);s([],true);t(null,q);return;}r(y);n=setTimeout((function(){var z=this.$MercurySearchThreadsStrategy3.getThreadlist(q,s);t(z,q);}).bind(this),o);};p.prototype.$MercurySearchThreadsStrategy5=function(q){'use strict';var r='',s=[];for(var t=q.length-1;t>0;t--){var u=q.slice(0,t),v=this.$MercurySearchThreadsStrategy3.getCachedThreadlist(u);if(!v)continue;if(this.$MercurySearchThreadsStrategy3.isExhausted(u)){return {from_exhausted_remote_results:true,thread_ids:this.$MercurySearchThreadsStrategy2.findMatchingThreadsFromIds(q,v)};}else if(r.length===0){r=u;s=this.$MercurySearchThreadsStrategy2.findMatchingThreadsFromIds(q,v);}}return {from_exhausted_remote_results:false,thread_ids:s};};p.prototype.$MercurySearchThreadsStrategy4=function(q,r){'use strict';return Object.keys(babelHelpers._extends({},l(q),l(r)));};Object.assign(p,j);f.exports=p;},null);
  __d('WebMessengerMasterViewSearchInputControl',['Event','CSS','DOM','Input','Keys','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerSubscriptionsHandler','WebMessengerEvents','cx','MercurySearchThreadsStrategy'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){if(c.__markCompiled)c.__markCompiled();var t=c('MercurySearchThreadsStrategy').get();function u(ca,da){'use strict';this._manager=ca;this._rootElement=da;j.empty(this._rootElement);var ea=p[':fb:web-messenger:master-view:search-input'].build();j.replace(this._rootElement,ea.getRoot());this._searchBox=ea.getRoot();this._searchInput=ea.getNode('searchInput');this._searchClear=ea.getNode('searchClear');this._searchButton=j.find(this._searchBox,'button');this._state=null;this._query=null;this._folder=null;this._threadID=null;this._ariaOwns=this._searchInput.getAttribute('aria-owns');q.addSubscriptions(r.subscribe(r.UPDATE_SELECTION,ba.bind(null,this)),h.listen(this._searchButton,'click',(function(){var fa=k.getValue(this._searchInput);if(fa)z(this,fa);}).bind(this)),h.listen(this._searchClear,'click',y.bind(null,this)),h.listen(this._searchInput,'keyup',(function(event){var fa=k.getValue(this._searchInput);if(event.keyCode==l.ESC){y(this);}else if(event.keyCode==l.RETURN&&fa){m.openSearchThread();}else if(fa){aa(this,fa);}else if(fa!==o.getCurrentStateData().query){y(this);this.focus();}return false;}).bind(this)),h.listen(this._searchInput,'focus',(function(fa){this._focused=true;}).bind(this)),h.listen(this._searchInput,'blur',(function(fa){this._focused=false;}).bind(this)));}u.prototype.updateView=function(){'use strict';var ca=w(this);v(this);if(ca)x(this);};u.prototype.focusAndSelectSearch=function(){'use strict';z(this,k.getValue(this._searchInput));this._manager.scrollToTop(false);this.focus();this._searchInput.select();};u.prototype.focus=function(){'use strict';setTimeout((function(){if(!this._focused){this._searchInput.focus();this._searchInput.value=this._searchInput.value;}}).bind(this),0);};u.prototype.destroy=function(){'use strict';};function v(ca){var da=o.getCurrentStateData();ca._state=o.getCurrentMasterState();ca._folder=da.folder;if(ca._state!=n.MASTER.SEARCH){ca._query=null;}else ca._query=da.query;}function w(ca){if(!ca._state||!ca._folder)return true;var da=o.getCurrentMasterState(),ea=o.getCurrentStateData();if(ca._folder!=ea.folder)return true;if(da!=ca._state)return true;if(da==n.MASTER.SEARCH&&ca._query!=ea.query)return true;return false;}function x(ca){if(ca._state==n.MASTER.SEARCH){var da=ca._query||'';if(k.getValue(ca._searchInput)!=da)k.setValue(ca._searchInput,da);ca.focus();}else{k.reset(ca._searchInput);ca._searchInput.blur();}i.conditionClass(ca._searchBox,"_47",!k.isEmpty(ca._searchInput));}function y(ca){t.clearTimer();var da=o.getCurrentStateData();da.no_uri=true;delete da.query;o.updateMasterState(n.MASTER.RECENT_THREADS,da);}function z(ca,da){var ea=o.getCurrentMasterState();if(ea!=n.MASTER.SEARCH)ca._threadID=o.getCurrentStateData().thread_id;if(da)o.updateDetailState(n.DETAIL.SEARCH_SNIPPET,{query:da,message_query:da});}function aa(ca,da){var ea=o.getCurrentStateData();if(da!==ea.query){var fa=o.getCurrentMasterState();if(fa!=n.MASTER.SEARCH)ca._threadID=ea.thread_id;if(da)o.updateMasterState(n.MASTER.SEARCH,{all_people_query:ea.all_people_query,message_query:ea.message_query,message_id:ea.message_id,query:da,thread_id:ea.thread_id});}}function ba(ca,da,ea){if(j.contains(ca._ariaOwns,ea))ca._searchInput.setAttribute('aria-activedescendant',ea);}f.exports=u;},null);
  __d('MercuryLogger',['JSLogger','MercuryThreadIDMap','MercuryThreads'],function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=c('MercuryThreadIDMap').get(),j=c('MercuryThreads').get(),k=h.create('messaging_impressions');function l(event,p){k.log(event,p);}function m(p,q){var r=j.getThreadMetaNow(p);if(r){var s=i.getServerIDFromClientIDNow(p);if(s){var event=q?'thread_search':'thread',t={is_single_thread:r.is_canonical_user,is_subscribed:r.is_subscribed,query:q||null};t.thread_fbid=s;l(event,t);}k.bump('opened_thread_'+r.folder);}}function n(p,q){var r={};q.forEach(function(s){var t=i.getServerIDFromClientIDNow(s),u=j.getThreadMetaNow(s);if(u&&t){var v={is_single_thread:u.is_canonical_user,folder:u.folder,participants:u.participants,other_user_fbid:u.other_user_fbid};v.thread_fbid=t;r[t]=v;}});l('threadlist',{folder:p,threads:r});k.bump('opened_threadlist_'+p);}var o={logThread:function(p){m(p);},logThreadlist:function(p,q){n(p,q);},logThreadFromSearch:function(p,q){m(q,p);},logThreadlistFromSearch:function(p,q){l('threadlist_search',{folder:q,query:p});}};f.exports=o;},null);
  __d('WebMessengerThreadlistRenderer',['CSS','DOM','Event','Focus','MercuryListUpdateRenderer','MercuryAPIArgsSource','MessagingTag','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','MercuryThreadMetadataRawRenderer','MercuryThreadMetadataRenderer','Tooltip','WebMessengerMercury','WebMessengerPermalinks','WebMessengerDeleteThreadDialog','cx','fbt'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){if(c.__markCompiled)c.__markCompiled();var z={renderThreadsFromIDs:function(ba,ca,da,ea,fa,ga){ea=ea||function(ha){return ha;};fa=fa||{};l.updateList(ba,ca.map(ea),function(ha){return !fa[ca[ha]]&&ca[ha]!=da;},function(ha){var ia=ca[ha],ja=q[':fb:web-messenger:threadlist-row'].build();ja.getRoot().setAttribute('id',ea(ia));var ka=ja.getNode('threadLink');k.listen(ka,function(la){h.conditionClass(ja.getRoot(),"_5fes",la);});j.listen(ka,'click',function(la){if(la.getModifiers().any)return true;var ma=p.getCurrentMasterState(),na={thread_id:ia};if(ma===o.MASTER.SEARCH)na.query=p.getCurrentStateData().query;p.updateDetailState(o.DETAIL.RECENT_MESSAGES,na);return false;});if(ia==da)h.addClass(ja.getRoot(),"_kv");u.getThreads().getThreadMeta(ia,function(la){var ma=s.getForFBID(p.getCurrentUserID());ma.renderCoreThreadlist(la,ja,aa.bind(null,ga),{names_renderer:r.renderShortNames,show_unread_count:false},true);},m.WEBMESSENGER);return ja.getRoot();});}};function aa(ba,ca,da){var ea=ca.getNode('readToggler'),fa=ca.getNode('archiveButton'),ga=ca.getNode('deleteButton');ca.getNode('threadLink').setAttribute('href',v.getURI(ba,o.DETAIL.RECENT_MESSAGES,{thread_id:da.thread_id}).toString());if(da.unread_count>0){h.addClass(ca.getRoot(),"_kx");i.setContent(ca.getNode('newCount'),y._("{num} new",[y.param('num',da.unread_count)]));h.addClass(ea,"_ky");t.set(ea,y._("Mark as Read"),'above','right');}else{h.addClass(ea,"_kz");t.set(ea,y._("Mark as Unread"),'above','right');}j.listen(ea,'click',function(event){var ja=u.getThreadActions();h.hasClass(ea,"_ky")?ja.markRead(da.thread_id):ja.markUnread(da.thread_id);return false;});var ha=p.getCurrentStateData().folder;if(ha==n.SPAM){t.set(ga,y._("Delete Conversation"),'above','right');h.addClass(ga,"_4_3q");j.listen(ga,'click',function(event){w.show(da.thread_id);});h.hide(fa);}else{h.hide(ga);var ia=true;if(ha==n.ACTION_ARCHIVED){ia=false;t.set(fa,y._("Unarchive"),'above','right');h.addClass(fa,"_2s2");}else{t.set(fa,y._("Archive"),'above','right');h.addClass(fa,"_l9");}j.listen(fa,'click',function(event){var ja=u.getThreadActions();ia?ja.archive(da.thread_id):ja.unarchive(da.thread_id);var ka=p.getCurrentStateData();if(ka.thread_id==da.thread_id)p.updateDetailState(o.DETAIL.RECENT_MESSAGES,{folder:ka.folder});return false;});}}f.exports=z;},null);
  __d('WebMessengerMasterViewUnseenMessagesNotice',['MercuryThreadlistConstants','MessagingTag','WebMessengerStateManager','UserActivity','WebMessengerSubscriptionsHandler','WebMessengerMessagesNotice','WebMessengerConstants','WebMessengerMercury','throttle'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();var q,r,s=n.THREADLIST_SCROLLTOP_OFFSET,t=h.MESSAGE_NOTICE_INACTIVITY_THRESHOLD;q=babelHelpers.inherits(u,m);r=q&&q.prototype;function u(z){'use strict';r.constructor.call(this);this._manager=z;this._threadInformer=o.getThreadInformer();this._unseenState=o.getUnseenState();l.addSubscriptions(this._threadInformer.subscribe('messages-received',(function(aa,ba){var ca=!k.isActive(t),da=!this.isScrolledWithinTopThreshold();if(!r.getActive.call(this)||x(ba)||!w(ba))return;if(r.onlyReceivedFromSelf.call(this,ba))return;if(ca){this.removeMessageNotice();this._manager.scrollToTop();}else if(da)this.showMessageNotice();}).bind(this)),this._threadInformer.subscribe('unseen-updated',v.bind(null,this)));this._manager.addScrollCallback(p.withBlocking((function(aa){if(r.getActive.call(this)&&aa.getScrollTop()<=n.THREADLIST_TOP_OFFSET&&k.isActive(t)&&y()){this.removeMessageNotice();this._unseenState.markAsSeen();}}).bind(this),100,null));}u.prototype.isScrolledWithinTopThreshold=function(){'use strict';return this._manager.getScrollTop()<=s;};u.prototype.showMessageNotice=function(){'use strict';if(!y())return;var z=(function(){this._manager.scrollToTop();}).bind(this);r.showMessageNotice.call(this,z,'below');};function v(z){if(z._unseenState.getUnseenCount()===0)z.removeMessageNotice();}function w(z){for(var aa in z)for(var ba=0;ba<z[aa].length;ba++)if(z[aa][ba].folder==i.INBOX)return true;return false;}function x(z){var aa=j.getCurrentStateData().thread_id,ba=true;for(var ca in z)if(z.hasOwnProperty(ca))if(ca!==aa){ba=false;break;}return y()&&ba;}function y(){var z=j.getCurrentStateData().folder;return z===i.INBOX;}f.exports=u;},null);
  __d('WebMessengerMasterViewRecentThreadsControl',['CSS','DOM','Event','MercuryLogger','MercuryAPIArgsSource','MercuryFilters','MercuryFolders','MercuryThreadlistConstants','MessagingTag','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadlistRenderer','WebMessengerConstants','WebMessengerEvents','WebMessengerInfoBoxRenderer','WebMessengerSubscriptionsHandler','WebMessengerMasterViewUnseenMessagesNotice','WebMessengerMercury','createObjectFrom','cx','ge','fbt','UserActivity'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca,da,ea){if(c.__markCompiled)c.__markCompiled();c('UserActivity');var fa='recent:';function ga(ya,za,ab,bb){'use strict';this._manager=ya;this._rootElement=za;this._infoBox=ab;this._orderedThreadlist=aa.getOrderedThreadlist();this._serverRequests=aa.getServerRequests();this._threadInformer=aa.getThreadInformer();this._threads=aa.getThreads();this._unseenState=aa.getUnseenState();i.empty(this._rootElement);this._pagerExponent=-1;var cb=t[':fb:web-messenger:threadlist'].build();i.setContent(this._rootElement,cb.getRoot());this._loadingSpinner=cb.getNode('loadingSpinner');this._threadlistRows=cb.getNode('threadlistRows');this._loadMoreButton=cb.getNode('loadMoreButton');this._loadMoreLink=cb.getNode('loadMoreLink');this._active=false;this._state=null;this._folder=null;this._filter=null;this._selection=null;this._threadIDs=[];this._unreadThreadIDs=[];this._folders=n.getSupportedFolders();this._filters=m.getSupportedFilters();this._olderTimestamp={};this._currentCountMap={};this._folders.forEach((function(db){this._currentCountMap[db]={};this._filters.concat([m.ALL]).forEach((function(eb){this._currentCountMap[db][eb]=o.WEBMESSENGER_THREAD_COUNT+1;}).bind(this));}).bind(this));this._unseenMessagesNotice=new z(this._manager);this._unseenMessagesNotice.setNoticeContextNode(bb);y.addSubscriptions(this._threadInformer.subscribe('threadlist-updated',(function(db,eb){ta(this,ba(eb));}).bind(this)),j.listen(this._loadMoreLink,'click',(function(){sa(this);}).bind(this)),this._manager.subscribe('scrolledNearBottom',(function(){this._active&&sa(this);}).bind(this)));}ga.prototype.updateView=function(){'use strict';this._active=true;this._unseenMessagesNotice.updateView();h.show(this._rootElement);var ya=ia(this),za=ja(this),ab=this._folder,bb=this._selection;ka(this);if(za)la(this,bb);if(ya){ra(this);}else ma(this);if(ab!=this._folder)k.logThreadlist(this._folder,this._threadIDs);if(this._selection&&bb!=this._selection)k.logThread(this._selection);};ga.prototype.hideView=function(){'use strict';this._active=false;this._unseenMessagesNotice.hideView();h.hide(this._rootElement);};ga.prototype.destroy=function(){'use strict';ha(this);this._unseenMessagesNotice.destroy();};function ha(ya){ya._threadlistSubscription&&ya._orderedThreadlist.unsubscribe(ya._threadlistSubscription.subscriber_id,ya._threadlistSubscription.folder,ya._threadlistSubscription.filter);ya._threadlistSubscription=null;}function ia(ya){var za=s.getCurrentStateData();if(ya._folder!=za.folder||ya._filter!=za.filter)return true;return false;}function ja(ya){var za=s.getCurrentStateData();if(ya._selection!=za.thread_id)return true;return false;}function ka(ya){var za=s.getCurrentStateData();ya._state=s.getCurrentMasterState();if(ya._folder!=za.folder||ya._filter!=za.filter)ya._pageExponent=-1;ya._folder=za.folder;ya._filter=za.filter;ya._selection=za.thread_id;}function la(ya,za){var ab=da(xa(za));if(ab){h.removeClass(ab,"_kv");ab.removeAttribute('aria-selected');}var bb=da(xa(ya._selection));if(bb){h.addClass(bb,"_kv");bb.setAttribute('aria-selected','true');}w.updateSelection(bb&&bb.id);}function ma(ya){if(ya._active)q.updateThreadlistIndex(ya,ya._threadIDs.map(xa),xa(ya._selection));}function na(ya){h.addClass(ya._manager.getFlexAreaElement(),"_3j6");h.addClass(ya._manager.getFlexAreaElement(),"_3j7");}function oa(ya){h.removeClass(ya._manager.getFlexAreaElement(),"_3j6");h.removeClass(ya._manager.getFlexAreaElement(),"_3j7");}function pa(ya){h.hide(ya._threadlistRows);oa(ya);}function qa(ya){if(ya._threadIDs.length){h.show(ya._threadlistRows);oa(ya);}else{h.hide(ya._threadlistRows);na(ya);}}function ra(ya){h.show(ya._loadingSpinner);h.hide(ya._infoBox);pa(ya);h.hide(ya._loadMoreButton);ha(ya);var za=ya._orderedThreadlist.getFilteredThreadlist(o.RECENT_THREAD_OFFSET,ya._currentCountMap[ya._folder][ya._filter],ya._folder,ya._filter,function(ab,bb){h.hide(ya._loadingSpinner);ua(ya,ab,bb);qa(ya);ma(ya);ya._manager.poke();ya._manager.forceFireScrollCallbacks();},null,l.WEBMESSENGER);if(za)ya._threadlistSubscription={subscriber_id:za,folder:ya._folder,filter:ya._filter};}function sa(ya){if(ya._requestInFlight||h.hasClass(ya._loadMoreButton,'hidden_elem'))return;ya._requestInFlight=true;h.addClass(ya._loadMoreButton,'async_saving');ya._pagerExponent=Math.min(ya._pagerExponent+1,v.EXPONENTIAL_PAGER_MAX_CYCLES);var za=Math.pow(2,ya._pagerExponent),ab=ya._currentCountMap[ya._folder][ya._filter]+za*o.WEBMESSENGER_MORE_COUNT;ha(ya);var bb=ya._orderedThreadlist.getFilteredThreadlist(o.RECENT_THREAD_OFFSET,ab,ya._folder,ya._filter,function(cb,db){h.removeClass(ya._loadMoreButton,'async_saving');ya._currentCountMap[ya._folder][ya._filter]=ab;ua(ya,cb,db);ma(ya);ya._manager.poke();ya._requestInFlight=false;},null,l.WEBMESSENGER);if(bb)ya._threadlistSubscription={subscriber_id:bb,folder:ya._folder,filter:ya._filter};}function ta(ya,za){if(!ya._folder||!ya._olderTimestamp[ya._folder])return;var ab=ya._orderedThreadlist.getThreadlistUntilTimestamp(ya._olderTimestamp[ya._folder],ya._folder,ya._filter);if(ya._filter==p.UNREAD){ab=wa(ya,ab);}else ya._unreadThreadIDs=[];if(ab.length>ya._currentCountMap[ya._folder][ya._filter])ya._currentCountMap[ya._folder][ya._filter]=ab.length;ya._threadIDs=ab;qa(ya);u.renderThreadsFromIDs(ya._threadlistRows,ab,ya._selection,xa,za,r.MASTER.RECENT_THREADS);ma(ya);ya._manager.poke();}function ua(ya,za,ab){var bb=za.length==ya._currentCountMap[ya._folder][ya._filter];if(bb)za.pop();if(za.length){var cb=za[za.length-1];ya._threads.getThreadMeta(cb,function(db){ya._olderTimestamp[ya._folder]=db.timestamp;},l.WEBMESSENGER);}if(ya._filter==p.UNREAD){ya._unreadThreadIDs=za;}else ya.unreadThreadIDs=[];h.conditionShow(ya._loadMoreButton,bb);ya._threadIDs=za;u.renderThreadsFromIDs(ya._threadlistRows,za,ya._selection,xa,null,r.MASTER.RECENT_THREADS);ab=ab&&za.length===0;ab&&va(ya);h.conditionShow(ya._infoBox,ab);}function va(ya){if(ya._builtErrorMessage)return;i.setContent(ya._infoBox,x.render(ea._("Could Not Load Conversations"),[{text:ea._("Try Again"),handler:ra.bind(null,ya)}]));ya._builtErrorMessage=true;}function wa(ya,za){za.forEach(function(ab){if(ya._unreadThreadIDs.indexOf(ab)<0)ya._unreadThreadIDs.push(ab);});ya._unreadThreadIDs.sort(function(ab,bb){var cb=ya._threads.getThreadMetaNow(ab).timestamp,db=ya._threads.getThreadMetaNow(bb).timestamp;return db-cb;});ya._unreadThreadIDs=ya._unreadThreadIDs.filter(function(ab){var bb=ya._threads.getThreadMetaNow(ab);return n.getFromMeta(bb)==ya._folder;});return ya._unreadThreadIDs;}function xa(ya){if(ya)return fa+ya;return null;}f.exports=ga;},null);
  __d('MercurySearchThreadResultOrderer',['MercurySingletonMixin','MessagingTag','MercuryThreads','createObjectFrom'],function a(b,c,d,e,f,g,h,i,j,k){if(c.__markCompiled)c.__markCompiled();function l(p){'use strict';this.$MercurySearchThreadResultOrderer1=p;this.$MercurySearchThreadResultOrderer2=j.getForFBID(p);}l.prototype.separateCanonicalThreadsInFolder=function(p,q){'use strict';var r=[],s=[];p.forEach((function(t){var u=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(t);if(u.folder===q&&u.is_canonical){r.push(t);}else s.push(t);}).bind(this));return {canonical_in_folder:r.sort((function(t,u){return this.$MercurySearchThreadResultOrderer3(t,u);}).bind(this)),remaining:s};};l.prototype.filterThreadsInFolder=function(p,q){'use strict';var r=[];p.forEach((function(s){var t=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(s);if(t.folder===q&&t.is_archived===false){r.push(s);}else if(q===i.ACTION_ARCHIVED&&t.is_archived===true)r.push(s);}).bind(this));return r;};l.prototype.orderResults=function(p,q,r,s){'use strict';var t=o(q,r),u=t.sort(this.$MercurySearchThreadResultOrderer4.bind(this,s));return o(p,u);};l.prototype.$MercurySearchThreadResultOrderer4=function(p,q,r){'use strict';var s=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(q),t=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(r),u=m(s),v=m(t);if(u!==v)return n(u,p)>n(v,p)?-1:1;if(s.is_canonical!==t.is_canonical)return s.is_canonical?-1:1;return this.$MercurySearchThreadResultOrderer3(q,r);};l.prototype.$MercurySearchThreadResultOrderer3=function(p,q){'use strict';var r=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(p),s=this.$MercurySearchThreadResultOrderer2.getThreadMetaNow(q);return r.timestamp>s.timestamp?-1:1;};function m(p){return p.is_archived?i.ACTION_ARCHIVED:p.folder;}function n(p,q){if(p===q)return 5;var r={};r[i.INBOX]=4;r[i.ACTION_ARCHIVED]=3;r[i.OTHER]=2;r[i.SPAM]=1;return r[p];}function o(p,q){var r=k(p),s=q.filter(function(t){return !(t in r);});return p.concat(s);}Object.assign(l,h);f.exports=l;},null);
  __d('WebMessengerMasterViewSearchThreadsControl',['Event','CSS','DOM','MercuryFolders','MercuryLogger','WebMessengerShortcuts','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerTemplates','WebMessengerThreadlistRenderer','WebMessengerEvents','WebMessengerMercury','WebMessengerSubscriptionsHandler','createObjectFrom','csx','cx','fbt','ge','getElementText','MercurySearchThreadResultOrderer','MercurySearchThreadResults','MercurySearchThreadsStrategy'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z){if(c.__markCompiled)c.__markCompiled();var aa=c('MercurySearchThreadResultOrderer').get(),ba=c('MercurySearchThreadResults').get(),ca=c('MercurySearchThreadsStrategy').get(),da='search:',ea='search-indicator';function fa(bb,cb,db,eb){'use strict';this._manager=bb;this._rootElement=cb;this._noMessagesIndicator=eb;this._orderedThreadlist=s.getOrderedThreadlist();this._threadInformer=s.getThreadInformer();this._threads=s.getThreads();j.empty(this._rootElement);var fb=p[':fb:web-messenger:thread-search'].build();j.setContent(this._rootElement,fb.getRoot());this._loadingSpinner=fb.getNode('loadingSpinner');this._threadlistRows=fb.getNode('threadlistRows');this._loadMoreButton=fb.getNode('loadMoreButton');this._loadMoreLink=fb.getNode('loadMoreLink');var gb=p[':fb:web-messenger:master-view-snippets-link'].build();this._threadSearchResultDescription=gb.getNode('threadSearchResultDescription');this._searchMessagesIndicator=gb.getRoot();this._searchMessagesIndicator.setAttribute('id',da+ea);j.replace(db,this._searchMessagesIndicator);this._snippetSearchLink=gb.getNode('snippetSearchLink');this._snippetSearchLinkText=gb.getNode('snippetSearchLinkText');this._active=false;this._detailState=null;this._query=null;this._folder=null;this._selection=null;this._keyboardSelection=null;this._threadIDs=[];this._oldestTimestamps=ha(this);this._namesChangedSinceLastRedraw=false;this._remoteResultsCompleted=true;t.addSubscriptions(this._threadInformer.subscribe('threadlist-updated',(function(hb,ib){ta(this,u(ib));}).bind(this)),this._threadInformer.subscribe('messages-received',(function(){this._namesChangedSinceLastRedraw=true;}).bind(this)),h.listen(this._loadMoreLink,'click',(function(){sa(this);}).bind(this)),h.listen(this._snippetSearchLink,'click',(function(){this.updateKeyboardSelection(ea);ab(this);}).bind(this)));}fa.prototype.updateView=function(){'use strict';this._active=true;i.show(this._rootElement);i.hide(this._loadingSpinner);var bb=ia(this),cb=ja(this),db=this._folder,eb=this._query,fb=this._selection;ka(this);if(cb||bb){var gb=this._keyboardSelection;switch(this._detailState){case n.DETAIL.RECENT_MESSAGES:this._keyboardSelection=this._selection;break;case n.DETAIL.SEARCH_SNIPPET:case n.DETAIL.SEARCH_CONTEXT:this._keyboardSelection=ea;}la(this,gb);}if(bb){qa(this);}else{ma(this,false);ra(this);}if(eb!=this._query||db!=this._folder)l.logThreadlistFromSearch(this._query,this._folder);if(this._selection&&fb!=this._selection)l.logThreadFromSearch(this._query,this._selection);};fa.prototype.hideView=function(){'use strict';this._active=false;i.hide(this._rootElement);ua(this,false);ra(this);};fa.prototype.openSearchThread=function(bb){'use strict';if(bb==ea){ab(this);}else o.updateDetailState(n.DETAIL.RECENT_MESSAGES,{query:this._query,thread_id:bb});};fa.prototype.updateKeyboardSelection=function(bb){'use strict';var cb=this._keyboardSelection;this._keyboardSelection=bb;la(this,cb);};fa.prototype.destroy=function(){'use strict';ga(this);};function ga(bb){bb._searchThreadsSubscription&&ba.unsubscribe(bb._searchThreadsSubscription.subscriber_id,bb._searchThreadsSubscription.query);bb._searchThreadsSubscription=null;}function ha(bb){var cb={};k.getSupportedFolders().forEach((function(db){var eb=bb._orderedThreadlist.getThreadlistUntilTimestamp(0,db);cb[db]=eb.length>0?bb._threads.getThreadMetaNow(eb[eb.length-1]).timestamp:Infinity;}).bind(this));return cb;}function ia(bb){var cb=bb._namesChangedSinceLastRedraw;bb._namesChangedSinceLastRedraw=false;if(cb)return true;if(!bb._remoteResultsCompleted)return true;var db=ha(bb),eb=bb._oldestTimestamps;bb._oldestTimestamps=db;var fb=o.getCurrentStateData();if(bb._query!==fb.query||bb._folder!==fb.folder)return true;for(var gb in eb)if(eb[gb]>db[gb])return true;return false;}function ja(bb){var cb=o.getCurrentStateData();if(bb._selection!=cb.thread_id)return true;return false;}function ka(bb){var cb=o.getCurrentStateData();bb._detailState=o.getCurrentDetailState();bb._query=cb.query;bb._folder=cb.folder;bb._selection=cb.thread_id;}function la(bb,cb){var db=y(ya(cb));if(db){i.removeClass(db,"_kv");db.removeAttribute('aria-selected');}var eb=y(ya(bb._keyboardSelection));if(eb){i.addClass(eb,"_kv");eb.setAttribute('aria-selected',true);}r.updateSelection(eb&&eb.id);}function ma(bb,cb){if(bb._keyboardSelection&&bb._keyboardSelection!=ea&&bb._threadIDs.indexOf(bb._keyboardSelection)<0)bb._keyboardSelection=null;if(!bb._keyboardSelection)if(bb._threadIDs.length){bb._keyboardSelection=bb._threadIDs[0];}else if(!cb){bb._keyboardSelection=ea;la(bb);}var db=bb._threadIDs.slice(0);db.push(ea);if(bb._active)m.updateThreadlistIndex(bb,db.map(ya),ya(bb._keyboardSelection));}function na(bb){var cb=j.scry(bb._threadlistRows,"._l5");cb.filter(function(db){return z(db)!==o.getCurrentStateData().folder;}).forEach(i.show.bind(i));}function oa(bb){var cb=j.scry(bb._threadlistRows,"._l5");cb.forEach(i.hide.bind(i));}function pa(bb){na(bb);bb._manager.draw();}function qa(bb){i.show(bb._loadingSpinner);ua(bb,false);i.hide(bb._threadlistRows);i.hide(bb._loadMoreButton);oa(bb);ga(bb);if(bb._query){var cb=[],db=[];bb._remoteResultsCompleted=false;ca.search(bb._query,function(eb){var fb=aa.separateCanonicalThreadsInFolder(eb,o.getCurrentStateData().folder);cb=fb.canonical_in_folder;db=fb.remaining;za(bb);i.show(bb._threadlistRows);wa(bb,cb);pa(bb);},function(eb,fb){bb._remoteResultsCompleted=true;var gb=aa.orderResults(cb,db,eb,o.getCurrentStateData().folder);if(gb.length>0){i.conditionShow(bb._loadMoreButton,!fb);xa(bb,gb);}else va(bb);i.hide(bb._loadingSpinner);pa(bb);},function(eb,fb){if(eb)bb._searchThreadsSubscription={subscriber_id:eb,query:fb};});}else{ca.clearTimer();i.hide(bb._loadingSpinner);j.empty(bb._threadlistRows);i.show(bb._threadlistRows);bb._threadIDs=[];}ra(bb);}function ra(bb){var cb=!!bb._query&&bb._active,db=cb^i.shown(bb._searchMessagesIndicator);i.conditionShow(bb._searchMessagesIndicator,cb);bb._manager.sizeToFit(cb);db&&bb._manager.draw();}function sa(bb){ga(bb);i.addClass(bb._loadMoreButton,'async_saving');var cb=ba.getMoreThreadlist(bb._query,function(db,eb){i.removeClass(bb._loadMoreButton,'async_saving');i.conditionShow(bb._loadMoreButton,!eb);xa(bb,db);bb._manager.poke();});if(cb)bb._searchThreadsSubscription={subscriber_id:cb,query:bb._query};}function ta(bb,cb){if(bb._threadIDs.length){q.renderThreadsFromIDs(bb._threadlistRows,bb._threadIDs,bb._keyboardSelection,ya,cb,n.MASTER.SEARCH);bb._manager.poke();}}function ua(bb,cb){cb=cb&&bb._active;i.conditionClass(bb._searchMessagesIndicator,"_33x",cb!==false);i.conditionShow(bb._noMessagesIndicator,cb!==false);}function va(bb){bb._threadIDs=[];ma(bb,false);var cb=x._("No people or conversations named {query}",[x.param('query',bb._query)]),db=j.create('div',{},cb);j.setContent(bb._noMessagesIndicator,db);ua(bb,true);}function wa(bb,cb){xa(bb,cb,true);}function xa(bb,cb,db){bb._threadIDs=cb;ma(bb,db);q.renderThreadsFromIDs(bb._threadlistRows,cb,bb._keyboardSelection,ya,null,n.MASTER.SEARCH);r.updateSelection(bb._keyboardSelection);if(bb._keyboardSelection==ea)la(bb);}function ya(bb){if(bb)return da+bb;return null;}function za(bb){var cb=x._("Showing results for name: {query}",[x.param('query',bb._query)]);j.setContent(bb._threadSearchResultDescription,cb);}function ab(bb){if(bb._query){o.updateDetailState(n.DETAIL.SEARCH_SNIPPET,{query:bb._query,message_query:bb._query});r.focusSearch();}}f.exports=fa;},null);
  __d('WebMessengerMasterViewControlManager',['ArbiterMixin','DOM','WebMessengerFlexibleScrollArea','WebMessengerMasterViewTabBarControl','WebMessengerMasterViewSearchInputControl','WebMessengerMasterViewRecentThreadsControl','WebMessengerMasterViewSearchThreadsControl','WebMessengerStateManager','WebMessengerStateConstants','Style','WebMessengerTemplates','WebMessengerEvents','WebMessengerSubscriptionsHandler','mixin'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){if(c.__markCompiled)c.__markCompiled();var v,w;v=babelHelpers.inherits(x,u(h));w=v&&v.prototype;function x(y){'use strict';w.constructor.call(this);this._rootElement=y;i.empty(this._rootElement);var z=r[':fb:web-messenger:master-view'].build();i.setContent(this._rootElement,z.getRoot());this._tabBarControl=new k(this,z.getNode('masterViewTabBar'),z.getNode('masterViewTopContent'));this._searchInputControl=new l(this,z.getNode('masterViewSearchInput'));this._searchThreadsControl=new n(this,z.getNode('masterViewSearchThreads'),z.getNode('searchMessagesIndicator'),z.getNode('noMessages'));this._threadlistRowsWrapper=z.getNode('threadlistRowsWrapper');this._flexArea&&this._flexArea.destroy();var aa={fade:true,persistent:true};this._flexArea=new j(this._threadlistRowsWrapper,aa).setInfiniteScrollHandler(this.inform.bind(this,'scrolledNearBottom')).setContainer(this._rootElement).setMinFlexAreaHeight(40).draw();this._recentThreadsControl=new m(this,z.getNode('masterViewRecentThreads'),z.getNode('masterInfoBox'),z.getNode('masterViewTabBar'));t.addSubscriptions(s.subscribe(s.FOCUS_AND_SELECT_SEARCH,this._searchInputControl.focusAndSelectSearch.bind(this._searchInputControl)),s.subscribe(s.FOCUS_SEARCH,this._searchInputControl.focus.bind(this._searchInputControl)),s.subscribe(s.MASTER_DOM_CHANGED,(function(){this._tabBarControl.updateView();this._flexArea&&this._flexArea.draw();}).bind(this)),o.subscribe(p.STATE_CHANGE_EVENT,this.updateOnStateChange.bind(this)));this._resizeNodes=[this._rootElement,this._threadlistRowsWrapper,i.find(this._threadlistRowsWrapper,'div.uiScrollableAreaBody')];}x.prototype.updateOnStateChange=function(){'use strict';var y=o.getCurrentMasterState();this._tabBarControl.updateView();this._searchInputControl.updateView();switch(y){case p.MASTER.RECENT_THREADS:this._searchThreadsControl.hideView();this._recentThreadsControl.updateView();break;case p.MASTER.SEARCH:this._recentThreadsControl.hideView();this._searchThreadsControl.updateView();break;}};x.prototype.scrollIntoView=function(y,z){'use strict';this._flexArea&&this._flexArea.scrollIntoView(y,z);};x.prototype.scrollToBottom=function(y){'use strict';this._flexArea&&this._flexArea.scrollToBottom(y);};x.prototype.scrollToTop=function(y){'use strict';this._flexArea&&this._flexArea.scrollToTop(y);};x.prototype.isScrolledToTop=function(){'use strict';return this._flexArea&&this._flexArea.isScrolledToTop();};x.prototype.getScrollTop=function(){'use strict';return this._flexArea.getScrollableArea().getScrollTop();};x.prototype.draw=function(){'use strict';this._flexArea&&this._flexArea.draw();};x.prototype.poke=function(){'use strict';this._flexArea&&this._flexArea.poke();};x.prototype.sizeToFit=function(y){'use strict';this._flexArea&&this._flexArea.setSizeToFit(y);};x.prototype.addScrollCallback=function(y){'use strict';this._flexArea&&this._flexArea.addScrollCallback(y);};x.prototype.forceFireScrollCallbacks=function(){'use strict';this._flexArea&&this._flexArea._onScroll();};x.prototype.getFlexAreaElement=function(){'use strict';return this._flexArea.flexArea;};x.prototype.resizeTo=function(y){'use strict';if(y!==null){y=y.toString();if(!(y.endsWith('%')||y.endsWith('px')))y=y+'px';}this._resizeNodes.forEach(function(z){q.set(z,'width',y);});s.masterDOMChanged();};x.prototype.destroy=function(){'use strict';this._tabBarControl.destroy();this._recentThreadsControl.destroy();this._searchThreadsControl.destroy();this._flexArea.destroy();};f.exports=x;},null);
  __d('WebMessengerPageTitleRenderer',['DocumentTitle','MercuryAPIArgsSource','MercuryViewer','MercuryParticipants','WebMessengerStateConstants','WebMessengerStateManager','fbt','MercuryThreadMetadataRenderer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n){if(c.__markCompiled)c.__markCompiled();var o=c('MercuryThreadMetadataRenderer').get(),p=c('MercuryThreads').get(),q={updateTitleForState:function(t,u,v){this.withTitleForState(t,u,v||function(w){var x=m.getCurrentDetailState(),y=m.getCurrentStateData();if(t===x&&u===y)h.set(w);});},withTitleForState:function(t,u,v){switch(t){case l.DETAIL.RECENT_MESSAGES:r(u.thread_id,v);break;default:s(v);break;}}};function r(t,u){if(!t){s(u);return;}p.getThreadMeta(t,function(v){if(v.name){u(n._("{conversation_name} - Messages",[n.param('conversation_name',v.name)]));return;}k.getMulti(v.participants,function(w){var x=[];for(var y in w)if(w.hasOwnProperty(y))x.push(w[y]);var z=o.renderParticipantList(t,x,w[j.getID()]?v.participants.length-1:v.participants.length,{abbr_mode:true,last_separator_uses_and:true,names_renderer:function(aa){var ba=[];if(aa.length===1&&aa[0].id===j.getID()){ba.push(aa[0].name);}else for(var ca=0;ca<aa.length;ca++)if(aa[ca].id!==j.getID())ba.push(aa[ca].name);return ba;}});u(n._("{conversation_name} - Messages",[n.param('conversation_name',z)]));});},i.WEBMESSENGER);}function s(t){t(n._("Messages"));}f.exports=q;},null);
  __d('WebMessengerPageTitleControl',['WebMessengerPageTitleRenderer','WebMessengerStateManager','WebMessengerStateConstants','WebMessengerSubscriptionsHandler','WebMessengerEvents'],function a(b,c,d,e,f,g,h,i,j,k,l){if(c.__markCompiled)c.__markCompiled();var m=function(){var n=function(){h.updateTitleForState(i.getCurrentDetailState(),i.getCurrentStateData());};k.addSubscriptions(i.subscribe(j.STATE_CHANGE_EVENT,n),l.subscribe(l.DETAIL_DOM_CHANGED,n));};f.exports=m;},null);
  __d('WebMessengerThreadMessagesAgent',['MercuryAPIArgsSource','MessagingTag','WebMessengerConstants','MercuryMessages','MercuryOrderedThreadlist','MercuryThreadInformer','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j){if(c.__markCompiled)c.__markCompiled();var k=c('MercuryMessages').get(),l=c('MercuryOrderedThreadlist').get(),m=c('MercuryThreadInformer').get(),n=c('MercuryThreads').get(),o=21,p=false,q='n_inbox_n_unreads',r=j.THREADLIST_MAX_READ_PRELOAD_NUM,s=j.THREADLIST_MAX_UNREAD_PRELOAD_NUM;function t(){'use strict';this._active=true;this._iterative=p;this._strategy=q;this._requestInFlight=false;this._requestIsQueued=false;this._pendingThreadIds={};this._processedThreadIds={};this._threadInformerSubscriptions=[];this._threadInformerSubscriptions.push(m.subscribe('threadlist-updated',u.bind(null,this)));}t.prototype.turnOn=function(){'use strict';this._active=true;};t.prototype.turnOff=function(){'use strict';this._active=false;};t.prototype.destroy=function(){'use strict';this._threadInformerSubscriptions.forEach(m.unsubscribe);this._threadInformerSubscriptions=[];};function u(x){if(x._active&&!x._requestIsQueued){if(x._requestInFlight){x._requestIsQueued=true;return;}var y=v(x);if(y.length){x._requestInFlight=true;if(y.length>o){y=y.slice(0,o);x._requestIsQueued=true;}}y.forEach(function(z){x._processedThreadIds[z]=true;x._pendingThreadIds[z]=true;k.getThreadMessagesRange(z,0,j.INITIAL_MESSAGES_LIMIT,function(){w(x,z);},null,h.WEBMESSENGER);});}}function v(x){var y=l.getThreadlistUntilTimestamp(0,i.INBOX),z=y.filter(function(ea){return !x._processedThreadIds[ea]&&!k.hasLoadedNMessages(ea,j.INITIAL_MESSAGES_LIMIT);});if(x._strategy===q){var aa=[],ba=[];for(var ca=0;ca<z.length;ca++){var da=n.getThreadMetaNow(z[ca]);if(da){if(da.unread_count&&ba.length<s)ba.push(z[ca]);if(!da.unread_count&&aa.length<r)aa.push(z[ca]);if(ba.length>=s&&aa.length>=r)break;}}z=aa.concat(ba);}return z;}function w(x,y){if(x._pendingThreadIds[y])delete x._pendingThreadIds[y];if(Object.keys(x._pendingThreadIds).length===0){if(!x._iterative)x._active=false;x._requestInFlight=false;if(x._requestIsQueued){x._requestIsQueued=false;u(x);}}}f.exports=t;},null);
  __d('WebMessengerAdsControl',['AdsMouseStateStore','Animation','Arbiter','CSS','CurrentUser','DOM','EgoAdsObjectSet','Event','KeyedCallbackManager','MercuryIDs','UIPagelet','URI','UserActivity','Vector','WebMessengerAdsConfig','WebMessengerStateManager','shield','WebMessengerSubscriptionsHandler','cx','csx','throttle','WebMessengerConstants','MercuryThreads'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca){if(c.__markCompiled)c.__markCompiled();var da=c('MercuryThreads').get(),ea=600,fa=ca.ADS_ROTATION_INTERVAL_PASSIVE,ga=ca.ADS_ROTATION_THRESHOLD_ACTIVE,ha=ca.MAX_ADS,ia=2,ja=165,ka=h.STATES,la='data-height',ma=new p(),na='webMessengerAdsStage',oa=0,pa={};function qa(){}Object.assign(qa,{init:function(){this._ads=new n();this._initializedAds=false;this._loadingCount=null;this._stage=null;this._drawCount=0;this._lastRefresh=0;this._pageletInProgress=null;this._lastMousedOnAds=false;this._waitOn(['codes','container','sidebar','footer'],this.start.bind(this));y.addSubscriptions(t.subscribe(x(this._refreshIfReady,this)),j.subscribe('footerLoaded',function(){ma.setResource('footer',1);}),j.subscribe(['sidebar/initialized','sidebar/show','sidebar/hide','minisidebar/show'],this._sideBarChanged.bind(this)),ma);return this;},setContainer:function(xa){ma.setResource('container',xa);this._container=xa;},setTrackingCodes:function(xa){ma.setResource('codes',xa);},getTrackingCodes:function(){return ma.getResource('codes');},updateRhcID:function(){var xa=m.scry(this._container,'div.ego_section')[0];if(!xa)return;h.updateRhcID(m.getID(xa));},start:function(){this._stage=m.create('div',{id:na,className:"_2rn"});this._ego=m.find(this._container,"._81");m.insertAfter(this._ego,this._stage);this.updateRhcID();this._updateFooterHeight();this.waitForAdsLoad(this._container,this._processOnPageUnits.bind(this));y.addSubscriptions(o.listen(window,'resize',ba(this.draw,100,this)),o.listen(this._ego,'mouseenter',x(this._mouseEvent,this,true)),o.listen(this._ego,'mouseleave',x(this._mouseEvent,this,false)));},stateChanged:function(xa,ya){xa=xa||{};ya=ya||{};if(xa.thread_id&&ya.thread_id&&ya.thread_id!==xa.thread_id)this._refreshIfReady(true);},draw:function(){var xa=this._loadingCount<=0;if(!this._initializedAds||!this._drawCount&&!xa)return;this._adjustAdsToFit();},_processOnPageUnits:function(){this._ads.init(va(this._ego));this._initializedAds=true;this._adjustAdsToFit();},_processStagedUnits:function(){this._pageletInProgress=false;var xa=va(this._stage);if(!this._lastMousedOnAds&&xa.length&&!this._focusedOnAds()){m.empty(this._ego);while(this._stage.childNodes.length)m.appendContent(this._ego,this._stage.firstChild);this._ads.init(xa);this._lastRefresh=Date.now();this._adjustAdsToFit();}},waitForAdsLoad:function(xa,ya){var za=va(xa);this._loadingCount=za.length;if(!this._loadingCount){this._lastRefresh=Date.now()-fa/2;this._pageletInProgress=false;return;}var ab=(function(bb){ua(bb);if(--this._loadingCount<=0)ya();}).bind(this);za.forEach((function(bb){function cb(){setTimeout(ab.bind(null,bb),0);}var db=m.scry(bb,'img.img')[0];if(!db||db.complete){cb();}else o.listen(db,{load:cb,error:cb,abort:cb});}).bind(this));},_adjustAdsToFit:function(){this._drawCount++;var xa=u.getViewportDimensions().y,ya=xa-this._footerHeight-ja,za=ya,ab=0;while(za>0&&ab<this._ads.getCount()){za-=ta(this._ads.getUnit(ab));if(za>=0)ab++;}ab=Math.max(ab,ia);for(var bb=0;bb<this._ads.getCount();bb++)sa(this._ads.getUnit(bb),bb>=ab);k.conditionShow(this._ego,ab);k.addClass(this._ads.getUnit(0),'ego_unit_no_top_border');var cb=m.scry(this._container,'.ego_section');cb.forEach(function(db){ra(db,m.scry(db,'[data-onscreen]').length);});ra(this._container,true);this._registerImpressions(ab);this._registerHoldoutImpressions(ya);j.inform('WebMessengerAdsControl/adjustAds');},_waitOn:function(xa,ya){ma.executeOrEnqueue(xa,ya);},_mouseEvent:function(xa){this._lastMousedOnAds=xa;},intentShown:function(){if(!v.stateRefresh)return false;var xa=h.getState();switch(xa){case ka.STATIONARY:return !v.refreshOnStationary;case ka.INTENT:case ka.HOVER:return true;default:return false;}},_focusedOnAds:function(){return m.contains(this._container,document.activeElement);},_refreshIfReady:function(xa){var ya=xa?ga:fa;if(this._lastRefresh===0){this._lastRefresh=Date.now();return;}else if(this._pageletInProgress||!this._drawCount||this._lastMousedOnAds||this._focusedOnAds()||this.intentShown()||this._lastRefresh+ya>Date.now())return;ma.reset();this._waitOn(['codes'],this.waitForAdsLoad.bind(this,this._stage,this._processStagedUnits.bind(this)));this._pageletInProgress=r.loadFromEndpoint('WebEgoPane',na,{pid:43,data:[l.getID(),ha,++oa,wa()]},{crossPage:true,bundle:false,handler:this.onLoadHandler.bind(this)});},onLoadHandler:function(){if(!v.fade)return;new i(this._container).from('opacity',0).to('opacity',1).duration(ea).go();},_updateFooterHeight:function(){k.hide(this._ego);this._footerHeight=u.getElementDimensions(this._container).y;k.show(this._ego);},_registerImpression:function(xa){var ya=this.getTrackingCodes();if(!ya||!ya[xa])return null;var za=m.create('iframe',{src:new s('/ai.php').addQueryData({aed:ya[xa]}),width:0,height:0,frameborder:0,scrolling:'no',className:'fbEmuTracking'});za.setAttribute('aria-hidden','true');m.appendContent(this._container,za);return za;},_registerImpressions:function(xa){var ya=this.getTrackingCodes(),za=pa;pa={};for(var ab=0;ab<xa;ab++){if(!this._ads.getUnit(ab))continue;var bb=m.scry(this._ads.getUnit(ab),"div._4u8");if(!bb.length)continue;var cb=bb[0].getAttribute('data-ad'),db=JSON.parse(cb).adid;if(db in za){pa[db]=za[db];delete za[db];}else{if(!ya||!ya[db])continue;var eb=this._registerImpression(db);delete ya[db];if(eb)pa[db]=eb;}}for(db in za)m.remove(za[db]);},_registerHoldoutImpressions:function(xa){var ya=this._ads.getHoldoutAdIDsForSpace(xa,ta);if(ya)ya.forEach(this._registerImpression.bind(this));},_sideBarChanged:function(xa,ya){if(xa=='sidebar/initialized')ma.setResource('sidebar',1);this._initializedAds&&this.draw();}});function ra(xa,ya){k.conditionClass(xa,"_2rn",!ya);}function sa(xa,ya){k.conditionClass(xa,"_22r",ya);xa.setAttribute('aria-hidden',ya?'true':'false');if(ya){xa.removeAttribute('data-onscreen');}else xa.setAttribute('data-onscreen','1');}function ta(xa){if(!xa)return 0;var ya=xa.getAttribute(la)||ua(xa);return parseInt(ya,10);}function ua(xa){var ya=u.getElementDimensions(xa).y;xa.setAttribute(la,ya);return ya;}function va(xa){return m.scry(xa,'div.ego_unit');}function wa(){var xa=w.getCurrentStateData();if(xa.thread_id){var ya=da.getThreadMetaNow(xa.thread_id);if(ya)return ya.participants.map(function(za){return q.getUserIDFromParticipantID(za);}).filter(function(za){return za&&za!=l.getID();});}return [];}f.exports=qa;},null);
  __d('WebMessengerApp',['Arbiter','CSS','WebMessengerDetailViewControlManager','DOM','WebMessengerMasterViewControlManager','MercuryStateCheck','WebMessengerPageTitleControl','PageTransitions','WebMessengerPermalinks','WebMessengerShortcuts','SnowflakePermalinkUtils','WebMessengerStateConstants','WebMessengerStateManager','WebMessengerStateStore','WebMessengerThreadMessagesAgent','URI','WebMessengerAdsControl','cx','WebMessengerSubscriptionsHandler','WebMessengerWidthControl','clickRefAction','WebMessengerTemplates','MercuryServerPayloadPreprocessor','MercuryThreadInformer','MercuryDeliveryState'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ba,ca){if(c.__markCompiled)c.__markCompiled();var da=c('MercuryServerPayloadPreprocessor').get(),ea=c('MercuryThreadInformer').get();c('MercuryDeliveryState').get();e(['FBRTCMessageHandler'],function(na){na.init();});var fa,ga;function ha(na,oa){var pa=oa&&oa.getQueryData().hasOwnProperty('theater'),qa=oa&&r.isPermalinkURI(oa);if(pa){fa=h.subscribe('PhotoSnowlift.CLOSE',ia.bind(null,na),h.SUBSCRIBE_NEW);return false;}else if(qa){ga=h.subscribe('PhotoSnowflake.CLOSE',ia.bind(null,na),h.SUBSCRIBE_NEW);return false;}var ra=p.processURI(oa);if(ra){var sa=t.getCurrentStateData();if(ra.redirect){p.goNextURI(ra.master_state,ra.detail_state,ra.data,ra.replace);}else t.updateStateOnURI(ra.master_state,ra.detail_state,ra.data);o.transitionComplete();na._adsControl.stateChanged(sa,t.getCurrentStateData());return true;}ma(na);return false;}function ia(na){o.registerHandler(ha.bind(null,na),6);if(fa){fa.unsubscribe();fa=null;}if(ga){ga.unsubscribe();ga=null;}}function ja(){var na=t.getCurrentStateData();u.setLastSeen(na.folder,na.thread_id);}function ka(na,oa,pa,qa,ra,sa){z.engage();ia(this);h.inform('chat/set_does_page_occlude_tabs',true,h.BEHAVIOR_PERSISTENT);h.inform('chat/set_show_tab_unread_ui',false,h.BEHAVIOR_PERSISTENT);new v();t.setStandaloneMode(sa);da.handleUpdate(oa);m.get();k.empty(na);var ta=ca[':fb:web-messenger:page-skeleton'].build();k.setContent(na,ta.getRoot());if(t.getStandaloneMode())i.addClass(document.body,"_k0_");q.registerGeneralShortcuts();this._masterViewManager=new l(ta.getNode('masterView'));this._detailViewManager=new j(ta.getNode('detailView'));this._pageTitleControl=new n();qa&&k.prependContent(ta.getRoot(),qa);if(t.getStandaloneMode()){this._widthControl=null;this._masterViewManager.resizeTo(null);this._detailViewManager.resizeTo(null);}else this._widthControl=new aa(this._masterViewManager.resizeTo.bind(this._masterViewManager),this._detailViewManager.resizeTo.bind(this._detailViewManager),ra);this._adsControl=x.init();var ua=pa?new w(pa):p.getDefaultURI();ha(this,ua);ba('web_messenger').set_namespace('web_messenger');z.addSubscriptions(ea.subscribe('threads-deleted',function(va,wa){var xa=t.getCurrentStateData().thread_id,ya=t.getCurrentDetailState();if(ya==s.DETAIL.RECENT_MESSAGES&&wa[xa]){t.updateDetailState(s.DETAIL.RECENT_MESSAGES,{thread_id:null});}else ja();}),t.subscribe(s.STATE_CHANGE_EVENT,ja));e(['MercuryBrowserAlerts'],function(va){z.addSubscriptions(ea.subscribe('messages-received',function(wa,xa){for(var ya in xa){var za=xa[ya];for(var ab=0;ab<za.length;ab++)va.messageReceived(za[ab]);}}));va.subscribe('before-alert',function(wa,event){if(event.threadID==la())event.cancelAlert();});});}function la(){var na=t.getCurrentDetailState(),oa=t.getCurrentStateData();if(na==s.DETAIL.RECENT_MESSAGES||na==s.DETAIL.SEARCH_CONTEXT)return oa.thread_id;return null;}function ma(na){var oa=true;e(['ChatTabActions'],function(pa){oa&&pa.persistLocalState();});z.release();h.inform('chat/set_does_page_occlude_tabs',false,h.BEHAVIOR_PERSISTENT);h.inform('chat/set_show_tab_unread_ui',true,h.BEHAVIOR_PERSISTENT);na._masterViewManager.destroy();na._detailViewManager.destroy();oa=false;}f.exports=ka;},null);
  __d('WebMessengerDetailViewCallButtonManagerImpl',['BanzaiLogger','CurrentUser','FBRTCCallabilityStore','FBRTCCore','FBRTCLogger','MercuryIDs','MercuryParticipants','Tooltip','invariant'],function a(b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){if(c.__markCompiled)c.__markCompiled();'use strict';var q={onCallClicked:function(r){h.log('VideoCallLoggerConfig',{event:'web_messenger_call_click'});var s=m.getUserIDFromThreadID(r);!s?p(0):undefined;k.startOutgoingCall(s,l.Trigger.WEB_MESSENGER,false);},isVideoCallableThread:function(r){if(r){var s=m.getUserIDFromThreadID(r);if(s&&s!==i.getID())return true;}return false;},updateVideoCallButton:function(r,s){if(!s||!q.isVideoCallableThread(s))return;var t=m.getUserIDFromThreadID(s);!t?p(0):undefined;r.disabled=!j.isCallable(t);n.get(m.getParticipantIDFromUserID(t),function(u){o.set(r,j.callButtonTooltip(t,u.short_name));});}};f.exports=q;},null);