efficient-storefront-blocks 0.70.0 → 0.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +57 -0
- package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +4 -0
- package/dist/chunks/{SiteEditorProvider-3GKJZDL5.js → SiteEditorProvider-N4T55FAV.js} +1 -1
- package/dist/chunks/chunk-3TBLX25X.js +1 -0
- package/dist/chunks/chunk-4V6BLJSG.js +1 -0
- package/dist/chunks/{chunk-QWHNN7GF.js → chunk-K26JUDGZ.js} +1 -1
- package/dist/chunks/chunk-SJODSVWU.js +1 -0
- package/dist/chunks/chunk-WPHE7RI4.js +246 -0
- package/dist/chunks/{fitment-data-6GK7QQQI.js → fitment-data-5ZSHENM3.js} +1 -1
- package/dist/contract.js +2 -2
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/PreviewHeader.d.ts +0 -1
- package/dist/editor/components/PreviewHeader.js +1 -11
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/index.js +1 -1
- package/dist/editor/lib/document/config.d.ts +2 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/efficient-block-sources.js +1 -1
- package/dist/editor/lib/header-settings-source.d.ts +2 -1
- package/dist/editor/lib/header-settings-source.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +19 -5
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +296 -200
- package/dist/links.d.ts +0 -2
- package/dist/links.js +1 -1
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +3 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/ChatLauncher.js +1 -1
- package/dist/render/components/ContactCards.d.ts +13 -0
- package/dist/render/components/ContactCards.js +1 -0
- package/dist/render/components/CopyText.d.ts +4 -0
- package/dist/render/components/CopyText.js +1 -0
- package/dist/render/components/Events.d.ts +3 -0
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FooterMessaging.d.ts +5 -0
- package/dist/render/components/FooterMessaging.js +1 -0
- package/dist/render/components/FooterPayment.d.ts +11 -0
- package/dist/render/components/FooterPayment.js +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/Header.d.ts +2 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderCallButton.d.ts +9 -0
- package/dist/render/components/HeaderCallButton.js +1 -0
- package/dist/render/components/HeaderToolBlocks.d.ts +1 -2
- package/dist/render/components/HeaderToolBlocks.js +1 -1
- package/dist/render/components/MessagingCards.d.ts +9 -0
- package/dist/render/components/MessagingCards.js +1 -0
- package/dist/render/components/QrCode.d.ts +5 -0
- package/dist/render/components/QrCode.js +1 -0
- package/dist/render/components/Reviews.d.ts +14 -4
- package/dist/render/components/Reviews.js +1 -1
- package/dist/render/components/SectionGroupBody.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.d.ts +2 -25
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -3
- package/dist/render/components/checkout/checkout-parts.d.ts +5 -0
- package/dist/render/components/checkout/checkout-parts.js +1 -0
- package/dist/render/components/checkout/checkout-state.d.ts +174 -0
- package/dist/render/components/checkout/checkout-state.js +3 -0
- package/dist/render/lib/api/index.d.ts +1 -8
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +10 -3
- package/dist/render/lib/content/site.d.ts +1 -1
- package/dist/render/lib/document/blocks/commerce/CountrySwitchBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +7 -0
- package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/ContactCards/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/ContactCards/render.js +1 -0
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/Footer/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterGroup/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterMessaging/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterMessaging/render.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.d.ts +3 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/FooterPayment/render.js +1 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/MessagingCards/render.js +1 -0
- package/dist/render/lib/document/blocks/service/Reviews/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
- package/dist/render/lib/document/blocks/service/metas.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/metas.js +1 -1
- package/dist/render/lib/document/blocks/service/renders.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +137 -6
- package/dist/render/lib/document/card-templates.d.ts +2 -0
- package/dist/render/lib/document/card-templates.js +1 -0
- package/dist/render/lib/document/footer-page-blocks.d.ts +1 -0
- package/dist/render/lib/document/footer-page-blocks.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-config.d.ts +2 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +1 -0
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -0
- package/dist/render/lib/links/link-rules.d.ts +1 -1
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/qr.d.ts +5 -0
- package/dist/render/lib/qr.js +1 -0
- package/dist/render/lib/sections/messaging.d.ts +45 -0
- package/dist/render/lib/sections/messaging.js +1 -0
- package/dist/render/lib/sections/reviews.d.ts +1 -0
- package/dist/render/lib/sections/reviews.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/collections.js +1 -1
- package/dist/words.d.ts +42 -10
- package/dist/words.js +4 -4
- package/package.json +7 -4
- package/dist/chunks/EditorPreviewCheckout-XI4VULPL.js +0 -4
- package/dist/chunks/chunk-RPLNV3WM.js +0 -1
- package/dist/chunks/chunk-SQH6XBRG.js +0 -1
- package/dist/chunks/chunk-TXTTPEQA.js +0 -1
- package/dist/chunks/chunk-XF2ZAVNU.js +0 -262
- package/dist/render/components/useStorefrontReviews.d.ts +0 -2
- package/dist/render/components/useStorefrontReviews.js +0 -1
- /package/dist/chunks/{chunk-XF2ZAVNU.js.LEGAL.txt → chunk-WPHE7RI4.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as tt,SITE_HOST_HEADER as et,SITE_SLUG_HEADER as rt}from"../site-headers.js";import{PRODUCT_API_BASE as at,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as st,clientIpFromForwardedFor as nt,FORWARDED_FOR_HEADER as ot,hopCachingOf as it}from"../forwarded-for.js";import ct from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as dt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const ut=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const U="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",lt=new Set([502,503,504]),I=0,pt="This editor runs on its host's own backend, which does not serve this request.",yt=5e3,ht=15e3,ft=()=>typeof window>"u"?yt:ht;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ft())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>lt.has(t)?U:e,gt=["admin","venue"];let M="admin";function ne(t){M=gt.includes(t)?t:"admin"}function mt(){return M}const wt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let F=null;function oe(t){F=t&&wt.test(t)?t:null}function St(){return F}function Pt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!dt())throw new m(I,pt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??ut}${Pt(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(I,U,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(I,U,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let O=null;async function B(){return O||(O=bt().finally(()=>{O=null}),O)}async function bt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ot={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as At,absolutizeApiUrl as N}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as Rt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Et}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ct,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?At(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as we}from"./origins.js";const z=typeof window>"u"&&k!=="",$t=z?k:at,_t=Ct,b=()=>({baseUrl:_t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function It(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const kt=t=>t instanceof m&&t.status===400;function Jt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Lt()).host}async function Lt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(et)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Dt(){try{const{headers:t}=await import("next/headers");return nt((await t()).get(ot))}catch{return null}}async function xt(){try{const{headers:t}=await import("next/headers");return(await t()).get(rt)||null}catch{return null}}async function Ht(){const t=await xt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await Ht())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Mt="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(tt)}catch{return null}}async function Bt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function v(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Mt}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Bt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function qt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Dt()]),o=st(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await qt(it(t)),s={baseUrl:$t,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const le={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),b())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),b())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),b())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),b())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),b())}},pe={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(It(t,s)));return J(g(e))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),kt);return Jt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async()=>{try{return await i(await f(d("/bundles")),await u())}catch{return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,b());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await v(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async(t={})=>{const e=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+e,await u())).map(o=>({...o,coverImage:N(o.coverImage)??""}))}catch(s){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:N(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await v(d("/header-settings"),{signal:t})),s=N(e.logoUrl);let o=null,l=null;if(s&&Rt(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await v(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},ye={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Gt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},R=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Wt=t=>`${R(t)}currencies/`,jt="/api/storefront/media/ingest/";class zt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Kt(){const t=Et();if(!t)throw new zt;return`${jt}?${new URLSearchParams({site:t})}`}const Vt="X-Puck-Media-Manifest",Y=ct.contentHash,_={"X-Media-Manifest":Y,[Vt]:Y},he=Q({});function Q(t){return(e,s={})=>{const o=St(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??mt()})}}function Xt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>$("header-settings",a,s),l=a=>$("theme-settings",a,s),p=a=>$("chat-settings",a,s),w=a=>$("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new Gt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),geocode:(a,r,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:a,country:n}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:_,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:_,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.sort_order-E.sort_order||S.name.localeCompare(E.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,E)=>S.title.localeCompare(E.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(R(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Wt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${R(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${R(a)}live-state/`,{token:r}),updateSite:(a,r,n)=>e(R(a),{method:"PATCH",body:JSON.stringify(r),token:n}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(Kt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const fe=Xt({siteDrafts:!0});export{ut as API_URL,Gt as AmbiguousPageSlugError,m as ApiError,ht as BROWSER_READ_TIMEOUT_MS,pt as EFFICIENT_CLIENT_CLOSED_MESSAGE,zt as MediaUploadDestinationError,Mt as PREVIEW_PARAM,we as PRODUCT_API_BASE,yt as SERVER_READ_TIMEOUT_MS,U as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,he as adminFetch,Ot as api,i as apiFetch,C as appendSiteQuery,ye as bookings,Xt as createStorefrontAdmin,D as defaultRequestDeadline,Kt as editorMediaUploadPath,mt as editorPortalAudience,St as editorRequestLanguage,le as fitment,pe as products,ft as readDeadlineMs,Dt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Lt as resolveSiteHostSource,xt as resolveSiteSlug,oe as setEditorLanguage,ne as setEditorPortalAudience,fe as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as tt,SITE_HOST_HEADER as et,SITE_SLUG_HEADER as rt}from"../site-headers.js";import{PRODUCT_API_BASE as at,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as st,clientIpFromForwardedFor as nt,FORWARDED_FOR_HEADER as ot,hopCachingOf as it}from"../forwarded-for.js";import ct from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as dt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const ut=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const U="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",lt=new Set([502,503,504]),I=0,pt="This editor runs on its host's own backend, which does not serve this request.",yt=5e3,ht=15e3,ft=()=>typeof window>"u"?yt:ht;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ft())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>lt.has(t)?U:e,gt=["admin","venue"];let M="admin";function ne(t){M=gt.includes(t)?t:"admin"}function mt(){return M}const wt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let F=null;function oe(t){F=t&&wt.test(t)?t:null}function St(){return F}function Pt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!dt())throw new m(I,pt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??ut}${Pt(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(I,U,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(I,U,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let O=null;async function B(){return O||(O=bt().finally(()=>{O=null}),O)}async function bt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ot={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as At,absolutizeApiUrl as N}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as Rt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Et}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ct,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?At(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as we}from"./origins.js";const z=typeof window>"u"&&k!=="",$t=z?k:at,_t=Ct,b=()=>({baseUrl:_t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function It(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const kt=t=>t instanceof m&&t.status===400;function Jt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Lt()).host}async function Lt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(et)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Dt(){try{const{headers:t}=await import("next/headers");return nt((await t()).get(ot))}catch{return null}}async function xt(){try{const{headers:t}=await import("next/headers");return(await t()).get(rt)||null}catch{return null}}async function Ht(){const t=await xt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Ht())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Mt="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(tt)}catch{return null}}async function Bt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function v(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Mt}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Bt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function qt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Dt()]),o=st(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await qt(it(t)),s={baseUrl:$t,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const le={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),b())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),b())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),b())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),b())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),b())}},pe={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(It(t,s)));return J(g(e))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),kt);return Jt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async()=>{try{return await i(await f(d("/bundles")),await u())}catch{return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,b());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await v(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async(t={})=>{const e=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+e,await u())).map(o=>({...o,coverImage:N(o.coverImage)??""}))}catch(s){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:N(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await v(d("/header-settings"),{signal:t})),s=N(e.logoUrl);let o=null,l=null;if(s&&Rt(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await v(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},ye={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Gt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Wt=t=>`${$(t)}currencies/`,jt="/api/storefront/media/ingest/";class zt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Kt(){const t=Et();if(!t)throw new zt;return`${jt}?${new URLSearchParams({site:t})}`}const Vt="X-Puck-Media-Manifest",Y=ct.contentHash,_={"X-Media-Manifest":Y,[Vt]:Y},he=Q({});function Q(t){return(e,s={})=>{const o=St(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??mt()})}}function Xt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>C("header-settings",a,s),l=a=>C("theme-settings",a,s),p=a=>C("chat-settings",a,s),w=a=>C("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new Gt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),geocode:(a,r,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:a,country:n}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:_,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:_,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e($(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Wt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${$(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${$(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(Kt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const fe=Xt({siteDrafts:!0});export{ut as API_URL,Gt as AmbiguousPageSlugError,m as ApiError,ht as BROWSER_READ_TIMEOUT_MS,pt as EFFICIENT_CLIENT_CLOSED_MESSAGE,zt as MediaUploadDestinationError,Mt as PREVIEW_PARAM,we as PRODUCT_API_BASE,yt as SERVER_READ_TIMEOUT_MS,U as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,he as adminFetch,Ot as api,i as apiFetch,E as appendSiteQuery,ye as bookings,Xt as createStorefrontAdmin,D as defaultRequestDeadline,Kt as editorMediaUploadPath,mt as editorPortalAudience,St as editorRequestLanguage,le as fitment,pe as products,ft as readDeadlineMs,Dt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Lt as resolveSiteHostSource,xt as resolveSiteSlug,oe as setEditorLanguage,ne as setEditorPortalAudience,fe as storefrontAdmin};
|
|
@@ -1391,7 +1391,7 @@ export interface components {
|
|
|
1391
1391
|
foundedYear: number | null;
|
|
1392
1392
|
commerceEnabled: boolean;
|
|
1393
1393
|
cardPayments: boolean;
|
|
1394
|
-
paymentMethods: ("card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna")[];
|
|
1394
|
+
paymentMethods: ("card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna" | "bank")[];
|
|
1395
1395
|
paypalClientId: string | null;
|
|
1396
1396
|
paypalEnvironment: "live" | "sandbox" | null;
|
|
1397
1397
|
squareApplicationId: string | null;
|
|
@@ -1401,8 +1401,6 @@ export interface components {
|
|
|
1401
1401
|
googleAdsId: string | null;
|
|
1402
1402
|
googleAdsConversionLabel: string | null;
|
|
1403
1403
|
metaPixelId: string | null;
|
|
1404
|
-
mapsApiKey: string | null;
|
|
1405
|
-
mapsMapId: string | null;
|
|
1406
1404
|
socialLinks?: components["schemas"]["SiteSocialLinks"];
|
|
1407
1405
|
consentEnabled?: boolean;
|
|
1408
1406
|
consentPrivacyPage?: string | null;
|
|
@@ -1637,6 +1635,9 @@ export interface components {
|
|
|
1637
1635
|
height: "compact" | "standard";
|
|
1638
1636
|
heightPx: number | null;
|
|
1639
1637
|
sticky: "none" | "always" | "on_scroll_up";
|
|
1638
|
+
callButton?: boolean;
|
|
1639
|
+
callPhone?: string;
|
|
1640
|
+
callHref?: string;
|
|
1640
1641
|
borderThickness: number;
|
|
1641
1642
|
colorSchemeDefault: "light" | "dark";
|
|
1642
1643
|
colorSchemeInverse: "light" | "dark";
|
|
@@ -1930,6 +1931,7 @@ export interface components {
|
|
|
1930
1931
|
customerEmail?: string;
|
|
1931
1932
|
country?: string;
|
|
1932
1933
|
subdivision?: string;
|
|
1934
|
+
postcode?: string;
|
|
1933
1935
|
};
|
|
1934
1936
|
CartQuoteTax: {
|
|
1935
1937
|
name: string;
|
|
@@ -1968,6 +1970,11 @@ export interface components {
|
|
|
1968
1970
|
grandTotal: number;
|
|
1969
1971
|
currency: components["schemas"]["Currency"];
|
|
1970
1972
|
deliveryOptions: components["schemas"]["DeliveryOption"][];
|
|
1973
|
+
courier: components["schemas"]["CartQuoteCourier"] | null;
|
|
1974
|
+
};
|
|
1975
|
+
CartQuoteCourier: {
|
|
1976
|
+
status: "quoted" | "unavailable";
|
|
1977
|
+
reason: string;
|
|
1971
1978
|
};
|
|
1972
1979
|
CountrySubdivision: {
|
|
1973
1980
|
code: string;
|
|
@@ -8,7 +8,7 @@ export declare function resolveCopyright({ legalName, foundedYear, siteName, }:
|
|
|
8
8
|
foundedYear?: number | null;
|
|
9
9
|
siteName: string;
|
|
10
10
|
}, currentYear?: number): string;
|
|
11
|
-
export type PaymentMethod = "card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna";
|
|
11
|
+
export type PaymentMethod = "card" | "paypal" | "afterpay" | "square" | "gocardless" | "zip" | "klarna" | "bank";
|
|
12
12
|
export interface SiteCurrency {
|
|
13
13
|
code: string;
|
|
14
14
|
symbol: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{CountrySwitchTool as t}from"../../../../../components/HeaderToolBlocks.js";import{resolveCountryShowAs as e}from"../../../../content/country-show-as.js";import{CountrySwitchBlockMeta as m}from"./meta.js";const h={...m,render:({showAs:o})=>r(t,{showAs:e(o)})};export{h as CountrySwitchBlockRender};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const CONTACT_KIND_OPTIONS: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: "phone" | "whatsapp" | "telegram" | "line" | "wechat" | "email" | "kakaotalk";
|
|
5
|
+
}[];
|
|
6
|
+
export declare const CONTACT_KIND_FALLBACK = "phone";
|
|
7
|
+
export declare const ContactCardsMeta: Omit<BlockRender, "render">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CONTACT_KIND_NAMES as o,CONTACT_KINDS as C}from"../../../../sections/messaging.js";const e=C.map(t=>({label:o[t],value:t})),c="phone",n={label:"Contact cards",widthRows:"two",defaultProps:{title:"Who to ask",description:"",contained:!0,contacts:[]}};export{c as CONTACT_KIND_FALLBACK,e as CONTACT_KIND_OPTIONS,n as ContactCardsMeta};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ContactEntry } from "../../../../sections/messaging.js";
|
|
2
|
+
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
3
|
+
export declare const contactCardsSample: () => ContactEntry[];
|
|
4
|
+
export declare const ContactCardsRender: BlockRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import r from"../../../../../components/ContactCards.js";import{contactViews as n}from"../../../../sections/messaging.js";import{readHidable as c}from"efficient-easel/screen/lib/document/hidable";import{ContactCardsMeta as d}from"./meta.js";const s=()=>[{name:"Jessie",kind:"phone",value:"0400 000 000"},{name:"Saki",kind:"line",value:"yourvenue"}],o=t=>{const{text:e,hidden:i}=c(t);return i||!e?void 0:e},x={...d,render:t=>{let e=n(t.contacts);return!e.length&&t.editor?.isEditing&&(e=n(s())),a(r,{title:o(t.title),description:o(t.description),contacts:e,contained:t.contained!==!1})}};export{x as ContactCardsRender,s as contactCardsSample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as y}from"react/jsx-runtime";import h,{readFacets as k}from"../../../../../components/Events.js";import{BLOCK_SOURCE_ROWS_PROP as b,declaredBlockSource as x,sourcedRows as
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import h,{readFacets as k,readTags as g}from"../../../../../components/Events.js";import{BLOCK_SOURCE_ROWS_PROP as b,declaredBlockSource as x,sourcedRows as A}from"efficient-web-builder/format/lib/content/block-sources";import{hidableText as E}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as S}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as n}from"efficient-web-builder/format/lib/editor-words";import{EventsMeta as T,EVENTS_PH as u}from"./meta.js";const v=()=>[{key:"sample-1",title:n("First card"),excerpt:n("A line about it appears here.")},{key:"sample-2",title:n("Second card"),excerpt:n("A line about it appears here.")},{key:"sample-3",title:n("Third card"),excerpt:n("A line about it appears here.")},{key:"sample-4",title:n("Fourth card"),excerpt:n("A line about it appears here.")}],f=(e,i,a)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...a?.facets?{facets:a.facets}:{},...a?.tags?{tags:a.tags}:{}});function B(e){const i=e[b],a=new Map,o=[];if(!Array.isArray(i))return{byKey:a,byIndex:o};for(const d of i){if(!d||typeof d!="object"||Array.isArray(d))continue;const t=d;if(!Object.values(t).some(l=>typeof l=="string"&&l))continue;const s={facets:k(t.facets),tags:g(t.tags)};o.push(s),typeof t.key=="string"&&t.key&&a.set(t.key,s)}return{byKey:a,byIndex:o}}const I={...T,render:e=>{const i=S(e.headPlacement)==="own-box",a=r=>i?void 0:r,o=m(e.linkText,u.link,e.editor),t=x(e)!==""?A(e,!!e.editor?.isEditing,v()):null,s=t&&!t.sample?B(e):null,l=t?t.sample?[]:t.rows.map((r,c)=>f(r,c,r.key?s?.byKey.get(r.key):s?.byIndex[c])):e.posts;return y(h,{num:a(m(e.num,u.num,e.editor)),title:a(m(e.title,u.title,e.editor)),link:a(o?{text:o,href:E(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:l,sample:t?.sample?t.rows.map((r,c)=>f(r,c)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,nameFilter:e.nameFilter===!0,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.editor?.isEditing})}};export{I as EventsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FOOTER_COLUMNS_DEFAULT as o,LOGO_FILL_DEFAULT as t,LOGO_ROW_FILL_DEFAULT as e}from"efficient-web-builder/format/lib/content/footer";const
|
|
1
|
+
import{FOOTER_COLUMNS_DEFAULT as o,LOGO_FILL_DEFAULT as t,LOGO_ROW_FILL_DEFAULT as e}from"efficient-web-builder/format/lib/content/footer";const F={blocks:{type:"slot",allow:["FooterLogo","FooterMenu","FooterDivider","FooterGroup","FooterText","FooterEmailSignup","FooterSocial","FooterPayment"]}},r={label:"Footer",fields:F,defaultProps:{columns:o,logoFill:t,logoRowFill:e}};export{r as FooterMeta,F as FooterSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o={blocks:{type:"slot",allow:["FooterText","FooterEmailSignup","FooterMenu","FooterDivider","FooterSocial"]}},t={label:"Footer Box",fields:o,defaultProps:{direction:"vertical",align:"start"}};export{t as FooterGroupMeta,o as FooterGroupSlots};
|
|
1
|
+
const o={blocks:{type:"slot",allow:["FooterText","FooterEmailSignup","FooterMenu","FooterDivider","FooterSocial","FooterPayment"]}},t={label:"Footer Box",fields:o,defaultProps:{direction:"vertical",align:"start"}};export{t as FooterGroupMeta,o as FooterGroupSlots};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MESSAGING_SOURCE as e}from"../../../../sections/messaging.js";const s={label:"Messaging Strip",defaultProps:{heading:"Message us",dataSource:e}};export{s as FooterMessagingMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import s from"../../../../../components/FooterMessaging.js";import{messagingChannels as t}from"../../../../sections/messaging.js";import{sourcedRows as m}from"efficient-web-builder/format/lib/content/block-sources";import{readHidable as a}from"efficient-easel/screen/lib/document/hidable";import{messagingSample as d}from"../MessagingCards/render.js";import{FooterMessagingMeta as g}from"./meta.js";const M={...g,render:e=>{const{rows:o}=m(e,!!e.editor?.isEditing,d()),{text:r,hidden:n}=a(e.heading);return i(s,{heading:n?void 0:r||void 0,channels:t(o)})}};export{M as FooterMessagingRender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{FOOTER_PAYMENT_PH as t}from"efficient-web-builder/format/lib/content/footer";const e=t.lead,a={label:"Payment Logos",defaultProps:{lead:e,methods:[],size:"sm",align:"start"}};export{e as FOOTER_PAYMENT_LEAD,a as FooterPaymentMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fragment as g,jsx as t}from"react/jsx-runtime";import d from"../../../../../components/FooterPayment.js";import{declaredBlockSource as f,sourcedRows as y}from"efficient-web-builder/format/lib/content/block-sources";import{say as l}from"efficient-web-builder/format/lib/editor-words";import{FooterPaymentMeta as h}from"./meta.js";const p=()=>[{label:l("Cash"),kind:"cash"},{label:l("Card"),kind:"card"}],x={...h,render:r=>{const{lead:a,methods:o,size:n,align:i,editor:m}=r;if(f(r)!==""){const e=y(r,!!m?.isEditing,p()).rows;return e.length?t(d,{lead:a,methods:e.map(s=>({name:s.label,kind:s.kind})),size:n,align:i}):t(g,{})}const c=Array.isArray(o)?o:[];return t(d,{lead:a,methods:c.map(e=>({name:e.label})),size:n,align:i,editing:m?.isEditing})}};export{x as FooterPaymentRender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{MESSAGING_SOURCE as e}from"../../../../sections/messaging.js";const t={label:"Messaging cards",widthRows:"two",defaultProps:{title:"Message us",description:"",contained:!0,dataSource:e}};export{t as MessagingCardsMeta};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
|
|
2
|
+
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
3
|
+
export declare const messagingSample: () => SourceRow[];
|
|
4
|
+
export declare const MessagingCardsRender: BlockRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import s from"../../../../../components/MessagingCards.js";import{messagingChannels as o}from"../../../../sections/messaging.js";import{sourcedRows as i}from"efficient-web-builder/format/lib/content/block-sources";import{readHidable as m}from"efficient-easel/screen/lib/document/hidable";import{MessagingCardsMeta as h}from"./meta.js";const p=()=>[{app:"wechat",name:"WeChat",handle:"yourvenue",href:"",qr:"https://u.wechat.com/yourvenue"},{app:"telegram",name:"Telegram",handle:"@yourvenue",href:"https://t.me/yourvenue",qr:"https://t.me/yourvenue"},{app:"whatsapp",name:"WhatsApp",handle:"0400 000 000",href:"https://wa.me/61400000000",qr:"https://wa.me/61400000000"},{app:"line",name:"LINE",handle:"yourvenue",href:"https://line.me/ti/p/~yourvenue",qr:"https://line.me/ti/p/~yourvenue"}],n=e=>{const{text:t,hidden:r}=m(e);return r||!t?void 0:t},v={...h,render:e=>{const{rows:t}=i(e,!!e.editor?.isEditing,p());return a(s,{title:n(e.title),description:n(e.description),channels:o(t),contained:e.contained!==!1})}};export{v as MessagingCardsRender,p as messagingSample};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{cardTemplateSlot as e}from"efficient-web-builder/format/lib/content/card-template";import{PRODUCT_REVIEWS_SOURCE as t}from"../../../../sections/reviews.js";const i={eyebrow:"Reviews",title:"From our *customers.*"},o={template:e()},l={label:"Reviews",fields:o,defaultProps:{eyebrow:"",title:"",columns:3,limit:6,dataSource:t,items:[]}};export{i as REVIEWS_PH,l as ReviewsMeta,o as ReviewsSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import f from"../../../../../components/Reviews.js";import{CardTemplateRows as y}from"efficient-web-builder/render/components/CardRowContext";import{cardRow as h}from"efficient-web-builder/format/lib/content/card-template";import{declaredBlockSource as p,sourcedRows as b}from"efficient-web-builder/format/lib/content/block-sources";import{parseSectionHeadPlacement as R}from"efficient-web-builder/format/lib/sections/section-head-placement";import{parseSectionEyebrowLook as g}from"efficient-web-builder/format/lib/sections/section-eyebrow-look";import{phHide as c}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as i}from"efficient-web-builder/format/lib/editor-words";import{ReviewsMeta as k,REVIEWS_PH as d}from"./meta.js";const w=()=>[{key:"sample-review-1",name:i("Sample reviewer"),rating:"5",title:i("Sample review title"),quote:i("Approved customer reviews appear here automatically — this card is only a preview of the section's shape.")},{key:"sample-review-2",name:i("Sample reviewer"),rating:"4",title:"",quote:i("Reviews are collected by the Review Form section and wait for your approval before they show.")},{key:"sample-review-3",name:i("Sample reviewer"),rating:"5",title:i("Another sample"),quote:i("Set a product design code on this section to show one product's reviews; leave it blank for the whole store.")}],S=(e,o)=>{const a=Number.parseFloat(e.rating??"");return{key:e.key||`review-${o}`,quote:e.quote??"",title:e.title??"",name:e.name??"",meta:e.dateLabel||e.role||"",...Number.isFinite(a)?{rating:a}:{}}},q=e=>(Array.isArray(e)?e:[]).map(h).filter(o=>(o.quote??"").trim()),I={...k,render:e=>{const o=R(e.headPlacement)==="own-box",a=t=>o?void 0:t,m=!!e.editor?.isEditing;let r,l=!1;if(p(e)!==""){const t=b(e,m,w()),u=typeof e.limit=="number"&&e.limit>0?e.limit:6;r=t.sample?t.rows:t.rows.slice(0,u),l=t.sample}else r=q(e.items),!r.length&&m&&(r=w(),l=!0);const v=r.map(S),n=t=>s(f,{look:g(e.eyebrowLook,"Reviews"),eyebrow:a(c(e.eyebrow,d.eyebrow,e.editor)),title:a(c(e.title,d.title,e.editor)),omitHead:o,columns:e.columns,rows:v,sample:l,editing:m,cards:t});return s(y,{ownerId:String(e.id??""),ownerType:"Reviews",Template:e.template,rows:r,fallback:n(),children:t=>n(t)})}};export{I as ReviewsRender};
|
|
@@ -11,11 +11,15 @@ export declare const SERVICE_METAS: {
|
|
|
11
11
|
FooterLogo: Omit<BlockRender, "render">;
|
|
12
12
|
FooterMenu: Omit<BlockRender, "render">;
|
|
13
13
|
FooterSocial: Omit<BlockRender, "render">;
|
|
14
|
+
FooterPayment: Omit<BlockRender, "render">;
|
|
14
15
|
FooterText: Omit<BlockRender, "render">;
|
|
15
16
|
Form: Omit<BlockRender, "render">;
|
|
16
17
|
LegalLineBlock: Omit<BlockRender, "render">;
|
|
17
18
|
OpeningHours: Omit<BlockRender, "render">;
|
|
18
19
|
RateTable: Omit<BlockRender, "render">;
|
|
20
|
+
MessagingCards: Omit<BlockRender, "render">;
|
|
21
|
+
FooterMessaging: Omit<BlockRender, "render">;
|
|
22
|
+
ContactCards: Omit<BlockRender, "render">;
|
|
19
23
|
RatingBlock: Omit<BlockRender, "render">;
|
|
20
24
|
ReviewForm: Omit<BlockRender, "render">;
|
|
21
25
|
Reviews: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{EventsMeta as m}from"./Events/meta.js";import{FooterDividerMeta as a}from"./FooterDivider/meta.js";import{FooterEmailSignupMeta as p}from"./FooterEmailSignup/meta.js";import{FooterGroupMeta as M}from"./FooterGroup/meta.js";import{FooterLogoMeta as n}from"./FooterLogo/meta.js";import{FooterMenuMeta as f}from"./FooterMenu/meta.js";import{FooterMeta as
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{EventsMeta as m}from"./Events/meta.js";import{FooterDividerMeta as a}from"./FooterDivider/meta.js";import{FooterEmailSignupMeta as p}from"./FooterEmailSignup/meta.js";import{FooterGroupMeta as M}from"./FooterGroup/meta.js";import{FooterLogoMeta as n}from"./FooterLogo/meta.js";import{FooterMenuMeta as f}from"./FooterMenu/meta.js";import{FooterMeta as g}from"./Footer/meta.js";import{FooterSocialMeta as F}from"./FooterSocial/meta.js";import{FooterPaymentMeta as s}from"./FooterPayment/meta.js";import{FooterTextMeta as u}from"./FooterText/meta.js";import{FormMeta as S}from"./Form/meta.js";import{LegalLineBlockMeta as l}from"./LegalLineBlock/meta.js";import{OpeningHoursMeta as B}from"./OpeningHours/meta.js";import{RateTableMeta as c}from"./RateTable/meta.js";import{MessagingCardsMeta as b}from"./MessagingCards/meta.js";import{FooterMessagingMeta as E}from"./FooterMessaging/meta.js";import{ContactCardsMeta as R}from"./ContactCards/meta.js";import{RatingBlockMeta as T}from"./RatingBlock/meta.js";import{ReviewFormMeta as d}from"./ReviewForm/meta.js";import{ReviewsMeta as C}from"./Reviews/meta.js";import{SiteFooterMeta as k}from"./SiteFooter/meta.js";import{SiteHeaderMeta as v}from"./SiteHeader/meta.js";import{SubmitBoxMeta as x}from"./SubmitBox/meta.js";import{SubmitBuildMeta as L}from"./SubmitBuild/meta.js";import{SubscribeBlogsMeta as _}from"./SubscribeBlogs/meta.js";import{SubscribeMeta as w}from"./Subscribe/meta.js";const po={AppointmentBooking:r,BookingBox:e,ContactRouting:i,Events:m,Footer:g,FooterDivider:a,FooterEmailSignup:p,FooterGroup:M,FooterLogo:n,FooterMenu:f,FooterSocial:F,FooterPayment:s,FooterText:u,Form:S,LegalLineBlock:l,OpeningHours:B,RateTable:c,MessagingCards:b,FooterMessaging:E,ContactCards:R,RatingBlock:T,ReviewForm:d,Reviews:C,[o]:k,[t]:v,SubmitBox:x,SubmitBuild:L,Subscribe:w,SubscribeBlogs:_};export{po as SERVICE_METAS};
|
|
@@ -11,11 +11,15 @@ export declare const SERVICE_RENDERS: {
|
|
|
11
11
|
FooterLogo: BlockRender;
|
|
12
12
|
FooterMenu: BlockRender;
|
|
13
13
|
FooterSocial: BlockRender;
|
|
14
|
+
FooterPayment: BlockRender;
|
|
14
15
|
FooterText: BlockRender;
|
|
15
16
|
Form: BlockRender;
|
|
16
17
|
LegalLineBlock: BlockRender;
|
|
17
18
|
OpeningHours: BlockRender;
|
|
18
19
|
RateTable: BlockRender;
|
|
20
|
+
MessagingCards: BlockRender;
|
|
21
|
+
FooterMessaging: BlockRender;
|
|
22
|
+
ContactCards: BlockRender;
|
|
19
23
|
RatingBlock: BlockRender;
|
|
20
24
|
ReviewForm: BlockRender;
|
|
21
25
|
Reviews: BlockRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{BookingBoxRender as t}from"./BookingBox/render.js";import{ContactRoutingRender as i}from"./ContactRouting/render.js";import{EventsRender as m}from"./Events/render.js";import{FooterRender as n}from"./Footer/render.js";import{FooterDividerRender as R}from"./FooterDivider/render.js";import{FooterEmailSignupRender as p}from"./FooterEmailSignup/render.js";import{FooterGroupRender as d}from"./FooterGroup/render.js";import{FooterLogoRender as f}from"./FooterLogo/render.js";import{FooterMenuRender as
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{BookingBoxRender as t}from"./BookingBox/render.js";import{ContactRoutingRender as i}from"./ContactRouting/render.js";import{EventsRender as m}from"./Events/render.js";import{FooterRender as n}from"./Footer/render.js";import{FooterDividerRender as R}from"./FooterDivider/render.js";import{FooterEmailSignupRender as p}from"./FooterEmailSignup/render.js";import{FooterGroupRender as d}from"./FooterGroup/render.js";import{FooterLogoRender as f}from"./FooterLogo/render.js";import{FooterMenuRender as a}from"./FooterMenu/render.js";import{FooterSocialRender as g}from"./FooterSocial/render.js";import{FooterPaymentRender as F}from"./FooterPayment/render.js";import{FooterTextRender as s}from"./FooterText/render.js";import{FormRender as u}from"./Form/render.js";import{LegalLineBlockRender as S}from"./LegalLineBlock/render.js";import{OpeningHoursRender as l}from"./OpeningHours/render.js";import{RateTableRender as B}from"./RateTable/render.js";import{MessagingCardsRender as c}from"./MessagingCards/render.js";import{FooterMessagingRender as E}from"./FooterMessaging/render.js";import{ContactCardsRender as b}from"./ContactCards/render.js";import{RatingBlockRender as C}from"./RatingBlock/render.js";import{ReviewFormRender as T}from"./ReviewForm/render.js";import{ReviewsRender as k}from"./Reviews/render.js";import{SiteFooterRender as v}from"./SiteFooter/render.js";import{SiteHeaderRender as x}from"./SiteHeader/render.js";import{SubmitBoxRender as L}from"./SubmitBox/render.js";import{SubmitBuildRender as M}from"./SubmitBuild/render.js";import{SubscribeRender as _}from"./Subscribe/render.js";import{SubscribeBlogsRender as w}from"./SubscribeBlogs/render.js";const Ro={AppointmentBooking:e,BookingBox:t,ContactRouting:i,Events:m,Footer:n,FooterDivider:R,FooterEmailSignup:p,FooterGroup:d,FooterLogo:f,FooterMenu:a,FooterSocial:g,FooterPayment:F,FooterText:s,Form:u,LegalLineBlock:S,OpeningHours:l,RateTable:B,MessagingCards:c,FooterMessaging:E,ContactCards:b,RatingBlock:C,ReviewForm:T,Reviews:k,[o]:v,[r]:x,SubmitBox:L,SubmitBuild:M,Subscribe:_,SubscribeBlogs:w};export{Ro as SERVICE_RENDERS};
|
|
@@ -1233,6 +1233,29 @@
|
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
1235
|
},
|
|
1236
|
+
"FooterPayment": {
|
|
1237
|
+
"lead": {
|
|
1238
|
+
"type": "custom",
|
|
1239
|
+
"__text": {
|
|
1240
|
+
"control": "text",
|
|
1241
|
+
"label": "Lead",
|
|
1242
|
+
"placeholder": "We accept"
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
"methods": {
|
|
1246
|
+
"type": "array",
|
|
1247
|
+
"label": "Payment methods",
|
|
1248
|
+
"arrayFields": {
|
|
1249
|
+
"label": {
|
|
1250
|
+
"type": "custom",
|
|
1251
|
+
"__text": {
|
|
1252
|
+
"control": "copyText",
|
|
1253
|
+
"label": "Name"
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1236
1259
|
"FooterText": {
|
|
1237
1260
|
"text": {
|
|
1238
1261
|
"type": "custom",
|
|
@@ -1311,6 +1334,74 @@
|
|
|
1311
1334
|
}
|
|
1312
1335
|
}
|
|
1313
1336
|
},
|
|
1337
|
+
"MessagingCards": {
|
|
1338
|
+
"title": {
|
|
1339
|
+
"type": "custom",
|
|
1340
|
+
"__text": {
|
|
1341
|
+
"control": "textarea",
|
|
1342
|
+
"label": "Heading",
|
|
1343
|
+
"placeholder": "Message us"
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
"description": {
|
|
1347
|
+
"type": "custom",
|
|
1348
|
+
"__text": {
|
|
1349
|
+
"control": "textarea",
|
|
1350
|
+
"label": "Body",
|
|
1351
|
+
"placeholder": ""
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
"FooterMessaging": {
|
|
1356
|
+
"heading": {
|
|
1357
|
+
"type": "custom",
|
|
1358
|
+
"__text": {
|
|
1359
|
+
"control": "text",
|
|
1360
|
+
"label": "Heading",
|
|
1361
|
+
"placeholder": "Message us"
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
"ContactCards": {
|
|
1366
|
+
"title": {
|
|
1367
|
+
"type": "custom",
|
|
1368
|
+
"__text": {
|
|
1369
|
+
"control": "textarea",
|
|
1370
|
+
"label": "Heading",
|
|
1371
|
+
"placeholder": "Who to ask"
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
"description": {
|
|
1375
|
+
"type": "custom",
|
|
1376
|
+
"__text": {
|
|
1377
|
+
"control": "textarea",
|
|
1378
|
+
"label": "Body",
|
|
1379
|
+
"placeholder": ""
|
|
1380
|
+
}
|
|
1381
|
+
},
|
|
1382
|
+
"contacts": {
|
|
1383
|
+
"type": "array",
|
|
1384
|
+
"label": "Contacts",
|
|
1385
|
+
"arrayFields": {
|
|
1386
|
+
"name": {
|
|
1387
|
+
"type": "custom",
|
|
1388
|
+
"__text": {
|
|
1389
|
+
"control": "copyText",
|
|
1390
|
+
"label": "Name",
|
|
1391
|
+
"placeholder": "Who to ask for"
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
"value": {
|
|
1395
|
+
"type": "custom",
|
|
1396
|
+
"__text": {
|
|
1397
|
+
"control": "copyText",
|
|
1398
|
+
"label": "Number or ID",
|
|
1399
|
+
"placeholder": "A number, @name or an ID"
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
},
|
|
1314
1405
|
"ReviewForm": {
|
|
1315
1406
|
"eyebrow": {
|
|
1316
1407
|
"type": "custom",
|
|
@@ -1354,12 +1445,52 @@
|
|
|
1354
1445
|
"placeholder": "From our *customers.*"
|
|
1355
1446
|
}
|
|
1356
1447
|
},
|
|
1357
|
-
"
|
|
1358
|
-
"type": "
|
|
1359
|
-
"
|
|
1360
|
-
|
|
1361
|
-
"
|
|
1362
|
-
|
|
1448
|
+
"items": {
|
|
1449
|
+
"type": "array",
|
|
1450
|
+
"label": "Typed reviews",
|
|
1451
|
+
"arrayFields": {
|
|
1452
|
+
"quote": {
|
|
1453
|
+
"type": "custom",
|
|
1454
|
+
"__text": {
|
|
1455
|
+
"control": "plainTextarea",
|
|
1456
|
+
"label": "Quote"
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
"title": {
|
|
1460
|
+
"type": "custom",
|
|
1461
|
+
"__text": {
|
|
1462
|
+
"control": "plainText",
|
|
1463
|
+
"label": "Title"
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
"name": {
|
|
1467
|
+
"type": "custom",
|
|
1468
|
+
"__text": {
|
|
1469
|
+
"control": "plainText",
|
|
1470
|
+
"label": "Name"
|
|
1471
|
+
}
|
|
1472
|
+
},
|
|
1473
|
+
"role": {
|
|
1474
|
+
"type": "custom",
|
|
1475
|
+
"__text": {
|
|
1476
|
+
"control": "plainText",
|
|
1477
|
+
"label": "Role · location"
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
},
|
|
1482
|
+
"dataSourceOptions": {
|
|
1483
|
+
"type": "object",
|
|
1484
|
+
"label": "Product",
|
|
1485
|
+
"objectFields": {
|
|
1486
|
+
"designCode": {
|
|
1487
|
+
"type": "custom",
|
|
1488
|
+
"__text": {
|
|
1489
|
+
"control": "plainText",
|
|
1490
|
+
"label": "Design code",
|
|
1491
|
+
"placeholder": "e.g. D00123 · blank = the whole store"
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1363
1494
|
}
|
|
1364
1495
|
}
|
|
1365
1496
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerCardTemplates as e}from"efficient-web-builder/format/lib/content/card-template";const l=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}]}];e(l);export{l as STOREFRONT_CARD_TEMPLATES};
|
|
@@ -2,6 +2,7 @@ export declare const PAGE_BLOCKS_FROM_FOOTER: {
|
|
|
2
2
|
readonly MenuBlock: "FooterMenu";
|
|
3
3
|
readonly EmailFormBlock: "FooterEmailSignup";
|
|
4
4
|
readonly SocialLogosBlock: "FooterSocial";
|
|
5
|
+
readonly PaymentLogosBlock: "FooterPayment";
|
|
5
6
|
};
|
|
6
7
|
export declare const PAGE_MENU_DIRECTION_DEFAULT = "column";
|
|
7
8
|
export declare function addPageBlocksFromFooter(components: Record<string, object>): void;
|