Live
“,e+=”
“),e+=”
“,e}function getVariant(){var a=window.NYTD&&window.NYTD.Abra&&window.NYTD.Abra.getAbraSync&&window.NYTD.Abra.getAbraSync(“STYLN_elections_notifications”);// Only actually have control situation in prd and stg
return[“www.nytimes.com”,”www.stg.nytimes.com”].includes(window.location.hostname)||(a=”STYLN_elections_notifications”),a||”0_control”}function reportData(){if(window.dataLayer){var a;try{a=dataLayer.find(function(a){return!!a.user}).user}catch(a){}var b={abtest:{test:”styln-elections-notifications”,variant:getVariant()},module:{name:”styln-elections-notifications”,label:getVariant(),region:”TOP_BANNER”},user:a};window.dataLayer.push(Object.assign({},b,{event:”ab-alloc”})),window.dataLayer.push(Object.assign({},b,{event:”ab-expose”})),window.dataLayer.push(Object.assign({},b,{event:”impression”}))}}function insertNotification(a,b){// Bail here if the user is in control
if(reportData(),”0_control”!==getVariant()){// Remove menu bar items or previous notification
var c=document.querySelector(“.nytslm_innerContainer”);if(c&&1 30 * 60 * 1000) return restoreMenuIfNecessary();
// Do not update DOM if the content won’t change
if(currentNotificationContents!==a.text&&window.localStorage.getItem(“stylnelecs”)!==a.timestamp)// Do not show if user has interacted with this link
// if (Cookie.get(‘stylnelecs’) === data.timestamp) return;
{expireLocalStorage(“stylnelecs”),currentNotificationContents=a.text;// Construct URL for tracking
var b=a.link.split(“#”),c=b[0]+”?action=click&pgtype=Article&state=default&module=styln-elections-notifications&variant=1_election_notifications®ion=TOP_BANNER&context=Menu#”+b[1],d=formatNotification(c,a.text,a.kicker,a.image);insertNotification(d,function(){var b=document.querySelector(“.nytslm_notification_link”);return b?void(b.onclick=function(){window.localStorage.setItem(“stylnelecs”,a.timestamp)}):null})}})}(function(){navigator.userAgent.includes(“nytios”)||navigator.userAgent.includes(“nyt_android”)||window.stylnelecsHasLoaded||(setInterval(getUpdate,5e3),window.stylnelecsHasLoaded=!0)})(),function(){try{if(navigator.userAgent.includes(“nytios”)||navigator.userAgent.includes(“nyt_android”)){var a=document.getElementsByClassName(“nytslm_title”)[0];a.style.pointerEvents=”none”}}catch(a){}}();