@zonos/elements 1.2.0 → 1.2.2
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-ac9a3c40.js → cart-d4b52ae8.js} +5 -15
- package/dist/cjs/{getBorderRadius-1f9c0fa3.js → getBorderRadius-fdd605c6.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{isDarkColor-0651a165.js → isDarkColor-f3446afd.js} +1 -1
- package/dist/cjs/{localization-3a4b4a43.js → localization-d7fe7290.js} +41 -14
- package/dist/cjs/{submitGtag-9e873a0a.js → submitGtag-d65003f9.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +10 -5
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +20 -20
- package/dist/cjs/zonos-checkout.cjs.entry.js +17 -10
- package/dist/cjs/zonos-controller.cjs.entry.js +15 -6
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +16 -8
- package/dist/cjs/zonos-hello.cjs.entry.js +17 -3
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/{zonosStore-270f79cc.js → zonosStore-a430ec5b.js} +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +6 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +10 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +6 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +7 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -5
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +5 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +15 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +15 -7
- package/dist/collection/components/main/zonos-controller.js +10 -1
- package/dist/collection/components/store/hello/localization.js +31 -9
- package/dist/collection/components/store/zonosStore.js +2 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +5 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +9 -4
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -11
- package/dist/collection/types/generated/graphql.customer.types.js +4 -1
- package/dist/components/cart.js +1 -11
- package/dist/components/localization.js +40 -13
- package/dist/components/zonos-address2.js +5 -0
- package/dist/components/zonos-cart-subtotal2.js +4 -3
- package/dist/components/zonos-checkout-payment2.js +3 -3
- package/dist/components/zonos-checkout.js +11 -4
- package/dist/components/zonos-controller.js +10 -1
- package/dist/components/zonos-customer-info2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +15 -7
- package/dist/components/zonos-hello.js +16 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +5 -6
- package/dist/components/zonosStore.js +2 -0
- package/dist/esm/{cart-cf46a264.js → cart-e1b93711.js} +5 -15
- package/dist/esm/{getBorderRadius-278281bf.js → getBorderRadius-45764ad7.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/{isDarkColor-8fd3a24e.js → isDarkColor-6fbb9b14.js} +1 -1
- package/dist/esm/{localization-add1d9e9.js → localization-f3828793.js} +41 -14
- package/dist/esm/{submitGtag-aa5fe441.js → submitGtag-a901ece5.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +10 -5
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-cart-items_10.entry.js +20 -20
- package/dist/esm/zonos-checkout.entry.js +17 -10
- package/dist/esm/zonos-controller.entry.js +15 -6
- package/dist/esm/zonos-country-flag_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +16 -8
- package/dist/esm/zonos-hello.entry.js +17 -3
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/{zonosStore-e5291656.js → zonosStore-05a62104.js} +2 -0
- package/dist/esm-es5/cart-e1b93711.js +1 -0
- package/dist/esm-es5/{getBorderRadius-278281bf.js → getBorderRadius-45764ad7.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-8fd3a24e.js → isDarkColor-6fbb9b14.js} +1 -1
- package/dist/esm-es5/{localization-add1d9e9.js → localization-f3828793.js} +1 -1
- package/dist/esm-es5/{submitGtag-aa5fe441.js → submitGtag-a901ece5.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.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_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-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e5291656.js → zonosStore-05a62104.js} +1 -1
- package/dist/scripts/loadZonos.js +3 -3
- package/dist/scripts/zonos.js +3 -3
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
- package/dist/types/components/store/checkout/cart.d.ts +1 -0
- package/dist/types/components/store/hello/localization.d.ts +2 -0
- package/dist/types/components/utils/api/getExchangeRate.d.ts +9 -3
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +2 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +37 -8
- package/dist/types/types/generated/graphql.customer.types.ts +49 -8
- package/dist/types/types/generated/graphql.frontend.types.d.ts +4 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-05256415.system.entry.js +1 -0
- package/dist/zonos-elements/{p-01990dcd.js → p-08695f4e.js} +1 -1
- package/dist/zonos-elements/p-0e0b46a5.js +1 -0
- package/dist/zonos-elements/{p-0cd4b073.system.js → p-164fae93.system.js} +1 -1
- package/dist/zonos-elements/p-25db3885.js +1 -0
- package/dist/zonos-elements/p-28681677.entry.js +1 -0
- package/dist/zonos-elements/p-34a49bce.entry.js +1 -0
- package/dist/zonos-elements/p-365970ff.entry.js +1 -0
- package/dist/zonos-elements/p-3f3fbcea.entry.js +1 -0
- package/dist/zonos-elements/p-40083e93.system.entry.js +1 -0
- package/dist/zonos-elements/{p-8fa1244b.entry.js → p-40778e43.entry.js} +1 -1
- package/dist/zonos-elements/{p-6cd7a90e.system.js → p-53649e16.system.js} +1 -1
- package/dist/zonos-elements/p-5d7ffddb.entry.js +1 -0
- package/dist/zonos-elements/p-60821b2a.entry.js +1 -0
- package/dist/zonos-elements/{p-9d06e3a3.system.js → p-6dcd752e.system.js} +1 -1
- package/dist/zonos-elements/{p-0f64d234.entry.js → p-6e7cd3f7.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee671d13.js → p-770c959e.js} +1 -1
- package/dist/zonos-elements/{p-847a1b9a.system.entry.js → p-81c699f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-18d37ad9.system.js → p-85ab35c9.system.js} +1 -1
- package/dist/zonos-elements/{p-ddc11127.system.entry.js → p-8a75b765.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1781245e.system.js → p-8aabbb9b.system.js} +1 -1
- package/dist/zonos-elements/{p-1b6d064d.system.js → p-8c867835.system.js} +1 -1
- package/dist/zonos-elements/p-8db8cc05.system.js +1 -0
- package/dist/zonos-elements/p-914ce305.system.entry.js +1 -0
- package/dist/zonos-elements/{p-466bae3a.entry.js → p-96a3c767.entry.js} +1 -1
- package/dist/zonos-elements/{p-d0ecfe92.system.entry.js → p-a3641931.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3f394b7.system.entry.js → p-aca66238.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-86825d4a.js → p-bf070bf6.js} +1 -1
- package/dist/zonos-elements/{p-083b951d.system.entry.js → p-c8ad044e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ebb4de4e.entry.js → p-cc070c1c.entry.js} +1 -1
- package/dist/zonos-elements/{p-96fbce98.system.entry.js → p-cc1c785c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-de9d8a4f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1293796f.js → p-f7875c40.js} +1 -1
- package/dist/zonos-elements/p-f8491335.system.js +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-cf46a264.js +0 -1
- package/dist/zonos-elements/p-0a33b542.system.js +0 -1
- package/dist/zonos-elements/p-1835470b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6bb67f2e.system.entry.js +0 -1
- package/dist/zonos-elements/p-82ab16e2.js +0 -1
- package/dist/zonos-elements/p-a014d540.entry.js +0 -1
- package/dist/zonos-elements/p-aed841bf.entry.js +0 -1
- package/dist/zonos-elements/p-b0a39955.js +0 -1
- package/dist/zonos-elements/p-bb35713f.entry.js +0 -1
- package/dist/zonos-elements/p-c4eb37b5.entry.js +0 -1
- package/dist/zonos-elements/p-de86c2e4.system.entry.js +0 -1
- package/dist/zonos-elements/p-e80aae7d.entry.js +0 -1
- package/dist/zonos-elements/p-eb6cc449.system.entry.js +0 -1
- package/dist/zonos-elements/p-f5392f7e.entry.js +0 -1
|
@@ -3196,18 +3196,23 @@ const getCountryLandedCost = async (countryCode) => {
|
|
|
3196
3196
|
|
|
3197
3197
|
const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCurrency, }) => {
|
|
3198
3198
|
var _a;
|
|
3199
|
+
// If source currency matches target currency (US -> US) and is not a guaranteed rate, return null
|
|
3200
|
+
if (sourceCurrency === targetCurrency && !isGuaranteed) {
|
|
3201
|
+
return { exchangeRate: null, maxAge: null };
|
|
3202
|
+
}
|
|
3199
3203
|
const url = `${"https://v1.route.js.zonos.com"}/api/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}}`;
|
|
3200
3204
|
const { errors, json } = await handleFetch(url);
|
|
3201
3205
|
if (errors.length || !json) {
|
|
3202
3206
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
3203
|
-
return null;
|
|
3207
|
+
return { exchangeRate: null, maxAge: null };
|
|
3204
3208
|
}
|
|
3205
|
-
const { rate, targetFormat } = json.exchangeRateCreate;
|
|
3209
|
+
const { maxAge, rate, targetFormat } = json.exchangeRateCreate;
|
|
3206
3210
|
if (rate) {
|
|
3207
3211
|
sessionStorage.setItem(country + '_rate', JSON.stringify(rate));
|
|
3208
|
-
|
|
3212
|
+
const exchangeRate = { rate, targetFormat };
|
|
3213
|
+
return { exchangeRate, maxAge };
|
|
3209
3214
|
}
|
|
3210
|
-
return null;
|
|
3215
|
+
return { exchangeRate: null, maxAge: null };
|
|
3211
3216
|
};
|
|
3212
3217
|
|
|
3213
3218
|
const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
|
|
@@ -3465,23 +3470,45 @@ const { state: localizationStore } = createStore({
|
|
|
3465
3470
|
shippingZoneCountries: null,
|
|
3466
3471
|
targetCurrency: 'USD',
|
|
3467
3472
|
});
|
|
3473
|
+
const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
3474
|
+
const { exchangeRate, maxAge } = await getExchangeRate({
|
|
3475
|
+
country: localizationStore.selectedCountryCode,
|
|
3476
|
+
isGuaranteed,
|
|
3477
|
+
sourceCurrency: zonosStore.sourceCurrency,
|
|
3478
|
+
targetCurrency: localizationStore.targetCurrency,
|
|
3479
|
+
});
|
|
3480
|
+
if (exchangeRate) {
|
|
3481
|
+
localizationStore.exchangeRate = exchangeRate;
|
|
3482
|
+
currencyDisplay();
|
|
3483
|
+
}
|
|
3484
|
+
return { maxAge };
|
|
3485
|
+
};
|
|
3486
|
+
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
3487
|
+
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
3488
|
+
if (localizationStore.exchangeRateTimeout) {
|
|
3489
|
+
clearTimeout(localizationStore.exchangeRateTimeout);
|
|
3490
|
+
}
|
|
3491
|
+
// maxAge comes in seconds, convert to milliseconds
|
|
3492
|
+
const defaultMaxAge = 5 * 60;
|
|
3493
|
+
const maxAgeToUse = maxAge || defaultMaxAge;
|
|
3494
|
+
// Recursively set timeouts to get new exchange rates when the current one expires
|
|
3495
|
+
localizationStore.exchangeRateTimeout = setTimeout(async () => {
|
|
3496
|
+
const { maxAge: newMaxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
3497
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge: newMaxAge });
|
|
3498
|
+
}, maxAgeToUse * 1000);
|
|
3499
|
+
};
|
|
3468
3500
|
const getNewLocalization = async () => {
|
|
3469
3501
|
log('get new localization store');
|
|
3470
3502
|
const { isShippableCountry, selectedCountryCode } = localizationStore;
|
|
3471
|
-
const isGuaranteed = zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
3472
3503
|
if (zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
3473
3504
|
!isShippableCountry ||
|
|
3474
3505
|
!selectedCountryCode) {
|
|
3475
3506
|
return;
|
|
3476
3507
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
isGuaranteed
|
|
3480
|
-
|
|
3481
|
-
targetCurrency: localizationStore.targetCurrency,
|
|
3482
|
-
});
|
|
3483
|
-
if (localizationStore.exchangeRate) {
|
|
3484
|
-
currencyDisplay();
|
|
3508
|
+
if (zonosStore.sourceCurrency !== localizationStore.targetCurrency) {
|
|
3509
|
+
const isGuaranteed = zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
3510
|
+
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
3511
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
3485
3512
|
}
|
|
3486
3513
|
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
3487
3514
|
};
|
|
@@ -34,6 +34,11 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
34
34
|
? Object.values(shippableCountries).map(country => country.code)
|
|
35
35
|
: [],
|
|
36
36
|
contacts: this.defaultAddress ? [this.defaultAddress] : undefined,
|
|
37
|
+
defaultValues: {
|
|
38
|
+
address: {
|
|
39
|
+
country: localizationStore.selectedCountryCode || 'AL',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
37
42
|
display: {
|
|
38
43
|
name: 'split',
|
|
39
44
|
},
|
|
@@ -12,7 +12,7 @@ const InfoIcon = `<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org
|
|
|
12
12
|
</svg>
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
|
-
const zonosCartSubtotalCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-subtotal-price{text-align:right}";
|
|
15
|
+
const zonosCartSubtotalCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}";
|
|
16
16
|
|
|
17
17
|
const ZonosCartSubtotal = /*@__PURE__*/ proxyCustomElement(class ZonosCartSubtotal extends HTMLElement {
|
|
18
18
|
constructor() {
|
|
@@ -22,6 +22,7 @@ const ZonosCartSubtotal = /*@__PURE__*/ proxyCustomElement(class ZonosCartSubtot
|
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
24
|
const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;
|
|
25
|
+
const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
|
|
25
26
|
const renderShippingInfo = () => {
|
|
26
27
|
if (!cartStore.selectedShippingOption) {
|
|
27
28
|
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Shipping')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('No shipping method selected'))));
|
|
@@ -36,12 +37,12 @@ const ZonosCartSubtotal = /*@__PURE__*/ proxyCustomElement(class ZonosCartSubtot
|
|
|
36
37
|
amount: cartStore.shipping,
|
|
37
38
|
currency: cartStore.currency,
|
|
38
39
|
})
|
|
39
|
-
: '-')),
|
|
40
|
+
: '-')), showDutyTaxesInfo && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-icon", { content: InfoIcon, size: 16 })), !!cartStore.isSelectedShippingAboveDeminimis && (h("zonos-text", { color: "gray-800", type: "body" }, translate('Order is over the de minimis threshold for both duty and tax')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxFees
|
|
40
41
|
? formatCurrency({
|
|
41
42
|
amount: cartStore.dutiesTaxFees,
|
|
42
43
|
currency: cartStore.currency,
|
|
43
44
|
})
|
|
44
|
-
: '-', cartStore.isSelectedShippingGuarantee && (h("zonos-badge", null, translate('Guaranteed')))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
|
|
45
|
+
: '-', cartStore.isSelectedShippingGuarantee && (h("zonos-badge", null, translate('Guaranteed'))))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
|
|
45
46
|
amount:
|
|
46
47
|
// show total without taxes when step is shipping, show total with taxes when step is payment
|
|
47
48
|
cartStore.step === 'shipping'
|
|
@@ -9,7 +9,7 @@ import { d as defineCustomElement$3 } from './zonos-payment2.js';
|
|
|
9
9
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
10
10
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
11
11
|
|
|
12
|
-
const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:Inter;display:block}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:
|
|
12
|
+
const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:Inter;display:block}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:calc(100% - 10px)}";
|
|
13
13
|
|
|
14
14
|
const ZonosCheckoutPayment = /*@__PURE__*/ proxyCustomElement(class ZonosCheckoutPayment extends HTMLElement {
|
|
15
15
|
constructor() {
|
|
@@ -40,12 +40,12 @@ const ZonosCheckoutPayment = /*@__PURE__*/ proxyCustomElement(class ZonosCheckou
|
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
this.disabled = !((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
|
|
43
|
-
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.paymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), h("zonos-payment", null)), h("zonos-button", { backgroundColor: this.submitBtnColor, "is-disabled": this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
43
|
+
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.paymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), h("zonos-payment", null)), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, "is-disabled": this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
44
44
|
// use primary type when on mobile mode
|
|
45
45
|
variant: this.submitBtnType }, "Pay", ' ', formatCurrency({
|
|
46
46
|
amount: cartStore.total,
|
|
47
47
|
currency: cartStore.currency,
|
|
48
|
-
}))));
|
|
48
|
+
})))));
|
|
49
49
|
}
|
|
50
50
|
static get watchers() { return {
|
|
51
51
|
"disabled": ["watchFormComplete"]
|
|
@@ -39,7 +39,7 @@ const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none"
|
|
|
39
39
|
|
|
40
40
|
const RemoveIcon = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
41
41
|
|
|
42
|
-
const zonosCheckoutCss = ".sc-zonos-checkout-h{font-family:Inter;display:block}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--amino-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:var(--amino-space-48) var(--amino-space-56)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--amino-gray-0));border-right:1px solid var(--amino-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--amino-gray-0);padding-bottom:var(--amino-space-80)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--amino-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--amino-space-24);padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--back-button.sc-zonos-checkout{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 var(--amino-space-8) var(--amino-space-8)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:var(--amino-space-
|
|
42
|
+
const zonosCheckoutCss = ".sc-zonos-checkout-h{font-family:Inter;display:block}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--amino-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:var(--amino-space-48) var(--amino-space-56)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--amino-gray-0));border-right:1px solid var(--amino-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--amino-gray-0);padding-bottom:var(--amino-space-80)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--amino-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--amino-space-24);padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--back-button.sc-zonos-checkout{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 var(--amino-space-8) var(--amino-space-8)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:var(--amino-space-24);top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;position:absolute;bottom:var(--amino-space-32);right:var(--amino-space-56);gap:var(--amino-space-8)}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:var(--amino-space-76);margin-bottom:var(--amino-space-8)}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--amino-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:var(--amino-space-32)}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:var(--amino-space-12)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:var(--amino-space-16)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--amino-space-16);margin-top:var(--amino-space-24);border:var(--amino-border);border-radius:var(--border-radius, var(--amino-radius-10));background-color:var(--amino-gray-50);padding:var(--amino-space-12);margin-top:var(--amino-space-32)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.mobile.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{bottom:0;left:0;padding:var(--amino-space-12);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-gray-0)}";
|
|
43
43
|
|
|
44
44
|
const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout extends HTMLElement {
|
|
45
45
|
constructor() {
|
|
@@ -62,7 +62,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
62
62
|
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
63
63
|
if (!localizationStore.isShippableCountry) {
|
|
64
64
|
if (showLog) {
|
|
65
|
-
log(`not shippable country`);
|
|
65
|
+
log(`Checkout: not shippable country`);
|
|
66
66
|
}
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
@@ -203,7 +203,8 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
203
203
|
// show the selector when it's domestic
|
|
204
204
|
selector === null || selector === void 0 ? void 0 : selector.forEach(el => {
|
|
205
205
|
const element = el;
|
|
206
|
-
const display = element.getAttribute('data-zonos-checkout-original-display')
|
|
206
|
+
const display = element.getAttribute('data-zonos-checkout-original-display') ||
|
|
207
|
+
getComputedStyle(element).display;
|
|
207
208
|
// fallback to initial (browser value) if "display" is not found
|
|
208
209
|
element.style.display = display || 'initial';
|
|
209
210
|
});
|
|
@@ -377,7 +378,13 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
377
378
|
'--border-radius': getBorderRadius(style),
|
|
378
379
|
} }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
|
|
379
380
|
'--primary-color': !this.isMobile ? colorPrimary : '',
|
|
380
|
-
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor, submitBtnType: submitBtnType }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isMobile && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-collapse", { collapseSize: reviewElementSize,
|
|
381
|
+
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor, submitBtnType: submitBtnType }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isMobile && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-collapse", { collapseSize: reviewElementSize,
|
|
382
|
+
// only collapse on mobile
|
|
383
|
+
collapsed: this.collapseReviewMobile && this.isMobile }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
384
|
+
// do nothing if it's not mobile
|
|
385
|
+
if (!this.isMobile) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
381
388
|
this.collapseReviewMobile =
|
|
382
389
|
!this.collapseReviewMobile;
|
|
383
390
|
}, ref: el => (this.zonosReviewRef = el) }), h("zonos-cart-items", null))), h("zonos-v-stack", { spacing: 16 }, h("zonos-cart-subtotal", null), h("zonos-custom-message", { class: "zonos--checkout-default-message", icon: MessageIcon, message: defaultMessage }))), !this.isMobile && renderFooter()), this.isMobile && renderFooter())), (cartStore.step === 'finish' || cartStore.step === 'error') && (h("div", { class: "zonos--done", "data-theme": rightSideTheme }, h("div", { class: "zonos--header" }, renderLogo(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => this.handleFinishClick(), theme: rightSideTheme })), h("zonos-checkout-finish", { borderRadius: style, onCloseClick: () => this.handleFinishClick(), overrideNotification: cartStore.step === 'error' && !!cartStore.error
|
|
@@ -119,11 +119,20 @@ const ZonosController$1 = /*@__PURE__*/ proxyCustomElement(class ZonosController
|
|
|
119
119
|
log('Checkout failed to load -- missing publishable key', 'warn');
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
+
if (zonosStore.checkoutSettings.subscriptionStatus === 'INACTIVE') {
|
|
123
|
+
log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===', 'warn');
|
|
124
|
+
log('zonos controller loaded');
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (zonosStore.checkoutSettings.visibilityStatus === 'DISABLED') {
|
|
128
|
+
log('=== Checkout is disabled by store owner ===', 'warn');
|
|
129
|
+
log('zonos controller loaded');
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
122
132
|
// send publishable key out to load stripe
|
|
123
133
|
this.stripeInitEvent.emit({
|
|
124
134
|
publishableKey: publishableKey.token,
|
|
125
135
|
});
|
|
126
|
-
// eslint-disable-next-line no-console
|
|
127
136
|
log('zonos controller loaded');
|
|
128
137
|
})();
|
|
129
138
|
}
|
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$3 } from './zonos-link-authentication2.js';
|
|
|
8
8
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
9
9
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
10
10
|
|
|
11
|
-
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:Inter;display:block}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{width:100%}";
|
|
11
|
+
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:Inter;display:block}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:calc(100% - 10px)}";
|
|
12
12
|
|
|
13
13
|
const ZonosCustomerInfo = /*@__PURE__*/ proxyCustomElement(class ZonosCustomerInfo extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
@@ -42,9 +42,9 @@ const ZonosCustomerInfo = /*@__PURE__*/ proxyCustomElement(class ZonosCustomerIn
|
|
|
42
42
|
this.disabled =
|
|
43
43
|
!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) ||
|
|
44
44
|
!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
|
|
45
|
-
return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), h("zonos-link-authentication", { titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" })), h("zonos-button", { backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
45
|
+
return (h(Host, { class: "zonos--customer-info zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Customer information')), h("zonos-link-authentication", { titleText: translate('Contact') }), h("zonos-address", { defaultAddress: this.defaultAddress, titleText: translate('Address'), type: "shipping" })), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
46
46
|
// use primary type when on mobile mode
|
|
47
|
-
variant: this.submitBtnType }, translate('Continue to shipping'))));
|
|
47
|
+
variant: this.submitBtnType }, translate('Continue to shipping')))));
|
|
48
48
|
}
|
|
49
49
|
static get watchers() { return {
|
|
50
50
|
"disabled": ["watchFormComplete"]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { j as currencyFormat, b as localizationStore, t as translate } from './localization.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore.js';
|
|
4
4
|
import { c as classes } from './classes.js';
|
|
5
5
|
import { d as defineCustomElement$b } from './zonos-banner2.js';
|
|
@@ -97,18 +97,26 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
97
97
|
const { countryLandedCost, selectedCountryCode } = localizationStore;
|
|
98
98
|
// Our Robby API spells deminimis wrong here
|
|
99
99
|
const dutyDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.dutyDeminimus)
|
|
100
|
-
?
|
|
100
|
+
? currencyFormat(countryLandedCost.dutyDeminimus)
|
|
101
101
|
: null;
|
|
102
|
+
// If Canada, use 40 CAD (courier duty de minimis)
|
|
103
|
+
const dutyDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
104
|
+
? currencyFormat(40)
|
|
105
|
+
: dutyDeminimis;
|
|
102
106
|
// If deminimis is undefined or null, assume it's $0
|
|
103
|
-
const dutyDeMinimisMessage =
|
|
104
|
-
? `${translate('Spend')} ${
|
|
107
|
+
const dutyDeMinimisMessage = dutyDeminimisToUse
|
|
108
|
+
? `${translate('Spend')} ${dutyDeminimisToUse} ${translate('duty free')}`
|
|
105
109
|
: translate('Duties will apply to all orders');
|
|
106
110
|
// Our Robby API spells deminimis wrong here
|
|
107
111
|
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
108
|
-
?
|
|
112
|
+
? currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
109
113
|
: null;
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
// If Canada, use 150 CAD (courier tax de minimis)
|
|
115
|
+
const taxDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
116
|
+
? currencyFormat(150)
|
|
117
|
+
: taxDeminimis;
|
|
118
|
+
const taxDeMinimisMessage = taxDeminimisToUse
|
|
119
|
+
? `${translate('Spend')} ${taxDeminimisToUse} ${translate('tax free')}`
|
|
112
120
|
: translate('Taxes will apply to all orders');
|
|
113
121
|
const animateLeft = this.animateFromLeftOverride ||
|
|
114
122
|
(this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { _ as _root, i as isObjectLike_1, e as _baseGetTag, f as isObject_1, z as zonosStore, m as mergeConfig } from './zonosStore.js';
|
|
3
|
-
import { h as handleFetch, l as logError, b as localizationStore, i as isValidSelector, t as translate, s as setZonosCountryUrlParam, e as currencyDisplay, f as currencyConvertAndFormat, g as currencyConvert, j as currencyFormat
|
|
3
|
+
import { h as handleFetch, l as logError, b as localizationStore, i as isValidSelector, t as translate, s as setZonosCountryUrlParam, a as log, e as currencyDisplay, f as currencyConvertAndFormat, g as currencyConvert, j as currencyFormat } from './localization.js';
|
|
4
4
|
import { c as classes } from './classes.js';
|
|
5
5
|
import { g as getHasMoreSpaceOnRight, d as defineCustomElement$7 } from './zonos-hello-dialog2.js';
|
|
6
6
|
import { d as defineCustomElement$d } from './zonos-banner2.js';
|
|
@@ -610,6 +610,19 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
|
|
|
610
610
|
return hasMoreSpaceOnRight;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
+
this.isShippableCountry = (showLog = true) => {
|
|
614
|
+
if (!localizationStore.localizationLoaded) {
|
|
615
|
+
return false;
|
|
616
|
+
}
|
|
617
|
+
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
618
|
+
if (!localizationStore.isShippableCountry) {
|
|
619
|
+
if (showLog) {
|
|
620
|
+
log(`Hello: not shippable country`);
|
|
621
|
+
}
|
|
622
|
+
return false;
|
|
623
|
+
}
|
|
624
|
+
return true;
|
|
625
|
+
};
|
|
613
626
|
this.mobileLocationOverride = undefined;
|
|
614
627
|
this.animateFromLeftOverride = undefined;
|
|
615
628
|
this.appearanceSettingsOverride = undefined;
|
|
@@ -688,7 +701,8 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
|
|
|
688
701
|
const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride);
|
|
689
702
|
const { theme } = appearanceSettings;
|
|
690
703
|
const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
|
|
691
|
-
|
|
704
|
+
const showHello = this.isShippableCountry() && !!selectedCountryCode;
|
|
705
|
+
return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, showHello && (h("div", { class: "zonos--hello-wrapper" }, h("button", { class: classes([
|
|
692
706
|
'zonos--hello-widget',
|
|
693
707
|
this.showPeekMessage && 'zonos--hello-show-peek-message',
|
|
694
708
|
this.mobileLocationOverride && 'zonos--hello-mobile-override',
|
|
@@ -5,7 +5,7 @@ import { g as getBorderRadius } from './getBorderRadius.js';
|
|
|
5
5
|
import { i as isColorVariable } from './isColorVariable.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
7
7
|
|
|
8
|
-
const zonosShippingRichRadioCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-
|
|
8
|
+
const zonosShippingRichRadioCss = ":host{font-family:Inter;display:block}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--selected-border-color, var(--amino-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
|
9
9
|
|
|
10
10
|
const ZonosShippingRichRadio = /*@__PURE__*/ proxyCustomElement(class ZonosShippingRichRadio extends HTMLElement {
|
|
11
11
|
constructor() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { c as cartStore, i as cartStoreUpdateSelectedShippingOption, b as cartStoreGetShippingTransitInfo
|
|
2
|
+
import { c as cartStore, i as cartStoreUpdateSelectedShippingOption, b as cartStoreGetShippingTransitInfo } from './cart.js';
|
|
3
3
|
import { t as translate } from './localization.js';
|
|
4
4
|
import { f as formatCurrency } from './formatCurrency.js';
|
|
5
5
|
import { s as submitGtag } from './submitGtag.js';
|
|
@@ -9,7 +9,7 @@ import { d as defineCustomElement$3 } from './zonos-shipping-rich-radio2.js';
|
|
|
9
9
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
10
10
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
11
11
|
|
|
12
|
-
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:Inter;display:block}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding
|
|
12
|
+
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:Inter;display:block}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:calc(100% - 10px)}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";
|
|
13
13
|
|
|
14
14
|
const ZonosShipping = /*@__PURE__*/ proxyCustomElement(class ZonosShipping extends HTMLElement {
|
|
15
15
|
constructor() {
|
|
@@ -52,9 +52,8 @@ const ZonosShipping = /*@__PURE__*/ proxyCustomElement(class ZonosShipping exten
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
render() {
|
|
55
|
-
var _a
|
|
56
|
-
const
|
|
57
|
-
const serviceLevels = (_b = cartStore.shippingData) === null || _b === void 0 ? void 0 : _b.flatMap((item) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const serviceLevels = (_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.flatMap((item) => {
|
|
58
57
|
var _a, _b;
|
|
59
58
|
const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(item);
|
|
60
59
|
const sublabel = expectedDate
|
|
@@ -75,7 +74,7 @@ const ZonosShipping = /*@__PURE__*/ proxyCustomElement(class ZonosShipping exten
|
|
|
75
74
|
value: item.id,
|
|
76
75
|
};
|
|
77
76
|
});
|
|
78
|
-
return (h(Host, { class: "zonos--shipping zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !(serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.length) ? (h("zonos-banner", { bannerTitle: "No shipping methods found - try editing your address or contacting support if the error persists", intent: "error" })) : (h("zonos-shipping-rich-radio", { items: serviceLevels || [], onRadioSelected: e => this.handleRadioSelected(e) }))
|
|
77
|
+
return (h(Host, { class: "zonos--shipping zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !(serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.length) ? (h("zonos-banner", { bannerTitle: "No shipping methods found - try editing your address or contacting support if the error persists", intent: "error" })) : (h("zonos-shipping-rich-radio", { items: serviceLevels || [], onRadioSelected: e => this.handleRadioSelected(e) }))), h("zonos-button", { backgroundColor: this.submitBtnColor, "is-disabled": this.disabled, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
79
78
|
// use primary type when on mobile mode
|
|
80
79
|
variant: this.submitBtnType }, translate('Go to payment'))));
|
|
81
80
|
}
|
|
@@ -2553,6 +2553,8 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
2553
2553
|
},
|
|
2554
2554
|
organization: '',
|
|
2555
2555
|
placeOrderButtonSelector: null,
|
|
2556
|
+
// default inactive for subscription
|
|
2557
|
+
subscriptionStatus: 'INACTIVE',
|
|
2556
2558
|
successBehavior: 'REDIRECT_TO_SUCCESS_PAGE',
|
|
2557
2559
|
successRedirectUrl: '',
|
|
2558
2560
|
visibilityStatus: 'ENABLED',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as createStore, z as zonosStore } from './zonosStore-
|
|
2
|
-
import { h as handleFetch, l as log, a as localizationStore, b as logError, t as translate } from './localization-
|
|
3
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
1
|
+
import { c as createStore, z as zonosStore } from './zonosStore-05a62104.js';
|
|
2
|
+
import { h as handleFetch, l as log, a as localizationStore, b as logError, t as translate } from './localization-f3828793.js';
|
|
3
|
+
import { i as isDarkColor } from './isDarkColor-6fbb9b14.js';
|
|
4
|
+
import { g as getBorderRadius } from './getBorderRadius-45764ad7.js';
|
|
5
5
|
|
|
6
6
|
const prepCalculateLandedCost = () => {
|
|
7
7
|
// maybe we don't need email now for prefetch the landed cost
|
|
@@ -20,17 +20,7 @@ const prepCalculateLandedCost = () => {
|
|
|
20
20
|
lastName: stripeAddressData.value.lastName || '',
|
|
21
21
|
phone: stripeAddressData.value.phone || '',
|
|
22
22
|
},
|
|
23
|
-
items: cartStore.items.map(item =>
|
|
24
|
-
amount: item.amount,
|
|
25
|
-
countryOfOrigin: item.countryOfOrigin,
|
|
26
|
-
currencyCode: item.currencyCode,
|
|
27
|
-
imageUrl: item.imageUrl,
|
|
28
|
-
measurements: item.measurements,
|
|
29
|
-
metadata: item.metadata,
|
|
30
|
-
name: item.name,
|
|
31
|
-
productId: item.productId,
|
|
32
|
-
quantity: item.quantity,
|
|
33
|
-
})),
|
|
23
|
+
items: cartStore.items.map(item => item),
|
|
34
24
|
shippingAddress: {
|
|
35
25
|
addressLine1: stripeAddressData.value.address.line1,
|
|
36
26
|
addressLine2: stripeAddressData.value.address.line2 || '',
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { c as cartStore, a as cartStoreApplySubtotals, b as cartStoreGetShippingTransitInfo, d as cartStoreNextStep, e as cartStorePreviousStep, f as cartStoreReCalculateTotal, g as cartStoreReset, h as cartStoreUpdateItems, i as cartStoreUpdateSelectedShippingOption, j as cartStoreUpdateToErrorState } from './cart-
|
|
2
|
-
import './zonosStore-
|
|
1
|
+
export { c as cartStore, a as cartStoreApplySubtotals, b as cartStoreGetShippingTransitInfo, d as cartStoreNextStep, e as cartStorePreviousStep, f as cartStoreReCalculateTotal, g as cartStoreReset, h as cartStoreUpdateItems, i as cartStoreUpdateSelectedShippingOption, j as cartStoreUpdateToErrorState } from './cart-e1b93711.js';
|
|
2
|
+
import './zonosStore-05a62104.js';
|
|
3
3
|
import './index-d1aa9293.js';
|
|
4
|
-
import './localization-
|
|
5
|
-
import './isDarkColor-
|
|
6
|
-
import './getBorderRadius-
|
|
4
|
+
import './localization-f3828793.js';
|
|
5
|
+
import './isDarkColor-6fbb9b14.js';
|
|
6
|
+
import './getBorderRadius-45764ad7.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createCommonjsModule, b as commonjsGlobal } from './zonosStore-
|
|
1
|
+
import { a as createCommonjsModule, b as commonjsGlobal } from './zonosStore-05a62104.js';
|
|
2
2
|
|
|
3
3
|
var tinycolor = createCommonjsModule(function (module, exports) {
|
|
4
4
|
// This file is autogenerated. It's used to publish CJS to npm.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createStore, z as zonosStore } from './zonosStore-
|
|
1
|
+
import { c as createStore, z as zonosStore } from './zonosStore-05a62104.js';
|
|
2
2
|
|
|
3
3
|
const stringsArabic = {
|
|
4
4
|
'Above de minimis threshold for': {
|
|
@@ -3196,18 +3196,23 @@ const getCountryLandedCost = async (countryCode) => {
|
|
|
3196
3196
|
|
|
3197
3197
|
const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCurrency, }) => {
|
|
3198
3198
|
var _a;
|
|
3199
|
+
// If source currency matches target currency (US -> US) and is not a guaranteed rate, return null
|
|
3200
|
+
if (sourceCurrency === targetCurrency && !isGuaranteed) {
|
|
3201
|
+
return { exchangeRate: null, maxAge: null };
|
|
3202
|
+
}
|
|
3199
3203
|
const url = `${"https://v1.route.js.zonos.com"}/api/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}}`;
|
|
3200
3204
|
const { errors, json } = await handleFetch(url);
|
|
3201
3205
|
if (errors.length || !json) {
|
|
3202
3206
|
logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
3203
|
-
return null;
|
|
3207
|
+
return { exchangeRate: null, maxAge: null };
|
|
3204
3208
|
}
|
|
3205
|
-
const { rate, targetFormat } = json.exchangeRateCreate;
|
|
3209
|
+
const { maxAge, rate, targetFormat } = json.exchangeRateCreate;
|
|
3206
3210
|
if (rate) {
|
|
3207
3211
|
sessionStorage.setItem(country + '_rate', JSON.stringify(rate));
|
|
3208
|
-
|
|
3212
|
+
const exchangeRate = { rate, targetFormat };
|
|
3213
|
+
return { exchangeRate, maxAge };
|
|
3209
3214
|
}
|
|
3210
|
-
return null;
|
|
3215
|
+
return { exchangeRate: null, maxAge: null };
|
|
3211
3216
|
};
|
|
3212
3217
|
|
|
3213
3218
|
const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
|
|
@@ -3465,23 +3470,45 @@ const { state: localizationStore } = createStore({
|
|
|
3465
3470
|
shippingZoneCountries: null,
|
|
3466
3471
|
targetCurrency: 'USD',
|
|
3467
3472
|
});
|
|
3473
|
+
const triggerGetExchangeRate = async (isGuaranteed) => {
|
|
3474
|
+
const { exchangeRate, maxAge } = await getExchangeRate({
|
|
3475
|
+
country: localizationStore.selectedCountryCode,
|
|
3476
|
+
isGuaranteed,
|
|
3477
|
+
sourceCurrency: zonosStore.sourceCurrency,
|
|
3478
|
+
targetCurrency: localizationStore.targetCurrency,
|
|
3479
|
+
});
|
|
3480
|
+
if (exchangeRate) {
|
|
3481
|
+
localizationStore.exchangeRate = exchangeRate;
|
|
3482
|
+
currencyDisplay();
|
|
3483
|
+
}
|
|
3484
|
+
return { maxAge };
|
|
3485
|
+
};
|
|
3486
|
+
// This recursive function is for users who step away from their computer and come back needing a new exchange rate
|
|
3487
|
+
const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
3488
|
+
if (localizationStore.exchangeRateTimeout) {
|
|
3489
|
+
clearTimeout(localizationStore.exchangeRateTimeout);
|
|
3490
|
+
}
|
|
3491
|
+
// maxAge comes in seconds, convert to milliseconds
|
|
3492
|
+
const defaultMaxAge = 5 * 60;
|
|
3493
|
+
const maxAgeToUse = maxAge || defaultMaxAge;
|
|
3494
|
+
// Recursively set timeouts to get new exchange rates when the current one expires
|
|
3495
|
+
localizationStore.exchangeRateTimeout = setTimeout(async () => {
|
|
3496
|
+
const { maxAge: newMaxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
3497
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge: newMaxAge });
|
|
3498
|
+
}, maxAgeToUse * 1000);
|
|
3499
|
+
};
|
|
3468
3500
|
const getNewLocalization = async () => {
|
|
3469
3501
|
log('get new localization store');
|
|
3470
3502
|
const { isShippableCountry, selectedCountryCode } = localizationStore;
|
|
3471
|
-
const isGuaranteed = zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
3472
3503
|
if (zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
3473
3504
|
!isShippableCountry ||
|
|
3474
3505
|
!selectedCountryCode) {
|
|
3475
3506
|
return;
|
|
3476
3507
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
isGuaranteed
|
|
3480
|
-
|
|
3481
|
-
targetCurrency: localizationStore.targetCurrency,
|
|
3482
|
-
});
|
|
3483
|
-
if (localizationStore.exchangeRate) {
|
|
3484
|
-
currencyDisplay();
|
|
3508
|
+
if (zonosStore.sourceCurrency !== localizationStore.targetCurrency) {
|
|
3509
|
+
const isGuaranteed = zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
3510
|
+
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
3511
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
3485
3512
|
}
|
|
3486
3513
|
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
3487
3514
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as zonosStore } from './zonosStore-
|
|
2
|
-
import { l as log } from './localization-
|
|
1
|
+
import { z as zonosStore } from './zonosStore-05a62104.js';
|
|
2
|
+
import { l as log } from './localization-f3828793.js';
|
|
3
3
|
|
|
4
4
|
const checkoutBreakpoint = 890;
|
|
5
5
|
const isCheckoutMobile = (isMobile) => {
|