PageSourceSearch

https://racr.it/cdn/shop/t/2/assets/lookbook-script.js?v=165532553026237763421675093636

js racr.it collected 2026-09-25 13:22:05 UTC 7,086 bytes, 2 lines download raw bytes

1if(typeof lookbookDialogRef>"u"){class LookbookDialogDot extends HTMLElement{constructor(){super()}connectedCallback(){this.RESERVED_SPACE=20,this.left=0,this.top=0,this.inLeftHalf=!0,this.dialog=this.querySelector("[data-lookbook-dialog]"),this.productItem=this.querySelector(".product-item"),this.closeDialogButton=this.querySelector("[data-close-lookbook-dialog-button]"),this.productItem.appendChild(this.closeDialogButton),window.innerWidth>1024?this.addEventListener("click",this.toggleDialog.bind(this)):this.closeDialogButton.style.display="none",window.addEventListener("resize",this.onResize.bind(this))}onResize(){window.innerWidth>1024?(this.removeEventListener("click",this.toggleDialog.bind(this)),this.addEventListener("click",this.toggleDialog.bind(this)),this.closeDialogButton.style.display="block"):(this.removeEventListener("click",this.toggleDialog.bind(this)),this.closeDialogButton.style.display="none"),this.dialog.hasAttribute("open")&&this.closeDialog()}resetPosition(){this.left=0,this.top=0,this.setPosition()}toggleDialog(e){if(!(window.innerWidth<=1024)){if(e.target.matches("[data-close-lookbook-dialog-button]"))return this.closeDialog();if(this.checkIsQuickshop3(e))return this.closeDialog();if(this.checkIsQuickView(e))return this.closeDialog();if(!(e.target.closest(".product-item")||e.target.matches(".product-item"))){if(this.dialog.hasAttribute("open"))return this.closeDialog();e.target.matches(".glyphicon")&&(e.stopImmediatePropagation(),this.openDialog())}}}checkIsQuickshop3(e){return document.body.classList.contains("quick_shop_option_3")?e.target.matches("[data-quickshop-popup]")||e.target.closest("[data-quickshop-popup]"):!1}checkIsQuickView(e){return e.target.matches("[data-open-quick-view-popup]")||e.target.closest("[data-open-quick-view-popup]")||e.target.matches(".card-quickview")}openDialog(){this.currentTop=window.scrollY,this.resetPosition(),this.dialog.showModal(),this.calculatePosition({currentWindowTop:this.currentTop}),this.setPosition(),window.scrollTo({top:this.currentTop}),this.productItem.scrollIntoView({block:"nearest",behavior:"smooth"})}closeDialog(){this.productItem.classList.add("closing"),setTimeout(()=>{this.resetPosition(),this.dialog.close(),this.productItem.classList.remove("closing")},500)}calculatePosition({currentWindowTop}){const lookbookDotBox=this.getBoundingClientRect(),dialogBox=this.productItem.getBoundingClientRect();if(window.innerWidth>1024){const{left:dotLeft,right:dotRight,top:dotTop,width:dotWidth}=lookbookDotBox,{left:dialogLeft,top:dialogTop,width:dialogWidth,height:dialogHeight}=dialogBox,axis=window.innerWidth/2;dotLeft+dotWidth/2>axis&&(this.inLeftHalf=!1),this.left=LookbookDialogDot.getLeft({inLeftHalf:this.inLeftHalf,reservedSpace:this.RESERVED_SPACE,right:dotRight,left:dotLeft,dialogLeft,dialogWidth}),this.top=LookbookDialogDot.getTop({top:dotTop,dialogHeight,dialogTop,currentWindowTop,reservedSpace:this.RESERVED_SPACE})}else this.top=50,this.left=50}setPosition(){this.productItem.style.setProperty("--top",this.top),this.productItem.style.setProperty("--left",this.left)}static getLeft(params){const{inLeftHalf,reservedSpace,right,left,dialogLeft,dialogWidth}=params;let intendedLeft,deltaLeft;return inLeftHalf?(intendedLeft=right+reservedSpace,deltaLeft=-1*(dialogLeft-intendedLeft)):(intendedLeft=left-reservedSpace-dialogWidth,deltaLeft=intendedLeft-dialogLeft),deltaLeft}static getTop(params){const{top,dialogHeight,reservedSpace,dialogTop,currentWindowTop}=params;let intendedTop,deltaTop;return top+dialogHeight+reservedSpace>currentWindowTop+window.innerHeight?(intendedTop=top-dialogHeight+reservedSpace,deltaTop=-1*(dialogTop-intendedTop)):(intendedTop=top-reservedSpace,deltaTop=intendedTop-dialogTop),deltaTop}}class LookbookWrapper extends HTMLElement{constructor(){super()}connectedCallback(){this.lookbookIcons=[...this.querySelectorAll("[data-lookbook-icon]")],this.initialized=!1,window.innerWidth<=1024&&this.lookbookIcons.forEach(icon=>{icon.addEventListener("click",this.onClick.bind(this))}),window.addEventListener("resize",this.onResize.bind(this)),setTimeout(()=>{this.initialized=!0},150)}onResize(){window.innerWidth<=1024?this.lookbookIcons.forEach(icon=>{icon.removeEventListener("click",this.onClick.bind(this)),icon.addEventListener("click",this.onClick.bind(this))}):this.lookbookIcons.forEach(icon=>{icon.removeEventListener("click",this.onClick.bind(this))})}onClick(e){window.innerWidth>1024||!this.initialized||this.buildPopup(e)}buildPopup(e){const icon=e.currentTarget,currentIndex=this.lookbookIcons.indexOf(icon);this.lookbookIcons.forEach(icon2=>{const productItem=icon2.querySelector(".product-item"),dialog=icon2.querySelector("[data-lookbook-dialog]");if(productItem){const signature=`sig-${productItem.dataset.productId}-${Date.now().toString()}`;dialog.dataset.signature=signature,productItem.dataset.signature=signature,LookbookMobilePopup.appendItem(productItem)}}),LookbookMobilePopup.togglePopup(!0,currentIndex)}}class LookbookMobilePopup extends HTMLElement{constructor(){super()}connectedCallback(){this.contentWrapper=this.querySelector("[data-lookbook-mobile-images-container]"),this.closeButton=this.querySelector("[data-close-lookbook-modal]"),this.closeButton.addEventListener("click",()=>{LookbookMobilePopup.togglePopup(!1)}),this.addEventListener("click",this.onSelfClick.bind(this)),window.addEventListener("resize",this.onResize.bind(this))}onSelfClick(e){e.target.tagName.toLowerCase()==="lookbook-mobile-popup"&&(LookbookMobilePopup.togglePopup(!1),document.getElementById("halo-card-mobile-popup")?.classList.remove("show"),document.body.classList.remove("quick_shop_popup_mobile"))}onResize(){LookbookMobilePopup.togglePopup(!1)}static appendItem(item){document.querySelector("[data-lookbook-popup-mobile] [data-lookbook-mobile-images-container]").appendChild(item)}static togglePopup(isOpen,indexToScroll=0){const contentWrapper=document.querySelector("[data-lookbook-popup-mobile] [data-lookbook-mobile-images-container]");if(LookbookMobilePopup.checkAndSetOverflowing(contentWrapper),document.body.classList.toggle("mobile-popup-active",isOpen),isOpen)setTimeout(()=>{document.querySelectorAll("[data-lookbook-popup-mobile] .product-item")[indexToScroll]?.scrollIntoView({behavior:"smooth",block:"start"})},400);else{const items=contentWrapper.querySelectorAll("[data-signature]");setTimeout(()=>
1{items.forEach(item=>{const signature=item.dataset.signature;document.querySelector(`[data-lookbook-dialog][data-signature="${signature}"]`).appendChild(item)})},350)}}static checkAndSetOverflowing(contentWrapper=null){contentWrapper&&contentWrapper.classList.toggle("center",contentWrapper.scrollWidth<=contentWrapper.clientWidth)}}var lookbookDialogRef=LookbookDialogDot;window.addEventListener("load",()=>{customElements.define("lookbook-dialog-dot",LookbookDialogDot),customElements.define("lookbook-wrapper",LookbookWrapper),customElements.define("lookbook-mobile-popup",LookbookMobilePopup)})}
2//# sourceMappingURL=/cdn/shop/t/2/assets/lookbook-script.js.map?v=165532553026237763421675093636

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.