@cimplify/sdk 0.99.2 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +21 -21
- package/dist/advanced.mjs +2 -2
- package/dist/{chunk-PTPOQVXS.js → chunk-64EDCDBR.js} +5 -9
- package/dist/{chunk-DOEGVGTM.mjs → chunk-GWKIDFN6.mjs} +1 -1
- package/dist/{chunk-QYBGG3ZJ.mjs → chunk-I7L4VRHI.mjs} +1 -1
- package/dist/{chunk-R7FAU2ZF.js → chunk-J3UYIBKH.js} +47 -47
- package/dist/{chunk-ZFI2TKTO.mjs → chunk-OX5L6XE7.mjs} +1 -1
- package/dist/{chunk-KFLGQGMC.mjs → chunk-V5TU5JKA.mjs} +5 -9
- package/dist/{chunk-4S5EMSF5.js → chunk-X6G6QERR.js} +12 -12
- package/dist/{chunk-J64F56EB.js → chunk-ZA5VKVUB.js} +2 -2
- package/dist/{client-BNfVL2IL.d.mts → client-B5MeD8da.d.mts} +2 -2
- package/dist/{client-CX59ew7C.d.ts → client-C1vS5pf0.d.ts} +2 -2
- package/dist/{client-BeMhSkRT.d.mts → client-DQpvwf-p.d.mts} +2 -2
- package/dist/{client-CCCOOaI3.d.ts → client-DmR3Z6pQ.d.ts} +2 -2
- package/dist/{index-D-w5h82t.d.ts → index-Br-vFygC.d.ts} +3 -3
- package/dist/{index-BuNjyfaV.d.mts → index-DUOCn1Cs.d.mts} +3 -3
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +100 -100
- package/dist/index.mjs +4 -4
- package/dist/{payment-pKPpaORI.d.mts → payment-BIpS9oPG.d.mts} +2 -2
- package/dist/{payment-By0JidTe.d.ts → payment-CsuBKHqg.d.ts} +2 -2
- package/dist/{price-BvRtp6ak.d.mts → price-IOOoVYS-.d.mts} +1 -1
- package/dist/{price-23RNXftz.d.ts → price-Ml_uPoiY.d.ts} +1 -1
- package/dist/{product-O8-wcHSe.d.ts → product-BKV6TBj_.d.mts} +26 -48
- package/dist/{product-O8-wcHSe.d.mts → product-BKV6TBj_.d.ts} +26 -48
- package/dist/react.d.mts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +130 -130
- package/dist/react.mjs +3 -3
- package/dist/{server-HVDbbqR9.d.mts → server-C0iEk55_.d.mts} +1 -1
- package/dist/{server-JBuTPY-j.d.ts → server-CfpYhSV_.d.ts} +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +8 -8
- package/dist/server.mjs +3 -3
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +23 -23
- package/dist/testing/suite.mjs +4 -4
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +79 -79
- package/dist/testing.mjs +5 -5
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +28 -28
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkQPRI2NII_js = require('./chunk-QPRI2NII.js');
|
|
5
5
|
var chunkXREIZ56K_js = require('./chunk-XREIZ56K.js');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunkJ3UYIBKH_js = require('./chunk-J3UYIBKH.js');
|
|
7
|
+
var chunkX6G6QERR_js = require('./chunk-X6G6QERR.js');
|
|
8
|
+
var chunk64EDCDBR_js = require('./chunk-64EDCDBR.js');
|
|
9
9
|
var chunkAETVRBKI_js = require('./chunk-AETVRBKI.js');
|
|
10
10
|
require('./chunk-OWW5GUSB.js');
|
|
11
11
|
var React14 = require('react');
|
|
@@ -602,12 +602,12 @@ function attachInternalItemMetadata(item) {
|
|
|
602
602
|
return { ...item, _lineKey: lineKeyFromItem(item) };
|
|
603
603
|
}
|
|
604
604
|
function calculateLineSubtotal(item) {
|
|
605
|
-
let unitPrice =
|
|
605
|
+
let unitPrice = chunk64EDCDBR_js.parsePrice(item.product.default_price);
|
|
606
606
|
if (item.variant?.price_adjustment) {
|
|
607
|
-
unitPrice +=
|
|
607
|
+
unitPrice += chunk64EDCDBR_js.parsePrice(item.variant.price_adjustment);
|
|
608
608
|
}
|
|
609
609
|
for (const option of item.addOnOptions || []) {
|
|
610
|
-
if (option.default_price) unitPrice +=
|
|
610
|
+
if (option.default_price) unitPrice += chunk64EDCDBR_js.parsePrice(option.default_price);
|
|
611
611
|
}
|
|
612
612
|
return roundMoney(unitPrice * item.quantity);
|
|
613
613
|
}
|
|
@@ -806,7 +806,7 @@ async function syncFromServer(entry) {
|
|
|
806
806
|
return next;
|
|
807
807
|
}
|
|
808
808
|
function emitMutationError(entry, operation, opId, idempotencyKey, error) {
|
|
809
|
-
entry.client.events.emit(
|
|
809
|
+
entry.client.events.emit(chunkJ3UYIBKH_js.MUTATION_ERROR, {
|
|
810
810
|
service: "cart",
|
|
811
811
|
operation,
|
|
812
812
|
opId,
|
|
@@ -846,10 +846,10 @@ function getOrCreateStore(params) {
|
|
|
846
846
|
syncTail: Promise.resolve(),
|
|
847
847
|
failedOpRemovers: /* @__PURE__ */ new Set()
|
|
848
848
|
};
|
|
849
|
-
client.events.on(
|
|
849
|
+
client.events.on(chunkJ3UYIBKH_js.SESSION_CLAIMED, () => {
|
|
850
850
|
if (entry.initialized) void syncFromServer(entry);
|
|
851
851
|
});
|
|
852
|
-
client.events.on(
|
|
852
|
+
client.events.on(chunkJ3UYIBKH_js.SESSION_CLEARED, () => {
|
|
853
853
|
if (entry.initialized) void syncFromServer(entry);
|
|
854
854
|
});
|
|
855
855
|
cartStores.set(storeKey, entry);
|
|
@@ -1145,7 +1145,7 @@ var DEFAULT_COUNTRY = "US";
|
|
|
1145
1145
|
function createDefaultClient() {
|
|
1146
1146
|
const processRef = globalThis.process;
|
|
1147
1147
|
const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
1148
|
-
return
|
|
1148
|
+
return chunkJ3UYIBKH_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
1149
1149
|
}
|
|
1150
1150
|
function getStoredLocationId() {
|
|
1151
1151
|
if (typeof window === "undefined" || !window.localStorage) {
|
|
@@ -3193,19 +3193,19 @@ function toAccountLineItem(item, currency) {
|
|
|
3193
3193
|
quantity: s.quantity,
|
|
3194
3194
|
name: s.product_name,
|
|
3195
3195
|
variantName: s.variant_name,
|
|
3196
|
-
priceLabel:
|
|
3196
|
+
priceLabel: chunk64EDCDBR_js.parsePrice(s.unit_price) > 0 ? chunk64EDCDBR_js.formatMoney(s.unit_price, currency) : void 0
|
|
3197
3197
|
}));
|
|
3198
3198
|
const customisations = item.composite_selections?.selections.map((s) => ({
|
|
3199
3199
|
quantity: s.quantity,
|
|
3200
3200
|
name: s.component_name,
|
|
3201
|
-
priceLabel:
|
|
3201
|
+
priceLabel: chunk64EDCDBR_js.parsePrice(s.unit_price) > 0 ? `+${chunk64EDCDBR_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
3202
3202
|
}));
|
|
3203
3203
|
const data = {
|
|
3204
3204
|
id: item.id,
|
|
3205
3205
|
name: item.product_name ?? "Item",
|
|
3206
3206
|
imageUrl: item.image_url,
|
|
3207
3207
|
subtitle: lineSubtitle(item),
|
|
3208
|
-
priceLabel:
|
|
3208
|
+
priceLabel: chunk64EDCDBR_js.formatMoney(item.total_price, currency),
|
|
3209
3209
|
lineType: item.line_type,
|
|
3210
3210
|
includes,
|
|
3211
3211
|
customisations,
|
|
@@ -3255,20 +3255,20 @@ var PAYMENT_TONE = {
|
|
|
3255
3255
|
function toAccountOrderView(order, opts = {}) {
|
|
3256
3256
|
const currency = order.payment.currency;
|
|
3257
3257
|
const rows = [
|
|
3258
|
-
{ label: "Subtotal", value:
|
|
3258
|
+
{ label: "Subtotal", value: chunk64EDCDBR_js.formatMoney(order.pricing.subtotal, currency) }
|
|
3259
3259
|
];
|
|
3260
|
-
if (
|
|
3260
|
+
if (chunk64EDCDBR_js.parsePrice(order.pricing.total_discount) > 0) {
|
|
3261
3261
|
rows.push({
|
|
3262
3262
|
label: "Discount",
|
|
3263
|
-
value: `\u2212${
|
|
3263
|
+
value: `\u2212${chunk64EDCDBR_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
3264
3264
|
tone: "positive"
|
|
3265
3265
|
});
|
|
3266
3266
|
}
|
|
3267
|
-
if (order.pricing.tax &&
|
|
3268
|
-
rows.push({ label: "Tax", value:
|
|
3267
|
+
if (order.pricing.tax && chunk64EDCDBR_js.parsePrice(order.pricing.tax) > 0) {
|
|
3268
|
+
rows.push({ label: "Tax", value: chunk64EDCDBR_js.formatMoney(order.pricing.tax, currency) });
|
|
3269
3269
|
}
|
|
3270
|
-
if (order.pricing.service_charge &&
|
|
3271
|
-
rows.push({ label: "Service", value:
|
|
3270
|
+
if (order.pricing.service_charge && chunk64EDCDBR_js.parsePrice(order.pricing.service_charge) > 0) {
|
|
3271
|
+
rows.push({ label: "Service", value: chunk64EDCDBR_js.formatMoney(order.pricing.service_charge, currency) });
|
|
3272
3272
|
}
|
|
3273
3273
|
const placed = fmtDateTime(order.timestamps.created_at);
|
|
3274
3274
|
const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
@@ -3282,7 +3282,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
3282
3282
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
3283
3283
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
3284
3284
|
rows,
|
|
3285
|
-
total: { label: "Total", value:
|
|
3285
|
+
total: { label: "Total", value: chunk64EDCDBR_js.formatMoney(order.pricing.total_price, currency) }
|
|
3286
3286
|
},
|
|
3287
3287
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
3288
3288
|
onBack: opts.onBack
|
|
@@ -3457,7 +3457,7 @@ function CimplifySignInButton({
|
|
|
3457
3457
|
const onClick = async () => {
|
|
3458
3458
|
if (busy || disabled || !signInOpts.clientId) return;
|
|
3459
3459
|
setBusy(true);
|
|
3460
|
-
await
|
|
3460
|
+
await chunkX6G6QERR_js.startSignIn({
|
|
3461
3461
|
...signInOpts,
|
|
3462
3462
|
onSuccess: () => {
|
|
3463
3463
|
setBusy(false);
|
|
@@ -4312,7 +4312,7 @@ function Price({
|
|
|
4312
4312
|
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4313
4313
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4314
4314
|
prefix,
|
|
4315
|
-
|
|
4315
|
+
chunk64EDCDBR_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
4316
4316
|
] });
|
|
4317
4317
|
}
|
|
4318
4318
|
function createCachedQuery(config) {
|
|
@@ -5348,16 +5348,16 @@ function useProductPrice(input) {
|
|
|
5348
5348
|
if (bundleTotalPrice != null) {
|
|
5349
5349
|
unitPrice = bundleTotalPrice;
|
|
5350
5350
|
} else if (compositePrice) {
|
|
5351
|
-
unitPrice =
|
|
5351
|
+
unitPrice = chunk64EDCDBR_js.parsePrice(compositePrice.final_price);
|
|
5352
5352
|
} else {
|
|
5353
|
-
unitPrice =
|
|
5353
|
+
unitPrice = chunk64EDCDBR_js.parsePrice(product.default_price);
|
|
5354
5354
|
if (variant?.price_adjustment) {
|
|
5355
|
-
unitPrice +=
|
|
5355
|
+
unitPrice += chunk64EDCDBR_js.parsePrice(variant.price_adjustment);
|
|
5356
5356
|
}
|
|
5357
5357
|
if (addOnOptions) {
|
|
5358
5358
|
for (const option of addOnOptions) {
|
|
5359
5359
|
if (option.default_price) {
|
|
5360
|
-
unitPrice +=
|
|
5360
|
+
unitPrice += chunk64EDCDBR_js.parsePrice(option.default_price);
|
|
5361
5361
|
}
|
|
5362
5362
|
}
|
|
5363
5363
|
}
|
|
@@ -6186,7 +6186,7 @@ function useChat(options = {}) {
|
|
|
6186
6186
|
const watchSessionClaims = React14.useCallback(() => {
|
|
6187
6187
|
const c = clientRef.current;
|
|
6188
6188
|
if (!c || claimUnsubRef.current) return;
|
|
6189
|
-
const unsubClaimed = c.events.on(
|
|
6189
|
+
const unsubClaimed = c.events.on(chunkJ3UYIBKH_js.SESSION_CLAIMED, (event) => {
|
|
6190
6190
|
setClaimedAs(event.customerName || c.support.claimedCustomerName || null);
|
|
6191
6191
|
if (!openedRef.current) {
|
|
6192
6192
|
void openIfExisting();
|
|
@@ -6195,7 +6195,7 @@ function useChat(options = {}) {
|
|
|
6195
6195
|
connectWebSocket();
|
|
6196
6196
|
void resyncConversation();
|
|
6197
6197
|
});
|
|
6198
|
-
const unsubCleared = c.events.on(
|
|
6198
|
+
const unsubCleared = c.events.on(chunkJ3UYIBKH_js.SESSION_CLEARED, resetConversation);
|
|
6199
6199
|
claimUnsubRef.current = () => {
|
|
6200
6200
|
unsubClaimed();
|
|
6201
6201
|
unsubCleared();
|
|
@@ -6247,7 +6247,7 @@ function useChat(options = {}) {
|
|
|
6247
6247
|
if (!openedRef.current) return false;
|
|
6248
6248
|
}
|
|
6249
6249
|
const replyTo = opts?.replyTo;
|
|
6250
|
-
const clientId =
|
|
6250
|
+
const clientId = chunkX6G6QERR_js.generateIdempotencyKey();
|
|
6251
6251
|
const localId = optimisticId(clientId);
|
|
6252
6252
|
const optimistic = {
|
|
6253
6253
|
id: localId,
|
|
@@ -6436,15 +6436,15 @@ function AuthElement({
|
|
|
6436
6436
|
}, [onReady, onAuthenticated, onError]);
|
|
6437
6437
|
React14.useEffect(() => {
|
|
6438
6438
|
if (!elements || !containerRef.current) return;
|
|
6439
|
-
const element = elements.create(
|
|
6439
|
+
const element = elements.create(chunkX6G6QERR_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
6440
6440
|
elementRef.current = element;
|
|
6441
|
-
element.on(
|
|
6441
|
+
element.on(chunkX6G6QERR_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6442
6442
|
element.on(
|
|
6443
|
-
|
|
6443
|
+
chunkX6G6QERR_js.EVENT_TYPES.AUTHENTICATED,
|
|
6444
6444
|
(data) => onAuthenticatedRef.current?.(data)
|
|
6445
6445
|
);
|
|
6446
6446
|
element.on(
|
|
6447
|
-
|
|
6447
|
+
chunkX6G6QERR_js.EVENT_TYPES.ERROR,
|
|
6448
6448
|
(data) => onErrorRef.current?.(data)
|
|
6449
6449
|
);
|
|
6450
6450
|
element.mount(containerRef.current);
|
|
@@ -6473,15 +6473,15 @@ function AddressElement({
|
|
|
6473
6473
|
}, [onReady, onChange, onError]);
|
|
6474
6474
|
React14.useEffect(() => {
|
|
6475
6475
|
if (!elements || !containerRef.current) return;
|
|
6476
|
-
const element = elements.create(
|
|
6476
|
+
const element = elements.create(chunkX6G6QERR_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
6477
6477
|
elementRef.current = element;
|
|
6478
|
-
element.on(
|
|
6478
|
+
element.on(chunkX6G6QERR_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6479
6479
|
element.on(
|
|
6480
|
-
|
|
6480
|
+
chunkX6G6QERR_js.EVENT_TYPES.CHANGE,
|
|
6481
6481
|
(data) => onChangeRef.current?.(data)
|
|
6482
6482
|
);
|
|
6483
6483
|
element.on(
|
|
6484
|
-
|
|
6484
|
+
chunkX6G6QERR_js.EVENT_TYPES.ERROR,
|
|
6485
6485
|
(data) => onErrorRef.current?.(data)
|
|
6486
6486
|
);
|
|
6487
6487
|
element.mount(containerRef.current);
|
|
@@ -6511,15 +6511,15 @@ function PaymentElement({
|
|
|
6511
6511
|
}, [onReady, onChange, onError]);
|
|
6512
6512
|
React14.useEffect(() => {
|
|
6513
6513
|
if (!elements || !containerRef.current) return;
|
|
6514
|
-
const element = elements.create(
|
|
6514
|
+
const element = elements.create(chunkX6G6QERR_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
6515
6515
|
elementRef.current = element;
|
|
6516
|
-
element.on(
|
|
6516
|
+
element.on(chunkX6G6QERR_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
|
|
6517
6517
|
element.on(
|
|
6518
|
-
|
|
6518
|
+
chunkX6G6QERR_js.EVENT_TYPES.CHANGE,
|
|
6519
6519
|
(data) => onChangeRef.current?.(data)
|
|
6520
6520
|
);
|
|
6521
6521
|
element.on(
|
|
6522
|
-
|
|
6522
|
+
chunkX6G6QERR_js.EVENT_TYPES.ERROR,
|
|
6523
6523
|
(data) => onErrorRef.current?.(data)
|
|
6524
6524
|
);
|
|
6525
6525
|
element.mount(containerRef.current);
|
|
@@ -6676,7 +6676,7 @@ function VariantSelector({
|
|
|
6676
6676
|
if (!variants || variants.length <= 1) {
|
|
6677
6677
|
return null;
|
|
6678
6678
|
}
|
|
6679
|
-
basePrice != null ?
|
|
6679
|
+
basePrice != null ? chunk64EDCDBR_js.parsePrice(basePrice) : 0;
|
|
6680
6680
|
if (variantAxes && variantAxes.length > 0) {
|
|
6681
6681
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
6682
6682
|
const labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -6782,7 +6782,7 @@ function VariantSelector({
|
|
|
6782
6782
|
className: cn("divide-y divide-border", classNames?.list),
|
|
6783
6783
|
children: variants.map((variant) => {
|
|
6784
6784
|
const isSelected = selectedVariantId === variant.id;
|
|
6785
|
-
const adjustment =
|
|
6785
|
+
const adjustment = chunk64EDCDBR_js.parsePrice(variant.price_adjustment);
|
|
6786
6786
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6787
6787
|
radio.Radio.Root,
|
|
6788
6788
|
{
|
|
@@ -7050,16 +7050,16 @@ function BundleSelector({
|
|
|
7050
7050
|
}, [components, selections, onReady]);
|
|
7051
7051
|
const totalPrice = React14.useMemo(() => {
|
|
7052
7052
|
if (pricingType === "fixed" && bundlePrice) {
|
|
7053
|
-
return
|
|
7053
|
+
return chunk64EDCDBR_js.parsePrice(bundlePrice);
|
|
7054
7054
|
}
|
|
7055
7055
|
const componentsTotal = components.reduce((sum, comp) => {
|
|
7056
7056
|
return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
|
|
7057
7057
|
}, 0);
|
|
7058
7058
|
if (pricingType === "percentage_discount" && discountValue) {
|
|
7059
|
-
return componentsTotal * (1 -
|
|
7059
|
+
return componentsTotal * (1 - chunk64EDCDBR_js.parsePrice(discountValue) / 100);
|
|
7060
7060
|
}
|
|
7061
7061
|
if (pricingType === "fixed_discount" && discountValue) {
|
|
7062
|
-
return componentsTotal -
|
|
7062
|
+
return componentsTotal - chunk64EDCDBR_js.parsePrice(discountValue);
|
|
7063
7063
|
}
|
|
7064
7064
|
return componentsTotal;
|
|
7065
7065
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
@@ -7121,15 +7121,15 @@ function BundleSelector({
|
|
|
7121
7121
|
}
|
|
7122
7122
|
function getComponentPrice(component, selectedVariantId) {
|
|
7123
7123
|
if (!selectedVariantId || component.available_variants.length === 0) {
|
|
7124
|
-
return
|
|
7124
|
+
return chunk64EDCDBR_js.parsePrice(component.effective_price);
|
|
7125
7125
|
}
|
|
7126
7126
|
if (selectedVariantId === component.variant_id) {
|
|
7127
|
-
return
|
|
7127
|
+
return chunk64EDCDBR_js.parsePrice(component.effective_price);
|
|
7128
7128
|
}
|
|
7129
7129
|
const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
|
|
7130
7130
|
const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
7131
|
-
if (!selectedAdj) return
|
|
7132
|
-
return
|
|
7131
|
+
if (!selectedAdj) return chunk64EDCDBR_js.parsePrice(component.effective_price);
|
|
7132
|
+
return chunk64EDCDBR_js.parsePrice(component.effective_price) - chunk64EDCDBR_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunk64EDCDBR_js.parsePrice(selectedAdj.price_adjustment);
|
|
7133
7133
|
}
|
|
7134
7134
|
function formatDuration(minutes, unit) {
|
|
7135
7135
|
if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
|
|
@@ -7243,7 +7243,7 @@ function BundleComponentCard({
|
|
|
7243
7243
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
7244
7244
|
children: component.available_variants.map((variant) => {
|
|
7245
7245
|
const isSelected = selectedVariantId === variant.id;
|
|
7246
|
-
const adjustment =
|
|
7246
|
+
const adjustment = chunk64EDCDBR_js.parsePrice(variant.price_adjustment);
|
|
7247
7247
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7248
7248
|
radio.Radio.Root,
|
|
7249
7249
|
{
|
|
@@ -7690,7 +7690,7 @@ function CompositeSelector({
|
|
|
7690
7690
|
"data-cimplify-composite-summary": true,
|
|
7691
7691
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
7692
7692
|
children: [
|
|
7693
|
-
|
|
7693
|
+
chunk64EDCDBR_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7694
7694
|
"div",
|
|
7695
7695
|
{
|
|
7696
7696
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7701,7 +7701,7 @@ function CompositeSelector({
|
|
|
7701
7701
|
]
|
|
7702
7702
|
}
|
|
7703
7703
|
),
|
|
7704
|
-
|
|
7704
|
+
chunk64EDCDBR_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7705
7705
|
"div",
|
|
7706
7706
|
{
|
|
7707
7707
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -7845,7 +7845,7 @@ function BookingSummary({
|
|
|
7845
7845
|
className,
|
|
7846
7846
|
classNames
|
|
7847
7847
|
}) {
|
|
7848
|
-
const depositValue = depositAmount != null ?
|
|
7848
|
+
const depositValue = depositAmount != null ? chunk64EDCDBR_js.parsePrice(depositAmount) : 0;
|
|
7849
7849
|
const depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0;
|
|
7850
7850
|
const hasDeposit = depositDue > 0;
|
|
7851
7851
|
const balance = Math.max(0, total - depositDue);
|
|
@@ -8568,7 +8568,7 @@ function InputField({
|
|
|
8568
8568
|
currency,
|
|
8569
8569
|
classNames
|
|
8570
8570
|
}) {
|
|
8571
|
-
const hasPriceAdjustment = field.price_adjustment != null &&
|
|
8571
|
+
const hasPriceAdjustment = field.price_adjustment != null && chunk64EDCDBR_js.parsePrice(field.price_adjustment) > 0;
|
|
8572
8572
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
8573
8573
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
8574
8574
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -9649,7 +9649,7 @@ function ProductCustomizer({
|
|
|
9649
9649
|
const [selectedStaffId, setSelectedStaffId] = React14.useState(null);
|
|
9650
9650
|
const [unitsCount, setUnitsCount] = React14.useState(1);
|
|
9651
9651
|
const cart = useCart();
|
|
9652
|
-
const currency =
|
|
9652
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
9653
9653
|
const productType = product.type || "product";
|
|
9654
9654
|
const isComposite = productType === "composite";
|
|
9655
9655
|
const isBundle = productType === "bundle";
|
|
@@ -9705,18 +9705,18 @@ function ProductCustomizer({
|
|
|
9705
9705
|
}, [selectedAddOnOptionIds]);
|
|
9706
9706
|
const localTotalPrice = React14.useMemo(() => {
|
|
9707
9707
|
if (isComposite && compositePrice) {
|
|
9708
|
-
return
|
|
9708
|
+
return chunk64EDCDBR_js.parsePrice(compositePrice.final_price) * quantity;
|
|
9709
9709
|
}
|
|
9710
9710
|
if (isBundle && bundleTotalPrice != null) {
|
|
9711
9711
|
return bundleTotalPrice * quantity;
|
|
9712
9712
|
}
|
|
9713
|
-
let price =
|
|
9713
|
+
let price = chunk64EDCDBR_js.parsePrice(product.default_price);
|
|
9714
9714
|
if (selectedVariant?.price_adjustment) {
|
|
9715
|
-
price +=
|
|
9715
|
+
price += chunk64EDCDBR_js.parsePrice(selectedVariant.price_adjustment);
|
|
9716
9716
|
}
|
|
9717
9717
|
for (const option of selectedAddOnOptions) {
|
|
9718
9718
|
if (option.default_price) {
|
|
9719
|
-
price +=
|
|
9719
|
+
price += chunk64EDCDBR_js.parsePrice(option.default_price);
|
|
9720
9720
|
}
|
|
9721
9721
|
}
|
|
9722
9722
|
return price * quantity;
|
|
@@ -9765,7 +9765,7 @@ function ProductCustomizer({
|
|
|
9765
9765
|
const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
|
|
9766
9766
|
const perUnit = priceInfo.pre_tax_price;
|
|
9767
9767
|
if (perUnit === void 0 || perUnit === null) return void 0;
|
|
9768
|
-
return
|
|
9768
|
+
return chunk64EDCDBR_js.parsePrice(perUnit) * quantity;
|
|
9769
9769
|
}, [quote, quantity]);
|
|
9770
9770
|
const displayTotalPrice = React14.useMemo(() => {
|
|
9771
9771
|
const total = quotedTotalPrice ?? localTotalPrice;
|
|
@@ -9949,7 +9949,7 @@ function ProductCustomizer({
|
|
|
9949
9949
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
9950
9950
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
9951
9951
|
"Deposit required: ",
|
|
9952
|
-
|
|
9952
|
+
chunk64EDCDBR_js.parsePrice(product.deposit_amount),
|
|
9953
9953
|
"%"
|
|
9954
9954
|
] }) }),
|
|
9955
9955
|
product.allergies && product.allergies.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-customizer-allergens": true, className: cn("flex flex-wrap gap-1.5", classNames?.allergens), children: product.allergies.map((allergen) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10022,7 +10022,7 @@ function ProductCustomizer({
|
|
|
10022
10022
|
] })
|
|
10023
10023
|
] }),
|
|
10024
10024
|
product.quantity_pricing && product.quantity_pricing.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customizer-unit-price": true, className: "text-sm text-muted-foreground text-right shrink-0", children: [
|
|
10025
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10025
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk64EDCDBR_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunk64EDCDBR_js.parsePrice(product.default_price)), currency, className: "font-medium text-foreground" }),
|
|
10026
10026
|
" ea."
|
|
10027
10027
|
] }),
|
|
10028
10028
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -10481,7 +10481,7 @@ function CartLineItemRow({
|
|
|
10481
10481
|
const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
|
|
10482
10482
|
const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
|
|
10483
10483
|
const isOptimistic2 = item.isOptimistic === true;
|
|
10484
|
-
const lineTotal =
|
|
10484
|
+
const lineTotal = chunk64EDCDBR_js.parsePrice(unitPrice) * item.quantity;
|
|
10485
10485
|
const imageUrl = item.product.image_url;
|
|
10486
10486
|
const variantLabel2 = item.variant ? chunkQPRI2NII_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
10487
10487
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -10714,15 +10714,15 @@ function CartSummary({
|
|
|
10714
10714
|
] }),
|
|
10715
10715
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
|
|
10716
10716
|
] }),
|
|
10717
|
-
totalDiscounts != null &&
|
|
10717
|
+
totalDiscounts != null && chunk64EDCDBR_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
|
|
10718
10718
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
|
|
10719
10719
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
|
|
10720
10720
|
] }),
|
|
10721
10721
|
deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
|
|
10722
10722
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
10723
|
-
|
|
10723
|
+
chunk64EDCDBR_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
|
|
10724
10724
|
] }),
|
|
10725
|
-
serviceCharge != null &&
|
|
10725
|
+
serviceCharge != null && chunk64EDCDBR_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
|
|
10726
10726
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
|
|
10727
10727
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
|
|
10728
10728
|
] }),
|
|
@@ -10812,16 +10812,16 @@ function SaleBadge({
|
|
|
10812
10812
|
className,
|
|
10813
10813
|
classNames
|
|
10814
10814
|
}) {
|
|
10815
|
-
const onSale =
|
|
10815
|
+
const onSale = chunk64EDCDBR_js.isOnSale(product);
|
|
10816
10816
|
const hasDeal = dealInfo !== void 0;
|
|
10817
10817
|
if (!hasDeal && !onSale && !label) {
|
|
10818
10818
|
return null;
|
|
10819
10819
|
}
|
|
10820
10820
|
let percentage = null;
|
|
10821
10821
|
if (hasDeal && dealInfo.benefit_type === "percentage") {
|
|
10822
|
-
percentage =
|
|
10822
|
+
percentage = chunk64EDCDBR_js.parsePrice(dealInfo.value);
|
|
10823
10823
|
} else if (onSale) {
|
|
10824
|
-
percentage =
|
|
10824
|
+
percentage = chunk64EDCDBR_js.getDiscountPercentage(product);
|
|
10825
10825
|
}
|
|
10826
10826
|
const badgeText = label ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
10827
10827
|
if (!badgeText) {
|
|
@@ -10840,7 +10840,7 @@ function SaleBadge({
|
|
|
10840
10840
|
"%"
|
|
10841
10841
|
] }),
|
|
10842
10842
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
10843
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10843
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk64EDCDBR_js.getBasePrice(product), currency: chunk64EDCDBR_js.getProductCurrency(product) }) })
|
|
10844
10844
|
]
|
|
10845
10845
|
}
|
|
10846
10846
|
);
|
|
@@ -10858,7 +10858,7 @@ function SalePrice({
|
|
|
10858
10858
|
if (!sale) {
|
|
10859
10859
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
10860
10860
|
}
|
|
10861
|
-
const off = Math.round(
|
|
10861
|
+
const off = Math.round(chunk64EDCDBR_js.parsePrice(sale.percent_off));
|
|
10862
10862
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10863
10863
|
"span",
|
|
10864
10864
|
{
|
|
@@ -11234,7 +11234,7 @@ function ProductSheet({
|
|
|
11234
11234
|
Price,
|
|
11235
11235
|
{
|
|
11236
11236
|
amount: fullProduct.default_price,
|
|
11237
|
-
currency:
|
|
11237
|
+
currency: chunk64EDCDBR_js.getProductCurrency(fullProduct),
|
|
11238
11238
|
className: classNames?.price
|
|
11239
11239
|
}
|
|
11240
11240
|
)
|
|
@@ -11420,10 +11420,10 @@ function SoldOutOverlay() {
|
|
|
11420
11420
|
function SaleBadge2({ product }) {
|
|
11421
11421
|
let label = null;
|
|
11422
11422
|
if (product.sale) {
|
|
11423
|
-
const off = Math.round(
|
|
11423
|
+
const off = Math.round(chunk64EDCDBR_js.parsePrice(product.sale.percent_off));
|
|
11424
11424
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
11425
|
-
} else if (
|
|
11426
|
-
const pct =
|
|
11425
|
+
} else if (chunk64EDCDBR_js.isOnSale(product)) {
|
|
11426
|
+
const pct = chunk64EDCDBR_js.getDiscountPercentage(product);
|
|
11427
11427
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
11428
11428
|
}
|
|
11429
11429
|
if (!label) return null;
|
|
@@ -11464,7 +11464,7 @@ function FoodProductCard({
|
|
|
11464
11464
|
className
|
|
11465
11465
|
}) {
|
|
11466
11466
|
const image = product.image_url || product.images?.[0] || "";
|
|
11467
|
-
const currency =
|
|
11467
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11468
11468
|
const tags = product.tags || [];
|
|
11469
11469
|
const isSignature = product.metadata?.is_signature === true;
|
|
11470
11470
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -11520,9 +11520,9 @@ function RetailProductCard({
|
|
|
11520
11520
|
className
|
|
11521
11521
|
}) {
|
|
11522
11522
|
const image = product.image_url || product.images?.[0] || "";
|
|
11523
|
-
const currency =
|
|
11523
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11524
11524
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
11525
|
-
const onSale =
|
|
11525
|
+
const onSale = chunk64EDCDBR_js.isOnSale(product);
|
|
11526
11526
|
const swatches = getColorSwatches(product);
|
|
11527
11527
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
11528
11528
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
@@ -11543,7 +11543,7 @@ function RetailProductCard({
|
|
|
11543
11543
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
11544
11544
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11545
11545
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11546
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11546
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk64EDCDBR_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
11547
11547
|
] }) }),
|
|
11548
11548
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11549
11549
|
"span",
|
|
@@ -11558,10 +11558,10 @@ function RetailProductCard({
|
|
|
11558
11558
|
] });
|
|
11559
11559
|
}
|
|
11560
11560
|
function PriceRange({ product, currency, className }) {
|
|
11561
|
-
const resolvedCurrency = currency ??
|
|
11562
|
-
const range =
|
|
11561
|
+
const resolvedCurrency = currency ?? chunk64EDCDBR_js.getProductCurrency(product);
|
|
11562
|
+
const range = chunk64EDCDBR_js.getPriceRange(product);
|
|
11563
11563
|
if (!range) return null;
|
|
11564
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
11564
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunk64EDCDBR_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
11565
11565
|
}
|
|
11566
11566
|
function WholesaleProductCard({
|
|
11567
11567
|
product,
|
|
@@ -11571,7 +11571,7 @@ function WholesaleProductCard({
|
|
|
11571
11571
|
className
|
|
11572
11572
|
}) {
|
|
11573
11573
|
const image = product.image_url || product.images?.[0] || "";
|
|
11574
|
-
const currency =
|
|
11574
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11575
11575
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11576
11576
|
const status = product.inventory_status;
|
|
11577
11577
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -11619,7 +11619,7 @@ function DigitalProductCard({
|
|
|
11619
11619
|
className
|
|
11620
11620
|
}) {
|
|
11621
11621
|
const image = product.image_url || product.images?.[0] || "";
|
|
11622
|
-
const currency =
|
|
11622
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11623
11623
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
11624
11624
|
const isTicket = product.digital_type === "ticket";
|
|
11625
11625
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -11650,11 +11650,11 @@ function BundleProductCard({
|
|
|
11650
11650
|
className
|
|
11651
11651
|
}) {
|
|
11652
11652
|
const image = product.image_url || product.images?.[0] || "";
|
|
11653
|
-
const currency =
|
|
11653
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11654
11654
|
const components = product.components || [];
|
|
11655
11655
|
const componentCount = components.length;
|
|
11656
|
-
const onSale =
|
|
11657
|
-
const discount =
|
|
11656
|
+
const onSale = chunk64EDCDBR_js.isOnSale(product);
|
|
11657
|
+
const discount = chunk64EDCDBR_js.getDiscountPercentage(product);
|
|
11658
11658
|
const hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
11659
11659
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11660
11660
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
@@ -11681,7 +11681,7 @@ function BundleProductCard({
|
|
|
11681
11681
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
11682
11682
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
11683
11683
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11684
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
11684
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk64EDCDBR_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
11685
11685
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
11686
11686
|
"Save ",
|
|
11687
11687
|
discount,
|
|
@@ -11701,7 +11701,7 @@ function CompositeProductCard({
|
|
|
11701
11701
|
className
|
|
11702
11702
|
}) {
|
|
11703
11703
|
const image = product.image_url || product.images?.[0] || "";
|
|
11704
|
-
const currency =
|
|
11704
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11705
11705
|
const groups = product.groups || [];
|
|
11706
11706
|
const groupCount = groups.length;
|
|
11707
11707
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -11753,7 +11753,7 @@ function StandardServiceCard({
|
|
|
11753
11753
|
className
|
|
11754
11754
|
}) {
|
|
11755
11755
|
const image = product.image_url || product.images?.[0] || "";
|
|
11756
|
-
const currency =
|
|
11756
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11757
11757
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11758
11758
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
11759
11759
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
@@ -11808,7 +11808,7 @@ function CompactServiceCard({
|
|
|
11808
11808
|
className
|
|
11809
11809
|
}) {
|
|
11810
11810
|
const image = product.image_url || product.images?.[0] || "";
|
|
11811
|
-
const currency =
|
|
11811
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11812
11812
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11813
11813
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
11814
11814
|
const href = `/products/${product.slug}`;
|
|
@@ -11857,7 +11857,7 @@ function ScheduleServiceCard({
|
|
|
11857
11857
|
className
|
|
11858
11858
|
}) {
|
|
11859
11859
|
const image = product.image_url || product.images?.[0] || "";
|
|
11860
|
-
const currency =
|
|
11860
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11861
11861
|
const href = `/products/${product.slug}`;
|
|
11862
11862
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
11863
11863
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -11929,7 +11929,7 @@ function RentalServiceCard({
|
|
|
11929
11929
|
className
|
|
11930
11930
|
}) {
|
|
11931
11931
|
const image = product.image_url || product.images?.[0] || "";
|
|
11932
|
-
const currency =
|
|
11932
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
11933
11933
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11934
11934
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
11935
11935
|
const priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit;
|
|
@@ -11999,7 +11999,7 @@ function AccommodationCard({
|
|
|
11999
11999
|
className
|
|
12000
12000
|
}) {
|
|
12001
12001
|
const image = product.image_url || product.images?.[0] || "";
|
|
12002
|
-
const currency =
|
|
12002
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
12003
12003
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12004
12004
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
12005
12005
|
const tags = product.tags || [];
|
|
@@ -12065,7 +12065,7 @@ function LeaseServiceCard({
|
|
|
12065
12065
|
className
|
|
12066
12066
|
}) {
|
|
12067
12067
|
const image = product.image_url || product.images?.[0] || "";
|
|
12068
|
-
const currency =
|
|
12068
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
12069
12069
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
12070
12070
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
12071
12071
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -12139,7 +12139,7 @@ function SubscriptionCard({
|
|
|
12139
12139
|
className
|
|
12140
12140
|
}) {
|
|
12141
12141
|
const image = product.image_url || product.images?.[0] || "";
|
|
12142
|
-
const currency =
|
|
12142
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
12143
12143
|
const plans = product.billing_plans || [];
|
|
12144
12144
|
const primaryPlan = plans[0];
|
|
12145
12145
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -12370,7 +12370,7 @@ function ProductCard({
|
|
|
12370
12370
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
12371
12371
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
12372
12372
|
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 }),
|
|
12373
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
12373
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunk64EDCDBR_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
12374
12374
|
] })
|
|
12375
12375
|
] });
|
|
12376
12376
|
})();
|
|
@@ -12699,7 +12699,7 @@ function SearchInput({
|
|
|
12699
12699
|
}
|
|
12700
12700
|
),
|
|
12701
12701
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
|
|
12702
|
-
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children:
|
|
12702
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunk64EDCDBR_js.formatPrice(product.default_price) })
|
|
12703
12703
|
] })
|
|
12704
12704
|
},
|
|
12705
12705
|
product.id
|
|
@@ -13194,19 +13194,19 @@ function OrderSummary({
|
|
|
13194
13194
|
order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
|
|
13195
13195
|
] }),
|
|
13196
13196
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
13197
|
-
order.total_discount != null &&
|
|
13197
|
+
order.total_discount != null && chunk64EDCDBR_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
13198
13198
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
13199
13199
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
13200
13200
|
] }),
|
|
13201
|
-
order.delivery_fee != null &&
|
|
13201
|
+
order.delivery_fee != null && chunk64EDCDBR_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
13202
13202
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
13203
13203
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
13204
13204
|
] }),
|
|
13205
|
-
order.service_charge != null &&
|
|
13205
|
+
order.service_charge != null && chunk64EDCDBR_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
13206
13206
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
13207
13207
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
13208
13208
|
] }),
|
|
13209
|
-
order.tax != null &&
|
|
13209
|
+
order.tax != null && chunk64EDCDBR_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
13210
13210
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
13211
13211
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
13212
13212
|
] }),
|
|
@@ -13737,7 +13737,7 @@ function BookingPage({
|
|
|
13737
13737
|
const hasStaffStep = staff && staff.length > 0;
|
|
13738
13738
|
const depositType = product?.deposit_type;
|
|
13739
13739
|
const depositAmount = product?.deposit_amount;
|
|
13740
|
-
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
13740
|
+
const hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunk64EDCDBR_js.parsePrice(depositAmount) !== 0;
|
|
13741
13741
|
const cancellationMinutes = product?.cancellation_window_minutes;
|
|
13742
13742
|
const noShowFee = product?.no_show_fee;
|
|
13743
13743
|
const handleSlotSelect = React14.useCallback(
|
|
@@ -13870,14 +13870,14 @@ function BookingPage({
|
|
|
13870
13870
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
13871
13871
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
13872
13872
|
"Deposit: ",
|
|
13873
|
-
depositType === "percentage" ? `${
|
|
13873
|
+
depositType === "percentage" ? `${chunk64EDCDBR_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
13874
13874
|
] }),
|
|
13875
13875
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
13876
13876
|
"Free cancellation up to ",
|
|
13877
13877
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
13878
13878
|
" before"
|
|
13879
13879
|
] }),
|
|
13880
|
-
noShowFee !== void 0 &&
|
|
13880
|
+
noShowFee !== void 0 && chunk64EDCDBR_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
13881
13881
|
"No-show fee: ",
|
|
13882
13882
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
13883
13883
|
] })
|
|
@@ -13980,7 +13980,7 @@ function BookingPage({
|
|
|
13980
13980
|
] }),
|
|
13981
13981
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
13982
13982
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
13983
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
13983
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunk64EDCDBR_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
13984
13984
|
] })
|
|
13985
13985
|
] }),
|
|
13986
13986
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14654,9 +14654,9 @@ function DefaultProductLayout({
|
|
|
14654
14654
|
}) {
|
|
14655
14655
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
14656
14656
|
const images = chunkQPRI2NII_js.resolveGallery(product, selectedVariantId);
|
|
14657
|
-
const currency =
|
|
14657
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
14658
14658
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
14659
|
-
const onSale =
|
|
14659
|
+
const onSale = chunk64EDCDBR_js.isOnSale(product);
|
|
14660
14660
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
14661
14661
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
14662
14662
|
renderBreadcrumb?.(product),
|
|
@@ -14679,13 +14679,13 @@ function DefaultProductLayout({
|
|
|
14679
14679
|
/* @__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: [
|
|
14680
14680
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
14681
14681
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14682
|
-
/* @__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(
|
|
14682
|
+
/* @__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(chunk64EDCDBR_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
14683
14683
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14684
14684
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
14685
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
14685
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk64EDCDBR_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
14686
14686
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
14687
14687
|
"Save ",
|
|
14688
|
-
|
|
14688
|
+
chunk64EDCDBR_js.getDiscountPercentage(product),
|
|
14689
14689
|
"%"
|
|
14690
14690
|
] })
|
|
14691
14691
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -14747,7 +14747,7 @@ function FoodProductLayout({
|
|
|
14747
14747
|
className
|
|
14748
14748
|
}) {
|
|
14749
14749
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14750
|
-
const currency =
|
|
14750
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
14751
14751
|
const tags = product.tags || [];
|
|
14752
14752
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
14753
14753
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -14822,7 +14822,7 @@ function WholesaleProductLayout({
|
|
|
14822
14822
|
className
|
|
14823
14823
|
}) {
|
|
14824
14824
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14825
|
-
const currency =
|
|
14825
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
14826
14826
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
14827
14827
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
14828
14828
|
renderBreadcrumb?.(product),
|
|
@@ -14906,9 +14906,9 @@ function ServiceProductLayout({
|
|
|
14906
14906
|
className
|
|
14907
14907
|
}) {
|
|
14908
14908
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14909
|
-
const currency =
|
|
14909
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
14910
14910
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
14911
|
-
const depositAmount = hasDeposit ?
|
|
14911
|
+
const depositAmount = hasDeposit ? chunk64EDCDBR_js.parsePrice(product.deposit_amount) : 0;
|
|
14912
14912
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
14913
14913
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
14914
14914
|
renderBreadcrumb?.(product),
|
|
@@ -14976,7 +14976,7 @@ function ServiceProductLayout({
|
|
|
14976
14976
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
14977
14977
|
" deposit charged at booking"
|
|
14978
14978
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
14979
|
-
|
|
14979
|
+
chunk64EDCDBR_js.parsePrice(product.deposit_amount),
|
|
14980
14980
|
"% deposit charged at booking"
|
|
14981
14981
|
] }) })
|
|
14982
14982
|
] })
|
|
@@ -15008,7 +15008,7 @@ function DigitalProductLayout({
|
|
|
15008
15008
|
className
|
|
15009
15009
|
}) {
|
|
15010
15010
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15011
|
-
const currency =
|
|
15011
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
15012
15012
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
15013
15013
|
const isTicket = product.digital_type === "ticket";
|
|
15014
15014
|
const isAccessPass = product.digital_type === "access_grant";
|
|
@@ -15135,15 +15135,15 @@ function BundleProductLayout({
|
|
|
15135
15135
|
className
|
|
15136
15136
|
}) {
|
|
15137
15137
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15138
|
-
const currency =
|
|
15138
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
15139
15139
|
const components = product.components || [];
|
|
15140
|
-
const onSale =
|
|
15141
|
-
const discount =
|
|
15140
|
+
const onSale = chunk64EDCDBR_js.isOnSale(product);
|
|
15141
|
+
const discount = chunk64EDCDBR_js.getDiscountPercentage(product);
|
|
15142
15142
|
const baseTotal = components.reduce(
|
|
15143
|
-
(sum, c) => sum +
|
|
15143
|
+
(sum, c) => sum + chunk64EDCDBR_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
15144
15144
|
0
|
|
15145
15145
|
);
|
|
15146
|
-
const bundlePrice =
|
|
15146
|
+
const bundlePrice = chunk64EDCDBR_js.parsePrice(product.default_price);
|
|
15147
15147
|
const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
15148
15148
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
15149
15149
|
renderBreadcrumb?.(product),
|
|
@@ -15219,7 +15219,7 @@ function CompositeProductLayout({
|
|
|
15219
15219
|
className
|
|
15220
15220
|
}) {
|
|
15221
15221
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
15222
|
-
const currency =
|
|
15222
|
+
const currency = chunk64EDCDBR_js.getProductCurrency(product);
|
|
15223
15223
|
const groups = product.groups || [];
|
|
15224
15224
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
15225
15225
|
renderBreadcrumb?.(product),
|
|
@@ -15642,7 +15642,7 @@ function CartDrawer({
|
|
|
15642
15642
|
}) {
|
|
15643
15643
|
const { isOpen, close } = useCartDrawer();
|
|
15644
15644
|
const cart = useCart();
|
|
15645
|
-
const subtotalNum =
|
|
15645
|
+
const subtotalNum = chunk64EDCDBR_js.parsePrice(cart.subtotal);
|
|
15646
15646
|
const animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
15647
15647
|
React14.useEffect(() => {
|
|
15648
15648
|
if (!isOpen) return;
|
|
@@ -16036,9 +16036,9 @@ function CatalogueCollectionLayout({
|
|
|
16036
16036
|
result = result.filter((p) => p.tags?.includes(activeCategory));
|
|
16037
16037
|
}
|
|
16038
16038
|
if (sortBy === "price-asc") {
|
|
16039
|
-
result = [...result].sort((a, b) =>
|
|
16039
|
+
result = [...result].sort((a, b) => chunk64EDCDBR_js.parsePrice(a.default_price) - chunk64EDCDBR_js.parsePrice(b.default_price));
|
|
16040
16040
|
} else if (sortBy === "price-desc") {
|
|
16041
|
-
result = [...result].sort((a, b) =>
|
|
16041
|
+
result = [...result].sort((a, b) => chunk64EDCDBR_js.parsePrice(b.default_price) - chunk64EDCDBR_js.parsePrice(a.default_price));
|
|
16042
16042
|
} else if (sortBy === "name") {
|
|
16043
16043
|
result = [...result].sort((a, b) => a.name.localeCompare(b.name));
|
|
16044
16044
|
}
|
|
@@ -19567,7 +19567,7 @@ function toneChip(value) {
|
|
|
19567
19567
|
}
|
|
19568
19568
|
}
|
|
19569
19569
|
function money(amount, currency) {
|
|
19570
|
-
return
|
|
19570
|
+
return chunk64EDCDBR_js.formatPrice(chunk64EDCDBR_js.parsePrice(num(amount) ?? 0), text(currency));
|
|
19571
19571
|
}
|
|
19572
19572
|
var CHAT_GENUI_COMPONENTS = {
|
|
19573
19573
|
Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19815,7 +19815,7 @@ function ReplyCardView({
|
|
|
19815
19815
|
card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
|
|
19816
19816
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
19817
19817
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
|
|
19818
|
-
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children:
|
|
19818
|
+
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunk64EDCDBR_js.formatPrice(chunk64EDCDBR_js.parsePrice(card.price), currency ?? void 0) }),
|
|
19819
19819
|
fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
|
|
19820
19820
|
] })
|
|
19821
19821
|
]
|