@cimplify/sdk 0.75.0 → 0.78.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.
Files changed (49) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/{chunk-OGQFDCZM.js → chunk-2SJUHD32.js} +24 -11
  4. package/dist/{chunk-BYWJSPT4.mjs → chunk-7EYA527E.mjs} +5 -2
  5. package/dist/{chunk-Y64AIRGW.js → chunk-EIJKO43W.js} +6 -3
  6. package/dist/{chunk-J7L5LHGK.mjs → chunk-XRJCLWJ2.mjs} +24 -11
  7. package/dist/{client-xDpke-KS.d.ts → client-B1ix2-Og.d.mts} +11 -4
  8. package/dist/{client-yFghjc1-.d.mts → client-BFuRYjAL.d.mts} +2 -2
  9. package/dist/{client--w53owD4.d.ts → client-BW82Vq-p.d.ts} +2 -2
  10. package/dist/{client-D7uHF_jh.d.mts → client-DxW_uHll.d.ts} +11 -4
  11. package/dist/{index-lt-fe29V.d.mts → index-Bu76UyFz.d.mts} +3 -3
  12. package/dist/{index-DTGS0QC1.d.ts → index-Moe4cGMB.d.ts} +3 -3
  13. package/dist/index.d.mts +6 -6
  14. package/dist/index.d.ts +6 -6
  15. package/dist/mock/cli.mjs +24 -11
  16. package/dist/mock/library.js +24 -11
  17. package/dist/mock/library.mjs +24 -11
  18. package/dist/mock/msw.js +24 -11
  19. package/dist/mock/msw.mjs +24 -11
  20. package/dist/{payment-C-2gApyQ.d.mts → payment-B7qzWdaJ.d.mts} +1 -1
  21. package/dist/{payment-CfemTORM.d.ts → payment-mVIJIJcq.d.ts} +1 -1
  22. package/dist/{price-CZBQw-Rh.d.mts → price-BfOaGqjx.d.mts} +1 -1
  23. package/dist/{price-DNeyoO7y.d.ts → price-CS1IsORZ.d.ts} +1 -1
  24. package/dist/{product-_GFoaPHU.d.mts → product-BgFOFmQw.d.mts} +7 -0
  25. package/dist/{product-_GFoaPHU.d.ts → product-BgFOFmQw.d.ts} +7 -0
  26. package/dist/react.d.mts +4 -4
  27. package/dist/react.d.ts +4 -4
  28. package/dist/react.js +5 -1
  29. package/dist/react.mjs +5 -1
  30. package/dist/{server-G8I4JtqK.d.mts → server-CGO4zneR.d.mts} +1 -1
  31. package/dist/{server-1hXIXH2k.d.ts → server-Daq42vK7.d.ts} +1 -1
  32. package/dist/server.d.mts +4 -4
  33. package/dist/server.d.ts +4 -4
  34. package/dist/testing/msw.d.mts +2 -2
  35. package/dist/testing/msw.d.ts +2 -2
  36. package/dist/testing/msw.js +2 -2
  37. package/dist/testing/msw.mjs +1 -1
  38. package/dist/testing/suite.d.mts +6 -6
  39. package/dist/testing/suite.d.ts +6 -6
  40. package/dist/testing/suite.js +21 -21
  41. package/dist/testing/suite.mjs +2 -2
  42. package/dist/testing.d.mts +20 -5
  43. package/dist/testing.d.ts +20 -5
  44. package/dist/testing.js +77 -77
  45. package/dist/testing.mjs +3 -3
  46. package/dist/utils.d.mts +4 -4
  47. package/dist/utils.d.ts +4 -4
  48. package/package.json +1 -1
  49. package/registry/order-summary.json +1 -1
@@ -4525,17 +4525,27 @@ function recalculateTotals(opts) {
4525
4525
  const lineTotal = multiply(add(item.price, item.add_ons_price), item.quantity);
4526
4526
  subtotal = add(subtotal, lineTotal);
4527
4527
  }
4528
- const totalDiscounts = opts.appliedCouponCodes.includes("WELCOME10") ? percent(subtotal, 10) : "0.00";
4529
- const afterDiscount = money(parseFloat(subtotal) - parseFloat(totalDiscounts));
4530
- const tax = "0.00";
4531
- const service = "0.00";
4532
- const total = add(add(afterDiscount, tax), service);
4528
+ const subtotalNum = parseFloat(subtotal);
4529
+ const rawDiscount = opts.appliedCouponCodes.includes("WELCOME10") ? parseFloat(percent(subtotal, 10)) : 0;
4530
+ const cappedDiscount = Math.min(rawDiscount, subtotalNum);
4531
+ const taxable = Math.max(subtotalNum - cappedDiscount, 0);
4532
+ const service = 0;
4533
+ const rate2 = opts.taxRatePct / 100;
4534
+ let tax;
4535
+ let total;
4536
+ if (opts.taxInclusive) {
4537
+ tax = 0;
4538
+ total = subtotalNum + service - cappedDiscount;
4539
+ } else {
4540
+ tax = (taxable + service) * rate2;
4541
+ total = subtotalNum + service + tax - cappedDiscount;
4542
+ }
4533
4543
  return {
4534
4544
  subtotal,
4535
- total_discounts: totalDiscounts,
4536
- tax_amount: tax,
4537
- service_charge: service,
4538
- total_price: total
4545
+ total_discounts: money(cappedDiscount),
4546
+ tax_amount: money(tax),
4547
+ service_charge: money(service),
4548
+ total_price: money(total)
4539
4549
  };
