efficient-storefront-blocks 0.86.0 → 0.87.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/chunks/{EditorPreviewCheckout-4LNXFNN7.js → EditorPreviewCheckout-GD4IJ4WK.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-A2HMVDKS.js → SiteEditorProvider-2UVCJZXS.js} +1 -1
  4. package/dist/chunks/{chunk-TGBNREUJ.js → chunk-H4IHUSCU.js} +1 -1
  5. package/dist/chunks/chunk-QLR6IVWJ.js +369 -0
  6. package/dist/chunks/chunk-SYK5QPNV.js +1 -0
  7. package/dist/chunks/{chunk-SLRULFYY.js → chunk-XZ46W3NV.js} +1 -1
  8. package/dist/chunks/{fitment-data-TSYW6AFA.js → fitment-data-5GBUMO2O.js} +1 -1
  9. package/dist/contract.js +20 -2
  10. package/dist/editor/lib/document/blocks/commerce/ProductBuy/fields.d.ts +2 -0
  11. package/dist/editor/lib/document/blocks/commerce/ProductBuy/fields.js +1 -0
  12. package/dist/editor/lib/document/blocks/commerce/ProductEyebrow/fields.d.ts +2 -0
  13. package/dist/editor/lib/document/blocks/commerce/ProductEyebrow/fields.js +1 -0
  14. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/ProductName/fields.d.ts +2 -0
  16. package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.d.ts +2 -0
  18. package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -0
  19. package/dist/editor/lib/document/blocks/commerce/ProductSpecs/fields.d.ts +2 -0
  20. package/dist/editor/lib/document/blocks/commerce/ProductSpecs/fields.js +1 -0
  21. package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
  22. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  23. package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
  24. package/dist/editor/lib/document/config.js +1 -1
  25. package/dist/editor/lib/document/section-text-regions.js +1 -1
  26. package/dist/editor/lib/storefront-editor-words.d.ts +7 -8
  27. package/dist/editor/lib/storefront-editor-words.js +1 -1
  28. package/dist/fitment.js +1 -1
  29. package/dist/index.js +35 -35
  30. package/dist/links.js +1 -1
  31. package/dist/render/app/fonts/fallbacks.css +8 -0
  32. package/dist/render/app/fonts/jost/OFL.txt +93 -0
  33. package/dist/render/app/fonts/jost/cyrillic-italic.woff2 +0 -0
  34. package/dist/render/app/fonts/jost/cyrillic.woff2 +0 -0
  35. package/dist/render/app/fonts/jost/latin-ext-italic.woff2 +0 -0
  36. package/dist/render/app/fonts/jost/latin-ext.woff2 +0 -0
  37. package/dist/render/app/fonts/jost/latin-italic.woff2 +0 -0
  38. package/dist/render/app/fonts/jost/latin.woff2 +0 -0
  39. package/dist/render/app/globals.css +11 -11
  40. package/dist/render/built-with.json +1 -1
  41. package/dist/render/components/Events.js +1 -1
  42. package/dist/render/components/FitmentTable.d.ts +1 -1
  43. package/dist/render/components/FitmentTable.js +1 -1
  44. package/dist/render/components/FooterMenu.d.ts +5 -1
  45. package/dist/render/components/FooterMenu.js +1 -1
  46. package/dist/render/components/GridCardTemplate.d.ts +34 -0
  47. package/dist/render/components/GridCardTemplate.js +1 -0
  48. package/dist/render/components/MenuLinkBlock.d.ts +5 -1
  49. package/dist/render/components/MenuLinkBlock.js +1 -1
  50. package/dist/render/components/ProductCardChrome.d.ts +1 -1
  51. package/dist/render/components/ProductCardChrome.js +1 -1
  52. package/dist/render/components/ProductGridSection.d.ts +5 -15
  53. package/dist/render/components/ProductGridSection.js +1 -1
  54. package/dist/render/components/ProductRef.js +1 -1
  55. package/dist/render/components/StorefrontProviders.d.ts +1 -1
  56. package/dist/render/components/StorefrontProviders.js +1 -1
  57. package/dist/render/components/TyreCard.js +1 -1
  58. package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
  59. package/dist/render/components/TyreFitVerdicts.js +1 -1
  60. package/dist/render/components/TyrePlpCard.js +1 -1
  61. package/dist/render/components/card-pieces/CardEyebrow.d.ts +3 -1
  62. package/dist/render/components/card-pieces/CardEyebrow.js +1 -1
  63. package/dist/render/components/card-pieces/CardName.d.ts +3 -1
  64. package/dist/render/components/card-pieces/CardName.js +1 -1
  65. package/dist/render/components/card-pieces/CardPrice.d.ts +2 -6
  66. package/dist/render/components/card-pieces/CardPrice.js +1 -1
  67. package/dist/render/components/card-pieces/CardProductPicture.d.ts +8 -0
  68. package/dist/render/components/card-pieces/CardProductPicture.js +1 -0
  69. package/dist/render/components/card-pieces/card-text-region.d.ts +18 -0
  70. package/dist/render/components/card-pieces/card-text-region.js +1 -0
  71. package/dist/render/components/fitment/StockFitmentPart.d.ts +8 -1
  72. package/dist/render/components/fitment/StockFitmentPart.js +1 -1
  73. package/dist/render/components/fitment/fitment-answer-source.d.ts +12 -0
  74. package/dist/render/components/fitment/fitment-answer-source.js +1 -0
  75. package/dist/render/components/pdp-dynamic/DynamicFitmentTable.js +1 -1
  76. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.d.ts +10 -12
  77. package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
  78. package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
  79. package/dist/render/components/pdp-dynamic/DynamicTyreSizes.js +1 -1
  80. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  81. package/dist/render/components/wheels-plp/PlpCard.d.ts +1 -1
  82. package/dist/render/components/wheels-plp/PlpCard.js +1 -1
  83. package/dist/render/lib/content/field-usage.d.ts +1 -0
  84. package/dist/render/lib/content/field-usage.js +1 -1
  85. package/dist/render/lib/content/product-card-seed.d.ts +29 -0
  86. package/dist/render/lib/content/product-card-seed.js +1 -0
  87. package/dist/render/lib/content/tab-strip.d.ts +17 -0
  88. package/dist/render/lib/content/tab-strip.js +1 -0
  89. package/dist/render/lib/document/blocks/commerce/ProductBuy/meta.d.ts +2 -0
  90. package/dist/render/lib/document/blocks/commerce/ProductBuy/meta.js +1 -0
  91. package/dist/render/lib/document/blocks/commerce/ProductBuy/render.d.ts +2 -0
  92. package/dist/render/lib/document/blocks/commerce/ProductBuy/render.js +1 -0
  93. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/meta.d.ts +2 -0
  94. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/meta.js +1 -0
  95. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.d.ts +2 -0
  96. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -0
  97. package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.d.ts +4 -0
  98. package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
  99. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  100. package/dist/render/lib/document/blocks/commerce/ProductName/meta.d.ts +2 -0
  101. package/dist/render/lib/document/blocks/commerce/ProductName/meta.js +1 -0
  102. package/dist/render/lib/document/blocks/commerce/ProductName/render.d.ts +2 -0
  103. package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -0
  104. package/dist/render/lib/document/blocks/commerce/ProductPicture/meta.d.ts +2 -0
  105. package/dist/render/lib/document/blocks/commerce/ProductPicture/meta.js +1 -0
  106. package/dist/render/lib/document/blocks/commerce/ProductPicture/render.d.ts +2 -0
  107. package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -0
  108. package/dist/render/lib/document/blocks/commerce/ProductPrice/render.js +1 -1
  109. package/dist/render/lib/document/blocks/commerce/ProductSpecs/meta.d.ts +2 -0
  110. package/dist/render/lib/document/blocks/commerce/ProductSpecs/meta.js +1 -0
  111. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.d.ts +2 -0
  112. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -0
  113. package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.d.ts +0 -4
  114. package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
  115. package/dist/render/lib/document/blocks/commerce/RelatedProducts/render.js +1 -1
  116. package/dist/render/lib/document/blocks/commerce/StockFitment/meta.js +1 -1
  117. package/dist/render/lib/document/blocks/commerce/metas.d.ts +5 -0
  118. package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
  119. package/dist/render/lib/document/blocks/commerce/renders.d.ts +5 -0
  120. package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
  121. package/dist/render/lib/document/blocks/text-part-shapes.json +0 -16
  122. package/dist/render/lib/document/card-templates.js +1 -1
  123. package/dist/render/lib/document/footer-page-blocks.js +1 -1
  124. package/dist/render/lib/document/lazy-draws.js +1 -1
  125. package/dist/render/lib/font-table.json +209 -1
  126. package/dist/render/lib/menu-link.d.ts +2 -0
  127. package/dist/render/lib/menu-link.js +1 -1
  128. package/dist/render/lib/next-fonts.js +1 -1
  129. package/dist/render/lib/sections/grid-no-hole.d.ts +1 -0
  130. package/dist/render/lib/sections/grid-no-hole.js +1 -1
  131. package/dist/render/lib/sections/product-card-text-regions.d.ts +3 -0
  132. package/dist/render/lib/sections/product-card-text-regions.js +1 -0
  133. package/dist/render/lib/sections/product-grid-columns.d.ts +13 -1
  134. package/dist/render/lib/sections/product-grid-columns.js +1 -1
  135. package/dist/render/lib/sections/related-to-grid.d.ts +8 -0
  136. package/dist/render/lib/sections/related-to-grid.js +1 -0
  137. package/dist/render/lib/storefront-page-groups.d.ts +0 -4
  138. package/dist/render/lib/storefront-page-groups.js +1 -1
  139. package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +1 -0
  140. package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
  141. package/dist/render/lib/wheels/plp-filters.js +1 -1
  142. package/dist/words.d.ts +46 -9
  143. package/dist/words.js +6 -6
  144. package/package.json +2 -2
  145. package/dist/chunks/chunk-EUKK2IN6.js +0 -1
  146. package/dist/chunks/chunk-FJRKNPNN.js +0 -340
  147. /package/dist/chunks/{chunk-ALMIS7CK.js → chunk-DLWIDJS5.js} +0 -0
  148. /package/dist/chunks/{chunk-FJRKNPNN.js.LEGAL.txt → chunk-QLR6IVWJ.js.LEGAL.txt} +0 -0
@@ -1,8 +1,6 @@
1
- import { type CardImageBackground } from "efficient-web-builder/format/lib/content/card-image-background";
2
- import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
1
+ import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
3
2
  import type { SlotComponent } from "efficient-easel/blocks";
4
3
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
5
- import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
6
4
  import type { CategorySourceValue } from "../lib/content/source-values.js";
7
5
  import type { ProductSummary, WheelSummary } from "../lib/api/index.js";
