@zonos/elements 1.3.229 → 1.3.231
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/{buildCartItemsByTempCart-309fcebf.js → buildCartItemsByTempCart-edddbf4b.js} +1 -0
- package/dist/cjs/{cart-ad82a680.js → cart-9b519566.js} +6 -2
- package/dist/cjs/hasInclusivePrice-12605be9.js +24 -0
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{localization-31e3dfe3.js → localization-38af974b.js} +118 -30
- package/dist/cjs/{paypal-88b5e878.js → paypal-e8fa2302.js} +3 -3
- package/dist/cjs/{placeTestOrder-6aefbf9c.js → placeTestOrder-6388881f.js} +11 -7
- package/dist/cjs/{renderFallback-87c908ad.js → renderFallback-bb2c4bce.js} +2 -2
- package/dist/cjs/{translationStore-b8b25e9d.js → translationStore-f2d5eae9.js} +420 -360
- package/dist/cjs/zonos-address_11.cjs.entry.js +21 -5
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +73 -13
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -6
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +12 -5
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -6
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +55 -45
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +68 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -1
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +54 -43
- package/dist/collection/components/main/zonos-controller.js +5 -2
- package/dist/collection/components/store/hello/localization.js +47 -16
- package/dist/collection/components/store/translationStore/strings.arabic.js +21 -18
- package/dist/collection/components/store/translationStore/strings.base.js +21 -18
- package/dist/collection/components/store/translationStore/strings.chinese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.danish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.dutch.js +21 -18
- package/dist/collection/components/store/translationStore/strings.french.js +21 -18
- package/dist/collection/components/store/translationStore/strings.german.js +21 -18
- package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -18
- package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.italian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.japanese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.korean.js +21 -18
- package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.polish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -18
- package/dist/collection/components/store/translationStore/strings.russian.js +21 -18
- package/dist/collection/components/store/translationStore/strings.spanish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.swedish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.turkish.js +21 -18
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -18
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +18 -2
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +1 -0
- package/dist/collection/components/utils/api/{getInclusivePricing.js → getInclusivePriceConfigurations.js} +1 -1
- package/dist/collection/components/utils/api/getLocalization.js +2 -5
- package/dist/collection/components/utils/api/getZonosSettings.js +5 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +6 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -5
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +4 -1
- package/dist/collection/components/utils/getOverridenZCountry.js +11 -0
- package/dist/collection/components/utils/hasInclusivePrice.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.js +10 -0
- package/dist/collection/components/utils/hello/currencyConversion/applyInclusivePrice.js +39 -0
- package/dist/collection/components/utils/hello/currencyConversion/calculateInclusivePrice.js +32 -0
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +11 -6
- package/dist/collection/constants/key.js +9 -0
- package/dist/collection/types/InclusivePricing.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +87 -3
- package/dist/collection/types/index.js +1 -0
- package/dist/collection/utils/performBlurCurrency.js +38 -5
- package/dist/esm/{buildCartItemsByTempCart-c4488f73.js → buildCartItemsByTempCart-a117f75d.js} +1 -0
- package/dist/esm/{cart-c74f9aaa.js → cart-bc0e1598.js} +6 -2
- package/dist/esm/hasInclusivePrice-706cc09d.js +20 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/{localization-106476cb.js → localization-53f67640.js} +117 -31
- package/dist/esm/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +3 -3
- package/dist/esm/{placeTestOrder-891295e8.js → placeTestOrder-917731cf.js} +11 -7
- package/dist/esm/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +2 -2
- package/dist/esm/{translationStore-766b7521.js → translationStore-d241dcf7.js} +420 -360
- package/dist/esm/zonos-address_11.entry.js +21 -5
- package/dist/esm/zonos-cart-items_13.entry.js +73 -13
- package/dist/esm/zonos-checkout.entry.js +9 -6
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +12 -5
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +9 -6
- package/dist/esm/zonos-empty-state-payment_4.entry.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +55 -45
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm-es5/buildCartItemsByTempCart-a117f75d.js +1 -0
- package/dist/esm-es5/cart-bc0e1598.js +1 -0
- package/dist/esm-es5/hasInclusivePrice-706cc09d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/localization-53f67640.js +1 -0
- package/dist/esm-es5/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +1 -1
- package/dist/esm-es5/placeTestOrder-917731cf.js +1 -0
- package/dist/esm-es5/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +1 -1
- package/dist/esm-es5/translationStore-d241dcf7.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.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-empty-state-payment_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/scripts/blurCurrencyOnInit.js +1 -1
- package/dist/scripts/index.d.ts +39 -6
- 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/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +3 -0
- package/dist/types/components/store/hello/localization.d.ts +14 -3
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.base.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.french.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.german.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -15
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -15
- package/dist/types/components/utils/api/getInclusivePriceConfigurations.d.ts +2 -0
- package/dist/types/components/utils/getOverridenZCountry.d.ts +5 -0
- package/dist/types/components/utils/hasInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/applyInclusivePrice.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/calculateInclusivePrice.d.ts +27 -0
- package/dist/types/constants/key.d.ts +9 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/InclusivePricing.d.ts +13 -0
- package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +1 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +192 -51
- package/dist/types/types/generated/graphql.internal.types.ts +229 -50
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +2 -0
- package/dist/types/utils/performBlurCurrency.d.ts +12 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-c89e9d56.system.js → p-0047fecf.system.js} +1 -1
- package/dist/zonos-elements/{p-bd373de0.system.entry.js → p-0bc8e55c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-964a4d85.js → p-2008df67.js} +1 -1
- package/dist/zonos-elements/{p-2db90c99.system.entry.js → p-22338b4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3d2925c5.system.entry.js → p-2eaa5013.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-288f5a5b.system.entry.js → p-304bdbc2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-30981f80.entry.js +1 -0
- package/dist/zonos-elements/{p-69451a50.system.js → p-398d9022.system.js} +1 -1
- package/dist/zonos-elements/p-3a242dfc.system.js +1 -0
- package/dist/zonos-elements/{p-5608ac9d.entry.js → p-3eda5c2c.entry.js} +1 -1
- package/dist/zonos-elements/p-3f0ca5f9.js +1 -0
- package/dist/zonos-elements/{p-23f6a2fb.system.entry.js → p-3f35b8b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de984173.system.js → p-419c292c.system.js} +1 -1
- package/dist/zonos-elements/{p-7a97e1cf.system.entry.js → p-4697f061.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4f5be8f0.entry.js +1 -0
- package/dist/zonos-elements/p-516a9666.system.js +1 -0
- package/dist/zonos-elements/p-55c6ff14.system.entry.js +1 -0
- package/dist/zonos-elements/p-6d563f33.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9c728733.system.js → p-7730879e.system.js} +1 -1
- package/dist/zonos-elements/p-7920d79c.system.js +1 -0
- package/dist/zonos-elements/p-7c96a585.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/{p-29c80a34.js → p-83666056.js} +1 -1
- package/dist/zonos-elements/{p-2b84039a.entry.js → p-91fa43ef.entry.js} +1 -1
- package/dist/zonos-elements/p-9a444a82.system.entry.js +1 -0
- package/dist/zonos-elements/p-9bdad585.system.entry.js +1 -0
- package/dist/zonos-elements/p-abc0fb80.js +1 -0
- package/dist/zonos-elements/{p-b0a75761.entry.js → p-ac26a931.entry.js} +1 -1
- package/dist/zonos-elements/p-bb707dfd.system.js +1 -0
- package/dist/zonos-elements/{p-10894d36.entry.js → p-bc963b03.entry.js} +1 -1
- package/dist/zonos-elements/p-c0e080e3.js +1 -0
- package/dist/zonos-elements/p-c20429ea.entry.js +1 -0
- package/dist/zonos-elements/p-c28da00e.entry.js +1 -0
- package/dist/zonos-elements/p-c9be03e0.entry.js +1 -0
- package/dist/zonos-elements/{p-6c8e4f01.system.entry.js → p-cb70de13.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cec35a21.entry.js +1 -0
- package/dist/zonos-elements/{p-cf56b990.entry.js → p-d15cd138.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f1024de.system.entry.js → p-d852d6da.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d9486c57.entry.js +1 -0
- package/dist/zonos-elements/p-db73c11a.entry.js +1 -0
- package/dist/zonos-elements/{p-203c7fda.js → p-e27a9450.js} +1 -1
- package/dist/zonos-elements/{p-76f924b3.entry.js → p-ede9e968.entry.js} +1 -1
- package/dist/zonos-elements/p-ee8fcde6.js +1 -0
- package/dist/zonos-elements/p-f688d7a4.system.js +1 -0
- package/dist/zonos-elements/{p-236e0144.system.entry.js → p-ff1722d0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ff522088.system.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +3 -3
- package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +0 -1
- package/dist/esm-es5/cart-c74f9aaa.js +0 -1
- package/dist/esm-es5/localization-106476cb.js +0 -1
- package/dist/esm-es5/placeTestOrder-891295e8.js +0 -1
- package/dist/esm-es5/translationStore-766b7521.js +0 -1
- package/dist/types/components/utils/api/getInclusivePricing.d.ts +0 -6
- package/dist/zonos-elements/p-053a042e.entry.js +0 -1
- package/dist/zonos-elements/p-0d3767ec.entry.js +0 -1
- package/dist/zonos-elements/p-1d15662c.js +0 -1
- package/dist/zonos-elements/p-21b251f0.system.entry.js +0 -1
- package/dist/zonos-elements/p-225a61c4.system.entry.js +0 -1
- package/dist/zonos-elements/p-462f8857.entry.js +0 -1
- package/dist/zonos-elements/p-57ee34aa.system.entry.js +0 -1
- package/dist/zonos-elements/p-595668d7.system.js +0 -1
- package/dist/zonos-elements/p-62803534.entry.js +0 -1
- package/dist/zonos-elements/p-6497ce22.entry.js +0 -1
- package/dist/zonos-elements/p-65db3219.entry.js +0 -1
- package/dist/zonos-elements/p-94853366.system.entry.js +0 -1
- package/dist/zonos-elements/p-9972941a.entry.js +0 -1
- package/dist/zonos-elements/p-ad7be556.system.entry.js +0 -1
- package/dist/zonos-elements/p-b4fe3604.system.js +0 -1
- package/dist/zonos-elements/p-b8293509.js +0 -1
- package/dist/zonos-elements/p-c3c3cd98.js +0 -1
- package/dist/zonos-elements/p-cdaf52f4.system.js +0 -1
- package/dist/zonos-elements/p-cef1e888.system.js +0 -1
- package/dist/zonos-elements/p-eea0d8af.js +0 -1
- package/dist/zonos-elements/p-f4085c23.entry.js +0 -1
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1c710d00.js');
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const translationStore = require('./translationStore-
|
|
6
|
+
const localization = require('./localization-38af974b.js');
|
|
7
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
9
9
|
const classes = require('./classes-b7918f56.js');
|
|
10
10
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
11
|
+
const hasInclusivePrice = require('./hasInclusivePrice-12605be9.js');
|
|
11
12
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
12
13
|
const TaxId = require('./TaxId-12acedde.js');
|
|
13
14
|
require('./handleFetch-954f30e1.js');
|
|
@@ -112,10 +113,6 @@ const ZonosHelloDialog = class {
|
|
|
112
113
|
var _a;
|
|
113
114
|
return (_a = localization.localizationStore.countryLandedCost) === null || _a === void 0 ? void 0 : _a.hasTaxId;
|
|
114
115
|
};
|
|
115
|
-
this.hasInclusivePrices = () => {
|
|
116
|
-
var _a;
|
|
117
|
-
return ((_a = localization.localizationStore.inclusivePricing) === null || _a === void 0 ? void 0 : _a.status) === 'ENABLED';
|
|
118
|
-
};
|
|
119
116
|
/**
|
|
120
117
|
* Some countries don't have threshold. So we need to show generic message for them
|
|
121
118
|
*/
|
|
@@ -200,7 +197,7 @@ const ZonosHelloDialog = class {
|
|
|
200
197
|
];
|
|
201
198
|
};
|
|
202
199
|
this.getAustraliaDutyTaxMessage = (landedCost) => {
|
|
203
|
-
if (
|
|
200
|
+
if (hasInclusivePrice.hasInclusivePrice()) {
|
|
204
201
|
return [];
|
|
205
202
|
}
|
|
206
203
|
return [
|
|
@@ -213,7 +210,7 @@ const ZonosHelloDialog = class {
|
|
|
213
210
|
];
|
|
214
211
|
};
|
|
215
212
|
this.getNewZealandDutyTaxMessge = (landedCost) => {
|
|
216
|
-
if (
|
|
213
|
+
if (hasInclusivePrice.hasInclusivePrice()) {
|
|
217
214
|
return null;
|
|
218
215
|
}
|
|
219
216
|
return [
|
|
@@ -226,7 +223,7 @@ const ZonosHelloDialog = class {
|
|
|
226
223
|
];
|
|
227
224
|
};
|
|
228
225
|
this.getNorwayDutyTaxMessage = (landedCost) => {
|
|
229
|
-
if (
|
|
226
|
+
if (hasInclusivePrice.hasInclusivePrice()) {
|
|
230
227
|
return null;
|
|
231
228
|
}
|
|
232
229
|
return [
|
|
@@ -239,7 +236,7 @@ const ZonosHelloDialog = class {
|
|
|
239
236
|
];
|
|
240
237
|
};
|
|
241
238
|
this.getSingaporeDutyTaxMessage = (landedCost) => {
|
|
242
|
-
if (
|
|
239
|
+
if (hasInclusivePrice.hasInclusivePrice()) {
|
|
243
240
|
return null;
|
|
244
241
|
}
|
|
245
242
|
return [
|
|
@@ -252,38 +249,57 @@ const ZonosHelloDialog = class {
|
|
|
252
249
|
];
|
|
253
250
|
};
|
|
254
251
|
this.getInclusivePriceMessage = () => {
|
|
255
|
-
const
|
|
256
|
-
|
|
252
|
+
const settings = localization.localizationStore.inclusivePricingConfigurations;
|
|
253
|
+
const foundConfiguration = settings === null || settings === void 0 ? void 0 : settings.find(Boolean);
|
|
254
|
+
const taxConfiguration = foundConfiguration === null || foundConfiguration === void 0 ? void 0 : foundConfiguration.configurations[hasInclusivePrice.TAXES_KEY];
|
|
255
|
+
const dutyConfiguration = foundConfiguration === null || foundConfiguration === void 0 ? void 0 : foundConfiguration.configurations[hasInclusivePrice.DUTY_KEY];
|
|
256
|
+
if ((taxConfiguration === null || taxConfiguration === void 0 ? void 0 : taxConfiguration.status) === 'DISABLED' &&
|
|
257
|
+
(dutyConfiguration === null || dutyConfiguration === void 0 ? void 0 : dutyConfiguration.status) === 'DISABLED') {
|
|
257
258
|
return null;
|
|
258
259
|
}
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
setting.tax.status === 'INCLUDED') {
|
|
266
|
-
return translationStore.translate('Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions.');
|
|
267
|
-
}
|
|
268
|
-
if (setting.duty.status === 'INCLUDED' &&
|
|
269
|
-
setting.fee.status === 'INCLUDED') {
|
|
270
|
-
return translationStore.translate('Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions.');
|
|
260
|
+
if ((dutyConfiguration === null || dutyConfiguration === void 0 ? void 0 : dutyConfiguration.status) === 'ENABLED' &&
|
|
261
|
+
(taxConfiguration === null || taxConfiguration === void 0 ? void 0 : taxConfiguration.status) === 'ENABLED') {
|
|
262
|
+
return {
|
|
263
|
+
inclusiveType: 'DUTIES_TAXES_AND_FEES',
|
|
264
|
+
message: translationStore.translate('Product prices already include duties, taxes and fees. No additional duties, taxes, or fees will be added at checkout.'),
|
|
265
|
+
};
|
|
271
266
|
}
|
|
272
|
-
if (
|
|
273
|
-
|
|
274
|
-
|
|
267
|
+
if ((dutyConfiguration === null || dutyConfiguration === void 0 ? void 0 : dutyConfiguration.status) === 'ENABLED') {
|
|
268
|
+
return {
|
|
269
|
+
inclusiveType: 'DUTIES_FEES',
|
|
270
|
+
message: translationStore.translate('Product prices already include duties and fees. No additional duties or fees will be added at checkout.'),
|
|
271
|
+
};
|
|
275
272
|
}
|
|
276
|
-
if (
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
if (setting.fee.status === 'INCLUDED') {
|
|
283
|
-
return translationStore.translate('Product prices already include fees. No additional fees will be added at checkout, with rare exceptions.');
|
|
273
|
+
if ((taxConfiguration === null || taxConfiguration === void 0 ? void 0 : taxConfiguration.status) === 'ENABLED') {
|
|
274
|
+
return {
|
|
275
|
+
inclusiveType: 'TAXES',
|
|
276
|
+
message: translationStore.translate('Product prices already include taxes. No additional taxes will be added at checkout.'),
|
|
277
|
+
};
|
|
284
278
|
}
|
|
285
279
|
return null;
|
|
286
280
|
};
|
|
281
|
+
this.renderHelloMessage = () => {
|
|
282
|
+
// If deminimis is undefined or null, assume it's $0
|
|
283
|
+
const dutyDeMinimisMessage = this.getDutyMessage();
|
|
284
|
+
// If deminimis is undefined or null, assume it's $0
|
|
285
|
+
const taxDeMinimisMessage = this.getTaxMessage();
|
|
286
|
+
const inclusivePriceMessage = this.getInclusivePriceMessage();
|
|
287
|
+
if (hasInclusivePrice.hasInclusivePrice() && inclusivePriceMessage) {
|
|
288
|
+
switch (inclusivePriceMessage.inclusiveType) {
|
|
289
|
+
case 'DUTIES_FEES': {
|
|
290
|
+
return (index.h(index.Fragment, null, inclusivePriceMessage.message && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Duty inclusive pricing icon", content: InclusivePricingIcon }), index.h("zonos-text", { "aria-label": "Duty inclusive pricing message" }, inclusivePriceMessage.message))), taxDeMinimisMessage && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Tax de minimis icon", content: MoneyIcon }), index.h("zonos-text", { "aria-label": "Tax de minimis message" }, taxDeMinimisMessage)))));
|
|
291
|
+
}
|
|
292
|
+
case 'TAXES': {
|
|
293
|
+
return (index.h(index.Fragment, null, inclusivePriceMessage.message && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Tax inclusive pricing icon", content: InclusivePricingIcon }), index.h("zonos-text", { "aria-label": "Tax inclusive pricing message" }, inclusivePriceMessage.message))), dutyDeMinimisMessage && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Duty de minimis icon", content: ImportIcon }), index.h("zonos-text", { "aria-label": "Duty de minimis message" }, dutyDeMinimisMessage)))));
|
|
294
|
+
}
|
|
295
|
+
case 'DUTIES_TAXES_AND_FEES':
|
|
296
|
+
default: {
|
|
297
|
+
return (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), index.h("zonos-text", null, inclusivePriceMessage.message)));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return (index.h(index.Fragment, null, dutyDeMinimisMessage && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Duty de minimis icon", content: ImportIcon }), index.h("zonos-text", { "aria-label": "Duty de minimis message" }, dutyDeMinimisMessage))), taxDeMinimisMessage && (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Tax de minimis icon", content: MoneyIcon }), index.h("zonos-text", { "aria-label": "Tax de minimis message" }, taxDeMinimisMessage)))));
|
|
302
|
+
};
|
|
287
303
|
/**
|
|
288
304
|
* Get additional duty tax message if selected country has tax id
|
|
289
305
|
*/
|
|
@@ -328,12 +344,6 @@ const ZonosHelloDialog = class {
|
|
|
328
344
|
render() {
|
|
329
345
|
var _a;
|
|
330
346
|
const { selectedCountryCode } = localization.localizationStore;
|
|
331
|
-
const hasInclusivePrices = this.hasInclusivePrices();
|
|
332
|
-
const inclusivePriceMessage = this.getInclusivePriceMessage();
|
|
333
|
-
// If deminimis is undefined or null, assume it's $0
|
|
334
|
-
const dutyDeMinimisMessage = this.getDutyMessage();
|
|
335
|
-
// If deminimis is undefined or null, assume it's $0
|
|
336
|
-
const taxDeMinimisMessage = this.getTaxMessage();
|
|
337
347
|
// Show additional information if selected country has tax id
|
|
338
348
|
const additionalInformation = this.getAdditionalDutyTaxMessage();
|
|
339
349
|
const animateLeft = this.animateFromLeftOverride ||
|
|
@@ -348,18 +358,18 @@ const ZonosHelloDialog = class {
|
|
|
348
358
|
const defaultMessage = formatStringWithLinks.formatStringWithLinks(defaultMessageStr);
|
|
349
359
|
const currentPage = this.getCurrentPageEnum();
|
|
350
360
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
351
|
-
return (index.h(index.Host, { key: '
|
|
361
|
+
return (index.h(index.Host, { key: '9b72c4f7b35ebdb1179430d4fc6baec2f9c7d9ca', class: "zonos--elements" }, index.h("div", { key: '821ea623e2c2764a647c493887bce1b9d6d21756', class: classes.classes([
|
|
352
362
|
'zonos--hello-dialog',
|
|
353
363
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
354
364
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
355
365
|
!!this.mobileLocationOverride &&
|
|
356
366
|
'zonos--hello-dialog-mobile-override',
|
|
357
367
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
358
|
-
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: '
|
|
368
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: 'e2aa3326f46296c22733a836078e980afd9e736c' }, index.h("div", { key: '683e1d862da858facf1cf513271a3ce470bd1389', class: "zonos--hello-dialog-content" }, index.h("zonos-button", { key: '90bdcf789ad76957a4c5623c52f25d6c4c4d0e16', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), index.h("zonos-v-stack", { key: 'ebae01dd1e80f6b6c3e9e6f310468feb940532b5', spacing: 24 }, index.h("zonos-country-flag", { key: '94c73321eae6a57d1bc5db1067564bbc415a8bb1', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), index.h("zonos-v-stack", { key: 'a06e2bc0e4c712a86e4bd2ed8fdef054a6c33776', class: "zonos--hello-dialog-header", spacing: 4 }, index.h("zonos-text", { key: '4d487ee5c7ba3092e0630e4ceeaa43c562bfccf5', type: "boldSubheader" }, welcomeMessage), index.h("zonos-text", { key: 'cd8e2a7bfacdb82262d7e3d54019b220b27aff9a', innerHTML: defaultMessage, textColor: "gray-800" })), index.h("zonos-v-stack", { key: '612dd0f2d812b957fa02c6da598db8b067f6d32d', spacing: 8 }, this.restrictedItems.map(item => {
|
|
359
369
|
var _a;
|
|
360
370
|
return item && (index.h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (index.h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
361
|
-
}), index.h("zonos-card", { key: '
|
|
362
|
-
additionalInformation.map(info => (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country icon", content: BagIcon }), index.h("zonos-text", { "aria-label": `Additional information for buying goods from selected country message`, innerHTML: info })))))), filteredMessages.map(x => (index.h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), index.h("zonos-hello-dialog-footer", { key: '
|
|
371
|
+
}), index.h("zonos-card", { key: '12b7726f5afd1fd37bf00558e1059dd6a4ae4301', spacing: "12px" }, index.h("zonos-v-stack", { key: '1a935c9c54b8410ad6255bcc9d652e71ed5b0d55', spacing: 12 }, this.renderHelloMessage(), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
372
|
+
additionalInformation.map(info => (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country icon", content: BagIcon }), index.h("zonos-text", { "aria-label": `Additional information for buying goods from selected country message`, innerHTML: info })))))), filteredMessages.map(x => (index.h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), index.h("zonos-hello-dialog-footer", { key: '76d5ac661a9b67dd34b9950b88b6e6fece9267d4', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (index.h("div", { key: '154934865bc0791c462f7b05e50b8186ddf1ef69' }, index.h("zonos-country-select", { key: '74a170a0cce0d78761f53a80a588ca42a883fbd0', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (index.h("div", { key: '09be0a1d26f4753f455e4ea35d60acd17967270e' }, index.h("zonos-language-select", { key: 'b904c114352a255af58461fbbcb352d0a883e85c', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
363
373
|
}
|
|
364
374
|
static get assetsDirs() { return ["assets"]; }
|
|
365
375
|
static get watchers() { return {
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1c710d00.js');
|
|
6
6
|
const debounce = require('./debounce-2c9f3f1e.js');
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
const translationStore = require('./translationStore-
|
|
7
|
+
const localization = require('./localization-38af974b.js');
|
|
8
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
10
10
|
const classes = require('./classes-b7918f56.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1c710d00.js');
|
|
6
|
-
const localization = require('./localization-
|
|
7
|
-
const translationStore = require('./translationStore-
|
|
6
|
+
const localization = require('./localization-38af974b.js');
|
|
7
|
+
const translationStore = require('./translationStore-f2d5eae9.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
9
9
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
10
10
|
require('./handleFetch-954f30e1.js');
|
|
@@ -1,21 +1,55 @@
|
|
|
1
1
|
import { Fragment, h, Host } from "@stencil/core";
|
|
2
2
|
import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
|
|
3
3
|
import { stripeStore, stripeStoreApplyPromoCode, stripeStoreRemovePromoCode, } from "../../../store/checkout/stripe";
|
|
4
|
+
import { localizationStore } from "../../../store/hello/localization";
|
|
4
5
|
import { translate } from "../../../store/translationStore";
|
|
5
6
|
import { zonosStore } from "../../../store/zonosStore";
|
|
6
7
|
import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
|
|
8
|
+
import { hasInclusivePrice } from "../../../utils/hasInclusivePrice";
|
|
9
|
+
import { DUTY_KEY, TAXES_KEY } from "../../../../constants/key";
|
|
7
10
|
export class ZonosCartSubtotal {
|
|
8
11
|
constructor() {
|
|
9
12
|
/**
|
|
10
13
|
* Loading state for apply promo code button
|
|
11
14
|
*/
|
|
12
15
|
this.loading = false;
|
|
16
|
+
this.getInclusivePriceType = () => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const inclusivePriceConfiguration = localizationStore.inclusivePricingConfigurations.find(Boolean);
|
|
19
|
+
const dutyInclusive = ((_a = inclusivePriceConfiguration === null || inclusivePriceConfiguration === void 0 ? void 0 : inclusivePriceConfiguration.configurations[DUTY_KEY]) === null || _a === void 0 ? void 0 : _a.status) ===
|
|
20
|
+
'ENABLED';
|
|
21
|
+
const taxInclusive = ((_b = inclusivePriceConfiguration === null || inclusivePriceConfiguration === void 0 ? void 0 : inclusivePriceConfiguration.configurations[TAXES_KEY]) === null || _b === void 0 ? void 0 : _b.status) ===
|
|
22
|
+
'ENABLED';
|
|
23
|
+
if (dutyInclusive && taxInclusive) {
|
|
24
|
+
return 'DUTY_TAX_AND_FEE';
|
|
25
|
+
}
|
|
26
|
+
// Fee would also be included with duty if it's inclusive
|
|
27
|
+
if (dutyInclusive) {
|
|
28
|
+
return 'DUTY_AND_FEE';
|
|
29
|
+
}
|
|
30
|
+
if (taxInclusive) {
|
|
31
|
+
return 'TAX';
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
this.getCartSubtotalSubtitle = () => {
|
|
36
|
+
const inclusivePriceType = this.getInclusivePriceType();
|
|
37
|
+
if (inclusivePriceType === 'DUTY_AND_FEE') {
|
|
38
|
+
return (h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Duties and fees included')));
|
|
39
|
+
}
|
|
40
|
+
if (inclusivePriceType === 'TAX') {
|
|
41
|
+
return (h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Taxes included')));
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
13
45
|
}
|
|
14
46
|
render() {
|
|
15
47
|
var _a, _b, _c, _d, _e;
|
|
48
|
+
// Since now we are prefetching the landed cost, we need to not show the total that includes the landed cost and shipping
|
|
49
|
+
const cartTotal = cartStore.step === 'customer-info' ? cartStore.subtotal : cartStore.total;
|
|
16
50
|
const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
|
|
17
51
|
// Show 0 for subtotal and total when all items are restricted
|
|
18
|
-
const total = cartStoreHasOneEligibleItem() ?
|
|
52
|
+
const total = cartStoreHasOneEligibleItem() ? cartTotal : 0;
|
|
19
53
|
// Total is in target currency, devide by target rate to get base currency
|
|
20
54
|
const subtotal = cartStoreHasOneEligibleItem() ? cartStore.subtotal : 0;
|
|
21
55
|
const shouldRenderPromoInput =
|
|
@@ -41,16 +75,43 @@ export class ZonosCartSubtotal {
|
|
|
41
75
|
this.loading = false;
|
|
42
76
|
};
|
|
43
77
|
const renderShippingInfo = () => {
|
|
44
|
-
if (!cartStore.selectedShippingOption
|
|
78
|
+
if (!cartStore.selectedShippingOption ||
|
|
79
|
+
// Should not show shipping info at customer info step
|
|
80
|
+
cartStore.step === 'customer-info') {
|
|
45
81
|
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'))));
|
|
46
82
|
}
|
|
47
83
|
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cartStore.selectedShippingOption.displayName), cartStore.selectedShippingOptionTransitTime && (h("zonos-text", { class: "zonos--caption", type: "caption" }, cartStore.selectedShippingOptionTransitTime))));
|
|
48
84
|
};
|
|
49
85
|
const renderLandedCost = () => {
|
|
50
86
|
var _a, _b, _c;
|
|
87
|
+
// At the moment, inclusive price only support for US merchant
|
|
88
|
+
if (hasInclusivePrice()) {
|
|
89
|
+
const inclusivePriceType = this.getInclusivePriceType();
|
|
90
|
+
// This should not happen, put it here to exclude null from the type
|
|
91
|
+
if (!inclusivePriceType) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (inclusivePriceType === 'TAX') {
|
|
95
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
|
|
96
|
+
? renderCheckoutCurrency({
|
|
97
|
+
amount: cartStore.dutiesTaxesFees,
|
|
98
|
+
isForeign: true,
|
|
99
|
+
})
|
|
100
|
+
: '-'))));
|
|
101
|
+
}
|
|
102
|
+
if (inclusivePriceType === 'DUTY_AND_FEE') {
|
|
103
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Taxes'))), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
|
|
104
|
+
? renderCheckoutCurrency({
|
|
105
|
+
amount: cartStore.dutiesTaxesFees,
|
|
106
|
+
isForeign: true,
|
|
107
|
+
})
|
|
108
|
+
: '-'))));
|
|
109
|
+
}
|
|
110
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('The purchase price covers duties, taxes and fees.'))), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, "-"))));
|
|
111
|
+
}
|
|
51
112
|
// Domestic US doesn't have duty applied, just taxes and fees
|
|
52
113
|
if ((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US')) {
|
|
53
|
-
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Taxes and fees'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null ||
|
|
114
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Taxes and fees'))), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null ||
|
|
54
115
|
cartStore.dutiesTaxesFeesEstimate !== null
|
|
55
116
|
? renderCheckoutCurrency({
|
|
56
117
|
amount: cartStore.dutiesTaxesFees ||
|
|
@@ -61,23 +122,23 @@ export class ZonosCartSubtotal {
|
|
|
61
122
|
: '-'))));
|
|
62
123
|
}
|
|
63
124
|
if (cartStore.landedCostMethod === 'DAP') {
|
|
64
|
-
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate !== null
|
|
125
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), cartStore.dutiesTaxesFeesEstimate !== null
|
|
65
126
|
? `${translate('Estimated [amount]', {
|
|
66
127
|
amount: renderCheckoutCurrency({
|
|
67
128
|
amount: cartStore.dutiesTaxesFeesEstimate,
|
|
68
129
|
isForeign: true,
|
|
69
130
|
}),
|
|
70
131
|
})}`
|
|
71
|
-
: '-'), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, translate('Due at delivery')))));
|
|
132
|
+
: '-'), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, translate('Due at delivery')))));
|
|
72
133
|
}
|
|
73
|
-
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
|
|
134
|
+
return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title zonos--landed-cost" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('Nothing due at the door'))), h("td", { class: "zonos--column zonos--cart-subtotal-price zonos--landed-cost" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null
|
|
74
135
|
? renderCheckoutCurrency({
|
|
75
136
|
amount: cartStore.dutiesTaxesFees,
|
|
76
137
|
isForeign: true,
|
|
77
138
|
})
|
|
78
139
|
: '-'))));
|
|
79
140
|
};
|
|
80
|
-
return (h(Host, { class: "zonos--cart-subtotal zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tr", { class: "zonos--row zonos--cart-subtotal" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Cart subtotal'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
|
|
141
|
+
return (h(Host, { class: "zonos--cart-subtotal zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tr", { class: "zonos--row zonos--cart-subtotal" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Cart subtotal')), h("zonos-text", { class: "zonos--caption", type: "caption" }, this.getCartSubtotalSubtitle())), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
|
|
81
142
|
amount: subtotal,
|
|
82
143
|
isForeign: true,
|
|
83
144
|
})))), h("tr", { class: "zonos--row zonos--cart-shipping" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, renderShippingInfo()), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, cartStore.shipping
|
|
@@ -1812,7 +1812,7 @@ export class ZonosCheckout {
|
|
|
1812
1812
|
"signature": "(session: CheckoutSessionDetailsFragment) => Promise<void>",
|
|
1813
1813
|
"parameters": [{
|
|
1814
1814
|
"name": "session",
|
|
1815
|
-
"type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null;
|
|
1815
|
+
"type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; phone: string | null; name: string | null; locality: string; postalCode: string; }[] | null; name: string | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; appliedAdjustments: { adjustment: { name: string | null; source: AdjustmentSource | null; } | null; amount: number; type: LandedCostAdjustmentType | null; item: { amount: number; } | null; }[] | null; currencyCode: CurrencyCode; deMinimis: { type: DeMinimisType; threshold: DeMinimisThreshold; method: IncotermCode; note: string; formula: string; }[]; duties: { amount: number; currencyCode: CurrencyCode; }[]; fees: { amount: number; currencyCode: CurrencyCode; }[]; landedCostGuaranteeCode: LandedCostGuaranteeCode; id: string; method: IncotermCode; remittance: { amount: number; description: string; }[]; rootId: string; shipmentRating: { amount: number; currencyCode: CurrencyCode; displayName: string; id: string; shippingProfile: { serviceLevel: { code: string; }; transitTime: { guaranteedDelivery: string | null; max: number | null; min: number | null; type: TransitTypeCode | null; } | null; } | null; }; taxes: { amount: number; currencyCode: CurrencyCode; }[]; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; references: { inclusivePriceConfigurationId: string | null; } | null; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
|
|
1816
1816
|
"docs": ""
|
|
1817
1817
|
}],
|
|
1818
1818
|
"references": {
|
|
@@ -31,7 +31,8 @@ export class ZonosReview {
|
|
|
31
31
|
this.isMobile = isCheckoutMobile(this.mobile);
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
const
|
|
34
|
+
const cartTotal = cartStore.step === 'customer-info' ? cartStore.subtotal : cartStore.total;
|
|
35
|
+
const total = cartStoreHasOneEligibleItem() ? cartTotal : 0;
|
|
35
36
|
const titleTextType = this.isMobile ? 'boldSubheader' : 'semiBoldLabel';
|
|
36
37
|
const totalTextType = this.isMobile
|
|
37
38
|
? 'boldSubheader'
|
|
@@ -15,7 +15,10 @@ export class ZonosCountrySelect {
|
|
|
15
15
|
this.inputValue = '';
|
|
16
16
|
this.countrySelected = (countryCode) => {
|
|
17
17
|
// mutate the selected country code in store
|
|
18
|
-
void localizationStoreUpdateSelectedCountryCode(
|
|
18
|
+
void localizationStoreUpdateSelectedCountryCode({
|
|
19
|
+
isInitializing: false,
|
|
20
|
+
newSelectedCountryCode: countryCode,
|
|
21
|
+
});
|
|
19
22
|
this.handleOnClose();
|
|
20
23
|
};
|
|
21
24
|
this.handleInputChange = (event) => {
|
|
@@ -48,13 +51,13 @@ export class ZonosCountrySelect {
|
|
|
48
51
|
? fuseObject.map(country => country.item)
|
|
49
52
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
50
53
|
const isEmpty = !filteredCountries.length;
|
|
51
|
-
return (h(Host, { key: '
|
|
54
|
+
return (h(Host, { key: '4bdbe0a40e52745510cf5c51826375eb46d6c85a', class: "zonos--elements", style: {
|
|
52
55
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
53
|
-
} }, h("div", { key: '
|
|
56
|
+
} }, h("div", { key: '82492f3baa43f2691fa9457fdde52fcc6d6b153e', class: "zonos--country-select" }, h("zonos-v-stack", { key: '56fa5efa199d1f83f8042b9280295d0e08c9d045', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '3b84b57f1b80152fcb0c4049672796c87744517a', handleOnClose: () => this.handleOnClose(), label: translate('Select a country') }, h("input", { key: '68b9b5af5dbdf20d47e39c45b3c64df772afb56f', autoComplete: "off", class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: translate('Search countries'), ref: el => {
|
|
54
57
|
if (el) {
|
|
55
58
|
this.inputRef = el;
|
|
56
59
|
}
|
|
57
|
-
}, type: "text", value: this.inputValue }))), h("div", { key: '
|
|
60
|
+
}, type: "text", value: this.inputValue }))), h("div", { key: '365e7ae9464070080182bb4b83f232d0952eb9c8', class: "zonos--country-select-content" }, isEmpty && (h("zonos-text", { key: '025ae5379da4ef222c39544bee3b009bc3a3c7a4', class: "no-country", textColor: "gray-800" }, translate('No countries found'))), h("zonos-virtual-scroll", { key: '3ae131cb44d63bd239e3c90cbfcaf8535817c663', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index => {
|
|
58
61
|
const country = filteredCountries[index];
|
|
59
62
|
if (!country) {
|
|
60
63
|
return null;
|