@zonos/elements 1.3.85 → 1.3.87

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 (89) hide show
  1. package/dist/cjs/{cart-fc426d98.js → cart-120d68f9.js} +38 -23
  2. package/dist/cjs/{createCustomEvent-354c8e63.js → createCustomEvent-ed9156dc.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{paypal-1fe5ed0c.js → paypal-875cfaf1.js} +1 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +8 -8
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +2 -2
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -3
  17. package/dist/collection/components/store/checkout/cart.js +22 -12
  18. package/dist/collection/components/store/checkout/stripe.js +16 -11
  19. package/dist/collection/types/generated/graphql.frontend.types.js +5 -5
  20. package/dist/esm/{cart-6c44367a.js → cart-9f1caabf.js} +38 -23
  21. package/dist/esm/{createCustomEvent-ec15a4a7.js → createCustomEvent-464c49c0.js} +1 -1
  22. package/dist/esm/index.js +7 -7
  23. package/dist/esm/{paypal-a562a640.js → paypal-fb449438.js} +1 -1
  24. package/dist/esm/zonos-address_7.entry.js +1 -1
  25. package/dist/esm/zonos-cart-items_12.entry.js +8 -8
  26. package/dist/esm/zonos-checkout.entry.js +3 -3
  27. package/dist/esm/zonos-controller.entry.js +1 -1
  28. package/dist/esm/zonos-country-flag.entry.js +1 -1
  29. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  30. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  31. package/dist/esm/zonos-hello.entry.js +1 -1
  32. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  33. package/dist/esm/zonos-notification_3.entry.js +2 -2
  34. package/dist/esm-es5/{cart-6c44367a.js → cart-9f1caabf.js} +1 -1
  35. package/dist/esm-es5/{createCustomEvent-ec15a4a7.js → createCustomEvent-464c49c0.js} +1 -1
  36. package/dist/esm-es5/index.js +1 -1
  37. package/dist/esm-es5/{paypal-a562a640.js → paypal-fb449438.js} +1 -1
  38. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  39. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  40. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  41. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  42. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  43. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  44. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  45. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  46. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  47. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  48. package/dist/scripts/index.d.ts +1 -1
  49. package/dist/scripts/index.js +1 -1
  50. package/dist/scripts/loadZonos.js +1 -1
  51. package/dist/scripts/zonos.js +1 -1
  52. package/dist/types/components/store/checkout/cart.d.ts +7 -3
  53. package/dist/types/types/generated/graphql.frontend.types.d.ts +28 -29
  54. package/dist/types/types/generated/graphql.frontend.types.ts +43 -44
  55. package/dist/types/types/generated/graphql.internal.types.d.ts +3 -3
  56. package/dist/types/types/generated/graphql.internal.types.ts +3 -3
  57. package/dist/zonos-elements/index.esm.js +1 -1
  58. package/dist/zonos-elements/{p-1eb59b7c.system.entry.js → p-0b01b9b1.system.entry.js} +1 -1
  59. package/dist/zonos-elements/{p-5ba198b3.entry.js → p-253cbdae.entry.js} +1 -1
  60. package/dist/zonos-elements/{p-b9645c27.system.js → p-294026a0.system.js} +1 -1
  61. package/dist/zonos-elements/{p-63a33354.system.entry.js → p-35577bd8.system.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-7b4a5b9b.system.entry.js → p-3d521899.system.entry.js} +1 -1
  63. package/dist/zonos-elements/p-4412b94b.system.entry.js +1 -0
  64. package/dist/zonos-elements/{p-d7b341e3.system.entry.js → p-49a3a2a5.system.entry.js} +1 -1
  65. package/dist/zonos-elements/{p-35b6b151.system.entry.js → p-5bef550e.system.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-76013796.system.entry.js → p-69bb9b53.system.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-6b7fa35e.system.js → p-6c380fa8.system.js} +1 -1
  68. package/dist/zonos-elements/{p-b5316c2c.entry.js → p-72513d54.entry.js} +1 -1
  69. package/dist/zonos-elements/p-7f21c1c4.entry.js +1 -0
  70. package/dist/zonos-elements/{p-a858a304.entry.js → p-7fce2a19.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-092961f1.system.js → p-89d2a27b.system.js} +1 -1
  72. package/dist/zonos-elements/{p-01604d44.entry.js → p-92f1cf70.entry.js} +1 -1
  73. package/dist/zonos-elements/{p-133595ff.system.entry.js → p-94589f18.system.entry.js} +1 -1
  74. package/dist/zonos-elements/{p-3b3cb2a4.entry.js → p-9f36076f.entry.js} +1 -1
  75. package/dist/zonos-elements/{p-51e2df70.entry.js → p-a7b6fd9c.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-95241447.entry.js → p-b58f4433.entry.js} +1 -1
  77. package/dist/zonos-elements/{p-5ebde561.system.entry.js → p-c0a7750c.system.entry.js} +1 -1
  78. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  79. package/dist/zonos-elements/{p-ee8b5e53.js → p-cb9ff4df.js} +1 -1
  80. package/dist/zonos-elements/{p-64b67900.entry.js → p-d33a87fc.entry.js} +1 -1
  81. package/dist/zonos-elements/{p-08fee913.system.js → p-d7cf2a25.system.js} +1 -1
  82. package/dist/zonos-elements/{p-cbb742ab.js → p-d81f35bf.js} +2 -2
  83. package/dist/zonos-elements/{p-c37b99dd.system.entry.js → p-e05eed8e.system.entry.js} +1 -1
  84. package/dist/zonos-elements/{p-e78c2429.entry.js → p-e6129027.entry.js} +1 -1
  85. package/dist/zonos-elements/{p-710ac059.js → p-f7ec6999.js} +1 -1
  86. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  87. package/package.json +1 -1
  88. package/dist/zonos-elements/p-a26a8ca5.system.entry.js +0 -1
  89. package/dist/zonos-elements/p-de6c2a4a.entry.js +0 -1
@@ -9297,13 +9297,16 @@ const stripeStorePrefetchLandedCost = async (params) => {
9297
9297
  if (subtotals) {
9298
9298
  // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
9299
9299
  cartStoreApplySubtotals({
9300
- adjustments: subtotals.adjustments,
9301
- exchangeRate: subtotals.exchangeRate,
9302
- items: subtotals.items,
9303
- landedCostTotal: subtotals.landedCostTotal,
9304
- presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
9305
- shipping: subtotals.shipping,
9306
- total: subtotals.total,
9300
+ method: (matchLandedCost === null || matchLandedCost === void 0 ? void 0 : matchLandedCost.landedCost.method) || 'DDP',
9301
+ subtotals: {
9302
+ adjustments: subtotals.adjustments,
9303
+ exchangeRate: subtotals.exchangeRate,
9304
+ items: subtotals.items,
9305
+ landedCostTotal: subtotals.landedCostTotal,
9306
+ presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
9307
+ shipping: subtotals.shipping,
9308
+ total: subtotals.total,
9309
+ },
9307
9310
  });
9308
9311
  }
9309
9312
  }
@@ -9424,7 +9427,7 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
9424
9427
  };
