@zonos/elements 1.3.119 → 1.3.121
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.
- package/dist/cjs/{CheckoutConfig-f2622b6b.js → CheckoutConfig-222be92b.js} +1 -1
- package/dist/cjs/{cart-596cb57e.js → cart-b2ba04a6.js} +1 -5
- package/dist/cjs/{handleFetch-aa729c61.js → handleFetch-bd39d5cc.js} +4 -1
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-affcc548.js → paypal-1209340d.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/collection/components/store/checkout/stripe.js +0 -4
- package/dist/collection/components/utils/handleFetch.js +4 -1
- package/dist/esm/{CheckoutConfig-018263e2.js → CheckoutConfig-f3f1d468.js} +1 -1
- package/dist/esm/{cart-efbc5880.js → cart-c2a7dbf4.js} +1 -5
- package/dist/esm/{handleFetch-3dea7d46.js → handleFetch-752697c2.js} +4 -1
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-268dd71f.js → paypal-47ce80b4.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +2 -2
- package/dist/esm/zonos-cart-items_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm-es5/{CheckoutConfig-018263e2.js → CheckoutConfig-f3f1d468.js} +1 -1
- package/dist/esm-es5/{cart-efbc5880.js → cart-c2a7dbf4.js} +1 -1
- package/dist/esm-es5/{handleFetch-3dea7d46.js → handleFetch-752697c2.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-268dd71f.js → paypal-47ce80b4.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-eb2e92ab.entry.js → p-02495901.entry.js} +1 -1
- package/dist/zonos-elements/{p-927b66cc.entry.js → p-0af2a53c.entry.js} +1 -1
- package/dist/zonos-elements/{p-5960812d.system.entry.js → p-14b0dc71.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d5b72bb.system.js → p-1cdec61a.system.js} +1 -1
- package/dist/zonos-elements/{p-30adae87.entry.js → p-2251fc7e.entry.js} +1 -1
- package/dist/zonos-elements/{p-3b84160c.js → p-34fb869f.js} +1 -1
- package/dist/zonos-elements/{p-cb06587e.system.entry.js → p-3a70faa7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d7574261.entry.js → p-3f464965.entry.js} +1 -1
- package/dist/zonos-elements/{p-ff9c2eda.system.entry.js → p-63e67e78.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-43b3c2ae.system.js → p-6cbcdee3.system.js} +1 -1
- package/dist/zonos-elements/{p-4e42bab7.system.entry.js → p-76251f26.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cef712dd.entry.js → p-7780ded7.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7a51042.entry.js → p-81dbd74c.entry.js} +1 -1
- package/dist/zonos-elements/{p-7aeefe91.system.entry.js → p-8a64b0c4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a207df84.entry.js → p-9143b174.entry.js} +1 -1
- package/dist/zonos-elements/{p-804a31d8.entry.js → p-9af218f8.entry.js} +1 -1
- package/dist/zonos-elements/{p-6e2f4ea1.system.js → p-9b5f28ba.system.js} +1 -1
- package/dist/zonos-elements/{p-b34dcd91.system.entry.js → p-a70da456.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a8327037.entry.js → p-addf0048.entry.js} +1 -1
- package/dist/zonos-elements/{p-5bd31424.system.entry.js → p-b1373482.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-762ffec5.system.entry.js → p-b1b7ac58.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee0b19a5.system.js → p-b8e00fdf.system.js} +1 -1
- package/dist/zonos-elements/{p-9eae2294.js → p-c0fc4490.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/p-d4110fa4.js +1 -0
- package/dist/zonos-elements/{p-b47564a1.system.js → p-d4ae2bd4.system.js} +2 -2
- package/dist/zonos-elements/{p-72af4019.system.entry.js → p-d5bd3c3a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f494000d.entry.js → p-d8e4b363.entry.js} +1 -1
- package/dist/zonos-elements/{p-70c9464f.js → p-ee89e172.js} +1 -1
- package/dist/zonos-elements/{p-6b382357.system.entry.js → p-f4b06db0.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-970fa103.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-e12d459c.js');
|
|
4
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const handleFetch = require('./handleFetch-bd39d5cc.js');
|
|
5
5
|
const isDarkColor = require('./isDarkColor-d206c6fa.js');
|
|
6
6
|
const getBorderRadius = require('./getBorderRadius-61ed5601.js');
|
|
7
7
|
|
|
@@ -10053,10 +10053,6 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
10053
10053
|
handleFetch.logError(`Failed to create checkout session - missing localizationStore.targetCurrency`);
|
|
10054
10054
|
return false;
|
|
10055
10055
|
}
|
|
10056
|
-
if (!total) {
|
|
10057
|
-
handleFetch.logError(`Failed to create checkout session - missing total amount of items`);
|
|
10058
|
-
return false;
|
|
10059
|
-
}
|
|
10060
10056
|
stripeStore.isFetchingSession = true;
|
|
10061
10057
|
const body = {
|
|
10062
10058
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
@@ -219,7 +219,10 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
219
219
|
const url = baseUrl + path;
|
|
220
220
|
// adding random encoded token to the url so that the request will be cached differently for each store
|
|
221
221
|
const modifiedUrl = new URL(url);
|
|
222
|
-
|
|
222
|
+
const encodeDomain = window.Zonos.cartId
|
|
223
|
+
? `${window.location.hostname}-${window.Zonos.cartId}`
|
|
224
|
+
: window.location.hostname;
|
|
225
|
+
modifiedUrl.searchParams.set('zToken', encodeString(encodeDomain));
|
|
223
226
|
try {
|
|
224
227
|
response = await fetch(modifiedUrl.toString(), options);
|
|
225
228
|
}
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
6
|
-
const CheckoutConfig = require('./CheckoutConfig-
|
|
5
|
+
const handleFetch = require('./handleFetch-bd39d5cc.js');
|
|
6
|
+
const CheckoutConfig = require('./CheckoutConfig-222be92b.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.
|
|
100
|
+
const cdnUrl = "https://v1.3.121.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.
|
|
285
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
286
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
287
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
284
|
+
const ZONOS_URL = "https://v1.3.121.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.121";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.121";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.121";
|
|
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 = "
|
|
302
|
+
Zonos.releaseDate = "1730844222999";
|
|
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.
|
|
312
|
+
Zonos.version = `v${"1.3.121"}`;
|
|
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-
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
4
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
5
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-1209340d.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-
|
|
12
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
|
+
const paypal = require('./paypal-1209340d.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-e12d459c.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
9
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
15
|
+
const CheckoutConfig = require('./CheckoutConfig-222be92b.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-e12d459c.js');
|
|
8
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-e12d459c.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.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-
|
|
11
|
+
require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.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-
|
|
11
|
+
require('./handleFetch-bd39d5cc.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-
|
|
7
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
9
|
+
const handleFetch = require('./handleFetch-bd39d5cc.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-
|
|
6
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-e12d459c.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
|
-
require('./handleFetch-
|
|
9
|
+
require('./handleFetch-bd39d5cc.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-
|
|
9
|
-
const handleFetch = require('./handleFetch-
|
|
10
|
-
const paypal = require('./paypal-
|
|
8
|
+
const cart = require('./cart-b2ba04a6.js');
|
|
9
|
+
const handleFetch = require('./handleFetch-bd39d5cc.js');
|
|
10
|
+
const paypal = require('./paypal-1209340d.js');
|
|
11
11
|
require('./isDarkColor-d206c6fa.js');
|
|
12
12
|
require('./getBorderRadius-61ed5601.js');
|
|
13
13
|
|
|
@@ -467,10 +467,6 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
467
467
|
logError(`Failed to create checkout session - missing localizationStore.targetCurrency`);
|
|
468
468
|
return false;
|
|
469
469
|
}
|
|
470
|
-
if (!total) {
|
|
471
|
-
logError(`Failed to create checkout session - missing total amount of items`);
|
|
472
|
-
return false;
|
|
473
|
-
}
|
|
474
470
|
stripeStore.isFetchingSession = true;
|
|
475
471
|
const body = {
|
|
476
472
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
@@ -54,7 +54,10 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
54
54
|
const url = baseUrl + path;
|
|
55
55
|
// adding random encoded token to the url so that the request will be cached differently for each store
|
|
56
56
|
const modifiedUrl = new URL(url);
|
|
57
|
-
|
|
57
|
+
const encodeDomain = window.Zonos.cartId
|
|
58
|
+
? `${window.location.hostname}-${window.Zonos.cartId}`
|
|
59
|
+
: window.location.hostname;
|
|
60
|
+
modifiedUrl.searchParams.set('zToken', encodeString(encodeDomain));
|
|
58
61
|
try {
|
|
59
62
|
response = await fetch(modifiedUrl.toString(), options);
|
|
60
63
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as handleFetch, l as log, a as logError } from './handleFetch-
|
|
1
|
+
import { h as handleFetch, l as log, a as logError } from './handleFetch-752697c2.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, j as jsonParse } from './handleFetch-
|
|
2
|
+
import { h as handleFetch, a as logError, l as log, f as fallbackApiList, j as jsonParse } from './handleFetch-752697c2.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
|
|
5
5
|
|
|
@@ -10051,10 +10051,6 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
10051
10051
|
logError(`Failed to create checkout session - missing localizationStore.targetCurrency`);
|
|
10052
10052
|
return false;
|
|
10053
10053
|
}
|
|
10054
|
-
if (!total) {
|
|
10055
|
-
logError(`Failed to create checkout session - missing total amount of items`);
|
|
10056
|
-
return false;
|
|
10057
|
-
}
|
|
10058
10054
|
stripeStore.isFetchingSession = true;
|
|
10059
10055
|
const body = {
|
|
10060
10056
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
@@ -217,7 +217,10 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
217
217
|
const url = baseUrl + path;
|
|
218
218
|
// adding random encoded token to the url so that the request will be cached differently for each store
|
|
219
219
|
const modifiedUrl = new URL(url);
|
|
220
|
-
|
|
220
|
+
const encodeDomain = window.Zonos.cartId
|
|
221
|
+
? `${window.location.hostname}-${window.Zonos.cartId}`
|
|
222
|
+
: window.location.hostname;
|
|
223
|
+
modifiedUrl.searchParams.set('zToken', encodeString(encodeDomain));
|
|
221
224
|
try {
|
|
222
225
|
response = await fetch(modifiedUrl.toString(), options);
|
|
223
226
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as log, a as logError } from './handleFetch-
|
|
2
|
-
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-
|
|
3
|
-
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-
|
|
1
|
+
import { l as log, a as logError } from './handleFetch-752697c2.js';
|
|
2
|
+
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-f3f1d468.js';
|
|
3
|
+
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-f3f1d468.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.
|
|
97
|
+
const cdnUrl = "https://v1.3.121.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.
|
|
282
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
283
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
284
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
281
|
+
const ZONOS_URL = "https://v1.3.121.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.121";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.121";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.121";
|
|
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 = "
|
|
299
|
+
Zonos.releaseDate = "1730844222999";
|
|
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.
|
|
309
|
+
Zonos.version = `v${"1.3.121"}`;
|
|
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, v as stripeStoreHandleInventoryCheck, o as translate, u as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-
|
|
3
|
-
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-
|
|
2
|
+
import { d as cartStore, v as stripeStoreHandleInventoryCheck, o as translate, u as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-c2a7dbf4.js';
|
|
3
|
+
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-752697c2.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, R as getFallbackDefaultCountryCode, l as localizationStore, o as translate } from './cart-
|
|
2
|
+
import { j as stripeStore, R as getFallbackDefaultCountryCode, l as localizationStore, o as translate } from './cart-c2a7dbf4.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
|
-
import { a as logError, l as log } from './handleFetch-
|
|
4
|
+
import { a as logError, l as log } from './handleFetch-752697c2.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, G as currencyFormat, o as translate, H as cartStoreHasOneEligibleItem, I as stripeStoreApplyPromoCode, J as stripeStoreRemovePromoCode, y as stripeStoreReset, j as stripeStore, K as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, M as stripeStoreMessageBasedOnStatus, l as localizationStore, N as stripeStoreTranslateAddressToLatin, O as cartStoreUpdateSelectedShippingOption, P as cartStoreGetShippingTransitInfo, Q as sortServiceLevelOptionsByAmount } from './cart-
|
|
2
|
+
import { d as cartStore, G as currencyFormat, o as translate, H as cartStoreHasOneEligibleItem, I as stripeStoreApplyPromoCode, J as stripeStoreRemovePromoCode, y as stripeStoreReset, j as stripeStore, K as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, M as stripeStoreMessageBasedOnStatus, l as localizationStore, N as stripeStoreTranslateAddressToLatin, O as cartStoreUpdateSelectedShippingOption, P as cartStoreGetShippingTransitInfo, Q as sortServiceLevelOptionsByAmount } from './cart-c2a7dbf4.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-
|
|
4
|
+
import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-47ce80b4.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-
|
|
8
|
+
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-752697c2.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 cartStoreUpdateToErrorState, o as translate, p as getZCountryUrlParam, q as cartStoreSetCheckoutSession, r as stripeStorePrefetchLandedCost, u as cartStoreNextStep, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset, z as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-
|
|
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 cartStoreUpdateToErrorState, o as translate, p as getZCountryUrlParam, q as cartStoreSetCheckoutSession, r as stripeStorePrefetchLandedCost, u as cartStoreNextStep, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset, z as localizationStoreOnUpdate } from './cart-c2a7dbf4.js';
|
|
3
|
+
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-47ce80b4.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-
|
|
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-752697c2.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-
|
|
11
|
+
import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-f3f1d468.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 { A as isValidSelector, j as stripeStore, B as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { A as isValidSelector, j as stripeStore, B as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-c2a7dbf4.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-
|
|
4
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-752697c2.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-
|
|
2
|
+
import { l as localizationStore } from './cart-c2a7dbf4.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-752697c2.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, o as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, o as translate, l as localizationStore } from './cart-c2a7dbf4.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-
|
|
7
|
+
import './handleFetch-752697c2.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 { o as translate, l as localizationStore, G as currencyFormat } from './cart-
|
|
2
|
+
import { o as translate, l as localizationStore, G as currencyFormat } from './cart-c2a7dbf4.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-
|
|
7
|
+
import './handleFetch-752697c2.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, A as isValidSelector, o as translate, p as getZCountryUrlParam, C as setZCountryUrlParam, D as currencyDisplay, E as currencyConvertAndFormat, F as currencyConvert, G as currencyFormat } from './cart-
|
|
3
|
+
import { l as localizationStore, A as isValidSelector, o as translate, p as getZCountryUrlParam, C as setZCountryUrlParam, D as currencyDisplay, E as currencyConvertAndFormat, F as currencyConvert, G as currencyFormat } from './cart-c2a7dbf4.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import { h as handleFetch, a as logError, l as log } from './handleFetch-
|
|
5
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-752697c2.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 { S as localizationStoreUpdateSelectedLocale, o as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { S as localizationStoreUpdateSelectedLocale, o as translate, l as localizationStore } from './cart-c2a7dbf4.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-752697c2.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-
|
|
5
|
-
import { a as logError, l as log } from './handleFetch-
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
4
|
+
import { j as stripeStore } from './cart-c2a7dbf4.js';
|
|
5
|
+
import { a as logError, l as log } from './handleFetch-752697c2.js';
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-47ce80b4.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-
|
|
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-752697c2.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};
|