@zonos/elements 1.3.123 → 1.3.124

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 (83) hide show
  1. package/dist/cjs/{CheckoutConfig-00c7333a.js → CheckoutConfig-8e3cdcb3.js} +1 -1
  2. package/dist/cjs/{cart-d2676914.js → cart-a2a94f35.js} +1 -1
  3. package/dist/cjs/{handleFetch-83c97d08.js → handleFetch-fa0ce321.js} +5 -1
  4. package/dist/cjs/index.cjs.js +9 -9
  5. package/dist/cjs/{paypal-617669c3.js → paypal-bf7d3c50.js} +2 -2
  6. package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
  7. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
  9. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  10. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
  16. package/dist/collection/components/utils/handleFetch.js +5 -1
  17. package/dist/esm/{CheckoutConfig-5cde3ee4.js → CheckoutConfig-101b97e6.js} +1 -1
  18. package/dist/esm/{cart-5346e4d9.js → cart-7d97dbff.js} +1 -1
  19. package/dist/esm/{handleFetch-7424d200.js → handleFetch-da1a9c5d.js} +5 -1
  20. package/dist/esm/index.js +10 -10
  21. package/dist/esm/{paypal-db99e15a.js → paypal-7264946a.js} +2 -2
  22. package/dist/esm/zonos-address_7.entry.js +2 -2
  23. package/dist/esm/zonos-cart-items_13.entry.js +3 -3
  24. package/dist/esm/zonos-checkout.entry.js +4 -4
  25. package/dist/esm/zonos-controller.entry.js +2 -2
  26. package/dist/esm/zonos-country-flag.entry.js +2 -2
  27. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  28. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  29. package/dist/esm/zonos-hello.entry.js +2 -2
  30. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  31. package/dist/esm/zonos-notification_3.entry.js +3 -3
  32. package/dist/esm-es5/{CheckoutConfig-5cde3ee4.js → CheckoutConfig-101b97e6.js} +1 -1
  33. package/dist/esm-es5/{cart-5346e4d9.js → cart-7d97dbff.js} +1 -1
  34. package/dist/esm-es5/{handleFetch-7424d200.js → handleFetch-da1a9c5d.js} +1 -1
  35. package/dist/esm-es5/index.js +1 -1
  36. package/dist/esm-es5/{paypal-db99e15a.js → paypal-7264946a.js} +1 -1
  37. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  38. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  39. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  40. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  41. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  42. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  43. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  44. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  45. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  46. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  47. package/dist/scripts/index.js +1 -1
  48. package/dist/scripts/loadZonos.js +1 -1
  49. package/dist/scripts/zonos.js +1 -1
  50. package/dist/zonos-elements/index.esm.js +1 -1
  51. package/dist/zonos-elements/{p-d5cf05b7.system.entry.js → p-02c97b12.system.entry.js} +1 -1
  52. package/dist/zonos-elements/{p-97334e5a.system.entry.js → p-073bcd19.system.entry.js} +1 -1
  53. package/dist/zonos-elements/{p-81055154.system.js → p-0fa85ff9.system.js} +1 -1
  54. package/dist/zonos-elements/{p-6efffc06.entry.js → p-1a7975a6.entry.js} +1 -1
  55. package/dist/zonos-elements/{p-ccfd1d50.entry.js → p-2763b93b.entry.js} +1 -1
  56. package/dist/zonos-elements/{p-b3b1c105.entry.js → p-3251fb8b.entry.js} +1 -1
  57. package/dist/zonos-elements/{p-9ea5037d.system.entry.js → p-4afde7ca.system.entry.js} +1 -1
  58. package/dist/zonos-elements/{p-c504e50e.system.entry.js → p-68f30f18.system.entry.js} +1 -1
  59. package/dist/zonos-elements/{p-cfaac5aa.entry.js → p-6cc6c6c4.entry.js} +1 -1
  60. package/dist/zonos-elements/{p-b98e54b2.system.entry.js → p-71a733d4.system.entry.js} +1 -1
  61. package/dist/zonos-elements/p-7769b60c.js +1 -0
  62. package/dist/zonos-elements/{p-8231711f.js → p-78adf768.js} +1 -1
  63. package/dist/zonos-elements/{p-4f5da154.entry.js → p-8138eb01.entry.js} +1 -1
  64. package/dist/zonos-elements/{p-c97b9a45.entry.js → p-8333a565.entry.js} +1 -1
  65. package/dist/zonos-elements/{p-06636f62.entry.js → p-861ed8e9.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-860716a1.entry.js → p-8b1f00a6.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-eb94b8c5.system.entry.js → p-8dd3b09d.system.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-5fe1e3f6.system.js → p-8e833a0c.system.js} +1 -1
  69. package/dist/zonos-elements/{p-62384488.js → p-9368629a.js} +1 -1
  70. package/dist/zonos-elements/{p-b00508d3.system.entry.js → p-9c7618b3.system.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-d1f1f84d.system.entry.js → p-a17ebf04.system.entry.js} +1 -1
  72. package/dist/zonos-elements/{p-8e317f73.js → p-a3b195e9.js} +1 -1
  73. package/dist/zonos-elements/{p-20411dc5.system.entry.js → p-ab4d2507.system.entry.js} +1 -1
  74. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  75. package/dist/zonos-elements/{p-3a3dd0a7.entry.js → p-c8f24421.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-9afea72c.entry.js → p-d2ca12ed.entry.js} +1 -1
  77. package/dist/zonos-elements/{p-bc2efe24.system.js → p-d9dceba1.system.js} +1 -1
  78. package/dist/zonos-elements/{p-8c7715aa.system.js → p-db6be6ab.system.js} +1 -1
  79. package/dist/zonos-elements/{p-8f7935f6.system.entry.js → p-e23684e2.system.entry.js} +1 -1
  80. package/dist/zonos-elements/{p-3ef38f02.system.js → p-f399a2e5.system.js} +1 -1
  81. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  82. package/package.json +1 -1
  83. package/dist/zonos-elements/p-f3cdaa23.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const handleFetch = require('./handleFetch-83c97d08.js');
