@cimplify/sdk 0.44.16 → 0.44.19

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.
Files changed (42) hide show
  1. package/dist/advanced.js +22 -21
  2. package/dist/advanced.mjs +3 -2
  3. package/dist/{chunk-MBGQP6FZ.js → chunk-3FS3ZDKX.js} +60 -60
  4. package/dist/{chunk-UXLQ7WXI.mjs → chunk-5OK3YDZC.mjs} +2 -2
  5. package/dist/{chunk-MNIKXG7W.js → chunk-BN2CXGMO.js} +5 -272
  6. package/dist/chunk-GLOO4HUN.mjs +676 -0
  7. package/dist/{chunk-CFD4J32N.js → chunk-HBRCVJL4.js} +22 -21
  8. package/dist/{chunk-ZLEFMQC6.mjs → chunk-KSKZAXG2.mjs} +4 -498
  9. package/dist/{chunk-6AZZ6AOF.mjs → chunk-NRT6PVW5.mjs} +4 -251
  10. package/dist/{chunk-XL4CX75J.js → chunk-PGSM3NQ2.js} +237 -781
  11. package/dist/chunk-Q4I7JRGO.js +733 -0
  12. package/dist/chunk-QBQCMQ4F.js +271 -0
  13. package/dist/chunk-XPXAZXF2.mjs +250 -0
  14. package/dist/{chunk-7NML226B.mjs → chunk-XZPO5GEM.mjs} +2 -1
  15. package/dist/client-B_Ei3ENB.d.mts +86 -0
  16. package/dist/client-Bep2FooI.d.ts +86 -0
  17. package/dist/index.js +145 -144
  18. package/dist/index.mjs +4 -3
  19. package/dist/mock/cli.mjs +2 -0
  20. package/dist/mock/library.js +2 -0
  21. package/dist/mock/library.mjs +2 -0
  22. package/dist/mock/msw.js +2 -0
  23. package/dist/mock/msw.mjs +2 -0
  24. package/dist/react.js +81 -80
  25. package/dist/react.mjs +4 -3
  26. package/dist/server.js +6 -5
  27. package/dist/server.mjs +4 -3
  28. package/dist/testing/msw.d.mts +17 -0
  29. package/dist/testing/msw.d.ts +17 -0
  30. package/dist/testing/msw.js +42 -0
  31. package/dist/testing/msw.mjs +40 -0
  32. package/dist/testing/suite.d.mts +25 -0
  33. package/dist/testing/suite.d.ts +25 -0
  34. package/dist/testing/suite.js +28 -23
  35. package/dist/testing/suite.mjs +9 -4
  36. package/dist/testing.d.mts +963 -135
  37. package/dist/testing.d.ts +963 -135
  38. package/dist/testing.js +123 -59
  39. package/dist/testing.mjs +51 -4
  40. package/dist/utils.js +29 -28
  41. package/dist/utils.mjs +2 -1
  42. package/package.json +11 -2
package/dist/mock/cli.mjs CHANGED
@@ -4978,7 +4978,9 @@ function toUICart(registry, cart) {
4978
4978
  id: variant.id,
4979
4979
  name: variantName,
4980
4980
  sku: variant.sku,
4981
+ price: i.price,
4981
4982
  price_adjustment: variant.price_adjustment,
4983
+ is_default: variant.is_default ?? false,
4982
4984
  display_attributes: variantDisplayAttributes,
4983
4985
  images: variant.images
4984
4986
  } : void 0,
@@ -4346,7 +4346,9 @@ function toUICart(registry, cart) {
4346
4346
  id: variant.id,
4347
4347
  name: variantName,
4348
4348
  sku: variant.sku,
4349
+ price: i.price,
4349
4350
  price_adjustment: variant.price_adjustment,
4351
+ is_default: variant.is_default ?? false,
4350
4352
  display_attributes: variantDisplayAttributes,
4351
4353
  images: variant.images
4352
4354
  } : void 0,
@@ -4344,7 +4344,9 @@ function toUICart(registry, cart) {
4344
4344
  id: variant.id,
4345
4345
  name: variantName,
4346
4346
  sku: variant.sku,
4347
+ price: i.price,
4347
4348
  price_adjustment: variant.price_adjustment,
4349
+ is_default: variant.is_default ?? false,
4348
4350
  display_attributes: variantDisplayAttributes,
4349
4351
  images: variant.images
4350
4352
  } : void 0,
package/dist/mock/msw.js CHANGED
@@ -4344,7 +4344,9 @@ function toUICart(registry, cart) {
4344
4344
  id: variant.id,
4345
4345
  name: variantName,
4346
4346
  sku: variant.sku,
4347
+ price: i.price,
4347
4348
  price_adjustment: variant.price_adjustment,
4349
+ is_default: variant.is_default ?? false,
4348
4350
  display_attributes: variantDisplayAttributes,
4349
4351
  images: variant.images
4350
4352
  } : void 0,
