@cimplify/sdk 0.104.0 → 0.104.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 -7
- package/dist/advanced.d.ts +3 -7
- package/dist/advanced.js +23 -23
- package/dist/advanced.mjs +4 -4
- package/dist/{client-BuLcOWLv.d.ts → catalogue-BlQ85Uma.d.mts} +415 -763
- package/dist/{client-D5AoobFc.d.mts → catalogue-C8TqOj9K.d.ts} +415 -763
- package/dist/{payment-g0HFkEDU.d.mts → checkout-BqK9XUz5.d.mts} +3824 -1446
- package/dist/{payment-g0HFkEDU.d.ts → checkout-BqK9XUz5.d.ts} +3824 -1446
- package/dist/{chunk-GOHSXBKW.mjs → chunk-33VCYWVL.mjs} +25 -1
- package/dist/{chunk-2WPVUIHX.mjs → chunk-6G3ANKQA.mjs} +1030 -360
- package/dist/{chunk-E4K2VQDD.js → chunk-BWEIMKLF.js} +541 -16
- package/dist/{chunk-IQFFSKE2.js → chunk-DQEXY542.js} +1345 -746
- package/dist/{chunk-CNN7Z2IP.js → chunk-EV2EVOYS.js} +27 -0
- package/dist/{chunk-YVAEY3VC.js → chunk-HYFA67A7.js} +1034 -364
- package/dist/{chunk-5RT4HYMP.mjs → chunk-L5SNEU2O.mjs} +524 -15
- package/dist/{chunk-4BKOKHE3.js → chunk-RBNBSQI7.mjs} +217 -19
- package/dist/{chunk-H3RATH4B.mjs → chunk-SFUJMS5E.js} +261 -2
- package/dist/{chunk-DYIAX3WI.mjs → chunk-U54CWUUT.mjs} +11 -2
- package/dist/{chunk-OKADBZAI.mjs → chunk-UFOWPN3D.mjs} +808 -574
- package/dist/{chunk-OCCNG6MO.mjs → chunk-V4457OKB.mjs} +1310 -722
- package/dist/{chunk-5BDYDZ4U.js → chunk-WXREIBFW.js} +892 -657
- package/dist/{chunk-7PDEX54K.js → chunk-XAUSDMMZ.js} +13 -3
- package/dist/{client-BVNWjk6W.d.ts → client-DhXeiUrf.d.ts} +2 -2
- package/dist/{client-fM716k7G.d.mts → client-mXiUrV4X.d.mts} +2 -2
- package/dist/{index-BtcoqrY1.d.ts → index-B0AdZvrM.d.mts} +9 -4
- package/dist/{index-D7Tf3v7c.d.mts → index-CK8Nk5uQ.d.ts} +9 -4
- package/dist/index-DPWI5XcU.d.ts +8 -0
- package/dist/index-DVfUh-ci.d.mts +8 -0
- package/dist/index.d.mts +31 -14
- package/dist/index.d.ts +31 -14
- package/dist/index.js +305 -133
- package/dist/index.mjs +6 -6
- package/dist/mock/cli.mjs +1442 -386
- package/dist/mock/library.js +1168 -352
- package/dist/mock/library.mjs +1168 -352
- package/dist/mock/msw.js +1168 -352
- package/dist/mock/msw.mjs +1168 -352
- package/dist/{price-BLIeAb8K.d.ts → price-6hQIIac9.d.ts} +1 -1
- package/dist/{price-Czq_cTC_.d.mts → price-BUDv1rI7.d.mts} +1 -1
- package/dist/react.d.mts +10 -5
- package/dist/react.d.ts +10 -5
- package/dist/react.js +227 -197
- package/dist/react.mjs +90 -60
- package/dist/{server-DKK_D-PP.d.ts → server-DJ0mSs9i.d.mts} +31 -57
- package/dist/{server-BkVhOIwn.d.mts → server-DSTX76Ki.d.ts} +31 -57
- package/dist/server.d.mts +3 -4
- package/dist/server.d.ts +3 -4
- package/dist/server.js +11 -11
- package/dist/server.mjs +5 -5
- package/dist/styles.css +2 -2
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +4 -4
- package/dist/testing/msw.mjs +3 -3
- package/dist/testing/suite.d.mts +5 -6
- package/dist/testing/suite.d.ts +5 -6
- package/dist/testing/suite.js +29 -28
- package/dist/testing/suite.mjs +10 -9
- package/dist/testing.d.mts +2177 -14
- package/dist/testing.d.ts +2177 -14
- package/dist/testing.js +167 -89
- package/dist/testing.mjs +24 -10
- package/dist/utils.d.mts +3 -4
- package/dist/utils.d.ts +3 -4
- package/dist/utils.js +35 -31
- package/dist/utils.mjs +2 -2
- package/package.json +9 -9
- package/registry/order-history.json +1 -1
- package/registry/order-summary.json +1 -1
- package/dist/link-D9iSVxt5.d.mts +0 -308
- package/dist/link-D9iSVxt5.d.ts +0 -308
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 chunkWXREIBFW_js = require('./chunk-WXREIBFW.js');
|
|
6
6
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
7
|
+
var chunkDQEXY542_js = require('./chunk-DQEXY542.js');
|
|
8
|
+
var chunkEV2EVOYS_js = require('./chunk-EV2EVOYS.js');
|
|
9
|
+
var chunkXAUSDMMZ_js = require('./chunk-XAUSDMMZ.js');
|
|
10
|
+
var chunkSFUJMS5E_js = require('./chunk-SFUJMS5E.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(chunkXAUSDMMZ_js.parsePrice(item._quotedUnitPrice) * item.quantity);
|
|
639
639
|
}
|
|
640
|
-
let unitPrice =
|
|
640
|
+
let unitPrice = chunkXAUSDMMZ_js.parsePrice(item.product.default_price);
|
|
641
641
|
if (item.variant?.price_adjustment) {
|
|
642
|
-
unitPrice +=
|
|
642
|
+
unitPrice += chunkXAUSDMMZ_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 += chunkXAUSDMMZ_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(chunkWXREIBFW_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(chunkWXREIBFW_js.SESSION_CLAIMED, () => {
|
|
907
907
|
if (entry.initialized) void syncFromServer(entry);
|
|
908
908
|
});
|
|
909
|
-
client.events.on(
|
|
909
|
+
client.events.on(chunkWXREIBFW_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 chunkWXREIBFW_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 && !chunkSFUJMS5E_js.isSupportedCurrency(normalized)) {
|
|
1322
1322
|
return;
|
|
1323
1323
|
}
|
|
1324
1324
|
setDisplayCurrencyOverride(normalized);
|
|
@@ -1518,25 +1518,28 @@ function statusToLabel(status) {
|
|
|
1518
1518
|
if (!status) {
|
|
1519
1519
|
return "";
|
|
1520
1520
|
}
|
|
1521
|
-
if (status ===
|
|
1521
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.PREPARING) {
|
|
1522
1522
|
return "Preparing checkout";
|
|
1523
1523
|
}
|
|
1524
|
-
if (status ===
|
|
1524
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.REVIEWING_TERMS) {
|
|
1525
|
+
return "Review updated terms";
|
|
1526
|
+
}
|
|
1527
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.RECOVERING) {
|
|
1525
1528
|
return "Resuming payment";
|
|
1526
1529
|
}
|
|
1527
|
-
if (status ===
|
|
1530
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.PROCESSING) {
|
|
1528
1531
|
return "Processing payment";
|
|
1529
1532
|
}
|
|
1530
|
-
if (status ===
|
|
1533
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.AWAITING_AUTHORIZATION) {
|
|
1531
1534
|
return "Waiting for authorization";
|
|
1532
1535
|
}
|
|
1533
|
-
if (status ===
|
|
1536
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.POLLING) {
|
|
1534
1537
|
return "Confirming payment";
|
|
1535
1538
|
}
|
|
1536
|
-
if (status ===
|
|
1539
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.FINALIZING) {
|
|
1537
1540
|
return "Finalizing order";
|
|
1538
1541
|
}
|
|
1539
|
-
if (status ===
|
|
1542
|
+
if (status === chunkEV2EVOYS_js.CHECKOUT_STATUS.SUCCESS) {
|
|
1540
1543
|
return "Payment complete";
|
|
1541
1544
|
}
|
|
1542
1545
|
return "Payment failed";
|
|
@@ -1545,6 +1548,9 @@ function CimplifyCheckout({
|
|
|
1545
1548
|
client,
|
|
1546
1549
|
businessId,
|
|
1547
1550
|
cartId,
|
|
1551
|
+
intentId,
|
|
1552
|
+
hostedSessionId,
|
|
1553
|
+
initialTerms,
|
|
1548
1554
|
locationId,
|
|
1549
1555
|
linkUrl,
|
|
1550
1556
|
orderTypes,
|
|
@@ -1558,14 +1564,14 @@ function CimplifyCheckout({
|
|
|
1558
1564
|
className
|
|
1559
1565
|
}) {
|
|
1560
1566
|
const resolvedOrderTypes = React14.useMemo(
|
|
1561
|
-
() => orderTypes && orderTypes.length > 0 ? orderTypes : [
|
|
1567
|
+
() => orderTypes && orderTypes.length > 0 ? orderTypes : [chunkEV2EVOYS_js.ORDER_TYPE.PICKUP, chunkEV2EVOYS_js.ORDER_TYPE.DELIVERY],
|
|
1562
1568
|
[orderTypes]
|
|
1563
1569
|
);
|
|
1564
1570
|
const resolvedDefaultOrderType = React14.useMemo(() => {
|
|
1565
1571
|
if (defaultOrderType && resolvedOrderTypes.includes(defaultOrderType)) {
|
|
1566
1572
|
return defaultOrderType;
|
|
1567
1573
|
}
|
|
1568
|
-
return resolvedOrderTypes[0] ||
|
|
1574
|
+
return resolvedOrderTypes[0] || chunkEV2EVOYS_js.ORDER_TYPE.PICKUP;
|
|
1569
1575
|
}, [defaultOrderType, resolvedOrderTypes]);
|
|
1570
1576
|
const [orderType, setOrderType] = React14.useState(resolvedDefaultOrderType);
|
|
1571
1577
|
const [status, setStatus] = React14.useState(null);
|
|
@@ -1591,7 +1597,12 @@ function CimplifyCheckout({
|
|
|
1591
1597
|
displayCurrency: cimplifyCtx.displayCurrency,
|
|
1592
1598
|
convertPrice: cimplifyCtx.convertPrice
|
|
1593
1599
|
};
|
|
1594
|
-
}, [
|
|
1600
|
+
}, [
|
|
1601
|
+
cimplifyCtx?.fxRate,
|
|
1602
|
+
cimplifyCtx?.displayCurrency,
|
|
1603
|
+
cimplifyCtx?.baseCurrency,
|
|
1604
|
+
cimplifyCtx?.convertPrice
|
|
1605
|
+
]);
|
|
1595
1606
|
const fxOptionsRef = React14.useRef(fxOptions);
|
|
1596
1607
|
fxOptionsRef.current = fxOptions;
|
|
1597
1608
|
const resolvedCartRef = React14.useRef(resolvedCart);
|
|
@@ -1604,11 +1615,9 @@ function CimplifyCheckout({
|
|
|
1604
1615
|
onStatusChange?.(nextStatus, context);
|
|
1605
1616
|
}
|
|
1606
1617
|
);
|
|
1607
|
-
const fireError = React14__default.default.useEffectEvent(
|
|
1608
|
-
(error)
|
|
1609
|
-
|
|
1610
|
-
}
|
|
1611
|
-
);
|
|
1618
|
+
const fireError = React14__default.default.useEffectEvent((error) => {
|
|
1619
|
+
onError?.(error);
|
|
1620
|
+
});
|
|
1612
1621
|
React14.useEffect(() => {
|
|
1613
1622
|
if (!resolvedOrderTypes.includes(orderType)) {
|
|
1614
1623
|
setOrderType(resolvedDefaultOrderType);
|
|
@@ -1626,20 +1635,23 @@ function CimplifyCheckout({
|
|
|
1626
1635
|
let cancelled = false;
|
|
1627
1636
|
async function bootstrap() {
|
|
1628
1637
|
const needsBusinessResolve = !businessId;
|
|
1629
|
-
const needsCartResolve = !cartId;
|
|
1638
|
+
const needsCartResolve = !cartId && !intentId;
|
|
1630
1639
|
if (!needsBusinessResolve && !needsCartResolve) {
|
|
1631
1640
|
if (!cancelled) {
|
|
1632
1641
|
setResolvedBusinessId(businessId || null);
|
|
1633
|
-
setResolvedCartId(cartId || null);
|
|
1642
|
+
setResolvedCartId(intentId ? null : cartId || null);
|
|
1643
|
+
if (intentId) setResolvedCart(null);
|
|
1634
1644
|
setIsInitializing(false);
|
|
1635
1645
|
setErrorMessage(null);
|
|
1636
1646
|
}
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1647
|
+
if (!intentId) {
|
|
1648
|
+
client.cart.get().then((cartResult) => {
|
|
1649
|
+
if (!cancelled && cartResult.ok && cartResult.value) {
|
|
1650
|
+
setResolvedCart(cartResult.value);
|
|
1651
|
+
}
|
|
1652
|
+
}).catch(() => {
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1643
1655
|
return;
|
|
1644
1656
|
}
|
|
1645
1657
|
if (!cancelled) {
|
|
@@ -1657,13 +1669,13 @@ function CimplifyCheckout({
|
|
|
1657
1669
|
setResolvedCartId(null);
|
|
1658
1670
|
setErrorMessage(message);
|
|
1659
1671
|
setIsInitializing(false);
|
|
1660
|
-
fireError({ code:
|
|
1672
|
+
fireError({ code: chunkSFUJMS5E_js.ErrorCode.BUSINESS_ID_REQUIRED, message });
|
|
1661
1673
|
}
|
|
1662
1674
|
return;
|
|
1663
1675
|
}
|
|
1664
1676
|
}
|
|
1665
|
-
let nextCartId = cartId ?? null;
|
|
1666
|
-
if (!nextCartId) {
|
|
1677
|
+
let nextCartId = intentId ? null : cartId ?? null;
|
|
1678
|
+
if (!intentId && !nextCartId) {
|
|
1667
1679
|
const cartResult = await client.cart.get();
|
|
1668
1680
|
if (!cartResult.ok || !cartResult.value?.id || cartResult.value.items.length === 0) {
|
|
1669
1681
|
if (!cancelled) {
|
|
@@ -1672,7 +1684,7 @@ function CimplifyCheckout({
|
|
|
1672
1684
|
setResolvedCartId(null);
|
|
1673
1685
|
setErrorMessage(message);
|
|
1674
1686
|
setIsInitializing(false);
|
|
1675
|
-
fireError({ code:
|
|
1687
|
+
fireError({ code: chunkSFUJMS5E_js.ErrorCode.CART_EMPTY, message });
|
|
1676
1688
|
}
|
|
1677
1689
|
return;
|
|
1678
1690
|
}
|
|
@@ -1692,7 +1704,7 @@ function CimplifyCheckout({
|
|
|
1692
1704
|
return () => {
|
|
1693
1705
|
cancelled = true;
|
|
1694
1706
|
};
|
|
1695
|
-
}, [businessId, cartId, client]);
|
|
1707
|
+
}, [businessId, cartId, client, intentId]);
|
|
1696
1708
|
React14.useEffect(() => {
|
|
1697
1709
|
return () => {
|
|
1698
1710
|
isMountedRef.current = false;
|
|
@@ -1701,31 +1713,36 @@ function CimplifyCheckout({
|
|
|
1701
1713
|
};
|
|
1702
1714
|
}, []);
|
|
1703
1715
|
const handleSubmit = React14__default.default.useEffectEvent(async () => {
|
|
1704
|
-
if (isSubmitting || isInitializing || !resolvedCartId) {
|
|
1705
|
-
if (!resolvedCartId && !isInitializing) {
|
|
1706
|
-
const message = "
|
|
1716
|
+
if (isSubmitting || isInitializing || !resolvedCartId && !intentId) {
|
|
1717
|
+
if (!resolvedCartId && !intentId && !isInitializing) {
|
|
1718
|
+
const message = "A cart or purchase intent is required before checkout.";
|
|
1707
1719
|
setErrorMessage(message);
|
|
1708
|
-
fireError({ code:
|
|
1720
|
+
fireError({ code: chunkSFUJMS5E_js.ErrorCode.CHECKOUT_AUTHORITY_REQUIRED, message });
|
|
1709
1721
|
}
|
|
1710
1722
|
return;
|
|
1711
1723
|
}
|
|
1712
1724
|
setErrorMessage(null);
|
|
1713
1725
|
setIsSubmitting(true);
|
|
1714
|
-
emitStatus(
|
|
1726
|
+
emitStatus(chunkEV2EVOYS_js.CHECKOUT_STATUS.PREPARING, {
|
|
1727
|
+
display_text: statusToLabel(chunkEV2EVOYS_js.CHECKOUT_STATUS.PREPARING)
|
|
1728
|
+
});
|
|
1715
1729
|
if (!elementsRef.current) {
|
|
1716
1730
|
const message = "Checkout is still initializing. Please try again.";
|
|
1717
1731
|
setErrorMessage(message);
|
|
1718
|
-
fireError({ code:
|
|
1732
|
+
fireError({ code: chunkSFUJMS5E_js.ErrorCode.CHECKOUT_NOT_READY, message });
|
|
1719
1733
|
setIsSubmitting(false);
|
|
1720
1734
|
return;
|
|
1721
1735
|
}
|
|
1722
1736
|
const checkout = elementsRef.current.processCheckout({
|
|
1723
|
-
cart_id: resolvedCartId,
|
|
1737
|
+
cart_id: intentId ? void 0 : resolvedCartId ?? void 0,
|
|
1738
|
+
intent_id: intentId,
|
|
1739
|
+
hosted_session_id: hostedSessionId,
|
|
1740
|
+
initial_terms: initialTerms,
|
|
1724
1741
|
location_id: locationId ?? client.getLocationId() ?? void 0,
|
|
1725
1742
|
order_type: orderType,
|
|
1726
1743
|
enroll_in_link: enrollInLink,
|
|
1727
1744
|
on_status_change: emitStatus,
|
|
1728
|
-
pay_currency: fxOptions?.displayCurrency
|
|
1745
|
+
pay_currency: intentId ? void 0 : fxOptions?.displayCurrency
|
|
1729
1746
|
});
|
|
1730
1747
|
activeCheckoutRef.current = checkout;
|
|
1731
1748
|
try {
|
|
@@ -1734,7 +1751,7 @@ function CimplifyCheckout({
|
|
|
1734
1751
|
onComplete(result);
|
|
1735
1752
|
return;
|
|
1736
1753
|
}
|
|
1737
|
-
const code = result.error?.code ||
|
|
1754
|
+
const code = result.error?.code || chunkSFUJMS5E_js.ErrorCode.CHECKOUT_FAILED;
|
|
1738
1755
|
const message = result.error?.message || "Payment failed.";
|
|
1739
1756
|
setErrorMessage(message);
|
|
1740
1757
|
fireError({ code, message });
|
|
@@ -1755,27 +1772,30 @@ function CimplifyCheckout({
|
|
|
1755
1772
|
linkUrl
|
|
1756
1773
|
});
|
|
1757
1774
|
elementsRef.current = elements;
|
|
1758
|
-
const checkout = elements.create(
|
|
1775
|
+
const checkout = elements.create(chunkDQEXY542_js.ELEMENT_TYPES.CHECKOUT, {
|
|
1759
1776
|
orderTypes: resolvedOrderTypes,
|
|
1760
1777
|
defaultOrderType: resolvedDefaultOrderType,
|
|
1761
|
-
submitLabel
|
|
1778
|
+
submitLabel,
|
|
1779
|
+
intentId,
|
|
1780
|
+
hostedSessionId,
|
|
1781
|
+
initialTerms
|
|
1762
1782
|
});
|
|
1763
1783
|
if (checkoutMountRef.current) {
|
|
1764
1784
|
checkout.mount(checkoutMountRef.current);
|
|
1765
1785
|
}
|
|
1766
|
-
checkout.on(
|
|
1786
|
+
checkout.on(chunkDQEXY542_js.EVENT_TYPES.READY, () => {
|
|
1767
1787
|
const cart = resolvedCartRef.current;
|
|
1768
1788
|
if (cart) {
|
|
1769
1789
|
checkout.setCart(transformToCheckoutCart(cart, fxOptionsRef.current));
|
|
1770
1790
|
}
|
|
1771
1791
|
});
|
|
1772
|
-
checkout.on(
|
|
1792
|
+
checkout.on(chunkDQEXY542_js.EVENT_TYPES.ORDER_TYPE_CHANGED, (data) => {
|
|
1773
1793
|
const typed = data;
|
|
1774
1794
|
if (typed.orderType) {
|
|
1775
1795
|
setOrderType(typed.orderType);
|
|
1776
1796
|
}
|
|
1777
1797
|
});
|
|
1778
|
-
checkout.on(
|
|
1798
|
+
checkout.on(chunkDQEXY542_js.EVENT_TYPES.REQUEST_SUBMIT, () => {
|
|
1779
1799
|
void handleSubmit();
|
|
1780
1800
|
});
|
|
1781
1801
|
return () => {
|
|
@@ -1789,11 +1809,14 @@ function CimplifyCheckout({
|
|
|
1789
1809
|
resolvedBusinessId,
|
|
1790
1810
|
resolvedOrderTypes,
|
|
1791
1811
|
resolvedDefaultOrderType,
|
|
1792
|
-
submitLabel
|
|
1812
|
+
submitLabel,
|
|
1813
|
+
intentId,
|
|
1814
|
+
hostedSessionId,
|
|
1815
|
+
initialTerms
|
|
1793
1816
|
]);
|
|
1794
1817
|
React14.useEffect(() => {
|
|
1795
1818
|
if (!resolvedCart || !elementsRef.current) return;
|
|
1796
|
-
const checkoutElement = elementsRef.current.getElement(
|
|
1819
|
+
const checkoutElement = elementsRef.current.getElement(chunkDQEXY542_js.ELEMENT_TYPES.CHECKOUT);
|
|
1797
1820
|
if (checkoutElement) {
|
|
1798
1821
|
checkoutElement.setCart(transformToCheckoutCart(resolvedCart, fxOptions));
|
|
1799
1822
|
}
|
|
@@ -1802,7 +1825,7 @@ function CimplifyCheckout({
|
|
|
1802
1825
|
if (isInitializing) {
|
|
1803
1826
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-status": "", style: { fontSize: 13, color: colors.textSecondary }, children: "Preparing checkout..." }) });
|
|
1804
1827
|
}
|
|
1805
|
-
if (!resolvedBusinessId || !resolvedCartId) {
|
|
1828
|
+
if (!resolvedBusinessId || !resolvedCartId && !intentId) {
|
|
1806
1829
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { fontSize: 13, color: colors.error }, children: errorMessage || "Unable to initialize checkout. Please refresh and try again." }) });
|
|
1807
1830
|
}
|
|
1808
1831
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-cimplify-checkout": "", children: [
|
|
@@ -1820,7 +1843,14 @@ function CimplifyCheckout({
|
|
|
1820
1843
|
}
|
|
1821
1844
|
),
|
|
1822
1845
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-section": "checkout", children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: checkoutMountRef }) }),
|
|
1823
|
-
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1846
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1847
|
+
"p",
|
|
1848
|
+
{
|
|
1849
|
+
"data-cimplify-status": "",
|
|
1850
|
+
style: { marginTop: 8, fontSize: 13, color: colors.textSecondary },
|
|
1851
|
+
children: statusText || statusToLabel(status)
|
|
1852
|
+
}
|
|
1853
|
+
),
|
|
1824
1854
|
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { marginTop: 8, fontSize: 13, color: colors.error }, children: errorMessage })
|
|
1825
1855
|
] });
|
|
1826
1856
|
}
|
|
@@ -3262,19 +3292,19 @@ function toAccountLineItem(item, currency) {
|
|
|
3262
3292
|
quantity: s.quantity,
|
|
3263
3293
|
name: s.product_name,
|
|
3264
3294
|
variantName: s.variant_name,
|
|
3265
|
-
priceLabel:
|
|
3295
|
+
priceLabel: chunkXAUSDMMZ_js.parsePrice(s.unit_price) > 0 ? chunkXAUSDMMZ_js.formatMoney(s.unit_price, currency) : void 0
|
|
3266
3296
|
}));
|
|
3267
3297
|
const customisations = item.composite_selections?.selections.map((s) => ({
|
|
3268
3298
|
quantity: s.quantity,
|
|
3269
3299
|
name: s.component_name,
|
|
3270
|
-
priceLabel:
|
|
3300
|
+
priceLabel: chunkXAUSDMMZ_js.parsePrice(s.unit_price) > 0 ? `+${chunkXAUSDMMZ_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
3271
3301
|
}));
|
|
3272
3302
|
const data = {
|
|
3273
3303
|
id: item.id,
|
|
3274
3304
|
name: item.product_name ?? "Item",
|
|
3275
3305
|
imageUrl: item.image_url,
|
|
3276
3306
|
subtitle: lineSubtitle(item),
|
|
3277
|
-
priceLabel:
|
|
3307
|
+
priceLabel: chunkXAUSDMMZ_js.formatMoney(item.total_price, currency),
|
|
3278
3308
|
lineType: item.line_type,
|
|
3279
3309
|
includes,
|
|
3280
3310
|
customisations,
|
|
@@ -3312,8 +3342,7 @@ var STATUS_TONE2 = {
|
|
|
3312
3342
|
picked_up: "positive",
|
|
3313
3343
|
served: "positive",
|
|
3314
3344
|
completed: "positive",
|
|
3315
|
-
cancelled: "muted"
|
|
3316
|
-
refunded: "muted"
|
|
3345
|
+
cancelled: "muted"
|
|
3317
3346
|
};
|
|
3318
3347
|
var PAYMENT_TONE = {
|
|
3319
3348
|
paid: "positive",
|
|
@@ -3324,20 +3353,20 @@ var PAYMENT_TONE = {
|
|
|
3324
3353
|
function toAccountOrderView(order, opts = {}) {
|
|
3325
3354
|
const currency = order.payment.currency;
|
|
3326
3355
|
const rows = [
|
|
3327
|
-
{ label: "Subtotal", value:
|
|
3356
|
+
{ label: "Subtotal", value: chunkXAUSDMMZ_js.formatMoney(order.pricing.subtotal, currency) }
|
|
3328
3357
|
];
|
|
3329
|
-
if (
|
|
3358
|
+
if (chunkXAUSDMMZ_js.parsePrice(order.pricing.total_discount) > 0) {
|
|
3330
3359
|
rows.push({
|
|
3331
3360
|
label: "Discount",
|
|
3332
|
-
value: `\u2212${
|
|
3361
|
+
value: `\u2212${chunkXAUSDMMZ_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
3333
3362
|
tone: "positive"
|
|
3334
3363
|
});
|
|
3335
3364
|
}
|
|
3336
|
-
if (order.pricing.tax &&
|
|
3337
|
-
rows.push({ label: "Tax", value:
|
|
3365
|
+
if (order.pricing.tax && chunkXAUSDMMZ_js.parsePrice(order.pricing.tax) > 0) {
|
|
3366
|
+
rows.push({ label: "Tax", value: chunkXAUSDMMZ_js.formatMoney(order.pricing.tax, currency) });
|
|
3338
3367
|
}
|
|
3339
|
-
if (order.pricing.service_charge &&
|
|
3340
|
-
rows.push({ label: "Service", value:
|
|
3368
|
+
if (order.pricing.service_charge && chunkXAUSDMMZ_js.parsePrice(order.pricing.service_charge) > 0) {
|
|
3369
|
+
rows.push({ label: "Service", value: chunkXAUSDMMZ_js.formatMoney(order.pricing.service_charge, currency) });
|
|
3341
3370
|
}
|
|
3342
3371
|
const placed = fmtDateTime(order.timestamps.created_at);
|
|
3343
3372
|
const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
@@ -3351,7 +3380,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
3351
3380
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
3352
3381
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
3353
3382
|
rows,
|
|
3354
|
-
total: { label: "Total", value:
|
|
3383
|
+
total: { label: "Total", value: chunkXAUSDMMZ_js.formatMoney(order.pricing.total_price, currency) }
|
|
3355
3384
|
},
|
|
3356
3385
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
3357
3386
|
onBack: opts.onBack
|
|
@@ -3526,7 +3555,7 @@ function CimplifySignInButton({
|
|
|
3526
3555
|
const onClick = async () => {
|
|
3527
3556
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3528
3557
|
setBusy(true);
|
|
3529
|
-
await
|
|
3558
|
+
await chunkDQEXY542_js.startSignIn({
|
|
3530
3559
|
...signInOpts,
|
|
3531
3560
|
onSuccess: () => {
|
|
3532
3561
|
setBusy(false);
|
|
@@ -4381,7 +4410,7 @@ function Price({
|
|
|
4381
4410
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4382
4411
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4383
4412
|
prefix,
|
|
4384
|
-
|
|
4413
|
+
chunkXAUSDMMZ_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4385
4414
|
] });
|
|
4386
4415
|
}
|
|
4387
4416
|
function createCachedQuery(config) {
|
|
@@ -4613,9 +4642,12 @@ function useCategories(options = {}) {
|
|
|
4613
4642
|
const { data, isLoading, error, refetch } = categoriesQuery(options);
|
|
4614
4643
|
return { categories: data ?? [], isLoading, error, refetch };
|
|
4615
4644
|
}
|
|
4616
|
-
var TERMINAL_STATUSES =
|
|
4645
|
+
var TERMINAL_STATUSES = {
|
|
4646
|
+
completed: true,
|
|
4647
|
+
cancelled: true
|
|
4648
|
+
};
|
|
4617
4649
|
function isTerminalOrderStatus(status) {
|
|
4618
|
-
return
|
|
4650
|
+
return Object.prototype.hasOwnProperty.call(TERMINAL_STATUSES, status);
|
|
4619
4651
|
}
|
|
4620
4652
|
var orderCache = /* @__PURE__ */ new Map();
|
|
4621
4653
|
var orderInflight = /* @__PURE__ */ new Map();
|
|
@@ -4708,7 +4740,7 @@ function useOrder(orderId, options = {}) {
|
|
|
4708
4740
|
React14.useEffect(() => {
|
|
4709
4741
|
void load(false);
|
|
4710
4742
|
}, [load]);
|
|
4711
|
-
const isTerminal = order ?
|
|
4743
|
+
const isTerminal = order ? isTerminalOrderStatus(order.status) : false;
|
|
4712
4744
|
React14.useEffect(() => {
|
|
4713
4745
|
if (!poll || !enabled || normalizedOrderId.length === 0 || isTerminal) {
|
|
4714
4746
|
return;
|
|
@@ -4994,9 +5026,9 @@ function useClientSessionEpoch(client) {
|
|
|
4994
5026
|
const subscribe = React14.useCallback(
|
|
4995
5027
|
(notify) => {
|
|
4996
5028
|
const unsubscribe = [
|
|
4997
|
-
client.events.on(
|
|
4998
|
-
client.events.on(
|
|
4999
|
-
client.events.on(
|
|
5029
|
+
client.events.on(chunkWXREIBFW_js.AUTH_TOKEN_CHANGED, notify),
|
|
5030
|
+
client.events.on(chunkWXREIBFW_js.SESSION_CLAIMED, notify),
|
|
5031
|
+
client.events.on(chunkWXREIBFW_js.SESSION_CLEARED, notify)
|
|
5000
5032
|
];
|
|
5001
5033
|
return () => {
|
|
5002
5034
|
for (const stopListening of unsubscribe) {
|
|
@@ -5483,13 +5515,13 @@ function useProductPrice(input) {
|
|
|
5483
5515
|
if (bundleTotalPrice != null) {
|
|
5484
5516
|
unitPrice = bundleTotalPrice;
|
|
5485
5517
|
} else if (compositePrice) {
|
|
5486
|
-
unitPrice =
|
|
5518
|
+
unitPrice = chunkXAUSDMMZ_js.parsePrice(compositePrice.final_price);
|
|
5487
5519
|
} else {
|
|
5488
|
-
unitPrice =
|
|
5520
|
+
unitPrice = chunkXAUSDMMZ_js.getVariantUnitPrice(product, variant);
|
|
5489
5521
|
if (addOnOptions) {
|
|
5490
5522
|
for (const option of addOnOptions) {
|
|
5491
5523
|
if (option.default_price) {
|
|
5492
|
-
unitPrice +=
|
|
5524
|
+
unitPrice += chunkXAUSDMMZ_js.parsePrice(option.default_price);
|
|
5493
5525
|
}
|
|
5494
5526
|
}
|
|
5495
5527
|
}
|
|
@@ -6236,7 +6268,7 @@ function useChat(options = {}) {
|
|
|
6236
6268
|
ws.onmessage = (event) => {
|
|
6237
6269
|
try {
|
|
6238
6270
|
const envelope = JSON.parse(event.data);
|
|
6239
|
-
const update =
|
|
6271
|
+
const update = chunkWXREIBFW_js.chatRealtimeUpdateFromWire(envelope);
|
|
6240
6272
|
if (update.kind === "message") {
|
|
6241
6273
|
appendMessages([update.message]);
|
|
6242
6274
|
} else if (update.kind === "message_updated") {
|
|
@@ -6347,7 +6379,7 @@ function useChat(options = {}) {
|
|
|
6347
6379
|
const watchSessionClaims = React14.useCallback(() => {
|
|
6348
6380
|
const c = clientRef.current;
|
|
6349
6381
|
if (!c || claimUnsubRef.current) return;
|
|
6350
|
-
const unsubClaimed = c.events.on(
|
|
6382
|
+
const unsubClaimed = c.events.on(chunkWXREIBFW_js.SESSION_CLAIMED, (event) => {
|
|
6351
6383
|
setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
|
|
6352
6384
|
if (!openedRef.current) {
|
|
6353
6385
|
void openIfExisting();
|
|
@@ -6356,7 +6388,7 @@ function useChat(options = {}) {
|
|
|
6356
6388
|
connectWebSocket();
|
|
6357
6389
|
void resyncConversation();
|
|
6358
6390
|
});
|
|
6359
|
-
const unsubCleared = c.events.on(
|
|
6391
|
+
const unsubCleared = c.events.on(chunkWXREIBFW_js.SESSION_CLEARED, resetConversation);
|
|
6360
6392
|
claimUnsubRef.current = () => {
|
|
6361
6393
|
unsubClaimed();
|
|
6362
6394
|
unsubCleared();
|
|
@@ -6408,7 +6440,7 @@ function useChat(options = {}) {
|
|
|
6408
6440
|
if (!openedRef.current) return false;
|
|
6409
6441
|
}
|
|
6410
6442
|
const replyTo = opts?.replyTo;
|
|
6411
|
-
const clientId =
|
|
6443
|
+
const clientId = chunkDQEXY542_js.generateIdempotencyKey();
|
|
6412
6444
|
const localId = optimisticId(clientId);
|
|
6413
6445
|
const optimistic = {
|
|
6414
6446
|
id: localId,
|
|
@@ -6597,15 +6629,15 @@ function AuthElement({
|
|
|
6597
6629
|
}, [onReady, onAuthenticated, onError]);
|
|
6598
6630
|
React14.useEffect(() => {
|
|
6599
6631
|
if (!elements || !containerRef.current) return;
|
|
6600
|
-
const element = elements.create(
|
|
6632
|
+
const element = elements.create(chunkDQEXY542_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6601
6633
|
elementRef.current = element;
|
|
6602
|
-
element.on(
|
|
6634
|
+
element.on(chunkDQEXY542_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6603
6635
|
element.on(
|
|
6604
|
-
|
|
6636
|
+
chunkDQEXY542_js.EVENT_TYPES.AUTHENTICATED,
|
|
6605
6637
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6606
6638
|
);
|
|
6607
6639
|
element.on(
|
|
6608
|
-
|
|
6640
|
+
chunkDQEXY542_js.EVENT_TYPES.ERROR,
|
|
6609
6641
|
(data) => onErrorRef.current?.(data)
|
|
6610
6642
|
);
|
|
6611
6643
|
element.mount(containerRef.current);
|
|
@@ -6634,15 +6666,15 @@ function AddressElement({
|
|
|
6634
6666
|
}, [onReady, onChange, onError]);
|
|
6635
6667
|
React14.useEffect(() => {
|
|
6636
6668
|
if (!elements || !containerRef.current) return;
|
|
6637
|
-
const element = elements.create(
|
|
6669
|
+
const element = elements.create(chunkDQEXY542_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6638
6670
|
elementRef.current = element;
|
|
6639
|
-
element.on(
|
|
6671
|
+
element.on(chunkDQEXY542_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6640
6672
|
element.on(
|
|
6641
|
-
|
|
6673
|
+
chunkDQEXY542_js.EVENT_TYPES.CHANGE,
|
|
6642
6674
|
(data) => onChangeRef.current?.(data)
|
|
6643
6675
|
);
|
|
6644
6676
|
element.on(
|
|
6645
|
-
|
|
6677
|
+
chunkDQEXY542_js.EVENT_TYPES.ERROR,
|
|
6646
6678
|
(data) => onErrorRef.current?.(data)
|
|
6647
6679
|
);
|
|
6648
6680
|
element.mount(containerRef.current);
|
|
@@ -6672,15 +6704,15 @@ function PaymentElement({
|
|
|
6672
6704
|
}, [onReady, onChange, onError]);
|
|
6673
6705
|
React14.useEffect(() => {
|
|
6674
6706
|
if (!elements || !containerRef.current) return;
|
|
6675
|
-
const element = elements.create(
|
|
6707
|
+
const element = elements.create(chunkDQEXY542_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6676
6708
|
elementRef.current = element;
|
|
6677
|
-
element.on(
|
|
6709
|
+
element.on(chunkDQEXY542_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6678
6710
|
element.on(
|
|
6679
|
-
|
|
6711
|
+
chunkDQEXY542_js.EVENT_TYPES.CHANGE,
|
|
6680
6712
|
(data) => onChangeRef.current?.(data)
|
|
6681
6713
|
);
|
|
6682
6714
|
element.on(
|
|
6683
|
-
|
|
6715
|
+
chunkDQEXY542_js.EVENT_TYPES.ERROR,
|
|
6684
6716
|
(data) => onErrorRef.current?.(data)
|
|
6685
6717
|
);
|
|
6686
6718
|
element.mount(containerRef.current);
|
|
@@ -6837,7 +6869,7 @@ function VariantSelector({
|
|
|
6837
6869
|
if (!variants || variants.length <= 1) {
|
|
6838
6870
|
return null;
|
|
6839
6871
|
}
|
|
6840
|
-
basePrice != null ?
|
|
6872
|
+
basePrice != null ? chunkXAUSDMMZ_js.parsePrice(basePrice) : 0;
|
|
6841
6873
|
if (variantAxes && variantAxes.length > 0) {
|
|
6842
6874
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6843
6875
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6943,7 +6975,7 @@ function VariantSelector({
|
|
|
6943
6975
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6944
6976
|
children: variants.map((variant) => {
|
|
6945
6977
|
const isSelected = selectedVariantId === variant.id;
|
|
6946
|
-
const adjustment =
|
|
6978
|
+
const adjustment = chunkXAUSDMMZ_js.parsePrice(variant.price_adjustment);
|
|
6947
6979
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6948
6980
|
radio.Radio.Root,
|
|
6949
6981
|
{
|
|
@@ -7211,16 +7243,16 @@ function BundleSelector({
|
|
|
7211
7243
|
}, [components, selections, onReady]);
|
|
7212
7244
|
const totalPrice = React14.useMemo(() => {
|
|
7213
7245
|
if (pricingType === "fixed" && bundlePrice) {
|
|
7214
|
-
return
|
|
7246
|
+
return chunkXAUSDMMZ_js.parsePrice(bundlePrice);
|
|
7215
7247
|
}
|
|
7216
7248
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
7217
7249
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
7218
7250
|
}, 0);
|
|
7219
7251
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
7220
|
-
return componentsTotal * (1 -
|
|
7252
|
+
return componentsTotal * (1 - chunkXAUSDMMZ_js.parsePrice(discountValue) / 100);
|
|
7221
7253
|
}
|
|
7222
7254
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
7223
|
-
return componentsTotal -
|
|
7255
|
+
return componentsTotal - chunkXAUSDMMZ_js.parsePrice(discountValue);
|
|
7224
7256
|
}
|
|
7225
7257
|
return componentsTotal;
|
|
7226
7258
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -7282,15 +7314,15 @@ function BundleSelector({
|
|
|
7282
7314
|
}
|
|
7283
7315
|
function getComponentPrice(component, selectedVariantId) {
|
|
7284
7316
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
7285
|
-
return
|
|
7317
|
+
return chunkXAUSDMMZ_js.parsePrice(component.effective_price);
|
|
7286
7318
|
}
|
|
7287
7319
|
if (selectedVariantId === component.variant_id) {
|
|
7288
|
-
return
|
|
7320
|
+
return chunkXAUSDMMZ_js.parsePrice(component.effective_price);
|
|
7289
7321
|
}
|
|
7290
7322
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
7291
7323
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
7292
|
-
if (!selectedAdj) return
|
|
7293
|
-
return
|
|
7324
|
+
if (!selectedAdj) return chunkXAUSDMMZ_js.parsePrice(component.effective_price);
|
|
7325
|
+
return chunkXAUSDMMZ_js.parsePrice(component.effective_price) - chunkXAUSDMMZ_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkXAUSDMMZ_js.parsePrice(selectedAdj.price_adjustment);
|
|
7294
7326
|
}
|
|
7295
7327
|
function formatDuration(minutes, unit) {
|
|
7296
7328
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -7404,7 +7436,7 @@ function BundleComponentCard({
|
|
|
7404
7436
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
7405
7437
|
children: component.available_variants.map((variant) => {
|
|
7406
7438
|
const isSelected = selectedVariantId === variant.id;
|
|
7407
|
-
const adjustment =
|
|
7439
|
+
const adjustment = chunkXAUSDMMZ_js.parsePrice(variant.price_adjustment);
|
|
7408
7440
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7409
7441
|
radio.Radio.Root,
|
|
7410
7442
|
{
|
|
@@ -7851,7 +7883,7 @@ function CompositeSelector({
|
|
|
7851
7883
|
"data-cimplify-composite-summary": true,
|
|
7852
7884
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7853
7885
|
children: [
|
|
7854
|
-
|
|
7886
|
+
chunkXAUSDMMZ_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7855
7887
|
"div",
|
|
7856
7888
|
{
|
|
7857
7889
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7862,7 +7894,7 @@ function CompositeSelector({
|
|
|
7862
7894
|
]
|
|
7863
7895
|
}
|
|
7864
7896
|
),
|
|
7865
|
-
|
|
7897
|
+
chunkXAUSDMMZ_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7866
7898
|
"div",
|
|
7867
7899
|
{
|
|
7868
7900
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -8006,7 +8038,7 @@ function BookingSummary({
|
|
|
8006
8038
|
className,
|
|
8007
8039
|
classNames
|
|
8008
8040
|
}) {
|
|
8009
|
-
const depositValue = depositAmount != null ?
|
|
8041
|
+
const depositValue = depositAmount != null ? chunkXAUSDMMZ_js.parsePrice(depositAmount) : 0;
|
|
8010
8042
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
8011
8043
|
const hasDeposit = depositDue > 0;
|
|
8012
8044
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -8734,7 +8766,7 @@ function InputField({
|
|
|
8734
8766
|
currency,
|
|
8735
8767
|
classNames
|
|
8736
8768
|
}) {
|
|
8737
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
8769
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunkXAUSDMMZ_js.parsePrice(field.price_adjustment) > 0;
|
|
8738
8770
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
8739
8771
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
8740
8772
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -9866,15 +9898,15 @@ function ProductCustomizerContent({
|
|
|
9866
9898
|
}, [selectedAddOnOptionIds]);
|
|
9867
9899
|
const localTotalPrice = React14.useMemo(() => {
|
|
9868
9900
|
if (isComposite && compositePrice) {
|
|
9869
|
-
return
|
|
9901
|
+
return chunkXAUSDMMZ_js.parsePrice(compositePrice.final_price) * quantity;
|
|
9870
9902
|
}
|
|
9871
9903
|
if (isBundle && bundleTotalPrice != null) {
|
|
9872
9904
|
return bundleTotalPrice * quantity;
|
|
9873
9905
|
}
|
|
9874
|
-
let price =
|
|
9906
|
+
let price = chunkXAUSDMMZ_js.getVariantUnitPrice(product, selectedVariant);
|
|
9875
9907
|
for (const option of selectedAddOnOptions) {
|
|
9876
9908
|
if (option.default_price) {
|
|
9877
|
-
price +=
|
|
9909
|
+
price += chunkXAUSDMMZ_js.parsePrice(option.default_price);
|
|
9878
9910
|
}
|
|
9879
9911
|
}
|
|
9880
9912
|
return price * quantity;
|
|
@@ -9940,12 +9972,12 @@ function ProductCustomizerContent({
|
|
|
9940
9972
|
} = useQuote(quoteInput, {
|
|
9941
9973
|
enabled: quoteEnabled
|
|
9942
9974
|
});
|
|
9943
|
-
const currency = quote?.currency ??
|
|
9975
|
+
const currency = quote?.currency ?? chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
9944
9976
|
const quoteId = quote?.quote_id;
|
|
9945
9977
|
const quotedUnitPrice = (quote?.quoted_total_price_info ?? quote?.final_price_info)?.final_price;
|
|
9946
9978
|
const quotedTotalPrice = React14.useMemo(() => {
|
|
9947
9979
|
if (quotedUnitPrice === void 0 || quotedUnitPrice === null) return void 0;
|
|
9948
|
-
return
|
|
9980
|
+
return chunkXAUSDMMZ_js.parsePrice(quotedUnitPrice) * quantity;
|
|
9949
9981
|
}, [quotedUnitPrice, quantity]);
|
|
9950
9982
|
const quoteIsReady = quoteEnabled && quote !== null && !isQuoteLoading && !quoteError && !isQuoteExpired2;
|
|
9951
9983
|
const validationMessage = !quoteEnabled ? REQUIRED_OPTIONS_MESSAGE : quoteError ? QUOTE_UNAVAILABLE_MESSAGE : !quoteIsReady ? QUOTE_LOADING_MESSAGE : null;
|
|
@@ -10169,7 +10201,7 @@ function ProductCustomizerContent({
|
|
|
10169
10201
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
10170
10202
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
10171
10203
|
"Deposit required: ",
|
|
10172
|
-
|
|
10204
|
+
chunkXAUSDMMZ_js.parsePrice(product.deposit_amount),
|
|
10173
10205
|
"%"
|
|
10174
10206
|
] })
|
|
10175
10207
|
}
|
|
@@ -10277,10 +10309,10 @@ function ProductCustomizerContent({
|
|
|
10277
10309
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10278
10310
|
Price,
|
|
10279
10311
|
{
|
|
10280
|
-
amount:
|
|
10312
|
+
amount: chunkXAUSDMMZ_js.getUnitPriceAtQuantity(
|
|
10281
10313
|
product.quantity_pricing,
|
|
10282
10314
|
quantity,
|
|
10283
|
-
|
|
10315
|
+
chunkXAUSDMMZ_js.parsePrice(product.default_price)
|
|
10284
10316
|
),
|
|
10285
10317
|
currency,
|
|
10286
10318
|
className: "font-medium text-foreground"
|
|
@@ -10746,11 +10778,11 @@ function CartLineItemRow({
|
|
|
10746
10778
|
addOnOptions: item.addOnOptions
|
|
10747
10779
|
});
|
|
10748
10780
|
const pinnedUnitPrice = item._quotedUnitPrice;
|
|
10749
|
-
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice :
|
|
10781
|
+
const unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunkXAUSDMMZ_js.parsePrice(pinnedUnitPrice);
|
|
10750
10782
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
10751
10783
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
10752
10784
|
const isOptimistic2 = item.isOptimistic === true;
|
|
10753
|
-
const lineTotal =
|
|
10785
|
+
const lineTotal = chunkXAUSDMMZ_js.parsePrice(unitPrice) * item.quantity;
|
|
10754
10786
|
const imageUrl = item.product.image_url;
|
|
10755
10787
|
const variantLabel2 = item.variant ? chunk2P4KXFB6_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
10756
10788
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -11039,7 +11071,7 @@ function CartSummary({
|
|
|
11039
11071
|
removeItem,
|
|
11040
11072
|
updateQuantity
|
|
11041
11073
|
} = useCart();
|
|
11042
|
-
const displayCurrency = serverCart?.currency ??
|
|
11074
|
+
const displayCurrency = serverCart?.currency ?? chunkSFUJMS5E_js.currencyCode(currency);
|
|
11043
11075
|
const deliveryFee = serverCart?.delivery_fee;
|
|
11044
11076
|
const serviceCharge = serverCart?.service_charge;
|
|
11045
11077
|
const totalDiscounts = serverCart?.total_discounts;
|
|
@@ -11102,7 +11134,7 @@ function CartSummary({
|
|
|
11102
11134
|
]
|
|
11103
11135
|
}
|
|
11104
11136
|
),
|
|
11105
|
-
totalDiscounts != null &&
|
|
11137
|
+
totalDiscounts != null && chunkXAUSDMMZ_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11106
11138
|
"div",
|
|
11107
11139
|
{
|
|
11108
11140
|
"data-cimplify-cart-discount": true,
|
|
@@ -11128,7 +11160,7 @@ function CartSummary({
|
|
|
11128
11160
|
className: cn("flex items-baseline justify-between", classNames?.deliveryFee),
|
|
11129
11161
|
children: [
|
|
11130
11162
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
11131
|
-
|
|
11163
|
+
chunkXAUSDMMZ_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11132
11164
|
Price,
|
|
11133
11165
|
{
|
|
11134
11166
|
amount: deliveryFee,
|
|
@@ -11139,7 +11171,7 @@ function CartSummary({
|
|
|
11139
11171
|
]
|
|
11140
11172
|
}
|
|
11141
11173
|
),
|
|
11142
|
-
serviceCharge != null &&
|
|
11174
|
+
serviceCharge != null && chunkXAUSDMMZ_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11143
11175
|
"div",
|
|
11144
11176
|
{
|
|
11145
11177
|
"data-cimplify-cart-service-charge": true,
|
|
@@ -11273,18 +11305,18 @@ function SaleBadge({
|
|
|
11273
11305
|
className,
|
|
11274
11306
|
classNames
|
|
11275
11307
|
}) {
|
|
11276
|
-
const onSale =
|
|
11308
|
+
const onSale = chunkXAUSDMMZ_js.isOnSale(product);
|
|
11277
11309
|
const hasDeal = dealInfo !== void 0;
|
|
11278
11310
|
if (!hasDeal && !onSale && !label) {
|
|
11279
11311
|
return null;
|
|
11280
11312
|
}
|
|
11281
11313
|
let percentage = null;
|
|
11282
11314
|
if (product.sale) {
|
|
11283
|
-
percentage =
|
|
11315
|
+
percentage = chunkXAUSDMMZ_js.parsePrice(product.sale.percent_off);
|
|
11284
11316
|
} else if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
11285
|
-
percentage =
|
|
11317
|
+
percentage = chunkXAUSDMMZ_js.parsePrice(dealInfo.value);
|
|
11286
11318
|
} else if (onSale) {
|
|
11287
|
-
percentage =
|
|
11319
|
+
percentage = chunkXAUSDMMZ_js.getDiscountPercentage(product);
|
|
11288
11320
|
}
|
|
11289
11321
|
const badgeText = label ?? product.sale?.badge_text ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
11290
11322
|
if (!badgeText) {
|
|
@@ -11303,7 +11335,7 @@ function SaleBadge({
|
|
|
11303
11335
|
"%"
|
|
11304
11336
|
] }),
|
|
11305
11337
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
11306
|
-
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: chunkXAUSDMMZ_js.getBasePrice(product), currency: chunkXAUSDMMZ_js.getProductCurrency(product) }) })
|
|
11307
11339
|
]
|
|
11308
11340
|
}
|
|
11309
11341
|
);
|
|
@@ -11321,7 +11353,7 @@ function SalePrice({
|
|
|
11321
11353
|
if (!sale) {
|
|
11322
11354
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
11323
11355
|
}
|
|
11324
|
-
const off = Math.round(
|
|
11356
|
+
const off = Math.round(chunkXAUSDMMZ_js.parsePrice(sale.percent_off));
|
|
11325
11357
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11326
11358
|
"span",
|
|
11327
11359
|
{
|
|
@@ -11697,7 +11729,7 @@ function ProductSheet({
|
|
|
11697
11729
|
Price,
|
|
11698
11730
|
{
|
|
11699
11731
|
amount: fullProduct.default_price,
|
|
11700
|
-
currency:
|
|
11732
|
+
currency: chunkXAUSDMMZ_js.getProductCurrency(fullProduct),
|
|
11701
11733
|
className: classNames?.price
|
|
11702
11734
|
}
|
|
11703
11735
|
)
|
|
@@ -11883,10 +11915,10 @@ function SoldOutOverlay() {
|
|
|
11883
11915
|
function SaleBadge2({ product }) {
|
|
11884
11916
|
let label = null;
|
|
11885
11917
|
if (product.sale) {
|
|
11886
|
-
const off = Math.round(
|
|
11918
|
+
const off = Math.round(chunkXAUSDMMZ_js.parsePrice(product.sale.percent_off));
|
|
11887
11919
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11888
|
-
} else if (
|
|
11889
|
-
const pct =
|
|
11920
|
+
} else if (chunkXAUSDMMZ_js.isOnSale(product)) {
|
|
11921
|
+
const pct = chunkXAUSDMMZ_js.getDiscountPercentage(product);
|
|
11890
11922
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11891
11923
|
}
|
|
11892
11924
|
if (!label) return null;
|
|
@@ -11927,7 +11959,7 @@ function FoodProductCard({
|
|
|
11927
11959
|
className
|
|
11928
11960
|
}) {
|
|
11929
11961
|
const image = product.image_url || product.images?.[0] || "";
|
|
11930
|
-
const currency =
|
|
11962
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
11931
11963
|
const tags = product.tags || [];
|
|
11932
11964
|
const isSignature = product.metadata?.is_signature === true;
|
|
11933
11965
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -11983,9 +12015,9 @@ function RetailProductCard({
|
|
|
11983
12015
|
className
|
|
11984
12016
|
}) {
|
|
11985
12017
|
const image = product.image_url || product.images?.[0] || "";
|
|
11986
|
-
const currency =
|
|
12018
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
11987
12019
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
11988
|
-
const onSale =
|
|
12020
|
+
const onSale = chunkXAUSDMMZ_js.isOnSale(product);
|
|
11989
12021
|
const swatches = getColorSwatches(product);
|
|
11990
12022
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
11991
12023
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -12006,7 +12038,7 @@ function RetailProductCard({
|
|
|
12006
12038
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
12007
12039
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12008
12040
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
12009
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
12041
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkXAUSDMMZ_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
12010
12042
|
] }) }),
|
|
12011
12043
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12012
12044
|
"span",
|
|
@@ -12021,10 +12053,10 @@ function RetailProductCard({
|
|
|
12021
12053
|
] });
|
|
12022
12054
|
}
|
|
12023
12055
|
function PriceRange({ product, currency, className }) {
|
|
12024
|
-
const resolvedCurrency = currency ??
|
|
12025
|
-
const range =
|
|
12056
|
+
const resolvedCurrency = currency ?? chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12057
|
+
const range = chunkXAUSDMMZ_js.getPriceRange(product);
|
|
12026
12058
|
if (!range) return null;
|
|
12027
|
-
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: chunkXAUSDMMZ_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
12028
12060
|
}
|
|
12029
12061
|
function WholesaleProductCard({
|
|
12030
12062
|
product,
|
|
@@ -12034,7 +12066,7 @@ function WholesaleProductCard({
|
|
|
12034
12066
|
className
|
|
12035
12067
|
}) {
|
|
12036
12068
|
const image = product.image_url || product.images?.[0] || "";
|
|
12037
|
-
const currency =
|
|
12069
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12038
12070
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12039
12071
|
const status = product.inventory_status;
|
|
12040
12072
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12082,7 +12114,7 @@ function DigitalProductCard({
|
|
|
12082
12114
|
className
|
|
12083
12115
|
}) {
|
|
12084
12116
|
const image = product.image_url || product.images?.[0] || "";
|
|
12085
|
-
const currency =
|
|
12117
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12086
12118
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
12087
12119
|
const isTicket = product.digital_type === "ticket";
|
|
12088
12120
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -12113,11 +12145,11 @@ function BundleProductCard({
|
|
|
12113
12145
|
className
|
|
12114
12146
|
}) {
|
|
12115
12147
|
const image = product.image_url || product.images?.[0] || "";
|
|
12116
|
-
const currency =
|
|
12148
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12117
12149
|
const components = product.components || [];
|
|
12118
12150
|
const componentCount = components.length;
|
|
12119
|
-
const onSale =
|
|
12120
|
-
const discount =
|
|
12151
|
+
const onSale = chunkXAUSDMMZ_js.isOnSale(product);
|
|
12152
|
+
const discount = chunkXAUSDMMZ_js.getDiscountPercentage(product);
|
|
12121
12153
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
12122
12154
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12123
12155
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -12144,7 +12176,7 @@ function BundleProductCard({
|
|
|
12144
12176
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
12145
12177
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
12146
12178
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12147
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
12179
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkXAUSDMMZ_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
12148
12180
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
12149
12181
|
"Save ",
|
|
12150
12182
|
discount,
|
|
@@ -12164,7 +12196,7 @@ function CompositeProductCard({
|
|
|
12164
12196
|
className
|
|
12165
12197
|
}) {
|
|
12166
12198
|
const image = product.image_url || product.images?.[0] || "";
|
|
12167
|
-
const currency =
|
|
12199
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12168
12200
|
const groups = product.groups || [];
|
|
12169
12201
|
const groupCount = groups.length;
|
|
12170
12202
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -12216,7 +12248,7 @@ function StandardServiceCard({
|
|
|
12216
12248
|
className
|
|
12217
12249
|
}) {
|
|
12218
12250
|
const image = product.image_url || product.images?.[0] || "";
|
|
12219
|
-
const currency =
|
|
12251
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12220
12252
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12221
12253
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
12222
12254
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -12271,7 +12303,7 @@ function CompactServiceCard({
|
|
|
12271
12303
|
className
|
|
12272
12304
|
}) {
|
|
12273
12305
|
const image = product.image_url || product.images?.[0] || "";
|
|
12274
|
-
const currency =
|
|
12306
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12275
12307
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12276
12308
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
12277
12309
|
const href = `/products/${product.slug}`;
|
|
@@ -12320,7 +12352,7 @@ function ScheduleServiceCard({
|
|
|
12320
12352
|
className
|
|
12321
12353
|
}) {
|
|
12322
12354
|
const image = product.image_url || product.images?.[0] || "";
|
|
12323
|
-
const currency =
|
|
12355
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12324
12356
|
const href = `/products/${product.slug}`;
|
|
12325
12357
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
12326
12358
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -12392,7 +12424,7 @@ function RentalServiceCard({
|
|
|
12392
12424
|
className
|
|
12393
12425
|
}) {
|
|
12394
12426
|
const image = product.image_url || product.images?.[0] || "";
|
|
12395
|
-
const currency =
|
|
12427
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12396
12428
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12397
12429
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
12398
12430
|
const priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit;
|
|
@@ -12462,7 +12494,7 @@ function AccommodationCard({
|
|
|
12462
12494
|
className
|
|
12463
12495
|
}) {
|
|
12464
12496
|
const image = product.image_url || product.images?.[0] || "";
|
|
12465
|
-
const currency =
|
|
12497
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12466
12498
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12467
12499
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
12468
12500
|
const tags = product.tags || [];
|
|
@@ -12528,7 +12560,7 @@ function LeaseServiceCard({
|
|
|
12528
12560
|
className
|
|
12529
12561
|
}) {
|
|
12530
12562
|
const image = product.image_url || product.images?.[0] || "";
|
|
12531
|
-
const currency =
|
|
12563
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12532
12564
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12533
12565
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12534
12566
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -12602,7 +12634,7 @@ function SubscriptionCard({
|
|
|
12602
12634
|
className
|
|
12603
12635
|
}) {
|
|
12604
12636
|
const image = product.image_url || product.images?.[0] || "";
|
|
12605
|
-
const currency =
|
|
12637
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
12606
12638
|
const plans = product.billing_plans || [];
|
|
12607
12639
|
const primaryPlan = plans[0];
|
|
12608
12640
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12833,7 +12865,7 @@ function ProductCard({
|
|
|
12833
12865
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12834
12866
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12835
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 }),
|
|
12836
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
12868
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkXAUSDMMZ_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
12837
12869
|
] })
|
|
12838
12870
|
] });
|
|
12839
12871
|
})();
|
|
@@ -13162,7 +13194,7 @@ function SearchInput({
|
|
|
13162
13194
|
}
|
|
13163
13195
|
),
|
|
13164
13196
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
13165
|
-
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: chunkXAUSDMMZ_js.formatPrice(product.default_price) })
|
|
13166
13198
|
] })
|
|
13167
13199
|
},
|
|
13168
13200
|
product.id
|
|
@@ -13499,8 +13531,7 @@ var STATUS_LABELS = {
|
|
|
13499
13531
|
delivered: "Delivered",
|
|
13500
13532
|
picked_up: "Picked Up",
|
|
13501
13533
|
completed: "Completed",
|
|
13502
|
-
cancelled: "Cancelled"
|
|
13503
|
-
refunded: "Refunded"
|
|
13534
|
+
cancelled: "Cancelled"
|
|
13504
13535
|
};
|
|
13505
13536
|
var PAYMENT_STATE_LABELS = {
|
|
13506
13537
|
not_paid: "Not Paid",
|
|
@@ -13657,19 +13688,19 @@ function OrderSummary({
|
|
|
13657
13688
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
13658
13689
|
] }),
|
|
13659
13690
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
13660
|
-
order.total_discount != null &&
|
|
13691
|
+
order.total_discount != null && chunkXAUSDMMZ_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
13661
13692
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
13662
13693
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
13663
13694
|
] }),
|
|
13664
|
-
order.delivery_fee != null &&
|
|
13695
|
+
order.delivery_fee != null && chunkXAUSDMMZ_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
13665
13696
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
13666
13697
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
13667
13698
|
] }),
|
|
13668
|
-
order.service_charge != null &&
|
|
13699
|
+
order.service_charge != null && chunkXAUSDMMZ_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
13669
13700
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
13670
13701
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
13671
13702
|
] }),
|
|
13672
|
-
order.tax != null &&
|
|
13703
|
+
order.tax != null && chunkXAUSDMMZ_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
13673
13704
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
13674
13705
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
13675
13706
|
] }),
|
|
@@ -13712,8 +13743,7 @@ var STATUS_LABELS2 = {
|
|
|
13712
13743
|
delivered: "Delivered",
|
|
13713
13744
|
picked_up: "Picked Up",
|
|
13714
13745
|
completed: "Completed",
|
|
13715
|
-
cancelled: "Cancelled"
|
|
13716
|
-
refunded: "Refunded"
|
|
13746
|
+
cancelled: "Cancelled"
|
|
13717
13747
|
};
|
|
13718
13748
|
function OrderHistory({
|
|
13719
13749
|
orders: ordersProp,
|
|
@@ -14200,7 +14230,7 @@ function BookingPage({
|
|
|
14200
14230
|
const hasStaffStep = staff && staff.length > 0;
|
|
14201
14231
|
const depositType = product?.deposit_type;
|
|
14202
14232
|
const depositAmount = product?.deposit_amount;
|
|
14203
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
14233
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkXAUSDMMZ_js.parsePrice(depositAmount) !== 0;
|
|
14204
14234
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
14205
14235
|
const noShowFee = product?.no_show_fee;
|
|
14206
14236
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -14333,14 +14363,14 @@ function BookingPage({
|
|
|
14333
14363
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
14334
14364
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
14335
14365
|
"Deposit: ",
|
|
14336
|
-
depositType === "percentage" ? `${
|
|
14366
|
+
depositType === "percentage" ? `${chunkXAUSDMMZ_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
14337
14367
|
] }),
|
|
14338
14368
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
14339
14369
|
"Free cancellation up to ",
|
|
14340
14370
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
14341
14371
|
" before"
|
|
14342
14372
|
] }),
|
|
14343
|
-
noShowFee !== void 0 &&
|
|
14373
|
+
noShowFee !== void 0 && chunkXAUSDMMZ_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
14344
14374
|
"No-show fee: ",
|
|
14345
14375
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
14346
14376
|
] })
|
|
@@ -14443,7 +14473,7 @@ function BookingPage({
|
|
|
14443
14473
|
] }),
|
|
14444
14474
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
14445
14475
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
14446
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
14476
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkXAUSDMMZ_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
14447
14477
|
] })
|
|
14448
14478
|
] }),
|
|
14449
14479
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -15117,9 +15147,9 @@ function DefaultProductLayout({
|
|
|
15117
15147
|
}) {
|
|
15118
15148
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
15119
15149
|
const images = chunk2P4KXFB6_js.resolveGallery(product, selectedVariantId);
|
|
15120
|
-
const currency =
|
|
15150
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15121
15151
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
15122
|
-
const onSale =
|
|
15152
|
+
const onSale = chunkXAUSDMMZ_js.isOnSale(product);
|
|
15123
15153
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
15124
15154
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
15125
15155
|
renderBreadcrumb?.(product),
|
|
@@ -15142,13 +15172,13 @@ function DefaultProductLayout({
|
|
|
15142
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: [
|
|
15143
15173
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
15144
15174
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15145
|
-
/* @__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(chunkXAUSDMMZ_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
15146
15176
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15147
15177
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
15148
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
15178
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkXAUSDMMZ_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
15149
15179
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
15150
15180
|
"Save ",
|
|
15151
|
-
|
|
15181
|
+
chunkXAUSDMMZ_js.getDiscountPercentage(product),
|
|
15152
15182
|
"%"
|
|
15153
15183
|
] })
|
|
15154
15184
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -15210,7 +15240,7 @@ function FoodProductLayout({
|
|
|
15210
15240
|
className
|
|
15211
15241
|
}) {
|
|
15212
15242
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15213
|
-
const currency =
|
|
15243
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15214
15244
|
const tags = product.tags || [];
|
|
15215
15245
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
15216
15246
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -15285,7 +15315,7 @@ function WholesaleProductLayout({
|
|
|
15285
15315
|
className
|
|
15286
15316
|
}) {
|
|
15287
15317
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15288
|
-
const currency =
|
|
15318
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15289
15319
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
15290
15320
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
15291
15321
|
renderBreadcrumb?.(product),
|
|
@@ -15369,9 +15399,9 @@ function ServiceProductLayout({
|
|
|
15369
15399
|
className
|
|
15370
15400
|
}) {
|
|
15371
15401
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15372
|
-
const currency =
|
|
15402
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15373
15403
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
15374
|
-
const depositAmount = hasDeposit ?
|
|
15404
|
+
const depositAmount = hasDeposit ? chunkXAUSDMMZ_js.parsePrice(product.deposit_amount) : 0;
|
|
15375
15405
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
15376
15406
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
15377
15407
|
renderBreadcrumb?.(product),
|
|
@@ -15439,7 +15469,7 @@ function ServiceProductLayout({
|
|
|
15439
15469
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
15440
15470
|
" deposit charged at booking"
|
|
15441
15471
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
15442
|
-
|
|
15472
|
+
chunkXAUSDMMZ_js.parsePrice(product.deposit_amount),
|
|
15443
15473
|
"% deposit charged at booking"
|
|
15444
15474
|
] }) })
|
|
15445
15475
|
] })
|
|
@@ -15471,7 +15501,7 @@ function DigitalProductLayout({
|
|
|
15471
15501
|
className
|
|
15472
15502
|
}) {
|
|
15473
15503
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15474
|
-
const currency =
|
|
15504
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15475
15505
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
15476
15506
|
const isTicket = product.digital_type === "ticket";
|
|
15477
15507
|
const isAccessPass = product.digital_type === "access_grant";
|
|
@@ -15598,15 +15628,15 @@ function BundleProductLayout({
|
|
|
15598
15628
|
className
|
|
15599
15629
|
}) {
|
|
15600
15630
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15601
|
-
const currency =
|
|
15631
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15602
15632
|
const components = product.components || [];
|
|
15603
|
-
const onSale =
|
|
15604
|
-
const discount =
|
|
15633
|
+
const onSale = chunkXAUSDMMZ_js.isOnSale(product);
|
|
15634
|
+
const discount = chunkXAUSDMMZ_js.getDiscountPercentage(product);
|
|
15605
15635
|
const baseTotal = components.reduce(
|
|
15606
|
-
(sum, c) => sum +
|
|
15636
|
+
(sum, c) => sum + chunkXAUSDMMZ_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
15607
15637
|
0
|
|
15608
15638
|
);
|
|
15609
|
-
const bundlePrice =
|
|
15639
|
+
const bundlePrice = chunkXAUSDMMZ_js.parsePrice(product.default_price);
|
|
15610
15640
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
15611
15641
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
15612
15642
|
renderBreadcrumb?.(product),
|
|
@@ -15682,7 +15712,7 @@ function CompositeProductLayout({
|
|
|
15682
15712
|
className
|
|
15683
15713
|
}) {
|
|
15684
15714
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15685
|
-
const currency =
|
|
15715
|
+
const currency = chunkXAUSDMMZ_js.getProductCurrency(product);
|
|
15686
15716
|
const groups = product.groups || [];
|
|
15687
15717
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
15688
15718
|
renderBreadcrumb?.(product),
|
|
@@ -16105,7 +16135,7 @@ function CartDrawer({
|
|
|
16105
16135
|
}) {
|
|
16106
16136
|
const { isOpen, close } = useCartDrawer();
|
|
16107
16137
|
const cart = useCart();
|
|
16108
|
-
const subtotalNum =
|
|
16138
|
+
const subtotalNum = chunkXAUSDMMZ_js.parsePrice(cart.subtotal);
|
|
16109
16139
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
16110
16140
|
React14.useEffect(() => {
|
|
16111
16141
|
if (!isOpen) return;
|
|
@@ -16499,9 +16529,9 @@ function CatalogueCollectionLayout({
|
|
|
16499
16529
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
16500
16530
|
}
|
|
16501
16531
|
if (sortBy === "price-asc") {
|
|
16502
|
-
result = [...result].sort((a, b) =>
|
|
16532
|
+
result = [...result].sort((a, b) => chunkXAUSDMMZ_js.parsePrice(a.default_price) - chunkXAUSDMMZ_js.parsePrice(b.default_price));
|
|
16503
16533
|
} else if (sortBy === "price-desc") {
|
|
16504
|
-
result = [...result].sort((a, b) =>
|
|
16534
|
+
result = [...result].sort((a, b) => chunkXAUSDMMZ_js.parsePrice(b.default_price) - chunkXAUSDMMZ_js.parsePrice(a.default_price));
|
|
16505
16535
|
} else if (sortBy === "name") {
|
|
16506
16536
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
16507
16537
|
}
|
|
@@ -20030,7 +20060,7 @@ function toneChip(value) {
|
|
|
20030
20060
|
}
|
|
20031
20061
|
}
|
|
20032
20062
|
function money(amount, currency) {
|
|
20033
|
-
return
|
|
20063
|
+
return chunkXAUSDMMZ_js.formatPrice(chunkXAUSDMMZ_js.parsePrice(num(amount) ?? 0), text(currency));
|
|
20034
20064
|
}
|
|
20035
20065
|
var CHAT_GENUI_COMPONENTS = {
|
|
20036
20066
|
Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20278,7 +20308,7 @@ function ReplyCardView({
|
|
|
20278
20308
|
card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
|
|
20279
20309
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
20280
20310
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
|
|
20281
|
-
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: chunkXAUSDMMZ_js.formatPrice(chunkXAUSDMMZ_js.parsePrice(card.price), currency ?? void 0) }),
|
|
20282
20312
|
fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
|
|
20283
20313
|
] })
|
|
20284
20314
|
]
|
|
@@ -20375,12 +20405,12 @@ function ChatWidget({
|
|
|
20375
20405
|
setAttachError(null);
|
|
20376
20406
|
if (!isAllowedAttachment(file)) {
|
|
20377
20407
|
setAttachError(
|
|
20378
|
-
new
|
|
20408
|
+
new chunkSFUJMS5E_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
|
|
20379
20409
|
);
|
|
20380
20410
|
return;
|
|
20381
20411
|
}
|
|
20382
20412
|
if (file.size > MAX_ATTACHMENT_BYTES) {
|
|
20383
|
-
setAttachError(new
|
|
20413
|
+
setAttachError(new chunkSFUJMS5E_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
|
|
20384
20414
|
return;
|
|
20385
20415
|
}
|
|
20386
20416
|
const uploaded = await client.uploads.upload(file);
|