1class LookbookSection extends HTMLElement{connectedCallback(){this.#bindDesktop(),this.#bindMobile(),this.#bindOutsideClick()}#bindDesktop(){this.querySelectorAll("[data-hotspot]").forEach(btn=>{btn.addEventListener("click",e=>{e.stopPropagation();const idx=btn.dataset.hotspot;this.#toggle(idx,"[data-card]","[data-hotspot]")})}),this.querySelectorAll("[data-close]").forEach(btn=>{btn.addEventListener("click",e=>{e.stopPropagation();const card=this.querySelector(`[data-card="${btn.dataset.close}"]`);card&&card.classList.add("hidden")})})}#bindMobile(){this.querySelectorAll("[data-hotspot-mobile]").forEach(btn=>{btn.addEventListener("click",e=>{e.stopPropagation();const idx=btn.dataset.hotspotMobile;this.#toggle(idx,"[data-card-mobile]","[data-hotspot-mobile]")})}),this.querySelectorAll("[data-close-mobile]").forEach(btn=>{btn.addEventListener("click",e=>{e.stopPropagation();const card=this.querySelector(`[data-card-mobile="${btn.dataset.closeMobile}"]`);card&&card.classList.add("hidden")})})}#toggle(idx,cardAttr,hotspotAttr){this.querySelectorAll(cardAttr).forEach(c=>{c.getAttribute(cardAttr.replace("[","").replace("]",""))!==idx&&c.classList.add("hidden")});const attr=cardAttr.replace("[","").replace("]",""),card=this.querySelector(`${cardAttr.slice(0,-1)}="${idx}"]`);if(!card)return;const isHidden=card.classList.contains("hidden");card.classList.toggle("hidden",!isHidden),isHidden&&requestAnimationFrame(()=>this.#positionCard(card))}#positionCard(card){const container=card.parentElement;if(!container)return;const containerRect=container.getBoundingClientRect(),cardEl=card.querySelector(":scope > div");if(!cardEl)return;const cardRect=cardEl.getBoundingClientRect();card.style.transform="";const rightOverflow=cardRect.right-containerRect.right,bottomOverflow=cardRect.bottom-containerRect.bottom;let tx=10,ty=-cardRect.height/2;rightOverflow>0&&(tx=-(cardRect.width+10)),card.getBoundingClientRect().left+tx<containerRect.left&&(tx=10),bottomOverflow>0&&(ty-=bottomOverflow+10),card.getBoundingClientRect().top+ty<containerRect.top&&(ty=10),card.style.transform=`translate(${tx}px, ${ty}px)`}#bindOutsideClick(){document.addEventListener("click",e=>{if(!this.contains(e.target)){this.querySelectorAll(".lookbook-card").forEach(c=>c.classList.add("hidden"));return}e.target.closest("[data-hotspot], [data-hotspot-mobile], .lookbook-card")||this.querySelectorAll(".lookbook-card").forEach(c=>c.classList.add("hidden"))})}}customElements.define("lookbook-section",LookbookSection);export{LookbookSection}; 2//# sourceMappingURL=/cdn/shop/t/20/assets/lookbook.js.map?v=40958880998856220391776447043
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.