/*!CK:2511093640!*//*1438092926,*/

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

__d("Network",["mixInEventEmitter"],function(a,b,c,d,e,f,g){b.__markCompiled&&b.__markCompiled();var h=true,i=a.navigator.connection,j={0:'unknown',1:'ethernet',2:'wifi',3:'2g',4:'3g'};function k(){return h;}function l(q){if(q==h)return;h=q;p.emit(q?'online':'offline');}function m(){return i?i.bandwidth:(h?Infinity:0);}function n(){return i?i.metered:false;}function o(){var q=i?String(i.type):'0';return j[q]||q;}var p={getBandwidth:m,getType:o,isMetered:n,isOnline:k,setOnline:l};g(p,{online:true,offline:true});if(a.addEventListener){a.addEventListener('online',l.bind(null,true));a.addEventListener('offline',l.bind(null,false));}else if(a.attachEvent){a.attachEvent('online',l.bind(null,true));a.attachEvent('offline',l.bind(null,false));}e.exports=p;},null);
__d("ChannelMonitor",["Clock","CurrentUser","MChannelManager","MSession","Network","BanzaiScuba","StateMachine","setIntervalAcrossTransitions"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){b.__markCompiled&&b.__markCompiled();var o=1000,p='mchannel',q,r,s,t,u;function v(){u=Date.now();}function w(ba){s=ba.name;t=ba.status||ba.progress;if(!u){v();n(z,o);}if(ba.progress==m.ENTERED){r=Date.now();q=new l(p,null,{addBrowserFields:true}).addNormal('state',s).addNormal('online',k.isOnline()).addNormal('push_phase',j.push_phase).addDenorm('user',h.getID());}else if(ba.progress==m.EXITED)if(q){q.addNormal('substate',ba.status).addInteger('duration',Date.now()-r).post();q=null;}}var x;function y(){var ba=new l(p+'_rollup',null,{addBrowserFields:true});for(var ca in x)ba.addInteger(ca,x[ca]);x=null;ba.post();}function z(){if(g.isAnomalous()){v();return;}var ba=Date.now();x=x||{total:0};var ca=ba-u;u=ba;if(ca<0||ca>o*2)return;var da=s;if(t==m.PENDING)da+='_pending';x.total+=ca;x[da]=(x[da]||0)+ca;if(k.isOnline())x.online=(x.online||0)+ca;if(x.total>=o*30)y();}function aa(){g.addListener(g.ANOMALY,v);if(!i.xhrEnabled)return;i.addListener(m.ENTER,w);i.addListener(m.EXIT,w);}f.init=aa;},null);
__d("MChannelIndicator",["setTimeoutAcrossTransitions","Clock","JSXDOM","MBugNub","MChannelManager","MPageController","MViewport","Network","StateMachine","cx","fbt","ChannelClientConfig","LogHistory"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q){b.__markCompiled&&b.__markCompiled();var r=b('ChannelClientConfig').config,s=b('LogHistory').getInstance('channel'),t=(r&&r.INDICATOR_TOLERANCE)||17000,u,v;function w(){if(!j.isReportURI()){j.captureState();l.forceLoad(j.getReportURI('ChannelMonitor'));}}function x(aa){if(v){clearTimeout(v);v=null;}var ba="_5572"+(aa?' show':'');if(aa&&!u){u=i.div(null,q._("Chat is disconnected. {report-this link} if this is unexpected.",[q.param("report-this link",i.strong(null,q._("Report this")))]));u.onclick=w;m.appendNode(u);}if(u&&u.className!=ba){u.className=ba;s.log('indicator '+aa);}}function y(){v=null;x(true);}function z(aa){var ba=aa.name,ca=aa.status||aa.progress,da=ba=='reconnect'||ba=='stall'||ca=='error';da=da&&n.isOnline();if(!da){x(false);}else if(da&&!v)v=g(y,t);}k.addListener(o.ENTER,z);k.addListener(o.EXIT,z);h.addListener(h.ANOMALY,x.bind(null,false));f.setVisible=x;},null);