@zonos/elements 1.3.144 → 1.3.145
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-2398abd4.js → cart-9d5e2816.js} +3 -3
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-7ed9dfb7.js → paypal-f9015045.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +14 -14
- package/dist/cjs/zonos-controller.cjs.entry.js +25 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +12 -12
- package/dist/collection/components/main/zonos-controller.js +24 -3
- package/dist/collection/components/store/translationStore/strings.danish.js +1 -1
- package/dist/collection/components/store/translationStore/strings.korean.js +1 -1
- package/dist/collection/components/store/translationStore/strings.russian.js +1 -1
- package/dist/esm/{cart-3427ee25.js → cart-887f7d66.js} +3 -3
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-4e2f9753.js → paypal-6fd5749b.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-cart-items_13.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +14 -14
- package/dist/esm/zonos-controller.entry.js +25 -4
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/{cart-3427ee25.js → cart-887f7d66.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-4e2f9753.js → paypal-6fd5749b.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/main/zonos-controller.d.ts +1 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +12 -10
- package/dist/types/types/generated/graphql.internal.types.ts +12 -10
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-ea35b237.system.entry.js → p-0e9826d2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e2f1fa53.entry.js → p-1d466ac6.entry.js} +1 -1
- package/dist/zonos-elements/{p-bb92882d.system.entry.js → p-2e6265cc.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e05e259.system.entry.js → p-3bd17598.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-da6a29e4.system.entry.js → p-3f282167.system.entry.js} +1 -1
- package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
- package/dist/zonos-elements/{p-515e3606.system.entry.js → p-49b8760c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e01ccb27.entry.js → p-4d353108.entry.js} +1 -1
- package/dist/zonos-elements/p-5e4b6b77.js +17 -0
- package/dist/zonos-elements/{p-d6061c79.entry.js → p-5e76c269.entry.js} +1 -1
- package/dist/zonos-elements/{p-a8cf3542.system.entry.js → p-794b2d24.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0e6a3cd2.system.js → p-826b5d0c.system.js} +1 -1
- package/dist/zonos-elements/{p-7e47f6cf.entry.js → p-896dca32.entry.js} +1 -1
- package/dist/zonos-elements/{p-50896f89.entry.js → p-9024f5a1.entry.js} +1 -1
- package/dist/zonos-elements/p-98db517b.entry.js +1 -0
- package/dist/zonos-elements/{p-c8b0bc02.system.entry.js → p-9ae29c27.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3b0a097.system.js → p-b0ced00a.system.js} +1 -1
- package/dist/zonos-elements/{p-1423ebbe.js → p-b18c4d1d.js} +1 -1
- package/dist/zonos-elements/{p-2deae669.entry.js → p-b4823b13.entry.js} +1 -1
- package/dist/zonos-elements/{p-463e44b6.system.entry.js → p-b7a40db9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-48bca3d4.system.entry.js → p-e3abf96c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e5fc0b.entry.js → p-e4d509be.entry.js} +1 -1
- package/dist/zonos-elements/{p-00136c20.entry.js → p-e8926f59.entry.js} +1 -1
- package/dist/zonos-elements/{p-9951462e.entry.js → p-f824a75f.entry.js} +1 -1
- package/dist/zonos-elements/{p-5834c218.system.js → p-fdb592a8.system.js} +1 -1
- package/dist/zonos-elements/{p-7302a081.system.entry.js → p-fec7bdd4.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-485d89a4.js +0 -17
- package/dist/zonos-elements/p-b262b93e.entry.js +0 -1
|
@@ -1576,7 +1576,7 @@ const stringsDanish = {
|
|
|
1576
1576
|
value: 'Ingen lande fundet',
|
|
1577
1577
|
},
|
|
1578
1578
|
'No payment method needed for staging': {
|
|
1579
|
-
value: 'Ingen betalingsmetode nødvendig
|
|
1579
|
+
value: 'Ingen betalingsmetode nødvendig til iscenesættelse',
|
|
1580
1580
|
},
|
|
1581
1581
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1582
1582
|
value: 'Ingen forsendelsesvurdering valgt. Gå venligst tilbage til "Forsendelse"-trinnet og vælg en forsendelsesvurdering for at fortsætte.',
|
|
@@ -5296,7 +5296,7 @@ const stringsKorean = {
|
|
|
5296
5296
|
value: '국가를 찾을 수 없습니다',
|
|
5297
5297
|
},
|
|
5298
5298
|
'No payment method needed for staging': {
|
|
5299
|
-
value: '스테이징에 결제
|
|
5299
|
+
value: '스테이징에 결제 수단이 필요하지 않습니다',
|
|
5300
5300
|
},
|
|
5301
5301
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5302
5302
|
value: '배송 등급이 선택되지 않았습니다. "배송" 단계로 돌아가서 배송 등급을 선택하여 진행하세요.',
|
|
@@ -7156,7 +7156,7 @@ const stringsRussian = {
|
|
|
7156
7156
|
value: 'Страны не найдены',
|
|
7157
7157
|
},
|
|
7158
7158
|
'No payment method needed for staging': {
|
|
7159
|
-
value: '
|
|
7159
|
+
value: 'Для постановки не требуется способ оплаты',
|
|
7160
7160
|
},
|
|
7161
7161
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
7162
7162
|
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
132
|
-
const cdnUrl = "https://v1.3.
|
|
132
|
+
const cdnUrl = "https://v1.3.145.js.zonos.com";
|
|
133
133
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
134
134
|
if (!qaUrl &&
|
|
135
135
|
(cdnUrl.includes('test.') ||
|
|
@@ -313,10 +313,10 @@ const zonosLoadUrl = (() => {
|
|
|
313
313
|
}
|
|
314
314
|
return null;
|
|
315
315
|
})();
|
|
316
|
-
const ZONOS_URL = "https://v1.3.
|
|
317
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
318
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
319
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
316
|
+
const ZONOS_URL = "https://v1.3.145.js.zonos.com";
|
|
317
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.145";
|
|
318
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.145";
|
|
319
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.145";
|
|
320
320
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
321
321
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
322
322
|
class Zonos {
|
|
@@ -330,7 +330,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
330
330
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
331
331
|
Zonos._paypalMockResponse = null;
|
|
332
332
|
Zonos.isBigCommerce = false;
|
|
333
|
-
Zonos.releaseDate = "
|
|
333
|
+
Zonos.releaseDate = "1735941346400";
|
|
334
334
|
Zonos.isLegacyCheckout = false;
|
|
335
335
|
Zonos.domain = typeof window !== 'undefined'
|
|
336
336
|
? // domain that embeds the iframe
|
|
@@ -346,7 +346,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
346
346
|
Zonos.isNpm = true;
|
|
347
347
|
Zonos.zonosQaUrl = null;
|
|
348
348
|
Zonos.zonosQaUrlApi = null;
|
|
349
|
-
Zonos.version = `v${"1.3.
|
|
349
|
+
Zonos.version = `v${"1.3.145"}`;
|
|
350
350
|
Zonos.modeAlerted = false;
|
|
351
351
|
Zonos.cartData = null;
|
|
352
352
|
Zonos.paypal = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
4
|
-
const cart = require('./cart-
|
|
4
|
+
const cart = require('./cart-9d5e2816.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
6
6
|
const isDarkColor = require('./isDarkColor-2acf30d1.js');
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
9
9
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const paypal = require('./paypal-
|
|
8
|
+
const paypal = require('./paypal-f9015045.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
10
10
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
11
11
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
|
+
const paypal = require('./paypal-f9015045.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
10
10
|
const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
|
|
@@ -442,19 +442,8 @@ const ZonosCheckout = class {
|
|
|
442
442
|
(_b = (_a = zonosStore.zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
443
443
|
}
|
|
444
444
|
async buildCartAndInit() {
|
|
445
|
-
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
446
|
-
if (window.Zonos.cartData) {
|
|
447
|
-
handleFetch.log('tempCartUUID is provided, start building cart');
|
|
448
|
-
const isExpired = this.handleCartExpiredCheck();
|
|
449
|
-
if (isExpired) {
|
|
450
|
-
// Do not proceed if the cart is expired
|
|
451
|
-
return false;
|
|
452
|
-
}
|
|
453
|
-
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
454
|
-
await cart.cartStoreUpdateItems({ adjustments, cartItems });
|
|
455
|
-
}
|
|
456
445
|
// if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
|
|
457
|
-
|
|
446
|
+
if (typeof zonosStore.zonosStore.checkoutSettings.createCartId === 'function') {
|
|
458
447
|
handleFetch.log('"createCartId" is provided, start building cart');
|
|
459
448
|
const cartId = await zonosStore.zonosStore.checkoutSettings.createCartId();
|
|
460
449
|
window.Zonos.cartId = cartId;
|
|
@@ -473,6 +462,17 @@ const ZonosCheckout = class {
|
|
|
473
462
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
474
463
|
await cart.cartStoreUpdateItems({ adjustments, cartItems });
|
|
475
464
|
}
|
|
465
|
+
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
466
|
+
else if (window.Zonos.cartData) {
|
|
467
|
+
handleFetch.log('tempCartUUID is provided, start building cart');
|
|
468
|
+
const isExpired = this.handleCartExpiredCheck();
|
|
469
|
+
if (isExpired) {
|
|
470
|
+
// Do not proceed if the cart is expired
|
|
471
|
+
return false;
|
|
472
|
+
}
|
|
473
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
474
|
+
await cart.cartStoreUpdateItems({ adjustments, cartItems });
|
|
475
|
+
}
|
|
476
476
|
else if (zonosStore.zonosStore.checkoutSettings.buildCartDetail &&
|
|
477
477
|
cart.localizationStore.selectedCountryCode) {
|
|
478
478
|
handleFetch.log('build cart detail');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
8
8
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
9
9
|
require('./isDarkColor-2acf30d1.js');
|
|
@@ -243,17 +243,38 @@ const ZonosController = class {
|
|
|
243
243
|
return oldReplaceState.apply(this, arguments);
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
+
injectCustomHTML(htmlString) {
|
|
247
|
+
if (!htmlString) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
// Skip injecting custom HTML for legacy checkout
|
|
251
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
252
|
+
handleFetch.log('=== Skip injecting custom HTML for hosted checkout', 'info');
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
handleFetch.log('=== Injecting custom HTML for hosted checkout');
|
|
256
|
+
const template = document.createElement('template');
|
|
257
|
+
template.innerHTML = htmlString;
|
|
258
|
+
const scripts = template.content.querySelectorAll('script');
|
|
259
|
+
scripts.forEach(script => {
|
|
260
|
+
const scriptToInject = document.createElement('script');
|
|
261
|
+
scriptToInject.textContent = script.innerHTML;
|
|
262
|
+
document.body.appendChild(scriptToInject);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
246
265
|
async componentWillLoad() {
|
|
247
266
|
this.initHistoryListener();
|
|
248
267
|
zonosStore.zonosStore.zonosApiKey = this.zonosApiKey;
|
|
249
268
|
// running with scope async function to avoid blocking the main thread
|
|
250
269
|
(async () => {
|
|
251
|
-
var _a, _b;
|
|
270
|
+
var _a, _b, _c;
|
|
252
271
|
const { errors, json, zonosMode } = await getZonosSettings();
|
|
253
272
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
254
273
|
handleFetch.log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
255
274
|
return;
|
|
256
275
|
}
|
|
276
|
+
const customHTML = ((_b = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _b === void 0 ? void 0 : _b.customHTML) || '';
|
|
277
|
+
this.injectCustomHTML(customHTML);
|
|
257
278
|
// init zonos notification
|
|
258
279
|
this.initZonosNotification();
|
|
259
280
|
const getLogoUrl = () => {
|
|
@@ -288,7 +309,7 @@ const ZonosController = class {
|
|
|
288
309
|
// init localization store
|
|
289
310
|
await cart.initLocalizationStore();
|
|
290
311
|
// checkout init
|
|
291
|
-
const publishableKey = ((
|
|
312
|
+
const publishableKey = ((_c = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _c === void 0 ? void 0 : _c.externalServiceTokens.find(item => item.type === 'STRIPE_PUBLISHABLE_TOKEN')) || null;
|
|
292
313
|
if (!publishableKey || !this.stripeInitEvent) {
|
|
293
314
|
handleFetch.log('Checkout failed to load -- missing publishable key', 'warn');
|
|
294
315
|
return;
|
|
@@ -357,7 +378,7 @@ const ZonosController = class {
|
|
|
357
378
|
zonosStore.zonosStore.organizationName = organizationName;
|
|
358
379
|
}
|
|
359
380
|
render() {
|
|
360
|
-
return index.h(index.Host, { key: '
|
|
381
|
+
return index.h(index.Host, { key: 'f59eff8c088135e8fc791d03f668e787ec0d0912', class: "zonos--elements" });
|
|
361
382
|
}
|
|
362
383
|
};
|
|
363
384
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
require('./handleFetch-3673a0c2.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
8
8
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
9
9
|
const isDarkColor = require('./isDarkColor-2acf30d1.js');
|
|
@@ -6,9 +6,9 @@ const index = require('./index-2f90486e.js');
|
|
|
6
6
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const getBorderRadius = require('./getBorderRadius-7d0772bf.js');
|
|
9
|
-
const cart = require('./cart-
|
|
9
|
+
const cart = require('./cart-9d5e2816.js');
|
|
10
10
|
const handleFetch = require('./handleFetch-3673a0c2.js');
|
|
11
|
-
const paypal = require('./paypal-
|
|
11
|
+
const paypal = require('./paypal-f9015045.js');
|
|
12
12
|
require('./isDarkColor-2acf30d1.js');
|
|
13
13
|
|
|
14
14
|
const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-2f90486e.js');
|
|
6
6
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
7
|
-
const cart = require('./cart-
|
|
7
|
+
const cart = require('./cart-9d5e2816.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const handleFetch = require('./handleFetch-3673a0c2.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-2f90486e.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-9d5e2816.js');
|
|
7
7
|
const zonosStore = require('./zonosStore-46809186.js');
|
|
8
8
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
9
9
|
require('./handleFetch-3673a0c2.js');
|
|
@@ -232,19 +232,8 @@ export class ZonosCheckout {
|
|
|
232
232
|
(_b = (_a = zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
233
233
|
}
|
|
234
234
|
async buildCartAndInit() {
|
|
235
|
-
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
236
|
-
if (window.Zonos.cartData) {
|
|
237
|
-
log('tempCartUUID is provided, start building cart');
|
|
238
|
-
const isExpired = this.handleCartExpiredCheck();
|
|
239
|
-
if (isExpired) {
|
|
240
|
-
// Do not proceed if the cart is expired
|
|
241
|
-
return false;
|
|
242
|
-
}
|
|
243
|
-
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
244
|
-
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
245
|
-
}
|
|
246
235
|
// if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
|
|
247
|
-
|
|
236
|
+
if (typeof zonosStore.checkoutSettings.createCartId === 'function') {
|
|
248
237
|
log('"createCartId" is provided, start building cart');
|
|
249
238
|
const cartId = await zonosStore.checkoutSettings.createCartId();
|
|
250
239
|
window.Zonos.cartId = cartId;
|
|
@@ -263,6 +252,17 @@ export class ZonosCheckout {
|
|
|
263
252
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
264
253
|
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
265
254
|
}
|
|
255
|
+
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
256
|
+
else if (window.Zonos.cartData) {
|
|
257
|
+
log('tempCartUUID is provided, start building cart');
|
|
258
|
+
const isExpired = this.handleCartExpiredCheck();
|
|
259
|
+
if (isExpired) {
|
|
260
|
+
// Do not proceed if the cart is expired
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
264
|
+
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
265
|
+
}
|
|
266
266
|
else if (zonosStore.checkoutSettings.buildCartDetail &&
|
|
267
267
|
localizationStore.selectedCountryCode) {
|
|
268
268
|
log('build cart detail');
|
|
@@ -92,17 +92,38 @@ export class ZonosController {
|
|
|
92
92
|
return oldReplaceState.apply(this, arguments);
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
+
injectCustomHTML(htmlString) {
|
|
96
|
+
if (!htmlString) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Skip injecting custom HTML for legacy checkout
|
|
100
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
101
|
+
log('=== Skip injecting custom HTML for hosted checkout', 'info');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
log('=== Injecting custom HTML for hosted checkout');
|
|
105
|
+
const template = document.createElement('template');
|
|
106
|
+
template.innerHTML = htmlString;
|
|
107
|
+
const scripts = template.content.querySelectorAll('script');
|
|
108
|
+
scripts.forEach(script => {
|
|
109
|
+
const scriptToInject = document.createElement('script');
|
|
110
|
+
scriptToInject.textContent = script.innerHTML;
|
|
111
|
+
document.body.appendChild(scriptToInject);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
95
114
|
async componentWillLoad() {
|
|
96
115
|
this.initHistoryListener();
|
|
97
116
|
zonosStore.zonosApiKey = this.zonosApiKey;
|
|
98
117
|
// running with scope async function to avoid blocking the main thread
|
|
99
118
|
(async () => {
|
|
100
|
-
var _a, _b;
|
|
119
|
+
var _a, _b, _c;
|
|
101
120
|
const { errors, json, zonosMode } = await getZonosSettings();
|
|
102
121
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
103
122
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
104
123
|
return;
|
|
105
124
|
}
|
|
125
|
+
const customHTML = ((_b = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _b === void 0 ? void 0 : _b.customHTML) || '';
|
|
126
|
+
this.injectCustomHTML(customHTML);
|
|
106
127
|
// init zonos notification
|
|
107
128
|
this.initZonosNotification();
|
|
108
129
|
const getLogoUrl = () => {
|
|
@@ -137,7 +158,7 @@ export class ZonosController {
|
|
|
137
158
|
// init localization store
|
|
138
159
|
await initLocalizationStore();
|
|
139
160
|
// checkout init
|
|
140
|
-
const publishableKey = ((
|
|
161
|
+
const publishableKey = ((_c = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _c === void 0 ? void 0 : _c.externalServiceTokens.find(item => item.type === 'STRIPE_PUBLISHABLE_TOKEN')) || null;
|
|
141
162
|
if (!publishableKey || !this.stripeInitEvent) {
|
|
142
163
|
log('Checkout failed to load -- missing publishable key', 'warn');
|
|
143
164
|
return;
|
|
@@ -206,7 +227,7 @@ export class ZonosController {
|
|
|
206
227
|
zonosStore.organizationName = organizationName;
|
|
207
228
|
}
|
|
208
229
|
render() {
|
|
209
|
-
return h(Host, { key: '
|
|
230
|
+
return h(Host, { key: 'f59eff8c088135e8fc791d03f668e787ec0d0912', class: "zonos--elements" });
|
|
210
231
|
}
|
|
211
232
|
static get is() { return "zonos-controller"; }
|
|
212
233
|
static get encapsulation() { return "shadow"; }
|
|
@@ -174,7 +174,7 @@ export const stringsDanish = {
|
|
|
174
174
|
value: 'Ingen lande fundet',
|
|
175
175
|
},
|
|
176
176
|
'No payment method needed for staging': {
|
|
177
|
-
value: 'Ingen betalingsmetode nødvendig
|
|
177
|
+
value: 'Ingen betalingsmetode nødvendig til iscenesættelse',
|
|
178
178
|
},
|
|
179
179
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
180
180
|
value: 'Ingen forsendelsesvurdering valgt. Gå venligst tilbage til "Forsendelse"-trinnet og vælg en forsendelsesvurdering for at fortsætte.',
|
|
@@ -174,7 +174,7 @@ export const stringsKorean = {
|
|
|
174
174
|
value: '국가를 찾을 수 없습니다',
|
|
175
175
|
},
|
|
176
176
|
'No payment method needed for staging': {
|
|
177
|
-
value: '스테이징에 결제
|
|
177
|
+
value: '스테이징에 결제 수단이 필요하지 않습니다',
|
|
178
178
|
},
|
|
179
179
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
180
180
|
value: '배송 등급이 선택되지 않았습니다. "배송" 단계로 돌아가서 배송 등급을 선택하여 진행하세요.',
|
|
@@ -174,7 +174,7 @@ export const stringsRussian = {
|
|
|
174
174
|
value: 'Страны не найдены',
|
|
175
175
|
},
|
|
176
176
|
'No payment method needed for staging': {
|
|
177
|
-
value: '
|
|
177
|
+
value: 'Для постановки не требуется способ оплаты',
|
|
178
178
|
},
|
|
179
179
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
180
180
|
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
|
@@ -1574,7 +1574,7 @@ const stringsDanish = {
|
|
|
1574
1574
|
value: 'Ingen lande fundet',
|
|
1575
1575
|
},
|
|
1576
1576
|
'No payment method needed for staging': {
|
|
1577
|
-
value: 'Ingen betalingsmetode nødvendig
|
|
1577
|
+
value: 'Ingen betalingsmetode nødvendig til iscenesættelse',
|
|
1578
1578
|
},
|
|
1579
1579
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
1580
1580
|
value: 'Ingen forsendelsesvurdering valgt. Gå venligst tilbage til "Forsendelse"-trinnet og vælg en forsendelsesvurdering for at fortsætte.',
|
|
@@ -5294,7 +5294,7 @@ const stringsKorean = {
|
|
|
5294
5294
|
value: '국가를 찾을 수 없습니다',
|
|
5295
5295
|
},
|
|
5296
5296
|
'No payment method needed for staging': {
|
|
5297
|
-
value: '스테이징에 결제
|
|
5297
|
+
value: '스테이징에 결제 수단이 필요하지 않습니다',
|
|
5298
5298
|
},
|
|
5299
5299
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
5300
5300
|
value: '배송 등급이 선택되지 않았습니다. "배송" 단계로 돌아가서 배송 등급을 선택하여 진행하세요.',
|
|
@@ -7154,7 +7154,7 @@ const stringsRussian = {
|
|
|
7154
7154
|
value: 'Страны не найдены',
|
|
7155
7155
|
},
|
|
7156
7156
|
'No payment method needed for staging': {
|
|
7157
|
-
value: '
|
|
7157
|
+
value: 'Для постановки не требуется способ оплаты',
|
|
7158
7158
|
},
|
|
7159
7159
|
'No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.': {
|
|
7160
7160
|
value: 'Не выбран рейтинг доставки. Пожалуйста, вернитесь к шагу "Доставка" и выберите рейтинг доставки, чтобы продолжить.',
|
package/dist/esm/index.js
CHANGED
|
@@ -126,7 +126,7 @@ const getZonosQaUrl = () => {
|
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
129
|
-
const cdnUrl = "https://v1.3.
|
|
129
|
+
const cdnUrl = "https://v1.3.145.js.zonos.com";
|
|
130
130
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
131
131
|
if (!qaUrl &&
|
|
132
132
|
(cdnUrl.includes('test.') ||
|
|
@@ -310,10 +310,10 @@ const zonosLoadUrl = (() => {
|
|
|
310
310
|
}
|
|
311
311
|
return null;
|
|
312
312
|
})();
|
|
313
|
-
const ZONOS_URL = "https://v1.3.
|
|
314
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
315
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
316
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
313
|
+
const ZONOS_URL = "https://v1.3.145.js.zonos.com";
|
|
314
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.145";
|
|
315
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.145";
|
|
316
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.145";
|
|
317
317
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
318
318
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
319
319
|
class Zonos {
|
|
@@ -327,7 +327,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
|
|
|
327
327
|
!!window.location.search.match(/\?.*(&*)zonosConversionTest/);
|
|
328
328
|
Zonos._paypalMockResponse = null;
|
|
329
329
|
Zonos.isBigCommerce = false;
|
|
330
|
-
Zonos.releaseDate = "
|
|
330
|
+
Zonos.releaseDate = "1735941346400";
|
|
331
331
|
Zonos.isLegacyCheckout = false;
|
|
332
332
|
Zonos.domain = typeof window !== 'undefined'
|
|
333
333
|
? // domain that embeds the iframe
|
|
@@ -343,7 +343,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
|
|
|
343
343
|
Zonos.isNpm = true;
|
|
344
344
|
Zonos.zonosQaUrl = null;
|
|
345
345
|
Zonos.zonosQaUrlApi = null;
|
|
346
|
-
Zonos.version = `v${"1.3.
|
|
346
|
+
Zonos.version = `v${"1.3.145"}`;
|
|
347
347
|
Zonos.modeAlerted = false;
|
|
348
348
|
Zonos.cartData = null;
|
|
349
349
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as zonosStore, c as createStore } from './zonosStore-44efd080.js';
|
|
2
|
-
import { C as validateCheckoutSession, f as stripeStore, e as cartStore, x as stripeStoreHandleInventoryCheck, q as translate, w as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-
|
|
2
|
+
import { C as validateCheckoutSession, f as stripeStore, e as cartStore, x as stripeStoreHandleInventoryCheck, q as translate, w as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-887f7d66.js';
|
|
3
3
|
import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-b4633675.js';
|
|
4
4
|
import { t as tinycolor } from './isDarkColor-10f38df6.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { f as stripeStore, T as getFallbackDefaultCountryCode, l as localizationStore, q as translate, e as cartStore } from './cart-
|
|
2
|
+
import { f as stripeStore, T as getFallbackDefaultCountryCode, l as localizationStore, q as translate, e as cartStore } from './cart-887f7d66.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { b as logError, l as log } from './handleFetch-b4633675.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-d82f06f2.js';
|
|
2
|
-
import { e as cartStore, J as currencyFormat, q as translate, K as cartStoreHasOneEligibleItem, L as stripeStoreApplyPromoCode, M as stripeStoreRemovePromoCode, f as stripeStore, A as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, N as stripeStoreResetPromoCode, O as stripeStoreMessageBasedOnStatus, l as localizationStore, w as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as cartStoreUpdateSelectedShippingOption, R as cartStoreGetShippingTransitInfo, S as sortServiceLevelOptionsByAmount } from './cart-
|
|
2
|
+
import { e as cartStore, J as currencyFormat, q as translate, K as cartStoreHasOneEligibleItem, L as stripeStoreApplyPromoCode, M as stripeStoreRemovePromoCode, f as stripeStore, A as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, N as stripeStoreResetPromoCode, O as stripeStoreMessageBasedOnStatus, l as localizationStore, w as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as cartStoreUpdateSelectedShippingOption, R as cartStoreGetShippingTransitInfo, S as sortServiceLevelOptionsByAmount } from './cart-887f7d66.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-
|
|
4
|
+
import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-6fd5749b.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
6
6
|
import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-b4633675.js';
|
|
7
7
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-d82f06f2.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as cartStoreStartCheckoutInterval, t as trackConversionEvent, o as getCheckoutSessionBody, p as cartStoreUpdateToErrorState, q as translate, r as getZCountryUrlParam, u as cartStoreSetCheckoutSession, v as stripeStorePrefetchLandedCost, w as cartStoreNextStep, x as stripeStoreHandleInventoryCheck, y as stripeStoreConfirmPayment, z as stripeStoreHandleInventoryRefund, A as stripeStoreReset, B as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as cartStoreStartCheckoutInterval, t as trackConversionEvent, o as getCheckoutSessionBody, p as cartStoreUpdateToErrorState, q as translate, r as getZCountryUrlParam, u as cartStoreSetCheckoutSession, v as stripeStorePrefetchLandedCost, w as cartStoreNextStep, x as stripeStoreHandleInventoryCheck, y as stripeStoreConfirmPayment, z as stripeStoreHandleInventoryRefund, A as stripeStoreReset, B as localizationStoreOnUpdate } from './cart-887f7d66.js';
|
|
3
|
+
import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-6fd5749b.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-44efd080.js';
|
|
5
5
|
import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-b4633675.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -438,19 +438,8 @@ const ZonosCheckout = class {
|
|
|
438
438
|
(_b = (_a = zonosStore.checkoutSettings).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
439
439
|
}
|
|
440
440
|
async buildCartAndInit() {
|
|
441
|
-
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
442
|
-
if (window.Zonos.cartData) {
|
|
443
|
-
log('tempCartUUID is provided, start building cart');
|
|
444
|
-
const isExpired = this.handleCartExpiredCheck();
|
|
445
|
-
if (isExpired) {
|
|
446
|
-
// Do not proceed if the cart is expired
|
|
447
|
-
return false;
|
|
448
|
-
}
|
|
449
|
-
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
450
|
-
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
451
|
-
}
|
|
452
441
|
// if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
|
|
453
|
-
|
|
442
|
+
if (typeof zonosStore.checkoutSettings.createCartId === 'function') {
|
|
454
443
|
log('"createCartId" is provided, start building cart');
|
|
455
444
|
const cartId = await zonosStore.checkoutSettings.createCartId();
|
|
456
445
|
window.Zonos.cartId = cartId;
|
|
@@ -469,6 +458,17 @@ const ZonosCheckout = class {
|
|
|
469
458
|
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
470
459
|
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
471
460
|
}
|
|
461
|
+
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
462
|
+
else if (window.Zonos.cartData) {
|
|
463
|
+
log('tempCartUUID is provided, start building cart');
|
|
464
|
+
const isExpired = this.handleCartExpiredCheck();
|
|
465
|
+
if (isExpired) {
|
|
466
|
+
// Do not proceed if the cart is expired
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
470
|
+
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
471
|
+
}
|
|
472
472
|
else if (zonosStore.checkoutSettings.buildCartDetail &&
|
|
473
473
|
localizationStore.selectedCountryCode) {
|
|
474
474
|
log('build cart detail');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-d82f06f2.js';
|
|
2
|
-
import { D as isValidSelector, f as stripeStore, E as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { D as isValidSelector, f as stripeStore, E as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-887f7d66.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-44efd080.js';
|
|
4
4
|
import { h as handleFetch, b as logError, l as log } from './handleFetch-b4633675.js';
|
|
5
5
|
import './isDarkColor-10f38df6.js';
|
|
@@ -239,17 +239,38 @@ const ZonosController = class {
|
|
|
239
239
|
return oldReplaceState.apply(this, arguments);
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
+
injectCustomHTML(htmlString) {
|
|
243
|
+
if (!htmlString) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
// Skip injecting custom HTML for legacy checkout
|
|
247
|
+
if (!window.Zonos.isLegacyCheckout) {
|
|
248
|
+
log('=== Skip injecting custom HTML for hosted checkout', 'info');
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
log('=== Injecting custom HTML for hosted checkout');
|
|
252
|
+
const template = document.createElement('template');
|
|
253
|
+
template.innerHTML = htmlString;
|
|
254
|
+
const scripts = template.content.querySelectorAll('script');
|
|
255
|
+
scripts.forEach(script => {
|
|
256
|
+
const scriptToInject = document.createElement('script');
|
|
257
|
+
scriptToInject.textContent = script.innerHTML;
|
|
258
|
+
document.body.appendChild(scriptToInject);
|
|
259
|
+
});
|
|
260
|
+
}
|
|
242
261
|
async componentWillLoad() {
|
|
243
262
|
this.initHistoryListener();
|
|
244
263
|
zonosStore.zonosApiKey = this.zonosApiKey;
|
|
245
264
|
// running with scope async function to avoid blocking the main thread
|
|
246
265
|
(async () => {
|
|
247
|
-
var _a, _b;
|
|
266
|
+
var _a, _b, _c;
|
|
248
267
|
const { errors, json, zonosMode } = await getZonosSettings();
|
|
249
268
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
250
269
|
log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
251
270
|
return;
|
|
252
271
|
}
|
|
272
|
+
const customHTML = ((_b = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _b === void 0 ? void 0 : _b.customHTML) || '';
|
|
273
|
+
this.injectCustomHTML(customHTML);
|
|
253
274
|
// init zonos notification
|
|
254
275
|
this.initZonosNotification();
|
|
255
276
|
const getLogoUrl = () => {
|
|
@@ -284,7 +305,7 @@ const ZonosController = class {
|
|
|
284
305
|
// init localization store
|
|
285
306
|
await initLocalizationStore();
|
|
286
307
|
// checkout init
|
|
287
|
-
const publishableKey = ((
|
|
308
|
+
const publishableKey = ((_c = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _c === void 0 ? void 0 : _c.externalServiceTokens.find(item => item.type === 'STRIPE_PUBLISHABLE_TOKEN')) || null;
|
|
288
309
|
if (!publishableKey || !this.stripeInitEvent) {
|
|
289
310
|
log('Checkout failed to load -- missing publishable key', 'warn');
|
|
290
311
|
return;
|
|
@@ -353,7 +374,7 @@ const ZonosController = class {
|
|
|
353
374
|
zonosStore.organizationName = organizationName;
|
|
354
375
|
}
|
|
355
376
|
render() {
|
|
356
|
-
return h(Host, { key: '
|
|
377
|
+
return h(Host, { key: 'f59eff8c088135e8fc791d03f668e787ec0d0912', class: "zonos--elements" });
|
|
357
378
|
}
|
|
358
379
|
};
|
|
359
380
|
ZonosController.style = ZonosControllerStyle0;
|