Build 545032stable
Module 772162
1,247 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>_});var i=n(439372),r=n(815706),s=n(592598),a=n(672396),o=n(652215);let l=null,u=new Map,c=null;class d extends i.A{_initialize(){l=null,u.clear(),c=null}_terminate(){l=null,u.clear(),c=null}handleOverlayMounted=e=>{l=Date.now()};handleNotificationEvent=e=>{if(e.action!==a.uj.Viewed)return;let t=Date.now(),n=e.notificationType;c={timestamp:t,notificationType:n},u.set(n,t)};handleSetNotificationDisabledSetting=e=>{let{shouldTrack:t,setting:n,disabled:i}=e;if(!t)return;let a=Date.now(),d=null!=l?a-l:null,_=null,f=null;for(let[e,t]of u.entries()){let i=s.A.getDisabledSettingByNotificationType(e);if(null!=i&&i===n){let n=a-t;(null==_||n<_)&&(_=n,f={notificationType:e,timestamp:t})}}let h=null!=c&&null!=f&&c.notificationType===f.notificationType&&c.timestamp===f.timestamp;(0,r.z)(o.HAw.OVERLAY_NOTIFICATION_SETTING_UPDATED,{setting:n,disabled:i,time_since_last_seen_overlay:d,time_since_last_seen_notification:_,is_most_recent_notification:h,most_recent_notification_type:f?.notificationType})};actions={OVERLAY_SET_NOTIFICATION_DISABLED_SETTING:this.handleSetNotificationDisabledSetting,OVERLAY_MOUNTED:this.handleOverlayMounted,OVERLAY_NOTIFICATION_EVENT:this.handleNotificationEvent}}let _=new d}