@cimplify/sdk 0.71.0 → 0.72.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/react.d.mts +55 -17
- package/dist/react.d.ts +55 -17
- package/dist/react.js +148 -84
- package/dist/react.mjs +149 -85
- package/dist/testing.d.mts +15 -15
- package/dist/testing.d.ts +15 -15
- package/package.json +1 -1
- package/registry/accommodation-card.json +1 -1
- package/registry/add-on-selector.json +1 -1
- package/registry/billing-plan-selector.json +1 -1
- package/registry/booking-page.json +1 -1
- package/registry/bundle-selector.json +1 -1
- package/registry/compact-service-card.json +1 -1
- package/registry/composite-selector.json +1 -1
- package/registry/customer-input-fields.json +1 -1
- package/registry/date-slot-picker.json +1 -1
- package/registry/default-product-layout.json +1 -1
- package/registry/digital-product-card.json +1 -1
- package/registry/digital-product-layout.json +1 -1
- package/registry/food-product-card.json +1 -1
- package/registry/food-product-layout.json +1 -1
- package/registry/lease-service-card.json +1 -1
- package/registry/price-range.json +1 -1
- package/registry/price.json +1 -1
- package/registry/product-card.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/product-sheet.json +1 -1
- package/registry/rental-service-card.json +1 -1
- package/registry/retail-product-card.json +1 -1
- package/registry/sale-badge.json +1 -1
- package/registry/schedule-service-card.json +1 -1
- package/registry/service-product-layout.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/standard-service-card.json +1 -1
- package/registry/subscription-card.json +1 -1
- package/registry/variant-selector.json +1 -1
- package/registry/volume-pricing.json +1 -1
- package/registry/wholesale-product-card.json +1 -1
- package/registry/wholesale-product-layout.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1149,14 +1149,20 @@ function CimplifyProvider({
|
|
|
1149
1149
|
client,
|
|
1150
1150
|
children,
|
|
1151
1151
|
onLocationChange,
|
|
1152
|
+
initialBusiness,
|
|
1153
|
+
initialLocations,
|
|
1152
1154
|
optimistic = true
|
|
1153
1155
|
}) {
|
|
1154
1156
|
const resolvedClient = React14.useMemo(() => client ?? createDefaultClient(), [client]);
|
|
1155
1157
|
const onLocationChangeRef = React14.useRef(onLocationChange);
|
|
1156
|
-
const
|
|
1157
|
-
const
|
|
1158
|
-
const [
|
|
1159
|
-
const [
|
|
1158
|
+
const seeded = initialBusiness !== void 0;
|
|
1159
|
+
const initialBootstrapDone = React14.useRef(seeded);
|
|
1160
|
+
const [business, setBusiness] = React14.useState(initialBusiness ?? null);
|
|
1161
|
+
const [locations, setLocations] = React14.useState(initialLocations ?? []);
|
|
1162
|
+
const [currentLocation, setCurrentLocationState] = React14.useState(
|
|
1163
|
+
initialLocations && initialLocations.length > 0 ? initialLocations[0] : null
|
|
1164
|
+
);
|
|
1165
|
+
const [isReady, setIsReady] = React14.useState(seeded);
|
|
1160
1166
|
React14.useEffect(() => {
|
|
1161
1167
|
onLocationChangeRef.current = onLocationChange;
|
|
1162
1168
|
}, [onLocationChange]);
|
|
@@ -1230,7 +1236,9 @@ function CimplifyProvider({
|
|
|
1230
1236
|
React14.useEffect(() => {
|
|
1231
1237
|
let cancelled = false;
|
|
1232
1238
|
async function bootstrap() {
|
|
1233
|
-
|
|
1239
|
+
if (!initialBootstrapDone.current) {
|
|
1240
|
+
setIsReady(false);
|
|
1241
|
+
}
|
|
1234
1242
|
const [businessResult, locationsResult] = await Promise.all([
|
|
1235
1243
|
resolvedClient.business.getInfo(),
|
|
1236
1244
|
resolvedClient.business.getLocations()
|
|
@@ -1255,23 +1263,27 @@ function CimplifyProvider({
|
|
|
1255
1263
|
resolvedClient.setLocationId(null);
|
|
1256
1264
|
setStoredLocationId(null);
|
|
1257
1265
|
}
|
|
1266
|
+
initialBootstrapDone.current = true;
|
|
1258
1267
|
setIsReady(true);
|
|
1259
1268
|
}
|
|
1260
1269
|
bootstrap().catch(() => {
|
|
1261
1270
|
if (cancelled) {
|
|
1262
1271
|
return;
|
|
1263
1272
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1273
|
+
if (!seeded) {
|
|
1274
|
+
setBusiness(null);
|
|
1275
|
+
setLocations([]);
|
|
1276
|
+
setCurrentLocationState(null);
|
|
1277
|
+
resolvedClient.setLocationId(null);
|
|
1278
|
+
setStoredLocationId(null);
|
|
1279
|
+
}
|
|
1280
|
+
initialBootstrapDone.current = true;
|
|
1269
1281
|
setIsReady(true);
|
|
1270
1282
|
});
|
|
1271
1283
|
return () => {
|
|
1272
1284
|
cancelled = true;
|
|
1273
1285
|
};
|
|
1274
|
-
}, [resolvedClient]);
|
|
1286
|
+
}, [resolvedClient, seeded]);
|
|
1275
1287
|
const clientContextValue = React14.useMemo(
|
|
1276
1288
|
() => ({
|
|
1277
1289
|
client: resolvedClient,
|
|
@@ -4203,11 +4215,18 @@ function CimplifyUserButton({
|
|
|
4203
4215
|
)
|
|
4204
4216
|
] });
|
|
4205
4217
|
}
|
|
4206
|
-
function Price({
|
|
4218
|
+
function Price({
|
|
4219
|
+
amount,
|
|
4220
|
+
currency,
|
|
4221
|
+
className,
|
|
4222
|
+
prefix,
|
|
4223
|
+
convert = true
|
|
4224
|
+
}) {
|
|
4207
4225
|
const context = useOptionalCimplify();
|
|
4208
|
-
const
|
|
4209
|
-
const
|
|
4210
|
-
const
|
|
4226
|
+
const sourceCurrency = currency ?? context?.baseCurrency ?? "USD";
|
|
4227
|
+
const fxActive = convert && context?.fxRate != null && context.displayCurrency !== sourceCurrency && sourceCurrency === context.baseCurrency;
|
|
4228
|
+
const resolvedCurrency = fxActive ? context.displayCurrency : sourceCurrency;
|
|
4229
|
+
const resolvedAmount = fxActive ? context.convertPrice(amount) : typeof amount === "string" ? parseFloat(amount) || 0 : amount;
|
|
4211
4230
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
4212
4231
|
prefix,
|
|
4213
4232
|
chunk7Y2O3E4D_js.formatPrice(resolvedAmount, resolvedCurrency)
|
|
@@ -6163,6 +6182,7 @@ function VariantSelector({
|
|
|
6163
6182
|
variants,
|
|
6164
6183
|
variantAxes,
|
|
6165
6184
|
basePrice,
|
|
6185
|
+
currency,
|
|
6166
6186
|
selectedVariantId,
|
|
6167
6187
|
onVariantChange,
|
|
6168
6188
|
productName,
|
|
@@ -6315,7 +6335,7 @@ function VariantSelector({
|
|
|
6315
6335
|
),
|
|
6316
6336
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-variant-pricing": true, className: cn("text-sm text-muted-foreground", classNames?.pricing), children: [
|
|
6317
6337
|
adjustment > 0 ? "+" : adjustment < 0 ? "" : "+",
|
|
6318
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment })
|
|
6338
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment, currency })
|
|
6319
6339
|
] })
|
|
6320
6340
|
]
|
|
6321
6341
|
},
|
|
@@ -6330,6 +6350,7 @@ function AddOnSelector({
|
|
|
6330
6350
|
addOns,
|
|
6331
6351
|
selectedOptions,
|
|
6332
6352
|
onOptionsChange,
|
|
6353
|
+
currency,
|
|
6333
6354
|
className,
|
|
6334
6355
|
classNames
|
|
6335
6356
|
}) {
|
|
@@ -6488,7 +6509,7 @@ function AddOnSelector({
|
|
|
6488
6509
|
),
|
|
6489
6510
|
option.default_price != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground", children: [
|
|
6490
6511
|
"+",
|
|
6491
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: option.default_price })
|
|
6512
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: option.default_price, currency })
|
|
6492
6513
|
] })
|
|
6493
6514
|
]
|
|
6494
6515
|
},
|
|
@@ -6508,6 +6529,7 @@ function BundleSelector({
|
|
|
6508
6529
|
bundlePrice,
|
|
6509
6530
|
discountValue,
|
|
6510
6531
|
pricingType,
|
|
6532
|
+
currency,
|
|
6511
6533
|
onSelectionsChange,
|
|
6512
6534
|
onPriceChange,
|
|
6513
6535
|
onReady,
|
|
@@ -6588,6 +6610,7 @@ function BundleSelector({
|
|
|
6588
6610
|
component: comp,
|
|
6589
6611
|
selectedVariantId: variantChoices[comp.id],
|
|
6590
6612
|
onVariantChange: (variantId) => handleVariantChange(comp.id, variantId),
|
|
6613
|
+
currency,
|
|
6591
6614
|
classNames
|
|
6592
6615
|
},
|
|
6593
6616
|
comp.id
|
|
@@ -6599,7 +6622,7 @@ function BundleSelector({
|
|
|
6599
6622
|
className: cn("border-t border-border pt-4 flex justify-between text-sm", classNames?.summary),
|
|
6600
6623
|
children: [
|
|
6601
6624
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Bundle price" }),
|
|
6602
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: bundlePrice, className: "font-medium text-primary" })
|
|
6625
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: bundlePrice, currency, className: "font-medium text-primary" })
|
|
6603
6626
|
]
|
|
6604
6627
|
}
|
|
6605
6628
|
),
|
|
@@ -6610,7 +6633,7 @@ function BundleSelector({
|
|
|
6610
6633
|
className: cn("flex justify-between text-sm", classNames?.savings),
|
|
6611
6634
|
children: [
|
|
6612
6635
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "You save" }),
|
|
6613
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: discountValue, className: "text-green-600 font-medium" })
|
|
6636
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: discountValue, currency, className: "text-green-600 font-medium" })
|
|
6614
6637
|
]
|
|
6615
6638
|
}
|
|
6616
6639
|
)
|
|
@@ -6643,6 +6666,7 @@ function BundleComponentCard({
|
|
|
6643
6666
|
component,
|
|
6644
6667
|
selectedVariantId,
|
|
6645
6668
|
onVariantChange,
|
|
6669
|
+
currency,
|
|
6646
6670
|
classNames
|
|
6647
6671
|
}) {
|
|
6648
6672
|
const idPrefix = React14.useId();
|
|
@@ -6723,7 +6747,7 @@ function BundleComponentCard({
|
|
|
6723
6747
|
}
|
|
6724
6748
|
)
|
|
6725
6749
|
] }),
|
|
6726
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: displayPrice }) })
|
|
6750
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: displayPrice, currency }) })
|
|
6727
6751
|
]
|
|
6728
6752
|
}
|
|
6729
6753
|
),
|
|
@@ -6769,7 +6793,7 @@ function BundleComponentCard({
|
|
|
6769
6793
|
className: cn("text-sm text-muted-foreground", classNames?.variantAdjustment),
|
|
6770
6794
|
children: [
|
|
6771
6795
|
adjustment > 0 ? "+" : "",
|
|
6772
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment })
|
|
6796
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: variant.price_adjustment, currency })
|
|
6773
6797
|
]
|
|
6774
6798
|
}
|
|
6775
6799
|
)
|
|
@@ -6787,6 +6811,7 @@ function BundleComponentCard({
|
|
|
6787
6811
|
function CompositeSelector({
|
|
6788
6812
|
compositeId,
|
|
6789
6813
|
groups,
|
|
6814
|
+
currency,
|
|
6790
6815
|
onSelectionsChange,
|
|
6791
6816
|
onPriceChange,
|
|
6792
6817
|
onReady,
|
|
@@ -7165,7 +7190,7 @@ function CompositeSelector({
|
|
|
7165
7190
|
),
|
|
7166
7191
|
component.price != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground shrink-0", children: [
|
|
7167
7192
|
"+",
|
|
7168
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: component.price })
|
|
7193
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: component.price, currency })
|
|
7169
7194
|
] })
|
|
7170
7195
|
]
|
|
7171
7196
|
},
|
|
@@ -7192,7 +7217,7 @@ function CompositeSelector({
|
|
|
7192
7217
|
className: cn("flex justify-between text-muted-foreground", classNames?.summaryLine),
|
|
7193
7218
|
children: [
|
|
7194
7219
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Base" }),
|
|
7195
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.base_price })
|
|
7220
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.base_price, currency })
|
|
7196
7221
|
]
|
|
7197
7222
|
}
|
|
7198
7223
|
),
|
|
@@ -7203,7 +7228,7 @@ function CompositeSelector({
|
|
|
7203
7228
|
className: cn("flex justify-between text-muted-foreground", classNames?.summaryLine),
|
|
7204
7229
|
children: [
|
|
7205
7230
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Selections" }),
|
|
7206
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.components_total })
|
|
7231
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.components_total, currency })
|
|
7207
7232
|
]
|
|
7208
7233
|
}
|
|
7209
7234
|
),
|
|
@@ -7214,7 +7239,7 @@ function CompositeSelector({
|
|
|
7214
7239
|
className: cn("flex justify-between font-medium pt-1 border-t border-border", classNames?.summaryTotal),
|
|
7215
7240
|
children: [
|
|
7216
7241
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Total" }),
|
|
7217
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.final_price, className: "text-primary" })
|
|
7242
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: priceResult.final_price, currency, className: "text-primary" })
|
|
7218
7243
|
]
|
|
7219
7244
|
}
|
|
7220
7245
|
)
|
|
@@ -7271,6 +7296,7 @@ function formatMarkup(plan) {
|
|
|
7271
7296
|
function BillingPlanSelector({
|
|
7272
7297
|
productId,
|
|
7273
7298
|
plans: plansProp,
|
|
7299
|
+
currency,
|
|
7274
7300
|
onPlanSelect,
|
|
7275
7301
|
selectedPlanId,
|
|
7276
7302
|
showOneTimePurchase = false,
|
|
@@ -7332,7 +7358,7 @@ function BillingPlanSelector({
|
|
|
7332
7358
|
markup && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-billing-markup": true, className: classNames?.price, children: markup }),
|
|
7333
7359
|
plan.markup_type === "fixed" && plan.markup_amount != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-billing-markup": true, className: classNames?.price, children: [
|
|
7334
7360
|
"+",
|
|
7335
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: plan.markup_amount })
|
|
7361
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: plan.markup_amount, currency })
|
|
7336
7362
|
] }),
|
|
7337
7363
|
plan.trial_days > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-billing-trial": true, className: classNames?.trialBadge, children: [
|
|
7338
7364
|
plan.trial_days,
|
|
@@ -7340,7 +7366,7 @@ function BillingPlanSelector({
|
|
|
7340
7366
|
] }),
|
|
7341
7367
|
plan.setup_fee > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-billing-setup-fee": true, className: classNames?.setupFee, children: [
|
|
7342
7368
|
"Setup fee: ",
|
|
7343
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: plan.setup_fee })
|
|
7369
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: plan.setup_fee, currency })
|
|
7344
7370
|
] }),
|
|
7345
7371
|
plan.plan_type === "installment" && plan.installment_periods != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-billing-periods": true, children: [
|
|
7346
7372
|
plan.installment_periods,
|
|
@@ -7368,6 +7394,7 @@ function VolumePricing({
|
|
|
7368
7394
|
tiers,
|
|
7369
7395
|
currentQuantity,
|
|
7370
7396
|
defaultOpen = false,
|
|
7397
|
+
currency,
|
|
7371
7398
|
className,
|
|
7372
7399
|
classNames
|
|
7373
7400
|
}) {
|
|
@@ -7432,7 +7459,7 @@ function VolumePricing({
|
|
|
7432
7459
|
}
|
|
7433
7460
|
),
|
|
7434
7461
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-volume-pricing-price": true, className: classNames?.tierPrice, children: [
|
|
7435
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: tier.unit_price, prefix: "" }),
|
|
7462
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: tier.unit_price, currency, prefix: "" }),
|
|
7436
7463
|
" /ea"
|
|
7437
7464
|
] })
|
|
7438
7465
|
]
|
|
@@ -7707,6 +7734,7 @@ function CustomerInputFields({
|
|
|
7707
7734
|
values,
|
|
7708
7735
|
onChange,
|
|
7709
7736
|
onFileUpload,
|
|
7737
|
+
currency,
|
|
7710
7738
|
className,
|
|
7711
7739
|
classNames
|
|
7712
7740
|
}) {
|
|
@@ -7736,6 +7764,7 @@ function CustomerInputFields({
|
|
|
7736
7764
|
value: values[field.id],
|
|
7737
7765
|
onValueChange: (value) => setValue(field.id, value),
|
|
7738
7766
|
onFileUpload: onFileUpload ?? (clientContext?.client ? (_file, _field) => defaultFileUpload(_file) : void 0),
|
|
7767
|
+
currency,
|
|
7739
7768
|
classNames
|
|
7740
7769
|
},
|
|
7741
7770
|
field.id
|
|
@@ -7746,6 +7775,7 @@ function InputField({
|
|
|
7746
7775
|
value,
|
|
7747
7776
|
onValueChange,
|
|
7748
7777
|
onFileUpload,
|
|
7778
|
+
currency,
|
|
7749
7779
|
classNames
|
|
7750
7780
|
}) {
|
|
7751
7781
|
const hasPriceAdjustment = field.price_adjustment != null && chunk7Y2O3E4D_js.parsePrice(field.price_adjustment) > 0;
|
|
@@ -7755,7 +7785,7 @@ function InputField({
|
|
|
7755
7785
|
field.is_required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs text-destructive", classNames?.required), children: "Required" }),
|
|
7756
7786
|
hasPriceAdjustment && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("text-xs text-muted-foreground", classNames?.priceAdjustment), children: [
|
|
7757
7787
|
"+",
|
|
7758
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: field.price_adjustment })
|
|
7788
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: field.price_adjustment, currency })
|
|
7759
7789
|
] })
|
|
7760
7790
|
] }),
|
|
7761
7791
|
field.help_text && /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-xs text-muted-foreground mb-1.5", classNames?.helpText), children: field.help_text }),
|
|
@@ -8678,6 +8708,7 @@ function SlotPicker({
|
|
|
8678
8708
|
onSlotSelect,
|
|
8679
8709
|
groupByTimeOfDay = true,
|
|
8680
8710
|
showPrice = true,
|
|
8711
|
+
currency,
|
|
8681
8712
|
schedulingMode = "intraday",
|
|
8682
8713
|
durationUnit,
|
|
8683
8714
|
durationValue,
|
|
@@ -8790,7 +8821,7 @@ function SlotPicker({
|
|
|
8790
8821
|
{
|
|
8791
8822
|
"data-cimplify-slot-price": true,
|
|
8792
8823
|
className: cn("text-xs opacity-70", classNames?.slotPrice),
|
|
8793
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: slot.price })
|
|
8824
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: slot.price, currency })
|
|
8794
8825
|
}
|
|
8795
8826
|
)
|
|
8796
8827
|
]
|
|
@@ -8827,6 +8858,7 @@ function DateSlotPicker({
|
|
|
8827
8858
|
onSlotSelect,
|
|
8828
8859
|
availability: availabilityProp,
|
|
8829
8860
|
showPrice = true,
|
|
8861
|
+
currency,
|
|
8830
8862
|
schedulingMode,
|
|
8831
8863
|
durationUnit,
|
|
8832
8864
|
durationValue,
|
|
@@ -8975,6 +9007,7 @@ function DateSlotPicker({
|
|
|
8975
9007
|
selectedSlot,
|
|
8976
9008
|
onSlotSelect: handleSlotSelect,
|
|
8977
9009
|
showPrice,
|
|
9010
|
+
currency,
|
|
8978
9011
|
schedulingMode,
|
|
8979
9012
|
durationUnit,
|
|
8980
9013
|
durationValue,
|
|
@@ -9011,6 +9044,7 @@ function ProductCustomizer({
|
|
|
9011
9044
|
const [specialInstructions, setSpecialInstructions] = React14.useState("");
|
|
9012
9045
|
const [selectedSlot, setSelectedSlot] = React14.useState(null);
|
|
9013
9046
|
const cart = useCart();
|
|
9047
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
9014
9048
|
const productType = product.type || "product";
|
|
9015
9049
|
const isComposite = productType === "composite";
|
|
9016
9050
|
const isBundle = productType === "bundle";
|
|
@@ -9177,6 +9211,7 @@ function ProductCustomizer({
|
|
|
9177
9211
|
{
|
|
9178
9212
|
compositeId: product.composite_id,
|
|
9179
9213
|
groups: product.groups,
|
|
9214
|
+
currency,
|
|
9180
9215
|
onSelectionsChange: setCompositeSelections,
|
|
9181
9216
|
onPriceChange: setCompositePrice,
|
|
9182
9217
|
onReady: setCompositeReady,
|
|
@@ -9190,6 +9225,7 @@ function ProductCustomizer({
|
|
|
9190
9225
|
bundlePrice: product.bundle_price,
|
|
9191
9226
|
discountValue: product.discount_value,
|
|
9192
9227
|
pricingType: product.pricing_type,
|
|
9228
|
+
currency,
|
|
9193
9229
|
onSelectionsChange: setBundleSelections,
|
|
9194
9230
|
onPriceChange: setBundleTotalPrice,
|
|
9195
9231
|
onReady: setBundleReady
|
|
@@ -9201,7 +9237,8 @@ function ProductCustomizer({
|
|
|
9201
9237
|
serviceId: product.id,
|
|
9202
9238
|
selectedSlot,
|
|
9203
9239
|
onSlotSelect: (slot) => setSelectedSlot(slot),
|
|
9204
|
-
participantCount: quantity
|
|
9240
|
+
participantCount: quantity,
|
|
9241
|
+
currency
|
|
9205
9242
|
}
|
|
9206
9243
|
),
|
|
9207
9244
|
hasVariants && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9210,6 +9247,7 @@ function ProductCustomizer({
|
|
|
9210
9247
|
variants: product.variants,
|
|
9211
9248
|
variantAxes: product.variant_axes,
|
|
9212
9249
|
basePrice: product.default_price,
|
|
9250
|
+
currency,
|
|
9213
9251
|
selectedVariantId,
|
|
9214
9252
|
onVariantChange: handleVariantChange,
|
|
9215
9253
|
productName: product.name
|
|
@@ -9220,7 +9258,8 @@ function ProductCustomizer({
|
|
|
9220
9258
|
{
|
|
9221
9259
|
addOns: product.add_ons,
|
|
9222
9260
|
selectedOptions: selectedAddOnOptionIds,
|
|
9223
|
-
onOptionsChange: setSelectedAddOnOptionIds
|
|
9261
|
+
onOptionsChange: setSelectedAddOnOptionIds,
|
|
9262
|
+
currency
|
|
9224
9263
|
}
|
|
9225
9264
|
),
|
|
9226
9265
|
product.billing_plans && product.billing_plans.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9228,6 +9267,7 @@ function ProductCustomizer({
|
|
|
9228
9267
|
{
|
|
9229
9268
|
productId: product.id,
|
|
9230
9269
|
plans: product.billing_plans,
|
|
9270
|
+
currency,
|
|
9231
9271
|
onPlanSelect: setSelectedBillingPlan,
|
|
9232
9272
|
selectedPlanId: selectedBillingPlan?.id ?? null,
|
|
9233
9273
|
showOneTimePurchase: true
|
|
@@ -9237,7 +9277,8 @@ function ProductCustomizer({
|
|
|
9237
9277
|
VolumePricing,
|
|
9238
9278
|
{
|
|
9239
9279
|
tiers: product.quantity_pricing,
|
|
9240
|
-
currentQuantity: quantity
|
|
9280
|
+
currentQuantity: quantity,
|
|
9281
|
+
currency
|
|
9241
9282
|
}
|
|
9242
9283
|
),
|
|
9243
9284
|
product.input_fields && product.input_fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9245,12 +9286,13 @@ function ProductCustomizer({
|
|
|
9245
9286
|
{
|
|
9246
9287
|
fields: product.input_fields,
|
|
9247
9288
|
values: customerInputValues,
|
|
9248
|
-
onChange: setCustomerInputValues
|
|
9289
|
+
onChange: setCustomerInputValues,
|
|
9290
|
+
currency
|
|
9249
9291
|
}
|
|
9250
9292
|
),
|
|
9251
9293
|
product.deposit_type && product.deposit_type !== "none" && product.deposit_amount && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-customizer-deposit": true, className: cn("text-sm text-muted-foreground", classNames?.depositInfo), children: product.deposit_type === "fixed" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
9252
9294
|
"Deposit required: ",
|
|
9253
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount })
|
|
9295
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
9254
9296
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
9255
9297
|
"Deposit required: ",
|
|
9256
9298
|
chunk7Y2O3E4D_js.parsePrice(product.deposit_amount),
|
|
@@ -9314,7 +9356,7 @@ function ProductCustomizer({
|
|
|
9314
9356
|
] })
|
|
9315
9357
|
] }),
|
|
9316
9358
|
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: [
|
|
9317
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunk7Y2O3E4D_js.parsePrice(product.default_price)), className: "font-medium text-foreground" }),
|
|
9359
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunk7Y2O3E4D_js.parsePrice(product.default_price)), currency, className: "font-medium text-foreground" }),
|
|
9318
9360
|
" ea."
|
|
9319
9361
|
] }),
|
|
9320
9362
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9331,7 +9373,7 @@ function ProductCustomizer({
|
|
|
9331
9373
|
),
|
|
9332
9374
|
children: isAdded ? "Added to Cart" : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9333
9375
|
"Add to Cart \xB7 ",
|
|
9334
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: displayTotalPrice })
|
|
9376
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: displayTotalPrice, currency })
|
|
9335
9377
|
] })
|
|
9336
9378
|
}
|
|
9337
9379
|
)
|
|
@@ -10080,7 +10122,7 @@ function SaleBadge({
|
|
|
10080
10122
|
"%"
|
|
10081
10123
|
] }),
|
|
10082
10124
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
10083
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product) }) })
|
|
10125
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), currency: chunk7Y2O3E4D_js.getProductCurrency(product) }) })
|
|
10084
10126
|
]
|
|
10085
10127
|
}
|
|
10086
10128
|
);
|
|
@@ -10375,6 +10417,7 @@ function ProductSheet({
|
|
|
10375
10417
|
Price,
|
|
10376
10418
|
{
|
|
10377
10419
|
amount: fullProduct.default_price,
|
|
10420
|
+
currency: chunk7Y2O3E4D_js.getProductCurrency(fullProduct),
|
|
10378
10421
|
className: classNames?.price
|
|
10379
10422
|
}
|
|
10380
10423
|
)
|
|
@@ -10541,6 +10584,7 @@ function FoodProductCard({
|
|
|
10541
10584
|
className
|
|
10542
10585
|
}) {
|
|
10543
10586
|
const image = product.image_url || product.images?.[0] || "";
|
|
10587
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10544
10588
|
const tags = product.tags || [];
|
|
10545
10589
|
const isSignature = product.metadata?.is_signature === true;
|
|
10546
10590
|
const isNew = product.metadata?.is_new === true;
|
|
@@ -10567,8 +10611,8 @@ function FoodProductCard({
|
|
|
10567
10611
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mt-3", children: [
|
|
10568
10612
|
isComposite ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold", children: [
|
|
10569
10613
|
"From ",
|
|
10570
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price })
|
|
10571
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
10614
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency })
|
|
10615
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10572
10616
|
tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1", children: tags.slice(0, 2).map((tag) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-muted-foreground px-1.5 py-0.5 bg-muted rounded", children: tag }, tag)) })
|
|
10573
10617
|
] })
|
|
10574
10618
|
] })
|
|
@@ -10596,6 +10640,7 @@ function RetailProductCard({
|
|
|
10596
10640
|
className
|
|
10597
10641
|
}) {
|
|
10598
10642
|
const image = product.image_url || product.images?.[0] || "";
|
|
10643
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10599
10644
|
const outOfStock = product.inventory_status?.in_stock === false;
|
|
10600
10645
|
const onSale = chunk7Y2O3E4D_js.isOnSale(product);
|
|
10601
10646
|
const swatches = getColorSwatches(product);
|
|
@@ -10614,8 +10659,8 @@ function RetailProductCard({
|
|
|
10614
10659
|
product.vendor && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-widest", children: product.vendor }),
|
|
10615
10660
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-semibold text-foreground leading-snug tracking-tight mt-1 truncate", children: product.name }),
|
|
10616
10661
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
10617
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
10618
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" })
|
|
10662
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10663
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
10619
10664
|
] }),
|
|
10620
10665
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10621
10666
|
"span",
|
|
@@ -10630,8 +10675,7 @@ function RetailProductCard({
|
|
|
10630
10675
|
] });
|
|
10631
10676
|
}
|
|
10632
10677
|
function PriceRange({ product, currency, className }) {
|
|
10633
|
-
const
|
|
10634
|
-
const resolvedCurrency = currency ?? context?.displayCurrency ?? "USD";
|
|
10678
|
+
const resolvedCurrency = currency ?? chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10635
10679
|
const range = chunk7Y2O3E4D_js.getPriceRange(product);
|
|
10636
10680
|
if (!range) return null;
|
|
10637
10681
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunk7Y2O3E4D_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
|
|
@@ -10644,6 +10688,7 @@ function WholesaleProductCard({
|
|
|
10644
10688
|
className
|
|
10645
10689
|
}) {
|
|
10646
10690
|
const image = product.image_url || product.images?.[0] || "";
|
|
10691
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10647
10692
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
10648
10693
|
const status = product.inventory_status;
|
|
10649
10694
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -10663,7 +10708,7 @@ function WholesaleProductCard({
|
|
|
10663
10708
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3.5", children: [
|
|
10664
10709
|
product.sku && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-muted-foreground font-mono", children: product.sku }),
|
|
10665
10710
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-semibold text-foreground leading-snug tracking-tight mt-1 truncate", children: product.name }),
|
|
10666
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: hasTiers ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, className: "text-sm font-bold" }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }) }),
|
|
10711
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: hasTiers ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, className: "text-sm font-bold" }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }) }),
|
|
10667
10712
|
status && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 mt-2", children: [
|
|
10668
10713
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
10669
10714
|
"w-[7px] h-[7px] rounded-full shrink-0",
|
|
@@ -10691,6 +10736,7 @@ function DigitalProductCard({
|
|
|
10691
10736
|
className
|
|
10692
10737
|
}) {
|
|
10693
10738
|
const image = product.image_url || product.images?.[0] || "";
|
|
10739
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10694
10740
|
const typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null;
|
|
10695
10741
|
const isTicket = product.digital_type === "event_ticket";
|
|
10696
10742
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
@@ -10704,7 +10750,7 @@ function DigitalProductCard({
|
|
|
10704
10750
|
] }),
|
|
10705
10751
|
!isTicket && product.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[12px] text-muted-foreground mt-1 line-clamp-1", children: stripHtmlToText(product.description) }),
|
|
10706
10752
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mt-2.5", children: [
|
|
10707
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
10753
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10708
10754
|
product.file_type && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: [
|
|
10709
10755
|
product.file_type.toUpperCase(),
|
|
10710
10756
|
product.file_size_mb != null && ` \xB7 ${product.file_size_mb >= 1024 ? `${(product.file_size_mb / 1024).toFixed(1)}GB` : `${product.file_size_mb}MB`}`
|
|
@@ -10721,6 +10767,7 @@ function BundleProductCard({
|
|
|
10721
10767
|
className
|
|
10722
10768
|
}) {
|
|
10723
10769
|
const image = product.image_url || product.images?.[0] || "";
|
|
10770
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10724
10771
|
const components = product.components || [];
|
|
10725
10772
|
const componentCount = components.length;
|
|
10726
10773
|
const onSale = chunk7Y2O3E4D_js.isOnSale(product);
|
|
@@ -10749,9 +10796,9 @@ function BundleProductCard({
|
|
|
10749
10796
|
components.map((c) => c.product_name || c.product_id).join(", ")
|
|
10750
10797
|
] }),
|
|
10751
10798
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
10752
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
10799
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10753
10800
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10754
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" }),
|
|
10801
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
10755
10802
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
10756
10803
|
"Save ",
|
|
10757
10804
|
discount,
|
|
@@ -10771,6 +10818,7 @@ function CompositeProductCard({
|
|
|
10771
10818
|
className
|
|
10772
10819
|
}) {
|
|
10773
10820
|
const image = product.image_url || product.images?.[0] || "";
|
|
10821
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10774
10822
|
const groups = product.groups || [];
|
|
10775
10823
|
const groupCount = groups.length;
|
|
10776
10824
|
groups.reduce((sum, g) => sum + g.components.length, 0);
|
|
@@ -10798,7 +10846,7 @@ function CompositeProductCard({
|
|
|
10798
10846
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mt-2.5", children: [
|
|
10799
10847
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold", children: [
|
|
10800
10848
|
"From ",
|
|
10801
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price })
|
|
10849
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency })
|
|
10802
10850
|
] }),
|
|
10803
10851
|
tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-muted-foreground px-1.5 py-0.5 bg-muted rounded", children: tags[0] })
|
|
10804
10852
|
] })
|
|
@@ -10822,12 +10870,13 @@ function StandardServiceCard({
|
|
|
10822
10870
|
className
|
|
10823
10871
|
}) {
|
|
10824
10872
|
const image = product.image_url || product.images?.[0] || "";
|
|
10873
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10825
10874
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10826
10875
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10827
10876
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10828
10877
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
10829
10878
|
product.duration_minutes != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-3 left-3 inline-flex items-center gap-1 text-[12px] font-semibold px-2.5 py-1 rounded-lg bg-background/92 backdrop-blur-xl text-foreground shadow-sm", children: formatDuration3(product.duration_minutes, product.duration_unit) }),
|
|
10830
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price }) })
|
|
10879
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency }) })
|
|
10831
10880
|
] }),
|
|
10832
10881
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4", children: [
|
|
10833
10882
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-bold text-foreground leading-snug tracking-tight", children: product.name }),
|
|
@@ -10839,7 +10888,7 @@ function StandardServiceCard({
|
|
|
10839
10888
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10840
10889
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "\xB7" }),
|
|
10841
10890
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
10842
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount }),
|
|
10891
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency }),
|
|
10843
10892
|
" deposit"
|
|
10844
10893
|
] })
|
|
10845
10894
|
] })
|
|
@@ -10876,6 +10925,7 @@ function CompactServiceCard({
|
|
|
10876
10925
|
className
|
|
10877
10926
|
}) {
|
|
10878
10927
|
const image = product.image_url || product.images?.[0] || "";
|
|
10928
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10879
10929
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10880
10930
|
const hasBillingPlans = product.billing_plans && product.billing_plans.length > 0;
|
|
10881
10931
|
const href = `/products/${product.slug}`;
|
|
@@ -10891,14 +10941,14 @@ function CompactServiceCard({
|
|
|
10891
10941
|
"Available"
|
|
10892
10942
|
] }),
|
|
10893
10943
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10.5px] font-medium text-amber-600", children: [
|
|
10894
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount }),
|
|
10944
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency }),
|
|
10895
10945
|
" deposit"
|
|
10896
10946
|
] }),
|
|
10897
10947
|
hasBillingPlans && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center gap-0.5 text-[10.5px] font-semibold text-primary px-1.5 py-0.5 bg-primary/10 rounded", children: "Subscription" })
|
|
10898
10948
|
] })
|
|
10899
10949
|
] }),
|
|
10900
10950
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
10901
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
|
|
10951
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10902
10952
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-4 h-4 text-muted-foreground group-hover:text-primary transition-colors", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) })
|
|
10903
10953
|
] })
|
|
10904
10954
|
] });
|
|
@@ -10924,6 +10974,7 @@ function ScheduleServiceCard({
|
|
|
10924
10974
|
className
|
|
10925
10975
|
}) {
|
|
10926
10976
|
const image = product.image_url || product.images?.[0] || "";
|
|
10977
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10927
10978
|
const href = `/products/${product.slug}`;
|
|
10928
10979
|
const durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null;
|
|
10929
10980
|
const displaySlots = (slots || []).slice(0, 3);
|
|
@@ -10943,7 +10994,7 @@ function ScheduleServiceCard({
|
|
|
10943
10994
|
durationLabel,
|
|
10944
10995
|
" \xB7 "
|
|
10945
10996
|
] }),
|
|
10946
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price })
|
|
10997
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency })
|
|
10947
10998
|
] })
|
|
10948
10999
|
] }),
|
|
10949
11000
|
image && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-14 h-14 rounded-xl overflow-hidden bg-muted shrink-0", children: renderImage ? renderImage({ src: image, alt: product.name, className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: image, alt: product.name, className: "w-full h-full object-cover" }) })
|
|
@@ -10995,6 +11046,7 @@ function RentalServiceCard({
|
|
|
10995
11046
|
className
|
|
10996
11047
|
}) {
|
|
10997
11048
|
const image = product.image_url || product.images?.[0] || "";
|
|
11049
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
10998
11050
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10999
11051
|
const unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day";
|
|
11000
11052
|
const status = product.inventory_status;
|
|
@@ -11006,7 +11058,7 @@ function RentalServiceCard({
|
|
|
11006
11058
|
unit
|
|
11007
11059
|
] }),
|
|
11008
11060
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: [
|
|
11009
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price }),
|
|
11061
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency }),
|
|
11010
11062
|
"/",
|
|
11011
11063
|
unit
|
|
11012
11064
|
] }),
|
|
@@ -11028,7 +11080,7 @@ function RentalServiceCard({
|
|
|
11028
11080
|
product.min_order_quantity > 1 ? "s" : ""
|
|
11029
11081
|
] }),
|
|
11030
11082
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10.5px] font-medium text-amber-600", children: [
|
|
11031
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount }),
|
|
11083
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency }),
|
|
11032
11084
|
" deposit"
|
|
11033
11085
|
] })
|
|
11034
11086
|
] }),
|
|
@@ -11064,6 +11116,7 @@ function AccommodationCard({
|
|
|
11064
11116
|
className
|
|
11065
11117
|
}) {
|
|
11066
11118
|
const image = product.image_url || product.images?.[0] || "";
|
|
11119
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
11067
11120
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11068
11121
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
11069
11122
|
const tags = product.tags || [];
|
|
@@ -11072,7 +11125,7 @@ function AccommodationCard({
|
|
|
11072
11125
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
11073
11126
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute bottom-3 left-3 inline-flex items-center text-[12px] font-semibold px-2.5 py-1 rounded-lg bg-background/92 backdrop-blur-xl text-foreground shadow-sm", children: "Per night" }),
|
|
11074
11127
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: [
|
|
11075
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price }),
|
|
11128
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency }),
|
|
11076
11129
|
"/night"
|
|
11077
11130
|
] })
|
|
11078
11131
|
] }),
|
|
@@ -11129,6 +11182,7 @@ function LeaseServiceCard({
|
|
|
11129
11182
|
className
|
|
11130
11183
|
}) {
|
|
11131
11184
|
const image = product.image_url || product.images?.[0] || "";
|
|
11185
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
11132
11186
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
11133
11187
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
11134
11188
|
const unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo";
|
|
@@ -11142,7 +11196,7 @@ function LeaseServiceCard({
|
|
|
11142
11196
|
unit
|
|
11143
11197
|
] }),
|
|
11144
11198
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: [
|
|
11145
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price }),
|
|
11199
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency }),
|
|
11146
11200
|
"/",
|
|
11147
11201
|
unit
|
|
11148
11202
|
] })
|
|
@@ -11161,7 +11215,7 @@ function LeaseServiceCard({
|
|
|
11161
11215
|
product.min_order_quantity > 1 ? "s" : ""
|
|
11162
11216
|
] }),
|
|
11163
11217
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10.5px] font-medium text-amber-600", children: [
|
|
11164
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount }),
|
|
11218
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency }),
|
|
11165
11219
|
" deposit"
|
|
11166
11220
|
] }),
|
|
11167
11221
|
cancellationHours != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10.5px] font-medium text-muted-foreground", children: cancellationHours >= 720 ? `${Math.floor(cancellationHours / 720)} month notice` : `${cancellationHours}h notice` })
|
|
@@ -11202,6 +11256,7 @@ function SubscriptionCard({
|
|
|
11202
11256
|
className
|
|
11203
11257
|
}) {
|
|
11204
11258
|
const image = product.image_url || product.images?.[0] || "";
|
|
11259
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
11205
11260
|
const plans = product.billing_plans || [];
|
|
11206
11261
|
const primaryPlan = plans[0];
|
|
11207
11262
|
const frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo";
|
|
@@ -11211,7 +11266,7 @@ function SubscriptionCard({
|
|
|
11211
11266
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
11212
11267
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
11213
11268
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute bottom-3 right-3 text-white font-bold text-lg drop-shadow-sm", children: [
|
|
11214
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price }),
|
|
11269
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency }),
|
|
11215
11270
|
frequency
|
|
11216
11271
|
] }),
|
|
11217
11272
|
hasTrial && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute top-3 left-3 text-[11px] font-semibold tracking-wide bg-emerald-50/90 text-emerald-700 border border-emerald-200/50 backdrop-blur px-2 py-0.5 rounded-md", children: [
|
|
@@ -11240,7 +11295,7 @@ function SubscriptionCard({
|
|
|
11240
11295
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
11241
11296
|
hasTrial && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-emerald-600 font-medium", children: "Free trial" }),
|
|
11242
11297
|
primaryPlan?.setup_fee != null && primaryPlan.setup_fee > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
11243
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: primaryPlan.setup_fee }),
|
|
11298
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: primaryPlan.setup_fee, currency }),
|
|
11244
11299
|
" setup"
|
|
11245
11300
|
] })
|
|
11246
11301
|
] }),
|
|
@@ -11403,7 +11458,7 @@ function ProductCard({
|
|
|
11403
11458
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
11404
11459
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
11405
11460
|
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 }),
|
|
11406
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
11461
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunk7Y2O3E4D_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
11407
11462
|
] })
|
|
11408
11463
|
] });
|
|
11409
11464
|
})();
|
|
@@ -12746,6 +12801,7 @@ function BookingPage({
|
|
|
12746
12801
|
}) {
|
|
12747
12802
|
const { addItem } = useCart();
|
|
12748
12803
|
const { client } = useCimplifyClient();
|
|
12804
|
+
const currency = service.currency;
|
|
12749
12805
|
const isReschedule = existingBooking !== void 0;
|
|
12750
12806
|
const [step, setStep] = React14.useState(STEP.SELECT_SLOT);
|
|
12751
12807
|
const [selectedSlot, setSelectedSlot] = React14.useState(null);
|
|
@@ -12887,10 +12943,10 @@ function BookingPage({
|
|
|
12887
12943
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-service-info": true, className: classNames?.serviceInfo, children: [
|
|
12888
12944
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-name": true, children: service.name }),
|
|
12889
12945
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-duration": true, children: formatDuration2(service.duration_minutes, service.duration_unit) }),
|
|
12890
|
-
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price }) }),
|
|
12946
|
+
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
12891
12947
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
12892
12948
|
"Deposit: ",
|
|
12893
|
-
depositType === "percentage" ? `${chunk7Y2O3E4D_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount })
|
|
12949
|
+
depositType === "percentage" ? `${chunk7Y2O3E4D_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
12894
12950
|
] }),
|
|
12895
12951
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
12896
12952
|
"Free cancellation up to ",
|
|
@@ -12899,7 +12955,7 @@ function BookingPage({
|
|
|
12899
12955
|
] }),
|
|
12900
12956
|
noShowFee !== void 0 && chunk7Y2O3E4D_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
12901
12957
|
"No-show fee: ",
|
|
12902
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee })
|
|
12958
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
12903
12959
|
] })
|
|
12904
12960
|
] }),
|
|
12905
12961
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-booking-error": true, className: classNames?.error, children: error }),
|
|
@@ -12912,7 +12968,8 @@ function BookingPage({
|
|
|
12912
12968
|
participantCount,
|
|
12913
12969
|
selectedSlot,
|
|
12914
12970
|
onSlotSelect: handleSlotSelect,
|
|
12915
|
-
showPrice
|
|
12971
|
+
showPrice,
|
|
12972
|
+
currency
|
|
12916
12973
|
}
|
|
12917
12974
|
)
|
|
12918
12975
|
] }),
|
|
@@ -12970,11 +13027,11 @@ function BookingPage({
|
|
|
12970
13027
|
] }),
|
|
12971
13028
|
(selectedSlot.price || service.price) && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: classNames?.summaryRow, children: [
|
|
12972
13029
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Price" }),
|
|
12973
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: selectedSlot.price || service.price }) })
|
|
13030
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: selectedSlot.price || service.price, currency }) })
|
|
12974
13031
|
] }),
|
|
12975
13032
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
12976
13033
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
12977
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunk7Y2O3E4D_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount }) })
|
|
13034
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunk7Y2O3E4D_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
12978
13035
|
] })
|
|
12979
13036
|
] }),
|
|
12980
13037
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13638,6 +13695,7 @@ function DefaultProductLayout({
|
|
|
13638
13695
|
}) {
|
|
13639
13696
|
const [selectedVariantId, setSelectedVariantId] = React14__default.default.useState();
|
|
13640
13697
|
const images = chunkIQLJJW2H_js.resolveGallery(product, selectedVariantId);
|
|
13698
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
13641
13699
|
const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
|
|
13642
13700
|
const onSale = chunk7Y2O3E4D_js.isOnSale(product);
|
|
13643
13701
|
const hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
@@ -13659,15 +13717,15 @@ function DefaultProductLayout({
|
|
|
13659
13717
|
/* @__PURE__ */ jsxRuntime.jsx(TagPills, { tags: product.tags || [] })
|
|
13660
13718
|
] }),
|
|
13661
13719
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
13662
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, className: "text-2xl font-extrabold" }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13663
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-extrabold" }),
|
|
13664
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), className: "text-lg text-muted-foreground line-through" }),
|
|
13720
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13721
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
13722
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunk7Y2O3E4D_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
13665
13723
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
13666
13724
|
"Save ",
|
|
13667
13725
|
chunk7Y2O3E4D_js.getDiscountPercentage(product),
|
|
13668
13726
|
"%"
|
|
13669
13727
|
] })
|
|
13670
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
|
|
13728
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
13671
13729
|
/* @__PURE__ */ jsxRuntime.jsx(InventoryBadge, { product }),
|
|
13672
13730
|
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
13673
13731
|
hasPhysicalDetails && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-details": true, className: "space-y-1 text-sm text-muted-foreground", children: [
|
|
@@ -13726,6 +13784,7 @@ function FoodProductLayout({
|
|
|
13726
13784
|
className
|
|
13727
13785
|
}) {
|
|
13728
13786
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
13787
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
13729
13788
|
const tags = product.tags || [];
|
|
13730
13789
|
const ingredients = getMetadataStringList(product.metadata, "ingredients");
|
|
13731
13790
|
const pairings = getMetadataStringList(product.metadata, "pairings");
|
|
@@ -13751,7 +13810,7 @@ function FoodProductLayout({
|
|
|
13751
13810
|
] }),
|
|
13752
13811
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
13753
13812
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-bold tracking-tight", children: product.name }),
|
|
13754
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold mt-2 block" })
|
|
13813
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold mt-2 block" })
|
|
13755
13814
|
] }),
|
|
13756
13815
|
(product.calories != null || product.preparation_time_minutes != null) && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-stats": true, className: "flex flex-wrap gap-4 py-3 border-y border-border", children: [
|
|
13757
13816
|
product.preparation_time_minutes != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5 text-sm text-muted-foreground", children: [
|
|
@@ -13800,6 +13859,7 @@ function WholesaleProductLayout({
|
|
|
13800
13859
|
className
|
|
13801
13860
|
}) {
|
|
13802
13861
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
13862
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
13803
13863
|
const hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
13804
13864
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
13805
13865
|
renderBreadcrumb?.(product),
|
|
@@ -13822,7 +13882,7 @@ function WholesaleProductLayout({
|
|
|
13822
13882
|
] }),
|
|
13823
13883
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name })
|
|
13824
13884
|
] }),
|
|
13825
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: hasTiers ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, className: "text-2xl font-extrabold" }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
|
|
13885
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: hasTiers ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
13826
13886
|
/* @__PURE__ */ jsxRuntime.jsx(InventoryBadge, { product }),
|
|
13827
13887
|
product.min_order_quantity != null && product.min_order_quantity > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-moq": true, className: "flex items-center gap-3 p-3 bg-amber-50 border border-amber-200 text-sm text-amber-800", children: [
|
|
13828
13888
|
"Minimum order quantity: ",
|
|
@@ -13883,6 +13943,7 @@ function ServiceProductLayout({
|
|
|
13883
13943
|
className
|
|
13884
13944
|
}) {
|
|
13885
13945
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
13946
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
13886
13947
|
const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
13887
13948
|
const depositAmount = hasDeposit ? chunk7Y2O3E4D_js.parsePrice(product.deposit_amount) : 0;
|
|
13888
13949
|
const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
@@ -13902,12 +13963,12 @@ function ServiceProductLayout({
|
|
|
13902
13963
|
/* @__PURE__ */ jsxRuntime.jsx(TagPills, { tags: product.tags || [] }),
|
|
13903
13964
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
13904
13965
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
13905
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-bold text-primary mt-2 block" })
|
|
13966
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-bold text-primary mt-2 block" })
|
|
13906
13967
|
] }),
|
|
13907
13968
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-service-info": true, className: "flex flex-wrap gap-2", children: [
|
|
13908
13969
|
product.duration_minutes != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center gap-1.5 px-3 py-1.5 bg-muted text-sm text-muted-foreground rounded-full", children: formatDuration2(product.duration_minutes, product.duration_unit) }),
|
|
13909
13970
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 px-3 py-1.5 bg-muted text-sm text-muted-foreground rounded-full", children: [
|
|
13910
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount }),
|
|
13971
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }),
|
|
13911
13972
|
" deposit"
|
|
13912
13973
|
] }),
|
|
13913
13974
|
product.general_service_capacity != null && product.general_service_capacity > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 px-3 py-1.5 bg-muted text-sm text-muted-foreground rounded-full", children: [
|
|
@@ -13946,10 +14007,10 @@ function ServiceProductLayout({
|
|
|
13946
14007
|
] }),
|
|
13947
14008
|
product.no_show_fee && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground", children: [
|
|
13948
14009
|
"No-show fee: ",
|
|
13949
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.no_show_fee, className: "font-medium text-foreground" })
|
|
14010
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.no_show_fee, currency, className: "font-medium text-foreground" })
|
|
13950
14011
|
] }),
|
|
13951
14012
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: product.deposit_type === "fixed" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13952
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, className: "font-medium text-foreground" }),
|
|
14013
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
13953
14014
|
" deposit charged at booking"
|
|
13954
14015
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13955
14016
|
chunk7Y2O3E4D_js.parsePrice(product.deposit_amount),
|
|
@@ -13984,6 +14045,7 @@ function DigitalProductLayout({
|
|
|
13984
14045
|
className
|
|
13985
14046
|
}) {
|
|
13986
14047
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14048
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
13987
14049
|
const typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product";
|
|
13988
14050
|
const isTicket = product.digital_type === "event_ticket";
|
|
13989
14051
|
const isAccessPass = product.digital_type === "access_pass";
|
|
@@ -14007,7 +14069,7 @@ function DigitalProductLayout({
|
|
|
14007
14069
|
] }),
|
|
14008
14070
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
14009
14071
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
|
|
14010
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-bold mt-2 block" })
|
|
14072
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-bold mt-2 block" })
|
|
14011
14073
|
] }),
|
|
14012
14074
|
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
14013
14075
|
isDownload && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout-delivery": true, className: "flex items-center gap-3 px-4 py-3 bg-muted rounded-lg", children: [
|
|
@@ -14110,6 +14172,7 @@ function BundleProductLayout({
|
|
|
14110
14172
|
className
|
|
14111
14173
|
}) {
|
|
14112
14174
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14175
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
14113
14176
|
const components = product.components || [];
|
|
14114
14177
|
const onSale = chunk7Y2O3E4D_js.isOnSale(product);
|
|
14115
14178
|
const discount = chunk7Y2O3E4D_js.getDiscountPercentage(product);
|
|
@@ -14144,8 +14207,8 @@ function BundleProductLayout({
|
|
|
14144
14207
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
14145
14208
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-bold tracking-tight", children: product.name }),
|
|
14146
14209
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-3 mt-2", children: [
|
|
14147
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-bold" }),
|
|
14148
|
-
onSale && baseTotal > 0 && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: baseTotal, className: "text-lg text-muted-foreground line-through" })
|
|
14210
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-bold" }),
|
|
14211
|
+
onSale && baseTotal > 0 && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: baseTotal, currency, className: "text-lg text-muted-foreground line-through" })
|
|
14149
14212
|
] })
|
|
14150
14213
|
] }),
|
|
14151
14214
|
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|
|
@@ -14161,13 +14224,13 @@ function BundleProductLayout({
|
|
|
14161
14224
|
] }),
|
|
14162
14225
|
component.allow_variant_choice && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-violet-600 font-medium", children: "Choose variant" })
|
|
14163
14226
|
] }),
|
|
14164
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: component.effective_price ?? 0, className: "text-sm text-muted-foreground shrink-0" })
|
|
14227
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: component.effective_price ?? 0, currency, className: "text-sm text-muted-foreground shrink-0" })
|
|
14165
14228
|
] }, component.id)) })
|
|
14166
14229
|
] }),
|
|
14167
14230
|
savings > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-bundle-savings": true, className: "flex items-center gap-2 p-3 bg-emerald-50 border border-emerald-200/60 text-sm text-emerald-800", children: [
|
|
14168
14231
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }),
|
|
14169
14232
|
"You save ",
|
|
14170
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: savings, className: "font-semibold" }),
|
|
14233
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: savings, currency, className: "font-semibold" }),
|
|
14171
14234
|
" with this bundle"
|
|
14172
14235
|
] }),
|
|
14173
14236
|
/* @__PURE__ */ jsxRuntime.jsx(CustomAttributesTable, { attributes: product.custom_attributes || [] }),
|
|
@@ -14193,6 +14256,7 @@ function CompositeProductLayout({
|
|
|
14193
14256
|
className
|
|
14194
14257
|
}) {
|
|
14195
14258
|
const images = product.images || (product.image_url ? [product.image_url] : []);
|
|
14259
|
+
const currency = chunk7Y2O3E4D_js.getProductCurrency(product);
|
|
14196
14260
|
const groups = product.groups || [];
|
|
14197
14261
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
14198
14262
|
renderBreadcrumb?.(product),
|
|
@@ -14220,7 +14284,7 @@ function CompositeProductLayout({
|
|
|
14220
14284
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-bold tracking-tight", children: product.name }),
|
|
14221
14285
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-lg text-muted-foreground mt-2", children: [
|
|
14222
14286
|
"From ",
|
|
14223
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "font-semibold text-foreground" })
|
|
14287
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "font-semibold text-foreground" })
|
|
14224
14288
|
] })
|
|
14225
14289
|
] }),
|
|
14226
14290
|
/* @__PURE__ */ jsxRuntime.jsx(RichText, { html: product.description, "data-cimplify-product-layout-description": true }),
|