PageSourceSearch

https://hunterboots.com/cdn/shop/t/233/assets/HTMLUpdateUtility.CJOjKlJ7.min.js

js hunterboots.com collected 2026-09-25 04:07:02 UTC 5,084 bytes, 1 lines download raw bytes

1var y=c=>{throw TypeError(c)};var L=(c,e,t)=>e.has(c)||y("Cannot "+t);var m=(c,e,t)=>(L(c,e,"read from private field"),t?t.call(c):e.get(c)),S=(c,e,t)=>e.has(c)?y("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(c):e.set(c,t),b=(c,e,t,s)=>(L(c,e,"write to private field"),s?s.call(c,t):e.set(c,t),t);import{c as I,f as _}from"./WithApiClient.CPffo4ee.min.js";import{f as F}from"./firstFocusableElement.BqnhZP5g.min.js";import{d as A}from"./index.CKJCYK2x.min.js";const P=["application/json","application/ld+json"];var f,d;class M{constructor(e,t=[]){S(this,f);S(this,d);this.lastFocusedElementSelectorId=null,this.$subSectionsCache={},this.skippedParams=[],this.$api=I({baseUrl:""},"html-update-utility"),b(this,f,[]),b(this,d,[]),(this.host=e).addController(this),this.skippedParams=t}async fetchSections({sectionIds:e,baseUrl:t=null,params:s={},includeExistingParams:i=!0,withCache:r=!1}){var n;if(e.length===0)return{};(n=this.abortController)==null||n.abort("Previous request aborted"),this.abortController=new AbortController;const o=i?_(new URLSearchParams(window.location.search)):{};return await this.$api(`${t??window.location.pathname}`,{method:"GET",signal:this.abortController.signal},{params:{...o,...s,sections:e.join(",")},withCache:r,forceJSON:!0})}addPreProcessCallback(e){m(this,f).push(e)}addPostProcessCallback(e){m(this,d).push(e)}hostDisconnected(){var e;(e=this.abortController)==null||e.abort("Host disconnected")}_updateAttributes(e,t){Array.from(t.attributes).forEach(s=>{s.name!=="cloak"&&!this.skippedParams.includes(s.name)&&e.getAttribute(s.name)!==s.value&&e.setAttribute(s.name,s.value)}),Array.from(e.attributes).forEach(s=>{s.name!=="cloak"&&!this.skippedParams.includes(s.name)&&!t.hasAttribute(s.name)&&e.removeAttribute(s.name)})}extractSubsectionIds(e){return Array.from(e.querySelectorAll("[sub-section-id]")).map(s=>s.getAttribute("sub-section-id")).filter(Boolean)}selectSubsection(e,t){return e.querySelector(`[sub-section-id="${t}"]`)}async fetchAndReplaceSections({renderRoot:e,forceReplaceAll:t=!1,sectionIds:s,baseUrl:i=null,params:r={},includeExistingParams:o=!0,withCache:l=!1,filterHTML:n}){const h=await this.fetchSections({sectionIds:s,baseUrl:i,params:r,includeExistingParams:o,withCache:l});for(const a in h){const u=n?n(h[a]):h[a],p=e.querySelector(`[section-id="${a}"]`);if(!p||!u||typeof u!="string")continue;const E=this.parseSectionStringForSelector(u,`[section-id="${a}"]`);E&&await this.replace(p,E,t)}}async fetchAndReplaceSectionId({renderRoot:e,forceReplaceAll:t=!1,sectionId:s,baseUrl:i=null,params:r={},includeExistingParams:o=!0,withCache:l=!1,filterHTML:n}){const h=await this.fetchSections({sectionIds:[s],baseUrl:i,params:r,includeExistingParams:o,withCache:l});for(const a in h){const u=n?n(h[a]):h[a];if(!u||typeof u!="string")continue;const p=this.parseSectionStringForSelector(u,`[section-id="${a}"]`);p&&await this.replace(e,p,t)}}_recordLastFocusedElement(e){try{const t=document.activeElement;t&&t.id&&(e.contains(t)||t===e)&&(this.lastFocusedElementSelectorId=t.id)}catch(t){console.error(t)}}_restoreFocusToLastElement(e){try{this.lastFocusedElementSelectorId&&setTimeout(()=>{var s;const t=document.getElementById(`${this.lastFocusedElementSelectorId}`);t?t==null||t.focus():(s=F(e)||e)==null||s.focus(),this.lastFocusedElementSelectorId=null},50)}catch(t){console.error(t)}}async replace(e,t,s=!1){this._recordLastFocusedElement(e),m(this,f).forEach(r=>r(t));const i=A();requestAnimationFrame(async()=>{await this._runReplace(e,t,s),i.resolve()}),await i.promise,m(this,d).forEach(r=>r(t)),this._restoreFocusToLastElement(e)}async wrapUpdateProcess(e,t,s){this._recordLastFocusedElement(e),m(this,f).forEach(r=>r(t));const i=A();requestAnimationFrame(async()=>{await s(t),i.resolve()}),await i.promise,m(this,d).forEach(r=>r(t)),this._restoreFocusToLastElement(e)}async _runReplace(e,t,s=!1){const i=s?[]:this.extractSubsectionIds(t);if(i.length>0)for(const r of i){const o=this.selectSubsection(t,r),l=this.selectSubsection(e,r);o&&l&&(!this._checkSubSectionsCache(r,o.innerHTML)&&await this.setInnerHTML(l,o),this._setSubSectionsCache(r,o.innerHTML))}else await this.setInnerHTML(e,t)}_setSubSectionsCache(e,t){this.$subSectionsCache[e]=t}_checkSubSectionsCache(e,t){return this.$subSectionsCache[e]===t?!0:(this.$subSectionsCache[e]=t,!1)}parseSectionStringForSelector(e,t){return new DOMParser().parseFromString(e,"text/html").querySelector(t)}_render(e,t){this._setInnerHTML(e,t.innerHTML),this._updateAttributes(e,t)}setInnerHTML(e,t){return new Promise(s=>{setTimeout(()=>{this._render(e,t),s(e)},0)})}_setInnerHTML(e,t){e.innerHTML=t,this.reRunScripts(e)}reRunScripts(e){e.querySelectorAll("script").forEach(t=>{var i;if(P.includes(t.type))return;const s=document.createElement("script");
1Array.from(t.attributes).forEach(r=>{s.setAttribute(r.name,r.value)}),s.appendChild(document.createTextNode(t.innerHTML)),(i=t.parentNode)==null||i.replaceChild(s,t)})}flushCache(){this.$api("FLUSH_CACHE"),this.$subSectionsCache={}}}f=new WeakMap,d=new WeakMap;export{M as H};

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.