@zonos/elements 1.3.128 → 1.3.129

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 (107) hide show
  1. package/dist/cjs/{CheckoutConfig-8e3cdcb3.js → CheckoutConfig-62479cef.js} +1 -1
  2. package/dist/cjs/{cart-3bdaf092.js → cart-ba8cca00.js} +22 -3
  3. package/dist/cjs/{handleFetch-fa0ce321.js → handleFetch-a8dfb07c.js} +1 -1
  4. package/dist/cjs/index.cjs.js +15 -9
  5. package/dist/cjs/{paypal-2f48ab8d.js → paypal-441c3f79.js} +2 -2
  6. package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
  7. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +6 -9
  8. package/dist/cjs/zonos-checkout.cjs.entry.js +7 -8
  9. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  10. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +3 -6
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +3 -3
  18. package/dist/collection/components/store/checkout/stripe.js +17 -2
  19. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +4 -0
  20. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +0 -1
  21. package/dist/collection/components/utils/logging/sendErrorLog.js +1 -1
  22. package/dist/collection/scripts/_zonosBase.js +6 -0
  23. package/dist/collection/types/generated/graphql.frontend.types.js +5 -0
  24. package/dist/collection/types/generated/graphql.internal.types.js +39 -0
  25. package/dist/esm/{CheckoutConfig-101b97e6.js → CheckoutConfig-5da839fa.js} +1 -1
  26. package/dist/esm/{cart-519f08e3.js → cart-01b5bf4a.js} +22 -3
  27. package/dist/esm/{handleFetch-da1a9c5d.js → handleFetch-40fc3562.js} +1 -1
  28. package/dist/esm/index.js +16 -10
  29. package/dist/esm/{paypal-d0a05eda.js → paypal-4c094b25.js} +2 -2
  30. package/dist/esm/zonos-address_7.entry.js +2 -2
  31. package/dist/esm/zonos-cart-items_13.entry.js +6 -9
  32. package/dist/esm/zonos-checkout.entry.js +7 -8
  33. package/dist/esm/zonos-controller.entry.js +2 -2
  34. package/dist/esm/zonos-country-flag.entry.js +2 -2
  35. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  36. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  37. package/dist/esm/zonos-hello.entry.js +2 -2
  38. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  39. package/dist/esm/zonos-notification_3.entry.js +3 -3
  40. package/dist/esm-es5/{CheckoutConfig-101b97e6.js → CheckoutConfig-5da839fa.js} +1 -1
  41. package/dist/esm-es5/{cart-519f08e3.js → cart-01b5bf4a.js} +1 -1
  42. package/dist/esm-es5/handleFetch-40fc3562.js +1 -0
  43. package/dist/esm-es5/index.js +1 -1
  44. package/dist/esm-es5/{paypal-d0a05eda.js → paypal-4c094b25.js} +1 -1
  45. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  46. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  47. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  48. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  49. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  50. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  51. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  52. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  53. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  54. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  55. package/dist/scripts/index.d.ts +6 -0
  56. package/dist/scripts/index.js +1 -1
  57. package/dist/scripts/loadZonos.js +1 -1
  58. package/dist/scripts/zonos.js +1 -1
  59. package/dist/types/components/store/checkout/stripe.d.ts +1 -0
  60. package/dist/types/scripts/_zonosBase.d.ts +2 -0
  61. package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +8 -0
  62. package/dist/types/types/generated/graphql.frontend.types.d.ts +23 -0
  63. package/dist/types/types/generated/graphql.frontend.types.ts +33 -0
  64. package/dist/types/types/generated/graphql.internal.types.d.ts +44 -0
  65. package/dist/types/types/generated/graphql.internal.types.ts +57 -0
  66. package/dist/zonos-elements/index.esm.js +1 -1
  67. package/dist/zonos-elements/{p-eca920dc.system.entry.js → p-08948e65.system.entry.js} +1 -1
  68. package/dist/zonos-elements/p-0cfb97ae.js +1 -0
  69. package/dist/zonos-elements/p-0e8613be.entry.js +1 -0
  70. package/dist/zonos-elements/{p-0cb426b8.entry.js → p-0f465aa6.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-f962fc6a.system.entry.js → p-10aef679.system.entry.js} +1 -1
  72. package/dist/zonos-elements/{p-2db962f9.system.entry.js → p-17a5550a.system.entry.js} +1 -1
  73. package/dist/zonos-elements/p-26172f0d.entry.js +1 -0
  74. package/dist/zonos-elements/{p-8df3d5d0.system.entry.js → p-2bb86f3d.system.entry.js} +1 -1
  75. package/dist/zonos-elements/p-2faa3104.system.entry.js +1 -0
  76. package/dist/zonos-elements/p-4d4ea5dc.system.entry.js +1 -0
  77. package/dist/zonos-elements/{p-ea8663b7.entry.js → p-55a3db7d.entry.js} +1 -1
  78. package/dist/zonos-elements/{p-f7d56ce5.system.js → p-582cdd52.system.js} +1 -1
  79. package/dist/zonos-elements/{p-d9dceba1.system.js → p-5e22a288.system.js} +1 -1
  80. package/dist/zonos-elements/{p-9833f37d.system.entry.js → p-5ee9685e.system.entry.js} +1 -1
  81. package/dist/zonos-elements/p-60b0025b.system.js +1 -0
  82. package/dist/zonos-elements/p-6305e92c.system.js +1 -0
  83. package/dist/zonos-elements/{p-3dbfe639.entry.js → p-700c5732.entry.js} +1 -1
  84. package/dist/zonos-elements/{p-e2cda105.system.entry.js → p-7312d038.system.entry.js} +1 -1
  85. package/dist/zonos-elements/{p-167b7fa8.system.entry.js → p-8390f23d.system.entry.js} +1 -1
  86. package/dist/zonos-elements/{p-d6f1b6fa.system.entry.js → p-8612f8d1.system.entry.js} +1 -1
  87. package/dist/zonos-elements/{p-723c9d4d.entry.js → p-91e111c4.entry.js} +1 -1
  88. package/dist/zonos-elements/{p-2402e12c.js → p-94146bc9.js} +1 -1
  89. package/dist/zonos-elements/p-9b0cbd91.entry.js +1 -0
  90. package/dist/zonos-elements/{p-f50f48da.entry.js → p-9d057d1d.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-00ff4f4a.js → p-a9069f68.js} +1 -1
  92. package/dist/zonos-elements/{p-a3b195e9.js → p-b7cfbfc1.js} +1 -1
  93. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  94. package/dist/zonos-elements/{p-abbfde44.system.js → p-c93c9524.system.js} +2 -2
  95. package/dist/zonos-elements/{p-76d03238.entry.js → p-ce391c90.entry.js} +1 -1
  96. package/dist/zonos-elements/{p-efffbaec.entry.js → p-d6f8309b.entry.js} +1 -1
  97. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  98. package/package.json +1 -1
  99. package/dist/esm-es5/handleFetch-da1a9c5d.js +0 -1
  100. package/dist/zonos-elements/p-0fa85ff9.system.js +0 -1
  101. package/dist/zonos-elements/p-61380d53.system.entry.js +0 -1
  102. package/dist/zonos-elements/p-685e395e.entry.js +0 -1
  103. package/dist/zonos-elements/p-7769b60c.js +0 -1
  104. package/dist/zonos-elements/p-a7eaa9ad.entry.js +0 -1
  105. package/dist/zonos-elements/p-bc9987f2.system.entry.js +0 -1
  106. package/dist/zonos-elements/p-bf2f9095.entry.js +0 -1
  107. package/dist/zonos-elements/p-dcd4e458.system.js +0 -1
