/*1357656548,173217629*/

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

/** js/notifications/modules/MinNotifications.js */
__d("MinNotifications",["Event","Arbiter","AsyncSignal","Banzai","BanzaiODS","CSS","Parent","UIPagelet","URI","$","emptyFunction"],function(a,b,c,d,e,f){


var g=b('Event'),

h=b('Arbiter'),
i=b('AsyncSignal'),
j=b('Banzai'),
k=b('BanzaiODS'),
l=b('CSS'),
m=b('Parent'),
n=b('UIPagelet'),
o=b('URI'),

p=b('$'),
q=b('emptyFunction'),





r=null;

function s(){
w.fetched=q.thatReturnsTrue;
r&&l.removeClass(r,'hasNew');
new i
(o('/ajax/notifications/mark_read.php').
getQualifiedURI().
toString(),
{seen:1}).
send();}









function t(){
n.loadFromEndpoint
('NotificationsJewelPageletController',
'fbNotificationsList',
{},
{crossPage:true,handler:s});}






var u=p('fbNotificationsList'),
v=g.listen
(u,'click',function(x){

if(window.presenceNotifications){
v.remove();
return;}



var y=m.byTag(x.getTarget(),'li'),
z=y&&
y.getAttribute('id').replace('notification_','');
if(z){




l.removeClass(y,'jewelItemNew');

new i
(o('/ajax/notifications/mark_read.php').
getQualifiedURI().
toString(),
{'alert_ids[0]':z,seen:1}).
send();}

if(j.isEnabled('notifications'))
k.bumpEntityKey('notifications','click');}),





w=a.MinNotifications||
{fetchSent:q.thatReturnsFalse,
fetched:q.thatReturnsFalse,
bootstrap:function(x){
w.bootstrap=q;
if(window.presenceNotifications)
return;

r=m.byClass(x,'fbJewel');
w.fetchSent=q.thatReturnsTrue;

r&&!l.hasClass(r,'hasNew')?

t():

h.subscribe('fbNotificationsList_wrapper_displayed',s);}};





e.exports=a.MinNotifications=w;});