8
6
  export declare const TITLE_SIZES: readonly [{
@@ -46,22 +44,14 @@ interface Props {
46
44
  kinds?: string[];
47
45
  columns?: number;
48
46
  columnsPhone?: unknown;
47
+ columnsTablet?: unknown;
49
48
  limit?: number;
50
49
  editing?: boolean;
51
50
  contentCapped?: boolean;
52
- imageBackground?: CardImageBackground;
53
- cardImage?: number | null;
54
51
  hover?: CardHoverDrawn;
55
- coverIndex?: number;
56
- indexBadge?: CardIndexFormat;
57
- outline?: CardOutline;
58
- showBadge?: boolean;
59
52
  fieldUsage?: readonly FieldUsageAnswer[];
60
- showCardPrice?: boolean;
61
- showCardFinishes?: boolean;
62
- showCardSizes?: boolean;
63
- showCardBuy?: boolean;
64
- showCardPage?: boolean;
53
+ ownerId?: string;
54
+ template?: SlotComponent;
65
55
  }
66
- export default function ProductGridSection({ num, catalog, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, limit, editing, contentCapped, imageBackground, hover, coverIndex, indexBadge, outline, showBadge, fieldUsage, showCardPrice, showCardFinishes, showCardSizes, showCardBuy, showCardPage, cardImage, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
56
+ export default function ProductGridSection({ num, catalog, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit, editing, contentCapped, hover, fieldUsage, ownerId, template, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
67
57
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as x,Fragment as De}from"react/jsx-runtime";import{GRID_CARD_SHOW as D}from"../lib/sections/card-show-defaults.js";import{useScopeClass as He}from"../lib/use-scope-class.js";import{useEffect as _,useMemo as p,useState as Ue}from"react";import{CARD_IMAGE_BG_OFF as je,resolveCardImageBackground as We}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as Xe}from"efficient-web-builder/format/lib/content/card-image-shape";import{containerGapProps as Ke,GAP_ZONE_CLASS as Ze}from"efficient-web-builder/format/lib/content/container-gap";import qe from"next/link";import Ve from"./ProductCard.js";import{CARD_ROWS_GRID_CLASS as Ye,cardRowsGap as Je,cardRowsGridStyle as Qe}from"./WheelCardFrame.js";import{ProductCardChromeProvider as er}from"./ProductCardChrome.js";import{gridClassImageSizes as rr}from"../lib/sections/card-image-sizes.js";import{fillRowCss as tr}from"../lib/sections/fill-row.js";import{noHoleBands as re,noHoleCss as te,showsASetCard as ne}from"../lib/sections/grid-no-hole.js";import{setIsWide as nr,summarySetBuild as sr}from"../lib/wheels/set-mode.js";import{answersForKind as se}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as or}from"./ProductCardEyebrow.js";import ar from"./NoCurrencyNote.js";import{DEFAULT_CARD_OUTLINE as ir,cardIndexCss as lr,parseCardIndexFormat as dr}from"efficient-web-builder/format/lib/sections/product-card-style";import{DEFAULT_COVER_INDEX as mr}from"../lib/wheels/cover-rendering.js";import{SITE_WIDTH_CAP as cr,centredCap as pr}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as ur,SectionWheelsProvider as gr}from"./ProductRef.js";import{useCurrency as hr}from"./CurrencyContext.js";import{COLLECTION_ATTR as fr,useCatalogFilter as xr}from"./catalog/CatalogFilterContext.js";import wr from"./SectionBand.js";import{useInsideBox as vr,useInsideSiteGutter as yr}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Cr}from"../lib/sections/product-grid-columns.js";import{renderGold as H,renderHeadline as br}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Sr}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as $r}from"../lib/wheels/wheel-summary-casing.js";import Mr from"./TyreSummaryCard.js";import{itemKind as U,plpKindNoun as Nr}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as _r,gridKindsOf as Er,gridRowsOf as Tr}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as zr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Ir}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Lr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Ar}from"../lib/wheels/lug-count.js";import{diametersOf as Br}from"../lib/wheels/size-range.js";import{say as Pr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Rr}from"../lib/sections/product-grid-title.js";const s={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},oe=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${s.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium1} ${s.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium2} ${s.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium3} ${s.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium4} ${s.headingMediumUpTo800Xl}`}];function Fr(w){return(oe.find(u=>u.value===w)??oe.find(u=>u.value===Rr)).cls}function Or({num:w,catalog:u,kinds:E,title:T,titleSize:ae,padTop:j,description:C,link:v,products:ie,wheels:le,source:d,columns:de,columnsPhone:me,limit:o,editing:y,contentCapped:ce=!1,imageBackground:pe,hover:ue,coverIndex:ge,indexBadge:he,outline:fe,showBadge:xe,fieldUsage:g,showCardPrice:we,showCardFinishes:ve,showCardSizes:ye,showCardBuy:Ce,showCardPage:be,cardImage:Se,gap:$e,gapPhone:Me}){const z=p(()=>g?se(g,"alloy-wheel"):void 0,[g]),Ne=p(()=>g?se(g,"tyre"):void 0,[g]),e=He("pg"),m=Cr(de,me),W=typeof o=="number"&&o>0,X=ce,_e=yr(),Ee=vr(),Te=_e||Ee,K=zr(y===!0&&!!d),i=p(()=>d?$r(Tr(d,E,K??u??[])):null,[u,K,d,E]),c=_r(d),h=c!==null,{filters:b,reportCount:I,reportLugs:L,reportSizes:A,reportFinishes:B,reportCategories:P,vehicle:Z}=xr(),{currency:R}=hr(),F=h&&!!b.process&&b.process!==c,t=p(()=>i?h?Sr(i,b,R,Z.fit):i:null,[i,h,b,R,Z.fit]);_(()=>(P(e,c===null?[]:[c]),()=>P(e,[])),[c,P,e]),_(()=>{if(h)return I(e,F?0:t?.length??0),()=>I(e,0)},[h,F,t,I,e]);const ze=p(()=>{const n=(t??[]).filter(l=>U(l)!=="tyre");if(n.length===0)return!1;const a=n.some(l=>!!l.process);return n.some(l=>!!l.setWords)||or({kind:!1,brand:!1,process:a},z??[])},[t,z]),S=p(()=>({lugs:Ar(i??[]),sizes:Br(i??[]),finishes:Lr(i??[])}),[i]);_(()=>(L(e,S.lugs),A(e,S.sizes),B(e,S.finishes),()=>{L(e,[]),A(e,[]),B(e,[])}),[S,L,A,B,e]);const f=Ke("ProductGrid",$e,"both",Me),q=f.className.includes(Ze),O=`${e} grid${f.className} bg-[var(--catalog-grid-bg)] ${m}`,Ie=q?`${O} ${Ye}`:O,Le=q?{...f.style,...Qe(Je(f))}:f.style,Ae=t?t.length>0?r("div",{className:Ie,style:Le,children:t.map((n,a)=>U(n)==="tyre"?r(Mr,{item:n,currency:R,editing:y,fieldUsage:Ne},`tyre:${n.slug}-${a}`):r(Ve,{wheel:n,variant:"catalog"},`${n.slug}-${a}`))}):y?r("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:r("span",{className:`font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:Pr("No products in “{name}” yet",{name:d?.name??""})})}):null:r(ie,{className:O,style:f.style,minEmptyHeight:320}),$=t?t.length:null,V=Nr(Er(d,E)),Be=w||T||C||v?x("div",{className:`${Ir} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${X||Te?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[x("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[w&&r("span",{className:`font-mono ${s.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:H(w)}),T&&r("h2",{className:`${Fr(ae)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:br(T,!1)})]}),(C||v||$!==null)&&x("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[C&&r("span",{className:`max-w-[340px] truncate font-display ${s.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:H(C)}),v&&x(qe,{href:v.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${s.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[H(v.text),r("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&x("span",{className:`whitespace-nowrap font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[$," ",$===1?V.one:V.many]})]})]}):null,Pe=typeof j=="number"?{"--pg-pt":`${j}px`}:{},Y=dr(he),M=p(()=>{if(!t)return null;const n=t.map(a=>U(a)!=="tyre"&&nr(sr(a))?2:1);return ne(n,o)?re(m,n,o):null},[t,m,o]),[Re,Fe]=Ue("");_(()=>{if(t)return;const n=document.querySelector(`.${e}`);if(!n)return;const a=()=>{const l=[...n.children].map(ke=>ke.classList.contains("col-span-2")?2:1);Fe(ne(l,o)?te(e,re(m,l,o,!1),l.length):"")};a();const k=new MutationObserver(a);return k.observe(n,{childList:!0}),()=>k.disconnect()},[t,e,m,o]);const Oe=M?M[0].tracks:t?W?Math.min(t.length,o):t.length:void 0,N=M?te(e,M,t.length):Re,J=N?"":tr(e,m,{limit:o,cards:t?.length}),Q=lr(e,Y),ee=x(De,{children:[W&&!N&&r("style",{children:`.${e} > *:nth-child(n+${o+1}){display:none}`}),N&&r("style",{children:N}),J&&r("style",{children:J}),Q&&r("style",{children:Q}),Be,Ae,r(ar,{editing:y})]});if(F)return null;const G=r(wr,{attrs:h&&c!==null?{[fr]:c}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:{...Pe,...Xe(Se)},defaults:{"--pg-pt":"120px"},children:X?r("div",{style:pr(cr),children:ee}):ee}),Ge=i?G:y?r(ur,{children:G}):r(gr,{wheels:le,children:G});return r(er,{imageSizes:rr(m,Oe),imageBackgroundFill:We(pe,je),hover:ue,coverIndex:ge??mr,indexBadge:Y,outline:fe??ir,showBadge:xe??!0,fieldUsage:z,reserveEyebrow:ze,showCardPrice:we??!0,showCardFinishes:ve??!0,showCardSizes:ye??D.showCardSizes,showCardBuy:Ce??D.showCardBuy,showCardPage:be??D.showCardPage,children:Ge})}export{oe as TITLE_SIZES,Or as default};
1
+ "use client";import{jsx as r,jsxs as x,Fragment as Ie}from"react/jsx-runtime";import{useScopeClass as _e}from"../lib/use-scope-class.js";import{useEffect as T,useMemo as p,useState as He}from"react";import{cardHoverOf as Pe}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as Be}from"efficient-web-builder/format/lib/content/container-gap";import Oe from"next/link";import{cardRowsGrid as Re,GridCardProvider as Ae,GridCards as Ge,gridIndexCss as ke}from"./GridCardTemplate.js";import{gridClassImageSizes as Fe}from"../lib/sections/card-image-sizes.js";import{fillRowCss as Ue}from"../lib/sections/fill-row.js";import{hiddenCardsRule as je,noHoleBands as J,noHoleCss as Q,showsASetCard as ee}from"../lib/sections/grid-no-hole.js";import{setIsWide as We,summarySetBuild as De}from"../lib/wheels/set-mode.js";import{answersForKind as re,NO_FIELD_ANSWERS as Ke}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Xe}from"./ProductCardEyebrow.js";import Ze from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as qe,centredCap as Ve}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Ye,SectionWheelsProvider as Je}from"./ProductRef.js";import{useCurrency as Qe}from"./CurrencyContext.js";import{COLLECTION_ATTR as er,useCatalogFilter as rr}from"./catalog/CatalogFilterContext.js";import tr from"./SectionBand.js";import{useInsideBox as nr,useInsideSiteGutter as sr}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as ir}from"../lib/sections/product-grid-columns.js";import{renderGold as k,renderHeadline as ar}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as or}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as lr}from"../lib/wheels/wheel-summary-casing.js";import dr from"./TyreSummaryCard.js";import{itemKind as F,plpKindNoun as mr}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as cr,gridKindsOf as pr,gridRowsOf as ur}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as gr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as fr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as hr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as xr}from"../lib/wheels/lug-count.js";import{diametersOf as wr}from"../lib/wheels/size-range.js";import{say as vr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as yr}from"../lib/sections/product-grid-title.js";const br=Pe({},"ProductGrid"),s={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},te=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${s.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium1} ${s.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium2} ${s.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium3} ${s.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium4} ${s.headingMediumUpTo800Xl}`}];function Cr(w){return(te.find(u=>u.value===w)??te.find(u=>u.value===yr)).cls}function Sr({num:w,catalog:u,kinds:z,title:E,titleSize:ne,padTop:U,description:b,link:v,products:se,wheels:ie,source:m,columns:ae,columnsPhone:oe,columnsTablet:le,limit:i,editing:g,contentCapped:de=!1,hover:me,fieldUsage:f,ownerId:ce="",template:pe,gap:ue,gapPhone:ge}){const L=p(()=>f?re(f,"alloy-wheel"):void 0,[f]),fe=p(()=>f?re(f,"tyre"):void 0,[f]),e=_e("pg"),d=ir(ae,oe,le),j=typeof i=="number"&&i>0,W=de,he=sr(),xe=nr(),we=he||xe,D=gr(g===!0&&!!m),o=p(()=>m?lr(ur(m,z,D??u??[])):null,[u,D,m,z]),c=cr(m),h=c!==null,{filters:C,reportCount:I,reportLugs:_,reportSizes:H,reportFinishes:P,reportCategories:B,vehicle:K}=rr(),{currency:O}=Qe(),R=h&&!!C.process&&C.process!==c,t=p(()=>o?h?or(o,C,O,K.fit):o:null,[o,h,C,O,K.fit]);T(()=>(B(e,c===null?[]:[c]),()=>B(e,[])),[c,B,e]),T(()=>{if(h)return I(e,R?0:t?.length??0),()=>I(e,0)},[h,R,t,I,e]);const S=p(()=>({lugs:xr(o??[]),sizes:wr(o??[]),finishes:hr(o??[])}),[o]);T(()=>(_(e,S.lugs),H(e,S.sizes),P(e,S.finishes),()=>{_(e,[]),H(e,[]),P(e,[])}),[S,_,H,P,e]);const A=Be("ProductGrid",ue,"both",ge),ve=`${e} grid${A.className} bg-[var(--catalog-grid-bg)] ${d}`,X=Re(A),ye=`${e} grid${X.className} bg-[var(--catalog-grid-bg)] ${d}`,be=X.style,Ce=p(()=>{const n=(t??[]).filter(l=>F(l)!=="tyre");if(n.length===0)return!1;const a=n.some(l=>!!l.process);return n.some(l=>!!l.setWords)||Xe({kind:!1,brand:!1,process:a},L??[])},[t,L]),Se=t?t.length>0?r("div",{className:ye,style:be,children:t.map((n,a)=>F(n)==="tyre"?r(dr,{item:n,currency:O,editing:g,fieldUsage:fe},`tyre:${n.slug}-${a}`):r(Ge,{wheels:[n],children:y=>y},`${n.slug}-${a}`))}):g?r("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:r("span",{className:`font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:vr("No products in “{name}” yet",{name:m?.name??""})})}):null:r(se,{className:ve,style:A.style,minEmptyHeight:320}),$=t?t.length:null,Z=mr(pr(m,z)),$e=w||E||b||v?x("div",{className:`${fr} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${W||we?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[x("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[w&&r("span",{className:`font-mono ${s.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:k(w)}),E&&r("h2",{className:`${Cr(ne)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:ar(E,!1)})]}),(b||v||$!==null)&&x("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[b&&r("span",{className:`max-w-[340px] truncate font-display ${s.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:k(b)}),v&&x(Oe,{href:v.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${s.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[k(v.text),r("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&x("span",{className:`whitespace-nowrap font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[$," ",$===1?Z.one:Z.many]})]})]}):null,Me=typeof U=="number"?{"--pg-pt":`${U}px`}:{},M=p(()=>{if(!t)return null;const n=t.map(a=>F(a)!=="tyre"&&We(De(a))?2:1);return ee(n,i)?J(d,n,i):null},[t,d,i]),[Ne,Te]=He("");T(()=>{if(t)return;const n=document.querySelector(`.${e}`);if(!n)return;const a=()=>{const l=[...n.children].map(Le=>Le.classList.contains("col-span-2")?2:1);Te(ee(l,i)?Q(e,J(d,l,i,!1),l.length):"")};a();const y=new MutationObserver(a);return y.observe(n,{childList:!0}),()=>y.disconnect()},[t,e,d,i]);const ze=M?M[0].tracks:t?j?Math.min(t.length,i):t.length:void 0,N=M?Q(e,M,t.length):Ne,q=N?"":Ue(e,d,{limit:i,cards:t?.length}),V=ke(e),Y=x(Ie,{children:[j&&!N&&r("style",{children:je(e,i+1)}),N&&r("style",{children:N}),q&&r("style",{children:q}),V&&r("style",{children:V}),$e,Se,r(Ze,{editing:g})]});if(R)return null;const G=r(tr,{attrs:h&&c!==null?{[er]:c}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Me,defaults:{"--pg-pt":"120px"},children:W?r("div",{style:Ve(qe),children:Y}):Y}),Ee=o?G:g?r(Ye,{children:G}):r(Je,{wheels:ie,children:G});return r(Ae,{value:{ownerId:ce,Template:pe,hover:me??br,imageSizes:Fe(d,ze),fieldUsage:L??Ke,reserveEyebrow:Ce,editing:g===!0},children:Ee})}export{te as TITLE_SIZES,Sr as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{createContext as c,useContext as d,useEffect as g,useState as u}from"react";import m from"./ProductCard.js";import{loadProductCatalog as h}from"./useProductCatalog.js";import{say as f}from"efficient-web-builder/format/lib/editor-words";const i=c({wheels:[],loading:!1,live:!1});function p(e,t){return e.find(r=>r.designCode===t)??e.find(r=>r.slug===t)}function S({wheels:e,children:t}){return a(i.Provider,{value:{wheels:e??[],loading:!1,live:!0},children:t})}function b({children:e}){const[t,r]=u([]),[s,o]=u(!0);return g(()=>{let n=!1;return h().then(l=>{n||(r(l),o(!1))}).catch(()=>{n||o(!1)}),()=>{n=!0}},[]),a(i.Provider,{value:{wheels:t,loading:s,live:!1},children:e})}function v({code:e,finish:t,wheel:r}){const{wheels:s,loading:o,live:n}=d(i),l=r??(e?p(s,e):void 0);return l?a(m,{wheel:l,variant:"catalog",defaultFinish:t},`${l.slug}:${t??""}`):n?null:a("div",{className:"sf-card flex aspect-square w-full items-center justify-center bg-surface-2 p-4 text-center",children:a("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:o?f("Loading…"):e||f("Set a design code")})})}export{b as ProductCatalogProvider,S as SectionWheelsProvider,v as default,p as wheelForCode};
1
+ "use client";import{jsx as s}from"react/jsx-runtime";import{createContext as d,useContext as g,useEffect as h,useState as f}from"react";import{GridCards as m}from"./GridCardTemplate.js";import{loadProductCatalog as p}from"./useProductCatalog.js";import{say as u}from"efficient-web-builder/format/lib/editor-words";const a=d({wheels:[],loading:!1,live:!1});function x(e,t){return e.find(r=>r.designCode===t)??e.find(r=>r.slug===t)}function b({wheels:e,children:t}){return s(a.Provider,{value:{wheels:e??[],loading:!1,live:!0},children:t})}function y({children:e}){const[t,r]=f([]),[o,i]=f(!0);return h(()=>{let n=!1;return p().then(l=>{n||(r(l),i(!1))}).catch(()=>{n||i(!1)}),()=>{n=!0}},[]),s(a.Provider,{value:{wheels:t,loading:o,live:!1},children:e})}function v({code:e,finish:t,wheel:r}){const{wheels:o,loading:i,live:n}=g(a),l=r??(e?x(o,e):void 0);return l?s(m,{wheels:[l],finishes:[t],children:c=>c},`${l.slug}:${t??""}`):n?null:s("div",{className:"sf-card flex aspect-square w-full items-center justify-center bg-surface-2 p-4 text-center",children:s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:i?u("Loading…"):e||u("Set a design code")})})}export{y as ProductCatalogProvider,b as SectionWheelsProvider,v as default,x as wheelForCode};
@@ -1,4 +1,4 @@
1
- import type { ComponentProps, ReactNode } from "react";
1
+ import { type ComponentProps, type ReactNode } from "react";
2
2
  import { CatalogFilterLabelsProvider } from "./catalog/CatalogFilterLabels.js";
