@cimplify/sdk 0.107.0 → 0.107.1
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/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{catalogue-C4xKpirp.d.ts → catalogue-AmW4XjaN.d.ts} +2 -1
- package/dist/{catalogue-BohD-jU_.d.mts → catalogue-rWd71Xi-.d.mts} +2 -1
- package/dist/{chunk-AVXA4F6G.js → chunk-ANT574FD.js} +29 -0
- package/dist/{chunk-W4ZFZPPY.js → chunk-CEML2737.js} +152 -147
- package/dist/{chunk-NYDVVNZI.mjs → chunk-JRGK3NXR.mjs} +1 -1
- package/dist/{chunk-NJYR6GGM.mjs → chunk-KG3WT4PR.mjs} +29 -1
- package/dist/{chunk-IWZKCL3P.mjs → chunk-NZMU7UUA.mjs} +3 -3
- package/dist/{chunk-HKCB73AJ.js → chunk-ONII7K3T.js} +177 -177
- package/dist/{chunk-2I6YKE6Q.mjs → chunk-OTPLI3JY.mjs} +2 -2
- package/dist/{chunk-P4HYAV3L.mjs → chunk-T4OU77DM.mjs} +7 -2
- package/dist/{chunk-73HY36Z7.js → chunk-THSYGWUA.js} +70 -70
- package/dist/{chunk-NX5YBQZP.js → chunk-UVRPC2P7.js} +73 -62
- package/dist/{chunk-UYFTOIFW.js → chunk-V32BCG7M.js} +6 -6
- package/dist/{chunk-MKZXZDHE.mjs → chunk-XBL3TMPC.mjs} +14 -3
- package/dist/{client-BBFfAtn4.d.mts → client-DlTJ2hUM.d.mts} +2 -2
- package/dist/{client-ByURQZM9.d.ts → client-ni-CfOSO.d.ts} +2 -2
- package/dist/{elements-Dtqe9Ekd.d.mts → elements-BF1Y4aOi.d.mts} +92 -6
- package/dist/{elements-Dtqe9Ekd.d.ts → elements-BF1Y4aOi.d.ts} +92 -6
- package/dist/{index-DFqDU6yU.d.ts → index-CZ0bJm6k.d.ts} +2 -2
- package/dist/{index-B6mukQYB.d.mts → index-DML_W635.d.mts} +2 -2
- package/dist/{index-CvLuAMjQ.d.ts → index-DU7vffby.d.ts} +2 -2
- package/dist/{index-7oz-hVVA.d.mts → index-DopYJKDL.d.mts} +2 -2
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +156 -152
- package/dist/index.mjs +5 -5
- package/dist/mock/cli.mjs +16 -2
- package/dist/mock/library.js +16 -2
- package/dist/mock/library.mjs +16 -2
- package/dist/mock/msw.js +16 -2
- package/dist/mock/msw.mjs +16 -2
- package/dist/{price-B4jL81ef.d.ts → price-B5t2mpsE.d.ts} +1 -1
- package/dist/{price-Pyq-vlrm.d.mts → price-DI_U5oXU.d.mts} +1 -1
- package/dist/react.d.mts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +151 -151
- package/dist/react.mjs +4 -4
- package/dist/{server-Cowuvfbr.d.ts → server-BItJAUTD.d.ts} +1 -1
- package/dist/{server-KilvZJU0.d.mts → server-Dq70vD7z.d.mts} +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +5 -5
- package/dist/testing/suite.d.ts +5 -5
- package/dist/testing/suite.js +26 -26
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +4 -4
- package/dist/testing.d.ts +4 -4
- package/dist/testing.js +118 -118
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +32 -32
- package/dist/utils.mjs +2 -2
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk2P4KXFB6_js = require('./chunk-2P4KXFB6.js');
|
|
5
|
-
var
|
|
5
|
+
var chunkCEML2737_js = require('./chunk-CEML2737.js');
|
|
6
6
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
7
|
-
var
|
|
7
|
+
var chunkONII7K3T_js = require('./chunk-ONII7K3T.js');
|
|
8
8
|
var chunkEV2EVOYS_js = require('./chunk-EV2EVOYS.js');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkV32BCG7M_js = require('./chunk-V32BCG7M.js');
|
|
10
|
+
var chunkANT574FD_js = require('./chunk-ANT574FD.js');
|
|
11
11
|
require('./chunk-OWW5GUSB.js');
|
|
12
12
|
var React14 = require('react');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -635,14 +635,14 @@ function attachInternalItemMetadata(item, metadata = {}) {
|
|
|
635
635
|
}
|
|
636
636
|
function calculateLineSubtotal(item) {
|
|
637
637
|
if (item._quotedUnitPrice !== void 0) {
|
|
638
|
-
return roundMoney(
|
|
638
|
+
return roundMoney(chunkV32BCG7M_js.parsePrice(item._quotedUnitPrice) * item.quantity);
|
|
639
639
|
}
|
|
640
|
-
let unitPrice =
|
|
640
|
+
let unitPrice = chunkV32BCG7M_js.parsePrice(item.product.default_price);
|
|
641
641
|
if (item.variant?.price_adjustment) {
|
|
642
|
-
unitPrice +=
|
|
642
|
+
unitPrice += chunkV32BCG7M_js.parsePrice(item.variant.price_adjustment);
|
|
643
643
|
}
|
|
644
644
|
for (const option of item.addOnOptions || []) {
|
|
645
|
-
if (option.default_price) unitPrice +=
|
|
645
|
+
if (option.default_price) unitPrice += chunkV32BCG7M_js.parsePrice(option.default_price);
|
|
646
646
|
}
|
|
647
647
|
return roundMoney(unitPrice * item.quantity);
|
|
648
648
|
}
|
|
@@ -863,7 +863,7 @@ async function syncFromServer(entry) {
|
|
|
863
863
|
return next;
|
|
864
864
|
}
|
|
865
865
|
function emitMutationError(entry, operation, opId, idempotencyKey, error) {
|
|
866
|
-
entry.client.events.emit(
|
|
866
|
+
entry.client.events.emit(chunkONII7K3T_js.MUTATION_ERROR, {
|
|
867
867
|
service: "cart",
|
|
868
868
|
operation,
|
|
869
869
|
opId,
|
|
@@ -903,10 +903,10 @@ function getOrCreateStore(params) {
|
|
|
903
903
|
syncTail: Promise.resolve(),
|
|
904
904
|
failedOpRemovers: /* @__PURE__ */ new Set()
|
|
905
905
|
};
|
|
906
|
-
client.events.on(
|
|
906
|
+
client.events.on(chunkONII7K3T_js.SESSION_CLAIMED, () => {
|
|
907
907
|
if (entry.initialized) void syncFromServer(entry);
|
|
908
908
|
});
|
|
909
|
-
client.events.on(
|
|
909
|
+
client.events.on(chunkONII7K3T_js.SESSION_CLEARED, () => {
|
|
910
910
|
if (entry.initialized) void syncFromServer(entry);
|
|
911
911
|
});
|
|
912
912
|
cartStores.set(storeKey, entry);
|
|
@@ -1214,7 +1214,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1214
1214
|
function createDefaultClient() {
|
|
1215
1215
|
const processRef = globalThis.process;
|
|
1216
1216
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1217
|
-
return
|
|
1217
|
+
return chunkCEML2737_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1218
1218
|
}
|
|
1219
1219
|
function getStoredLocationId() {
|
|
1220
1220
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -1318,7 +1318,7 @@ function CimplifyProvider({
|
|
|
1318
1318
|
const setDisplayCurrency = React14.useCallback(
|
|
1319
1319
|
(currency) => {
|
|
1320
1320
|
const normalized = currency?.trim().toUpperCase() || null;
|
|
1321
|
-
if (normalized && !
|
|
1321
|
+
if (normalized && !chunkANT574FD_js.isSupportedCurrency(normalized)) {
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
1324
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -1669,7 +1669,7 @@ function CimplifyCheckout({
|
|
|
1669
1669
|
setResolvedCartId(null);
|
|
1670
1670
|
setErrorMessage(message);
|
|
1671
1671
|
setIsInitializing(false);
|
|
1672
|
-
fireError({ code:
|
|
1672
|
+
fireError({ code: chunkANT574FD_js.ErrorCode.BUSINESS_ID_REQUIRED, message });
|
|
1673
1673
|
}
|
|
1674
1674
|
return;
|
|
1675
1675
|
}
|
|
@@ -1684,7 +1684,7 @@ function CimplifyCheckout({
|
|
|
1684
1684
|
setResolvedCartId(null);
|
|
1685
1685
|
setErrorMessage(message);
|
|
1686
1686
|
setIsInitializing(false);
|
|
1687
|
-
fireError({ code:
|
|
1687
|
+
fireError({ code: chunkANT574FD_js.ErrorCode.CART_EMPTY, message });
|
|
1688
1688
|
}
|
|
1689
1689
|
return;
|
|
1690
1690
|
}
|
|
@@ -1717,7 +1717,7 @@ function CimplifyCheckout({
|
|
|
1717
1717
|
if (!resolvedCartId && !intentId && !isInitializing) {
|
|
1718
1718
|
const message = "A cart or purchase intent is required before checkout.";
|
|
1719
1719
|
setErrorMessage(message);
|
|
1720
|
-
fireError({ code:
|
|
1720
|
+
fireError({ code: chunkANT574FD_js.ErrorCode.CHECKOUT_AUTHORITY_REQUIRED, message });
|
|
1721
1721
|
}
|
|
1722
1722
|
return;
|
|
1723
1723
|
}
|
|
@@ -1729,7 +1729,7 @@ function CimplifyCheckout({
|
|
|
1729
1729
|
if (!elementsRef.current) {
|
|
1730
1730
|
const message = "Checkout is still initializing. Please try again.";
|
|
1731
1731
|
setErrorMessage(message);
|
|
1732
|
-
fireError({ code:
|
|
1732
|
+
fireError({ code: chunkANT574FD_js.ErrorCode.CHECKOUT_NOT_READY, message });
|
|
1733
1733
|
setIsSubmitting(false);
|
|
1734
1734
|
return;
|
|
1735
1735
|
}
|
|
@@ -1751,7 +1751,7 @@ function CimplifyCheckout({
|
|
|
1751
1751
|
onComplete(result);
|
|
1752
1752
|
return;
|
|
1753
1753
|
}
|
|
1754
|
-
const code = result.error?.code ||
|
|
1754
|
+
const code = result.error?.code || chunkANT574FD_js.ErrorCode.CHECKOUT_FAILED;
|
|
1755
1755
|
const message = result.error?.message || "Payment failed.";
|
|
1756
1756
|
setErrorMessage(message);
|
|
1757
1757
|
fireError({ code, message });
|
|
@@ -1772,7 +1772,7 @@ function CimplifyCheckout({
|
|
|
1772
1772
|
linkUrl
|
|
1773
1773
|
});
|
|
1774
1774
|
elementsRef.current = elements;
|
|
1775
|
-
const checkout = elements.create(
|
|
1775
|
+
const checkout = elements.create(chunkONII7K3T_js.ELEMENT_TYPES.CHECKOUT, {
|
|
1776
1776
|
orderTypes: resolvedOrderTypes,
|
|
1777
1777
|
defaultOrderType: resolvedDefaultOrderType,
|
|
1778
1778
|
submitLabel,
|
|
@@ -1783,19 +1783,19 @@ function CimplifyCheckout({
|
|
|
1783
1783
|
if (checkoutMountRef.current) {
|
|
1784
1784
|
checkout.mount(checkoutMountRef.current);
|
|
1785
1785
|
}
|
|
1786
|
-
checkout.on(
|
|
1786
|
+
checkout.on(chunkONII7K3T_js.EVENT_TYPES.READY, () => {
|
|
1787
1787
|
const cart = resolvedCartRef.current;
|
|
1788
1788
|
if (cart) {
|
|
1789
1789
|
checkout.setCart(transformToCheckoutCart(cart, fxOptionsRef.current));
|
|
1790
1790
|
}
|
|
1791
1791
|
});
|
|
1792
|
-
checkout.on(
|
|
1792
|
+
checkout.on(chunkONII7K3T_js.EVENT_TYPES.ORDER_TYPE_CHANGED, (data) => {
|
|
1793
1793
|
const typed = data;
|
|
1794
1794
|
if (typed.orderType) {
|
|
1795
1795
|
setOrderType(typed.orderType);
|
|
1796
1796
|
}
|
|
1797
1797
|
});
|
|
1798
|
-
checkout.on(
|
|
1798
|
+
checkout.on(chunkONII7K3T_js.EVENT_TYPES.REQUEST_SUBMIT, () => {
|
|
1799
1799
|
void handleSubmit();
|
|
1800
1800
|
});
|
|
1801
1801
|
return () => {
|
|
@@ -1816,7 +1816,7 @@ function CimplifyCheckout({
|
|
|
1816
1816
|
]);
|
|
1817
1817
|
React14.useEffect(() => {
|
|
1818
1818
|
if (!resolvedCart || !elementsRef.current) return;
|
|
1819
|
-
const checkoutElement = elementsRef.current.getElement(
|
|
1819
|
+
const checkoutElement = elementsRef.current.getElement(chunkONII7K3T_js.ELEMENT_TYPES.CHECKOUT);
|
|
1820
1820
|
if (checkoutElement) {
|
|
1821
1821
|
checkoutElement.setCart(transformToCheckoutCart(resolvedCart, fxOptions));
|
|
1822
1822
|
}
|
|
@@ -3292,19 +3292,19 @@ function toAccountLineItem(item, currency) {
|
|
|
3292
3292
|
quantity: s.quantity,
|
|
3293
3293
|
name: s.product_name,
|
|
3294
3294
|
variantName: s.variant_name,
|
|
3295
|
-
priceLabel:
|
|
3295
|
+
priceLabel: chunkV32BCG7M_js.parsePrice(s.unit_price) > 0 ? chunkV32BCG7M_js.formatMoney(s.unit_price, currency) : void 0
|
|
3296
3296
|
}));
|
|
3297
3297
|
const customisations = item.composite_selections?.selections.map((s) => ({
|
|
3298
3298
|
quantity: s.quantity,
|
|
3299
3299
|
name: s.component_name,
|
|
3300
|
-
priceLabel:
|
|
3300
|
+
priceLabel: chunkV32BCG7M_js.parsePrice(s.unit_price) > 0 ? `+${chunkV32BCG7M_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
3301
3301
|
}));
|
|
3302
3302
|
const data = {
|
|
3303
3303
|
id: item.id,
|
|
3304
3304
|
name: item.product_name ?? "Item",
|
|
3305
3305
|
imageUrl: item.image_url,
|
|
3306
3306
|
subtitle: lineSubtitle(item),
|
|
3307
|
-
priceLabel:
|
|
3307
|
+
priceLabel: chunkV32BCG7M_js.formatMoney(item.total_price, currency),
|
|
3308
3308
|
lineType: item.line_type,
|
|
3309
3309
|
includes,
|
|
3310
3310
|
customisations,
|
|
@@ -3353,20 +3353,20 @@ var PAYMENT_TONE = {
|
|
|
3353
3353
|
function toAccountOrderView(order, opts = {}) {
|
|
3354
3354
|
const currency = order.payment.currency;
|
|
3355
3355
|
const rows = [
|
|
3356
|
-
{ label: "Subtotal", value:
|
|
3356
|
+
{ label: "Subtotal", value: chunkV32BCG7M_js.formatMoney(order.pricing.subtotal, currency) }
|
|
3357
3357
|
];
|
|
3358
|
-
if (
|
|
3358
|
+
if (chunkV32BCG7M_js.parsePrice(order.pricing.total_discount) > 0) {
|
|
3359
3359
|
rows.push({
|
|
3360
3360
|
label: "Discount",
|
|
3361
|
-
value: `\u2212${
|
|
3361
|
+
value: `\u2212${chunkV32BCG7M_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
3362
3362
|
tone: "positive"
|
|
3363
3363
|
});
|
|
3364
3364
|
}
|
|
3365
|
-
if (order.pricing.tax &&
|
|
3366
|
-
rows.push({ label: "Tax", value:
|
|
3365
|
+
if (order.pricing.tax && chunkV32BCG7M_js.parsePrice(order.pricing.tax) > 0) {
|
|
3366
|
+
rows.push({ label: "Tax", value: chunkV32BCG7M_js.formatMoney(order.pricing.tax, currency) });
|
|
3367
3367
|
}
|
|
3368
|
-
if (order.pricing.service_charge &&
|
|
3369
|
-
rows.push({ label: "Service", value:
|
|
3368
|
+
if (order.pricing.service_charge && chunkV32BCG7M_js.parsePrice(order.pricing.service_charge) > 0) {
|
|
3369
|
+
rows.push({ label: "Service", value: chunkV32BCG7M_js.formatMoney(order.pricing.service_charge, currency) });
|
|
3370
3370
|
}
|
|
3371
3371
|
const placed = fmtDateTime(order.timestamps.created_at);
|
|
3372
3372
|
const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
@@ -3380,7 +3380,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
3380
3380
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
3381
3381
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
3382
3382
|
rows,
|
|
3383
|
-
total: { label: "Total", value:
|
|
3383
|
+
total: { label: "Total", value: chunkV32BCG7M_js.formatMoney(order.pricing.total_price, currency) }
|
|
3384
3384
|
},
|
|
3385
3385
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
3386
3386
|
onBack: opts.onBack
|
|
@@ -3555,7 +3555,7 @@ function CimplifySignInButton({
|
|
|
3555
3555
|
const onClick = async () => {
|
|
3556
3556
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3557
3557
|
setBusy(true);
|
|
3558
|
-
await
|
|
3558
|
+
await chunkONII7K3T_js.startSignIn({
|
|
3559
3559
|
...signInOpts,
|
|
3560
3560
|
onSuccess: () => {
|
|
3561
3561
|
setBusy(false);
|
|
@@ -4410,7 +4410,7 @@ function Price({
|
|
|
4410
4410
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4411
4411
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4412
4412
|
prefix,
|
|
4413
|
-
|
|
4413
|
+
chunkV32BCG7M_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4414
4414
|
] });
|
|
4415
4415
|
}
|
|
4416
4416
|
function createCachedQuery(config) {
|
|
@@ -5026,9 +5026,9 @@ function useClientSessionEpoch(client) {
|
|
|
5026
5026
|
const subscribe = React14.useCallback(
|
|
5027
5027
|
(notify) => {
|
|
5028
5028
|
const unsubscribe = [
|
|
5029
|
-
client.events.on(
|
|
5030
|
-
client.events.on(
|
|
5031
|
-
client.events.on(
|
|
5029
|
+
client.events.on(chunkONII7K3T_js.AUTH_TOKEN_CHANGED, notify),
|
|
5030
|
+
client.events.on(chunkONII7K3T_js.SESSION_CLAIMED, notify),
|
|
5031
|
+
client.events.on(chunkONII7K3T_js.SESSION_CLEARED, notify)
|
|
5032
5032
|
];
|
|
5033
5033
|
return () => {
|
|
5034
5034
|
for (const stopListening of unsubscribe) {
|
|
@@ -5515,13 +5515,13 @@ function useProductPrice(input) {
|
|
|
5515
5515
|
if (bundleTotalPrice != null) {
|
|
5516
5516
|
unitPrice = bundleTotalPrice;
|
|
5517
5517
|
} else if (compositePrice) {
|
|
5518
|
-
unitPrice =
|
|
5518
|
+
unitPrice = chunkV32BCG7M_js.parsePrice(compositePrice.final_price);
|
|
5519
5519
|
} else {
|
|
5520
|
-
unitPrice =
|
|
5520
|
+
unitPrice = chunkV32BCG7M_js.getVariantUnitPrice(product, variant);
|
|
5521
5521
|
if (addOnOptions) {
|
|
5522
5522
|
for (const option of addOnOptions) {
|
|
5523
5523
|
if (option.default_price) {
|
|
5524
|
-
unitPrice +=
|
|
5524
|
+
unitPrice += chunkV32BCG7M_js.parsePrice(option.default_price);
|
|
5525
5525
|
}
|
|
5526
5526
|
}
|
|
5527
5527
|
}
|
|
@@ -6268,7 +6268,7 @@ function useChat(options = {}) {
|
|
|
6268
6268
|
ws.onmessage = (event) => {
|
|
6269
6269
|
try {
|
|
6270
6270
|
const envelope = JSON.parse(event.data);
|
|
6271
|
-
const update =
|
|
6271
|
+
const update = chunkCEML2737_js.chatRealtimeUpdateFromWire(envelope);
|
|
6272
6272
|
if (update.kind === "message") {
|
|
6273
6273
|
appendMessages([update.message]);
|
|
6274
6274
|
} else if (update.kind === "message_updated") {
|
|
@@ -6379,7 +6379,7 @@ function useChat(options = {}) {
|
|
|
6379
6379
|
const watchSessionClaims = React14.useCallback(() => {
|
|
6380
6380
|
const c = clientRef.current;
|
|
6381
6381
|
if (!c || claimUnsubRef.current) return;
|
|
6382
|
-
const unsubClaimed = c.events.on(
|
|
6382
|
+
const unsubClaimed = c.events.on(chunkONII7K3T_js.SESSION_CLAIMED, (event) => {
|
|
6383
6383
|
setClaimedAs(event.customerName || c.session.claimedCustomerName || null);
|
|
6384
6384
|
if (!openedRef.current) {
|
|
6385
6385
|
void openIfExisting();
|
|
@@ -6388,7 +6388,7 @@ function useChat(options = {}) {
|
|
|
6388
6388
|
connectWebSocket();
|
|
6389
6389
|
void resyncConversation();
|
|
6390
6390
|
});
|
|
6391
|
-
const unsubCleared = c.events.on(
|
|
6391
|
+
const unsubCleared = c.events.on(chunkONII7K3T_js.SESSION_CLEARED, resetConversation);
|
|
6392
6392
|
claimUnsubRef.current = () => {
|
|
6393
6393
|
unsubClaimed();
|
|
6394
6394
|
unsubCleared();
|
|
@@ -6440,7 +6440,7 @@ function useChat(options = {}) {
|
|
|
6440
6440
|
if (!openedRef.current) return false;
|
|
6441
6441
|
}
|
|
6442
6442
|
const replyTo = opts?.replyTo;
|
|
6443
|
-
const clientId =
|
|
6443
|
+
const clientId = chunkONII7K3T_js.generateIdempotencyKey();
|
|
6444
6444
|
const localId = optimisticId(clientId);
|
|
6445
6445
|
const optimistic = {
|
|
6446
6446
|
id: localId,
|
|
@@ -6629,15 +6629,15 @@ function AuthElement({
|
|
|
6629
6629
|
}, [onReady, onAuthenticated, onError]);
|
|
6630
6630
|
React14.useEffect(() => {
|
|
6631
6631
|
if (!elements || !containerRef.current) return;
|
|
6632
|
-
const element = elements.create(
|
|
6632
|
+
const element = elements.create(chunkONII7K3T_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6633
6633
|
elementRef.current = element;
|
|
6634
|
-
element.on(
|
|
6634
|
+
element.on(chunkONII7K3T_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6635
6635
|
element.on(
|
|
6636
|
-
|
|
6636
|
+
chunkONII7K3T_js.EVENT_TYPES.AUTHENTICATED,
|
|
6637
6637
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6638
6638
|
);
|
|
6639
6639
|
element.on(
|
|
6640
|
-
|
|
6640
|
+
chunkONII7K3T_js.EVENT_TYPES.ERROR,
|
|
6641
6641
|
(data) => onErrorRef.current?.(data)
|
|
6642
6642
|
);
|
|
6643
6643
|
element.mount(containerRef.current);
|
|
@@ -6666,15 +6666,15 @@ function AddressElement({
|
|
|
6666
6666
|
}, [onReady, onChange, onError]);
|
|
6667
6667
|
React14.useEffect(() => {
|
|
6668
6668
|
if (!elements || !containerRef.current) return;
|
|
6669
|
-
const element = elements.create(
|
|
6669
|
+
const element = elements.create(chunkONII7K3T_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6670
6670
|
elementRef.current = element;
|
|
6671
|
-
element.on(
|
|
6671
|
+
element.on(chunkONII7K3T_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6672
6672
|
element.on(
|
|
6673
|
-
|
|
6673
|
+
chunkONII7K3T_js.EVENT_TYPES.CHANGE,
|
|
6674
6674
|
(data) => onChangeRef.current?.(data)
|
|
6675
6675
|
);
|
|
6676
6676
|
element.on(
|
|
6677
|
-
|
|
6677
|
+
chunkONII7K3T_js.EVENT_TYPES.ERROR,
|
|
6678
6678
|
(data) => onErrorRef.current?.(data)
|
|
6679
6679
|
);
|
|
6680
6680
|
element.mount(containerRef.current);
|
|
@@ -6704,15 +6704,15 @@ function PaymentElement({
|
|
|
6704
6704
|
}, [onReady, onChange, onError]);
|
|
6705
6705
|
React14.useEffect(() => {
|
|
6706
6706
|
if (!elements || !containerRef.current) return;
|
|
6707
|
-
const element = elements.create(
|
|
6707
|
+
const element = elements.create(chunkONII7K3T_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6708
6708
|
elementRef.current = element;
|
|
6709
|
-
element.on(
|
|
6709
|
+
element.on(chunkONII7K3T_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6710
6710
|
element.on(
|
|
6711
|
-
|
|
6711
|
+
chunkONII7K3T_js.EVENT_TYPES.CHANGE,
|
|
6712
6712
|
(data) => onChangeRef.current?.(data)
|
|
6713
6713
|
);
|
|
6714
6714
|
element.on(
|
|
6715
|
-
|
|
6715
|
+
chunkONII7K3T_js.EVENT_TYPES.ERROR,
|
|
6716
6716
|
(data) => onErrorRef.current?.(data)
|
|
6717
6717
|
);
|
|
6718
6718
|
element.mount(containerRef.current);
|
|
@@ -6869,7 +6869,7 @@ function VariantSelector({
|
|
|
6869
6869
|
if (!variants || variants.length <= 1) {
|
|
6870
6870
|
return null;
|
|
6871
6871
|
}
|
|
6872
|
-
basePrice != null ?
|
|
6872
|
+
basePrice != null ? chunkV32BCG7M_js.parsePrice(basePrice) : 0;
|
|
6873
6873
|
if (variantAxes && variantAxes.length > 0) {
|
|
6874
6874
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6875
6875
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6975,7 +6975,7 @@ function VariantSelector({
|
|
|
6975
6975
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6976
6976
|
children: variants.map((variant) => {
|
|
6977
6977
|
const isSelected = selectedVariantId === variant.id;
|
|
6978
|
-
const adjustment =
|
|
6978
|
+
const adjustment = chunkV32BCG7M_js.parsePrice(variant.price_adjustment);
|
|
6979
6979
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6980
6980
|
radio.Radio.Root,
|
|
6981
6981
|
{
|
|
@@ -7243,16 +7243,16 @@ function BundleSelector({
|
|
|
7243
7243
|
}, [components, selections, onReady]);
|
|
7244
7244
|
const totalPrice = React14.useMemo(() => {
|
|
7245
7245
|
if (pricingType === "fixed" && bundlePrice) {
|
|
7246
|
-
return
|
|
7246
|
+
return chunkV32BCG7M_js.parsePrice(bundlePrice);
|
|
7247
7247
|
}
|
|
7248
7248
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
7249
7249
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
7250
7250
|
}, 0);
|
|
7251
7251
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
7252
|
-
return componentsTotal * (1 -
|
|
7252
|
+
return componentsTotal * (1 - chunkV32BCG7M_js.parsePrice(discountValue) / 100);
|
|
7253
7253
|
}
|
|
7254
7254
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
7255
|
-
return componentsTotal -
|
|
7255
|
+
return componentsTotal - chunkV32BCG7M_js.parsePrice(discountValue);
|
|
7256
7256
|
}
|
|
7257
7257
|
return componentsTotal;
|
|
7258
7258
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -7314,15 +7314,15 @@ function BundleSelector({
|
|
|
7314
7314
|
}
|
|
7315
7315
|
function getComponentPrice(component, selectedVariantId) {
|
|
7316
7316
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
7317
|
-
return
|
|
7317
|
+
return chunkV32BCG7M_js.parsePrice(component.effective_price);
|
|
7318
7318
|
}
|
|
7319
7319
|
if (selectedVariantId === component.variant_id) {
|
|
7320
|
-
return
|
|
7320
|
+
return chunkV32BCG7M_js.parsePrice(component.effective_price);
|
|
7321
7321
|
}
|
|
7322
7322
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
7323
7323
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
7324
|
-
if (!selectedAdj) return
|
|
7325
|
-
return
|
|
7324
|
+
if (!selectedAdj) return chunkV32BCG7M_js.parsePrice(component.effective_price);
|
|
7325
|
+
return chunkV32BCG7M_js.parsePrice(component.effective_price) - chunkV32BCG7M_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkV32BCG7M_js.parsePrice(selectedAdj.price_adjustment);
|
|
7326
7326
|
}
|
|
7327
7327
|
function formatDuration(minutes, unit) {
|
|
7328
7328
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -7436,7 +7436,7 @@ function BundleComponentCard({
|
|
|
7436
7436
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
7437
7437
|
children: component.available_variants.map((variant) => {
|
|
7438
7438
|
const isSelected = selectedVariantId === variant.id;
|
|
7439
|
-
const adjustment =
|
|
7439
|
+
const adjustment = chunkV32BCG7M_js.parsePrice(variant.price_adjustment);
|
|
7440
7440
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7441
7441
|
radio.Radio.Root,
|
|
7442
7442
|
{
|
|
@@ -7883,7 +7883,7 @@ function CompositeSelector({
|
|
|
7883
7883
|
"data-cimplify-composite-summary": true,
|
|
7884
7884
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7885
7885
|
children: [
|
|
7886
|
-
|
|
7886
|
+
chunkV32BCG7M_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7887
7887
|
"div",
|
|
7888
7888
|
{
|
|
7889
7889
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7894,7 +7894,7 @@ function CompositeSelector({
|
|
|
7894
7894
|
]
|
|
7895
7895
|
}
|
|
7896
7896
|
),
|
|
7897
|
-
|
|
7897
|
+
chunkV32BCG7M_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7898
7898
|
"div",
|
|
7899
7899
|
{
|
|
7900
7900
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -8038,7 +8038,7 @@ function BookingSummary({
|
|
|
8038
8038
|
className,
|
|
8039
8039
|
classNames
|
|
8040
8040
|
}) {
|
|
8041
|
-
const depositValue = depositAmount != null ?
|
|
8041
|
+
const depositValue = depositAmount != null ? chunkV32BCG7M_js.parsePrice(depositAmount) : 0;
|
|
8042
8042
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
8043
8043
|
const hasDeposit = depositDue > 0;
|
|
8044
8044
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -8766,7 +8766,7 @@ function InputField({
|
|
|
8766
8766
|
currency,
|
|
8767
8767
|
classNames
|
|
8768
8768
|
}) {
|
|
8769
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
8769
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunkV32BCG7M_js.parsePrice(field.price_adjustment) > 0;
|
|
8770
8770
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
8771
8771
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
8772
8772
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -9898,15 +9898,15 @@ function ProductCustomizerContent({
|
|
|
9898
9898
|
}, [selectedAddOnOptionIds]);
|
|
9899
9899
|
const localTotalPrice = React14.useMemo(() => {
|
|
9900
9900
|
if (isComposite && compositePrice) {
|
|
9901
|
-
return
|
|
9901
|
+
return chunkV32BCG7M_js.parsePrice(compositePrice.final_price) * quantity;
|
|
9902
9902
|
}
|
|
9903
9903
|
if (isBundle && bundleTotalPrice != null) {
|
|
9904
9904
|
return bundleTotalPrice * quantity;
|
|
9905
9905
|
}
|
|
9906
|
-
let price =
|
|
9906
|
+
let price = chunkV32BCG7M_js.getVariantUnitPrice(product, selectedVariant);
|
|
9907
9907
|
for (const option of selectedAddOnOptions) {
|
|
9908
9908
|
if (option.default_price) {
|
|
9909
|
-
price +=
|
|
9909
|
+
price += chunkV32BCG7M_js.parsePrice(option.default_price);
|
|
9910
9910
|
}
|
|
9911
9911
|
}
|
|
9912
9912
|
return price * quantity;
|
|
@@ -9972,12 +9972,12 @@ function ProductCustomizerContent({
|
|
|
9972
9972
|
} = useQuote(quoteInput, {
|
|
9973
9973
|
enabled: quoteEnabled
|
|
9974
9974
|
});
|
|
9975
|
-
const currency = quote?.currency ??
|
|
9975
|
+
const currency = quote?.currency ?? chunkV32BCG7M_js.getProductCurrency(product);
|
|
9976
9976
|
const quoteId = quote?.quote_id;
|
|
9977
9977
|
const quotedUnitPrice = (quote?.quoted_total_price_info ?? quote?.final_price_info)?.final_price;
|
|
9978
9978
|
const quotedTotalPrice = React14.useMemo(() => {
|
|
9979
9979
|
if (quotedUnitPrice === void 0 || quotedUnitPrice === null) return void 0;
|
|
9980
|
-
return
|
|
9980
|
+
return chunkV32BCG7M_js.parsePrice(quotedUnitPrice) * quantity;
|
|
9981
9981
|
}, [quotedUnitPrice, quantity]);
|
|
9982
9982
|
const quoteIsReady = quoteEnabled && quote !== null && !isQuoteLoading && !quoteError && !isQuoteExpired2;
|
|
9983
9983
|
const validationMessage = !quoteEnabled ? REQUIRED_OPTIONS_MESSAGE : quoteError ? QUOTE_UNAVAILABLE_MESSAGE : !quoteIsReady ? QUOTE_LOADING_MESSAGE : null;
|
|
@@ -10201,7 +10201,7 @@ function ProductCustomizerContent({
|
|
|
10201
10201
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
10202
10202
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
10203
10203
|
"Deposit required: ",
|
|
10204
|
-
|
|
10204
|
+
chunkV32BCG7M_js.parsePrice(product.deposit_amount),
|
|
10205
10205
|
"%"
|
|
10206
10206
|
] })
|
|
10207
10207
|
}
|
|
@@ -10309,10 +10309,10 @@ function ProductCustomizerContent({
|
|
|
10309
10309
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10310
10310
|
Price,
|
|
10311
10311
|
{
|
|
10312
|
-
amount:
|
|
10312
|
+
amount: chunkV32BCG7M_js.getUnitPriceAtQuantity(
|
|
10313
10313
|
product.quantity_pricing,
|
|
10314
10314
|
quantity,
|
|
10315
|
-
|
|
10315
|
+
chunkV32BCG7M_js.parsePrice(product.default_price)
|
|
10316
10316
|
),
|
|
10317
10317
|
currency,
|
|
10318
10318
|
className: "font-medium text-foreground"
|
|
@@ -10778,11 +10778,11 @@ function CartLineItemRow({
|
|
|
10778
10778
|
addOnOptions: item.addOnOptions
|
|
10779
10779
|
});
|
|
10780
10780
|
const pinnedUnitPrice = item._quotedUnitPrice;
|
|
10781
|
-
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice :
|
|
10781
|
+
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunkV32BCG7M_js.parsePrice(pinnedUnitPrice);
|
|
10782
10782
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
10783
10783
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
10784
10784
|
const isOptimistic2 = item.isOptimistic === true;
|
|
10785
|
-
const lineTotal =
|
|
10785
|
+
const lineTotal = chunkV32BCG7M_js.parsePrice(unitPrice) * item.quantity;
|
|
10786
10786
|
const imageUrl = item.product.image_url;
|
|
10787
10787
|
const variantLabel2 = item.variant ? chunk2P4KXFB6_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
10788
10788
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -11071,7 +11071,7 @@ function CartSummary({
|
|
|
11071
11071
|
removeItem,
|
|
11072
11072
|
updateQuantity
|
|
11073
11073
|
} = useCart();
|
|
11074
|
-
const displayCurrency = serverCart?.currency ??
|
|
11074
|
+
const displayCurrency = serverCart?.currency ?? chunkANT574FD_js.currencyCode(currency);
|
|
11075
11075
|
const deliveryFee = serverCart?.delivery_fee;
|
|
11076
11076
|
const serviceCharge = serverCart?.service_charge;
|
|
11077
11077
|
const totalDiscounts = serverCart?.total_discounts;
|
|
@@ -11134,7 +11134,7 @@ function CartSummary({
|
|
|
11134
11134
|
]
|
|
11135
11135
|
}
|
|
11136
11136
|
),
|
|
11137
|
-
totalDiscounts != null &&
|
|
11137
|
+
totalDiscounts != null && chunkV32BCG7M_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11138
11138
|
"div",
|
|
11139
11139
|
{
|
|
11140
11140
|
"data-cimplify-cart-discount": true,
|
|
@@ -11160,7 +11160,7 @@ function CartSummary({
|
|
|
11160
11160
|
className: cn("flex items-baseline justify-between", classNames?.deliveryFee),
|
|
11161
11161
|
children: [
|
|
11162
11162
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
11163
|
-
|
|
11163
|
+
chunkV32BCG7M_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11164
11164
|
Price,
|
|
11165
11165
|
{
|
|
11166
11166
|
amount: deliveryFee,
|
|
@@ -11171,7 +11171,7 @@ function CartSummary({
|
|
|
11171
11171
|
]
|
|
11172
11172
|
}
|
|
11173
11173
|
),
|
|
11174
|
-
serviceCharge != null &&
|
|
11174
|
+
serviceCharge != null && chunkV32BCG7M_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11175
11175
|
"div",
|
|
11176
11176
|
{
|
|
11177
11177
|
"data-cimplify-cart-service-charge": true,
|
|
@@ -11305,18 +11305,18 @@ function SaleBadge({
|
|
|
11305
11305
|
className,
|
|
11306
11306
|
classNames
|
|
11307
11307
|
}) {
|
|
11308
|
-
const onSale =
|
|
11308
|
+
const onSale = chunkV32BCG7M_js.isOnSale(product);
|
|
11309
11309
|
const hasDeal = dealInfo !== void 0;
|
|
11310
11310
|
if (!hasDeal && !onSale && !label) {
|
|
11311
11311
|
return null;
|
|
11312
11312
|
}
|
|
11313
11313
|
let percentage = null;
|
|
11314
11314
|
if (product.sale) {
|
|
11315
|
-
percentage =
|
|
11315
|
+
percentage = chunkV32BCG7M_js.parsePrice(product.sale.percent_off);
|
|
11316
11316
|
} else if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
11317
|
-
percentage =
|
|
11317
|
+
percentage = chunkV32BCG7M_js.parsePrice(dealInfo.value);
|
|
11318
11318
|
} else if (onSale) {
|
|
11319
|
-
percentage =
|
|
11319
|
+
percentage = chunkV32BCG7M_js.getDiscountPercentage(product);
|
|
11320
11320
|
}
|
|
11321
11321
|
const badgeText = label ?? product.sale?.badge_text ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
11322
11322
|
if (!badgeText) {
|
|
@@ -11335,7 +11335,7 @@ function SaleBadge({
|
|
|
11335
11335
|
"%"
|
|
11336
11336
|
] }),
|
|
11337
11337
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
11338
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11338
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkV32BCG7M_js.getBasePrice(product), currency: chunkV32BCG7M_js.getProductCurrency(product) }) })
|
|
11339
11339
|
]
|
|
11340
11340
|
}
|
|
11341
11341
|
);
|
|
@@ -11353,7 +11353,7 @@ function SalePrice({
|
|
|
11353
11353
|
if (!sale) {
|
|
11354
11354
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
11355
11355
|
}
|
|
11356
|
-
const off = Math.round(
|
|
11356
|
+
const off = Math.round(chunkV32BCG7M_js.parsePrice(sale.percent_off));
|
|
11357
11357
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11358
11358
|
"span",
|
|
11359
11359
|
{
|
|
@@ -11729,7 +11729,7 @@ function ProductSheet({
|
|
|
11729
11729
|
Price,
|
|
11730
11730
|
{
|
|
11731
11731
|
amount: fullProduct.default_price,
|
|
11732
|
-
currency:
|
|
11732
|
+
currency: chunkV32BCG7M_js.getProductCurrency(fullProduct),
|
|
11733
11733
|
className: classNames?.price
|
|
11734
11734
|
}
|
|
11735
11735
|
)
|
|
@@ -11915,10 +11915,10 @@ function SoldOutOverlay() {
|
|
|
11915
11915
|
function SaleBadge2({ product }) {
|
|
11916
11916
|
let label = null;
|
|
11917
11917
|
if (product.sale) {
|
|
11918
|
-
const off = Math.round(
|
|
11918
|
+
const off = Math.round(chunkV32BCG7M_js.parsePrice(product.sale.percent_off));
|
|
11919
11919
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11920
|
-
} else if (
|
|
11921
|
-
const pct =
|
|
11920
|
+
} else if (chunkV32BCG7M_js.isOnSale(product)) {
|
|
11921
|
+
const pct = chunkV32BCG7M_js.getDiscountPercentage(product);
|
|
11922
11922
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11923
11923
|
}
|
|
11924
11924
|
if (!label) return null;
|
|
@@ -11959,7 +11959,7 @@ function FoodProductCard({
|
|
|
11959
11959
|
className
|
|
11960
11960
|
}) {
|
|
11961
11961
|
const image = product.image_url || product.images?.[0] || "";
|
|
11962
|
-
const currency =
|
|
11962
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
11963
11963
|
const tags = product.tags || [];
|
|
11964
11964
|
const isSignature = product.metadata?.is_signature === true;
|
|
11965
11965
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -12015,9 +12015,9 @@ function RetailProductCard({
|
|
|
12015
12015
|
className
|
|
12016
12016
|
}) {
|
|
12017
12017
|
const image = product.image_url || product.images?.[0] || "";
|
|
12018
|
-
const currency =
|
|
12018
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12019
12019
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
12020
|
-
const onSale =
|
|
12020
|
+
const onSale = chunkV32BCG7M_js.isOnSale(product);
|
|
12021
12021
|
const swatches = getColorSwatches(product);
|
|
12022
12022
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
12023
12023
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -12038,7 +12038,7 @@ function RetailProductCard({
|
|
|
12038
12038
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
12039
12039
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12040
12040
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
12041
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
12041
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkV32BCG7M_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
12042
12042
|
] }) }),
|
|
12043
12043
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12044
12044
|
"span",
|
|
@@ -12053,10 +12053,10 @@ function RetailProductCard({
|
|
|
12053
12053
|
] });
|
|
12054
12054
|
}
|
|
12055
12055
|
function PriceRange({ product, currency, className }) {
|
|
12056
|
-
const resolvedCurrency = currency ??
|
|
12057
|
-
const range =
|
|
12056
|
+
const resolvedCurrency = currency ?? chunkV32BCG7M_js.getProductCurrency(product);
|
|
12057
|
+
const range = chunkV32BCG7M_js.getPriceRange(product);
|
|
12058
12058
|
if (!range) return null;
|
|
12059
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
12059
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkV32BCG7M_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
12060
12060
|
}
|
|
12061
12061
|
function WholesaleProductCard({
|
|
12062
12062
|
product,
|
|
@@ -12066,7 +12066,7 @@ function WholesaleProductCard({
|
|
|
12066
12066
|
className
|
|
12067
12067
|
}) {
|
|
12068
12068
|
const image = product.image_url || product.images?.[0] || "";
|
|
12069
|
-
const currency =
|
|
12069
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12070
12070
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12071
12071
|
const status = product.inventory_status;
|
|
12072
12072
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12114,7 +12114,7 @@ function DigitalProductCard({
|
|
|
12114
12114
|
className
|
|
12115
12115
|
}) {
|
|
12116
12116
|
const image = product.image_url || product.images?.[0] || "";
|
|
12117
|
-
const currency =
|
|
12117
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12118
12118
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
12119
12119
|
const isTicket = product.digital_type === "ticket";
|
|
12120
12120
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12145,11 +12145,11 @@ function BundleProductCard({
|
|
|
12145
12145
|
className
|
|
12146
12146
|
}) {
|
|
12147
12147
|
const image = product.image_url || product.images?.[0] || "";
|
|
12148
|
-
const currency =
|
|
12148
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12149
12149
|
const components = product.components || [];
|
|
12150
12150
|
const componentCount = components.length;
|
|
12151
|
-
const onSale =
|
|
12152
|
-
const discount =
|
|
12151
|
+
const onSale = chunkV32BCG7M_js.isOnSale(product);
|
|
12152
|
+
const discount = chunkV32BCG7M_js.getDiscountPercentage(product);
|
|
12153
12153
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
12154
12154
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12155
12155
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -12176,7 +12176,7 @@ function BundleProductCard({
|
|
|
12176
12176
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
12177
12177
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
12178
12178
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12179
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
12179
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkV32BCG7M_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
12180
12180
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
12181
12181
|
"Save ",
|
|
12182
12182
|
discount,
|
|
@@ -12196,7 +12196,7 @@ function CompositeProductCard({
|
|
|
12196
12196
|
className
|
|
12197
12197
|
}) {
|
|
12198
12198
|
const image = product.image_url || product.images?.[0] || "";
|
|
12199
|
-
const currency =
|
|
12199
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12200
12200
|
const groups = product.groups || [];
|
|
12201
12201
|
const groupCount = groups.length;
|
|
12202
12202
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -12248,7 +12248,7 @@ function StandardServiceCard({
|
|
|
12248
12248
|
className
|
|
12249
12249
|
}) {
|
|
12250
12250
|
const image = product.image_url || product.images?.[0] || "";
|
|
12251
|
-
const currency =
|
|
12251
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12252
12252
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12253
12253
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12254
12254
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -12303,7 +12303,7 @@ function CompactServiceCard({
|
|
|
12303
12303
|
className
|
|
12304
12304
|
}) {
|
|
12305
12305
|
const image = product.image_url || product.images?.[0] || "";
|
|
12306
|
-
const currency =
|
|
12306
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12307
12307
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12308
12308
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
12309
12309
|
const href = `/products/${product.slug}`;
|
|
@@ -12352,7 +12352,7 @@ function ScheduleServiceCard({
|
|
|
12352
12352
|
className
|
|
12353
12353
|
}) {
|
|
12354
12354
|
const image = product.image_url || product.images?.[0] || "";
|
|
12355
|
-
const currency =
|
|
12355
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12356
12356
|
const href = `/products/${product.slug}`;
|
|
12357
12357
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
12358
12358
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -12424,7 +12424,7 @@ function RentalServiceCard({
|
|
|
12424
12424
|
className
|
|
12425
12425
|
}) {
|
|
12426
12426
|
const image = product.image_url || product.images?.[0] || "";
|
|
12427
|
-
const currency =
|
|
12427
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12428
12428
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12429
12429
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
12430
12430
|
const priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit;
|
|
@@ -12494,7 +12494,7 @@ function AccommodationCard({
|
|
|
12494
12494
|
className
|
|
12495
12495
|
}) {
|
|
12496
12496
|
const image = product.image_url || product.images?.[0] || "";
|
|
12497
|
-
const currency =
|
|
12497
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12498
12498
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12499
12499
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
12500
12500
|
const tags = product.tags || [];
|
|
@@ -12560,7 +12560,7 @@ function LeaseServiceCard({
|
|
|
12560
12560
|
className
|
|
12561
12561
|
}) {
|
|
12562
12562
|
const image = product.image_url || product.images?.[0] || "";
|
|
12563
|
-
const currency =
|
|
12563
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12564
12564
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12565
12565
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12566
12566
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -12634,7 +12634,7 @@ function SubscriptionCard({
|
|
|
12634
12634
|
className
|
|
12635
12635
|
}) {
|
|
12636
12636
|
const image = product.image_url || product.images?.[0] || "";
|
|
12637
|
-
const currency =
|
|
12637
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
12638
12638
|
const plans = product.billing_plans || [];
|
|
12639
12639
|
const primaryPlan = plans[0];
|
|
12640
12640
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12865,7 +12865,7 @@ function ProductCard({
|
|
|
12865
12865
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12866
12866
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12867
12867
|
descriptionPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-description": true, className: cn("text-sm text-muted-foreground line-clamp-2", classNames?.description), children: descriptionPreview }),
|
|
12868
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
12868
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkV32BCG7M_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
12869
12869
|
] })
|
|
12870
12870
|
] });
|
|
12871
12871
|
})();
|
|
@@ -13194,7 +13194,7 @@ function SearchInput({
|
|
|
13194
13194
|
}
|
|
13195
13195
|
),
|
|
13196
13196
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
13197
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
13197
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkV32BCG7M_js.formatPrice(product.default_price) })
|
|
13198
13198
|
] })
|
|
13199
13199
|
},
|
|
13200
13200
|
product.id
|
|
@@ -13688,19 +13688,19 @@ function OrderSummary({
|
|
|
13688
13688
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
13689
13689
|
] }),
|
|
13690
13690
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
13691
|
-
order.total_discount != null &&
|
|
13691
|
+
order.total_discount != null && chunkV32BCG7M_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
13692
13692
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
13693
13693
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
13694
13694
|
] }),
|
|
13695
|
-
order.delivery_fee != null &&
|
|
13695
|
+
order.delivery_fee != null && chunkV32BCG7M_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
13696
13696
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
13697
13697
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
13698
13698
|
] }),
|
|
13699
|
-
order.service_charge != null &&
|
|
13699
|
+
order.service_charge != null && chunkV32BCG7M_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
13700
13700
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
13701
13701
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
13702
13702
|
] }),
|
|
13703
|
-
order.tax != null &&
|
|
13703
|
+
order.tax != null && chunkV32BCG7M_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
13704
13704
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
13705
13705
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
13706
13706
|
] }),
|
|
@@ -14230,7 +14230,7 @@ function BookingPage({
|
|
|
14230
14230
|
const hasStaffStep = staff && staff.length > 0;
|
|
14231
14231
|
const depositType = product?.deposit_type;
|
|
14232
14232
|
const depositAmount = product?.deposit_amount;
|
|
14233
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
14233
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkV32BCG7M_js.parsePrice(depositAmount) !== 0;
|
|
14234
14234
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
14235
14235
|
const noShowFee = product?.no_show_fee;
|
|
14236
14236
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -14363,14 +14363,14 @@ function BookingPage({
|
|
|
14363
14363
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
14364
14364
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
14365
14365
|
"Deposit: ",
|
|
14366
|
-
depositType === "percentage" ? `${
|
|
14366
|
+
depositType === "percentage" ? `${chunkV32BCG7M_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
14367
14367
|
] }),
|
|
14368
14368
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
14369
14369
|
"Free cancellation up to ",
|
|
14370
14370
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
14371
14371
|
" before"
|
|
14372
14372
|
] }),
|
|
14373
|
-
noShowFee !== void 0 &&
|
|
14373
|
+
noShowFee !== void 0 && chunkV32BCG7M_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
14374
14374
|
"No-show fee: ",
|
|
14375
14375
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
14376
14376
|
] })
|
|
@@ -14473,7 +14473,7 @@ function BookingPage({
|
|
|
14473
14473
|
] }),
|
|
14474
14474
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
14475
14475
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
14476
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
14476
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkV32BCG7M_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
14477
14477
|
] })
|
|
14478
14478
|
] }),
|
|
14479
14479
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15147,9 +15147,9 @@ function DefaultProductLayout({
|
|
|
15147
15147
|
}) {
|
|
15148
15148
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
15149
15149
|
const images = chunk2P4KXFB6_js.resolveGallery(product, selectedVariantId);
|
|
15150
|
-
const currency =
|
|
15150
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15151
15151
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
15152
|
-
const onSale =
|
|
15152
|
+
const onSale = chunkV32BCG7M_js.isOnSale(product);
|
|
15153
15153
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
15154
15154
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
15155
15155
|
renderBreadcrumb?.(product),
|
|
@@ -15172,13 +15172,13 @@ function DefaultProductLayout({
|
|
|
15172
15172
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : product.sale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15173
15173
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
15174
15174
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15175
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(
|
|
15175
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(chunkV32BCG7M_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
15176
15176
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15177
15177
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
15178
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
15178
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkV32BCG7M_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15179
15179
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
15180
15180
|
"Save ",
|
|
15181
|
-
|
|
15181
|
+
chunkV32BCG7M_js.getDiscountPercentage(product),
|
|
15182
15182
|
"%"
|
|
15183
15183
|
] })
|
|
15184
15184
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -15240,7 +15240,7 @@ function FoodProductLayout({
|
|
|
15240
15240
|
className
|
|
15241
15241
|
}) {
|
|
15242
15242
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15243
|
-
const currency =
|
|
15243
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15244
15244
|
const tags = product.tags || [];
|
|
15245
15245
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
15246
15246
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -15315,7 +15315,7 @@ function WholesaleProductLayout({
|
|
|
15315
15315
|
className
|
|
15316
15316
|
}) {
|
|
15317
15317
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15318
|
-
const currency =
|
|
15318
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15319
15319
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
15320
15320
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
15321
15321
|
renderBreadcrumb?.(product),
|
|
@@ -15399,9 +15399,9 @@ function ServiceProductLayout({
|
|
|
15399
15399
|
className
|
|
15400
15400
|
}) {
|
|
15401
15401
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15402
|
-
const currency =
|
|
15402
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15403
15403
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
15404
|
-
const depositAmount = hasDeposit ?
|
|
15404
|
+
const depositAmount = hasDeposit ? chunkV32BCG7M_js.parsePrice(product.deposit_amount) : 0;
|
|
15405
15405
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
15406
15406
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
15407
15407
|
renderBreadcrumb?.(product),
|
|
@@ -15469,7 +15469,7 @@ function ServiceProductLayout({
|
|
|
15469
15469
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
15470
15470
|
" deposit charged at booking"
|
|
15471
15471
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15472
|
-
|
|
15472
|
+
chunkV32BCG7M_js.parsePrice(product.deposit_amount),
|
|
15473
15473
|
"% deposit charged at booking"
|
|
15474
15474
|
] }) })
|
|
15475
15475
|
] })
|
|
@@ -15501,7 +15501,7 @@ function DigitalProductLayout({
|
|
|
15501
15501
|
className
|
|
15502
15502
|
}) {
|
|
15503
15503
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15504
|
-
const currency =
|
|
15504
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15505
15505
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
15506
15506
|
const isTicket = product.digital_type === "ticket";
|
|
15507
15507
|
const isAccessPass = product.digital_type === "access_grant";
|
|
@@ -15628,15 +15628,15 @@ function BundleProductLayout({
|
|
|
15628
15628
|
className
|
|
15629
15629
|
}) {
|
|
15630
15630
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15631
|
-
const currency =
|
|
15631
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15632
15632
|
const components = product.components || [];
|
|
15633
|
-
const onSale =
|
|
15634
|
-
const discount =
|
|
15633
|
+
const onSale = chunkV32BCG7M_js.isOnSale(product);
|
|
15634
|
+
const discount = chunkV32BCG7M_js.getDiscountPercentage(product);
|
|
15635
15635
|
const baseTotal = components.reduce(
|
|
15636
|
-
(sum, c) => sum +
|
|
15636
|
+
(sum, c) => sum + chunkV32BCG7M_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
15637
15637
|
0
|
|
15638
15638
|
);
|
|
15639
|
-
const bundlePrice =
|
|
15639
|
+
const bundlePrice = chunkV32BCG7M_js.parsePrice(product.default_price);
|
|
15640
15640
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
15641
15641
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
15642
15642
|
renderBreadcrumb?.(product),
|
|
@@ -15712,7 +15712,7 @@ function CompositeProductLayout({
|
|
|
15712
15712
|
className
|
|
15713
15713
|
}) {
|
|
15714
15714
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15715
|
-
const currency =
|
|
15715
|
+
const currency = chunkV32BCG7M_js.getProductCurrency(product);
|
|
15716
15716
|
const groups = product.groups || [];
|
|
15717
15717
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
15718
15718
|
renderBreadcrumb?.(product),
|
|
@@ -16135,7 +16135,7 @@ function CartDrawer({
|
|
|
16135
16135
|
}) {
|
|
16136
16136
|
const { isOpen, close } = useCartDrawer();
|
|
16137
16137
|
const cart = useCart();
|
|
16138
|
-
const subtotalNum =
|
|
16138
|
+
const subtotalNum = chunkV32BCG7M_js.parsePrice(cart.subtotal);
|
|
16139
16139
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
16140
16140
|
React14.useEffect(() => {
|
|
16141
16141
|
if (!isOpen) return;
|
|
@@ -16529,9 +16529,9 @@ function CatalogueCollectionLayout({
|
|
|
16529
16529
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
16530
16530
|
}
|
|
16531
16531
|
if (sortBy === "price-asc") {
|
|
16532
|
-
result = [...result].sort((a, b) =>
|
|
16532
|
+
result = [...result].sort((a, b) => chunkV32BCG7M_js.parsePrice(a.default_price) - chunkV32BCG7M_js.parsePrice(b.default_price));
|
|
16533
16533
|
} else if (sortBy === "price-desc") {
|
|
16534
|
-
result = [...result].sort((a, b) =>
|
|
16534
|
+
result = [...result].sort((a, b) => chunkV32BCG7M_js.parsePrice(b.default_price) - chunkV32BCG7M_js.parsePrice(a.default_price));
|
|
16535
16535
|
} else if (sortBy === "name") {
|
|
16536
16536
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
16537
16537
|
}
|
|
@@ -20060,7 +20060,7 @@ function toneChip(value) {
|
|
|
20060
20060
|
}
|
|
20061
20061
|
}
|
|
20062
20062
|
function money(amount, currency) {
|
|
20063
|
-
return
|
|
20063
|
+
return chunkV32BCG7M_js.formatPrice(chunkV32BCG7M_js.parsePrice(num(amount) ?? 0), text(currency));
|
|
20064
20064
|
}
|
|
20065
20065
|
var CHAT_GENUI_COMPONENTS = {
|
|
20066
20066
|
Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20308,7 +20308,7 @@ function ReplyCardView({
|
|
|
20308
20308
|
card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
|
|
20309
20309
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
20310
20310
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
|
|
20311
|
-
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children:
|
|
20311
|
+
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunkV32BCG7M_js.formatPrice(chunkV32BCG7M_js.parsePrice(card.price), currency ?? void 0) }),
|
|
20312
20312
|
fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
|
|
20313
20313
|
] })
|
|
20314
20314
|
]
|
|
@@ -20405,12 +20405,12 @@ function ChatWidget({
|
|
|
20405
20405
|
setAttachError(null);
|
|
20406
20406
|
if (!isAllowedAttachment(file)) {
|
|
20407
20407
|
setAttachError(
|
|
20408
|
-
new
|
|
20408
|
+
new chunkANT574FD_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
|
|
20409
20409
|
);
|
|
20410
20410
|
return;
|
|
20411
20411
|
}
|
|
20412
20412
|
if (file.size > MAX_ATTACHMENT_BYTES) {
|
|
20413
|
-
setAttachError(new
|
|
20413
|
+
setAttachError(new chunkANT574FD_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
|
|
20414
20414
|
return;
|
|
20415
20415
|
}
|
|
20416
20416
|
const uploaded = await client.uploads.upload(file);
|