1"use strict";(self.NiveaXwebpackJsonp=self.NiveaXwebpackJsonp||[]).push([[8528],{78650:(e,t,i)=>{i.r(t),i.d(t,{default:()=>s});const o='[data-module="Tooltip"]';class s{static setup(e=o){Array.from(document.querySelectorAll(e)).filter(e=>!e.dataset.moduleInitialized).forEach(e=>{new s(e),e.dataset.moduleInitialized="true"})}constructor(e){this.element=e,this.element=e,this.init(e)}init(e){this.listenTouchDevice(e),this.eventListeners(e),this.setPositionOfTooltip(),this.mobileDesktopChangeEventListener()}eventListeners(e){e.addEventListener("click",e=>this.toggleTooltip(e),!1),document.addEventListener("close-tooltips",e=>this.checkToCloseTooltip(e.detail),!1),document.addEventListener("click",t=>this.checkOutsideClick(t,e),!1)}mobileDesktopChangeEventListener(){return document.addEventListener("niveax:breakpointchange",e=>{this.changePositionOfTooltip("isMobile"==e.detail.deviceType)}),this}setPositionOfTooltip(){this.changePositionOfTooltip(window.NiveaX.deviceType.isMobile)}changePositionOfTooltip(e){let t=this.element.parentElement.parentElement;if(e){let i=t.querySelector("[data-tooltip-mobile]"),o=t.querySelector(".nx-tooltip");i&&(i.insertBefore(o,i.children[0]),this.setPosition(e))}else{let i=t.querySelector("[data-tooltip-desktop]");i&&(i.appendChild(this.element),this.setPosition(),this.onResize(e))}}listenTouchDevice(e){document.addEventListener("touchstart",function t(){e.classList.add("nx-u-is-touch"),document.removeEventListener("touchstart",t)},{passive:!0})}toggleTooltip(e){e.preventDefault(),e.stopPropagation(),(this.element.closest(".
1nx-product-teaser__eshop-info")||this.element.closest(".nx-product-bottom-bar"))&&this.setPositionOfTooltip(),this.closeOtherTooltips(this.element),this.element.classList.toggle("nx-u-over")}closeOtherTooltips(e){document.dispatchEvent(new CustomEvent("close-tooltips",{detail:e}))}checkToCloseTooltip(e){e!==this.element&&this.element.classList.remove("nx-u-over")}findPosition(e){let t=window.innerWidth,i=this.element.getBoundingClientRect(),o=this.element.querySelector(".nx-tooltip__content").getBoundingClientRect(),s=window.innerWidth/2,n=i.left,l=i.right,c=l>=s&&l<=s+100,r=n<=s&&n>=s-100;const h=this.element.querySelector(".nx-tooltip__content");return e&&(c||r)?(h.setAttribute("style",`left :calc(50% + (${s-n}px))`),"middle"):t-i.left-o.width<0?(h.removeAttribute("style"),"left"):(h.removeAttribute("style"),"right")}setPosition(e){this.element&&(this.element.classList.contains(`nx-u-tooltip-${this.findPosition(e)}`)||(this.element.classList.remove("nx-u-tooltip-left"),this.element.classList.remove("nx-u-tooltip-right"),this.element.classList.remove("nx-u-tooltip-middle"),this.element.classList.toggle(`nx-u-tooltip-${this.findPosition(e)}`)))}onResize(e){NiveaX.addToEventStore("resize",this.setPosition.bind([this,e]),window)}checkOutsideClick(e,t){t.contains(e.target)||this.element.classList.remove("nx-u-over")}}s.setup(o)}}]); 2//# sourceMappingURL=/dist/NiveaX/./modules/Tooltip.4521d439.js.fba641be.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.