(()=>{"use strict";var setCookie=function(cookieName,cookieValue,expiryDays){var cookiePath=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/",date=new Date;date.setTime(date.getTime()+24*expiryDays*60*60*1e3);var expires="expires=".concat(date.toUTCString());document.cookie="".concat(cookieName,"=").concat(cookieValue,";").concat(expires,";path=").concat(cookiePath,";")},getCookie=function(name){for(var cookieName="".concat(name,"="),cookies=document.cookie.split(";"),i=0;i<cookies.length;i++){for(var cookie=cookies[i];" "==cookie.charAt(0);)cookie=cookie.substring(1);if(0==cookie.indexOf(cookieName))return cookie.substring(cookieName.length,cookie.length)}return""};Drupal.behaviors.siteModeSwitcher={attach:function(context){var siteModeTimeCheckInterval,siteModeTimeCheckTimeout,HTML=document.documentElement,BUTTON_SITE_MODE_SWITCHER=context.querySelector('button[data-js="site-mode-switcher"]'),USER_SITE_MODE_VALUE=getCookie("USER_SITE_MODE"),setDataSiteMode=function(siteMode){document.startViewTransition?document.startViewTransition(function(){HTML.setAttribute("data-site-mode",siteMode)}):HTML.setAttribute("data-site-mode",siteMode)},getSiteMode=function(){if(USER_SITE_MODE_VALUE)HTML.setAttribute("data-site-mode",USER_SITE_MODE_VALUE);else{var NOW=new Date,DATE_PARTS=new Intl.DateTimeFormat("en-US",{timeZone:"America/New_York",hour:"numeric",hour12:!1}).formatToParts(NOW),HOURS=Number(DATE_PARTS.find(function(p){return"hour"===p.type}).value),DAY_OF_WEEK=new Date(NOW.toLocaleString("en-US",{timeZone:"America/New_York"})).getDay(),siteMode=DAY_OF_WEEK>=1&&DAY_OF_WEEK<=5&&(HOURS>=9&&HOURS<18)?"at-work":"at-play";siteMode!==getCookie("SYSTEM_SITE_MODE")&&(setCookie("SYSTEM_SITE_MODE",siteMode),setDataSiteMode(siteMode))}};if(BUTTON_SITE_MODE_SWITCHER&&BUTTON_SITE_MODE_SWITCHER.addEventListener("click",function(){var newSiteMode="at-work"===HTML.getAttribute("data-site-mode")?"at-play":"at-work";setCookie("USER_SITE_MODE",newSiteMode),setDataSiteMode(newSiteMode),clearInterval(siteModeTimeCheckInterval),clearTimeout(siteModeTimeCheckTimeout)}),"localhost"!==window.location.hostname){if(!USER_SITE_MODE_VALUE){NOW=new Date,msUntilNextMinute=1e3*(60-NOW.getSeconds())-NOW.getMilliseconds(),siteModeTimeCheckTimeout=setTimeout(function(){getSiteMode(),siteModeTimeCheckInterval=setInterval(getSiteMode,6e4)},msUntilNextMinute)}var NOW,msUntilNextMinute;getSiteMode()}}}})();