@zonos/elements 1.3.83 → 1.3.84
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/{cart-4de3faca.js → cart-a06f18e2.js} +8 -3
- package/dist/cjs/{createCustomEvent-65331eae.js → createCustomEvent-8d9cf9ac.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-370b3a10.js → paypal-078f3cef.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +5 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -2
- package/dist/collection/components/store/checkout/cart.js +0 -1
- package/dist/collection/components/store/checkout/stripe.js +3 -2
- package/dist/collection/components/store/hello/localization.js +5 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
- package/dist/collection/components/utils/checkout/isDisabledCountry.js +0 -2
- package/dist/collection/components/utils/checkout/isShippableCountry.js +0 -2
- package/dist/esm/{cart-bdc45f59.js → cart-40e0d619.js} +8 -4
- package/dist/esm/{createCustomEvent-4db13122.js → createCustomEvent-1f615c82.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-1b29d424.js → paypal-a45fb0bb.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +5 -5
- package/dist/esm/zonos-checkout.entry.js +9 -7
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-bdc45f59.js → cart-40e0d619.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-4db13122.js → createCustomEvent-1f615c82.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-1b29d424.js → paypal-a45fb0bb.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.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/components/store/hello/localization.d.ts +4 -0
- package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -23
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-9b911f6f.entry.js → p-019b202c.entry.js} +1 -1
- package/dist/zonos-elements/{p-6aa35f18.entry.js → p-0a15de43.entry.js} +1 -1
- package/dist/zonos-elements/{p-ce41cbde.js → p-1348c46d.js} +1 -1
- package/dist/zonos-elements/p-181de82e.entry.js +1 -0
- package/dist/zonos-elements/{p-2b60faf8.entry.js → p-189a2cae.entry.js} +1 -1
- package/dist/zonos-elements/{p-a1fa0a1c.system.js → p-3d9a0e52.system.js} +1 -1
- package/dist/zonos-elements/{p-a6cff57f.system.js → p-47d5a081.system.js} +1 -1
- package/dist/zonos-elements/{p-2183128a.system.entry.js → p-5d325c13.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f1d043ad.system.entry.js → p-5ef15d65.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a34f0674.entry.js → p-60c543e7.entry.js} +1 -1
- package/dist/zonos-elements/p-7096814b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-2140ccb4.system.entry.js → p-78ca17aa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-771e2623.entry.js → p-9013751a.entry.js} +1 -1
- package/dist/zonos-elements/p-9367aeca.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e3df5ff6.system.entry.js → p-ac6562c7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-01d11845.system.entry.js → p-b1381434.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7cc5e325.js → p-b39b794a.js} +1 -1
- package/dist/zonos-elements/p-ba10b830.entry.js +1 -0
- package/dist/zonos-elements/{p-278d61ed.js → p-c1fbe220.js} +1 -1
- package/dist/zonos-elements/{p-3457c5e8.system.entry.js → p-c224f43a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-017bf338.entry.js → p-c3314b3b.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-7f3aeb53.system.entry.js → p-d043cf10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5fb337a0.entry.js → p-d31368f1.entry.js} +1 -1
- package/dist/zonos-elements/{p-4ec7afc5.system.js → p-e2adfe87.system.js} +1 -1
- package/dist/zonos-elements/{p-b0303b0e.entry.js → p-e563eb3f.entry.js} +1 -1
- package/dist/zonos-elements/{p-0cc8c6a3.system.js → p-e6f2948c.system.js} +1 -1
- package/dist/zonos-elements/{p-9cfa3736.system.entry.js → p-ec8ff301.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-00bb8221.system.entry.js +0 -1
- package/dist/zonos-elements/p-3347e142.entry.js +0 -1
- package/dist/zonos-elements/p-844ec9f9.system.entry.js +0 -1
- package/dist/zonos-elements/p-c6350880.entry.js +0 -1
|
@@ -8459,6 +8459,10 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
8459
8459
|
}
|
|
8460
8460
|
};
|
|
8461
8461
|
|
|
8462
|
+
/**
|
|
8463
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8464
|
+
*/
|
|
8465
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8462
8466
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = zonosStore.createStore({
|
|
8463
8467
|
countryLandedCost: null,
|
|
8464
8468
|
customMessages: [],
|
|
@@ -8572,7 +8576,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
8572
8576
|
// update shippable country
|
|
8573
8577
|
localizationStore.isShippableCountry = isShippableCountry;
|
|
8574
8578
|
handleFetch.log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
|
|
8575
|
-
const isDisabledCountry =
|
|
8579
|
+
const isDisabledCountry = !!selectedCountryCode &&
|
|
8576
8580
|
zonosStore.zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
8577
8581
|
localizationStore.isDisabledCountry = isDisabledCountry;
|
|
8578
8582
|
handleFetch.log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
|
|
@@ -9526,7 +9530,8 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
9526
9530
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
9527
9531
|
itemsAmount: total,
|
|
9528
9532
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
9529
|
-
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
9533
|
+
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
9534
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
9530
9535
|
},
|
|
9531
9536
|
method: 'POST',
|
|
9532
9537
|
});
|
|
@@ -10003,7 +10008,6 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
10003
10008
|
adjustmentsAmount: adjustmentTotal,
|
|
10004
10009
|
cartId: window.Zonos.cartId,
|
|
10005
10010
|
currency: currency,
|
|
10006
|
-
// TEMP: test
|
|
10007
10011
|
dutiesTaxesFeesEstimate: 0,
|
|
10008
10012
|
itemsAmount: total,
|
|
10009
10013
|
});
|
|
@@ -10053,6 +10057,7 @@ const cartStoreResetTabItems = () => {
|
|
|
10053
10057
|
cartStoreResetSelectedShippingOption();
|
|
10054
10058
|
};
|
|
10055
10059
|
|
|
10060
|
+
exports.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
|
|
10056
10061
|
exports.cartStore = cartStore;
|
|
10057
10062
|
exports.cartStoreClearCheckoutInterval = cartStoreClearCheckoutInterval;
|
|
10058
10063
|
exports.cartStoreGetShippingTransitInfo = cartStoreGetShippingTransitInfo;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -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.84.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.84.js.zonos.com";
|
|
285
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.84";
|
|
286
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.84";
|
|
287
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.84";
|
|
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 = "1728756182320";
|
|
303
303
|
Zonos.isLegacyCheckout = false;
|
|
304
304
|
/**
|
|
305
305
|
* By default, the package will load from npm
|
|
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
307
307
|
Zonos.isNpm = true;
|
|
308
308
|
Zonos.zonosQaUrl = null;
|
|
309
309
|
Zonos.zonosQaUrlApi = null;
|
|
310
|
-
Zonos.version = `v${"1.3.
|
|
310
|
+
Zonos.version = `v${"1.3.84"}`;
|
|
311
311
|
Zonos.modeAlerted = false;
|
|
312
312
|
Zonos.cartData = null;
|
|
313
313
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-a06f18e2.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -84,7 +84,7 @@ const ZonosAddress = class {
|
|
|
84
84
|
defaultValues: {
|
|
85
85
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
86
86
|
cart.localizationStore.selectedCountryCode ||
|
|
87
|
-
|
|
87
|
+
cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
88
88
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
89
89
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
90
90
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -147,7 +147,7 @@ const ZonosAddress = class {
|
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
149
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
150
|
-
return (index.h(index.Host, { key: '
|
|
150
|
+
return (index.h(index.Host, { key: 'aa9a569b302099681082cd4219b553f9c70842ea', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '60050e9f8f0b80dde9acc9ffbd868333fdabf2b3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '5af7ee4f23d75fc877cdde7babe0edaefef14da8', class: "zonos--address-component" })));
|
|
151
151
|
}
|
|
152
152
|
get el() { return index.getElement(this); }
|
|
153
153
|
static get watchers() { return {
|
|
@@ -3,11 +3,11 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-078f3cef.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
10
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
10
|
+
const createCustomEvent = require('./createCustomEvent-8d9cf9ac.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-5a64574c.js');
|
|
12
12
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
13
13
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -1212,12 +1212,12 @@ const ZonosShipping = class {
|
|
|
1212
1212
|
if (this.showErrorBanner) {
|
|
1213
1213
|
this.showErrorBanner = !this.handleValidate();
|
|
1214
1214
|
}
|
|
1215
|
-
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
1215
|
+
return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !defaultShownServiceLevels.length && (index.h("button", { class: classes.classes([
|
|
1216
1216
|
'zonos--shipping-options-collapse-trigger',
|
|
1217
1217
|
this.collapsedDAPOptions && 'collapsed',
|
|
1218
1218
|
]), onClick: () => {
|
|
1219
1219
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
1220
|
-
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '
|
|
1220
|
+
} }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: 'e6ec0a7cc6d2e4930fbca92337670962d2d0cff8', class: "zonos--group-btn" }, index.h("zonos-button", { key: '8586e3fd283e11c1928ccd17e4ef59bf191138e7', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
1221
1221
|
// use primary type when on mobile mode
|
|
1222
1222
|
variant: this.submitBtnType }, cart.translate('Go to payment'))))));
|
|
1223
1223
|
}
|
|
@@ -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-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-a06f18e2.js');
|
|
7
|
+
const paypal = require('./paypal-078f3cef.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
9
|
-
const createCustomEvent = require('./createCustomEvent-
|
|
9
|
+
const createCustomEvent = require('./createCustomEvent-8d9cf9ac.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
12
12
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -45,7 +45,6 @@ const isDisabledCountry = (showLog = true) => {
|
|
|
45
45
|
return true;
|
|
46
46
|
}
|
|
47
47
|
if (cart.localizationStore.isDisabledCountry) {
|
|
48
|
-
document.dispatchEvent(createCustomEvent.createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country that has been disabled for checkout'));
|
|
49
48
|
if (showLog) {
|
|
50
49
|
handleFetch.log(`Checkout: disabled country`);
|
|
51
50
|
}
|
|
@@ -60,7 +59,6 @@ const isShippableCountry = (showLog = true) => {
|
|
|
60
59
|
}
|
|
61
60
|
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
62
61
|
if (!cart.localizationStore.isShippableCountry) {
|
|
63
|
-
document.dispatchEvent(createCustomEvent.createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country where shipping is not available'));
|
|
64
62
|
if (showLog) {
|
|
65
63
|
handleFetch.log(`Checkout: not shippable country`);
|
|
66
64
|
}
|
|
@@ -354,7 +352,9 @@ const ZonosCheckout = class {
|
|
|
354
352
|
});
|
|
355
353
|
button.addEventListener('click', async (e) => {
|
|
356
354
|
var _a;
|
|
357
|
-
|
|
355
|
+
// Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
|
|
356
|
+
if (!window.Zonos.isLegacyCheckout &&
|
|
357
|
+
(!isShippableCountry() || isDisabledCountry())) {
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
e.preventDefault();
|
|
@@ -438,7 +438,9 @@ const ZonosCheckout = class {
|
|
|
438
438
|
const legacyShippingInfo = {
|
|
439
439
|
country:
|
|
440
440
|
// fallback to selected country code if country is not provided
|
|
441
|
-
urlParams.get('country') ||
|
|
441
|
+
urlParams.get('country') ||
|
|
442
|
+
cart.localizationStore.selectedCountryCode ||
|
|
443
|
+
cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
442
444
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
443
445
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
444
446
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
9
9
|
require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-5efc8367.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-a06f18e2.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
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-a06f18e2.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-45e76490.js');
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-d56e0a8b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-a4395972.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-a06f18e2.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-45e76490.js');
|
|
10
|
-
const paypal = require('./paypal-
|
|
10
|
+
const paypal = require('./paypal-078f3cef.js');
|
|
11
11
|
require('./isDarkColor-5efc8367.js');
|
|
12
12
|
require('./getBorderRadius-5a64574c.js');
|
|
13
13
|
|
|
@@ -2,7 +2,7 @@ import { Fragment, h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
3
|
import { paypalInitScript } from "../../store/checkout/paypal";
|
|
4
4
|
import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
|
|
5
|
-
import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
|
|
5
|
+
import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
|
|
6
6
|
import { translate } from "../../store/translationStore";
|
|
7
7
|
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
8
8
|
import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
|
|
@@ -198,7 +198,9 @@ export class ZonosCheckout {
|
|
|
198
198
|
});
|
|
199
199
|
button.addEventListener('click', async (e) => {
|
|
200
200
|
var _a;
|
|
201
|
-
|
|
201
|
+
// Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
|
|
202
|
+
if (!window.Zonos.isLegacyCheckout &&
|
|
203
|
+
(!isShippableCountry() || isDisabledCountry())) {
|
|
202
204
|
return;
|
|
203
205
|
}
|
|
204
206
|
e.preventDefault();
|
|
@@ -282,7 +284,9 @@ export class ZonosCheckout {
|
|
|
282
284
|
const legacyShippingInfo = {
|
|
283
285
|
country:
|
|
284
286
|
// fallback to selected country code if country is not provided
|
|
285
|
-
urlParams.get('country') ||
|
|
287
|
+
urlParams.get('country') ||
|
|
288
|
+
localizationStore.selectedCountryCode ||
|
|
289
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
286
290
|
customerAddress1: urlParams.get('customerAddress1'),
|
|
287
291
|
customerAddress2: urlParams.get('customerAddress2'),
|
|
288
292
|
customerCity: urlParams.get('customerCity'),
|
|
@@ -146,12 +146,12 @@ export class ZonosShipping {
|
|
|
146
146
|
if (this.showErrorBanner) {
|
|
147
147
|
this.showErrorBanner = !this.handleValidate();
|
|
148
148
|
}
|
|
149
|
-
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }),
|
|
149
|
+
return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !defaultShownServiceLevels.length && (h("button", { class: classes([
|
|
150
150
|
'zonos--shipping-options-collapse-trigger',
|
|
151
151
|
this.collapsedDAPOptions && 'collapsed',
|
|
152
152
|
]), onClick: () => {
|
|
153
153
|
this.collapsedDAPOptions = !this.collapsedDAPOptions;
|
|
154
|
-
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '
|
|
154
|
+
} }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: 'e6ec0a7cc6d2e4930fbca92337670962d2d0cff8', class: "zonos--group-btn" }, h("zonos-button", { key: '8586e3fd283e11c1928ccd17e4ef59bf191138e7', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
155
155
|
// use primary type when on mobile mode
|
|
156
156
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
157
157
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
import { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStorePreviousStep, cartStoreResetCartItems, cartStoreSetCheckoutSession, cartStoreUpdateSelectedShippingOption, } from "./cart";
|
|
3
|
-
import { localizationStore } from "../hello/localization";
|
|
3
|
+
import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, } from "../hello/localization";
|
|
4
4
|
import { translate } from "../translationStore";
|
|
5
5
|
import { zonosStore } from "../zonosStore";
|
|
6
6
|
import { calculateLandedCostNormalized } from "../../utils/api/calculateLandedCostNormaliz";
|
|
@@ -420,7 +420,8 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
420
420
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
421
421
|
itemsAmount: total,
|
|
422
422
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
423
|
-
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
423
|
+
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
424
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
424
425
|
},
|
|
425
426
|
method: 'POST',
|
|
426
427
|
});
|
|
@@ -15,6 +15,10 @@ import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrenc
|
|
|
15
15
|
import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
|
|
16
16
|
import { log } from "../../utils/logging/log";
|
|
17
17
|
import { logError } from "../../utils/logging/logError";
|
|
18
|
+
/**
|
|
19
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
20
|
+
*/
|
|
21
|
+
export const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
18
22
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = createStore({
|
|
19
23
|
countryLandedCost: null,
|
|
20
24
|
customMessages: [],
|
|
@@ -128,7 +132,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
128
132
|
// update shippable country
|
|
129
133
|
localizationStore.isShippableCountry = isShippableCountry;
|
|
130
134
|
log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
|
|
131
|
-
const isDisabledCountry =
|
|
135
|
+
const isDisabledCountry = !!selectedCountryCode &&
|
|
132
136
|
zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
133
137
|
localizationStore.isDisabledCountry = isDisabledCountry;
|
|
134
138
|
log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
|
-
import { localizationStore } from "../../store/hello/localization";
|
|
3
|
+
import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, } from "../../store/hello/localization";
|
|
4
4
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
5
5
|
import { logError } from "../../utils/logging/logError";
|
|
6
6
|
/**
|
|
@@ -72,7 +72,7 @@ export class ZonosAddress {
|
|
|
72
72
|
defaultValues: {
|
|
73
73
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
74
74
|
localizationStore.selectedCountryCode ||
|
|
75
|
-
|
|
75
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
76
76
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
77
77
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
78
78
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -135,7 +135,7 @@ export class ZonosAddress {
|
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
137
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
138
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: 'aa9a569b302099681082cd4219b553f9c70842ea', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '60050e9f8f0b80dde9acc9ffbd868333fdabf2b3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '5af7ee4f23d75fc877cdde7babe0edaefef14da8', class: "zonos--address-component" })));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "zonos-address"; }
|
|
141
141
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { localizationStore } from "../../store/hello/localization";
|
|
2
|
-
import { createCustomEvent } from "../createCustomEvent";
|
|
3
2
|
import { log } from "../logging/log";
|
|
4
3
|
export const isDisabledCountry = (showLog = true) => {
|
|
5
4
|
if (!localizationStore.localizationLoaded) {
|
|
6
5
|
return true;
|
|
7
6
|
}
|
|
8
7
|
if (localizationStore.isDisabledCountry) {
|
|
9
|
-
document.dispatchEvent(createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country that has been disabled for checkout'));
|
|
10
8
|
if (showLog) {
|
|
11
9
|
log(`Checkout: disabled country`);
|
|
12
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { localizationStore } from "../../store/hello/localization";
|
|
2
|
-
import { createCustomEvent } from "../createCustomEvent";
|
|
3
2
|
import { log } from "../logging/log";
|
|
4
3
|
export const isShippableCountry = (showLog = true) => {
|
|
5
4
|
if (!localizationStore.localizationLoaded) {
|
|
@@ -7,7 +6,6 @@ export const isShippableCountry = (showLog = true) => {
|
|
|
7
6
|
}
|
|
8
7
|
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
9
8
|
if (!localizationStore.isShippableCountry) {
|
|
10
|
-
document.dispatchEvent(createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country where shipping is not available'));
|
|
11
9
|
if (showLog) {
|
|
12
10
|
log(`Checkout: not shippable country`);
|
|
13
11
|
}
|
|
@@ -8457,6 +8457,10 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
8457
8457
|
}
|
|
8458
8458
|
};
|
|
8459
8459
|
|
|
8460
|
+
/**
|
|
8461
|
+
* CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
|
|
8462
|
+
*/
|
|
8463
|
+
const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
|
|
8460
8464
|
const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = createStore({
|
|
8461
8465
|
countryLandedCost: null,
|
|
8462
8466
|
customMessages: [],
|
|
@@ -8570,7 +8574,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
8570
8574
|
// update shippable country
|
|
8571
8575
|
localizationStore.isShippableCountry = isShippableCountry;
|
|
8572
8576
|
log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
|
|
8573
|
-
const isDisabledCountry =
|
|
8577
|
+
const isDisabledCountry = !!selectedCountryCode &&
|
|
8574
8578
|
zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
8575
8579
|
localizationStore.isDisabledCountry = isDisabledCountry;
|
|
8576
8580
|
log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
|
|
@@ -9524,7 +9528,8 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
9524
9528
|
currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
|
|
9525
9529
|
itemsAmount: total,
|
|
9526
9530
|
metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
|
|
9527
|
-
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
9531
|
+
presentmentCountryCode: localizationStore.selectedCountryCode ||
|
|
9532
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
|
|
9528
9533
|
},
|
|
9529
9534
|
method: 'POST',
|
|
9530
9535
|
});
|
|
@@ -10001,7 +10006,6 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
10001
10006
|
adjustmentsAmount: adjustmentTotal,
|
|
10002
10007
|
cartId: window.Zonos.cartId,
|
|
10003
10008
|
currency: currency,
|
|
10004
|
-
// TEMP: test
|
|
10005
10009
|
dutiesTaxesFeesEstimate: 0,
|
|
10006
10010
|
itemsAmount: total,
|
|
10007
10011
|
});
|
|
@@ -10051,4 +10055,4 @@ const cartStoreResetTabItems = () => {
|
|
|
10051
10055
|
cartStoreResetSelectedShippingOption();
|
|
10052
10056
|
};
|
|
10053
10057
|
|
|
10054
|
-
export { setZCountryUrlParam as A, currencyDisplay as B, currencyConvertAndFormat as C,
|
|
10058
|
+
export { setZCountryUrlParam as A, currencyDisplay as B, currencyConvertAndFormat as C, DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT as D, currencyConvert as E, currencyFormat as F, cartStoreHasOneEligibleItem as G, stripeStoreApplyPromoCode as H, stripeStoreRemovePromoCode as I, stripeStoreRetrievePayment as J, stripeStoreMessageBasedOnStatus as K, stripeStoreResetPromoCode as L, stripeStoreTranslateAddressToLatin as M, cartStoreUpdateSelectedShippingOption as N, cartStoreGetShippingTransitInfo as O, sortServiceLevelOptionsByAmount as P, localizationStoreUpdateSelectedLocale as Q, localizationStoreUpdateSelectedCountryCode as a, stripeStoreCleanupDomesticShippingSession as b, stripeStoreSaveDomesticShippingSession as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStore as j, stripeStoreInitCheckoutSession as k, localizationStore as l, cartStoreStartCheckoutInterval as m, cartStoreUpdateToErrorState as n, cartStoreSetCheckoutSession as o, stripeStorePrefetchLandedCost as p, cartStoreNextStep as q, stripeStoreHandleInventoryCheck as r, stripeStoreGetDomesticShippingSession as s, translate as t, stripeStoreConfirmPayment as u, stripeStoreReset as v, localizationStoreOnUpdate as w, isValidSelector as x, initLocalizationStore as y, getZCountryUrlParam as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { d as cartStore, l as localizationStore } from './cart-40e0d619.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { h as handleFetch } from './handleFetch-0133265e.js';
|
|
4
4
|
|
package/dist/esm/index.js
CHANGED
|
@@ -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.84.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.84.js.zonos.com";
|
|
282
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.84";
|
|
283
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.84";
|
|
284
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.84";
|
|
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 = "1728756182320";
|
|
300
300
|
Zonos.isLegacyCheckout = false;
|
|
301
301
|
/**
|
|
302
302
|
* By default, the package will load from npm
|
|
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
|
|
|
304
304
|
Zonos.isNpm = true;
|
|
305
305
|
Zonos.zonosQaUrl = null;
|
|
306
306
|
Zonos.zonosQaUrlApi = null;
|
|
307
|
-
Zonos.version = `v${"1.3.
|
|
307
|
+
Zonos.version = `v${"1.3.84"}`;
|
|
308
308
|
Zonos.modeAlerted = false;
|
|
309
309
|
Zonos.cartData = null;
|
|
310
310
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
|
|
2
|
-
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-40e0d619.js';
|
|
3
3
|
import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-0133265e.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-b3afa948.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
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, D as DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, t as translate } from './cart-40e0d619.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError } from './handleFetch-0133265e.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -80,7 +80,7 @@ const ZonosAddress = class {
|
|
|
80
80
|
defaultValues: {
|
|
81
81
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
82
82
|
localizationStore.selectedCountryCode ||
|
|
83
|
-
|
|
83
|
+
DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
|
|
84
84
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
85
85
|
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
86
86
|
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
@@ -143,7 +143,7 @@ const ZonosAddress = class {
|
|
|
143
143
|
}
|
|
144
144
|
render() {
|
|
145
145
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
146
|
-
return (h(Host, { key: '
|
|
146
|
+
return (h(Host, { key: 'aa9a569b302099681082cd4219b553f9c70842ea', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '60050e9f8f0b80dde9acc9ffbd868333fdabf2b3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '5af7ee4f23d75fc877cdde7babe0edaefef14da8', class: "zonos--address-component" })));
|
|
147
147
|
}
|
|
148
148
|
get el() { return getElement(this); }
|
|
149
149
|
static get watchers() { return {
|