PageSourceSearch

https://www.ibsafoundation.org/hubfs/hub_generated/template_assets…/1790780496566/template_pwr-tabs.min.js

js ibsafoundation.org collected 2026-10-02 16:46:41 UTC 4,863 bytes, 2 lines download raw bytes

1class PWRTabs{target;tabs=[];tabDropdown;config;lastTabClickTime=0;currentTab;constructor(target,config={onSwitchTab:(newTab,oldTab)=>{console.log("selected tab: "+newTab.tabId)},tabClass:"pwr-tabs__item",transitionDuration:400}){this.target=target,this.config=config,this.target.pwrTab=this,target.querySelectorAll("."+this.config.tabClass).forEach((tab,index)=>{var rel=tab.getAttribute("rel");this.tabs.push({index:index,tabId:rel,title:tab.innerHTML,tabButton:tab}),tab.addEventListener("click",ev=>{this.onClickTab(rel)})}),this.tabDropdown=target.querySelector(".vanilla .pwr-tabs__dropdown select"),this.tabDropdown.addEventListener("change",ev=>{this.onClickTab(ev.target.value)}),this.currentTab=this.tabs.length?this.tabs[0]:null,matchHeight.matchAll()}onClickTab(tabId){if(this.lastTabClickTime+this.config.transitionDuration*this.getDurationFactor()>Date.now())return!1;this.lastTabClickTime=Date.now(),this.selectTab(tabId)}selectTab(tabId,animate=!0){var tab=this.getTabById(tabId);if(tab){if(this.currentTab){if(this.currentTab.tabId==tabId)return;this.currentTab.tabButton.classList.remove(this.config.tabClass+"--active"),this.currentTab.tabButton.setAttribute("aria-selected","false")}tab.tabButton.classList.add(this.config.tabClass+"--active"),tab.tabButton.setAttribute("aria-selected","true"),this.tabDropdown.value=tab.tabId;var oldTab=this.currentTab;this.currentTab=tab,matchHeight.matchAll(),this.onSwitchTab(tab,oldTab,animate)}}onSwitchTab(newTab,oldTab,animate=!0){this.config.onSwitchTab(newTab,oldTab,animate)}getTabById(tabId){return this.tabs.find(tab=>tab.tabId==tabId)}getDurationFactor(){return"function"==typeof pwr.style.getVar?pwr.style.getVar("--ts-duration-factor",1):1}showContent(content,animate=!0){content.classList.remove("pwr-collapse-content"),content.style.removeProperty("margin-top"),content.style.removeProperty("margin-bottom"),content.style.removeProperty("padding-top"),content.style.removeProperty("padding-bottom"),pwr.nav.enableTab(content),animate&&(content.style.zIndex=2,pwr.animation.fade(content,this.config.transitionDuration,0,1,()=>{content.style.removeProperty("z-index")}))}hideContent(content,animate=!0){function collapseContent(content){content.classList.add("pwr-collapse-content"),content.style.setProperty("margin-top","0px","important"),content.style.setProperty("margin-bottom","0px","important"),content.style.setProperty("padding-top","0px","important"),content.style.setProperty("padding-bottom","0px","important"),pwr.nav.disableTab(content)}if(animate){const{offsetTop:offsetTop,offsetLeft:offsetLeft}=content;content.style.top=offsetTop+"px",content.style.left=offsetLeft+"px",content.style.width=content.offsetWidth+"px",content.style.height=content.offsetHeight+"px",content.style.position="absolute",content.style.zIndex=0,setTimeout(()=>{collapseContent(content),content.style.position="relative",content.style.removeProperty("top"),content.style.removeProperty("left"),content.style.removeProperty("width"),content.style.removeProperty("height"),content.style.removeProperty("z-index")},this.config.transitionDuration*this.getDurationFactor())}else collapseContent(content)}removeHSHiddenClasses(content){Array.from(content.classList).filter(c=>c.endsWith("-hidden")).forEach(c=>content.classList.remove(c))}}class PWRSecTabs extends PWRTabs{constructor(target,config){super(target,{tabClass:"pwr-tabs__item",onSwitchTab:(newTab,oldTab,animate)=>{pwr.hs.isEditorMode()||(this.hideContent(oldTab.content,animate),this.showContent(newTab.content,animate),pwr.aos.refresh(),window.dispatchEvent(new CustomEvent("update-heights")))},transitionDuration:400}
1),pwr.hs.isEditorMode()||this.tabs.forEach((tab,index)=>{var section=pwr.dom.furthest(target,".row-fluid-wrapper.row-depth-1"),content=pwr.dom.nthNextSibling(section,index+1);this.removeHSHiddenClasses(content),tab.content=content,content&&index>0&&this.hideContent(content,!1)})}}class PWRContentTabs extends PWRTabs{constructor(target,config){super(target,{tabClass:"pwr-tabs__tab",onSwitchTab:(newTab,oldTab,animate)=>{if(newTab.tabId!=oldTab.tabId){var oldContent=target.querySelector("#"+oldTab.tabId),newContent=target.querySelector("#"+newTab.tabId);oldContent&&this.hideContent(oldContent,!1),newContent&&(newContent.style.display="block",this.showContent(newContent,animate)),pwr.aos.refresh(),window.dispatchEvent(new CustomEvent("update-heights"))}},transitionDuration:400})}}pwr.dom.ready(()=>{document.querySelectorAll(".pwr-sec-tabs.vanilla .pwr-tabs").forEach(e=>new PWRSecTabs(e)),document.querySelectorAll(".pwr-sec-text-tabs.vanilla .pwr-tabs, .pwr-sec-team.vanilla .pwr-tabs, .pwr-sec-schedule.vanilla .pwr-tabs").forEach(e=>new PWRContentTabs(e))});
2//# sourceURL=https://8737774.fs1.hubspotusercontent-eu1.net/hubfs/8737774/hub_generated/template_assets/1/121830390382/1790780496566/template_pwr-tabs.js

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.