@zonos/elements 1.3.12-alpha.1 → 1.3.12-alpha.10
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-fcddc0e6.js → cart-37e23be9.js} +739 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sendErrorLog-7b3d82e4.js +29 -0
- package/dist/cjs/{submitGtag-ec6ead54.js → submitGtag-d0718b63.js} +1 -20
- package/dist/cjs/zonos-address_4.cjs.entry.js +41 -17
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +8 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +7 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +90 -26
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/importIcon.svg +4 -0
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +85 -25
- package/dist/collection/components/store/translationStore/strings.arabic.js +36 -0
- package/dist/collection/components/store/translationStore/strings.base.js +36 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +36 -0
- package/dist/collection/components/store/translationStore/strings.french.js +36 -0
- package/dist/collection/components/store/translationStore/strings.german.js +36 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +36 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -0
- package/dist/collection/components/store/translationStore.js +19 -3
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +41 -15
- package/dist/collection/components/utils/logging/getNavigatorConnection.js +16 -0
- package/dist/collection/components/utils/logging/sendLoadScriptLog.js +16 -0
- package/dist/collection/types/LogLoadScriptRequestBody.js +1 -0
- package/dist/collection/types/generated/graphql.customer.types.js +64 -14
- package/dist/collection/types/generated/graphql.frontend.types.js +4 -0
- package/dist/components/sendErrorLog.js +21 -0
- package/dist/components/stripe.js +740 -4
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/zonos-address2.js +41 -15
- package/dist/components/zonos-checkout-finish2.js +3 -20
- package/dist/components/zonos-checkout.js +3 -2
- package/dist/components/zonos-controller.js +1 -1
- package/dist/components/zonos-hello-dialog2.js +89 -25
- package/dist/components/zonos-hello.js +1 -1
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/esm/{cart-228e1ef7.js → cart-7961927b.js} +739 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sendErrorLog-4d9581da.js +26 -0
- package/dist/esm/{submitGtag-c3727595.js → submitGtag-4c1f09dc.js} +2 -20
- package/dist/esm/zonos-address_4.entry.js +40 -16
- package/dist/esm/zonos-card_2.entry.js +1 -1
- package/dist/esm/zonos-cart-items_10.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.entry.js +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +90 -26
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/cart-7961927b.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/sendErrorLog-4d9581da.js +1 -0
- package/dist/esm-es5/submitGtag-4c1f09dc.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.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/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +36 -0
- package/dist/types/components/store/translationStore.d.ts +24 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +7 -1
- package/dist/types/components/utils/api/getCountryLandedCost.d.ts +10 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/logging/getNavigatorConnection.d.ts +8 -0
- package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +4 -0
- package/dist/types/types/LogLoadScriptRequestBody.d.ts +12 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +91 -18
- package/dist/types/types/generated/graphql.customer.types.ts +132 -22
- package/dist/types/types/generated/graphql.frontend.types.d.ts +13 -3
- package/dist/types/types/generated/graphql.frontend.types.ts +23 -3
- package/dist/types/types/global.d.ts +1 -2
- package/dist/zonos-elements/assets/importIcon.svg +4 -0
- package/dist/zonos-elements/p-0bdac452.system.js +1 -0
- package/dist/zonos-elements/p-0c5d3595.js +1 -0
- package/dist/zonos-elements/{p-5d5c0fbf.entry.js → p-2191b884.entry.js} +1 -1
- package/dist/zonos-elements/{p-0082c5be.system.entry.js → p-2da8e12a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-67ff446b.system.entry.js → p-339c505b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac5aecca.entry.js → p-33f5634a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5f662cf2.entry.js → p-3eb402c8.entry.js} +1 -1
- package/dist/zonos-elements/p-431648d8.system.entry.js +1 -0
- package/dist/zonos-elements/p-44842b39.system.entry.js +1 -0
- package/dist/zonos-elements/{p-14a2824f.entry.js → p-44f4dd4b.entry.js} +1 -1
- package/dist/zonos-elements/{p-35c328ba.system.entry.js → p-4b3923d2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-30cd191f.entry.js → p-4eba3abe.entry.js} +1 -1
- package/dist/zonos-elements/p-5a3ceb49.entry.js +1 -0
- package/dist/zonos-elements/p-63775f6d.js +1 -0
- package/dist/zonos-elements/p-6e81adba.system.js +1 -1
- package/dist/zonos-elements/{p-5f6f0581.system.entry.js → p-7efb9c12.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5dbb80df.system.entry.js → p-8eb876e8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a6c9c505.system.js +1 -0
- package/dist/zonos-elements/{p-c815e8b4.system.entry.js → p-bdb72353.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-499d7f5d.system.entry.js → p-d6aa3011.system.entry.js} +1 -1
- package/dist/zonos-elements/p-dd4f3724.system.js +1 -0
- package/dist/zonos-elements/{p-925ae524.entry.js → p-e1796e2a.entry.js} +1 -1
- package/dist/zonos-elements/{p-db1adc42.entry.js → p-e4919505.entry.js} +1 -1
- package/dist/zonos-elements/p-e4be7bd8.js +1 -0
- package/dist/zonos-elements/{p-7ff3a533.system.entry.js → p-e5fd850c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e90e2126.entry.js +1 -0
- package/dist/zonos-elements/{p-11f1b5fb.entry.js → p-f0b5d2fb.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +0 -8
- package/dist/esm/isCheckoutMobile-8846dccb.js +0 -6
- package/dist/esm-es5/cart-228e1ef7.js +0 -1
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +0 -1
- package/dist/esm-es5/submitGtag-c3727595.js +0 -1
- package/dist/zonos-elements/p-0679e872.system.entry.js +0 -1
- package/dist/zonos-elements/p-09dbb0e9.entry.js +0 -1
- package/dist/zonos-elements/p-55940b5a.system.entry.js +0 -1
- package/dist/zonos-elements/p-770e5b9e.js +0 -1
- package/dist/zonos-elements/p-81a54668.js +0 -1
- package/dist/zonos-elements/p-94bbf247.system.js +0 -1
- package/dist/zonos-elements/p-960e4021.system.js +0 -1
- package/dist/zonos-elements/p-aed0098c.system.js +0 -1
- package/dist/zonos-elements/p-d11b2449.js +0 -1
- package/dist/zonos-elements/p-d31e5fcc.entry.js +0 -1
|
@@ -2,6 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { s as stripeStore, l as logError, a as localizationStore, t as translate } from './stripe.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore.js';
|
|
4
4
|
import { i as isCheckoutMobile } from './isCheckoutMobile.js';
|
|
5
|
+
import { s as sendErrorLog } from './sendErrorLog.js';
|
|
5
6
|
import { d as defineCustomElement$2 } from './zonos-banner2.js';
|
|
6
7
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
7
8
|
|
|
@@ -26,6 +27,15 @@ const containsNonLatinChars = (params) => {
|
|
|
26
27
|
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:var(--amino-space-8)}";
|
|
27
28
|
const ZonosAddressStyle0 = zonosAddressCss;
|
|
28
29
|
|
|
30
|
+
const mappedFields = {
|
|
31
|
+
city: 'City',
|
|
32
|
+
country: 'Country',
|
|
33
|
+
line1: 'Address line 1',
|
|
34
|
+
line2: 'Address line 2',
|
|
35
|
+
name: 'Name',
|
|
36
|
+
postal_code: 'Postal code',
|
|
37
|
+
state: 'State',
|
|
38
|
+
};
|
|
29
39
|
const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends HTMLElement {
|
|
30
40
|
constructor() {
|
|
31
41
|
super();
|
|
@@ -35,7 +45,8 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
35
45
|
this.titleText = undefined;
|
|
36
46
|
this.defaultAddress = null;
|
|
37
47
|
this.stripe = window.Zonos.stripe;
|
|
38
|
-
this.
|
|
48
|
+
this.reportedInvalidCharacters = false;
|
|
49
|
+
this.invalidCharacterList = null;
|
|
39
50
|
this.isDirtyAddress = false;
|
|
40
51
|
}
|
|
41
52
|
getStripeAddressInstance() {
|
|
@@ -61,13 +72,9 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
61
72
|
stripeStore.stripeAddressEventData = event;
|
|
62
73
|
break;
|
|
63
74
|
}
|
|
64
|
-
const
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
if (hasInvalidCharacters) {
|
|
68
|
-
// no need to prefetch landed cost if the address contains invalid characters
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
75
|
+
const invalidCharacterList = this.checkInvalidCharacters(event);
|
|
76
|
+
this.invalidCharacterList = invalidCharacterList;
|
|
77
|
+
this.invalidCharacters.emit(!!invalidCharacterList);
|
|
71
78
|
}
|
|
72
79
|
updateAddressElement({ stripeAddressElement, type, }) {
|
|
73
80
|
if (type === 'shipping') {
|
|
@@ -80,7 +87,7 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
80
87
|
// Do nothing if the allowed character sets is ALL or the address is incomplete
|
|
81
88
|
if (!address.complete ||
|
|
82
89
|
zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
|
|
83
|
-
return
|
|
90
|
+
return null;
|
|
84
91
|
}
|
|
85
92
|
const { address: addressValue, firstName, lastName, name } = address.value;
|
|
86
93
|
const { city, country, line1, line2, postal_code, state } = addressValue;
|
|
@@ -93,11 +100,29 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
93
100
|
postal_code,
|
|
94
101
|
state,
|
|
95
102
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
if (!Object.keys(invalidList).length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
// send error event only once so we know what value is invalid
|
|
107
|
+
if (!this.reportedInvalidCharacters) {
|
|
108
|
+
this.reportedInvalidCharacters = true;
|
|
109
|
+
void sendErrorLog({
|
|
110
|
+
endpoint: 'NonLatinInput',
|
|
111
|
+
errors: Object.keys(invalidList).map(fieldName => {
|
|
112
|
+
var _a;
|
|
113
|
+
if (fieldName !== 'name') {
|
|
114
|
+
// trim all number so we don't send sensitive information
|
|
115
|
+
const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
|
|
116
|
+
return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
|
|
117
|
+
}
|
|
118
|
+
const customerName = name || `${firstName} ${lastName}`;
|
|
119
|
+
const trimmedName = customerName.replace(/[\d\w]+/g, '');
|
|
120
|
+
return `Invalid character found ${fieldName}: "${trimmedName}"`;
|
|
121
|
+
}),
|
|
122
|
+
metadata: {},
|
|
123
|
+
});
|
|
99
124
|
}
|
|
100
|
-
return
|
|
125
|
+
return invalidList;
|
|
101
126
|
}
|
|
102
127
|
async watchInitStripe() {
|
|
103
128
|
var _a, _b;
|
|
@@ -196,7 +221,7 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
196
221
|
}
|
|
197
222
|
render() {
|
|
198
223
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
199
|
-
return (h(Host, { key: '
|
|
224
|
+
return (h(Host, { key: 'b1ad2f6c9c23e6411bf1adccdd34b3aa4f5250b1', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '786a733a44925a670393b72bf0ae3db5ba59f9a1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'b9d58cbc17abf5daf5d13ffdebc7485c3ac6457d', class: "zonos--address-component" }), this.invalidCharacterList && (h("zonos-banner", { bannerTitle: translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (h("zonos-text", null, `- ${translate(mappedFields[fieldName])}: ${translate('only supports Latin characters (A-Z, a-z)')}`)))))));
|
|
200
225
|
}
|
|
201
226
|
get el() { return this; }
|
|
202
227
|
static get watchers() { return {
|
|
@@ -208,7 +233,8 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
|
|
|
208
233
|
"titleText": [1, "title-text"],
|
|
209
234
|
"defaultAddress": [16],
|
|
210
235
|
"stripe": [32],
|
|
211
|
-
"
|
|
236
|
+
"reportedInvalidCharacters": [32],
|
|
237
|
+
"invalidCharacterList": [32],
|
|
212
238
|
"isDirtyAddress": [32]
|
|
213
239
|
}, undefined, {
|
|
214
240
|
"stripe": ["watchInitStripe"]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { h as handleFetch, r as stripeStoreReset, c as cartStore, s as stripeStore, u as stripeStoreRetrievePayment, t as translate } from './stripe.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore.js';
|
|
4
4
|
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
5
5
|
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
6
|
+
import { s as sendErrorLog } from './sendErrorLog.js';
|
|
6
7
|
import { s as submitGtag } from './submitGtag.js';
|
|
7
8
|
import { d as defineCustomElement$4 } from './zonos-button2.js';
|
|
8
9
|
import { d as defineCustomElement$3 } from './zonos-icon2.js';
|
|
@@ -19,24 +20,6 @@ const createCustomEvent = (eventName, detail) => {
|
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
const sendErrorLog = async ({ endpoint, errors, metadata }) => {
|
|
23
|
-
const userAgentData = 'userAgentData' in window.navigator
|
|
24
|
-
? // userAgentData is not yet supported in all browsers
|
|
25
|
-
window.navigator.userAgentData
|
|
26
|
-
: null;
|
|
27
|
-
const errorObject = {
|
|
28
|
-
endpoint,
|
|
29
|
-
errors,
|
|
30
|
-
metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
|
|
31
|
-
? userAgentData
|
|
32
|
-
: window.navigator.userAgent }, metadata),
|
|
33
|
-
};
|
|
34
|
-
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
35
|
-
body: errorObject,
|
|
36
|
-
method: 'POST',
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
|
|
40
23
|
const RemoveIcon = `<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
41
24
|
|
|
42
25
|
const SuccessIcon = `<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
@@ -237,4 +220,4 @@ function defineCustomElement() {
|
|
|
237
220
|
} });
|
|
238
221
|
}
|
|
239
222
|
|
|
240
|
-
export { ZonosCheckoutFinish as Z, createCustomEvent as c, defineCustomElement as d
|
|
223
|
+
export { ZonosCheckoutFinish as Z, createCustomEvent as c, defineCustomElement as d };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import { a as localizationStore, b as log, d as stripeStoreGetDomesticShippingSession, e as localizationStoreUpdateSelectedCountryCode, f as stripeStoreCleanupDomesticShippingSession, l as logError, g as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as cartStore,
|
|
2
|
+
import { a as localizationStore, b as log, d as stripeStoreGetDomesticShippingSession, e as localizationStoreUpdateSelectedCountryCode, f as stripeStoreCleanupDomesticShippingSession, l as logError, g as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as cartStore, j as cartStoreUpdateItems, k as cartStoreReset, s as stripeStore, m as stripeStoreInitCheckoutSession, n as cartStoreUpdateToErrorState, t as translate, o as stripeStorePrefetchLandedCost, p as cartStoreNextStep, q as stripeStoreConfirmPayment, r as stripeStoreReset } from './stripe.js';
|
|
3
3
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore.js';
|
|
4
4
|
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
5
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile.js';
|
|
6
|
-
import { c as createCustomEvent,
|
|
6
|
+
import { c as createCustomEvent, d as defineCustomElement$l } from './zonos-checkout-finish2.js';
|
|
7
|
+
import { s as sendErrorLog } from './sendErrorLog.js';
|
|
7
8
|
import { c as classes } from './classes.js';
|
|
8
9
|
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
9
10
|
import { i as isDarkColor } from './isDarkColor.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { h as handleFetch, l as logError, y as isValidSelector, b as log, s as stripeStore, z as initLocalizationStore, e as localizationStoreUpdateSelectedCountryCode } from './stripe.js';
|
|
3
3
|
import { z as zonosStore, d as zonosStoreInitSetting, a as zonosStoreFontFamily } from './zonosStore.js';
|
|
4
4
|
import { d as defineCustomElement$3 } from './zonos-notification2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './zonos-text2.js';
|
|
@@ -35,6 +35,12 @@ const BagIcon = `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xml
|
|
|
35
35
|
</svg>
|
|
36
36
|
`;
|
|
37
37
|
|
|
38
|
+
const ImportIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
+
<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>
|
|
40
|
+
<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>
|
|
41
|
+
</svg>
|
|
42
|
+
`;
|
|
43
|
+
|
|
38
44
|
const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
|
|
39
45
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>
|
|
40
46
|
</svg>
|
|
@@ -81,6 +87,81 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
81
87
|
this.setShowLanguageSelect = async (value) => {
|
|
82
88
|
this.showLanguageSelect = value;
|
|
83
89
|
};
|
|
90
|
+
this.getDutyMessage = () => {
|
|
91
|
+
const { countryLandedCost } = localizationStore;
|
|
92
|
+
// Our Robby API spells deminimis wrong here
|
|
93
|
+
const dutyDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.dutyDeminimus)
|
|
94
|
+
? currencyFormat(countryLandedCost.dutyDeminimus)
|
|
95
|
+
: null;
|
|
96
|
+
// If Canada, use 40 CAD (courier duty de minimis)
|
|
97
|
+
const dutyDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
98
|
+
? currencyFormat(40)
|
|
99
|
+
: dutyDeminimis;
|
|
100
|
+
// If deminimis is undefined or null, assume it's $0
|
|
101
|
+
return dutyDeminimisToUse
|
|
102
|
+
? `${translate('Spend')} ${dutyDeminimisToUse} ${translate('duty free')}`
|
|
103
|
+
: translate('Duties will apply to all orders');
|
|
104
|
+
};
|
|
105
|
+
this.getTaxMessage = () => {
|
|
106
|
+
const { countryLandedCost } = localizationStore;
|
|
107
|
+
// Our Robby API spells deminimis wrong here
|
|
108
|
+
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
109
|
+
? currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
110
|
+
: null;
|
|
111
|
+
// If Canada, use 150 CAD (courier tax de minimis)
|
|
112
|
+
const taxDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
113
|
+
? currencyFormat(150)
|
|
114
|
+
: taxDeminimis;
|
|
115
|
+
return taxDeminimisToUse
|
|
116
|
+
? `${translate('Spend')} ${taxDeminimisToUse} ${translate('tax free')}`
|
|
117
|
+
: translate('Taxes will apply to all orders');
|
|
118
|
+
};
|
|
119
|
+
this.getUkDutyTaxMessage = (landedCost) => {
|
|
120
|
+
if (landedCost.allowLowValueOrders) {
|
|
121
|
+
// show nothing if low value orders are allowed
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const dutyDeminimis = landedCost.dutyDeminimus;
|
|
125
|
+
return translate('Orders to ${countryName} must be over ${threshold} to ship.', {
|
|
126
|
+
countryName: 'United Kingdom',
|
|
127
|
+
threshold: currencyFormat(dutyDeminimis),
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
this.getAustraliaDutyTaxMessage = (landedCost) => {
|
|
131
|
+
return translate('${percentage} GST due on any order above ${threshold}.', {
|
|
132
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
133
|
+
threshold: currencyFormat(landedCost.vatTaxDeminimus),
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
this.getNewZealandDutyTaxMessge = (landedCost) => {
|
|
137
|
+
return translate('${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.', {
|
|
138
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
139
|
+
threshold: currencyFormat(landedCost.vatTaxDeminimus),
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Get additional duty tax message if selected country has tax id
|
|
144
|
+
*/
|
|
145
|
+
this.getAdditionalDutyTaxMessage = () => {
|
|
146
|
+
if (!localizationStore.countryLandedCost) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
// only show the message if the store has a tax id for selected country
|
|
150
|
+
if (!localizationStore.countryLandedCost.hasTaxId) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
switch (localizationStore.countryLandedCost.countryCode) {
|
|
154
|
+
case 'GB':
|
|
155
|
+
return this.getUkDutyTaxMessage(localizationStore.countryLandedCost);
|
|
156
|
+
case 'AU':
|
|
157
|
+
return this.getAustraliaDutyTaxMessage(localizationStore.countryLandedCost);
|
|
158
|
+
case 'NZ':
|
|
159
|
+
return this.getNewZealandDutyTaxMessge(localizationStore.countryLandedCost);
|
|
160
|
+
default:
|
|
161
|
+
// show nothing
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
84
165
|
this.isOpen = false;
|
|
85
166
|
this.setIsOpen = () => { };
|
|
86
167
|
this.mobileLocationOverride = undefined;
|
|
@@ -102,30 +183,13 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
102
183
|
}
|
|
103
184
|
render() {
|
|
104
185
|
var _a;
|
|
105
|
-
const {
|
|
106
|
-
//
|
|
107
|
-
const
|
|
108
|
-
? currencyFormat(countryLandedCost.dutyDeminimus)
|
|
109
|
-
: null;
|
|
110
|
-
// If Canada, use 40 CAD (courier duty de minimis)
|
|
111
|
-
const dutyDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
112
|
-
? currencyFormat(40)
|
|
113
|
-
: dutyDeminimis;
|
|
186
|
+
const { selectedCountryCode } = localizationStore;
|
|
187
|
+
// If deminimis is undefined or null, assume it's $0
|
|
188
|
+
const dutyDeMinimisMessage = this.getDutyMessage();
|
|
114
189
|
// If deminimis is undefined or null, assume it's $0
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// Our Robby API spells deminimis wrong here
|
|
119
|
-
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
120
|
-
? currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
121
|
-
: null;
|
|
122
|
-
// If Canada, use 150 CAD (courier tax de minimis)
|
|
123
|
-
const taxDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
124
|
-
? currencyFormat(150)
|
|
125
|
-
: taxDeminimis;
|
|
126
|
-
const taxDeMinimisMessage = taxDeminimisToUse
|
|
127
|
-
? `${translate('Spend')} ${taxDeminimisToUse} ${translate('tax free')}`
|
|
128
|
-
: translate('Taxes will apply to all orders');
|
|
190
|
+
const taxDeMinimisMessage = this.getTaxMessage();
|
|
191
|
+
// Show additional information if selected country has tax id
|
|
192
|
+
const additionalInformation = this.getAdditionalDutyTaxMessage();
|
|
129
193
|
const animateLeft = this.animateFromLeftOverride ||
|
|
130
194
|
(this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));
|
|
131
195
|
const animateFromBottom = this.dialogRef && getHasMoreSpaceAbove(this.dialogRef);
|
|
@@ -136,7 +200,7 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
136
200
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
137
201
|
const currentPage = this.getCurrentPageEnum();
|
|
138
202
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
139
|
-
return (h(Host, { key: '
|
|
203
|
+
return (h(Host, { key: 'ccabd686943b009ed6bb9c0ec64a6a4e7cc917f5', class: "zonos--elements" }, h("div", { key: '6bfbae15f5b43413fc76d21b94d0d56a2ce48f4d', "aria-hidden": "true", class: classes([
|
|
140
204
|
'zonos--hello-dialog',
|
|
141
205
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
142
206
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
@@ -146,7 +210,7 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
146
210
|
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { 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", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
|
|
147
211
|
var _a;
|
|
148
212
|
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)))));
|
|
149
|
-
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content:
|
|
213
|
+
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)), additionalInformation && (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Low value order shipping restriction", content: BagIcon }), h("zonos-text", null, additionalInformation))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", null, h("zonos-country-select", { handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", null, h("zonos-language-select", { handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
150
214
|
}
|
|
151
215
|
static get assetsDirs() { return ["assets"]; }
|
|
152
216
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore.js';
|
|
3
|
-
import {
|
|
3
|
+
import { h as handleFetch, l as logError, a as localizationStore, y as isValidSelector, t as translate, A as getZCountryUrlParam, B as setZCountryUrlParam, b as log, C as currencyDisplay, D as currencyConvertAndFormat, E as currencyConvert, F as currencyFormat } from './stripe.js';
|
|
4
4
|
import { c as classes } from './classes.js';
|
|
5
5
|
import { g as getHasMoreSpaceOnRight, d as defineCustomElement$9 } from './zonos-hello-dialog2.js';
|
|
6
6
|
import { d as defineCustomElement$f } from './zonos-banner2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as stripeStore, l as logError,
|
|
2
|
+
import { s as stripeStore, l as logError, o as stripeStorePrefetchLandedCost } from './stripe.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
4
4
|
|
|
5
5
|
const zonosLinkAuthenticationCss = ".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:var(--amino-space-16)}";
|