3
+ const handleFetch = require('./handleFetch-fa0ce321.js');
4
4
 
5
5
  const getTempCartById = async ({ cartId, retries, }) => {
6
6
  const urlParams = new URLSearchParams(window.location.search);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-e12d459c.js');
4
- const handleFetch = require('./handleFetch-83c97d08.js');
4
+ const handleFetch = require('./handleFetch-fa0ce321.js');
5
5
  const isDarkColor = require('./isDarkColor-d206c6fa.js');
6
6
  const getBorderRadius = require('./getBorderRadius-61ed5601.js');
7
7
 
@@ -181,7 +181,11 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
181
181
  };
182
182
  const getResponseBody = async ({ response, shouldLog = true, shouldThrow = false, }) => {
183
183
  try {
184
- const json = await response.json();
184
+ const text = await response.text();
185
+ const json = jsonParse(text);
186
+ if (!json) {
187
+ throw new Error(`Failed to parse content: ${text}`);
188
+ }
185
189
  return json;
186
190
  }
187
191
  catch (e) {
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const handleFetch = require('./handleFetch-83c97d08.js');
6
- const CheckoutConfig = require('./CheckoutConfig-00c7333a.js');
5
+ const handleFetch = require('./handleFetch-fa0ce321.js');
6
+ const CheckoutConfig = require('./CheckoutConfig-8e3cdcb3.js');
7
7
 
8
8
  /**
9
9
  * Get the load version and url based on the loadScriptSrc and version
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
97
97
  return null;
98
98
  }
99
99
  const qaUrl = extractZonosQaUrl(window.location.href);
100
- const cdnUrl = "https://v1.3.123.js.zonos.com";
100
+ const cdnUrl = "https://v1.3.124.js.zonos.com";
101
101
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
102
102
  if (!qaUrl &&
103
103
  (cdnUrl.includes('test.') ||
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
281
281
  }
282
282
  return null;
283
283
  })();
284
- const ZONOS_URL = "https://v1.3.123.js.zonos.com";
285
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.123";
286
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.123";
287
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.123";
284
+ const ZONOS_URL = "https://v1.3.124.js.zonos.com";
285
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.124";
286
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.124";
287
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.124";
288
288
  const INTER_FONT_URL = 'https://rsms.me';
289
289
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
290
290
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
299
299
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
300
300
  Zonos._paypalMockResponse = null;
301
301
  Zonos.isBigCommerce = false;
302
- Zonos.releaseDate = "1730930859534";
302
+ Zonos.releaseDate = "1730994388117";
303
303
  Zonos.isLegacyCheckout = false;
304
304
  Zonos.showBaseForeign = typeof window !== 'undefined' &&
305
305
  window.location.search.includes('zonosShowBaseForeign');
@@ -309,7 +309,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
309
309
  Zonos.isNpm = true;
310
310
  Zonos.zonosQaUrl = null;
311
311
  Zonos.zonosQaUrlApi = null;
312
- Zonos.version = `v${"1.3.123"}`;
312
+ Zonos.version = `v${"1.3.124"}`;
313
313
  Zonos.modeAlerted = false;
314
314
  Zonos.cartData = null;
315
315
  Zonos.paypal = null;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-e12d459c.js');
4
- const cart = require('./cart-d2676914.js');
5
- const handleFetch = require('./handleFetch-83c97d08.js');
4
+ const cart = require('./cart-a2a94f35.js');
5
+ const handleFetch = require('./handleFetch-fa0ce321.js');
6
6
  const isDarkColor = require('./isDarkColor-d206c6fa.js');
7
7
 
8
8
  /*!
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
- const handleFetch = require('./handleFetch-83c97d08.js');
8
+ const handleFetch = require('./handleFetch-fa0ce321.js');
9
9
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
10
10
  const zonosStore = require('./zonosStore-e12d459c.js');
11
11
  const classes = require('./classes-b7918f56.js');
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-617669c3.js');
8
+ const paypal = require('./paypal-bf7d3c50.js');
9
9
  const zonosStore = require('./zonosStore-e12d459c.js');
10
10
  const createCustomEvent = require('./createCustomEvent-3e982e57.js');
11
11
  const getBorderRadius = require('./getBorderRadius-61ed5601.js');
12
- const handleFetch = require('./handleFetch-83c97d08.js');
12
+ const handleFetch = require('./handleFetch-fa0ce321.js');
13
13
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
14
14
  const ILanguage = require('./ILanguage-98b04442.js');
15
15
  const isDarkColor = require('./isDarkColor-d206c6fa.js');
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
7
- const paypal = require('./paypal-617669c3.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
+ const paypal = require('./paypal-bf7d3c50.js');
8
8
  const zonosStore = require('./zonosStore-e12d459c.js');
9
- const handleFetch = require('./handleFetch-83c97d08.js');
9
+ const handleFetch = require('./handleFetch-fa0ce321.js');
10
10
  const createCustomEvent = require('./createCustomEvent-3e982e57.js');
11
11
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
12
12
  const classes = require('./classes-b7918f56.js');
13
13
  const getBorderRadius = require('./getBorderRadius-61ed5601.js');
14
14
  const isDarkColor = require('./isDarkColor-d206c6fa.js');
15
- const CheckoutConfig = require('./CheckoutConfig-00c7333a.js');
15
+ const CheckoutConfig = require('./CheckoutConfig-8e3cdcb3.js');
16
16
  const RemoveIcon = require('./RemoveIcon-081ac073.js');
17
17
 
18
18
  /**
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const zonosStore = require('./zonosStore-e12d459c.js');
8
- const handleFetch = require('./handleFetch-83c97d08.js');
8
+ const handleFetch = require('./handleFetch-fa0ce321.js');
9
9
  require('./isDarkColor-d206c6fa.js');
10
10
  require('./getBorderRadius-61ed5601.js');
11
11
 
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const zonosStore = require('./zonosStore-e12d459c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- require('./handleFetch-83c97d08.js');
9
+ require('./handleFetch-fa0ce321.js');
10
10
  require('./isDarkColor-d206c6fa.js');
11
11
  require('./getBorderRadius-61ed5601.js');
12
12
 
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const zonosStore = require('./zonosStore-e12d459c.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-d206c6fa.js');
10
10
  const ILanguage = require('./ILanguage-98b04442.js');
11
- require('./handleFetch-83c97d08.js');
11
+ require('./handleFetch-fa0ce321.js');
12
12
  require('./getBorderRadius-61ed5601.js');
13
13
 
14
14
  /**
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const zonosStore = require('./zonosStore-e12d459c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
11
- require('./handleFetch-83c97d08.js');
11
+ require('./handleFetch-fa0ce321.js');
12
12
  require('./isDarkColor-d206c6fa.js');
13
13
  require('./getBorderRadius-61ed5601.js');
14
14
 
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-e12d459c.js');
7
- const cart = require('./cart-d2676914.js');
7
+ const cart = require('./cart-a2a94f35.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const handleFetch = require('./handleFetch-83c97d08.js');
9
+ const handleFetch = require('./handleFetch-fa0ce321.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
11
11
  require('./isDarkColor-d206c6fa.js');
12
12
  require('./getBorderRadius-61ed5601.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-d2676914.js');
6
+ const cart = require('./cart-a2a94f35.js');
7
7
  const zonosStore = require('./zonosStore-e12d459c.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
- require('./handleFetch-83c97d08.js');
9
+ require('./handleFetch-fa0ce321.js');
10
10
  require('./isDarkColor-d206c6fa.js');
11
11
  require('./getBorderRadius-61ed5601.js');
12
12
 
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-e12d459c.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const cart = require('./cart-d2676914.js');
9
- const handleFetch = require('./handleFetch-83c97d08.js');
10
- const paypal = require('./paypal-617669c3.js');
8
+ const cart = require('./cart-a2a94f35.js');
9
+ const handleFetch = require('./handleFetch-fa0ce321.js');
10
+ const paypal = require('./paypal-bf7d3c50.js');
11
11
  require('./isDarkColor-d206c6fa.js');
12
12
  require('./getBorderRadius-61ed5601.js');
13
13
 
@@ -16,7 +16,11 @@ import { log } from "./logging/log";
16
16
  import { sendErrorLog } from "./logging/sendErrorLog";
17
17
  const getResponseBody = async ({ response, shouldLog = true, shouldThrow = false, }) => {
18
18
  try {
19
- const json = await response.json();
19
+ const text = await response.text();
20
+ const json = jsonParse(text);
21
+ if (!json) {
22
+ throw new Error(`Failed to parse content: ${text}`);
23
+ }
20
24
  return json;
21
25
  }
22
26
  catch (e) {
@@ -1,4 +1,4 @@
1
- import { h as handleFetch, l as log, a as logError } from './handleFetch-7424d200.js';
1
+ import { h as handleFetch, l as log, a as logError } from './handleFetch-da1a9c5d.js';
2
2
 
3
3
  const getTempCartById = async ({ cartId, retries, }) => {
4
4
  const urlParams = new URLSearchParams(window.location.search);
@@ -1,5 +1,5 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-6b5bd87c.js';
2
- import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-7424d200.js';
2
+ import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-da1a9c5d.js';
3
3
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
5
5
 
@@ -179,7 +179,11 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
179
179
  };
180
180
  const getResponseBody = async ({ response, shouldLog = true, shouldThrow = false, }) => {
181
181
  try {
182
- const json = await response.json();
182
+ const text = await response.text();
183
+ const json = jsonParse(text);
184
+ if (!json) {
185
+ throw new Error(`Failed to parse content: ${text}`);
186
+ }
183
187
  return json;
184
188
  }
185
189
  catch (e) {
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { l as log, a as logError } from './handleFetch-7424d200.js';
2
- import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5cde3ee4.js';
3
- export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-5cde3ee4.js';
1
+ import { l as log, a as logError } from './handleFetch-da1a9c5d.js';
2
+ import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-101b97e6.js';
3
+ export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-101b97e6.js';
4
4
 
5
5
  /**
6
6
  * Get the load version and url based on the loadScriptSrc and version
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
94
94
  return null;
95
95
  }
96
96
  const qaUrl = extractZonosQaUrl(window.location.href);
97
- const cdnUrl = "https://v1.3.123.js.zonos.com";
97
+ const cdnUrl = "https://v1.3.124.js.zonos.com";
98
98
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
99
99
  if (!qaUrl &&
100
100
  (cdnUrl.includes('test.') ||
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
278
278
  }
279
279
  return null;
280
280
  })();
281
- const ZONOS_URL = "https://v1.3.123.js.zonos.com";
282
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.123";
283
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.123";
284
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.123";
281
+ const ZONOS_URL = "https://v1.3.124.js.zonos.com";
282
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.124";
283
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.124";
284
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.124";
285
285
  const INTER_FONT_URL = 'https://rsms.me';
286
286
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
287
287
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
296
296
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
297
297
  Zonos._paypalMockResponse = null;
298
298
  Zonos.isBigCommerce = false;
299
- Zonos.releaseDate = "1730930859534";
299
+ Zonos.releaseDate = "1730994388117";
300
300
  Zonos.isLegacyCheckout = false;
301
301
  Zonos.showBaseForeign = typeof window !== 'undefined' &&
302
302
  window.location.search.includes('zonosShowBaseForeign');
@@ -306,7 +306,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
306
306
  Zonos.isNpm = true;
307
307
  Zonos.zonosQaUrl = null;
308
308
  Zonos.zonosQaUrlApi = null;
309
- Zonos.version = `v${"1.3.123"}`;
309
+ Zonos.version = `v${"1.3.124"}`;
310
310
  Zonos.modeAlerted = false;
311
311
  Zonos.cartData = null;
312
312
  Zonos.paypal = null;
@@ -1,6 +1,6 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-6b5bd87c.js';
2
- import { d as cartStore, w as stripeStoreHandleInventoryCheck, p as translate, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-5346e4d9.js';
3
- import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-7424d200.js';
2
+ import { d as cartStore, w as stripeStoreHandleInventoryCheck, p as translate, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-7d97dbff.js';
3
+ import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-da1a9c5d.js';
4
4
  import { t as tinycolor } from './isDarkColor-dc08fa26.js';
5
5
 
6
6
  /*!
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { j as stripeStore, S as getFallbackDefaultCountryCode, l as localizationStore, p as translate } from './cart-5346e4d9.js';
2
+ import { j as stripeStore, S as getFallbackDefaultCountryCode, l as localizationStore, p as translate } from './cart-7d97dbff.js';
3
3
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
4
- import { a as logError, l as log } from './handleFetch-7424d200.js';
4
+ import { a as logError, l as log } from './handleFetch-da1a9c5d.js';
5
5
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
6
6
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
2
- import { d as cartStore, H as currencyFormat, p as translate, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, z as stripeStoreReset, j as stripeStore, L as stripeStoreRetrievePayment, t as trackConversionEvent, M as stripeStoreResetPromoCode, N as stripeStoreMessageBasedOnStatus, l as localizationStore, O as stripeStoreTranslateAddressToLatin, P as cartStoreUpdateSelectedShippingOption, Q as cartStoreGetShippingTransitInfo, R as sortServiceLevelOptionsByAmount } from './cart-5346e4d9.js';
2
+ import { d as cartStore, H as currencyFormat, p as translate, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, z as stripeStoreReset, j as stripeStore, L as stripeStoreRetrievePayment, t as trackConversionEvent, M as stripeStoreResetPromoCode, N as stripeStoreMessageBasedOnStatus, l as localizationStore, O as stripeStoreTranslateAddressToLatin, P as cartStoreUpdateSelectedShippingOption, Q as cartStoreGetShippingTransitInfo, R as sortServiceLevelOptionsByAmount } from './cart-7d97dbff.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-db99e15a.js';
4
+ import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-7264946a.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
6
6
  import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
7
7
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
8
- import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-7424d200.js';
8
+ import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-da1a9c5d.js';
9
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
10
10
  import { l as languages } from './ILanguage-cd6acb72.js';
11
11
  import { i as isDarkColor, t as tinycolor } from './isDarkColor-dc08fa26.js';
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as translate, q as getZCountryUrlParam, r as cartStoreSetCheckoutSession, u as stripeStorePrefetchLandedCost, v as cartStoreNextStep, w as stripeStoreHandleInventoryCheck, x as stripeStoreConfirmPayment, y as stripeStoreHandleInventoryRefund, z as stripeStoreReset, A as localizationStoreOnUpdate } from './cart-5346e4d9.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-db99e15a.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as translate, q as getZCountryUrlParam, r as cartStoreSetCheckoutSession, u as stripeStorePrefetchLandedCost, v as cartStoreNextStep, w as stripeStoreHandleInventoryCheck, x as stripeStoreConfirmPayment, y as stripeStoreHandleInventoryRefund, z as stripeStoreReset, A as localizationStoreOnUpdate } from './cart-7d97dbff.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-7264946a.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
5
- import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-7424d200.js';
5
+ import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-da1a9c5d.js';
6
6
  import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
7
7
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
8
8
  import { c as classes } from './classes-0d95c529.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
10
10
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
11
- import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5cde3ee4.js';
11
+ import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-101b97e6.js';
12
12
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
13
13
 
14
14
  /**
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
2
- import { B as isValidSelector, j as stripeStore, C as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-5346e4d9.js';
2
+ import { B as isValidSelector, j as stripeStore, C as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-7d97dbff.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
- import { h as handleFetch, a as logError, l as log } from './handleFetch-7424d200.js';
4
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-da1a9c5d.js';
5
5
  import './isDarkColor-dc08fa26.js';
6
6
  import './getBorderRadius-008516a4.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { l as localizationStore } from './cart-5346e4d9.js';
2
+ import { l as localizationStore } from './cart-7d97dbff.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-7424d200.js';
5
+ import './handleFetch-da1a9c5d.js';
6
6
  import './isDarkColor-dc08fa26.js';
7
7
  import './getBorderRadius-008516a4.js';
8
8
 
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, p as translate, l as localizationStore } from './cart-5346e4d9.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, p as translate, l as localizationStore } from './cart-7d97dbff.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-7424d200.js';
7
+ import './handleFetch-da1a9c5d.js';
8
8
  import './getBorderRadius-008516a4.js';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
2
- import { p as translate, l as localizationStore, H as currencyFormat } from './cart-5346e4d9.js';
2
+ import { p as translate, l as localizationStore, H as currencyFormat } from './cart-7d97dbff.js';
3
3
  import { z as zonosStore } from './zonosStore-6b5bd87c.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
- import './handleFetch-7424d200.js';
7
+ import './handleFetch-da1a9c5d.js';
8
8
  import './isDarkColor-dc08fa26.js';
9
9
  import './getBorderRadius-008516a4.js';
10
10
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
2
  import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
3
- import { l as localizationStore, B as isValidSelector, p as translate, q as getZCountryUrlParam, D as setZCountryUrlParam, E as currencyDisplay, F as currencyConvertAndFormat, G as currencyConvert, H as currencyFormat } from './cart-5346e4d9.js';
3
+ import { l as localizationStore, B as isValidSelector, p as translate, q as getZCountryUrlParam, D as setZCountryUrlParam, E as currencyDisplay, F as currencyConvertAndFormat, G as currencyConvert, H as currencyFormat } from './cart-7d97dbff.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import { h as handleFetch, a as logError, l as log } from './handleFetch-7424d200.js';
5
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-da1a9c5d.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
7
  import './isDarkColor-dc08fa26.js';
8
8
  import './getBorderRadius-008516a4.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
- import { T as localizationStoreUpdateSelectedLocale, p as translate, l as localizationStore } from './cart-5346e4d9.js';
2
+ import { T as localizationStoreUpdateSelectedLocale, p as translate, l as localizationStore } from './cart-7d97dbff.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
- import './handleFetch-7424d200.js';
5
+ import './handleFetch-da1a9c5d.js';
6
6
  import './isDarkColor-dc08fa26.js';
7
7
  import './getBorderRadius-008516a4.js';
8
8
 
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
2
2
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { j as stripeStore } from './cart-5346e4d9.js';
5
- import { a as logError, l as log } from './handleFetch-7424d200.js';
6
- import { d as paypalStoreInitButtons } from './paypal-db99e15a.js';
4
+ import { j as stripeStore } from './cart-7d97dbff.js';
5
+ import { a as logError, l as log } from './handleFetch-da1a9c5d.js';
6
+ import { d as paypalStoreInitButtons } from './paypal-7264946a.js';
7
7
  import './isDarkColor-dc08fa26.js';
8
8
  import './getBorderRadius-008516a4.js';
9
9
 
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-7424d200.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,n,a,o,i;var c=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams(window.location.search);r=t.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:c},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:n=e.sent(),a=n.errors,o=n.json;i=!o||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:c,retries:s-1})];case 3:if(i){return[2,null]}return[2,o]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,n=t.isLegacyCartId;if(!n&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:a=o.sent();log("[ZONOS - loadZonos] getting temp cart data","info",a);if(!a){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:a.cartData,storeFavicon:a.storeFaviconUrl,storeId:a.cartData.storeId,storeLogo:a.storeLogoUrl,zonosApiKey:a.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-da1a9c5d.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,n,a,o,i;var c=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams(window.location.search);r=t.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:c},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:n=e.sent(),a=n.errors,o=n.json;i=!o||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:c,retries:s-1})];case 3:if(i){return[2,null]}return[2,o]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,n=t.isLegacyCartId;if(!n&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:a=o.sent();log("[ZONOS - loadZonos] getting temp cart data","info",a);if(!a){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:a.cartData,storeFavicon:a.storeFaviconUrl,storeId:a.cartData.storeId,storeLogo:a.storeLogoUrl,zonosApiKey:a.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};