PageSourceSearch

https://www.neweracap.com/cdn/shop/t/5423/assets/ne-auth-session.js?v=17256327034652745351790258017

js neweracap.com collected 2026-09-24 17:21:55 UTC 2,944 bytes, 2 lines download raw bytes

1(()=>{let pending;function readState(html){const node=html.getElementById("NeCustomerState"),state=node&&JSON.parse(node.textContent);if(!html.body.classList.contains("is-logged")||!Number.isSafeInteger(state?.customer?.id)||state.customer.id<=0)throw new Error("Customer session was not confirmed");return state}async function refreshPage(){const url=new URL(window.location.href);if(url.searchParams.delete("auth"),url.pathname.includes("/products/")){const variant=document.querySelector('main product-form [name="id"]')?.value;variant&&url.searchParams.set("variant",variant)}const response=await fetch(url,{credentials:"same-origin",cache:"no-store",signal:AbortSignal.timeout(3e4)});if(!response.ok||new URL(response.url).origin!==url.origin)throw new Error("Unable to refresh customer state");const html=new DOMParser().parseFromString(await response.text(),"text/html"),state=readState(html),updates=Array.from(document.querySelectorAll("[data-auth-refresh][id], .ne-auth-section[id]"),current=>{const next=html.getElementById(current.id);if(!next||!next.hasAttribute("data-auth-refresh")&&!next.classList.contains("ne-auth-section"))throw new Error("Customer UI is missing");return next.querySelectorAll('script:not([type="application/json"]):not([data-mega-panel])').forEach(script=>script.remove()),{current,next}});window.customer=state.customer,document.getElementById("NeCustomerState").textContent=JSON.stringify(state),document.body.classList.add("is-logged");for(const{current,next}of updates){current.dispatchEvent(new CustomEvent("shopify:section:unload",{bubbles:!0}));const placeholders=Array.from(next.querySelectorAll("[data-auth-preserve]"));current.querySelectorAll("[data-auth-preserve]").forEach(kept=>{const placeholder=placeholders.find(node=>node.dataset.authPreserve===kept.dataset.authPreserve);placeholder&&placeholder.replaceWith(kept)});for(const{name,value}of Array.from(next.attributes))current.setAttribute(name,value);current.replaceChildren(...Array.from(next.childNodes)),current.dispatchEvent(new CustomEvent("shopify:section:load",{bubbles:!0}))}const panels=Array.from(html.querySelectorAll("script[data-mega-panel]"));return document.querySelectorAll("script[data-mega-panel]").forEach(current=>{const next=panels.find(node=>node.dataset.megaPanel===current.dataset.megaPanel);next&&(current.textContent=next.textContent)}),document.querySelectorAll('[data-auth-open="login"], [data-auth-open="register"]').forEach(link=>{link instanceof HTMLAnchorElement&&(link.href=state.accountUrl),link.removeAttribute("data-auth-open")}),window.dispatchEvent(new CustomEvent("ne:customer-state",{detail:state})),window.Shopify?.PaymentButton?.init&&window.Shopify.PaymentButton.init(),state}window.NECustomerSession={refresh(){return pending||(pending=refreshPage().finally(()=>{pending=null})),pending}}})();
2//# sourceMappingURL=/cdn/shop/t/5423/assets/ne-auth-session.js.map?v=17256327034652745351790258017

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.