PageSourceSearch

https://www.pawsomepawsboutique.co.uk/cdn/shop/t/33/assets/product.js?v=122340855978345389201781531014

js pawsomepawsboutique.co.uk collected 2026-10-09 04:13:20 UTC 8,625 bytes, 2 lines download raw bytes

1class NikitaProduct extends HTMLElement{constructor(){super(),this.productForm=this.querySelector("form.nikita-product-form"),this.atcBtn=this.productForm.querySelector('button[type="submit"]'),this.stickyAtcBtn=this.querySelector("button#sticky-AddToCart"),this.soldOut=!1,this.v_id=this.productForm.querySelector("select").value,this.playButton=this.querySelector("[data-gallery-video-control]"),this.playButton&&this.playButton.addEventListener("click",this.playVideo.bind(this)),this.video=this.querySelector("[data-gallery-video] video"),this.video&&(this.video.addEventListener("click",this.pauseVideo.bind(this)),this.initVideoObserver()),this.thumbSwiper=new Swiper(this.querySelector(".thumbslider .swiper"),{slidesPerView:6,spaceBetween:8,loop:!0,navigation:{nextEl:this.querySelector(".thumbslider .button-next"),prevEl:this.querySelector(".thumbslider .button-prev")},breakpoints:{1025:{direction:"vertical",slidesPerView:4,spaceBetween:15}}});let direction="";window.innerWidth>1024?direction="vertical":direction="horizontal",this.thumbSwiper.changeDirection(direction),this.mediaSlider=new Swiper(this.querySelector(".mainslider .swiper"),{spaceBetween:10,loop:!0,cssMode:window.navigator.platform==="iPhone",zoom:{maxRatio:1.5,minRatio:1},thumbs:{swiper:this.thumbSwiper}}),this.addAction(),this.syncInitialPurchaseState(),this.watchKlaviyoNotifyButton()}watchKlaviyoNotifyButton(){if(!this.productForm||this.closest("#quick_view_modal"))return;const syncFromState=()=>{const productOptions=this.querySelector("product-options");productOptions&&this.syncKlaviyoBackInStock(productOptions.dataset.availability==="true",productOptions.dataset.v_id)};this.klaviyoNotifyObserver=new MutationObserver(syncFromState),this.klaviyoNotifyObserver.observe(this.productForm,{childList:!0,subtree:!0})}disconnectedCallback(){this.klaviyoNotifyObserver&&this.klaviyoNotifyObserver.disconnect()}syncInitialPurchaseState(){const productOptions=this.querySelector("product-options");if(!productOptions)return;const isAvailable=productOptions.dataset.availability==="true";this.setPurchaseAvailability(isAvailable,productOptions.dataset.v_id)}setPurchaseAvailability(isAvailable,variantId=null){if(this.soldOut=!isAvailable,this.atcBtn&&this.atcBtn.classList.toggle("available-sold",isAvailable),this.stickyAtcBtn){this.stickyAtcBtn.classList.toggle("available-sold",isAvailable);const stickyWrapper=this.stickyAtcBtn.closest(".sticky-atc-wrapper");stickyWrapper&&stickyWrapper.classList.toggle("variant-unavailable",!isAvailable)}const resolvedVariantId=variantId||this.v_id||this.productForm?.querySelector("product-options")?.dataset?.v_id;this.closest("#quick_view_modal")||(this.syncKlaviyoBackInStock(isAvailable,resolvedVariantId),isAvailable||this.reorderOosCtaButtons())}reorderOosCtaButtons(){const ctasHolder=this.productForm?.querySelector(".ctas_holder");if(!ctasHolder)return;const notifyButton=ctasHolder.querySelector(".notifyButtonStyle, .klaviyo-bis-trigger, [data-klaviyo-bis-trigger], .restock-alerts-notify-button"),wishlistButton=ctasHolder.querySelector('.nm-wishlist-button, [class*="wishlist-button"]');if(!notifyButton||!wishlistButton)return;const notifyNode=notifyButton.closest(".nm-portal")||notifyButton,wishlistNode=wishlistButton.closest(".nm-portal")||wishlistButton;notifyNode!==wishlistNode&&wishlistNode.parentNode===ctasHolder&&notifyNode.compareDocumentPosition(wishlistNode)&Node.DOCUMENT_POSITION_PRECEDING&&ctasHolder.insertBefore(notifyNode,wishlistNode)}syncKlaviyoBackInStock(isAvailable,variantId){if(!this.productForm||this.closest("#quick_view_modal"))return;const variantSelect=this.productForm.querySelector('select[name="id"]');if(variantSelect&&variantId){const nextValue=String(variantId);variantSelect.value!==nextValue&&(variantSelect.value=nextValue,variantSelect.dispatchEvent(new Event("change",{bubbles:!0})))}if(!variantId)return;this.productForm.querySelectorAll(".notifyButtonStyle, .klaviyo-bis-trigger, [data-klaviyo-bis-trigger], .restock-alerts-notify-button").forEach(button=>{button.dataset.variantId=variantId,button.hidden=isAvailable,button.style.display=isAvailable?"n
1one":"",button.setAttribute("aria-hidden",isAvailable?"true":"false")}),isAvailable||this.reorderOosCtaButtons()}addAction(){this.mediaSlider.on("slideChangeTransitionStart",this.mediaSlider.zoom.out),window.addEventListener("resize",()=>{window.innerWidth<=1024?this.thumbSwiper.changeDirection("horizontal"):this.thumbSwiper.changeDirection("vertical"),window.innerWidth==1024&&this.thumbSwiper.changeDirection("horizontal")}),this.mediaSlider.on("click",this.mediaSlider.zoom.in),this.addEventListener("variant:change",ev=>{const isAvailable=ev.target.dataset.availability==="true",variantId=ev.target.dataset.v_id;if(this.setPurchaseAvailability(isAvailable,variantId),!variantId)return;this.v_id=variantId;let m_id=ev.target.dataset.m_id;this.v_price=ev.target.dataset.v_price;let slided=!1;const slider=this.mediaSlider;this.querySelectorAll(".mainslider .swiper-slide .img-wrapper").forEach((img,arg)=>{img.dataset.id==m_id&&!slided&&(slided=!0,slider.slideTo(arg))});const bundlePriceContainer=document.querySelector("[data-bundle-price]");if(bundlePriceContainer){const symbol=bundlePriceContainer.getAttribute("data-bundle-price"),dataPrice=parseFloat(this.v_price.replace(/[^\d.]/g,"")),percentPrice=dataPrice*.2,totalBundlePrice=(dataPrice-percentPrice).toFixed(2);if(document.querySelector(".product_price").innerHTML=`${symbol}${totalBundlePrice}`,document.querySelector(".product_compare_price").innerHTML=`${this.v_price}`,this.atcBtn){const addToCartPrice=this.atcBtn.querySelector("#AddToCartPrice");addToCartPrice&&(addToCartPrice.innerHTML=`${symbol}${totalBundlePrice}`)}if(this.stickyAtcBtn){const stickyAddToCartPrice=this.stickyAtcBtn.querySelector("#AddToCartPrice");stickyAddToCartPrice&&(stickyAddToCartPrice.innerHTML=`${symbol}${totalBundlePrice}`)}}else{if(document.querySelector(".product_price").innerHTML=this.v_price,this.atcBtn){const addToCartPrice=this.atcBtn.querySelector("#AddToCartPrice");addToCartPrice&&(addToCartPrice.innerHTML=this.v_price)}if(this.stickyAtcBtn){const stickyAddToCartPrice=this.stickyAtcBtn.querySelector("#AddToCartPrice");stickyAddToCartPrice&&(stickyAddToCartPrice.innerHTML=this.v_price)}}}),this.addEventListener("product:soldout",()=>{this.setPurchaseAvailability(!1)}),this.productForm.addEventListener("submit",ev=>{ev.preventDefault(),this.addToCart(this.soldOut)}),this.atcBtn.addEventListener("click",ev=>{ev.preventDefault(),this.addToCart(this.soldOut)}),this.stickyAtcBtn&&this.stickyAtcBtn.addEventListener("click",ev=>{ev.preventDefault(),this.addToCart(this.soldOut)}),document.addEventListener("scroll",()=>{if(!this.atcBtn)return;const{top,height}=this.atcBtn.getBoundingClientRect();this.stickyShow(top+height<0)})}addToCart(soldOut=!1){if(soldOut||!this.productForm||this.productForm.classList.contains("variant-unavailable")||this.productForm.classList.contains("disabled"))return null;const properties={};this.productForm.querySelectorAll("input").forEach(input=>{if(input.getAttribute("name")?.includes("properties")){const match=input.getAttribute("name").match(/properties\[(.*?)\]/);match&&(properties[match[1]]=input.value)}});let body={id:this.v_id,quantity:1,properties,sections:ThatWorks.cartElement.getSectionsToRender().map(section=>section.id)};console.log(body),fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)}).then(res=>res.json()).then(res=>{document.dispatchEvent(ThatWorks.pixelEvent.cart),ThatWorks.cartElement.renderContents(res)})}stickyShow(status){if(!this.stickyAtcBtn)return;const parent=this.stickyAtcBtn.parentElement;parent.classList.toggle("sticky",status);const height=status?parent.getBoundingClientRect().height:0;window.innerWidth<550&&(document.querySelector("footer").style.marginBottom=`${height}px`)}playVideo(){this.video.play(),this.playButton.classList.add("is-hidden"),this.video.addEventListener("ended",()=>{this.playButton.classList.remove("is-hidden")},{once:!0})}pauseVideo(){this.video.pause(),this.playButton.classList.remove("is-hidden")}initVideoObserver(){this.videoObserver=new IntersectionObserver(entries=>
1{entries.forEach(entry=>{entry.isIntersecting||(this.video.pause(),this.playButton.classList.remove("is-hidden"))})}),this.videoObserver.observe(this.video)}}window.customElements.define("nikita-product",NikitaProduct),window.ThatWorks.productElement=document.querySelector("nikita-product");
2//# sourceMappingURL=/cdn/shop/t/33/assets/product.js.map?v=122340855978345389201781531014

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.