4540
4550
  }
4541
4551
  function computeLineKey(opts) {
@@ -4668,7 +4678,8 @@ function toUICart(registry, cart) {
4668
4678
  total_price: cart.total_price,
4669
4679
  currency: cart.currency,
4670
4680
  tax_rate: cart.tax_rate,
4671
- service_charge_rate: cart.service_charge_rate
4681
+ service_charge_rate: cart.service_charge_rate,
4682
+ tax_inclusive: false
4672
4683
  },
4673
4684
  customer_info: {
4674
4685
  name: cart.customer_name,
@@ -4687,6 +4698,7 @@ function toUICart(registry, cart) {
4687
4698
 
4688
4699
  // src/mock/domain/cart/index.ts
4689
4700
  var CART_TTL_MS = 24 * 60 * 60 * 1e3;
4701
+ var TAX_RATE_PCT = 0;
4690
4702
  var ZERO2 = "0.00";
4691
4703
  function createCartService(opts) {
4692
4704
  const { registry, clock, ids, bus, inventory } = opts;
@@ -4728,7 +4740,8 @@ function createCartService(opts) {
4728
4740
  const recalc = (cart) => {
4729
4741
  const totals = recalculateTotals({
4730
4742
  items: cart.items,
4731
- appliedCouponCodes: cart.applied_discount_codes});
4743
+ appliedCouponCodes: cart.applied_discount_codes,
4744
+ taxRatePct: TAX_RATE_PCT});
4732
4745
  const updated = {
4733
4746
  ...cart,
4734
4747
  ...totals,
package/dist/mock/msw.js CHANGED
@@ -4525,17 +4525,27 @@ function recalculateTotals(opts) {
4525
4525
  const lineTotal = multiply(add(item.price, item.add_ons_price), item.quantity);
4526
4526
  subtotal = add(subtotal, lineTotal);
4527
4527
  }
4528
- const totalDiscounts = opts.appliedCouponCodes.includes("WELCOME10") ? percent(subtotal, 10) : "0.00";
4529
- const afterDiscount = money(parseFloat(subtotal) - parseFloat(totalDiscounts));
4530
- const tax = "0.00";
4531
- const service = "0.00";
4532
- const total = add(add(afterDiscount, tax), service);
4528
+ const subtotalNum = parseFloat(subtotal);
4529
+ const rawDiscount = opts.appliedCouponCodes.includes("WELCOME10") ? parseFloat(percent(subtotal, 10)) : 0;
4530
+ const cappedDiscount = Math.min(rawDiscount, subtotalNum);
4531
+ const taxable = Math.max(subtotalNum - cappedDiscount, 0);
4532
+ const service = 0;
4533
+ const rate2 = opts.taxRatePct / 100;
4534
+ let tax;
4535
+ let total;
4536
+ if (opts.taxInclusive) {
4537
+ tax = 0;
4538
+ total = subtotalNum + service - cappedDiscount;
4539
+ } else {
4540
+ tax = (taxable + service) * rate2;
4541
+ total = subtotalNum + service + tax - cappedDiscount;
4542
+ }
4533
4543
  return {
4534
4544
  subtotal,
4535
- total_discounts: totalDiscounts,
4536
- tax_amount: tax,
4537
- service_charge: service,
4538
- total_price: total
4545
+ total_discounts: money(cappedDiscount),
4546
+ tax_amount: money(tax),
4547
+ service_charge: money(service),
4548
+ total_price: money(total)
4539
4549
  };
4540
4550
  }
4541
4551
  function computeLineKey(opts) {
@@ -4668,7 +4678,8 @@ function toUICart(registry, cart) {
4668
4678
  total_price: cart.total_price,
4669
4679
  currency: cart.currency,
4670
4680
  tax_rate: cart.tax_rate,
4671
- service_charge_rate: cart.service_charge_rate
4681
+ service_charge_rate: cart.service_charge_rate,
4682
+ tax_inclusive: false
4672
4683
  },
4673
4684
  customer_info: {
4674
4685
  name: cart.customer_name,
@@ -4687,6 +4698,7 @@ function toUICart(registry, cart) {
4687
4698
 
4688
4699
  // src/mock/domain/cart/index.ts
4689
4700
  var CART_TTL_MS = 24 * 60 * 60 * 1e3;
4701
+ var TAX_RATE_PCT = 0;
4690
4702
  var ZERO2 = "0.00";
4691
4703
  function createCartService(opts) {
4692
4704
  const { registry, clock, ids, bus, inventory } = opts;
@@ -4728,7 +4740,8 @@ function createCartService(opts) {
4728
4740
  const recalc = (cart) => {
4729
4741
  const totals = recalculateTotals({
4730
4742
  items: cart.items,
4731
- appliedCouponCodes: cart.applied_discount_codes});
4743
+ appliedCouponCodes: cart.applied_discount_codes,
4744
+ taxRatePct: TAX_RATE_PCT});
4732
4745
  const updated = {
4733
4746
  ...cart,
4734
4747
  ...totals,
package/dist/mock/msw.mjs CHANGED
@@ -4523,17 +4523,27 @@ function recalculateTotals(opts) {
4523
4523
  const lineTotal = multiply(add(item.price, item.add_ons_price), item.quantity);
4524
4524
  subtotal = add(subtotal, lineTotal);
4525
4525
  }
4526
- const totalDiscounts = opts.appliedCouponCodes.includes("WELCOME10") ? percent(subtotal, 10) : "0.00";
4527
- const afterDiscount = money(parseFloat(subtotal) - parseFloat(totalDiscounts));
4528
- const tax = "0.00";
4529
- const service = "0.00";
4530
- const total = add(add(afterDiscount, tax), service);
4526
+ const subtotalNum = parseFloat(subtotal);
4527
+ const rawDiscount = opts.appliedCouponCodes.includes("WELCOME10") ? parseFloat(percent(subtotal, 10)) : 0;
4528
+ const cappedDiscount = Math.min(rawDiscount, subtotalNum);
4529
+ const taxable = Math.max(subtotalNum - cappedDiscount, 0);
4530
+ const service = 0;
4531
+ const rate2 = opts.taxRatePct / 100;
4532
+ let tax;
4533
+ let total;
4534
+ if (opts.taxInclusive) {
4535
+ tax = 0;
4536
+ total = subtotalNum + service - cappedDiscount;
4537
+ } else {
4538
+ tax = (taxable + service) * rate2;
4539
+ total = subtotalNum + service + tax - cappedDiscount;
4540
+ }
4531
4541
  return {
4532
4542
  subtotal,
4533
- total_discounts: totalDiscounts,
4534
- tax_amount: tax,
4535
- service_charge: service,
4536
- total_price: total
4543
+ total_discounts: money(cappedDiscount),
4544
+ tax_amount: money(tax),
4545
+ service_charge: money(service),
4546
+ total_price: money(total)
4537
4547
  };
4538
4548
  }
4539
4549
  function computeLineKey(opts) {
@@ -4666,7 +4676,8 @@ function toUICart(registry, cart) {
4666
4676
  total_price: cart.total_price,
4667
4677
  currency: cart.currency,
4668
4678
  tax_rate: cart.tax_rate,
4669
- service_charge_rate: cart.service_charge_rate
4679
+ service_charge_rate: cart.service_charge_rate,
4680
+ tax_inclusive: false
4670
4681
  },
4671
4682
  customer_info: {
4672
4683
  name: cart.customer_name,
@@ -4685,6 +4696,7 @@ function toUICart(registry, cart) {
4685
4696
 
4686
4697
  // src/mock/domain/cart/index.ts
4687
4698
  var CART_TTL_MS = 24 * 60 * 60 * 1e3;
4699
+ var TAX_RATE_PCT = 0;
4688
4700
  var ZERO2 = "0.00";
4689
4701
  function createCartService(opts) {
4690
4702
  const { registry, clock, ids, bus, inventory } = opts;
@@ -4726,7 +4738,8 @@ function createCartService(opts) {
4726
4738
  const recalc = (cart) => {
4727
4739
  const totals = recalculateTotals({
4728
4740
  items: cart.items,
4729
- appliedCouponCodes: cart.applied_discount_codes});
4741
+ appliedCouponCodes: cart.applied_discount_codes,
4742
+ taxRatePct: TAX_RATE_PCT});
4730
4743
  const updated = {
4731
4744
  ...cart,
4732
4745
  ...totals,
@@ -1,4 +1,4 @@
1
- import { aM as Money, ab as CurrencyCode } from './product-_GFoaPHU.mjs';
1
+ import { aM as Money, ab as CurrencyCode } from './product-BgFOFmQw.mjs';
2
2
 
3
3
  type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending";
4
4
  type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtnmomo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
@@ -1,4 +1,4 @@
1
- import { aM as Money, ab as CurrencyCode } from './product-_GFoaPHU.js';
1
+ import { aM as Money, ab as CurrencyCode } from './product-BgFOFmQw.js';
2
2
 
3
3
  type PaymentStatus = "initialized" | "pending" | "processing" | "authorized" | "captured" | "failed" | "cancelled" | "refunded" | "unknown" | "voided" | "requires_action" | "abandoned" | "reversed" | "disputed" | "refund_pending";
4
4
  type PaymentProvider = "stripe" | "paystack" | "cellulant" | "mtnmomo" | "offline" | "mtn" | "vodafone" | "airtel" | "cash" | "manual";
@@ -1,4 +1,4 @@
1
- import { ab as CurrencyCode, S as ChosenPrice } from './product-_GFoaPHU.mjs';
1
+ import { ab as CurrencyCode, S as ChosenPrice } from './product-BgFOFmQw.mjs';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
@@ -1,4 +1,4 @@
1
- import { ab as CurrencyCode, S as ChosenPrice } from './product-_GFoaPHU.js';
1
+ import { ab as CurrencyCode, S as ChosenPrice } from './product-BgFOFmQw.js';
2
2
 
3
3
  interface ProductWithPrice {
4
4
  price_info?: ChosenPrice;
@@ -466,6 +466,13 @@ interface UICartPricing {
466
466
  tax_rate?: Money;
467
467
  service_charge_rate?: Money;
468
468
  currency: CurrencyCode;
469
+ /** Tax is baked into the prices (e.g. Ghana VAT), so `tax_amount` is the
470
+ * portion already inside `subtotal`/`total_price`, not an addition. */
471
+ tax_inclusive: boolean;
472
+ /** Deposit computed from the catalogue when the cart has deposit-eligible
473
+ * service items; lets checkout offer "pay deposit now, balance later". */
474
+ deposit_required?: boolean;
475
+ deposit_amount?: Money;
469
476
  }
470
477
  interface AddOnOptionDetails {
471
478
  id: string;
@@ -466,6 +466,13 @@ interface UICartPricing {
466
466
  tax_rate?: Money;
467
467
  service_charge_rate?: Money;
468
468
  currency: CurrencyCode;
469
+ /** Tax is baked into the prices (e.g. Ghana VAT), so `tax_amount` is the
470
+ * portion already inside `subtotal`/`total_price`, not an addition. */
471
+ tax_inclusive: boolean;
472
+ /** Deposit computed from the catalogue when the cart has deposit-eligible
473
+ * service items; lets checkout offer "pay deposit now, balance later". */
474
+ deposit_required?: boolean;
475
+ deposit_amount?: Money;
469
476
  }
470
477
  interface AddOnOptionDetails {
471
478
  id: string;
package/dist/react.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import React$1, { ReactNode } from 'react';
2
2
  import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.mjs';
3
3
  export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.mjs';
4
- import { ad as CimplifyClient, cj as ProcessCheckoutResult, aa as CheckoutStatus, ab as CheckoutStatusContext, aV as EnrichedOrderItem, aU as EnrichedOrder, w as Business, bp as Location, cA as ReorderResult, b$ as OrderStatus, bF as Order, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cf as PriceQuote, cp as QuoteUiMessage, cV as Service, r as AvailableSlot, av as DayAvailability, an as CustomerBooking, M as CancelBookingResult, f as ActivityStateResponse, d2 as SessionMessage, c as ActivityRecommendation, ax as DeliveryFeeResponse, b6 as FxRateResponse, db as StorefrontBootstrap, Y as ChatWidgetStarter, X as ChatMessage, h as AddressInfo, n as AuthenticatedData, aT as ElementsOptions, c9 as PaymentMethodInfo, aR as ElementsCheckoutResult, ci as ProcessCheckoutOptions, ag as CimplifyElements, bg as LineItem, d5 as Staff, cQ as Room } from './client-D7uHF_jh.mjs';
4
+ import { ad as CimplifyClient, cj as ProcessCheckoutResult, aa as CheckoutStatus, ab as CheckoutStatusContext, aV as EnrichedOrderItem, aU as EnrichedOrder, w as Business, bp as Location, cA as ReorderResult, b$ as OrderStatus, bF as Order, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cf as PriceQuote, cp as QuoteUiMessage, cV as Service, r as AvailableSlot, av as DayAvailability, an as CustomerBooking, M as CancelBookingResult, f as ActivityStateResponse, d2 as SessionMessage, c as ActivityRecommendation, ax as DeliveryFeeResponse, b6 as FxRateResponse, db as StorefrontBootstrap, Y as ChatWidgetStarter, X as ChatMessage, h as AddressInfo, n as AuthenticatedData, aT as ElementsOptions, c9 as PaymentMethodInfo, aR as ElementsCheckoutResult, ci as ProcessCheckoutOptions, ag as CimplifyElements, bg as LineItem, d5 as Staff, cQ as Room } from './client-B1ix2-Og.mjs';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import { ab as CurrencyCode, aX as Product, aO as Pagination, T as CimplifyError, b9 as ProductWithDetails, Q as Category, aM as Money, C as BundleSelectionInput, $ as ComponentSelectionInput, z as BundleSelectionData, a8 as CompositeSelectionData, U as Collection, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, b5 as ProductTimeProfile, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, E as BundleSummary, a6 as CompositePriceResult, bo as SubscriptionWithDetails, bn as SubscriptionStatus, bk as Subscription, ac as CustomAttributeDefinition, ba as PropertyFacet, a$ as ProductBillingPlan, bL as VariantView, bF as VariantAxisWithValues, f as AddOnWithOptions, w as BundleComponentView, x as BundlePriceType, a4 as CompositeGroupView, aq as DisplayCart, b1 as ProductInputField, bg as SchedulingMode, at as DurationUnit, aj as DepositType, ad as CustomAttributeValue, b2 as ProductProperty, bc as QuantityPricingTier } from './product-_GFoaPHU.mjs';
7
- import { P as ProductWithPrice } from './price-CZBQw-Rh.mjs';
6
+ import { ab as CurrencyCode, aX as Product, aO as Pagination, T as CimplifyError, b9 as ProductWithDetails, Q as Category, aM as Money, C as BundleSelectionInput, $ as ComponentSelectionInput, z as BundleSelectionData, a8 as CompositeSelectionData, U as Collection, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, b5 as ProductTimeProfile, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, E as BundleSummary, a6 as CompositePriceResult, bo as SubscriptionWithDetails, bn as SubscriptionStatus, bk as Subscription, ac as CustomAttributeDefinition, ba as PropertyFacet, a$ as ProductBillingPlan, bL as VariantView, bF as VariantAxisWithValues, f as AddOnWithOptions, w as BundleComponentView, x as BundlePriceType, a4 as CompositeGroupView, aq as DisplayCart, b1 as ProductInputField, bg as SchedulingMode, at as DurationUnit, aj as DepositType, ad as CustomAttributeValue, b2 as ProductProperty, bc as QuantityPricingTier } from './product-BgFOFmQw.mjs';
7
+ import { P as ProductWithPrice } from './price-BfOaGqjx.mjs';
8
8
  import { ClassValue } from 'clsx';
9
9
  import { Matcher } from 'react-day-picker';
10
- import './payment-C-2gApyQ.mjs';
10
+ import './payment-B7qzWdaJ.mjs';
11
11
 
12
12
  interface UserIdentity {
13
13
  uid: string;
package/dist/react.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import React$1, { ReactNode } from 'react';
2
2
  import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions } from './sign-in-DQlIdqsi.js';
3
3
  export { A as AdConfig, g as getVariantDisplayName } from './sign-in-DQlIdqsi.js';
4
- import { ad as CimplifyClient, cj as ProcessCheckoutResult, aa as CheckoutStatus, ab as CheckoutStatusContext, aV as EnrichedOrderItem, aU as EnrichedOrder, w as Business, bp as Location, cA as ReorderResult, b$ as OrderStatus, bF as Order, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cf as PriceQuote, cp as QuoteUiMessage, cV as Service, r as AvailableSlot, av as DayAvailability, an as CustomerBooking, M as CancelBookingResult, f as ActivityStateResponse, d2 as SessionMessage, c as ActivityRecommendation, ax as DeliveryFeeResponse, b6 as FxRateResponse, db as StorefrontBootstrap, Y as ChatWidgetStarter, X as ChatMessage, h as AddressInfo, n as AuthenticatedData, aT as ElementsOptions, c9 as PaymentMethodInfo, aR as ElementsCheckoutResult, ci as ProcessCheckoutOptions, ag as CimplifyElements, bg as LineItem, d5 as Staff, cQ as Room } from './client-xDpke-KS.js';
4
+ import { ad as CimplifyClient, cj as ProcessCheckoutResult, aa as CheckoutStatus, ab as CheckoutStatusContext, aV as EnrichedOrderItem, aU as EnrichedOrder, w as Business, bp as Location, cA as ReorderResult, b$ as OrderStatus, bF as Order, cl as QuoteBundleSelectionInput, cm as QuoteCompositeSelectionInput, cf as PriceQuote, cp as QuoteUiMessage, cV as Service, r as AvailableSlot, av as DayAvailability, an as CustomerBooking, M as CancelBookingResult, f as ActivityStateResponse, d2 as SessionMessage, c as ActivityRecommendation, ax as DeliveryFeeResponse, b6 as FxRateResponse, db as StorefrontBootstrap, Y as ChatWidgetStarter, X as ChatMessage, h as AddressInfo, n as AuthenticatedData, aT as ElementsOptions, c9 as PaymentMethodInfo, aR as ElementsCheckoutResult, ci as ProcessCheckoutOptions, ag as CimplifyElements, bg as LineItem, d5 as Staff, cQ as Room } from './client-DxW_uHll.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import { ab as CurrencyCode, aX as Product, aO as Pagination, T as CimplifyError, b9 as ProductWithDetails, Q as Category, aM as Money, C as BundleSelectionInput, $ as ComponentSelectionInput, z as BundleSelectionData, a8 as CompositeSelectionData, U as Collection, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, b5 as ProductTimeProfile, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, E as BundleSummary, a6 as CompositePriceResult, bo as SubscriptionWithDetails, bn as SubscriptionStatus, bk as Subscription, ac as CustomAttributeDefinition, ba as PropertyFacet, a$ as ProductBillingPlan, bL as VariantView, bF as VariantAxisWithValues, f as AddOnWithOptions, w as BundleComponentView, x as BundlePriceType, a4 as CompositeGroupView, aq as DisplayCart, b1 as ProductInputField, bg as SchedulingMode, at as DurationUnit, aj as DepositType, ad as CustomAttributeValue, b2 as ProductProperty, bc as QuantityPricingTier } from './product-_GFoaPHU.js';
7
- import { P as ProductWithPrice } from './price-DNeyoO7y.js';
6
+ import { ab as CurrencyCode, aX as Product, aO as Pagination, T as CimplifyError, b9 as ProductWithDetails, Q as Category, aM as Money, C as BundleSelectionInput, $ as ComponentSelectionInput, z as BundleSelectionData, a8 as CompositeSelectionData, U as Collection, b4 as ProductTaxonomy, bt as TaxonomyWithChildren, b5 as ProductTimeProfile, ah as Deal, b0 as ProductDealInfo, an as DiscountValidation, E as BundleSummary, a6 as CompositePriceResult, bo as SubscriptionWithDetails, bn as SubscriptionStatus, bk as Subscription, ac as CustomAttributeDefinition, ba as PropertyFacet, a$ as ProductBillingPlan, bL as VariantView, bF as VariantAxisWithValues, f as AddOnWithOptions, w as BundleComponentView, x as BundlePriceType, a4 as CompositeGroupView, aq as DisplayCart, b1 as ProductInputField, bg as SchedulingMode, at as DurationUnit, aj as DepositType, ad as CustomAttributeValue, b2 as ProductProperty, bc as QuantityPricingTier } from './product-BgFOFmQw.js';
7
+ import { P as ProductWithPrice } from './price-CS1IsORZ.js';
8
8
  import { ClassValue } from 'clsx';
9
9
  import { Matcher } from 'react-day-picker';
10
- import './payment-CfemTORM.js';
10
+ import './payment-mVIJIJcq.js';
11
11
 
12
12
  interface UserIdentity {
13
13
  uid: string;
package/dist/react.js CHANGED
@@ -407,7 +407,10 @@ function transformToCheckoutCart(cart, fx) {
407
407
  total_discounts: amt(cart.pricing.total_discounts),
408
408
  service_charge: amt(cart.pricing.service_charge),
409
409
  total: amt(cart.pricing.total_price),
410
- currency: fx?.displayCurrency ?? cart.pricing.currency
410
+ currency: fx?.displayCurrency ?? cart.pricing.currency,
411
+ tax_inclusive: cart.pricing.tax_inclusive ?? false,
412
+ deposit_required: cart.pricing.deposit_required ?? false,
413
+ deposit_amount: cart.pricing.deposit_amount != null ? amt(cart.pricing.deposit_amount) : void 0
411
414
  };
412
415
  }
413
416
 
@@ -12298,6 +12301,7 @@ var STATUS_LABELS = {
12298
12301
  };
12299
12302
  var PAYMENT_STATE_LABELS = {
12300
12303
  not_paid: "Not Paid",
12304
+ partially_paid: "Partially Paid",
12301
12305
  paid: "Paid",
12302
12306
  partially_refunded: "Partially Refunded",
12303
12307
  refunded: "Refunded"
package/dist/react.mjs CHANGED
@@ -402,7 +402,10 @@ function transformToCheckoutCart(cart, fx) {
402
402
  total_discounts: amt(cart.pricing.total_discounts),
403
403
  service_charge: amt(cart.pricing.service_charge),
404
404
  total: amt(cart.pricing.total_price),
405
- currency: fx?.displayCurrency ?? cart.pricing.currency
405
+ currency: fx?.displayCurrency ?? cart.pricing.currency,
406
+ tax_inclusive: cart.pricing.tax_inclusive ?? false,
407
+ deposit_required: cart.pricing.deposit_required ?? false,
408
+ deposit_amount: cart.pricing.deposit_amount != null ? amt(cart.pricing.deposit_amount) : void 0
406
409
  };
407
410
  }
408
411
 
@@ -12293,6 +12296,7 @@ var STATUS_LABELS = {
12293
12296
  };
12294
12297
  var PAYMENT_STATE_LABELS = {
12295
12298
  not_paid: "Not Paid",
12299
+ partially_paid: "Partially Paid",
12296
12300
  paid: "Paid",
12297
12301
  partially_refunded: "Partially Refunded",
12298
12302
  refunded: "Refunded"
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b1 as ProductInputField } from './product-_GFoaPHU.mjs';
2
+ import { b1 as ProductInputField } from './product-BgFOFmQw.mjs';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
@@ -1,5 +1,5 @@
1
1
  import { Hono } from 'hono';
2
- import { b1 as ProductInputField } from './product-_GFoaPHU.js';
2
+ import { b1 as ProductInputField } from './product-BgFOFmQw.js';
3
3
 
4
4
  interface Clock {
5
5
  now(): Date;
package/dist/server.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { ad as CimplifyClient } from './client-D7uHF_jh.mjs';
2
- export { K as CacheOptions, cq as ReadRequestOptions, cM as Result } from './client-D7uHF_jh.mjs';
3
- export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-_GFoaPHU.mjs';
1
+ import { ad as CimplifyClient } from './client-B1ix2-Og.mjs';
2
+ export { K as CacheOptions, cq as ReadRequestOptions, cM as Result } from './client-B1ix2-Og.mjs';
3
+ export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-BgFOFmQw.mjs';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-C-2gApyQ.mjs';
5
+ import './payment-B7qzWdaJ.mjs';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
package/dist/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ad as CimplifyClient } from './client-xDpke-KS.js';
2
- export { K as CacheOptions, cq as ReadRequestOptions, cM as Result } from './client-xDpke-KS.js';
3
- export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-_GFoaPHU.js';
1
+ import { ad as CimplifyClient } from './client-DxW_uHll.js';
2
+ export { K as CacheOptions, cq as ReadRequestOptions, cM as Result } from './client-DxW_uHll.js';
3
+ export { Q as Category, T as CimplifyError, U as Collection, aX as Product, b9 as ProductWithDetails } from './product-BgFOFmQw.js';
4
4
  import { JWTVerifyResult } from 'jose';
5
- import './payment-CfemTORM.js';
5
+ import './payment-mVIJIJcq.js';
6
6
 
7
7
  interface ServerClientOptions {
8
8
  /**
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-G8I4JtqK.mjs';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-CGO4zneR.mjs';
2
2
  import 'hono';
3
- import '../product-_GFoaPHU.mjs';
3
+ import '../product-BgFOFmQw.mjs';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,6 +1,6 @@
1
- import { A as AppHandle, C as CreateAppOptions } from '../server-1hXIXH2k.js';
1
+ import { A as AppHandle, C as CreateAppOptions } from '../server-Daq42vK7.js';
2
2
  import 'hono';
3
- import '../product-_GFoaPHU.js';
3
+ import '../product-BgFOFmQw.js';
4
4
 
5
5
  interface MswHandlerSetup {
6
6
  handlers: unknown[];
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkOGQFDCZM_js = require('../chunk-OGQFDCZM.js');
3
+ var chunk2SJUHD32_js = require('../chunk-2SJUHD32.js');
4
4
  require('../chunk-XA3ZNR75.js');
5
5
  require('../chunk-OWW5GUSB.js');
6
6
 
7
7
  // src/mock/msw.ts
8
8
  async function createMswHandlers(options = {}) {
9
9
  const baseUrl = options.baseUrl ?? "http://localhost:8787";
10
- const handle = chunkOGQFDCZM_js.createMockApp(options);
10
+ const handle = chunk2SJUHD32_js.createMockApp(options);
11
11
  const msw = await import('msw').catch(() => {
12
12
  throw new Error("msw is required to use @cimplify/sdk/mock/msw \u2014 install it as a peer dependency");
13
13
  });
@@ -1,4 +1,4 @@
1
- import { createMockApp } from '../chunk-J7L5LHGK.mjs';
1
+ import { createMockApp } from '../chunk-XRJCLWJ2.mjs';
2
2
  import '../chunk-AMZXALF6.mjs';
3
3
  import '../chunk-3G6RQLXK.mjs';
4
4
 
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client-yFghjc1-.mjs';
3
- import { C as CreateAppOptions } from '../server-G8I4JtqK.mjs';
4
- export { S as SeedName } from '../server-G8I4JtqK.mjs';
5
- import '../client-D7uHF_jh.mjs';
6
- import '../product-_GFoaPHU.mjs';
7
- import '../payment-C-2gApyQ.mjs';
2
+ import { T as TestClientHandle } from '../client-BFuRYjAL.mjs';
3
+ import { C as CreateAppOptions } from '../server-CGO4zneR.mjs';
4
+ export { S as SeedName } from '../server-CGO4zneR.mjs';
5
+ import '../client-B1ix2-Og.mjs';
6
+ import '../product-BgFOFmQw.mjs';
7
+ import '../payment-B7qzWdaJ.mjs';
8
8
  import 'hono';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { TestAPI } from 'vitest';
2
- import { T as TestClientHandle } from '../client--w53owD4.js';
3
- import { C as CreateAppOptions } from '../server-1hXIXH2k.js';
4
- export { S as SeedName } from '../server-1hXIXH2k.js';
5
- import '../client-xDpke-KS.js';
6
- import '../product-_GFoaPHU.js';
7
- import '../payment-CfemTORM.js';
2
+ import { T as TestClientHandle } from '../client-BW82Vq-p.js';
3
+ import { C as CreateAppOptions } from '../server-Daq42vK7.js';
4
+ export { S as SeedName } from '../server-Daq42vK7.js';
5
+ import '../client-DxW_uHll.js';
6
+ import '../product-BgFOFmQw.js';
7
+ import '../payment-mVIJIJcq.js';
8
8
  import 'hono';
9
9
 
10
10
  /**
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkY64AIRGW_js = require('../chunk-Y64AIRGW.js');
4
- require('../chunk-OGQFDCZM.js');
3
+ var chunkEIJKO43W_js = require('../chunk-EIJKO43W.js');
4
+ require('../chunk-2SJUHD32.js');
5
5
  require('../chunk-QS4XDVHI.js');
6
6
  require('../chunk-CV5QMDQS.js');
7
7
  require('../chunk-7Y2O3E4D.js');
@@ -20,11 +20,11 @@ var PLACEHOLDER_PHRASES = [
20
20
  function createBrandSuite(opts) {
21
21
  vitest.describe(opts.label ?? "brand schema", () => {
22
22
  vitest.it("conforms to the Cimplify brand contract", () => {
23
- vitest.expect(() => chunkY64AIRGW_js.assertBrand(opts.brand)).not.toThrow();
23
+ vitest.expect(() => chunkEIJKO43W_js.assertBrand(opts.brand)).not.toThrow();
24
24
  });
25
25
  vitest.it("declares a known mock seed", () => {
26
26
  const b = opts.brand;
27
- vitest.expect(chunkY64AIRGW_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
27
+ vitest.expect(chunkEIJKO43W_js.SeedNameSchema.safeParse(b.mock?.seed).success).toBe(true);
28
28
  });
29
29
  vitest.it("has no placeholder copy left in", () => {
30
30
  const offenders = [];
@@ -56,7 +56,7 @@ ${msg}`);
56
56
  vitest.expect(b.mock?.businessId).toMatch(/^bus_/);
57
57
  });
58
58
  vitest.it("zod-parses cleanly", () => {
59
- const result = chunkY64AIRGW_js.BrandSchema.safeParse(opts.brand);
59
+ const result = chunkEIJKO43W_js.BrandSchema.safeParse(opts.brand);
60
60
  if (!result.success) {
61
61
  throw new Error(
62
62
  "Brand schema violations:\n" + result.error.issues.map((i) => ` \u2022 brand.${i.path.join(".")}: ${i.message}`).join("\n")
@@ -71,23 +71,23 @@ function createCartFlowSuite(opts = {}) {
71
71
  vitest.describe(opts.label ?? "cart flow against in-process mock", () => {
72
72
  let h;
73
73
  vitest.beforeEach(() => {
74
- h = chunkY64AIRGW_js.createTestClient(opts);
74
+ h = chunkEIJKO43W_js.createTestClient(opts);
75
75
  });
76
76
  vitest.afterEach(() => h.dispose());
77
77
  vitest.it("starts with an empty cart matching the canonical shape", async () => {
78
78
  const res = await h.client.cart.get();
79
79
  vitest.expect(res.ok).toBe(true);
80
80
  if (!res.ok) return;
81
- vitest.expect(() => chunkY64AIRGW_js.assertCart(res.value)).not.toThrow();
81
+ vitest.expect(() => chunkEIJKO43W_js.assertCart(res.value)).not.toThrow();
82
82
  vitest.expect(res.value.items).toHaveLength(0);
83
83
  });
84
84
  vitest.it("adds the first product, persists it, and returns a shape-valid cart", async () => {
85
- const { product, variantId } = await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
85
+ const { product, variantId } = await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
86
86
  vitest.expect(product.id).toBeTruthy();
87
87
  const get = await h.client.cart.get();
88
88
  vitest.expect(get.ok).toBe(true);
89
89
  if (!get.ok) return;
90
- vitest.expect(() => chunkY64AIRGW_js.assertCart(get.value)).not.toThrow();
90
+ vitest.expect(() => chunkEIJKO43W_js.assertCart(get.value)).not.toThrow();
91
91
  vitest.expect(get.value.items).toHaveLength(1);
92
92
  vitest.expect(get.value.items[0]?.item_id).toBe(product.id);
93
93
  if (variantId) {
@@ -98,8 +98,8 @@ function createCartFlowSuite(opts = {}) {
98
98
  vitest.expect(parseFloat(String(get.value.pricing.subtotal))).toBeGreaterThan(0);
99
99
  });
100
100
  vitest.it("dedupes by line_key when adding the same product twice", async () => {
101
- await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
102
- await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
101
+ await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
102
+ await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
103
103
  const res = await h.client.cart.get();
104
104
  vitest.expect(res.ok).toBe(true);
105
105
  if (!res.ok) return;
@@ -107,7 +107,7 @@ function createCartFlowSuite(opts = {}) {
107
107
  vitest.expect(res.value.items[0]?.quantity).toBe(2);
108
108
  });
109
109
  vitest.it("removes items and zeroes the subtotal", async () => {
110
- await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
110
+ await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
111
111
  const before = await h.client.cart.get();
112
112
  if (!before.ok) throw before.error;
113
113
  const itemId = before.value.items[0]?.id;
@@ -133,28 +133,28 @@ function createContractSuite(opts = {}) {
133
133
  vitest.describe(opts.label ?? "SDK \u2194 mock contract", () => {
134
134
  let h;
135
135
  vitest.beforeEach(() => {
136
- h = chunkY64AIRGW_js.createTestClient(opts);
136
+ h = chunkEIJKO43W_js.createTestClient(opts);
137
137
  });
138
138
  vitest.afterEach(() => h.dispose());
139
139
  vitest.it("AddItemPayload schema accepts a minimal valid body", () => {
140
- const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
140
+ const result = chunkEIJKO43W_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: 1 });
141
141
  vitest.expect(result.success).toBe(true);
142
142
  });
143
143
  vitest.it("AddItemPayload schema rejects negative quantity", () => {
144
- const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
144
+ const result = chunkEIJKO43W_js.AddItemPayloadSchema.safeParse({ item_id: "prod_x", quantity: -1 });
145
145
  vitest.expect(result.success).toBe(false);
146
146
  });
147
147
  vitest.it("AddItemPayload schema rejects empty item_id", () => {
148
- const result = chunkY64AIRGW_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
148
+ const result = chunkEIJKO43W_js.AddItemPayloadSchema.safeParse({ item_id: "", quantity: 1 });
149
149
  vitest.expect(result.success).toBe(false);
150
150
  });
151
151
  vitest.it("Cart line items returned by the mock match CartItemSchema", async () => {
152
- const { product } = await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
152
+ const { product } = await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
153
153
  const get = await h.client.cart.get();
154
154
  if (!get.ok) throw get.error;
155
155
  vitest.expect(get.value.items.length).toBeGreaterThan(0);
156
156
  for (const item of get.value.items) {
157
- const result = chunkY64AIRGW_js.CartItemSchema.safeParse(item);
157
+ const result = chunkEIJKO43W_js.CartItemSchema.safeParse(item);
158
158
  if (!result.success) {
159
159
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
160
160
  throw new Error(`Cart item shape mismatch for ${product.name}:
@@ -164,19 +164,19 @@ ${issues}`);
164
164
  }
165
165
  });
166
166
  vitest.it("CheckoutResponse from the mock includes bill_token", async () => {
167
- await chunkY64AIRGW_js.fixtures.addFirstProduct(h.client);
167
+ await chunkEIJKO43W_js.fixtures.addFirstProduct(h.client);
168
168
  const cartRes = await h.client.cart.get();
169
169
  if (!cartRes.ok) throw cartRes.error;
170
170
  const checkout = await h.client.checkout.process({
171
171
  cart_id: cartRes.value.id,
172
- customer: chunkY64AIRGW_js.fixtures.customer(),
172
+ customer: chunkEIJKO43W_js.fixtures.customer(),
173
173
  order_type: "delivery",
174
174
  payment_method: "mobile_money",
175
175
  mobile_money_details: { phone_number: "+233244000000", provider: "mtn" }
176
176
  });
177
177
  vitest.expect(checkout.ok).toBe(true);
178
178
  if (!checkout.ok) return;
179
- const result = chunkY64AIRGW_js.CheckoutResponseSchema.safeParse(checkout.value);
179
+ const result = chunkEIJKO43W_js.CheckoutResponseSchema.safeParse(checkout.value);
180
180
  if (!result.success) {
181
181
  const issues = result.error.issues.map((i) => ` \u2022 ${i.path.join(".")}: ${i.message}`).join("\n");
182
182
  throw new Error(`CheckoutResponse shape mismatch:
@@ -1,5 +1,5 @@
1
- import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-BYWJSPT4.mjs';
2
- import '../chunk-J7L5LHGK.mjs';
1
+ import { assertBrand, SeedNameSchema, BrandSchema, createTestClient, assertCart, fixtures, AddItemPayloadSchema, CartItemSchema, CheckoutResponseSchema } from '../chunk-7EYA527E.mjs';
2
+ import '../chunk-XRJCLWJ2.mjs';
3
3
  import '../chunk-H337NF4O.mjs';
4
4
  import '../chunk-3BKMNVTR.mjs';
5
5
  import '../chunk-TD3AY34U.mjs';