efficient-storefront-blocks 0.100.0 → 0.101.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.
- package/CHANGELOG.md +31 -0
- package/dist/chunks/{EditorPreviewCheckout-OLTXWUGM.js → EditorPreviewCheckout-JMBBJSI7.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-4XV2T5MD.js → SiteEditorProvider-BKZW7KVN.js} +1 -1
- package/dist/chunks/chunk-AF5TRBQB.js +1 -0
- package/dist/chunks/chunk-GJZGQCDM.js +1 -0
- package/dist/chunks/chunk-KV3EHFHB.js +339 -0
- package/dist/chunks/chunk-YSKMBJ7V.js +74 -0
- package/dist/chunks/{fitment-data-ZWKG2FFA.js → fitment-data-HMD5DDDB.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/editor/lib/api/section-templates.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/Subscribe/fields.js +1 -1
- package/dist/editor/lib/document/box-header.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +35 -30
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +122 -16
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ChatWidget.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/ConsentContext.d.ts +6 -0
- package/dist/render/components/ConsentContext.js +1 -1
- package/dist/render/components/ConsentPanel.d.ts +6 -0
- package/dist/render/components/ConsentPanel.js +1 -1
- package/dist/render/components/ConsentProvider.js +1 -1
- package/dist/render/components/CouponField.js +1 -1
- package/dist/render/components/DealerFinderSection.js +1 -1
- package/dist/render/components/EmailCaptureForm.js +1 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FooterEmailSignup.js +1 -1
- package/dist/render/components/FooterLogo.d.ts +1 -1
- package/dist/render/components/FooterLogo.js +1 -1
- package/dist/render/components/FooterMenu.d.ts +2 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +2 -1
- package/dist/render/components/GalleryGrid.js +3 -3
- package/dist/render/components/LegalLine.d.ts +10 -0
- package/dist/render/components/LegalLine.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/SiteLegalContext.d.ts +19 -0
- package/dist/render/components/SiteLegalContext.js +1 -0
- package/dist/render/components/Subscribe.d.ts +9 -1
- package/dist/render/components/Subscribe.js +1 -1
- package/dist/render/components/booking/BookingFormState.js +1 -1
- package/dist/render/components/fitment/FitmentFinder.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +2 -2
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.d.ts +3 -2
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.js +1 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/list-rows.d.ts +3 -0
- package/dist/render/lib/api/list-rows.js +1 -0
- package/dist/render/lib/api/types.d.ts +4 -0
- package/dist/render/lib/cache-evict.d.ts +1 -0
- package/dist/render/lib/cache-evict.js +1 -1
- package/dist/render/lib/chrome-cache.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +7 -0
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/collection-card-look.d.ts +0 -4
- package/dist/render/lib/content/collection-card-look.js +1 -1
- package/dist/render/lib/content/facet-row-seed.js +1 -1
- package/dist/render/lib/content/product-card-seed.js +1 -1
- package/dist/render/lib/content/rail-row-seed.js +1 -1
- package/dist/render/lib/content/site.d.ts +4 -0
- package/dist/render/lib/content/site.js +1 -1
- package/dist/render/lib/content/tab-strip.d.ts +3 -1
- package/dist/render/lib/content/tab-strip.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Subscribe/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/document-nodes.d.ts +2 -0
- package/dist/render/lib/document/document-nodes.js +1 -1
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-listing.js +1 -1
- package/dist/render/lib/field-input.d.ts +2 -0
- package/dist/render/lib/field-input.js +1 -1
- package/dist/render/lib/links/link-rules.d.ts +5 -0
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/sections/band-padding.d.ts +17 -1
- package/dist/render/lib/sections/band-padding.js +1 -1
- package/dist/render/lib/sections/gallery-toolbar.d.ts +2 -2
- package/dist/render/lib/sections/gallery-toolbar.js +1 -1
- package/dist/render/lib/sections/product-pictures.js +1 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/plp-filters.d.ts +2 -1
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +0 -3
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/selected-ranges.d.ts +1 -0
- package/dist/render/lib/wheels/selected-ranges.js +1 -1
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/chunk-4SYZK3TW.js +0 -1
- package/dist/chunks/chunk-G6OVBAOA.js +0 -74
- package/dist/chunks/chunk-OWUMH5VC.js +0 -339
- package/dist/chunks/chunk-WN7SFD3N.js +0 -1
- /package/dist/chunks/{chunk-OWUMH5VC.js.LEGAL.txt → chunk-KV3EHFHB.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-SCTOV5CT.js → chunk-XNUK2QNK.js} +0 -0
|
@@ -2,12 +2,13 @@ import { type Dispatch, type SetStateAction } from "react";
|
|
|
2
2
|
import type { VehicleSelection } from "../../lib/wheels/fitment-options.js";
|
|
3
3
|
import { type PlpFilterState, type PlpSortKey } from "../../lib/wheels/plp-filters.js";
|
|
4
4
|
export declare function watchLocation(onChange: () => void): () => void;
|
|
5
|
+
export declare function useAddressQuery(stamped: string, follow: boolean): string;
|
|
5
6
|
export interface PlpUrlFiltersArgs {
|
|
6
7
|
editing: boolean;
|
|
7
8
|
openingSort: PlpSortKey;
|
|
8
9
|
appliedVehicle: VehicleSelection | null;
|
|
9
10
|
vehicleRestored: boolean;
|
|
10
|
-
|
|
11
|
+
addressQuery?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare function filtersFromQuery(search: string, openingSort: PlpSortKey): PlpFilterState;
|
|
13
|
-
export declare function usePlpFiltersInUrl({ editing, openingSort, appliedVehicle, vehicleRestored,
|
|
14
|
+
export declare function usePlpFiltersInUrl({ editing, openingSort, appliedVehicle, vehicleRestored, addressQuery, }: PlpUrlFiltersArgs): [PlpFilterState, Dispatch<SetStateAction<PlpFilterState>>];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useEffect as
|
|
1
|
+
"use client";import{useEffect as u,useState as p}from"react";import{EMPTY_PLP_FILTERS as F,plpFilterQuery as L,plpFiltersFromParams as P,plpFiltersToParams as a}from"../../lib/wheels/plp-filters.js";import{appendVehicleParams as S}from"../../lib/wheels/plp-vehicle-params.js";const d="plp:locationchange";let m=!1;function y(t){if(typeof window>"u")return()=>{};if(!m){m=!0;for(const e of["pushState","replaceState"]){const n=window.history[e];window.history[e]=function(...o){n.apply(this,o),window.dispatchEvent(new Event(d))}}}return window.addEventListener("popstate",t),window.addEventListener(d,t),()=>{window.removeEventListener("popstate",t),window.removeEventListener(d,t)}}function A(t,e){const[n,r]=p(null);return u(()=>{if(!e||typeof window>"u")return;const o=()=>r(L(window.location.search));return o(),y(o)},[e]),e&&n!==null?n:t}function h(t,e){const n=P(t);return a(n).toString()===""?{...F,sort:e}:n}function I({editing:t,openingSort:e,appliedVehicle:n,vehicleRestored:r,addressQuery:o}){const[c,w]=p(()=>h(t?"":o??"",e)),[f,E]=p(!1);return u(()=>{if(t||typeof window>"u")return;const s=()=>{const i=h(window.location.search,e);w(l=>a(l).toString()===a(i).toString()?l:i)};return s(),E(!0),y(s)},[t,e]),u(()=>{if(t||!f||!r||typeof window>"u")return;const s=a(c);S(s,n);const i=s.toString();window.history.replaceState(null,"",`${window.location.pathname}${i?`?${i}`:""}`)},[t,f,r,c,n]),[c,w]}export{h as filtersFromQuery,A as useAddressQuery,I as usePlpFiltersInUrl,y as watchLocation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as ot,SITE_HOST_HEADER as it,SITE_SLUG_HEADER as ct}from"../site-headers.js";import{PRODUCT_API_BASE as dt,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ut,clientIpFromForwardedFor as lt,FORWARDED_FOR_HEADER as pt,hopCachingOf as yt}from"../forwarded-for.js";import ht from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ft}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as E}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const gt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class w extends Error{status;data;constructor(e,s,n){super(s),this.status=e,this.data=n}}const I="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.",mt=new Set([502,503,504]),N=0,wt="This editor runs on its host's own backend, which does not serve this request.",St=5e3,Pt=15e3,Ot=()=>typeof window>"u"?St:Pt;function H(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(Ot())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>mt.has(t)?I:e,bt=["admin","venue"];let B="admin";function ye(t){B=bt.includes(t)?t:"admin"}function At(){return B}const Tt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function he(t){q=t&&Tt.test(t)?t:null}function Rt(){return q}function Et(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=V();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:n,headers:l,audience:p,...h}=e;if(typeof window<"u"&&!ft())throw new w(N,wt,null);if(typeof window>"u"&&n===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) 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.`);const r=typeof FormData<"u"&&h.body instanceof FormData;let a;try{a=await fetch(`${n??gt}${Et(t)}`,{...h,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:h.signal??H({...h,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new w(N,I,null):y}let o;try{o=await a.text()}catch(y){throw F(y)?new w(N,I,null):y}let c=null;if(o)try{c=JSON.parse(o)}catch{throw new w(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),o)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new w(a.status,y,c)}return c}let b=null;async function G(){return b||(b=$t().finally(()=>{b=null}),b)}async function $t(){const t=P.takeLegacyRefresh(),e=await Ut.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function g(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new w(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(n){if(!(n instanceof w)||n.status!==401)throw n;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),n}}}const Ct=100,j=20;function _t(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function z(t,e){const[s,n=""]=t.split("?"),l=[];let p="1";for(let h=0;h<j&&p;h++){const r=new URLSearchParams(n);r.set("page_size",String(Ct)),p!=="1"&&r.set("page",p);const a=await g(`${s}?${r.toString()}`);l.push(...a.results),p=_t(a.next)}return p&&console.warn(`[${e}] stopped at ${j} pages (${l.length} rows); list may be truncated`),l}async function K(t,e={}){if(P.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(s){if(!(s instanceof w)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function X(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new w(403,"This session is not valid for this shop.",null);return t}const Ut={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await X(),t},me:X,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>g("/api/products/brands/"),myOrders:()=>z("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>z(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as It,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Nt,isSvgUrl as vt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as kt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Lt,webRuntimeSiteSlug as V}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Jt}from"../sections/dealer-finder.js";function m(t){if(typeof t=="string")return t.startsWith("/media/")?It(t):t;if(Array.isArray(t))return t.map(m);if(t&&typeof t=="object"){const e={};for(const[s,n]of Object.entries(t))e[s]=s==="captions"&&n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).map(([l,p])=>[m(l),p])):m(n);return e}return t}import{PRODUCT_API_BASE as Ce}from"./origins.js";const Z=typeof window>"u"&&D!=="",Dt=Z?D:dt,xt=Lt,O=()=>({baseUrl:xt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Y=100,Q=50;function k(t,e,s){const n=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&n.set(l,String(p));return n.set("pageSize",String(Y)),s&&n.set("cursor",s),`/api/v1${t}?${n.toString()}`}function Ht(t,e){return k("/wheels",{process:t},e)}const tt=Y;function Ft(t,e){return k("/wheels",{slug:t.join(",")},e)}function Mt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Bt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function L(t,e,s=()=>!1,n=()=>!1){const l=[];let p=null;try{for(let h=0;h<Q;h++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Bt(r.next),!p)break;if(n(l))return l}p&&console.warn(`[${t}] stopped at ${Q} pages (${l.length} rows); catalog may be truncated`)}catch(h){if(s(h))throw h;console.warn(`[${t}] product API unavailable, returning []`,h)}return l}const et=t=>t instanceof w&&t.status===400;function rt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?E([e]):[e])}async function at(){return(await qt()).host}async function qt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,n=s(e.get(it)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:n,matchesRequestHost:n!==null&&n===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Gt(){try{const{headers:t}=await import("next/headers");return lt((await t()).get(pt))}catch{return null}}async function Wt(){try{const{headers:t}=await import("next/headers");return(await t()).get(ct)||null}catch{return null}}async function jt(){const t=await Wt();if(t)return`site=${encodeURIComponent(t)}`;const e=await at();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=V();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await jt())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const zt="preview";async function Kt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(ot)}catch{return null}}async function Xt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function J(t,e){const s=await Kt();if(s===null)return[await f(t),await u(e)];const n=$(await f(t),`${zt}=${encodeURIComponent(s)}`),{next:l,cache:p,...h}=e??{},r=await u({...h,cache:"no-store"}),a=await Xt();return a&&(r.headers={...r.headers,"user-agent":a}),[n,r]}async function Vt(t){if(!Z)return;const[e,s]=await Promise.all([at(),Gt()]),n=ut(e,s,t);return Object.keys(n).length>0?n:void 0}async function u(t){const e=await Vt(yt(t)),s={baseUrl:Dt,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const n=s.toString();return`/api/v1/fitment${t}${n?`?${n}`:""}`}const Pe={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:n}=await import("./fitment-data.js");return n.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,n)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,n)}return(await i(T("/modifications",{make:t,model:e,year:s,region:n}),O())).results},getStockFitment:async(t,e,s,n,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,n,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:n,region:l}),O())}},Oe={listWheels:async(t,e={})=>{const s=await L("products.listWheels",async n=>await f(Ht(t,n)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:n=>E([...n]).length>=e.maxRows);return E(m(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const n=[];for(let r=0;r<s.length;r+=tt)n.push(s.slice(r,r+tt));const l=await Promise.all(n.map(r=>L("products.listWheelsBySlug",async a=>await f(Ft(r,a)),e.throwOnFailure?()=>!0:et))),p=new Set(s),h=l.flat().filter(r=>p.has(r.slug));return E(m(h))},listCatalog:async(t,e,s={})=>{if(t.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` — so the call would silently return the wheel catalog instead of nothing.");const n=await L("products.listCatalog",async l=>await f(Mt(t,e,l)),s.throwOnFailure?()=>!0:et,s.maxRows===void 0?void 0:l=>rt([...l]).length>=s.maxRows);return rt(m(n))},getWheel:async t=>x(m(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>m(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:n}=await import("./gallery-builds-data.js");return m(n(e,s))}try{const n=new URLSearchParams;e&&n.set("process",e),s&&n.set("wheelSlug",s);const l=n.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return m(p.results)}catch(n){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",n),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>m(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof w&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof w&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof w&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[n,l]=await J(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return m(await i(n,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(n){if(e)throw n;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",n),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),n=e.toString();try{return await i(await f(n?`${s}?${n}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await K(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await K(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await J(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let n=null,l=null;if(s&&vt(s)){const p=await Nt(s,t);p&&(n=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:n,logoInkIsDark:l}},getThemeSettings:async()=>i(...await J(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},be={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Zt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const n=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${n?`?${n}`:""}`},_=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Yt=t=>`${_(t)}currencies/`,Qt="/api/storefront/media/ingest/";class te 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 ee(){const t=kt();if(!t)throw new te;return`${Qt}?${new URLSearchParams({site:t})}`}const re="X-Puck-Media-Manifest",st=ht.contentHash,U={"X-Media-Manifest":st,[re]:st},Ae=nt({});function nt(t){return(e,s={})=>{const n=Rt(),l=t.headers||n?{...n?{"Accept-Language":n}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??At()})}}function ae(t={}){const e=nt(t),s=t.siteDrafts===!0,n=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),h=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,o)=>{const c=new URLSearchParams({slug:r});o&&c.set("site",o);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!o&&S.length>1)throw new Zt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,o,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:o}),duplicatePage:(r,a,o)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:o}),geocode:(r,a,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:r,country:o}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,o,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:U,token:o}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,o)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),listTemplatePages:async(r,a)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o)?o:o.results??[]},findTemplatePageBySlug:async(r,a,o)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:o});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:U,token:o}),saveTemplatePageLayout:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),deleteTemplatePage:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/pages/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,o,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:o}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(n(a),{token:r}),listMenus:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/menus/?${o}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const o=new URLSearchParams;a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return m(y)},listProducts:async(r,a={})=>{const o=new URLSearchParams;a.kinds?.length&&o.set("kind",a.kinds.join(",")),a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return m(y)},getWheelDetail:async(r,a,o={})=>{const c=new URLSearchParams({slug:a});return o.siteId&&c.set("site",o.siteId),x(m(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e(_(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const o=await e(Yt(r),{token:a});return Array.isArray(o)?o:[]},publishSite:(r,a)=>e(`${_(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${_(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,o)=>e(p(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(h(a),{token:r}),updateSocialSettings:(r,a,o)=>e(h(o),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,o)=>{const c=new FormData;return c.append("logo",r),e(n(o),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(n(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const o=new FormData;return o.append("file",r),e(ee(),{method:"POST",body:o,token:a})},listMedia:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("kind",a);const c=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const Te=ae({siteDrafts:!0});function se(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function Re(t){return Jt(await i(se(t)))}export{gt as API_URL,Zt as AmbiguousPageSlugError,w as ApiError,Pt as BROWSER_READ_TIMEOUT_MS,wt as EFFICIENT_CLIENT_CLOSED_MESSAGE,te as MediaUploadDestinationError,zt as PREVIEW_PARAM,Ce as PRODUCT_API_BASE,St as SERVER_READ_TIMEOUT_MS,I as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,Ae as adminFetch,Ut as api,i as apiFetch,$ as appendSiteQuery,be as bookings,ae as createStorefrontAdmin,se as dealersPath,H as defaultRequestDeadline,ee as editorMediaUploadPath,At as editorPortalAudience,Rt as editorRequestLanguage,Re as fetchDealers,Pe as fitment,Oe as products,Ot as readDeadlineMs,Gt as resolveClientIp,m as resolveMediaUrls,Kt as resolvePreviewToken,at as resolveSiteHost,qt as resolveSiteHostSource,Wt as resolveSiteSlug,he as setEditorLanguage,ye as setEditorPortalAudience,Te as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as it,SITE_HOST_HEADER as ct,SITE_SLUG_HEADER as dt}from"../site-headers.js";import{PRODUCT_API_BASE as ut,PRODUCT_BACKEND_URL as x}from"./origins.js";import{listRows as m}from"./list-rows.js";import{backendHopHeaders as lt,clientIpFromForwardedFor as pt,FORWARDED_FOR_HEADER as yt,hopCachingOf as ht}from"../forwarded-for.js";import ft from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as gt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as $}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as H}from"../wheels/renderable-finishes.js";const mt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class S extends Error{status;data;constructor(e,n,s){super(n),this.status=e,this.data=s}}const N="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.",wt=new Set([502,503,504]),v=0,St="This editor runs on its host's own backend, which does not serve this request.",Pt=5e3,Ot=15e3,bt=()=>typeof window>"u"?Pt:Ot;function F(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(bt())}const M=t=>t instanceof Error&&t.name==="TimeoutError",B=(t,e)=>wt.has(t)?N:e,Tt=["admin","venue"];let q="admin";function fe(t){q=Tt.includes(t)?t:"admin"}function Rt(){return q}const At=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let G=null;function ge(t){G=t&&At.test(t)?t:null}function Et(){return G}function $t(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=Z();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:n,baseUrl:s,headers:u,audience:l,...y}=e;if(typeof window<"u"&&!gt())throw new S(v,St,null);if(typeof window>"u"&&s===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) 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.`);const a=typeof FormData<"u"&&y.body instanceof FormData;let r;try{r=await fetch(`${s??mt}${$t(t)}`,{...y,headers:{...a?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...u},signal:y.signal??F({...y,audience:l})})}catch(h){throw h instanceof TypeError||M(h)?new S(v,N,null):h}let o;try{o=await r.text()}catch(h){throw M(h)?new S(v,N,null):h}let p=null;if(o)try{p=JSON.parse(o)}catch{throw new S(r.status,r.ok?"Expected JSON but received a non-JSON response":B(r.status,r.statusText),o)}if(!r.ok){const h=(p&&typeof p=="object"&&"detail"in p&&typeof p.detail=="string"?p.detail:null)??B(r.status,r.statusText);throw new S(r.status,h,p)}return p}let T=null;async function W(){return T||(T=Ct().finally(()=>{T=null}),T)}async function Ct(){const t=O.takeLegacyRefresh(),e=await It.refresh(t??void 0);return O.setTokens(e.access),e.access}async function j(){return O.getAccess()??W()}async function g(t,e={}){let n;try{n=await j()}catch{throw O.clear(),new S(401,"Not signed in",null)}try{return await i(t,{...e,token:n})}catch(s){if(!(s instanceof S)||s.status!==401)throw s;try{const u=await W();return await i(t,{...e,token:u})}catch{throw O.clear(),s}}}const _t=100,z=20;function Ut(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function K(t,e){const[n,s=""]=t.split("?"),u=[];let l="1";for(let y=0;y<z&&l;y++){const a=new URLSearchParams(s);a.set("page_size",String(_t)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=Ut(r.next)}return l&&console.warn(`[${e}] stopped at ${z} pages (${u.length} rows); list may be truncated`),u}async function X(t,e={}){if(O.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(n){if(!(n instanceof S)||n.status!==401)throw n}return{data:await i(t,e),asShopper:!1}}async function V(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw O.clear(),new S(403,"This session is not valid for this shop.",null);return t}const It={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{O.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await j();return await V(),t},me:V,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,n)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:n})}),brands:()=>g("/api/products/brands/"),myOrders:()=>K("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>K(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const n=new FormData;return n.append("claim_item",t),n.append("file",e),n.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:n})}};import{media as Nt,absolutizeApiUrl as k}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as vt,isSvgUrl as kt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Lt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Jt,webRuntimeSiteSlug as Z}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Dt}from"../sections/dealer-finder.js";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Nt(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[n,s]of Object.entries(t))e[n]=n==="captions"&&s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).map(([u,l])=>[w(u),l])):w(s);return e}return t}import{PRODUCT_API_BASE as Ue}from"./origins.js";const Y=typeof window>"u"&&x!=="",xt=Y?x:ut,Ht=Jt,b=()=>({baseUrl:Ht(),audience:null});function c(t,e){const n=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${n}`}const Q=100,tt=50;function L(t,e,n){const s=new URLSearchParams;for(const[u,l]of Object.entries(e))l!=null&&l!==""&&s.set(u,String(l));return s.set("pageSize",String(Q)),n&&s.set("cursor",n),`/api/v1${t}?${s.toString()}`}function Ft(t,e){return L("/wheels",{process:t},e)}const et=Q;function Mt(t,e){return L("/wheels",{slug:t.join(",")},e)}function Bt(t,e,n){return L("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function qt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,n=()=>!1,s=()=>!1){const u=[];let l=null;try{for(let y=0;y<tt;y++){const a=await i(await e(l),await d());if(u.push(...m(a)),l=qt(a.next),!l)break;if(s(u))return u}l&&console.warn(`[${t}] stopped at ${tt} pages (${u.length} rows); catalog may be truncated`)}catch(y){if(n(y))throw y;console.warn(`[${t}] product API unavailable, returning []`,y)}return u}const at=t=>t instanceof S&&t.status===400;function rt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?$([e]):[e])}async function nt(){return(await Gt()).host}async function Gt(){try{const{headers:t}=await import("next/headers"),e=await t(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,s=n(e.get(ct)??e.get("x-forwarded-host")??e.get("host")),u=n(e.get("host"));return{host:s,matchesRequestHost:s!==null&&s===u}}catch{return{host:null,matchesRequestHost:!1}}}async function Wt(){try{const{headers:t}=await import("next/headers");return pt((await t()).get(yt))}catch{return null}}async function jt(){try{const{headers:t}=await import("next/headers");return(await t()).get(dt)||null}catch{return null}}async function zt(){const t=await jt();if(t)return`site=${encodeURIComponent(t)}`;const e=await nt();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=Z();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await zt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Kt="preview";async function Xt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(it)}catch{return null}}async function Vt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function D(t,e){const n=await Xt();if(n===null)return[await f(t),await d(e)];const s=C(await f(t),`${Kt}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await Vt();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function Zt(t){if(!Y)return;const[e,n]=await Promise.all([nt(),Wt()]),s=lt(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await Zt(ht(t)),n={baseUrl:xt,...t};return e&&(n.headers={...e,...t?.headers}),n}const R=typeof window>"u";function A(t,e){const n=new URLSearchParams;for(const[u,l]of Object.entries(e))l!==void 0&&l!==""&&n.set(u,String(l));const s=n.toString();return`/api/v1/fitment${t}${s?`?${s}`:""}`}const be={listMakes:async t=>{if(R){const{fitmentData:n}=await import("./fitment-data.js");return n.makes(t)}const e=await i(A("/makes",{region:t}),b());return m(e)},listModels:async(t,e)=>{if(R){const{fitmentData:s}=await import("./fitment-data.js");return s.models(t,e)}const n=await i(A("/models",{make:t,region:e}),b());return m(n)},listYears:async(t,e,n)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.years(t,e,n)}const s=await i(A("/years",{make:t,model:e,region:n}),b());return m(s)},listModifications:async(t,e,n,s)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.modifications(t,e,n,s)}const u=await i(A("/modifications",{make:t,model:e,year:n,region:s}),b());return m(u)},getStockFitment:async(t,e,n,s,u)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.stockFitment(t,e,n,s,u)}return i(A("/stock-fitment",{make:t,model:e,year:n,modification:s,region:u}),b())}},Te={listWheels:async(t,e={})=>{const n=await J("products.listWheels",async s=>await f(Ft(t,s)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:s=>$([...s]).length>=e.maxRows);return $(w(n))},listWheelsBySlug:async(t,e={})=>{const n=[...new Set(t.map(a=>a.trim()).filter(Boolean))];if(n.length===0)return[];const s=[];for(let a=0;a<n.length;a+=et)s.push(n.slice(a,a+et));const u=await Promise.all(s.map(a=>J("products.listWheelsBySlug",async r=>await f(Mt(a,r)),e.throwOnFailure?()=>!0:at))),l=new Set(n),y=u.flat().filter(a=>l.has(a.slug));return $(w(y))},listCatalog:async(t,e,n={})=>{if(t.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` — so the call would silently return the wheel catalog instead of nothing.");const s=await J("products.listCatalog",async u=>await f(Bt(t,e,u)),n.throwOnFailure?()=>!0:at,n.maxRows===void 0?void 0:u=>rt([...u]).length>=n.maxRows);return rt(w(s))},getWheel:async t=>H(w(await i(await f(c(`/wheels/${t}`)),await d()))),getTyre:async t=>w(await i(await f(c(`/tyres/${t}`)),await d())),listBundles:async(t={})=>{try{return await i(await f(c("/bundles")),await d())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(c(`/bundles/${t}`)),await d()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:n=null}=t;if(typeof window>"u"){const{listGalleryBuilds:s}=await import("./gallery-builds-data.js");return w(s(e,n))}try{const s=new URLSearchParams;e&&s.set("process",e),n&&s.set("wheelSlug",n);const u=s.toString(),l=await i(`/api/v1/gallery-builds${u?`?${u}`:""}`,b());return w(m(l))}catch(s){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",s),[]}},getSite:async()=>i(await f(c("/site")),await d()),getSiteBySlug:async t=>i(`${c("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await d():void 0),listPages:async()=>w(await i(await f(c("/pages")),await d())),listPopups:async()=>i(await f(c("/popups")),await d()),listProductTemplates:async()=>{try{return await i(await f(c("/product-templates")),await d())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${c("/dynamic-pages")}${e}`),await d())}catch(n){if(n instanceof S&&n.status===404)return[];throw n}},getRecord:async(t,e)=>{try{return await i(await f(c(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await d())}catch(n){if(n instanceof S&&n.status===404)return null;throw n}},listRecordKeys:async t=>{try{const e=await i(await f(c(`/records/${encodeURIComponent(t)}`)),await d({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(e){if(e instanceof S&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(c("/product-type-choices")),await d())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(c("/field-usage")),await d())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const n=e.record?`?record=${encodeURIComponent(e.record)}`:"",[s,u]=await D(c(`/pages/${t}`)+n,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(s,u))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const n=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(c("/blog-posts")+n,await d())).map(u=>({...u,coverImage:k(u.coverImage)??""}))}catch(s){if(e)throw s;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(c(`/blog-posts/${t}`),await d());return{...e,coverImage:k(e.coverImage)??""}},createOrder:async t=>i(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(c("/orders/lookup"),await d({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(c("/payments/intent"),await d({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(c("/checkouts/release"),await d({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(c("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(c("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(c("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(c("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(c("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(c("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(c("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(c("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(c("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(c("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(c("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(c("/stock-alerts"),await d({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(c("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(c("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(c("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(c("/carts"),await d({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(c("/carts/restore"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(c("/carts/unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const n=c("/reviews"),s=e.toString();try{return await i(await f(s?`${n}?${s}`:n),await d())}catch(u){return console.warn("[products.listReviews] product API unavailable, returning []",u),[]}},submitReview:async t=>i(c("/reviews"),await d({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(c(`/forms/${encodeURIComponent(t)}`),await d()),submitForm:async(t,e)=>i(c(`/forms/${encodeURIComponent(t)}/submissions`),await d({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await d())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(c(`/countries/${encodeURIComponent(t)}/subdivisions`),await d())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=c("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await X(e,n)).data:i(e,n)},validateCoupon:async t=>{const{data:e,asShopper:n}=await X(c("/coupons/validate"),await d({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:n}},getHeaderSettings:async()=>{const t=F({method:"GET"}),e=await i(...await D(c("/header-settings"),{signal:t})),n=k(e.logoUrl);let s=null,u=null;if(n&&kt(n)){const l=await vt(n,t);l&&(s=l.reversed,u=l.inkIsDark)}return{...e,logoUrl:n,logoReversed:s,logoInkIsDark:u}},getThemeSettings:async()=>i(...await D(c("/theme-settings"))),getChatSettings:async()=>i(await f(c("/chat-settings")),await d())},Re={listServices:async()=>{try{return await i(c("/bookings/services"),await d())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(c(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await d()),create:async t=>i(c("/bookings"),await d({method:"POST",body:JSON.stringify(t)})),get:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}`),await d()),cancel:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await d({method:"POST"})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class Yt extends Error{slug;count;constructor(e,n){super(`Slug "${e}" exists on ${n} websites; a site is required to pick one.`),this.slug=e,this.count=n,this.name="AmbiguousPageSlugError"}}const _=(t,e,n)=>{const s=new URLSearchParams({...e?{site:e}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${s?`?${s}`:""}`},U=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Qt=t=>`${U(t)}currencies/`,te="/api/storefront/media/ingest/";class ee 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 ae(){const t=Lt();if(!t)throw new ee;return`${te}?${new URLSearchParams({site:t})}`}const re="X-Puck-Media-Manifest",st=ft.contentHash,I={"X-Media-Manifest":st,[re]:st},Ae=ot({});function ot(t){return(e,n={})=>{const s=Et(),u=t.headers||s?{...s?{"Accept-Language":s}:{},...t.headers,...n.headers}:void 0;return i(e,{...n,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...u?{headers:u}:{},audience:t.audience??Rt()})}}function ne(t={}){const e=ot(t),n=t.siteDrafts===!0,s=a=>_("header-settings",a,n),u=a=>_("theme-settings",a,n),l=a=>_("chat-settings",a,n),y=a=>_("social-settings",a,n);return{findPageBySlug:async(a,r,o)=>{const p=new URLSearchParams({slug:a});o&&p.set("site",o);const h=await e(`/api/storefront/pages/?${p.toString()}`,{token:r}),P=m(h);if(!o&&P.length>1)throw new Yt(a,P.length);return P[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,o,p,h)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:p,...h?{client_id:h}:{}}),token:o}),duplicatePage:(a,r,o)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:o}),geocode:(a,r,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:a,country:o}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,o,p=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:p}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:I,token:o}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,o)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),listTemplatePages:async(a,r)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return m(o)},findTemplatePageBySlug:async(a,r,o)=>{const p=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:o});return m(p)[0]??null},createTemplatePage:(a,r,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:I,token:o}),saveTemplatePageLayout:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),deleteTemplatePage:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/pages/?${o.toString()}`,{token:a});return m(p)},createPage:(a,r,o,p)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:o}),token:p}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(s(r),{token:a}),listMenus:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/menus/?${o}`,{token:a});return m(p)},listBlogPosts:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:a});return m(p)},listFieldUsage:async(a,r)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/categories/?${o.toString()}`,{token:a});return[...m(p)].sort((P,E)=>P.sort_order-E.sort_order||P.name.localeCompare(E.name))},listForms:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/forms/?${o.toString()}`,{token:a});return[...m(p)].sort((P,E)=>P.title.localeCompare(E.title))},listWheelSummaries:async(a,r={})=>{const o=new URLSearchParams;r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/wheel-curations/summaries/${p?`?${p}`:""}`,{token:a});return w(h)},listProducts:async(a,r={})=>{const o=new URLSearchParams;r.kinds?.length&&o.set("kind",r.kinds.join(",")),r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/products/${p?`?${p}`:""}`,{token:a});return w(h)},getWheelDetail:async(a,r,o={})=>{const p=new URLSearchParams({slug:r});return o.siteId&&p.set("site",o.siteId),H(w(await e(`/api/storefront/wheel-curations/detail/?${p.toString()}`,{token:a})))},updateHeaderSettings:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(U(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return m(r)},listSiteCurrencies:async(a,r)=>{const o=await e(Qt(a),{token:r});return Array.isArray(o)?o:[]},publishSite:(a,r)=>e(`${U(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${U(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(u(r),{token:a}),updateThemeSettings:(a,r,o)=>e(u(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getMyPreferences:async a=>(await e("/api/auth/me/",{token:a})).preferences??{},updateMyPreferences:(a,r)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:a}),token:r}),getChatSettings:(a,r)=>e(l(r),{token:a}),updateChatSettings:(a,r,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(y(r),{token:a}),updateSocialSettings:(a,r,o)=>e(y(o),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,o)=>{const p=new FormData;return p.append("logo",a),e(s(o),{method:"PATCH",body:p,token:r})},clearHeaderLogo:(a,r)=>e(s(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const o=new FormData;return o.append("file",a),e(ae(),{method:"POST",body:o,token:r})},listMedia:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("kind",r);const p=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:a});return m(p)}}}const Ee=ne({siteDrafts:!0});function se(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function $e(t){return Dt(await i(se(t)))}export{mt as API_URL,Yt as AmbiguousPageSlugError,S as ApiError,Ot as BROWSER_READ_TIMEOUT_MS,St as EFFICIENT_CLIENT_CLOSED_MESSAGE,ee as MediaUploadDestinationError,Kt as PREVIEW_PARAM,Ue as PRODUCT_API_BASE,Pt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,v as STATUS_NETWORK_ERROR,Ae as adminFetch,It as api,i as apiFetch,C as appendSiteQuery,Re as bookings,ne as createStorefrontAdmin,se as dealersPath,F as defaultRequestDeadline,ae as editorMediaUploadPath,Rt as editorPortalAudience,Et as editorRequestLanguage,$e as fetchDealers,be as fitment,Te as products,bt as readDeadlineMs,Wt as resolveClientIp,w as resolveMediaUrls,Xt as resolvePreviewToken,nt as resolveSiteHost,Gt as resolveSiteHostSource,jt as resolveSiteSlug,ge as setEditorLanguage,fe as setEditorPortalAudience,Ee as storefrontAdmin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function s(r){return Array.isArray(r)?r:r?.results??[]}export{s as listRows};
|
|
@@ -1437,6 +1437,10 @@ export interface components {
|
|
|
1437
1437
|
consentEnabled?: boolean;
|
|
1438
1438
|
consentPrivacyPage?: string | null;
|
|
1439
1439
|
consentNoticeOptOut?: boolean;
|
|
1440
|
+
privacyPage?: string | null;
|
|
1441
|
+
termsPage?: string | null;
|
|
1442
|
+
footerCookieSettings?: boolean;
|
|
1443
|
+
footerSitemap?: boolean;
|
|
1440
1444
|
};
|
|
1441
1445
|
SiteSocialLinks: {
|
|
1442
1446
|
instagram?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface Expiring {
|
|
2
2
|
expiresAt: number;
|
|
3
3
|
}
|
|
4
|
+
export declare function isCallerChosenKey(key: string): boolean;
|
|
4
5
|
export declare function evictForInsert<V extends Expiring>(cache: Map<string, V>, max: number, isVolatileKey: (key: string) => boolean, now: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function u(e){return/(?:^|\|)(?:slug|xhost):/.test(e)}function d(e,o,l,s){for(;e.size>=o;){let n,t;for(const[i,f]of e){if(f.expiresAt<=s){n=i;break}t===void 0&&l(i)&&(t=i)}const r=n??t??e.keys().next().value;if(r===void 0)return;e.delete(r)}}export{d as evictForInsert,u as isCallerChosenKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolvePreviewToken as l,resolveSiteHostSource as
|
|
1
|
+
import{resolvePreviewToken as l,resolveSiteHostSource as x,resolveSiteSlug as _}from"./api/index.js";import{evictForInsert as d,isCallerChosenKey as C}from"./cache-evict.js";const f=6e4,A=5e3,h=500,n=new Map;async function p(r){const{host:e,matchesRequestHost:t}=await x();if(!e)return"";const o=await _();return o?`${r}|slug:${encodeURIComponent(e)}/${encodeURIComponent(o)}`:t?`${r}|host:${e}`:`${r}|xhost:${e}`}async function v(r,e){if(await l()!==null)return e();const t=await p(r);if(!t)return e();const o=Date.now(),c=n.get(t);if(c&&c.expiresAt>o)return c.load;const s=await e(),a=s.outcome.state==="failed",w=a?A:f,m=n.get(t)?.lastGood,i=s.outcome.state==="ok"?s:a?m:void 0,u=a&&i?i:s;return d(n,h,C,o),n.set(t,{load:u,expiresAt:o+w,lastGood:i}),u}async function y(r,e){if(await l()!==null)return e();const t=await p(r);if(!t)return e();const o=n.get(t);if(o&&o.expiresAt>Date.now())return o.load;const c=await e(),s=Date.now();return d(n,h,C,s),n.set(t,{load:c,expiresAt:s+f}),c}function E(){n.clear()}export{A as CHROME_CACHE_FAILURE_TTL_MS,h as CHROME_CACHE_MAX,f as CHROME_CACHE_TTL_MS,v as cachedChrome,y as cachedSiteRead,E as clearChromeCache};
|
|
@@ -58,4 +58,11 @@ export declare const CONSENT_BUTTONS: {
|
|
|
58
58
|
readonly privacyChoices: "Privacy choices";
|
|
59
59
|
readonly privacyPolicy: "Privacy Policy";
|
|
60
60
|
readonly alwaysOn: "Always on";
|
|
61
|
+
readonly close: "Close";
|
|
62
|
+
readonly cookieSettings: "Cookie settings";
|
|
63
|
+
};
|
|
64
|
+
export declare const NO_TRACKING_PANEL: {
|
|
65
|
+
readonly eyebrow: "Cookie settings";
|
|
66
|
+
readonly body: "This site uses only the cookies it needs to work, such as your cart and your login. It runs no advertising or analytics cookies, so there is nothing to switch off.";
|
|
67
|
+
readonly bodyNoSale: "This site uses only the cookies it needs to work, such as remembering your choices. It runs no advertising or analytics cookies, so there is nothing to switch off.";
|
|
61
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const m=1,s="Ads on. Shopper can opt out.",i="Ads and analytics off until Accept",r={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:s,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:i,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}},
|
|
1
|
+
const m=1,s="Ads on. Shopper can opt out.",i="Ads and analytics off until Accept",r={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:s,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:i,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}},k="Honoured: ads off",l=new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"]),c={US:"us",PR:"us",GU:"us",VI:"us",AS:"us",MP:"us",CA:"ca",AU:"au",NZ:"nz",GB:"uk"};function u(o){const e=(o??"").trim().toUpperCase();return e?Object.hasOwn(c,e)?c[e]:l.has(e)?"eu":"other":"other"}const h=new Set(["Pacific/Honolulu","Pacific/Guam","Pacific/Saipan","Pacific/Pago_Pago","America/Puerto_Rico","America/St_Thomas"]),d=new Set(["New_York","Chicago","Denver","Los_Angeles","Phoenix","Anchorage","Adak","Boise","Detroit","Juneau","Sitka","Metlakatla","Yakutat","Nome","Menominee","Indianapolis","Louisville","Fort_Wayne","Knox_IN"]),f=new Set(["Toronto","Vancouver","Edmonton","Winnipeg","Halifax","St_Johns","Regina","Montreal","Moncton","Glace_Bay","Goose_Bay","Iqaluit","Whitehorse","Dawson","Dawson_Creek","Fort_Nelson","Creston","Cambridge_Bay","Inuvik","Rankin_Inlet","Resolute","Swift_Current","Atikokan","Blanc-Sablon","Nipigon","Thunder_Bay","Rainy_River","Pangnirtung","Yellowknife","Coral_Harbour"]);function y(o){const e=(o??"").trim();if(!e)return"other";if(e==="Europe/London"||e==="Europe/Belfast"||e==="GB"||e==="GB-Eire"||e==="Europe/Guernsey"||e==="Europe/Jersey"||e==="Europe/Isle_of_Man")return"uk";if(e.startsWith("Europe/")||e==="Atlantic/Canary"||e==="Atlantic/Madeira"||e==="Atlantic/Azores"||e==="Atlantic/Reykjavik"||e==="Atlantic/Faroe")return"eu";if(e.startsWith("Australia/")||e==="Antarctica/Macquarie")return"au";if(e==="Pacific/Auckland"||e==="Pacific/Chatham"||e==="NZ"||e==="NZ-CHAT")return"nz";if(e.startsWith("US/")||h.has(e))return"us";if(e.startsWith("Canada/"))return"ca";if(e.startsWith("America/")){const n=e.slice(8),t=n.split("/")[0];if(t==="Indiana"||t==="Kentucky"||t==="North_Dakota"||d.has(n))return"us";if(f.has(n))return"ca"}return"other"}function p(o,e){const n=y(o);if(!e)return n;const t=u(e);return r[n].model==="opt-in"?n:(r[t].model==="opt-in",t)}function C(o){const e=new Set,n=[];for(const t of o){const a=u(t);a==="other"||e.has(a)||(e.add(a),n.push(r[a]))}return n.push(r.other),n}function g(o){const e=[...o.googleAds?["Google"]:[],...o.meta?["Facebook","Instagram"]:[]];return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function w(o,e,n){const t=g(n),a=t?`We use cookies to count visits and to show you ${e} ads on ${t}.`:"We use cookies to count visits.";return o.model==="opt-in"?{heading:t?"Cookies and ads":"Cookies",before:`${a} Nothing loads until you choose. You can change this at any time with `,link:o.footerLink,after:" at the bottom of every page."}:{heading:t?"Cookies and ads":"Cookies",before:`${a} You can say no at any time: choose Privacy choices, or use `,link:o.footerLink,after:" at the bottom of every page."}}const A={necessary:{name:"Necessary",body:"Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.",bodyNoSale:"What the site needs to work, such as remembering this choice. The site cannot work without them."},analytics:{name:"Analytics",body:"Counts visits and pages so we can improve the site. Google Analytics and our own visit count."},ads:{body:"Google Ads and Meta (Facebook, Instagram) tags, and the order details we send to them to measure our ads.",bodyNoSale:"Google Ads and Meta (Facebook, Instagram) tags, which measure our ads."}},E={title:"Opt-out request honoured",body:"Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads."},P={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on",close:"Close",cookieSettings:"Cookie settings"},N={eyebrow:"Cookie settings",body:"This site uses only the cookies it needs to work, such as your cart and your login. It runs no advertising or analytics cookies, so there is nothing to switch off.",bodyNoSale:"This site uses only the cookies it needs to work, such as remembering your choices. It runs no advertising or analytics cookies, so there is nothing to switch off."};export{P as CONSENT_BUTTONS,k as CONSENT_GPC_RULE,r as CONSENT_RULES,m as CONSENT_RULES_VERSION,E as GPC_HONOURED,N as NO_TRACKING_PANEL,A as PANEL_ROWS,g as adPlaces,w as bannerWords,u as regionOfCountry,y as regionOfTimeZone,C as rulesForCountries,p as visitorRegion};
|
|
@@ -7,7 +7,3 @@ export declare const COLLECTIONS_ROOM_BELOW: {
|
|
|
7
7
|
readonly bottom: 120;
|
|
8
8
|
readonly bottomPhone: 70;
|
|
9
9
|
};
|
|
10
|
-
export declare const COLLECTIONS_ROOM_Y = "py-[120px]";
|
|
11
|
-
export declare const COLLECTIONS_ROOM_Y_PHONE = "max-view-wide:py-[70px]";
|
|
12
|
-
export declare const COLLECTIONS_ROOM_BOTTOM = "pb-[120px]";
|
|
13
|
-
export declare const COLLECTIONS_ROOM_BOTTOM_PHONE = "max-view-wide:pb-[70px]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{FRAME_120 as o,FRAME_PHONE_PX as O}from"../sections/band-padding.js";const r=104,E="group-hover:scale-[1.04]",L=40,_=30,C="[background:rgba(0,0,0,0.4)] group-hover:[background:rgba(0,0,0,0.3)]",e={bottom:o.bottom,bottomPhone:O};export{e as COLLECTIONS_ROOM_BELOW,L as COLLECTION_DARKEN,_ as COLLECTION_HOVER_DARKEN,r as COLLECTION_HOVER_ZOOM,E as COLLECTION_HOVER_ZOOM_CLASS,C as COLLECTION_WASH_CLASS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_SWATCH_PROP as c}from"efficient-web-builder/format/lib/content/box-background";import{BOX_ROW_IMAGE_PROP as C}from"efficient-web-builder/format/lib/content/box-card-rule";import{BOX_HIDE_WHEN_ROW_EMPTY as l}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as r}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as f}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as
|
|
1
|
+
import{BOX_SWATCH_PROP as c}from"efficient-web-builder/format/lib/content/box-background";import{BOX_ROW_IMAGE_PROP as C}from"efficient-web-builder/format/lib/content/box-card-rule";import{BOX_HIDE_WHEN_ROW_EMPTY as l}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as r}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as f}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as E,DIM as R,INNER_BOX as d,TEXT as m,boxPadding as i,seedNodes as y}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as p,squareBox as T}from"./square-box.js";import{ALLOY_WHEELS_LISTING_TYPE as O}from"../document/document-nodes.js";const x="facetTemplate",H="Filter option template",G=[{key:"facetLabel",label:"Filter option"},{key:"facetName",label:"Type name"},{key:"facetCount",label:"Option count"},{key:"facetColour",label:"Option colour",kind:"colour"},{key:"facetTickFill",label:"Tick box fill",kind:"colour"},{key:"facetTick",label:"Tick mark",kind:"image"},{key:"facetTickMark",label:"Tick box shown"},{key:"facetRadioMark",label:"Round mark shown"},{key:"facetDot",label:"Round mark dot",kind:"colour"}],L="sf-facet-tick-picture",v="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%271%200.75%2014%2014%27%20id%3D%27"+L+"%27%3E%3Cpath%20d%3D%27M3.2%208%206.4%2011.2%2012.8%203.2%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.56%27%2F%3E%3C%2Fsvg%3E",Y="--sf-facet-tick",U="[&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-image:none]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-color:var(--accent-ink)]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[-webkit-mask:var(--sf-facet-tick)_center/cover_no-repeat] [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[mask:var(--sf-facet-tick)_center/cover_no-repeat]";function $(e,n){return{facetLabel:e.label,facetName:"",facetCount:String(e.count),facetColour:e.swatch??"",facetTickFill:n?"main":"",facetTick:n?v:"",facetTickMark:"tick",facetRadioMark:"",facetDot:""}}function j(e,n){return{facetLabel:"",facetName:e.label,facetCount:String(e.count),facetColour:"",facetTickFill:n?"main":"",facetTick:"",facetTickMark:"",facetRadioMark:"radio",facetDot:n?"main":""}}const q=["Text","ImageBlock",t],h={...E,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},k=13,s=10,w=2,_=1,o="2026-12-18",a="storefront sections owner",V=[{part:"facetLabel",kind:"size",value:k,reason:"The old rail's option words were 13 px; kept so no facet word moves.",owner:a,due:o},{part:"facetName",kind:"size",value:k,reason:"A type's name takes the facet words' 13 px, so the type picker has the same rail look.",owner:a,due:o},{part:"Option",kind:"gap",value:s,reason:"The old rail's 10 px between the option and its count; kept so no word moves.",owner:a,due:o},{part:"Choice",kind:"gap",value:s,reason:"The old rail's 10 px between tick box, dot and words; kept so no word moves.",owner:a,due:o},{part:"Tick box",kind:"padding",value:1,reason:"The 1 px ring round the tick box, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio",kind:"padding",value:1,reason:"The 1 px ring round the round mark, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio ground",kind:"padding",value:3,reason:"The 3 px between the round mark's ring and its 8 px dot, as the browser's own radio.",owner:a,due:o},{part:"Tick",kind:"box",value:14,reason:"The tick box's ground inside its 1 px ring: 16 px less the ring each side, the browser's own checkbox size.",owner:a,due:o},{part:"Radio ground",kind:"box",value:14,reason:"The round mark's ground inside its 1 px ring: 16 px less the ring each side, the browser's own radio size.",owner:a,due:o},{part:"Ring",kind:"box",value:13,reason:"The colour dot's 1 px ring as the old rail drew it (13 px round); kept so no swatch or word moves.",owner:a,due:o},{part:"Colour",kind:"box",value:11,reason:"The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.",owner:a,due:o},{part:"Tick box",kind:"corner",value:w,reason:"The browser's own checkbox corners (2 px on 16 px), below the shell's smallest corner step (--radius-sm 4 px); kept so the tick box keeps the rail's look.",owner:a,due:o},{part:"Tick",kind:"corner",value:_,reason:"The tick box's ground inside its 1 px ring follows the box's 2 px corners (2 - 1).",owner:a,due:o},{part:"aside",kind:"padding",value:22,reason:"The rail box's right padding at lg (PlpSidebar lg:pr-[22px]): 12 px room for the picked frame plus main's 10 px scrollbar room, so the content stays main's 258 px wide.",owner:a,due:o}],A={size:k,case:"capitalize",lineHeight:1.5},F={size:k,case:"none",lineHeight:1.5},N={textStyle:"body-5",size:11,case:"none",letterSpacing:0,lineHeight:1.5},g="muted",b="surface",P=()=>({type:t,props:{...h,name:"Option",justify:"between",gap:s,gapPhone:s,...i(4,12)},slots:{[r]:[{type:t,props:{...h,name:"Choice",gap:s,gapPhone:s,minWidth:0},slots:{[r]:[{type:t,props:{...d,name:"Tick mark",[l]:["facetTickMark"]},slots:{[r]:[{type:t,props:{...T(16,{sectionCorners:w,fillColor:g,[c]:"facetTickFill",...i(1,1)}),name:"Tick box"},slots:{[r]:[{type:t,props:{...T(14,{sectionCorners:_,fillColor:b,[c]:"facetTickFill",[C]:"facetTick",...i(0,0)}),name:"Tick"}}]}}]}},{type:t,props:{...d,name:"Round mark",[l]:["facetRadioMark"]},slots:{[r]:[{type:t,props:{...p(16,{fillColor:g,[c]:"facetTickFill",...i(1,1)}),name:"Radio"},slots:{[r]:[{type:t,props:{...p(14,{fillColor:b,...i(3,3)}),name:"Radio ground"},slots:{[r]:[{type:t,props:{...p(8,{[c]:"facetDot",...i(0,0)}),name:"Dot"}}]}}]}}]}},{type:t,props:{...d,name:"Swatch",[l]:["facetColour"]},slots:{[r]:[{type:t,props:{...p(13,{sectionBorder:{width:1}}),name:"Ring"},slots:{[r]:[{type:t,props:{...p(11,{[c]:"facetColour"}),name:"Colour"}}]}}]}},{type:t,props:{...d,name:"Label",[l]:["facetLabel"]},slots:{[r]:[f("facetLabel",{...m,tag:"span",minWidth:0},A)]}},{type:t,props:{...d,name:"Name",[l]:["facetName"]},slots:{[r]:[f("facetName",{...m,tag:"span",minWidth:0},F)]}}]}},f("facetCount",{...R,tag:"span"},N)]}});function S(e){return y([P()],(n,u)=>u==="0"?`${e}~facet`:`${e}~facet.${u.slice(2)}`)}function J(e){if(e[x]!==void 0)return e;const n=typeof e.id=="string"&&e.id.trim()?e.id:O;return{...e,[x]:S(n)}}export{G as FACET_ROW_FIELDS,q as FACET_TEMPLATE_ALLOW,H as FACET_TEMPLATE_LABEL,x as FACET_TEMPLATE_SLOT,v as FACET_TICK,U as FACET_TICK_INK_CLASS,L as FACET_TICK_MARK,Y as FACET_TICK_VAR,V as NAMED_EXCEPTIONS,h as ONE_ROW,$ as facetRow,S as facetRowSeed,j as typeRow,J as withFacetTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_TYPE as s,CONTAINER_BLOCKS_SLOT as u}from"efficient-web-builder/format/lib/document/container-blocks";import{DIM as D,INNER_BOX as l,boxPadding as C,seedNodes as
|
|
1
|
+
import{BOX_TYPE as s,CONTAINER_BLOCKS_SLOT as u}from"efficient-web-builder/format/lib/document/container-blocks";import{DIM as D,INNER_BOX as l,boxPadding as C,seedNodes as m,token as E}from"efficient-web-builder/format/lib/document/seed-parts";import{CARD_ROW_FIELD_PROP as S}from"efficient-web-builder/format/lib/content/card-template";import{CARDS_BODY_LOOK as x}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{THEME_CARD_IMAGE_BG as I,resolveBoundCardImageBackground as L}from"efficient-web-builder/format/lib/content/card-image-background";import{SHARED_ROWS_KEY as k}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GRID_CARD_SHOW as w,LISTING_CARD_SHOW as b}from"../sections/card-show-defaults.js";import{ALLOY_WHEELS_LISTING_TYPE as K}from"../document/document-nodes.js";const _="ProductPicture",y="ProductSpecs",P="ProductBuy",g="ProductPrice",f="ProductColour",A="ProductSize",R="ProductEyebrow",p="ProductName",Q=[_,R,p,y,g,f,A,P],ee=[{key:"name",label:"Name"},{key:"eyebrow",label:"Eyebrow"},{key:"note",label:"Note"},{key:"href",label:"Product page",kind:"link"},{key:"colour",label:"Product colour",kind:"colour"},{key:"colourVaried",label:"Product colour, varied",kind:"colour"},{key:"colourRandom",label:"Random colour",kind:"colour"}],N={...l,gap:0,gapPhone:0,...C(32,32,32,32),[k]:"shared"},h=(e,t="ProductGrid")=>typeof e.id=="string"&&e.id.trim()?e.id:t,a=(e,t)=>typeof e=="boolean"?e:t,U={type:"Text",props:{...D,tag:"p",text:"",[S]:"note",_partStyles:{text:{...x,...E("body",14),lineHeight:1.375}}}};function H(e,t={}){const r=e.dynamic===!0,o={},i=r?t.legacyWellHonoured?e.imageBackground??I:L(e.imageBackground):e.imageBackground;i!==void 0&&(o.imageBackground=i);for(const d of["cardImage","coverIndex","indexBadge","showBadge"])e[d]!==void 0&&(o[d]=e[d]);const c=t.showRest??w,n={price:a(e.showCardPrice,!0),finishes:a(e.showCardFinishes,!0),sizes:a(e.showCardSizes,c.showCardSizes),buy:a(e.showCardBuy,c.showCardBuy),page:a(e.showCardPage,c.showCardPage)},O={...N,name:"Card"};e.outline==="hairline"&&(O.sectionBorder={width:1,style:"solid"});const T=[{type:_,props:o},{type:R},{type:p},{type:y,props:{sizes:n.sizes}},...n.price?[{type:g}]:[],...n.finishes?[{type:f}]:[],...n.buy||n.page?[{type:P,props:{buy:n.buy,page:n.page}}]:[]];return{type:s,props:O,slots:{[u]:T}}}const G={...l,gap:0,gapPhone:0,...C(0,0,0,0)},Y={...l,gap:8,gapPhone:8,...C(16,20,16,20)},z={role:"heading",size:18,weight:500,case:"none",letterSpacing:-.015,lineHeight:1.2},B=24;function W(e){const t={frame:"full"};for(const o of["cardImage","showBadge"])e[o]!==void 0&&(t[o]=e[o]);const r={type:s,props:{...Y,name:"Copy"},slots:{[u]:[{type:p,props:{fixedHeight:!1,_partStyles:{"@name":z}}},U,{type:g}]}};return{type:s,props:{...G,name:"Card"},slots:{[u]:[{type:_,props:t},r]}}}function te(e){if(e.template!==void 0)return e;const t=h(e);return{...e,gap:e.gap??B,gapPhone:e.gapPhone??B,template:m([W(e)],(r,o)=>`${t}~card-${o}-${r}`)}}function X(e,t={}){const r=h(e,t.section);return m([H(e,t)],(o,i)=>`${r}~card-${i}-${o}`)}function oe(e){return $(e,{showRest:b,section:K})}function $(e,t={}){return e.template!==void 0?e:{...e,template:X(e,t)}}export{P as PRODUCT_BUY_BLOCK,ee as PRODUCT_CARD_FIELDS,Q as PRODUCT_CARD_SLOT_BLOCKS,f as PRODUCT_COLOUR_BLOCK,R as PRODUCT_EYEBROW_BLOCK,p as PRODUCT_NAME_BLOCK,_ as PRODUCT_PICTURE_BLOCK,g as PRODUCT_PRICE_BLOCK,A as PRODUCT_SIZE_BLOCK,y as PRODUCT_SPECS_BLOCK,W as kitCardSeed,H as productCardSeed,X as productCardTemplate,te as withKitCardTemplate,oe as withListingCardTemplate,$ as withProductCardTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HOST_PART_TYPE as
|
|
1
|
+
import{HOST_PART_TYPE as c}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as r,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as m}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{INNER_BOX as a,LABEL_FACE as O,TEXT as p,boxPadding as l,seedNodes as L}from"efficient-web-builder/format/lib/document/seed-parts";import{say as P}from"efficient-web-builder/format/lib/editor-words";import{FACET_TEMPLATE_ALLOW as R,ONE_ROW as u}from"./facet-row-seed.js";import{ALLOY_WHEELS_LISTING_TYPE as f}from"../document/document-nodes.js";const _="railTemplate",W="Filter group template",d="railHeadTemplate",$="Filter head template",s="railGroup",Y=[{key:s,label:"Filter group"}],g="options",S="end",b=R,x={...O,size:11,letterSpacing:.2,lineHeight:1.5},I={fontRole:"heading",size:18,weight:500,case:"upper",letterSpacing:-.01,lineHeight:1.5},T=(t,e)=>({type:c,props:{name:t,label:e}}),h=()=>({type:r,props:{...a,name:"Group",gap:0,startsOpen:!0},slots:{rowTitle:[m(s,{...p,tag:"span"},x)],[i]:[{type:r,props:{...a,name:"Options",...l(0,0),sectionPaddingBottom:12,sectionPaddingBottomPhone:12},slots:{[i]:[T(g,"Filter options")]}}]}}),y=()=>({type:r,props:{...u,name:"Head",justify:"between",...l(0,0),sectionPaddingBottom:8,sectionPaddingBottomPhone:8},slots:{[i]:[{type:"Text",props:{...p,tag:"h2",text:P("Filter"),_partStyles:{text:I}}},T(S,"Clear all")]}}),E=(t,e)=>{let o=0;return(n,A)=>A==="0"?`${t}~${e}`:`${t}~${e}.${o++}`};function H(t){return L([h()],E(t,"rail"))}function B(t){return L([y()],E(t,"railhead"))}function K(t){const e=t[_]===void 0,o=t[d]===void 0;if(!e&&!o)return t;const n=typeof t.id=="string"&&t.id.trim()?t.id:f;return{...t,...e?{[_]:H(n)}:{},...o?{[d]:B(n)}:{}}}const X=t=>({[s]:t});export{S as RAIL_END_PART,s as RAIL_GROUP_FIELD,$ as RAIL_HEAD_TEMPLATE_LABEL,d as RAIL_HEAD_TEMPLATE_SLOT,g as RAIL_OPTIONS_PART,Y as RAIL_ROW_FIELDS,b as RAIL_TEMPLATE_ALLOW,W as RAIL_TEMPLATE_LABEL,_ as RAIL_TEMPLATE_SLOT,X as railRow,K as withRailTemplates};
|
|
@@ -51,6 +51,10 @@ export interface SiteIdentity {
|
|
|
51
51
|
consentEnabled: boolean;
|
|
52
52
|
consentPrivacyPage: string | null;
|
|
53
53
|
consentNoticeOptOut: boolean;
|
|
54
|
+
privacyPage: string | null;
|
|
55
|
+
termsPage: string | null;
|
|
56
|
+
footerCookieSettings: boolean;
|
|
57
|
+
footerSitemap: boolean;
|
|
54
58
|
socialLinks: SocialLinks;
|
|
55
59
|
}
|
|
56
60
|
export declare const NEUTRAL_SITE_IDENTITY: SiteIdentity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cache as s}from"react";import{products as i}from"../api/index.js";import{cachedChrome as c}from"../chrome-cache.js";import{loadChrome as d}from"../chrome-load.js";import{NEUTRAL_SITE_NAME as a,resolveSiteName as t}from"efficient-web-builder/format/lib/content/site-name";import{EMPTY_SOCIAL_LINKS as o,normalizeSocialLinks as m}from"efficient-web-builder/format/lib/content/social-links";function p(e,n){return e?.trim()||n}function
|
|
1
|
+
import{cache as s}from"react";import{products as i}from"../api/index.js";import{cachedChrome as c}from"../chrome-cache.js";import{loadChrome as d}from"../chrome-load.js";import{NEUTRAL_SITE_NAME as a,resolveSiteName as t}from"efficient-web-builder/format/lib/content/site-name";import{EMPTY_SOCIAL_LINKS as o,normalizeSocialLinks as m}from"efficient-web-builder/format/lib/content/social-links";function p(e,n){return e?.trim()||n}function N({legalName:e,foundedYear:n,siteName:r},l=new Date().getFullYear()){const u=p(e,r);return`© ${n&&n<l?`${n}–${l}`:`${l}`} ${u}`}const g={name:a,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:o},y=s(async()=>c("site",()=>d("site",async()=>{const e=await i.getSite();return{name:t(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,privacyPage:e.privacyPage??null,termsPage:e.termsPage??null,footerCookieSettings:e.footerCookieSettings??!0,footerSitemap:e.footerSitemap??!0,socialLinks:m(e.socialLinks)}},g))),f=async()=>(await y()).value,A=async()=>(await f()).name,x={name:a,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,privacyPage:null,termsPage:null,footerCookieSettings:!0,footerSitemap:!0,socialLinks:o};export{g as NEUTRAL_SITE_IDENTITY,a as NEUTRAL_SITE_NAME,x as PREVIEW_SITE_IDENTITY,f as loadSiteIdentity,y as loadSiteIdentityResult,A as loadSiteName,N as resolveCopyright,p as resolveCopyrightName,t as resolveSiteName};
|
|
@@ -14,5 +14,7 @@ export declare const TAB_PILLS: {
|
|
|
14
14
|
readonly list: "flex flex-wrap gap-2 px-1 pb-1 max-view-wide:min-w-max max-view-wide:flex-nowrap";
|
|
15
15
|
readonly tab: (current: boolean) => string;
|
|
16
16
|
};
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function menuLayoutOf(direction: unknown): "row" | "column";
|
|
18
|
+
export declare function marksCurrentLink(layout: "row" | "column" | undefined, currentPage: unknown): boolean;
|
|
19
|
+
export declare function currentLinkIndex(hrefs: readonly string[], pagePath: string | null | undefined, pageQuery: string): number;
|
|
18
20
|
export declare function showCurrentTab(strip: HTMLElement | null, behavior: ScrollBehavior): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizePath as
|
|
1
|
+
import{normalizePath as s}from"efficient-web-builder/format/lib/popup/rules";import{menuLinkKind as u}from"../menu-link.js";import{linkParts as b}from"../links/link-rules.js";import{plpFilterQuery as m}from"../wheels/plp-filters.js";const d="[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",w="text-[length:var(--size-label,13px)]",g={rowLink:"relative opacity-100",row:"pointer-events-none absolute inset-x-0 -bottom-2 h-[2px] bg-accent",tab:"absolute inset-x-0 -bottom-px h-[2px] bg-accent"},y={list:`m-0 flex list-none items-stretch gap-0 overflow-auto p-0 ${d}`,item:(e,t)=>[`relative isolate flex whitespace-nowrap border-r border-line px-[26px] py-[18px] font-mono ${w} uppercase tracking-[0.22em]`,e?"border-l border-line":"",t?"":"[&_*]:pointer-events-none [&_a]:pointer-events-auto"].join(" "),tab:e=>["block transition-colors after:absolute after:inset-0 after:-z-1",e?"text-fg":"text-fg-dim hover:text-fg"].join(" "),underline:g.tab},E={nav:"-mx-1 [scrollbar-width:none] max-view-wide:overflow-x-auto [&::-webkit-scrollbar]:hidden",list:"flex flex-wrap gap-2 px-1 pb-1 max-view-wide:min-w-max max-view-wide:flex-nowrap",tab:e=>`flex flex-col gap-0.5 rounded-[var(--sf-button-radius,999px)] border px-5 py-2.5 transition-colors ${e?"border-accent bg-accent text-accent-ink":"border-line text-fg hover:border-accent hover:text-accent"}`};function C(e){return e==="row"?"row":"column"}function R(e,t){return e==="row"&&t===!0}function f(e){return[...new URLSearchParams(m(e))].map(([t,r])=>`${t}=${r}`)}function S(e,t,r){if(!t)return-1;const n=s(t),o=new Set(f(r));let i=-1,c=-1;return e.forEach((l,p)=>{if(u(l)!=="page"||s(l)!==n)return;const a=f(b(l).query);a.every(x=>o.has(x))&&a.length>c&&(i=p,c=a.length)}),i}function _(e,t){let r=e?.querySelector('[aria-current="page"]')??null;if(!e||!r)return;for(;r.parentElement&&r.parentElement!==e;)r=r.parentElement;const n=e.getBoundingClientRect(),o=r.getBoundingClientRect(),i=o.left<n.left?o.left-n.left:o.right>n.right?Math.min(o.right-n.right,o.left-n.left):0;i!==0&&e.scrollBy({left:i,behavior:t})}export{g as CURRENT_LINE,y as TAB_CELLS,E as TAB_PILLS,S as currentLinkIndex,R as marksCurrentLink,C as menuLayoutOf,_ as showCurrentTab};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{PAGE_TITLE_LEVEL_PROP as m}from"efficient-web-builder/format/lib/document/one-h1";import l from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as f,listingHiddenFacets as L}from"../../../../wheels/plp-filters.js";import{addressQueryOf as g}from"../../../../wheels/selected-ranges.js";import{cardHoverOf as T}from"efficient-web-builder/format/lib/animation/hover";import{phHide as d}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as h}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as E}from"../../../../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_SLOT as c,RAIL_TEMPLATE_SLOT as _}from"../../../../content/rail-row-seed.js";import{AlloyWheelsListingMeta as s,ALLOYWHEELSLISTING_PH as n}from"./meta.js";import{ALLOY_WHEELS_LISTING_TYPE as A}from"../../../document-nodes.js";const R={...s,render:e=>{const t=h(e),i=o=>t?void 0:o;return r(l,{titleLevel:e[m],heading:i(d(e.heading,n.heading,e.editor)),intro:i(d(e.intro,n.intro,e.editor)),omitHead:t,askForCar:e.askForCar!==!1,addressQuery:g(e)||void 0,gateHeading:a(e.gateHeading),gateIntro:a(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:f(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[E],railTemplate:e[_],railHeadTemplate:e[c],hover:T(e,A),hiddenFacets:L(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}};export{R as AlloyWheelsListingRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as g,jsx as
|
|
1
|
+
import{Fragment as g,jsx as a}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import k,{SourcedGalleryGrid as P}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import y from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as w,productPictureTiles as T,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{hidableText as d}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as r}from"../../../../sections/band-padding.js";import{GalleryBMeta as B,GALLERY_B_PH as l}from"./meta.js";const j={...B,render:e=>{const m=G(e.headPlacement)==="own-box",i=n=>m?void 0:n,c={num:i(t(e.num,l.num,e.editor)),title:i(t(e.title,l.title,e.editor)),omitHead:m,linkText:i(t(e.linkText,l.link,e.editor)),linkHref:i(d(e.linkHref)||"/contact"),galleryHref:d(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],pads:r(e),editing:e.editor?.isEditing},u=h(e);if(u===w){const n=!!e.editor?.isEditing,o=T(e,n,e.limit);return!n&&o.length===0?a(g,{}):a(y,{...c,layout:v(e),sourced:o})}if(u!==""){const n=!!e.editor?.isEditing,{rows:o,sample:f}=x(e,n);return a(P,{num:i(t(e.num,l.num,e.editor)),title:i(t(e.title,l.title,e.editor)),linkText:i(t(e.linkText,l.link,e.editor)),linkHref:i(d(e.linkHref)||"/contact"),omitHead:m,rows:f?[]:o,limit:e.limit,layout:e.layout,editing:n,pads:r(e)})}return e.dynamic?a(k,{num:i(t(e.num,l.num,e.editor)),title:i(t(e.title,l.title,e.editor)),linkText:i(t(e.linkText,l.link,e.editor)),linkHref:i(d(e.linkHref)||"/contact"),omitHead:m,galleryHref:d(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:r(e)}):a(y,{...c,items:e.items})}};export{j as GalleryBRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{gridLimitOf as H}from"../../../../sections/product-grid-pages.js";import{FIRST_COUNT_IN_CHIPS_PROP as b}from"../../../../wheels/shopper-first-paint.js";import{phoneKey as o,tabletKey as P}from"efficient-easel/draw";import C from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as s}from"../../../../catalog/relationships.js";import{resolveWidth as y}from"efficient-web-builder/format/lib/content/section-width";import R from"../../../../../components/ProductGridSection.js";import{relatedCardCount as _}from"../../../../catalog/related-cards.js";import{hidableText as k}from"efficient-easel/screen/lib/document/hidable";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{parseSectionHeadPlacement as T}from"efficient-web-builder/format/lib/sections/section-head-placement";import{PH as d}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as a}from"../placeholders.js";import{PRODUCT_GRID_TYPE as I}from"../../../document-nodes.js";import{parseMoreProducts as O}from"../../../../sections/product-grid-pages.js";import{ProductGridMeta as S}from"./meta.js";import{bandPadProps as D}from"../../../../sections/band-padding.js";const Z={...S,render:e=>{const l=typeof e.id=="string"?e.id:"",c=e.template;if(e.dynamic){const n=T(e.headPlacement)==="own-box",m=x=>n?void 0:x;return g(C,{num:m(t(e.num,a.num,e.editor)),title:m(t(e.title,d.sectionHeading,e.editor)),description:m(t(e.description,d.body,e.editor)),omitHead:n,columns:typeof e.columns=="number"?e.columns:3,columnsPhone:e[o("columns")],columnsTablet:e[P("columns")],gap:e.gap,gapPhone:e[o("gap")],cardCount:_(e.limit),relationship:typeof e.relationship=="string"?e.relationship:s,hover:h(e,I),ownerId:l,template:c,cardImage:e.cardImage,outline:e.outline,indexBadge:e.indexBadge,editing:e.editor?.isEditing})}const r=t(e.linkText,a.link,e.editor),u=e.source,w=y(e,"full"),f=T(e.headPlacement)==="own-box",i=n=>f?void 0:n;return g(R,{gap:e.gap,gapPhone:e[o("gap")],contentCapped:w.mode==="page",num:i(t(e.num,a.num,e.editor)),title:i(t(e.title,d.sectionHeading,e.editor)),titleSize:e.titleSize,noTop:f,pads:D(e),description:i(t(e.description,d.body,e.editor)),link:i(r?{text:r,href:k(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:u?.slug?u:void 0,catalog:e.catalog,catalogTotal:e.catalogTotal,firstCountInChips:e[b]===!0,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,columnsPhone:e[o("columns")],columnsTablet:e[P("columns")],limit:H({limit:e.limit,showAll:e.showAll}),moreProducts:O(e.moreProducts),perPage:e.perPage,editing:e.editor?.isEditing,hover:h(e,I),ownerId:l,template:c})}};export{Z as ProductGridRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as D}from"react/jsx-runtime";import{subscribeContentTypeOf as _}from"../../../subscribe-content-type.js";import j from"../../../../../components/Subscribe.js";import{hidableText as r}from"efficient-easel/screen/lib/document/hidable";import{NEWSLETTER_SOURCE as y}from"../../../../newsletter-signup.js";import{phHide as t}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{SUBSCRIBE_PH as e,subscribeRailRows as O}from"../subscribe.js";import{parseSectionHeadPlacement as U}from"efficient-web-builder/format/lib/sections/section-head-placement";import{SubscribeMeta as I}from"./meta.js";const Q={...I,render:n=>{const{headNum:o,headTitle:l,headDesc:c,kicker:d,leadTitle:m,intro:b,emailPlaceholder:h,submitText:T,subscribedText:u,finePrint:x,issuesHeading:f,issues:g,contentType:p,posts:P,limit:H,archiveText:S,archiveHref:k,align:v,alignTablet:A,alignPhone:E,textAlign:R,textAlignTablet:N,textAlignPhone:w,panel:B,editor:i}=n,s=U(n.headPlacement)==="own-box",a=C=>s?void 0:C;return D(j,{headNum:a(t(o,e.headNum,i)),headTitle:a(t(l,e.headTitle,i)),headDesc:a(t(c,e.headDesc,i)),omitHead:s,kicker:t(d,e.kicker,i),leadTitle:t(m,e.leadTitle,i),intro:t(b,e.intro,i),emailPlaceholder:r(h)||e.emailPlaceholder,submitText:r(T)||e.submitText,subscribedText:r(u)||e.subscribedText,finePrint:t(x,e.finePrint,i),issuesHeading:t(f,e.issuesHeading,i),issues:O(_(p),{issues:g,posts:P,limit:H,editor:i}),source:y.subscribeSection,editing:i?.isEditing,archiveText:t(S,e.archiveText,i),archiveHref:r(k)||e.archiveHref,align:v,alignTablet:A,alignPhone:E,textAlign:R,textAlignTablet:N,textAlignPhone:w,panel:B!==!1})}};export{Q as SubscribeRender};
|