@loczer/storefront-sdk 0.182.0 → 0.183.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/dist/StorefrontProvider.d.ts +18 -15
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +24 -34
- package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
- package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
- package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
- package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
- package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
- package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
- package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
- package/dist/components/AboutSection/index.d.ts +1 -6
- package/dist/components/AboutSection/index.d.ts.map +1 -1
- package/dist/components/AboutSection/index.js +43 -39
- package/dist/components/ContactSection/index.d.ts +1 -3
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +222 -164
- package/dist/components/Footer/index.d.ts +3 -4
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +98 -69
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
- package/dist/components/FulfillmentSection/index.js +17 -16
- package/dist/components/Header/index.d.ts +1 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +77 -72
- package/dist/components/Layout/index.d.ts +3 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +45 -47
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +68 -60
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +151 -150
- package/dist/index.js +62 -62
- package/dist/lib/cart.d.ts +4 -1
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +64 -40
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +4 -3
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +20 -9
- package/dist/lib/storefrontAddress.d.ts +5 -0
- package/dist/lib/storefrontAddress.d.ts.map +1 -0
- package/dist/lib/storefrontAddress.js +24 -0
- package/dist/lib/storefrontAvailability.d.ts +6 -6
- package/dist/lib/storefrontContact.d.ts +10 -0
- package/dist/lib/storefrontContact.d.ts.map +1 -0
- package/dist/lib/storefrontContact.js +24 -0
- package/dist/lib/storefrontMissingValues.d.ts +5 -0
- package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
- package/dist/lib/storefrontMissingValues.js +4 -0
- package/dist/lib/storefrontProducts.d.ts +23 -21
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +7 -5
- package/dist/lib/whatsapp.d.ts +8 -6
- package/dist/lib/whatsapp.d.ts.map +1 -1
- package/dist/lib/whatsapp.js +16 -43
- package/dist/pages/BookingPage.js +36 -36
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +126 -128
- package/dist/pages/ProductPage.js +160 -160
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -12
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -2
- package/dist/ui/radio-group.d.ts +1 -1
- package/package.json +7 -6
- package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
- package/dist/data/config.d.ts +0 -15
- package/dist/data/config.d.ts.map +0 -1
- package/dist/data/config.js +0 -24
- package/dist/static/strings.d.ts +0 -2
- package/dist/static/strings.d.ts.map +0 -1
- package/dist/static/strings.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const MISSING_SHOP_ADDRESS = "[Missing shop address]";
|
|
2
|
+
export declare const MISSING_SHOP_EMAIL = "[Missing shop email]";
|
|
3
|
+
export declare const MISSING_SHOP_PHONE_NUMBER = "[Missing phone number]";
|
|
4
|
+
export declare const UNCONFIGURED_SHOP_MAP_CENTER: readonly [0, 0];
|
|
5
|
+
//# sourceMappingURL=storefrontMissingValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storefrontMissingValues.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontMissingValues.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,2BAA2B,CAAA;AAC5D,eAAO,MAAM,kBAAkB,yBAAyB,CAAA;AACxD,eAAO,MAAM,yBAAyB,2BAA2B,CAAA;AAGjE,eAAO,MAAM,4BAA4B,iBAAkB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/lib/storefrontMissingValues.ts
|
|
2
|
+
var e = "[Missing shop address]", t = "[Missing shop email]", n = "[Missing phone number]", r = [0, 0];
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as MISSING_SHOP_ADDRESS, t as MISSING_SHOP_EMAIL, n as MISSING_SHOP_PHONE_NUMBER, r as UNCONFIGURED_SHOP_MAP_CENTER };
|
|
@@ -2,11 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const storefrontPublicProductPriceSchema: z.ZodObject<{
|
|
3
3
|
value: z.ZodNumber;
|
|
4
4
|
unit: z.ZodEnum<{
|
|
5
|
-
hour: "hour";
|
|
6
|
-
half_day: "half_day";
|
|
7
5
|
day: "day";
|
|
8
|
-
|
|
6
|
+
half_day: "half_day";
|
|
7
|
+
hour: "hour";
|
|
9
8
|
month: "month";
|
|
9
|
+
week: "week";
|
|
10
10
|
}>;
|
|
11
11
|
quantity: z.ZodNumber;
|
|
12
12
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -105,11 +105,11 @@ export declare const storefrontPublicBikeProductSchema: z.ZodObject<{
|
|
|
105
105
|
prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
106
|
value: z.ZodNumber;
|
|
107
107
|
unit: z.ZodEnum<{
|
|
108
|
-
hour: "hour";
|
|
109
|
-
half_day: "half_day";
|
|
110
108
|
day: "day";
|
|
111
|
-
|
|
109
|
+
half_day: "half_day";
|
|
110
|
+
hour: "hour";
|
|
112
111
|
month: "month";
|
|
112
|
+
week: "week";
|
|
113
113
|
}>;
|
|
114
114
|
quantity: z.ZodNumber;
|
|
115
115
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -178,11 +178,11 @@ export declare const storefrontPublicAccessoryProductSchema: z.ZodObject<{
|
|
|
178
178
|
prices: z.ZodArray<z.ZodObject<{
|
|
179
179
|
value: z.ZodNumber;
|
|
180
180
|
unit: z.ZodEnum<{
|
|
181
|
-
hour: "hour";
|
|
182
|
-
half_day: "half_day";
|
|
183
181
|
day: "day";
|
|
184
|
-
|
|
182
|
+
half_day: "half_day";
|
|
183
|
+
hour: "hour";
|
|
185
184
|
month: "month";
|
|
185
|
+
week: "week";
|
|
186
186
|
}>;
|
|
187
187
|
quantity: z.ZodNumber;
|
|
188
188
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -217,10 +217,9 @@ export declare const requestSchema: z.ZodObject<{
|
|
|
217
217
|
}, z.core.$strip>;
|
|
218
218
|
export type RequestPayload = z.infer<typeof requestSchema>;
|
|
219
219
|
export type StorefrontProductsRequestPayload = RequestPayload;
|
|
220
|
-
export declare const responseSchema: z.ZodObject<{
|
|
221
|
-
success: z.
|
|
222
|
-
|
|
223
|
-
products: z.ZodOptional<z.ZodObject<{
|
|
220
|
+
export declare const responseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
221
|
+
success: z.ZodLiteral<true>;
|
|
222
|
+
products: z.ZodObject<{
|
|
224
223
|
bikes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
225
224
|
id: z.ZodString;
|
|
226
225
|
checkoutProductId: z.ZodOptional<z.ZodString>;
|
|
@@ -260,11 +259,11 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
260
259
|
prices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
261
260
|
value: z.ZodNumber;
|
|
262
261
|
unit: z.ZodEnum<{
|
|
263
|
-
hour: "hour";
|
|
264
|
-
half_day: "half_day";
|
|
265
262
|
day: "day";
|
|
266
|
-
|
|
263
|
+
half_day: "half_day";
|
|
264
|
+
hour: "hour";
|
|
267
265
|
month: "month";
|
|
266
|
+
week: "week";
|
|
268
267
|
}>;
|
|
269
268
|
quantity: z.ZodNumber;
|
|
270
269
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -332,11 +331,11 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
332
331
|
prices: z.ZodArray<z.ZodObject<{
|
|
333
332
|
value: z.ZodNumber;
|
|
334
333
|
unit: z.ZodEnum<{
|
|
335
|
-
hour: "hour";
|
|
336
|
-
half_day: "half_day";
|
|
337
334
|
day: "day";
|
|
338
|
-
|
|
335
|
+
half_day: "half_day";
|
|
336
|
+
hour: "hour";
|
|
339
337
|
month: "month";
|
|
338
|
+
week: "week";
|
|
340
339
|
}>;
|
|
341
340
|
quantity: z.ZodNumber;
|
|
342
341
|
currency: z.ZodOptional<z.ZodString>;
|
|
@@ -364,8 +363,11 @@ export declare const responseSchema: z.ZodObject<{
|
|
|
364
363
|
variants_as_products: "variants_as_products";
|
|
365
364
|
}>>;
|
|
366
365
|
}, z.core.$strip>>>;
|
|
367
|
-
}, z.core.$strip
|
|
368
|
-
}, z.core.$strip
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
368
|
+
success: z.ZodLiteral<false>;
|
|
369
|
+
message: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strip>], "success">;
|
|
369
371
|
export type ResponsePayload = z.infer<typeof responseSchema>;
|
|
370
372
|
export type StorefrontProductsResponsePayload = ResponsePayload;
|
|
371
373
|
//# sourceMappingURL=storefrontProducts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storefrontProducts.d.ts","sourceRoot":"","sources":["../../src/lib/storefrontProducts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAevB,eAAO,MAAM,kCAAkC;;;;;;;;;;;iBAK7C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAE7F,eAAO,MAAM,8CAA8C;;;iBAGzD,CAAA;AACF,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8CAA8C,CAAC,CAAA;AAErH,eAAO,MAAM,6CAA6C;;;;iBAIxD,CAAA;AACF,MAAM,MAAM,uCAAuC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6CAA6C,CAAC,CAAA;AAEnH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;iBAK/C,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AAEjG,eAAO,MAAM,4CAA4C;;;;EAAqD,CAAA;AAC9G,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4CAA4C,CAAC,CAAA;AACjH,eAAO,MAAM,8BAA8B;;;EAA6B,CAAA;AACxE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAcjD,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAA;AAErG,eAAO,MAAM,KAAK,oCAAoC,CAAA;AAEtD,eAAO,MAAM,aAAa;;iBAExB,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAC1D,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAA;AAE7D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAYzB,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAC5D,MAAM,MAAM,iCAAiC,GAAG,eAAe,CAAA"}
|
|
@@ -71,13 +71,15 @@ var t = e.object({
|
|
|
71
71
|
features: e.array(n).optional(),
|
|
72
72
|
productVariants: e.array(c).min(1),
|
|
73
73
|
storefrontDisplayMode: f.default("variant_selector")
|
|
74
|
-
}), g = "/api/public/storefront/products", _ = e.object({ storeSlug: e.string().trim().min(1).toLowerCase() }), v = e.object({
|
|
75
|
-
success: e.
|
|
76
|
-
message: e.string().optional(),
|
|
74
|
+
}), g = "/api/public/storefront/products", _ = e.object({ storeSlug: e.string().trim().min(1).toLowerCase() }), v = e.discriminatedUnion("success", [e.object({
|
|
75
|
+
success: e.literal(!0),
|
|
77
76
|
products: e.object({
|
|
78
77
|
bikes: e.array(m).default([]),
|
|
79
78
|
accessories: e.array(h).default([])
|
|
80
|
-
})
|
|
81
|
-
})
|
|
79
|
+
})
|
|
80
|
+
}), e.object({
|
|
81
|
+
success: e.literal(!1),
|
|
82
|
+
message: e.string().optional()
|
|
83
|
+
})]);
|
|
82
84
|
//#endregion
|
|
83
85
|
export { g as ROUTE, _ as requestSchema, v as responseSchema, h as storefrontPublicAccessoryProductSchema, l as storefrontPublicBikeAvailabilityStatusSchema, u as storefrontPublicBikeKindSchema, m as storefrontPublicBikeProductSchema, p as storefrontPublicImageStyleSchema, f as storefrontPublicProductDisplayModeSchema, a as storefrontPublicProductPriceSchema, d as storefrontPublicProductSlugSchema, s as storefrontPublicProductVariantAttributeSchema, o as storefrontPublicProductVariantIdentifierSchema, c as storefrontPublicProductVariantSchema };
|
package/dist/lib/whatsapp.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { StorefrontPreset } from '../data/config';
|
|
2
1
|
import { StorefrontConfiguration } from '../storefrontSchemas';
|
|
2
|
+
type StorefrontWhatsAppConfiguration = {
|
|
3
|
+
shop: Pick<StorefrontConfiguration["shop"], "contactPhone1" | "contactPhone2" | "country">;
|
|
4
|
+
content?: Pick<NonNullable<StorefrontConfiguration["content"]>, "whatsappMessage" | "whatsappPhone1Enabled" | "whatsappPhone2Enabled">;
|
|
5
|
+
};
|
|
3
6
|
export declare function buildWhatsAppHref(phone: string | undefined, message?: string): string | undefined;
|
|
4
|
-
export declare function resolveStorefrontWhatsAppContact({
|
|
5
|
-
|
|
6
|
-
storefrontConfiguration?: StorefrontConfiguration;
|
|
7
|
+
export declare function resolveStorefrontWhatsAppContact({ storefrontConfiguration, language, }: {
|
|
8
|
+
storefrontConfiguration?: StorefrontWhatsAppConfiguration;
|
|
7
9
|
language: string;
|
|
8
10
|
}): {
|
|
9
11
|
href: string;
|
|
10
12
|
phoneDisplay: string;
|
|
11
13
|
} | undefined;
|
|
12
14
|
export declare function resolveStorefrontWhatsAppHref(params: {
|
|
13
|
-
|
|
14
|
-
storefrontConfiguration?: StorefrontConfiguration;
|
|
15
|
+
storefrontConfiguration?: StorefrontWhatsAppConfiguration;
|
|
15
16
|
language: string;
|
|
16
17
|
}): string | undefined;
|
|
18
|
+
export {};
|
|
17
19
|
//# sourceMappingURL=whatsapp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/lib/whatsapp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"whatsapp.d.ts","sourceRoot":"","sources":["../../src/lib/whatsapp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAInE,KAAK,+BAA+B,GAAG;IACrC,IAAI,EAAE,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS,CAAC,CAAA;IAC1F,OAAO,CAAC,EAAE,IAAI,CACZ,WAAW,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,EAC/C,iBAAiB,GAAG,uBAAuB,GAAG,uBAAuB,CACtE,CAAA;CACF,CAAA;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOjG;AAED,wBAAgB,gCAAgC,CAAC,EAC/C,uBAAuB,EACvB,QAAQ,GACT,EAAE;IACD,uBAAuB,CAAC,EAAE,+BAA+B,CAAA;IACzD,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAuBrD;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,uBAAuB,CAAC,EAAE,+BAA+B,CAAA;IACzD,QAAQ,EAAE,MAAM,CAAA;CACjB,GAAG,MAAM,GAAG,SAAS,CAErB"}
|
package/dist/lib/whatsapp.js
CHANGED
|
@@ -1,55 +1,28 @@
|
|
|
1
1
|
import { getLocalizedValue as e } from "../localization.js";
|
|
2
|
+
import { formatStorefrontPhoneDisplay as t } from "./storefrontContact.js";
|
|
2
3
|
//#region src/lib/whatsapp.ts
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (i?.preset && a === r(i.preset)) return i.preset.phone_display;
|
|
7
|
-
let o = i?.country?.trim().toUpperCase() ?? "";
|
|
8
|
-
if ((o === "FR" || a.startsWith("33")) && a.startsWith("33") && a.length === 11) {
|
|
9
|
-
let e = a.slice(2);
|
|
10
|
-
return `+33 (0)${e.slice(0, 1)} ${n(e.slice(1))}`;
|
|
11
|
-
}
|
|
12
|
-
return (o === "US" || o === "CA" || a.startsWith("1")) && a.startsWith("1") && a.length === 11 ? `+1 (${a.slice(1, 4)}) ${a.slice(4, 7)}-${a.slice(7)}` : e.trim();
|
|
13
|
-
};
|
|
14
|
-
function o(e, n) {
|
|
15
|
-
let r = t(e);
|
|
4
|
+
var n = (e) => e?.replace(/\D/g, "") ?? "";
|
|
5
|
+
function r(e, t) {
|
|
6
|
+
let r = n(e);
|
|
16
7
|
if (!r) return;
|
|
17
|
-
let i =
|
|
8
|
+
let i = t?.trim() ?? "";
|
|
18
9
|
return `https://wa.me/${r}${i ? `?text=${encodeURIComponent(i)}` : ""}`;
|
|
19
10
|
}
|
|
20
|
-
function
|
|
21
|
-
if (!n)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
let { content: s, shop: c } = n;
|
|
29
|
-
if (!s) {
|
|
30
|
-
let e = i(t.whatsapp_href);
|
|
31
|
-
return {
|
|
32
|
-
href: t.whatsapp_href,
|
|
33
|
-
phoneDisplay: e ? a(`+${e}`, {
|
|
34
|
-
country: c.country,
|
|
35
|
-
preset: t
|
|
36
|
-
}) : t.phone_display
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
let l = e(s?.whatsappMessage, r).trim(), u = [s.whatsappPhone1Enabled ? c.contactPhone1 : void 0, s.whatsappPhone2Enabled ? c.contactPhone2 : void 0];
|
|
40
|
-
for (let e of u) {
|
|
41
|
-
let n = o(e, l);
|
|
11
|
+
function i({ storefrontConfiguration: n, language: i }) {
|
|
12
|
+
if (!n) return;
|
|
13
|
+
let { content: a, shop: o } = n;
|
|
14
|
+
if (!a) return;
|
|
15
|
+
let s = e(a?.whatsappMessage, i).trim(), c = [a.whatsappPhone1Enabled ? o.contactPhone1 : void 0, a.whatsappPhone2Enabled ? o.contactPhone2 : void 0];
|
|
16
|
+
for (let e of c) {
|
|
17
|
+
let n = r(e, s);
|
|
42
18
|
if (n) return {
|
|
43
19
|
href: n,
|
|
44
|
-
phoneDisplay:
|
|
45
|
-
country: c.country,
|
|
46
|
-
preset: t
|
|
47
|
-
})
|
|
20
|
+
phoneDisplay: t(e ?? "", o.country)
|
|
48
21
|
};
|
|
49
22
|
}
|
|
50
23
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
24
|
+
function a(e) {
|
|
25
|
+
return i(e)?.href;
|
|
53
26
|
}
|
|
54
27
|
//#endregion
|
|
55
|
-
export {
|
|
28
|
+
export { r as buildWhatsAppHref, i as resolveStorefrontWhatsAppContact, a as resolveStorefrontWhatsAppHref };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { applyBookingParamsToSearch as e, createBookingPeriodConfigFromStorefrontConfiguration as t, getBookingParamsFromSearch as n, getDefaultBookingParamsForStorefrontConfiguration as r, resolveBookingSearchParamsFromSessionStorage as i, writeBookingSearchParamsToSessionStorage as a } from "../lib/booking.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { getProductVariantAttributeValue as o, getStorefrontProductVariantDisplay as s } from "../lib/productVariants.js";
|
|
3
|
+
import { getStorefrontCheckoutProductId as c } from "../lib/products.js";
|
|
4
|
+
import { useStorefrontCart as l } from "../lib/cart.js";
|
|
5
5
|
import { getLocalizedValue as u } from "../localization.js";
|
|
6
6
|
import { buildStorefrontCartSummary as d } from "../lib/cartSummary.js";
|
|
7
7
|
import { ROUTE as f, buildStorefrontAvailabilityKey as p, getStorefrontAvailabilityIssue as ee, getStorefrontAvailabilityStatus as m, getValidStorefrontAvailabilitySchedule as h, isStorefrontAvailabilityInsufficient as te, responseSchema as ne } from "../lib/storefrontAvailability.js";
|
|
@@ -43,19 +43,19 @@ var D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e
|
|
|
43
43
|
...e,
|
|
44
44
|
fulfillment: "pickup"
|
|
45
45
|
} : e, Ae = (e, t) => {
|
|
46
|
-
let n =
|
|
46
|
+
let n = c(e), r = e.representedVariantId?.trim();
|
|
47
47
|
if (r) {
|
|
48
48
|
let e = t.get(p(n, r));
|
|
49
49
|
if (e) return e;
|
|
50
50
|
}
|
|
51
51
|
return t.get(p(n));
|
|
52
|
-
}, je = (e, t, n) => n.get(p(
|
|
52
|
+
}, je = (e, t, n) => n.get(p(c(e), t)), Me = (e, t, n) => {
|
|
53
53
|
let r = ee(t);
|
|
54
54
|
return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
|
|
55
55
|
}, Ne = (e) => {
|
|
56
56
|
let t = /* @__PURE__ */ new Map();
|
|
57
57
|
for (let n of e) {
|
|
58
|
-
let e =
|
|
58
|
+
let e = c(n);
|
|
59
59
|
t.set(p(e), { productId: e });
|
|
60
60
|
for (let r of n.productVariants ?? []) t.set(p(e, r.id), {
|
|
61
61
|
productId: e,
|
|
@@ -69,21 +69,21 @@ var D = (e) => String(e).padStart(2, "0"), O = "product_modal", De = (e) => `${e
|
|
|
69
69
|
}
|
|
70
70
|
return Array.from(t.values());
|
|
71
71
|
};
|
|
72
|
-
function Pe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCancel: i, getVariantAvailabilityLabel: a, isVariantOutOfCapacity:
|
|
72
|
+
function Pe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCancel: i, getVariantAvailabilityLabel: a, isVariantOutOfCapacity: c }) {
|
|
73
73
|
let { t: l } = Se(), u = e.productVariants ?? [];
|
|
74
74
|
return /* @__PURE__ */ w("div", {
|
|
75
75
|
className: "grid gap-3 rounded-xl border border-slate-200 bg-slate-50 p-3",
|
|
76
76
|
children: [
|
|
77
77
|
/* @__PURE__ */ C("p", {
|
|
78
78
|
className: "text-xs font-medium text-slate-700",
|
|
79
|
-
children: /* @__PURE__ */ C("span", { children: u.some((e) => !!
|
|
79
|
+
children: /* @__PURE__ */ C("span", { children: u.some((e) => !!o(e, "size")) ? l("product_size_label") : l("product_variant_label") })
|
|
80
80
|
}),
|
|
81
81
|
/* @__PURE__ */ C(v, {
|
|
82
82
|
value: t,
|
|
83
83
|
onValueChange: n,
|
|
84
84
|
className: "grid gap-2",
|
|
85
85
|
children: u.map((n) => {
|
|
86
|
-
let r = `booking-variant-${e.id}-${n.id}`.toLowerCase(), i = `storefront-booking-variant-option-${e.id}-${n.id}`.toLowerCase(), { label:
|
|
86
|
+
let r = `booking-variant-${e.id}-${n.id}`.toLowerCase(), i = `storefront-booking-variant-option-${e.id}-${n.id}`.toLowerCase(), { label: o, description: l } = s(n), u = c(n.id), d = a(n.id);
|
|
87
87
|
return /* @__PURE__ */ w("label", {
|
|
88
88
|
htmlFor: r,
|
|
89
89
|
"data-testid": i,
|
|
@@ -97,7 +97,7 @@ function Pe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCan
|
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ C("span", {
|
|
99
99
|
className: "text-sm font-medium text-slate-950",
|
|
100
|
-
children:
|
|
100
|
+
children: o
|
|
101
101
|
}),
|
|
102
102
|
l ? /* @__PURE__ */ C("span", {
|
|
103
103
|
className: "text-xs text-slate-600",
|
|
@@ -139,7 +139,7 @@ function Pe({ product: e, selectedVariantId: t, onSelect: n, onConfirm: r, onCan
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
function j() {
|
|
142
|
-
let { t:
|
|
142
|
+
let { t: o, i18n: s } = Se(), { storeSlug: v } = be(), y = ye(), { storefrontConfiguration: D } = oe(), j = D.workspace?.workspaceLanguage, { bikes: Fe, accessories: Ie } = ce(), { bikes: M, accessories: N } = se(), [P, F] = xe(), { items: Le, itemCount: I, addItem: Re, clear: ze, removeItem: Be, setQuantity: Ve } = l(), He = x(() => t(D), [D]), L = x(() => r(D), [D]), R = D.settings.fulfillmentModes.includes("delivery"), Ue = D.settings.deliveryDisabledReason.trim(), We = D.shop.address?.trim() ?? "", z = x(() => i(P, v), [P, v]), [B, Ge] = S(() => ke(n(z, L), R));
|
|
143
143
|
b(() => {
|
|
144
144
|
Ge((e) => {
|
|
145
145
|
let t = {
|
|
@@ -208,16 +208,16 @@ function j() {
|
|
|
208
208
|
return n ? te(n) : e.availabilityStatus === "OUT_OF_STOCK";
|
|
209
209
|
}, Xe = (e) => (e.productVariants ?? []).length > 0, Ze = (e, t) => {
|
|
210
210
|
let n = je(e, t, H);
|
|
211
|
-
return n ? Me(
|
|
211
|
+
return n ? Me(o, n, m(n)) : e.availabilityStatus === "OUT_OF_STOCK" ? o("availability_out_of_stock") : null;
|
|
212
212
|
}, Qe = ge(v), $e = x(() => ({
|
|
213
|
-
startDate:
|
|
214
|
-
pickStartDate:
|
|
215
|
-
startTime:
|
|
216
|
-
endDate:
|
|
217
|
-
pickEndDate:
|
|
218
|
-
endTime:
|
|
219
|
-
selectedDaysTooltip: ({ count: e }) =>
|
|
220
|
-
}), [
|
|
213
|
+
startDate: o("booking_start_date"),
|
|
214
|
+
pickStartDate: o("booking_start_date"),
|
|
215
|
+
startTime: o("booking_start_time"),
|
|
216
|
+
endDate: o("booking_end_date"),
|
|
217
|
+
pickEndDate: o("booking_end_date"),
|
|
218
|
+
endTime: o("booking_end_time"),
|
|
219
|
+
selectedDaysTooltip: ({ count: e }) => o("booking_selected_days_tooltip", { count: e })
|
|
220
|
+
}), [s.language, o]), U = (e) => {
|
|
221
221
|
Ge((t) => {
|
|
222
222
|
let n = {
|
|
223
223
|
...t,
|
|
@@ -241,10 +241,10 @@ function j() {
|
|
|
241
241
|
bookingPeriodConfig: He,
|
|
242
242
|
fetchTimeSlots: Qe,
|
|
243
243
|
labels: $e,
|
|
244
|
-
localeCode:
|
|
244
|
+
localeCode: s.language
|
|
245
245
|
}, W = x(() => d({
|
|
246
246
|
items: Le,
|
|
247
|
-
language:
|
|
247
|
+
language: s.language,
|
|
248
248
|
fallbackLanguage: j,
|
|
249
249
|
products: {
|
|
250
250
|
bikes: Fe,
|
|
@@ -253,7 +253,7 @@ function j() {
|
|
|
253
253
|
}), [
|
|
254
254
|
Ie,
|
|
255
255
|
Fe,
|
|
256
|
-
|
|
256
|
+
s.language,
|
|
257
257
|
Le,
|
|
258
258
|
j
|
|
259
259
|
]), G = x(() => W.lines.map((e) => ({
|
|
@@ -320,7 +320,7 @@ function j() {
|
|
|
320
320
|
}, $ = (e, t, n = 1) => {
|
|
321
321
|
Re({
|
|
322
322
|
kind: e.kind,
|
|
323
|
-
productId:
|
|
323
|
+
productId: c(e),
|
|
324
324
|
...t ? { productVariantId: t } : {},
|
|
325
325
|
quantity: n
|
|
326
326
|
});
|
|
@@ -363,7 +363,7 @@ function j() {
|
|
|
363
363
|
children: [/* @__PURE__ */ C(Ce, {
|
|
364
364
|
className: "h-4 w-4",
|
|
365
365
|
"aria-hidden": "true"
|
|
366
|
-
}), /* @__PURE__ */ C("span", { children:
|
|
366
|
+
}), /* @__PURE__ */ C("span", { children: o("back_to_home") })]
|
|
367
367
|
}), /* @__PURE__ */ C(E, {
|
|
368
368
|
to: q,
|
|
369
369
|
className: T(I > 0 ? "inline-flex" : "hidden"),
|
|
@@ -373,7 +373,7 @@ function j() {
|
|
|
373
373
|
children: [/* @__PURE__ */ C(Ee, {
|
|
374
374
|
className: "h-4 w-4",
|
|
375
375
|
"aria-hidden": "true"
|
|
376
|
-
}), /* @__PURE__ */ C("span", { children:
|
|
376
|
+
}), /* @__PURE__ */ C("span", { children: o("checkout_button") })]
|
|
377
377
|
})
|
|
378
378
|
})]
|
|
379
379
|
}),
|
|
@@ -389,7 +389,7 @@ function j() {
|
|
|
389
389
|
children: [
|
|
390
390
|
/* @__PURE__ */ C(_, {
|
|
391
391
|
stepNumber: 1,
|
|
392
|
-
title:
|
|
392
|
+
title: o("booking_summary_title")
|
|
393
393
|
}),
|
|
394
394
|
/* @__PURE__ */ C(ie, {
|
|
395
395
|
...et,
|
|
@@ -416,10 +416,10 @@ function j() {
|
|
|
416
416
|
className: "space-y-2 scroll-mt-32",
|
|
417
417
|
children: [/* @__PURE__ */ C(_, {
|
|
418
418
|
stepNumber: 2,
|
|
419
|
-
title:
|
|
419
|
+
title: o("products_title")
|
|
420
420
|
}), /* @__PURE__ */ C("p", {
|
|
421
421
|
className: "text-sm text-slate-600",
|
|
422
|
-
children: /* @__PURE__ */ C("span", { children:
|
|
422
|
+
children: /* @__PURE__ */ C("span", { children: o("products_description") })
|
|
423
423
|
})]
|
|
424
424
|
}),
|
|
425
425
|
/* @__PURE__ */ C("div", {
|
|
@@ -443,16 +443,16 @@ function j() {
|
|
|
443
443
|
className: "space-y-2 pt-4",
|
|
444
444
|
children: [/* @__PURE__ */ C(_, {
|
|
445
445
|
stepNumber: 3,
|
|
446
|
-
title:
|
|
446
|
+
title: o("accessories_title")
|
|
447
447
|
}), /* @__PURE__ */ C("p", {
|
|
448
448
|
className: "text-sm text-slate-600",
|
|
449
|
-
children: /* @__PURE__ */ C("span", { children:
|
|
449
|
+
children: /* @__PURE__ */ C("span", { children: o("accessories_description") })
|
|
450
450
|
})]
|
|
451
451
|
}),
|
|
452
452
|
/* @__PURE__ */ C("div", {
|
|
453
453
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
454
454
|
children: N.map((e) => {
|
|
455
|
-
let t = u(e.name,
|
|
455
|
+
let t = u(e.name, s.language, j), n = u(e.description, s.language, j), r = u(e.warning, s.language, j), i = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", a = pe(e.primaryImageStyle), c = `/${v ?? ""}/products/${e.slug}`, l = A(e), d = X(e), f = m(Ae(e, H)) === "OUT_OF_STOCK", p = !!l || Xe(e);
|
|
456
456
|
return /* @__PURE__ */ C(le, {
|
|
457
457
|
className: "h-full border-slate-200 bg-white shadow-sm",
|
|
458
458
|
children: /* @__PURE__ */ w("div", {
|
|
@@ -475,7 +475,7 @@ function j() {
|
|
|
475
475
|
}), f ? /* @__PURE__ */ C(re, {
|
|
476
476
|
variant: "destructive",
|
|
477
477
|
className: "pointer-events-none absolute right-2 top-2 shadow-sm",
|
|
478
|
-
children: /* @__PURE__ */ C("span", { children:
|
|
478
|
+
children: /* @__PURE__ */ C("span", { children: o("availability_out_of_stock") })
|
|
479
479
|
}) : null]
|
|
480
480
|
}),
|
|
481
481
|
/* @__PURE__ */ w("div", {
|
|
@@ -516,17 +516,17 @@ function j() {
|
|
|
516
516
|
/* @__PURE__ */ w("div", {
|
|
517
517
|
className: "mt-auto flex items-center gap-2",
|
|
518
518
|
children: [/* @__PURE__ */ C(E, {
|
|
519
|
-
to:
|
|
519
|
+
to: c,
|
|
520
520
|
state: J,
|
|
521
521
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
522
|
-
children: /* @__PURE__ */ C("span", { children:
|
|
522
|
+
children: /* @__PURE__ */ C("span", { children: o("product_details_link") })
|
|
523
523
|
}), /* @__PURE__ */ w(g, {
|
|
524
524
|
type: "button",
|
|
525
525
|
size: "sm",
|
|
526
526
|
className: "ml-auto rounded-full gap-2",
|
|
527
527
|
onClick: () => mt(e),
|
|
528
528
|
disabled: !p,
|
|
529
|
-
children: [/* @__PURE__ */ C("span", { children:
|
|
529
|
+
children: [/* @__PURE__ */ C("span", { children: o("add_to_cart") }), /* @__PURE__ */ C(we, {
|
|
530
530
|
className: "h-4 w-4",
|
|
531
531
|
"aria-hidden": "true"
|
|
532
532
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA6GA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CA8qB/B"}
|