if (self.CavalryLogger) { CavalryLogger.start_js(["LS+ZH"]); } __d("NotifTestIDs",[],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={REACT_BLUE_BAR_JEWEL:"react_blue_bar_jewel",NON_REACT_BLUE_BAR_JEWEL:"non_react_blue_bar_jewel",REACT_NOTIF_LIST:"react_notif_list",SEE_ALL_LIST:"see_all_list",REACT_NOTIF_JEWEL_FLYOUT:"react_notif_jewel_flyout",NON_REACT_NOTIF_JEWEL_FLYOUT:"non_react_notif_jewel_flyout",CHEVRON:"chevron",REACT_MARK_ALL_AS_READ_LINK:"react_mark_all_as_read_link",NON_REACT_MARK_ALL_AS_READ_LINK:"non_react_mark_all_as_read_link",NOTIFICATION_SOUND_SETTING:"notifiation_sound_setting",NOTIFICATION_SOUND_SETTING_SELECTOR:"notifiation_sound_setting_selector",MESSAGE_SOUND_SETTING:"message_sound_setting",MESSAGE_SOUND_SETTING_SELECTOR:"message_sound_setting_selector",CLOSE_FRIEND_ACTIVITY_SELECTOR:"close_friend_activity_selector",BIRTHDAY_SELECTOR:"birthday_selector",ON_THIS_DAY_SELECTOR:"on_this_day_selector",TAGS_SELECTOR:"tags_selector",LIVE_VIDEO_SELECTOR:"live_video_selector",REACT_BADGE_COUNT_CONTAINER:"react_badge_count_container",NON_REACT_BADGE_COUNT_CONTAINER:"non_react_badge_count_container",BEEPER_LIST:"beeper_list",NON_REACT_SETTING_LINK:"non_react_setting_link",REACT_SETTING_LINK:"react_setting_link"};}),null); __d("NotificationConstants",[],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();f.exports={PayloadSourceType:{UNKNOWN:0,USER_ACTION:1,LIVE_SEND:2,ENDPOINT:3,INITIAL_LOAD:4,OTHER_APPLICATION:5,SYNC:6,CLIENT:7}};}),null); __d('NotificationStore',['BizSiteIdentifier.brands','BusinessUserConf','KeyedCallbackManager','NotificationConstants','NotificationUpdates','RangedCallbackManager','MercuryServerDispatcher'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=function m(n){this.notifications=new (c('KeyedCallbackManager'))();var o=function p(q){var r=this.notifications.getResource(q);return r.creation_time;};this.order=new (c('RangedCallbackManager'))(o.bind(this),function(p,q){return q-p;});this.graphQLPageInfo={};},i=c('BizSiteIdentifier.brands').isBizSite()?c('BizSiteIdentifier.brands').getBusinessID():null;c('NotificationUpdates').subscribe('update-notifications',function(m,n){var o=n.endpoint||k;if(n.page_info)j[o].graphQLPageInfo=n.page_info;if(n.nodes===undefined)return;var p,q=[],r={},s=n.nodes||[],t;s.forEach(function(u){p=u.alert_id;t=j[o].notifications.getResource(p);if(!t||t.creation_time0?!!('business_ids_user_pref' in w?w.business_ids_user_pref[c('BizSiteIdentifier.brands').getBusinessID()]:w.business_ids[c('BizSiteIdentifier.brands').getBusinessID()]):!c('BizSiteIdentifier.brands').isBizSite();});},_filterNodesBasedOnBusinessUser:function u(v,w){return v.filter(function(x){return w==x.biz_user_id;});}});c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('notification_json'),function(u,v){var w=Date.now(),x=v.obj.nodes;if(x){x.forEach(function(y){y.receivedTime=w;});o.debug('notifications_received',x);t.handleUpdate(c('NotificationConstants').PayloadSourceType.LIVE_SEND,v.obj);}});c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('notifications_seen'),function(u,v){var w=c('NotificationTokens').tokenizeIDs(v.obj.alert_ids);t.handleUpdate(c('NotificationConstants').PayloadSourceType.LIVE_SEND,{seenState:c('createObjectFrom')(w)});});c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('notifications_read'),function(u,v){var w=c('NotificationTokens').tokenizeIDs(v.obj.alert_ids);t.handleUpdate(c('NotificationConstants').PayloadSourceType.LIVE_SEND,{readState:c('createObjectFrom')(w)});});c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('notification_hidden'),function(u,v){var w=c('NotificationTokens').tokenizeIDs([v.obj.notif_id+'']);t.handleUpdate(c('NotificationConstants').PayloadSourceType.LIVE_SEND,{HiddenState:c('createObjectFrom')(w)});});f.exports=t;}),null); __d("XNotificationsOptionsController",["XController"],(function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports=c("XController").create("\/notifications\/feedback\/option\/",{notif_id:{type:"Int",required:true},undo:{type:"Bool",defaultValue:false},server_action:{type:"String",required:true},biz_user_id:{type:"Int"}});}),null); __d('NotificationUserActions',['AsyncRequest','BusinessUserConf','NotificationConstants','NotificationStore','NotificationTokens','NotificationUpdates','URI','XNotificationsOptionsController','createObjectFrom','emptyFunction'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('NotificationConstants').PayloadSourceType.USER_ACTION,i='mark_spam',j='turn_off',k='undo',l='original_subscription_level',m=false;function n(t){t.biz_user_id=c('BusinessUserConf').biz_user_id;new (c('AsyncRequest'))('/ajax/notifications/mark_read.php').setData(t).send();}function o(t){var u={};t.forEach(function(v,w){u['alert_ids['+w+']']=v;});return u;}function p(t,u,v,w,x){var y=c('NotificationTokens').untokenizeIDs([t])[0],z={notification_id:y,client_rendered:true,request_type:u};Object.assign(z,v);new (c('AsyncRequest'))('/ajax/notifications/negative_req.php').setData(z).setHandler(w||c('emptyFunction')).setErrorHandler(x||c('emptyFunction')).send();}function q(t,u,v,w,x){var y=c('XNotificationsOptionsController').getURIBuilder().setInt('notif_id',c('NotificationTokens').untokenizeIDs([t])[0]).setInt('biz_user_id',c('BusinessUserConf').biz_user_id).setBool('undo',w).setString('server_action',x).getURI(),z=function aa(ba){if(!ba.payload)throw new Error('No response from notif option!');c('NotificationUpdates').handleUpdate(h,{hiddenState:c('createObjectFrom')([t],!ba.payload.visible)});u(ba.payload);};new (c('AsyncRequest'))(y).setHandler(z||c('emptyFunction')).setErrorHandler(v||c('emptyFunction')).send();}function r(t,u,v,w,x){var y=x?k:j;c('NotificationStore').getAll(function(z){var aa=Object.keys(z).filter(function(ba){var ca=z[ba];return !!(ca.application&&ca.application.id&&ca.application.id==u);});p(t,y,null,function(ba){v(ba);c('NotificationUpdates').handleUpdate(h,{hiddenState:c('createObjectFrom')(aa,!x)});},w);});}var s={markNotificationsAsSeen:function t(u){var v=document.getElementById('notificationsCountValue'),w=null;if(v)w=v.innerText;c('NotificationUpdates').handleUpdate(h,{seenState:c('createObjectFrom')(u)});var x=c('NotificationTokens').untokenizeIDs(u),y=o(x);y.seen=true;if(w)y.badgeCount=w;n(y);},setNextIsFromReadButton:function t(u){m=u;},markNotificationsAsRead:function t(u){c('NotificationUpdates').handleUpdate(h,{readState:c('createObjectFrom')(u)});var v=c('NotificationTokens').untokenizeIDs(u),w=o(v);if(m){w.from_read_button=true;m=false;}n(w);},sendNotifOption:function t(u,v,w,x){q(u,v,w,false,x);},undoNotifOption:function t(u,v,w,x){q(u,v,w,true,x);},markNotificationAsHidden:function t(u,v,w){c('NotificationUpdates').handleUpdate(h,{hiddenState:c('createObjectFrom')([u])});p(u,j,null,v,w);},markNotificationAsVisible:function t(u,v,w,x){c('NotificationUpdates').handleUpdate(h,{hiddenState:c('createObjectFrom')([u],false)});var y=null;if(v!==null){y={};y[l]=v;}p(u,k,y,w,x);},markNotificationAsSpam:function t(u,v,w){c('NotificationUpdates').handleUpdate(h,{hiddenState:c('createObjectFrom')([u],true)});p(u,i,null,v,w);},markAppAsHidden:function t(u,v,w,x){var y=false;r(u,v,w,x,y);},markAppAsVisible:function t(u,v,w,x){var y=true;r(u,v,w,x,y);}};f.exports=s;}),null); __d('EXHPLeftNavController',['cx','csx','Arbiter','Bootloader','Event','Parent','UIPagelet','emptyFunction','requireWeak'],(function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=void 0;function k(){if(!j){j=true;c('Bootloader').loadModules(["LeftNavActions","BookmarkPopoverMenu.react","LeftNavDragController","LeftNavItemDraggableBehavior"],c('emptyFunction'),'EXHPLeftNavController');}}var l=void 0;function m(){if(!l){l=true;c('UIPagelet').loadFromEndpoint('ReactLeftNavPagelet','pagelet_navigation').setHandler(function(){l=false;if(o){o.remove();o=null;}});}}var n={},o=void 0,p={init:function t(u){o=c('Event').listen(u,'click',function(event){var v=event.target,w=c('Parent').byAttribute(v,'data-nav-item-id');if(!w)return;var x=w.getAttribute('data-nav-item-id'),y=c('Parent').bySelector(v,"._26tg");if(y){q(y,x);event.preventDefault();}else r(w,x);});},consumeDidHaveClick:function t(u){var v=n[u];delete n[u];return !!v;}};function q(t,u){t.parentNode.replaceChild(s(),t);n[u]=true;k();m();}function r(t,u){var v=t.querySelector('.countValue');v&&v.remove();if(t.getAttribute('data-type')==='type_explore_feed'){m();c('requireWeak')('LeftNavController',function(w){c('Arbiter').inform('LeftNavController/topicFeedClick',u);});}}function s(){var t=document.createElement('span');t.className="_2ita _55ym _55yn _55yo";return t;}f.exports=p;}),null); __d('RequestsJewelStore',['Arbiter','ArbiterMixin','ChannelConstants'],(function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=babelHelpers['extends']({},c('ArbiterMixin'),{_initialized:false,_count:0,_requestList:{},addFriendRequests:function i(j){Object.assign(this._requestList,j);},getRequestListKeys:function i(){return Object.keys(this._requestList);},removeRequest:function i(j){delete this._requestList[j];},getRequestCount:function i(j){return this.getRequestListKeys().length;},decrementCount:function i(){this.setCount(Math.max(0,this._count-1));},setCount:function i(j){c('Arbiter').inform('jewel/count-updated',{jewel:'requests',count:j},c('Arbiter').BEHAVIOR_STATE);},setupListeners:function i(){if(this._initialized)return;this._initialized=true;c('Arbiter').subscribe('jewel/count-updated',function(j,k){k.jewel==='requests'&&this._updateCount(k.count);}.bind(this));c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('jewel_requests_add'),function(j,k){return this._addRequest(k);}.bind(this));c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('jewel_friending_notifs'),function(j,k){return this._addNotification(k);}.bind(this));c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('jewel_requests_remove_old'),function(j,k){return this._removeOldRequest(k);}.bind(this));c('Arbiter').subscribe(c('ChannelConstants').getArbiterType('friend_requests_seen'),function(j,k){return this.setCount(0);}.bind(this));},_updateCount:function i(j){var k=this._count!==j;this._count=j;if(k)this.inform('countUpdated',j);},_addRequest:function i(j){if(!j)return;var k=j.obj,l=k.from,m=k.suggester,n=this._requestList[l];if(!n)this.setCount(this._count+1);var o=n?n.type:null,p=o===19&&!m;this.inform('addRequest',{shouldReplace:p,previousType:o});},_addNotification:function i(j){if(!j||j.obj.notif_type!=='friend_confirmed')return;this.inform('addNotification');},_removeOldRequest:function i(j){if(!j)return;var k=this._requestList[j.obj.from];if(!k)return;this.inform('removeOldRequest',k);}});f.exports=h;}),null);