PageSourceSearch

https://www.habitat.org/sites/default/files/js/js_yLSUx5b6iPJSH-m1…jlbQuM58EamIq0nnhCCXrNkwS0HdFA0Uj80ywc1t4Q_

js habitat.org collected 2026-10-01 08:28:55 UTC 22,357 bytes, 7 lines download raw bytes

1/* @license GPL-2.0-or-later https://www.drupal.org/licensing/faq */
2!((document,Drupal)=>{'use strict';Drupal.behaviors.donateHeaderMenu={attach:function(context){const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-sm-min');const buttons=context.querySelectorAll('button.donate-cta');buttons.forEach((button)=>{button.addEventListener('click',this.toggleDonateMenu);const donationCtaObserver=new MutationObserver((mutations)=>mutations.forEach(({type,target})=>{if(type==='attributes'&&target.classList.contains('donate-cta--animate')){this.attachDonationCtaAnimation(target);donationCtaObserver.disconnect();}}));donationCtaObserver.observe(button,{attributes:true,attributeFilter:['class']});});document.documentElement.addEventListener('click',(event)=>{if(matchMedia(`(min-width:${breakPoint})`).matches){let exit=false;for(const button of buttons)if(button.contains(event.target))exit=true;if(!exit)document.querySelector('.header .donate-menu')?.classList.remove('donate-menu--expanded');}});matchMedia(`(min-width:${breakPoint})`).addEventListener('change',()=>{document.querySelector('.header .donate-menu').classList.remove('donate-menu--expanded');});},attachDonationCtaAnimation:function(button){if(button.classList.contains('donate-cta--animate')){const inactivityDelay=3000;let inactivityTimer;let animationInterval;const startInactivityAnimation=()=>{const startAnimation=()=>{if(button.classList.contains('donate-cta--animated')===false)button.classList.add('donate-cta--animated');};animationInterval=setInterval(startAnimation,3000);};const resetInactivityTimer=()=>{clearTimeout(inactivityTimer);clearInterval(animationInterval);inactivityTimer=setTimeout(startInactivityAnimation,inactivityDelay);};['mousemove','keydown','scroll','touchstart'].forEach((event)=>{window.addEventListener(event,resetInactivityTimer,{passive:true});});button.addEventListener('animationend',({animationName})=>{if(animationName==='heartbeat')button.classList.remove('donate-cta--animated');});resetInactivityTimer();}},toggleDonateMenu:function(event){const menu=event.target.closest('.donate-menu');menu.classList.toggle('donate-menu--expanded');}};})(document,Drupal);;
3(function(document,Drupal){Drupal.behaviors.collapseUtility={attach:function(context){context.querySelectorAll('[data-is-collapsible]').forEach((item)=>{item.querySelectorAll('[data-collapsible-toggle]').forEach((toggle)=>{toggle.addEventListener('mouseup',this.toggleClickEvent);toggle.addEventListener('keyup',this.toggleKeyEvent);});const content=item.querySelector('[data-collapsible-content]');Drupal.behaviors.collapseUtility.setAllTabindexes(content,'-1');});this.openFromLink();window.addEventListener('hashchange',this.openFromLink);},toggleClickEvent:function(event){event.preventDefault();const clickedItem=event.target.closest('[data-is-collapsible]');const collapseGroup=clickedItem.closest('[data-collapse-group]');const toggles=Array.from(clickedItem.children).filter((e)=>e.dataset.collapsibleToggle!==undefined);const animationDuration=parseInt(window.getComputedStyle(toggles[0]).getPropertyValue('--motion-default'));const content=clickedItem.querySelector('[data-collapsible-content]');const contentWrapper=clickedItem.querySelector('[data-collapsible-content-wrapper]');toggles.forEach((toggle)=>{toggle.disabled=true;window.setTimeout(()=>{toggle.disabled=false;},animationDuration);});if(clickedItem.hasAttribute('data-collapsible-open')){if('noClose' in collapseGroup.dataset&&collapseGroup.dataset.collapseGroup==='single')return;Drupal.behaviors.collapseUtility.closeItem(clickedItem,toggles,content,contentWrapper);}else Drupal.behaviors.collapseUtility.openItem(clickedItem,toggles,content,contentWrapper);},toggleKeyEvent:function(event){if(event.key==='Enter'||event.key==='Space')Drupal.behaviors.collapseUtility.toggleClickEvent(event);},closeItem:function(item,toggles=false,content=false,contentWrapper=false){if(item.dataset.isCollapsible!==undefined){if(!toggles)toggles=Array.from(item.children).filter((e)=>e.dataset.collapsibleToggle!==undefined);if(!content)content=item.querySelector('[data-collapsible-content]');if(!contentWrapper)contentWrapper=item.querySelector('[data-collapsible-content-wrapper]');if(contentWrapper.collapsibleResizeObserver)contentWrapper.collapsibleResizeObserver.unobserve(contentWrapper);content.style.maxHeight=null;item.removeAttribute('data-collapsible-open');
3toggles.forEach((toggle)=>{toggle.setAttribute('aria-expanded','false');});content.setAttribute('aria-hidden','true');Drupal.behaviors.collapseUtility.setAllTabindexes(content,'-1');}},openItem:function(item,toggles=false,content=false,contentWrapper=false){if(item.dataset.isCollapsible!==undefined){if(!toggles)toggles=Array.from(item.children).filter((e)=>e.dataset.collapsibleToggle!==undefined);if(!content)content=item.querySelector('[data-collapsible-content]');if(!contentWrapper)contentWrapper=item.querySelector('[data-collapsible-content-wrapper]');const hasOpen=item.closest('[data-collapse-group]').querySelector('[data-collapsible-open]');const isSingle=Drupal.behaviors.collapseUtility.isSingleOpen(item);if(contentWrapper.collapsibleResizeObserver===undefined)contentWrapper.collapsibleResizeObserver=new ResizeObserver((entries)=>{const lastResize=entries.pop();if(lastResize)content.style.maxHeight=`${content.scrollHeight}px`;});const animationDuration=parseInt(window.getComputedStyle(toggles[0]).getPropertyValue('--motion-default'));if(isSingle&&hasOpen)setTimeout(()=>{content.style.maxHeight=`${content.scrollHeight}px`;item.setAttribute('data-collapsible-open','');},animationDuration);else{content.style.maxHeight=`${content.scrollHeight}px`;item.setAttribute('data-collapsible-open','');}setTimeout(()=>{contentWrapper.collapsibleResizeObserver.observe(contentWrapper);},animationDuration);toggles.forEach((toggle)=>{toggle.setAttribute('aria-expanded','true');});content.setAttribute('aria-hidden','false');Drupal.behaviors.collapseUtility.setAllTabindexes(content,'0');}},isSingleOpen:function(clickedItem){const collapseGroup=clickedItem.closest('[data-collapse-group]');if(collapseGroup.dataset.collapseGroup==='single'){Drupal.behaviors.collapseUtility.closeOpenItems(collapseGroup,clickedItem);return true;}return false;},closeOpenItems:function(collapseGroup,clickedItem){const openItems=collapseGroup.querySelectorAll('[data-collapsible-open]');if(openItems.length>0)openItems.forEach((openItem)=>{if(clickedItem!==openItem)Drupal.behaviors.collapseUtility.closeItem(openItem);});},openCloseItems:function(expandGroup,clickedItem){const closedItems=expandGroup.querySelectorAll('[data-is-collapsible]:not([data-collapsible-open])');if(closedItems.length>0)closedItems.forEach((closedItem)=>{if(clickedItem!==closedItem){const closeToggles=Array.from(closedItem.children).filter((e)=>e.dataset.collapsibleToggle!==undefined);const closeContent=closedItem.querySelector('[data-collapsible-content]');const contentWrapper=closedItem.querySelector('[data-collapsible-content-wrapper]');const animationDuration=parseInt(window.getComputedStyle(closedItems[0]).getPropertyValue('--motion-default'));closedItem.setAttribute('data-collapsible-open','');closeToggles.forEach((closeToggle)=>{closeToggle.setAttribute('aria-expanded','true');});closeContent.setAttribute('aria-hidden','false');Drupal.behaviors.collapseUtility.setAllTabindexes(closeContent,'0');if(contentWrapper.collapsibleResizeObserver===undefined)contentWrapper.collapsibleResizeObserver=new ResizeObserver((entries)=>{const lastResize=entries.pop();if(lastResize)closeContent.style.maxHeight=`${closeContent.scrollHeight}px`;});setTimeout(()=>{contentWrapper.collapsibleResizeObserver.observe(contentWrapper);},animationDuration);closeContent.style.maxHeight=`${closeContent.scrollHeight}px`;}});},setUpCollapsible:function(toggle,container,modifierClass){if(!toggle||!container||!modifierClass||container.classList.contains('js'))return;container.classList.add('js');container.dataset.isCollapsible=true;const button=document.createElement('button');for(const attr of toggle.attributes)button.setAttribute(attr.name,attr.value);button.innerHTML=toggle.innerHTML;button.dataset.collapsibleToggle=true;container.insertBefore(button,toggle);container.removeChild(toggle);const children=Array.from(container.childNodes).filter((el)=>el!==button);const content=document.createElement('div');const wrapper=document.createElement('div');content.classList.add(`${modifierClass}-collapsible__content`);content.dataset.collapsibleContent=true;wrapper.classList.add(`${modifierClass}-collapsible__content-wrapper`);wrapper.dataset.collapsibleContentWrapper=true;content.appendChild(wrapper);
3children.forEach((el)=>{wrapper.appendChild(el);});container.appendChild(content);Drupal.behaviors.collapseUtility.attach(container.parentElement||document);button.addEventListener('click',(e)=>{e.preventDefault();});},setAllTabindexes:function(content,focusValue){Array.from(content.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]')).filter((el)=>!el.hasAttribute('disabled')&&!el.getAttribute('aria-hidden')).forEach((el)=>{el.setAttribute('tabindex',focusValue);});},openFromLink:function(){const hash=window.location.hash.slice(1);if(hash){const hashTarget=document.getElementById(hash);if(hashTarget.hasAttribute('data-collapsible-toggle'))Drupal.behaviors.collapseUtility.openItem(hashTarget.closest('[data-is-collapsible]'));}}};})(document,Drupal);;
4!((document,Drupal)=>{'use strict';Drupal.behaviors.dropdownMenu={attach:function(context){once('hab-dropdown-menu','.dropdown-menu',context).forEach((menu)=>{const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-sm-min');if(matchMedia(`(min-width:${breakPoint})`).matches)menu.dataset.collapseGroup='single';context.querySelectorAll('.dropdown-menu__toggle').forEach((closeButton)=>{closeButton.addEventListener('click',(e)=>{const collapseGroup=e.target.closest('[data-collapse-group]');if(collapseGroup.classList.contains('expanded')){collapseGroup.classList.remove('expanded');Drupal.behaviors.collapseUtility.closeOpenItems(collapseGroup,e.target);}else{collapseGroup.classList.add('expanded');Drupal.behaviors.collapseUtility.openCloseItems(collapseGroup,e.target);}});});document.documentElement.addEventListener('click',this.closeMenu);document.documentElement.addEventListener('keyup',(event)=>{if(event.key==='Enter'||event.key==='Space')this.closeMenu(event);});matchMedia(`(min-width:${breakPoint})`).addEventListener('change',(event)=>{if(event.matches)menu.dataset.collapseGroup='single';else menu.dataset.collapseGroup='multi';const collapseGroup=document.querySelector('.dropdown-menu');collapseGroup.forEach((group)=>{Drupal.behaviors.collapseUtility.closeOpenItems(group,false);});});});},closeMenu:function(event){const dropdownMenus=document.querySelectorAll('.dropdown-menu');const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-sm-min');if(matchMedia(`(min-width:${breakPoint})`).matches){let exit=false;for(const menu of dropdownMenus)if(menu.contains(event.target)){exit=true;break;}if(!exit){const collapseGroup=document.querySelectorAll('.dropdown-menu');collapseGroup.forEach((group)=>{Drupal.behaviors.collapseUtility.closeOpenItems(group,false);});}}}};})(document,Drupal);;
5!((document,Drupal,once)=>{'use strict';Drupal.behaviors.menuControl={attach:function(context){once('hab-menu-control','.header__main-menu-control',context).forEach((button)=>{button.addEventListener('click',(e)=>{this.toggleMenu(e);});const closeMenuOnResize=(event)=>{if(event.matches){document.body.classList.remove('main-menu-open');document.querySelector('.dropdown-menu--main').classList.remove('show');document.querySelector('.dropdown-menu--subsite').classList.remove('show');document.querySelector('.header__main-menu-control.open').classList.remove('open');}};const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-tablet-max');matchMedia(`(min-width:${breakPoint})`).addEventListener('change',closeMenuOnResize);});},toggleMenu:function(e){const buttons=document.querySelectorAll('.header__main-menu-control');if(e.target.classList.contains('open'))document.body.classList.remove('main-menu-open');else document.body.classList.add('main-menu-open');buttons.forEach((button)=>{if(button.classList.contains(e.target.classList[1]))button.classList.toggle('open');else button.classList.remove('open');});if(e.target.classList.contains('header__main-menu-control--subsite')){document.querySelector('.dropdown-menu--subsite').classList.add('show');document.querySelector('.dropdown-menu--main').classList.remove('show');}else{if(e.target.classList.contains('header__main-menu-control--main'))document.querySelector('.dropdown-menu--main').classList.add('show');}}};})(document,Drupal,once);;
6!((document,Drupal)=>{'use strict';Drupal.behaviors.searchControl={attach:function(){const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-sm-min');document.documentElement.addEventListener('click',this.closeSearch);document.documentElement.addEventListener('keyup',(event)=>{if(event.key==='Enter'||event.key==='Space')this.closeSearch(event);});matchMedia(`(min-width:${breakPoint})`).addEventListener('change',()=>{const collapseGroup=document.querySelector('.header__search');Drupal.behaviors.collapseUtility.closeItem(collapseGroup,false);});},closeSearch:function(event){const searchButtons=document.querySelectorAll('.header__search-icon');const breakPoint=getComputedStyle(document.documentElement).getPropertyValue('--bp-sm-min');if(matchMedia(`(min-width:${breakPoint})`).matches){const searchPanel=document.querySelector('.header__search-search');let exit=false;for(const button of searchButtons)if(button.contains(event.target)){exit=true;break;}if(searchPanel.contains(event.target))exit=true;if(!exit){const collapseGroup=document.querySelector('.header__search');Drupal.behaviors.collapseUtility.closeItem(collapseGroup);}}}};})(document,Drupal);;
7(function(Drupal,drupalSettings,once){Drupal.AjaxCommands.prototype.alert_data_received=function(ajax,response,status){};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 getAlertPriority=(alert)=>{const {showOnPages,negateShowOnPages}=alert;let priority=0;if(shouldShowOnThisPage(showOnPages,negateShowOnPages)){const currentPath=window.location.pathname;priority=showOnPages.includes(currentPath)?currentPath.length:priority;if(alert.renderedAlert&&alert.renderedAlert.includes('modal-exit'))priority=-1;if(priority===0){const pages=showOnPages.length===0||negateShowOnPages?['/*']:showOnPages;for(const page of pages)if(shouldShowOnThisPage([page],false)){const pagePriority=page.substr(0,page.indexOf('*')).length/2;if(pagePriority>priority)priority=pagePriority;}}}return priority;};const alertWasDismissed=(alert)=>{const key=`alert-dismissed-${alert.uuid}`;if(!(key in window.localStorage))return false;const dismissedAtTimestamp=Number(localStorage.getItem(key));const now=Math.floor(Date.now()/1000);if(!alert.dismiss_period||alert.dismiss_period===0)return dismissedAtTimestamp>=alert.dismissalIgnoreBefore;const expirationInSeconds=alert.dismiss_period*3600;if(now-dismissedAtTimestamp>=expirationInSeconds){localStorage.removeItem(key);return false;}return dismissedAtTimestamp>=alert.dismissalIgnoreBefore;};const updateLandmarkRole=()=>{const roots=document.querySelectorAll(sitewideAlertsSelector);
7roots.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};if(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=()=>new Promise((resolve,reject)=>{const url=Drupal.url.toAbsolute('/sitewide_alert/load');Drupal.ajax({url}).execute().done((commands)=>{let alerts=[];for(const {command,data} of commands)if(command==='alert_data_received')alerts=data.sitewideAlerts;return resolve(alerts);});});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));if(drupalSettings.sitewideAlert.pathPrioritySort)alerts.sort((a,b)=>getAlertPriority(b)-getAlertPriority(a));const winnerAlert=drupalSettings.sitewideAlert.pathPrioritySort?alerts.find((alert)=>shouldShowOnThisPage(alert.showOnPages,alert.negateShowOnPages)&&!alertWasDismissed(alert)):null;alerts.forEach((alert)=>{const dismissed=alertWasDismissed(alert);const showOnThisPage=shouldShowOnThisPage(alert.showOnPages,alert.negateShowOnPages);const shouldRender=drupalSettings.sitewideAlert.pathPrioritySort?(winnerAlert&&alert.uuid===winnerAlert.uuid):(showOnThisPage&&!dismissed);roots.forEach((root)=>{const existingAlertElement=root.querySelector(`[data-uuid="${alert.uuid}"]`);if(shouldRender){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();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.