@zonos/elements 1.3.34 → 1.3.36
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-42cc98d9.js → cart-401b6d32.js} +51 -19
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{submitGtag-09f2e437.js → submitGtag-bc6af393.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +18 -17
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +10 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
- 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 +11 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_2.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +6 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +8 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +8 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +2 -0
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +9 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +4 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +51 -19
- package/dist/esm/{cart-b9f15a63.js → cart-f29968a8.js} +51 -19
- package/dist/esm/index.js +4 -4
- package/dist/esm/{submitGtag-8b52cfdd.js → submitGtag-fcfd5cf4.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +18 -17
- package/dist/esm/zonos-cart-items_12.entry.js +10 -4
- package/dist/esm/zonos-checkout.entry.js +2 -2
- 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 +11 -4
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_2.entry.js +1 -1
- package/dist/esm-es5/{cart-b9f15a63.js → cart-f29968a8.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{submitGtag-8b52cfdd.js → submitGtag-fcfd5cf4.js} +1 -1
- package/dist/esm-es5/zonos-address_8.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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +2 -2
- 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-address-update-dialog/zonos-address-update-dialog.d.ts +2 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-758c2820.system.js → p-1c2de5da.system.js} +1 -1
- package/dist/zonos-elements/{p-b65cc2cf.system.js → p-1fbf0527.system.js} +1 -1
- package/dist/zonos-elements/{p-b5f769ba.js → p-2947c138.js} +1 -1
- package/dist/zonos-elements/p-2cee5f3a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-af5fc5f7.system.entry.js → p-38f882ea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3625cdc7.system.entry.js → p-4d95b4f4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3bc94271.js → p-5b723a1d.js} +1 -1
- package/dist/zonos-elements/{p-fdf79bff.system.entry.js → p-5ce19bce.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c49eb9b.entry.js → p-60f7bcee.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a3bf998.system.entry.js → p-62e21e2b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-88e5c33b.entry.js → p-6b06ac3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-09f89949.entry.js → p-6ec40c8f.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f51a7ee.entry.js → p-8363436f.entry.js} +1 -1
- package/dist/zonos-elements/{p-829bac92.system.entry.js → p-891d2c76.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-679e42d8.system.js → p-91635589.system.js} +1 -1
- package/dist/zonos-elements/p-952e331c.entry.js +1 -0
- package/dist/zonos-elements/p-bf9578d3.entry.js +1 -0
- package/dist/zonos-elements/{p-3143bbf8.system.entry.js → p-c0efa3a3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b525aaa.system.entry.js → p-c9062536.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cfe9c940.entry.js +1 -0
- package/dist/zonos-elements/{p-f64ac752.system.entry.js → p-d410ef50.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b33ed3b.entry.js → p-e0709be2.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-1a67d86d.entry.js → p-e4ef71bd.entry.js} +1 -1
- package/dist/zonos-elements/{p-6a42fa2a.entry.js → p-eea3ec17.entry.js} +1 -1
- package/dist/zonos-elements/{p-210f3405.system.entry.js → p-f9931ad1.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-0f58c8ab.entry.js +0 -1
- package/dist/zonos-elements/p-27538d28.system.entry.js +0 -1
- package/dist/zonos-elements/p-4ff5c708.entry.js +0 -1
- package/dist/zonos-elements/p-83e265cf.entry.js +0 -1
|
@@ -7142,6 +7142,25 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
|
|
|
7142
7142
|
void updateCheckoutSessionLanguage();
|
|
7143
7143
|
};
|
|
7144
7144
|
|
|
7145
|
+
/**
|
|
7146
|
+
* Extract value from translated object
|
|
7147
|
+
*/
|
|
7148
|
+
const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
7149
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7150
|
+
const { city, country, line1, line2, postal_code, state } = currentAddress.value.address;
|
|
7151
|
+
const name = currentAddress.value.name ||
|
|
7152
|
+
[currentAddress.value.firstName, currentAddress.value.lastName].join(' ');
|
|
7153
|
+
return {
|
|
7154
|
+
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
7155
|
+
country,
|
|
7156
|
+
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
7157
|
+
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2 || '']) || line2 || '',
|
|
7158
|
+
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
7159
|
+
phone: currentAddress.value.phone || '',
|
|
7160
|
+
postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
|
|
7161
|
+
state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
|
|
7162
|
+
};
|
|
7163
|
+
};
|
|
7145
7164
|
const prepCalculateLandedCost = () => {
|
|
7146
7165
|
// maybe we don't need email now for prefetch the landed cost
|
|
7147
7166
|
const stripeLinkData = stripeStore.stripeLinkEventData;
|
|
@@ -7152,39 +7171,52 @@ const prepCalculateLandedCost = () => {
|
|
|
7152
7171
|
if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
|
|
7153
7172
|
throw new Error('Missing stripe address data');
|
|
7154
7173
|
}
|
|
7174
|
+
// Attempt to get translated address if available
|
|
7175
|
+
const translatedShippingAddress = getTranslatedAddress({
|
|
7176
|
+
currentAddress: stripeAddressData,
|
|
7177
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
7178
|
+
});
|
|
7179
|
+
const shippingFirstName = translatedShippingAddress.name.split(' ')[0] || '';
|
|
7180
|
+
const shippingLastName = translatedShippingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
7181
|
+
const translatedBillingAddress = getTranslatedAddress({
|
|
7182
|
+
currentAddress: stripeBillingAddressData,
|
|
7183
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
7184
|
+
});
|
|
7185
|
+
const billingFirstName = translatedBillingAddress.name.split(' ')[0] || '';
|
|
7186
|
+
const billingLastName = translatedBillingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
7155
7187
|
return {
|
|
7156
7188
|
billingAddress: {
|
|
7157
|
-
addressLine1:
|
|
7158
|
-
addressLine2:
|
|
7159
|
-
city:
|
|
7160
|
-
country:
|
|
7161
|
-
postalCode:
|
|
7162
|
-
state:
|
|
7189
|
+
addressLine1: translatedBillingAddress.line1,
|
|
7190
|
+
addressLine2: translatedBillingAddress.line2 || '',
|
|
7191
|
+
city: translatedBillingAddress.city,
|
|
7192
|
+
country: translatedBillingAddress.country,
|
|
7193
|
+
postalCode: translatedBillingAddress.postal_code,
|
|
7194
|
+
state: translatedBillingAddress.state,
|
|
7163
7195
|
},
|
|
7164
7196
|
billingContact: {
|
|
7165
7197
|
// firstName and lastName should be valid now since stripe only mark
|
|
7166
7198
|
// the address as complete when both fields are filled.
|
|
7167
|
-
firstName:
|
|
7168
|
-
lastName:
|
|
7169
|
-
phone:
|
|
7199
|
+
firstName: billingFirstName,
|
|
7200
|
+
lastName: billingLastName,
|
|
7201
|
+
phone: translatedBillingAddress.phone,
|
|
7170
7202
|
},
|
|
7171
7203
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
7172
7204
|
contact: {
|
|
7173
|
-
email:
|
|
7205
|
+
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
7174
7206
|
// firstName and lastName should be valid now since stripe only mark
|
|
7175
7207
|
// the address as complete when both fields are filled.
|
|
7176
|
-
firstName:
|
|
7177
|
-
lastName:
|
|
7178
|
-
phone:
|
|
7208
|
+
firstName: shippingFirstName,
|
|
7209
|
+
lastName: shippingLastName,
|
|
7210
|
+
phone: translatedShippingAddress.phone,
|
|
7179
7211
|
},
|
|
7180
7212
|
items: cartStore.items,
|
|
7181
7213
|
shippingAddress: {
|
|
7182
|
-
addressLine1:
|
|
7183
|
-
addressLine2:
|
|
7184
|
-
city:
|
|
7185
|
-
country:
|
|
7186
|
-
postalCode:
|
|
7187
|
-
state:
|
|
7214
|
+
addressLine1: translatedShippingAddress.line1,
|
|
7215
|
+
addressLine2: translatedShippingAddress.line2,
|
|
7216
|
+
city: translatedShippingAddress.city,
|
|
7217
|
+
country: translatedShippingAddress.country,
|
|
7218
|
+
postalCode: translatedShippingAddress.postal_code,
|
|
7219
|
+
state: translatedShippingAddress.state,
|
|
7188
7220
|
},
|
|
7189
7221
|
};
|
|
7190
7222
|
};
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -249,9 +249,9 @@ const zonosLoadUrl = (() => {
|
|
|
249
249
|
}
|
|
250
250
|
return null;
|
|
251
251
|
})();
|
|
252
|
-
const ZONOS_URL = "https://v1.3.
|
|
253
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
254
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
252
|
+
const ZONOS_URL = "https://v1.3.36.js.zonos.com";
|
|
253
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.36";
|
|
254
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.36";
|
|
255
255
|
const MAIN_LOAD_CDN_TYPE = 'jsdelivr';
|
|
256
256
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
257
257
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
@@ -271,7 +271,7 @@ Zonos.isBigCommerce = false;
|
|
|
271
271
|
*/
|
|
272
272
|
Zonos.isNpm = true;
|
|
273
273
|
Zonos.zonosQaUrl = null;
|
|
274
|
-
Zonos.version = `v${"1.3.
|
|
274
|
+
Zonos.version = `v${"1.3.36"}`;
|
|
275
275
|
Zonos.modeAlerted = false;
|
|
276
276
|
Zonos.tempCartData = null;
|
|
277
277
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -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-401b6d32.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');
|
|
@@ -212,16 +212,17 @@ const ZonosAddressForm = class {
|
|
|
212
212
|
render() {
|
|
213
213
|
const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
|
|
214
214
|
const firstName = name.split(' ')[0] || '';
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
// get the rest of the name if it exists
|
|
216
|
+
const lastName = name.split(' ').slice(1).join(' ') || '';
|
|
217
|
+
return (index.h(index.Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, index.h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, index.h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
217
218
|
? cart.translate('Shipping')
|
|
218
|
-
: cart.translate('Billing'))), index.h("div", { key: '
|
|
219
|
+
: cart.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError: containsNonLatinChars.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
219
220
|
key: 'name',
|
|
220
221
|
value: `${e.detail} ${lastName}`,
|
|
221
|
-
}) }), index.h("zonos-input", { key: '
|
|
222
|
+
}) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError: containsNonLatinChars.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
222
223
|
key: 'name',
|
|
223
224
|
value: `${firstName} ${e.detail}`,
|
|
224
|
-
}) }))), index.h("div", { key: '
|
|
225
|
+
}) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError: containsNonLatinChars.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: cart.translate('Address line 2'), inputValue: line2, isError: containsNonLatinChars.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, index.h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: cart.translate('City'), inputValue: city, isError: containsNonLatinChars.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: cart.translate('State/Province'), inputValue: state, isError: containsNonLatinChars.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: cart.translate('Postal code'), inputValue: postal_code, isError: containsNonLatinChars.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: cart.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
225
226
|
}
|
|
226
227
|
static get watchers() { return {
|
|
227
228
|
"translatedAddress": ["watchCurrentAddress"]
|
|
@@ -235,13 +236,13 @@ const ZonosAddressUpdateDialogStyle0 = zonosAddressUpdateDialogCss;
|
|
|
235
236
|
const ZonosAddressUpdateDialog = class {
|
|
236
237
|
constructor(hostRef) {
|
|
237
238
|
index.registerInstance(this, hostRef);
|
|
238
|
-
this.
|
|
239
|
+
this.closeUpdateDialog = index.createEvent(this, "closeUpdateDialog", 7);
|
|
239
240
|
this.continueClicked = index.createEvent(this, "continueClicked", 7);
|
|
240
241
|
/**
|
|
241
242
|
* handler for close button click
|
|
242
243
|
*/
|
|
243
|
-
this.
|
|
244
|
-
this.
|
|
244
|
+
this.closeUpdateDialogHandler = () => {
|
|
245
|
+
this.closeUpdateDialog.emit();
|
|
245
246
|
};
|
|
246
247
|
/**
|
|
247
248
|
* Extract value from translated object
|
|
@@ -371,24 +372,24 @@ const ZonosAddressUpdateDialog = class {
|
|
|
371
372
|
: this.submitBtnType || 'standard';
|
|
372
373
|
const billing = this.billingAddress;
|
|
373
374
|
const shipping = this.shippingAddress;
|
|
374
|
-
return (index.h(index.Host, { key: '
|
|
375
|
+
return (index.h(index.Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes.classes([
|
|
375
376
|
'zonos--address-update-dialog zonos--elements',
|
|
376
377
|
this.isMobile && 'mobile',
|
|
377
|
-
]) }, index.h("zonos-dialog", { key: '
|
|
378
|
+
]) }, index.h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, index.h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, index.h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, cart.translate('Update your address')), index.h("zonos-button", { key: '66abf7b74045e68e84e631298504236d32ca9c4e', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1.RemoveIcon }), noBackground: true, onClick: () => this.closeUpdateDialogHandler() })), index.h("zonos-text", { key: 'ffb3d8f169867d5f6dff269e1becd99c98c5a7da' }, cart.translate('To ensure delivery all address details must be in Latin characters.'))), index.h("div", { key: '2cb61f06ce174e2317870decfdd337c67c5cf128', class: "zonos--group" }, index.h("zonos-text", { key: 'a616c540984120b468e52bccfb380ea3974ced22', class: "zonos--what-you-entered", type: "semiBoldLabel" }, cart.translate('What you entered')), index.h("div", { key: '6ac8f9c14472370c501af1b0d50bd8f8746b7694', class: "zonos--address-display-group" }, index.h("zonos-address-display", { key: 'ea2c67a7bba51c99f80be968e448beeffcf1f863', addressType: "shipping", currentAddress: shipping }), billing && (index.h("zonos-address-display", { key: '7ea1683dc04a292810e04ed6550d86086f25186f', addressType: "billing", currentAddress: billing }))), index.h("div", { key: '4d1cd9096943518b8b4e267608a5e1542befb6a9', class: "zonos--address-form-section" }, index.h("zonos-text", { key: 'e4184a2cc618d26d43979fa8cfe06070cf8b5af8', type: "semiBoldLabel" }, cart.translate('Translated address')), index.h("zonos-address-form", { key: 'c55d9d3c658565ceb7c7b879f444e3937b9f7ad6', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
378
379
|
const address = e.detail;
|
|
379
380
|
this.translatedShippingAddressState =
|
|
380
381
|
this.buildTranslateAddressState({
|
|
381
382
|
currentAddress: shipping,
|
|
382
383
|
translatedAddress: address,
|
|
383
384
|
});
|
|
384
|
-
}, translatedAddress: this.translatedShippingAddressState }), billing && (index.h("zonos-address-form", { key: '
|
|
385
|
+
}, translatedAddress: this.translatedShippingAddressState }), billing && (index.h("zonos-address-form", { key: 'c3facc295b1322bb00baa6081f343dcea4f10777', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
|
|
385
386
|
const address = e.detail;
|
|
386
387
|
this.translatedBillingAddressState =
|
|
387
388
|
this.buildTranslateAddressState({
|
|
388
389
|
currentAddress: billing,
|
|
389
390
|
translatedAddress: address,
|
|
390
391
|
});
|
|
391
|
-
}, translatedAddress: this.translatedBillingAddressState })))), index.h("div", { key: '
|
|
392
|
+
}, translatedAddress: this.translatedBillingAddressState })))), index.h("div", { key: '1c89c9604ba0dece40275fcfac97e7f93706b430', class: "zonos--group-btn" }, index.h("div", { key: 'e47d393940b094b4e123864e4070daa87f0616f0', class: "zonos--button-wrapper" }, index.h("zonos-button", { key: '216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6', class: "zonos--cancel-btn", onClick: () => this.closeUpdateDialogHandler(), variant: "subtle" }, cart.translate('Cancel')), index.h("zonos-button", { key: 'acbacb92cedb325b46843d8f3aff13f4e7c86ab5', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, cart.translate('Update address'))))))));
|
|
392
393
|
}
|
|
393
394
|
get el() { return index.getElement(this); }
|
|
394
395
|
static get watchers() { return {
|
|
@@ -520,7 +521,7 @@ const ZonosDialogStyle0 = zonosDialogCss;
|
|
|
520
521
|
const ZonosDialog = class {
|
|
521
522
|
constructor(hostRef) {
|
|
522
523
|
index.registerInstance(this, hostRef);
|
|
523
|
-
this.closeDialog = index.createEvent(this, "closeDialog",
|
|
524
|
+
this.closeDialog = index.createEvent(this, "closeDialog", 3);
|
|
524
525
|
this.isMobileMode = () => {
|
|
525
526
|
return this.mobile || window.innerWidth <= 768;
|
|
526
527
|
};
|
|
@@ -573,7 +574,7 @@ const ZonosDialog = class {
|
|
|
573
574
|
const borderStyle = getBorderRadius.getBorderRadius({
|
|
574
575
|
overrideBorderStyle: this.borderStyle,
|
|
575
576
|
});
|
|
576
|
-
return (index.h(index.Host, { key: '
|
|
577
|
+
return (index.h(index.Host, { key: '018771d0e01311ae520abcf33fbd64316794b202', class: classes.classes([
|
|
577
578
|
'zonos--elements',
|
|
578
579
|
this.open && 'open',
|
|
579
580
|
this.isLoading && 'is-loading',
|
|
@@ -585,10 +586,10 @@ const ZonosDialog = class {
|
|
|
585
586
|
'--height': this.height || 'initial',
|
|
586
587
|
'--min-height': this.minHeight || '500px',
|
|
587
588
|
'--width': this.width,
|
|
588
|
-
} }, index.h("div", { key: '
|
|
589
|
+
} }, index.h("div", { key: 'a86c9f8465054fde894bbdd71149e59d97e8cbcf', class: "zonos--backdrop" }), index.h("div", { key: 'b2f0c86fa0e768474ba4d522f8c2b8157f89cd56', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, index.h("div", { key: '26cd8a7b98d38c53dcf4789c8781f0c1ced99633', class: "zonos--dialog" }, this.isLoading && (index.h("div", { key: '34d0ba841a9af9ca2ff6d21d0471113cc86cdec3', class: "zonos--loading" }, index.h("zonos-spinner", { key: '0109778b1a9734de0959035e3975414fb1cac1be', size: 30 }))), (this.headerText || !this.noCloseButton) && (index.h("div", { key: 'f80a4c337727500ee1ad92c1d80d7b3088eccc0f', class: "zonos--header" }, this.headerText && (index.h("h3", { key: '92b078fbbcd9ca5f8bf178fc67f2bee817d1e961', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (index.h("zonos-button", { key: '698e45fffd466f22b6179aa220d35fe39ee5374c', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), index.h("div", { key: 'a4012e5a48d5fbcc77cac038d8a39fe05f332008', class: classes.classes([
|
|
589
590
|
'zonos--body',
|
|
590
591
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
591
|
-
]) }, index.h("slot", { key: '
|
|
592
|
+
]) }, index.h("slot", { key: 'd64b381cb91afde4ddbde58348a62612d9871c8e' })), index.h("slot", { key: '4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144', name: "dialog-footer" })))));
|
|
592
593
|
}
|
|
593
594
|
static get assetsDirs() { return ["assets"]; }
|
|
594
595
|
};
|
|
@@ -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-401b6d32.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-bc6af393.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');
|
|
@@ -719,7 +719,9 @@ const ZonosCustomerInfo = class {
|
|
|
719
719
|
// overwrite the address object with the new data
|
|
720
720
|
stripeEventDataObj = Object.assign(Object.assign({}, stripeEventDataObj), { complete: true, value: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value), { address: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address), { city: submitDataByKey.city ||
|
|
721
721
|
(stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address.city) ||
|
|
722
|
-
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
722
|
+
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
723
|
+
// get all the names after
|
|
724
|
+
lastName: submitDataByKey.name.split(' ').slice(1).join(' '), name: submitDataByKey.name }) });
|
|
723
725
|
};
|
|
724
726
|
/**
|
|
725
727
|
* handler for continue button click
|
|
@@ -848,12 +850,16 @@ const ZonosCustomerInfo = class {
|
|
|
848
850
|
variant: this.submitBtnType }, cart.translate('Continue to shipping')))), cart.stripeStore.stripeAddressEventData && (index.h("zonos-address-update-dialog", { billingAddress: !cart.stripeStore.stripeShippingSameAsBilling &&
|
|
849
851
|
cart.stripeStore.stripeBillingAddressEventData
|
|
850
852
|
? this.prepareAddressObject(cart.stripeStore.stripeBillingAddressEventData)
|
|
851
|
-
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile,
|
|
853
|
+
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile, onCloseUpdateDialog: () => (this.openAddressValidationDialog = false), onContinueClicked: e => {
|
|
852
854
|
const submitData = e.detail;
|
|
853
855
|
this.transformTranslatedAddressToStripeEvent({
|
|
854
856
|
submitData,
|
|
855
857
|
type: 'shippingAddress',
|
|
856
858
|
});
|
|
859
|
+
this.transformTranslatedAddressToStripeEvent({
|
|
860
|
+
submitData,
|
|
861
|
+
type: 'billingAddress',
|
|
862
|
+
});
|
|
857
863
|
}, shippingAddress: this.prepareAddressObject(cart.stripeStore.stripeAddressEventData), translatedBillingAddress: cart.stripeStore.translatedAddress.billingAddress, translatedShippingAddress: cart.stripeStore.translatedAddress.address }))));
|
|
858
864
|
}
|
|
859
865
|
get el() { return index.getElement(this); }
|
|
@@ -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-401b6d32.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
|
-
const submitGtag = require('./submitGtag-
|
|
8
|
+
const submitGtag = require('./submitGtag-bc6af393.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-401b6d32.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const logError = require('./logError-4e2f2020.js');
|
|
9
9
|
require('./isDarkColor-371a3b1a.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-401b6d32.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-401b6d32.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');
|
|
@@ -1794,7 +1794,7 @@ const GreenCheckDuotoneIcon = `<svg width="16" height="16" viewBox="0 0 16 16" f
|
|
|
1794
1794
|
</svg>
|
|
1795
1795
|
`;
|
|
1796
1796
|
|
|
1797
|
-
const zonosCountrySelectCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--country-select{position:relative}:host .zonos--country-select .zonos--country-select-header{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);z-index:11}:host .zonos--country-select .zonos--country-select-input{padding:8px;border-radius:var(--zonos-elements-radius-4);border:var(--zonos-elements-border)}:host .zonos--country-select .zonos--country-select-content{padding:16px;padding-top:0px}:host .zonos--country-select .zonos--country-select-country{display:-ms-flexbox;display:flex;gap:16px;padding:8px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--country-select .zonos--country-select-country:hover{background:var(--zonos-elements-gray-100)}:host .zonos--country-select .zonos--country-select-country .zonos--country-flag{border-radius:var(--zonos-elements-radius-4);width:24px;height:18px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--country-select .zonos--country-select-country .zonos--country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}}";
|
|
1797
|
+
const zonosCountrySelectCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--country-select{position:relative;max-height:500px;overflow-y:auto}:host .zonos--country-select .zonos--country-select-header{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);z-index:11}:host .zonos--country-select .zonos--country-select-input{padding:8px;border-radius:var(--zonos-elements-radius-4);border:var(--zonos-elements-border)}:host .zonos--country-select .zonos--country-select-content{padding:16px;padding-top:0px}:host .zonos--country-select .zonos--country-select-country{display:-ms-flexbox;display:flex;gap:16px;padding:8px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--country-select .zonos--country-select-country:hover{background:var(--zonos-elements-gray-100)}:host .zonos--country-select .zonos--country-select-country .zonos--country-flag{border-radius:var(--zonos-elements-radius-4);width:24px;height:18px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--country-select .zonos--country-select-country .zonos--country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}}";
|
|
1798
1798
|
const ZonosCountrySelectStyle0 = zonosCountrySelectCss;
|
|
1799
1799
|
|
|
1800
1800
|
const ZonosCountrySelect = class {
|
|
@@ -1806,8 +1806,15 @@ const ZonosCountrySelect = class {
|
|
|
1806
1806
|
this.handleOnClose();
|
|
1807
1807
|
};
|
|
1808
1808
|
this.handleInputChange = (event) => {
|
|
1809
|
+
var _a;
|
|
1809
1810
|
const input = event.target;
|
|
1810
1811
|
this.inputValue = input.value;
|
|
1812
|
+
// query the country list container
|
|
1813
|
+
const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select');
|
|
1814
|
+
// scroll to top every time the input changes
|
|
1815
|
+
if (countryListSelector) {
|
|
1816
|
+
countryListSelector.scrollTop = 0;
|
|
1817
|
+
}
|
|
1811
1818
|
};
|
|
1812
1819
|
this.handleOnClose = () => { };
|
|
1813
1820
|
this.inputValue = '';
|
|
@@ -1829,9 +1836,9 @@ const ZonosCountrySelect = class {
|
|
|
1829
1836
|
const filteredCountries = this.inputValue
|
|
1830
1837
|
? fuseObject.map(country => country.item)
|
|
1831
1838
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
1832
|
-
return (index.h(index.Host, { key: '
|
|
1839
|
+
return (index.h(index.Host, { key: '55753f75d50712e9a27a9db9131130ce1e042c7e', class: "zonos--elements", style: {
|
|
1833
1840
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
1834
|
-
} }, index.h("div", { key: '
|
|
1841
|
+
} }, index.h("div", { key: 'c96d6b99ea3d55074256b39deaab01e14c5cea0b', class: "zonos--country-select" }, index.h("zonos-v-stack", { key: '2e87ea4ed6a5d4b9bd0aa6764f0aa9661e7d68fd', class: "zonos--country-select-header", spacing: 8 }, index.h("zonos-select-dialog-header", { key: 'd8dec91571385908913825d8bad4beda4dcaa409', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, index.h("input", { key: 'b93ab3eb035c813af752da077b493140ae0fa394', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), index.h("div", { key: 'aaaf3dbd925250d799119b5a57ca95691eeaa985', class: "zonos--country-select-content" }, filteredCountries.map(country => (index.h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), index.h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === cart.localizationStore.selectedCountryCode && (index.h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
1835
1842
|
}
|
|
1836
1843
|
get ele() { return index.getElement(this); }
|
|
1837
1844
|
};
|
|
@@ -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-401b6d32.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');
|
|
@@ -217,18 +217,18 @@ const ZonosHelloDialog = class {
|
|
|
217
217
|
const defaultMessage = formatStringWithLinks.formatStringWithLinks(defaultMessageStr);
|
|
218
218
|
const currentPage = this.getCurrentPageEnum();
|
|
219
219
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
220
|
-
return (index.h(index.Host, { key: 'af2c46bcc413205d644a2b94ee2ff568d3d004f2', class: "zonos--elements" }, index.h("div", { key: '
|
|
220
|
+
return (index.h(index.Host, { key: 'af2c46bcc413205d644a2b94ee2ff568d3d004f2', class: "zonos--elements" }, index.h("div", { key: 'e74b871d52d734ca9ad772d8ae1c5bef1aaf06f9', class: classes.classes([
|
|
221
221
|
'zonos--hello-dialog',
|
|
222
222
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
223
223
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
224
224
|
!!this.mobileLocationOverride &&
|
|
225
225
|
'zonos--hello-dialog-mobile-override',
|
|
226
226
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
227
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: '
|
|
227
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (index.h("div", { key: 'd973d051143ab56e1af29b7ee812f1e5405b7768' }, index.h("div", { key: '1539bbc35aebccc9748e2d3b77b1717bd2e5dec5', class: "zonos--hello-dialog-content" }, index.h("zonos-button", { key: '675ff7bb8fdf8373c1aa21200ccc42ff9b585355', 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: 'c82a41c292facb00fd1a48ce69920b1de47d3f09', spacing: 24 }, index.h("zonos-country-flag", { key: '6b083cf77226e3766ad50a812c1201809593f3d6', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), index.h("zonos-v-stack", { key: 'f0ab4ca66f22b0448edff37fc730e72790b83de8', class: "zonos--hello-dialog-header", spacing: 4 }, index.h("zonos-text", { key: '574f22410d18fbeea3ac3fe22a735a2d858b5c9e', type: "boldSubheader" }, welcomeMessage), index.h("zonos-text", { key: '35f718094fcbd34d8e8ae9ec46fd0429cfcd1104', innerHTML: defaultMessage, textColor: "gray-800" })), index.h("zonos-v-stack", { key: 'e4bd687a84f1d48d0a20564a4ac9b9c1a24b3850', spacing: 8 }, this.restrictedItems.map(item => {
|
|
228
228
|
var _a;
|
|
229
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)))));
|
|
230
|
-
}), index.h("zonos-card", { key: '
|
|
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: '
|
|
230
|
+
}), index.h("zonos-card", { key: '53fa284d1d87505e550bb893a895e944894cd8b6', spacing: "12px" }, index.h("zonos-v-stack", { key: 'ee8ecb870af875c1bbc49be88464094753d96b26', spacing: 12 }, index.h("div", { key: '9bb07220319b2635d66722c79a81c77c049e2aa0', class: "zonos--flex-message" }, index.h("zonos-icon", { key: 'cf345dace81622f3fd240a1538f25fce855d2ae2', "aria-label": "Duty de minimis", content: ImportIcon }), index.h("zonos-text", { key: '4a047bc63a8e2a1f88203241b927ac3f3f05a398' }, dutyDeMinimisMessage)), index.h("div", { key: 'af75e4d21ae1189d015376bfed3caf9156788ceb', class: "zonos--flex-message" }, index.h("zonos-icon", { key: '356fbbe36379ab8513822be08f8b4f3af4f8baf5', "aria-label": "Tax de minimis", content: MoneyIcon }), index.h("zonos-text", { key: '5b8fb3f1622bb49bbed21e0a81d6725a5825e931' }, 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: '362873c8bac81efc80e44fae1d74a0bffae5e605', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (index.h("div", { key: '86d0d738e77d51666d3f63288aa1e954d539bb06' }, index.h("zonos-country-select", { key: '98766f096f97b249f0b4b3ebe053474de4ae498a', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (index.h("div", { key: '3268e1c0a9f7300b0e997ef238a4d95ec9d4f894' }, index.h("zonos-language-select", { key: '1b6d9dd2872332b2eba343ffd8798b1e87c71c2a', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
232
232
|
}
|
|
233
233
|
static get assetsDirs() { return ["assets"]; }
|
|
234
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-401b6d32.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-401b6d32.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-4c6c85da.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./logError-4e2f2020.js');
|
|
@@ -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-401b6d32.js');
|
|
9
9
|
const logError = require('./logError-4e2f2020.js');
|
|
10
10
|
require('./isDarkColor-371a3b1a.js');
|
|
11
11
|
require('./getBorderRadius-074b46ef.js');
|
|
@@ -24,16 +24,17 @@ export class ZonosAddressForm {
|
|
|
24
24
|
render() {
|
|
25
25
|
const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
|
|
26
26
|
const firstName = name.split(' ')[0] || '';
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// get the rest of the name if it exists
|
|
28
|
+
const lastName = name.split(' ').slice(1).join(' ') || '';
|
|
29
|
+
return (h(Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
29
30
|
? translate('Shipping')
|
|
30
|
-
: translate('Billing'))), h("div", { key: '
|
|
31
|
+
: translate('Billing'))), h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, translate('Contact')), h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
31
32
|
key: 'name',
|
|
32
33
|
value: `${e.detail} ${lastName}`,
|
|
33
|
-
}) }), h("zonos-input", { key: '
|
|
34
|
+
}) }), h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
34
35
|
key: 'name',
|
|
35
36
|
value: `${firstName} ${e.detail}`,
|
|
36
|
-
}) }))), h("div", { key: '
|
|
37
|
+
}) }))), h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, translate('Address')), h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
37
38
|
}
|
|
38
39
|
static get is() { return "zonos-address-form"; }
|
|
39
40
|
static get encapsulation() { return "shadow"; }
|
|
@@ -10,8 +10,8 @@ export class ZonosAddressUpdateDialog {
|
|
|
10
10
|
/**
|
|
11
11
|
* handler for close button click
|
|
12
12
|
*/
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
13
|
+
this.closeUpdateDialogHandler = () => {
|
|
14
|
+
this.closeUpdateDialog.emit();
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Extract value from translated object
|
|
@@ -141,24 +141,24 @@ export class ZonosAddressUpdateDialog {
|
|
|
141
141
|
: this.submitBtnType || 'standard';
|
|
142
142
|
const billing = this.billingAddress;
|
|
143
143
|
const shipping = this.shippingAddress;
|
|
144
|
-
return (h(Host, { key: '
|
|
144
|
+
return (h(Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes([
|
|
145
145
|
'zonos--address-update-dialog zonos--elements',
|
|
146
146
|
this.isMobile && 'mobile',
|
|
147
|
-
]) }, h("zonos-dialog", { key: '
|
|
147
|
+
]) }, h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, translate('Update your address')), h("zonos-button", { key: '66abf7b74045e68e84e631298504236d32ca9c4e', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeUpdateDialogHandler() })), h("zonos-text", { key: 'ffb3d8f169867d5f6dff269e1becd99c98c5a7da' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '2cb61f06ce174e2317870decfdd337c67c5cf128', class: "zonos--group" }, h("zonos-text", { key: 'a616c540984120b468e52bccfb380ea3974ced22', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: '6ac8f9c14472370c501af1b0d50bd8f8746b7694', class: "zonos--address-display-group" }, h("zonos-address-display", { key: 'ea2c67a7bba51c99f80be968e448beeffcf1f863', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: '7ea1683dc04a292810e04ed6550d86086f25186f', addressType: "billing", currentAddress: billing }))), h("div", { key: '4d1cd9096943518b8b4e267608a5e1542befb6a9', class: "zonos--address-form-section" }, h("zonos-text", { key: 'e4184a2cc618d26d43979fa8cfe06070cf8b5af8', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: 'c55d9d3c658565ceb7c7b879f444e3937b9f7ad6', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
148
148
|
const address = e.detail;
|
|
149
149
|
this.translatedShippingAddressState =
|
|
150
150
|
this.buildTranslateAddressState({
|
|
151
151
|
currentAddress: shipping,
|
|
152
152
|
translatedAddress: address,
|
|
153
153
|
});
|
|
154
|
-
}, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: '
|
|
154
|
+
}, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: 'c3facc295b1322bb00baa6081f343dcea4f10777', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
|
|
155
155
|
const address = e.detail;
|
|
156
156
|
this.translatedBillingAddressState =
|
|
157
157
|
this.buildTranslateAddressState({
|
|
158
158
|
currentAddress: billing,
|
|
159
159
|
translatedAddress: address,
|
|
160
160
|
});
|
|
161
|
-
}, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '
|
|
161
|
+
}, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '1c89c9604ba0dece40275fcfac97e7f93706b430', class: "zonos--group-btn" }, h("div", { key: 'e47d393940b094b4e123864e4070daa87f0616f0', class: "zonos--button-wrapper" }, h("zonos-button", { key: '216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6', class: "zonos--cancel-btn", onClick: () => this.closeUpdateDialogHandler(), variant: "subtle" }, translate('Cancel')), h("zonos-button", { key: 'acbacb92cedb325b46843d8f3aff13f4e7c86ab5', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, translate('Update address'))))))));
|
|
162
162
|
}
|
|
163
163
|
static get is() { return "zonos-address-update-dialog"; }
|
|
164
164
|
static get encapsulation() { return "shadow"; }
|
|
@@ -379,8 +379,8 @@ export class ZonosAddressUpdateDialog {
|
|
|
379
379
|
}
|
|
380
380
|
static get events() {
|
|
381
381
|
return [{
|
|
382
|
-
"method": "
|
|
383
|
-
"name": "
|
|
382
|
+
"method": "closeUpdateDialog",
|
|
383
|
+
"name": "closeUpdateDialog",
|
|
384
384
|
"bubbles": true,
|
|
385
385
|
"cancelable": true,
|
|
386
386
|
"composed": true,
|