@zonos/elements 1.3.266 → 1.3.267

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 (166) hide show
  1. package/dist/cjs/{cart-efc42379.js → cart-ed2de167.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-400be1b2.js → hasInclusivePrice-bf31fbdb.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-9e4d479f.js → invoice-542c23e7.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-630fcf87.js → isCollectMobileTablet-fe8149a5.js} +2 -2
  6. package/dist/cjs/{localization-4b17c530.js → localization-66d378ab.js} +51 -0
  7. package/dist/cjs/{paypal-3bb55914.js → paypal-d8282578.js} +2 -2
  8. package/dist/cjs/{placeTestOrder-313cbd78.js → placeTestOrder-0a4b9dd7.js} +2 -2
  9. package/dist/cjs/{renderCheckoutCurrency-e0436f1c.js → renderCheckoutCurrency-ac9083d9.js} +2 -2
  10. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  15. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  17. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-controller.cjs.entry.js +122 -3
  19. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  20. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  22. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
  28. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  29. package/dist/collection/components/main/zonos-controller.js +6 -2
  30. package/dist/collection/components/store/hello/localization.js +6 -0
  31. package/dist/collection/components/utils/checkout/injectDomesticElementHideStyle.js +116 -0
  32. package/dist/collection/types/generated/graphql.internal.types.js +287 -73
  33. package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +48 -0
  34. package/dist/esm/{cart-62c166fc.js → cart-49082718.js} +1 -1
  35. package/dist/esm/{hasInclusivePrice-a73f64b7.js → hasInclusivePrice-2323d514.js} +1 -1
  36. package/dist/esm/index.js +7 -7
  37. package/dist/esm/{invoice-fa4ff6fb.js → invoice-16c688e7.js} +2 -2
  38. package/dist/esm/{isCollectMobileTablet-5f50ec81.js → isCollectMobileTablet-910aea2e.js} +2 -2
  39. package/dist/esm/{localization-d2631105.js → localization-33a9f7ff.js} +51 -0
  40. package/dist/esm/{paypal-424d040d.js → paypal-2e9aa4ba.js} +2 -2
  41. package/dist/esm/{placeTestOrder-cf237d95.js → placeTestOrder-35c9b460.js} +2 -2
  42. package/dist/esm/{renderCheckoutCurrency-513ead96.js → renderCheckoutCurrency-b84a6da7.js} +2 -2
  43. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  44. package/dist/esm/zonos-address_4.entry.js +2 -2
  45. package/dist/esm/zonos-card_5.entry.js +3 -3
  46. package/dist/esm/zonos-cart-items_12.entry.js +6 -6
  47. package/dist/esm/zonos-checkout.entry.js +3 -3
  48. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  49. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  50. package/dist/esm/zonos-collect.entry.js +4 -4
  51. package/dist/esm/zonos-controller.entry.js +122 -3
  52. package/dist/esm/zonos-country-flag.entry.js +1 -1
  53. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  54. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  55. package/dist/esm/zonos-hello.entry.js +1 -1
  56. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  57. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  58. package/dist/esm/zonos-invoice.entry.js +4 -4
  59. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  60. package/dist/esm/zonos-store-credit.entry.js +3 -3
  61. package/dist/esm-es5/{cart-62c166fc.js → cart-49082718.js} +1 -1
  62. package/dist/esm-es5/{hasInclusivePrice-a73f64b7.js → hasInclusivePrice-2323d514.js} +1 -1
  63. package/dist/esm-es5/index.js +1 -1
  64. package/dist/esm-es5/{invoice-fa4ff6fb.js → invoice-16c688e7.js} +1 -1
  65. package/dist/esm-es5/{isCollectMobileTablet-5f50ec81.js → isCollectMobileTablet-910aea2e.js} +1 -1
  66. package/dist/esm-es5/{localization-d2631105.js → localization-33a9f7ff.js} +1 -1
  67. package/dist/esm-es5/{paypal-424d040d.js → paypal-2e9aa4ba.js} +2 -2
  68. package/dist/esm-es5/{placeTestOrder-cf237d95.js → placeTestOrder-35c9b460.js} +1 -1
  69. package/dist/esm-es5/{renderCheckoutCurrency-513ead96.js → renderCheckoutCurrency-b84a6da7.js} +1 -1
  70. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  71. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  72. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  73. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  74. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  75. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  76. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  77. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  78. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  79. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  80. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  81. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  82. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  83. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  84. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  85. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  86. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  87. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  88. package/dist/scripts/index.d.ts +33 -13
  89. package/dist/scripts/index.js +1 -1
  90. package/dist/scripts/loadZonos.js +1 -1
  91. package/dist/scripts/zonos.js +1 -1
  92. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  93. package/dist/types/components/utils/checkout/injectDomesticElementHideStyle.d.ts +18 -0
  94. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +14 -13
  95. package/dist/types/types/checkout/CheckoutConfig.d.ts +9 -0
  96. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  97. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  98. package/dist/types/types/generated/graphql.internal.types.d.ts +341 -106
  99. package/dist/types/types/generated/graphql.internal.types.ts +419 -141
  100. package/dist/types/types/utils/ZonosSettings.d.ts +9 -0
  101. package/dist/types/utils/toggleBigcommerceNativeCurrencySelector.d.ts +17 -0
  102. package/dist/zonos-elements/index.esm.js +1 -1
  103. package/dist/zonos-elements/{p-acf42bc1.entry.js → p-01497a20.entry.js} +1 -1
  104. package/dist/zonos-elements/p-029be4a8.entry.js +1 -0
  105. package/dist/zonos-elements/{p-5e10d4ff.system.entry.js → p-034ab928.system.entry.js} +1 -1
  106. package/dist/zonos-elements/p-07a76716.system.js +1 -0
  107. package/dist/zonos-elements/{p-08934304.system.entry.js → p-087520f2.system.entry.js} +1 -1
  108. package/dist/zonos-elements/{p-889e5db0.entry.js → p-0ed70279.entry.js} +1 -1
  109. package/dist/zonos-elements/{p-0ea16658.system.entry.js → p-1325bbd6.system.entry.js} +1 -1
  110. package/dist/zonos-elements/{p-305e2dd8.system.js → p-175c04a4.system.js} +1 -1
  111. package/dist/zonos-elements/{p-bb77b580.entry.js → p-180d3e3d.entry.js} +1 -1
  112. package/dist/zonos-elements/{p-f76d5249.entry.js → p-1ec9b3b0.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-9aaa1d80.entry.js → p-1f256673.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-7b74e5f2.system.entry.js → p-22ba60f6.system.entry.js} +1 -1
  115. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  116. package/dist/zonos-elements/{p-781cc8de.system.entry.js → p-2a8fcb71.system.entry.js} +1 -1
  117. package/dist/zonos-elements/p-2c854197.system.entry.js +1 -0
  118. package/dist/zonos-elements/{p-01384124.system.js → p-311ba000.system.js} +1 -1
  119. package/dist/zonos-elements/{p-7c101a92.system.entry.js → p-3516340a.system.entry.js} +1 -1
  120. package/dist/zonos-elements/{p-a9425900.system.js → p-3b1b3598.system.js} +1 -1
  121. package/dist/zonos-elements/p-458df669.js +1 -0
  122. package/dist/zonos-elements/{p-ce44c942.system.js → p-4f718ef9.system.js} +1 -1
  123. package/dist/zonos-elements/p-5d823ea7.system.js +1 -0
  124. package/dist/zonos-elements/{p-2431f95c.entry.js → p-5e1799bc.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-72187e00.entry.js → p-601bb27e.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-1d6f3ab9.js → p-6987f9c9.js} +1 -1
  127. package/dist/zonos-elements/{p-7b640194.entry.js → p-703fc360.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-7677c45a.entry.js → p-71c7a1ff.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-06c4d422.system.js → p-77c2e465.system.js} +1 -1
  130. package/dist/zonos-elements/{p-a75baf3e.js → p-843ced6c.js} +1 -1
  131. package/dist/zonos-elements/{p-cd88efdb.js → p-84dbf474.js} +1 -1
  132. package/dist/zonos-elements/{p-2b30beea.system.js → p-8570e88a.system.js} +1 -1
  133. package/dist/zonos-elements/{p-ea88f7f5.system.entry.js → p-8d5f413c.system.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-03e95598.entry.js → p-8f9e95c2.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-227ef22f.entry.js → p-90c932fd.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-9b660cd3.js → p-9a5a2043.js} +1 -1
  137. package/dist/zonos-elements/{p-209d7728.system.entry.js → p-9b0a6fe5.system.entry.js} +1 -1
  138. package/dist/zonos-elements/{p-72efa5b7.system.entry.js → p-9e0cb5b3.system.entry.js} +1 -1
  139. package/dist/zonos-elements/{p-6ab742d9.system.entry.js → p-a1bad0c3.system.entry.js} +1 -1
  140. package/dist/zonos-elements/{p-d63e18a8.entry.js → p-a6db8883.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-f1bbad73.entry.js → p-a78bc004.entry.js} +1 -1
  142. package/dist/zonos-elements/{p-0efd2d5a.js → p-adb9827c.js} +1 -1
  143. package/dist/zonos-elements/{p-bbbbae9a.system.entry.js → p-b5a26334.system.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-37207963.system.js → p-b6a36c25.system.js} +1 -1
  145. package/dist/zonos-elements/{p-4d433020.system.entry.js → p-b7e4a020.system.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-8cd0a098.system.entry.js → p-baf0b24c.system.entry.js} +1 -1
  147. package/dist/zonos-elements/p-becac995.js +1 -0
  148. package/dist/zonos-elements/{p-4495f149.system.entry.js → p-c9c17d08.system.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-27513bfe.system.entry.js → p-cb966d16.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-6b682a6b.system.entry.js → p-ce103c66.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-cfb0059f.js +1 -0
  152. package/dist/zonos-elements/{p-02d812c8.entry.js → p-d950b0b4.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-5ae695a3.entry.js → p-db5f6b8c.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-daeb57cb.entry.js → p-e056ae6b.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-bce7bfcc.system.entry.js → p-e850e6e7.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-456a600b.entry.js → p-fb712719.entry.js} +1 -1
  157. package/dist/zonos-elements/zonos-elements.css +1 -1
  158. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  159. package/package.json +1 -1
  160. package/dist/zonos-elements/p-1a470353.entry.js +0 -1
  161. package/dist/zonos-elements/p-27eeaf56.system.js +0 -1
  162. package/dist/zonos-elements/p-40a45837.system.entry.js +0 -1
  163. package/dist/zonos-elements/p-61d73d69.js +0 -1
  164. package/dist/zonos-elements/p-8ccd6d3f.js +0 -1
  165. package/dist/zonos-elements/p-a371f770.system.js +0 -1
  166. package/dist/zonos-elements/p-c7047a1c.js +0 -1
@@ -0,0 +1,48 @@
1
+ import { localizationStore } from "../components/store/hello/localization";
2
+ import { zonosStore } from "../components/store/zonosStore";
3
+ import { logError } from "../components/utils/logging/logError";
4
+ const HIDE_CLASSNAME = 'z--bc-currency-hide';
5
+ /**
6
+ * Hides BigCommerce's native currency selector while Hello is actively
7
+ * converting prices, and restores it otherwise. The selector is hidden
8
+ * only when all of the following hold:
9
+ *
10
+ * - the host storefront is BigCommerce (`window.Zonos.isBigCommerce`),
11
+ * - the shopper is in a Zonos shipping zone
12
+ * (`localizationStore.isShippableCountry`), and
13
+ * - BC's currently selected native currency
14
+ * (`document.body.dataset.currencyCode`) equals `zonosStore.sourceCurrency`
15
+ * — i.e. BC has not pre-converted the prices Hello reads from the DOM.
16
+ *
17
+ * If those conditions don't hold (non-BC platform, non-shippable country,
18
+ * BC currency differs from source, or the selector is not configured), the
19
+ * function removes the class so any previously hidden element re-appears.
20
+ */
21
+ export const toggleBigcommerceNativeCurrencySelector = () => {
22
+ var _a, _b;
23
+ if (typeof window === 'undefined' || !((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.isBigCommerce)) {
24
+ return;
25
+ }
26
+ const selector = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.bigcommerceNativeCurrencySelector;
27
+ if (!selector) {
28
+ return;
29
+ }
30
+ const bigcommerceCurrencyCode = document.body.dataset.currencyCode;
31
+ const shouldHide = localizationStore.isShippableCountry &&
32
+ !!bigcommerceCurrencyCode &&
33
+ bigcommerceCurrencyCode === zonosStore.sourceCurrency;
34
+ try {
35
+ const elements = document.querySelectorAll(selector);
36
+ elements.forEach(element => {
37
+ if (shouldHide) {
38
+ element.classList.add(HIDE_CLASSNAME);
39
+ }
40
+ else {
41
+ element.classList.remove(HIDE_CLASSNAME);
42
+ }
43
+ });
44
+ }
45
+ catch (error) {
46
+ logError(`Error toggling BigCommerce native currency selector: ${error}`);
47
+ }
48
+ };
@@ -1,5 +1,5 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-9662b071.js';
2
- import { s as storageStore, l as localizationStore, e as getOverridenZCountry, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-d2631105.js';
2
+ import { s as storageStore, l as localizationStore, e as getOverridenZCountry, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-33a9f7ff.js';
3
3
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
4
4
  import { h as handleFetch, l as logError, f as fallbackApiList, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, j as jsonParse } from './handleFetch-a844cac1.js';
5
5
  import { i as isDarkColor } from './isDarkColor-0a8453e7.js';
@@ -1,4 +1,4 @@
1
- import { l as localizationStore } from './localization-d2631105.js';
1
+ import { l as localizationStore } from './localization-33a9f7ff.js';
2
2
 
3
3
  /**
4
4
  * Since the backend and the frontend are using the same keys,
package/dist/esm/index.js CHANGED
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
131
131
  return null;
132
132
  }
133
133
  const qaUrl = extractZonosQaUrl(window.location.href);
134
- const cdnUrl = "https://v1.3.266.js.zonos.com";
134
+ const cdnUrl = "https://v1.3.267.js.zonos.com";
135
135
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
136
136
  if (!qaUrl &&
137
137
  (cdnUrl.includes('test.') ||
@@ -379,10 +379,10 @@ const zonosLoadUrl = (() => {
379
379
  return null;
380
380
  })();
381
381
  const startLoadTime = Date.now();
382
- const ZONOS_URL = "https://v1.3.266.js.zonos.com";
383
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.266";
384
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.266";
385
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.266";
382
+ const ZONOS_URL = "https://v1.3.267.js.zonos.com";
383
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.267";
384
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.267";
385
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.267";
386
386
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
387
387
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
388
388
  class Zonos {
@@ -400,7 +400,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
400
400
  ? new URLSearchParams(window.location.search).get('iframeLogType')
401
401
  : null;
402
402
  Zonos.isBigCommerce = false;
403
- Zonos.releaseDate = "1779310983053";
403
+ Zonos.releaseDate = "1779911513615";
404
404
  Zonos.isLegacyCheckout = false;
405
405
  Zonos.googleAnalyticId = null;
406
406
  Zonos.googleAnalyticReady = false;
@@ -425,7 +425,7 @@ Zonos.isNpm = true;
425
425
  Zonos.zonosQaUrl = null;
426
426
  Zonos.zonosQaUrlApi = null;
427
427
  Zonos.trackEventLogs = [];
428
- Zonos.version = `v${"1.3.266"}`;
428
+ Zonos.version = `v${"1.3.267"}`;
429
429
  Zonos.modeAlerted = false;
430
430
  Zonos.cartData = null;
431
431
  Zonos.paypal = null;
@@ -1,6 +1,6 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-9662b071.js';
2
- import { b as stripeStore, G as stripeStoreBuildAddressForPartyCreate, d as cartStore, H as cartStoreUpdateSelectedShippingOption } from './cart-62c166fc.js';
3
- import { s as storageStore } from './localization-d2631105.js';
2
+ import { b as stripeStore, G as stripeStoreBuildAddressForPartyCreate, d as cartStore, H as cartStoreUpdateSelectedShippingOption } from './cart-49082718.js';
3
+ import { s as storageStore } from './localization-33a9f7ff.js';
4
4
  import { h as handleFetch, s as sendErrorLog, l as logError } from './handleFetch-a844cac1.js';
5
5
  import { b as allLogs } from './VarianceTest-572cecf5.js';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-9662b071.js';
2
- import { b as stripeStore, G as stripeStoreBuildAddressForPartyCreate, d as cartStore, H as cartStoreUpdateSelectedShippingOption } from './cart-62c166fc.js';
3
- import { s as storageStore } from './localization-d2631105.js';
2
+ import { b as stripeStore, G as stripeStoreBuildAddressForPartyCreate, d as cartStore, H as cartStoreUpdateSelectedShippingOption } from './cart-49082718.js';
3
+ import { s as storageStore } from './localization-33a9f7ff.js';
4
4
  import { h as handleFetch, s as sendErrorLog, l as logError } from './handleFetch-a844cac1.js';
5
5
  import { b as allLogs } from './VarianceTest-572cecf5.js';
6
6
 
@@ -17125,6 +17125,52 @@ const setZCountryUrlParam = (selectedCountryCode) => {
17125
17125
  }
17126
17126
  };
17127
17127
 
17128
+ const HIDE_CLASSNAME = 'z--bc-currency-hide';
17129
+ /**
17130
+ * Hides BigCommerce's native currency selector while Hello is actively
17131
+ * converting prices, and restores it otherwise. The selector is hidden
17132
+ * only when all of the following hold:
17133
+ *
17134
+ * - the host storefront is BigCommerce (`window.Zonos.isBigCommerce`),
17135
+ * - the shopper is in a Zonos shipping zone
17136
+ * (`localizationStore.isShippableCountry`), and
17137
+ * - BC's currently selected native currency
17138
+ * (`document.body.dataset.currencyCode`) equals `zonosStore.sourceCurrency`
17139
+ * — i.e. BC has not pre-converted the prices Hello reads from the DOM.
17140
+ *
17141
+ * If those conditions don't hold (non-BC platform, non-shippable country,
17142
+ * BC currency differs from source, or the selector is not configured), the
17143
+ * function removes the class so any previously hidden element re-appears.
17144
+ */
17145
+ const toggleBigcommerceNativeCurrencySelector = () => {
17146
+ var _a, _b;
17147
+ if (typeof window === 'undefined' || !((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.isBigCommerce)) {
17148
+ return;
17149
+ }
17150
+ const selector = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.bigcommerceNativeCurrencySelector;
17151
+ if (!selector) {
17152
+ return;
17153
+ }
17154
+ const bigcommerceCurrencyCode = document.body.dataset.currencyCode;
17155
+ const shouldHide = localizationStore.isShippableCountry &&
17156
+ !!bigcommerceCurrencyCode &&
17157
+ bigcommerceCurrencyCode === zonosStore.sourceCurrency;
17158
+ try {
17159
+ const elements = document.querySelectorAll(selector);
17160
+ elements.forEach(element => {
17161
+ if (shouldHide) {
17162
+ element.classList.add(HIDE_CLASSNAME);
17163
+ }
17164
+ else {
17165
+ element.classList.remove(HIDE_CLASSNAME);
17166
+ }
17167
+ });
17168
+ }
17169
+ catch (error) {
17170
+ logError(`Error toggling BigCommerce native currency selector: ${error}`);
17171
+ }
17172
+ };
17173
+
17128
17174
  const { dispose: localizationDispose, onChange: localizationStoreOnChange, state: localizationStore, } = createStore({
17129
17175
  countryLandedCost: null,
17130
17176
  customMessages: [],
@@ -17286,6 +17332,11 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
17286
17332
  localizationStore.isDisabledCountry = isDisabledCountry;
17287
17333
  log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
17288
17334
  addInternationalHideClass();
17335
+ // Hide / restore BC's native currency selector based on the new
17336
+ // shipping-zone state. Runs here (rather than inside `currencyDisplay`)
17337
+ // because `currencyDisplay` is also invoked from the price-mutation
17338
+ // observer in `zonos-hello.tsx`, which fires on every DOM render.
17339
+ toggleBigcommerceNativeCurrencySelector();
17289
17340
  if (!selectedCountryCode) {
17290
17341
  return;
17291
17342
  }
@@ -1,6 +1,6 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-9662b071.js';
2
- import { t as trackConversionEvent, y as validateCheckoutSession, b as stripeStore, d as cartStore, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, z as storeCreditStoreCreateOrder, r as cartStoreNextStep, h as cartStoreClearCheckoutInterval, F as storeCreditStoreGetEffectiveAmount } from './cart-62c166fc.js';
3
- import { t as translate, s as storageStore } from './localization-d2631105.js';
2
+ import { t as trackConversionEvent, y as validateCheckoutSession, b as stripeStore, d as cartStore, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, z as storeCreditStoreCreateOrder, r as cartStoreNextStep, h as cartStoreClearCheckoutInterval, F as storeCreditStoreGetEffectiveAmount } from './cart-49082718.js';
3
+ import { t as translate, s as storageStore } from './localization-33a9f7ff.js';
4
4
  import { h as handleFetch, g as getIsTestMode, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
5
5
  import { i as isContrastColor } from './isContrastColor-6bad285e.js';
6
6
  import { l as log } from './VarianceTest-572cecf5.js';
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-62c166fc.js';
2
- import { s as storageStore } from './localization-d2631105.js';
1
+ import { d as cartStore } from './cart-49082718.js';
2
+ import { s as storageStore } from './localization-33a9f7ff.js';
3
3
  import { l as logError, h as handleFetch } from './handleFetch-a844cac1.js';
4
4
 
5
5
  const placeTestOrder = async () => {
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-62c166fc.js';
2
- import { o as applyInclusiveEffectiveRate, d as currencyFormat } from './localization-d2631105.js';
1
+ import { d as cartStore } from './cart-49082718.js';
2
+ import { o as applyInclusiveEffectiveRate, d as currencyFormat } from './localization-33a9f7ff.js';
3
3
 
4
4
  const getDisplayCurrency = () => {
5
5
  var _a, _b;
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, a as Host, d as createEvent, g as getElement } from './index-cfd394c8.js';
2
- import { t as translate, l as localizationStore, s as storageStore, q as storageStoreOnChange } from './localization-d2631105.js';
2
+ import { t as translate, l as localizationStore, s as storageStore, q as storageStoreOnChange } from './localization-33a9f7ff.js';
3
3
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
4
- import { Q as extractName, b as stripeStore, q as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-62c166fc.js';
4
+ import { Q as extractName, b as stripeStore, q as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-49082718.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { g as getBorderRadius } from './getBorderRadius-98c64be8.js';
7
7
  import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
2
  import { t as throttle_1 } from './throttle-882b1f47.js';
3
- import { b as stripeStore, t as trackConversionEvent, Q as extractName, E as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-62c166fc.js';
4
- import { s as storageStore, r as getFallbackDefaultCountryCode, t as translate, q as storageStoreOnChange, l as localizationStore } from './localization-d2631105.js';
3
+ import { b as stripeStore, t as trackConversionEvent, Q as extractName, E as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-49082718.js';
4
+ import { s as storageStore, r as getFallbackDefaultCountryCode, t as translate, q as storageStoreOnChange, l as localizationStore } from './localization-33a9f7ff.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
6
6
  import { l as logError, i as isCheckoutMobile, s as sendErrorLog } from './handleFetch-a844cac1.js';
7
7
  import { a as shouldRenderTaxIdInput, s as shouldRenderShortAddressCodeInput } from './shouldRenderTaxIdInput-2572bf77.js';
@@ -2,10 +2,10 @@ import { r as registerInstance, h, a as Host, g as getElement, d as createEvent
2
2
  import { f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-98c64be8.js';
5
- import { b as stripeStore, t as trackConversionEvent } from './cart-62c166fc.js';
6
- import { s as storageStore } from './localization-d2631105.js';
5
+ import { b as stripeStore, t as trackConversionEvent } from './cart-49082718.js';
6
+ import { s as storageStore } from './localization-33a9f7ff.js';
7
7
  import { l as logError } from './handleFetch-a844cac1.js';
8
- import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-424d040d.js';
8
+ import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-2e9aa4ba.js';
9
9
  import { l as log } from './VarianceTest-572cecf5.js';
10
10
  import './isDarkColor-0a8453e7.js';
11
11
  import './isContrastColor-6bad285e.js';
@@ -1,18 +1,18 @@
1
1
  import { r as registerInstance, e as getAssetPath, h, a as Host, F as Fragment, d as createEvent, g as getElement } from './index-cfd394c8.js';
2
- import { d as cartStore, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, b as stripeStore, C as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, M as stripeStoreMessageBasedOnStatus, N as storeCreditStore, O as storeCreditStoreReset, x as storeCreditStoreCoversFullAmount, r as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as extractName, D as cartStoreOnChange, R as stripeStoreAsyncAddressUpdate, H as cartStoreUpdateSelectedShippingOption, S as cartStoreGetShippingTransitInfo, T as cartStoreGetMethod, U as sortServiceLevelOptionsByAmount } from './cart-62c166fc.js';
3
- import { t as translate, l as localizationStore, s as storageStore, c as localizationStoreOnChange } from './localization-d2631105.js';
4
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-513ead96.js';
2
+ import { d as cartStore, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, b as stripeStore, C as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, M as stripeStoreMessageBasedOnStatus, N as storeCreditStore, O as storeCreditStoreReset, x as storeCreditStoreCoversFullAmount, r as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as extractName, D as cartStoreOnChange, R as stripeStoreAsyncAddressUpdate, H as cartStoreUpdateSelectedShippingOption, S as cartStoreGetShippingTransitInfo, T as cartStoreGetMethod, U as sortServiceLevelOptionsByAmount } from './cart-49082718.js';
3
+ import { t as translate, l as localizationStore, s as storageStore, c as localizationStoreOnChange } from './localization-33a9f7ff.js';
4
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-b84a6da7.js';
5
5
  import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-5f7856f2.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
7
7
  import { z as zonosStore, h as zonosStoreOnChange, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
8
- import { D as DUTY_KEY, T as TAXES_KEY, h as hasInclusivePrice } from './hasInclusivePrice-a73f64b7.js';
9
- import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore } from './paypal-424d040d.js';
8
+ import { D as DUTY_KEY, T as TAXES_KEY, h as hasInclusivePrice } from './hasInclusivePrice-2323d514.js';
9
+ import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore } from './paypal-2e9aa4ba.js';
10
10
  import { h as handleFetch, s as sendErrorLog, j as jsonParse, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
11
11
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
12
12
  import { g as getBorderRadius } from './getBorderRadius-98c64be8.js';
13
13
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
14
14
  import { l as languages } from './ILanguage-cd6acb72.js';
15
- import { p as placeTestOrder } from './placeTestOrder-cf237d95.js';
15
+ import { p as placeTestOrder } from './placeTestOrder-35c9b460.js';
16
16
  import { i as isDarkColor } from './isDarkColor-0a8453e7.js';
17
17
  import { g as getContrastColor } from './getContrastColor-0aa643c1.js';
18
18
  import { i as isColorVariable } from './isColorVariable-0a94004f.js';
@@ -1,7 +1,7 @@
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-62c166fc.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitAnalytics, a as paypalStore, b as paypalInitScript } from './paypal-424d040d.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-d2631105.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-49082718.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitAnalytics, a as paypalStore, b as paypalInitScript } from './paypal-2e9aa4ba.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-33a9f7ff.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-9662b071.js';
6
6
  import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
7
7
  import { h as handleFetch, l as logError, g as getIsTestMode, j as jsonParse, b as getAdditionalLogMetadata, s as sendErrorLog, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-a844cac1.js';
@@ -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-62c166fc.js';
2
+ import { d as cartStore } from './cart-49082718.js';
3
3
  import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-5f7856f2.js';
4
4
  import { f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { s as styles } from './styles-6fc2fad9.js';
7
- import './localization-d2631105.js';
7
+ import './localization-33a9f7ff.js';
8
8
  import './handleFetch-a844cac1.js';
9
9
  import './VarianceTest-572cecf5.js';
10
10
  import './isDarkColor-0a8453e7.js';
@@ -1,17 +1,17 @@
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-62c166fc.js';
3
- import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-424d040d.js';
4
- import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-d2631105.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-49082718.js';
3
+ import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-2e9aa4ba.js';
4
+ import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-33a9f7ff.js';
5
5
  import { z as zonosStore } from './zonosStore-9662b071.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-98c64be8.js';
9
9
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
10
- import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-5f50ec81.js';
10
+ import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-910aea2e.js';
11
11
  import { c as classes } from './classes-0d95c529.js';
12
12
  import { l as languages } from './ILanguage-cd6acb72.js';
13
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-513ead96.js';
14
- import { p as placeTestOrder } from './placeTestOrder-cf237d95.js';
13
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-b84a6da7.js';
14
+ import { p as placeTestOrder } from './placeTestOrder-35c9b460.js';
15
15
  import { r as renderFallback } from './renderFallback-b250f4e9.js';
16
16
  import './isDarkColor-0a8453e7.js';
17
17
  import './isContrastColor-6bad285e.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, a as Host, F as Fragment } from './index-cfd394c8.js';
2
- import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, A as stripeStoreConfirmPayment, E as stripeStoreOnChange, C as stripeStoreReset, f as cartStoreReset } from './cart-62c166fc.js';
3
- import { i as isCollectMobile, a as isCollectTablet, c as collectStoreUpdateSelectedShippingOption, b as collectStoreInitShippingInfo, d as collectStoreAsyncAddressUpdate, e as collectStore } from './isCollectMobileTablet-5f50ec81.js';
4
- import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-424d040d.js';
5
- import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-d2631105.js';
2
+ import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, A as stripeStoreConfirmPayment, E as stripeStoreOnChange, C as stripeStoreReset, f as cartStoreReset } from './cart-49082718.js';
3
+ import { i as isCollectMobile, a as isCollectTablet, c as collectStoreUpdateSelectedShippingOption, b as collectStoreInitShippingInfo, d as collectStoreAsyncAddressUpdate, e as collectStore } from './isCollectMobileTablet-910aea2e.js';
4
+ import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-2e9aa4ba.js';
5
+ import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-33a9f7ff.js';
6
6
  import { z as zonosStore } from './zonosStore-9662b071.js';
7
7
  import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
8
8
  import { h as handleFetch, s as sendErrorLog, l as logError, g as getIsTestMode } from './handleFetch-a844cac1.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, d as createEvent, h, a as Host } from './index-cfd394c8.js';
2
- import { b as stripeStore } from './cart-62c166fc.js';
3
- import { e as getOverridenZCountry, i as isValidSelector, h as initLocalizationStore, s as storageStore, a as localizationStoreUpdateSelectedCountryCode } from './localization-d2631105.js';
2
+ import { b as stripeStore } from './cart-49082718.js';
3
+ import { e as getOverridenZCountry, i as isValidSelector, h as initLocalizationStore, s as storageStore, a as localizationStoreUpdateSelectedCountryCode } from './localization-33a9f7ff.js';
4
4
  import { z as zonosStore, e as zonosStoreInitSetting, f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
5
5
  import { g as getGenericSettingsOverride, i as iframeServices, a as injectPrivateIframe } from './getGenericSettingsOverride-0bc3e118.js';
6
6
  import { h as handleFetch, l as logError } from './handleFetch-a844cac1.js';
@@ -97,6 +97,122 @@ const initInvoice = () => {
97
97
  injectCheckoutElement();
98
98
  };
99
99
 
100
+ const STYLE_ID = 'zonos-domestic-element-hide-style';
101
+ /**
102
+ * Probe whether the host parser understands `:is(...)`. Real browsers do
103
+ * (Chrome 88+, Firefox 78+, Safari 14+); older environments and some test
104
+ * runtimes don't. When supported, we wrap the merchant selector in a single
105
+ * `:is(...)` so a single `body.z-intl ` ancestor scopes the whole group.
106
+ * When not supported, we distribute the prefix across each top-level
107
+ * comma-separated piece instead — so the rule still applies in that
108
+ * environment.
109
+ */
110
+ const supportsIsSelector = typeof document !== 'undefined' &&
111
+ (() => {
112
+ try {
113
+ document.querySelector(':is(.zonos-is-probe)');
114
+ return true;
115
+ }
116
+ catch (_a) {
117
+ return false;
118
+ }
119
+ })();
120
+ /**
121
+ * Split a CSS selector string on top-level commas. Commas inside parentheses
122
+ * (`:not(.a, .b)`, `:nth-child(2n+1)`) or attribute brackets
123
+ * (`[data-foo=","]`) are preserved as part of the piece.
124
+ */
125
+ const splitTopLevelCommas = (input) => {
126
+ const parts = [];
127
+ let parenDepth = 0;
128
+ let bracketDepth = 0;
129
+ let current = '';
130
+ for (let i = 0; i < input.length; i++) {
131
+ const char = input[i];
132
+ if (char === '(') {
133
+ parenDepth++;
134
+ }
135
+ else if (char === ')') {
136
+ parenDepth--;
137
+ }
138
+ else if (char === '[') {
139
+ bracketDepth++;
140
+ }
141
+ else if (char === ']') {
142
+ bracketDepth--;
143
+ }
144
+ if (char === ',' && parenDepth === 0 && bracketDepth === 0) {
145
+ const trimmed = current.trim();
146
+ if (trimmed) {
147
+ parts.push(trimmed);
148
+ }
149
+ current = '';
150
+ }
151
+ else {
152
+ current += char;
153
+ }
154
+ }
155
+ const trimmed = current.trim();
156
+ if (trimmed) {
157
+ parts.push(trimmed);
158
+ }
159
+ return parts;
160
+ };
161
+ /**
162
+ * Build the fully-scoped selector that will land in the injected `<style>`
163
+ * tag. Exported so tests can exercise both branches of the `:is()`-support
164
+ * fallback without having to mock the module-level probe.
165
+ */
166
+ const buildDomesticHideSelector = ({ merchantSelector, supportsIs, }) => {
167
+ if (supportsIs) {
168
+ return `body.z-intl :is(${merchantSelector})`;
169
+ }
170
+ // Fallback: distribute the `body.z-intl ` ancestor prefix across each
171
+ // top-level comma-separated piece. Parentheses/brackets are respected,
172
+ // so pseudo-classes that take selector lists (`:not(.a, .b)`) and
173
+ // attribute selectors that contain commas stay intact.
174
+ return splitTopLevelCommas(merchantSelector)
175
+ .map(part => `body.z-intl ${part}`)
176
+ .join(', ');
177
+ };
178
+ /**
179
+ * Inject a `<style>` tag that hides storefront elements matching the
180
+ * merchant-configured `checkoutSettings.domesticElementSelector`, scoped to
181
+ * `body.z-intl` so the rule only takes effect when the shopper is in a
182
+ * shipping zone (Hello sets the body class). The exact selector we emit is
183
+ * also the selector we validate — see [[buildDomesticHideSelector]] for the
184
+ * `:is()`-support branching.
185
+ */
186
+ const injectDomesticElementHideStyle = (domesticElementSelector) => {
187
+ if (typeof document === 'undefined' || !domesticElementSelector) {
188
+ return;
189
+ }
190
+ const fullSelector = buildDomesticHideSelector({
191
+ merchantSelector: domesticElementSelector,
192
+ supportsIs: supportsIsSelector,
193
+ });
194
+ // The browser's own parser is the source of truth — `document.querySelector`
195
+ // throws `DOMException(SyntaxError)` for syntactically invalid selectors.
196
+ // Validating the exact string we're about to emit catches both malformed
197
+ // input and payloads that close `:is(` early to escape the wrapper.
198
+ try {
199
+ document.querySelector(fullSelector);
200
+ }
201
+ catch (_a) {
202
+ log(`Skip domesticElementSelector injection: "${domesticElementSelector}" produced an invalid CSS selector ("${fullSelector}")`, 'warn');
203
+ return;
204
+ }
205
+ // Already injected — settings can re-emit on hot reload during dev.
206
+ if (document.getElementById(STYLE_ID)) {
207
+ return;
208
+ }
209
+ const style = document.createElement('style');
210
+ style.id = STYLE_ID;
211
+ style.textContent = `${fullSelector} { display: none !important; }`;
212
+ (document.head || document.body).appendChild(style);
213
+ log('Zonos domestic element hide style injected');
214
+ };
215
+
100
216
  const injectHelloComponent = (anchorElementSelector) => {
101
217
  const triggerAnchorElement = document.querySelector(anchorElementSelector);
102
218
  // append checkout component if doesn't exist
@@ -629,6 +745,9 @@ const ZonosController = class {
629
745
  zonosSettings: json,
630
746
  });
631
747
  zonosStore.zonosMode = zonosMode;
748
+ // Inject the merchant's domestic-element hide style now that
749
+ // checkoutSettings have been merged into the store.
750
+ injectDomesticElementHideStyle(zonosStore.checkoutSettings.domesticElementSelector);
632
751
  // setup google font after store loaded
633
752
  void this.setupGoogleFont();
634
753
  if (zonosStore.helloSettings.visibilityStatus === 'DISABLED') {
@@ -726,7 +845,7 @@ const ZonosController = class {
726
845
  zonosStore.organizationName = organizationName;
727
846
  }
728
847
  render() {
729
- return h(Host, { key: '681a81baa59bfe91e9fe0927aee49fa720fcb35b', class: "zonos--elements" });
848
+ return h(Host, { key: 'fe1f262a2bfbf4f6f39c0f23783c132bde8d2dd7', class: "zonos--elements" });
730
849
  }
731
850
  };
732
851
  ZonosController.style = ZonosControllerStyle0;
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
- import { l as localizationStore } from './localization-d2631105.js';
2
+ import { l as localizationStore } from './localization-33a9f7ff.js';
3
3
  import { f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import './handleFetch-a844cac1.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './localization-d2631105.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './localization-33a9f7ff.js';
3
3
  import { f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-0a8453e7.js';
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, d as createEvent, h, F as Fragment, a as Host } from './index-cfd394c8.js';
2
- import { l as localizationStore, t as translate, d as currencyFormat } from './localization-d2631105.js';
2
+ import { l as localizationStore, t as translate, d as currencyFormat } from './localization-33a9f7ff.js';
3
3
  import { z as zonosStore } from './zonosStore-9662b071.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
6
- import { h as hasInclusivePrice, T as TAXES_KEY, D as DUTY_KEY } from './hasInclusivePrice-a73f64b7.js';
6
+ import { h as hasInclusivePrice, T as TAXES_KEY, D as DUTY_KEY } from './hasInclusivePrice-2323d514.js';
7
7
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
8
8
  import { e as euCountryCodes } from './TaxId-50d72254.js';
9
9
  import './handleFetch-a844cac1.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
2
  import { d as debounce_1 } from './debounce-ab526ca0.js';
3
- import { l as localizationStore, i as isValidSelector, t as translate, g as getZCountryUrlParam, j as setZCountryUrlParam, k as currencyDisplay, m as currencyConvertAndFormat, n as currencyConvert, d as currencyFormat } from './localization-d2631105.js';
3
+ import { l as localizationStore, i as isValidSelector, t as translate, g as getZCountryUrlParam, j as setZCountryUrlParam, k as currencyDisplay, m as currencyConvertAndFormat, n as currencyConvert, d as currencyFormat } from './localization-33a9f7ff.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-9662b071.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { h as handleFetch, l as logError } from './handleFetch-a844cac1.js';
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, h, a as Host } from './index-cfd394c8.js';
2
- import { d as cartStore } from './cart-62c166fc.js';
3
- import { t as translate } from './localization-d2631105.js';
4
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-513ead96.js';
2
+ import { d as cartStore } from './cart-49082718.js';
3
+ import { t as translate } from './localization-33a9f7ff.js';
4
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-b84a6da7.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
- import { c as invoiceStore } from './invoice-fa4ff6fb.js';
6
+ import { c as invoiceStore } from './invoice-16c688e7.js';
7
7
  import { r as renderFallback } from './renderFallback-b250f4e9.js';
8
8
  import './zonosStore-9662b071.js';
9
9
  import './VarianceTest-572cecf5.js';
@@ -1,7 +1,7 @@
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-62c166fc.js';
3
- import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-424d040d.js';
4
- import { t as translate, s as storageStore, l as localizationStore } from './localization-d2631105.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-49082718.js';
3
+ import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-2e9aa4ba.js';
4
+ import { t as translate, s as storageStore, l as localizationStore } from './localization-33a9f7ff.js';
5
5
  import { z as zonosStore } from './zonosStore-9662b071.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';
@@ -10,9 +10,9 @@ import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
10
10
  import { i as isInvoiceMobile, a as isInvoiceTablet } from './isInvoiceMobileTablet-1f7b614e.js';
11
11
  import { c as classes } from './classes-0d95c529.js';
12
12
  import { l as languages } from './ILanguage-cd6acb72.js';
13
- import { c as invoiceStore } from './invoice-fa4ff6fb.js';
14
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-513ead96.js';
15
- import { p as placeTestOrder } from './placeTestOrder-cf237d95.js';
13
+ import { c as invoiceStore } from './invoice-16c688e7.js';
14
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-b84a6da7.js';
15
+ import { p as placeTestOrder } from './placeTestOrder-35c9b460.js';
16
16
  import { r as renderFallback } from './renderFallback-b250f4e9.js';
17
17
  import './isDarkColor-0a8453e7.js';
18
18
  import './isContrastColor-6bad285e.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, a as Host, F as Fragment } from './index-cfd394c8.js';
2
- import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, A as stripeStoreConfirmPayment, E as stripeStoreOnChange, C as stripeStoreReset, f as cartStoreReset } from './cart-62c166fc.js';
3
- import { i as invoiceStoreUpdateSelectedShippingOption, a as invoiceStoreInitShippingInfo, b as invoiceStoreAsyncAddressUpdate, c as invoiceStore } from './invoice-fa4ff6fb.js';
4
- import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-424d040d.js';
5
- import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-d2631105.js';
2
+ import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, A as stripeStoreConfirmPayment, E as stripeStoreOnChange, C as stripeStoreReset, f as cartStoreReset } from './cart-49082718.js';
3
+ import { i as invoiceStoreUpdateSelectedShippingOption, a as invoiceStoreInitShippingInfo, b as invoiceStoreAsyncAddressUpdate, c as invoiceStore } from './invoice-16c688e7.js';
4
+ import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-2e9aa4ba.js';
5
+ import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-33a9f7ff.js';
6
6
  import { z as zonosStore } from './zonosStore-9662b071.js';
7
7
  import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
8
8
  import { h as handleFetch, s as sendErrorLog, l as logError, g as getIsTestMode } from './handleFetch-a844cac1.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, a as Host } from './index-cfd394c8.js';
2
- import { u as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './localization-d2631105.js';
2
+ import { u as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './localization-33a9f7ff.js';
3
3
  import { f as zonosStoreFontFamily } from './zonosStore-9662b071.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
5
  import './handleFetch-a844cac1.js';