@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.
Files changed (149) hide show
  1. package/dist/cjs/{cart-97a2d20a.js → cart-28310848.js} +2 -0
  2. package/dist/cjs/index.cjs.js +14 -7
  3. package/dist/cjs/{invoice-05a10ee1.js → invoice-2e8e5879.js} +1 -1
  4. package/dist/cjs/{isCollectMobileTablet-edd4804c.js → isCollectMobileTablet-bd0f4556.js} +1 -1
  5. package/dist/cjs/{paypal-0b4b352b.js → paypal-3019ae94.js} +21 -18
  6. package/dist/cjs/{placeTestOrder-07b46688.js → placeTestOrder-b0369cfd.js} +1 -1
  7. package/dist/cjs/{renderCheckoutCurrency-dd3b0609.js → renderCheckoutCurrency-9e919b9f.js} +1 -1
  8. package/dist/cjs/submitGtag-a50ab32e.js +116 -0
  9. package/dist/cjs/zonos-address-display_9.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -2
  12. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +109 -17
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +27 -6
  14. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
  16. package/dist/cjs/zonos-collect.cjs.entry.js +4 -3
  17. package/dist/cjs/zonos-controller.cjs.entry.js +5 -2
  18. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
  19. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
  20. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -3
  21. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +88 -9
  22. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +9 -2
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +24 -4
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +9 -3
  25. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +5 -5
  26. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  27. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +5 -5
  28. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  29. package/dist/collection/components/main/zonos-controller.js +4 -1
  30. package/dist/collection/components/store/checkout/paypal.js +19 -1
  31. package/dist/collection/components/store/checkout/stripe.js +2 -0
  32. package/dist/collection/components/utils/submitGtag.js +90 -2
  33. package/dist/collection/scripts/_zonosBase.js +7 -0
  34. package/dist/collection/types/analyticsRelay.js +6 -0
  35. package/dist/esm/{cart-99ec4a3d.js → cart-ba8f3890.js} +2 -0
  36. package/dist/esm/index.js +14 -7
  37. package/dist/esm/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  38. package/dist/esm/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  39. package/dist/esm/{paypal-56534e48.js → paypal-8d8518c0.js} +23 -19
  40. package/dist/esm/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  41. package/dist/esm/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  42. package/dist/esm/submitGtag-89d6e9cb.js +113 -0
  43. package/dist/esm/zonos-address-display_9.entry.js +1 -1
  44. package/dist/esm/zonos-address_4.entry.js +1 -1
  45. package/dist/esm/zonos-card_5.entry.js +3 -2
  46. package/dist/esm/zonos-cart-items_12.entry.js +109 -17
  47. package/dist/esm/zonos-checkout.entry.js +27 -6
  48. package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
  49. package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
  50. package/dist/esm/zonos-collect.entry.js +4 -3
  51. package/dist/esm/zonos-controller.entry.js +5 -2
  52. package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
  53. package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
  54. package/dist/esm/zonos-invoice.entry.js +4 -3
  55. package/dist/esm-es5/{cart-99ec4a3d.js → cart-ba8f3890.js} +1 -1
  56. package/dist/esm-es5/index.js +1 -1
  57. package/dist/esm-es5/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  58. package/dist/esm-es5/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  59. package/dist/esm-es5/paypal-8d8518c0.js +17 -0
  60. package/dist/esm-es5/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  61. package/dist/esm-es5/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  62. package/dist/esm-es5/submitGtag-89d6e9cb.js +1 -0
  63. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -1
  64. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  65. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  66. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  67. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  68. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  69. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  70. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  71. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  72. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  73. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  74. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  75. package/dist/scripts/analyticsRelayOnInit.js +1 -0
  76. package/dist/scripts/index.d.ts +11 -0
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +4 -0
  81. package/dist/types/components/store/checkout/stripe.d.ts +6 -0
  82. package/dist/types/components/utils/submitGtag.d.ts +32 -2
  83. package/dist/types/scripts/_zonosBase.d.ts +11 -0
  84. package/dist/types/types/analyticsRelay.d.ts +12 -0
  85. package/dist/zonos-elements/index.esm.js +1 -1
  86. package/dist/zonos-elements/p-002e45f9.system.js +17 -0
  87. package/dist/zonos-elements/p-0792688d.system.entry.js +1 -0
  88. package/dist/zonos-elements/p-0b7beb16.system.entry.js +1 -0
  89. package/dist/zonos-elements/p-0f787f5d.entry.js +1 -0
  90. package/dist/zonos-elements/{p-2e8f842c.entry.js → p-0ff93ca6.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-10355cf6.system.entry.js → p-1acf0a71.system.entry.js} +1 -1
  92. package/dist/zonos-elements/p-291f7ccb.system.entry.js +1 -0
  93. package/dist/zonos-elements/p-3972663a.system.entry.js +1 -0
  94. package/dist/zonos-elements/{p-53a9da45.entry.js → p-39fa55c7.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-f6f1d779.system.entry.js → p-3e85b9f5.system.entry.js} +1 -1
  96. package/dist/zonos-elements/p-48475755.entry.js +1 -0
  97. package/dist/zonos-elements/{p-d0411b2d.entry.js → p-58248f03.entry.js} +1 -1
  98. package/dist/zonos-elements/p-5edef7c3.system.js +1 -0
  99. package/dist/zonos-elements/{p-678331f0.system.js → p-63a3d3b9.system.js} +1 -1
  100. package/dist/zonos-elements/p-64661dd1.js +1 -0
  101. package/dist/zonos-elements/p-69212d0f.entry.js +1 -0
  102. package/dist/zonos-elements/{p-71185d24.system.js → p-719403e0.system.js} +1 -1
  103. package/dist/zonos-elements/{p-382601a9.system.entry.js → p-71a8d971.system.entry.js} +1 -1
  104. package/dist/zonos-elements/p-71d855b8.system.entry.js +1 -0
  105. package/dist/zonos-elements/p-71f10bf0.entry.js +1 -0
  106. package/dist/zonos-elements/p-72ff005c.entry.js +1 -0
  107. package/dist/zonos-elements/{p-08365fdb.system.js → p-7dba5f23.system.js} +1 -1
  108. package/dist/zonos-elements/p-85e59f3a.system.entry.js +1 -0
  109. package/dist/zonos-elements/{p-ce98e472.js → p-866afec1.js} +1 -1
  110. package/dist/zonos-elements/p-942358eb.system.js +1 -0
  111. package/dist/zonos-elements/{p-2c10b067.system.entry.js → p-94c5fbfc.system.entry.js} +1 -1
  112. package/dist/zonos-elements/p-a12cb7ce.entry.js +1 -0
  113. package/dist/zonos-elements/p-abf38ed6.js +1 -0
  114. package/dist/zonos-elements/{p-df6e62f8.system.js → p-ae16dda9.system.js} +1 -1
  115. package/dist/zonos-elements/{p-46ece7ae.js → p-bc4bfa06.js} +1 -1
  116. package/dist/zonos-elements/p-bf5e47e2.entry.js +1 -0
  117. package/dist/zonos-elements/{p-dca14319.system.js → p-c027a832.system.js} +1 -1
  118. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  119. package/dist/zonos-elements/p-c2f34b10.system.entry.js +1 -0
  120. package/dist/zonos-elements/p-c36696f9.js +1 -0
  121. package/dist/zonos-elements/p-c7311ce5.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-1b86711b.js → p-de8899bc.js} +1 -1
  123. package/dist/zonos-elements/p-e17bbcee.entry.js +1 -0
  124. package/dist/zonos-elements/{p-e458f737.entry.js → p-f6c2c743.entry.js} +1 -1
  125. package/dist/zonos-elements/p-fe06c9ea.js +17 -0
  126. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  127. package/package.json +1 -1
  128. package/dist/esm-es5/paypal-56534e48.js +0 -17
  129. package/dist/zonos-elements/p-0c201c39.system.entry.js +0 -1
  130. package/dist/zonos-elements/p-0cb5f151.system.entry.js +0 -1
  131. package/dist/zonos-elements/p-3e2f175c.entry.js +0 -1
  132. package/dist/zonos-elements/p-5295d36e.entry.js +0 -1
  133. package/dist/zonos-elements/p-64870563.entry.js +0 -1
  134. package/dist/zonos-elements/p-695e0803.system.entry.js +0 -1
  135. package/dist/zonos-elements/p-6e3cf6eb.entry.js +0 -1
  136. package/dist/zonos-elements/p-6f430d6f.system.entry.js +0 -1
  137. package/dist/zonos-elements/p-794d29dc.entry.js +0 -1
  138. package/dist/zonos-elements/p-8defdf0d.system.js +0 -17
  139. package/dist/zonos-elements/p-8e98a7c8.js +0 -1
  140. package/dist/zonos-elements/p-95348ebf.system.entry.js +0 -1
  141. package/dist/zonos-elements/p-9a066833.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-aa6c2348.system.entry.js +0 -1
  143. package/dist/zonos-elements/p-ada8841a.js +0 -1
  144. package/dist/zonos-elements/p-c75b7c47.entry.js +0 -1
  145. package/dist/zonos-elements/p-caff391d.system.entry.js +0 -1
  146. package/dist/zonos-elements/p-dd19d9d8.js +0 -17
  147. package/dist/zonos-elements/p-df90bccf.entry.js +0 -1
  148. package/dist/zonos-elements/p-e07aaf09.system.js +0 -1
  149. package/dist/zonos-elements/p-f8eb618b.entry.js +0 -1
