PageSourceSearch

https://hunterboots.com/cdn/shop/t/233/assets/WithApiClient.CPffo4ee.min.js

js hunterboots.com collected 2026-09-25 04:06:55 UTC 4,583 bytes, 1 lines download raw bytes

1import{d as O}from"./index.CKJCYK2x.min.js";async function R(e,s={},t=[],r=1*60*1e3){try{const a=q(e,t),h=Date.now();if((s.method??"GET").toUpperCase()==="GET")try{const o=localStorage.getItem(a);if(o){const{timestamp:l,body:u,headers:y}=JSON.parse(o);if(h-l<r)return new Response(u,{headers:y});localStorage.removeItem(a)}}catch(o){console.warn("Error reading from fetch cache",o)}const c=await fetch(e,s),n=c.clone();try{const o=await n.text(),l={};n.headers.forEach((u,y)=>{l[y]=u}),localStorage.setItem(a,JSON.stringify({timestamp:h,body:o,headers:l}))}catch{}return c}catch(a){return console.error("Error in fetchWithCache",a),fetch(e,s)}}function x(e){let s=0,t,r;for(t=0;t<e.length;t++)r=e.charCodeAt(t),s=(s<<5)-s+r,s|=0;return(s>>>0).toString(16).padStart(8,"0")}const q=(e,s=[])=>{var c;const t=typeof window<"u"&&((c=window.location)!=null&&c.origin)?window.location.origin:"http://localhost",r=new URL(e,t);r.hash="",s.forEach(n=>r.searchParams.delete(n));const a=r.pathname+(r.search?r.search:"");return`fetch-cache:${x(a)}`},m={},b={},A=async(e,s)=>{try{const t=e.headers.get("content-type");return t&&(t.includes("application/json")||t.includes("json")||t.includes("application/graphql")||t.includes("text/javascript"))||s!=null&&s.forceJSON?await e.json():await e.text()}catch(t){return console.error("Error in formattedResponse",t),await e.text()}},j=e=>{const s=new URLSearchParams;for(const t in e){const r=e[t];if(Array.isArray(r))for(const a of r)s.append(t,a);else s.set(t,r)}return s},N=e=>{const s={};for(const[t,r]of e)s[t]?Array.isArray(s[t])?s[t].push(r):s[t]=[s[t],r]:s[t]=r;return s},p=async(e,s,t,r,a)=>{var h,c,n,o;try{const l={...e.headers,...(r==null?void 0:r.headers)||{}},u=a!=null&&a.params?j(a.params):null;(h=e==null?void 0:e.onRequestStart)==null||h.call(e);const y={...l,...(r==null?void 0:r.headers)||{}};a!=null&&a.removeContentType&&delete y["Content-Type"];const i=(r==null?void 0:r.method)||e.defaultMethod||"GET",S=(a==null?void 0:a.withCache)&&i==="GET",U=(a==null?void 0:a.persistCache)&&i==="GET"?(d,K)=>R(d,K,a==null?void 0:a.persistCacheParamsToIgnore,a==null?void 0:a.persistCacheExpiryMs):fetch,f=`${e.baseUrl}${t}${u?"?"+u.toString():""}`;if(S){const d=s.get(f);if(d)return d}const C=await U(f,{signal:e.signal,method:i,...r,headers:y,...(r==null?void 0:r.body)&&(a==null?void 0:a.rawBody)&&{body:r.body},...(r==null?void 0:r.body)&&!(a!=null&&a.rawBody)&&{body:JSON.stringify(r.body)}});if(!C.ok||C.status>=400)throw await A(C,a);if((n=(c=r==null?void 0:r.headers)==null?void 0:c["Content-Type"])!=null&&n.includes("text/")){const d=await C.text();return S&&s.set(f,d),d}const T=await A(C,a);return S&&s.set(f,T),T}catch(l){throw console.error("Error in createApiClient",l),l}finally{(o=e==null?void 0:e.onRequestEnd)==null||o.call(e)}},P=async(e,s,t)=>{if(b[t])return;b[t]=!0;const r=m[t];for(;r.length>0;){const{requestArguments:a,deferred:h}=r.shift();try{const c=await p(e,s,a.endpoint,a.init,a.options);h.resolve(c)}catch(c){h.reject(c)}}b[t]=!1},E=(e,s)=>{const t=new I(s);return e.withQueue&&e.queueKey&&(m[e.queueKey]||(m[e.queueKey]=[])),(r,a,h)=>{if(r==="FLUSH_CACHE")return t.clear(),Promise.resolve({});if(e.withQueue&&e.queueKey){const c=O();return m[e.queueKey].push({requestArguments:{endpoint:r,init:a,options:h},deferred:c}),P(e,t,e.queueKey),c.promise}return p(e,t,r,a,h)}},$=e=>{class s extends e{constructor(){super(...arguments),this.$api=new _(this)}}return s};class _{constructor(s){this.abortController=new AbortController,this.fetchClient=E({baseUrl:"",signal:this.abortController.signal}),this.storefrontClient=E({baseUrl:`${window.Shopify.routes.root==="/"?"":window.Shopify.routes.root}/api/2024-07/graphql.json`,headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":`${window.__STOREFRONT_ACCESS_TOKEN__}`},defaultMethod:"POST",signal:this.abortController.signal}),this.shopifyClient=E({baseUrl:`${window.Shopify.routes.root}`,headers:{"Content-Type":"application/json"},signal:this.abortController.signal}),(this.host=s).addController(this)}hostDisconnected(){this.abortController.abort()}get client(){return{fetchClient:this.fetchClient,storefront:s=>this.storefrontClient("",s),shopify:this.shopifyClient}}}const w=new Map;class I{constructor(s){if(this.cache=new Map,this.get=t=>this.cache.get(t),this.set=(t,r)=>this.cache.set(t,r),this.clear=()=>this.cache.clear(),this.cacheKey=s,this.cacheKey&&(w.has(this.cacheKey)||w.set(this.cacheKey,this)),this.cacheKey&&w.has(this.cacheKey)){const t=w.get(this.cacheKey);t&&(this.cache=t.cache)}}}export{$ as W,E as c,N as f};

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.