efficient-storefront-blocks 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{c as W,e as G,i as V,k as x,q as I,r as K,t as T}from"./chunk-2I435NJQ.js";var E="x-forwarded-for";function j(e){let t=(e??"").split(",").map(r=>r.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var ve="x-forwarded-host";function z(e,t,r){let n={};return e&&(n[ve]=e),t&&r==="uncached"&&(n[E]=t),n}function Z(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var Q="x-storefront-site",X="x-storefront-host";var Y={contentHash:"db2b679aad5380c6",schema:1,mediaFields:{ImageBlock:["src"],LogoBlock:["src"],Flex:["bgImage"],FeaturedCover:["image"],LongRead:["image"],Banner:["imageSrc"],Timeline:["imageSrc"],Logos:["items[].src"],ContactLocations:["locations[].photo"],HeroSingle:["imageFocal","mediaImage","mediaVideo","poster"],HeroSlide:["mediaImage","mediaVideo","poster"],PostCard:["image"],Gallery:["othersCards[].image","othersCards[].photos[].src","vehicleCards[].image","vehicleCards[].photos[].src","wheelCards[].image","wheelCards[].photos[].src"],GalleryItem:["image","photos[].src"],Manifesto:["imageSrc"],SectionHeader:["logoSrc"],IntroBleed:["imageSrc","imageSrcMobile"],Split:["imageSrc","textBgSrc"],ProcessSteps:["steps[].image"],DetailRows:["rows[].image"],PaymentBadges:["badges[].src"]},mediaKeyNames:["bgImage","image","imageFocal","imageSrc","imageSrcMobile","logoSrc","mediaImage","mediaVideo","photo","poster","src","textBgSrc"],snapshotObjects:{ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},hydratedLists:{Events:["posts"],SubscribeBlogs:["posts"]},technicalStateKeys:["imageFocal"]};var Ie="shop_access_token",ee="shop_refresh_token",q=null;function B(){T.removeItem(Ie),T.removeItem(ee)}var w={getAccess(){return q},takeLegacyRefresh(){let e=T.getItem(ee);return B(),e},setTokens(e){q=e,B()},clear(){q=null,B()}};function Ee(e){return!!e.src}function A(e){let t=e.finishes.filter(Ee);if(t.length===e.finishes.length)return e;let r=e.defaultFinish&&t.some(n=>n.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:r}}function qe(e){return e.listable!==!1}function $(e){return e.map(A).filter(qe)}var se=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],oe=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),O={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},ie=12,ae=/\burl\(/i,ce=new RegExp(`(?<![-\\w])(${se.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),le=new RegExp(`((?:^|[;{\\s"'])(?:${se.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),Be=/<svg\b([^>]*)>/i,$e=/\bfill\s*[=:]/i;function Ne(e){let t=e.replace(ce,(r,n,s,o,m)=>{let u=te(m);return u===null?r:`${n}${s}${o}${u}${o}`}).replace(le,(r,n,s)=>{let o=te(s);return o===null?r:`${n}${o}`});return t=t.replace(Be,(r,n)=>$e.test(n)?r:`<svg fill="#ffffff"${n}>`),t}function te(e){let t=/!important/i.test(e),r=e.replace(/!important/gi,"").trim().toLowerCase();if(!r||ae.test(r)||oe.has(r))return null;let n=r in O?[...O[r],1]:me(r);if(!n)return null;let[s,o,m,u]=n;if(Math.max(s,o,m)-Math.min(s,o,m)>ie)return null;let p=Ue(255-s,255-o,255-m,u);return t?`${p} !important`:p}function Ue(e,t,r,n){if(n<1)return`rgba(${e}, ${t}, ${r}, ${n})`;let s=o=>o.toString(16).padStart(2,"0");return`#${s(e)}${s(t)}${s(r)}`}function me(e){return e.startsWith("#")?Le(e):e.startsWith("rgb")?Me(e):e.startsWith("hsl")?De(e):null}function Le(e){let t=e.slice(1),r=1;if(t.length===3||t.length===4)t.length===4&&(r=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(n=>n+n).join("");else if(t.length===6||t.length===8)t.length===8&&(r=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),r]:null}function Me(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[r,n]=t.split("/"),s=r.split(/[\s,]+/).filter(Boolean).slice(0,3);if(s.length<3)return null;let o=s.map(u=>u.endsWith("%")?Math.round(parseFloat(u)/100*255):Math.round(parseFloat(u)));if(o.some(u=>Number.isNaN(u)))return null;let m=n?v(n):He(r);return[o[0],o[1],o[2],m]}function He(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?v(t[3]):1}function v(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function De(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[r,n]=t.split("/"),s=r.split(/[\s,]+/).filter(Boolean);if(s.length<3)return null;let o=parseFloat(s[0]),m=parseFloat(s[1])/100,u=parseFloat(s[2])/100;if([o,m,u].some(Oe=>Number.isNaN(Oe)))return null;let p=n?v(n):s.length>=4?v(s[3]):1,[f,S,P]=Je(o,m,u);return[f,S,P,p]}function Je(e,t,r){let n=(1-Math.abs(2*r-1))*t,s=(e%360+360)%360/60,o=n*(1-Math.abs(s%2-1)),m=0,u=0,p=0;s<1?[m,u,p]=[n,o,0]:s<2?[m,u,p]=[o,n,0]:s<3?[m,u,p]=[0,n,o]:s<4?[m,u,p]=[0,o,n]:s<5?[m,u,p]=[o,0,n]:[m,u,p]=[n,0,o];let f=r-n/2;return[Math.round((m+f)*255),Math.round((u+f)*255),Math.round((p+f)*255)]}var re=512*1024;function N(e){return/\.svg(\?|$)/i.test(e)}function We(e){return`data:image/svg+xml,${encodeURIComponent(Ne(e))}`}function Ge(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||ae.test(t)||oe.has(t))return null;let r=t in O?[...O[t],1]:me(t);if(!r)return null;let[n,s,o]=r;return Math.max(n,s,o)-Math.min(n,s,o)>ie?null:(.2126*n+.7152*s+.0722*o)/255}function Ve(e){let t=[],r=n=>{let s=Ge(n);s!==null&&t.push(s)};for(let n of e.matchAll(ce))r(n[4]);for(let n of e.matchAll(le))r(n[2]);return t.length?t.reduce((n,s)=>n+s,0)/t.length<.5:null}var ne=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ke(e){let t=e;for(let r=ne.exec(t);r&&r[0].length>0;r=ne.exec(t))t=t.slice(r[0].length);return/^<svg[\s>/]/i.test(t)}async function je(e,t){if(!N(e))return null;try{let r=await fetch(e,{signal:t,redirect:"manual"});if(!r.ok)return null;let n=Number(r.headers.get("content-length"));if(Number.isFinite(n)&&n>re)return null;let s=await r.text();return s.length>re?null:Ke(s)?s:null}catch{return null}}async function ue(e,t){let r=await je(e,t);return r===null?null:{reversed:We(r),inkIsDark:Ve(r)}}function pe(){return W().siteId()}var ze="",y=class extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n}},L="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",Ze=new Set([502,503,504]),U=0,Qe="This editor runs on its host's own backend, which does not serve this request.",Xe=5e3,Ye=15e3,et=()=>typeof window>"u"?Xe:Ye;function Ae(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&e.audience!=="admin"&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(et())}var de=e=>e instanceof Error&&e.name==="TimeoutError",ge=(e,t)=>Ze.has(e)?L:t;function tt(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=I();return!t||/[?&]site=/.test(e)?e:M(e,`site=${encodeURIComponent(t)}`)}async function i(e,t={}){let{token:r,baseUrl:n,headers:s,audience:o,...m}=t;if(typeof window<"u"&&!G())throw new y(U,Qe,null);if(typeof window>"u"&&n===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let u=typeof FormData<"u"&&m.body instanceof FormData,p;try{p=await fetch(`${n??ze}${tt(e)}`,{...m,headers:{...u?{}:{"Content-Type":"application/json"},...r?{Authorization:`Bearer ${r}`}:{},...o===null?{}:{"X-Portal-Audience":o??"shop"},...s},signal:m.signal??Ae({...m,audience:o})})}catch(P){throw P instanceof TypeError||de(P)?new y(U,L,null):P}let f;try{f=await p.text()}catch(P){throw de(P)?new y(U,L,null):P}let S=null;if(f)try{S=JSON.parse(f)}catch{throw new y(p.status,p.ok?"Expected JSON but received a non-JSON response":ge(p.status,p.statusText),f)}if(!p.ok){let P=(S&&typeof S=="object"&&"detail"in S&&typeof S.detail=="string"?S.detail:null)??ge(p.status,p.statusText);throw new y(p.status,P,S)}return S}var R=null;async function Re(){return R||(R=rt().finally(()=>{R=null}),R)}async function rt(){let e=w.takeLegacyRefresh(),t=await nt.refresh(e??void 0);return w.setTokens(t.access),t.access}async function _e(){return w.getAccess()??Re()}async function d(e,t={}){let r;try{r=await _e()}catch{throw w.clear(),new y(401,"Not signed in",null)}try{return await i(e,{...t,token:r})}catch(n){if(!(n instanceof y)||n.status!==401)throw n;try{let s=await Re();return await i(e,{...t,token:s})}catch{throw w.clear(),n}}}async function he(e,t={}){if(w.getAccess())try{return{data:await d(e,t),asShopper:!0}}catch(r){if(!(r instanceof y)||r.status!==401)throw r}return{data:await i(e,t),asShopper:!1}}async function ye(){let e=await d("/api/auth/me/");if(e.portal!=="shop")throw w.clear(),new y(403,"This session is not valid for this shop.",null);return e}var nt={login:(e,t)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{w.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await _e();return await ye(),e},me:ye,updateMe:e=>d("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>d("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>d("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>d("/api/shop-portal/profile/"),updateMyProfile:e=>d("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>d("/api/shop-portal/delivery-locations/"),createAddress:e=>d("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>d(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>d(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,r)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:r})}),brands:()=>d("/api/products/brands/"),myOrders:()=>d("/api/shop-portal/orders/").then(e=>e.results),myOrder:e=>d(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>d(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>d(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`).then(t=>t.results),createReturn:e=>d("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>d(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let r=new FormData;return r.append("claim_item",e),r.append("file",t),r.append("media_type",t.type.startsWith("video/")?"video":"image"),d("/api/shop-portal/return-media/",{method:"POST",body:r})}};function h(e){if(typeof e=="string")return e.startsWith("/media/")?V(e):e;if(Array.isArray(e))return e.map(h);if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=r==="captions"&&n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).map(([s,o])=>[h(s),o])):h(n);return t}return e}var st="",Ce="".replace(/\/+$/,""),ke=typeof window>"u"&&Ce!=="",ot=ke?Ce:st,it=K,b=()=>({baseUrl:it(),audience:null});function c(e,t){let r=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${r}`}var at=100,fe=50;function xe(e,t,r){let n=new URLSearchParams;for(let[s,o]of Object.entries(t))o!=null&&o!==""&&n.set(s,String(o));return n.set("pageSize",String(at)),r&&n.set("cursor",r),`/api/v1${e}?${n.toString()}`}function ct(e,t){return xe("/wheels",{process:e},t)}function lt(e,t,r){return xe("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},r)}function mt(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function Se(e,t,r=()=>!1){let n=[],s=null;try{for(let o=0;o<fe;o++){let m=await i(await t(s),await a());if(n.push(...m.results),s=mt(m.next),!s)break}s&&console.warn(`[${e}] stopped at ${fe} pages (${n.length} rows); catalog may be truncated`)}catch(o){if(r(o))throw o;console.warn(`[${e}] product API unavailable, returning []`,o)}return n}var ut=e=>e instanceof y&&e.status===400;function pt(e){return e.flatMap(t=>t.kind==="alloy-wheel"?$([t]):[t])}async function Te(){return(await dt()).host}async function dt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),r=o=>o?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,n=r(t.get(X)??t.get("x-forwarded-host")??t.get("host")),s=r(t.get("host"));return{host:n,matchesRequestHost:n!==null&&n===s}}catch{return{host:null,matchesRequestHost:!1}}}async function gt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return j((await e()).get(E))}catch{return null}}async function ht(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(Q)||null}catch{return null}}async function yt(){let e=await ht();if(e)return`site=${encodeURIComponent(e)}`;let t=await Te();return t?`host=${encodeURIComponent(t)}`:""}async function g(e){if(typeof window<"u"){let t=I();return t?M(e,`site=${encodeURIComponent(t)}`):e}return M(e,await yt())}function M(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}async function ft(e){if(!ke)return;let[t,r]=await Promise.all([Te(),gt()]),n=z(t,r,e);return Object.keys(n).length>0?n:void 0}async function a(e){let t=await ft(Z(e)),r={baseUrl:ot,...e};return t&&(r.headers={...t,...e?.headers}),r}var _=typeof window>"u";function C(e,t){let r=new URLSearchParams;for(let[s,o]of Object.entries(t))o!==void 0&&o!==""&&r.set(s,String(o));let n=r.toString();return`/api/v1/fitment${e}${n?`?${n}`:""}`}var Gt={listMakes:async e=>{if(_){let{fitmentData:r}=await import("./fitment-data-FSXAUWXQ.js");return r.makes(e)}return(await i(C("/makes",{region:e}),b())).results},listModels:async(e,t)=>{if(_){let{fitmentData:n}=await import("./fitment-data-FSXAUWXQ.js");return n.models(e,t)}return(await i(C("/models",{make:e,region:t}),b())).results},listYears:async(e,t,r)=>{if(_){let{fitmentData:s}=await import("./fitment-data-FSXAUWXQ.js");return s.years(e,t,r)}return(await i(C("/years",{make:e,model:t,region:r}),b())).results},listModifications:async(e,t,r,n)=>{if(_){let{fitmentData:o}=await import("./fitment-data-FSXAUWXQ.js");return o.modifications(e,t,r,n)}return(await i(C("/modifications",{make:e,model:t,year:r,region:n}),b())).results},getStockFitment:async(e,t,r,n,s)=>{if(_){let{fitmentData:o}=await import("./fitment-data-FSXAUWXQ.js");return o.stockFitment(e,t,r,n,s)}return i(C("/stock-fitment",{make:e,model:t,year:r,modification:n,region:s}),b())}},Vt={listWheels:async e=>{let t=await Se("products.listWheels",async r=>await g(ct(e,r)));return $(h(t))},listCatalog:async(e,t)=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let r=await Se("products.listCatalog",async n=>await g(lt(e,t,n)),ut);return pt(h(r))},getWheel:async e=>A(h(await i(await g(c(`/wheels/${e}`)),await a()))),getTyre:async e=>h(await i(await g(c(`/tyres/${e}`)),await a())),listBundles:async()=>{try{return await i(await g(c("/bundles")),await a())}catch{return[]}},getBundle:async e=>i(await g(c(`/bundles/${e}`)),await a()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:r=null}=e;if(typeof window>"u"){let{listGalleryBuilds:n}=await import("./gallery-builds-data-VVHHVNYW.js");return h(n(t,r))}try{let n=new URLSearchParams;t&&n.set("process",t),r&&n.set("wheelSlug",r);let s=n.toString(),o=await i(`/api/v1/gallery-builds${s?`?${s}`:""}`,b());return h(o.results)}catch(n){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",n),[]}},getSite:async()=>i(await g(c("/site")),await a()),getSiteBySlug:async e=>i(`${c("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0),listBrands:async()=>{try{return(await i(await g(c("/brands")),await a())).results??[]}catch(e){return console.warn("[products.listBrands] product API unavailable, returning []",e),[]}},listBrandsForSite:async e=>(await i(`${c("/brands")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0)).results??[],listPages:async()=>h(await i(await g(c("/pages")),await a())),listProductTemplates:async()=>{try{return await i(await g(c("/product-templates")),await a())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listProductTypeChoices:async()=>{try{return await i(await g(c("/product-type-choices")),await a())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await i(await g(c("/field-usage")),await a())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>h(await i(await g(c(`/pages/${e}`)),await a(t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0))),listBlogPosts:async()=>{try{return(await i(c("/blog-posts"),await a())).map(t=>({...t,coverImage:x(t.coverImage)??""}))}catch(e){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",e),[]}},getBlogPost:async e=>{let t=await i(c(`/blog-posts/${e}`),await a());return{...t,coverImage:x(t.coverImage)??""}},createOrder:async e=>i(c("/orders"),await a({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>d(c("/orders"),await a({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>i(c("/orders/lookup"),await a({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>i(c("/payments/intent"),await a({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>i(c("/payments/paypal/order"),await a({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>i(c("/payments/paypal/capture"),await a({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>i(c("/payments/afterpay/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>i(c("/payments/afterpay/capture"),await a({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>i(c("/payments/square/charge"),await a({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>i(c("/payments/gocardless/billing-request"),await a({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>i(c("/payments/gocardless/complete"),await a({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>i(c("/payments/zip/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>i(c("/payments/zip/capture"),await a({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>i(c("/payments/klarna/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>i(c("/payments/klarna/capture"),await a({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>i(c("/stock-alerts"),await a({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>i(c("/pre-order-intents"),await a({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>i(c("/newsletter-subscriptions"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>i(c("/newsletter-unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>i(c("/carts"),await a({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>i(c("/carts/restore"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>i(c("/carts/unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let r=c("/reviews"),n=t.toString();try{return await i(await g(n?`${r}?${n}`:r),await a())}catch(s){return console.warn("[products.listReviews] product API unavailable, returning []",s),[]}},submitReview:async e=>i(c("/reviews"),await a({method:"POST",body:JSON.stringify(e)})),getForm:async e=>i(c(`/forms/${encodeURIComponent(e)}`),await a()),submitForm:async(e,t)=>i(c(`/forms/${encodeURIComponent(e)}/submissions`),await a({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await a())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await i(c(`/countries/${encodeURIComponent(e)}/subdivisions`),await a())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=c("/cart/quote"),r=await a({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await he(t,r)).data:i(t,r)},validateCoupon:async e=>{let{data:t,asShopper:r}=await he(c("/coupons/validate"),await a({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:r}},getHeaderSettings:async()=>{let e=Ae({method:"GET"}),t=await i(await g(c("/header-settings")),await a({signal:e})),r=x(t.logoUrl),n=null,s=null;if(r&&N(r)){let o=await ue(r,e);o&&(n=o.reversed,s=o.inkIsDark)}return{...t,logoUrl:r,logoReversed:n,logoInkIsDark:s}},getThemeSettings:async()=>i(await g(c("/theme-settings")),await a()),getChatSettings:async()=>i(await g(c("/chat-settings")),await a())},Kt={listServices:async()=>{try{return await i(c("/bookings/services"),await a())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>i(c(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await a()),create:async e=>i(c("/bookings"),await a({method:"POST",body:JSON.stringify(e)})),get:async e=>i(c(`/bookings/manage/${encodeURIComponent(e)}`),await a()),cancel:async e=>i(c(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await a({method:"POST"})),createPaymentIntent:async e=>i(c("/bookings/payments/intent"),await a({method:"POST",body:JSON.stringify({manageToken:e})}))},H=class extends Error{constructor(r,n){super(`Slug "${r}" exists on ${n} websites; a site is required to pick one.`);this.slug=r;this.count=n;this.name="AmbiguousPageSlugError"}},k=e=>e?`/api/storefront/header-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/header-settings/",Pe=e=>e?`/api/storefront/theme-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/theme-settings/",we=e=>e?`/api/storefront/chat-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/chat-settings/",be=e=>`/api/storefront/social-settings/?${new URLSearchParams({site:e})}`,D=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,St=e=>`${D(e)}currencies/`,Pt="/api/storefront/media/ingest/",J=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function wt(){let e=pe();if(!e)throw new J;return`${Pt}?${new URLSearchParams({site:e})}`}var F={"X-Puck-Media-Manifest":Y.contentHash},l=(e,t={})=>i(e,{...t,audience:"admin"}),jt={findPageBySlug:async(e,t,r)=>{let n=new URLSearchParams({slug:e});r&&n.set("site",r);let s=await l(`/api/storefront/pages/?${n.toString()}`,{token:t}),o=Array.isArray(s)?s:s.results??[];if(!r&&o.length>1)throw new H(e,o.length);return o[0]??null},getPageById:(e,t)=>l(`/api/storefront/pages/${e}/`,{token:t}),saveLayout:(e,t,r,n,s)=>l(`/api/storefront/pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t,expected_updated_at:n,...s?{client_id:s}:{}}),token:r}),publishPage:(e,t,r)=>l(`/api/storefront/pages/${e}/publish/`,{method:"POST",body:r?JSON.stringify({expected_updated_at:r}):void 0,token:t}),claimPageEditLock:(e,t,r,n=!1)=>l(`/api/storefront/pages/${e}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:r,takeover:n}),token:t}),releasePageEditLock:(e,t)=>l(`/api/storefront/pages/${e}/edit-lock/`,{method:"DELETE",token:t}),createTemplate:(e,t,r)=>l("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:e,layout:t}),headers:F,token:r}),getTemplate:(e,t)=>l(`/api/storefront/page-templates/${e}/`,{token:t}),saveTemplateLayout:(e,t,r)=>l(`/api/storefront/page-templates/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:F,token:r}),listTemplatePages:async(e,t)=>{let r=await l(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}`,{token:t});return Array.isArray(r)?r:r.results??[]},findTemplatePageBySlug:async(e,t,r)=>{let n=await l(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}&slug=${encodeURIComponent(t)}`,{token:r});return(Array.isArray(n)?n:n.results??[])[0]??null},createTemplatePage:(e,t,r)=>l("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:e,...t}),headers:F,token:r}),saveTemplatePageLayout:(e,t,r)=>l(`/api/storefront/template-pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:F,token:r}),deleteTemplatePage:(e,t)=>l(`/api/storefront/template-pages/${e}/`,{method:"DELETE",token:t}),listPages:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("site",t);let n=await l(`/api/storefront/pages/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]},createPage:(e,t,r,n)=>l("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:e,slug:t,layout:r}),token:n}),deletePage:(e,t)=>l(`/api/storefront/pages/${e}/`,{method:"DELETE",token:t}),getHeaderSettings:(e,t)=>l(k(t),{token:e}),listMenus:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("site",t);let n=await l(`/api/storefront/menus/?${r}`,{token:e});return Array.isArray(n)?n:n.results??[]},listBlogPosts:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.visibleOnly&&r.set("is_visible","true"),t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/blog-posts/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]},listFieldUsage:async(e,t)=>{let r=await l(`/api/storefront/field-usage/?site=${encodeURIComponent(t)}`,{token:e});return Array.isArray(r?.entries)?r.entries:[]},listCategories:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.visibleOnly&&r.set("is_visible","true"),t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/categories/?${r.toString()}`,{token:e});return[...Array.isArray(n)?n:n.results??[]].sort((o,m)=>o.sort_order-m.sort_order||o.name.localeCompare(m.name))},listForms:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/forms/?${r.toString()}`,{token:e});return[...Array.isArray(n)?n:n.results??[]].sort((o,m)=>o.title.localeCompare(m.title))},listWheelSummaries:async(e,t={})=>{let r=new URLSearchParams;t.siteId&&r.set("site",t.siteId);let n=r.toString(),s=await l(`/api/storefront/wheel-curations/summaries/${n?`?${n}`:""}`,{token:e});return h(s)},listProducts:async(e,t={})=>{let r=new URLSearchParams;t.kinds?.length&&r.set("kind",t.kinds.join(",")),t.siteId&&r.set("site",t.siteId);let n=r.toString(),s=await l(`/api/storefront/products/${n?`?${n}`:""}`,{token:e});return h(s)},getWheelDetail:async(e,t,r={})=>{let n=new URLSearchParams({slug:t});return r.siteId&&n.set("site",r.siteId),A(h(await l(`/api/storefront/wheel-curations/detail/?${n.toString()}`,{token:e})))},updateHeaderSettings:(e,t,r)=>l(k(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getSite:(e,t)=>l(D(e),{token:t}),listSiteCurrencies:async(e,t)=>{let r=await l(St(e),{token:t});return Array.isArray(r)?r:[]},updateSite:(e,t,r)=>l(D(e),{method:"PATCH",body:JSON.stringify(t),token:r}),getThemeSettings:(e,t)=>l(Pe(t),{token:e}),updateThemeSettings:(e,t,r)=>l(Pe(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getChatSettings:(e,t)=>l(we(t),{token:e}),updateChatSettings:(e,t,r)=>l(we(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getSocialSettings:(e,t)=>l(be(t),{token:e}),updateSocialSettings:(e,t,r)=>l(be(r),{method:"PATCH",body:JSON.stringify(e),token:t}),uploadHeaderLogo:(e,t,r)=>{let n=new FormData;return n.append("logo",e),l(k(r),{method:"PATCH",body:n,token:t})},clearHeaderLogo:(e,t)=>l(k(t),{method:"PATCH",body:JSON.stringify({logo:null}),token:e}),setHeaderLogoFromAsset:(e,t,r)=>l(k(r),{method:"PATCH",body:JSON.stringify({logo_asset_id:e}),token:t}),uploadMedia:async(e,t)=>{let r=new FormData;return r.append("file",e),l(wt(),{method:"POST",body:r,token:t})},listMedia:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("kind",t);let n=await l(`/api/storefront/media-assets/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]}};export{Y as a,z as b,Z as c,w as d,Ee as e,N as f,pe as g,ze as h,y as i,L as j,U as k,i as l,nt as m,st as n,Te as o,dt as p,gt as q,ht as r,Gt as s,Vt as t,Kt as u,H as v,l as w,jt as x};
1
+ import{c as W,e as G,i as V,k as x,q as I,r as K,t as T}from"./chunk-TY6TWI3F.js";var E="x-forwarded-for";function j(e){let t=(e??"").split(",").map(r=>r.trim()).filter(Boolean);return t.length>0?t[t.length-1]:null}var ve="x-forwarded-host";function z(e,t,r){let n={};return e&&(n[ve]=e),t&&r==="uncached"&&(n[E]=t),n}function Z(e){if(e?.cache==="no-store"||e?.cache==="no-cache")return"uncached";if(e?.cache==="force-cache")return"data-cached";let t=e?.next?.revalidate;return typeof t=="number"&&t>0?"data-cached":"uncached"}var Q="x-storefront-site",X="x-storefront-host";var Y={contentHash:"db2b679aad5380c6",schema:1,mediaFields:{ImageBlock:["src"],LogoBlock:["src"],Flex:["bgImage"],FeaturedCover:["image"],LongRead:["image"],Banner:["imageSrc"],Timeline:["imageSrc"],Logos:["items[].src"],ContactLocations:["locations[].photo"],HeroSingle:["imageFocal","mediaImage","mediaVideo","poster"],HeroSlide:["mediaImage","mediaVideo","poster"],PostCard:["image"],Gallery:["othersCards[].image","othersCards[].photos[].src","vehicleCards[].image","vehicleCards[].photos[].src","wheelCards[].image","wheelCards[].photos[].src"],GalleryItem:["image","photos[].src"],Manifesto:["imageSrc"],SectionHeader:["logoSrc"],IntroBleed:["imageSrc","imageSrcMobile"],Split:["imageSrc","textBgSrc"],ProcessSteps:["steps[].image"],DetailRows:["rows[].image"],PaymentBadges:["badges[].src"]},mediaKeyNames:["bgImage","image","imageFocal","imageSrc","imageSrcMobile","logoSrc","mediaImage","mediaVideo","photo","poster","src","textBgSrc"],snapshotObjects:{ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},hydratedLists:{Events:["posts"],SubscribeBlogs:["posts"]},technicalStateKeys:["imageFocal"]};var Ie="shop_access_token",ee="shop_refresh_token",q=null;function B(){T.removeItem(Ie),T.removeItem(ee)}var w={getAccess(){return q},takeLegacyRefresh(){let e=T.getItem(ee);return B(),e},setTokens(e){q=e,B()},clear(){q=null,B()}};function Ee(e){return!!e.src}function A(e){let t=e.finishes.filter(Ee);if(t.length===e.finishes.length)return e;let r=e.defaultFinish&&t.some(n=>n.name===e.defaultFinish)?e.defaultFinish:null;return{...e,finishes:t,defaultFinish:r}}function qe(e){return e.listable!==!1}function $(e){return e.map(A).filter(qe)}var se=["fill","stroke","stop-color","color","flood-color","lighting-color","solid-color"],oe=new Set(["none","transparent","currentcolor","inherit","initial","unset","context-fill","context-stroke"]),O={black:[0,0,0],white:[255,255,255],gray:[128,128,128],grey:[128,128,128],darkgray:[169,169,169],darkgrey:[169,169,169],dimgray:[105,105,105],dimgrey:[105,105,105],lightgray:[211,211,211],lightgrey:[211,211,211],gainsboro:[220,220,220],silver:[192,192,192],whitesmoke:[245,245,245]},ie=12,ae=/\burl\(/i,ce=new RegExp(`(?<![-\\w])(${se.join("|")})(\\s*=\\s*)(["'])([^"']*)\\3`,"gi"),le=new RegExp(`((?:^|[;{\\s"'])(?:${se.join("|")})\\s*:\\s*)([^;}"'<>]+)`,"gi"),Be=/<svg\b([^>]*)>/i,$e=/\bfill\s*[=:]/i;function Ne(e){let t=e.replace(ce,(r,n,s,o,m)=>{let u=te(m);return u===null?r:`${n}${s}${o}${u}${o}`}).replace(le,(r,n,s)=>{let o=te(s);return o===null?r:`${n}${o}`});return t=t.replace(Be,(r,n)=>$e.test(n)?r:`<svg fill="#ffffff"${n}>`),t}function te(e){let t=/!important/i.test(e),r=e.replace(/!important/gi,"").trim().toLowerCase();if(!r||ae.test(r)||oe.has(r))return null;let n=r in O?[...O[r],1]:me(r);if(!n)return null;let[s,o,m,u]=n;if(Math.max(s,o,m)-Math.min(s,o,m)>ie)return null;let p=Ue(255-s,255-o,255-m,u);return t?`${p} !important`:p}function Ue(e,t,r,n){if(n<1)return`rgba(${e}, ${t}, ${r}, ${n})`;let s=o=>o.toString(16).padStart(2,"0");return`#${s(e)}${s(t)}${s(r)}`}function me(e){return e.startsWith("#")?Le(e):e.startsWith("rgb")?Me(e):e.startsWith("hsl")?De(e):null}function Le(e){let t=e.slice(1),r=1;if(t.length===3||t.length===4)t.length===4&&(r=parseInt(t[3]+t[3],16)/255),t=t.slice(0,3).split("").map(n=>n+n).join("");else if(t.length===6||t.length===8)t.length===8&&(r=parseInt(t.slice(6,8),16)/255),t=t.slice(0,6);else return null;return/^[0-9a-f]{6}$/.test(t)?[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),r]:null}function Me(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[r,n]=t.split("/"),s=r.split(/[\s,]+/).filter(Boolean).slice(0,3);if(s.length<3)return null;let o=s.map(u=>u.endsWith("%")?Math.round(parseFloat(u)/100*255):Math.round(parseFloat(u)));if(o.some(u=>Number.isNaN(u)))return null;let m=n?v(n):He(r);return[o[0],o[1],o[2],m]}function He(e){let t=e.split(/[\s,]+/).filter(Boolean);return t.length>=4?v(t[3]):1}function v(e){let t=e.trim().endsWith("%")?parseFloat(e)/100:parseFloat(e);return Number.isNaN(t)?1:t}function De(e){let t=e.slice(e.indexOf("(")+1,e.lastIndexOf(")")),[r,n]=t.split("/"),s=r.split(/[\s,]+/).filter(Boolean);if(s.length<3)return null;let o=parseFloat(s[0]),m=parseFloat(s[1])/100,u=parseFloat(s[2])/100;if([o,m,u].some(Oe=>Number.isNaN(Oe)))return null;let p=n?v(n):s.length>=4?v(s[3]):1,[f,S,P]=Je(o,m,u);return[f,S,P,p]}function Je(e,t,r){let n=(1-Math.abs(2*r-1))*t,s=(e%360+360)%360/60,o=n*(1-Math.abs(s%2-1)),m=0,u=0,p=0;s<1?[m,u,p]=[n,o,0]:s<2?[m,u,p]=[o,n,0]:s<3?[m,u,p]=[0,n,o]:s<4?[m,u,p]=[0,o,n]:s<5?[m,u,p]=[o,0,n]:[m,u,p]=[n,0,o];let f=r-n/2;return[Math.round((m+f)*255),Math.round((u+f)*255),Math.round((p+f)*255)]}var re=512*1024;function N(e){return/\.svg(\?|$)/i.test(e)}function We(e){return`data:image/svg+xml,${encodeURIComponent(Ne(e))}`}function Ge(e){let t=e.replace(/!important/gi,"").trim().toLowerCase();if(!t||ae.test(t)||oe.has(t))return null;let r=t in O?[...O[t],1]:me(t);if(!r)return null;let[n,s,o]=r;return Math.max(n,s,o)-Math.min(n,s,o)>ie?null:(.2126*n+.7152*s+.0722*o)/255}function Ve(e){let t=[],r=n=>{let s=Ge(n);s!==null&&t.push(s)};for(let n of e.matchAll(ce))r(n[4]);for(let n of e.matchAll(le))r(n[2]);return t.length?t.reduce((n,s)=>n+s,0)/t.length<.5:null}var ne=/^(?:\uFEFF|\s+|<\?xml[^>]*\?>|<!--[\s\S]*?-->|<!DOCTYPE\s+svg[^>[]*>)/i;function Ke(e){let t=e;for(let r=ne.exec(t);r&&r[0].length>0;r=ne.exec(t))t=t.slice(r[0].length);return/^<svg[\s>/]/i.test(t)}async function je(e,t){if(!N(e))return null;try{let r=await fetch(e,{signal:t,redirect:"manual"});if(!r.ok)return null;let n=Number(r.headers.get("content-length"));if(Number.isFinite(n)&&n>re)return null;let s=await r.text();return s.length>re?null:Ke(s)?s:null}catch{return null}}async function ue(e,t){let r=await je(e,t);return r===null?null:{reversed:We(r),inkIsDark:Ve(r)}}function pe(){return W().siteId()}var ze="",y=class extends Error{constructor(t,r,n){super(r),this.status=t,this.data=n}},L="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",Ze=new Set([502,503,504]),U=0,Qe="This editor runs on its host's own backend, which does not serve this request.",Xe=5e3,Ye=15e3,et=()=>typeof window>"u"?Xe:Ye;function Ae(e){let t=(e.method??"GET").toUpperCase();if(!(e.body!=null||t!=="GET"&&t!=="HEAD")&&e.audience!=="admin"&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(et())}var de=e=>e instanceof Error&&e.name==="TimeoutError",ge=(e,t)=>Ze.has(e)?L:t;function tt(e){if(typeof window>"u"||!e.startsWith("/api/v1/"))return e;let t=I();return!t||/[?&]site=/.test(e)?e:M(e,`site=${encodeURIComponent(t)}`)}async function i(e,t={}){let{token:r,baseUrl:n,headers:s,audience:o,...m}=t;if(typeof window<"u"&&!G())throw new y(U,Qe,null);if(typeof window>"u"&&n===void 0)throw new Error(`apiFetch(${JSON.stringify(e)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);let u=typeof FormData<"u"&&m.body instanceof FormData,p;try{p=await fetch(`${n??ze}${tt(e)}`,{...m,headers:{...u?{}:{"Content-Type":"application/json"},...r?{Authorization:`Bearer ${r}`}:{},...o===null?{}:{"X-Portal-Audience":o??"shop"},...s},signal:m.signal??Ae({...m,audience:o})})}catch(P){throw P instanceof TypeError||de(P)?new y(U,L,null):P}let f;try{f=await p.text()}catch(P){throw de(P)?new y(U,L,null):P}let S=null;if(f)try{S=JSON.parse(f)}catch{throw new y(p.status,p.ok?"Expected JSON but received a non-JSON response":ge(p.status,p.statusText),f)}if(!p.ok){let P=(S&&typeof S=="object"&&"detail"in S&&typeof S.detail=="string"?S.detail:null)??ge(p.status,p.statusText);throw new y(p.status,P,S)}return S}var R=null;async function Re(){return R||(R=rt().finally(()=>{R=null}),R)}async function rt(){let e=w.takeLegacyRefresh(),t=await nt.refresh(e??void 0);return w.setTokens(t.access),t.access}async function _e(){return w.getAccess()??Re()}async function d(e,t={}){let r;try{r=await _e()}catch{throw w.clear(),new y(401,"Not signed in",null)}try{return await i(e,{...t,token:r})}catch(n){if(!(n instanceof y)||n.status!==401)throw n;try{let s=await Re();return await i(e,{...t,token:s})}catch{throw w.clear(),n}}}async function he(e,t={}){if(w.getAccess())try{return{data:await d(e,t),asShopper:!0}}catch(r){if(!(r instanceof y)||r.status!==401)throw r}return{data:await i(e,t),asShopper:!1}}async function ye(){let e=await d("/api/auth/me/");if(e.portal!=="shop")throw w.clear(),new y(403,"This session is not valid for this shop.",null);return e}var nt={login:(e,t)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:e,password:t,portal:"shop"}),credentials:"include"}),refresh:e=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(e?{refresh:e,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{w.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{let e=await _e();return await ye(),e},me:ye,updateMe:e=>d("/api/auth/me/",{method:"PATCH",body:JSON.stringify(e)}),changePassword:(e,t)=>d("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:t,old_password:e})}),changeEmail:(e,t)=>d("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:e,current_password:t})}),myProfile:()=>d("/api/shop-portal/profile/"),updateMyProfile:e=>d("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(e)}),myAddresses:()=>d("/api/shop-portal/delivery-locations/"),createAddress:e=>d("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(e)}),updateAddress:(e,t)=>d(`/api/shop-portal/delivery-locations/${e}/`,{method:"PATCH",body:JSON.stringify(t)}),deleteAddress:e=>d(`/api/shop-portal/delivery-locations/${e}/`,{method:"DELETE"}),passwordResetRequest:e=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:e})}),passwordResetConfirm:(e,t,r)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:e,token:t,new_password:r})}),brands:()=>d("/api/products/brands/"),myOrders:()=>d("/api/shop-portal/orders/").then(e=>e.results),myOrder:e=>d(`/api/shop-portal/orders/${e}/`),cancelOrder:e=>d(`/api/shop-portal/orders/${e}/cancel/`,{method:"POST"}),myReturns:e=>d(`/api/shop-portal/returns/${e?`?order=${encodeURIComponent(e)}`:""}`).then(t=>t.results),createReturn:e=>d("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(e)}),withdrawReturn:e=>d(`/api/shop-portal/returns/${e}/cancel/`,{method:"POST"}),uploadReturnPhoto:(e,t)=>{let r=new FormData;return r.append("claim_item",e),r.append("file",t),r.append("media_type",t.type.startsWith("video/")?"video":"image"),d("/api/shop-portal/return-media/",{method:"POST",body:r})}};function h(e){if(typeof e=="string")return e.startsWith("/media/")?V(e):e;if(Array.isArray(e))return e.map(h);if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=r==="captions"&&n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).map(([s,o])=>[h(s),o])):h(n);return t}return e}var st="",Ce="".replace(/\/+$/,""),ke=typeof window>"u"&&Ce!=="",ot=ke?Ce:st,it=K,b=()=>({baseUrl:it(),audience:null});function c(e,t){let r=t?`?process=${encodeURIComponent(t)}`:"";return`/api/v1${e}${r}`}var at=100,fe=50;function xe(e,t,r){let n=new URLSearchParams;for(let[s,o]of Object.entries(t))o!=null&&o!==""&&n.set(s,String(o));return n.set("pageSize",String(at)),r&&n.set("cursor",r),`/api/v1${e}?${n.toString()}`}function ct(e,t){return xe("/wheels",{process:e},t)}function lt(e,t,r){return xe("/products",{kind:e.join(","),make:t?.make,model:t?.model,year:t?.year,modification:t?.modification},r)}function mt(e){if(!e)return null;try{return new URL(e,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function Se(e,t,r=()=>!1){let n=[],s=null;try{for(let o=0;o<fe;o++){let m=await i(await t(s),await a());if(n.push(...m.results),s=mt(m.next),!s)break}s&&console.warn(`[${e}] stopped at ${fe} pages (${n.length} rows); catalog may be truncated`)}catch(o){if(r(o))throw o;console.warn(`[${e}] product API unavailable, returning []`,o)}return n}var ut=e=>e instanceof y&&e.status===400;function pt(e){return e.flatMap(t=>t.kind==="alloy-wheel"?$([t]):[t])}async function Te(){return(await dt()).host}async function dt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js"),t=await e(),r=o=>o?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,n=r(t.get(X)??t.get("x-forwarded-host")??t.get("host")),s=r(t.get("host"));return{host:n,matchesRequestHost:n!==null&&n===s}}catch{return{host:null,matchesRequestHost:!1}}}async function gt(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return j((await e()).get(E))}catch{return null}}async function ht(){try{let{headers:e}=await import("./headers-UYHEZDAT.js");return(await e()).get(Q)||null}catch{return null}}async function yt(){let e=await ht();if(e)return`site=${encodeURIComponent(e)}`;let t=await Te();return t?`host=${encodeURIComponent(t)}`:""}async function g(e){if(typeof window<"u"){let t=I();return t?M(e,`site=${encodeURIComponent(t)}`):e}return M(e,await yt())}function M(e,t){return t?`${e}${e.includes("?")?"&":"?"}${t}`:e}async function ft(e){if(!ke)return;let[t,r]=await Promise.all([Te(),gt()]),n=z(t,r,e);return Object.keys(n).length>0?n:void 0}async function a(e){let t=await ft(Z(e)),r={baseUrl:ot,...e};return t&&(r.headers={...t,...e?.headers}),r}var _=typeof window>"u";function C(e,t){let r=new URLSearchParams;for(let[s,o]of Object.entries(t))o!==void 0&&o!==""&&r.set(s,String(o));let n=r.toString();return`/api/v1/fitment${e}${n?`?${n}`:""}`}var Gt={listMakes:async e=>{if(_){let{fitmentData:r}=await import("./fitment-data-XSPS665M.js");return r.makes(e)}return(await i(C("/makes",{region:e}),b())).results},listModels:async(e,t)=>{if(_){let{fitmentData:n}=await import("./fitment-data-XSPS665M.js");return n.models(e,t)}return(await i(C("/models",{make:e,region:t}),b())).results},listYears:async(e,t,r)=>{if(_){let{fitmentData:s}=await import("./fitment-data-XSPS665M.js");return s.years(e,t,r)}return(await i(C("/years",{make:e,model:t,region:r}),b())).results},listModifications:async(e,t,r,n)=>{if(_){let{fitmentData:o}=await import("./fitment-data-XSPS665M.js");return o.modifications(e,t,r,n)}return(await i(C("/modifications",{make:e,model:t,year:r,region:n}),b())).results},getStockFitment:async(e,t,r,n,s)=>{if(_){let{fitmentData:o}=await import("./fitment-data-XSPS665M.js");return o.stockFitment(e,t,r,n,s)}return i(C("/stock-fitment",{make:e,model:t,year:r,modification:n,region:s}),b())}},Vt={listWheels:async e=>{let t=await Se("products.listWheels",async r=>await g(ct(e,r)));return $(h(t))},listCatalog:async(e,t)=>{if(e.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` \u2014 so the call would silently return the wheel catalog instead of nothing.");let r=await Se("products.listCatalog",async n=>await g(lt(e,t,n)),ut);return pt(h(r))},getWheel:async e=>A(h(await i(await g(c(`/wheels/${e}`)),await a()))),getTyre:async e=>h(await i(await g(c(`/tyres/${e}`)),await a())),listBundles:async()=>{try{return await i(await g(c("/bundles")),await a())}catch{return[]}},getBundle:async e=>i(await g(c(`/bundles/${e}`)),await a()),listGalleryBuilds:async(e={})=>{let{process:t=null,wheelSlug:r=null}=e;if(typeof window>"u"){let{listGalleryBuilds:n}=await import("./gallery-builds-data-VVHHVNYW.js");return h(n(t,r))}try{let n=new URLSearchParams;t&&n.set("process",t),r&&n.set("wheelSlug",r);let s=n.toString(),o=await i(`/api/v1/gallery-builds${s?`?${s}`:""}`,b());return h(o.results)}catch(n){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",n),[]}},getSite:async()=>i(await g(c("/site")),await a()),getSiteBySlug:async e=>i(`${c("/site")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0),listBrands:async()=>{try{return(await i(await g(c("/brands")),await a())).results??[]}catch(e){return console.warn("[products.listBrands] product API unavailable, returning []",e),[]}},listBrandsForSite:async e=>(await i(`${c("/brands")}?${new URLSearchParams({site:e})}`,typeof window>"u"?await a():void 0)).results??[],listPages:async()=>h(await i(await g(c("/pages")),await a())),listProductTemplates:async()=>{try{return await i(await g(c("/product-templates")),await a())}catch(e){return console.warn("[products.listProductTemplates] unavailable, returning []",e),[]}},listProductTypeChoices:async()=>{try{return await i(await g(c("/product-type-choices")),await a())}catch(e){return console.warn("[products.listProductTypeChoices] unavailable, returning []",e),[]}},listFieldUsage:async()=>{try{return await i(await g(c("/field-usage")),await a())}catch(e){return console.warn("[products.listFieldUsage] unavailable, returning []",e),[]}},getPage:async(e,t={})=>h(await i(await g(c(`/pages/${e}`)),await a(t.revalidate!==void 0?{next:{revalidate:t.revalidate}}:void 0))),listBlogPosts:async()=>{try{return(await i(c("/blog-posts"),await a())).map(t=>({...t,coverImage:x(t.coverImage)??""}))}catch(e){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",e),[]}},getBlogPost:async e=>{let t=await i(c(`/blog-posts/${e}`),await a());return{...t,coverImage:x(t.coverImage)??""}},createOrder:async e=>i(c("/orders"),await a({method:"POST",body:JSON.stringify(e)})),createOrderAuthed:async e=>d(c("/orders"),await a({method:"POST",body:JSON.stringify(e)})),lookupOrder:async e=>i(c("/orders/lookup"),await a({method:"POST",body:JSON.stringify(e)})),createPaymentIntent:async e=>i(c("/payments/intent"),await a({method:"POST",body:JSON.stringify(e)})),createPaypalOrder:async e=>i(c("/payments/paypal/order"),await a({method:"POST",body:JSON.stringify(e)})),capturePaypalOrder:async e=>i(c("/payments/paypal/capture"),await a({method:"POST",body:JSON.stringify(e)})),createAfterpayCheckout:async e=>i(c("/payments/afterpay/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureAfterpayPayment:async e=>i(c("/payments/afterpay/capture"),await a({method:"POST",body:JSON.stringify(e)})),chargeSquare:async e=>i(c("/payments/square/charge"),await a({method:"POST",body:JSON.stringify(e)})),createGocardlessBillingRequest:async e=>i(c("/payments/gocardless/billing-request"),await a({method:"POST",body:JSON.stringify(e)})),completeGocardlessPayment:async e=>i(c("/payments/gocardless/complete"),await a({method:"POST",body:JSON.stringify(e)})),createZipCheckout:async e=>i(c("/payments/zip/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureZipPayment:async e=>i(c("/payments/zip/capture"),await a({method:"POST",body:JSON.stringify(e)})),createKlarnaCheckout:async e=>i(c("/payments/klarna/checkout"),await a({method:"POST",body:JSON.stringify(e)})),captureKlarnaPayment:async e=>i(c("/payments/klarna/capture"),await a({method:"POST",body:JSON.stringify(e)})),createStockAlert:async e=>i(c("/stock-alerts"),await a({method:"POST",body:JSON.stringify(e)})),createPreOrderIntent:async e=>i(c("/pre-order-intents"),await a({method:"POST",body:JSON.stringify(e)})),createNewsletterSubscription:async e=>i(c("/newsletter-subscriptions"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeNewsletter:async e=>i(c("/newsletter-unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),captureCart:async e=>i(c("/carts"),await a({method:"POST",body:JSON.stringify(e)})),restoreCart:async e=>i(c("/carts/restore"),await a({method:"POST",body:JSON.stringify(e)})),unsubscribeCartReminders:async e=>i(c("/carts/unsubscribe"),await a({method:"POST",body:JSON.stringify(e)})),listReviews:async(e={})=>{let t=new URLSearchParams;e.limit&&t.set("limit",String(e.limit)),e.designCode&&t.set("designCode",e.designCode);let r=c("/reviews"),n=t.toString();try{return await i(await g(n?`${r}?${n}`:r),await a())}catch(s){return console.warn("[products.listReviews] product API unavailable, returning []",s),[]}},submitReview:async e=>i(c("/reviews"),await a({method:"POST",body:JSON.stringify(e)})),getForm:async e=>i(c(`/forms/${encodeURIComponent(e)}`),await a()),submitForm:async(e,t)=>i(c(`/forms/${encodeURIComponent(e)}/submissions`),await a({method:"POST",body:JSON.stringify(t)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await a())}catch(e){return console.warn("[products.listShippingMethods] product API unavailable, returning []",e),[]}},listCountrySubdivisions:async e=>{try{return await i(c(`/countries/${encodeURIComponent(e)}/subdivisions`),await a())}catch(t){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",t),[]}},quoteCart:async e=>{let t=c("/cart/quote"),r=await a({method:"POST",body:JSON.stringify(e)});return e.couponCode?(await he(t,r)).data:i(t,r)},validateCoupon:async e=>{let{data:t,asShopper:r}=await he(c("/coupons/validate"),await a({method:"POST",body:JSON.stringify(e)}));return{...t,askedAsShopper:r}},getHeaderSettings:async()=>{let e=Ae({method:"GET"}),t=await i(await g(c("/header-settings")),await a({signal:e})),r=x(t.logoUrl),n=null,s=null;if(r&&N(r)){let o=await ue(r,e);o&&(n=o.reversed,s=o.inkIsDark)}return{...t,logoUrl:r,logoReversed:n,logoInkIsDark:s}},getThemeSettings:async()=>i(await g(c("/theme-settings")),await a()),getChatSettings:async()=>i(await g(c("/chat-settings")),await a())},Kt={listServices:async()=>{try{return await i(c("/bookings/services"),await a())}catch(e){return console.warn("[bookings.listServices] API unavailable, returning []",e),{results:[],currency:"USD"}}},getAvailability:async(e,t)=>i(c(`/bookings/availability?service=${encodeURIComponent(e)}&date=${t}`),await a()),create:async e=>i(c("/bookings"),await a({method:"POST",body:JSON.stringify(e)})),get:async e=>i(c(`/bookings/manage/${encodeURIComponent(e)}`),await a()),cancel:async e=>i(c(`/bookings/manage/${encodeURIComponent(e)}/cancel`),await a({method:"POST"})),createPaymentIntent:async e=>i(c("/bookings/payments/intent"),await a({method:"POST",body:JSON.stringify({manageToken:e})}))},H=class extends Error{constructor(r,n){super(`Slug "${r}" exists on ${n} websites; a site is required to pick one.`);this.slug=r;this.count=n;this.name="AmbiguousPageSlugError"}},k=e=>e?`/api/storefront/header-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/header-settings/",Pe=e=>e?`/api/storefront/theme-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/theme-settings/",we=e=>e?`/api/storefront/chat-settings/?${new URLSearchParams({site:e})}`:"/api/storefront/chat-settings/",be=e=>`/api/storefront/social-settings/?${new URLSearchParams({site:e})}`,D=e=>`/api/storefront/sites/${encodeURIComponent(e)}/`,St=e=>`${D(e)}currencies/`,Pt="/api/storefront/media/ingest/",J=class extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}};function wt(){let e=pe();if(!e)throw new J;return`${Pt}?${new URLSearchParams({site:e})}`}var F={"X-Puck-Media-Manifest":Y.contentHash},l=(e,t={})=>i(e,{...t,audience:"admin"}),jt={findPageBySlug:async(e,t,r)=>{let n=new URLSearchParams({slug:e});r&&n.set("site",r);let s=await l(`/api/storefront/pages/?${n.toString()}`,{token:t}),o=Array.isArray(s)?s:s.results??[];if(!r&&o.length>1)throw new H(e,o.length);return o[0]??null},getPageById:(e,t)=>l(`/api/storefront/pages/${e}/`,{token:t}),saveLayout:(e,t,r,n,s)=>l(`/api/storefront/pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t,expected_updated_at:n,...s?{client_id:s}:{}}),token:r}),publishPage:(e,t,r)=>l(`/api/storefront/pages/${e}/publish/`,{method:"POST",body:r?JSON.stringify({expected_updated_at:r}):void 0,token:t}),claimPageEditLock:(e,t,r,n=!1)=>l(`/api/storefront/pages/${e}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:r,takeover:n}),token:t}),releasePageEditLock:(e,t)=>l(`/api/storefront/pages/${e}/edit-lock/`,{method:"DELETE",token:t}),createTemplate:(e,t,r)=>l("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:e,layout:t}),headers:F,token:r}),getTemplate:(e,t)=>l(`/api/storefront/page-templates/${e}/`,{token:t}),saveTemplateLayout:(e,t,r)=>l(`/api/storefront/page-templates/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:F,token:r}),listTemplatePages:async(e,t)=>{let r=await l(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}`,{token:t});return Array.isArray(r)?r:r.results??[]},findTemplatePageBySlug:async(e,t,r)=>{let n=await l(`/api/storefront/template-pages/?template=${encodeURIComponent(e)}&slug=${encodeURIComponent(t)}`,{token:r});return(Array.isArray(n)?n:n.results??[])[0]??null},createTemplatePage:(e,t,r)=>l("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:e,...t}),headers:F,token:r}),saveTemplatePageLayout:(e,t,r)=>l(`/api/storefront/template-pages/${e}/`,{method:"PATCH",body:JSON.stringify({layout:t}),headers:F,token:r}),deleteTemplatePage:(e,t)=>l(`/api/storefront/template-pages/${e}/`,{method:"DELETE",token:t}),listPages:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("site",t);let n=await l(`/api/storefront/pages/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]},createPage:(e,t,r,n)=>l("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:e,slug:t,layout:r}),token:n}),deletePage:(e,t)=>l(`/api/storefront/pages/${e}/`,{method:"DELETE",token:t}),getHeaderSettings:(e,t)=>l(k(t),{token:e}),listMenus:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("site",t);let n=await l(`/api/storefront/menus/?${r}`,{token:e});return Array.isArray(n)?n:n.results??[]},listBlogPosts:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.visibleOnly&&r.set("is_visible","true"),t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/blog-posts/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]},listFieldUsage:async(e,t)=>{let r=await l(`/api/storefront/field-usage/?site=${encodeURIComponent(t)}`,{token:e});return Array.isArray(r?.entries)?r.entries:[]},listCategories:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.visibleOnly&&r.set("is_visible","true"),t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/categories/?${r.toString()}`,{token:e});return[...Array.isArray(n)?n:n.results??[]].sort((o,m)=>o.sort_order-m.sort_order||o.name.localeCompare(m.name))},listForms:async(e,t={})=>{let r=new URLSearchParams({no_page:"true"});t.siteId&&r.set("site",t.siteId);let n=await l(`/api/storefront/forms/?${r.toString()}`,{token:e});return[...Array.isArray(n)?n:n.results??[]].sort((o,m)=>o.title.localeCompare(m.title))},listWheelSummaries:async(e,t={})=>{let r=new URLSearchParams;t.siteId&&r.set("site",t.siteId);let n=r.toString(),s=await l(`/api/storefront/wheel-curations/summaries/${n?`?${n}`:""}`,{token:e});return h(s)},listProducts:async(e,t={})=>{let r=new URLSearchParams;t.kinds?.length&&r.set("kind",t.kinds.join(",")),t.siteId&&r.set("site",t.siteId);let n=r.toString(),s=await l(`/api/storefront/products/${n?`?${n}`:""}`,{token:e});return h(s)},getWheelDetail:async(e,t,r={})=>{let n=new URLSearchParams({slug:t});return r.siteId&&n.set("site",r.siteId),A(h(await l(`/api/storefront/wheel-curations/detail/?${n.toString()}`,{token:e})))},updateHeaderSettings:(e,t,r)=>l(k(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getSite:(e,t)=>l(D(e),{token:t}),listSiteCurrencies:async(e,t)=>{let r=await l(St(e),{token:t});return Array.isArray(r)?r:[]},updateSite:(e,t,r)=>l(D(e),{method:"PATCH",body:JSON.stringify(t),token:r}),getThemeSettings:(e,t)=>l(Pe(t),{token:e}),updateThemeSettings:(e,t,r)=>l(Pe(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getChatSettings:(e,t)=>l(we(t),{token:e}),updateChatSettings:(e,t,r)=>l(we(r),{method:"PATCH",body:JSON.stringify(e),token:t}),getSocialSettings:(e,t)=>l(be(t),{token:e}),updateSocialSettings:(e,t,r)=>l(be(r),{method:"PATCH",body:JSON.stringify(e),token:t}),uploadHeaderLogo:(e,t,r)=>{let n=new FormData;return n.append("logo",e),l(k(r),{method:"PATCH",body:n,token:t})},clearHeaderLogo:(e,t)=>l(k(t),{method:"PATCH",body:JSON.stringify({logo:null}),token:e}),setHeaderLogoFromAsset:(e,t,r)=>l(k(r),{method:"PATCH",body:JSON.stringify({logo_asset_id:e}),token:t}),uploadMedia:async(e,t)=>{let r=new FormData;return r.append("file",e),l(wt(),{method:"POST",body:r,token:t})},listMedia:async(e,t)=>{let r=new URLSearchParams({no_page:"true"});t&&r.set("kind",t);let n=await l(`/api/storefront/media-assets/?${r.toString()}`,{token:e});return Array.isArray(n)?n:n.results??[]}};export{Y as a,z as b,Z as c,w as d,Ee as e,N as f,pe as g,ze as h,y as i,L as j,U as k,i as l,nt as m,st as n,Te as o,dt as p,gt as q,ht as r,Gt as s,Vt as t,Kt as u,H as v,l as w,jt as x};