3
3
  import { SiteMenuLinksProvider } from "./catalog/SiteMenuLinks.js";
4
4
  import { CurrencyProvider } from "./CurrencyContext.js";
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{CartProvider as l}from"./CartContext.js";import{CatalogFilterLabelsProvider as d}from"./catalog/CatalogFilterLabels.js";import{SiteMenuLinksProvider as a}from"./catalog/SiteMenuLinks.js";import{CurrencyProvider as s}from"./CurrencyContext.js";import{EnglishVariantProvider as c}from"./EnglishVariant.js";import{SearchProvider as f}from"./SearchContext.js";import{SubscribePopupProvider as h}from"./SubscribePopupContext.js";import{WishlistProvider as p}from"./WishlistContext.js";import{normalizeEnglishVariant as u}from"../lib/content/english-variant.js";function v({catalogFilterLabels:i,englishVariant:o,menuItems:e,currency:t,searchShortcut:m=!0,children:n}){return r(c,{variant:u(o),children:r(d,{labels:i,children:r(a,{items:e,children:r(s,{...t,children:r(h,{children:r(p,{children:r(l,{children:r(f,{shortcut:m,children:n})})})})})})})})}export{v as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{useMemo as u}from"react";import{usePathname as c}from"next/navigation";import{SiteRuntimeProvider as p,useSiteRuntime as h}from"efficient-web-builder/render/lib/site-runtime";import{CartProvider as f}from"./CartContext.js";import{CatalogFilterLabelsProvider as P}from"./catalog/CatalogFilterLabels.js";import{SiteMenuLinksProvider as v}from"./catalog/SiteMenuLinks.js";import{CurrencyProvider as g}from"./CurrencyContext.js";import{EnglishVariantProvider as S}from"./EnglishVariant.js";import{SearchProvider as b}from"./SearchContext.js";import{SubscribePopupProvider as x}from"./SubscribePopupContext.js";import{WishlistProvider as C}from"./WishlistContext.js";import{normalizeEnglishVariant as j}from"../lib/content/english-variant.js";function E({catalogFilterLabels:o,englishVariant:t,menuItems:n,currency:m,searchShortcut:a=!0,children:d}){const e=h(),l=c(),i=e.pagePath!==void 0?e.pagePath:l??null,s=u(()=>({...e,pagePath:i}),[e,i]);return r(p,{runtime:s,children:r(S,{variant:j(t),children:r(P,{labels:o,children:r(v,{items:n,children:r(g,{...m,children:r(x,{children:r(C,{children:r(f,{children:r(b,{shortcut:a,children:d})})})})})})})})})}export{E as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r,Fragment as C}from"react/jsx-runtime";import A from"next/link";import w from"./TyreImage.js";import{priceIn as $,UNPRICED_LABEL as T}from"../lib/wheels/price-display.js";import{keepForSpec as j}from"../lib/content/field-usage.js";import{stockWord as D}from"../lib/content/stock-words.js";import{CARD_INDEX_BADGE_CLASS as I,CARD_INDEX_CLASS as R,cardOutlineClass as k}from"efficient-web-builder/format/lib/sections/product-card-style";const s={headingSmall:"text-[length:var(--size-headingSmall,22px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},B=[],F="View tyre",P="flex flex-col bg-[var(--card-bg)] p-5";function g(l,n){const a=l?k(l):"";return[P,n?"relative":"",a].filter(Boolean).join(" ")}function V({outline:l,showIndex:n=!1,size:a,specs:t,prices:x,image:h,inStock:o,href:c,linkLabel:u=F,imageSizes:b="(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",fieldUsage:N=B,currency:S,formatPrice:_}){const m=$(x,S),v=m===null?T:_(m),y=j(N),d=[["load_index","Load index",t.loadIndex],["speed_rating","Speed",t.speedRating],["construction","Construction",t.construction],["tire_type","Type",t.tireType]].filter(([,,i])=>!!i).filter(([i])=>y(i)),p=r(C,{children:[e(w,{image:h,size:a,type:t.tireType,sizes:b}),e("h3",{className:`mt-4 font-heading3 ${s.headingSmall} font-medium leading-tight`,children:a}),t.treadPattern?e("div",{className:`mt-1 font-mono ${s.labelSmall} uppercase tracking-[0.18em] text-accent`,children:t.treadPattern}):null,d.length>0&&e("dl",{className:`mt-3 flex flex-col gap-2 font-mono ${s.labelSmall}`,children:d.map(([i,E,L])=>r("div",{className:"flex items-baseline justify-between gap-3",children:[e("dt",{className:"uppercase tracking-[0.14em] text-fg-dim",children:E}),e("dd",{className:"text-right text-fg",children:L})]},i))}),r("div",{className:`mt-4 flex items-baseline justify-between gap-3 border-t border-line pt-3 font-mono ${s.labelLarge}`,children:[e("span",{className:"text-fg",children:v}),e("span",{style:o?{color:"var(--green)"}:void 0,className:o?void 0:"text-fg-dim",children:D(o)})]})]}),f=n?e("span",{"aria-hidden":!0,className:`${R} ${I}`}):null;return c?r(A,{href:c,"aria-label":a?`View ${a} tyre`:"View this tyre",className:`group ${g(l,n)}`,children:[f,p,r("span",{className:`mt-3 inline-flex items-center gap-2 font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-accent transition-colors group-hover:text-fg`,children:[u,e("span",{"aria-hidden":!0,className:"transition-transform group-hover:translate-x-1",children:"→"})]})]}):r("div",{className:g(l,n),children:[f,p]})}export{V as default};
1
+ "use client";import{jsx as e,jsxs as r,Fragment as C}from"react/jsx-runtime";import A from"next/link";import w from"./TyreImage.js";import{priceIn as $,UNPRICED_LABEL as j}from"../lib/wheels/price-display.js";import{NO_FIELD_ANSWERS as D,keepForSpec as I}from"../lib/content/field-usage.js";import{stockWord as R}from"../lib/content/stock-words.js";import{CARD_INDEX_BADGE_CLASS as T,CARD_INDEX_CLASS as k,cardOutlineClass as B}from"efficient-web-builder/format/lib/sections/product-card-style";const s={headingSmall:"text-[length:var(--size-headingSmall,22px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},F="View tyre",V="flex flex-col bg-[var(--card-bg)] p-5";function g(l,n){const a=l?B(l):"";return[V,n?"relative":"",a].filter(Boolean).join(" ")}function P({outline:l,showIndex:n=!1,size:a,specs:t,prices:x,image:h,inStock:o,href:m,linkLabel:u=F,imageSizes:b="(max-width: 720px) 100vw, (max-width: 1100px) 50vw, 33vw",fieldUsage:N=D,currency:S,formatPrice:_}){const c=$(x,S),v=c===null?j:_(c),y=I(N),d=[["load_index","Load index",t.loadIndex],["speed_rating","Speed",t.speedRating],["construction","Construction",t.construction],["tire_type","Type",t.tireType]].filter(([,,i])=>!!i).filter(([i])=>y(i)),p=r(C,{children:[e(w,{image:h,size:a,type:t.tireType,sizes:b}),e("h3",{className:`mt-4 font-heading3 ${s.headingSmall} font-medium leading-tight`,children:a}),t.treadPattern?e("div",{className:`mt-1 font-mono ${s.labelSmall} uppercase tracking-[0.18em] text-accent`,children:t.treadPattern}):null,d.length>0&&e("dl",{className:`mt-3 flex flex-col gap-2 font-mono ${s.labelSmall}`,children:d.map(([i,E,L])=>r("div",{className:"flex items-baseline justify-between gap-3",children:[e("dt",{className:"uppercase tracking-[0.14em] text-fg-dim",children:E}),e("dd",{className:"text-right text-fg",children:L})]},i))}),r("div",{className:`mt-4 flex items-baseline justify-between gap-3 border-t border-line pt-3 font-mono ${s.labelLarge}`,children:[e("span",{className:"text-fg",children:v}),e("span",{style:o?{color:"var(--green)"}:void 0,className:o?void 0:"text-fg-dim",children:R(o)})]})]}),f=n?e("span",{"aria-hidden":!0,className:`${k} ${T}`}):null;return m?r(A,{href:m,"aria-label":a?`View ${a} tyre`:"View this tyre",className:`group ${g(l,n)}`,children:[f,p,r("span",{className:`mt-3 inline-flex items-center gap-2 font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-accent transition-colors group-hover:text-fg`,children:[u,e("span",{"aria-hidden":!0,className:"transition-transform group-hover:translate-x-1",children:"→"})]})]}):r("div",{className:g(l,n),children:[f,p]})}export{P as default};
@@ -1,8 +1,9 @@
1
1
  import { type TyreFitAnswer } from "../lib/tyres/tyre-vehicle-fitment.js";
2
2
  import type { TyreVariant } from "../lib/api/index.js";
3
- export default function TyreFitVerdicts({ variants, answer, loading, onRetry, }: {
3
+ export default function TyreFitVerdicts({ variants, answer, loading, onRetry, headline, }: {
4
4
  variants: TyreVariant[];
5
5
  answer: TyreFitAnswer | null;
6
6
  loading?: boolean;
7
7
  onRetry?: () => void;
8
+ headline?: string;
8
9
  }): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{TYRE_FIT_LABEL as m,tyreFitHeadline as d}from"../lib/tyres/tyre-fit-copy.js";import{variantFitStatus as g}from"../lib/tyres/tyre-vehicle-fitment.js";const t={body:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},p={fits:{className:"font-medium",style:{color:"var(--green)"}},doesNotFit:{className:"text-fg-dim"},unknown:{className:"text-fg-dim"}};function u({variants:c,answer:l,loading:o=!1,onRetry:s}){return l?i("div",{className:"mt-10",children:[e("p",{className:`max-w-[68ch] font-serif ${t.body} italic leading-[1.55] text-fg-dim`,children:d(l)}),l.failed&&s?e("button",{type:"button",onClick:s,className:`mt-4 cursor-pointer font-mono ${t.labelLarge} uppercase tracking-[0.18em] text-accent underline-offset-4 hover:underline`,children:"Try again"}):null,e("ul",{className:"mt-6 grid gap-[2px] border border-line bg-line",children:c.map(a=>{const r=g(l,a.sku),n=p[r];return i("li",{className:"flex items-baseline justify-between gap-6 bg-bg px-5 py-4",children:[e("span",{className:`font-mono ${t.labelLarge} uppercase tracking-[0.14em] text-fg`,children:a.size}),e("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] ${n.className}`,style:n.style,children:m[r]})]},a.sku)})})]}):o?e("p",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:"Checking your car…"}):null}export{u as default};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{TYRE_FIT_LABEL as d,tyreFitHeadline as g}from"../lib/tyres/tyre-fit-copy.js";import{variantFitStatus as p}from"../lib/tyres/tyre-vehicle-fitment.js";const t={body:"text-[length:var(--size-body,18px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},u={fits:{className:"font-medium",style:{color:"var(--green)"}},doesNotFit:{className:"text-fg-dim"},unknown:{className:"text-fg-dim"}};function f({variants:c,answer:l,loading:o=!1,onRetry:s,headline:m}){return l?i("div",{className:"mt-10",children:[e("p",{className:`max-w-[68ch] font-serif ${t.body} italic leading-[1.55] text-fg-dim`,children:m??g(l)}),l.failed&&s?e("button",{type:"button",onClick:s,className:`mt-4 cursor-pointer font-mono ${t.labelLarge} uppercase tracking-[0.18em] text-accent underline-offset-4 hover:underline`,children:"Try again"}):null,e("ul",{className:"mt-6 grid gap-[2px] border border-line bg-line",children:c.map(a=>{const r=p(l,a.sku),n=u[r];return i("li",{className:"flex items-baseline justify-between gap-6 bg-bg px-5 py-4",children:[e("span",{className:`font-mono ${t.labelLarge} uppercase tracking-[0.14em] text-fg`,children:a.size}),e("span",{className:`font-mono ${t.labelSmall} uppercase tracking-[0.24em] ${n.className}`,style:n.style,children:d[r]})]},a.sku)})})]}):o?e("p",{className:`mt-10 border border-line bg-bg p-6 font-mono ${t.labelLarge} uppercase tracking-[0.24em] text-fg-dim`,children:"Checking your car…"}):null}export{f as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import g from"./card-pieces/CardBuyButton.js";import C from"./card-pieces/CardFinishSwatches.js";import P from"./card-pieces/CardPrice.js";import b from"./card-pieces/CardSizes.js";import{TyreCardStateProvider as x,useProductCardState as S}from"./card-pieces/ProductCardState.js";import{productCardEyebrow as z}from"./ProductCardEyebrow.js";import B from"./TyreImage.js";import k from"./WheelCardFrame.js";import{keepForCard as T}from"../lib/content/field-usage.js";import{tyreModelLine as L}from"../lib/tyres/tyre-brand-name.js";import{formatSizeRange as E}from"../lib/wheels/size-range.js";const F=[];function j({brand:i,brandLogo:m,brandPlate:s=!0,kindLabel:l=null,showBrand:a=!0,name:d,slug:p,sizes:e,fitSize:t=null,rimDiameters:u,prices:c,image:o,currency:f,editing:h=!1,fieldUsage:n=F}){return r(x,{tyre:{brand:i,brandLogo:m,name:d,slug:p,sizes:e,fitSize:t,rimDiameters:u,prices:c,image:o},currency:f,editing:h,children:r(v,{brandPlate:s,kindLabel:l,showBrand:a,fieldUsage:n})})}function v({brandPlate:i,kindLabel:m,showBrand:s,fieldUsage:l}){const a=S();if(a.kind!=="tyre")throw new Error("TyrePlpCard drew outside its own tyre state.");const{tyre:d,pagePath:p,arm:e}=a,{brand:t,brandLogo:u,name:c,sizes:o,rimDiameters:f,image:h}=d,n=T(l),y=[o.length>0?`${o.length} ${o.length===1?"size":"sizes"}`:null,n("rim_diameter")?E(f):null].filter(Boolean).join(" · ");return r(k,{href:p,identityLink:!0,containerProps:{onPointerEnter:e,onTouchStart:e,onFocusCapture:e},image:r(B,{image:h,className:"h-full w-full",sizes:"(max-width: 640px) 90vw, (max-width: 1024px) 45vw, 280px",showBackground:!1}),plate:i?r(w,{brand:t,logo:u}):null,eyebrow:z(m,s&&n("brand")&&t||null),name:L(t??"",c),spec:y,price:r(P,{}),swatches:r(C,{}),sizes:r(b,{}),buy:r(g,{})})}export{j as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import w from"./BrandPlate.js";import g from"./card-pieces/CardBuyButton.js";import C from"./card-pieces/CardFinishSwatches.js";import P from"./card-pieces/CardPrice.js";import b from"./card-pieces/CardSizes.js";import{TyreCardStateProvider as x,useProductCardState as S}from"./card-pieces/ProductCardState.js";import{productCardEyebrow as z}from"./ProductCardEyebrow.js";import B from"./TyreImage.js";import k from"./WheelCardFrame.js";import{keepForCard as L,NO_FIELD_ANSWERS as T}from"../lib/content/field-usage.js";import{tyreModelLine as E}from"../lib/tyres/tyre-brand-name.js";import{formatSizeRange as F}from"../lib/wheels/size-range.js";function _({brand:n,brandLogo:m,brandPlate:l=!0,kindLabel:s=null,showBrand:a=!0,name:d,slug:p,sizes:e,fitSize:t=null,rimDiameters:u,prices:f,image:o,currency:c,editing:h=!1,fieldUsage:i=T}){return r(x,{tyre:{brand:n,brandLogo:m,name:d,slug:p,sizes:e,fitSize:t,rimDiameters:u,prices:f,image:o},currency:c,editing:h,children:r(j,{brandPlate:l,kindLabel:s,showBrand:a,fieldUsage:i})})}function j({brandPlate:n,kindLabel:m,showBrand:l,fieldUsage:s}){const a=S();if(a.kind!=="tyre")throw new Error("TyrePlpCard drew outside its own tyre state.");const{tyre:d,pagePath:p,arm:e}=a,{brand:t,brandLogo:u,name:f,sizes:o,rimDiameters:c,image:h}=d,i=L(s),y=[o.length>0?`${o.length} ${o.length===1?"size":"sizes"}`:null,i("rim_diameter")?F(c):null].filter(Boolean).join(" · ");return r(k,{href:p,identityLink:!0,containerProps:{onPointerEnter:e,onTouchStart:e,onFocusCapture:e},image:r(B,{image:h,className:"h-full w-full",sizes:"(max-width: 640px) 90vw, (max-width: 1024px) 45vw, 280px",showBackground:!1}),plate:n?r(w,{brand:t,logo:u}):null,eyebrow:z(m,l&&i("brand")&&t||null),name:E(t??"",f),spec:y,price:r(P,{}),swatches:r(C,{}),sizes:r(b,{}),buy:r(g,{})})}export{_ as default};
@@ -1,6 +1,8 @@
1
1
  import type { ReactNode } from "react";
2
+ import { type CardTextRegion } from "./card-text-region.js";
2
3
  export interface CardEyebrowSettings {
3
4
  children?: ReactNode;
4
5
  reserve?: boolean;
6
+ region?: CardTextRegion;
5
7
  }
6
- export default function CardEyebrow({ children: eyebrow, reserve }: CardEyebrowSettings): import("react").JSX.Element;
8
+ export default function CardEyebrow({ children: eyebrow, reserve, region }: CardEyebrowSettings): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import{CARD_TEXT_SIZE as o,CardRow as s,useCatalogCard as c}from"./card-row.js";function i({children:a,reserve:n=!1}){const r=c(),t=`font-mono ${o.label} uppercase text-accent ${r?"tracking-[0.3em]":"tracking-[0.25em]"}`,l=a?e("div",{className:t,children:a}):r&&n?e("div",{"aria-hidden":!0,className:t,children:" "}):null;return e(s,{children:l})}export{i as default};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{CARD_TEXT_SIZE as c,CardRow as l,useCatalogCard as s}from"./card-row.js";import{RegionBridge as d,RegionWords as m,regionAttr as u}from"./card-text-region.js";function g({children:o,reserve:a=!1,region:r}){const t=s(),n=`font-mono ${c.label} uppercase text-accent ${t?"tracking-[0.3em]":"tracking-[0.25em]"}`,i=o?e("div",{...u(r,"eyebrow"),className:n,children:e(m,{region:r,at:"eyebrow",children:o})}):t&&a?e("div",{"aria-hidden":!0,className:n,children:" "}):null;return e(d,{region:r,sectionType:"ProductEyebrow",children:e(l,{children:i})})}export{g as default};
@@ -1,4 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
- export default function CardName({ children: name }: {
2
+ import { type CardTextRegion } from "./card-text-region.js";
3
+ export default function CardName({ children: name, region }: {
3
4
  children?: ReactNode;
5
+ region?: CardTextRegion;
4
6
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{withRMark as t}from"efficient-web-builder/render/components/RMark";import{CARD_TEXT_SIZE as n,useCatalogCard as d}from"./card-row.js";import{useProductCardStateOrNull as i}from"./ProductCardState.js";function m({children:a}){const o=d(),e=i();return a===void 0&&e?.kind!=="wheel"&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty"),r("div",{className:o?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${n.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${n.headingSmall1} font-medium tracking-[-0.02em]`,children:a??(e?.kind==="wheel"?t(e.wheel.name):null)})}export{m as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{withRMark as i}from"efficient-web-builder/render/components/RMark";import{CARD_TEXT_SIZE as o,useCatalogCard as d}from"./card-row.js";import{useProductCardStateOrNull as m}from"./ProductCardState.js";import{RegionBridge as l,RegionWords as s,regionAttr as c}from"./card-text-region.js";function h({children:a,region:e}){const t=d(),n=m();return a===void 0&&n?.kind!=="wheel"&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty"),r(l,{region:e,sectionType:"ProductName",children:r("div",{...c(e,"name"),className:t?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${o.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${o.headingSmall1} font-medium tracking-[-0.02em]`,children:r(s,{region:e,at:"name",children:a??(n?.kind==="wheel"?i(n.wheel.name):null)})})})}export{h as default};
@@ -1,15 +1,11 @@
1
- import type { PartStyles } from "efficient-web-builder/render/lib/document/part-styles";
1
+ import { type CardTextRegion } from "./card-text-region.js";
2
2
  export interface CardPriceSettings {
3
3
  show?: boolean;
4
4
  quoteSets?: boolean;
5
5
  setTotal?: boolean;
6
6
  wasFollowsSize?: boolean;
7
7
  }
8
- export interface CardPriceRegion {
9
- nodeId?: string;
10
- partStyles?: PartStyles;
11
- editing: boolean;
12
- }
8
+ export type CardPriceRegion = CardTextRegion;
13
9
  export default function CardPrice({ show, region, ...settings }: CardPriceSettings & {
14
10
  region?: CardPriceRegion;
15
11
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as c,Fragment as b}from"react/jsx-runtime";import P from"efficient-web-builder/render/components/TextRegionRun";import{SectionTextParts as S}from"efficient-web-builder/render/lib/document/editing-bridges";import{TEXT_REGION_ATTR as T}from"efficient-web-builder/format/lib/sections/text-regions";import{formatPrice as v}from"../../lib/commerce.js";import{setLabel as y}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as d}from"../../lib/wheels/set-mode.js";import{EACH_UNIT as N,formatSelectionPrice as _,formatSelectionWasPrice as w,formatWheelPrice as p,formatWheelWasPrice as L,FROM_PREFIX as u,priceIn as k,resolveWheelPrice as f,SET_QUOTE_LABEL as E}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as h,CardRow as x}from"./card-row.js";import{useHeroPriceStateOrNull as R,useProductCardState as I}from"./ProductCardState.js";function C(e,t){if(e.kind==="tyre"){const m=f(k(e.tyre.prices,e.currency),null);return{was:null,amount:p(m,e.currency,u),note:m.priced?N:null}}const{wheel:o,currency:r,price:i,sel:l,isSet:g}=e,a=f(o.prices[r],o.msrpPrices?.[r]),s=t.setTotal&&i.priced&&i.setTotal!=null&&l.selectedVariant?`${y(l.selectedVariant)} · ${v(i.setTotal,r)}`:null;return g&&t.quoteSets?{was:null,amount:a.priced?d(p(a,r,u),!0):E,note:s}:{was:t.wasFollowsSize?w(i,r):L(a,r),amount:d(_(i,r),i.priced),note:s}}function W({state:e,region:t}){const o=!!t?.editing,r=c("div",{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[e.msrpLabel&&n("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:e.msrpLabel}),n("div",{className:"font-heading2 text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] font-bold leading-none tracking-[-0.01em] text-fg",...o?{[T]:"price"}:{},children:n(P,{region:"price",partStyles:t?.partStyles,children:e.amount})}),e.unitLabel&&n("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.unitLabel}),e.packBadge&&n("div",{className:"ml-auto border border-accent px-3 py-2 font-mono text-[length:var(--size-label,13px)] font-bold uppercase tracking-[0.18em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)"},children:e.packBadge})]});return!o||!t?.nodeId?r:n(S,{nodeId:t.nodeId,sectionType:"ProductPrice",partStyles:t.partStyles,children:r})}function z({show:e=!0,region:t,...o}){const r=R();return r?n(W,{state:r,region:t}):n(F,{show:e,...o})}function F({show:e,...t}){const o=I(),{was:r,amount:i,note:l}=C(o,t);return c(b,{children:[n(x,{children:e?c("div",{className:`mt-2 font-mono ${h.labelLarge}`,children:[r&&n("span",{className:"mr-2 text-fg-dim line-through",children:r}),i]}):null}),n(x,{children:e&&l?n("div",{className:`mt-[2px] font-mono ${h.labelSmall} tracking-[0.08em] text-fg-dim`,children:l}):null})]})}export{z as default};
1
+ "use client";import{jsx as n,jsxs as c,Fragment as b}from"react/jsx-runtime";import{formatPrice as P}from"../../lib/commerce.js";import{setLabel as v}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as d}from"../../lib/wheels/set-mode.js";import{EACH_UNIT as w,formatSelectionPrice as L,formatSelectionWasPrice as N,formatWheelPrice as u,formatWheelWasPrice as S,FROM_PREFIX as p,priceIn as k,resolveWheelPrice as f,SET_QUOTE_LABEL as T}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as h,CardRow as g}from"./card-row.js";import{RegionBridge as _,RegionWords as y,regionAttr as C}from"./card-text-region.js";import{useHeroPriceStateOrNull as E,useProductCardState as R}from"./ProductCardState.js";function W(e,t){if(e.kind==="tyre"){const m=f(k(e.tyre.prices,e.currency),null);return{was:null,amount:u(m,e.currency,p),note:m.priced?w:null}}const{wheel:i,currency:r,price:o,sel:l,isSet:x}=e,a=f(i.prices[r],i.msrpPrices?.[r]),s=t.setTotal&&o.priced&&o.setTotal!=null&&l.selectedVariant?`${v(l.selectedVariant)} · ${P(o.setTotal,r)}`:null;return x&&t.quoteSets?{was:null,amount:a.priced?d(u(a,r,p),!0):T,note:s}:{was:t.wasFollowsSize?N(o,r):S(a,r),amount:d(L(o,r),o.priced),note:s}}function z({state:e,region:t}){const i=c("div",{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[e.msrpLabel&&n("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:e.msrpLabel}),n("div",{className:"font-heading2 text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] font-bold leading-none tracking-[-0.01em] text-fg",...C(t,"price"),children:n(y,{region:t,at:"price",children:e.amount})}),e.unitLabel&&n("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.unitLabel}),e.packBadge&&n("div",{className:"ml-auto border border-accent px-3 py-2 font-mono text-[length:var(--size-label,13px)] font-bold uppercase tracking-[0.18em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)"},children:e.packBadge})]});return n(_,{region:t,sectionType:"ProductPrice",children:i})}function F({show:e=!0,region:t,...i}){const r=E();return r?n(z,{state:r,region:t}):n(j,{show:e,...i})}function j({show:e,...t}){const i=R(),{was:r,amount:o,note:l}=W(i,t);return c(b,{children:[n(g,{children:e?c("div",{className:`mt-2 font-mono ${h.labelLarge}`,children:[r&&n("span",{className:"mr-2 text-fg-dim line-through",children:r}),o]}):null}),n(g,{children:e&&l?n("div",{className:`mt-[2px] font-mono ${h.labelSmall} tracking-[0.08em] text-fg-dim`,children:l}):null})]})}export{F as default};
@@ -0,0 +1,8 @@
1
+ export interface CardProductPictureSettings {
2
+ imageBackground?: unknown;
3
+ cardImage?: unknown;
4
+ coverIndex?: unknown;
5
+ indexBadge?: unknown;
6
+ showBadge?: unknown;
7
+ }
8
+ export default function CardProductPicture(settings: CardProductPictureSettings): import("react").JSX.Element | null;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as o,Fragment as D,jsxs as g}from"react/jsx-runtime";import E from"next/image";import{useState as $}from"react";import{CARD_INDEX_BADGE_CLASS as j,CARD_INDEX_CLASS as v,parseCardIndexFormat as B}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as N,resolveCardImageBackground as y}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as G}from"efficient-web-builder/format/lib/content/card-image-shape";import{setSecondSrc as z}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as L,parseCoverIndex as R,resolvePaintedSrc as W}from"../../lib/wheels/cover-rendering.js";import O from"../WheelPlaceholder.js";import{cardSpinOf as X}from"../card-spin.js";import{useGridCard as H}from"../GridCardTemplate.js";import M from"./CardPicture.js";import T from"./CardProductBadge.js";import{useHeldCardPicture as q}from"./useHeldCardPicture.js";import{useProductCardState as J}from"./ProductCardState.js";function K(i){const s=J();return s.kind!=="wheel"?null:o(Q,{state:s,...i})}function Q({state:i,imageBackground:s,cardImage:C,coverIndex:w,indexBadge:F,showBadge:_}){const{wheel:a,sel:e,isSet:c}=i,{hover:P,imageSizes:d}=H(),m=X(P),x=L(a,R(w),e.finish?.name,e.shownSrc),[l,A]=$(()=>new Set),f=r=>{e.pictureFailed(r),A(n=>n.has(r)?n:new Set(n).add(r))},h=W({overrideSrc:x,hookSrc:e.shownSrc,failed:l}),u=(r,n)=>o(E,{alt:n,src:r,width:1e3,height:1e3,sizes:d,className:`block h-full w-full object-contain ${m.className}`,style:m.style,draggable:!1,onError:()=>f(r)},r),I=e.finish?`${a.name} — ${e.finish.name}`:a.name,b=c?z(a.finishes?.find(r=>r.name===e.finish?.name),h):null,t=q({src:h,second:b,alt:I,sizes:d,failed:l,onFailed:f,near:e.nearScreen,holdEmpty:e.awaitingProbe}),k=g(D,{children:[t.src?u(t.src,t.alt):o(O,{imageLabel:a.name,spin:m}),t.trial]}),p=B(F),S=p!=="off";return g("div",{style:G(C),children:[S?o("span",{"aria-hidden":!0,"data-format":p,className:`${v} ${j}`}):null,o(T,{show:_!==!1,numbered:S,axleSets:!0}),o(M,{image:k,imageSecond:t.second?u(t.second,`${t.alt} — right`):void 0,wide:c,imageBackgroundFill:y(s,N)})]})}export{K as default};
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from "react";
2
+ import type { PartStyles } from "efficient-web-builder/render/lib/document/part-styles";
3
+ export interface CardTextRegion {
4
+ nodeId?: string;
5
+ partStyles?: PartStyles;
6
+ editing: boolean;
7
+ }
8
+ export declare function regionAttr(region: CardTextRegion | undefined, key: string): Record<string, string>;
9
+ export declare function RegionWords({ region, at, children }: {
10
+ region?: CardTextRegion;
11
+ at: string;
12
+ children: ReactNode;
13
+ }): import("react").JSX.Element;
14
+ export declare function RegionBridge({ region, sectionType, children }: {
15
+ region?: CardTextRegion;
16
+ sectionType: string;
17
+ children: ReactNode;
18
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{Fragment as o,jsx as n}from"react/jsx-runtime";import i from"efficient-web-builder/render/components/TextRegionRun";import{SectionTextParts as d}from"efficient-web-builder/render/lib/document/editing-bridges";import{TEXT_REGION_ATTR as p}from"efficient-web-builder/format/lib/sections/text-regions";function f(t,r){return t?.editing?{[p]:r}:{}}function c({region:t,at:r,children:e}){return t?n(i,{region:r,partStyles:t.partStyles,children:e}):n(o,{children:e})}function l({region:t,sectionType:r,children:e}){return!t?.editing||!t.nodeId?n(o,{children:e}):n(d,{nodeId:t.nodeId,sectionType:r,partStyles:t.partStyles,children:e})}export{l as RegionBridge,c as RegionWords,f as regionAttr};
@@ -1,4 +1,11 @@
1
+ import { type ReactNode } from "react";
2
+ import type { StoreProduct } from "../../lib/catalog/store-product.js";
3
+ export declare function useFitmentAnswerView({ product, editing, label, }: {
4
+ product: StoreProduct | null;
5
+ editing?: boolean;
6
+ label?: string;
7
+ }): ReactNode;
1
8
  export default function StockFitmentPart({ editing, label, }: {
2
9
  editing?: boolean;
3
10
  label?: string;
4
- }): import("react").JSX.Element | null;
11
+ }): ReactNode;
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{useSyncExternalStore as i}from"react";import{say as n}from"efficient-web-builder/format/lib/editor-words";import s from"./StockFitmentCard.js";import{storefrontVehicleMemory as o}from"../../lib/wheels/vehicle-memory.js";const c=()=>null;function m({editing:e=!1,label:a="Stock fitment"}){const t=i(o.subscribeStock,o.readStock,c);return t?r(s,{loading:t.loading,error:t.error,data:t.stock}):e?r("div",{"data-host-part-sample":"",className:"opacity-60",children:n(a)}):null}export{m as default};
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{useSyncExternalStore as c}from"react";import{say as m}from"efficient-web-builder/format/lib/editor-words";import h from"./StockFitmentCard.js";import{fitmentAnswerFor as w}from"./fitment-answer-source.js";import l from"../TyreFitVerdicts.js";import{useTyreFitAnswer as S}from"../useTyreFitAnswer.js";import{useSampleProduct as v}from"../pdp-dynamic/useSampleProduct.js";import{useCurrentProduct as A}from"../../lib/document/current-product.js";import{tyreFitQuery as F,unknownAnswer as k}from"../../lib/tyres/tyre-vehicle-fitment.js";import{storefrontVehicleMemory as i}from"../../lib/wheels/vehicle-memory.js";const N=()=>null,x=()=>null,b=k({make:"",model:"",year:0,modification:""});function C({product:o,editing:r=!1,label:s=""}){const n=w(o),a=c(i.subscribeStock,i.readStock,N),u=c(i.subscribe,i.read,x),t=n.source==="tyreVerdicts"?n:null,{answer:p,loading:d,retry:f}=S(t?.slug??"",t&&!r?F(u?.vehicle):null),y=r?e("div",{"data-host-part-sample":"",className:"opacity-60",children:m(s)}):null;return t?r?e("div",{"data-host-part-sample":"",className:"opacity-60",children:e(l,{variants:t.variants,answer:b,headline:m("A sample. On the live page each size shows its own verdict for the shopper's car.")})}):e(l,{variants:t.variants,answer:p,loading:d,onRetry:f}):a?e(h,{loading:a.loading,error:a.error,data:a.stock}):y}function O({editing:o=!1,label:r=""}){const s=A(),n=v(o&&!s);return C({product:s?.product??n,editing:o,label:r})}export{O as default,C as useFitmentAnswerView};
@@ -0,0 +1,12 @@
1
+ import type { ProductKind, TyreVariant } from "../../lib/api/index.js";
2
+ import type { StoreProduct } from "../../lib/catalog/store-product.js";
3
+ export type FitmentAnswerSource = "stockCard" | "tyreVerdicts";
4
+ export declare const FITMENT_ANSWER_BY_KIND: Readonly<Record<ProductKind, FitmentAnswerSource>>;
5
+ export type FitmentAnswer = {
6
+ source: "stockCard";
7
+ } | {
8
+ source: "tyreVerdicts";
9
+ slug: string;
10
+ variants: TyreVariant[];
11
+ };
12
+ export declare function fitmentAnswerFor(product: StoreProduct | null | undefined): FitmentAnswer;
@@ -0,0 +1 @@
1
+ const t={"alloy-wheel":"stockCard",tyre:"tyreVerdicts"},s={source:"stockCard"};function n(e){if(!e)return s;const r=t[e.kind];return r==="tyreVerdicts"&&e.kind==="tyre"&&e.source.variants.length>0?{source:r,slug:e.source.slug,variants:e.source.variants}:s}export{t as FITMENT_ANSWER_BY_KIND,n as fitmentAnswerFor};
@@ -1 +1 @@
1
- "use client";import{jsx as n}from"react/jsx-runtime";import g from"../FitmentTable.js";import k from"./KindGate.js";import{TyreSizesContent as x}from"../TyreSizeGrid.js";import{useCurrentProduct as w}from"../../lib/document/current-product.js";import{useSampleProduct as F}from"./useSampleProduct.js";const U=["alloy-wheel","tyre"],b=[];function h(t){return n(k,{kinds:U,type:"FitmentTable",editing:t.editing,children:n(y,{...t})})}function y({num:t,title:s,description:l,showFilter:m,tooltipDefaultOn:a,footnote:d,footnoteLinkText:c,footnoteLinkHref:u,editing:r=!1,omitHead:f=!1,tyreHead:e}){const o=w(),p=F(r&&!o),i=o?.product??p;if(i?.kind==="tyre")return n(x,{variants:i.source.variants,fieldUsage:o?.fieldUsage??b,num:t,title:e?e.title:s,description:e?e.description:l,editing:r,omitHead:f,keepHiddenHead:e!=null});const T=i?.kind==="alloy-wheel"?i.source.fitments??[]:[];return n(g,{num:t,title:s,description:l,rows:T,showFilter:m,tooltipDefaultOn:a,footnote:d,footnoteLinkText:c,footnoteLinkHref:u,editing:r,omitHead:f,fieldUsage:o?.fieldUsage})}export{h as default,U as supportedKinds};
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import k from"../FitmentTable.js";import x from"./KindGate.js";import{TyreSizesContent as F}from"../TyreSizeGrid.js";import{useCurrentProduct as T}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as w}from"../../lib/content/field-usage.js";import{useSampleProduct as b}from"./useSampleProduct.js";const h=["alloy-wheel","tyre"];function y(t){return n(x,{kinds:h,type:"FitmentTable",editing:t.editing,children:n(S,{...t})})}function S({num:t,title:s,description:l,showFilter:f,tooltipDefaultOn:a,footnote:d,footnoteLinkText:u,footnoteLinkHref:c,editing:r=!1,omitHead:m=!1,tyreHead:e}){const o=T(),p=b(r&&!o),i=o?.product??p;if(i?.kind==="tyre")return n(F,{variants:i.source.variants,fieldUsage:o?.fieldUsage??w,num:t,title:e?e.title:s,description:e?e.description:l,editing:r,omitHead:m,keepHiddenHead:e!=null});const g=i?.kind==="alloy-wheel"?i.source.fitments??[]:[];return n(k,{num:t,title:s,description:l,rows:g,showFilter:f,tooltipDefaultOn:a,footnote:d,footnoteLinkText:u,footnoteLinkHref:c,editing:r,omitHead:m,fieldUsage:o?.fieldUsage})}export{y as default,h as supportedKinds};
@@ -1,6 +1,6 @@
1
- import { type CardImageBackground } from "efficient-web-builder/format/lib/content/card-image-background";
2
- import type { CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
1
+ import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
3
2
  import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
3
+ import type { SlotComponent } from "efficient-easel/blocks";
4
4
  export declare const supportedKinds: readonly ("alloy-wheel" | "tyre")[];
5
5
  interface Props {
6
6
  num?: string;
@@ -14,19 +14,17 @@ interface Props {
14
14
  footnoteLinkHref?: string;
15
15
  editing?: boolean;
16
16
  omitHead?: boolean;
17
+ hover?: CardHoverDrawn;
18
+ ownerId?: string;
19
+ template?: SlotComponent;
17
20
  cardImage?: number | null;
18
21
  outline?: CardOutline;
19
22
  indexBadge?: CardIndexFormat;
20
- showBadge?: boolean;
21
- showCardPrice?: boolean;
22
- showCardFinishes?: boolean;
23
- showCardSizes?: boolean;
24
- showCardBuy?: boolean;
25
- showCardPage?: boolean;
26
- coverIndex?: number;
27
- imageBackground?: CardImageBackground;
28
- hover?: CardHoverDrawn;
23
+ columnsPhone?: unknown;
24
+ columnsTablet?: unknown;
25
+ gap?: number | string;
26
+ gapPhone?: unknown;
29
27
  }
30
28
  export default function DynamicRelatedProducts(props: Props): import("react").JSX.Element;
31
- export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, cardImage, outline, indexBadge, showBadge, showCardPrice, showCardFinishes, showCardSizes, showCardBuy, showCardPage, coverIndex, imageBackground, hover, }: Props): import("react").JSX.Element | null;
29
+ export declare function RelatedProductsBody({ num, title, description, columns, cardCount, relationship: key, footnote, footnoteLinkText, footnoteLinkHref, editing, omitHead, hover, ownerId, template, cardImage, outline, indexBadge, columnsPhone, columnsTablet, gap, gapPhone, }: Props): import("react").JSX.Element | null;
32
30
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as F}from"react/jsx-runtime";import A from"../SectionBand.js";import{useScopeClass as W}from"../../lib/use-scope-class.js";import{GRID_CARD_SHOW as I}from"../../lib/sections/card-show-defaults.js";import{useEffect as V,useState as X}from"react";import{resolveCardImageBackground as Z,THEME_CARD_IMAGE_BG as q}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as B}from"efficient-web-builder/format/lib/content/card-image-shape";import{DEFAULT_COVER_INDEX as J}from"../../lib/wheels/cover-rendering.js";import{DEFAULT_CARD_INDEX_FORMAT as Q,DEFAULT_CARD_OUTLINE as Y,cardIndexCss as ee}from"efficient-web-builder/format/lib/sections/product-card-style";import re from"../CompatibleTyres.js";import oe from"../ProductCard.js";import{CARD_ROWS_GRID_CLASS as te,cardRowsGridStyle as ie}from"../WheelCardFrame.js";import{ProductCardChromeProvider as se}from"../ProductCardChrome.js";import{gridClassImageSizes as ae}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as ne}from"../../lib/sections/fill-row.js";import le from"efficient-web-builder/render/components/SectionHeader";import de from"../ViewMoreLink.js";import{useSiteMenuLinks as ce}from"../catalog/SiteMenuLinks.js";import{renderGold as G,renderHeadline as me}from"efficient-web-builder/render/components/goldPhrases";import pe from"./KindGate.js";import{loadProductCatalog as ue}from"../useProductCatalog.js";import{PLP_KINDS as fe}from"../../lib/catalog/plp-item.js";import{relatedCardCount as he,relatedViewMore as ge}from"../../lib/catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as Ce,relationshipApplies as we,relationshipByKey as xe}from"../../lib/catalog/relationships.js";import{useCurrentProduct as ye}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as O}from"../../lib/wheels/placeholder-wheel.js";import{say as T}from"efficient-web-builder/format/lib/editor-words";const H={label:"text-[length:var(--size-label,13px)]"},ve=fe,$={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"};function be(r){return e(pe,{kinds:ve,type:"RelatedProducts",editing:r.editing,children:e(Se,{...r})})}function Se({num:r,title:t,description:c,columns:a=3,cardCount:b,relationship:S=Ce,footnote:_,footnoteLinkText:k,footnoteLinkHref:E,editing:o=!1,omitHead:C=!1,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y}){const d=ye(),U=ce(),R=he(b),[j,N]=X([]);V(()=>{if(d||!o)return;let P=!1;return ue().then(M=>{const K=M.length>0?M:O;P||N(K)}).catch(()=>{P||N(O)}),()=>{P=!0}},[d,o]);const s=xe(S);if(!s)return null;const D=ge(s,U),L=C?null:e(le,{num:r?G(r):void 0,title:me(t||s.heading,!1),description:c?G(c):void 0,accent:!0});if(!d)return o?e(z,{header:L,wheels:j.slice(0,R),columns:a,viewMore:D,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y}):null;if(!we(s,d.product.kind))return o?e(A,{className:"border-b border-line py-14 max-view-desktop:py-10",style:B(i),children:e("p",{className:`font-mono ${H.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:T(s.label)})})}):null;const v=s.resolve(d.product,d.relatedWheels);return v.kind==="tyre"?e(re,{omitHead:C,columns:a,cardImage:i,outline:m,indexBadge:p,num:r,title:t||s.heading,description:c,tyres:[...v.tyres].slice(0,R),footnote:_,footnoteLinkText:k,footnoteLinkHref:E,viewMore:D,editing:o}):v.wheels.length===0?o?F(A,{className:"border-b border-line py-[120px] max-view-desktop:py-20",style:B(i),children:[L,e("p",{className:`border-t border-line py-6 font-mono ${H.label} uppercase tracking-[0.18em] text-fg-dim`,children:T("Related products appear here on a product page.")})]}):null:e(z,{header:L,wheels:[...v.wheels].slice(0,R),columns:a,viewMore:D,cardImage:i,outline:m,indexBadge:p,showBadge:w,showCardPrice:x,showCardFinishes:n,showCardSizes:l,showCardBuy:u,showCardPage:f,coverIndex:h,imageBackground:g,hover:y})}function z({header:r,wheels:t,columns:c,viewMore:a,cardImage:b,outline:S,indexBadge:_,showBadge:k,showCardPrice:E,showCardFinishes:o,showCardSizes:C,showCardBuy:i,showCardPage:m,coverIndex:p,imageBackground:w,hover:x}){const n=W("rp");if(t.length===0)return null;const l=$[Math.min(4,Math.max(2,c))]??$[3],u=_??Q,f=ee(n,u),h=ne(n,l,{cards:t.length});return F(A,{className:"border-b border-line py-[120px] max-view-desktop:py-20",style:B(b),children:[f&&e("style",{children:f}),h&&e("style",{children:h}),r,e(se,{imageSizes:ae(l,t.length),imageBackgroundFill:Z(w,q),hover:x,coverIndex:p??J,outline:S??Y,indexBadge:u,showBadge:k??!0,showCardPrice:E??!0,showCardFinishes:o??!0,showCardSizes:C??I.showCardSizes,showCardBuy:i??I.showCardBuy,showCardPage:m??I.showCardPage,children:e("div",{className:`${n} grid gap-[2px] ${te} bg-[var(--catalog-grid-bg)] ${l}`,style:ie("2px"),children:t.map((g,y)=>e(oe,{wheel:g,variant:"catalog"},`${g.slug}-${y}`))})}),e("div",{className:"mt-10 flex",children:e(de,{href:a.href,label:a.label})})]})}export{Se as RelatedProductsBody,be as default,ve as supportedKinds};
1
+ "use client";import{jsx as e,jsxs as T}from"react/jsx-runtime";import P from"../SectionBand.js";import{useScopeClass as z}from"../../lib/use-scope-class.js";import{useEffect as V,useState as W}from"react";import{cardHoverOf as F}from"efficient-web-builder/format/lib/animation/hover";const U=F({},"ProductGrid");import Z from"../CompatibleTyres.js";import{cardRowsGrid as X,GridCardProvider as q,GridCards as J,gridIndexCss as Q}from"../GridCardTemplate.js";import{productGridColumnsClass as Y}from"../../lib/sections/product-grid-columns.js";import{containerGapProps as ee}from"efficient-web-builder/format/lib/content/container-gap";import{cardImageShapeTokens as _}from"efficient-web-builder/format/lib/content/card-image-shape";import{NO_FIELD_ANSWERS as re}from"../../lib/content/field-usage.js";import{gridClassImageSizes as te}from"../../lib/sections/card-image-sizes.js";import{fillRowCss as oe}from"../../lib/sections/fill-row.js";import ie from"efficient-web-builder/render/components/SectionHeader";import ne from"../ViewMoreLink.js";import{useSiteMenuLinks as se}from"../catalog/SiteMenuLinks.js";import{renderGold as I,renderHeadline as le}from"efficient-web-builder/render/components/goldPhrases";import ae from"./KindGate.js";import{loadProductCatalog as de}from"../useProductCatalog.js";import{PLP_KINDS as ce}from"../../lib/catalog/plp-item.js";import{relatedCardCount as pe,relatedViewMore as me}from"../../lib/catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as fe,relationshipApplies as ue,relationshipByKey as he}from"../../lib/catalog/relationships.js";import{useCurrentProduct as ge}from"../../lib/document/current-product.js";import{PLACEHOLDER_RELATED as H}from"../../lib/wheels/placeholder-wheel.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";const A={label:"text-[length:var(--size-label,13px)]"},ye=ce;function be(t){return e(ae,{kinds:ye,type:"RelatedProducts",editing:t.editing,children:e(xe,{...t})})}function xe({num:t,title:o,description:n,columns:c=3,cardCount:h,relationship:g=fe,footnote:y,footnoteLinkText:b,footnoteLinkHref:x,editing:r=!1,omitHead:p=!1,hover:v,ownerId:a="",template:d,cardImage:s,outline:m,indexBadge:f,columnsPhone:C,columnsTablet:M,gap:O,gapPhone:$}){const N={columns:c,columnsPhone:C,columnsTablet:M,gap:O,gapPhone:$,hover:v,ownerId:a,template:d,editing:r},l=ge(),j=se(),S=pe(h),[B,R]=W([]);V(()=>{if(l||!r)return;let E=!1;return de().then(G=>{const K=G.length>0?G:H;E||R(K)}).catch(()=>{E||R(H)}),()=>{E=!0}},[l,r]);const i=he(g);if(!i)return null;const k=me(i,j),w=p?null:e(ie,{num:t?I(t):void 0,title:le(o||i.heading,!1),description:n?I(n):void 0,accent:!0});if(!l)return r?e(D,{header:w,wheels:B.slice(0,S),viewMore:k,...N}):null;if(!ue(i,l.product.kind))return r?e(P,{className:"border-b border-line py-14 max-view-desktop:py-10",style:_(s),children:e("p",{className:`font-mono ${A.label} uppercase tracking-[0.18em] text-fg-dim`,children:L("“{relationship}” does not apply to this product. It is hidden on the live page.",{relationship:L(i.label)})})}):null;const u=i.resolve(l.product,l.relatedWheels);return u.kind==="tyre"?e(Z,{omitHead:p,columns:c,cardImage:s,outline:m,indexBadge:f,num:t,title:o||i.heading,description:n,tyres:[...u.tyres].slice(0,S),footnote:y,footnoteLinkText:b,footnoteLinkHref:x,viewMore:k,editing:r}):u.wheels.length===0?r?T(P,{className:"border-b border-line py-[120px] max-view-desktop:py-20",style:_(s),children:[w,e("p",{className:`border-t border-line py-6 font-mono ${A.label} uppercase tracking-[0.18em] text-fg-dim`,children:L("Related products appear here on a product page.")})]}):null:e(D,{header:w,wheels:[...u.wheels].slice(0,S),viewMore:k,...N})}function D({header:t,wheels:o,viewMore:n,columns:c,columnsPhone:h,columnsTablet:g,gap:y,gapPhone:b,hover:x,ownerId:r,template:p,editing:v}){const a=z("rp");if(o.length===0)return null;const d=Y(c,h,g),s=X(ee("ProductGrid",y,"both",b)),m=Q(a),f=oe(a,d,{cards:o.length});return T(P,{className:"border-b border-line py-[120px] max-view-desktop:py-20",children:[m&&e("style",{children:m}),f&&e("style",{children:f}),t,e(q,{value:{ownerId:r,Template:p,hover:x??U,imageSizes:te(d,o.length),fieldUsage:re,reserveEyebrow:!1,editing:v},children:e(J,{wheels:o,children:C=>e("div",{className:`${a} grid${s.className} bg-[var(--catalog-grid-bg)] ${d}`,style:s.style,children:C})})}),e("div",{className:"mt-10 flex",children:e(ne,{href:n.href,label:n.label})})]})}export{xe as RelatedProductsBody,be as default,ye as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import b from"../SpecTable.js";import k from"./KindGate.js";import{DynamicEuTyreLabelBlock as v}from"./DynamicEuTyreLabel.js";import{buildSpecSheet as z,sourceFromWheel as E}from"../../lib/wheels/spec-sheet.js";import{buildTyreSpecSheet as I}from"../../lib/tyres/spec-sheet.js";import{partVariant as L}from"../../lib/catalog/from-wheel.js";import{useCurrentProduct as P}from"../../lib/document/current-product.js";import{applySpecAnswers as h}from"../../lib/content/field-usage.js";import{useSampleProduct as j}from"./useSampleProduct.js";const A=["alloy-wheel","tyre"],B=[];function D(t,r,i){const o=t.variants??[];return(r?o.find(n=>n.sku===r):void 0)??(i?o.find(n=>n.size===i):void 0)??o[0]??null}function G(t){return a(k,{kinds:A,type:"SpecTable",editing:t.editing,children:a(K,{...t})})}function K({num:t,title:r,description:i,showDiagram:o=!0,editing:n=!1,nodeId:d,omitHead:u=!1,template:p,showEuLabel:y=!1}){const e=P(),w=j(n&&!e),l=e?.product??w,c=l?.kind==="tyre"?l.source:null,m=e?.fieldUsage??B;if(c){const T=D(c,e?.selection.part?.id,e?.selection.shown.size),x=I({brand:c.brand,variant:T});return a(b,{capped:!1,builtInLabels:!0,num:t,title:r,description:i,rows:h(x.rows,m),diagram:null,editing:n,nodeId:d,omitHead:u,template:p,footer:y?a(v,{editing:n}):void 0})}const s=l?.kind==="alloy-wheel"?l.source:null,S=e?e.selection.shown.finish:s?.finishes[0]?.name,g=e&&s?L(s,e.selection.part)?.size??void 0:void 0,f=s?z(E(s),S,g):{rows:[],diagram:null};return a(b,{capped:!1,builtInLabels:!0,num:t,title:r,description:i,rows:h(f.rows,m),diagram:o?f.diagram:null,editing:n,nodeId:d,omitHead:u,template:p})}export{G as default,A as supportedKinds};
1
+ "use client";import{jsx as a}from"react/jsx-runtime";import b from"../SpecTable.js";import k from"./KindGate.js";import{DynamicEuTyreLabelBlock as I}from"./DynamicEuTyreLabel.js";import{buildSpecSheet as L,sourceFromWheel as v}from"../../lib/wheels/spec-sheet.js";import{buildTyreSpecSheet as z}from"../../lib/tyres/spec-sheet.js";import{partVariant as D}from"../../lib/catalog/from-wheel.js";import{useCurrentProduct as E}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as N,applySpecAnswers as h}from"../../lib/content/field-usage.js";import{useSampleProduct as _}from"./useSampleProduct.js";const j=["alloy-wheel","tyre"];function A(t,r,i){const o=t.variants??[];return(r?o.find(n=>n.sku===r):void 0)??(i?o.find(n=>n.size===i):void 0)??o[0]??null}function B(t){return a(k,{kinds:j,type:"SpecTable",editing:t.editing,children:a(F,{...t})})}function F({num:t,title:r,description:i,showDiagram:o=!0,editing:n=!1,nodeId:d,omitHead:u=!1,template:p,showEuLabel:y=!1}){const e=E(),w=_(n&&!e),l=e?.product??w,c=l?.kind==="tyre"?l.source:null,m=e?.fieldUsage??N;if(c){const T=A(c,e?.selection.part?.id,e?.selection.shown.size),x=z({brand:c.brand,variant:T});return a(b,{capped:!1,builtInLabels:!0,num:t,title:r,description:i,rows:h(x.rows,m),diagram:null,editing:n,nodeId:d,omitHead:u,template:p,footer:y?a(I,{editing:n}):void 0})}const s=l?.kind==="alloy-wheel"?l.source:null,S=e?e.selection.shown.finish:s?.finishes[0]?.name,g=e&&s?D(s,e.selection.part)?.size??void 0:void 0,f=s?L(v(s),S,g):{rows:[],diagram:null};return a(b,{capped:!1,builtInLabels:!0,num:t,title:r,description:i,rows:h(f.rows,m),diagram:o?f.diagram:null,editing:n,nodeId:d,omitHead:u,template:p})}export{B as default,j as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import u from"./KindGate.js";import{TyreSizesContent as m}from"../TyreSizeGrid.js";import{useCurrentProduct as p}from"../../lib/document/current-product.js";import{useSampleProduct as f}from"./useSampleProduct.js";const l=[],y=["tyre"];function S(t){return r(u,{kinds:y,type:"TyreSizes",editing:t.editing,children:r(x,{...t})})}function x({num:t,title:o,description:s,editing:i=!1,omitHead:c=!1}){const e=p(),d=f(i&&!e),n=e?.product??d,a=n?.kind==="tyre"?n.source.variants:[];return r(m,{variants:a,fieldUsage:e?.fieldUsage??l,num:t,title:o,description:s,editing:i,omitHead:c})}export{S as default,y as supportedKinds};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import m from"./KindGate.js";import{TyreSizesContent as u}from"../TyreSizeGrid.js";import{useCurrentProduct as p}from"../../lib/document/current-product.js";import{NO_FIELD_ANSWERS as f}from"../../lib/content/field-usage.js";import{useSampleProduct as l}from"./useSampleProduct.js";const y=["tyre"];function S(t){return r(m,{kinds:y,type:"TyreSizes",editing:t.editing,children:r(x,{...t})})}function x({num:t,title:n,description:s,editing:i=!1,omitHead:d=!1}){const e=p(),a=l(i&&!e),o=e?.product??a,c=o?.kind==="tyre"?o.source.variants:[];return r(u,{variants:c,fieldUsage:e?.fieldUsage??f,num:t,title:n,description:s,editing:i,omitHead:d})}export{S as default,y as supportedKinds};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as p,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as O}from"../../lib/sections/card-show-defaults.js";import{useScopeClass as Qe}from"../../lib/use-scope-class.js";import{useCallback as d,useEffect as Ze,useMemo as i,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as at}from"../CurrencyContext.js";import ct from"../NoCurrencyNote.js";import{usePreviewDevice as pt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as dt,renderHeadline as mt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ht}from"../useProductCatalog.js";import{scrollBehavior as ut}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as ft,PLP_GRID_GAP_VAR as gt,plpGridVars as yt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as St}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as xt,cardRowsGridStyle as wt}from"../WheelCardFrame.js";import{applyPlpFilters as bt,buildPlpFacets as Ct,buildPlpTypeOptions as Pt,buildTyreSizeBoxes as kt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as vt,paginatePlp as Nt,pickTyreSize as Tt,plpTyreSizeBoxesShown as _t,plpInStockCount as At,plpOpeningSort as zt,plpPriceBounds as Ft,plpShownKinds as Bt,plpSortKeysFor as It,PLP_SORT_LABELS as Ot}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as R,itemTyreSizes as Rt,plpBrandVaries as Lt,plpProcessVaries as Vt,plpItemsOfKinds as Et,plpKindNoun as L,resolvePlpKinds as Dt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Gt,plpVehicleCopy as Kt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as jt,oemTyreSizes as Mt}from"../../lib/tyres/tyre-vehicle-fitment.js";import $t from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Wt}from"../../lib/wheels/plp-fitment-match.js";import Ut from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Ht}from"../../lib/wheels/cover-rendering.js";import Xt from"./PlpCard.js";import Yt from"./PlpPagination.js";import qt from"./PlpSidebar.js";import{PlpResultRange as Jt,PlpToolbar as Qt}from"./PlpToolbar.js";import Zt from"../catalog/SortSelect.js";import eo from"./PlpVehicleBar.js";import to from"./PlpVehicleGate.js";import{useVehicleCatalog as oo}from"./useVehicleCatalog.js";import{useVehicleFit as ro}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as no}from"./usePlpFiltersInUrl.js";import{say as V}from"efficient-web-builder/format/lib/editor-words";const Wo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function so({level:C,className:P,children:k}){return r(C===2?"h2":"h1",{className:P,children:k})}const io=[];function lo({heading:C="",intro:P="",askForCar:k=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:f=io,showPrice:G=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:m=!1,coverIndex:ye=Ht,cardImage:Se,hover:xe,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Pe,showCardPage:ke,showCardPrice:ve,showCardFinishes:Ne,outline:Te=lt,indexBadge:K=it,titleLevel:_e}){const{currency:l}=at(),Ae=rt(we,ot),h=Dt(he),j=pt(),M=ft(ce),ze=yt(M,m?j:null),Fe=St(M,m?j:null),$=Qe("plp"),F=st($,K),Be=ht(),W=ue??fe??Be??[],U=i(()=>Et(W,h),[W,h.join(",")]),o=ro({editing:m,enabled:k,autoApply:!0}),[Ie,B]=tt(!1),Oe=zt(pe,h),g=o.applied?.vehicle??null,[e,x]=no({editing:m,openingSort:Oe,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=Bt(h,e.kind),s=d(t=>x(t),[x]),H=d((t,u)=>{const a=e[t],qe=a.map(String).includes(u)?a.filter(Je=>String(Je)!==u):[...a,t==="diameters"?Number(u):u];s({...e,[t]:qe,page:1})},[e,s]),X=d(t=>s({...e,priceMax:t,page:1}),[e,s]),Y=d(t=>s({...e,inStockOnly:t,page:1}),[e,s]),q=d(t=>s({...le,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Re=d(t=>s({...e,sort:t,page:1}),[e,s]),Le=d(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:ut()})},[e,s]),J=d(()=>s({...le,sort:e.sort}),[e.sort,s]),{clear:N}=o,Q=d(()=>{N(),B(!0),x(t=>({...t,page:1}))},[N]),Ve=d(()=>{N(),B(!1),x(t=>({...t,page:1}))},[N]),T=g?[g.make,g.model,g.year,g.modification].join("|"):"",_=et(null);Ze(()=>{if(o.restored){if(_.current===null){_.current=T;return}_.current!==T&&(_.current=T,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,T,x]);const A=oo({catalog:U,shownKinds:h,vehicle:g,editing:m}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>z(a)==="alloy-wheel"),u=new Set(Wt(t,o.fit).map(a=>a.slug));return A.filter(a=>z(a)!=="alloy-wheel"||u.has(R(a)))},[A,o.fit]),w=de.join(","),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return Ct(n,e,l,c,f).filter(u=>!t.has(u.key))},[n,e,l,w,c.join(","),f]),y=i(()=>bt(n,e,l),[n,e,l]),Z=c.length>1,De=i(()=>ie(f,"alloy-wheel"),[f]),Ge=i(()=>ie(f,"tyre"),[f]),ee=i(()=>Lt(y),[y]),Ke=i(()=>Vt(y),[y]),je=i(()=>G?Ft(n,l):null,[n,l,G]),Me=i(()=>At(n,e,l),[n,e,l]),$e=i(()=>Pt(n,h,e,l),[n,h.join(","),e,l]),We=d((t,u)=>{const a=Tt(n.flatMap(Rt),e.tyreSizes[0]??"",t,u);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ue=i(()=>{const t=new Set(w?w.split(","):[]);return!_t(n,c)||t.has("tyreSizes")?null:kt(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>Nt(y,e.page,D),[y,e.page,D]),b=L(c),I=Kt(c),te=Gt(E,ae,c,h),oe=c.length===1&&c[0]==="tyre",re=o.applied?.stock??null,v=i(()=>Mt(re),[re]),He=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),ne=U.length===0,Xe=!ne&&n.length===0,Ye=k&&!m&&!o.applied&&!Ie;return h.length===0?null:p("section",{style:nt(Se),children:[k&&r(eo,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&v.length>0?`Takes ${v.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&v.length===0:o.unresolved,matchCount:He,copy:I,onAmend:Ve,onClear:Q}),Ye&&r(to,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:I,onSkip:()=>B(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||P)&&p("header",{className:"mb-6",children:[C&&r(so,{level:_e,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:mt(C,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:dt(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(qt,{facets:Ee,filters:e,typeOptions:$e,sizeBoxes:Ue,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:je,inStockCount:me?Me:null,onToggle:H,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),p("div",{className:"min-w-0 flex-1",children:[r(Qt,{className:"mb-4",start:p(se,{children:[r(Jt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Ut,{filters:e,onToggle:H,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),end:r(Zt,{value:e.sort,keys:It(h),labels:Ot,onChange:Re})}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?b.many==="wheels"?V("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?V("No tyres in this website's catalog yet — curate products to see them here."):V("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:I.nothingFits}),p("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),vt(e)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${xt}`,style:{...ze,...wt(`var(${gt})`)},children:S.items.map(t=>z(t)==="tyre"?r($t,{item:t,currency:l,fitSize:v.length>0?jt(t.sizes,v):null,kindLabel:Z?L(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:Ge},`tyre:${R(t)}`):r(Xt,{wheel:t,colours:e.finishes,fit:o.fit,editing:m,kindLabel:Z?L(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:Ke,hover:xe,imageBackgroundFill:Ae,showBadge:be,outline:Te,indexBadge:K,showCardSizes:Ce??O.showCardSizes,showCardBuy:Pe??O.showCardBuy,showCardPage:ke??O.showCardPage,showCardPrice:ve??!0,showCardFinishes:Ne??!0,imageSizes:Fe},`wheel:${R(t)}`))})]}),r(Yt,{page:S.page,pageCount:S.pageCount,onPage:Le}),r(ct,{editing:m})]})]})]})]})}export{Wo as PLP_GATE_DEFAULTS,lo as default};
1
+ "use client";import{jsx as r,jsxs as p,Fragment as se}from"react/jsx-runtime";import{LISTING_CARD_SHOW as O}from"../../lib/sections/card-show-defaults.js";import{useScopeClass as Qe}from"../../lib/use-scope-class.js";import{useCallback as d,useEffect as Ze,useMemo as i,useRef as et,useState as tt}from"react";import{CARD_IMAGE_BG_OFF as ot,resolveCardImageBackground as rt}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as nt}from"efficient-web-builder/format/lib/content/card-image-shape";import{cardIndexCss as st,DEFAULT_CARD_INDEX_FORMAT as it,DEFAULT_CARD_OUTLINE as lt}from"efficient-web-builder/format/lib/sections/product-card-style";import{NO_FIELD_ANSWERS as at,answersForKind as ie}from"../../lib/content/field-usage.js";import{useCurrency as ct}from"../CurrencyContext.js";import pt from"../NoCurrencyNote.js";import{usePreviewDevice as dt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as mt,renderHeadline as ht}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as ut}from"../useProductCatalog.js";import{scrollBehavior as ft}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as gt,PLP_GRID_GAP_VAR as yt,plpGridVars as St}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as xt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as wt,cardRowsGridStyle as bt}from"../WheelCardFrame.js";import{applyPlpFilters as Ct,buildPlpFacets as Pt,buildPlpTypeOptions as kt,buildTyreSizeBoxes as vt,EMPTY_PLP_FILTERS as le,hasActivePlpFilters as Nt,paginatePlp as _t,pickTyreSize as Tt,plpTyreSizeBoxesShown as At,plpInStockCount as zt,plpOpeningSort as Ft,plpPriceBounds as It,plpShownKinds as Bt,plpSortKeysFor as Ot,PLP_SORT_LABELS as Lt}from"../../lib/wheels/plp-filters.js";import{itemKind as z,itemSlug as L,itemTyreSizes as Rt,plpBrandVaries as Vt,plpProcessVaries as Et,plpItemsOfKinds as Dt,plpKindNoun as R,resolvePlpKinds as Gt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Kt,plpVehicleCopy as jt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Mt,oemTyreSizes as $t}from"../../lib/tyres/tyre-vehicle-fitment.js";import Wt from"../TyreSummaryCard.js";import{wheelsFittingVehicle as Ut}from"../../lib/wheels/plp-fitment-match.js";import Ht from"./PlpActiveChips.js";import{DEFAULT_COVER_INDEX as Xt}from"../../lib/wheels/cover-rendering.js";import Yt from"./PlpCard.js";import qt from"./PlpPagination.js";import Jt from"./PlpSidebar.js";import{PlpResultRange as Qt,PlpToolbar as Zt}from"./PlpToolbar.js";import eo from"../catalog/SortSelect.js";import to from"./PlpVehicleBar.js";import oo from"./PlpVehicleGate.js";import{useVehicleCatalog as ro}from"./useVehicleCatalog.js";import{useVehicleFit as no}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as so}from"./usePlpFiltersInUrl.js";import{say as V}from"efficient-web-builder/format/lib/editor-words";const Wo={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function io({level:C,className:P,children:k}){return r(C===2?"h2":"h1",{className:P,children:k})}function lo({heading:C="",intro:P="",askForCar:k=!0,gateHeading:E="",gateIntro:ae="",perPage:D=24,columns:ce,defaultSort:pe="recommended",hiddenFacets:de=[],fieldUsage:f=at,showPrice:G=!0,showInStock:me=!0,kinds:he,products:ue,wheels:fe,requestQuery:ge,editing:m=!1,coverIndex:ye=Xt,cardImage:Se,hover:xe,imageBackground:we,showBadge:be=!0,showCardSizes:Ce,showCardBuy:Pe,showCardPage:ke,showCardPrice:ve,showCardFinishes:Ne,outline:_e=lt,indexBadge:K=it,titleLevel:Te}){const{currency:l}=ct(),Ae=rt(we,ot),h=Gt(he),j=dt(),M=gt(ce),ze=St(M,m?j:null),Fe=xt(M,m?j:null),$=Qe("plp"),F=st($,K),Ie=ut(),W=ue??fe??Ie??[],U=i(()=>Dt(W,h),[W,h.join(",")]),o=no({editing:m,enabled:k,autoApply:!0}),[Be,I]=tt(!1),Oe=Ft(pe,h),g=o.applied?.vehicle??null,[e,x]=so({editing:m,openingSort:Oe,appliedVehicle:g,vehicleRestored:o.restored,requestQuery:ge}),c=Bt(h,e.kind),s=d(t=>x(t),[x]),H=d((t,u)=>{const a=e[t],qe=a.map(String).includes(u)?a.filter(Je=>String(Je)!==u):[...a,t==="diameters"?Number(u):u];s({...e,[t]:qe,page:1})},[e,s]),X=d(t=>s({...e,priceMax:t,page:1}),[e,s]),Y=d(t=>s({...e,inStockOnly:t,page:1}),[e,s]),q=d(t=>s({...le,kind:t,inStockOnly:e.inStockOnly,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMax,e.sort,s]),Le=d(t=>s({...e,sort:t,page:1}),[e,s]),Re=d(t=>{s({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:ft()})},[e,s]),J=d(()=>s({...le,sort:e.sort}),[e.sort,s]),{clear:N}=o,Q=d(()=>{N(),I(!0),x(t=>({...t,page:1}))},[N]),Ve=d(()=>{N(),I(!1),x(t=>({...t,page:1}))},[N]),_=g?[g.make,g.model,g.year,g.modification].join("|"):"",T=et(null);Ze(()=>{if(o.restored){if(T.current===null){T.current=_;return}T.current!==_&&(T.current=_,x(t=>t.page===1?t:{...t,page:1}))}},[o.restored,_,x]);const A=ro({catalog:U,shownKinds:h,vehicle:g,editing:m}),n=i(()=>{if(!o.fit)return A;const t=A.filter(a=>z(a)==="alloy-wheel"),u=new Set(Ut(t,o.fit).map(a=>a.slug));return A.filter(a=>z(a)!=="alloy-wheel"||u.has(L(a)))},[A,o.fit]),w=de.join(","),Ee=i(()=>{const t=new Set(w?w.split(","):[]);return Pt(n,e,l,c,f).filter(u=>!t.has(u.key))},[n,e,l,w,c.join(","),f]),y=i(()=>Ct(n,e,l),[n,e,l]),Z=c.length>1,De=i(()=>ie(f,"alloy-wheel"),[f]),Ge=i(()=>ie(f,"tyre"),[f]),ee=i(()=>Vt(y),[y]),Ke=i(()=>Et(y),[y]),je=i(()=>G?It(n,l):null,[n,l,G]),Me=i(()=>zt(n,e,l),[n,e,l]),$e=i(()=>kt(n,h,e,l),[n,h.join(","),e,l]),We=d((t,u)=>{const a=Tt(n.flatMap(Rt),e.tyreSizes[0]??"",t,u);s({...e,tyreSizes:a?[a]:[],page:1})},[n,e,s]),Ue=i(()=>{const t=new Set(w?w.split(","):[]);return!At(n,c)||t.has("tyreSizes")?null:vt(n,e,l)},[n,e,l,w,c.join(","),f]),S=i(()=>_t(y,e.page,D),[y,e.page,D]),b=R(c),B=jt(c),te=Kt(E,ae,c,h),oe=c.length===1&&c[0]==="tyre",re=o.applied?.stock??null,v=i(()=>$t(re),[re]),He=i(()=>n.filter(t=>c.includes(z(t))).length,[n,c.join(",")]),ne=U.length===0,Xe=!ne&&n.length===0,Ye=k&&!m&&!o.applied&&!Be;return h.length===0?null:p("section",{style:nt(Se),children:[k&&r(to,{cascade:o.cascade,appliedName:o.appliedName,fit:o.fit,fitSummary:oe&&v.length>0?`Takes ${v.join(" · ")}`:null,resolving:o.resolving,unresolved:oe?!!o.applied&&!o.resolving&&v.length===0:o.unresolved,matchCount:He,copy:B,onAmend:Ve,onClear:Q}),Ye&&r(oo,{cascade:o.cascade,heading:te.heading,intro:te.intro,ready:o.restored,copy:B,onSkip:()=>I(!0)}),p("div",{className:"px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]",children:[(C||P)&&p("header",{className:"mb-6",children:[C&&r(io,{level:Te,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:ht(C,!1)}),P&&r("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:mt(P)})]}),p("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[r(Jt,{facets:Ee,filters:e,typeOptions:$e,sizeBoxes:Ue,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:b,priceBounds:je,inStockCount:me?Me:null,onToggle:H,onPickType:q,onPickSize:We,onPriceMax:X,onInStockOnly:Y,onClearAll:J}),p("div",{className:"min-w-0 flex-1",children:[r(Zt,{className:"mb-4",start:p(se,{children:[r(Qt,{total:S.total,range:{from:S.from,to:S.to},noun:b}),r(Ht,{filters:e,onToggle:H,onPriceMax:X,onInStockOnly:Y,onPickType:q})]}),end:r(eo,{value:e.sort,keys:Ot(h),labels:Lt,onChange:Le})}),ne?r("div",{className:"border border-dashed border-line p-10",children:r("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:m?b.many==="wheels"?V("No wheels in this website's catalog yet — curate products to see them here."):b.many==="tyres"?V("No tyres in this website's catalog yet — curate products to see them here."):V("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):Xe?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",o.appliedName]}),r("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:B.nothingFits}),p("button",{type:"button",onClick:Q,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",b.many]})]}):S.total===0?p("div",{className:"border border-line p-10",children:[p("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",b.many," match those filters"]}),r("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),Nt(e)&&r("button",{type:"button",onClick:J,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):p(se,{children:[F&&r("style",{children:F}),r("div",{className:`${F?`${$} plp-card-grid`:"plp-card-grid"} ${wt}`,style:{...ze,...bt(`var(${yt})`)},children:S.items.map(t=>z(t)==="tyre"?r(Wt,{item:t,currency:l,fitSize:v.length>0?Mt(t.sizes,v):null,kindLabel:Z?R(["tyre"]).one:null,showBrand:ee,editing:m,fieldUsage:Ge},`tyre:${L(t)}`):r(Yt,{wheel:t,colours:e.finishes,fit:o.fit,editing:m,kindLabel:Z?R(["alloy-wheel"]).one:null,showBrand:ee,coverIndex:ye,fieldUsage:De,showProcess:Ke,hover:xe,imageBackgroundFill:Ae,showBadge:be,outline:_e,indexBadge:K,showCardSizes:Ce??O.showCardSizes,showCardBuy:Pe??O.showCardBuy,showCardPage:ke??O.showCardPage,showCardPrice:ve??!0,showCardFinishes:Ne??!0,imageSizes:Fe},`wheel:${L(t)}`))})]}),r(qt,{page:S.page,pageCount:S.pageCount,onPage:Re}),r(pt,{editing:m})]})]})]})]})}export{Wo as PLP_GATE_DEFAULTS,lo as default};
@@ -1,7 +1,7 @@
1
1
  import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
2
2
  import type { WheelSummary } from "../../lib/api/index.js";
3
3
  import { type CardIndexFormat, type CardOutline } from "efficient-web-builder/format/lib/sections/product-card-style";
4
- import type { FieldUsageAnswer } from "../../lib/content/field-usage.js";
4
+ import { type FieldUsageAnswer } from "../../lib/content/field-usage.js";
5
5
  import { type VehicleFitment } from "../../lib/wheels/plp-fitment-match.js";
6
6
  export interface PlpCardProps {
7
7
  wheel: WheelSummary;
@@ -1 +1 @@
1
- "use client";import{jsx as r,Fragment as T,jsxs as G}from"react/jsx-runtime";import{CARD_IMAGE_SIZES as M}from"../../lib/sections/card-image-sizes.js";import{LISTING_CARD_SHOW as B}from"../../lib/sections/card-show-defaults.js";import U from"next/image";import{useHeldCardPicture as X}from"../card-pieces/useHeldCardPicture.js";import{useState as H}from"react";import V from"../BrandPlate.js";import Z,{CardBuyDialog as q}from"../card-pieces/CardBuyButton.js";import J from"../card-pieces/CardFinishSwatches.js";import K from"../card-pieces/CardPrice.js";import Q from"../card-pieces/CardProductBadge.js";import{useWheelCardState as Y,WheelCardStateProvider as ee}from"../card-pieces/ProductCardState.js";import{wheelCardEyebrow as re,wheelCardEyebrowShows as oe}from"../ProductCardEyebrow.js";import{withRMark as k}from"efficient-web-builder/render/components/RMark";import ae from"../WheelPlaceholder.js";import{cardSpinOf as se}from"../card-spin.js";import{cardHoverOf as te}from"efficient-web-builder/format/lib/animation/hover";import{CardSpecFacts as ne}from"../card-pieces/CardSpecs.js";import ie from"../WheelCardFrame.js";import{CARD_IMAGE_BG_OFF as le}from"efficient-web-builder/format/lib/content/card-image-background";import{itemBrand as de}from"../../lib/catalog/plp-item.js";import{CARD_INDEX_BADGE_CLASS as me,CARD_INDEX_CLASS as ce,DEFAULT_CARD_INDEX_FORMAT as he,DEFAULT_CARD_OUTLINE as pe}from"efficient-web-builder/format/lib/sections/product-card-style";import{setSecondSrc as ue}from"../../lib/wheels/set-mode.js";import{PLP_GRID_GAP_VAR as fe}from"../../lib/wheels/plp-grid.js";import{FITMENT_FIELD_SEPARATOR as we}from"../../lib/wheels/plp-fitment-match.js";import{coverSrcForWheel as Se,DEFAULT_COVER_INDEX as Ce,resolvePaintedSrc as ge}from"../../lib/wheels/cover-rendering.js";const _e=[],Ee=te({},"AlloyWheelsListing");function Ae({wheel:i,colours:p,fit:l=null,editing:d=!1,brandPlate:m=!1,kindLabel:u=null,showBrand:t=!0,showProcess:f=!1,coverIndex:w=Ce,fieldUsage:S=_e,hover:C=Ee,imageBackgroundFill:g=le,showBadge:_=!0,outline:E=pe,indexBadge:A=he,showCardSizes:F=B.showCardSizes,showCardBuy:b=B.showCardBuy,showCardPage:c=B.showCardPage,showCardPrice:o=!0,showCardFinishes:e=!0,imageSizes:h=M}){return r(ee,{wheel:i,colours:p,editing:d,children:r(Fe,{fit:l,brandPlate:m,kindLabel:u,showBrand:t,showProcess:f,coverIndex:w,fieldUsage:S,hover:C,imageBackgroundFill:g,showBadge:_,outline:E,indexBadge:A,showCardSizes:F,showCardBuy:b,showCardPage:c,showCardPrice:o,showCardFinishes:e,imageSizes:h})})}function Fe({fit:i,brandPlate:p,kindLabel:l,showBrand:d,showProcess:m,coverIndex:u,fieldUsage:t,hover:f,imageBackgroundFill:w,showBadge:S,outline:C,indexBadge:g,showCardSizes:_,showCardBuy:E,showCardPage:A,showCardPrice:F,showCardFinishes:b,imageSizes:c}){const{wheel:o,sel:e,isSet:h}=Y(),x=Se(o,u,e.finish?.name,e.shownSrc,i?.holes),[D,O]=H(()=>new Set),y=a=>{e.pictureFailed(a),O(n=>n.has(a)?n:new Set(n).add(a))},R=ge({overrideSrc:x,hookSrc:e.shownSrc,failed:D}),P=de(o),I=se(f),L=(a,n)=>r(U,{alt:n,src:a,width:800,height:800,sizes:c,className:["block h-full w-full object-contain",I.className].filter(Boolean).join(" "),style:I.style,draggable:!1,onError:()=>y(a)},a),W=e.finish?`${o.name} — ${e.finish.name}`:o.name,v=h?ue(o.finishes?.find(a=>a.name===e.finish?.name),R):null,s=X({src:R,second:v,alt:W,sizes:c,failed:D,onFailed:y,near:e.nearScreen,holdEmpty:e.awaitingProbe}),$=G(T,{children:[s.src?L(s.src,s.alt):r(ae,{imageLabel:o.name,spin:I}),s.trial]}),j=s.second?L(s.second,`${s.alt} — right`):void 0,N=g!=="off"?r("span",{"aria-hidden":!0,className:`${ce} ${me}`}):null,z=re({kindLabel:l,brand:d&&P?k(P):null,process:m&&o.process?k(o.process):null},t);return G(T,{children:[r(ie,{href:`/wheels/${o.slug}`,wide:h,setGridGap:`var(${fe})`,identityLink:!0,containerProps:{onPointerEnter:e.arm,onTouchStart:e.arm,onFocusCapture:e.arm},probes:e.probes,outline:C,imageBackgroundFill:w,indexBadge:N,badges:r(Q,{show:S,numbered:N!=null,sale:!0}),image:$,imageSecond:j,plate:p?r(V,{brand:P,logo:o.brandLogo}):null,eyebrow:z,wholeCardLink:!0,reserveEyebrow:oe({kind:!!l,brand:d,process:m},t),spec:r(ne,{sizes:_,fieldUsage:t,car:i,separator:we}),price:r(K,{show:F,setTotal:!0,wasFollowsSize:!0}),swatches:r(J,{show:b,showSingle:!0}),buy:r(Z,{buy:E,page:A})}),r(q,{})]})}export{Ae as default};
1
+ "use client";import{jsx as r,Fragment as T,jsxs as G}from"react/jsx-runtime";import{CARD_IMAGE_SIZES as M}from"../../lib/sections/card-image-sizes.js";import{LISTING_CARD_SHOW as D}from"../../lib/sections/card-show-defaults.js";import U from"next/image";import{useHeldCardPicture as X}from"../card-pieces/useHeldCardPicture.js";import{useState as H}from"react";import V from"../BrandPlate.js";import Z,{CardBuyDialog as q}from"../card-pieces/CardBuyButton.js";import J from"../card-pieces/CardFinishSwatches.js";import K from"../card-pieces/CardPrice.js";import Q from"../card-pieces/CardProductBadge.js";import{useWheelCardState as Y,WheelCardStateProvider as ee}from"../card-pieces/ProductCardState.js";import{wheelCardEyebrow as re,wheelCardEyebrowShows as oe}from"../ProductCardEyebrow.js";import{withRMark as k}from"efficient-web-builder/render/components/RMark";import ae from"../WheelPlaceholder.js";import{cardSpinOf as te}from"../card-spin.js";import{cardHoverOf as se}from"efficient-web-builder/format/lib/animation/hover";import{CardSpecFacts as ie}from"../card-pieces/CardSpecs.js";import ne from"../WheelCardFrame.js";import{CARD_IMAGE_BG_OFF as le}from"efficient-web-builder/format/lib/content/card-image-background";import{itemBrand as de}from"../../lib/catalog/plp-item.js";import{CARD_INDEX_BADGE_CLASS as me,CARD_INDEX_CLASS as ce,DEFAULT_CARD_INDEX_FORMAT as he,DEFAULT_CARD_OUTLINE as pe}from"efficient-web-builder/format/lib/sections/product-card-style";import{NO_FIELD_ANSWERS as fe}from"../../lib/content/field-usage.js";import{setSecondSrc as ue}from"../../lib/wheels/set-mode.js";import{PLP_GRID_GAP_VAR as we}from"../../lib/wheels/plp-grid.js";import{FITMENT_FIELD_SEPARATOR as Se}from"../../lib/wheels/plp-fitment-match.js";import{coverSrcForWheel as Ce,DEFAULT_COVER_INDEX as ge,resolvePaintedSrc as _e}from"../../lib/wheels/cover-rendering.js";const Ee=se({},"AlloyWheelsListing");function Fe({wheel:n,colours:p,fit:l=null,editing:d=!1,brandPlate:m=!1,kindLabel:f=null,showBrand:s=!0,showProcess:u=!1,coverIndex:w=ge,fieldUsage:S=fe,hover:C=Ee,imageBackgroundFill:g=le,showBadge:_=!0,outline:E=pe,indexBadge:F=he,showCardSizes:A=D.showCardSizes,showCardBuy:b=D.showCardBuy,showCardPage:c=D.showCardPage,showCardPrice:o=!0,showCardFinishes:e=!0,imageSizes:h=M}){return r(ee,{wheel:n,colours:p,editing:d,children:r(Ae,{fit:l,brandPlate:m,kindLabel:f,showBrand:s,showProcess:u,coverIndex:w,fieldUsage:S,hover:C,imageBackgroundFill:g,showBadge:_,outline:E,indexBadge:F,showCardSizes:A,showCardBuy:b,showCardPage:c,showCardPrice:o,showCardFinishes:e,imageSizes:h})})}function Ae({fit:n,brandPlate:p,kindLabel:l,showBrand:d,showProcess:m,coverIndex:f,fieldUsage:s,hover:u,imageBackgroundFill:w,showBadge:S,outline:C,indexBadge:g,showCardSizes:_,showCardBuy:E,showCardPage:F,showCardPrice:A,showCardFinishes:b,imageSizes:c}){const{wheel:o,sel:e,isSet:h}=Y(),x=Ce(o,f,e.finish?.name,e.shownSrc,n?.holes),[B,O]=H(()=>new Set),y=a=>{e.pictureFailed(a),O(i=>i.has(a)?i:new Set(i).add(a))},L=_e({overrideSrc:x,hookSrc:e.shownSrc,failed:B}),I=de(o),P=te(u),R=(a,i)=>r(U,{alt:i,src:a,width:800,height:800,sizes:c,className:["block h-full w-full object-contain",P.className].filter(Boolean).join(" "),style:P.style,draggable:!1,onError:()=>y(a)},a),W=e.finish?`${o.name} — ${e.finish.name}`:o.name,v=h?ue(o.finishes?.find(a=>a.name===e.finish?.name),L):null,t=X({src:L,second:v,alt:W,sizes:c,failed:B,onFailed:y,near:e.nearScreen,holdEmpty:e.awaitingProbe}),$=G(T,{children:[t.src?R(t.src,t.alt):r(ae,{imageLabel:o.name,spin:P}),t.trial]}),j=t.second?R(t.second,`${t.alt} — right`):void 0,N=g!=="off"?r("span",{"aria-hidden":!0,className:`${ce} ${me}`}):null,z=re({kindLabel:l,brand:d&&I?k(I):null,process:m&&o.process?k(o.process):null},s);return G(T,{children:[r(ne,{href:`/wheels/${o.slug}`,wide:h,setGridGap:`var(${we})`,identityLink:!0,containerProps:{onPointerEnter:e.arm,onTouchStart:e.arm,onFocusCapture:e.arm},probes:e.probes,outline:C,imageBackgroundFill:w,indexBadge:N,badges:r(Q,{show:S,numbered:N!=null,sale:!0}),image:$,imageSecond:j,plate:p?r(V,{brand:I,logo:o.brandLogo}):null,eyebrow:z,wholeCardLink:!0,reserveEyebrow:oe({kind:!!l,brand:d,process:m},s),spec:r(ie,{sizes:_,fieldUsage:s,car:n,separator:Se}),price:r(K,{show:A,setTotal:!0,wasFollowsSize:!0}),swatches:r(J,{show:b,showSingle:!0}),buy:r(Z,{buy:E,page:F})}),r(q,{})]})}export{Fe as default};
@@ -12,6 +12,7 @@ export interface FieldUsageAnswer {
12
12
  specOrder?: number | null;
13
13
  fitmentOrder?: number | null;
14
14
  }
15
+ export declare const NO_FIELD_ANSWERS: readonly FieldUsageAnswer[];
15
16
  export declare function answersForKind(answers: readonly FieldUsageAnswer[], kind: string): readonly FieldUsageAnswer[];
16
17
  export declare function applyCardAnswers<T extends {
17
18
  fieldKey?: string;