if (self.CavalryLogger) { CavalryLogger.start_js(["66+69"]); }

__d("MessagingRealtimeConstants",[],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={VIEWER_FBID:"realtime_viewer_fbid"};}),null);
__d('AjaxRequest',['ErrorUtils','Keys','PHPQuerySerializer','TimeSlice','URI','UserAgent_DEPRECATED','ZeroRewrites','setTimeoutAcrossTransitions'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(l,m,n){if(!(m instanceof c('URI')))m=new (c('URI'))(m);this.xhr=c('ZeroRewrites').getTransportBuilderForURI(m)();if(n&&l=='GET'){m.setQueryData(n);}else this._params=n;this.method=l;this.uri=m;this.xhr.open(l,m);}var i=window.XMLHttpRequest&&'withCredentials' in new XMLHttpRequest();h.supportsCORS=function(){return i;};h.ERROR='ar:error';h.TIMEOUT='ar:timeout';h.PROXY_ERROR='ar:proxy error';h.TRANSPORT_ERROR='ar:transport error';h.SERVER_ERROR='ar:http error';h.PARSE_ERROR='ar:parse error';h.SERVICE_UNAVAILABLE='ar:noservice';h._inflight=[];function j(){var l=h._inflight;h._inflight=[];l.forEach(function(m){m.abort();});}function k(l){l.onJSON=l.onError=l.onSuccess=null;clearTimeout(l._timer);if(l.xhr&&l.xhr.readyState<4){l.xhr.abort();l.xhr=null;}h._inflight=h._inflight.filter(function(m){return m&&m!=l&&m.xhr&&m.xhr.readyState<4;});}Object.assign(h.prototype,{timeout:60000,streamMode:true,prelude:/^for \(;;\);/,status:null,_eol:-1,_call:function l(m){if(this[m])this[m](this);},_parseStatus:function l(){var m;try{this.status=this.xhr.status;m=this.xhr.statusText;}catch(n){if(this.xhr.readyState>=4){this.errorType=h.TRANSPORT_ERROR;this.errorText=n.message;}return;}if(this.status===0&&!/^(file|ftp)/.test(this.uri)){this.errorType=h.TRANSPORT_ERROR;}else if(this.status>=100&&this.status<200){this.errorType=h.PROXY_ERROR;}else if(this.status>=200&&this.status<300){return;}else if(this.status>=300&&this.status<400){this.errorType=h.PROXY_ERROR;}else if(this.status>=400&&this.status<500){this.errorType=h.SERVER_ERROR;}else if(this.status===503){this.errorType=h.SERVICE_UNAVAILABLE;}else if(this.status>500&&this.status<600){this.errorType=h.PROXY_ERROR;}else if(this.status==1223){return;}else if(this.status>=12001&&this.status<=12156){this.errorType=h.TRANSPORT_ERROR;}else{m='unrecognized status code: '+this.status;this.errorType=h.ERROR;}if(!this.errorText)this.errorText=m;},_parseResponse:function l(){var m,n=this.xhr.readyState;try{m=this.xhr.responseText||'';}catch(o){if(n>=4){this.errorType=h.ERROR;this.errorText='responseText not available - '+o.message;}return;}while(this.xhr){var p=this._eol+1,q=this.streamMode?m.indexOf('\n',p):m.length;if(q<0&&n==4)q=m.length;if(q<=this._eol)break;var r=m;if(this.streamMode)r=m.substr(p,q-p).replace(/^\s*|\s*$/g,'');if(p===0&&this.prelude)if(this.prelude.test(r))r=r.replace(this.prelude,'');this._eol=q;if(r){try{this.json=JSON.parse(r);}catch(o){var s=/(<body[\S\s]+?<\/body>)/i.test(m)&&RegExp.$1,t={message:o.message,'char':p,excerpt:(p===0&&s||r).substr(512)};this.errorType=h.PARSE_ERROR;this.errorText='parse error - '+JSON.stringify(t);return;}c('ErrorUtils').applyWithGuard(this._call,this,['onJSON']);}}},_onReadyState:function l(){var m=this.xhr&&this.xhr.readyState||0;if(this.status==null&&m>=2)this._parseStatus();if(!this.errorType&&this.status!=null)if(m==3&&this.streamMode||m==4)this._parseResponse();if(this.errorType||m==4){this._time=Date.now()-this._sentAt;this._call(!this.errorType?'onSuccess':'onError');k(this);}},send:function l(m){this.xhr.onreadystatechange=c('TimeSlice').guard(this._onReadyState.bind(this),'AjaxRequest xhr.onreadystatechange');var n=this.timeout;if(n)this._timer=c('setTimeoutAcrossTransitions')(function(){this.errorType=h.TIMEOUT;this.errorText='timeout';this._time=Date.now()-this._sentAt;this._call('onError');k(this);}.bind(this),n);h._inflight.push(this);if(this.method=='POST')this.xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');this._sentAt=Date.now();this.xhr.send(m?c('PHPQuerySerializer').serialize(m):'');},abort:function l(){k(this);},toString:function l(){var m='[AjaxRequest readyState='+this.xhr.readyState;if(this.errorType)m+=' errorType='+this.errorType+' ('+this.errorText+')';return m+']';},toJSON:function l(){var m={json:this.json,status:this.status,errorType:this.errorType,errorText:this.errorText,time:this._time};if(this.errorType)m.uri=this.uri;for(var n in m)if(m[n]==null)delete m[n];return m;}});if(window.addEventListener&&c('UserAgent_DEPRECATED').firefox())window.addEventListener('keydown',function(event){if(event.keyCode===c('Keys').ESC)event.prevent();},false);if(window.attachEvent)window.attachEvent('onunload',j);f.exports=h;}),null);
__d('ChannelSubdomain',['Event','JSLogger','Run','LogHistory','setTimeoutAcrossTransitions','WebStorage'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('LogHistory').getInstance('channel'),i=c('JSLogger').create('channel'),j='channel_sub:',k=7,l=100*1000,m=null,n;function o(){var q=c('WebStorage').getLocalStorage();if(n){clearTimeout(n);n=null;}if(q&&m!=null)q.removeItem(j+m);m=null;}function p(q,r,s){var t,u=(q-1)*k;if(s){if(n)clearTimeout(n);m=n=null;}if(r==null)r=Math.floor(Math.random()*u);if(m==null){var v,w,x,y,z,aa,ba;(function(){var ca=c('WebStorage').getLocalStorage();if(ca){v=[];for(w=0;w<ca.length;w++){x=ca.key(w);if(x.indexOf(j)===0){y=parseInt(x.substr(j.length),10);v[y]=parseInt(ca.getItem(x),10);}}z=Date.now()-l;for(w=0;w<u;w++){aa=(w+r)%u;if(!v[aa]||v[aa]<z){m=aa;break;}}if(m!=null){ba=function da(){try{ca.setItem(j+m,Date.now());}catch(ea){h.warn('subdomain set failed',ea.message);}n=c('setTimeoutAcrossTransitions')(ba,l/2);};ba();}else{h.warn('no channel subdomain',v);i.error('subdomain_overflow');}if(typeof window.onpageshow!='undefined'){c('Event').listen(window,'pagehide',o);}else c('Run').onUnload(o);}else m=r;})();}return m==null?null:m%k;}f.exports={allocate:p,clear:o};}),null);
__d('DocRPC',['ErrorUtils'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={_apis:{},_dispatch:function i(j){var k;try{j=JSON.parse(j);}catch(l){throw new Error('DocRPC unparsable dispatch: "'+j+'"');}if(h._apis.hasOwnProperty(j.api)){var m=h._apis[j.api];if(m[j.method])k=c('ErrorUtils').applyWithGuard(m[j.method],m,j.args);}if(k===undefined)k=null;return JSON.stringify(k);},publish:function i(j,k){h._apis[k]=j;},proxy:function i(j,k,l){var i={};l.forEach(function(m){i[m]=function(){var n={api:k,method:m,args:Array.prototype.slice.call(arguments)},o;try{if(j.closed)throw new Error('DocRPC window closed');o=j.DocRPC._dispatch(JSON.stringify(n));}catch(p){c('ErrorUtils').reportError(p);return;}if(typeof o=='string')try{o=JSON.parse(o);}catch(p){throw new Error('DocRPC '+k+'.'+m+' unparsable return: "'+o+'"');}return o;};});return i;}};f.exports=b.DocRPC=h;}),null);
__d('ChannelTransport',['AjaxRequest','ChannelConstants','DocRPC','LogHistory','TimeSlice','URI','bind','setTimeoutAcrossTransitions','BanzaiODS'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('LogHistory').getInstance('channel');function i(){return (1048576*Math.random()|0).toString(36);}function j(u){return !isNaN(u)&&isFinite(u)&&0<=u&&u<=6;}function k(u,v){var w='';if(j(u.subdomain))w=u.subdomain+'-';var x=u.host;x=x===null||x===undefined?'edge-chat':u.host;var y=new (c('URI'))(v).setDomain(w+x+'.'+u.domain).setPort(u.port).setSecure(new (c('URI'))(window.location.href).isSecure());return y;}function l(u){var v={partition:u.partition,cb:i(),failure:u.pingFailuresOnSubdomain};if(u.sticky_token)v.sticky_token=u.sticky_token;if(u.sticky_pool)v.sticky_pool=u.sticky_pool;var w=k(u,'/p').setQueryData(v);h.log('start_p',{uri:w.toString()});var x=new (c('AjaxRequest'))('GET',w);if(c('AjaxRequest').supportsCORS())x.xhr.withCredentials=true;var y=function z(aa){h.log('finish_p',{xhr:aa.toJSON?aa.toJSON():aa,subdomain:u.subdomain,fullHost:u.fullHost});};x.onError=function(z){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendP.error');y(z);if(u.subdomain===null)return;if(j(u.subdomain)){u.pingFailuresOnSubdomain++;u.subdomain++;if(u.subdomain>6)u.subdomain=0;}};x.timeout=u.P_TIMEOUT;x.onSuccess=function(z){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendP.success');y(z);};x.send();}function m(u,v,w){var x=new Image(),y=0,z=function ca(da){x.abort();return da?v():w();};x.onload=c('TimeSlice').guard(function(){h.log('ping_ok',{duration:Date.now()-y});c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPing.success');z(true);},'ChannelTransport image.onload');x.onerror=c('TimeSlice').guard(function(){l(u);c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPing.error');z(false);},'ChannelTransport image.onerror');var aa=c('setTimeoutAcrossTransitions')(x.onerror,10000);x.abort=function(){if(aa){clearTimeout(aa);aa=null;}x.onload=x.onerror=null;};var ba={partition:u.partition,cb:i()};if(u.sticky_token)ba.sticky_token=u.sticky_token;if(u.sticky_pool)ba.sticky_pool=u.sticky_pool;if(u.lastRequestErrorReason){ba.reason=u.lastRequestErrorReason;u.lastRequestErrorReason=null;}if(u.uid&&u.viewerUid){ba.uid=u.uid;ba.viewer_uid=u.viewerUid;}y=Date.now();x.src=k(u,'/ping').setQueryData(ba);return x;}function n(u,v){var w={channel:u.user_channel,partition:u.partition,clientid:u.sessionID,cb:i(),cap:0,uid:u.uid,viewer_uid:u.viewerUid};if(u.sticky_token)w.sticky_token=u.sticky_token;if(u.sticky_pool)w.sticky_pool=u.sticky_pool;if(u.profile)w.profile=u.profile;if(u.capabilities)w.cap=u.capabilities;w.id=v;var x=k(u,'/add_bud').setQueryData(w),y=new (c('AjaxRequest'))('GET',x);if(c('AjaxRequest').supportsCORS())y.xhr.withCredentials=true;y.onError=function(z){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendAdditionalBuddy.error');h.warn('add_buddy_error');};y.onSuccess=function(z){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendAdditionalBuddy.success');h.log('add_buddy_ok');};y.timeout=u.P_TIMEOUT;y.send();}function o(u){var v={channel:u.user_channel,partition:u.partition,clientid:u.sessionID,cb:i(),cap:0,uid:u.uid,viewer_uid:u.viewerUid};if(u.sticky_token)v.sticky_token=u.sticky_token;if(u.sticky_pool)v.sticky_pool=u.sticky_pool;if(u.is_offline||u.shouldSuppressPresence){v.state='offline';}else v.state='active';if(v.state===u.lastPresenceState)return;u.lastPresenceState=v.state;if(u.profile)v.profile=u.profile;if(u.capabilities)v.cap=u.capabilities;var w=k(u,'/active_ping').setQueryData(v),x=new (c('AjaxRequest'))('GET',w);if(c('AjaxRequest').supportsCORS())x.xhr.withCredentials=true;x.onError=function(y){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendActivePing.error');h.warn('active_ping_error');};x.onSuccess=function(y){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendActivePing.success');h.log('active_ping_ok');};x.timeout=u.P_TIMEOUT;x.send();}function p(u,v,w,x){var y=new Date(),z=-1;if(u.userActive>0){z=(y-u.userActive)/1000|0;if(z<0)h.warn('idle_regression',{idleTime:z,now:y.getTime(),userActive:u.userActive});}var aa={channel:u.user_channel,seq:u.seq,partition:u.partition,clientid:u.sessionID,cb:i(),idle:z,qp:'y',cap:0};if(u.state.aiq)aa.aiq=u.state.aiq;if(u.ready)if(u.seqTurSentAt==-1||u.seqTurSentAt==u.seq){aa.tur=u.timeUntilReady;aa.qpmade=u.queueMade;u.seqTurSentAt=u.seq;}aa.pws=u.pws;if(u.sequenceId>0)aa.isq=u.sequenceId;aa.msgs_recv=u.estimatedReceived;if(u.uid&&u.viewerUid){aa.uid=u.uid;aa.viewer_uid=u.viewerUid;}if(u.sticky_token){aa.sticky_token=u.sticky_token;}else{aa.request_batch=1;if(u.msgr_region)aa.msgr_region=u.msgr_region;}if(u.sticky_pool)aa.sticky_pool=u.sticky_pool;if('trace_id' in u)aa.traceid=u.trace_id;if(u.is_offline||u.shouldSuppressPresence){aa.state='offline';}else if(u.userActive>0&&z<60)aa.state='active';u.lastPresenceState=aa.state;if(u.streamingCapable){aa.mode='stream';aa.format='json';}if(u.profile)aa.profile=u.profile;if(u.capabilities)aa.cap=u.capabilities;var ba=k(u,'/pull').setQueryData(aa),ca='GET',da=new (c('AjaxRequest'))(ca,ba);if(c('AjaxRequest').supportsCORS())da.xhr.withCredentials=true;da.timeout=u.streamingCapable?u.STREAMING_TIMEOUT:u.LONGPOLL_TIMEOUT;da.onJSON=function(ea){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPull.json');v(ea);};da.onSuccess=function(ea){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPull.success');w(ea);};da.onError=function(){var ea=this.status==12002&&this._time>=u.MIN_12002_TIMEOUT||this.status==504&&this._time>=u.MIN_504_TIMEOUT,fa=ea?w:x;if(ea){c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPull.success');}else c('BanzaiODS').bumpEntityKey('ChannelTransport','sendPull.error');return fa&&fa.apply(this,arguments);};da.send();u.inStreaming=u.streamingCapable;return da;}function q(u){this.manager=u;this.init&&this.init();}function r(u){q.apply(this,arguments);}Object.assign(r.prototype,{logName:'CORS',enterState:function u(v,w){if(this._request){this._request.abort();this._request=null;}if(v=='init')c('setTimeoutAcrossTransitions')(c('bind')(this.manager,'exitState',{status:c('ChannelConstants').OK,stateId:w.stateId}),0);if(!/pull|ping/.test(v))return;var x=this.manager;if(v=='ping'){this._request=m(w,c('bind')(x,'exitState',{status:c('ChannelConstants').OK,stateId:w.stateId}),c('bind')(x,'exitState',{status:c('ChannelConstants').ERROR,stateId:w.stateId}));}else if(v=='pull')this._request=p(w,c('bind')(x,'_processTransportData',w.stateId),c('bind')(x,'exitState',{status:c('ChannelConstants').OK,stateId:w.stateId}),c('bind')(x,'exitState',{status:c('ChannelConstants').ERROR,stateId:w.stateId}));}});function s(u){h.log('iframe_init_constructor');q.apply(this,arguments);this._iframe=document.createElement('iframe');this._iframe.style.display='none';document.body.appendChild(this._iframe);c('DocRPC').publish(this,'outerTransport');}Object.assign(s.prototype,{logName:'iframe',_initIframe:function u(v){h.log('iframe_init_start');window.onchanneliframeready=function(){h.log('iframe_resources');return v.resources;};window.onchanneliframeloaded=function(){h.log('iframe_loaded');};if(v){this._iframeURI=k(v,v.path);if(v.resources){var w=this._iframeURI.getDomain();v.resources=v.resources.map(function(y){var z=new (c('URI'))(y);if(z.getPath().startsWith('/intern/rsrc.php')&&z.getQueryData().origin!==undefined)return z.addQueryData('origin',w).toString();return y;});}}else this._iframeURI='about:blank';this._iframeProxy=null;try{this._iframe.contentWindow.location.replace(this._iframeURI);h.log('iframe_uri_set');}catch(x){h.error('iframe_uri_set_error',x);this.exitState({status:c('ChannelConstants').ERROR,stateId:v.stateId},x+'');}},enterState:function u(v,w){if(v=='init'){this._initIframe(w);}else if(/idle|ping|pull/.test(v)){if(this._iframeProxy){this._iframeProxy.enterState.apply(this._iframeProxy,arguments);}else if(v!='idle')this.exitState({status:c('ChannelConstants').ERROR,stateId:w.stateId},'iframe not yet loaded');}else if(v=='shutdown')this._initIframe();},_processTransportData:function u(){this.manager._processTransportData.apply(this.manager,arguments);},exitState:function u(v){if(this.manager.state=='init'&&v.status==c('ChannelConstants').OK)this._iframeProxy=c('DocRPC').proxy(this._iframe.contentWindow,'innerTransport',['enterState'],(this._iframeURI+'').replace(/iframe.*/,''));if(/ping|pull/.test(this.manager.state)&&!this._iframeProxy)return;this.manager.exitState.apply(this.manager,arguments);}});function t(){this.init=this.init.bind(this);q.apply(this,arguments);}Object.assign(t.prototype,{logName:'iframe(inner)',init:function u(){c('DocRPC').publish(this,'innerTransport');try{var w=c('DocRPC').proxy(window.parent,'outerTransport',['_processTransportData','exitState'],top.DocRPC.origin);Object.assign(this,w);this.exitState({status:c('ChannelConstants').OK,stateId:1e+06});}catch(v){h.error('iframe_inner_init_error',v);}},enterState:function u(v,w){if(this._request){this._request.abort();this._request=null;}if(v=='ping'){this._request=m(w,c('bind')(this,'exitState',{status:c('ChannelConstants').OK,stateId:w.stateId}),c('bind')(this,'exitState',{status:c('ChannelConstants').ERROR,stateId:w.stateId}));}else if(v=='pull')this._request=p(w,c('bind')(this,'_processTransportData',w.stateId),c('bind')(this,'exitState',{status:c('ChannelConstants').OK,stateId:w.stateId}),c('bind')(this,'exitState',{status:c('ChannelConstants').ERROR,stateId:w.stateId}));}});f.exports={isSubdomain:j,getURI:k,Transport:q,CORSTransport:r,IframeTransport:s,IframeInnerTransport:t,sendActivePing:o,sendAdditionalBuddyRequest:n};}),null);
__d('ChannelTransportDataLogger',['Arbiter','JSLogger','MercuryLoggingHelper'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=[],i=10,j=function l(m){return m.map(function(n){var o=n;if(n.message||n.delta&&n.delta.body){o=babelHelpers['extends']({},n);if(n.message)o.message=c('MercuryLoggingHelper').obfuscateMessage(n.message);if(n.delta&&n.delta.body)o.delta=c('MercuryLoggingHelper').obfuscateMessage(n.delta);}return o;});},k={log:function l(m){var n={t:m.t,seq:m.seq};if(m.ms)n.ms=j(m.ms);h.push(n);if(h.length>i)h.shift();}};c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(l,m){m.channelTransportLog=h;});f.exports=k;}),null);
__d('ChatProxyConnectionState',[],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(){this.auxiliaryIrisQueues={};this.aiq=null;}h.prototype.subscribeIrisQueue=function(i,j){this.auxiliaryIrisQueues[i]=j;this.updateCaches();};h.prototype.unsubscribeIrisQueue=function(i){delete this.auxiliaryIrisQueues[i];this.updateCaches();};h.prototype.updateCaches=function(){var i=[];for(var j in this.auxiliaryIrisQueues)if(this.auxiliaryIrisQueues.hasOwnProperty(j)){i.push(j);i.push(this.auxiliaryIrisQueues[j]);}if(i.length===0){this.aiq=null;}else this.aiq=i.join(',');};f.exports=h;}),null);
__d('FBAjaxRequest',['AjaxRequest','getAsyncParams'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i,j,k){k=babelHelpers['extends']({},c('getAsyncParams')(i),k);var l=new (c('AjaxRequest'))(i,j,k);l.streamMode=false;var m=l._call;l._call=function(n){if(n=='onJSON'&&this.json){if(this.json.error){this.errorType=c('AjaxRequest').SERVER_ERROR;this.errorText='AsyncResponse error: '+this.json.error;}this.json=this.json.payload;}m.apply(this,arguments);};l.ajaxReqSend=l.send;l.send=function(n){this.ajaxReqSend(babelHelpers['extends']({},n,k));};return l;}f.exports=h;}),null);
__d('FantailLogger',['FantailConfig'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('FantailConfig').FantailLogQueue,i={debug:function j(k,l){var m;for(var n=arguments.length,o=Array(n>2?n-2:0),p=2;p<n;p++)o[p-2]=arguments[p];h&&(m=h.get(k)).debug.apply(m,[l].concat(o));},info:function j(k,l){var m;for(var n=arguments.length,o=Array(n>2?n-2:0),p=2;p<n;p++)o[p-2]=arguments[p];h&&(m=h.get(k)).info.apply(m,[l].concat(o));},warn:function j(k,l){var m;for(var n=arguments.length,o=Array(n>2?n-2:0),p=2;p<n;p++)o[p-2]=arguments[p];h&&(m=h.get(k)).warn.apply(m,[l].concat(o));},error:function j(k,l){var m;for(var n=arguments.length,o=Array(n>2?n-2:0),p=2;p<n;p++)o[p-2]=arguments[p];h&&(m=h.get(k)).error.apply(m,[l].concat(o));}};f.exports=i;}),null);
__d("MovingStat",[],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();function h(i){i=i||60000;var j={t:new Date(),count:0,v:0},k=j,l=0,m=0;function n(){var o=new Date()-i;while(k&&k.next&&k.t<o){l-=k.v;m-=k.count;k=k.next;}}this.add=function(o){l+=o;m++;var p=new Date();if(p-j.t<1000){j.v+=o;j.count++;}else{j.next={t:p,v:o,count:1};j=j.next;n();}};this.tally=function(o){o=o||1000;n();return {sum:l,count:m,timeAverage:l*o/i};};}f.exports=h;}),null);
__d('RTISession',['invariant','URI','AjaxRequest','ErrorUtils'],(function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i='.facebook.com';function j(k,l,m,n,o,p,q,r,s){!k?h(0):void 0;!n?h(0):void 0;!o?h(0):void 0;this.domain=k;this.port=l;this.edgePoolName=m;this.stickyToken=n;this.loggedInId=o;this.accountId=p;this.clientProfile=q||'desktop';this.clientId=r;this.capabilities=s;}j.prototype.issueRequest=function(k,l,m,n,o){!k?h(0):void 0;!l?h(0):void 0;!n?h(0):void 0;var p=this.domain.length-i.length,q=p>0&&this.domain.indexOf(i,p)!==-1,r=q?this.domain:this.domain+i,s=(1048576*Math.random()|0).toString(36),t={cb:s,sticky_token:this.stickyToken,uid:this.loggedInId,viewer_uid:this.accountId,sticky_pool:this.edgePoolName,profile:this.clientProfile,clientid:this.clientId,cap:this.capabilities};for(var u in t)!!l[u]?h(0):void 0;Object.assign(t,l);var v=new (c('URI'))(k).setDomain(r).setPort(this.port).setSecure(new (c('URI'))(window.location.href).isSecure()).setQueryData(t),w=m?'POST':'GET',x=new (c('AjaxRequest'))(w,v);x.timeout=o?o*1000:30000;if(x.xhr)x.xhr.withCredentials=true;var y={};x.onSuccess=function(){};x.onJSON=function(){y.data=x.json;y.error=null;c('ErrorUtils').applyWithGuard(n,this,[y]);}.bind(this);x.onError=function(){y.data=null;y.error=x.errorType||'error';c('ErrorUtils').applyWithGuard(n,this,[y]);}.bind(this);x.send(JSON.stringify(m));};f.exports=j;}),null);
__d('ChannelManager',['errorCode','Promise','AjaxRequest','Arbiter','AsyncRequest','ChannelClientID','ChannelConstants','ChannelInitialData','ChannelSubdomain','ChannelTransport','ChannelTransportDataLogger','ChatVisibility','ChatReliabilityInstrumentation','DTSG','Env','FantailLogger','FBAjaxRequest','FBRTCSupport','ISB','JSLogger','LogHistory','MessagingRealtimeConstants','MovingStat','PresenceCookieManager','PresenceState','PresenceUtil','RTISession','SystemEvents','URI','UserActivity','ChatProxyConnectionState','emptyFunction','requestAnimationFrameAcrossTransitions','setIntervalAcrossTransitions','setTimeoutAcrossTransitions'],(function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i,j=c('JSLogger').create('channel'),k=c('LogHistory').getInstance('channel_manager'),l=null,m=c('emptyFunction'),n=new (c('Promise'))(function(aa,ba){m=aa;});function o(aa){l=aa;}var p={idle:{ok:'init!'},init:{ok:'pull!',error:'reconnect',sys_online:'init',sys_timetravel:'init'},pull:{ok:'pull!',error:'ping',error_missing:'pull',error_msg_type:'pull',refresh_0:'reconnect',refresh_110:'reconnect',refresh_111:'reconnect',refresh_112:'pull',refresh_113:'pull',refresh_117:'reconnect'},ping:{ok:'pull!',error:'ping',error_stale:'reconnect!'},reconnect:{ok:'init!',error:'reconnect',sys_online:'reconnect',sys_timetravel:'reconnect'},shutdown:{},_all:{error_max:'shutdown!',error_shutdown:'shutdown!',sys_owner:'reconnect',sys_nonowner:'idle!',sys_online:'ping',sys_offline:'idle!',sys_timetravel:'ping'}},q={state:new (c('ChatProxyConnectionState'))(),userActive:Date.now(),created:Date.now(),ready:false,seqTurSentAt:-1,queueMade:'',sequenceId:0,lastPresenceState:null,lastRequestErrorReason:null,seq:0,pingFailuresOnSubdomain:0,pws:'fresh',estimatedReceived:0,sessionID:c('ChannelClientID').getID(),capabilities:c('FBRTCSupport').getCapabilities(),streamingCapable:false,inStreaming:false,shouldSuppressPresence:c('PresenceState').shouldSuppress(),LONGPOLL_TIMEOUT:60000,STREAMING_TIMEOUT:60000,P_TIMEOUT:30000,IFRAME_LOAD_TIMEOUT:30000,MIN_RETRY_INTERVAL:5000,MAX_RETRY_INTERVAL:320000,MIN_12002_TIMEOUT:9000,MIN_504_TIMEOUT:20000,STALL_THRESHOLD:180000,JUMPSTART_THRESHOLD:90000,MIN_INIT_PROBE_DELAY:3000,INIT_PROBE_DELAY_RANDOMIZE_RANGE:12000,CHANNEL_PROXY_REPORTING_MIN_INTERVAL:10000,PROBE_DELAY:60000,PROBE_HEARTBEATS_INTERVAL_LOW:1000,PROBE_HEARTBEATS_INTERVAL_HIGH:5000,STREAMING_EXIT_STATE_ON_CONTINUE:false},r=1,s={},t=0;function u(){return c('AsyncRequest').lastSuccessTime?Math.round((Date.now()-c('AsyncRequest').lastSuccessTime)/1000):-1;}function v(){var aa={};if(i.getConfig('host'))aa[i.getConfig('user_channel')]=i.getConfig('seq',0);return aa;}function w(){var aa=Date.now(),ba=Date.now(),ca={total:0},da='idle',ea=false;c('SystemEvents').subscribe([c('SystemEvents').USER,c('SystemEvents').ONLINE,c('SystemEvents').TIME_TRAVEL],function(ha,ia){x(true);ba=null;i.lastPullTime=Date.now();var ja;switch(ha){case c('SystemEvents').USER:ja=c('SystemEvents').isPageOwner()?c('ChannelConstants').SYS_OWNER:c('ChannelConstants').SYS_NONOWNER;break;case c('SystemEvents').ONLINE:ja=ia?c('ChannelConstants').SYS_ONLINE:c('ChannelConstants').SYS_OFFLINE;break;case c('SystemEvents').TIME_TRAVEL:if(0<ia&&ia<180000&&q.reduceTimeTravel){c('FantailLogger').warn(c('ChannelConstants').FANTAIL_SERVICE,'skipping time travel failure. %s',ia);return;}ja=c('ChannelConstants').SYS_TIMETRAVEL;break;}i.exitState({status:ja,stateId:r});});var fa=function ha(ia,ja){var ka=Date.now(),la=null;if(ja){aa=ka;la=ja.nextState||ja.state;}else la=da;c('SystemEvents').checkTimeTravel();if(ba){var ma=Math.round((ka-ba)/1000);if(ma>0){ca[da]=(ca[da]||0)+ma;ca.total+=ma;}}da=la;ba=ka;if(!ia){ca.lastSuccessTime=u();ca.online=c('SystemEvents').isOnline();k.log('rollup',JSON.stringify(ca));}};c('Arbiter').subscribe(c('ChannelConstants').ON_ENTER_STATE,fa);c('setIntervalAcrossTransitions')(fa,60000);c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(ha,ia){ia.channelRollup=ca;});var ga=function ha(){if(i.isShutdown()||i.shouldIdle())return;c('SystemEvents').checkTimeTravel();var ia=Date.now()-(i.lastPullTime||c('Env').start);if(!ea&&ia>q.STALL_THRESHOLD){var ja=u();k.error('stall',JSON.stringify({lastSuccessTime:ja,rollupState:da}));c('ChatReliabilityInstrumentation').logCHANNEL_STALLED(ia.toString());ea=true;}var ka=Date.now()-aa;if(i.state=='pull'&&ka>q.JUMPSTART_THRESHOLD){aa=null;k.warn('jumpstart',JSON.stringify({state:i.state,dormant:ka}));i.enterState('init');}};c('setIntervalAcrossTransitions')(ga,5000);}function x(aa){if(aa){t=0;s={};}else t++;}function y(aa,ba){var ca=!c('AjaxRequest').supportsCORS()||q.forceIframe;if(!q.hasOwnProperty('host'))c('ChatReliabilityInstrumentation').logERROR('channel: no host in config');var da=c('ChannelTransport').isSubdomain(q.subdomain);if(!da||ca){q.fullHost=q.host;}else q.fullHost=q.subdomain+'-'+q.host;c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'received lb info: %s at seq: %s{%s} with '.concat('sticky: %s/%s, subdomain: %s, fullHost: %s, state: %s,').concat(' source: %s, args: %s'),q.sessionID,q.seq,q.sequenceId,q.sticky_token,q.sticky_pool,q.subdomain,q.fullHost,i.state,aa,ba);}i={state:'idle',nextState:null,proxyDown:false,lastPullTime:Date.now(),lastReportOnMisguidedMsgTime:Date.now(),heartbeats:[],setTestCallback:o,backoff:false,sessionRegistered:false,init:function aa(ba,ca){c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'initializing sessionid:%s at iris-seq:%s',q.sessionID,q.sequenceId);this.init=c('emptyFunction');c('Arbiter').subscribe(c('ChannelConstants').GET_RTI_SESSION_REQUEST,function(event,ga){this.informCurrentSession();}.bind(this));c('requestAnimationFrameAcrossTransitions')(function(){c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'using session id: %s at seq: %s {%s} with sticky: %s/%s',q.sessionID,q.seq,q.sequenceId,q.sticky_token,q.sticky_pool);c('UserActivity').subscribe(function(){var ga=c('ChannelTransport').getURI(q,'/U');c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'user activity sessionid: %s at seq: %s/{%s} '+'with sticky: %s/%s state: %s uri:%s',q.sessionID,q.seq,q.sequenceId,q.sticky_token,q.sticky_pool,i.state,ga);if(i.state=='pull'){q.userActive=Date.now();c('ChannelTransport').sendActivePing(q);}});});c('PresenceCookieManager').register('ch',v);var da=this.getConfig('max_conn',2);q.subdomain=c('ChannelSubdomain').allocate(da);if(!c('ChannelTransport').isSubdomain(q.subdomain)){c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'invalid subdomain from ChannelSubdomain: %s',q.subdomain);q.subdomain=null;}this._transportRate=new (c('MovingStat'))(30000);var ea=c('AjaxRequest').supportsCORS()&&!q.forceIframe?'CORSTransport':'IframeTransport';this.transport=new (c('ChannelTransport')[ea])(this);m(this.transport);if(ba)this.enterState(ba,ca);c('requestAnimationFrameAcrossTransitions')(function(){c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(event,ga){if(this._transportRate){ga.transportRate=this._transportRate.tally();ga.transportType=ea;ga.transportVersion=2;}}.bind(this));w();}.bind(this));if(i.getConfig('tryStreaming')&&i.getConfig('fullHost')&&c('AjaxRequest').supportsCORS()&&!q.forceIframe){var fa=q.MIN_INIT_PROBE_DELAY+Math.random()*q.INIT_PROBE_DELAY_RANDOMIZE_RANGE;c('setTimeoutAcrossTransitions')(this._probeTest,fa);}},configure:function aa(){for(var ba=arguments.length,ca=Array(ba),da=0;da<ba;da++)ca[da]=arguments[da];k.log('configure',JSON.stringify(ca));ca.forEach(function(ea){return Object.assign(q,ea);});y('reconnect',JSON.stringify(ca));c('Arbiter').inform(c('ChannelConstants').ON_CONFIG,this);},getConfig:function aa(ba,ca){return q.hasOwnProperty(ba)?q[ba]:ca;},getCompleteConfig:function aa(){return q;},subscribeIrisQueue:function aa(ba,ca){q.state.subscribeIrisQueue(ba,ca);this.exitState({status:c('ChannelConstants').OK,stateId:r});},unsubscribeIrisQueue:function aa(ba){q.state.unsubscribeIrisQueue(ba);},informCurrentSession:function aa(){var ba=null;if(this.sessionRegistered&&q&&q.fullHost&&q.sticky_token&&q.uid)ba=new (c('RTISession'))(q.fullHost,q.port,q.sticky_pool,q.sticky_token,q.uid,q.viewerUid,q.profile,q.sessionID,q.capabilities);c('Arbiter').inform(c('ChannelConstants').RTI_SESSION,ba);},isShutdown:function aa(){return this.state=='shutdown';},shouldIdle:function aa(){return !(c('SystemEvents').isPageOwner()&&c('SystemEvents').isOnline());},_sendIframeError:function aa(ba){var ca=new (c('AsyncRequest'))().setURI('/ajax/presence/reconnect.php').setData({reason:ba,fb_dtsg:c('DTSG').getToken()}).setOption('suppressErrorHandlerWarning',true).setOption('retries',1).setMethod('GET').setReadOnly(true).setAllowCrossPageTransition(true);ca.specifiesWriteRequiredParams()&&ca.send();},_getDelay:function aa(){var ba=Math.min(q.MIN_RETRY_INTERVAL*Math.pow(2,Math.max(0,t-1)),q.MAX_RETRY_INTERVAL);if(this.proxyDown&&'proxy_down_delay_millis' in q)ba=q.proxy_down_delay_millis;this.proxyDown=false;return Math.floor(ba*(1+Math.random()*.5));},resetDelay:function aa(){x(true);},enterState:function aa(){if(this._inEnterState){k.warn('enterstate_recursion',JSON.stringify({state:this.state,args:arguments}));c('ChatReliabilityInstrumentation').logERROR('enterstate_recursion');}this._inEnterState=true;try{this._enterState.apply(this,arguments);this._inEnterState=false;}catch(ba){this._inEnterState=false;throw ba;}},_enterState:function aa(ba){var ca=this.backoff?this._getDelay():0;this.backoff=false;if(this.isShutdown()){c('FantailLogger').warn(c('ChannelConstants').FANTAIL_SERVICE,'not executing state due to shutdown mode: %s',ba);return;}if(ba!='idle!'&&this.shouldIdle()){c('FantailLogger').warn(c('ChannelConstants').FANTAIL_SERVICE,'forced idleness');return;}r++;q.stateId=r;clearTimeout(this._deferredTransition);this._deferredTransition=null;if(!this.transport){n.done(function(ia){return ia.enterState('idle');});c('ChatReliabilityInstrumentation').logERROR('called enterState '+ba+' before transport init');}else this.transport.enterState('idle');this.state='idle';this.nextState=null;if(/!$/.test(ba)){if(this._transportRate){var da=this._transportRate.tally().timeAverage,ea=i.getConfig('MAX_CHANNEL_STATES_PER_SEC',1);if(da>=ea){if(!this._throttled){this._throttled=true;k.warn('throttled','{}');}j.bump('throttle');ca=1000/ea;}}}else if(!(/#$/.test(ba)))ca=this._getDelay();ba=ba.replace(/\W*$/,'');if(!p[ba]){c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'invalid state: %s',ba);throw new Error('invalid state:'+ba);}var fa=Array.from(arguments),ga;if(ca<=0){ga={state:ba};if(this._transportRate)this._transportRate.add(1);this.state=ba;var ha=this['_enter_'+this.state];if(ha){fa.shift();ha.apply(this,fa);}if(/init|idle|pull|ping/.test(this.state)){if(q.streamingCapable&&/pull/.test(this.state))this.heartbeats=[];q.is_offline=!c('ChatVisibility').isOnline();q.capabilities=c('FBRTCSupport').getCapabilities();c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'entering transport state: %s',this.state);if(!this.transport){n.done(function(ia){return ia.enterState(this.state,q);}.bind(this));c('ChatReliabilityInstrumentation').logERROR('called enterState '+ba+' before transport init');}else this.transport.enterState(this.state,q);if(this.state=='ping'){ga.url=c('ChannelTransport').getURI(q).toString();ga.port=q.port||'undefined';}}}else{this.state='idle';this.nextState=ba;ga={state:this.state,delay:ca,nextState:ba};fa[0]=ba+'#';this._deferredTransition=c('setTimeoutAcrossTransitions')(function(){this._deferredTransition=null;this.enterState.apply(this,fa);}.bind(this),ca);}if(/pull/.test(ba)){ga.client_id=q.sessionID;ga.streaming=q.inStreaming;}c('Arbiter').inform(c('ChannelConstants').ON_ENTER_STATE,ga);},exitState:function aa(ba,ca){var da=ba.stateId,ea=ba.status;if(this.isShutdown()||da<r)return;var fa=this.state,ga=Array.from(arguments);ga[0]=ba.status;var ha={state:fa,status:ea};if(/pull/.test(fa)){ha.client_id=q.sessionID;ha.streaming=q.inStreaming;}if(/ping/.test(fa)&&ea!=c('ChannelConstants').OK)ha.url=c('ChannelTransport').getURI(q).toString();if(this.nextState)ha.nextState=this.nextState;if(ca&&ca.errorType){q.lastRequestErrorReason=ca.errorType;ha.xhr=ca.toJSON?ca.toJSON():ca;if(ca.errorType==c('AjaxRequest').SERVICE_UNAVAILABLE){c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'got 5xx http status code, setting long delay');this.proxyDown=true;}delete ha.xhr.json;}else if(ea!=c('ChannelConstants').OK)q.lastRequestErrorReason=ea;if(ca&&ca.json){if(ca.json.t)ha.t=ca.json.t;if(ca.json.reason)ha.reason=ca.json.reason;if(ca.json.seq)ha.seq=ca.json.seq;}c('Arbiter').inform(c('ChannelConstants').ON_EXIT_STATE,ha);var ia=this['_exit_'+fa];if(ia)ea=ia.apply(this,ga)||ea;if(ea!=c('ChannelConstants').OK){x();s[fa]=(s[fa]||0)+1;}var ja=p[this.nextState||fa][ea]||p._all[ea],ka=ja&&ja.replace(/!*$/,'');if(!ka){k.error('terminal_transition',JSON.stringify(ha));this._shutdownHint=c('ChannelConstants').HINT_INVALID_STATE;ja='shutdown!';c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'entering shutdown state');}this._lastState=fa;this._lastStatus=ea;this.enterState(ja);},_processTransportData:function aa(ba,ca){this._processTransportData0(ba,ca,ca.json);},_processTransportData0:function aa(ba,ca,da){var ea=da.t;if('s' in da){da.seq=da.s;delete da.s;}if(da.u&&q.user&&da.u!=q.user){k.warn('misguided_msg',JSON.stringify({user:q.user,target:da.u}));this._reportProxyMisguidedMsg(da.u,q.user);return;}c('ChannelTransportDataLogger').log(da);var fa=q.seq;if('seq' in da){q.seq=da.seq;c('PresenceState').doSync();}switch(ea){case 'continue':if(q.inStreaming&&this.heartbeats.length<1){q.streamingCapable=false;k.log('switch_to_longpoll','{}');c('setTimeoutAcrossTransitions')(this._probeTest,q.PROBE_DELAY);}x(true);if(!q.inStreaming||q.STREAMING_EXIT_STATE_ON_CONTINUE)this.exitState({status:c('ChannelConstants').OK,stateId:ba});break;case 'refresh':case 'refreshDelay':c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'got refresh with reason: %s',da.reason);this.exitState({status:'refresh_'+(da.reason||0),stateId:ba},ca);break;case 'backoff':c('FantailLogger').warn(c('ChannelConstants').FANTAIL_SERVICE,'server told client to back off');x();this.backoff=true;break;case 'lb':var ga=da.lb_info;if(ga){q.sticky_token=ga.sticky;if('pool' in ga)q.sticky_pool=ga.pool;if('sd' in ga){var ha=ga.subdomain;if(c('ChannelTransport').isSubdomain(ha))q.subdomain=ga.subdomain;}if('vip' in ga)q.host=ga.vip;y('chatproxy',JSON.stringify(da));}else k.error('missing_lb_info','{}');break;case 'test_streaming':c('setTimeoutAcrossTransitions')(this._probeTest,500);break;case 'fullReload':c('PresenceCookieManager').clear();k.log('full_reload','{}');this.sessionRegistered=true;this.informCurrentSession();c('Arbiter').inform(c('ChannelConstants').ON_INVALID_HISTORY);x(true);c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'full reload incurred');var ia=c('ChannelConstants').OK;this.exitState({status:ia,stateId:ba},ca);if('ms' in da)this._processMessages(da,fa);break;case 'msg':x(true);this._processMessages(da,fa);break;case 'heartbeat':if(q.inStreaming){var ja=Date.now();if(this.heartbeats.length>0)var ka=ja-this.heartbeats[this.heartbeats.length-1];k.log('heartbeat_interval',JSON.stringify({client_id:q.sessionID,interval:ka}));this.heartbeats.push(ja);}break;case 'batched':var la=da.batches,ma;for(ma=0;ma<la.length;ma++)this._processTransportData0(ba,ca,la[ma]);break;default:c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'got an unknown protocol message: %s',ea);k.error('unknown_msg_type',JSON.stringify({type:ea}));break;}},_processMessages:function aa(ba,ca){var da,ea,fa,ga;if('tr' in ba)q.trace_id=ba.tr;ea=ba.ms;fa=q.seq-ea.length;for(da=0;da<ea.length;da++,fa++){q.estimatedReceived++;if(fa>=ca){ga=ea[da];if(ga.type){var ha=c('ChannelConstants').getArbiterType(ga.type);if(ga.type==='messaging'){var ia={type:'messaging',event:ga.event};if(ga.message){ia.inbox_unread=ga.unread_counts&&ga.unread_counts.inbox;ia.tid=ga.message.tid;ia.mid=ga.message.mid;c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'got message with id: %s',ga.message.mid);}}else if(ga.type==='pages_messaging'){if(ga.unread_counts&&ga.unread_counts.inbox)c('Arbiter').inform(c('ChannelConstants').getArbiterType('pages_inbox_count_update'),{page_id:ga[c('MessagingRealtimeConstants').VIEWER_FBID],inbox_unread:ga.unread_counts.inbox});}else if(ga.type==='skywalker'){ha=c('ChannelConstants').SKYWALKER;}else if(ga.type==='qprimer'){ga.first=!q.ready;if(ga.first){q.ready=true;q.timeUntilReady=Date.now()-q.created;q.queueMade=ga.made;}ha=c('ChannelConstants').CHANNEL_ESTABLISHED;}else if(ga.type==='pws'){q.pws=ga.pws;}else if(ga.type==='delta')q.sequenceId=ga.iseq;c('Arbiter').inform(ha,{obj:ga});}}else k.warn('seq_regression',JSON.stringify({last_seq:ca,messages:ea.length,seq:fa}));}},_enter_init:function aa(){if(s.init>=i.getConfig('MAX_INIT_FAILS',2))return c('setTimeoutAcrossTransitions')(function(){return this.exitState({status:c('ChannelConstants').ERROR_MAX,stateId:r});}.bind(this),0);this._initTimer=c('setTimeoutAcrossTransitions')(function(){return this.exitState({status:c('ChannelConstants').ERROR,stateId:r},'timeout');}.bind(this),q.IFRAME_LOAD_TIMEOUT);},_enter_reconnect:function aa(ba){k.warn('enter_reconnect',ba);c('FantailLogger').info(c('ChannelConstants').FANTAIL_SERVICE,'entered reconnect with reason: %s',ba);var ca=r;if(!c('PresenceUtil').hasUserCookie()){c('FantailLogger').warn(c('ChannelConstants').FANTAIL_SERVICE,'user has no cookie???');k.warn('no_user_cookie','{}');c('setTimeoutAcrossTransitions')(function(){this._shutdownHint=c('ChannelConstants').HINT_AUTH;this.exitState({status:c('ChannelConstants').ERROR_SHUTDOWN,stateId:ca});}.bind(this),0);return;}var da={reason:ba,fb_dtsg:c('DTSG').getToken()};if(c('ISB').token)da.fb_isb=c('ISB').token;if(l)l(da);var ea=new (c('FBAjaxRequest'))('GET','/ajax/presence/reconnect.php',da);ea.onSuccess=function(){i.configure(ea.json);c('PresenceCookieManager').store();this.exitState({status:c('ChannelConstants').OK,stateId:ca});}.bind(this);ea.onError=function(){var fa=ea.json&&ea.json.error;c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'reconnect error: %s',ea.errorType);if(ea.errorType==c('AjaxRequest').TRANSPORT_ERROR||ea.errorType==c('AjaxRequest').PROXY_ERROR||ea.errorType==c('AjaxRequest').SERVICE_UNAVAILABLE)this._shutdownHint=c('ChannelConstants').HINT_CONN;if(fa&&fa==1356007){this._shutdownHint=c('ChannelConstants').HINT_MAINT;}else if(fa==1357001||fa==1357004||fa==1348009){this._shutdownHint=c('ChannelConstants').HINT_AUTH;}else this._shutdownHint=null;this.exitState({status:this._shutdownHint?c('ChannelConstants').ERROR_SHUTDOWN:c('ChannelConstants').ERROR,stateId:ca},ea);}.bind(this);ea.send();},_enter_shutdown:function aa(){c('Arbiter').inform(c('ChannelConstants').ON_SHUTDOWN,{reason:this._shutdownHint});if('shutdown_recovery_interval_seconds' in q&&q.shutdown_recovery_interval_seconds>0){var ba=q.shutdown_recovery_interval_seconds*1000;c('setTimeoutAcrossTransitions')(function(){c('Arbiter').inform(c('ChannelConstants').ATTEMPT_RECONNECT);this._shutdownHint=null;this.state='reconnect!';this.enterState('reconnect!');}.bind(this),ba);}},_exit_init:function aa(ba){if(this._initTimer)this._initTimer=clearTimeout(this._initTimer);if(ba==c('ChannelConstants').ERROR_MAX)this._sendIframeError(c('ChannelConstants').reason_IFrameLoadGiveUp);},_exit_pull:function aa(ba,ca){var da=ba==c('ChannelConstants').OK;if(da){this.lastPullTime=Date.now();}else{var ea='exit status: '+ba;if(ca&&ca.errorType)ea+=' ajax request error: '+ca.errorType;c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'pull failed with status: %s',ea);}},_exit_ping:function aa(ba){if(ba==c('ChannelConstants').OK){var ca=Date.now()-(this.lastPullTime||c('Env').start);if(ca>q.STALL_THRESHOLD){c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'didnt complete a successful pull for too long');return c('ChannelConstants').ERROR_STALE;}}else c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'ping failed with status: %s',ba);},_reportProxyMisguidedMsg:function aa(ba,ca){c('FantailLogger').error(c('ChannelConstants').FANTAIL_SERVICE,'misguided message to %s meant for %s',ca,ba);var da=Date.now();if(da-this.lastReportOnMisguidedMsgTime<=q.CHANNEL_PROXY_REPORTING_MIN_INTERVAL)return;this.lastReportOnMisguidedMsgTime=da;var ea={received_uid:ba,expected_uid:ca};if(q.sticky_token)ea.sticky_token=q.sticky_token;var fa=new (c('URI'))('/err_misguided_msg').setDomain(q.host+'.'+q.domain).setPort(q.port).setSecure(new (c('URI'))(window.location.href).isSecure()).setQueryData(ea),ga=new (c('AjaxRequest'))('GET',fa);if(c('AjaxRequest').supportsCORS())ga.xhr.withCredentials=true;ga.onSuccess=function(ha){};ga.onError=function(ha){};ga.onJSON=function(ha,ia){};ga.send();},_probeTest:function aa(){q.streamingCapable=false;var ba=[],ca={mode:'stream',format:'json'};if(q.sticky_token)ca.sticky_token=q.sticky_token;var da=new (c('URI'))('/probe').setDomain(q.fullHost+'.'+q.domain).setPort(q.port).setSecure(new (c('URI'))(window.location.href).isSecure()).setQueryData(ca),ea=new (c('AjaxRequest'))('GET',da);ea.onJSON=function(fa,ga){if(fa&&fa.json&&fa.json.t==='heartbeat'){ba.push(Date.now());if(ba.length>=2){var ha=ba[1]-ba[0];if(ha>=q.PROBE_HEARTBEATS_INTERVAL_LOW&&ha<=q.PROBE_HEARTBEATS_INTERVAL_HIGH){q.streamingCapable=true;k.log('switch_to_streaming','{}');}}}};ea.onSuccess=function(fa){if(ba.length!=2){q.streamingCapable=false;k.error('probe_error',JSON.stringify({error:'beats.length = '+ba.length}));}k.log('probe_success','{}');};ea.onError=function(fa){q.streamingCapable=false;k.error('probe_error',JSON.stringify(fa));};ea.send();}};f.exports=i;function z(){if(c('ChannelInitialData').channelConfig){i.configure(c('ChannelInitialData').channelConfig);if(/shutdown/.test(c('ChannelInitialData').state))i._shutdownHint=c('ChannelConstants')[c('ChannelInitialData').reason];i.init(c('ChannelInitialData').state,c('ChannelInitialData').reason);c('ChatReliabilityInstrumentation').logCHANNEL_INIT();}else c('ChatReliabilityInstrumentation').logCHANNEL_NOCONFIG();}z();}),6);
__d('ChannelConnection',['Arbiter','ChannelConstants','ChannelManager','JSLogger','Run','SystemEvents','Visibility','setTimeoutAcrossTransitions'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('JSLogger').create('channel_connection'),i=null,j=null,k=null,l=null,m=0,n=Object.assign(new (c('Arbiter'))(),{CONNECTED:'chat-connection/connected',RECONNECTING:'chat-connection/reconnecting',SHUTDOWN:'chat-connection/shutdown',MUTE_WARNING:'chat-connection/mute',UNMUTE_WARNING:'chat-connection/unmute'});c('Run').onBeforeUnload(function(){});function o(){if(j){clearTimeout(j);j=null;}}function p(){o();h.log('unmute_warning');n.inform(n.UNMUTE_WARNING);}function q(v){o();j=c('setTimeoutAcrossTransitions')(p,v);h.log('mute_warning',{time:v});n.inform(n.MUTE_WARNING);}function r(){if(k){clearTimeout(k);k=null;}}function s(v,w){r();if(v===c('ChannelConstants').ON_ENTER_STATE&&(w.nextState||w.state)==='pull'){if(l!==n.CONNECTED){h.log('connected');var x=!l;l=n.CONNECTED;m=0;n.inform(n.CONNECTED,{init:x});}}else if(v===c('ChannelConstants').ON_ENTER_STATE&&((w.nextState||w.state)==='ping'||!w.nextState&&w.state==='idle')){k=c('setTimeoutAcrossTransitions')(function(){var y=null;if(!(w.state==='idle'&&!w.nextState))y=w.delay||0;h.log('reconnecting',{delay:y});if(n.disconnected())h.log('reconnecting_ui',{delay:y});l=n.RECONNECTING;w.state==='idle'&&m++;if(m>1){n.inform(n.RECONNECTING,y);}else if(!w.nextState&&w.state==='idle')s(v,w);},500);}else if(v===c('ChannelConstants').ON_SHUTDOWN){h.log('shutdown',{reason:w.reason});l=n.SHUTDOWN;m=0;n.inform(n.SHUTDOWN,w.reason);}}function t(){if(c('ChannelManager').isShutdown()){s(c('ChannelConstants').ON_SHUTDOWN,c('ChannelManager')._shutdownHint);}else s(c('ChannelConstants').ON_ENTER_STATE,{state:c('ChannelManager').state,nextState:c('ChannelManager').nextState,delay:0});c('Visibility').addListener(c('Visibility').VISIBLE,n.reconnect);}c('Run').onAfterLoad(t);Object.assign(n,{disconnected:function v(){return l===n.SHUTDOWN||l===n.RECONNECTING&&!j&&m>1;},isShutdown:function v(){return l===n.SHUTDOWN;},reconnect:function v(w){if(c('ChannelManager').state==='ping'||c('ChannelManager').state==='pull'||c('ChannelManager').isShutdown())return;h.log('reconnect',{now:w});n.inform(n.RECONNECTING,0);if(!!w){if(i!==null){clearTimeout(i);i=null;}c('ChannelManager').enterState('ping!');}else if(!i)i=c('setTimeoutAcrossTransitions')(function(){c('ChannelManager').enterState('ping!');i=null;},c('ChannelConstants').CHANNEL_MANUAL_RECONNECT_DEFER_MSEC);c('ChannelManager').resetDelay();},unmuteWarning:p});function u(){c('Arbiter').subscribe([c('ChannelConstants').ON_ENTER_STATE,c('ChannelConstants').ON_SHUTDOWN],s);c('Arbiter').subscribe(c('ChannelConstants').ATTEMPT_RECONNECT,function(){if(n.disconnected())n.reconnect();});c('SystemEvents').subscribe(c('SystemEvents').TIME_TRAVEL,function(){n.reconnect();q(c('ChannelConstants').MUTE_WARNING_TIME_MSEC);});c('Run').onBeforeUnload(r,false);}c('Run').onAfterLoad(u);n.mockAfterLoad=function(){t();u();};c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(v,w){w.channel_connected=!n.disconnected();});f.exports=n;}),6);
__d('BuddyListNub',['csx','cx','fbt','Arbiter','AsyncRequest','AvailableList','BootloadedComponent.react','ChannelConnection','ChatOptions','ChatSidebarActions','ChatSidebarStore','ChatSidebarVisibility','ChatVisibility','CSS','Dock','DOM','Event','JSLogger','JSResource','KeyEventController','Keys','NubController','OrderedFriendsList','Parent','PresencePrivacy','PresenceStatus','PresenceUtil','React','ReactDOM','Run','SidebarType','Style','Toggler','emptyFunction'],(function a(b,c,d,e,f,g,h,i,j){var k,l;if(c.__markCompiled)c.__markCompiled();var m=40,n=253,o='285px',p=c('JSLogger').create('buddylist_nub');k=babelHelpers.inherits(q,c('NubController'));l=k&&k.prototype;function q(r,s,t,u){'use strict';l.constructor.call(this);l.init.call(this,r);this.root=r;this.orderedList=s;this.button=c('DOM').find(r,'a.fbNubButton');this.unreadCount=c('DOM').find(r,"span._5ayx");this.label=c('DOM').find(r,'span.label');this.body=c('DOM').scry(r,'div.fbNubFlyoutBody')[0];this.container=c('Parent').bySelector(r,"._56ox");var v=c('DOM').find(r,'div.fbNubFlyoutTitlebar');c('Toggler').createInstance(v).setSticky(false);c('Toggler').createInstance(r).setSticky(true);if(u)c('Run').onAfterLoad(function(){this.dropdown=c('ReactDOM').render(c('React').createElement(c('BootloadedComponent.react'),{bootloadPlaceholder:c('React').createElement('span',null),bootloadLoader:c('JSResource')('ChatSidebarDropdown.react').__setRef('BuddyListNub'),onToggleSidebar:function w(){},sidebarType:c('SidebarType').BUDDYLIST}),u);}.bind(this));s.subscribeOnce('render',this.flyoutContentChanged.bind(this));c('Run').onAfterLoad(function(){var w=c('DOM').find(v,"div._4k48");if(w)c('ReactDOM').render(c('React').createElement(c('BootloadedComponent.react'),{bootloadPlaceholder:c('React').createElement('span',null),bootloadLoader:c('JSResource')('ChatSidebarComposeLink.react').__setRef('BuddyListNub'),className:"_3a-4"}),w);var x=c('DOM').find(this.button,"div._1us9");if(x)c('ReactDOM').render(c('React').createElement(c('BootloadedComponent.react'),{bootloadPlaceholder:c('React').createElement('span',null),bootloadLoader:c('JSResource')('ChatSidebarComposeLink.react').__setRef('BuddyListNub'),className:"_3a-4"}),x);var y=c('DOM').find(this.button,"div._1usa");if(y)c('ReactDOM').render(c('React').createElement(c('BootloadedComponent.react'),{bootloadPlaceholder:c('React').createElement('span',null),bootloadLoader:c('JSResource')('ChatSidebarDropdown.react').__setRef('BuddyListNub'),onToggleSidebar:function z(){},sidebarType:c('SidebarType').BUDDYLIST_NUB}),y);}.bind(this));s.setScrollContainer(this.body);c('AvailableList').subscribe('buddylist/availability-changed',this._updateCount.bind(this));c('Arbiter').subscribe('chat/connect',function(){return this._handleConnect(true);}.bind(this));c('Arbiter').subscribe('chat/option-changed',function(w,x){if(x.name=='hide_groups'){this.onResize();}else if(x.name==='hide_buddylist')x.value?this.hide():this.show();}.bind(this));c('ChannelConnection').subscribe(c('ChannelConnection').CONNECTED,function(){return this._updateView();}.bind(this));c('ChannelConnection').subscribe(c('ChannelConnection').SHUTDOWN,function(){return this._updateView();}.bind(this));c('ChannelConnection').subscribe(c('ChannelConnection').RECONNECTING,function(){return this._updateView();}.bind(this));c('ChannelConnection').subscribe([c('ChannelConnection').MUTE_WARNING,c('ChannelConnection').UNMUTE_WARNING],function(){return this._updateView();}.bind(this));this.subscribe('show',this.onShow.bind(this));this.subscribe('hide',this.onHide.bind(this));this.subscribe('resize',this.onResize.bind(this));c('Event').listen(r,'keydown',this._onKeyDown.bind(this));c('Event').listen(this.button,'click',this.onButtonClick.bind(this));c('KeyEventController').registerKey('q',function(event){if(!(this._isOpen)){this.onButtonClick();this.show();}event.prevent();}.bind(this));c('Arbiter').subscribe('minisidebar/show',this.hide.bind(this));c('Arbiter').subscribe('sidebar/visibility',function(w,x){if(x){this.hide();}else this._onSidebarHide();}.bind(this));c('Style').set(this.body,'min-height',o);c('Arbiter').subscribe('sidebar/typeahead/active',function(w,x){if(x){this._typeaheadActive=true;c('CSS').hide(this.body.parentNode);this.orderedList.hide();this.onResize();}else{this._typeaheadActive=false;this.onResize();c('CSS').show(this.body.parentNode);this.orderedList.show();}}.bind(this));c('OrderedFriendsList').getList(function(w){if(c('ChatSidebarStore').isEnabled()&&c('ChatSidebarStore').getVisibleType()===c('SidebarType').BUDDYLIST&&!c('ChatOptions').getSetting('hide_buddylist')&&!c('ChannelConnection').disconnected()&&!c('PresencePrivacy').isUserOffline()&&w.length>0)this.show();c('Event').listen(v,'click',function(x){if(c('CSS').matchesSelector(x.target,".titlebarTextWrapper"))this._syncHideBuddylist(true);}.bind(this));this._updateView();p.log('buddylist_initialized');}.bind(this));}q.prototype._handleVisibilityChange=function(){'use strict';this._updateView();if(!c('ChatVisibility').isOnline())this.hide();};q.prototype._updateView=function(r){'use strict';var s,t;if(!c('ChatVisibility').isOnline()){s=j._("{Chat} (Off)",[j.param('Chat',j._("Chat"))]);}else if(c('ChannelConnection').disconnected()){s=j._("{Chat} (Disconnected)",[j.param('Chat',j._("Chat"))]);}else{var u=c('PresenceStatus').getOnlineCount();if(u){var v=c('DOM').create('span',{className:'count'},'('+u+')');s=j._({"*":"{Chat} {number-available}"},[j.param('Chat',j._("Chat")),j.param('number-available',v,[0,u])]);}else{s=j._("Chat");t=true;}}this._setPresenceIcon();this._setUnread();this._setLabel(s,t);this.buttonContentChanged();};q.prototype._setPresenceIcon=function(){'use strict';c('CSS').conditionClass(this.root,'offline',!c('ChatVisibility').isOnline()||c('ChannelConnection').disconnected());};q.prototype.onButtonClick=function(){'use strict';if(!c('ChatSidebarStore').isInitialized())return true;c('ChatSidebarVisibility').shouldShowSidebarIgnoreEnabled(null,function(r,s){var t=c('ChatSidebarStore').isEnabled();if(!t&&r){c('ChatSidebarActions').enable(c('SidebarType').SIDEBAR);}else c('ChatSidebarActions').show(t&&r?c('SidebarType').SIDEBAR:c('SidebarType').BUDDYLIST);});};q.prototype.onHide=function(){'use strict';this._isOpen=false;if(this._buddyListRenderSubscription){this.orderedList.unsubscribe(this._buddyListRenderSubscription);this._buddyListRenderSubscription=null;}this._hideBuddyList();c('Arbiter').inform('buddylist/hide');};q.prototype._onKeyDown=function(event){'use strict';var r=c('Event').getKeyCode(event);if(r===c('Keys').ESC&&!c('CSS').hasClass(this.root,'menuOpened')){this.hide();return false;}else if(r==c('Keys').RETURN)c('ChatSidebarVisibility').shouldShowSidebarIgnoreEnabled(null,function(s,t){c('ChatSidebarActions').enable(s?c('SidebarType').SIDEBAR:c('SidebarType').BUDDYLIST);});};q.prototype._onSidebarHide=function(event){'use strict';if(c('ChatSidebarStore').isEnabled()&&!c('ChatOptions').getSetting('hide_buddylist')&&!c('ChannelConnection').disconnected()&&!c('PresencePrivacy').isUserOffline()){this.show();}else{this.hide();this.button.focus();}};q.prototype.onResize=function(){'use strict';var r=!this._typeaheadActive?n:c('Dock').getMaxFlyoutHeight(this.root)-60;c('Arbiter').inform('buddyList/resized',r,c('Arbiter').BEHAVIOR_PERSISTENT);if(this._typeaheadActive){c('Style').set(this.body,'max-height','none');}else c('Style').set(this.body,'max-height',o);var s=Math.max(250,r),t=Math.floor(s/m);this.orderedList.setNumTopFriends(t);};q.prototype._showBuddyList=function(){'use strict';this._buddyListRenderSubscription=this.orderedList.subscribe('render',function(){if(c('Style').get(this.body,'height')!=o)c('Style').set(this.body,'height',o);}.bind(this));this.orderedList.show();p.bump('buddylist_show');};q.prototype._hideBuddyList=function(){'use strict';this.orderedList.hide();p.bump('buddylist_hide');};q.prototype.onShow=function(){'use strict';this._isOpen=true;if(c('ChannelConnection').disconnected()){c('ChannelConnection').reconnect();this._showBuddyList();}else c('ChatVisibility').goOnline(this._showBuddyList.bind(this));this._syncHideBuddylist(false);};q.prototype._setLabel=function(r,s){'use strict';var t=this.label.textContent||this.label.innerText;if(t!==r){var u=this.label.cloneNode(true);c('DOM').setContent(u,r);c('DOM').replace(this.label,u);this.label=u;}this.throbber&&c('CSS').conditionShow(this.throbber,!!s);};q.prototype._setUnread=function(r){'use strict';c('CSS').conditionShow(this.unreadCount,!!r);};q.prototype._updateCount=function(){'use strict';this._updateView();};q.prototype._syncHideBuddylist=function(r){'use strict';c('ChatOptions').setSetting('hide_buddylist',r,'buddylist');new (c('AsyncRequest'))('/ajax/chat/settings.php').setHandler(c('emptyFunction')).setErrorHandler(c('emptyFunction')).setData({hide_buddylist:r,window_id:c('PresenceUtil').getSessionID()}).setAllowCrossPageTransition(true).send();};c('Arbiter').subscribe(c('JSLogger').DUMP_EVENT,function(r,s){s.buddylist_visible=c('ChatSidebarStore').getVisibleType()===c('SidebarType').BUDDYLIST;});f.exports=q;}),null);
__d('ChatUnreadCount',['ChatDispatcher','ChatUnreadCountActionTypes','Map','MercuryIDs','MercurySingletonProvider','MercuryThreadInformer','MercuryThreads','MercuryUnreadState','isInFocusMode'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();h.getForFBID=function(j){return i.getForFBID(j);};h.get=function(){return i.get();};function h(j){this.$ChatUnreadCount1=j;this.$ChatUnreadCount2=c('MercuryThreadInformer').getForFBID(j);this.$ChatUnreadCount3=c('MercuryThreads').getForFBID(j);this.$ChatUnreadCount4=new (c('Map'))();this.$ChatUnreadCount5=c('MercuryUnreadState').getForFBID(j);this.setupSubscriptions();}h.prototype.getUnreadCountForUID=function(j){if(!j)return null;var k=c('MercuryIDs').getThreadIDFromUserID(j);if(!this.$ChatUnreadCount5.getIsThreadUnread(k)){this.$ChatUnreadCount4['delete'](j);return 0;}var l=this.$ChatUnreadCount3.getOrFetch(k),m=l&&l.unread_count;this.$ChatUnreadCount4.set(j,m);if(c('isInFocusMode')(k))return 0;return m;};h.prototype.setupSubscriptions=function(){this.$ChatUnreadCount2.subscribe('threads-updated',function(j,k){var l=Object.keys(k).some(function(m){var n=c('MercuryIDs').getUserIDFromThreadID(m);if(!n)return false;var o=this.getUnreadCountForUID(n),p=this.$ChatUnreadCount4.get(n)||0;return o!==p;}.bind(this));if(l)c('ChatDispatcher').dispatch({type:c('ChatUnreadCountActionTypes').COUNT_UPDATED});}.bind(this));this.$ChatUnreadCount2.subscribe('unread-updated',function(){return c('ChatDispatcher').dispatch({type:c('ChatUnreadCountActionTypes').COUNT_UPDATED});});};var i=new (c('MercurySingletonProvider'))(h);f.exports=h;}),null);
__d('ChatSidebarComposeLink.react',['fbt','ChatOpenTab','ChatOpenTabEventLogger','FantaTabActions','Link.react','MercuryConfig','MercuryThreads','React','TooltipData'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('MercuryThreads').get();i=babelHelpers.inherits(l,c('React').Component);j=i&&i.prototype;function l(m){j.constructor.call(this,m);}l.prototype.render=function(){var m=h._("New Message");return (c('React').createElement(c('Link.react'),babelHelpers['extends']({className:this.props.className,href:'#',onClick:this.$ChatSidebarComposeLink1},c('TooltipData').propsFor(m,'below'))));};l.prototype.$ChatSidebarComposeLink1=function(m){if(c('MercuryConfig').FantaTabs){var n=k.createNewLocalThreadGenerateID();c('FantaTabActions').openTab(n);c('ChatOpenTabEventLogger').log('sidebar');}else c('ChatOpenTab').openEmptyTab(null,'sidebar');m.preventDefault();};f.exports=l;}),null);
__d('ChatSidebarSheetChatOffline.react',['fbt','Link.react','React'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes;i=babelHelpers.inherits(l,c('React').PureComponent);j=i&&i.prototype;l.prototype.render=function(){return (c('React').createElement('div',null,h._("{=Go online} to see who's available.",[h.param('=Go online',c('React').createElement(c('Link.react'),{className:'fbChatGoOnlineLink',onClick:this.props.onGoOnlineClick},h._("Turn on chat")))])));};function l(){i.apply(this,arguments);}l.propTypes={onGoOnlineClick:k.func.isRequired};f.exports=l;}),null);
__d('ChatSidebarSheetChatReconnectMsg.react',['fbt','ChannelConstants','Link.react','MessengerSpinner.react','React'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes;i=babelHelpers.inherits(l,c('React').PureComponent);j=i&&i.prototype;l.prototype.render=function(){var m=this.props,n=m.isMessenger,o=m.msecs,p=c('React').createElement(c('Link.react'),{className:'fbChatReconnectLink',onClick:this.props.onManuallyConnectClick},h._("No Internet Connection"));if(o==null||false===navigator.onLine){return (n?p:c('React').createElement('div',null,h._("Unable to connect to chat. Check your Internet connection.")));}else if(o>c('ChannelConstants').WARNING_COUNTDOWN_THRESHOLD_MSEC){return (n?p:c('React').createElement('div',null,h._("Unable to connect to chat. {try-again-link}",[h.param('try-again-link',c('React').createElement(c('Link.react'),{className:'fbChatReconnectLink',onClick:this.props.onManuallyConnectClick},h._("Try again")))])));}else if(o>1000){return (n?p:c('React').createElement('div',null,h._("Unable to connect to chat. Reconnecting in {seconds}",[h.param('seconds',Math.floor(o/1000))])));}else return (n?c('React').createElement('div',null,c('React').createElement(c('MessengerSpinner.react'),{color:'grey'}),h._("Connecting...")):c('React').createElement('div',null,h._("Unable to connect to chat. Reconnecting...")));};function l(){i.apply(this,arguments);}l.propTypes={isMessenger:k.bool,msecs:k.number,onManuallyConnectClick:k.func};f.exports=l;}),null);
__d('ChatSidebarSheetChatShutdownMsg.react',['fbt','ChannelConstants','React'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes;i=babelHelpers.inherits(l,c('React').PureComponent);j=i&&i.prototype;l.prototype.render=function(){var m=this.props,n=m.hint,o=m.isMessenger;switch(n){case c('ChannelConstants').HINT_AUTH:return (c('React').createElement('div',null,h._("Your session has timed out. Please log in.")));case c('ChannelConstants').HINT_MAINT:return (o?c('React').createElement('div',null,h._("Messenger is currently down for maintenance.")):c('React').createElement('div',null,h._("Facebook {Chat} is currently down for maintenance.",[h.param('Chat',h._("Chat"))])));case c('ChannelConstants').HINT_CONN:default:return (o?c('React').createElement('div',null,h._("Messenger is currently unavailable.")):c('React').createElement('div',null,h._("Facebook {Chat} is currently unavailable.",[h.param('Chat',h._("Chat"))])));}};function l(){i.apply(this,arguments);}l.propTypes={hint:k.string,isMessenger:k.bool};f.exports=l;}),null);
__d('ChatSidebarSheet.react',['fbt','Arbiter','ChannelConnection','ChatBehavior','ChatSidebarSheetChatOffline.react','ChatSidebarSheetChatReconnectMsg.react','ChatSidebarSheetChatShutdownMsg.react','ChatVisibility','CurrentEnvironment','CSS','JSLogger','MercurySyncConstants','PresencePrivacy','ReactComponentWithPureRenderMixin','React','SubscriptionsHandler','emptyFunction','joinClasses','setTimeoutAcrossTransitions'],(function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('JSLogger').create('sidebar_sheet'),j=c('React').PropTypes,k=c('React').createClass({displayName:'ChatSidebarSheet',mixins:[c('ReactComponentWithPureRenderMixin')],getInitialState:function l(){return {channelStatus:null,channelData:null,isConnected:!c('ChannelConnection').disconnected(),isOnline:c('ChatVisibility').isOnline(),notifiesUserMessages:c('ChatBehavior').notifiesUserMessages(),syncStateInvalid:false};},getDefaultProps:function l(){return {onUpdate:c('emptyFunction')};},_subscriptions:c('SubscriptionsHandler'),_showWarningTimeout:null,componentDidMount:function l(){this._subscriptions=new (c('SubscriptionsHandler'))();this._subscriptions.addSubscriptions(c('ChannelConnection').subscribe([c('ChannelConnection').CONNECTED,c('ChannelConnection').SHUTDOWN,c('ChannelConnection').RECONNECTING],this._handleConnectionChange),c('ChannelConnection').subscribe([c('ChannelConnection').MUTE_WARNING,c('ChannelConnection').UNMUTE_WARNING],this._calculateState),c('PresencePrivacy').subscribe('privacy-user-presence-changed',this._calculateState),c('ChatBehavior').subscribe(c('ChatBehavior').ON_CHANGED,this._calculateState),c('Arbiter').subscribe(c('MercurySyncConstants').ARBITER_EVENT_INVALID_STATE,function(){this.setState({syncStateInvalid:true});}.bind(this)));},componentWillUpdate:function l(){if(this._showWarningTimeout){clearTimeout(this._showWarningTimeout);this._showWarningTimeout=null;}},componentWillUnmount:function l(){this._subscriptions&&this._subscriptions.release();},render:function l(){var m=c('CurrentEnvironment').messengerdotcom,n=void 0,o=void 0;if(!this.state.isOnline&&!m){n='offline';o=this._renderOffline();}else if(!this.state.isConnected||this.state.syncStateInvalid){n='error';o=this._renderGeneralConnectionError(m);}else if(!this.state.notifiesUserMessages&&!m){n='notice';o=this._renderNotice();}if(this.state.channelStatus===c('ChannelConnection').RECONNECTING&&this.state.channelData<1000)n=c('joinClasses')(n,'reconnecting');return (c('React').createElement('div',{className:c('joinClasses')(this.props.className,n)},m?null:c('React').createElement('div',{className:'img'}),c('React').createElement('div',{className:'message'},o)));},_handleConnectionChange:function l(m,n){this.setState({channelStatus:m,channelData:n});this._calculateState();},_calculateState:function l(){this.setState({isConnected:!c('ChannelConnection').disconnected(),isOnline:c('ChatVisibility').isOnline(),notifiesUserMessages:c('ChatBehavior').notifiesUserMessages()});},_renderGeneralConnectionError:function l(m){if(this.state.channelStatus===c('ChannelConnection').SHUTDOWN||this.state.syncStateInvalid){return (c('React').createElement(c('ChatSidebarSheetChatShutdownMsg.react'),{hint:this.state.syncStateInvalid?undefined:this.state.channelData,isMessenger:m}));}else if(this.state.channelStatus===c('ChannelConnection').RECONNECTING){var n=this.state.channelData;if(n>1000)this._showWarningTimeout=c('setTimeoutAcrossTransitions')(this._handleConnectionChange.bind(this,c('ChannelConnection').RECONNECTING,n-1000),1000);return (c('React').createElement(c('ChatSidebarSheetChatReconnectMsg.react'),{isMessenger:m,msecs:n,onManuallyConnectClick:function o(){return c('ChannelConnection').reconnect();}}));}return null;},_renderOffline:function l(){return (c('React').createElement(c('ChatSidebarSheetChatOffline.react'),{onGoOnlineClick:function m(n){i.log('sidebar_go_online');c('ChatVisibility').goOnline();}}));},_renderNotice:function l(){return (c('React').createElement('div',null,h._("Alerts are off while you use another client to chat.")));}});f.exports=k;}),null);
__d('MessengerSearchTypeahead.react',['cx','fbt','ix','AbstractTypeahead.react','Bootloader','Image.react','MercuryIDs','MercuryThreadIDMap','MercuryThreads','MercuryTypeaheadConstants','MercuryVanityIDMap','MessengerActions','MessengerSearchSource','React','TypeaheadNavigation'],(function a(b,c,d,e,f,g,h,i,j){'use strict';var k,l;if(c.__markCompiled)c.__markCompiled();var m=c('MercuryThreadIDMap').get(),n=c('MercuryThreads').get(),o=c('React').PropTypes,p=j('/images/mercury/clients/messenger/threadlist/InboxThreadDismiss.png'),q=100,r=null,s=null;k=babelHelpers.inherits(t,c('React').PureComponent);l=k&&k.prototype;function t(){var v,w;for(var x=arguments.length,y=Array(x),z=0;z<x;z++)y[z]=arguments[z];return v=(w=l.constructor).call.apply(w,[this].concat(y)),u.call(this),v;}t.prototype.componentWillMount=function(){var v=function x(y,z,aa){var ba=y.indexOf(z),ca=ba==-1?y.length-1:ba-1;aa(ca==-1?y[y.length-1]:y[ca]);},w=function x(y,z,aa){var ba=y.indexOf(z)+1;aa(ba==y.length?y[0]:y[ba]);};if(this.props.isFlipped){v=c('TypeaheadNavigation').moveDown;w=c('TypeaheadNavigation').moveUp;}this.$MessengerSearchTypeahead1=function(x){for(var y=arguments.length,z=Array(y>1?y-1:0),aa=1;aa<y;aa++)z[aa-1]=arguments[aa];return v.apply(undefined,[s.orderEntries(x,this.props.queryString)].concat(z));}.bind(this);this.$MessengerSearchTypeahead2=function(x){for(var y=arguments.length,z=Array(y>1?y-1:0),aa=1;aa<y;aa++)z[aa-1]=arguments[aa];return w.apply(undefined,[s.orderEntries(x,this.props.queryString)].concat(z));}.bind(this);};t.prototype.render=function(){var v,w=this.props.isFacebookChat?i._("Search"):i._("Search for people and groups");return (c('React').createElement('div',{className:"_3rh8"},c('React').createElement(c('AbstractTypeahead.react'),{autoHighlight:this.props.isFacebookChat,blurOnWindowBlur:false,className:"_5iwm"+(this.props.isFocused||!!this.props.queryString?' '+"_5iwn":'')+(' '+"_150g")+(this.props.hideResults?' '+"_1a03":''),disabled:this.props.hideResults,inputClassName:"_3rhb",navigation:{moveUp:this.$MessengerSearchTypeahead1,moveDown:this.$MessengerSearchTypeahead2},onBlur:this.props.onBlur,onChange:this.$MessengerSearchTypeahead3,onFocus:function(){this.$MessengerSearchTypeahead4();(v=this.props).onFocus.apply(v,arguments);}.bind(this),onMouseOver:this.$MessengerSearchTypeahead4,onClick:this.$MessengerSearchTypeahead4,onSelectAttempt:this.$MessengerSearchTypeahead5,placeholder:w,presenter:{ViewRenderer:r,alwaysVisibleOnFocus:true,extraRendererProps:{className:"_11_d",hasHoverState:this.props.isFacebookChat,isLoading:this.state.isLoading,onScrollIntoView:this.props.onScrollIntoView,viewer:this.props.viewer},maxEntries:this.props.maxEntries||q,sortEntries:this.$MessengerSearchTypeahead6,useLayer:false},queryString:this.props.queryString,role:'search',searchSource:c('MessengerSearchSource').getForFBID(this.props.viewer),searchSourceOptions:{onQueryFinished:this.$MessengerSearchTypeahead7,onQueryStarted:this.$MessengerSearchTypeahead8,showDefaultEntries:!this.props.isFacebookChat,showThreadSearchEntry:!this.props.isFacebookChat&&!!this.props.queryString},selectOnTab:true,spellCheck:false,showEntriesOnFocus:!this.props.isFacebookChat}),c('React').createElement(c('Image.react'),{onMouseDown:this.props.onClear,className:(!this.props.queryString?"hidden_elem":'')+(' '+"_2xme"),src:p})));};t.propTypes={hideResults:o.bool,isFacebookChat:o.bool,isFlipped:o.bool,isFocused:o.bool,maxEntries:o.number,onBlur:o.func,onChange:o.func,onClear:o.func,onFocus:o.func,onSelect:o.func.isRequired,onScrollIntoView:o.func,queryString:o.string,viewer:o.string.isRequired};var u=function v(){var w;this.state={isLoading:false,orderable:!!s};this.$MessengerSearchTypeahead3=function(){this.setState({isLoaded:false});(w=this.props).onChange.apply(w,arguments);}.bind(this);this.$MessengerSearchTypeahead4=function(){if(!this.state.orderable)c('Bootloader').loadModules(["MessengerTypeaheadView.react","MessengerTypeaheadUtils"],function(x,y){r=x;s=y;this.setState({orderable:true});}.bind(this),'MessengerSearchTypeahead.react');}.bind(this);this.$MessengerSearchTypeahead8=function(x){if(x===this.props.queryString)this.setState({isLoading:true});}.bind(this);this.$MessengerSearchTypeahead7=function(x){if(x===this.props.queryString)this.setState({isLoading:false,isLoaded:true});}.bind(this);this.$MessengerSearchTypeahead6=function(x){return s?s.sortEntries(x,this.props.queryString):x;}.bind(this);this.$MessengerSearchTypeahead5=function(x){var y=x.getUniqueID(),z=x.getType(),aa=x.getAuxiliaryData().alias;if(aa)c('MercuryVanityIDMap').set(aa,c('MercuryIDs').getParticipantIDFromUserID(y));if(z===c('MercuryTypeaheadConstants').SEARCH_TYPE){c('MessengerActions').changeQueryAll(this.props.queryString);}else if(z===c('MercuryTypeaheadConstants').THREAD_TYPE){m.getClientIDFromServerID(y,function(ba){this.props.onSelect(ba,z);}.bind(this));}else n.getThreadMeta(c('MercuryIDs').getThreadIDFromUserID(y),function(ba){this.props.onSelect(ba.thread_id,z);}.bind(this));}.bind(this);};f.exports=t;}),null);
__d('ChatTypeaheadWrapper.react',['cx','Arbiter','Bootloader','ChatConfig','ChatOpenTab','ChatOpenTabEventLogger','ChatSidebarComposeLink.react','ChatSidebarSections','ChatSidebarSheet.react','FantaTabActions','MercuryConfig','MessengerSearchTypeahead.react','React','Run','emptyFunction','getActiveElement'],(function a(b,c,d,e,f,g,h){'use strict';var i,j;if(c.__markCompiled)c.__markCompiled();var k=40,l=c('ChatConfig').get('divebar_rounded_profile',false);function m(o){c('Arbiter').inform('sidebar/typeahead/active',o);}i=babelHelpers.inherits(n,c('React').Component);j=i&&i.prototype;function n(){var o,p;for(var q=arguments.length,r=Array(q),s=0;s<q;s++)r[s]=arguments[s];return o=(p=j.constructor).call.apply(p,[this].concat(r)),this.state={height:0,value:'',isSearching:false,dropdownComponent:null},o;}n.prototype.componentDidMount=function(){if(this.props.isSidebar){c('Arbiter').subscribe('sidebar/resized',function(o,p){this.setState({height:p});}.bind(this));c('Run').onAfterLoad(function(){c('Bootloader').loadModules(["ChatSidebarDropdown.react","SidebarType","ChatSidebarActions"],function(o,p,q){this.setState({dropdownComponent:c('React').createElement(o,{sidebarType:p.SIDEBAR,onToggleSidebar:q.disable})});}.bind(this),'ChatTypeaheadWrapper.react');}.bind(this));}else c('Arbiter').subscribe('buddyList/resized',function(o,p){this.setState({height:p});}.bind(this));};n.prototype.componentWillUpdate=function(o,p){if(p.isSearching!==this.state.isSearching)m(p.isSearching);};n.prototype.render=function(){var o=this.state.height!=null?Math.floor((this.state.height-k*2)/k):null;return (c('React').createElement('div',{className:!l?"squareProfile":''},this.props.isFlipped?c('React').createElement(c('ChatSidebarSheet.react'),{className:'fbChatSidebarMessage'}):null,c('React').createElement(c('MessengerSearchTypeahead.react'),{isFacebookChat:true,isFlipped:this.props.isFlipped,isFocused:true,maxEntries:o,queryString:this.state.value,viewer:this.props.id,onBlur:function(){return this.setState({isSearching:false,value:''});}.bind(this),onChange:function(p){var q=p.target.value;this.setState({isSearching:q!=='',value:q});}.bind(this),onClear:c('emptyFunction'),onFocus:c('emptyFunction'),onScrollIntoView:c('emptyFunction'),onSelect:function p(q,r){c('getActiveElement')().blur();if(c('MercuryConfig').FantaTabs){c('FantaTabActions').openTab(q);c('ChatOpenTabEventLogger').logByType(r,c('ChatSidebarSections').TYPEAHEAD,q);}else c('ChatOpenTab').openTabByType(q,r,c('ChatSidebarSections').TYPEAHEAD);}}),this.props.isSidebar?c('React').createElement('div',{className:"_531b"},this.state.dropdownComponent,c('React').createElement(c('ChatSidebarComposeLink.react'),{className:"_3a-4 _5q85"})):null,this.props.isFlipped?null:c('React').createElement(c('ChatSidebarSheet.react'),{className:'fbChatSidebarMessage'})));};f.exports=n;}),null);
__d('ChatTypeaheadCore',['ChatTypeaheadWrapper.react','React','ReactDOM'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={init:function i(j,k,l,m){c('ReactDOM').render(c('React').createElement(c('ChatTypeaheadWrapper.react'),{id:k,isSidebar:l,isFlipped:m}),j);}};f.exports=h;}),null);
__d('SidebarAppTickerResizer',['cx','Animation','Arbiter','AsyncRequest','ChatSidebarActions','ChatSidebarStore','ChatSidebarVisibility','CSS','debounce','Event','SidebarType','SimpleDrag','TickerController','$','queryThenMutateDOM'],(function a(b,c,d,e,f,g,h){if(c.__markCompiled)c.__markCompiled();var i=1e-07,j=1,k=85,l=171,m=165,n=300,o=46,p=90,q=82,r=150;function s(t,u,v,w,x){'use strict';this.$SidebarAppTickerResizer1=c('$')('pagelet_ticker');this.$SidebarAppTickerResizer2=c('$')('pagelet_canvas_nav_content');this.$SidebarAppTickerResizer3=this.$SidebarAppTickerResizer1.parentNode;this.$SidebarAppTickerResizer4=w;this.$SidebarAppTickerResizer5=x;var y=parseInt(v,10);if(!isNaN(y)){if(y>k)if(y!=this.$SidebarAppTickerResizer6())v=this.$SidebarAppTickerResizer6()+'px';this.$SidebarAppTickerResizer7(y);}this.$SidebarAppTickerResizer2.style.height=v;this.$SidebarAppTickerResizer8(t,u);if(v===null)c('Arbiter').subscribe('AppsDivebar/show-apps',this.$SidebarAppTickerResizer9.bind(this));if(!w){this.$SidebarAppTickerResizer10();c('CSS').hide(t);}c('Arbiter').subscribe('ChatSidebarDropdown/closeTicker',this.$SidebarAppTickerResizer10.bind(this));c('Arbiter').subscribe('ChatSidebarDropdown/openTicker',this.$SidebarAppTickerResizer11.bind(this));c('Arbiter').subscribe('sidebar/visibility',function(z,aa){if(aa)this.$SidebarAppTickerResizer12();}.bind(this));this.$SidebarAppTickerResizer13=c('debounce')(this.$SidebarAppTickerResizer9.bind(this),200);c('Event').listen(window,'resize',this.$SidebarAppTickerResizer13);c('Arbiter').inform('Ticker/resized');}s.prototype.$SidebarAppTickerResizer12=function(){'use strict';var t=Math.round(parseFloat(this.$SidebarAppTickerResizer1.style.height));if(t<=i)return;c('TickerController').show(this.$SidebarAppTickerResizer1);};s.prototype.$SidebarAppTickerResizer9=function(t){'use strict';c('queryThenMutateDOM')(function(){this.$SidebarAppTickerResizer14();}.bind(this),function(){var u=Math.round(parseFloat(this.$SidebarAppTickerResizer1.style.height));if(u>Math.round(this.$SidebarAppTickerResizer15())||this.$SidebarAppTickerResizer16&&this.$SidebarAppTickerResizer16>j){var v=this.$SidebarAppTickerResizer16/this.$SidebarAppTickerResizer17*100,w=this.$SidebarAppTickerResizer18(0,this.$SidebarAppTickerResizer15()-v);if(!(t&&t.type==='resize'))this.$SidebarAppTickerResizer19(w);c('ChatSidebarVisibility').shouldShowSidebar(null,function(x,y){c('ChatSidebarActions').show(x?c('SidebarType').SIDEBAR:c('SidebarType').BUDDYLIST);});}}.bind(this));};s.prototype.$SidebarAppTickerResizer15=function(){'use strict';if(!this.$SidebarAppTickerResizer4)return 0;if(c('ChatSidebarStore').getVisibleType()!==c('SidebarType').SIDEBAR)return p;return Math.min(p,(this.$SidebarAppTickerResizer17-this.$SidebarAppTickerResizer20-q)*100/this.$SidebarAppTickerResizer17);};s.prototype.$SidebarAppTickerResizer8=function(t,u){'use strict';var v=new (c('SimpleDrag'))(t);v.subscribe('start',this.$SidebarAppTickerResizer21.bind(this));v.subscribe(['update','end'],this.$SidebarAppTickerResizer22.bind(this));var w=new (c('SimpleDrag'))(u);w.subscribe('start',this.$SidebarAppTickerResizer21.bind(this));w.subscribe('update',this.$SidebarAppTickerResizer23.bind(this));w.subscribe('end',this.$SidebarAppTickerResizer24.bind(this));};s.prototype.$SidebarAppTickerResizer21=function(t,event){'use strict';this.$SidebarAppTickerResizer25=event.clientY;this.$SidebarAppTickerResizer14();this.$SidebarAppTickerResizer26();};s.prototype.$SidebarAppTickerResizer14=function(){'use strict';this.$SidebarAppTickerResizer20=this.$SidebarAppTickerResizer2.offsetTop;this.$SidebarAppTickerResizer27=this.$SidebarAppTickerResizer1.offsetHeight;this.$SidebarAppTickerResizer17=this.$SidebarAppTickerResizer3.offsetHeight;this.$SidebarAppTickerResizer16=this.$SidebarAppTickerResizer2.offsetHeight;this.$SidebarAppTickerResizer28=this.$SidebarAppTickerResizer16;};s.prototype.$SidebarAppTickerResizer26=function(){'use strict';c('CSS').addClass(this.$SidebarAppTickerResizer3,"_4vfq");};s.prototype.$SidebarAppTickerResizer29=function(){'use strict';c('CSS').removeClass(this.$SidebarAppTickerResizer3,"_4vfq");};s.prototype.$SidebarAppTickerResizer22=function(t,event){'use strict';var u=this.$SidebarAppTickerResizer16/this.$SidebarAppTickerResizer17*100,v=this.$SidebarAppTickerResizer18(event.clientY-this.$SidebarAppTickerResizer25,this.$SidebarAppTickerResizer15()-u);if(t=='end'){this.$SidebarAppTickerResizer29();this.$SidebarAppTickerResizer19(v);}c('ChatSidebarVisibility').shouldShowSidebar(null,function(w,x){c('ChatSidebarActions').show(w?c('SidebarType').SIDEBAR:c('SidebarType').BUDDYLIST);});};s.prototype.$SidebarAppTickerResizer23=function(t,event){'use strict';var u=-this.$SidebarAppTickerResizer16,v=this.$SidebarAppTickerResizer6()-this.$SidebarAppTickerResizer16,w=this.$SidebarAppTickerResizer30(event.clientY-this.$SidebarAppTickerResizer25,u,v);this.$SidebarAppTickerResizer18(-w,this.$SidebarAppTickerResizer15());this.$SidebarAppTickerResizer28=this.$SidebarAppTickerResizer16+w;this.$SidebarAppTickerResizer28=Math.max(j,this.$SidebarAppTickerResizer28);this.$SidebarAppTickerResizer2.style.height=this.$SidebarAppTickerResizer28+'px';};s.prototype.$SidebarAppTickerResizer24=function(t,event){'use strict';var u=this.$SidebarAppTickerResizer28,v=this.$SidebarAppTickerResizer31(this.$SidebarAppTickerResizer28);this.$SidebarAppTickerResizer7(v);var w=this.$SidebarAppTickerResizer18(this.$SidebarAppTickerResizer16-v,this.$SidebarAppTickerResizer15());if(this.$SidebarAppTickerResizer16!=v){this.$SidebarAppTickerResizer32(v);this.$SidebarAppTickerResizer19(w);}new (c('Animation'))(this.$SidebarAppTickerResizer2).from('height',u).to('height',v).duration(n).go();};s.prototype.$SidebarAppTickerResizer7=function(t){'use strict';if(!this.$SidebarAppTickerResizer5)return;var u="_3qrt",v=document.getElementsByClassName(u),w='';if(t==this.$SidebarAppTickerResizer33()){w='inline';}else w='';for(var x=0;x<v.length;x++)v[x].style.display=w;};s.prototype.$SidebarAppTickerResizer18=function(t,u){'use strict';var v=this.$SidebarAppTickerResizer27+t,w=v/this.$SidebarAppTickerResizer17*100;w=Math.max(i,Math.min(u,w));this.$SidebarAppTickerResizer1.style.height=w+'%';if(w!=i){c('CSS').removeClass(this.$SidebarAppTickerResizer1,'hidden_elem');this.$SidebarAppTickerResizer12();}return w;};s.prototype.$SidebarAppTickerResizer31=function(t){'use strict';var u=this.$SidebarAppTickerResizer33(),v=this.$SidebarAppTickerResizer6();return t<v-o?t<u-o?j:u:v;};s.prototype.$SidebarAppTickerResizer33=function(){'use strict';return k;};s.prototype.$SidebarAppTickerResizer6=function(){'use strict';if(this.$SidebarAppTickerResizer5){return m;}else return l;};s.prototype.$SidebarAppTickerResizer34=function(t){'use strict';var u=this.$SidebarAppTickerResizer6();return t<0?j:t>u?u:t;};s.prototype.$SidebarAppTickerResizer30=function(t,u,v){'use strict';return t<u?u:t>v?v:t;};s.prototype.$SidebarAppTickerResizer19=function(t){'use strict';new (c('AsyncRequest'))('/ajax/feed/ticker/resize').setData({height:''+t}).setMethod('POST').send();c('Arbiter').inform('Ticker/resized');};s.prototype.$SidebarAppTickerResizer32=function(t){'use strict';new (c('AsyncRequest'))('/ajax/feed/apps/resize').setData({height:''+t}).setMethod('POST').send();};s.prototype.$SidebarAppTickerResizer35=function(t){'use strict';var u=this.$SidebarAppTickerResizer27,v=this.$SidebarAppTickerResizer17*t/100;new (c('Animation'))(this.$SidebarAppTickerResizer1).from('height',u).to('height',v).duration(r).ondone(function(){this.$SidebarAppTickerResizer1.style.height=t+'%';this.$SidebarAppTickerResizer19(t===0?'0.0':t);c('ChatSidebarVisibility').shouldShowSidebar(null,function(w,x){c('ChatSidebarActions').show(w?c('SidebarType').SIDEBAR:c('SidebarType').BUDDYLIST);});}.bind(this)).go();};s.prototype.$SidebarAppTickerResizer10=function(){'use strict';this.$SidebarAppTickerResizer14();this.$SidebarAppTickerResizer35(0);};s.prototype.$SidebarAppTickerResizer11=function(){'use strict';this.$SidebarAppTickerResizer1.style.height='40px';c('TickerController').show(this.$SidebarAppTickerResizer1,function(){this.$SidebarAppTickerResizer14();var t=(this.$SidebarAppTickerResizer17-this.$SidebarAppTickerResizer20-q-this.$SidebarAppTickerResizer16)*50/this.$SidebarAppTickerResizer17;this.$SidebarAppTickerResizer35(t);}.bind(this));};f.exports=s;}),null);
__d('ChatTimezoneWarning',['MercuryParticipants','MercuryViewer','MessengerBotIDs'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=3,i={updateUserTimezoneWarning:function j(k,l,m){c('MercuryParticipants').get(c('MercuryViewer').getID(),function(n){var o=n.employee,p=n.timezone,q=0;if(k.timezone_warning_dismiss_count!==undefined){var r=k.timezone_warning_dismiss_count;for(var s=Object.entries(r),t=Array.isArray(s),u=0,s=t?s:s[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var v;if(t){if(u>=s.length)break;v=s[u++];}else{u=s.next();if(u.done)break;v=u.value;}var w=v,x=w[0],y=w[1];if(x.toString()===n.fbid)q=Number(y);}}else return;if(o&&p&&q<h)c('MercuryParticipants').getMulti(k.participants,function(z){var aa={},ba=true;for(var ca in z){ba=ba&&z[ca].employee;var da=!!c('MessengerBotIDs')[z[ca].fbid];if(z[ca].timezone!==undefined&&z[ca].timezone!==null&&p!==z[ca].timezone&&!da){var ea=z[ca].fbid;aa[ea]=z[ca];}}if(Object.keys(aa).length>0&&ba){aa.self=n;l(aa);}else m();});});}};f.exports=i;}),null);
__d('ChatUserPersonalUserWarning',['MercuryIDs','MercuryParticipants','MercuryViewer','MercuryEmployeeDualityPreferences'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=3,i={updateEmployeePersonalUserWarning:function j(k,l,m){c('MercuryParticipants').get(c('MercuryViewer').getID(),function(n){var o=n.employee,p=null;if(n.personal_id)p='fbid:'+n.personal_id;var q=p===n.id,r=0;if(k.work_user_warning_dismiss_count!==undefined){var s=k.work_user_warning_dismiss_count;for(var t=Object.entries(s),u=Array.isArray(t),v=0,t=u?t:t[typeof Symbol==='function'?Symbol.iterator:'@@iterator']();;){var w;if(u){if(v>=t.length)break;w=t[v++];}else{v=t.next();if(v.done)break;w=v.value;}var x=w,y=x[0],z=x[1];if(y.toString()===n.fbid)r=Number(z);}}else return;var aa=c('MercuryIDs').getUserIDFromThreadID(k.thread_id);if(!o||!q||!aa||k.participants.length>2||!c('MercuryEmployeeDualityPreferences').duality_warning_gk_check||r>=h){m();return;}c('MercuryParticipants').getMulti(k.participants,function(ba){var ca=false,da=null;for(var ea in ba)if(ba[ea].personal_id&&aa===ba[ea].personal_id.toString()&&ba[ea].work_id&&ba[ea].employee){ca=true;da=ea;}if(ca&&da!==null){l(n,ba[da]);}else m();});});}};f.exports=i;}),null);
__d('ChatTabTypeaheadDataSource',['MercuryConfig','MercuryTypeaheadConstants','MercuryTypeaheadDataSource'],(function a(b,c,d,e,f,g){var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('MercuryTypeaheadDataSource'));i=h&&h.prototype;function j(k){'use strict';k=k||{};k.maxResults=c('MercuryTypeaheadConstants').COMPOSER_CHATTAB_MAX;i.constructor.call(this,k);this.$ChatTabTypeaheadDataSource1=true;}j.prototype.buildData=function(k){'use strict';var l=[],m=[],n=[],o=[],p=[],q=[];k.forEach(function(s){var t=i.getEntry.call(this,s);switch(t.render_type){case c('MercuryTypeaheadConstants').FRIEND_TYPE:l.push(s);break;case c('MercuryTypeaheadConstants').THREAD_TYPE:if(this.$ChatTabTypeaheadDataSource1)m.push(s);break;case c('MercuryTypeaheadConstants').NON_FRIEND_TYPE:n.push(s);break;case c('MercuryTypeaheadConstants').FB4C_TYPE:o.push(s);break;case c('MercuryTypeaheadConstants').PAGE_TYPE:if(this.$ChatTabTypeaheadDataSource1)if(c('MercuryConfig').LinkedAgents&&c('MercuryConfig').LinkedAgents.indexOf(s.toString())>-1){q.push(s);}else p.push(s);break;default:break;}}.bind(this),this);var r=q.concat(l,o,m,p,n);return i.buildData.call(this,r);};j.prototype.query=function(k,l,m,n){'use strict';return i.query.call(this,k,l,m,n);};j.prototype.respond=function(k,l,m){'use strict';return i.respond.call(this,k,l,m);};j.prototype.setShowThreads=function(k){'use strict';this.$ChatTabTypeaheadDataSource1=k;};f.exports=j;}),null);
__d('MNCommerceDialogContainer.react',['MNCommerceDialogStateStore','PureStoreBasedStateMixin','React'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'MNCommerceDialogContainer',mixins:[c('PureStoreBasedStateMixin')(c('MNCommerceDialogStateStore'))],statics:{calculateState:function i(){var j=c('MNCommerceDialogStateStore').getDialogContainer();return {dialogContainer:j};}},render:function i(){var j=this.state.dialogContainer;if(!j)return null;return c('React').createElement(j,null);}});f.exports=h;}),null);
__d('MNCommerceDialogContainerMount',['MNCommerceDialogContainer.react','React','ReactDOM'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={mount:function i(j){c('ReactDOM').render(c('React').createElement(c('MNCommerceDialogContainer.react'),null),j);}};f.exports=h;}),null);
__d('FBRTCConstants',['FBRTCStruct','keyMirror'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={OFFER:'offer',ANSWER:'answer',ICE_CANDIDATE:'ice_candidate',OK:'ok',PING:'ping',PING_ACK:'ping_ack',HANGUP:'hang_up',OTHER_DISMISS:'other_dismiss',MSG_ACK:'msg_ack',PRANSWER:'pranswer',ICERESTART_OFFER:'icerestart_offer',ICERESTART_ANSWER:'icerestart_answer',PCRESTART_OFFER:'pcrestart_offer',PCRESTART_ANSWER:'pcrestart_answer',SDP_UPDATE:'sdp_update',OFFER_ACK:'offer_ack',OFFER_NACK:'offer_nack',ANSWER_ACK:'answer_ack',SET_VIDEO:'set_video',VIDEO_REQUEST:'video_request',ACK:'ack'},i={AUDIO_ONLY:'audio_only',AUDIO_VIDEO:'audio_video',SCREEN_CONTENT:'screen'},j=c('keyMirror')({NO_VIDEO:null,LQ_VIDEO:null,SD_VIDEO:null,HD_VIDEO:null,CUSTOM_VIDEO:null}),k=new (c('FBRTCStruct'))([{IGNORE_CALL:'IgnoreCall'},{HANGUP_CALL:'HangupCall'},{IN_ANOTHER_CALL:'InAnotherCall'},{ACCEPT_AFTER_HANGUP:'CallEndAcceptAfterHangUp'},{NO_ANSWER_TIMEOUT:'NoAnswerTimeout'},{INCOMING_TIMEOUT:'IncomingTimeout'},{OTHER_INSTANCE_HANDLED:'OtherInstanceHandled'},{SIGNALING_MESSAGE_FAILED:'SignalingMessageFailed'},{CONNECTION_DROPPED:'ConnectionDropped'},{CLIENT_INTERRUPTED:'ClientInterrupted'},{WEBRTC_ERROR:'WebRTCError'},{CLIENT_ERROR:'ClientError'},{NO_PERMISSION:'NoPermission'},{OTHER_NOT_CAPABLE:'OtherNotCapable'},{NO_UI_ERROR:'NoUIShown'},{UNSUPPORTED_VERSION:'VersionUnsupported'},{CALLER_NOT_VISIBLE:'CallerNotVisible'},{CARRIER_BLOCKED:'CarrierBlocked'},{OTHER_CARRIER_BLOCKED:'OtherCarrierBlocked'}]),l={REMOTE_PEER_HANGUP:'CollabRemotePeerHangup',REMOTE_PEER_REJECT:'CollabRemotePeerReject',CLOSED_BY_MCU:'CollabClosedByMcu',CLOSED_AS_STALE:'CollabClosedAsStale',CALL_INITIALIZATION_FAILED:'CollabCallInitializationFailed',SIP_CONNECTION_INITIALIZATION_FAILED:'CollabSipConnectionInitializationFailed',LOST_MCU_CONNECTION:'CollabLostMcuConnection',MCU_NO_AUDIO_STREAM:'CollabMcuNoAudioStream',MCU_INVALID_STREAM_CONFIGURATION:'CollabMcuInvalidStreamConfiguration',UNKNOWN:'CollabUnknown'},m={TOGGLE_SELF_VIEW:5,SUBMIT_STAR_RATING:6,SUBMIT_FEEDBACK:7,START_CALL:9,OPEN_SCREEN_IN_NEW:10},n={ONE_HOUR:'1hour',UNTIL_EIGHT_AM:'8am',ALWAYS:'always'},o=c('keyMirror')({VIDEO:null,AUDIO:null,SCREEN_SHARE:null}),p={MULTIWAY:'multiway',P2P:'p2p'},q={PayloadType:h,StreamType:i,VideoQuality:j,CallEndReason:k,CollabCallEndSubreason:l,UIEventType:m,CallBlockingConstants:n,IncomingCallDialogTypes:o,SignalingProtocol:p,endCallReasonFromString:function r(s){return k.strNames.indexOf(s);},callEndReasonString:function r(s){if(s<0||s>k.strNames.length)return 'Unknown';return k.strNames[s];},fullCallEndReasonString:function r(s,t){return this.callEndReasonString(s)+'_'+(t?'remote':'local');}};f.exports=q;}),null);
__d('FBRTCIceStatsParser',[],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=null;i.getInstance=function(){'use strict';if(!h)h=new i();return h;};function i(){'use strict';}i.prototype.extractIceInfo=function(j){'use strict';var k=[],l=j.split("\r\n");for(var m=0;m<l.length;m++){var n=l[m];if(this.$FBRTCIceStatsParser1(n))k.push({gen:this.$FBRTCIceStatsParser2(n),type:this.$FBRTCIceStatsParser3(n)});}return k;};i.prototype.$FBRTCIceStatsParser1=function(j){'use strict';return j.indexOf('candidate:')>-1;};i.prototype.$FBRTCIceStatsParser2=function(j){'use strict';var k=0,l=j.match(/generation (\d+)/);if(l)k=parseInt(l[1],10);return k;};i.prototype.$FBRTCIceStatsParser3=function(j){'use strict';var k=j.match(/typ (host|relay|srflx|prflx)/);if(k){return k[1];}else return 'unknown';};f.exports=i;}),null);
__d('FBRTCCallSummary',['FBRTCConstants','FBRTCIceStatsParser','FBRTCLogger','UserAgentData','performanceNow'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=5*60*1000,i={CALL_STARTED:'started',POPUP_OPENED:'opened',SENT_OFFER:'s_o',RECV_OFFER:'r_o',SENT_OFFER_ACK:'s_oack',RECV_OFFER_ACK:'r_oack',SENT_RETRIED_OFFER:'s_o2',RECV_RETRIED_OFFER:'r_o2',SENT_RETRIED_OFFER_ACK:'s_oack2',RECV_RETRIED_OFFER_ACK:'r_oack2',SENT_PRANSWER:'s_pr',RECV_PRANSWER:'r_pr',NETWORK_READY:'network_ready',SENT_ANSWER:'s_a',RECV_ANSWER:'r_a',SENT_ANSWER_ACK:'s_aack',RECV_ANSWER_ACK:'r_aack',SENT_RETRIED_ANSWER:'s_a2',RECV_RETRIED_ANSWER:'r_a2',SENT_RETRIED_ANSWER_ACK:'s_aack2',RECV_RETRIED_ANSWER_ACK:'r_aack2',SENT_OK:'s_ok',RECV_OK:'r_ok',CALL_CONNECTED:'connected',CALL_ENDED:'ended'};j.CURRENT_SUMMARY_VERSION=19;function j(k){'use strict';this.peerID=k.peerID;this.callID=k.callID;this.$FBRTCCallSummary1=k.isCaller;this.$FBRTCCallSummary2=new Date().valueOf();this.$FBRTCCallSummary3=null;this.$FBRTCCallSummary4={};this.$FBRTCCallSummary5=null;this.$FBRTCCallSummary6=null;this.$FBRTCCallSummary7=null;this.$FBRTCCallSummary8=null;this.$FBRTCCallSummary9=null;this.$FBRTCCallSummary10=null;this.$FBRTCCallSummary11={};this.$FBRTCCallSummary12={};this.$FBRTCCallSummary13={};this.$FBRTCCallSummary14={};this.$FBRTCCallSummary15={};this.$FBRTCCallSummary16={};this.$FBRTCCallSummary17=c('performanceNow')();this.$FBRTCCallSummary18=0;this.$FBRTCCallSummary19={};this.$FBRTCCallSummary20=this.$FBRTCCallSummary17;this.$FBRTCCallSummary21=0;this.$FBRTCCallSummary22={};this.addExtraInfo(c('FBRTCLogger').Key.DEVICE_INFO,this.$FBRTCCallSummary23());this.$FBRTCCallSummary24();this.$FBRTCCallSummary25=c('FBRTCIceStatsParser').getInstance();this.$FBRTCCallSummary26=c('FBRTCLogger').getInstance();}j.prototype.toJsonString=function(){'use strict';this.$FBRTCCallSummary9=new Date().valueOf();return JSON.stringify({version:j.CURRENT_SUMMARY_VERSION,peerID:this.peerID,callID:this.callID,isCaller:this.$FBRTCCallSummary1,callType:this.$FBRTCCallSummary27,localVideoDuration:this.$FBRTCCallSummary28,remoteVideoDuration:this.$FBRTCCallSummary29,startTime:this.$FBRTCCallSummary2,trigger:this.$FBRTCCallSummary3,signalingTime:this.$FBRTCCallSummary4,endCallReason:this.$FBRTCCallSummary5,endCallSubreason:this.$FBRTCCallSummary6,isRemoteEnded:this.$FBRTCCallSummary7,lastUpdatedTime:this.$FBRTCCallSummary8,lastSerializedTime:this.$FBRTCCallSummary9,unsetOnRetrieve:this.$FBRTCCallSummary10,openCount:this.$FBRTCCallSummary21,extraInfo:this.$FBRTCCallSummary22,pcStats:this.$FBRTCCallSummary11,captureStats:this.$FBRTCCallSummary12,gen0IceSentCount:this.$FBRTCCallSummary13,gen0IceReceivedCount:this.$FBRTCCallSummary14,iceSentCount:this.$FBRTCCallSummary15,iceReceivedCount:this.$FBRTCCallSummary16,newSignalingTime:this.$FBRTCCallSummary19,accumulatedCallTime:this.$FBRTCCallSummary30()});};j.fromJsonString=function(k){'use strict';var l;try{l=JSON.parse(k);}catch(m){return null;}if(l.version!==j.CURRENT_SUMMARY_VERSION)return null;if(!l.hasOwnProperty('peerID')||!l.hasOwnProperty('callID')||!l.hasOwnProperty('isCaller')||!l.hasOwnProperty('startTime')||!l.hasOwnProperty('trigger')||!l.hasOwnProperty('signalingTime')||!l.hasOwnProperty('endCallReason')||!l.hasOwnProperty('isRemoteEnded')||!l.hasOwnProperty('lastUpdatedTime')||!l.hasOwnProperty('lastSerializedTime'))return null;var n=new j({peerID:l.peerID,callID:l.callID,isCaller:l.isCaller});n.$FBRTCCallSummary2=l.startTime;n.$FBRTCCallSummary3=l.trigger;n.$FBRTCCallSummary4=l.signalingTime;n.$FBRTCCallSummary5=l.endCallReason;n.$FBRTCCallSummary6=l.endCallSubreason;n.$FBRTCCallSummary7=l.isRemoteEnded;n.$FBRTCCallSummary8=l.lastUpdatedTime;n.$FBRTCCallSummary9=l.lastSerializedTime;if(l.callType)n.$FBRTCCallSummary27=l.callType;if(l.localVideoDuration)n.$FBRTCCallSummary28=l.localVideoDuration;if(l.remoteVideoDuration)n.$FBRTCCallSummary29=l.remoteVideoDuration;if(l.unsetOnRetrieve)n.$FBRTCCallSummary10=l.unsetOnRetrieve;if(l.openCount)n.$FBRTCCallSummary21=l.openCount;if(l.extraInfo)n.$FBRTCCallSummary22=l.extraInfo;if(l.pcStats)n.$FBRTCCallSummary11=l.pcStats;if(l.captureStats)n.$FBRTCCallSummary12=l.captureStats;if(l.gen0IceSentCount)n.$FBRTCCallSummary13=l.gen0IceSentCount;if(l.gen0IceReceivedCount)n.$FBRTCCallSummary14=l.gen0IceReceivedCount;if(l.iceSentCount)n.$FBRTCCallSummary15=l.iceSentCount;if(l.iceReceivedCount)n.$FBRTCCallSummary16=l.iceReceivedCount;if(l.newSignalingTime)n.$FBRTCCallSummary19=l.newSignalingTime;if(l.accumulatedCallTime)n.$FBRTCCallSummary18=l.accumulatedCallTime;return n;};j.restoreOrInitialize=function(k,l,m,n,o){'use strict';var p=k.retrieveCallSummary(l,m);if(!p){p=new j({peerID:l,callID:m,isCaller:n});if(o){p.onFullMessageReceived({msg:o});p.onOfferAckSent(o);}else p.onCallStarted(c('FBRTCLogger').Trigger.UNKNOWN);c('FBRTCLogger').getInstance().logError(l,m,'Missing call summary from storage');}else if(p.$FBRTCCallSummary10){p.$FBRTCCallSummary5=null;p.$FBRTCCallSummary6=null;p.$FBRTCCallSummary7=null;delete p.$FBRTCCallSummary4[i.CALL_ENDED];delete p.$FBRTCCallSummary19[i.CALL_ENDED];p.$FBRTCCallSummary10=null;}return p;};j.logSavedSummaries=function(k){'use strict';var l=k.getLoggableSummaries(),m=l.length;if(m<=0)return;var n=c('FBRTCLogger').getInstance(),o=[];for(var p=0;p<m;p++){var q=l[p];n.logEndCallSummary(q);o.push({peerID:q.peerID,callID:q.callID});}k.removeCallSummaries(o);n.logToConsole('Logged pending summaries: '+m);};j.prototype.save=function(k){'use strict';var l=c('performanceNow')(),m=l-this.$FBRTCCallSummary20;if(m>h){this.$FBRTCCallSummary26.logInfo(this.peerID,this.callID,'Summary too old: '+m);return;}k.storeCallSummary(this.peerID,this.callID,this);this.$FBRTCCallSummary20=l;};j.prototype.getLastUpdatedTime=function(){'use strict';return this.$FBRTCCallSummary8;};j.prototype.setLastUpdatedTime=function(k){'use strict';this.$FBRTCCallSummary8=k;};j.prototype.getExtraInfo=function(){'use strict';return this.$FBRTCCallSummary22;};j.prototype.addExtraInfo=function(k,l){'use strict';this.$FBRTCCallSummary22[k]=l;this.$FBRTCCallSummary24();};j.prototype.onCallStarted=function(k){'use strict';this.$FBRTCCallSummary3=k;this.$FBRTCCallSummary31(i.CALL_STARTED);this.$FBRTCCallSummary24();};j.prototype.onPopupOpened=function(){'use strict';this.$FBRTCCallSummary31(i.POPUP_OPENED);this.$FBRTCCallSummary21++;this.$FBRTCCallSummary24();};j.prototype.setPcStats=function(k){'use strict';this.$FBRTCCallSummary11=k;this.$FBRTCCallSummary24();};j.prototype.setVideoCaptureStats=function(k,l){'use strict';this.$FBRTCCallSummary12={w:k,h:l};this.$FBRTCCallSummary24();};j.prototype.setCallType=function(k){'use strict';this.$FBRTCCallSummary27=k;this.$FBRTCCallSummary24();};j.prototype.setVideoDurations=function(k,l){'use strict';this.$FBRTCCallSummary28=k;this.$FBRTCCallSummary29=l;this.$FBRTCCallSummary24();};j.prototype.onOfferAckSent=function(k){'use strict';this.onMessageSent({type:c('FBRTCConstants').PayloadType.OFFER_ACK,flag:k.flag});};j.prototype.onMessageSent=function(k){'use strict';var l=k.flag===1;switch(k.type){case c('FBRTCConstants').PayloadType.OFFER:this.$FBRTCCallSummary32(l,i.SENT_OFFER,i.SENT_RETRIED_OFFER);this.$FBRTCCallSummary33(k,this.$FBRTCCallSummary13,this.$FBRTCCallSummary15);break;case c('FBRTCConstants').PayloadType.ANSWER:this.$FBRTCCallSummary32(l,i.SENT_ANSWER,i.SENT_RETRIED_ANSWER);this.$FBRTCCallSummary33(k,this.$FBRTCCallSummary13,this.$FBRTCCallSummary15);break;case c('FBRTCConstants').PayloadType.OK:this.$FBRTCCallSummary31(i.SENT_OK);break;case c('FBRTCConstants').PayloadType.PRANSWER:this.$FBRTCCallSummary31(i.SENT_PRANSWER);break;case c('FBRTCConstants').PayloadType.OFFER_ACK:this.$FBRTCCallSummary32(l,i.SENT_OFFER_ACK,i.SENT_RETRIED_OFFER_ACK);break;case c('FBRTCConstants').PayloadType.ANSWER_ACK:this.$FBRTCCallSummary32(l,i.SENT_ANSWER_ACK,i.SENT_RETRIED_ANSWER_ACK);break;case c('FBRTCConstants').PayloadType.ICE_CANDIDATE:this.$FBRTCCallSummary33(k,this.$FBRTCCallSummary13,this.$FBRTCCallSummary15);break;default:}this.$FBRTCCallSummary24();};j.prototype.$FBRTCCallSummary33=function(k,l,m){'use strict';var n=null,o=null,p=this.$FBRTCCallSummary25.extractIceInfo(k.sdp);for(var q=0;q<p.length;q++){n=p[q].gen;o=p[q].type;if(n===0)this.$FBRTCCallSummary34(l,o);this.$FBRTCCallSummary34(m,o);}};j.prototype.$FBRTCCallSummary34=function(k,l){'use strict';if(!k[l]){k[l]=1;}else k[l]=k[l]+1;};j.prototype.$FBRTCCallSummary35=function(k){'use strict';if(k.isFromMobile())this.addExtraInfo(c('FBRTCLogger').Key.PEER_IS_MOBILE,'1');};j.prototype.onFullMessageReceived=function(k){'use strict';var l=k.msg,m=l.flag===1;switch(l.type){case c('FBRTCConstants').PayloadType.OFFER:this.$FBRTCCallSummary35(k);this.$FBRTCCallSummary32(m,i.RECV_OFFER,i.RECV_RETRIED_OFFER);this.$FBRTCCallSummary33(l,this.$FBRTCCallSummary14,this.$FBRTCCallSummary16);break;case c('FBRTCConstants').PayloadType.ANSWER:this.$FBRTCCallSummary35(k);this.$FBRTCCallSummary32(m,i.RECV_ANSWER,i.RECV_RETRIED_ANSWER);this.$FBRTCCallSummary33(l,this.$FBRTCCallSummary14,this.$FBRTCCallSummary16);break;case c('FBRTCConstants').PayloadType.OK:this.$FBRTCCallSummary31(i.RECV_OK);break;case c('FBRTCConstants').PayloadType.PRANSWER:this.$FBRTCCallSummary31(i.RECV_PRANSWER);break;case c('FBRTCConstants').PayloadType.OFFER_ACK:this.$FBRTCCallSummary32(m,i.RECV_OFFER_ACK,i.RECV_RETRIED_OFFER_ACK);break;case c('FBRTCConstants').PayloadType.ANSWER_ACK:this.$FBRTCCallSummary32(m,i.RECV_ANSWER_ACK,i.RECV_RETRIED_ANSWER_ACK);break;case c('FBRTCConstants').PayloadType.ICE_CANDIDATE:this.$FBRTCCallSummary33(l,this.$FBRTCCallSummary14,this.$FBRTCCallSummary16);break;default:}this.$FBRTCCallSummary24();};j.prototype.onMsgAckReceived=function(k,l){'use strict';var m=k.msg.flag===1;if(l){this.$FBRTCCallSummary32(m,i.RECV_OFFER_ACK,i.RECV_RETRIED_OFFER_ACK);}else this.$FBRTCCallSummary32(m,i.RECV_ANSWER_ACK,i.RECV_RETRIED_ANSWER_ACK);};j.prototype.onCallConnected=function(){'use strict';this.$FBRTCCallSummary31(i.NETWORK_READY);this.$FBRTCCallSummary31(i.CALL_CONNECTED);this.$FBRTCCallSummary24();};j.prototype.onCallEnded=function(k,l,m,n){'use strict';this.$FBRTCCallSummary10=m;this.$FBRTCCallSummary5=k;this.$FBRTCCallSummary6=n;this.$FBRTCCallSummary7=l;this.$FBRTCCallSummary31(i.CALL_ENDED);this.$FBRTCCallSummary24();};j.prototype.toString=function(){'use strict';var k={};k.core_metrics=this.$FBRTCCallSummary36();k.time_series=null;return JSON.stringify(k);};j.prototype.$FBRTCCallSummary36=function(){'use strict';var k={};k.ver=j.CURRENT_SUMMARY_VERSION;k.caller=this.$FBRTCCallSummary1;k.call_type=this.$FBRTCCallSummary27;k.conn=this.$FBRTCCallSummary37();k.peer_id=this.peerID;k.has_video=true;k.open_count=this.$FBRTCCallSummary21;k.signaling=this.$FBRTCCallSummary38();k.sender=this.$FBRTCCallSummary39();k.receiver=this.$FBRTCCallSummary40();k.end=this.$FBRTCCallSummary41();k.video=this.$FBRTCCallSummary42();return k;};j.prototype.$FBRTCCallSummary37=function(){'use strict';var k={dtls:1};if(this.$FBRTCCallSummary11.sender&&this.$FBRTCCallSummary11.sender.rtt)k.rtt=this.$FBRTCCallSummary11.sender.rtt;return k;};j.prototype.$FBRTCCallSummary38=function(){'use strict';var k={};if(this.$FBRTCCallSummary3)k.trigger=this.$FBRTCCallSummary3;k.start_time=this.$FBRTCCallSummary2;k.time_from_start=this.$FBRTCCallSummary4;var l=this.$FBRTCCallSummary4[i.CALL_CONNECTED],m=this.$FBRTCCallSummary4[i.CALL_ENDED];if(l){if(!m)if(this.$FBRTCCallSummary9){m=this.$FBRTCCallSummary9-this.$FBRTCCallSummary2;}else m=this.$FBRTCCallSummary43();var n=m-l;if(n>0)k.duration=n;}k.new_time_from_start=this.$FBRTCCallSummary19;l=this.$FBRTCCallSummary19[i.CALL_CONNECTED];m=this.$FBRTCCallSummary19[i.CALL_ENDED];if(l){if(!m)if(this.$FBRTCCallSummary18>0){m=this.$FBRTCCallSummary18;}else m=this.$FBRTCCallSummary30();n=m-l;if(n>0)k.new_duration=n;}return k;};j.prototype.$FBRTCCallSummary39=function(){'use strict';var k={};if(this.$FBRTCCallSummary13)k.ice_g0=this.$FBRTCCallSummary13;if(this.$FBRTCCallSummary15)k.ice=this.$FBRTCCallSummary15;if(this.$FBRTCCallSummary11.sender)Object.assign(k,this.$FBRTCCallSummary11.sender);return k;};j.prototype.$FBRTCCallSummary40=function(){'use strict';var k={};if(this.$FBRTCCallSummary14)k.ice_g0=this.$FBRTCCallSummary14;if(this.$FBRTCCallSummary16)k.ice=this.$FBRTCCallSummary16;return k;};j.prototype.$FBRTCCallSummary41=function(){'use strict';var k={};if(this.$FBRTCCallSummary5!==null){k.end_call_reason_string=c('FBRTCConstants').callEndReasonString(this.$FBRTCCallSummary5);if(this.$FBRTCCallSummary6!==null)k.end_call_subreason_string=this.$FBRTCCallSummary6;k.remote_ended=this.$FBRTCCallSummary7;}if(this.$FBRTCCallSummary11.end)Object.assign(k,this.$FBRTCCallSummary11.end);return k;};j.prototype.$FBRTCCallSummary42=function(){'use strict';var k={capture:{}};if(this.$FBRTCCallSummary11.video&&this.$FBRTCCallSummary11.video.sender)Object.assign(k,this.$FBRTCCallSummary11.video.sender);if(this.$FBRTCCallSummary12)Object.assign(k.capture,this.$FBRTCCallSummary12);return {sender:k,ld:this.$FBRTCCallSummary28,rd:this.$FBRTCCallSummary29};};j.prototype.$FBRTCCallSummary43=function(){'use strict';return new Date().valueOf()-this.$FBRTCCallSummary2;};j.prototype.$FBRTCCallSummary30=function(){'use strict';var k=c('performanceNow')()-this.$FBRTCCallSummary17;return Math.floor(this.$FBRTCCallSummary18+k);};j.prototype.$FBRTCCallSummary31=function(k){'use strict';if(this.$FBRTCCallSummary4[k])return;this.$FBRTCCallSummary4[k]=this.$FBRTCCallSummary43();this.$FBRTCCallSummary19[k]=this.$FBRTCCallSummary30();};j.prototype.$FBRTCCallSummary32=function(k,l,m){'use strict';if(k){this.$FBRTCCallSummary31(m);}else this.$FBRTCCallSummary31(l);};j.prototype.$FBRTCCallSummary24=function(){'use strict';this.$FBRTCCallSummary8=new Date().valueOf();};j.prototype.$FBRTCCallSummary23=function(){'use strict';return {device:c('UserAgentData').deviceName,os:c('UserAgentData').platformName,os_version:c('UserAgentData').platformFullVersion,browser:c('UserAgentData').browserName,browser_version:c('UserAgentData').browserFullVersion,screen_height:window.screen.availHeight,screen_width:window.screen.availWidth};};f.exports=j;}),null);
__d('FBRTCCallSummaryStore',['CacheStorage','FBRTCCallSummary','FBRTCLogger','areEqual'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h='localstorage',i='RTC_CALL_SUMMARY_',j='summary',k=2000,l=3,m=3*60*1000,n=null;o.getInstance=function(){'use strict';if(!n)n=new o();return n;};function o(){'use strict';this.$FBRTCCallSummaryStore1=new (c('CacheStorage'))(h,i);this.$FBRTCCallSummaryStore2=c('FBRTCLogger').getInstance();}o.prototype.storeCallSummary=function(p,q,r){'use strict';var s=this;this.$FBRTCCallSummaryStore3(function(t){if(!t[p])t[p]={};var u=t[p][q];if(u){var v=s.$FBRTCCallSummaryStore4(u);if(v&&v.getLastUpdatedTime()>r.getLastUpdatedTime()){s.$FBRTCCallSummaryStore2.logToConsole('Outdated summaries');return null;}}t[p][q]=s.$FBRTCCallSummaryStore5(r);return t;},s.$FBRTCCallSummaryStore2.logError.bind(s.$FBRTCCallSummaryStore2,p,q));};o.prototype.retrieveCallSummary=function(p,q){'use strict';var r=this.$FBRTCCallSummaryStore6(),s=null;if(r[p])s=r[p][q];if(s){return this.$FBRTCCallSummaryStore4(s);}else return null;};o.prototype.removeCallSummary=function(p,q){'use strict';this.removeCallSummaries([{peerID:p,callID:q}]);};o.prototype.removeCallSummaries=function(p){'use strict';var q=this;this.$FBRTCCallSummaryStore3(function(r){var s=p.length;for(var t=0;t<s;t++){var u=p[t].peerID,v=p[t].callID;if(r[u]&&r[u][v]){delete r[u][v];if(q.$FBRTCCallSummaryStore7(r[u]))delete r[u];}}return r;},q.$FBRTCCallSummaryStore2.logError.bind(q.$FBRTCCallSummaryStore2,null,null));};o.prototype.getLoggableSummaries=function(){'use strict';var p=this.$FBRTCCallSummaryStore6(),q=[];for(var r in p)if(p.hasOwnProperty(r))for(var s in p[r])if(p[r].hasOwnProperty(s)){var t=this.$FBRTCCallSummaryStore4(p[r][s],m);if(t)q.push(t);}return q;};o.prototype.$FBRTCCallSummaryStore7=function(p){'use strict';for(var q in p)if(p.hasOwnProperty(q))return false;return true;};o.prototype.$FBRTCCallSummaryStore5=function(p){'use strict';var q={__t:Date.now(),__d:p.toJsonString()};return q;};o.prototype.$FBRTCCallSummaryStore4=function(p,q){'use strict';if(p)if(!q||Date.now()-p.__t>=q)return c('FBRTCCallSummary').fromJsonString(p.__d);return null;};o.prototype.$FBRTCCallSummaryStore6=function(){'use strict';var p=this.$FBRTCCallSummaryStore1.get(j)||{};return p;};o.prototype.$FBRTCCallSummaryStore3=function(p,q,r,s){'use strict';if(r===undefined||r===null)r=l;var t=this.$FBRTCCallSummaryStore6(),u=this.$FBRTCCallSummaryStore6(),v=p(t);if(v===null)return;var w=this.$FBRTCCallSummaryStore6();if(c('areEqual')(u,w)){this.$FBRTCCallSummaryStore1.set(j,v);this.$FBRTCCallSummaryStore2.logToConsole('Updated summaries');}else if(r>0){q('Retry lock');if(s){var x=this;setTimeout(function(){x.$FBRTCCallSummaryStore3(p,q,r-1,true);},k);}else this.$FBRTCCallSummaryStore3(p,q,r-1,true);}else q('Failed to lock');};f.exports=o;}),null);
__d('FBRTCCallSummaryUploader',['Banzai','FBRTCCallSummary','FBRTCCallSummaryStore'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h={init:function i(){var j=c('FBRTCCallSummaryStore').getInstance();c('Banzai').subscribe(c('Banzai').SEND,function(){c('FBRTCCallSummary').logSavedSummaries(j);});}};f.exports=h;}),null);
__d('P2PDialogStore',['EventEmitter','P2PActionConstants','P2PDispatcher'],(function a(b,c,d,e,f,g){'use strict';var h,i;if(c.__markCompiled)c.__markCompiled();var j=void 0,k={};h=babelHelpers.inherits(l,c('EventEmitter'));i=h&&h.prototype;function l(){i.constructor.call(this);j=c('P2PDispatcher').register(this.onEventDispatched.bind(this));k={dialogClass:null,dialogProps:null};}l.prototype.getState=function(){return k;};l.prototype.onEventDispatched=function(m){var n=m.type,o=m.data;switch(n){case c('P2PActionConstants').DIALOG_SHOWN:k.dialogClass=o.dialogClass;k.dialogProps=o.dialogProps;this.emit('change');break;case c('P2PActionConstants').DIALOG_CLOSED:k.dialogClass=null;k.dialogProps=null;this.emit('change');break;}};f.exports=new l();}),null);
__d('P2PDialogContainer.react',['P2PDialogStore','React'],(function a(b,c,d,e,f,g){'use strict';var h,i;if(c.__markCompiled)c.__markCompiled();h=babelHelpers.inherits(j,c('React').Component);i=h&&h.prototype;function j(){var k,l;for(var m=arguments.length,n=Array(m),o=0;o<m;o++)n[o]=arguments[o];return k=(l=i.constructor).call.apply(l,[this].concat(n)),this.state=c('P2PDialogStore').getState(),this.onDialogStoreChange=function(){this.setState(c('P2PDialogStore').getState());}.bind(this),k;}j.prototype.componentDidMount=function(){this.dialogStoreSub=c('P2PDialogStore').addListener('change',this.onDialogStoreChange);};j.prototype.componentWillUnmount=function(){if(this.dialogStoreSub){this.dialogStoreSub.remove();this.dialogStoreSub=null;}};j.prototype.render=function(){if(!this.state.dialogClass)return null;var k=this.state.dialogClass;return c('React').createElement(k,babelHelpers['extends']({},this.state.dialogProps,{key:'dialog'}));};f.exports=j;}),null);
__d('P2PDialogContainerMount',['P2PDialogContainer.react','React','ReactDOM'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={mount:function i(j){c('ReactDOM').render(c('React').createElement(c('P2PDialogContainer.react'),null),j);}};f.exports=h;}),null);
__d('PagesPlatformActionConstants',[],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={BOOKING_REQUEST_ACCEPT_ERROR:'booking_request_accept_error',BOOKING_REQUEST_ACCEPT_INITIATED:'booking_request_accept_initiated',BOOKING_REQUEST_ACCEPTED:'booking_request_accepted',BOOKING_REQUEST_CREATED:'booking_request_created',BOOKING_REQUEST_DECLINE_ERROR:'booking_request_decline_error',BOOKING_REQUEST_DECLINE_INITIATED:'booking_request_decline_initiated',BOOKING_REQUEST_DECLINED:'booking_request_declined',BOOKING_REQUEST_RESCHEDULE_INITIATED:'booking_request_reschedule_initiated',BOOKING_REQUEST_RESCHEULED:'booking_request_reschedule',DIALOG_CLOSED:'dialog_closed',DIALOG_SHOWN:'dialog_shown',NEW_TIME_CHOSEN:'new_time_chosen'};f.exports=h;}),null);
__d('PagesPlatformRequestDispatcher',['Dispatcher_DEPRECATED'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();f.exports=new (c('Dispatcher_DEPRECATED'))();}),null);
__d('PagesPlatformDialogStore',['EventEmitter','PagesPlatformActionConstants','PagesPlatformRequestDispatcher'],(function a(b,c,d,e,f,g){'use strict';var h,i;if(c.__markCompiled)c.__markCompiled();var j={};h=babelHelpers.inherits(k,c('EventEmitter'));i=h&&h.prototype;function k(){i.constructor.call(this);c('PagesPlatformRequestDispatcher').register(this.onEventDispatched.bind(this));j={dialogClass:null,dialogProps:null};}k.prototype.getState=function(){return j;};k.prototype.onEventDispatched=function(l){var m=l.type,n=l.data;switch(m){case c('PagesPlatformActionConstants').DIALOG_SHOWN:j.dialogClass=n.dialogClass;j.dialogProps=n.dialogProps;this.emit('change');break;case c('PagesPlatformActionConstants').DIALOG_CLOSED:j.dialogClass=null;j.dialogProps=null;this.emit('change');break;}};f.exports=new k();}),null);
__d('PagesPlatformDialogContainer.react',['PagesPlatformDialogStore','PureStoreBasedStateMixin','React'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').createClass({displayName:'PagesPlatformDialogContainer',mixins:[c('PureStoreBasedStateMixin')(c('PagesPlatformDialogStore'))],statics:{calculateState:function i(){return c('PagesPlatformDialogStore').getState();}},render:function i(){if(!this.state.dialogClass)return null;var j=this.state.dialogClass;return c('React').createElement(j,babelHelpers['extends']({},this.state.dialogProps,{key:'dialog'}));}});f.exports=h;}),null);
__d('PagesPlatformDialogContainerMount',['PagesPlatformDialogContainer.react','React','ReactDOM'],(function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h={mount:function i(j){c('ReactDOM').render(c('React').createElement(c('PagesPlatformDialogContainer.react'),null),j);}};f.exports=h;}),null);