@zonos/elements 1.3.171 → 1.3.173

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 (133) hide show
  1. package/dist/cjs/{CheckoutConfig-f5e68e14.js → CheckoutConfig-c5943bbf.js} +1 -1
  2. package/dist/cjs/{cart-36799bbe.js → cart-d9052930.js} +21 -8
  3. package/dist/cjs/{handleFetch-7b7f9f7c.js → handleFetch-ff25db40.js} +10 -6
  4. package/dist/cjs/index.cjs.js +9 -9
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{paypal-3eae38bd.js → paypal-31477331.js} +6 -2
  7. package/dist/cjs/zonos-address_7.cjs.entry.js +61 -19
  8. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +20 -12
  9. package/dist/cjs/zonos-checkout.cjs.entry.js +106 -36
  10. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-elements.cjs.js +1 -1
  14. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +20 -4
  15. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  18. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +10 -6
  19. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +114 -37
  20. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +10 -6
  21. package/dist/collection/components/store/checkout/cart.js +5 -0
  22. package/dist/collection/components/store/checkout/paypal.js +5 -0
  23. package/dist/collection/components/store/checkout/stripe.js +12 -7
  24. package/dist/collection/components/stripe/zonos-address/zonos-address.js +37 -16
  25. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +27 -4
  26. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +22 -2
  27. package/dist/collection/components/utils/api/trackConversionEvent.js +1 -0
  28. package/dist/collection/components/utils/handleFetch.js +9 -6
  29. package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +1 -0
  30. package/dist/collection/styles/stripe/defaultVariable.js +2 -0
  31. package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
  32. package/dist/collection/types/generated/graphql.internal.types.js +16 -0
  33. package/dist/esm/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
  34. package/dist/esm/{cart-b2e57589.js → cart-fff4f4a4.js} +21 -8
  35. package/dist/esm/{handleFetch-8d72c8cd.js → handleFetch-0109fb78.js} +10 -6
  36. package/dist/esm/index.js +10 -10
  37. package/dist/esm/loader.js +1 -1
  38. package/dist/esm/{paypal-38da5d52.js → paypal-087fbd16.js} +6 -2
  39. package/dist/esm/zonos-address_7.entry.js +61 -19
  40. package/dist/esm/zonos-cart-items_13.entry.js +20 -12
  41. package/dist/esm/zonos-checkout.entry.js +106 -36
  42. package/dist/esm/zonos-controller.entry.js +2 -2
  43. package/dist/esm/zonos-country-flag.entry.js +2 -2
  44. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  45. package/dist/esm/zonos-elements.js +1 -1
  46. package/dist/esm/zonos-empty-state-payment_4.entry.js +20 -4
  47. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  48. package/dist/esm/zonos-hello.entry.js +2 -2
  49. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  50. package/dist/esm-es5/{CheckoutConfig-2994efd9.js → CheckoutConfig-75af3742.js} +1 -1
  51. package/dist/esm-es5/{cart-b2e57589.js → cart-fff4f4a4.js} +1 -1
  52. package/dist/esm-es5/handleFetch-0109fb78.js +1 -0
  53. package/dist/esm-es5/index.js +1 -1
  54. package/dist/esm-es5/loader.js +1 -1
  55. package/dist/esm-es5/{paypal-38da5d52.js → paypal-087fbd16.js} +2 -2
  56. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  57. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  58. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  59. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  60. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  61. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  62. package/dist/esm-es5/zonos-elements.js +1 -1
  63. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  64. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  65. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  66. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  67. package/dist/scripts/index.d.ts +26 -6
  68. package/dist/scripts/index.js +1 -1
  69. package/dist/scripts/loadZonos.js +1 -1
  70. package/dist/scripts/zonos.js +1 -1
  71. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +17 -3
  72. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +1 -1
  73. package/dist/types/components/store/checkout/cart.d.ts +4 -0
  74. package/dist/types/components/store/checkout/stripe.d.ts +10 -1
  75. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +6 -2
  76. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +1 -1
  77. package/dist/types/components/stripe/zonos-payment/zonos-payment.d.ts +3 -0
  78. package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +1 -0
  79. package/dist/types/components.d.ts +8 -6
  80. package/dist/types/types/ConversionEvent.d.ts +2 -1
  81. package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -0
  82. package/dist/types/types/checkout/api/CheckoutSession.d.ts +8 -0
  83. package/dist/types/types/generated/graphql.frontend.types.d.ts +92 -0
  84. package/dist/types/types/generated/graphql.frontend.types.ts +106 -0
  85. package/dist/types/types/generated/graphql.internal.types.d.ts +124 -0
  86. package/dist/types/types/generated/graphql.internal.types.ts +154 -0
  87. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  88. package/dist/zonos-elements/index.esm.js +1 -1
  89. package/dist/zonos-elements/{p-0bfca3a9.system.entry.js → p-0078362c.system.entry.js} +1 -1
  90. package/dist/zonos-elements/p-033817e3.system.entry.js +1 -0
  91. package/dist/zonos-elements/p-04c38987.system.js +1 -0
  92. package/dist/zonos-elements/{p-cb52cfdf.entry.js → p-0db19b02.entry.js} +1 -1
  93. package/dist/zonos-elements/p-1b5a2714.system.entry.js +1 -0
  94. package/dist/zonos-elements/{p-1edbfb1f.system.entry.js → p-1be7b435.system.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-47f79a6d.js → p-1c488ecf.js} +1 -1
  96. package/dist/zonos-elements/{p-c5c2976f.system.js → p-2ebb4fa7.system.js} +1 -1
  97. package/dist/zonos-elements/{p-1a20922f.system.entry.js → p-31ce9143.system.entry.js} +1 -1
  98. package/dist/zonos-elements/{p-a3888f1d.system.js → p-38f6f6fd.system.js} +1 -1
  99. package/dist/zonos-elements/{p-b0c39400.entry.js → p-407a96d2.entry.js} +1 -1
  100. package/dist/zonos-elements/p-427c2766.entry.js +1 -0
  101. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  102. package/dist/zonos-elements/{p-0def1397.system.entry.js → p-514431e9.system.entry.js} +1 -1
  103. package/dist/zonos-elements/p-5275b7ca.system.entry.js +1 -0
  104. package/dist/zonos-elements/p-5edc11be.system.entry.js +1 -0
  105. package/dist/zonos-elements/{p-461ca324.entry.js → p-67ca7373.entry.js} +1 -1
  106. package/dist/zonos-elements/{p-864c7c7d.entry.js → p-73a7b89b.entry.js} +1 -1
  107. package/dist/zonos-elements/{p-ecd4ec15.system.js → p-759a654a.system.js} +1 -1
  108. package/dist/zonos-elements/{p-bfa028a2.entry.js → p-7862da71.entry.js} +1 -1
  109. package/dist/zonos-elements/p-78b81404.system.js +17 -0
  110. package/dist/zonos-elements/p-839448c3.js +1 -0
  111. package/dist/zonos-elements/p-8b33c3b7.entry.js +1 -0
  112. package/dist/zonos-elements/{p-56a8b1f6.system.entry.js → p-a83370c6.system.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-ff1c6d9a.entry.js → p-a9d7746a.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-c82f488b.system.entry.js → p-ada6e691.system.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-dd0259f4.js → p-bfd6e156.js} +1 -1
  116. package/dist/zonos-elements/p-cbd2bd33.js +17 -0
  117. package/dist/zonos-elements/p-ef9fdf45.entry.js +1 -0
  118. package/dist/zonos-elements/p-f6c0da8b.entry.js +1 -0
  119. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  120. package/package.json +1 -1
  121. package/dist/esm-es5/handleFetch-8d72c8cd.js +0 -1
  122. package/dist/zonos-elements/p-00ad3c73.entry.js +0 -1
  123. package/dist/zonos-elements/p-173d1fcd.system.entry.js +0 -1
  124. package/dist/zonos-elements/p-48173901.js +0 -17
  125. package/dist/zonos-elements/p-53cb8867.system.entry.js +0 -1
  126. package/dist/zonos-elements/p-56758218.system.entry.js +0 -1
  127. package/dist/zonos-elements/p-71539c8a.js +0 -1
  128. package/dist/zonos-elements/p-9261869c.system.js +0 -1
  129. package/dist/zonos-elements/p-934164df.entry.js +0 -1
  130. package/dist/zonos-elements/p-9f9e4f74.entry.js +0 -1
  131. package/dist/zonos-elements/p-bf113a46.system.js +0 -17
  132. package/dist/zonos-elements/p-e09cea9c.entry.js +0 -1
  133. package/dist/zonos-elements/p-fd352222.system.entry.js +0 -1
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { f as stripeStore, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-b2e57589.js';
2
+ import { f as stripeStore, t as trackConversionEvent, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-fff4f4a4.js';
3
3
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
5
- import { b as logError, l as log } from './handleFetch-8d72c8cd.js';
5
+ import { b as logError, l as log } from './handleFetch-0109fb78.js';
6
6
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
8
  import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
@@ -20,9 +20,13 @@ const ZonosAddress = class {
20
20
  * Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
21
21
  */
22
22
  this.isAutoCompleteAdjusted = false;
23
+ /**
24
+ * Check if the tracking event is sent
25
+ */
26
+ this.trackingSent = false;
23
27
  this.type = undefined;
24
28
  this.titleText = undefined;
25
- this.defaultAddress = null;
29
+ this.defaultAddress = [];
26
30
  this.stripe = window.Zonos.stripe;
27
31
  this.isDirtyAddress = false;
28
32
  }
@@ -45,9 +49,14 @@ const ZonosAddress = class {
45
49
  case 'billing':
46
50
  stripeStore.stripeBillingAddressEventData = event;
47
51
  break;
48
- default:
52
+ default: {
53
+ if (event.complete && !this.trackingSent) {
54
+ void trackConversionEvent('checkout_customerInfoFilled');
55
+ this.trackingSent = true;
56
+ }
49
57
  stripeStore.stripeAddressEventData = event;
50
58
  break;
59
+ }
51
60
  }
52
61
  }
53
62
  updateAddressElement({ stripeAddressElement, type, }) {
@@ -58,19 +67,15 @@ const ZonosAddress = class {
58
67
  stripeStore.stripeBillingAddressElement = stripeAddressElement;
59
68
  }
60
69
  async watchInitStripe() {
61
- var _a, _b;
62
70
  this.stripe = window.Zonos.stripe;
63
71
  const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
64
72
  if (!this.stripe || !stripeElements) {
65
73
  logError("Stripe is not initialized. Couldn't load stripe element.");
66
74
  return;
67
75
  }
68
- const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
69
- if (!phone) {
70
- // remove phone from default address if it's not provided, stripe
71
- // will throw error if key phone exist and its value is empty or 'undefined'.
72
- (_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
73
- }
76
+ // remove phone from default address if it's not provided, stripe
77
+ // will throw error if key phone exist and its value is empty or 'undefined'.
78
+ const defaultAddress = this.defaultAddress.map(address => (Object.assign(Object.assign({}, address), { name: address.name, phone: address.phone || undefined })));
74
79
  const shippableCountries = localizationStore.shippingZoneCountries;
75
80
  const shippingZone = shippableCountries
76
81
  ? Object.values(shippableCountries).map(country => country.code)
@@ -84,8 +89,8 @@ const ZonosAddress = class {
84
89
  const addressElement = stripeElements.create('address', {
85
90
  allowedCountries: checkoutAllCountries ? [] : allowedCountries,
86
91
  // only show the default address if stripeAddressEventData is not provided
87
- contacts: this.defaultAddress && !stripeAddressEventData
88
- ? [this.defaultAddress]
92
+ contacts: defaultAddress.length && !stripeAddressEventData
93
+ ? this.defaultAddress
89
94
  : [],
90
95
  defaultValues: {
91
96
  address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
@@ -143,12 +148,27 @@ const ZonosAddress = class {
143
148
  type: this.type,
144
149
  });
145
150
  }
146
- defaultAddressChanged() {
151
+ defaultAddressChanged(oldAddress, newAddress) {
152
+ // check if stringified json of oldAddress is different from newAddress
153
+ const oldAddressString = JSON.stringify(oldAddress);
154
+ const newAddressString = JSON.stringify(newAddress);
155
+ // No need to reset address element if the default address is the same
156
+ if (oldAddressString === newAddressString) {
157
+ return;
158
+ }
147
159
  log('Reset address element when default address property is changed', 'info', {
148
160
  defaultAddress: this.defaultAddress,
149
161
  });
150
162
  const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
163
+ stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.clear();
151
164
  stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
165
+ // Reset stripe address event data
166
+ if (this.type === 'shipping') {
167
+ stripeStore.stripeAddressEventData = null;
168
+ }
169
+ else {
170
+ stripeStore.stripeBillingAddressEventData = null;
171
+ }
152
172
  void this.watchInitStripe();
153
173
  }
154
174
  renderCompanyNameInput() {
@@ -182,7 +202,7 @@ const ZonosAddress = class {
182
202
  }
183
203
  render() {
184
204
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
185
- return (h(Host, { key: '18d2602886588dfeb39c7c0386354671076dd9bf', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '9c4f704259e307932930995b14a9f2edd51dd3e3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), h("div", { key: '7b2031b0b29cc8153b9b6376f27ccd331cc46e7a', class: "zonos--address-component" })));
205
+ return (h(Host, { key: '9fd8e0ac4b86c10004c24e9d33f40ec577bd2a73', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'e7c3cbcab6f175354f26a8426d0dbf01afca736d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), h("div", { key: '48ccbb019255c5362adf4c7954a7c2e3b015bfa5', class: "zonos--address-component" })));
186
206
  }
187
207
  get el() { return getElement(this); }
188
208
  static get watchers() { return {
@@ -630,7 +650,7 @@ const ZonosLinkAuthentication = class {
630
650
  // Create and mount the Authentication Element in ${type} mode
631
651
  const linkAuthenticationElement = stripeStore.stripeLinkElement ||
632
652
  stripeStore.stripeElements.create('linkAuthentication', {
633
- defaultValues: defaultValues || undefined,
653
+ defaultValues: defaultValues,
634
654
  });
635
655
  const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
636
656
  if (!linkAuthenticationElementContainer) {
@@ -645,11 +665,33 @@ const ZonosLinkAuthentication = class {
645
665
  });
646
666
  stripeStore.stripeLinkElement = linkAuthenticationElement;
647
667
  }
648
- watchDefaultEmail() {
649
- if (!this.defaultEmail) {
668
+ watchDefaultEmail(newDefaultEmail, oldDefaultEmail) {
669
+ var _a, _b;
670
+ log('Default email is changed', 'info', {
671
+ newDefaultEmail,
672
+ oldDefaultEmail,
673
+ });
674
+ if (oldDefaultEmail === newDefaultEmail) {
650
675
  return;
651
676
  }
652
- this.setCustomEmailInputToLinkEvent(this.defaultEmail);
677
+ if (!newDefaultEmail) {
678
+ stripeStore.stripeLinkEventData = null;
679
+ }
680
+ // Only set value for Stripe input input to stripeLinkEventData when checkout is in staging mode
681
+ if (cartStore.isStagingMode) {
682
+ this.setCustomEmailInputToLinkEvent(newDefaultEmail || '');
683
+ return;
684
+ }
685
+ (_a = stripeStore.stripeLinkElement) === null || _a === void 0 ? void 0 : _a.clear();
686
+ (_b = stripeStore.stripeLinkElement) === null || _b === void 0 ? void 0 : _b.destroy();
687
+ stripeStore.stripeLinkElement = null;
688
+ stripeStore.stripeLinkEventData = null;
689
+ log('Reset stripe link element when default email is changed', 'info', {
690
+ defaultEmail: newDefaultEmail,
691
+ });
692
+ setTimeout(() => {
693
+ void this.watchInitStripe();
694
+ }, 5);
653
695
  }
654
696
  componentDidLoad() {
655
697
  // @Watch doesn't get trigger on initial load
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-d82f06f2.js';
2
- import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-b2e57589.js';
2
+ import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-fff4f4a4.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-38da5d52.js';
4
+ import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-087fbd16.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
6
- import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-8d72c8cd.js';
6
+ import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-0109fb78.js';
7
7
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
8
  import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
9
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
@@ -1483,9 +1483,10 @@ const ZonosCheckoutFinish = class {
1483
1483
  clientSecret,
1484
1484
  storybookForceStatus: this.storybookForceStatus,
1485
1485
  });
1486
- this.notificationType = error ? 'error' : 'success';
1486
+ const isError = status === 'requires_action' || error;
1487
+ this.notificationType = isError ? 'error' : 'success';
1487
1488
  this.notificationMessages = messages || [];
1488
- this.notificationTitle = error
1489
+ this.notificationTitle = isError
1489
1490
  ? translate('Payment failed')
1490
1491
  : translate("You're all set!");
1491
1492
  log('=== Payment intent retrieve status', 'info', {
@@ -1562,6 +1563,9 @@ const ZonosCheckoutFinish = class {
1562
1563
  // show success message right away when order id is already created
1563
1564
  this.isLoading = false;
1564
1565
  if (paypalStore.orderIdCreated) {
1566
+ submitGtag('zonos-checkout-success');
1567
+ // Make sure to send the event when order is completed
1568
+ await trackConversionEvent('checkout_orderCompleted');
1565
1569
  this.notificationType = 'success';
1566
1570
  this.notificationTitle = translate("You're all set!");
1567
1571
  this.notificationMessages =
@@ -1628,11 +1632,11 @@ const ZonosCheckoutFinish = class {
1628
1632
  }
1629
1633
  render() {
1630
1634
  const isTestMode = getIsTestMode();
1631
- return (h(Host, { key: 'afcb0314658af4d53e7d453415dd73fb01a8f162', class: "zonos--checkout-finish zonos--elements", style: {
1635
+ return (h(Host, { key: '4bb26161ad400a7bbd7b7e9f0568ac5de8f18004', class: "zonos--checkout-finish zonos--elements", style: {
1632
1636
  '--zonos--border-radius': getBorderRadius({
1633
1637
  overrideBorderStyle: this.borderRadius,
1634
1638
  }),
1635
- } }, !this.isLoading && (h("div", { key: '99b7b6c9dd0e0545d770e4d9ed54207f5c13fdfd', class: "zonos--finish-details" }, h("div", { key: '11d249514d0eef2f8419e66b1070a20e745b84fd', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'c8f52780e8ea76b5951aa4ad3dfc87c19acbfd1d', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '459d7c1a9bd6fd77cfda25e9500a89061874b58f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '4e34926ba96975ceff18016eb6bcad1906f1c773',
1639
+ } }, !this.isLoading && (h("div", { key: '85d3bf11c73dfd2b18d0a6d996f2c1f4a01a2288', class: "zonos--finish-details" }, h("div", { key: '0e4fb2b7cd03a4464dde3cce69932b8482da0d02', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '0ced9d9d83576979ae785be52c0ae07dca0fd5de', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'd14a6fbe02dc836512b41859cc8de573653c4884', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '5a80853fd1374fc72ccc2b416b62f6c52e4916dd',
1636
1640
  // Only show loading spinner if it's not an error notification
1637
1641
  loading: this.isWaitingToRedirect &&
1638
1642
  this.notificationType !== 'error', onClick: () => {
@@ -1644,9 +1648,9 @@ const ZonosCheckoutFinish = class {
1644
1648
  }
1645
1649
  this.closeClickHandler();
1646
1650
  }, size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
1647
- this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '836907a2a325d615d897e5292f086bf9111226ae', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
1651
+ this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: 'ba2fca63de8f04c76fa4d1bc96d06863fbad78cf', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
1648
1652
  cartStore.step === 'finish' &&
1649
- this.notificationType === 'success' && (h("div", { key: 'ea1b4dd65f89d3eaec6391b6e440ae8ca20d5bdb', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '350ee6b7fe58ff5e7a1584989e2df13ce5d243c6', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'd3578cef9a3f6cc69fff48ee412f7010d526c284', onClick: () => {
1653
+ this.notificationType === 'success' && (h("div", { key: '1e3cb2f2f5874b93886247af585566dbaad9a45f', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'f8603ae4e116da9f8adabe648a6f626b994f208a', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '91df622529ff650464b3694780e65d2d929548f9', onClick: () => {
1650
1654
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
1651
1655
  this.redirectToUrl(isZonosDashboard
1652
1656
  ? '/orders/all'
@@ -2335,7 +2339,7 @@ const ZonosCustomerInfo = class {
2335
2339
  this.submitBtnType = undefined;
2336
2340
  this.submitBtnColor = undefined;
2337
2341
  this.isMobile = false;
2338
- this.defaultAddress = null;
2342
+ this.defaultAddress = [];
2339
2343
  this.showErrorBanner = false;
2340
2344
  this.shippingCountry = '';
2341
2345
  this.isCheckingForRestrictedItems = false;
@@ -2392,7 +2396,7 @@ const ZonosCustomerInfo = class {
2392
2396
  } }), this.isTaxIdError && (h("zonos-text", { textColor: 'red-600', type: "caption" }, translate('Tax id is required')))));
2393
2397
  }
2394
2398
  render() {
2395
- var _a, _b;
2399
+ var _a, _b, _c, _d, _e, _f;
2396
2400
  if (!stripeStore.stripeElements) {
2397
2401
  return null;
2398
2402
  }
@@ -2411,11 +2415,15 @@ const ZonosCustomerInfo = class {
2411
2415
  const showBilling = !stripeStore.stripeShippingSameAsBilling;
2412
2416
  // Get theme for the update dialog, inherit from the theme, no from this component theme
2413
2417
  const theme = getZonosStoreTheme(zonosStore.appearance.theme);
2418
+ // Attempt to get the email from email from customer profile's locations, if not provided, just use the email from root customer profile
2419
+ const defaultEmail = ((_b = this.defaultAddress.find(Boolean)) === null || _b === void 0 ? void 0 : _b.email) ||
2420
+ ((_e = (_d = (_c = stripeStore.customerProfile) === null || _c === void 0 ? void 0 : _c.locations) === null || _d === void 0 ? void 0 : _d.find(Boolean)) === null || _e === void 0 ? void 0 : _e.email) ||
2421
+ ((_f = stripeStore.customerProfile) === null || _f === void 0 ? void 0 : _f.email);
2414
2422
  // start validate on typing after error banner is shown, and hide it if the form is complete
2415
2423
  if (this.showErrorBanner) {
2416
2424
  this.showErrorBanner = !this.handleValidate();
2417
2425
  }
2418
- return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail: (_b = this.defaultAddress) === null || _b === void 0 ? void 0 : _b.email, isEmailError: this.isEmailError, onLinkAuthenticationChange: this.handleEmailValidation, titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" }), this.renderTaxIdInput(this.shippingCountry), h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: stripeStore.stripeShippingSameAsBilling, label: translate('Shipping address same as billing'), onCheckboxSelected: e => {
2426
+ return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), h("zonos-link-authentication", { defaultEmail: defaultEmail, isEmailError: this.isEmailError, onLinkAuthenticationChange: this.handleEmailValidation, titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" }), this.renderTaxIdInput(this.shippingCountry), h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: stripeStore.stripeShippingSameAsBilling, label: translate('Shipping address same as billing'), onCheckboxSelected: e => {
2419
2427
  stripeStore.stripeShippingSameAsBilling = e.detail;
2420
2428
  } }), h("zonos-collapse", { collapsed: !showBilling }, h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Billing address'), type: "billing" })), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
2421
2429
  // use primary type when on mobile mode
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-d82f06f2.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-b2e57589.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-38da5d52.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-fff4f4a4.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-087fbd16.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-d3c5a0a5.js';
5
- import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, e as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-8d72c8cd.js';
5
+ import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, e as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-0109fb78.js';
6
6
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
8
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
10
10
  import { i as isDarkColor } from './isDarkColor-446fccb7.js';
11
11
  import { s as styles } from './styles-6fc2fad9.js';
12
- import { c as checkoutHiddenBtnSelector, s as setupCartData, d as domesticRedirectedBtnSelector } from './CheckoutConfig-2994efd9.js';
12
+ import { c as checkoutHiddenBtnSelector, s as setupCartData, d as domesticRedirectedBtnSelector } from './CheckoutConfig-75af3742.js';
13
13
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
14
14
 
15
15
  /**
@@ -395,13 +395,30 @@ const ZonosCheckout = class {
395
395
  settlementAmount: total,
396
396
  };
397
397
  };
398
+ this.getDefaultAddress = () => {
399
+ // If checkout customer is authenticated, use the address from the customer profile
400
+ if (this.defaultCustomerProfileAddress.length) {
401
+ return this.defaultCustomerProfileAddress;
402
+ }
403
+ // If default address is provided directly from the component, use it
404
+ if (Array.isArray(this.defaultAddress) && this.defaultAddress.length) {
405
+ return this.defaultAddress;
406
+ }
407
+ if (!Array.isArray(this.defaultAddress) &&
408
+ typeof this.defaultAddress === 'object') {
409
+ return [this.defaultAddress];
410
+ }
411
+ return this.defaultAddressParams;
412
+ };
398
413
  this.appearanceSettingsOverride = undefined;
399
414
  this.preview = false;
400
415
  this.mobile = false;
401
416
  this.overrideStagingMode = undefined;
402
- this.defaultAddress = null;
417
+ this.defaultAddress = [];
403
418
  this.forceDialogOpen = false;
404
- this.defaultAddressParams = null;
419
+ this.defaultAddressParams = [];
420
+ this.defaultCustomerProfileAddress = [];
421
+ this.customerProfile = null;
405
422
  this.open = this.forceDialogOpen;
406
423
  this.stripe = window.Zonos.stripe;
407
424
  this.submitLoading = false;
@@ -418,6 +435,7 @@ const ZonosCheckout = class {
418
435
  this.inventoryCheckErrorMessage = null;
419
436
  this.placedOrderInfo = null;
420
437
  this.clientSecret = stripeStore.clientSecret;
438
+ this.stripeCustomerSessionClientSecret = stripeStore.stripeCustomerSessionClientSecret;
421
439
  }
422
440
  /**
423
441
  * Init cart info handler event
@@ -478,6 +496,8 @@ const ZonosCheckout = class {
478
496
  cartId = cartIdResult.cartId;
479
497
  // set prefill address if provided in createCartId callback result
480
498
  this.useShippingDataFromCreateCartId(cartIdResult.shippingData);
499
+ cartStore.customerAuthenticationToken =
500
+ cartIdResult.customerAuthenticationToken || null;
481
501
  }
482
502
  else {
483
503
  cartId = cartIdResult;
@@ -692,11 +712,11 @@ const ZonosCheckout = class {
692
712
  isPreview: this.preview,
693
713
  sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
694
714
  });
715
+ submitGtag('zonos-checkout-start');
716
+ void trackConversionEvent('checkout_open');
695
717
  const { enabled } = await isStoreDiscountEnabled();
696
718
  // Hide discount input if there's no active discount configured for the store
697
719
  cartStore.shouldHideDiscountInput = !enabled;
698
- submitGtag('zonos-checkout-start');
699
- void trackConversionEvent('checkout_open');
700
720
  this.handleOrderDuplication();
701
721
  if (window.Zonos.isLegacyCheckout) {
702
722
  void sendLoadCheckoutFacadeLog();
@@ -836,7 +856,6 @@ const ZonosCheckout = class {
836
856
  const phone = address.customerPhone || '';
837
857
  const postal_code = address.customerZip || '';
838
858
  const state = address.customerState || '';
839
- const countryCode = country === 'UK' ? 'GB' : country;
840
859
  /**
841
860
  * If one of the value is null, no need to preset the default address.
842
861
  * City and state are optional (they are not always provided for example Puerto Rico)
@@ -852,19 +871,27 @@ const ZonosCheckout = class {
852
871
  .join(', '));
853
872
  return;
854
873
  }
855
- this.defaultAddressParams = {
856
- address: {
857
- city: city || '',
858
- country: countryCode,
859
- line1,
860
- line2,
861
- postal_code,
862
- state,
874
+ if (country &&
875
+ localizationStore.shippingZoneCountries &&
876
+ !(country in localizationStore.shippingZoneCountries)) {
877
+ log(`Country "${country}" is not in the shipping zone, so it can not be prefilled`, 'warn');
878
+ return;
879
+ }
880
+ this.defaultAddressParams = [
881
+ {
882
+ address: {
883
+ city: city || '',
884
+ country,
885
+ line1,
886
+ line2,
887
+ postal_code,
888
+ state,
889
+ },
890
+ email,
891
+ name,
892
+ phone,
863
893
  },
864
- email,
865
- name,
866
- phone,
867
- };
894
+ ];
868
895
  log('Prefill address applied', 'info', {
869
896
  prefillAddress: this.defaultAddressParams,
870
897
  providedAddress: address,
@@ -890,19 +917,21 @@ const ZonosCheckout = class {
890
917
  domesticRedirectedBtnSelector: domesticRedirectedBtnSelector,
891
918
  onShippingAddressSessionFound: shippingAddressSession => {
892
919
  // prefilled the default address if shipping address session is found for checkout on open
893
- this.defaultAddress = {
894
- address: {
895
- city: shippingAddressSession.city,
896
- country: shippingAddressSession.countryCode,
897
- line1: shippingAddressSession.address1,
898
- line2: shippingAddressSession.address2,
899
- postal_code: shippingAddressSession.postalCode,
900
- state: shippingAddressSession.state,
920
+ this.defaultAddress = [
921
+ {
922
+ address: {
923
+ city: shippingAddressSession.city,
924
+ country: shippingAddressSession.countryCode,
925
+ line1: shippingAddressSession.address1,
926
+ line2: shippingAddressSession.address2,
927
+ postal_code: shippingAddressSession.postalCode,
928
+ state: shippingAddressSession.state,
929
+ },
930
+ email: '',
931
+ name: `${shippingAddressSession.firstName} ${shippingAddressSession.lastName}`,
932
+ phone: shippingAddressSession.phone,
901
933
  },
902
- email: '',
903
- name: `${shippingAddressSession.firstName} ${shippingAddressSession.lastName}`,
904
- phone: shippingAddressSession.phone,
905
- };
934
+ ];
906
935
  },
907
936
  });
908
937
  /**
@@ -1145,9 +1174,39 @@ const ZonosCheckout = class {
1145
1174
  handleAddressChange() {
1146
1175
  stripeStoreReset();
1147
1176
  }
1177
+ handleCustomerProfileChange() {
1178
+ var _a, _b;
1179
+ if (!this.customerProfile) {
1180
+ log('No customer profile', 'info');
1181
+ this.defaultCustomerProfileAddress = [];
1182
+ return;
1183
+ }
1184
+ log('Customer profile found', 'info', {
1185
+ customerProfile: this.customerProfile,
1186
+ });
1187
+ // Build and set saved locations from checkout customers
1188
+ this.defaultCustomerProfileAddress =
1189
+ ((_b = (_a = stripeStore.customerProfile) === null || _a === void 0 ? void 0 : _a.locations) === null || _b === void 0 ? void 0 : _b.map(location => {
1190
+ var _a;
1191
+ return {
1192
+ address: {
1193
+ city: location.locality,
1194
+ country: location.countryCode,
1195
+ line1: location.line1,
1196
+ line2: location.line2 || '',
1197
+ postal_code: location.postalCode,
1198
+ state: location.administrativeArea,
1199
+ },
1200
+ email: location.email || ((_a = stripeStore.customerProfile) === null || _a === void 0 ? void 0 : _a.email) || '',
1201
+ name: location.name || '',
1202
+ phone: location.phone || '',
1203
+ };
1204
+ })) || [];
1205
+ }
1148
1206
  handleClientSecretChange() {
1149
- log('=== Client secret changed', 'info', {
1150
- clientSecret: stripeStore.clientSecret,
1207
+ log('==== Client secret changed', 'info', {
1208
+ clientSecret: this.clientSecret,
1209
+ stripeCustomerSessionClientSecret: this.stripeCustomerSessionClientSecret,
1151
1210
  });
1152
1211
  // apply theme to stripe elements
1153
1212
  void this.applyStripeTheme();
@@ -1169,6 +1228,8 @@ const ZonosCheckout = class {
1169
1228
  html.style.overflow = 'hidden';
1170
1229
  }
1171
1230
  else {
1231
+ // Should reset stripeCustomerSessionClientSecret state when dialog is closed since merchant would need to re-authenticate, get an OTP again and we will get a new customer session.
1232
+ this.stripeCustomerSessionClientSecret = null;
1172
1233
  const bodyOverflow = body.getAttribute(overflowAttrKey);
1173
1234
  const htmlOverflow = html.getAttribute(overflowAttrKey);
1174
1235
  // reset overflow state to original state
@@ -1216,8 +1277,15 @@ const ZonosCheckout = class {
1216
1277
  }
1217
1278
  render() {
1218
1279
  var _a, _b, _c, _d;
1280
+ this.customerProfile = stripeStore.customerProfile;
1219
1281
  // Set client secret so that we can add this to @Watch listener
1220
1282
  this.clientSecret = stripeStore.clientSecret;
1283
+ // Only set and update stripeCustomerSession state if it's available, since it would only be available at the time checkout session is created, afterward access checkout session the value would be `null`.
1284
+ if (stripeStore.stripeCustomerSessionClientSecret) {
1285
+ // Set stripe customer session client secret so that we can add this to @Watch listener
1286
+ this.stripeCustomerSessionClientSecret =
1287
+ stripeStore.stripeCustomerSessionClientSecret;
1288
+ }
1221
1289
  const dialogLoading =
1222
1290
  // if it's last step, don't need to check stripe elements
1223
1291
  (cartStore.step !== 'finish' &&
@@ -1270,7 +1338,7 @@ const ZonosCheckout = class {
1270
1338
  '--zonos--primary-color': !this.isMobile
1271
1339
  ? colorPrimary
1272
1340
  : undefined,
1273
- }) }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress || this.defaultAddressParams, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, isMobile: this.isMobile, onContinueClicked: async () => {
1341
+ }) }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.getDefaultAddress(), isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, isMobile: this.isMobile, onContinueClicked: async () => {
1274
1342
  await this.handleStripePaymentContinue();
1275
1343
  }, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), h("div", { class: "zonos--right-actions" }, window.Zonos.showBaseForeign && (h("zonos-currency-toggle", null)), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() }))), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
1276
1344
  // do nothing if it's not mobile
@@ -1349,7 +1417,9 @@ const ZonosCheckout = class {
1349
1417
  "overrideStagingMode": ["overrideStagingModeChanged"],
1350
1418
  "mobile": ["handleMobileChange"],
1351
1419
  "defaultAddress": ["handleAddressChange"],
1420
+ "customerProfile": ["handleCustomerProfileChange"],
1352
1421
  "clientSecret": ["handleClientSecretChange"],
1422
+ "stripeCustomerSessionClientSecret": ["handleClientSecretChange"],
1353
1423
  "open": ["handleOpenChange"]
1354
1424
  }; }
1355
1425
  };
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-d82f06f2.js';
2
- import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-b2e57589.js';
2
+ import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-fff4f4a4.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
- import { h as handleFetch, b as logError, l as log } from './handleFetch-8d72c8cd.js';
4
+ import { h as handleFetch, b as logError, l as log } from './handleFetch-0109fb78.js';
5
5
  import './isDarkColor-446fccb7.js';
6
6
  import './getBorderRadius-ada3ccad.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { l as localizationStore } from './cart-b2e57589.js';
2
+ import { l as localizationStore } from './cart-fff4f4a4.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-8d72c8cd.js';
5
+ import './handleFetch-0109fb78.js';
6
6
  import './isDarkColor-446fccb7.js';
7
7
  import './getBorderRadius-ada3ccad.js';
8
8
 
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-b2e57589.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-fff4f4a4.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-446fccb7.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-8d72c8cd.js';
7
+ import './handleFetch-0109fb78.js';
8
8
  import './getBorderRadius-ada3ccad.js';
9
9
 
10
10
  /**