@zonos/elements 1.3.26 → 1.3.27
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-7e817cad.js → cart-61caeb84.js} +280 -160
- package/dist/cjs/index.cjs.js +3 -54
- package/dist/cjs/{submitGtag-7e0065da.js → submitGtag-d3898668.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +58 -21
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +54 -20
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +14 -8
- package/dist/collection/components/store/translationStore/strings.base.js +14 -8
- package/dist/collection/components/store/translationStore/strings.chinese.js +14 -8
- package/dist/collection/components/store/translationStore/strings.danish.js +14 -8
- package/dist/collection/components/store/translationStore/strings.dutch.js +14 -8
- package/dist/collection/components/store/translationStore/strings.french.js +14 -8
- package/dist/collection/components/store/translationStore/strings.german.js +14 -8
- package/dist/collection/components/store/translationStore/strings.hebrew.js +14 -8
- package/dist/collection/components/store/translationStore/strings.indonesian.js +14 -8
- package/dist/collection/components/store/translationStore/strings.italian.js +14 -8
- package/dist/collection/components/store/translationStore/strings.japanese.js +14 -8
- package/dist/collection/components/store/translationStore/strings.korean.js +14 -8
- package/dist/collection/components/store/translationStore/strings.norwegian.js +14 -8
- package/dist/collection/components/store/translationStore/strings.polish.js +14 -8
- package/dist/collection/components/store/translationStore/strings.portuguese.js +14 -8
- package/dist/collection/components/store/translationStore/strings.russian.js +14 -8
- package/dist/collection/components/store/translationStore/strings.spanish.js +14 -8
- package/dist/collection/components/store/translationStore/strings.swedish.js +14 -8
- package/dist/collection/components/store/translationStore/strings.turkish.js +14 -8
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +14 -8
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/wrapStringWithLink.js +3 -0
- package/dist/collection/scripts/_zonosBase.js +0 -51
- package/dist/esm/{cart-13e6a811.js → cart-530a8750.js} +280 -160
- package/dist/esm/index.js +3 -54
- package/dist/esm/{submitGtag-c8bb6f2e.js → submitGtag-44ba0846.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +3 -3
- package/dist/esm/zonos-card_2.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +58 -21
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +2 -2
- package/dist/esm-es5/cart-530a8750.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{submitGtag-c8bb6f2e.js → submitGtag-44ba0846.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.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/scripts/index.d.ts +0 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +8 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.base.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.danish.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.french.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.german.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.italian.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.korean.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.polish.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.russian.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +13 -7
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +13 -7
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/wrapStringWithLink.d.ts +4 -0
- package/dist/types/scripts/_zonosBase.d.ts +0 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-094bfe56.system.entry.js +1 -0
- package/dist/zonos-elements/{p-60621085.entry.js → p-099e229a.entry.js} +1 -1
- package/dist/zonos-elements/{p-b88e52b5.entry.js → p-11f87d7d.entry.js} +1 -1
- package/dist/zonos-elements/{p-f7e2d33b.system.entry.js → p-18d04e89.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-492b8e12.entry.js → p-2a5a0bae.entry.js} +1 -1
- package/dist/zonos-elements/{p-e975b187.entry.js → p-35d00c30.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e488bff.entry.js → p-37685139.entry.js} +1 -1
- package/dist/zonos-elements/{p-452ed1a7.entry.js → p-4eaae82e.entry.js} +1 -1
- package/dist/zonos-elements/p-5d006b02.system.js +1 -0
- package/dist/zonos-elements/{p-eea8111c.system.entry.js → p-5f580c9b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-99da2348.entry.js → p-687dbccc.entry.js} +1 -1
- package/dist/zonos-elements/{p-a5d823d3.system.entry.js → p-68dfcd25.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3baf7a18.entry.js → p-6fe27968.entry.js} +1 -1
- package/dist/zonos-elements/{p-58edaab6.system.entry.js → p-7b5a0a18.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d3e61deb.system.entry.js → p-84f7a3a2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-43c1dd27.system.entry.js → p-a5704be4.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b4ccc72c.js +1 -0
- package/dist/zonos-elements/{p-eabe2abc.js → p-bb032c2f.js} +1 -1
- package/dist/zonos-elements/p-c4154737.system.js +1 -0
- package/dist/zonos-elements/{p-094c7343.system.entry.js → p-cbed004d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-089c3737.system.entry.js → p-e15ef12e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2011cb03.entry.js → p-e3978982.entry.js} +1 -1
- package/dist/zonos-elements/{p-cab01f64.system.entry.js → p-ecd994c8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fb1120a2.system.js +1 -0
- package/dist/zonos-elements/p-fb1b98a8.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-13e6a811.js +0 -1
- package/dist/zonos-elements/p-121be462.system.js +0 -1
- package/dist/zonos-elements/p-1f2077df.entry.js +0 -1
- package/dist/zonos-elements/p-74488e31.system.js +0 -1
- package/dist/zonos-elements/p-875a311d.js +0 -1
- package/dist/zonos-elements/p-d1771035.system.js +0 -1
- package/dist/zonos-elements/p-e80a5ed7.system.entry.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -236,8 +236,8 @@ const zonosLoadUrl = (() => {
|
|
|
236
236
|
}
|
|
237
237
|
return null;
|
|
238
238
|
})();
|
|
239
|
-
const ZONOS_URL = zonosLoadUrl || "https://v1.3.
|
|
240
|
-
const JS_DELIVR_ZONOS_URL = "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
239
|
+
const ZONOS_URL = zonosLoadUrl || "https://v1.3.27.js.zonos.com";
|
|
240
|
+
const JS_DELIVR_ZONOS_URL = "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.27";
|
|
241
241
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
242
242
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
243
243
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -256,7 +256,7 @@ Zonos.isBigCommerce = false;
|
|
|
256
256
|
*/
|
|
257
257
|
Zonos.isNpm = true;
|
|
258
258
|
Zonos.zonosQaUrl = null;
|
|
259
|
-
Zonos.version = `v${"1.3.
|
|
259
|
+
Zonos.version = `v${"1.3.27"}`;
|
|
260
260
|
Zonos.modeAlerted = false;
|
|
261
261
|
Zonos.tempCartData = null;
|
|
262
262
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -274,8 +274,6 @@ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSett
|
|
|
274
274
|
_a.zonosApiKey = zonosApiKey;
|
|
275
275
|
_a.storeId = storeId;
|
|
276
276
|
logError.log('init zonos');
|
|
277
|
-
// add sentry to the project
|
|
278
|
-
_a.injectSentryScript();
|
|
279
277
|
// inject zonos cdn
|
|
280
278
|
_a.injectZonosCdn();
|
|
281
279
|
// inject css for zonos elements
|
|
@@ -402,55 +400,6 @@ Zonos.injectController = ({ config, zonosApiKey, }) => {
|
|
|
402
400
|
_a.zonosController = zonosController;
|
|
403
401
|
logError.log('Zonos controller injected!');
|
|
404
402
|
};
|
|
405
|
-
Zonos.injectSentryScript = () => {
|
|
406
|
-
const scriptUrl = 'https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js';
|
|
407
|
-
const findScript = () => {
|
|
408
|
-
const script = document.querySelector(`script[src="${scriptUrl}"]`);
|
|
409
|
-
return !!script;
|
|
410
|
-
};
|
|
411
|
-
if (findScript()) {
|
|
412
|
-
logError.log('Sentry script already exists in the document', 'warn');
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
const headOrBody = document.head || document.body;
|
|
416
|
-
// init zonos elements when the zonosKey is valid
|
|
417
|
-
// inject esmodule cdn for zonos elements
|
|
418
|
-
const script = document.createElement('script');
|
|
419
|
-
script.crossOrigin = 'anonymous';
|
|
420
|
-
script.src = scriptUrl;
|
|
421
|
-
script.integrity =
|
|
422
|
-
'sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l';
|
|
423
|
-
script.setAttribute('data-lazy', 'no');
|
|
424
|
-
script.onerror = () => {
|
|
425
|
-
logError.logError(`Failed to load ${script.src}`);
|
|
426
|
-
};
|
|
427
|
-
script.onload = () => {
|
|
428
|
-
var _b;
|
|
429
|
-
(_b = window.Sentry) === null || _b === void 0 ? void 0 : _b.init({
|
|
430
|
-
beforeSend(event) {
|
|
431
|
-
var _b, _c, _d, _e, _f, _g;
|
|
432
|
-
// only send error to sentry if it's from zonos production
|
|
433
|
-
const firstExceptionFilename = (_g = (_f = (_e = (_d = (_c = (_b = event.exception) === null || _b === void 0 ? void 0 : _b.values) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.stacktrace) === null || _e === void 0 ? void 0 : _e.frames) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.filename;
|
|
434
|
-
const isZonosProduction = (firstExceptionFilename === null || firstExceptionFilename === void 0 ? void 0 : firstExceptionFilename.includes('js.zonos.com')) ||
|
|
435
|
-
(firstExceptionFilename === null || firstExceptionFilename === void 0 ? void 0 : firstExceptionFilename.includes('@zonos/elements'));
|
|
436
|
-
const isDevelopmentHref = window.location.href.includes('dev.elements') ||
|
|
437
|
-
window.location.href.includes('route.js.zonos.com');
|
|
438
|
-
// don't send error to sentry if the errors are in development href
|
|
439
|
-
if (isZonosProduction && !isDevelopmentHref) {
|
|
440
|
-
return event;
|
|
441
|
-
}
|
|
442
|
-
return null;
|
|
443
|
-
},
|
|
444
|
-
dsn: 'https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760',
|
|
445
|
-
ignoreErrors: ['Failed to load Stripe.js'],
|
|
446
|
-
release: `zonos-elements@${_a.version}`,
|
|
447
|
-
tracesSampler: () => {
|
|
448
|
-
return 0.01;
|
|
449
|
-
},
|
|
450
|
-
});
|
|
451
|
-
};
|
|
452
|
-
headOrBody.appendChild(script);
|
|
453
|
-
};
|
|
454
403
|
Zonos.injectScript = ({ fallBackDomain, isModule, scriptDomain, theRestUrl, }) => {
|
|
455
404
|
const fullScriptUrl = `${scriptDomain}/${theRestUrl}`;
|
|
456
405
|
const findScript = () => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const logError = require('./logError-4e2f2020.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -147,7 +147,7 @@ const ZonosAddress = class {
|
|
|
147
147
|
}
|
|
148
148
|
render() {
|
|
149
149
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
150
|
-
return (index.h(index.Host, { key: '
|
|
150
|
+
return (index.h(index.Host, { key: '5279ab1ec41882e2b47adbb9074da302caeda979', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: 'e66644c9dfbeb56c54b8914cecfba5cee3023399', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: 'a7ca990d5c5c5a59edd6d6bf35a4594fb8dfe5d4', class: "zonos--address-component" })));
|
|
151
151
|
}
|
|
152
152
|
get el() { return index.getElement(this); }
|
|
153
153
|
static get watchers() { return {
|
|
@@ -635,7 +635,7 @@ const ZonosLinkAuthentication = class {
|
|
|
635
635
|
}
|
|
636
636
|
render() {
|
|
637
637
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
638
|
-
return (index.h(index.Host, { key: '
|
|
638
|
+
return (index.h(index.Host, { key: '153724937e64d3fdf4360648cefc4548b602e87a', class: "zonos--link-authentication zonos--elements" }, index.h("zonos-text", { key: 'ac9896dff5fd7acb29d81eebeb9e65a47d65b7fb', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: 'aca720a9382f63f248e3a2c382e5c61e52750bdf', class: "zonos--link-authentication-component" })));
|
|
639
639
|
}
|
|
640
640
|
get el() { return index.getElement(this); }
|
|
641
641
|
static get watchers() { return {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-61caeb84.js');
|
|
9
9
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
10
10
|
require('./logError-4e2f2020.js');
|
|
11
11
|
require('./isDarkColor-371a3b1a.js');
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
9
|
-
const submitGtag = require('./submitGtag-
|
|
9
|
+
const submitGtag = require('./submitGtag-d3898668.js');
|
|
10
10
|
const getBorderRadius = require('./getBorderRadius-074b46ef.js');
|
|
11
11
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
12
12
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
|
-
const submitGtag = require('./submitGtag-
|
|
8
|
+
const submitGtag = require('./submitGtag-d3898668.js');
|
|
9
9
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
10
10
|
const logError = require('./logError-4e2f2020.js');
|
|
11
11
|
const classes = require('./classes-b7918f56.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const logError = require('./logError-4e2f2020.js');
|
|
9
9
|
require('./isDarkColor-371a3b1a.js');
|
|
@@ -296,7 +296,7 @@ const ZonosController = class {
|
|
|
296
296
|
zonosStore.zonosStore.organizationName = organizationName;
|
|
297
297
|
}
|
|
298
298
|
render() {
|
|
299
|
-
return index.h(index.Host, { key: '
|
|
299
|
+
return index.h(index.Host, { key: 'cfacd00a3f5fba372425ec51cf885356353ad909', class: "zonos--elements" });
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
302
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./logError-4e2f2020.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-371a3b1a.js');
|
|
@@ -1883,9 +1883,9 @@ const ZonosHelloDialogFooter = class {
|
|
|
1883
1883
|
const language = (_b = ILanguage.languages.find(x => x.code === cart.localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
1884
1884
|
// Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
|
|
1885
1885
|
const mainColor = primaryColor && isDarkColor.isDarkColor(primaryColor) ? 'white' : 'black';
|
|
1886
|
-
return (index.h(index.Host, { key: '
|
|
1886
|
+
return (index.h(index.Host, { key: 'fe8165b23a8e56d068d00ae0f6caf587094db24f', class: "zonos--elements" }, index.h("div", { key: '32ee04554a36a2d7017e73425166a914e1e65714', class: "zonos--hello-dialog-footer", style: {
|
|
1887
1887
|
'--primary-color': primaryColor,
|
|
1888
|
-
} }, index.h("a", { key: '
|
|
1888
|
+
} }, index.h("a", { key: '9fe05913fae1b739ec763ba32128f9004e3015f5', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, index.h("zonos-icon", { key: 'ebea8cf3264c8d75369e1f87a71e97530755f79b', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), index.h("div", { key: '133b9a19a6e1cfc69fa4bf93964307ae546aead6', class: "zonos--hello-locale-wrapper" }, index.h("zonos-button", { key: 'f5f5b8e8750fdf81094caa496b37b6201addab4a', buttonColor: mainColor, icon: index.h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), index.h("zonos-button", { key: '454ef914ec4f5d9c4ffa7fdafb91dc25a27221b9', buttonColor: mainColor, icon: index.h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: cart.localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, cart.localizationStore.selectedCountryCode)))));
|
|
1889
1889
|
}
|
|
1890
1890
|
get ele() { return index.getElement(this); }
|
|
1891
1891
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -19,6 +19,10 @@ const getHasMoreSpaceAbove = (ref) => {
|
|
|
19
19
|
return availableSpaceAbove >= availableSpaceBelow;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
const wrapStringWithLink = ({ href, text, }) => {
|
|
23
|
+
return `<zonos-link href="${href}" target="_blank" rel="noopener noreferrer">${text}</zonos-link>`;
|
|
24
|
+
};
|
|
25
|
+
|
|
22
26
|
const BagIcon = `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">
|
|
23
27
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>
|
|
24
28
|
</svg>
|
|
@@ -74,6 +78,23 @@ const ZonosHelloDialog = class {
|
|
|
74
78
|
this.setShowLanguageSelect = async (value) => {
|
|
75
79
|
this.showLanguageSelect = value;
|
|
76
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Store has tax id setup in Zonos settings
|
|
83
|
+
*/
|
|
84
|
+
this.hasTaxId = () => {
|
|
85
|
+
var _a;
|
|
86
|
+
return (_a = cart.localizationStore.countryLandedCost) === null || _a === void 0 ? void 0 : _a.hasTaxId;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Some countries don't have threshold. So we need to show generic message for them
|
|
90
|
+
*/
|
|
91
|
+
this.isNoThresholdCountry = (countryCode) => {
|
|
92
|
+
// Only show threshold message if store doesn't have tax id in the settings
|
|
93
|
+
if (!countryCode || !this.hasTaxId()) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
return ['AU'].includes(countryCode);
|
|
97
|
+
};
|
|
77
98
|
this.getDutyMessage = () => {
|
|
78
99
|
const { countryLandedCost } = cart.localizationStore;
|
|
79
100
|
// Our Robby API spells deminimis wrong here
|
|
@@ -81,8 +102,11 @@ const ZonosHelloDialog = class {
|
|
|
81
102
|
? cart.currencyFormat({ amount: countryLandedCost.dutyDeminimus })
|
|
82
103
|
: null;
|
|
83
104
|
// If deminimis is undefined or null, assume it's $0
|
|
84
|
-
return dutyDeminimis
|
|
85
|
-
|
|
105
|
+
return dutyDeminimis &&
|
|
106
|
+
!this.isNoThresholdCountry(countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.countryCode)
|
|
107
|
+
? cart.translate('Spend [threshold] duty free', {
|
|
108
|
+
threshold: dutyDeminimis,
|
|
109
|
+
})
|
|
86
110
|
: cart.translate('Duties will apply to all orders');
|
|
87
111
|
};
|
|
88
112
|
this.getTaxMessage = () => {
|
|
@@ -91,8 +115,11 @@ const ZonosHelloDialog = class {
|
|
|
91
115
|
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
92
116
|
? cart.currencyFormat({ amount: countryLandedCost.vatTaxDeminimus })
|
|
93
117
|
: null;
|
|
94
|
-
return taxDeminimis
|
|
95
|
-
|
|
118
|
+
return taxDeminimis &&
|
|
119
|
+
!this.isNoThresholdCountry(countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.countryCode)
|
|
120
|
+
? cart.translate('Spend [threshold] tax free', {
|
|
121
|
+
threshold: taxDeminimis,
|
|
122
|
+
})
|
|
96
123
|
: cart.translate('Taxes will apply to all orders');
|
|
97
124
|
};
|
|
98
125
|
this.getUkDutyTaxMessage = (landedCost) => {
|
|
@@ -101,22 +128,31 @@ const ZonosHelloDialog = class {
|
|
|
101
128
|
return null;
|
|
102
129
|
}
|
|
103
130
|
const dutyDeminimis = landedCost.dutyDeminimus;
|
|
104
|
-
return
|
|
105
|
-
countryName
|
|
106
|
-
|
|
107
|
-
|
|
131
|
+
return [
|
|
132
|
+
cart.translate('Orders to [countryName] must be over [threshold] to ship.', {
|
|
133
|
+
countryName: 'United Kingdom',
|
|
134
|
+
threshold: cart.currencyFormat({ amount: dutyDeminimis }),
|
|
135
|
+
}),
|
|
136
|
+
];
|
|
108
137
|
};
|
|
109
138
|
this.getAustraliaDutyTaxMessage = (landedCost) => {
|
|
110
|
-
return
|
|
111
|
-
percentage
|
|
112
|
-
|
|
113
|
-
|
|
139
|
+
return [
|
|
140
|
+
cart.translate('Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders', {
|
|
141
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
142
|
+
}),
|
|
143
|
+
`${cart.translate('The low-value GST law passed July 1st, 2018 applies to this retailer.')} ${wrapStringWithLink({
|
|
144
|
+
href: 'https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst',
|
|
145
|
+
text: cart.translate('Learn more.'),
|
|
146
|
+
})}`,
|
|
147
|
+
];
|
|
114
148
|
};
|
|
115
149
|
this.getNewZealandDutyTaxMessge = (landedCost) => {
|
|
116
|
-
return
|
|
117
|
-
percentage
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
return [
|
|
151
|
+
cart.translate('[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.', {
|
|
152
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
153
|
+
threshold: cart.currencyFormat({ amount: landedCost.vatTaxDeminimus }),
|
|
154
|
+
}),
|
|
155
|
+
];
|
|
120
156
|
};
|
|
121
157
|
/**
|
|
122
158
|
* Get additional duty tax message if selected country has tax id
|
|
@@ -126,7 +162,7 @@ const ZonosHelloDialog = class {
|
|
|
126
162
|
return null;
|
|
127
163
|
}
|
|
128
164
|
// only show the message if the store has a tax id for selected country
|
|
129
|
-
if (!
|
|
165
|
+
if (!this.hasTaxId()) {
|
|
130
166
|
return null;
|
|
131
167
|
}
|
|
132
168
|
switch (cart.localizationStore.countryLandedCost.countryCode) {
|
|
@@ -181,17 +217,18 @@ const ZonosHelloDialog = class {
|
|
|
181
217
|
const defaultMessage = formatStringWithLinks.formatStringWithLinks(defaultMessageStr);
|
|
182
218
|
const currentPage = this.getCurrentPageEnum();
|
|
183
219
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
184
|
-
return (index.h(index.Host, { key: '
|
|
220
|
+
return (index.h(index.Host, { key: 'bb2b080aaba7b85599b7e6bcb7cabee70863070f', class: "zonos--elements" }, index.h("div", { key: 'aabdbd8c4b47f759396d1a56fac426570385768d', "aria-hidden": "true", class: classes.classes([
|
|
185
221
|
'zonos--hello-dialog',
|
|
186
222
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
187
223
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
188
224
|
!!this.mobileLocationOverride &&
|
|
189
225
|
'zonos--hello-dialog-mobile-override',
|
|
190
226
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
191
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: '
|
|
227
|
+
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: 'd9189f1ced79d3d3fd11c99ea1407e7b83a2573b' }, index.h("div", { key: '83ac2ab3583935ececea8be98ab64559d802725a', class: "zonos--hello-dialog-content" }, index.h("zonos-button", { key: '4f36dea145e751d63a2d0df3f472ffe674fbb580', 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: 'e8a7cebe4ca88da80b974e3a3536714fe4da47c1', spacing: 24 }, index.h("zonos-country-flag", { key: 'e02c72135b9c7e9e533fc46c8f4b286ba1cb1b63', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), index.h("zonos-v-stack", { key: '7d199c0a5f465fe1640e690d2712f11a80e1f378', class: "zonos--hello-dialog-header", spacing: 4 }, index.h("zonos-text", { key: '97bf6611bd485ace8ad9b94c3520148ae0d1eab0', type: "boldSubheader" }, welcomeMessage), index.h("zonos-text", { key: 'c1e524bf689f34aed978f350676ffa957724176f', innerHTML: defaultMessage, textColor: "gray-800" })), index.h("zonos-v-stack", { key: '81a2fabb2f6c2d853f2f6619f7c6829754d80a59', spacing: 8 }, this.restrictedItems.map(item => {
|
|
192
228
|
var _a;
|
|
193
229
|
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)))));
|
|
194
|
-
}), index.h("zonos-card", { key: '
|
|
230
|
+
}), index.h("zonos-card", { key: '29ba8b81746a696ca43b88daa89a7c85af5a2b34', spacing: "12px" }, index.h("zonos-v-stack", { key: '8f4e79efe07a4c7c1b493178c952bfe61a151f0c', spacing: 12 }, index.h("div", { key: 'a17eda2b103d376f7ca8a9b528d613195b3a1fe7', class: "zonos--flex-message" }, index.h("zonos-icon", { key: '13c828d956198211a1fbda77840f8b91692d1582', "aria-label": "Duty de minimis", content: ImportIcon }), index.h("zonos-text", { key: 'c38511e16905f169b821d0cd8d98dee80a7c1de1' }, dutyDeMinimisMessage)), index.h("div", { key: '9b3165d870419732d4be1421336326f8d4e98547', class: "zonos--flex-message" }, index.h("zonos-icon", { key: '46248b95b97a3ec74ffc038dda29ca74a1e700c2', "aria-label": "Tax de minimis", content: MoneyIcon }), index.h("zonos-text", { key: '1d698d83f9fa43746de870553d1ba1c09389aefb' }, taxDeMinimisMessage)), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
231
|
+
additionalInformation.map(info => (index.h("div", { class: "zonos--flex-message" }, index.h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), index.h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (index.h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), index.h("zonos-hello-dialog-footer", { key: 'fcc21cc1e8b3de45af03c64ffc95dc2ab6f57bf3', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (index.h("div", { key: 'bbf019b27e6da7aa3256f14bf928aae26ca92f54' }, index.h("zonos-country-select", { key: 'a70d55e1872ec626e8446866dbad3aafca69790c', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (index.h("div", { key: '77f63941fcbb3bc0c668a61aa48ca2e60b8addeb' }, index.h("zonos-language-select", { key: '57a4d06c098662b00c3587f3b2290552dc04f2fe', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
195
232
|
}
|
|
196
233
|
static get assetsDirs() { return ["assets"]; }
|
|
197
234
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-61caeb84.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const logError = require('./logError-4e2f2020.js');
|
|
10
10
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b071017b.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-61caeb84.js');
|
|
7
7
|
const logError = require('./logError-4e2f2020.js');
|
|
8
8
|
require('./zonosStore-4c6c85da.js');
|
|
9
9
|
require('./isDarkColor-371a3b1a.js');
|
|
@@ -45,7 +45,7 @@ const ZonosPayment = class {
|
|
|
45
45
|
}
|
|
46
46
|
render() {
|
|
47
47
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
48
|
-
return (index.h(index.Host, { key: '
|
|
48
|
+
return (index.h(index.Host, { key: 'abebca876eac8bd507fcbdb1c029d2ed0f3b749a', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: '142257f2052337206dbb70e70c87b5207f2bd97a', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: 'c55bbaea79a291e45d8ed37d556529365de89e9f', class: "zonos--payment-component" })));
|
|
49
49
|
}
|
|
50
50
|
get el() { return index.getElement(this); }
|
|
51
51
|
static get watchers() { return {
|
|
@@ -18,9 +18,9 @@ export class ZonosHelloDialogFooter {
|
|
|
18
18
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
19
19
|
// Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
|
|
20
20
|
const mainColor = primaryColor && isDarkColor(primaryColor) ? 'white' : 'black';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'fe8165b23a8e56d068d00ae0f6caf587094db24f', class: "zonos--elements" }, h("div", { key: '32ee04554a36a2d7017e73425166a914e1e65714', class: "zonos--hello-dialog-footer", style: {
|
|
22
22
|
'--primary-color': primaryColor,
|
|
23
|
-
} }, h("a", { key: '
|
|
23
|
+
} }, h("a", { key: '9fe05913fae1b739ec763ba32128f9004e3015f5', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'ebea8cf3264c8d75369e1f87a71e97530755f79b', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: '133b9a19a6e1cfc69fa4bf93964307ae546aead6', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: 'f5f5b8e8750fdf81094caa496b37b6201addab4a', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: '454ef914ec4f5d9c4ffa7fdafb91dc25a27221b9', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,6 +7,7 @@ import { formatStringWithLinks } from "../../utils/formatStringWithLinks";
|
|
|
7
7
|
import { currencyFormat } from "../../utils/hello/currencyConversion/currencyFormat";
|
|
8
8
|
import { getHasMoreSpaceAbove } from "../../utils/hello/getHasMoreSpaceAbove";
|
|
9
9
|
import { getHasMoreSpaceOnRight } from "../../utils/hello/getHasMoreSpaceOnRight";
|
|
10
|
+
import { wrapStringWithLink } from "../../utils/wrapStringWithLink";
|
|
10
11
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
11
12
|
import BagIcon from "./assets/bagIcon.svg";
|
|
12
13
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
@@ -44,6 +45,23 @@ export class ZonosHelloDialog {
|
|
|
44
45
|
this.setShowLanguageSelect = async (value) => {
|
|
45
46
|
this.showLanguageSelect = value;
|
|
46
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* Store has tax id setup in Zonos settings
|
|
50
|
+
*/
|
|
51
|
+
this.hasTaxId = () => {
|
|
52
|
+
var _a;
|
|
53
|
+
return (_a = localizationStore.countryLandedCost) === null || _a === void 0 ? void 0 : _a.hasTaxId;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Some countries don't have threshold. So we need to show generic message for them
|
|
57
|
+
*/
|
|
58
|
+
this.isNoThresholdCountry = (countryCode) => {
|
|
59
|
+
// Only show threshold message if store doesn't have tax id in the settings
|
|
60
|
+
if (!countryCode || !this.hasTaxId()) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return ['AU'].includes(countryCode);
|
|
64
|
+
};
|
|
47
65
|
this.getDutyMessage = () => {
|
|
48
66
|
const { countryLandedCost } = localizationStore;
|
|
49
67
|
// Our Robby API spells deminimis wrong here
|
|
@@ -51,8 +69,11 @@ export class ZonosHelloDialog {
|
|
|
51
69
|
? currencyFormat({ amount: countryLandedCost.dutyDeminimus })
|
|
52
70
|
: null;
|
|
53
71
|
// If deminimis is undefined or null, assume it's $0
|
|
54
|
-
return dutyDeminimis
|
|
55
|
-
?
|
|
72
|
+
return dutyDeminimis &&
|
|
73
|
+
!this.isNoThresholdCountry(countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.countryCode)
|
|
74
|
+
? translate('Spend [threshold] duty free', {
|
|
75
|
+
threshold: dutyDeminimis,
|
|
76
|
+
})
|
|
56
77
|
: translate('Duties will apply to all orders');
|
|
57
78
|
};
|
|
58
79
|
this.getTaxMessage = () => {
|
|
@@ -61,8 +82,11 @@ export class ZonosHelloDialog {
|
|
|
61
82
|
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
62
83
|
? currencyFormat({ amount: countryLandedCost.vatTaxDeminimus })
|
|
63
84
|
: null;
|
|
64
|
-
return taxDeminimis
|
|
65
|
-
?
|
|
85
|
+
return taxDeminimis &&
|
|
86
|
+
!this.isNoThresholdCountry(countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.countryCode)
|
|
87
|
+
? translate('Spend [threshold] tax free', {
|
|
88
|
+
threshold: taxDeminimis,
|
|
89
|
+
})
|
|
66
90
|
: translate('Taxes will apply to all orders');
|
|
67
91
|
};
|
|
68
92
|
this.getUkDutyTaxMessage = (landedCost) => {
|
|
@@ -71,22 +95,31 @@ export class ZonosHelloDialog {
|
|
|
71
95
|
return null;
|
|
72
96
|
}
|
|
73
97
|
const dutyDeminimis = landedCost.dutyDeminimus;
|
|
74
|
-
return
|
|
75
|
-
countryName
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
return [
|
|
99
|
+
translate('Orders to [countryName] must be over [threshold] to ship.', {
|
|
100
|
+
countryName: 'United Kingdom',
|
|
101
|
+
threshold: currencyFormat({ amount: dutyDeminimis }),
|
|
102
|
+
}),
|
|
103
|
+
];
|
|
78
104
|
};
|
|
79
105
|
this.getAustraliaDutyTaxMessage = (landedCost) => {
|
|
80
|
-
return
|
|
81
|
-
percentage
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
return [
|
|
107
|
+
translate('Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders', {
|
|
108
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
109
|
+
}),
|
|
110
|
+
`${translate('The low-value GST law passed July 1st, 2018 applies to this retailer.')} ${wrapStringWithLink({
|
|
111
|
+
href: 'https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst',
|
|
112
|
+
text: translate('Learn more.'),
|
|
113
|
+
})}`,
|
|
114
|
+
];
|
|
84
115
|
};
|
|
85
116
|
this.getNewZealandDutyTaxMessge = (landedCost) => {
|
|
86
|
-
return
|
|
87
|
-
percentage
|
|
88
|
-
|
|
89
|
-
|
|
117
|
+
return [
|
|
118
|
+
translate('[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.', {
|
|
119
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
120
|
+
threshold: currencyFormat({ amount: landedCost.vatTaxDeminimus }),
|
|
121
|
+
}),
|
|
122
|
+
];
|
|
90
123
|
};
|
|
91
124
|
/**
|
|
92
125
|
* Get additional duty tax message if selected country has tax id
|
|
@@ -96,7 +129,7 @@ export class ZonosHelloDialog {
|
|
|
96
129
|
return null;
|
|
97
130
|
}
|
|
98
131
|
// only show the message if the store has a tax id for selected country
|
|
99
|
-
if (!
|
|
132
|
+
if (!this.hasTaxId()) {
|
|
100
133
|
return null;
|
|
101
134
|
}
|
|
102
135
|
switch (localizationStore.countryLandedCost.countryCode) {
|
|
@@ -151,17 +184,18 @@ export class ZonosHelloDialog {
|
|
|
151
184
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
152
185
|
const currentPage = this.getCurrentPageEnum();
|
|
153
186
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
154
|
-
return (h(Host, { key: '
|
|
187
|
+
return (h(Host, { key: 'bb2b080aaba7b85599b7e6bcb7cabee70863070f', class: "zonos--elements" }, h("div", { key: 'aabdbd8c4b47f759396d1a56fac426570385768d', "aria-hidden": "true", class: classes([
|
|
155
188
|
'zonos--hello-dialog',
|
|
156
189
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
157
190
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
158
191
|
!!this.mobileLocationOverride &&
|
|
159
192
|
'zonos--hello-dialog-mobile-override',
|
|
160
193
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
161
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '
|
|
194
|
+
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: 'd9189f1ced79d3d3fd11c99ea1407e7b83a2573b' }, h("div", { key: '83ac2ab3583935ececea8be98ab64559d802725a', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '4f36dea145e751d63a2d0df3f472ffe674fbb580', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: 'e8a7cebe4ca88da80b974e3a3536714fe4da47c1', spacing: 24 }, h("zonos-country-flag", { key: 'e02c72135b9c7e9e533fc46c8f4b286ba1cb1b63', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: '7d199c0a5f465fe1640e690d2712f11a80e1f378', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: '97bf6611bd485ace8ad9b94c3520148ae0d1eab0', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: 'c1e524bf689f34aed978f350676ffa957724176f', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: '81a2fabb2f6c2d853f2f6619f7c6829754d80a59', spacing: 8 }, this.restrictedItems.map(item => {
|
|
162
195
|
var _a;
|
|
163
196
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
164
|
-
}), h("zonos-card", { key: '
|
|
197
|
+
}), h("zonos-card", { key: '29ba8b81746a696ca43b88daa89a7c85af5a2b34', spacing: "12px" }, h("zonos-v-stack", { key: '8f4e79efe07a4c7c1b493178c952bfe61a151f0c', spacing: 12 }, h("div", { key: 'a17eda2b103d376f7ca8a9b528d613195b3a1fe7', class: "zonos--flex-message" }, h("zonos-icon", { key: '13c828d956198211a1fbda77840f8b91692d1582', "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", { key: 'c38511e16905f169b821d0cd8d98dee80a7c1de1' }, dutyDeMinimisMessage)), h("div", { key: '9b3165d870419732d4be1421336326f8d4e98547', class: "zonos--flex-message" }, h("zonos-icon", { key: '46248b95b97a3ec74ffc038dda29ca74a1e700c2', "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", { key: '1d698d83f9fa43746de870553d1ba1c09389aefb' }, taxDeMinimisMessage)), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
198
|
+
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: 'fcc21cc1e8b3de45af03c64ffc95dc2ab6f57bf3', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: 'bbf019b27e6da7aa3256f14bf928aae26ca92f54' }, h("zonos-country-select", { key: 'a70d55e1872ec626e8446866dbad3aafca69790c', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: '77f63941fcbb3bc0c668a61aa48ca2e60b8addeb' }, h("zonos-language-select", { key: '57a4d06c098662b00c3587f3b2290552dc04f2fe', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
165
199
|
}
|
|
166
200
|
static get is() { return "zonos-hello-dialog"; }
|
|
167
201
|
static get encapsulation() { return "shadow"; }
|
|
@@ -178,7 +178,7 @@ export class ZonosController {
|
|
|
178
178
|
zonosStore.organizationName = organizationName;
|
|
179
179
|
}
|
|
180
180
|
render() {
|
|
181
|
-
return h(Host, { key: '
|
|
181
|
+
return h(Host, { key: 'cfacd00a3f5fba372425ec51cf885356353ad909', class: "zonos--elements" });
|
|
182
182
|
}
|
|
183
183
|
static get is() { return "zonos-controller"; }
|
|
184
184
|
static get encapsulation() { return "shadow"; }
|