@zonos/elements 1.3.54 → 1.3.56
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-ca67953a.js → CheckoutConfig-4d03e084.js} +1 -1
- package/dist/cjs/{cart-03b08131.js → cart-6c7bf457.js} +4 -4
- package/dist/cjs/{createCustomEvent-532569f1.js → createCustomEvent-a10ed604.js} +2 -2
- package/dist/cjs/{handleFetch-4b296adc.js → handleFetch-c0e07666.js} +5 -2
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-bdc19559.js → paypal-ec9ebaf5.js} +4 -4
- package/dist/cjs/zonos-address_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-badge_13.cjs.entry.js +4 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +10 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- 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 +5 -5
- 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/__mocks__/vercel-app/localization.js +1 -1
- package/dist/collection/__mocks__/zonos-url/localization.js +2899 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -2
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/paypal.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +3 -3
- package/dist/collection/components/utils/handleFetch.js +2 -2
- package/dist/collection/components/utils/hello/detectItemRestrictions.js +1 -1
- package/dist/collection/components/utils/hello/getProductsOnPage.js +2 -2
- package/dist/collection/components/utils/logging/sendErrorLog.js +3 -0
- package/dist/collection/types/generated/graphql.customer.types.js +9 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -1
- package/dist/collection/utils/formattedUrl.js +1 -1
- package/dist/esm/{CheckoutConfig-bf2a28bd.js → CheckoutConfig-7fe6442e.js} +1 -1
- package/dist/esm/{cart-008dea87.js → cart-a845a902.js} +4 -4
- package/dist/esm/{createCustomEvent-a10320c1.js → createCustomEvent-0797e187.js} +2 -2
- package/dist/esm/{handleFetch-99b944a2.js → handleFetch-613fbc00.js} +5 -2
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-b90fc7ff.js → paypal-6d80dfd9.js} +4 -4
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/zonos-badge_13.entry.js +4 -4
- package/dist/esm/zonos-checkout.entry.js +10 -7
- package/dist/esm/zonos-controller.entry.js +4 -4
- 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 +5 -5
- 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-bf2a28bd.js → CheckoutConfig-7fe6442e.js} +1 -1
- package/dist/esm-es5/{cart-008dea87.js → cart-a845a902.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-a10320c1.js → createCustomEvent-0797e187.js} +1 -1
- package/dist/esm-es5/handleFetch-613fbc00.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-b90fc7ff.js → paypal-6d80dfd9.js} +2 -2
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_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/types/types/generated/graphql.customer.types.d.ts +11 -0
- package/dist/types/types/generated/graphql.customer.types.ts +15 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-ca4efb81.system.entry.js → p-0954e8fe.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f9bfbf42.system.js → p-0fc80040.system.js} +1 -1
- package/dist/zonos-elements/{p-3149985c.entry.js → p-173f8e5b.entry.js} +1 -1
- package/dist/zonos-elements/{p-3cfbbf17.system.entry.js → p-17ea3429.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-92faa378.system.js → p-1df63802.system.js} +1 -1
- package/dist/zonos-elements/{p-7f93c97a.system.js → p-206cf031.system.js} +1 -1
- package/dist/zonos-elements/{p-546aabc0.system.entry.js → p-298df70c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6e385f8.system.entry.js → p-324a8c0d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2bc6342f.system.entry.js → p-3492c75f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f5bac726.system.entry.js → p-35122d9c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e672e4de.entry.js → p-35ca4dcc.entry.js} +1 -1
- package/dist/zonos-elements/{p-ada937d6.system.entry.js → p-40001536.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2673dd6d.system.entry.js → p-40f73fb4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-710b8292.js → p-472a6c19.js} +1 -1
- package/dist/zonos-elements/{p-fb28f27f.entry.js → p-4b205b2f.entry.js} +1 -1
- package/dist/zonos-elements/{p-72cfc372.system.entry.js → p-4dd2f617.system.entry.js} +1 -1
- package/dist/zonos-elements/p-51d82a07.entry.js +1 -0
- package/dist/zonos-elements/{p-997cc826.entry.js → p-556d4ddb.entry.js} +1 -1
- package/dist/zonos-elements/{p-baff865d.entry.js → p-6f87b869.entry.js} +1 -1
- package/dist/zonos-elements/{p-e6b9cf45.system.js → p-8260b820.system.js} +1 -1
- package/dist/zonos-elements/{p-88c2057e.entry.js → p-921d3603.entry.js} +1 -1
- package/dist/zonos-elements/{p-3566044a.entry.js → p-95a18511.entry.js} +1 -1
- package/dist/zonos-elements/{p-1c29081a.js → p-9fd3995f.js} +1 -1
- package/dist/zonos-elements/p-a99620c8.entry.js +1 -0
- package/dist/zonos-elements/{p-4b7c05a8.system.entry.js → p-b65b3e7b.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-66cc2bbd.system.js → p-d067bb64.system.js} +2 -2
- package/dist/zonos-elements/p-d20f6cf1.js +17 -0
- package/dist/zonos-elements/{p-18802362.entry.js → p-d42018fc.entry.js} +1 -1
- package/dist/zonos-elements/p-e89c2805.system.js +1 -0
- package/dist/zonos-elements/{p-b914e98e.js → p-f9c2288f.js} +1 -1
- package/dist/zonos-elements/p-fb59c3c3.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-99b944a2.js +0 -1
- package/dist/zonos-elements/p-7400bcd3.js +0 -1
- package/dist/zonos-elements/p-7a3118e7.entry.js +0 -1
- package/dist/zonos-elements/p-7eac524d.system.js +0 -1
- package/dist/zonos-elements/p-dfbc9605.js +0 -17
- package/dist/zonos-elements/p-e7e22128.entry.js +0 -1
|
@@ -137,7 +137,7 @@ export class ZonosCheckout {
|
|
|
137
137
|
const cartResult = await setupCartData(cartId);
|
|
138
138
|
const cartData = cartResult === null || cartResult === void 0 ? void 0 : cartResult.cartData;
|
|
139
139
|
if (!cartData) {
|
|
140
|
-
logError('
|
|
140
|
+
logError('Failed to build cart, please try again.');
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
@@ -267,7 +267,9 @@ export class ZonosCheckout {
|
|
|
267
267
|
useLegacyQueryParam() {
|
|
268
268
|
const urlParams = new URLSearchParams(window.location.search);
|
|
269
269
|
const legacyShippingInfo = {
|
|
270
|
-
country:
|
|
270
|
+
country:
|
|
271
|
+
// fallback to selected country code if country is not provided
|
|
272
|
+
urlParams.get('country') || localizationStore.selectedCountryCode,
|
|
271
273
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
272
274
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
273
275
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -285,6 +287,7 @@ export class ZonosCheckout {
|
|
|
285
287
|
!legacyShippingInfo.customerState ||
|
|
286
288
|
!legacyShippingInfo.customerZip ||
|
|
287
289
|
!legacyShippingInfo.country) {
|
|
290
|
+
log('Missing some query params so it can not be prefilled', 'info', legacyShippingInfo);
|
|
288
291
|
return;
|
|
289
292
|
}
|
|
290
293
|
this.defaultAddress = {
|
|
@@ -106,7 +106,7 @@ export class ZonosController {
|
|
|
106
106
|
// override subscription status
|
|
107
107
|
const config = Object.assign(Object.assign({}, this.config), { checkoutSettings: this.config.checkoutSettings
|
|
108
108
|
? Object.assign(Object.assign({}, this.config.checkoutSettings), { subscriptionStatus: undefined }) : undefined });
|
|
109
|
-
// load default setting if
|
|
109
|
+
// load default setting if failed to load user settings
|
|
110
110
|
zonosStoreInitSetting({
|
|
111
111
|
overrideSettings: config,
|
|
112
112
|
zonosSettings: json,
|
|
@@ -195,7 +195,7 @@ export class ZonosController {
|
|
|
195
195
|
zonosStore.organizationName = organizationName;
|
|
196
196
|
}
|
|
197
197
|
render() {
|
|
198
|
-
return h(Host, { key: '
|
|
198
|
+
return h(Host, { key: '7ec14cc108aea8ac9c552c76410c00b698fae8f8', class: "zonos--elements" });
|
|
199
199
|
}
|
|
200
200
|
static get is() { return "zonos-controller"; }
|
|
201
201
|
static get encapsulation() { return "shadow"; }
|
|
@@ -159,7 +159,7 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
159
159
|
}
|
|
160
160
|
const paypalClientId = zonosStore.checkoutSettings.externalServiceTokens.find(item => item.type === 'PAYPAL_CLIENT_ID');
|
|
161
161
|
if (!paypalClientId) {
|
|
162
|
-
log('
|
|
162
|
+
log('Failed to load paypal -- missing paypal publishable key', 'warn');
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
@@ -202,7 +202,7 @@ const paypalStoreInitButtons = (props) => {
|
|
|
202
202
|
fundingSource }, props))), { fundingSource }))) || null;
|
|
203
203
|
}
|
|
204
204
|
catch (err) {
|
|
205
|
-
log(`=====
|
|
205
|
+
log(`===== Failed to load paypal's "${fundingSource}" button`, 'warn', err);
|
|
206
206
|
}
|
|
207
207
|
if (button === null || button === void 0 ? void 0 : button.isEligible()) {
|
|
208
208
|
log(`==== Paypal button ${fundingSource} loaded`);
|
|
@@ -231,7 +231,7 @@ const stripeStorePrefetchLandedCost = async () => {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
catch (err) {
|
|
234
|
-
// default to empty array if we
|
|
234
|
+
// default to empty array if we failed to fetch landed cost, so we can show the error message
|
|
235
235
|
cartStore.landedCostData = [];
|
|
236
236
|
cartStore.shippingData = [];
|
|
237
237
|
logError(err);
|
|
@@ -355,7 +355,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
355
355
|
var _a;
|
|
356
356
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
357
357
|
if (!total || !localizationStore.targetCurrency) {
|
|
358
|
-
logError('
|
|
358
|
+
logError('Failed to create checkout session - invalid total or currency');
|
|
359
359
|
return false;
|
|
360
360
|
}
|
|
361
361
|
stripeStore.isFetchingSession = true;
|
|
@@ -497,7 +497,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
|
|
|
497
497
|
});
|
|
498
498
|
if (errors.length || !json) {
|
|
499
499
|
logError('Error occurs when translating address to latin', JSON.stringify(errors, null, 2));
|
|
500
|
-
// reset translated address if we
|
|
500
|
+
// reset translated address if we Failed to translate and let user manually fix it
|
|
501
501
|
stripeStore.translatedAddress = {
|
|
502
502
|
address: {},
|
|
503
503
|
billingAddress: {},
|
|
@@ -66,7 +66,7 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
66
66
|
zonosMode: null,
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
const message = '
|
|
69
|
+
const message = 'Failed to fetch';
|
|
70
70
|
return {
|
|
71
71
|
baseUrl,
|
|
72
72
|
errors: [{ message, type: 'unknown' }],
|
|
@@ -133,7 +133,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
|
|
|
133
133
|
const unknownError = errors.find(({ type }) => type === 'unknown');
|
|
134
134
|
const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
|
|
135
135
|
const shouldCallFallback =
|
|
136
|
-
// If next fallback is available, and the error is unknown (
|
|
136
|
+
// If next fallback is available, and the error is unknown (Failed to fetch) or 404
|
|
137
137
|
nextFallbackApiType && isUnknownError;
|
|
138
138
|
// Should log the error if it's unknown error
|
|
139
139
|
if (isUnknownError) {
|
|
@@ -7,7 +7,7 @@ export const detectItemRestrictions = async (newProducts) => {
|
|
|
7
7
|
}
|
|
8
8
|
const { selectedCountryCode } = localizationStore;
|
|
9
9
|
if (!selectedCountryCode) {
|
|
10
|
-
logError('Hello
|
|
10
|
+
logError('Hello could not check item restrictions - No country code selected');
|
|
11
11
|
return [];
|
|
12
12
|
}
|
|
13
13
|
const items = newProducts.map(product => ({
|
|
@@ -5,7 +5,7 @@ export const getProductsOnPage = () => {
|
|
|
5
5
|
var _a, _b;
|
|
6
6
|
const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.helloSettings;
|
|
7
7
|
if (!productTitleElementSelector || !productDescriptionElementSelector) {
|
|
8
|
-
logError(`Hello
|
|
8
|
+
logError(`Hello could not check item restrictions - must provide title and description selectors.`);
|
|
9
9
|
}
|
|
10
10
|
const titleNodes = (productTitleElementSelector &&
|
|
11
11
|
isValidSelector(productTitleElementSelector) &&
|
|
@@ -17,7 +17,7 @@ export const getProductsOnPage = () => {
|
|
|
17
17
|
[];
|
|
18
18
|
if (titleNodes.length !== descriptionNodes.length) {
|
|
19
19
|
// If the title and description selectors don't match, kill item restrictions altogether
|
|
20
|
-
logError('Hello
|
|
20
|
+
logError('Hello could not check item restrictions - Title and description selectors do not match');
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
23
23
|
const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
|
|
@@ -28,6 +28,9 @@ export const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostRelea
|
|
|
28
28
|
// use native fetch because in handleFetch also calls sendErrorLog and it will possibly cause circular dependencies issue
|
|
29
29
|
void fetch(`${MAIN_BASE_API}/api/zonos-elements/log-error`, {
|
|
30
30
|
body: JSON.stringify(errorObject),
|
|
31
|
+
headers: {
|
|
32
|
+
'Zonos-Referer': window.location.hostname,
|
|
33
|
+
},
|
|
31
34
|
method: 'POST',
|
|
32
35
|
});
|
|
33
36
|
}
|
|
@@ -293,6 +293,10 @@ export const classificationCalculateSource = {
|
|
|
293
293
|
Legacy: 'LEGACY',
|
|
294
294
|
Single: 'SINGLE',
|
|
295
295
|
};
|
|
296
|
+
export const classificationMethod = {
|
|
297
|
+
Augmented: 'AUGMENTED',
|
|
298
|
+
Calculated: 'CALCULATED',
|
|
299
|
+
};
|
|
296
300
|
export const classificationRequestField = {
|
|
297
301
|
Category: 'CATEGORY',
|
|
298
302
|
Description: 'DESCRIPTION',
|
|
@@ -1217,6 +1221,11 @@ export const externalServiceTokenType = {
|
|
|
1217
1221
|
export const fedExCategoryCode = {
|
|
1218
1222
|
Shipping: 'SHIPPING',
|
|
1219
1223
|
};
|
|
1224
|
+
export const fieldStatus = {
|
|
1225
|
+
Hidden: 'HIDDEN',
|
|
1226
|
+
Required: 'REQUIRED',
|
|
1227
|
+
Visible: 'VISIBLE',
|
|
1228
|
+
};
|
|
1220
1229
|
export const fulfillmentCenterType = {
|
|
1221
1230
|
ConsolidationCenter: 'CONSOLIDATION_CENTER',
|
|
1222
1231
|
Primary: 'PRIMARY',
|
|
@@ -35,7 +35,7 @@ export const formattedCloudflareApiUrl = ({ branchName, inCI: _inCI, inGithubAct
|
|
|
35
35
|
if (!isProdBranch) {
|
|
36
36
|
// use Cloudflare branch_url instead of the production url
|
|
37
37
|
if (!branchName) {
|
|
38
|
-
throw new Error('
|
|
38
|
+
throw new Error('Failed to get Cloudflare commit ref or branch name');
|
|
39
39
|
}
|
|
40
40
|
// generate generated deploy url based on the branch name
|
|
41
41
|
const cloudflareUrl = generateCloudflareDeployUrl({
|
|
@@ -34,7 +34,7 @@ export const formattedUrl = ({ branchName, inCI: _inCI, inVercel: _inVercel, isV
|
|
|
34
34
|
(_inVercel && type === 'vercel-git')) {
|
|
35
35
|
// use vercel branch_url instead of the production url
|
|
36
36
|
if (!branchName) {
|
|
37
|
-
throw new Error('
|
|
37
|
+
throw new Error('Failed to get vercel commit ref or branch name');
|
|
38
38
|
}
|
|
39
39
|
// get project name based on the `${url}`
|
|
40
40
|
const isStorybook =
|
|
@@ -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-613fbc00.js';
|
|
2
2
|
|
|
3
3
|
const getTempCartById = async (cartId) => {
|
|
4
4
|
const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-473f4654.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-613fbc00.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor-c927f77d.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-23398fc6.js';
|
|
5
5
|
|
|
@@ -8379,7 +8379,7 @@ const stripeStorePrefetchLandedCost = async () => {
|
|
|
8379
8379
|
}
|
|
8380
8380
|
}
|
|
8381
8381
|
catch (err) {
|
|
8382
|
-
// default to empty array if we
|
|
8382
|
+
// default to empty array if we failed to fetch landed cost, so we can show the error message
|
|
8383
8383
|
cartStore.landedCostData = [];
|
|
8384
8384
|
cartStore.shippingData = [];
|
|
8385
8385
|
logError(err);
|
|
@@ -8503,7 +8503,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
8503
8503
|
var _a;
|
|
8504
8504
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
8505
8505
|
if (!total || !localizationStore.targetCurrency) {
|
|
8506
|
-
logError('
|
|
8506
|
+
logError('Failed to create checkout session - invalid total or currency');
|
|
8507
8507
|
return false;
|
|
8508
8508
|
}
|
|
8509
8509
|
stripeStore.isFetchingSession = true;
|
|
@@ -8645,7 +8645,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
|
|
|
8645
8645
|
});
|
|
8646
8646
|
if (errors.length || !json) {
|
|
8647
8647
|
logError('Error occurs when translating address to latin', JSON.stringify(errors, null, 2));
|
|
8648
|
-
// reset translated address if we
|
|
8648
|
+
// reset translated address if we Failed to translate and let user manually fix it
|
|
8649
8649
|
stripeStore.translatedAddress = {
|
|
8650
8650
|
address: {},
|
|
8651
8651
|
billingAddress: {},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { d as cartStore, l as localizationStore } from './cart-a845a902.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-473f4654.js';
|
|
3
|
-
import { h as handleFetch } from './handleFetch-
|
|
3
|
+
import { h as handleFetch } from './handleFetch-613fbc00.js';
|
|
4
4
|
|
|
5
5
|
const trackConversionEvent = async (eventName, metadata) => {
|
|
6
6
|
var _a, _b;
|
|
@@ -114,6 +114,9 @@ const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseError
|
|
|
114
114
|
// use native fetch because in handleFetch also calls sendErrorLog and it will possibly cause circular dependencies issue
|
|
115
115
|
void fetch(`${MAIN_BASE_API}/api/zonos-elements/log-error`, {
|
|
116
116
|
body: JSON.stringify(errorObject),
|
|
117
|
+
headers: {
|
|
118
|
+
'Zonos-Referer': window.location.hostname,
|
|
119
|
+
},
|
|
117
120
|
method: 'POST',
|
|
118
121
|
});
|
|
119
122
|
}
|
|
@@ -193,7 +196,7 @@ const handleRequest = async ({ basePathType, options, path, }) => {
|
|
|
193
196
|
zonosMode: null,
|
|
194
197
|
};
|
|
195
198
|
}
|
|
196
|
-
const message = '
|
|
199
|
+
const message = 'Failed to fetch';
|
|
197
200
|
return {
|
|
198
201
|
baseUrl,
|
|
199
202
|
errors: [{ message, type: 'unknown' }],
|
|
@@ -260,7 +263,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
|
|
|
260
263
|
const unknownError = errors.find(({ type }) => type === 'unknown');
|
|
261
264
|
const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
|
|
262
265
|
const shouldCallFallback =
|
|
263
|
-
// If next fallback is available, and the error is unknown (
|
|
266
|
+
// If next fallback is available, and the error is unknown (Failed to fetch) or 404
|
|
264
267
|
nextFallbackApiType && isUnknownError;
|
|
265
268
|
// Should log the error if it's unknown error
|
|
266
269
|
if (isUnknownError) {
|
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-613fbc00.js';
|
|
2
|
+
import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-7fe6442e.js';
|
|
3
|
+
export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-7fe6442e.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Get the load version and url based on the loadScriptSrc and version
|
|
@@ -93,7 +93,7 @@ const getZonosQaUrl = () => {
|
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
95
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
96
|
-
const cdnUrl = "https://v1.3.
|
|
96
|
+
const cdnUrl = "https://v1.3.56.js.zonos.com";
|
|
97
97
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
98
98
|
if (!qaUrl &&
|
|
99
99
|
(cdnUrl.includes('test.') ||
|
|
@@ -277,10 +277,10 @@ const zonosLoadUrl = (() => {
|
|
|
277
277
|
}
|
|
278
278
|
return null;
|
|
279
279
|
})();
|
|
280
|
-
const ZONOS_URL = "https://v1.3.
|
|
281
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
282
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
283
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
280
|
+
const ZONOS_URL = "https://v1.3.56.js.zonos.com";
|
|
281
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.56";
|
|
282
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.56";
|
|
283
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.56";
|
|
284
284
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
285
285
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
286
286
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -295,14 +295,14 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
295
295
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
296
296
|
Zonos._paypalMockResponse = null;
|
|
297
297
|
Zonos.isBigCommerce = false;
|
|
298
|
-
Zonos.releaseDate = "
|
|
298
|
+
Zonos.releaseDate = "1727278094755";
|
|
299
299
|
Zonos.isLegacyCheckout = false;
|
|
300
300
|
/**
|
|
301
301
|
* By default, the package will load from npm
|
|
302
302
|
*/
|
|
303
303
|
Zonos.isNpm = true;
|
|
304
304
|
Zonos.zonosQaUrl = null;
|
|
305
|
-
Zonos.version = `v${"1.3.
|
|
305
|
+
Zonos.version = `v${"1.3.56"}`;
|
|
306
306
|
Zonos.modeAlerted = false;
|
|
307
307
|
Zonos.cartData = null;
|
|
308
308
|
Zonos.paypal = null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-473f4654.js';
|
|
2
|
-
import { d as cartStore, q as stripeStoreHandleInventoryCheck, t as translate, p 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, q as stripeStoreHandleInventoryCheck, t as translate, p as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-a845a902.js';
|
|
3
|
+
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-613fbc00.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-c927f77d.js';
|
|
5
5
|
|
|
6
6
|
/*!
|
|
@@ -392,7 +392,7 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
392
392
|
}
|
|
393
393
|
const paypalClientId = zonosStore.checkoutSettings.externalServiceTokens.find(item => item.type === 'PAYPAL_CLIENT_ID');
|
|
394
394
|
if (!paypalClientId) {
|
|
395
|
-
log('
|
|
395
|
+
log('Failed to load paypal -- missing paypal publishable key', 'warn');
|
|
396
396
|
return;
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
@@ -435,7 +435,7 @@ const paypalStoreInitButtons = (props) => {
|
|
|
435
435
|
fundingSource }, props))), { fundingSource }))) || null;
|
|
436
436
|
}
|
|
437
437
|
catch (err) {
|
|
438
|
-
log(`=====
|
|
438
|
+
log(`===== Failed to load paypal's "${fundingSource}" button`, 'warn', err);
|
|
439
439
|
}
|
|
440
440
|
if (button === null || button === void 0 ? void 0 : button.isEligible()) {
|
|
441
441
|
log(`==== Paypal button ${fundingSource} loaded`);
|
|
@@ -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, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { j as stripeStore, l as localizationStore, t as translate } from './cart-a845a902.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
|
-
import { a as logError } from './handleFetch-
|
|
4
|
+
import { a as logError } from './handleFetch-613fbc00.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-473f4654.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, a as getAssetPath, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily, z as zonosStore, g as getZonosStoreTheme } from './zonosStore-473f4654.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { d as cartStore, D as currencyFormat, E as cartStoreHasOneEligibleItem, t as translate, u as stripeStoreReset, j as stripeStore, F as stripeStoreRetrievePayment, G as stripeStoreMessageBasedOnStatus, l as localizationStore, H as stripeStoreTranslateAddressToLatin, I as cartStoreUpdateSelectedShippingOption, J as cartStoreGetShippingTransitInfo } from './cart-
|
|
5
|
-
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-
|
|
6
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
4
|
+
import { d as cartStore, D as currencyFormat, E as cartStoreHasOneEligibleItem, t as translate, u as stripeStoreReset, j as stripeStore, F as stripeStoreRetrievePayment, G as stripeStoreMessageBasedOnStatus, l as localizationStore, H as stripeStoreTranslateAddressToLatin, I as cartStoreUpdateSelectedShippingOption, J as cartStoreGetShippingTransitInfo } from './cart-a845a902.js';
|
|
5
|
+
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-6d80dfd9.js';
|
|
6
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-0797e187.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-23398fc6.js';
|
|
8
|
-
import { h as handleFetch, s as sendErrorLog } from './handleFetch-
|
|
8
|
+
import { h as handleFetch, s as sendErrorLog } from './handleFetch-613fbc00.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-c927f77d.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, n as cartStoreUpdateToErrorState, t as translate, o as stripeStorePrefetchLandedCost, p as cartStoreNextStep, q as stripeStoreHandleInventoryCheck, r as stripeStoreConfirmPayment, u as stripeStoreReset, v as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { s as submitGtag, p 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, n as cartStoreUpdateToErrorState, t as translate, o as stripeStorePrefetchLandedCost, p as cartStoreNextStep, q as stripeStoreHandleInventoryCheck, r as stripeStoreConfirmPayment, u as stripeStoreReset, v as localizationStoreOnUpdate } from './cart-a845a902.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-6d80dfd9.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-473f4654.js';
|
|
5
|
-
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-
|
|
5
|
+
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-0797e187.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
|
-
import { l as log, a as logError, s as sendErrorLog } from './handleFetch-
|
|
7
|
+
import { l as log, a as logError, s as sendErrorLog } from './handleFetch-613fbc00.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
9
9
|
import { g as getBorderRadius } from './getBorderRadius-23398fc6.js';
|
|
10
10
|
import { i as isDarkColor } from './isDarkColor-c927f77d.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-7fe6442e.js';
|
|
12
12
|
import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -277,7 +277,7 @@ const ZonosCheckout = class {
|
|
|
277
277
|
const cartResult = await setupCartData(cartId);
|
|
278
278
|
const cartData = cartResult === null || cartResult === void 0 ? void 0 : cartResult.cartData;
|
|
279
279
|
if (!cartData) {
|
|
280
|
-
logError('
|
|
280
|
+
logError('Failed to build cart, please try again.');
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
283
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
@@ -407,7 +407,9 @@ const ZonosCheckout = class {
|
|
|
407
407
|
useLegacyQueryParam() {
|
|
408
408
|
const urlParams = new URLSearchParams(window.location.search);
|
|
409
409
|
const legacyShippingInfo = {
|
|
410
|
-
country:
|
|
410
|
+
country:
|
|
411
|
+
// fallback to selected country code if country is not provided
|
|
412
|
+
urlParams.get('country') || localizationStore.selectedCountryCode,
|
|
411
413
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
412
414
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
413
415
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -425,6 +427,7 @@ const ZonosCheckout = class {
|
|
|
425
427
|
!legacyShippingInfo.customerState ||
|
|
426
428
|
!legacyShippingInfo.customerZip ||
|
|
427
429
|
!legacyShippingInfo.country) {
|
|
430
|
+
log('Missing some query params so it can not be prefilled', 'info', legacyShippingInfo);
|
|
428
431
|
return;
|
|
429
432
|
}
|
|
430
433
|
this.defaultAddress = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { w as isValidSelector, j as stripeStore, x as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { w as isValidSelector, j as stripeStore, x as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-a845a902.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-473f4654.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-613fbc00.js';
|
|
5
5
|
import './isDarkColor-c927f77d.js';
|
|
6
6
|
import './getBorderRadius-23398fc6.js';
|
|
7
7
|
|
|
@@ -226,7 +226,7 @@ const ZonosController = class {
|
|
|
226
226
|
// override subscription status
|
|
227
227
|
const config = Object.assign(Object.assign({}, this.config), { checkoutSettings: this.config.checkoutSettings
|
|
228
228
|
? Object.assign(Object.assign({}, this.config.checkoutSettings), { subscriptionStatus: undefined }) : undefined });
|
|
229
|
-
// load default setting if
|
|
229
|
+
// load default setting if failed to load user settings
|
|
230
230
|
zonosStoreInitSetting({
|
|
231
231
|
overrideSettings: config,
|
|
232
232
|
zonosSettings: json,
|
|
@@ -315,7 +315,7 @@ const ZonosController = class {
|
|
|
315
315
|
zonosStore.organizationName = organizationName;
|
|
316
316
|
}
|
|
317
317
|
render() {
|
|
318
|
-
return h(Host, { key: '
|
|
318
|
+
return h(Host, { key: '7ec14cc108aea8ac9c552c76410c00b698fae8f8', class: "zonos--elements" });
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
321
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -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-a845a902.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-613fbc00.js';
|
|
6
6
|
import './isDarkColor-c927f77d.js';
|
|
7
7
|
import './getBorderRadius-23398fc6.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, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-a845a902.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-c927f77d.js';
|
|
6
6
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
7
|
-
import './handleFetch-
|
|
7
|
+
import './handleFetch-613fbc00.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.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 { t as translate, l as localizationStore, D as currencyFormat } from './cart-
|
|
2
|
+
import { t as translate, l as localizationStore, D as currencyFormat } from './cart-a845a902.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-473f4654.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-613fbc00.js';
|
|
8
8
|
import './isDarkColor-c927f77d.js';
|
|
9
9
|
import './getBorderRadius-23398fc6.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-473f4654.js';
|
|
3
|
-
import { l as localizationStore, w as isValidSelector, t as translate, y as getZCountryUrlParam, z as setZCountryUrlParam, A as currencyDisplay, B as currencyConvertAndFormat, C as currencyConvert, D as currencyFormat } from './cart-
|
|
3
|
+
import { l as localizationStore, w as isValidSelector, t as translate, y as getZCountryUrlParam, z as setZCountryUrlParam, A as currencyDisplay, B as currencyConvertAndFormat, C as currencyConvert, D as currencyFormat } from './cart-a845a902.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-613fbc00.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
7
|
import './isDarkColor-c927f77d.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.js';
|
|
@@ -380,7 +380,7 @@ const detectItemRestrictions = async (newProducts) => {
|
|
|
380
380
|
}
|
|
381
381
|
const { selectedCountryCode } = localizationStore;
|
|
382
382
|
if (!selectedCountryCode) {
|
|
383
|
-
logError('Hello
|
|
383
|
+
logError('Hello could not check item restrictions - No country code selected');
|
|
384
384
|
return [];
|
|
385
385
|
}
|
|
386
386
|
const items = newProducts.map(product => ({
|
|
@@ -426,7 +426,7 @@ const getProductsOnPage = () => {
|
|
|
426
426
|
var _a, _b;
|
|
427
427
|
const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.helloSettings;
|
|
428
428
|
if (!productTitleElementSelector || !productDescriptionElementSelector) {
|
|
429
|
-
logError(`Hello
|
|
429
|
+
logError(`Hello could not check item restrictions - must provide title and description selectors.`);
|
|
430
430
|
}
|
|
431
431
|
const titleNodes = (productTitleElementSelector &&
|
|
432
432
|
isValidSelector(productTitleElementSelector) &&
|
|
@@ -438,7 +438,7 @@ const getProductsOnPage = () => {
|
|
|
438
438
|
[];
|
|
439
439
|
if (titleNodes.length !== descriptionNodes.length) {
|
|
440
440
|
// If the title and description selectors don't match, kill item restrictions altogether
|
|
441
|
-
logError('Hello
|
|
441
|
+
logError('Hello could not check item restrictions - Title and description selectors do not match');
|
|
442
442
|
return [];
|
|
443
443
|
}
|
|
444
444
|
const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { K as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { K as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-a845a902.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
|
-
import './handleFetch-
|
|
5
|
+
import './handleFetch-613fbc00.js';
|
|
6
6
|
import './isDarkColor-c927f77d.js';
|
|
7
7
|
import './getBorderRadius-23398fc6.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-473f4654.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-a845a902.js';
|
|
5
|
+
import { a as logError, l as log } from './handleFetch-613fbc00.js';
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-6d80dfd9.js';
|
|
7
7
|
import './isDarkColor-c927f77d.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.js';
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return u([t,e])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{n=a=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(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return u([t,e])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{n=a=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-613fbc00.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(o){switch(o.label){case 0:return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:e=o.sent(),r=e.errors,n=e.json;if(!n||r.length){return[2,null]}return[2,n]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,getTempCartById(t)];case 1:e=r.sent();log("[ZONOS - loadZonos] getting temp cart data","info",e);if(!e){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:e.cartData,storeFavicon:e.storeFaviconUrl,storeId:e.cartData.storeId,storeLogo:e.storeLogoUrl,zonosApiKey:e.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};
|