package/dist/mock/msw.mjs CHANGED
@@ -4342,7 +4342,9 @@ function toUICart(registry, cart) {
4342
4342
  id: variant.id,
4343
4343
  name: variantName,
4344
4344
  sku: variant.sku,
4345
+ price: i.price,
4345
4346
  price_adjustment: variant.price_adjustment,
4347
+ is_default: variant.is_default ?? false,
4346
4348
  display_attributes: variantDisplayAttributes,
4347
4349
  images: variant.images
4348
4350
  } : void 0,
package/dist/react.js CHANGED
@@ -2,9 +2,10 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkBGCEKFLA_js = require('./chunk-BGCEKFLA.js');
5
- var chunkMBGQP6FZ_js = require('./chunk-MBGQP6FZ.js');
6
- var chunkCFD4J32N_js = require('./chunk-CFD4J32N.js');
7
- var chunkMNIKXG7W_js = require('./chunk-MNIKXG7W.js');
5
+ var chunk3FS3ZDKX_js = require('./chunk-3FS3ZDKX.js');
6
+ var chunkHBRCVJL4_js = require('./chunk-HBRCVJL4.js');
7
+ var chunkBN2CXGMO_js = require('./chunk-BN2CXGMO.js');
8
+ var chunkQBQCMQ4F_js = require('./chunk-QBQCMQ4F.js');
8
9
  var React10 = require('react');
9
10
  var jsxRuntime = require('react/jsx-runtime');
10
11
  var clsx = require('clsx');
@@ -568,12 +569,12 @@ function attachInternalItemMetadata(item) {
568
569
  return { ...item, _lineKey: lineKeyFromItem(item) };
569
570
  }
570
571
  function calculateLineSubtotal(item) {
571
- let unitPrice = chunkMNIKXG7W_js.parsePrice(item.product.default_price);
572
+ let unitPrice = chunkBN2CXGMO_js.parsePrice(item.product.default_price);
572
573
  if (item.variant?.price_adjustment) {
573
- unitPrice += chunkMNIKXG7W_js.parsePrice(item.variant.price_adjustment);
574
+ unitPrice += chunkBN2CXGMO_js.parsePrice(item.variant.price_adjustment);
574
575
  }
575
576
  for (const option of item.addOnOptions || []) {
576
- if (option.default_price) unitPrice += chunkMNIKXG7W_js.parsePrice(option.default_price);
577
+ if (option.default_price) unitPrice += chunkBN2CXGMO_js.parsePrice(option.default_price);
577
578
  }
578
579
  return roundMoney(unitPrice * item.quantity);
579
580
  }
@@ -1152,7 +1153,7 @@ var DEFAULT_COUNTRY = "US";
1152
1153
  function createDefaultClient() {
1153
1154
  const processRef = globalThis.process;
1154
1155
  const envPublicKey = processRef?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
1155
- return chunkMBGQP6FZ_js.createCimplifyClient({ publicKey: envPublicKey });
1156
+ return chunk3FS3ZDKX_js.createCimplifyClient({ publicKey: envPublicKey });
1156
1157
  }
