@zonos/elements 1.3.254 → 1.3.256

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 (212) hide show
  1. package/dist/cjs/{cart-77640463.js → cart-e156c1e3.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-e93c64fd.js → hasInclusivePrice-d6d274bd.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-211ef96c.js → invoice-f4b5d538.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-14fb5ab4.js → isCollectMobileTablet-c9369cd8.js} +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-be7afc1b.js → localization-5bb1e598.js} +243 -0
  8. package/dist/cjs/{paypal-c61ef042.js → paypal-f9641595.js} +2 -2
  9. package/dist/cjs/{placeTestOrder-0f7477c8.js → placeTestOrder-7ac7f91a.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-1ac02803.js → renderCheckoutCurrency-6b59a718.js} +2 -2
  11. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +357 -78
  16. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  18. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-elements.cjs.js +1 -1
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  24. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +60 -2
  31. package/dist/collection/components/store/hello/localization.js +3 -0
  32. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  33. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  34. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  35. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  36. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  37. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  38. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  39. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  40. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  41. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  42. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  43. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  44. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  45. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  46. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  47. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  48. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  49. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  50. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  51. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  52. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +52 -0
  53. package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +22 -0
  54. package/dist/collection/components/utils/checkout/checkBigCommerceBypassCustomerGroup.js +122 -0
  55. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +5 -2
  56. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +120 -86
  57. package/dist/esm/{cart-394c9ddb.js → cart-55b8dd7c.js} +1 -1
  58. package/dist/esm/{hasInclusivePrice-f0322e1c.js → hasInclusivePrice-ddae18fd.js} +1 -1
  59. package/dist/esm/index.js +7 -7
  60. package/dist/esm/{invoice-5ae81ae5.js → invoice-dbe85a18.js} +2 -2
  61. package/dist/esm/{isCollectMobileTablet-15b668d6.js → isCollectMobileTablet-8af0d16d.js} +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{localization-0ebc8356.js → localization-d11c973f.js} +243 -0
  64. package/dist/esm/{paypal-b6fa3ec3.js → paypal-f87fbee0.js} +2 -2
  65. package/dist/esm/{placeTestOrder-5756cbc3.js → placeTestOrder-8e8e97be.js} +2 -2
  66. package/dist/esm/{renderCheckoutCurrency-5f3e06ea.js → renderCheckoutCurrency-45c74af2.js} +2 -2
  67. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  68. package/dist/esm/zonos-address_4.entry.js +2 -2
  69. package/dist/esm/zonos-card_5.entry.js +3 -3
  70. package/dist/esm/zonos-cart-items_12.entry.js +6 -6
  71. package/dist/esm/zonos-checkout.entry.js +358 -79
  72. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  73. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  74. package/dist/esm/zonos-collect.entry.js +4 -4
  75. package/dist/esm/zonos-controller.entry.js +2 -2
  76. package/dist/esm/zonos-country-flag.entry.js +1 -1
  77. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  78. package/dist/esm/zonos-elements.js +1 -1
  79. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  80. package/dist/esm/zonos-hello.entry.js +1 -1
  81. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  82. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  83. package/dist/esm/zonos-invoice.entry.js +4 -4
  84. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  85. package/dist/esm/zonos-store-credit.entry.js +3 -3
  86. package/dist/esm-es5/{cart-394c9ddb.js → cart-55b8dd7c.js} +1 -1
  87. package/dist/esm-es5/{hasInclusivePrice-f0322e1c.js → hasInclusivePrice-ddae18fd.js} +1 -1
  88. package/dist/esm-es5/index.js +1 -1
  89. package/dist/esm-es5/{invoice-5ae81ae5.js → invoice-dbe85a18.js} +1 -1
  90. package/dist/esm-es5/{isCollectMobileTablet-15b668d6.js → isCollectMobileTablet-8af0d16d.js} +1 -1
  91. package/dist/esm-es5/loader.js +1 -1
  92. package/dist/esm-es5/localization-d11c973f.js +1 -0
  93. package/dist/esm-es5/{paypal-b6fa3ec3.js → paypal-f87fbee0.js} +1 -1
  94. package/dist/esm-es5/{placeTestOrder-5756cbc3.js → placeTestOrder-8e8e97be.js} +1 -1
  95. package/dist/esm-es5/{renderCheckoutCurrency-5f3e06ea.js → renderCheckoutCurrency-45c74af2.js} +1 -1
  96. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  97. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  98. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  99. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  100. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  101. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  102. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  103. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  104. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  105. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  106. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  107. package/dist/esm-es5/zonos-elements.js +1 -1
  108. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  109. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  110. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  111. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  112. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  113. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  114. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  115. package/dist/scripts/index.d.ts +19 -0
  116. package/dist/scripts/index.js +1 -1
  117. package/dist/scripts/loadZonos.js +1 -1
  118. package/dist/scripts/zonos.js +1 -1
  119. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +13 -0
  120. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  121. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  122. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  123. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  124. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  125. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  126. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  127. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  128. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  129. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  130. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  131. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  132. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  133. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  134. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  135. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  136. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  137. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  138. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  139. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  140. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +36 -0
  141. package/dist/types/components/utils/checkout/buildBigcommerceRedirectUrl.d.ts +11 -0
  142. package/dist/types/components/utils/checkout/checkBigCommerceBypassCustomerGroup.d.ts +30 -0
  143. package/dist/types/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.d.ts +16 -1
  144. package/dist/types/types/utils/ZonosSettings.d.ts +7 -0
  145. package/dist/zonos-elements/index.esm.js +1 -1
  146. package/dist/zonos-elements/{p-bdaf2a38.entry.js → p-00728af1.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-4a38ea5e.system.entry.js → p-08830a50.system.entry.js} +1 -1
  148. package/dist/zonos-elements/p-179bbeae.js +1 -0
  149. package/dist/zonos-elements/{p-b49b8da4.system.entry.js → p-1c9e9692.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-97fb5ad5.entry.js → p-225957b9.entry.js} +1 -1
  151. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  152. package/dist/zonos-elements/{p-27fad55a.system.js → p-2a28c7ac.system.js} +1 -1
  153. package/dist/zonos-elements/{p-92d91395.system.entry.js → p-2cb5ef7d.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-b37a85f0.system.entry.js → p-2eeda8a9.system.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-0da3cc62.system.entry.js → p-32365d6a.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-11d6de1a.entry.js → p-399f5ad6.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-57b27c60.js → p-3a8925e9.js} +1 -1
  158. package/dist/zonos-elements/p-3f141999.system.js +1 -0
  159. package/dist/zonos-elements/{p-620ba943.js → p-3fae811a.js} +1 -1
  160. package/dist/zonos-elements/{p-93dec11b.entry.js → p-50d31f4f.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-c6047442.system.entry.js → p-52b70520.system.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-a0ac3ca2.system.entry.js → p-53275a0d.system.entry.js} +1 -1
  163. package/dist/zonos-elements/p-5343c32b.system.js +1 -0
  164. package/dist/zonos-elements/{p-09d7a5cb.system.js → p-57b5d3e3.system.js} +1 -1
  165. package/dist/zonos-elements/{p-daaaa8f1.system.entry.js → p-59025df9.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-a1e23675.system.entry.js → p-5d0b0126.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-8dfa0bb8.system.entry.js → p-664aff48.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-c1ae7391.system.entry.js → p-6b45e9f3.system.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-321e7920.system.js → p-70e069d3.system.js} +1 -1
  170. package/dist/zonos-elements/{p-fce715f1.system.entry.js → p-72de2fdc.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-8abeab5a.entry.js → p-7d4a1565.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-07ca3347.system.entry.js → p-8608c123.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-615b5d13.entry.js → p-89757efe.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-920d9189.entry.js → p-8a593061.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-efa69c89.entry.js → p-8ccf97ce.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-4f23732f.js → p-93c64387.js} +1 -1
  177. package/dist/zonos-elements/p-93d6e13f.entry.js +1 -0
  178. package/dist/zonos-elements/p-9631c373.system.js +1 -0
  179. package/dist/zonos-elements/p-99e1734a.js +1 -0
  180. package/dist/zonos-elements/{p-a5adc047.system.entry.js → p-9b42f0ad.system.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-8efb79ab.entry.js → p-aad014df.entry.js} +1 -1
  182. package/dist/zonos-elements/p-ae397ff8.system.entry.js +1 -0
  183. package/dist/zonos-elements/{p-d65cfa9b.system.entry.js → p-b439d38f.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-2bdc2206.entry.js → p-b85d4286.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-2c2e5ee6.entry.js → p-befad3c4.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-a5fb864a.system.entry.js → p-c66649fe.system.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-d8610393.entry.js → p-d14e5c81.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-a95ac160.entry.js → p-d155b9c6.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-dcef3647.system.js → p-d280e9b6.system.js} +1 -1
  190. package/dist/zonos-elements/{p-9ff90151.entry.js → p-dba635e6.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-1162b685.entry.js → p-ddde268d.entry.js} +1 -1
  192. package/dist/zonos-elements/p-e2adf04b.system.js +1 -0
  193. package/dist/zonos-elements/p-ee2c7a1e.js +1 -0
  194. package/dist/zonos-elements/{p-3d757163.entry.js → p-f36e907e.entry.js} +1 -1
  195. package/dist/zonos-elements/{p-29f7950c.js → p-f6733ffb.js} +1 -1
  196. package/dist/zonos-elements/{p-95f7f2a0.entry.js → p-f9ffff4e.entry.js} +1 -1
  197. package/dist/zonos-elements/p-fa0c5017.js +1 -0
  198. package/dist/zonos-elements/{p-fbccfa3e.system.js → p-fbd44c55.system.js} +1 -1
  199. package/dist/zonos-elements/{p-c2121663.system.entry.js → p-fc1c7fe5.system.entry.js} +1 -1
  200. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  201. package/package.json +1 -1
  202. package/dist/esm-es5/localization-0ebc8356.js +0 -1
  203. package/dist/zonos-elements/p-0dd5a4b8.system.js +0 -1
  204. package/dist/zonos-elements/p-1282495f.system.js +0 -1
  205. package/dist/zonos-elements/p-13041752.js +0 -1
  206. package/dist/zonos-elements/p-2b118454.js +0 -1
  207. package/dist/zonos-elements/p-2c9c750e.system.js +0 -1
  208. package/dist/zonos-elements/p-4df85216.entry.js +0 -1
  209. package/dist/zonos-elements/p-ac353826.js +0 -1
  210. package/dist/zonos-elements/p-ca19a10a.js +0 -1
  211. package/dist/zonos-elements/p-cc9620e5.system.entry.js +0 -1
  212. package/dist/zonos-elements/p-cf69bcc4.system.js +0 -1
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, h, F as Fragment, a as Host } from './index-cfd394c8.js';
2
- import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, y as validateCheckoutSession, z as storeCreditStoreCreateOrder, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as cartStoreOnChange, E as stripeStoreOnChange, F as storeCreditStoreGetEffectiveAmount } from './cart-394c9ddb.js';
3
- import { p as paypalStoreHasPaypalEnabled, a as paypalStore, b as paypalInitScript } from './paypal-b6fa3ec3.js';
4
- import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-0ebc8356.js';
2
+ import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, y as validateCheckoutSession, z as storeCreditStoreCreateOrder, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as cartStoreOnChange, E as stripeStoreOnChange, F as storeCreditStoreGetEffectiveAmount } from './cart-55b8dd7c.js';
3
+ import { p as paypalStoreHasPaypalEnabled, a as paypalStore, b as paypalInitScript } from './paypal-f87fbee0.js';
4
+ import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-d11c973f.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-5242a58d.js';
6
6
  import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
