PageSourceSearch

https://www.modernprairie.com/cdn/shop/t/252/assets/gd-load-more.js?v=148612196681897330151790027244

js modernprairie.com collected 2026-09-25 14:57:58 UTC 3,756 bytes, 2 lines download raw bytes

1class GDLoadMore extends HTMLElement{connectedCallback(){this.grid=document.getElementById("product-grid"),this.button=this.querySelector("[data-load-more-button]"),this.status=this.querySelector("[data-load-more-status]"),this.sentinel=this.querySelector("[data-load-more-sentinel]"),this.isLoading=!1,!(!this.grid||!this.button)&&(this.onClick=this.onClick.bind(this),this.button.addEventListener("click",this.onClick),this.dataset.mode==="infinite"&&this.startObserving())}disconnectedCallback(){this.button&&this.onClick&&this.button.removeEventListener("click",this.onClick),this.stopObserving()}startObserving(){if(!this.sentinel||!("IntersectionObserver"in window)){this.revealButton();return}this.observer=new IntersectionObserver(entries=>{entries.some(entry=>entry.isIntersecting)&&this.loadNext(!1)},{rootMargin:"800px 0px"}),this.observer.observe(this.sentinel)}rearmObserver(){!this.observer||!this.sentinel||!this.dataset.nextUrl||(this.observer.unobserve(this.sentinel),this.observer.observe(this.sentinel))}revealButton(){this.classList.add("gd-load-more--manual"),this.button&&this.button.classList.remove("visually-hidden")}stopObserving(){this.observer&&(this.observer.disconnect(),this.observer=null)}onClick(){this.loadNext(!0)}async loadNext(userInitiated){const nextUrl=this.dataset.nextUrl;if(!(!nextUrl||this.isLoading)){this.isLoading=!0,this.setBusy(!0);try{const response=await fetch(nextUrl);if(!response.ok)throw new Error(`Request failed with ${response.status}`);const doc=new DOMParser().parseFromString(await response.text(),"text/html"),newGrid=doc.getElementById("product-grid");if(!newGrid)throw new Error("No #product-grid in the fetched page");const fragment=document.createDocumentFragment();let firstNew=null;newGrid.querySelectorAll(":scope > li").forEach(item=>{if(item.hasAttribute("data-ingrid-placement"))return;const node=document.importNode(item,!0);firstNew||(firstNew=node),fragment.appendChild(node)});const addedCount=fragment.childElementCount;if(this.grid.appendChild(fragment),typeof initializeScrollAnimationTrigger=="function")try{initializeScrollAnimationTrigger(this.grid)}catch(animationError){console.warn("[gd-load-more] animation re-init skipped",animationError)}const nextMarker=doc.querySelector("gd-load-more"),followUpUrl=nextMarker&&nextMarker.getAttribute("data-next-url");followUpUrl?(this.dataset.nextUrl=followUpUrl,this.announce(this.strings().added.replace("[count]",addedCount))):this.finish(),userInitiated&&firstNew&&(firstNew.setAttribute("tabindex","-1"),firstNew.focus())}catch(error){console.error("[gd-load-more]",error),this.showError()}finally{this.isLoading=!1,this.setBusy(!1),this.rearmObserver()}}}finish(){delete this.dataset.nextUrl,this.stopObserving(),this.classList.add("gd-load-more--complete"),this.button&&(this.button.hidden=!0),this.sentinel&&(this.sentinel.hidden=!0),this.announce(this.strings().complete)}showError(){this.stopObserving(),this.revealButton(),this.announce(this.strings().error)}setBusy(isBusy){this.classList.toggle("gd-load-more--loading",isBusy),this.button&&(this.button.classList.toggle("loading",isBusy),this.button.setAttribute("aria-busy",isBusy?"true":"false"),isBusy?this.button.setAttribute("disabled","disabled"):this.button.removeAttribute("disabled"))}announce(message){this.status&&message&&(this.status.textContent=message)}strings(){return{added:this.dataset.textAdded||"[count] more products loaded",complete:this.dataset.textComplete||"All products loaded",error:this.dataset.textError||"Couldn't load more products. Please try again."}}}customElements.get("gd-load-more")||customElements.define("gd-load-more",GDLoadMore);
2//# sourceMappingURL=/cdn/shop/t/252/assets/gd-load-more.js.map?v=148612196681897330151790027244

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.