@@ -1069,6 +1069,16 @@ export const customsDocumentType = {
1069
1069
  Other: 'OTHER',
1070
1070
  ProFormaInvoice: 'PRO_FORMA_INVOICE',
1071
1071
  };
1072
+ export const customsItemValueSource = {
1073
+ ApiRequest: 'API_REQUEST',
1074
+ Catalog: 'CATALOG',
1075
+ Classify: 'CLASSIFY',
1076
+ ClassifyOnTheFly: 'CLASSIFY_ON_THE_FLY',
1077
+ Fallback: 'FALLBACK',
1078
+ Hybrid: 'HYBRID',
1079
+ OrganizationSetting: 'ORGANIZATION_SETTING',
1080
+ UserProvided: 'USER_PROVIDED',
1081
+ };
1072
1082
  export const customsSpecAttributeType = {
1073
1083
  AccountNumber: 'ACCOUNT_NUMBER',
1074
1084
  B13A: 'B13A',
@@ -1514,6 +1524,7 @@ export const itemValueSource = {
1514
1524
  ApiRequest: 'API_REQUEST',
1515
1525
  Catalog: 'CATALOG',
1516
1526
  Classify: 'CLASSIFY',
1527
+ ClassifyOnTheFly: 'CLASSIFY_ON_THE_FLY',
1517
1528
  Fallback: 'FALLBACK',
1518
1529
  Hybrid: 'HYBRID',
1519
1530
  OrganizationSetting: 'ORGANIZATION_SETTING',
@@ -1751,6 +1762,12 @@ export const manualClassificationBulkJobStatus = {
1751
1762
  ManuallyClassified: 'MANUALLY_CLASSIFIED',
1752
1763
  Processing: 'PROCESSING',
1753
1764
  };
1765
+ export const manualClassificationExportJobStatus = {
1766
+ Completed: 'COMPLETED',
1767
+ Error: 'ERROR',
1768
+ Initialized: 'INITIALIZED',
1769
+ Processing: 'PROCESSING',
1770
+ };
1754
1771
  export const manualClassificationRequestCreateStatus = {
1755
1772
  Created: 'CREATED',
1756
1773
  Existing: 'EXISTING',
@@ -1939,6 +1956,28 @@ export const paypalMockResponse = {
1939
1956
  InternalServerError: 'INTERNAL_SERVER_ERROR',
1940
1957
  TransactionRefused: 'TRANSACTION_REFUSED',
1941
1958
  };
1959
+ export const paypalOrderStatus = {
1960
+ Approved: 'APPROVED',
1961
+ Completed: 'COMPLETED',
1962
+ Created: 'CREATED',
1963
+ PayerActionRequired: 'PAYER_ACTION_REQUIRED',
1964
+ Saved: 'SAVED',
1965
+ Voided: 'VOIDED',
1966
+ };
1967
+ export const paypalPaymentStatus = {
1968
+ Completed: 'COMPLETED',
1969
+ Declined: 'DECLINED',
1970
+ Failed: 'FAILED',
1971
+ PartiallyRefunded: 'PARTIALLY_REFUNDED',
1972
+ Pending: 'PENDING',
1973
+ Refunded: 'REFUNDED',
1974
+ };
1975
+ export const paypalRefundStatus = {
1976
+ Cancelled: 'CANCELLED',
1977
+ Completed: 'COMPLETED',
1978
+ Failed: 'FAILED',
1979
+ Pending: 'PENDING',
1980
+ };
1942
1981
  export const pddpAmountType = {
1943
1982
  FlcTotalCost: 'FLC_TOTAL_COST',
1944
1983
  InsuredValue: 'INSURED_VALUE',
@@ -1,4 +1,4 @@
1
- import { h as handleFetch, l as log, a as logError } from './handleFetch-da1a9c5d.js';
1
+ import { h as handleFetch, l as log, a as logError } from './handleFetch-40fc3562.js';
2
2
 
3
3
  const getTempCartById = async ({ cartId, retries, }) => {
4
4
  const urlParams = new URLSearchParams(window.location.search);
@@ -1,5 +1,5 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-6b5bd87c.js';
2
- import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-da1a9c5d.js';
2
+ import { h as handleFetch, a as logError, l as log, f as fallbackApiList, s as sendErrorLog, j as jsonParse } from './handleFetch-40fc3562.js';
3
3
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
5
5
 
@@ -9208,6 +9208,7 @@ const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
9208
9208
  */
9209
9209
  const prepCartCalculateLandedCost = (cartId) => {
9210
9210
  var _a;
9211
+ const isE2ETest = new URLSearchParams(window.location.search).get('zonosE2ETest') === '1';
9211
9212
  // maybe we don't need email now for prefetch the landed cost
9212
9213
  const stripeLinkData = stripeStore.stripeLinkEventData;
9213
9214
  const stripeAddressData = stripeStore.stripeAddressEventData;
@@ -9258,6 +9259,7 @@ const prepCartCalculateLandedCost = (cartId) => {
9258
9259
  lastName: shippingLastName,
9259
9260
  phone: translatedShippingAddress.phone,
9260
9261
  },
9262
+ isTest: !!isE2ETest,
9261
9263
  landedCostAdjustments: cartStore.promoCode
9262
9264
  ? [
9263
9265
  {
@@ -9280,6 +9282,7 @@ const prepCartCalculateLandedCost = (cartId) => {
9280
9282
  };
9281
9283
  };
9282
9284
  const prepCalculateLandedCost = () => {
9285
+ const isE2ETest = new URLSearchParams(window.location.search).get('zonosE2ETest') === '1';
9283
9286
  // maybe we don't need email now for prefetch the landed cost
9284
9287
  const stripeLinkData = stripeStore.stripeLinkEventData;
9285
9288
  const stripeAddressData = stripeStore.stripeAddressEventData;
@@ -9340,6 +9343,7 @@ const prepCalculateLandedCost = () => {
9340
9343
  lastName: shippingLastName,
9341
9344
  phone: translatedShippingAddress.phone,
9342
9345
  },
9346
+ isTest: isE2ETest,
9343
9347
  items: cartStore.items,
9344
9348
  landedCostAdjustments: adjustments,
9345
9349
  shippingAddress: {
@@ -9858,6 +9862,7 @@ const stripeCalculateLandedCost = async () => {
9858
9862
  };
9859
9863
  const stripeStorePrefetchLandedCost = async (params) => {
9860
9864
  var _a, _b, _c, _d, _e, _f, _g, _h;
9865
+ const retries = (params === null || params === void 0 ? void 0 : params.retries) || 0;
9861
9866
  const applyingPromocode = !!(params === null || params === void 0 ? void 0 : params.applyingPromocode);
9862
9867
  const stripeAddressReady = !!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete);
9863
9868
  const stripeLinkReady = !!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
@@ -9877,7 +9882,16 @@ const stripeStorePrefetchLandedCost = async (params) => {
9877
9882
  !stripeBillingAddressReady) {
9878
9883
  return;
9879
9884
  }
9880
- stripeStore.isFetchingLandedCost = true;
9885
+ // If there is retries, stop loading for a moment and then showing the spinner again (this is just so customer can see that checkout is doing something and not stuck)
9886
+ if (retries) {
9887
+ stripeStore.isFetchingLandedCost = false;
9888
+ setTimeout(() => {
9889
+ stripeStore.isFetchingLandedCost = true;
9890
+ }, 300);
9891
+ }
9892
+ else {
9893
+ stripeStore.isFetchingLandedCost = true;
9894
+ }
9881
9895
  if (stripeStore.stripeAddressEventData) {
9882
9896
  stripeStore.stripeAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeAddressEventData);
9883
9897
  }
@@ -9916,9 +9930,14 @@ const stripeStorePrefetchLandedCost = async (params) => {
9916
9930
  if (err instanceof Error &&
9917
9931
  err.message &&
9918
9932
  !excludeErrors.includes(err.message)) {
9933
+ if (retries < 1) {
9934
+ // retry fetching landed cost one more time
9935
+ await stripeStorePrefetchLandedCost(Object.assign(Object.assign({}, params), { retries: (retries || 0) + 1 }));
9936
+ return;
9937
+ }
9919
9938
  const shipToAddress = (_h = stripeStore.stripeAddressUsedWhenFetchingLC) === null || _h === void 0 ? void 0 : _h.value;
9920
9939
  void sendErrorLog({
9921
- endpoint: 'Failed to fetch landed cost',
9940
+ endpoint: `Failed to fetch landed cost (${retries} retries)`,
9922
9941
  errors: [err.message],
9923
9942
  metadata: {
9924
9943
  cartId: window.Zonos.cartId,
@@ -139,7 +139,7 @@ const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseError
139
139
  endpoint,
140
140
  errors,
141
141
  href: window.location.href,
142
- metadata: Object.assign({ userAgent: userAgentData && userAgentData.brands.length > 0
142
+ metadata: Object.assign({ domain: window.Zonos.domain, userAgent: userAgentData && userAgentData.brands.length > 0
143
143
  ? userAgentData
144
144
  : window.navigator.userAgent }, metadata),
145
145
  };
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { l as log, a as logError } from './handleFetch-da1a9c5d.js';
2
- import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-101b97e6.js';
3
- export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-101b97e6.js';
1
+ import { l as log, a as logError } from './handleFetch-40fc3562.js';
2
+ import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5da839fa.js';
3
+ export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-5da839fa.js';
4
4
 
5
5
  /**
6
6
  * Get the load version and url based on the loadScriptSrc and version
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
94
94
  return null;
95
95
  }
96
96
  const qaUrl = extractZonosQaUrl(window.location.href);
97
- const cdnUrl = "https://v1.3.128.js.zonos.com";
97
+ const cdnUrl = "https://v1.3.129.js.zonos.com";
98
98
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
99
99
  if (!qaUrl &&
100
100
  (cdnUrl.includes('test.') ||
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
278
278
  }
279
279
  return null;
280
280
  })();
281
- const ZONOS_URL = "https://v1.3.128.js.zonos.com";
282
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.128";
283
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.128";
284
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.128";
281
+ const ZONOS_URL = "https://v1.3.129.js.zonos.com";
282
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.129";
283
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.129";
284
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.129";
285
285
  const INTER_FONT_URL = 'https://rsms.me';
286
286
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
287
287
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -296,8 +296,14 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
296
296
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
297
297
  Zonos._paypalMockResponse = null;
298
298
  Zonos.isBigCommerce = false;
299
- Zonos.releaseDate = "1731429497368";
299
+ Zonos.releaseDate = "1731519234165";
300
300
  Zonos.isLegacyCheckout = false;
301
+ Zonos.domain = typeof window !== 'undefined'
302
+ ? // domain that embeds the iframe
303
+ (window.location != window.parent.location && document.referrer) ||
304
+ // current domain
305
+ document.location.hostname
306
+ : '';
301
307
  Zonos.showBaseForeign = typeof window !== 'undefined' &&
302
308
  window.location.search.includes('zonosShowBaseForeign');
303
309
  /**
@@ -306,7 +312,7 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
306
312
  Zonos.isNpm = true;
307
313
  Zonos.zonosQaUrl = null;
308
314
  Zonos.zonosQaUrlApi = null;
309
- Zonos.version = `v${"1.3.128"}`;
315
+ Zonos.version = `v${"1.3.129"}`;
310
316
  Zonos.modeAlerted = false;
311
317
  Zonos.cartData = null;
312
318
  Zonos.paypal = null;
@@ -1,6 +1,6 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-6b5bd87c.js';
2
- import { d as cartStore, w as stripeStoreHandleInventoryCheck, p as translate, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-519f08e3.js';
3
- import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-da1a9c5d.js';
2
+ import { d as cartStore, w as stripeStoreHandleInventoryCheck, p as translate, v as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-01b5bf4a.js';
3
+ import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-40fc3562.js';
4
4
  import { t as tinycolor } from './isDarkColor-dc08fa26.js';
5
5
 
6
6
  /*!
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { j as stripeStore, S as getFallbackDefaultCountryCode, l as localizationStore, p as translate } from './cart-519f08e3.js';
2
+ import { j as stripeStore, S as getFallbackDefaultCountryCode, l as localizationStore, p as translate } from './cart-01b5bf4a.js';
3
3
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
4
- import { a as logError, l as log } from './handleFetch-da1a9c5d.js';
4
+ import { a as logError, l as log } from './handleFetch-40fc3562.js';
5
5
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
6
6
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
2
- import { d as cartStore, H as currencyFormat, p as translate, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, z as stripeStoreReset, j as stripeStore, L as stripeStoreRetrievePayment, t as trackConversionEvent, M as stripeStoreResetPromoCode, N as stripeStoreMessageBasedOnStatus, l as localizationStore, O as stripeStoreTranslateAddressToLatin, P as cartStoreUpdateSelectedShippingOption, Q as cartStoreGetShippingTransitInfo, R as sortServiceLevelOptionsByAmount } from './cart-519f08e3.js';
2
+ import { d as cartStore, H as currencyFormat, p as translate, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, z as stripeStoreReset, j as stripeStore, L as stripeStoreRetrievePayment, t as trackConversionEvent, M as stripeStoreResetPromoCode, N as stripeStoreMessageBasedOnStatus, l as localizationStore, O as stripeStoreTranslateAddressToLatin, P as cartStoreUpdateSelectedShippingOption, Q as cartStoreGetShippingTransitInfo, R as sortServiceLevelOptionsByAmount } from './cart-01b5bf4a.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-d0a05eda.js';
4
+ import { s as submitGtag, b as paypalStore, c as paypalStoreReset, i as isContrastColor } from './paypal-4c094b25.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
6
6
  import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
7
7
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
8
- import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-da1a9c5d.js';
8
+ import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, b as allLogs } from './handleFetch-40fc3562.js';
9
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
10
10
  import { l as languages } from './ILanguage-cd6acb72.js';
11
11
  import { i as isDarkColor, t as tinycolor } from './isDarkColor-dc08fa26.js';
@@ -1385,7 +1385,6 @@ const ZonosCheckoutFinish = class {
1385
1385
  metadata: {
1386
1386
  allLogs,
1387
1387
  checkoutSessionId: cartStore.checkoutSessionId || '',
1388
- domain: window.location.hostname,
1389
1388
  orderId: order.id,
1390
1389
  storeId: zonosStore.storeId,
1391
1390
  },
@@ -1400,7 +1399,6 @@ const ZonosCheckoutFinish = class {
1400
1399
  metadata: {
1401
1400
  allLogs,
1402
1401
  checkoutSessionId: cartStore.checkoutSessionId || '',
1403
- domain: window.location.hostname,
1404
1402
  orderId: order.id,
1405
1403
  storeId: zonosStore.storeId,
1406
1404
  },
@@ -1420,7 +1418,6 @@ const ZonosCheckoutFinish = class {
1420
1418
  metadata: {
1421
1419
  allLogs,
1422
1420
  checkoutSessionId: cartStore.checkoutSessionId || '',
1423
- domain: window.location.hostname,
1424
1421
  storeId: zonosStore.storeId,
1425
1422
  },
1426
1423
  });
@@ -1562,12 +1559,12 @@ const ZonosCheckoutFinish = class {
1562
1559
  }
1563
1560
  render() {
1564
1561
  const isTestMode = getIsTestMode();
1565
- return (h(Host, { key: 'e9e088880a1b13f821dfdb7804b2e27efae5298c', class: "zonos--checkout-finish zonos--elements", style: {
1562
+ return (h(Host, { key: '09ad6462aeafdfa1be8b0f0e34159aa74934b85c', class: "zonos--checkout-finish zonos--elements", style: {
1566
1563
  '--zonos--border-radius': getBorderRadius({
1567
1564
  overrideBorderStyle: this.borderRadius,
1568
1565
  }),
1569
- } }, !this.isLoading && (h("div", { key: 'a1ec6900c645aedfd4f4662fa5251b5b9adebadf', class: "zonos--finish-details" }, h("div", { key: '6e08efc67a101ca4af34c67d853709d1f4f0f436', 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: '049e7cbaef783b113daaf449b842bb27e1cd9fd4', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '9ff5e5794bd0762341ef27cfca03bb52829c3463', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), !window.Zonos.isLegacyCheckout &&
1570
- this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '0546063749a2b2c96762488e03507bfa31643b33', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'ef75fac530f2a3cf69ccd28c2d48f93771b8459e', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '5e8dd1c3e34c1e97b14e9f6225817005b79bd679', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '40c1c75fb3afae2c20ce8b018285f5cc21abbb96', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
1566
+ } }, !this.isLoading && (h("div", { key: '81df3ec5804d346938cd0052232446500805e5dd', class: "zonos--finish-details" }, h("div", { key: '49f0b91cd04f2f6e1291de3c542cec6ed1f3c0a9', 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: '398e803727b65d2dd7da40bb37e25702f69009d6', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '75ee45470ceca25057259916c76dd227f62b7276', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), !window.Zonos.isLegacyCheckout &&
1567
+ this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: 'cd792a9dd314e291d0957e0859e3b0e088cf1767', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'b54c583f058c23b2b5001179acac0c98780b1ded', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '2405f70c3143725d51d6f6a5e5a440350aeb9b80', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'c977d79e45170cce70695006de1274ef7cc39df4', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
1571
1568
  }
1572
1569
  static get assetsDirs() { return ["assets"]; }
1573
1570
  };
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as translate, q as getZCountryUrlParam, r as cartStoreSetCheckoutSession, u as stripeStorePrefetchLandedCost, v as cartStoreNextStep, w as stripeStoreHandleInventoryCheck, x as stripeStoreConfirmPayment, y as stripeStoreHandleInventoryRefund, z as stripeStoreReset, A as localizationStoreOnUpdate } from './cart-519f08e3.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-d0a05eda.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as translate, q as getZCountryUrlParam, r as cartStoreSetCheckoutSession, u as stripeStorePrefetchLandedCost, v as cartStoreNextStep, w as stripeStoreHandleInventoryCheck, x as stripeStoreConfirmPayment, y as stripeStoreHandleInventoryRefund, z as stripeStoreReset, A as localizationStoreOnUpdate } from './cart-01b5bf4a.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript } from './paypal-4c094b25.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
5
- import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-da1a9c5d.js';
5
+ import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs, j as jsonParse } from './handleFetch-40fc3562.js';
6
6
  import { c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-31a792d3.js';
7
7
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
8
8
  import { c as classes } from './classes-0d95c529.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
10
10
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
11
11
  import { s as styles } from './styles-6fc2fad9.js';
12
- import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-101b97e6.js';
12
+ import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-5da839fa.js';
13
13
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
14
14
 
15
15
  /**
@@ -151,7 +151,6 @@ const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShi
151
151
  JSON.stringify(Object.entries(shippingAddress)),
152
152
  ],
153
153
  metadata: {
154
- domain: window.location.hostname,
155
154
  storeId: zonosStore.storeId,
156
155
  },
157
156
  });
@@ -600,12 +599,12 @@ const ZonosCheckout = class {
600
599
  const postal_code = getParam('customerZip') || '';
601
600
  const state = getParam('customerState') || '';
602
601
  /**
603
- * If one of the value is null, no need to preset the default address
602
+ * If one of the value is null, no need to preset the default address.
603
+ * City and state are optional (they are not always provided for example Puerto Rico)
604
604
  **/
605
- if (!line1 || (!city && !state) || !name || !phone || !country) {
605
+ if (!line1 || !name || !phone || !country) {
606
606
  log('Missing required query params so it can not be prefilled', 'info', [
607
607
  !line1 && 'line1',
608
- !city && 'city',
609
608
  !name && 'name',
610
609
  !phone && 'phone',
611
610
  !country && 'country',
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
2
- import { B as isValidSelector, j as stripeStore, C as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-519f08e3.js';
2
+ import { B as isValidSelector, j as stripeStore, C as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-01b5bf4a.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
- import { h as handleFetch, a as logError, l as log } from './handleFetch-da1a9c5d.js';
4
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-40fc3562.js';
5
5
  import './isDarkColor-dc08fa26.js';
6
6
  import './getBorderRadius-008516a4.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { l as localizationStore } from './cart-519f08e3.js';
2
+ import { l as localizationStore } from './cart-01b5bf4a.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-da1a9c5d.js';
5
+ import './handleFetch-40fc3562.js';
6
6
  import './isDarkColor-dc08fa26.js';
7
7
  import './getBorderRadius-008516a4.js';
8
8
 
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, p as translate, l as localizationStore } from './cart-519f08e3.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, p as translate, l as localizationStore } from './cart-01b5bf4a.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-dc08fa26.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-da1a9c5d.js';
7
+ import './handleFetch-40fc3562.js';
8
8
  import './getBorderRadius-008516a4.js';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
2
- import { p as translate, l as localizationStore, H as currencyFormat } from './cart-519f08e3.js';
2
+ import { p as translate, l as localizationStore, H as currencyFormat } from './cart-01b5bf4a.js';
3
3
  import { z as zonosStore } from './zonosStore-6b5bd87c.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
- import './handleFetch-da1a9c5d.js';
7
+ import './handleFetch-40fc3562.js';
8
8
  import './isDarkColor-dc08fa26.js';
9
9
  import './getBorderRadius-008516a4.js';
10
10
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
2
  import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-6b5bd87c.js';
3
- import { l as localizationStore, B as isValidSelector, p as translate, q as getZCountryUrlParam, D as setZCountryUrlParam, E as currencyDisplay, F as currencyConvertAndFormat, G as currencyConvert, H as currencyFormat } from './cart-519f08e3.js';
3
+ import { l as localizationStore, B as isValidSelector, p as translate, q as getZCountryUrlParam, D as setZCountryUrlParam, E as currencyDisplay, F as currencyConvertAndFormat, G as currencyConvert, H as currencyFormat } from './cart-01b5bf4a.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import { h as handleFetch, a as logError, l as log } from './handleFetch-da1a9c5d.js';
5
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-40fc3562.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
7
  import './isDarkColor-dc08fa26.js';
8
8
  import './getBorderRadius-008516a4.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
- import { T as localizationStoreUpdateSelectedLocale, p as translate, l as localizationStore } from './cart-519f08e3.js';
2
+ import { T as localizationStoreUpdateSelectedLocale, p as translate, l as localizationStore } from './cart-01b5bf4a.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
- import './handleFetch-da1a9c5d.js';
5
+ import './handleFetch-40fc3562.js';
6
6
  import './isDarkColor-dc08fa26.js';
7
7
  import './getBorderRadius-008516a4.js';
8
8
 
@@ -2,9 +2,9 @@ import { r as registerInstance, h, H as Host, d as getElement, c as createEvent
2
2
  import { d as zonosStoreFontFamily } from './zonosStore-6b5bd87c.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-008516a4.js';
5
- import { j as stripeStore } from './cart-519f08e3.js';
6
- import { a as logError, l as log } from './handleFetch-da1a9c5d.js';
7
- import { d as paypalStoreInitButtons } from './paypal-d0a05eda.js';
5
+ import { j as stripeStore } from './cart-01b5bf4a.js';
6
+ import { a as logError, l as log } from './handleFetch-40fc3562.js';
7
+ import { d as paypalStoreInitButtons } from './paypal-4c094b25.js';
8
8
  import './isDarkColor-dc08fa26.js';
9
9
 
10
10
  const zonosNotificationCss = ":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{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-da1a9c5d.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,n,a,o,i;var c=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams(window.location.search);r=t.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:c},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:n=e.sent(),a=n.errors,o=n.json;i=!o||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:c,retries:s-1})];case 3:if(i){return[2,null]}return[2,o]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,n=t.isLegacyCartId;if(!n&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:a=o.sent();log("[ZONOS - loadZonos] getting temp cart data","info",a);if(!a){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:a.cartData,storeFavicon:a.storeFaviconUrl,storeId:a.cartData.storeId,storeLogo:a.storeLogoUrl,zonosApiKey:a.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function c(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?r(e.value):a(e.value).then(i,c)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,a&&(o=c[0]&2?a["return"]:c[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,c[1])).done)return o;if(a=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;a=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1];o=c;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(c);break}if(o[2])r.ops.pop();r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e];a=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-40fc3562.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,n,a,o,i;var c=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=new URLSearchParams(window.location.search);r=t.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:r,tempCartUUID:c},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:n=e.sent(),a=n.errors,o=n.json;i=!o||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:c,retries:s-1})];case 3:if(i){return[2,null]}return[2,o]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,n=t.isLegacyCartId;if(!n&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:a=o.sent();log("[ZONOS - loadZonos] getting temp cart data","info",a);if(!a){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:a.cartData,storeFavicon:a.storeFaviconUrl,storeId:a.cartData.storeId,storeLogo:a.storeLogoUrl,zonosApiKey:a.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};