@zonos/elements 1.3.247 → 1.3.248
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-97a2d20a.js → cart-28310848.js} +2 -0
- package/dist/cjs/index.cjs.js +14 -7
- package/dist/cjs/{invoice-05a10ee1.js → invoice-2e8e5879.js} +1 -1
- package/dist/cjs/{isCollectMobileTablet-edd4804c.js → isCollectMobileTablet-bd0f4556.js} +1 -1
- package/dist/cjs/{paypal-0b4b352b.js → paypal-3019ae94.js} +21 -18
- package/dist/cjs/{placeTestOrder-07b46688.js → placeTestOrder-b0369cfd.js} +1 -1
- package/dist/cjs/{renderCheckoutCurrency-dd3b0609.js → renderCheckoutCurrency-9e919b9f.js} +1 -1
- package/dist/cjs/submitGtag-a50ab32e.js +116 -0
- package/dist/cjs/zonos-address-display_9.cjs.entry.js +1 -1
- package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-card_5.cjs.entry.js +3 -2
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +109 -17
- package/dist/cjs/zonos-checkout.cjs.entry.js +27 -6
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +88 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +9 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +24 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +9 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +5 -5
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +5 -5
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +4 -1
- package/dist/collection/components/store/checkout/paypal.js +19 -1
- package/dist/collection/components/store/checkout/stripe.js +2 -0
- package/dist/collection/components/utils/submitGtag.js +90 -2
- package/dist/collection/scripts/_zonosBase.js +7 -0
- package/dist/collection/types/analyticsRelay.js +6 -0
- package/dist/esm/{cart-99ec4a3d.js → cart-ba8f3890.js} +2 -0
- package/dist/esm/index.js +14 -7
- package/dist/esm/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
- package/dist/esm/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
- package/dist/esm/{paypal-56534e48.js → paypal-8d8518c0.js} +23 -19
- package/dist/esm/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
- package/dist/esm/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
- package/dist/esm/submitGtag-89d6e9cb.js +113 -0
- package/dist/esm/zonos-address-display_9.entry.js +1 -1
- package/dist/esm/zonos-address_4.entry.js +1 -1
- package/dist/esm/zonos-card_5.entry.js +3 -2
- package/dist/esm/zonos-cart-items_12.entry.js +109 -17
- package/dist/esm/zonos-checkout.entry.js +27 -6
- package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
- package/dist/esm/zonos-collect.entry.js +4 -3
- package/dist/esm/zonos-controller.entry.js +5 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
- package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
- package/dist/esm/zonos-invoice.entry.js +4 -3
- package/dist/esm-es5/{cart-99ec4a3d.js → cart-ba8f3890.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
- package/dist/esm-es5/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
- package/dist/esm-es5/paypal-8d8518c0.js +17 -0
- package/dist/esm-es5/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
- package/dist/esm-es5/submitGtag-89d6e9cb.js +1 -0
- package/dist/esm-es5/zonos-address-display_9.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.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-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/scripts/analyticsRelayOnInit.js +1 -0
- package/dist/scripts/index.d.ts +11 -0
- 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-checkout-finish/zonos-checkout-finish.d.ts +4 -0
- package/dist/types/components/store/checkout/stripe.d.ts +6 -0
- package/dist/types/components/utils/submitGtag.d.ts +32 -2
- package/dist/types/scripts/_zonosBase.d.ts +11 -0
- package/dist/types/types/analyticsRelay.d.ts +12 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-002e45f9.system.js +17 -0
- package/dist/zonos-elements/p-0792688d.system.entry.js +1 -0
- package/dist/zonos-elements/p-0b7beb16.system.entry.js +1 -0
- package/dist/zonos-elements/p-0f787f5d.entry.js +1 -0
- package/dist/zonos-elements/{p-2e8f842c.entry.js → p-0ff93ca6.entry.js} +1 -1
- package/dist/zonos-elements/{p-10355cf6.system.entry.js → p-1acf0a71.system.entry.js} +1 -1
- package/dist/zonos-elements/p-291f7ccb.system.entry.js +1 -0
- package/dist/zonos-elements/p-3972663a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-53a9da45.entry.js → p-39fa55c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-f6f1d779.system.entry.js → p-3e85b9f5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-48475755.entry.js +1 -0
- package/dist/zonos-elements/{p-d0411b2d.entry.js → p-58248f03.entry.js} +1 -1
- package/dist/zonos-elements/p-5edef7c3.system.js +1 -0
- package/dist/zonos-elements/{p-678331f0.system.js → p-63a3d3b9.system.js} +1 -1
- package/dist/zonos-elements/p-64661dd1.js +1 -0
- package/dist/zonos-elements/p-69212d0f.entry.js +1 -0
- package/dist/zonos-elements/{p-71185d24.system.js → p-719403e0.system.js} +1 -1
- package/dist/zonos-elements/{p-382601a9.system.entry.js → p-71a8d971.system.entry.js} +1 -1
- package/dist/zonos-elements/p-71d855b8.system.entry.js +1 -0
- package/dist/zonos-elements/p-71f10bf0.entry.js +1 -0
- package/dist/zonos-elements/p-72ff005c.entry.js +1 -0
- package/dist/zonos-elements/{p-08365fdb.system.js → p-7dba5f23.system.js} +1 -1
- package/dist/zonos-elements/p-85e59f3a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ce98e472.js → p-866afec1.js} +1 -1
- package/dist/zonos-elements/p-942358eb.system.js +1 -0
- package/dist/zonos-elements/{p-2c10b067.system.entry.js → p-94c5fbfc.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a12cb7ce.entry.js +1 -0
- package/dist/zonos-elements/p-abf38ed6.js +1 -0
- package/dist/zonos-elements/{p-df6e62f8.system.js → p-ae16dda9.system.js} +1 -1
- package/dist/zonos-elements/{p-46ece7ae.js → p-bc4bfa06.js} +1 -1
- package/dist/zonos-elements/p-bf5e47e2.entry.js +1 -0
- package/dist/zonos-elements/{p-dca14319.system.js → p-c027a832.system.js} +1 -1
- package/dist/zonos-elements/p-c2442878.system.js +1 -1
- package/dist/zonos-elements/p-c2f34b10.system.entry.js +1 -0
- package/dist/zonos-elements/p-c36696f9.js +1 -0
- package/dist/zonos-elements/p-c7311ce5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1b86711b.js → p-de8899bc.js} +1 -1
- package/dist/zonos-elements/p-e17bbcee.entry.js +1 -0
- package/dist/zonos-elements/{p-e458f737.entry.js → p-f6c2c743.entry.js} +1 -1
- package/dist/zonos-elements/p-fe06c9ea.js +17 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/paypal-56534e48.js +0 -17
- package/dist/zonos-elements/p-0c201c39.system.entry.js +0 -1
- package/dist/zonos-elements/p-0cb5f151.system.entry.js +0 -1
- package/dist/zonos-elements/p-3e2f175c.entry.js +0 -1
- package/dist/zonos-elements/p-5295d36e.entry.js +0 -1
- package/dist/zonos-elements/p-64870563.entry.js +0 -1
- package/dist/zonos-elements/p-695e0803.system.entry.js +0 -1
- package/dist/zonos-elements/p-6e3cf6eb.entry.js +0 -1
- package/dist/zonos-elements/p-6f430d6f.system.entry.js +0 -1
- package/dist/zonos-elements/p-794d29dc.entry.js +0 -1
- package/dist/zonos-elements/p-8defdf0d.system.js +0 -17
- package/dist/zonos-elements/p-8e98a7c8.js +0 -1
- package/dist/zonos-elements/p-95348ebf.system.entry.js +0 -1
- package/dist/zonos-elements/p-9a066833.system.entry.js +0 -1
- package/dist/zonos-elements/p-aa6c2348.system.entry.js +0 -1
- package/dist/zonos-elements/p-ada8841a.js +0 -1
- package/dist/zonos-elements/p-c75b7c47.entry.js +0 -1
- package/dist/zonos-elements/p-caff391d.system.entry.js +0 -1
- package/dist/zonos-elements/p-dd19d9d8.js +0 -17
- package/dist/zonos-elements/p-df90bccf.entry.js +0 -1
- package/dist/zonos-elements/p-e07aaf09.system.js +0 -1
- package/dist/zonos-elements/p-f8eb618b.entry.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-0bbe9693.js';
|
|
2
2
|
import { t as throttle_1 } from './throttle-ce2432ab.js';
|
|
3
|
-
import { b as stripeStore, t as trackConversionEvent, K as extractName, B as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-
|
|
3
|
+
import { b as stripeStore, t as trackConversionEvent, K as extractName, B as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-ba8f3890.js';
|
|
4
4
|
import { s as storageStore, r as getFallbackDefaultCountryCode, t as translate, q as storageStoreOnChange, l as localizationStore } from './localization-853b48a9.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-b434e436.js';
|
|
6
6
|
import { l as logError, i as isCheckoutMobile, s as sendErrorLog } from './handleFetch-a844cac1.js';
|
|
@@ -2,13 +2,14 @@ import { r as registerInstance, h, H as Host, a as getElement, c as createEvent
|
|
|
2
2
|
import { f as zonosStoreFontFamily } from './zonosStore-b434e436.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
|
|
5
|
-
import { b as stripeStore, t as trackConversionEvent } from './cart-
|
|
5
|
+
import { b as stripeStore, t as trackConversionEvent } from './cart-ba8f3890.js';
|
|
6
6
|
import { s as storageStore } from './localization-853b48a9.js';
|
|
7
7
|
import { l as logError } from './handleFetch-a844cac1.js';
|
|
8
|
-
import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-
|
|
8
|
+
import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-8d8518c0.js';
|
|
9
9
|
import { l as log } from './VarianceTest-572cecf5.js';
|
|
10
10
|
import './isDarkColor-9ddd90cc.js';
|
|
11
11
|
import './isContrastColor-69778cea.js';
|
|
12
|
+
import './submitGtag-89d6e9cb.js';
|
|
12
13
|
|
|
13
14
|
const zonosCardCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
|
|
14
15
|
const ZonosCardStyle0 = zonosCardCss;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { r as registerInstance, d as getAssetPath, h, H as Host, F as Fragment, c as createEvent, a as getElement } from './index-0bbe9693.js';
|
|
2
|
-
import { d as cartStore, E as cartStoreHasOneEligibleItem, F as stripeStoreApplyPromoCode, G as stripeStoreRemovePromoCode, b as stripeStore, y as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, I as stripeStoreMessageBasedOnStatus, r as cartStoreNextStep, J as stripeStoreTranslateAddressToLatin, K as extractName, z as cartStoreOnChange, L as stripeStoreAsyncAddressUpdate, D as cartStoreUpdateSelectedShippingOption, M as cartStoreGetShippingTransitInfo, N as cartStoreGetMethod, O as sortServiceLevelOptionsByAmount } from './cart-
|
|
2
|
+
import { d as cartStore, E as cartStoreHasOneEligibleItem, F as stripeStoreApplyPromoCode, G as stripeStoreRemovePromoCode, b as stripeStore, y as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, I as stripeStoreMessageBasedOnStatus, r as cartStoreNextStep, J as stripeStoreTranslateAddressToLatin, K as extractName, z as cartStoreOnChange, L as stripeStoreAsyncAddressUpdate, D as cartStoreUpdateSelectedShippingOption, M as cartStoreGetShippingTransitInfo, N as cartStoreGetMethod, O as sortServiceLevelOptionsByAmount } from './cart-ba8f3890.js';
|
|
3
3
|
import { t as translate, l as localizationStore, s as storageStore, c as localizationStoreOnChange } from './localization-853b48a9.js';
|
|
4
|
-
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-
|
|
4
|
+
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-bd059ecf.js';
|
|
5
5
|
import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-b5b18743.js';
|
|
6
6
|
import { c as classes } from './classes-0d95c529.js';
|
|
7
7
|
import { z as zonosStore, h as zonosStoreOnChange, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-b434e436.js';
|
|
8
8
|
import { D as DUTY_KEY, T as TAXES_KEY, h as hasInclusivePrice } from './hasInclusivePrice-6fcc712f.js';
|
|
9
|
-
import {
|
|
9
|
+
import { c as paypalStoreReset, a as paypalStore } from './paypal-8d8518c0.js';
|
|
10
10
|
import { h as handleFetch, s as sendErrorLog, j as jsonParse, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
|
|
11
11
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
12
12
|
import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
|
|
13
13
|
import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
|
|
14
|
+
import { s as submitGtag } from './submitGtag-89d6e9cb.js';
|
|
14
15
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
15
|
-
import { p as placeTestOrder } from './placeTestOrder-
|
|
16
|
+
import { p as placeTestOrder } from './placeTestOrder-0a74923e.js';
|
|
16
17
|
import { i as isDarkColor } from './isDarkColor-9ddd90cc.js';
|
|
17
18
|
import { g as getContrastColor } from './getContrastColor-28c18704.js';
|
|
18
19
|
import { i as isColorVariable } from './isColorVariable-0a94004f.js';
|
|
@@ -355,6 +356,56 @@ const ZonosCheckoutFinish = class {
|
|
|
355
356
|
order: json,
|
|
356
357
|
};
|
|
357
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* Metadata for purchase event in GA4
|
|
361
|
+
*/
|
|
362
|
+
this.buildPurchaseMetadata = ({ checkoutSessionId, currency, }) => {
|
|
363
|
+
var _a, _b, _c, _d, _e, _f;
|
|
364
|
+
const items = cartStore.items
|
|
365
|
+
.filter(item => item.amount >= 0)
|
|
366
|
+
.map(item => ({
|
|
367
|
+
item_id: item.sku || item.productId || item.name,
|
|
368
|
+
item_name: item.name,
|
|
369
|
+
price: item.amount,
|
|
370
|
+
quantity: item.quantity,
|
|
371
|
+
}));
|
|
372
|
+
/**
|
|
373
|
+
* The value of this parameter should be the sum of all item amounts in the transaction (without shipping and tax).
|
|
374
|
+
* @ref https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#parameters_22
|
|
375
|
+
*/
|
|
376
|
+
const subtotal = ((_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.subtotals.items) ||
|
|
377
|
+
((_b = this.order) === null || _b === void 0 ? void 0 : _b.amountSubtotals.items);
|
|
378
|
+
const currencyCode = ((_c = cartStore.checkoutSession) === null || _c === void 0 ? void 0 : _c.subtotals.presentmentCurrencyCode) ||
|
|
379
|
+
((_d = this.order) === null || _d === void 0 ? void 0 : _d.currencyCode) ||
|
|
380
|
+
(currency === null || currency === void 0 ? void 0 : currency.toUpperCase());
|
|
381
|
+
// Cart subtotal amount, can be different on the final checkout session/payment intent, therefore only use it if the order/checkout session can not be found.
|
|
382
|
+
const cartSubtotal = items.reduce((acc, item) => acc + item.price * item.quantity, 0);
|
|
383
|
+
const cartCurrency = (_e = cartStore.items.find(Boolean)) === null || _e === void 0 ? void 0 : _e.currencyCode;
|
|
384
|
+
const transactionId = ((_f = this.order) === null || _f === void 0 ? void 0 : _f.id) || checkoutSessionId || new Date().getTime().toString();
|
|
385
|
+
if (currencyCode && subtotal) {
|
|
386
|
+
return {
|
|
387
|
+
currency: currencyCode,
|
|
388
|
+
items,
|
|
389
|
+
transaction_id: transactionId,
|
|
390
|
+
value: subtotal,
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
// Use cart currency and subtotal if the order/checkout session can not be found
|
|
394
|
+
if (cartCurrency && cartSubtotal) {
|
|
395
|
+
return {
|
|
396
|
+
currency: cartCurrency,
|
|
397
|
+
items,
|
|
398
|
+
transaction_id: transactionId,
|
|
399
|
+
value: cartSubtotal,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
return {
|
|
403
|
+
currency: undefined,
|
|
404
|
+
items,
|
|
405
|
+
transaction_id: transactionId,
|
|
406
|
+
value: undefined,
|
|
407
|
+
};
|
|
408
|
+
};
|
|
358
409
|
this.redirectToUrl = (url) => {
|
|
359
410
|
// reset store and checkout session id before redirecting
|
|
360
411
|
stripeStoreReset();
|
|
@@ -537,7 +588,7 @@ const ZonosCheckoutFinish = class {
|
|
|
537
588
|
this.checkStripePaymentStatus = async () => {
|
|
538
589
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
|
|
539
590
|
if (clientSecret || this.storybookForceStatus) {
|
|
540
|
-
const { error, messages, status } = await stripeStoreRetrievePayment({
|
|
591
|
+
const { currency, error, messages, status } = await stripeStoreRetrievePayment({
|
|
541
592
|
clientSecret,
|
|
542
593
|
storybookForceStatus: this.storybookForceStatus,
|
|
543
594
|
});
|
|
@@ -563,7 +614,12 @@ const ZonosCheckoutFinish = class {
|
|
|
563
614
|
window.history.replaceState({}, '', url.toString());
|
|
564
615
|
// Payment doesn't go through
|
|
565
616
|
if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
566
|
-
submitGtag(
|
|
617
|
+
submitGtag({
|
|
618
|
+
event: 'zonos-checkout-payment-fail',
|
|
619
|
+
metadata: {
|
|
620
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
621
|
+
},
|
|
622
|
+
});
|
|
567
623
|
void sendErrorLog({
|
|
568
624
|
endpoint: 'Stripe payment failed',
|
|
569
625
|
errors: [
|
|
@@ -578,8 +634,21 @@ const ZonosCheckoutFinish = class {
|
|
|
578
634
|
else {
|
|
579
635
|
// Save new order info in case the user reloads before we get order info
|
|
580
636
|
this.saveOrderIdForDuplicationIssue();
|
|
581
|
-
submitGtag('zonos-checkout-success');
|
|
582
637
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
638
|
+
submitGtag({
|
|
639
|
+
event: 'zonos-checkout-success',
|
|
640
|
+
metadata: this.buildPurchaseMetadata({
|
|
641
|
+
checkoutSessionId: checkoutSessionId || '',
|
|
642
|
+
currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
|
|
643
|
+
}),
|
|
644
|
+
});
|
|
645
|
+
submitGtag({
|
|
646
|
+
event: 'purchase',
|
|
647
|
+
metadata: this.buildPurchaseMetadata({
|
|
648
|
+
checkoutSessionId: checkoutSessionId || '',
|
|
649
|
+
currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
|
|
650
|
+
}),
|
|
651
|
+
});
|
|
583
652
|
void trackConversionEvent({
|
|
584
653
|
checkoutSessionId,
|
|
585
654
|
eventName: 'checkout_orderCompleted',
|
|
@@ -625,7 +694,18 @@ const ZonosCheckoutFinish = class {
|
|
|
625
694
|
// show success message right away when order id is already created
|
|
626
695
|
this.isLoading = false;
|
|
627
696
|
if (paypalStore.orderIdCreated) {
|
|
628
|
-
submitGtag(
|
|
697
|
+
submitGtag({
|
|
698
|
+
event: 'zonos-checkout-success',
|
|
699
|
+
metadata: this.buildPurchaseMetadata({
|
|
700
|
+
checkoutSessionId: storageStore.checkoutSessionId || '',
|
|
701
|
+
}),
|
|
702
|
+
});
|
|
703
|
+
submitGtag({
|
|
704
|
+
event: 'purchase',
|
|
705
|
+
metadata: this.buildPurchaseMetadata({
|
|
706
|
+
checkoutSessionId: storageStore.checkoutSessionId || '',
|
|
707
|
+
}),
|
|
708
|
+
});
|
|
629
709
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
630
710
|
void trackConversionEvent({
|
|
631
711
|
checkoutSessionId,
|
|
@@ -687,11 +767,11 @@ const ZonosCheckoutFinish = class {
|
|
|
687
767
|
}
|
|
688
768
|
render() {
|
|
689
769
|
const isTestMode = getIsTestMode();
|
|
690
|
-
return (h(Host, { key: '
|
|
770
|
+
return (h(Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
|
|
691
771
|
'--zonos--border-radius': getBorderRadius({
|
|
692
772
|
overrideBorderStyle: this.borderRadius,
|
|
693
773
|
}),
|
|
694
|
-
} }, !this.isLoading && (h("div", { key: '
|
|
774
|
+
} }, !this.isLoading && (h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
|
|
695
775
|
// Only show loading spinner if it's not an error notification
|
|
696
776
|
loading: this.isWaitingToRedirect &&
|
|
697
777
|
this.notificationType !== 'error', onClick: () => {
|
|
@@ -703,9 +783,9 @@ const ZonosCheckoutFinish = class {
|
|
|
703
783
|
}
|
|
704
784
|
this.closeClickHandler();
|
|
705
785
|
}, size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
|
|
706
|
-
this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '
|
|
786
|
+
this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
|
|
707
787
|
cartStore.step === 'finish' &&
|
|
708
|
-
this.notificationType === 'success' && (h("div", { key: '
|
|
788
|
+
this.notificationType === 'success' && (h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
|
|
709
789
|
const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
|
|
710
790
|
this.redirectToUrl(isZonosDashboard
|
|
711
791
|
? '/orders/all'
|
|
@@ -823,7 +903,7 @@ const ZonosCheckoutPayment = class {
|
|
|
823
903
|
* handler for continue button click
|
|
824
904
|
*/
|
|
825
905
|
this.continueClickHandler = async ({ currencyCode, }) => {
|
|
826
|
-
var _a;
|
|
906
|
+
var _a, _b;
|
|
827
907
|
if (!this.handleValidate()) {
|
|
828
908
|
this.showErrorBanner = true;
|
|
829
909
|
// Attempt to submit the form so the missing input error will be shown in Stripe
|
|
@@ -838,7 +918,13 @@ const ZonosCheckoutPayment = class {
|
|
|
838
918
|
}
|
|
839
919
|
stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
840
920
|
// submit google tag when the form is complete
|
|
841
|
-
submitGtag(
|
|
921
|
+
submitGtag({
|
|
922
|
+
event: 'zonos-checkout-payment-info',
|
|
923
|
+
metadata: {
|
|
924
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
925
|
+
paymentMethod: (_b = stripeStore.stripePaymentEventData) === null || _b === void 0 ? void 0 : _b.value.type,
|
|
926
|
+
},
|
|
927
|
+
});
|
|
842
928
|
this.continueClicked.emit();
|
|
843
929
|
};
|
|
844
930
|
this.copyCardToClipboard = async (cardNumber) => {
|
|
@@ -1945,20 +2031,26 @@ const ZonosShipping = class {
|
|
|
1945
2031
|
* handler for continue button click
|
|
1946
2032
|
*/
|
|
1947
2033
|
this.continueClickHandler = () => {
|
|
1948
|
-
var _a;
|
|
2034
|
+
var _a, _b;
|
|
1949
2035
|
// show error banner if the form is not complete
|
|
1950
2036
|
if (!this.handleValidate()) {
|
|
1951
2037
|
this.showErrorBanner = true;
|
|
1952
2038
|
return;
|
|
1953
2039
|
}
|
|
1954
2040
|
// submit google tag when the form is complete
|
|
1955
|
-
submitGtag(
|
|
2041
|
+
submitGtag({
|
|
2042
|
+
event: 'zonos-checkout-shipping-info',
|
|
2043
|
+
metadata: {
|
|
2044
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
2045
|
+
serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
|
|
2046
|
+
},
|
|
2047
|
+
});
|
|
1956
2048
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
1957
2049
|
void trackConversionEvent({
|
|
1958
2050
|
checkoutSessionId,
|
|
1959
2051
|
eventName: 'checkout_shippingInfoCompleted',
|
|
1960
2052
|
metadata: {
|
|
1961
|
-
serviceLevelId: (
|
|
2053
|
+
serviceLevelId: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value,
|
|
1962
2054
|
},
|
|
1963
2055
|
});
|
|
1964
2056
|
this.showErrorBanner = false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, F as Fragment, H as Host } from './index-0bbe9693.js';
|
|
2
|
-
import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset, z as cartStoreOnChange } from './cart-
|
|
3
|
-
import { p as paypalStoreHasPaypalEnabled,
|
|
2
|
+
import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset, z as cartStoreOnChange } from './cart-ba8f3890.js';
|
|
3
|
+
import { p as paypalStoreHasPaypalEnabled, a as paypalStore, b as paypalInitScript } from './paypal-8d8518c0.js';
|
|
4
4
|
import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-853b48a9.js';
|
|
5
5
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-b434e436.js';
|
|
6
6
|
import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
|
|
@@ -13,6 +13,7 @@ import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
|
13
13
|
import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
|
|
14
14
|
import { i as isDarkColor } from './isDarkColor-9ddd90cc.js';
|
|
15
15
|
import { s as styles } from './styles-6fc2fad9.js';
|
|
16
|
+
import { s as submitGtag } from './submitGtag-89d6e9cb.js';
|
|
16
17
|
import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
|
|
17
18
|
import './isContrastColor-69778cea.js';
|
|
18
19
|
import './debounce-c4785346.js';
|
|
@@ -909,7 +910,12 @@ const ZonosCheckout = class {
|
|
|
909
910
|
}
|
|
910
911
|
// Close the confirm dialog
|
|
911
912
|
this.confirmDialogOpen = false;
|
|
912
|
-
submitGtag(
|
|
913
|
+
submitGtag({
|
|
914
|
+
event: 'zonos-checkout-close',
|
|
915
|
+
metadata: {
|
|
916
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
917
|
+
},
|
|
918
|
+
});
|
|
913
919
|
this.open = this.forceDialogOpen || false;
|
|
914
920
|
if (!this.preview && cartStore.step === 'finish') {
|
|
915
921
|
// reset cart store if it's not preview mode and only when checkout is in the finish step.
|
|
@@ -1195,7 +1201,12 @@ const ZonosCheckout = class {
|
|
|
1195
1201
|
isPreview: this.preview,
|
|
1196
1202
|
sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
|
|
1197
1203
|
});
|
|
1198
|
-
submitGtag(
|
|
1204
|
+
submitGtag({
|
|
1205
|
+
event: 'zonos-checkout-start',
|
|
1206
|
+
metadata: {
|
|
1207
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
1208
|
+
},
|
|
1209
|
+
});
|
|
1199
1210
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
1200
1211
|
void trackConversionEvent({
|
|
1201
1212
|
checkoutSessionId,
|
|
@@ -1516,7 +1527,12 @@ const ZonosCheckout = class {
|
|
|
1516
1527
|
async handleCustomerInfoContinue() {
|
|
1517
1528
|
var _a, _b, _c, _d;
|
|
1518
1529
|
// submit google tag when the form is complete
|
|
1519
|
-
submitGtag(
|
|
1530
|
+
submitGtag({
|
|
1531
|
+
event: 'zonos-checkout-customer-info',
|
|
1532
|
+
metadata: {
|
|
1533
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
1534
|
+
},
|
|
1535
|
+
});
|
|
1520
1536
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
1521
1537
|
void trackConversionEvent({
|
|
1522
1538
|
checkoutSessionId,
|
|
@@ -1655,7 +1671,12 @@ const ZonosCheckout = class {
|
|
|
1655
1671
|
}
|
|
1656
1672
|
catch (err) {
|
|
1657
1673
|
logError(err);
|
|
1658
|
-
submitGtag(
|
|
1674
|
+
submitGtag({
|
|
1675
|
+
event: 'zonos-checkout-payment-fail',
|
|
1676
|
+
metadata: {
|
|
1677
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
1678
|
+
},
|
|
1679
|
+
});
|
|
1659
1680
|
stripeStore.hasPaymentError = true;
|
|
1660
1681
|
// should request inventory refund if there's an error during payment
|
|
1661
1682
|
if (stripeStore.shouldInventoryRefund) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, d as getAssetPath, h, H as Host } from './index-0bbe9693.js';
|
|
2
|
-
import { d as cartStore } from './cart-
|
|
2
|
+
import { d as cartStore } from './cart-ba8f3890.js';
|
|
3
3
|
import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-b5b18743.js';
|
|
4
4
|
import { f as zonosStoreFontFamily } from './zonosStore-b434e436.js';
|
|
5
5
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-0bbe9693.js';
|
|
2
|
-
import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, y as stripeStoreReset, I as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, z as cartStoreOnChange } from './cart-
|
|
3
|
-
import {
|
|
2
|
+
import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, y as stripeStoreReset, I as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, z as cartStoreOnChange } from './cart-ba8f3890.js';
|
|
3
|
+
import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-8d8518c0.js';
|
|
4
4
|
import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-853b48a9.js';
|
|
5
5
|
import { z as zonosStore } from './zonosStore-b434e436.js';
|
|
6
6
|
import { h as handleFetch, s as sendErrorLog, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
|
|
7
7
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
8
8
|
import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
|
|
9
9
|
import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
|
|
10
|
-
import {
|
|
10
|
+
import { s as submitGtag } from './submitGtag-89d6e9cb.js';
|
|
11
|
+
import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-797cea8b.js';
|
|
11
12
|
import { c as classes } from './classes-0d95c529.js';
|
|
12
13
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
13
|
-
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-
|
|
14
|
-
import { p as placeTestOrder } from './placeTestOrder-
|
|
14
|
+
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-bd059ecf.js';
|
|
15
|
+
import { p as placeTestOrder } from './placeTestOrder-0a74923e.js';
|
|
15
16
|
import { r as renderFallback } from './renderFallback-3f010b48.js';
|
|
16
17
|
import './isDarkColor-9ddd90cc.js';
|
|
17
18
|
import './isContrastColor-69778cea.js';
|
|
@@ -153,7 +154,7 @@ const ZonosCollectFinish = class {
|
|
|
153
154
|
window.history.replaceState({}, '', url.toString());
|
|
154
155
|
// Payment doesn't go through
|
|
155
156
|
if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
156
|
-
submitGtag('zonos-checkout-payment-fail');
|
|
157
|
+
submitGtag({ event: 'zonos-checkout-payment-fail' });
|
|
157
158
|
void sendErrorLog({
|
|
158
159
|
endpoint: 'Stripe payment failed',
|
|
159
160
|
errors: [
|
|
@@ -166,7 +167,7 @@ const ZonosCollectFinish = class {
|
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
else {
|
|
169
|
-
submitGtag('zonos-checkout-success');
|
|
170
|
+
submitGtag({ event: 'zonos-checkout-success' });
|
|
170
171
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
171
172
|
void trackConversionEvent({
|
|
172
173
|
checkoutSessionId,
|
|
@@ -211,7 +212,7 @@ const ZonosCollectFinish = class {
|
|
|
211
212
|
// show success message right away when order id is already created
|
|
212
213
|
this.isLoading = false;
|
|
213
214
|
if (paypalStore.orderIdCreated) {
|
|
214
|
-
submitGtag('zonos-checkout-success');
|
|
215
|
+
submitGtag({ event: 'zonos-checkout-success' });
|
|
215
216
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
216
217
|
void trackConversionEvent({
|
|
217
218
|
checkoutSessionId,
|
|
@@ -267,11 +268,11 @@ const ZonosCollectFinish = class {
|
|
|
267
268
|
}
|
|
268
269
|
render() {
|
|
269
270
|
const cartId = window.Zonos.cartId;
|
|
270
|
-
return (h(Host, { key: '
|
|
271
|
+
return (h(Host, { key: 'c085862ecf1f50752634fb44f99b5cb5d82a9e24', class: "zonos--checkout-finish zonos--elements", style: {
|
|
271
272
|
'--zonos--border-radius': getBorderRadius({
|
|
272
273
|
overrideBorderStyle: this.borderRadius,
|
|
273
274
|
}),
|
|
274
|
-
} }, !this.isLoading && (h("div", { key: '
|
|
275
|
+
} }, !this.isLoading && (h("div", { key: '9b30b12c817c3422b355a2f544bbf2908f736c80', class: "zonos--finish-details" }, h("div", { key: '697fff3258a6e74d99500ec25f5d3923f8c7cfc2', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '8457c0c9b22c2fb6374b60e492099981026d2690', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (h("zonos-badge", { key: '21ab18878abb37a2c37d873c494d71aee3d4ed71', badgeColor: "gray" }, this.confirmationId)), h("zonos-text", { key: '389918dd57e6ce5744b7192baa3c06c6db3f70cd', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.order && cartId && (h("div", { key: 'cca6b625a6bea62b788cf8dd6bb9e03e6505d81c', class: "zonos--button-container" }, h("zonos-button", { key: '0f45987515ae99045e5b449b5b1aaae11d70d9fb', onClick: () => {
|
|
275
276
|
window.open(this.getReceiptUrl({ cartId }), '_blank');
|
|
276
277
|
}, size: "lg", variant: "primary" }, translate('View receipt')))))))));
|
|
277
278
|
}
|
|
@@ -493,7 +494,7 @@ const ZonosCollectPayment = class {
|
|
|
493
494
|
}
|
|
494
495
|
stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
495
496
|
// submit google tag when the form is complete
|
|
496
|
-
submitGtag('zonos-checkout-payment-info');
|
|
497
|
+
submitGtag({ event: 'zonos-checkout-payment-info' });
|
|
497
498
|
this.continueClicked.emit();
|
|
498
499
|
};
|
|
499
500
|
this.copyCardToClipboard = async (cardNumber) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-0bbe9693.js';
|
|
2
|
-
import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, w as stripeStoreConfirmPayment, B as stripeStoreOnChange, y as stripeStoreReset, f as cartStoreReset } from './cart-
|
|
3
|
-
import { i as isCollectMobile, a as isCollectTablet, c as collectStoreUpdateSelectedShippingOption, b as collectStoreInitShippingInfo, d as collectStoreAsyncAddressUpdate, e as collectStore } from './isCollectMobileTablet-
|
|
4
|
-
import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-
|
|
2
|
+
import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, w as stripeStoreConfirmPayment, B as stripeStoreOnChange, y as stripeStoreReset, f as cartStoreReset } from './cart-ba8f3890.js';
|
|
3
|
+
import { i as isCollectMobile, a as isCollectTablet, c as collectStoreUpdateSelectedShippingOption, b as collectStoreInitShippingInfo, d as collectStoreAsyncAddressUpdate, e as collectStore } from './isCollectMobileTablet-797cea8b.js';
|
|
4
|
+
import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-8d8518c0.js';
|
|
5
5
|
import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-853b48a9.js';
|
|
6
6
|
import { z as zonosStore } from './zonosStore-b434e436.js';
|
|
7
7
|
import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
|
|
@@ -13,6 +13,7 @@ import { l as languages } from './ILanguage-cd6acb72.js';
|
|
|
13
13
|
import './isDarkColor-9ddd90cc.js';
|
|
14
14
|
import './getBorderRadius-877f6389.js';
|
|
15
15
|
import './isContrastColor-69778cea.js';
|
|
16
|
+
import './submitGtag-89d6e9cb.js';
|
|
16
17
|
|
|
17
18
|
const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
18
19
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-0bbe9693.js';
|
|
2
|
-
import { b as stripeStore } from './cart-
|
|
2
|
+
import { b as stripeStore } from './cart-ba8f3890.js';
|
|
3
3
|
import { e as getOverridenZCountry, i as isValidSelector, h as initLocalizationStore, s as storageStore, a as localizationStoreUpdateSelectedCountryCode } from './localization-853b48a9.js';
|
|
4
4
|
import { z as zonosStore, e as zonosStoreInitSetting, f as zonosStoreFontFamily } from './zonosStore-b434e436.js';
|
|
5
5
|
import { g as getGenericSettingsOverride, i as iframeServices, a as injectPrivateIframe } from './getGenericSettingsOverride-0bc3e118.js';
|
|
6
6
|
import { h as handleFetch, l as logError } from './handleFetch-a844cac1.js';
|
|
7
7
|
import { l as log } from './VarianceTest-572cecf5.js';
|
|
8
|
+
import { e as ensureAnalyticsRelayPing } from './submitGtag-89d6e9cb.js';
|
|
8
9
|
import './isDarkColor-9ddd90cc.js';
|
|
9
10
|
import './getBorderRadius-877f6389.js';
|
|
10
11
|
|
|
@@ -537,6 +538,8 @@ const ZonosController = class {
|
|
|
537
538
|
}
|
|
538
539
|
document.body.appendChild(scriptToInject);
|
|
539
540
|
});
|
|
541
|
+
// Custom HTML may set window.Zonos.googleAnalyticId; trigger relay ping so parent configures GA
|
|
542
|
+
ensureAnalyticsRelayPing();
|
|
540
543
|
}
|
|
541
544
|
async initGooglePlacesService(settings) {
|
|
542
545
|
const genericSettings = settings === null || settings === void 0 ? void 0 : settings.genericSettings;
|
|
@@ -723,7 +726,7 @@ const ZonosController = class {
|
|
|
723
726
|
zonosStore.organizationName = organizationName;
|
|
724
727
|
}
|
|
725
728
|
render() {
|
|
726
|
-
return h(Host, { key: '
|
|
729
|
+
return h(Host, { key: '92e1eae13d0b13f91098ea110203b6c7a7f67c3e', class: "zonos--elements" });
|
|
727
730
|
}
|
|
728
731
|
};
|
|
729
732
|
ZonosController.style = ZonosControllerStyle0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-0bbe9693.js';
|
|
2
|
-
import { d as cartStore } from './cart-
|
|
2
|
+
import { d as cartStore } from './cart-ba8f3890.js';
|
|
3
3
|
import { t as translate } from './localization-853b48a9.js';
|
|
4
|
-
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-
|
|
4
|
+
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-bd059ecf.js';
|
|
5
5
|
import { c as classes } from './classes-0d95c529.js';
|
|
6
|
-
import { c as invoiceStore } from './invoice-
|
|
6
|
+
import { c as invoiceStore } from './invoice-055bb6e5.js';
|
|
7
7
|
import { r as renderFallback } from './renderFallback-3f010b48.js';
|
|
8
8
|
import './zonosStore-b434e436.js';
|
|
9
9
|
import './VarianceTest-572cecf5.js';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-0bbe9693.js';
|
|
2
|
-
import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, y as stripeStoreReset, I as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, z as cartStoreOnChange } from './cart-
|
|
3
|
-
import {
|
|
2
|
+
import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, y as stripeStoreReset, I as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, z as cartStoreOnChange } from './cart-ba8f3890.js';
|
|
3
|
+
import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-8d8518c0.js';
|
|
4
4
|
import { t as translate, s as storageStore, l as localizationStore } from './localization-853b48a9.js';
|
|
5
5
|
import { z as zonosStore } from './zonosStore-b434e436.js';
|
|
6
6
|
import { h as handleFetch, s as sendErrorLog, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
|
|
7
7
|
import { c as createCustomEvent } from './createCustomEvent-58159025.js';
|
|
8
8
|
import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
|
|
9
9
|
import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
|
|
10
|
+
import { s as submitGtag } from './submitGtag-89d6e9cb.js';
|
|
10
11
|
import { i as isInvoiceMobile, a as isInvoiceTablet } from './isInvoiceMobileTablet-1f7b614e.js';
|
|
11
12
|
import { c as classes } from './classes-0d95c529.js';
|
|
12
13
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
13
|
-
import { c as invoiceStore } from './invoice-
|
|
14
|
-
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-
|
|
15
|
-
import { p as placeTestOrder } from './placeTestOrder-
|
|
14
|
+
import { c as invoiceStore } from './invoice-055bb6e5.js';
|
|
15
|
+
import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-bd059ecf.js';
|
|
16
|
+
import { p as placeTestOrder } from './placeTestOrder-0a74923e.js';
|
|
16
17
|
import { r as renderFallback } from './renderFallback-3f010b48.js';
|
|
17
18
|
import './isDarkColor-9ddd90cc.js';
|
|
18
19
|
import './isContrastColor-69778cea.js';
|
|
@@ -154,7 +155,7 @@ const ZonosInvoiceFinish = class {
|
|
|
154
155
|
window.history.replaceState({}, '', url.toString());
|
|
155
156
|
// Payment doesn't go through
|
|
156
157
|
if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
157
|
-
submitGtag('zonos-checkout-payment-fail');
|
|
158
|
+
submitGtag({ event: 'zonos-checkout-payment-fail' });
|
|
158
159
|
void sendErrorLog({
|
|
159
160
|
endpoint: 'Stripe payment failed',
|
|
160
161
|
errors: [
|
|
@@ -167,7 +168,7 @@ const ZonosInvoiceFinish = class {
|
|
|
167
168
|
});
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
170
|
-
submitGtag('zonos-checkout-success');
|
|
171
|
+
submitGtag({ event: 'zonos-checkout-success' });
|
|
171
172
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
172
173
|
void trackConversionEvent({
|
|
173
174
|
checkoutSessionId,
|
|
@@ -212,7 +213,7 @@ const ZonosInvoiceFinish = class {
|
|
|
212
213
|
// show success message right away when order id is already created
|
|
213
214
|
this.isLoading = false;
|
|
214
215
|
if (paypalStore.orderIdCreated) {
|
|
215
|
-
submitGtag('zonos-checkout-success');
|
|
216
|
+
submitGtag({ event: 'zonos-checkout-success' });
|
|
216
217
|
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
217
218
|
void trackConversionEvent({
|
|
218
219
|
checkoutSessionId,
|
|
@@ -268,11 +269,11 @@ const ZonosInvoiceFinish = class {
|
|
|
268
269
|
}
|
|
269
270
|
render() {
|
|
270
271
|
const cartId = window.Zonos.cartId;
|
|
271
|
-
return (h(Host, { key: '
|
|
272
|
+
return (h(Host, { key: '5d2fc87bc549fa2cb6d622e664043bbfe55f8b0e', class: "zonos--checkout-finish zonos--elements", style: {
|
|
272
273
|
'--zonos--border-radius': getBorderRadius({
|
|
273
274
|
overrideBorderStyle: this.borderRadius,
|
|
274
275
|
}),
|
|
275
|
-
} }, !this.isLoading && (h("div", { key: '
|
|
276
|
+
} }, !this.isLoading && (h("div", { key: '1268de9e5be1edc4cbe2e7e2f1d2590b168d8c7b', class: "zonos--finish-details" }, h("div", { key: 'ce63ee565c176ea5687fc1c0f721932e26b93ebd', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'a073858eac699426dc5947b85d3b3665868f164e', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (h("zonos-badge", { key: 'a96c40f5cc977de82585f7827d6bc6aef55ba873', badgeColor: "gray" }, this.confirmationId)), h("zonos-text", { key: 'd97bc54085b9fe69eb05b44042deae25c379ee3a', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.order && cartId && (h("div", { key: '488c3442e40fedf65caedbd3e098bd8b95976aab', class: "zonos--button-container" }, h("zonos-button", { key: '9a01b9cca0e3747548d386345015ecea80dc29d3', onClick: () => {
|
|
276
277
|
window.open(this.getReceiptUrl({ cartId }), '_blank');
|
|
277
278
|
}, size: "lg", variant: "primary" }, translate('View receipt')))))))));
|
|
278
279
|
}
|
|
@@ -474,7 +475,7 @@ const ZonosInvoicePayment = class {
|
|
|
474
475
|
}
|
|
475
476
|
stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
476
477
|
// submit google tag when the form is complete
|
|
477
|
-
submitGtag('zonos-checkout-payment-info');
|
|
478
|
+
submitGtag({ event: 'zonos-checkout-payment-info' });
|
|
478
479
|
this.continueClicked.emit();
|
|
479
480
|
};
|
|
480
481
|
this.copyCardToClipboard = async (cardNumber) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-0bbe9693.js';
|
|
2
|
-
import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, w as stripeStoreConfirmPayment, B as stripeStoreOnChange, y as stripeStoreReset, f as cartStoreReset } from './cart-
|
|
3
|
-
import { i as invoiceStoreUpdateSelectedShippingOption, a as invoiceStoreInitShippingInfo, b as invoiceStoreAsyncAddressUpdate, c as invoiceStore } from './invoice-
|
|
4
|
-
import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-
|
|
2
|
+
import { b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, n as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, u as stripeStoreUpdateCheckoutSessionBaseCurrency, w as stripeStoreConfirmPayment, B as stripeStoreOnChange, y as stripeStoreReset, f as cartStoreReset } from './cart-ba8f3890.js';
|
|
3
|
+
import { i as invoiceStoreUpdateSelectedShippingOption, a as invoiceStoreInitShippingInfo, b as invoiceStoreAsyncAddressUpdate, c as invoiceStore } from './invoice-055bb6e5.js';
|
|
4
|
+
import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-8d8518c0.js';
|
|
5
5
|
import { s as storageStore, t as translate, c as localizationStoreOnChange, d as currencyFormat, l as localizationStore } from './localization-853b48a9.js';
|
|
6
6
|
import { z as zonosStore } from './zonosStore-b434e436.js';
|
|
7
7
|
import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
|
|
@@ -13,6 +13,7 @@ import { l as languages } from './ILanguage-cd6acb72.js';
|
|
|
13
13
|
import './isDarkColor-9ddd90cc.js';
|
|
14
14
|
import './getBorderRadius-877f6389.js';
|
|
15
15
|
import './isContrastColor-69778cea.js';
|
|
16
|
+
import './submitGtag-89d6e9cb.js';
|
|
16
17
|
|
|
17
18
|
const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
18
19
|
|