@@ -1423,6 +1423,8 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
1423
1423
  const status = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status;
1424
1424
  const { isError, messages } = stripeStoreMessageBasedOnStatus(status);
1425
1425
  return {
1426
+ amount: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.amount,
1427
+ currency: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.currency,
1426
1428
  error: isError,
1427
1429
  messages,
1428
1430
  paymentIntentId: paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.id,
@@ -133,7 +133,7 @@ const getZonosQaUrl = () => {
133
133
  return null;
134
134
  }
135
135
  const qaUrl = extractZonosQaUrl(window.location.href);
136
- const cdnUrl = "https://v1.3.247.js.zonos.com";
136
+ const cdnUrl = "https://v1.3.248.js.zonos.com";
137
137
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
138
138
  if (!qaUrl &&
139
139
  (cdnUrl.includes('test.') ||
@@ -381,10 +381,10 @@ const zonosLoadUrl = (() => {
381
381
  return null;
382
382
  })();
383
383
  const startLoadTime = Date.now();
384
- const ZONOS_URL = "https://v1.3.247.js.zonos.com";
385
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.247";
386
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.247";
387
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.247";
384
+ const ZONOS_URL = "https://v1.3.248.js.zonos.com";
385
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.248";
386
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.248";
387
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.248";
388
388
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
389
389
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
390
390
  class Zonos {
@@ -402,8 +402,10 @@ Zonos.iframeLogType = typeof window !== 'undefined'
402
402
  ? new URLSearchParams(window.location.search).get('iframeLogType')
403
403
  : null;
404
404
  Zonos.isBigCommerce = false;
405
- Zonos.releaseDate = "1769706838597";
405
+ Zonos.releaseDate = "1772221080993";
406
406
  Zonos.isLegacyCheckout = false;
407
+ Zonos.googleAnalyticId = null;
408
+ Zonos.googleAnalyticReady = false;
407
409
  Zonos.startLoadTime = startLoadTime;
408
410
  Zonos.domain = typeof window !== 'undefined'
409
411
  ? // domain that embeds the iframe
@@ -423,7 +425,7 @@ Zonos.isNpm = true;
423
425
  Zonos.zonosQaUrl = null;
424
426
  Zonos.zonosQaUrlApi = null;
425
427
  Zonos.trackEventLogs = [];
426
- Zonos.version = `v${"1.3.247"}`;
428
+ Zonos.version = `v${"1.3.248"}`;
427
429
  Zonos.modeAlerted = false;
428
430
  Zonos.cartData = null;
429
431
  Zonos.paypal = null;
@@ -443,6 +445,10 @@ Zonos.init = async (params) => {
443
445
  VarianceTest.log(`====== ZONOS DEBUG MODE: on (${_a.version}) ======`);
444
446
  _a.zonosApiKey = zonosApiKey;
445
447
  _a.storeId = storeId;
448
+ // When not in iframe, GA is ready (gtag works directly). When in iframe, relay will set this after parent configures.
449
+ if (typeof window !== 'undefined' && window.parent === window) {
450
+ _a.googleAnalyticReady = true;
451
+ }
446
452
  if (_a.isNpm) {
447
453
  VarianceTest.log('====== ZONOS LOADING FROM NPM ======');
448
454
  const zonosQaUrl = getZonosQaUrl();
@@ -547,6 +553,7 @@ Zonos.injectCustomScriptForHostedCheckout = () => {
547
553
  const metadata = (cartData === null || cartData === void 0 ? void 0 : cartData.metadata) || [];
548
554
  const headerScript = metadata.find(meta => meta.key === 'customHeaderScript');
549
555
  const footerScript = metadata.find(meta => meta.key === 'customFooterScript');
556
+ // googleAnalyticId is set by customHTML in checkoutSettings (e.g. <script>window.Zonos.googleAnalyticId = "G-XXX";</script>), injected by zonos-controller
550
557
  // Only inject the script if checkout is on Zonos hosted checkout and custom script is available
551
558
  if (!window.Zonos.isLegacyCheckout || (!headerScript && !footerScript)) {
552
559
  VarianceTest.log('Skip injecting custom script for hosted checkout', 'info', {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-37a4b4f4.js');
4
- const cart = require('./cart-97a2d20a.js');
4
+ const cart = require('./cart-28310848.js');
5
5
  const localization = require('./localization-00e73920.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-37a4b4f4.js');
4
- const cart = require('./cart-97a2d20a.js');
4
+ const cart = require('./cart-28310848.js');
5
5
  const localization = require('./localization-00e73920.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-37a4b4f4.js');
4
- const cart = require('./cart-97a2d20a.js');
4
+ const cart = require('./cart-28310848.js');
5
5
  const localization = require('./localization-00e73920.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const isContrastColor = require('./isContrastColor-09f5924a.js');
8
8
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
9
+ const submitGtag = require('./submitGtag-a50ab32e.js');
9
10
 
10
11
  /*!
11
12
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
@@ -226,21 +227,6 @@ const paypalCreateOrder = async ({ checkoutSessionId, intent, }) => {
226
227
  return { errors, json };
227
228
  };
228
229
 
229
- /**
230
- * Submit a gtag event if the gtag function is available.
231
- */
232
- const submitGtag = (event) => {
233
- const googleAnalyticSetting = zonosStore.zonosStore.checkoutSettings.analyticsProviders.find(item => item.type === 'GOOGLE_ANALYTICS');
234
- // only submit if googleAnalytic in checkout setting is on.
235
- if (!googleAnalyticSetting || (googleAnalyticSetting === null || googleAnalyticSetting === void 0 ? void 0 : googleAnalyticSetting.status) === 'DISABLED') {
236
- return;
237
- }
238
- if (typeof window.gtag === 'function') {
239
- VarianceTest.log('Zonos submits gtag event', 'log', event);
240
- window.gtag('event', event, {});
241
- }
242
- };
243
-
244
230
  const { onChange: paypalStoreOnChange, reset: paypalStoreReset, state: paypalStore, } = zonosStore.createStore(() => ({
245
231
  intent: 'capture',
246
232
  orderIdCreated: null,
@@ -321,6 +307,12 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
321
307
  // reset stripe error message
322
308
  cart.stripeStore.hasPaymentError = false;
323
309
  cart.stripeStore.customErrorMessage = null;
310
+ submitGtag.submitGtag({
311
+ event: 'zonos-checkout-payment-fail',
312
+ metadata: {
313
+ checkoutSessionId,
314
+ },
315
+ });
324
316
  onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
325
317
  return '';
326
318
  }
@@ -353,6 +345,12 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
353
345
  // reset stripe error message
354
346
  cart.stripeStore.hasPaymentError = false;
355
347
  cart.stripeStore.customErrorMessage = null;
348
+ submitGtag.submitGtag({
349
+ event: 'zonos-checkout-payment-fail',
350
+ metadata: {
351
+ checkoutSessionId,
352
+ },
353
+ });
356
354
  // trigger fail event
357
355
  onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
358
356
  return '';
@@ -363,7 +361,13 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
363
361
  // reset paypal error banner
364
362
  paypalStore.paypalErrorMessage = null;
365
363
  // submit google tag when the form is complete
366
- submitGtag('zonos-checkout-payment-info');
364
+ submitGtag.submitGtag({
365
+ event: 'zonos-checkout-payment-info',
366
+ metadata: {
367
+ checkoutSessionId,
368
+ paymentMethod: 'paypal',
369
+ },
370
+ });
367
371
  const orderId = await paypalStoreCaptureOrder({
368
372
  checkoutSessionId,
369
373
  paypalMockResponse: window.Zonos._paypalMockResponse,
@@ -484,4 +488,3 @@ exports.paypalStoreHasPaypalEnabled = paypalStoreHasPaypalEnabled;
484
488
  exports.paypalStoreInitButtons = paypalStoreInitButtons;
485
489
  exports.paypalStoreOnChange = paypalStoreOnChange;
486
490
  exports.paypalStoreReset = paypalStoreReset;
487
- exports.submitGtag = submitGtag;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-97a2d20a.js');
3
+ const cart = require('./cart-28310848.js');
4
4
  const localization = require('./localization-00e73920.js');
5
5
  const handleFetch = require('./handleFetch-954f30e1.js');
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-97a2d20a.js');
3
+ const cart = require('./cart-28310848.js');
4
4
  const localization = require('./localization-00e73920.js');
5
5
 
6
6
  const getDisplayCurrency = () => {
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ const zonosStore = require('./zonosStore-37a4b4f4.js');
4
+ const handleFetch = require('./handleFetch-954f30e1.js');
5
+ const VarianceTest = require('./VarianceTest-bec00ea8.js');
6
+
7
+ /** Message type for zonos-analytic events sent from iframe to parent. */
8
+ const ZONOS_ANALYTIC_TYPE = 'zonos-analytic';
9
+ /** Ping sent by iframe to configure parent's analytics relay (e.g. GA) and get ready signal. */
10
+ const RELAY_PING_TYPE = 'zonos-analytics-relay-ping';
11
+ /** Response from parent when analytics relay (e.g. gtag) is ready. */
12
+ const RELAY_READY_TYPE = 'zonos-analytics-relay-ready';
13
+
14
+ let parentGtagReady = false;
15
+ let relayListenerAdded = false;
16
+ const queuedEvents = [];
17
+ function flushQueuedEvents() {
18
+ while (queuedEvents.length > 0) {
19
+ const { event, payload } = queuedEvents.shift();
20
+ try {
21
+ window.parent.postMessage({
22
+ event,
23
+ metadata: payload,
24
+ type: ZONOS_ANALYTIC_TYPE,
25
+ }, '*');
26
+ }
27
+ catch (_a) {
28
+ // Ignore postMessage failures
29
+ }
30
+ }
31
+ }
32
+ function ensureRelayListener() {
33
+ if (relayListenerAdded)
34
+ return;
35
+ relayListenerAdded = true;
36
+ window.addEventListener('message', (e) => {
37
+ var _a;
38
+ if (((_a = e.data) === null || _a === void 0 ? void 0 : _a.type) === RELAY_READY_TYPE) {
39
+ parentGtagReady = true;
40
+ if (typeof window.Zonos !== 'undefined') {
41
+ window.Zonos.googleAnalyticReady = true;
42
+ }
43
+ flushQueuedEvents();
44
+ }
45
+ });
46
+ }
47
+ function sendPingToParent() {
48
+ try {
49
+ const googleAnalyticId = typeof window.Zonos !== 'undefined'
50
+ ? window.Zonos.googleAnalyticId
51
+ : undefined;
52
+ window.parent.postMessage({ googleAnalyticId, type: RELAY_PING_TYPE }, '*');
53
+ }
54
+ catch (_a) {
55
+ // Ignore postMessage failures
56
+ }
57
+ }
58
+ /**
59
+ * Sends ping to parent with googleAnalyticId so parent can inject/configure GA and respond with ready.
60
+ * Call after customHTML or custom script sets window.Zonos.googleAnalyticId.
61
+ */
62
+ function ensureAnalyticsRelayPing() {
63
+ if (typeof window === 'undefined' ||
64
+ window.parent === window ||
65
+ parentGtagReady) {
66
+ return;
67
+ }
68
+ ensureRelayListener();
69
+ sendPingToParent();
70
+ }
71
+ /**
72
+ * Submit a gtag event if the gtag function is available.
73
+ * When running inside an iframe, only posts to parent after the parent has
74
+ * confirmed (via analyticsRelayOnInit) that gtag is available.
75
+ */
76
+ const submitGtag = ({ event, metadata }) => {
77
+ const googleAnalyticSetting = zonosStore.zonosStore.checkoutSettings.analyticsProviders.find(item => item.type === 'GOOGLE_ANALYTICS');
78
+ // only submit if googleAnalytic in checkout setting is on.
79
+ if (!googleAnalyticSetting || (googleAnalyticSetting === null || googleAnalyticSetting === void 0 ? void 0 : googleAnalyticSetting.status) === 'DISABLED') {
80
+ return;
81
+ }
82
+ const isTestMode = handleFetch.getIsTestMode();
83
+ const payload = Object.assign(Object.assign({}, metadata), (isTestMode && { isTestMode: true }));
84
+ // filter null key
85
+ const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== null));
86
+ const isInIframe = typeof window !== 'undefined' && window.parent !== window;
87
+ if (isInIframe) {
88
+ // gtag does not work in iframe; must relay to parent via postMessage
89
+ ensureRelayListener();
90
+ if (parentGtagReady) {
91
+ try {
92
+ window.parent.postMessage({
93
+ event,
94
+ metadata: filteredPayload,
95
+ type: ZONOS_ANALYTIC_TYPE,
96
+ }, '*');
97
+ }
98
+ catch (_a) {
99
+ // Ignore postMessage failures
100
+ }
101
+ }
102
+ else {
103
+ queuedEvents.push({ event, payload: filteredPayload });
104
+ sendPingToParent();
105
+ }
106
+ return;
107
+ }
108
+ // Not in iframe: call gtag directly
109
+ if (typeof window.gtag === 'function') {
110
+ VarianceTest.log('Zonos submits gtag event', 'log', event);
111
+ window.gtag('event', event, filteredPayload);
112
+ }
113
+ };
114
+
115
+ exports.ensureAnalyticsRelayPing = ensureAnalyticsRelayPing;
116
+ exports.submitGtag = submitGtag;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-69fa8852.js');
6
6
  const localization = require('./localization-00e73920.js');
7
7
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
8
- const cart = require('./cart-97a2d20a.js');
8
+ const cart = require('./cart-28310848.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
11
11
  const zonosStore = require('./zonosStore-37a4b4f4.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
6
  const throttle = require('./throttle-7dd64984.js');
7
- const cart = require('./cart-97a2d20a.js');
7
+ const cart = require('./cart-28310848.js');
8
8
  const localization = require('./localization-00e73920.js');
9
9
  const zonosStore = require('./zonosStore-37a4b4f4.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -6,13 +6,14 @@ const index = require('./index-69fa8852.js');
6
6
  const zonosStore = require('./zonosStore-37a4b4f4.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
9
- const cart = require('./cart-97a2d20a.js');
9
+ const cart = require('./cart-28310848.js');
10
10
  const localization = require('./localization-00e73920.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
12
- const paypal = require('./paypal-0b4b352b.js');
12
+ const paypal = require('./paypal-3019ae94.js');
13
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
14
  require('./isDarkColor-878e600e.js');
15
15
  require('./isContrastColor-09f5924a.js');
16
+ require('./submitGtag-a50ab32e.js');
16
17
 
17
18
  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)}";
18
19
  const ZonosCardStyle0 = zonosCardCss;
@@ -3,20 +3,21 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-69fa8852.js');
6
- const cart = require('./cart-97a2d20a.js');
6
+ const cart = require('./cart-28310848.js');
7
7
  const localization = require('./localization-00e73920.js');
8
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-dd3b0609.js');
8
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-9e919b9f.js');
9
9
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-577d0a77.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
11
  const zonosStore = require('./zonosStore-37a4b4f4.js');
12
12
  const hasInclusivePrice = require('./hasInclusivePrice-134b0250.js');
13
- const paypal = require('./paypal-0b4b352b.js');
13
+ const paypal = require('./paypal-3019ae94.js');
14
14
  const handleFetch = require('./handleFetch-954f30e1.js');
15
15
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
16
16
  const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
17
17
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
18
+ const submitGtag = require('./submitGtag-a50ab32e.js');
18
19
  const ILanguage = require('./ILanguage-98b04442.js');
19
- const placeTestOrder = require('./placeTestOrder-07b46688.js');
20
+ const placeTestOrder = require('./placeTestOrder-b0369cfd.js');
20
21
  const isDarkColor = require('./isDarkColor-878e600e.js');
21
22
  const getContrastColor = require('./getContrastColor-30848800.js');
22
23
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
@@ -359,6 +360,56 @@ const ZonosCheckoutFinish = class {
359
360
  order: json,
360
361
  };
361
362
  };
363
+ /**
364
+ * Metadata for purchase event in GA4
365
+ */
366
+ this.buildPurchaseMetadata = ({ checkoutSessionId, currency, }) => {
367
+ var _a, _b, _c, _d, _e, _f;
368
+ const items = cart.cartStore.items
369
+ .filter(item => item.amount >= 0)
370
+ .map(item => ({
371
+ item_id: item.sku || item.productId || item.name,
372
+ item_name: item.name,
373
+ price: item.amount,
374
+ quantity: item.quantity,
375
+ }));
376
+ /**
377
+ * The value of this parameter should be the sum of all item amounts in the transaction (without shipping and tax).
378
+ * @ref https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#parameters_22
379
+ */
380
+ const subtotal = ((_a = cart.cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.subtotals.items) ||
381
+ ((_b = this.order) === null || _b === void 0 ? void 0 : _b.amountSubtotals.items);
382
+ const currencyCode = ((_c = cart.cartStore.checkoutSession) === null || _c === void 0 ? void 0 : _c.subtotals.presentmentCurrencyCode) ||
383
+ ((_d = this.order) === null || _d === void 0 ? void 0 : _d.currencyCode) ||
384
+ (currency === null || currency === void 0 ? void 0 : currency.toUpperCase());
385
+ // 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.
386
+ const cartSubtotal = items.reduce((acc, item) => acc + item.price * item.quantity, 0);
387
+ const cartCurrency = (_e = cart.cartStore.items.find(Boolean)) === null || _e === void 0 ? void 0 : _e.currencyCode;
388
+ const transactionId = ((_f = this.order) === null || _f === void 0 ? void 0 : _f.id) || checkoutSessionId || new Date().getTime().toString();
389
+ if (currencyCode && subtotal) {
390
+ return {
391
+ currency: currencyCode,
392
+ items,
393
+ transaction_id: transactionId,
394
+ value: subtotal,
395
+ };
396
+ }
397
+ // Use cart currency and subtotal if the order/checkout session can not be found
398
+ if (cartCurrency && cartSubtotal) {
399
+ return {
400
+ currency: cartCurrency,
401
+ items,
402
+ transaction_id: transactionId,
403
+ value: cartSubtotal,
404
+ };
405
+ }
406
+ return {
407
+ currency: undefined,
408
+ items,
409
+ transaction_id: transactionId,
410
+ value: undefined,
411
+ };
412
+ };
362
413
  this.redirectToUrl = (url) => {
363
414
  // reset store and checkout session id before redirecting
364
415
  cart.stripeStoreReset();
@@ -541,7 +592,7 @@ const ZonosCheckoutFinish = class {
541
592
  this.checkStripePaymentStatus = async () => {
542
593
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || cart.stripeStore.clientSecret;
543
594
  if (clientSecret || this.storybookForceStatus) {
544
- const { error, messages, status } = await cart.stripeStoreRetrievePayment({
595
+ const { currency, error, messages, status } = await cart.stripeStoreRetrievePayment({
545
596
  clientSecret,
546
597
  storybookForceStatus: this.storybookForceStatus,
547
598
  });
@@ -567,7 +618,12 @@ const ZonosCheckoutFinish = class {
567
618
  window.history.replaceState({}, '', url.toString());
568
619
  // Payment doesn't go through
569
620
  if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
570
- paypal.submitGtag('zonos-checkout-payment-fail');
621
+ submitGtag.submitGtag({
622
+ event: 'zonos-checkout-payment-fail',
623
+ metadata: {
624
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
625
+ },
626
+ });
571
627
  void handleFetch.sendErrorLog({
572
628
  endpoint: 'Stripe payment failed',
573
629
  errors: [
@@ -582,8 +638,21 @@ const ZonosCheckoutFinish = class {
582
638
  else {
583
639
  // Save new order info in case the user reloads before we get order info
584
640
  this.saveOrderIdForDuplicationIssue();
585
- paypal.submitGtag('zonos-checkout-success');
586
641
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
642
+ submitGtag.submitGtag({
643
+ event: 'zonos-checkout-success',
644
+ metadata: this.buildPurchaseMetadata({
645
+ checkoutSessionId: checkoutSessionId || '',
646
+ currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
647
+ }),
648
+ });
649
+ submitGtag.submitGtag({
650
+ event: 'purchase',
651
+ metadata: this.buildPurchaseMetadata({
652
+ checkoutSessionId: checkoutSessionId || '',
653
+ currency: currency === null || currency === void 0 ? void 0 : currency.toUpperCase(),
654
+ }),
655
+ });
587
656
  void cart.trackConversionEvent({
588
657
  checkoutSessionId,
589
658
  eventName: 'checkout_orderCompleted',
@@ -629,7 +698,18 @@ const ZonosCheckoutFinish = class {
629
698
  // show success message right away when order id is already created
630
699
  this.isLoading = false;
631
700
  if (paypal.paypalStore.orderIdCreated) {
632
- paypal.submitGtag('zonos-checkout-success');
701
+ submitGtag.submitGtag({
702
+ event: 'zonos-checkout-success',
703
+ metadata: this.buildPurchaseMetadata({
704
+ checkoutSessionId: localization.storageStore.checkoutSessionId || '',
705
+ }),
706
+ });
707
+ submitGtag.submitGtag({
708
+ event: 'purchase',
709
+ metadata: this.buildPurchaseMetadata({
710
+ checkoutSessionId: localization.storageStore.checkoutSessionId || '',
711
+ }),
712
+ });
633
713
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
634
714
  void cart.trackConversionEvent({
635
715
  checkoutSessionId,
@@ -691,11 +771,11 @@ const ZonosCheckoutFinish = class {
691
771
  }
692
772
  render() {
693
773
  const isTestMode = handleFetch.getIsTestMode();
694
- return (index.h(index.Host, { key: '7b18913d8ebe7be5cbe9ee7d520b643c342c409d', class: "zonos--checkout-finish zonos--elements", style: {
774
+ return (index.h(index.Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
695
775
  '--zonos--border-radius': getBorderRadius.getBorderRadius({
696
776
  overrideBorderStyle: this.borderRadius,
697
777
  }),
698
- } }, !this.isLoading && (index.h("div", { key: 'afb522b8b3b769817c00312fc9c14b4c032873ca', class: "zonos--finish-details" }, index.h("div", { key: 'c8cd43bc5269f7f252abaeb25dc98929f52b89bb', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '1a7ead411d64fc8edf2de0383049bfd60660a315', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: '0c63714bbefc4e9beb1d2cf7414e5774bab4eabe', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: '06304d9815e2199108dfcb3dade1494f17b76137',
778
+ } }, !this.isLoading && (index.h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, index.h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
699
779
  // Only show loading spinner if it's not an error notification
700
780
  loading: this.isWaitingToRedirect &&
701
781
  this.notificationType !== 'error', onClick: () => {
@@ -707,9 +787,9 @@ const ZonosCheckoutFinish = class {
707
787
  }
708
788
  this.closeClickHandler();
709
789
  }, size: "md", variant: "primary" }, localization.translate('Close'))), !window.Zonos.isLegacyCheckout &&
710
- this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: '9b809e21052fddb2149a2a1d0c22db4b10808403', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
790
+ this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
711
791
  cart.cartStore.step === 'finish' &&
712
- this.notificationType === 'success' && (index.h("div", { key: '4a278c7c4270d265c61b6b36d20864c55e1b42f1', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'fd8a876a0c5b76edd3be2d9b28da9c3963aee714', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: '7882981c1fe01ab6f78d8f84bcfc9aab94bffb74', onClick: () => {
792
+ this.notificationType === 'success' && (index.h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
713
793
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
714
794
  this.redirectToUrl(isZonosDashboard
715
795
  ? '/orders/all'
@@ -827,7 +907,7 @@ const ZonosCheckoutPayment = class {
827
907
  * handler for continue button click
828
908
  */
829
909
  this.continueClickHandler = async ({ currencyCode, }) => {
830
- var _a;
910
+ var _a, _b;
831
911
  if (!this.handleValidate()) {
832
912
  this.showErrorBanner = true;
833
913
  // Attempt to submit the form so the missing input error will be shown in Stripe
@@ -842,7 +922,13 @@ const ZonosCheckoutPayment = class {
842
922
  }
843
923
  cart.stripeStore.checkoutSettlementCurrency = currencyCode;
844
924
  // submit google tag when the form is complete
845
- paypal.submitGtag('zonos-checkout-payment-info');
925
+ submitGtag.submitGtag({
926
+ event: 'zonos-checkout-payment-info',
927
+ metadata: {
928
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
929
+ paymentMethod: (_b = cart.stripeStore.stripePaymentEventData) === null || _b === void 0 ? void 0 : _b.value.type,
930
+ },
931
+ });
846
932
  this.continueClicked.emit();
847
933
  };
848
934
  this.copyCardToClipboard = async (cardNumber) => {
@@ -1949,20 +2035,26 @@ const ZonosShipping = class {
1949
2035
  * handler for continue button click
1950
2036
  */
1951
2037
  this.continueClickHandler = () => {
1952
- var _a;
2038
+ var _a, _b;
1953
2039
  // show error banner if the form is not complete
1954
2040
  if (!this.handleValidate()) {
1955
2041
  this.showErrorBanner = true;
1956
2042
  return;
1957
2043
  }
1958
2044
  // submit google tag when the form is complete
1959
- paypal.submitGtag('zonos-checkout-shipping-info');
2045
+ submitGtag.submitGtag({
2046
+ event: 'zonos-checkout-shipping-info',
2047
+ metadata: {
2048
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
2049
+ serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
2050
+ },
2051
+ });
1960
2052
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
1961
2053
  void cart.trackConversionEvent({
1962
2054
  checkoutSessionId,
1963
2055
  eventName: 'checkout_shippingInfoCompleted',
1964
2056
  metadata: {
1965
- serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
2057
+ serviceLevelId: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value,
1966
2058
  },
1967
2059
  });
1968
2060
  this.showErrorBanner = false;