1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */ 2(function(Drupal,PhotoSwipeLightbox){Drupal.behaviors.photoswipe={attach(context,settings){once('photoswipe','.photoswipe-gallery',context).forEach((gallery)=>{const lightbox=new PhotoSwipeLightbox({gallerySelector:'.photoswipe-gallery',childSelector:'a.photoswipe',pswpModule:PhotoSwipe,...(settings?.photoswipe?.options||{})});if(gallery.hasAttribute('data-show-download-button'))lightbox.on('uiRegister',()=>{lightbox.pswp.ui.registerElement({name:'download-button',order:8,isButton:true,title:settings?.photoswipe?.options?.downloadTitle,tagName:'a',html:{isCustomSVG:true,inner:'<path d="M20.5 14.3 17.1 18V10h-2.2v7.9l-3.4-3.6L10 16l6 6.1 6-6.1ZM23 23H9v2h14Z" id="pswp__icn-download"/>',outlineID:'pswp__icn-download'},onInit:(el,pswp)=>{el.setAttribute('download','');el.setAttribute('target','_blank');el.setAttribute('rel','noopener noreferrer');pswp.on('change',()=>{el.href=pswp.currSlide.data.src;});}});});const event=new CustomEvent('photoswipeLightboxBuild',{detail:{lightbox}});gallery.dispatchEvent(event);lightbox.init();});}};})(Drupal,PhotoSwipeLightbox);; 3(function(Drupal,drupalSettings,once){const sitewideAlertsSelector='[data-sitewide-alert]';const shouldShowOnThisPage=(pages=[],negate=true)=>{if(pages.length===0)return true;let pagePathMatches=false;const currentPath=window.location.pathname;for(let i=0;i<pages.length;i++){const baseUrl=drupalSettings.path.baseUrl.slice(0,-1);const page=baseUrl+pages[i];if(page.charAt(page.length-1)==='*'){if(currentPath.startsWith(page.substring(0,page.length-1))){pagePathMatches=true;break;}}else{if(page===currentPath){pagePathMatches=true;break;}}}return negate?!pagePathMatches:pagePathMatches;};const alertWasDismissed=(alert)=>{if(!alert.dismissible)return false;if(!(`alert-dismissed-${alert.uuid}` in window.localStorage))return false;const dismissedAtTimestamp=Number(window.localStorage.getItem(`alert-dismissed-${alert.uuid}`));return dismissedAtTimestamp>=alert.dismissalIgnoreBefore;};const updateLandmarkRole=()=>{const roots=document.querySelectorAll(sitewideAlertsSelector);roots.forEach((root)=>{const hasAlerts=root.querySelector('[data-uuid]')!==null;if(hasAlerts){root.setAttribute('role','region');root.setAttribute('aria-label',Drupal.t('Site alerts'));}else{root.removeAttribute('role');root.removeAttribute('aria-label');}});};const updateAlertCount=()=>{if(!drupalSettings.sitewideAlert.showCount)return;const roots=document.querySelectorAll(sitewideAlertsSelector);roots.forEach((root)=>{let count=0;const alerts=root.querySelectorAll('[data-uuid]');const totalCount=alerts.length;alerts.forEach((alert)=>{count++;const alertCountContainer=alert.querySelector('.alert-count');if(!alertCountContainer)return;alertCountContainer.innerHTML=Drupal.t('@current_count of @total_count alerts',{'@current_count':count,'@total_count':totalCount});});});};const removeAlert=(alert)=>{alert.dispatchEvent(new CustomEvent('sitewide-alert-removed',{bubbles:true,composed:true}));alert.remove();updateAlertCount();updateLandmarkRole();};const dismissAlert=(alert)=>{window.localStorage.setItem(`alert-dismissed-${alert.uuid}`,String(Math.round(new Date().getTime()/1000)));document.querySelectorAll(`[data-uuid="${alert.uuid}"]`).forEach((alert)=>{alert.dispatchEvent(new CustomEvent('sitewide-alert-dismissed',{bubbles:true,composed:true}));removeAlert(alert);});};const buildAlertElement=(alert)=>{const alertElement=document.createElement('div');alertElement.innerHTML=alert.renderedAlert;if(alert.dismissible){const dismissButtons=alertElement.getElementsByClassName('js-dismiss-button');for(let i=0;i<dismissButtons.length;i++)dismissButtons[i].addEventListener('click',()=>dismissAlert(alert));}return alertElement.firstElementChild;};const processSsrAlerts=()=>{const roots=document.querySelectorAll(sitewideAlertsSelector);roots.forEach((root)=>{const existingAlerts=root.querySelectorAll('[data-uuid]');existingAlerts.forEach((alertElement)=>{const uuid=alertElement.dataset.uuid;const dismissalIgnoreBefore=parseInt(alertElement.dataset.dismissalIgnoreBefore,10)||0;const isDismissible=alertElement.dataset.dismissible==='true';const alertData={uuid,dismissalIgnoreBefore,dismissible:isDismissible};
3if(alertWasDismissed(alertData)){removeAlert(alertElement);return;}if(isDismissible){const dismissButtons=alertElement.getElementsByClassName('js-dismiss-button');for(let i=0;i<dismissButtons.length;i++)dismissButtons[i].addEventListener('click',()=>dismissAlert(alertData));}});});};const fetchAlerts=()=>{const url=new URL(Drupal.url('sitewide_alert/load'),window.location.origin);url.username='';url.password='';return fetch(url.toString()).then((res)=>res.json()).then((result)=>result.sitewideAlerts,(error)=>{console.error(error);});};const removeStaleAlerts=(alerts)=>{const roots=document.querySelectorAll(sitewideAlertsSelector);roots.forEach((root)=>{const existingAlerts=root.querySelectorAll('[data-uuid]');const alertsToBeRemoved=Array.from(existingAlerts).filter((alert)=>!alerts.includes(alert.getAttribute('data-uuid')));alertsToBeRemoved.forEach((alert)=>removeAlert(alert));});};const initAlerts=()=>{const roots=document.querySelectorAll(sitewideAlertsSelector);fetchAlerts().then((alerts)=>{removeStaleAlerts(alerts.map((alert)=>alert.uuid));alerts.forEach((alert)=>{const dismissed=alertWasDismissed(alert);const showOnThisPage=shouldShowOnThisPage(alert.showOnPages,alert.negateShowOnPages);roots.forEach((root)=>{const existingAlertElement=root.querySelector(`[data-uuid="${alert.uuid}"]`);
3if(showOnThisPage&&!dismissed){if(existingAlertElement&&existingAlertElement.dataset.changed===alert.changed)return;const renderableAlertElement=buildAlertElement(alert);if(existingAlertElement)root.replaceChild(renderableAlertElement,existingAlertElement);else root.appendChild(renderableAlertElement);renderableAlertElement.dispatchEvent(new CustomEvent('sitewide-alert-rendered',{bubbles:true,composed:true}));Drupal.attachBehaviors(renderableAlertElement);return;}if((dismissed||!showOnThisPage)&&existingAlertElement)removeAlert(existingAlertElement);});updateAlertCount();});updateLandmarkRole();});};const supportsHistoryPushState=()=>{return 'pushState' in window.history&&window.history.pushState!==null;};const supportsHistoryReplaceState=()=>{return ('replaceState' in window.history&&window.history.replaceState!==null);};const triggerHistoryEvent=(thisArg,argArray)=>{const event=new CustomEvent('sitewidealerts.popstate',{detail:{state:thisArg,options:argArray}});window.dispatchEvent(event);};const proxyPushState=()=>{if(supportsHistoryPushState())window.history.pushState=new Proxy(window.history.pushState,{apply(target,thisArg,argArray){triggerHistoryEvent(thisArg,argArray);return target.apply(thisArg,argArray);}});if(supportsHistoryReplaceState())window.history.replaceState=new Proxy(window.history.replaceState,{apply(target,thisArg,argArray){triggerHistoryEvent(thisArg,argArray);return target.apply(thisArg,argArray);}});};function debounce(func,wait,immediate){let timeout;return function(...args){const context=this;const later=function(){timeout=null;if(!immediate)func.apply(context,args);};const callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow)func.apply(context,args);};}const historyListener=()=>{const debounced=debounce(initAlerts,2000);window.addEventListener('sitewidealerts.popstate',debounced);window.addEventListener('popstate',debounced);};Drupal.behaviors.sitewide_alert_init={attach:(context)=>{once('sitewide_alerts_init','html',context).forEach(()=>{processSsrAlerts();updateLandmarkRole();if(drupalSettings.sitewideAlert.serverSideRender!==true)initAlerts();proxyPushState();historyListener();if(drupalSettings.sitewideAlert.automaticRefresh===true){const interval=setInterval(()=>initAlerts(),drupalSettings.sitewideAlert.refreshInterval<1000?1000:drupalSettings.sitewideAlert.refreshInterval);if(!drupalSettings.sitewideAlert.automaticRefresh)clearInterval(interval);}});}};})(Drupal,drupalSettings,once);;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.