PageSourceSearch

https://www.nivea.com.ng/dist/NiveaX/modules/Tab.551e4d4b.js

js nivea.com.ng collected 2026-10-04 14:35:49 UTC 3,562 bytes, 2 lines download raw bytes

1"use strict";(self.NiveaXwebpackJsonp=self.NiveaXwebpackJsonp||[]).push([[4196],{43486:(t,e,s)=>{s.r(e),s.d(e,{default:()=>c});var i=s(98684),a=s(21464);const n='[data-module="Tab"]';class c{static setup(t=n){Array.from(document.querySelectorAll(t)).filter(t=>!t.dataset.moduleInitialized).forEach(t=>{new c(t),t.dataset.moduleInitialized="true"})}constructor(t){this.element=t,this.tabLinks=Array.from(this.element.querySelectorAll("[data-tab]")),this.tabSections=Array.from(this.element.querySelectorAll(".nx-tabs__item")),this.tabList=this.element.querySelector(".nx-scroll-wrapper__inner"),this.wrapperSelector=this.element.querySelector(".nx-scroll-wrapper__inner"),this.imageList=Array.from(this.element.querySelectorAll(".nx-tab-background")),this.tabLinks.length<=1||(this.cssClass={activeLink:"nx-tabs-links__item--active",activeSection:"nx-tabs__item--active",activeImage:"nx-tab-background--active"},this.init(),this.element.addEventListener("niveax:openTab",t=>this.openTabFromAnchor(t)))}init(){this.setTabEventHandler(),this.setActiveTabOnChange(0),(0,a.aO)(this.tabList),this.openTabFromAnchorOnLoad()}setTabEventHandler(){return this.tabLinks.forEach(t=>t.addEventListener("click",t=>this.onTabClick(t))),this}onTabClick(t){t.preventDefault(),this.changeTab(t)}changeTab(t,e=null){return this.clearActiveClass(),this.setActiveContainer(t,e),this}openTabFromAnchor(t){const e=t.detail.tabNode.getAttribute("data-tab-idx");this.changeTab(t,e),this.scrollToActive(e)}openTabFromAnchorOnLoad(){const t=window.location.hash.substring(1);if(t&&-1===t.indexOf("layer")&&this.element.contains(document.getElementById(`${t}`))){const e=this.findTabItemByAnchor(t);this.openTab(e),document.getElementById(`${t}`).scrollIntoView();const s=document.querySelector(".nx-anchor-navigation");window.scrollBy({top:s?-s.clientHeight:0,left:0,behavior:"auto"})}}findTabItemByAnchor(t){const e=this.element.querySelectorAll(".nx-tab-container-item");return Array.from(e).find(e=>e.contains(document.getElementById(`${t}`)))}openTab(t){const e=t.getAttribute("data-tab-idx");this.changeTab(null,e),this.scrollToActive(e)}scrollToActive(t){const e=this.element.querySelector(`.${this.cssClass.activeLink}[data-tab="${t}"]`);if(!e)return!1;const s=e.getBoundingClientRect().left-window.innerWidth/2+40;this.wrapperSelector.scrollLeft+=s}setActiveTabOnChange(t){this.tabLinks[t].classList.add(this.cssClass.activeLink),this.tabSections[t].classList.add(this.cssClass.activeSection)}clearActiveClass(){this.tabLinks.forEach(t=>t.classList.remove(this.cssClass.activeLink)),this.tabSections.forEach(t=>t.classList.remove(this.cssClass.activeSection)),this.imageList.forEach(t=>t.classList.remove(this.cssClass.activeImage)),this.element.setAttribute("style","")}setActiveContainer(t,e=null){let s=e||t.currentTarget.getAttribute("data-tab"),i=this.element.querySelector(`[id="${s}"], [data-tab-idx="${s}"]`),a=this.element.querySelector(`[data-tab-image-id="${s}"]`);const n=e?this.element.querySelector(`.nx-tabs-links__item[data-tab="${e}"]`):t.target;this.setActiveLink(n),this.setActiveTab(i),a&&this.setActiveImage(a),this.updateBackgroun
1dColor(n)}setActiveLink(t){t.classList.add(this.cssClass.activeLink)}setActiveTab(t){t.classList.add(this.cssClass.activeSection)}getHeightActiveTab(t){return t?(0,i.UI)(t):0}setActiveImage(t){t.classList.add(this.cssClass.activeImage)}updateBackgroundColor(t){this.element.setAttribute("style",null==t?void 0:t.getAttribute("data-style"))}}c.setup(n)}}]);
2//# sourceMappingURL=/dist/NiveaX/./modules/Tab.551e4d4b.js.47bced89.map

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.