1157
1158
  function getStoredLocationId() {
1158
1159
  if (typeof window === "undefined" || !window.localStorage) {
@@ -1236,7 +1237,7 @@ function CimplifyProvider({
1236
1237
  const setDisplayCurrency = React10.useCallback(
1237
1238
  (currency) => {
1238
1239
  const normalized = currency?.trim().toUpperCase() || null;
1239
- if (normalized && !chunkMNIKXG7W_js.isSupportedCurrency(normalized)) {
1240
+ if (normalized && !chunkQBQCMQ4F_js.isSupportedCurrency(normalized)) {
1240
1241
  return;
1241
1242
  }
1242
1243
  setDisplayCurrencyOverride(normalized);
@@ -1898,7 +1899,7 @@ function Price({ amount, currency, className, prefix }) {
1898
1899
  const resolvedAmount = typeof convertedAmount === "string" ? parseFloat(convertedAmount) || 0 : convertedAmount;
1899
1900
  return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
1900
1901
  prefix,
1901
- chunkMNIKXG7W_js.formatPrice(resolvedAmount, resolvedCurrency)
1902
+ chunkBN2CXGMO_js.formatPrice(resolvedAmount, resolvedCurrency)
1902
1903
  ] });
1903
1904
  }
1904
1905
  function createCachedQuery(config) {
@@ -2905,16 +2906,16 @@ function useProductPrice(input) {
2905
2906
  if (bundleTotalPrice != null) {
2906
2907
  unitPrice = bundleTotalPrice;
2907
2908
  } else if (compositePrice) {
2908
- unitPrice = chunkMNIKXG7W_js.parsePrice(compositePrice.final_price);
2909
+ unitPrice = chunkBN2CXGMO_js.parsePrice(compositePrice.final_price);
2909
2910
  } else {
2910
- unitPrice = chunkMNIKXG7W_js.parsePrice(product.default_price);
2911
+ unitPrice = chunkBN2CXGMO_js.parsePrice(product.default_price);
2911
2912
  if (variant?.price_adjustment) {
2912
- unitPrice += chunkMNIKXG7W_js.parsePrice(variant.price_adjustment);
2913
+ unitPrice += chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
2913
2914
  }
2914
2915
  if (addOnOptions) {
2915
2916
  for (const option of addOnOptions) {
2916
2917
  if (option.default_price) {
2917
- unitPrice += chunkMNIKXG7W_js.parsePrice(option.default_price);
2918
+ unitPrice += chunkBN2CXGMO_js.parsePrice(option.default_price);
2918
2919
  }
2919
2920
  }
2920
2921
  }
@@ -3658,19 +3659,19 @@ function AuthElement({
3658
3659
  }, [onReady, onAuthenticated, onRequiresOtp, onError]);
3659
3660
  React10.useEffect(() => {
3660
3661
  if (!elements || !containerRef.current) return;
3661
- const element = elements.create(chunkCFD4J32N_js.ELEMENT_TYPES.AUTH, { prefillEmail });
3662
+ const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.AUTH, { prefillEmail });
3662
3663
  elementRef.current = element;
3663
- element.on(chunkCFD4J32N_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3664
+ element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3664
3665
  element.on(
3665
- chunkCFD4J32N_js.EVENT_TYPES.AUTHENTICATED,
3666
+ chunkHBRCVJL4_js.EVENT_TYPES.AUTHENTICATED,
3666
3667
  (data) => onAuthenticatedRef.current?.(data)
3667
3668
  );
3668
3669
  element.on(
3669
- chunkCFD4J32N_js.EVENT_TYPES.REQUIRES_OTP,
3670
+ chunkHBRCVJL4_js.EVENT_TYPES.REQUIRES_OTP,
3670
3671
  (data) => onRequiresOtpRef.current?.(data)
3671
3672
  );
3672
3673
  element.on(
3673
- chunkCFD4J32N_js.EVENT_TYPES.ERROR,
3674
+ chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
3674
3675
  (data) => onErrorRef.current?.(data)
3675
3676
  );
3676
3677
  element.mount(containerRef.current);
@@ -3699,15 +3700,15 @@ function AddressElement({
3699
3700
  }, [onReady, onChange, onError]);
3700
3701
  React10.useEffect(() => {
3701
3702
  if (!elements || !containerRef.current) return;
3702
- const element = elements.create(chunkCFD4J32N_js.ELEMENT_TYPES.ADDRESS, { mode });
3703
+ const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.ADDRESS, { mode });
3703
3704
  elementRef.current = element;
3704
- element.on(chunkCFD4J32N_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3705
+ element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3705
3706
  element.on(
3706
- chunkCFD4J32N_js.EVENT_TYPES.CHANGE,
3707
+ chunkHBRCVJL4_js.EVENT_TYPES.CHANGE,
3707
3708
  (data) => onChangeRef.current?.(data)
3708
3709
  );
3709
3710
  element.on(
3710
- chunkCFD4J32N_js.EVENT_TYPES.ERROR,
3711
+ chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
3711
3712
  (data) => onErrorRef.current?.(data)
3712
3713
  );
3713
3714
  element.mount(containerRef.current);
@@ -3737,15 +3738,15 @@ function PaymentElement({
3737
3738
  }, [onReady, onChange, onError]);
3738
3739
  React10.useEffect(() => {
3739
3740
  if (!elements || !containerRef.current) return;
3740
- const element = elements.create(chunkCFD4J32N_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
3741
+ const element = elements.create(chunkHBRCVJL4_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
3741
3742
  elementRef.current = element;
3742
- element.on(chunkCFD4J32N_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3743
+ element.on(chunkHBRCVJL4_js.EVENT_TYPES.READY, () => onReadyRef.current?.());
3743
3744
  element.on(
3744
- chunkCFD4J32N_js.EVENT_TYPES.CHANGE,
3745
+ chunkHBRCVJL4_js.EVENT_TYPES.CHANGE,
3745
3746
  (data) => onChangeRef.current?.(data)
3746
3747
  );
3747
3748
  element.on(
3748
- chunkCFD4J32N_js.EVENT_TYPES.ERROR,
3749
+ chunkHBRCVJL4_js.EVENT_TYPES.ERROR,
3749
3750
  (data) => onErrorRef.current?.(data)
3750
3751
  );
3751
3752
  element.mount(containerRef.current);
@@ -3901,7 +3902,7 @@ function VariantSelector({
3901
3902
  if (!variants || variants.length <= 1) {
3902
3903
  return null;
3903
3904
  }
3904
- basePrice != null ? chunkMNIKXG7W_js.parsePrice(basePrice) : 0;
3905
+ basePrice != null ? chunkBN2CXGMO_js.parsePrice(basePrice) : 0;
3905
3906
  if (variantAxes && variantAxes.length > 0) {
3906
3907
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
3907
3908
  const labelId = `${idPrefix}-axis-${axis.id}`;
@@ -3977,7 +3978,7 @@ function VariantSelector({
3977
3978
  className: cn("divide-y divide-border", classNames?.list),
3978
3979
  children: variants.map((variant) => {
3979
3980
  const isSelected = selectedVariantId === variant.id;
3980
- const adjustment = chunkMNIKXG7W_js.parsePrice(variant.price_adjustment);
3981
+ const adjustment = chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
3981
3982
  return /* @__PURE__ */ jsxRuntime.jsxs(
3982
3983
  radio.Radio.Root,
3983
3984
  {
@@ -4243,16 +4244,16 @@ function BundleSelector({
4243
4244
  }, [components, selections, onReady]);
4244
4245
  const totalPrice = React10.useMemo(() => {
4245
4246
  if (pricingType === "fixed" && bundlePrice) {
4246
- return chunkMNIKXG7W_js.parsePrice(bundlePrice);
4247
+ return chunkBN2CXGMO_js.parsePrice(bundlePrice);
4247
4248
  }
4248
4249
  const componentsTotal = components.reduce((sum, comp) => {
4249
4250
  return sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity;
4250
4251
  }, 0);
4251
4252
  if (pricingType === "percentage_discount" && discountValue) {
4252
- return componentsTotal * (1 - chunkMNIKXG7W_js.parsePrice(discountValue) / 100);
4253
+ return componentsTotal * (1 - chunkBN2CXGMO_js.parsePrice(discountValue) / 100);
4253
4254
  }
4254
4255
  if (pricingType === "fixed_discount" && discountValue) {
4255
- return componentsTotal - chunkMNIKXG7W_js.parsePrice(discountValue);
4256
+ return componentsTotal - chunkBN2CXGMO_js.parsePrice(discountValue);
4256
4257
  }
4257
4258
  return componentsTotal;
4258
4259
  }, [components, variantChoices, pricingType, bundlePrice, discountValue]);
@@ -4313,15 +4314,15 @@ function BundleSelector({
4313
4314
  }
4314
4315
  function getComponentPrice(component, selectedVariantId) {
4315
4316
  if (!selectedVariantId || component.available_variants.length === 0) {
4316
- return chunkMNIKXG7W_js.parsePrice(component.effective_price);
4317
+ return chunkBN2CXGMO_js.parsePrice(component.effective_price);
4317
4318
  }
4318
4319
  if (selectedVariantId === component.variant_id) {
4319
- return chunkMNIKXG7W_js.parsePrice(component.effective_price);
4320
+ return chunkBN2CXGMO_js.parsePrice(component.effective_price);
4320
4321
  }
4321
4322
  const bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0;
4322
4323
  const selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
4323
- if (!selectedAdj) return chunkMNIKXG7W_js.parsePrice(component.effective_price);
4324
- return chunkMNIKXG7W_js.parsePrice(component.effective_price) - chunkMNIKXG7W_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkMNIKXG7W_js.parsePrice(selectedAdj.price_adjustment);
4324
+ if (!selectedAdj) return chunkBN2CXGMO_js.parsePrice(component.effective_price);
4325
+ return chunkBN2CXGMO_js.parsePrice(component.effective_price) - chunkBN2CXGMO_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkBN2CXGMO_js.parsePrice(selectedAdj.price_adjustment);
4325
4326
  }
4326
4327
  function formatDuration(minutes, unit) {
4327
4328
  if (unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0) {
@@ -4434,7 +4435,7 @@ function BundleComponentCard({
4434
4435
  className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
4435
4436
  children: component.available_variants.map((variant) => {
4436
4437
  const isSelected = selectedVariantId === variant.id;
4437
- const adjustment = chunkMNIKXG7W_js.parsePrice(variant.price_adjustment);
4438
+ const adjustment = chunkBN2CXGMO_js.parsePrice(variant.price_adjustment);
4438
4439
  return /* @__PURE__ */ jsxRuntime.jsxs(
4439
4440
  radio.Radio.Root,
4440
4441
  {
@@ -4880,7 +4881,7 @@ function CompositeSelector({
4880
4881
  "data-cimplify-composite-summary": true,
4881
4882
  className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
4882
4883
  children: [
4883
- chunkMNIKXG7W_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
4884
+ chunkBN2CXGMO_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
4884
4885
  "div",
4885
4886
  {
4886
4887
  "data-cimplify-composite-summary-line": true,
@@ -4891,7 +4892,7 @@ function CompositeSelector({
4891
4892
  ]
4892
4893
  }
4893
4894
  ),
4894
- chunkMNIKXG7W_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
4895
+ chunkBN2CXGMO_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
4895
4896
  "div",
4896
4897
  {
4897
4898
  "data-cimplify-composite-summary-line": true,
@@ -5187,7 +5188,7 @@ function InputField({
5187
5188
  onFileUpload,
5188
5189
  classNames
5189
5190
  }) {
5190
- const hasPriceAdjustment = field.price_adjustment != null && chunkMNIKXG7W_js.parsePrice(field.price_adjustment) > 0;
5191
+ const hasPriceAdjustment = field.price_adjustment != null && chunkBN2CXGMO_js.parsePrice(field.price_adjustment) > 0;
5191
5192
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
5192
5193
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
5193
5194
  /* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
@@ -6081,18 +6082,18 @@ function ProductCustomizer({
6081
6082
  }, [selectedAddOnOptionIds]);
6082
6083
  const localTotalPrice = React10.useMemo(() => {
6083
6084
  if (isComposite && compositePrice) {
6084
- return chunkMNIKXG7W_js.parsePrice(compositePrice.final_price) * quantity;
6085
+ return chunkBN2CXGMO_js.parsePrice(compositePrice.final_price) * quantity;
6085
6086
  }
6086
6087
  if (isBundle && bundleTotalPrice != null) {
6087
6088
  return bundleTotalPrice * quantity;
6088
6089
  }
6089
- let price = chunkMNIKXG7W_js.parsePrice(product.default_price);
6090
+ let price = chunkBN2CXGMO_js.parsePrice(product.default_price);
6090
6091
  if (selectedVariant?.price_adjustment) {
6091
- price += chunkMNIKXG7W_js.parsePrice(selectedVariant.price_adjustment);
6092
+ price += chunkBN2CXGMO_js.parsePrice(selectedVariant.price_adjustment);
6092
6093
  }
6093
6094
  for (const option of selectedAddOnOptions) {
6094
6095
  if (option.default_price) {
6095
- price += chunkMNIKXG7W_js.parsePrice(option.default_price);
6096
+ price += chunkBN2CXGMO_js.parsePrice(option.default_price);
6096
6097
  }
6097
6098
  }
6098
6099
  return price * quantity;
@@ -6141,7 +6142,7 @@ function ProductCustomizer({
6141
6142
  const priceInfo = quote.quoted_total_price_info ?? quote.final_price_info;
6142
6143
  const perUnit = priceInfo.pre_tax_price;
6143
6144
  if (perUnit === void 0 || perUnit === null) return void 0;
6144
- return chunkMNIKXG7W_js.parsePrice(perUnit) * quantity;
6145
+ return chunkBN2CXGMO_js.parsePrice(perUnit) * quantity;
6145
6146
  }, [quote, quantity]);
6146
6147
  const displayTotalPrice = quotedTotalPrice ?? localTotalPrice;
6147
6148
  const handleVariantChange = React10.useCallback(
@@ -6263,7 +6264,7 @@ function ProductCustomizer({
6263
6264
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount })
6264
6265
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
6265
6266
  "Deposit required: ",
6266
- chunkMNIKXG7W_js.parsePrice(product.deposit_amount),
6267
+ chunkBN2CXGMO_js.parsePrice(product.deposit_amount),
6267
6268
  "%"
6268
6269
  ] }) }),
6269
6270
  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(
@@ -6324,7 +6325,7 @@ function ProductCustomizer({
6324
6325
  ] })
6325
6326
  ] }),
6326
6327
  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: [
6327
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkMNIKXG7W_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunkMNIKXG7W_js.parsePrice(product.default_price)), className: "font-medium text-foreground" }),
6328
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getUnitPriceAtQuantity(product.quantity_pricing, quantity, chunkBN2CXGMO_js.parsePrice(product.default_price)), className: "font-medium text-foreground" }),
6328
6329
  " ea."
6329
6330
  ] }),
6330
6331
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -6448,7 +6449,7 @@ function CartLineItemRow({
6448
6449
  const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;
6449
6450
  const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;
6450
6451
  const isOptimistic = item.isOptimistic === true;
6451
- const lineTotal = chunkMNIKXG7W_js.parsePrice(unitPrice) * item.quantity;
6452
+ const lineTotal = chunkBN2CXGMO_js.parsePrice(unitPrice) * item.quantity;
6452
6453
  const imageUrl = item.product.image_url;
6453
6454
  const variantLabel = item.variant ? chunkBGCEKFLA_js.getVariantDisplayName(item.variant, item.product.name) : null;
6454
6455
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -6681,15 +6682,15 @@ function CartSummary({
6681
6682
  ] }),
6682
6683
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: subtotal, className: "tabular-nums" })
6683
6684
  ] }),
6684
- totalDiscounts != null && chunkMNIKXG7W_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
6685
+ totalDiscounts != null && chunkBN2CXGMO_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-discount": true, className: cn("flex items-baseline justify-between", classNames?.discount), children: [
6685
6686
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Discount" }),
6686
6687
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: totalDiscounts, prefix: "-", className: "tabular-nums text-primary" })
6687
6688
  ] }),
6688
6689
  deliveryFee != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-delivery-fee": true, className: cn("flex items-baseline justify-between", classNames?.deliveryFee), children: [
6689
6690
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
6690
- chunkMNIKXG7W_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
6691
+ chunkBN2CXGMO_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: deliveryFee, className: "tabular-nums" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-primary", children: "Free" })
6691
6692
  ] }),
6692
- serviceCharge != null && chunkMNIKXG7W_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
6693
+ serviceCharge != null && chunkBN2CXGMO_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-cart-service-charge": true, className: cn("flex items-baseline justify-between", classNames?.serviceCharge), children: [
6693
6694
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Service charge" }),
6694
6695
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: serviceCharge, className: "tabular-nums" })
6695
6696
  ] }),
@@ -6779,16 +6780,16 @@ function SaleBadge({
6779
6780
  className,
6780
6781
  classNames
6781
6782
  }) {
6782
- const onSale = chunkMNIKXG7W_js.isOnSale(product);
6783
+ const onSale = chunkBN2CXGMO_js.isOnSale(product);
6783
6784
  const hasDeal = dealInfo !== void 0;
6784
6785
  if (!hasDeal && !onSale && !label) {
6785
6786
  return null;
6786
6787
  }
6787
6788
  let percentage = null;
6788
6789
  if (hasDeal && dealInfo.benefit_type === "percentage") {
6789
- percentage = chunkMNIKXG7W_js.parsePrice(dealInfo.value);
6790
+ percentage = chunkBN2CXGMO_js.parsePrice(dealInfo.value);
6790
6791
  } else if (onSale) {
6791
- percentage = chunkMNIKXG7W_js.getDiscountPercentage(product);
6792
+ percentage = chunkBN2CXGMO_js.getDiscountPercentage(product);
6792
6793
  }
6793
6794
  const badgeText = label ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
6794
6795
  if (!badgeText) {
@@ -6807,7 +6808,7 @@ function SaleBadge({
6807
6808
  "%"
6808
6809
  ] }),
6809
6810
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
6810
- showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkMNIKXG7W_js.getBasePrice(product) }) })
6811
+ showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product) }) })
6811
6812
  ]
6812
6813
  }
6813
6814
  );
@@ -7060,8 +7061,8 @@ function SoldOutOverlay() {
7060
7061
  );
7061
7062
  }
7062
7063
  function SaleBadge2({ product }) {
7063
- if (!chunkMNIKXG7W_js.isOnSale(product)) return null;
7064
- const pct = chunkMNIKXG7W_js.getDiscountPercentage(product);
7064
+ if (!chunkBN2CXGMO_js.isOnSale(product)) return null;
7065
+ const pct = chunkBN2CXGMO_js.getDiscountPercentage(product);
7065
7066
  if (!pct || pct <= 0) return null;
7066
7067
  return /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-card-sale-badge": true, className: "inline-flex items-center text-[11px] font-semibold tracking-wide bg-destructive text-destructive-foreground px-2 py-0.5 rounded-md", children: [
7067
7068
  "-",
@@ -7154,7 +7155,7 @@ function RetailProductCard({
7154
7155
  }) {
7155
7156
  const image = product.image_url || product.images?.[0] || "";
7156
7157
  const outOfStock = product.inventory_status?.in_stock === false;
7157
- const onSale = chunkMNIKXG7W_js.isOnSale(product);
7158
+ const onSale = chunkBN2CXGMO_js.isOnSale(product);
7158
7159
  const swatches = getColorSwatches(product);
7159
7160
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
7160
7161
  outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
@@ -7172,7 +7173,7 @@ function RetailProductCard({
7172
7173
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14.5px] font-semibold text-foreground leading-snug tracking-tight mt-1 truncate", children: product.name }),
7173
7174
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2", children: [
7174
7175
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
7175
- onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkMNIKXG7W_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" })
7176
+ onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" })
7176
7177
  ] }),
7177
7178
  swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
7178
7179
  "span",
@@ -7189,9 +7190,9 @@ function RetailProductCard({
7189
7190
  function PriceRange({ product, currency, className }) {
7190
7191
  const context = useOptionalCimplify();
7191
7192
  const resolvedCurrency = currency ?? context?.displayCurrency ?? "USD";
7192
- const range = chunkMNIKXG7W_js.getPriceRange(product);
7193
+ const range = chunkBN2CXGMO_js.getPriceRange(product);
7193
7194
  if (!range) return null;
7194
- return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkMNIKXG7W_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
7195
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkBN2CXGMO_js.formatPriceRange(range.min, range.max, resolvedCurrency) });
7195
7196
  }
7196
7197
  function WholesaleProductCard({
7197
7198
  product,
@@ -7280,8 +7281,8 @@ function BundleProductCard({
7280
7281
  const image = product.image_url || product.images?.[0] || "";
7281
7282
  const components = product.components || [];
7282
7283
  const componentCount = components.length;
7283
- const onSale = chunkMNIKXG7W_js.isOnSale(product);
7284
- const discount = chunkMNIKXG7W_js.getDiscountPercentage(product);
7284
+ const onSale = chunkBN2CXGMO_js.isOnSale(product);
7285
+ const discount = chunkBN2CXGMO_js.getDiscountPercentage(product);
7285
7286
  const hasVariantChoice = components.some((c) => c.allow_variant_choice);
7286
7287
  return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
7287
7288
  /* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
@@ -7308,7 +7309,7 @@ function BundleProductCard({
7308
7309
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
7309
7310
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-sm font-bold" }),
7310
7311
  onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7311
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkMNIKXG7W_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" }),
7312
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-xs text-muted-foreground line-through" }),
7312
7313
  discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
7313
7314
  "Save ",
7314
7315
  discount,
@@ -8220,7 +8221,7 @@ function SearchInput({
8220
8221
  }
8221
8222
  ),
8222
8223
  /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-name": true, className: classNames?.resultName, style: { flex: 1, textAlign: "left" }, children: product.name }),
8223
- product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkMNIKXG7W_js.formatPrice(product.default_price) })
8224
+ product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-search-result-price": true, className: classNames?.resultPrice, style: { flexShrink: 0 }, children: chunkBN2CXGMO_js.formatPrice(product.default_price) })
8224
8225
  ] })
8225
8226
  },
8226
8227
  product.id
@@ -8714,19 +8715,19 @@ function OrderSummary({
8714
8715
  order.customer_notes.map((note, index) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index))
8715
8716
  ] }),
8716
8717
  /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
8717
- order.total_discount != null && chunkMNIKXG7W_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
8718
+ order.total_discount != null && chunkBN2CXGMO_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
8718
8719
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
8719
8720
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
8720
8721
  ] }),
8721
- order.delivery_fee != null && chunkMNIKXG7W_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
8722
+ order.delivery_fee != null && chunkBN2CXGMO_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
8722
8723
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
8723
8724
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
8724
8725
  ] }),
8725
- order.service_charge != null && chunkMNIKXG7W_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
8726
+ order.service_charge != null && chunkBN2CXGMO_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
8726
8727
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
8727
8728
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
8728
8729
  ] }),
8729
- order.tax != null && chunkMNIKXG7W_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
8730
+ order.tax != null && chunkBN2CXGMO_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
8730
8731
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
8731
8732
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
8732
8733
  ] }),
@@ -10015,7 +10016,7 @@ function DefaultProductLayout({
10015
10016
  }) {
10016
10017
  const images = product.images || (product.image_url ? [product.image_url] : []);
10017
10018
  const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
10018
- const onSale = chunkMNIKXG7W_js.isOnSale(product);
10019
+ const onSale = chunkBN2CXGMO_js.isOnSale(product);
10019
10020
  const hasPhysicalDetails = product.sku || product.vendor || product.material;
10020
10021
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
10021
10022
  renderBreadcrumb?.(product),
@@ -10037,10 +10038,10 @@ function DefaultProductLayout({
10037
10038
  /* @__PURE__ */ jsxRuntime.jsx("h1", { "data-cimplify-product-layout-name": true, className: "text-3xl lg:text-4xl font-extrabold tracking-tight", children: product.name }),
10038
10039
  /* @__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: [
10039
10040
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-extrabold" }),
10040
- /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkMNIKXG7W_js.getBasePrice(product), className: "text-lg text-muted-foreground line-through" }),
10041
+ /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkBN2CXGMO_js.getBasePrice(product), className: "text-lg text-muted-foreground line-through" }),
10041
10042
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
10042
10043
  "Save ",
10043
- chunkMNIKXG7W_js.getDiscountPercentage(product),
10044
+ chunkBN2CXGMO_js.getDiscountPercentage(product),
10044
10045
  "%"
10045
10046
  ] })
10046
10047
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, className: "text-2xl font-semibold" }) }),
@@ -10259,7 +10260,7 @@ function ServiceProductLayout({
10259
10260
  }) {
10260
10261
  const images = product.images || (product.image_url ? [product.image_url] : []);
10261
10262
  const hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
10262
- const depositAmount = hasDeposit ? chunkMNIKXG7W_js.parsePrice(product.deposit_amount) : 0;
10263
+ const depositAmount = hasDeposit ? chunkBN2CXGMO_js.parsePrice(product.deposit_amount) : 0;
10263
10264
  const cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
10264
10265
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
10265
10266
  renderBreadcrumb?.(product),
@@ -10327,7 +10328,7 @@ function ServiceProductLayout({
10327
10328
  /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, className: "font-medium text-foreground" }),
10328
10329
  " deposit charged at booking"
10329
10330
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10330
- chunkMNIKXG7W_js.parsePrice(product.deposit_amount),
10331
+ chunkBN2CXGMO_js.parsePrice(product.deposit_amount),
10331
10332
  "% deposit charged at booking"
10332
10333
  ] }) })
10333
10334
  ] })
@@ -10486,13 +10487,13 @@ function BundleProductLayout({
10486
10487
  }) {
10487
10488
  const images = product.images || (product.image_url ? [product.image_url] : []);
10488
10489
  const components = product.components || [];
10489
- const onSale = chunkMNIKXG7W_js.isOnSale(product);
10490
- const discount = chunkMNIKXG7W_js.getDiscountPercentage(product);
10490
+ const onSale = chunkBN2CXGMO_js.isOnSale(product);
10491
+ const discount = chunkBN2CXGMO_js.getDiscountPercentage(product);
10491
10492
  const baseTotal = components.reduce(
10492
- (sum, c) => sum + chunkMNIKXG7W_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
10493
+ (sum, c) => sum + chunkBN2CXGMO_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
10493
10494
  0
10494
10495
  );
10495
- const bundlePrice = chunkMNIKXG7W_js.parsePrice(product.default_price);
10496
+ const bundlePrice = chunkBN2CXGMO_js.parsePrice(product.default_price);
10496
10497
  const savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
10497
10498
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
10498
10499
  renderBreadcrumb?.(product),
@@ -10984,7 +10985,7 @@ function CartDrawer({
10984
10985
  }) {
10985
10986
  const { isOpen, close } = useCartDrawer();
10986
10987
  const cart = useCart();
10987
- const subtotalNum = chunkMNIKXG7W_js.parsePrice(cart.subtotal);
10988
+ const subtotalNum = chunkBN2CXGMO_js.parsePrice(cart.subtotal);
10988
10989
  const animatedSubtotal = useAnimatedNumber(subtotalNum);
10989
10990
  React10.useEffect(() => {
10990
10991
  if (!isOpen) return;
@@ -11378,9 +11379,9 @@ function CatalogueCollectionLayout({
11378
11379
  result = result.filter((p) => p.tags?.includes(activeCategory));
11379
11380
  }
11380
11381
  if (sortBy === "price-asc") {
11381
- result = [...result].sort((a, b) => chunkMNIKXG7W_js.parsePrice(a.default_price) - chunkMNIKXG7W_js.parsePrice(b.default_price));
11382
+ result = [...result].sort((a, b) => chunkBN2CXGMO_js.parsePrice(a.default_price) - chunkBN2CXGMO_js.parsePrice(b.default_price));
11382
11383
  } else if (sortBy === "price-desc") {
11383
- result = [...result].sort((a, b) => chunkMNIKXG7W_js.parsePrice(b.default_price) - chunkMNIKXG7W_js.parsePrice(a.default_price));
11384
+ result = [...result].sort((a, b) => chunkBN2CXGMO_js.parsePrice(b.default_price) - chunkBN2CXGMO_js.parsePrice(a.default_price));
11384
11385
  } else if (sortBy === "name") {
11385
11386
  result = [...result].sort((a, b) => a.name.localeCompare(b.name));
11386
11387
  }
package/dist/react.mjs CHANGED
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT } from './chunk-IRJFDKFV.mjs';
3
3
  export { getVariantDisplayName } from './chunk-IRJFDKFV.mjs';
4
- import { createCimplifyClient } from './chunk-UXLQ7WXI.mjs';
5
- import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-7NML226B.mjs';
6
- import { isSupportedCurrency, formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-6AZZ6AOF.mjs';
4
+ import { createCimplifyClient } from './chunk-5OK3YDZC.mjs';
5
+ import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-XZPO5GEM.mjs';
6
+ import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-NRT6PVW5.mjs';
7
+ import { isSupportedCurrency } from './chunk-XPXAZXF2.mjs';
7
8
  import React10, { createContext, useRef, useState, useCallback, useEffect, useContext, useMemo, useId, useSyncExternalStore } from 'react';
8
9
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
9
10
  import { clsx } from 'clsx';
package/dist/server.js CHANGED
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkMBGQP6FZ_js = require('./chunk-MBGQP6FZ.js');
4
- require('./chunk-CFD4J32N.js');
5
- var chunkMNIKXG7W_js = require('./chunk-MNIKXG7W.js');
3
+ var chunk3FS3ZDKX_js = require('./chunk-3FS3ZDKX.js');
4
+ require('./chunk-HBRCVJL4.js');
5
+ require('./chunk-BN2CXGMO.js');
6
+ var chunkQBQCMQ4F_js = require('./chunk-QBQCMQ4F.js');
6
7
  var react = require('react');
7
8
 
8
9
  var DEFAULT_DEV_URL = "http://127.0.0.1:8787";
@@ -18,7 +19,7 @@ function readEnv(...keys) {
18
19
  var getServerClient = react.cache((opts = {}) => {
19
20
  const baseUrl = opts.apiUrl ?? readEnv("CIMPLIFY_API_URL", "NEXT_PUBLIC_CIMPLIFY_API_URL") ?? DEFAULT_DEV_URL;
20
21
  const publicKey = opts.secretKey ?? readEnv("CIMPLIFY_SECRET_KEY", "NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY") ?? "mock-dev";
21
- const client = chunkMBGQP6FZ_js.createCimplifyClient({
22
+ const client = chunk3FS3ZDKX_js.createCimplifyClient({
22
23
  baseUrl,
23
24
  publicKey,
24
25
  suppressPublicKeyWarning: true
@@ -93,7 +94,7 @@ async function revalidateByTag(tag) {
93
94
 
94
95
  Object.defineProperty(exports, "CimplifyError", {
95
96
  enumerable: true,
96
- get: function () { return chunkMNIKXG7W_js.CimplifyError; }
97
+ get: function () { return chunkQBQCMQ4F_js.CimplifyError; }
97
98
  });
98
99
  exports.getServerClient = getServerClient;
99
100
  exports.revalidateBusiness = revalidateBusiness;
package/dist/server.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { createCimplifyClient } from './chunk-UXLQ7WXI.mjs';
2
- import './chunk-7NML226B.mjs';
3
- export { CimplifyError } from './chunk-6AZZ6AOF.mjs';
1
+ import { createCimplifyClient } from './chunk-5OK3YDZC.mjs';
2
+ import './chunk-XZPO5GEM.mjs';
3
+ import './chunk-NRT6PVW5.mjs';
4
+ export { CimplifyError } from './chunk-XPXAZXF2.mjs';
4
5
  import { cache } from 'react';
5
6
 
6
7
  var DEFAULT_DEV_URL = "http://127.0.0.1:8787";