9425
9428
  };
9426
9429
  const stripeStoreConfirmPayment = async () => {
9427
- var _a, _b, _c, _d;
9430
+ var _a, _b;
9428
9431
  const stripePaymentReady = !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
9429
9432
  const stripeElements = stripeStore.stripeElements;
9430
9433
  const stripe = stripeStore.stripe;
@@ -9435,7 +9438,6 @@ const stripeStoreConfirmPayment = async () => {
9435
9438
  if (stripe && stripeElements && stripePaymentReady && stripeClientSecret) {
9436
9439
  const { error } = await stripe.confirmPayment({
9437
9440
  confirmParams: {
9438
- receipt_email: (_d = (_c = stripeStore.stripeLinkEventData) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.email,
9439
9441
  return_url: window.location.href,
9440
9442
  },
9441
9443
  elements: stripeElements,
@@ -9461,7 +9463,7 @@ const stripeStoreConfirmPayment = async () => {
9461
9463
  * @returns {boolean} whether or not the checkout session is successfully created
9462
9464
  */
9463
9465
  const stripeStoreInitCheckoutSession = async () => {
9464
- var _a;
9466
+ var _a, _b;
9465
9467
  const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
9466
9468
  if (!total || !localizationStore.targetCurrency) {
9467
9469
  handleFetch.logError('Failed to create checkout session - invalid total or currency');
@@ -9489,7 +9491,10 @@ const stripeStoreInitCheckoutSession = async () => {
9489
9491
  // update cart store with updated information
9490
9492
  cartStoreSetCheckoutSession(result);
9491
9493
  stripeStore.clientSecret = result.clientSecret;
9492
- cartStoreApplySubtotals(Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }));
9494
+ cartStoreApplySubtotals({
9495
+ method: ((_b = result.landedCost) === null || _b === void 0 ? void 0 : _b.method) || 'DDP',
9496
+ subtotals: Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }),
9497
+ });
9493
9498
  handleFetch.log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
9494
9499
  handleFetch.log('done-init-checkout-session');
9495
9500
  return true;
@@ -9656,8 +9661,8 @@ const { onChange, reset, state: cartStore, } = zonosStore.createStore(() => ({
9656
9661
  checkoutTimeoutInterval: null,
9657
9662
  currency: 'USD',
9658
9663
  doneSteps: [],
9659
- dutiesTaxesFees: 0,
9660
- dutiesTaxesFeesEstimate: 0,
9664
+ dutiesTaxesFees: null,
9665
+ dutiesTaxesFeesEstimate: null,
9661
9666
  error: null,
9662
9667
  exchangeRate: null,
9663
9668
  externalConfirmationPageURL: null,
@@ -9781,15 +9786,16 @@ const cartStoreUpdateToErrorState = ({ messages, title, }) => {
9781
9786
  title,
9782
9787
  };
9783
9788
  };
9784
- const cartStoreApplySubtotals = (subtotals, dutiesTaxesFeesEstimate) => {
9789
+ const cartStoreApplySubtotals = ({ dutiesTaxesFeesEstimate, method, subtotals, }) => {
9785
9790
  // update exchange rate so we can use it to display cart items
9786
9791
  cartStore.exchangeRate = subtotals.exchangeRate;
9787
9792
  cartStore.adjustmentTotal = subtotals.adjustments;
9788
- cartStore.dutiesTaxesFees = subtotals.landedCostTotal;
9793
+ cartStore.dutiesTaxesFees =
9794
+ method === 'DAP' ? null : subtotals.landedCostTotal;
9789
9795
  cartStore.subtotal = subtotals.items;
9790
9796
  cartStore.total = subtotals.total;
9791
9797
  cartStore.currency = subtotals.presentmentCurrencyCode;
9792
- cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate || 0;
9798
+ cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate || null;
9793
9799
  };
9794
9800
  /**
9795
9801
  * Detect if there are any items in cart that are not restricted and have positive amount, exclude negative amount items
@@ -9813,10 +9819,15 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
9813
9819
  }
9814
9820
  };
9815
9821
  const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
9822
+ var _a;
9816
9823
  if (landedCostId && cartStore.selectedLandedCost) {
9817
9824
  // update cart total right away if we have landed cost id to avoid order total flickering
9818
9825
  const subtotals = cartStore.selectedLandedCost.subtotals;
9819
- cartStoreApplySubtotals(subtotals, dutiesTaxesFeesEstimate);
9826
+ cartStoreApplySubtotals({
9827
+ dutiesTaxesFeesEstimate,
9828
+ method: cartStore.landedCostMethod,
9829
+ subtotals,
9830
+ });
9820
9831
  handleFetch.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
9821
9832
  }
9822
9833
  // update checkout session
@@ -9847,7 +9858,10 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
9847
9858
  if (!landedCostId) {
9848
9859
  // This is when we first open the checkout modal and we just want to get info from the old cart session.
9849
9860
  // use subtotals from checkout session to update cart total
9850
- cartStoreApplySubtotals(json.checkoutSessionUpdate.subtotals);
9861
+ cartStoreApplySubtotals({
9862
+ method: ((_a = json.checkoutSessionUpdate.landedCost) === null || _a === void 0 ? void 0 : _a.method) || 'DDP',
9863
+ subtotals: json.checkoutSessionUpdate.subtotals,
9864
+ });
9851
9865
  handleFetch.log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
9852
9866
  }
9853
9867
  cartStoreSetCheckoutSession(json.checkoutSessionUpdate);
@@ -9872,12 +9886,13 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
9872
9886
  // do nothing if we can't find landed cost for selected shipping option
9873
9887
  return false;
9874
9888
  }
9875
- // If the quote is DAP, get the estimate from the corresponding DDP quote if available
9876
- const correspondingDdpQuote = (_b = cartStore.landedCostData) === null || _b === void 0 ? void 0 : _b.find(x => x.landedCost.shipmentRating.id === selectedShippingOption.id &&
9877
- x.landedCost.method === 'DDP');
9878
- const dutiesTaxesFeesEstimate = correspondingDdpQuote === null || correspondingDdpQuote === void 0 ? void 0 : correspondingDdpQuote.subtotals.landedCostTotal;
9889
+ // If the quote is DAP, then convert manually.
9890
+ const landedCostAmount = ((_b = selectedLandedCost.landedCost.amountSubtotals) === null || _b === void 0 ? void 0 : _b.landedCostTotal) || 0;
9891
+ // Convert using checkout presentment exchange rate
9892
+ const exchangeRate = selectedLandedCost.subtotals.exchangeRate.rate;
9893
+ const dutiesTaxesFeesEstimate = landedCostAmount * exchangeRate;
9879
9894
  if (dutiesTaxesFeesEstimate) {
9880
- handleFetch.log(`DAP quote, using estimate from DDP quote: ${dutiesTaxesFeesEstimate}`, 'info');
9895
+ handleFetch.log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
9881
9896
  }
9882
9897
  cartStore.landedCostMethod = selectedLandedCost.landedCost.method || 'DDP';
9883
9898
  // update shipping value and dutiesTaxFees on selectedShippingOption change
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-fc426d98.js');
3
+ const cart = require('./cart-120d68f9.js');
4
4
  const zonosStore = require('./zonosStore-a4395972.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
 
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
97
97
  return null;
98
98
  }
99
99
  const qaUrl = extractZonosQaUrl(window.location.href);
100
- const cdnUrl = "https://v1.3.85.js.zonos.com";
100
+ const cdnUrl = "https://v1.3.87.js.zonos.com";
101
101
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
102
102
  if (!qaUrl &&
103
103
  (cdnUrl.includes('test.') ||
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
281
281
  }
282
282
  return null;
283
283
  })();
284
- const ZONOS_URL = "https://v1.3.85.js.zonos.com";
285
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.85";
286
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.85";
287
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.85";
284
+ const ZONOS_URL = "https://v1.3.87.js.zonos.com";
285
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.87";
286
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.87";
287
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.87";
288
288
  const INTER_FONT_URL = 'https://rsms.me';
289
289
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
290
290
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
299
299
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
300
300
  Zonos._paypalMockResponse = null;
301
301
  Zonos.isBigCommerce = false;
302
- Zonos.releaseDate = "1728761799096";
302
+ Zonos.releaseDate = "1728918962245";
303
303
  Zonos.isLegacyCheckout = false;
304
304
  /**
305
305
  * By default, the package will load from npm
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
307
307
  Zonos.isNpm = true;
308
308
  Zonos.zonosQaUrl = null;
309
309
  Zonos.zonosQaUrlApi = null;
310
- Zonos.version = `v${"1.3.85"}`;
310
+ Zonos.version = `v${"1.3.87"}`;
311
311
  Zonos.modeAlerted = false;
312
312
  Zonos.cartData = null;
313
313
  Zonos.paypal = null;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-a4395972.js');
4
- const cart = require('./cart-fc426d98.js');
4
+ const cart = require('./cart-120d68f9.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
  const isDarkColor = require('./isDarkColor-5efc8367.js');
7
7
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-1fe5ed0c.js');
8
+ const paypal = require('./paypal-875cfaf1.js');
9
9
  const zonosStore = require('./zonosStore-a4395972.js');
10
- const createCustomEvent = require('./createCustomEvent-354c8e63.js');
10
+ const createCustomEvent = require('./createCustomEvent-ed9156dc.js');
11
11
  const getBorderRadius = require('./getBorderRadius-5a64574c.js');
12
12
  const handleFetch = require('./handleFetch-45e76490.js');
13
13
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
@@ -172,14 +172,14 @@ const ZonosCartSubtotal = class {
172
172
  };
173
173
  const renderLandedCost = () => {
174
174
  if (cart.cartStore.landedCostMethod === 'DAP') {
175
- return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), cart.cartStore.dutiesTaxesFeesEstimate
175
+ return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), cart.cartStore.dutiesTaxesFeesEstimate !== null
176
176
  ? `${cart.translate('Estimated')} ${cart.currencyFormat({
177
177
  amount: cart.cartStore.dutiesTaxesFeesEstimate,
178
178
  currency: cart.cartStore.currency,
179
179
  })}`
180
180
  : '-'), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.translate('Due at delivery')))));
181
181
  }
182
- return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), index.h("zonos-text", { class: "zonos--caption", type: "caption" }, cart.translate('Nothing due at the door'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.cartStore.dutiesTaxesFees
182
+ return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.translate('Duties, taxes, and fees')), index.h("zonos-text", { class: "zonos--caption", type: "caption" }, cart.translate('Nothing due at the door'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.cartStore.dutiesTaxesFees !== null
183
183
  ? cart.currencyFormat({
184
184
  amount: cart.cartStore.dutiesTaxesFees,
185
185
  currency: cart.cartStore.currency,
@@ -1228,13 +1228,13 @@ const ZonosShipping = class {
1228
1228
  if (this.showErrorBanner) {
1229
1229
  this.showErrorBanner = !this.handleValidate();
1230
1230
  }
1231
- return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
1232
- !defaultShownServiceLevels.length) && (index.h("button", { class: classes.classes([
1231
+ return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
1232
+ !!this.serviceLevelsDAP.length && (index.h("button", { class: classes.classes([
1233
1233
  'zonos--shipping-options-collapse-trigger',
1234
1234
  this.collapsedDAPOptions && 'collapsed',
1235
1235
  ]), onClick: () => {
1236
1236
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
1237
- } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, index.h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
1237
+ } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, index.h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
1238
1238
  // use primary type when on mobile mode
1239
1239
  variant: this.submitBtnType }, cart.translate('Go to payment'))))));
1240
1240
  }
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
7
- const paypal = require('./paypal-1fe5ed0c.js');
6
+ const cart = require('./cart-120d68f9.js');
7
+ const paypal = require('./paypal-875cfaf1.js');
8
8
  const zonosStore = require('./zonosStore-a4395972.js');
9
- const createCustomEvent = require('./createCustomEvent-354c8e63.js');
9
+ const createCustomEvent = require('./createCustomEvent-ed9156dc.js');
10
10
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
11
11
  const handleFetch = require('./handleFetch-45e76490.js');
12
12
  const classes = require('./classes-b7918f56.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
- const cart = require('./cart-fc426d98.js');
7
+ const cart = require('./cart-120d68f9.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-fc426d98.js');
6
+ const cart = require('./cart-120d68f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const cart = require('./cart-fc426d98.js');
8
+ const cart = require('./cart-120d68f9.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
- const paypal = require('./paypal-1fe5ed0c.js');
10
+ const paypal = require('./paypal-875cfaf1.js');
11
11
  require('./isDarkColor-5efc8367.js');
12
12
  require('./getBorderRadius-5a64574c.js');
13
13
 
@@ -40,14 +40,14 @@ export class ZonosCartSubtotal {
40
40
  };
41
41
  const renderLandedCost = () => {
42
42
  if (cartStore.landedCostMethod === 'DAP') {
43
- return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate
43
+ return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate !== null
44
44
  ? `${translate('Estimated')} ${currencyFormat({
45
45
  amount: cartStore.dutiesTaxesFeesEstimate,
46
46
  currency: cartStore.currency,
47
47
  })}`
48
48
  : '-'), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, translate('Due at delivery')))));
49
49
  }
50
- return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees
50
+ return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
51
51
  ? currencyFormat({
52
52
  amount: cartStore.dutiesTaxesFees,
53
53
  currency: cartStore.currency,
@@ -146,13 +146,13 @@ export class ZonosShipping {
146
146
  if (this.showErrorBanner) {
147
147
  this.showErrorBanner = !this.handleValidate();
148
148
  }
149
- return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
150
- !defaultShownServiceLevels.length) && (h("button", { class: classes([
149
+ return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
150
+ !!this.serviceLevelsDAP.length && (h("button", { class: classes([
151
151
  'zonos--shipping-options-collapse-trigger',
152
152
  this.collapsedDAPOptions && 'collapsed',
153
153
  ]), onClick: () => {
154
154
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
155
- } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
155
+ } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
156
156
  // use primary type when on mobile mode
157
157
  variant: this.submitBtnType }, translate('Go to payment'))))));
158
158
  }
@@ -13,8 +13,8 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
13
13
  checkoutTimeoutInterval: null,
14
14
  currency: 'USD',
15
15
  doneSteps: [],
16
- dutiesTaxesFees: 0,
17
- dutiesTaxesFeesEstimate: 0,
16
+ dutiesTaxesFees: null,
17
+ dutiesTaxesFeesEstimate: null,
18
18
  error: null,
19
19
  exchangeRate: null,
20
20
  externalConfirmationPageURL: null,
@@ -138,15 +138,16 @@ const cartStoreUpdateToErrorState = ({ messages, title, }) => {
138
138
  title,
139
139
  };
140
140
  };
141
- const cartStoreApplySubtotals = (subtotals, dutiesTaxesFeesEstimate) => {
141
+ const cartStoreApplySubtotals = ({ dutiesTaxesFeesEstimate, method, subtotals, }) => {
142
142
  // update exchange rate so we can use it to display cart items
143
143
  cartStore.exchangeRate = subtotals.exchangeRate;
144
144
  cartStore.adjustmentTotal = subtotals.adjustments;
145
- cartStore.dutiesTaxesFees = subtotals.landedCostTotal;
145
+ cartStore.dutiesTaxesFees =
146
+ method === 'DAP' ? null : subtotals.landedCostTotal;
146
147
  cartStore.subtotal = subtotals.items;
147
148
  cartStore.total = subtotals.total;
148
149
  cartStore.currency = subtotals.presentmentCurrencyCode;
149
- cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate || 0;
150
+ cartStore.dutiesTaxesFeesEstimate = dutiesTaxesFeesEstimate || null;
150
151
  };
151
152
  /**
152
153
  * Detect if there are any items in cart that are not restricted and have positive amount, exclude negative amount items
@@ -170,10 +171,15 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
170
171
  }
171
172
  };
172
173
  const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
174
+ var _a;
173
175
  if (landedCostId && cartStore.selectedLandedCost) {
174
176
  // update cart total right away if we have landed cost id to avoid order total flickering
175
177
  const subtotals = cartStore.selectedLandedCost.subtotals;
176
- cartStoreApplySubtotals(subtotals, dutiesTaxesFeesEstimate);
178
+ cartStoreApplySubtotals({
179
+ dutiesTaxesFeesEstimate,
180
+ method: cartStore.landedCostMethod,
181
+ subtotals,
182
+ });
177
183
  log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
178
184
  }
179
185
  // update checkout session
@@ -204,7 +210,10 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
204
210
  if (!landedCostId) {
205
211
  // This is when we first open the checkout modal and we just want to get info from the old cart session.
206
212
  // use subtotals from checkout session to update cart total
207
- cartStoreApplySubtotals(json.checkoutSessionUpdate.subtotals);
213
+ cartStoreApplySubtotals({
214
+ method: ((_a = json.checkoutSessionUpdate.landedCost) === null || _a === void 0 ? void 0 : _a.method) || 'DDP',
215
+ subtotals: json.checkoutSessionUpdate.subtotals,
216
+ });
208
217
  log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
209
218
  }
210
219
  cartStoreSetCheckoutSession(json.checkoutSessionUpdate);
@@ -229,12 +238,13 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
229
238
  // do nothing if we can't find landed cost for selected shipping option
230
239
  return false;
231
240
  }
232
- // If the quote is DAP, get the estimate from the corresponding DDP quote if available
233
- const correspondingDdpQuote = (_b = cartStore.landedCostData) === null || _b === void 0 ? void 0 : _b.find(x => x.landedCost.shipmentRating.id === selectedShippingOption.id &&
234
- x.landedCost.method === 'DDP');
235
- const dutiesTaxesFeesEstimate = correspondingDdpQuote === null || correspondingDdpQuote === void 0 ? void 0 : correspondingDdpQuote.subtotals.landedCostTotal;
241
+ // If the quote is DAP, then convert manually.
242
+ const landedCostAmount = ((_b = selectedLandedCost.landedCost.amountSubtotals) === null || _b === void 0 ? void 0 : _b.landedCostTotal) || 0;
243
+ // Convert using checkout presentment exchange rate
244
+ const exchangeRate = selectedLandedCost.subtotals.exchangeRate.rate;
245
+ const dutiesTaxesFeesEstimate = landedCostAmount * exchangeRate;
236
246
  if (dutiesTaxesFeesEstimate) {
237
- log(`DAP quote, using estimate from DDP quote: ${dutiesTaxesFeesEstimate}`, 'info');
247
+ log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
238
248
  }
239
249
  cartStore.landedCostMethod = selectedLandedCost.landedCost.method || 'DDP';
240
250
  // update shipping value and dutiesTaxFees on selectedShippingOption change
@@ -243,13 +243,16 @@ const stripeStorePrefetchLandedCost = async (params) => {
243
243
  if (subtotals) {
244
244
  // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
245
245
  cartStoreApplySubtotals({
246
- adjustments: subtotals.adjustments,
247
- exchangeRate: subtotals.exchangeRate,
248
- items: subtotals.items,
249
- landedCostTotal: subtotals.landedCostTotal,
250
- presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
251
- shipping: subtotals.shipping,
252
- total: subtotals.total,
246
+ method: (matchLandedCost === null || matchLandedCost === void 0 ? void 0 : matchLandedCost.landedCost.method) || 'DDP',
247
+ subtotals: {
248
+ adjustments: subtotals.adjustments,
249
+ exchangeRate: subtotals.exchangeRate,
250
+ items: subtotals.items,
251
+ landedCostTotal: subtotals.landedCostTotal,
252
+ presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
253
+ shipping: subtotals.shipping,
254
+ total: subtotals.total,
255
+ },
253
256
  });
254
257
  }
255
258
  }
@@ -370,7 +373,7 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
370
373
  };
371
374
  };
372
375
  const stripeStoreConfirmPayment = async () => {
373
- var _a, _b, _c, _d;
376
+ var _a, _b;
374
377
  const stripePaymentReady = !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
375
378
  const stripeElements = stripeStore.stripeElements;
376
379
  const stripe = stripeStore.stripe;
@@ -381,7 +384,6 @@ const stripeStoreConfirmPayment = async () => {
381
384
  if (stripe && stripeElements && stripePaymentReady && stripeClientSecret) {
382
385
  const { error } = await stripe.confirmPayment({
383
386
  confirmParams: {
384
- receipt_email: (_d = (_c = stripeStore.stripeLinkEventData) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.email,
385
387
  return_url: window.location.href,
386
388
  },
387
389
  elements: stripeElements,
@@ -407,7 +409,7 @@ const stripeStoreConfirmPayment = async () => {
407
409
  * @returns {boolean} whether or not the checkout session is successfully created
408
410
  */
409
411
  const stripeStoreInitCheckoutSession = async () => {
410
- var _a;
412
+ var _a, _b;
411
413
  const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
412
414
  if (!total || !localizationStore.targetCurrency) {
413
415
  logError('Failed to create checkout session - invalid total or currency');
@@ -435,7 +437,10 @@ const stripeStoreInitCheckoutSession = async () => {
435
437
  // update cart store with updated information
436
438
  cartStoreSetCheckoutSession(result);
437
439
  stripeStore.clientSecret = result.clientSecret;
438
- cartStoreApplySubtotals(Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }));
440
+ cartStoreApplySubtotals({
441
+ method: ((_b = result.landedCost) === null || _b === void 0 ? void 0 : _b.method) || 'DDP',
442
+ subtotals: Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }),
443
+ });
439
444
  log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
440
445
  log('done-init-checkout-session');
441
446
  return true;
@@ -466,6 +466,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
466
466
  createScriptLoadEvent(variables, requestHeaders) {
467
467
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createScriptLoadEvent', 'mutation');
468
468
  },
469
+ createStoreVersionSetting(variables, requestHeaders) {
470
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createStoreVersionSetting', 'mutation');
471
+ },
469
472
  deleteAllStoreReserveOrders(variables, requestHeaders) {
470
473
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'deleteAllStoreReserveOrders', 'mutation');
471
474
  },
@@ -514,8 +517,8 @@ export function getSdk(client, withWrapper = defaultWrapper) {
514
517
  localeCountryMessages(variables, requestHeaders) {
515
518
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'localeCountryMessages', 'query');
516
519
  },
517
- updateCacheStoreVersion(variables, requestHeaders) {
518
- return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateCacheStoreVersion', 'mutation');
520
+ storeVersionSetting(variables, requestHeaders) {
521
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'storeVersionSetting', 'query');
519
522
  },
520
523
  updateReserveOrder(variables, requestHeaders) {
521
524
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateReserveOrder', 'mutation');
@@ -523,8 +526,5 @@ export function getSdk(client, withWrapper = defaultWrapper) {
523
526
  upsertBigCommerceSettings(variables, requestHeaders) {
524
527
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'upsertBigCommerceSettings', 'mutation');
525
528
  },
526
- zonosElementsSetting(variables, requestHeaders) {
527
- return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'zonosElementsSetting', 'query');
528
- },
529
529
  };
530
530
  }