7
- import { h as handleFetch, l as logError, b as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, s as sendErrorLog, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-a844cac1.js';
7
+ import { h as handleFetch, g as getIsTestMode, l as logError, b as getAdditionalLogMetadata, j as jsonParse, s as sendErrorLog, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-a844cac1.js';
8
8
  import { u as updateCheckoutSessionAttributes } from './updateCheckoutSessionAttributes-b9f7e982.js';
9
- import { _ as _getIsValidCartId, c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector, d as domesticRedirectedBtnSelector, g as getAbandonedCartRenewTokenValue } from './CheckoutConfig-724d7bae.js';
10
9
  import { l as log, g as getElapsedTime, b as allLogs } from './VarianceTest-572cecf5.js';
10
+ import { _ as _getIsValidCartId, c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector, d as domesticRedirectedBtnSelector, g as getAbandonedCartRenewTokenValue } from './CheckoutConfig-724d7bae.js';
11
11
  import { c as classes } from './classes-0d95c529.js';
12
12
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
13
13
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
@@ -93,47 +93,28 @@ const buildCartUrl = ({ cartId, checkoutSessionId, customerAddress1, customerAdd
93
93
  return `${hostedCheckoutUrl}?${urlParams.toString()}`;
94
94
  };
95
95
 
96
- const isDisabledCountry = (showLog = true) => {
97
- if (!localizationStore.localizationLoaded) {
98
- return true;
99
- }
100
- if (localizationStore.isDisabledCountry) {
101
- if (showLog) {
102
- log(`Checkout: disabled country`);
103
- }
104
- return true;
105
- }
106
- return false;
107
- };
108
-
109
- const isShippableCountry = (showLog = true,
110
96
  /**
111
- * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
97
+ * Build an absolute redirect URL used by the BigCommerce checkout flows to
98
+ * navigate between the BC native `/checkout` page and the Zonos international
99
+ * checkout at `/`.
100
+ *
101
+ * Carries over the `zonosQaUrl` query param from the current URL (when
102
+ * present) so the preview Zonos elements build keeps loading after the
103
+ * redirect, and sets `zonosTestMode=1` when test mode is active so the
104
+ * destination page continues to use the test credentials.
112
105
  */
113
- providedCountryCode) => {
114
- var _a;
115
- if (!localizationStore.localizationLoaded) {
116
- return false;
117
- }
118
- if (providedCountryCode) {
119
- const isProvidedCountryCodeShippableCountry = !!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[providedCountryCode]) &&
120
- !zonosStore.disabledCountries.includes(providedCountryCode);
121
- if (showLog && !isProvidedCountryCodeShippableCountry) {
122
- log(`Checkout: ${providedCountryCode} is not a shippable country: ${isProvidedCountryCodeShippableCountry}`);
123
- }
124
- return isProvidedCountryCodeShippableCountry;
106
+ const buildBigcommerceRedirectUrl = (pathname) => {
107
+ const url = new URL(pathname, window.location.origin);
108
+ const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
109
+ if (zonosQaUrl) {
110
+ url.searchParams.set('zonosQaUrl', zonosQaUrl);
125
111
  }
126
- // if localization is loaded and the localization is not a shippable country, keep the original click event
127
- if (!localizationStore.isShippableCountry) {
128
- if (showLog) {
129
- log(`Checkout: not shippable country`);
130
- }
131
- return false;
112
+ if (getIsTestMode()) {
113
+ url.searchParams.set('zonosTestMode', '1');
132
114
  }
133
- return true;
115
+ return url.toString();
134
116
  };
135
117
 
136
- const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
137
118
  /**
138
119
  * Fetch the checkout/cart ID from the BigCommerce Storefront Cart API.
139
120
  * The `/checkout` page URL does not include the checkout ID, so we
@@ -166,7 +147,7 @@ const fetchCheckoutId = async () => {
166
147
  */
167
148
  const fetchBigCommerceCheckout = async (checkoutId) => {
168
149
  try {
169
- const response = await fetch(`/api/storefront/checkouts/${checkoutId}`, {
150
+ const response = await fetch(`/api/storefront/checkouts/${checkoutId}?include=customer.customerGroup`, {
170
151
  credentials: 'same-origin',
171
152
  headers: {
172
153
  Accept: 'application/json',
@@ -184,27 +165,211 @@ const fetchBigCommerceCheckout = async (checkoutId) => {
184
165
  return null;
185
166
  }
186
167
  };
168
+
169
+ const DEFAULT_RESULT = {
170
+ customerGroupId: null,
171
+ shouldBypass: false,
172
+ };
173
+ /**
174
+ * Performs the actual fetch logic to determine if the customer
175
+ * belongs to a bypass group.
176
+ */
177
+ const fetchBypassOutcome = async () => {
178
+ var _a, _b, _c, _d;
179
+ // Only relevant for BigCommerce stores — permanent no-op on other platforms
180
+ if (!window.Zonos.isBigCommerce) {
181
+ return { conclusive: true, result: DEFAULT_RESULT };
182
+ }
183
+ const bypassGroupIds = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceBypassCustomerGroupIds;
184
+ if (!(bypassGroupIds === null || bypassGroupIds === void 0 ? void 0 : bypassGroupIds.length)) {
185
+ if (zonosStore.loadedConfig) {
186
+ // Settings have finished loading and there are no bypass groups
187
+ // configured — this is a permanent "bypass not configured" answer.
188
+ return { conclusive: true, result: DEFAULT_RESULT };
189
+ }
190
+ // Settings haven't loaded yet — the empty list may be transient.
191
+ // Mark as inconclusive so a later caller retries after config loads.
192
+ return { conclusive: false, result: DEFAULT_RESULT };
193
+ }
194
+ // Fetch customer group from BigCommerce Storefront API
195
+ const checkoutId = await fetchCheckoutId();
196
+ if (!checkoutId) {
197
+ // No active cart yet — inconclusive. Common on fresh sessions where
198
+ // `initBigCommerceBypassCheck` runs before the user has added anything
199
+ // to their cart; once the cart exists we need to re-fetch.
200
+ log('BigCommerce bypass check: no active cart yet, will retry on next call', 'info');
201
+ return { conclusive: false, result: DEFAULT_RESULT };
202
+ }
203
+ const checkout = await fetchBigCommerceCheckout(checkoutId);
204
+ if (!checkout) {
205
+ // API call failed (network error, non-200, etc.) — inconclusive.
206
+ // Caching this would permanently disable bypass for the session if
207
+ // the logged-in user is actually a reseller.
208
+ log('BigCommerce bypass check: failed to fetch checkout data, will retry', 'info');
209
+ return { conclusive: false, result: DEFAULT_RESULT };
210
+ }
211
+ const customerGroupId = (_d = (_c = (_b = checkout.customer) === null || _b === void 0 ? void 0 : _b.customerGroup) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null;
212
+ if (customerGroupId === null) {
213
+ log('BigCommerce bypass check: no customer group found (guest user)', 'info');
214
+ // Guest user with an active cart — a definitive "no bypass" answer.
215
+ return { conclusive: true, result: DEFAULT_RESULT };
216
+ }
217
+ const shouldBypass = bypassGroupIds.includes(customerGroupId);
218
+ const result = { customerGroupId, shouldBypass };
219
+ if (shouldBypass) {
220
+ log(`BigCommerce bypass check: customer group ${String(customerGroupId)} is in bypass list; caller should keep the user on BC native checkout`, 'info');
221
+ }
222
+ else {
223
+ log(`BigCommerce bypass check: customer group ${String(customerGroupId)} is not in bypass list`, 'info');
224
+ }
225
+ return { conclusive: true, result };
226
+ };
227
+ /**
228
+ * Module-level promise that holds the in-flight or resolved bypass check.
229
+ * Set by `initBigCommerceBypassCheck` on page load so the result is ready
230
+ * by the time checkout opens or the watcher fires.
231
+ *
232
+ * Automatically invalidated when a fetch resolves to an inconclusive outcome,
233
+ * so subsequent callers retry (e.g. after the user adds an item to their
234
+ * cart or after settings finish loading).
235
+ */
236
+ let bypassCheckPromise = null;
237
+ const startBypassCheck = () => {
238
+ const outcomePromise = fetchBypassOutcome();
239
+ const resultPromise = outcomePromise.then(({ conclusive, result }) => {
240
+ if (!conclusive && bypassCheckPromise === resultPromise) {
241
+ // Invalidate cache so the next caller performs a fresh fetch.
242
+ bypassCheckPromise = null;
243
+ }
244
+ return result;
245
+ });
246
+ bypassCheckPromise = resultPromise;
247
+ return resultPromise;
248
+ };
249
+ /**
250
+ * Start fetching the BigCommerce customer group on page load.
251
+ * Call this once during initialization (e.g. in `zonos-checkout.init()`).
252
+ * The fetch runs in the background; `checkBigCommerceBypassCustomerGroup`
253
+ * will await the result when needed.
254
+ */
255
+ const initBigCommerceBypassCheck = () => {
256
+ var _a;
257
+ if (!window.Zonos.isBigCommerce) {
258
+ return;
259
+ }
260
+ const bypassGroupIds = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceBypassCustomerGroupIds;
261
+ if (!(bypassGroupIds === null || bypassGroupIds === void 0 ? void 0 : bypassGroupIds.length)) {
262
+ return;
263
+ }
264
+ // Fire the fetch immediately; consumers will await the same promise
265
+ void startBypassCheck();
266
+ };
267
+ /**
268
+ * Check if the current BigCommerce customer belongs to a customer group
269
+ * that should bypass Zonos Checkout.
270
+ *
271
+ * If `initBigCommerceBypassCheck` was called on page load and the resulting
272
+ * outcome was conclusive, this returns the already-resolved (or in-flight)
273
+ * result without making additional API calls. If the previous outcome was
274
+ * inconclusive (no cart, settings not loaded), the cache was invalidated
275
+ * automatically and this triggers a fresh fetch.
276
+ *
277
+ * @param options.forceRefresh - When true, bypasses any cached result and
278
+ * always fetches fresh BigCommerce checkout data. Use this on the
279
+ * BigCommerce domestic checkout page when the shipping country changes,
280
+ * to ensure the customer group reflects the current checkout state.
281
+ */
282
+ const checkBigCommerceBypassCustomerGroup = async (options = {}) => {
283
+ if (options.forceRefresh || !bypassCheckPromise) {
284
+ return startBypassCheck();
285
+ }
286
+ return bypassCheckPromise;
287
+ };
288
+
289
+ const isDisabledCountry = (showLog = true) => {
290
+ if (!localizationStore.localizationLoaded) {
291
+ return true;
292
+ }
293
+ if (localizationStore.isDisabledCountry) {
294
+ if (showLog) {
295
+ log(`Checkout: disabled country`);
296
+ }
297
+ return true;
298
+ }
299
+ return false;
300
+ };
301
+
302
+ const isShippableCountry = (showLog = true,
303
+ /**
304
+ * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
305
+ */
306
+ providedCountryCode) => {
307
+ var _a;
308
+ if (!localizationStore.localizationLoaded) {
309
+ return false;
310
+ }
311
+ if (providedCountryCode) {
312
+ const isProvidedCountryCodeShippableCountry = !!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[providedCountryCode]) &&
313
+ !zonosStore.disabledCountries.includes(providedCountryCode);
314
+ if (showLog && !isProvidedCountryCodeShippableCountry) {
315
+ log(`Checkout: ${providedCountryCode} is not a shippable country: ${isProvidedCountryCodeShippableCountry}`);
316
+ }
317
+ return isProvidedCountryCodeShippableCountry;
318
+ }
319
+ // if localization is loaded and the localization is not a shippable country, keep the original click event
320
+ if (!localizationStore.isShippableCountry) {
321
+ if (showLog) {
322
+ log(`Checkout: not shippable country`);
323
+ }
324
+ return false;
325
+ }
326
+ return true;
327
+ };
328
+
329
+ const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
187
330
  /**
188
331
  * Check if the logged-in user already has a shipping address on the checkout
189
- * that is internationally shippable. If so, save the address to session
190
- * and redirect to the home page to open the international checkout.
332
+ * that is internationally shippable. If so, optionally prompt the user to
333
+ * confirm before saving the address to session and redirecting to the home
334
+ * page to open the international checkout.
191
335
  */
192
- const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelected, }) => {
336
+ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelected, onLoggedInInternationalAddressDetected, }) => {
193
337
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
338
+ // Check if the customer belongs to a bypass group (e.g. resellers) before
339
+ // redirecting them away from BigCommerce native checkout. This delegates to
340
+ // the shared helper so the bypass decision has a single source of truth and
341
+ // reuses the cached promise warmed by `initBigCommerceBypassCheck`.
342
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup();
343
+ if (shouldBypass) {
344
+ return 'noAction';
345
+ }
194
346
  const checkoutId = await fetchCheckoutId();
195
347
  if (!checkoutId) {
196
- return false;
348
+ return 'noAction';
197
349
  }
198
350
  const checkout = await fetchBigCommerceCheckout(checkoutId);
199
351
  const shippingAddress = (_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.consignments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.shippingAddress;
200
352
  if (!(shippingAddress === null || shippingAddress === void 0 ? void 0 : shippingAddress.countryCode)) {
201
- return false;
353
+ return 'noAction';
202
354
  }
203
355
  const countryCode = shippingAddress.countryCode;
204
356
  if (!isShippableCountry(false, countryCode)) {
205
- return false;
357
+ return 'noAction';
358
+ }
359
+ log(onLoggedInInternationalAddressDetected
360
+ ? `Logged-in user has international shipping address: ${countryCode}, prompting user to choose checkout`
361
+ : `Logged-in user has international shipping address: ${countryCode}, redirecting automatically (legacy behavior)`, 'info');
362
+ // Ask the consumer (zonos-checkout) whether to redirect or stay on BC.
363
+ // Without this prompt the user can get stuck in a redirect loop when their
364
+ // saved default address is international but they want to use a different
365
+ // (domestic) saved address in BigCommerce native checkout.
366
+ if (onLoggedInInternationalAddressDetected) {
367
+ const action = await onLoggedInInternationalAddressDetected();
368
+ if (action === 'stay') {
369
+ log('User opted to stay on BigCommerce native checkout despite international default address', 'info');
370
+ return 'optedOut';
371
+ }
206
372
  }
207
- log(`Logged-in user has international shipping address: ${countryCode}, redirecting`, 'info');
208
373
  if (onInternationalCheckoutSelected) {
209
374
  await onInternationalCheckoutSelected();
210
375
  }
@@ -226,20 +391,24 @@ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelecte
226
391
  state: (_k = shippingAddress.stateOrProvince) !== null && _k !== void 0 ? _k : '',
227
392
  });
228
393
  // Redirect to home page — the home page will open the international checkout
229
- // when it detects the domestic shipping session
230
- window.location.href = '/';
231
- return true;
394
+ // when it detects the domestic shipping session. Carry over zonosQaUrl /
395
+ // zonosTestMode so the destination page keeps using the same build/env.
396
+ window.location.href = buildBigcommerceRedirectUrl('/');
397
+ return 'redirected';
232
398
  };
233
399
  /**
234
400
  * Watch for changes in domestic checkout step. Redirects user to home page to open international checkout when user selects a country in the international shipping zone.
235
401
  * @note Only works on default bigcommerce checkout page
236
402
  */
237
- const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedBtnSelector, onInternationalCheckoutSelected, onShippingAddressSessionFound, }) => {
403
+ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedBtnSelector, onInternationalCheckoutSelected, onLoggedInInternationalAddressDetected, onShippingAddressSessionFound, }) => {
238
404
  if (!window.Zonos.isBigCommerce) {
239
405
  return;
240
406
  }
241
407
  /**
242
- * Keep checking
408
+ * Keep checking.
409
+ * @returns `true` if the caller should stop polling — either because the user
410
+ * is being redirected to Zonos international checkout, or because the
411
+ * logged-in customer is in a bypass group and should stay on BC checkout.
243
412
  */
244
413
  const handleInternationalCheckoutSelected = async (overrideShippingCountry) => {
245
414
  var _a;
@@ -255,6 +424,19 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
255
424
  // do nothing if shipping country is not shippable
256
425
  return false;
257
426
  }
427
+ // Only check bypass after confirming the country is shippable (i.e. user is
428
+ // about to be redirected to Zonos international checkout). Force-refresh so
429
+ // we re-fetch BigCommerce checkout data every time the ship-to country
430
+ // changes — prevents stale customer-group data from a cached fetch.
431
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup({
432
+ forceRefresh: true,
433
+ });
434
+ if (shouldBypass) {
435
+ // Logged-in customer is in a bypass group — keep them on BC native
436
+ // checkout and stop polling / fetching further.
437
+ log('Bypass customer group detected on BC checkout, stopping interval', 'info');
438
+ return true;
439
+ }
258
440
  if (onInternationalCheckoutSelected) {
259
441
  await onInternationalCheckoutSelected();
260
442
  }
@@ -286,13 +468,40 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
286
468
  postalCode: shippingAddress.postalCode,
287
469
  state: shippingAddress.stateOrProvince,
288
470
  });
289
- // redirect to home page, home page then will open the checkout dialog if having domestic shipping session
290
- window.location.href = '/';
471
+ // redirect to home page, home page then will open the checkout dialog if
472
+ // having domestic shipping session. Carry over zonosQaUrl / zonosTestMode
473
+ // so the destination page keeps using the same build/env.
474
+ window.location.href = buildBigcommerceRedirectUrl('/');
291
475
  return true;
292
476
  };
293
477
  let isProcessing = false;
294
478
  let intervalCreated = false;
295
479
  let isCheckingLoggedInUserShippingAddress = false;
480
+ /**
481
+ * Set to `true` once the logged-in user has been prompted about a detected
482
+ * international default address and chose to stay on the BigCommerce native
483
+ * checkout. Prevents the observer from re-prompting on subsequent DOM
484
+ * mutations.
485
+ */
486
+ let loggedInAddressCheckSkipped = false;
487
+ /**
488
+ * Set to `true` while the logged-in international-address confirmation
489
+ * dialog is open and we are awaiting the user's response. While this
490
+ * flag is set the polling interval must not call
491
+ * `handleInternationalCheckoutSelected` — otherwise the interval would
492
+ * detect the pre-filled international country, show the loading dialog,
493
+ * and redirect before the user has responded to the confirm prompt.
494
+ */
495
+ let isAwaitingLoggedInConfirmation = false;
496
+ // NOTE: We intentionally do NOT await `checkBigCommerceBypassCustomerGroup()`
497
+ // here before attaching the MutationObserver. The bypass check involves two
498
+ // Storefront API round-trips, and awaiting it synchronously would delay
499
+ // observer registration — on fast-rendering BC pages that window can cause
500
+ // us to miss the initial DOM mutations and never trigger the redirect.
501
+ // Bypass is already enforced inside `checkLoggedInUserShippingAddress` and
502
+ // `handleInternationalCheckoutSelected` (both consult the helper), so the
503
+ // top-level gate is redundant. `initBigCommerceBypassCheck()` is called on
504
+ // page load so those inner calls typically resolve against a warm cache.
296
505
  const observer = new MutationObserver(async () => {
297
506
  var _a;
298
507
  const domesticRedirectedButton = document.querySelector(domesticRedirectedBtnSelector);
@@ -319,24 +528,35 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
319
528
  // For logged-in users, check if their saved address on the checkout is international
320
529
  // before the shipping form is even rendered.
321
530
  // Guard against repeated calls — the observer fires on every DOM mutation.
322
- if (isCheckingLoggedInUserShippingAddress) {
323
- return;
324
- }
325
- isCheckingLoggedInUserShippingAddress = true;
326
- try {
327
- const redirected = await checkLoggedInUserShippingAddress({
328
- onInternationalCheckoutSelected,
329
- });
330
- if (redirected) {
331
- observer.disconnect();
332
- return;
531
+ // Also skip if the user already chose to stay on BC native checkout.
532
+ if (!loggedInAddressCheckSkipped &&
533
+ !isCheckingLoggedInUserShippingAddress) {
534
+ isCheckingLoggedInUserShippingAddress = true;
535
+ isAwaitingLoggedInConfirmation = true;
536
+ try {
537
+ const result = await checkLoggedInUserShippingAddress({
538
+ onInternationalCheckoutSelected,
539
+ onLoggedInInternationalAddressDetected,
540
+ });
541
+ if (result === 'redirected') {
542
+ observer.disconnect();
543
+ return;
544
+ }
545
+ if (result === 'optedOut') {
546
+ // User elected to stay on BC native checkout — don't prompt again
547
+ // for the rest of this session. Continue with the rest of the
548
+ // observer logic so the country-change watcher still fires when
549
+ // the user manually picks an international country in BC's UI.
550
+ loggedInAddressCheckSkipped = true;
551
+ }
552
+ }
553
+ catch (error) {
554
+ logError('Error checking logged-in user shipping address', error);
555
+ }
556
+ finally {
557
+ isCheckingLoggedInUserShippingAddress = false;
558
+ isAwaitingLoggedInConfirmation = false;
333
559
  }
334
- }
335
- catch (error) {
336
- logError('Error checking logged-in user shipping address', error);
337
- }
338
- finally {
339
- isCheckingLoggedInUserShippingAddress = false;
340
560
  }
341
561
  const shipToCountryElement = document.querySelector(((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceDomesticCheckoutCountrySelector) ||
342
562
  FALLBACK_SHIP_TO_COUNTRY_SELECTOR);
@@ -356,14 +576,18 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
356
576
  // disconnect the observer after we know that's bigcommerce domestic checkout page
357
577
  observer.disconnect();
358
578
  const interval = setInterval(async () => {
359
- if (isProcessing) {
579
+ // Don't redirect while the logged-in international-address confirm
580
+ // dialog is open — the user hasn't made their choice yet.
581
+ if (isProcessing || isAwaitingLoggedInConfirmation) {
360
582
  return;
361
583
  }
362
584
  isProcessing = true;
363
585
  try {
364
- const isInternationalCountrySelected = await handleInternationalCheckoutSelected();
365
- // When isInternationalCountrySelected is true, user will be redirected shortly, so we can stop the checking interval here
366
- if (isInternationalCountrySelected) {
586
+ const shouldStopPolling = await handleInternationalCheckoutSelected();
587
+ // Stop the interval once either:
588
+ // - the user is being redirected to Zonos international checkout
589
+ // - the logged-in customer is in a bypass group (stay on BC checkout)
590
+ if (shouldStopPolling) {
367
591
  clearInterval(interval);
368
592
  return;
369
593
  }
@@ -387,7 +611,7 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
387
611
  clearInterval(stripeBcListenerInterval);
388
612
  addressElement.on('change', event => {
389
613
  const shippingCountry = event.value.address.country;
390
- if (shippingCountry) {
614
+ if (shippingCountry && !isAwaitingLoggedInConfirmation) {
391
615
  void handleInternationalCheckoutSelected(shippingCountry);
392
616
  }
393
617
  });
@@ -695,6 +919,19 @@ const ZonosCheckout = class {
695
919
  * This is for BigCommerce stores when the user selects a domestic country in the international checkout.
696
920
  */
697
921
  this.redirectToDomesticCheckoutDialogOpen = false;
922
+ /**
923
+ * Whether or not the confirm dialog for a logged-in BigCommerce user with a
924
+ * detected international default shipping address is shown. The user must
925
+ * choose to either continue to the international checkout or stay on the
926
+ * BigCommerce native checkout (and select a domestic address there).
927
+ */
928
+ this.loggedInIntlAddressConfirmDialogOpen = false;
929
+ /**
930
+ * Resolver for the promise returned to
931
+ * `watchImmediateBigcommerceDomesticCheckoutRedirect` while we wait for
932
+ * the user's choice in `loggedInIntlAddressConfirmDialogOpen`.
933
+ */
934
+ this.loggedInIntlAddressResolver = null;
698
935
  /**
699
936
  * Client secret value
700
937
  */
@@ -1307,6 +1544,23 @@ const ZonosCheckout = class {
1307
1544
  return;
1308
1545
  }
1309
1546
  }
1547
+ // For BigCommerce stores: check if the customer belongs to a bypass
1548
+ // group (e.g. resellers) and redirect them to BigCommerce native
1549
+ // checkout instead. This must happen *before* we flip any UI state
1550
+ // (opening the dialog, setting the fetching-session flag) so bypass
1551
+ // users never see the Zonos checkout dialog flash.
1552
+ // `initBigCommerceBypassCheck` was called on page load so this
1553
+ // typically resolves against the cached promise.
1554
+ if (window.Zonos.isBigCommerce) {
1555
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup();
1556
+ if (shouldBypass) {
1557
+ log('Bypass customer group detected, redirecting to BigCommerce native checkout', 'info');
1558
+ // Carry over zonosQaUrl / zonosTestMode so the BC native
1559
+ // checkout keeps loading the same Zonos elements build/env.
1560
+ window.location.href = buildBigcommerceRedirectUrl('/checkout');
1561
+ return;
1562
+ }
1563
+ }
1310
1564
  // start loading
1311
1565
  stripeStore.isFetchingSession = true;
1312
1566
  this.open = true;
@@ -1555,6 +1809,9 @@ const ZonosCheckout = class {
1555
1809
  if (typeof this.overrideStagingMode !== 'undefined') {
1556
1810
  cartStore.isStagingMode = this.overrideStagingMode;
1557
1811
  }
1812
+ // Start fetching BigCommerce customer group on page load so the bypass
1813
+ // result is ready by the time checkout opens or the BC watcher fires
1814
+ initBigCommerceBypassCheck();
1558
1815
  // check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
1559
1816
  watchImmediateBigcommerceDomesticCheckoutRedirect({
1560
1817
  domesticRedirectedBtnSelector: domesticRedirectedBtnSelector,
@@ -1563,6 +1820,16 @@ const ZonosCheckout = class {
1563
1820
  // wait for 2 secs
1564
1821
  await new Promise(resolve => setTimeout(resolve, 2000));
1565
1822
  },
1823
+ // Logged-in user is on the BC native /checkout page with a saved
1824
+ // international default address. Ask the user whether to continue to
1825
+ // the Zonos international checkout or stay on BC and pick a different
1826
+ // (domestic) saved address. This avoids the redirect loop where a user
1827
+ // who wants to checkout domestically gets bounced back to international
1828
+ // every time they land on /checkout.
1829
+ onLoggedInInternationalAddressDetected: () => new Promise(resolve => {
1830
+ this.loggedInIntlAddressResolver = resolve;
1831
+ this.loggedInIntlAddressConfirmDialogOpen = true;
1832
+ }),
1566
1833
  onShippingAddressSessionFound: shippingAddressSession => {
1567
1834
  // prefilled the default address if shipping address session is found for checkout on open
1568
1835
  this.defaultAddress = [
@@ -2052,7 +2319,9 @@ const ZonosCheckout = class {
2052
2319
  this.redirectToDomesticCheckoutDialogOpen = true;
2053
2320
  log(`Domestic country ${shippingCountry} selected in international checkout, redirecting to BigCommerce domestic checkout`, 'info');
2054
2321
  setTimeout(() => {
2055
- window.location.href = '/checkout';
2322
+ // Carry over zonosQaUrl / zonosTestMode so the BC native checkout
2323
+ // keeps loading the same Zonos elements build/env.
2324
+ window.location.href = buildBigcommerceRedirectUrl('/checkout');
2056
2325
  }, 2000);
2057
2326
  }
2058
2327
  }),
@@ -2163,7 +2432,17 @@ const ZonosCheckout = class {
2163
2432
  this.isMobile && 'mobile',
2164
2433
  this.isIframed && 'iframed',
2165
2434
  this.hiddenMode && 'hidden-mode',
2166
- ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to international checkout shortly.'), loadingTitle: translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to domestic checkout shortly.'), loadingTitle: translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-confirm-dialog", { class: "zonos--close-confirm-dialog", dialogCancelBtnText: translate("Don't close"), dialogConfirmBtnText: translate('Close'), dialogIntent: "warn", dialogOpen: this.confirmDialogOpen, dialogSubtitle: translate('Would you like to close checkout and return to the site?'), dialogTitle: translate('Are you sure?'), onCancelClicked: () => {
2435
+ ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to international checkout shortly.'), loadingTitle: translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to domestic checkout shortly.'), loadingTitle: translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: translate('Stay on this page'), dialogConfirmBtnText: translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: translate('Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
2436
+ var _a;
2437
+ this.loggedInIntlAddressConfirmDialogOpen = false;
2438
+ (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'stay');
2439
+ this.loggedInIntlAddressResolver = null;
2440
+ }, onConfirmClicked: () => {
2441
+ var _a;
2442
+ this.loggedInIntlAddressConfirmDialogOpen = false;
2443
+ (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'redirect');
2444
+ this.loggedInIntlAddressResolver = null;
2445
+ } }), h("zonos-confirm-dialog", { class: "zonos--close-confirm-dialog", dialogCancelBtnText: translate("Don't close"), dialogConfirmBtnText: translate('Close'), dialogIntent: "warn", dialogOpen: this.confirmDialogOpen, dialogSubtitle: translate('Would you like to close checkout and return to the site?'), dialogTitle: translate('Are you sure?'), onCancelClicked: () => {
2167
2446
  this.confirmDialogOpen = false;
2168
2447
  },
2169
2448
  // Mark user selected confirm to close the dialog
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, e as getAssetPath, h, a as Host } from './index-cfd394c8.js';
2
- import { d as cartStore } from './cart-394c9ddb.js';
2
+ import { d as cartStore } from './cart-55b8dd7c.js';
3
3
  import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-5f7856f2.js';
4
4
  import { f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { s as styles } from './styles-6fc2fad9.js';
7
- import './localization-0ebc8356.js';
7
+ import './localization-d11c973f.js';
8
8
  import './handleFetch-a844cac1.js';
9
9
  import './VarianceTest-572cecf5.js';
10
10
  import './isDarkColor-3537021b.js';
@@ -1,18 +1,18 @@
1
1
  import { r as registerInstance, d as createEvent, h, F as Fragment, a as Host, g as getElement } from './index-cfd394c8.js';
2
- import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, C as stripeStoreReset, M as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, D as cartStoreOnChange } from './cart-394c9ddb.js';
3
- import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-b6fa3ec3.js';
4
- import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-0ebc8356.js';
2
+ import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, C as stripeStoreReset, M as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, D as cartStoreOnChange } from './cart-55b8dd7c.js';
3
+ import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-f87fbee0.js';
4
+ import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-d11c973f.js';
5
5
  import { z as zonosStore } from './zonosStore-5242a58d.js';
6
6
  import { h as handleFetch, s as sendErrorLog, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
7
7
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
8
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
9
9
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
10
10
  import { s as submitGtag } from './submitGtag-13de9f1f.js';
11
- import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-15b668d6.js';
11
+ import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-8af0d16d.js';
12
12
  import { c as classes } from './classes-0d95c529.js';
13
13
  import { l as languages } from './ILanguage-cd6acb72.js';
14
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-5f3e06ea.js';
15
- import { p as placeTestOrder } from './placeTestOrder-5756cbc3.js';
14
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-45c74af2.js';
15
+ import { p as placeTestOrder } from './placeTestOrder-8e8e97be.js';
16
16
  import { r as renderFallback } from './renderFallback-b250f4e9.js';
17
17
  import './isDarkColor-3537021b.js';
18
18
  import './isContrastColor-c17e83c9.js';