@zonos/elements 1.3.12-alpha.1 → 1.3.12-alpha.3

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 (153) hide show
  1. package/dist/cjs/{cart-fcddc0e6.js → cart-fe91535c.js} +540 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sendErrorLog-fb356701.js +29 -0
  4. package/dist/cjs/{submitGtag-ec6ead54.js → submitGtag-62c97f6b.js} +1 -20
  5. package/dist/cjs/zonos-address_4.cjs.entry.js +41 -17
  6. package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
  7. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +8 -8
  8. package/dist/cjs/zonos-checkout.cjs.entry.js +7 -7
  9. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-country-select_3.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-elements.cjs.js +1 -1
  13. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-payment.cjs.entry.js +1 -1
  16. package/dist/collection/components/store/translationStore/strings.arabic.js +27 -0
  17. package/dist/collection/components/store/translationStore/strings.base.js +27 -0
  18. package/dist/collection/components/store/translationStore/strings.chinese.js +27 -0
  19. package/dist/collection/components/store/translationStore/strings.danish.js +27 -0
  20. package/dist/collection/components/store/translationStore/strings.dutch.js +27 -0
  21. package/dist/collection/components/store/translationStore/strings.french.js +27 -0
  22. package/dist/collection/components/store/translationStore/strings.german.js +27 -0
  23. package/dist/collection/components/store/translationStore/strings.hebrew.js +27 -0
  24. package/dist/collection/components/store/translationStore/strings.indonesian.js +27 -0
  25. package/dist/collection/components/store/translationStore/strings.italian.js +27 -0
  26. package/dist/collection/components/store/translationStore/strings.japanese.js +27 -0
  27. package/dist/collection/components/store/translationStore/strings.korean.js +27 -0
  28. package/dist/collection/components/store/translationStore/strings.norwegian.js +27 -0
  29. package/dist/collection/components/store/translationStore/strings.polish.js +27 -0
  30. package/dist/collection/components/store/translationStore/strings.portuguese.js +27 -0
  31. package/dist/collection/components/store/translationStore/strings.russian.js +27 -0
  32. package/dist/collection/components/store/translationStore/strings.spanish.js +27 -0
  33. package/dist/collection/components/store/translationStore/strings.swedish.js +27 -0
  34. package/dist/collection/components/store/translationStore/strings.turkish.js +27 -0
  35. package/dist/collection/components/store/translationStore/strings.vietnamese.js +27 -0
  36. package/dist/collection/components/stripe/zonos-address/zonos-address.js +41 -15
  37. package/dist/collection/components/utils/logging/sendLoadScriptLog.js +8 -0
  38. package/dist/collection/types/LogLoadScriptRequestBody.js +1 -0
  39. package/dist/collection/types/generated/graphql.customer.types.js +45 -14
  40. package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
  41. package/dist/components/sendErrorLog.js +21 -0
  42. package/dist/components/stripe.js +541 -1
  43. package/dist/components/trackConversionEvent.js +1 -1
  44. package/dist/components/zonos-address2.js +41 -15
  45. package/dist/components/zonos-checkout-finish2.js +3 -20
  46. package/dist/components/zonos-checkout.js +3 -2
  47. package/dist/components/zonos-controller.js +1 -1
  48. package/dist/components/zonos-hello.js +1 -1
  49. package/dist/components/zonos-link-authentication2.js +1 -1
  50. package/dist/esm/{cart-228e1ef7.js → cart-53f5c10c.js} +540 -0
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/sendErrorLog-1c2f093d.js +26 -0
  53. package/dist/esm/{submitGtag-c3727595.js → submitGtag-d2658ed5.js} +2 -20
  54. package/dist/esm/zonos-address_4.entry.js +40 -16
  55. package/dist/esm/zonos-card_2.entry.js +1 -1
  56. package/dist/esm/zonos-cart-items_10.entry.js +3 -3
  57. package/dist/esm/zonos-checkout.entry.js +3 -3
  58. package/dist/esm/zonos-controller.entry.js +1 -1
  59. package/dist/esm/zonos-country-flag.entry.js +1 -1
  60. package/dist/esm/zonos-country-select_3.entry.js +1 -1
  61. package/dist/esm/zonos-elements.js +1 -1
  62. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  63. package/dist/esm/zonos-hello.entry.js +1 -1
  64. package/dist/esm/zonos-payment.entry.js +1 -1
  65. package/dist/esm-es5/cart-53f5c10c.js +1 -0
  66. package/dist/esm-es5/loader.js +1 -1
  67. package/dist/esm-es5/sendErrorLog-1c2f093d.js +1 -0
  68. package/dist/esm-es5/submitGtag-d2658ed5.js +1 -0
  69. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  70. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  71. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  72. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  73. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  74. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  75. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  76. package/dist/esm-es5/zonos-elements.js +1 -1
  77. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  78. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  79. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  80. package/dist/scripts/loadZonos.js +1 -1
  81. package/dist/scripts/zonos.js +1 -1
  82. package/dist/scripts/zonosBase.js +1 -1
  83. package/dist/types/components/store/translationStore/strings.arabic.d.ts +27 -0
  84. package/dist/types/components/store/translationStore/strings.base.d.ts +27 -0
  85. package/dist/types/components/store/translationStore/strings.chinese.d.ts +27 -0
  86. package/dist/types/components/store/translationStore/strings.danish.d.ts +27 -0
  87. package/dist/types/components/store/translationStore/strings.dutch.d.ts +27 -0
  88. package/dist/types/components/store/translationStore/strings.french.d.ts +27 -0
  89. package/dist/types/components/store/translationStore/strings.german.d.ts +27 -0
  90. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +27 -0
  91. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +27 -0
  92. package/dist/types/components/store/translationStore/strings.italian.d.ts +27 -0
  93. package/dist/types/components/store/translationStore/strings.japanese.d.ts +27 -0
  94. package/dist/types/components/store/translationStore/strings.korean.d.ts +27 -0
  95. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +27 -0
  96. package/dist/types/components/store/translationStore/strings.polish.d.ts +27 -0
  97. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +27 -0
  98. package/dist/types/components/store/translationStore/strings.russian.d.ts +27 -0
  99. package/dist/types/components/store/translationStore/strings.spanish.d.ts +27 -0
  100. package/dist/types/components/store/translationStore/strings.swedish.d.ts +27 -0
  101. package/dist/types/components/store/translationStore/strings.turkish.d.ts +27 -0
  102. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +27 -0
  103. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +7 -1
  104. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  105. package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +4 -0
  106. package/dist/types/types/LogLoadScriptRequestBody.d.ts +11 -0
  107. package/dist/types/types/generated/graphql.customer.types.d.ts +54 -16
  108. package/dist/types/types/generated/graphql.customer.types.ts +74 -20
  109. package/dist/types/types/generated/graphql.frontend.types.d.ts +12 -1
  110. package/dist/types/types/generated/graphql.frontend.types.ts +22 -1
  111. package/dist/types/types/global.d.ts +1 -2
  112. package/dist/zonos-elements/{p-35c328ba.system.entry.js → p-09d7a0f8.system.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-67ff446b.system.entry.js → p-0cc5cfbd.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-11f1b5fb.entry.js → p-125043b5.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-55940b5a.system.entry.js → p-176f65e1.system.entry.js} +1 -1
  116. package/dist/zonos-elements/p-19dbd8c2.entry.js +1 -0
  117. package/dist/zonos-elements/p-3555ce7c.system.js +1 -0
  118. package/dist/zonos-elements/p-4cc4aba3.system.js +1 -0
  119. package/dist/zonos-elements/p-6e81adba.system.js +1 -1
  120. package/dist/zonos-elements/{p-5d5c0fbf.entry.js → p-6f6850aa.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-5f662cf2.entry.js → p-7e6bc603.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-ac5aecca.entry.js → p-969f36b3.entry.js} +1 -1
  123. package/dist/zonos-elements/p-9f4b0222.system.entry.js +1 -0
  124. package/dist/zonos-elements/p-aa46e052.js +1 -0
  125. package/dist/zonos-elements/{p-5dbb80df.system.entry.js → p-ac576bd7.system.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-30cd191f.entry.js → p-af17ec7f.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-499d7f5d.system.entry.js → p-b6c83e0b.system.entry.js} +1 -1
  128. package/dist/zonos-elements/p-bc25e1aa.js +1 -0
  129. package/dist/zonos-elements/p-beb55ff1.js +1 -0
  130. package/dist/zonos-elements/{p-925ae524.entry.js → p-bece7adb.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-0082c5be.system.entry.js → p-c30554b1.system.entry.js} +1 -1
  132. package/dist/zonos-elements/p-d24296a6.system.js +1 -0
  133. package/dist/zonos-elements/{p-14a2824f.entry.js → p-df6fd81f.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-c815e8b4.system.entry.js → p-e9732f93.system.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-7ff3a533.system.entry.js → p-ea1afd2d.system.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-d31e5fcc.entry.js → p-ecc72526.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-5f6f0581.system.entry.js → p-fd7ab92d.system.entry.js} +1 -1
  138. package/dist/zonos-elements/{p-db1adc42.entry.js → p-ff32ea53.entry.js} +1 -1
  139. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  140. package/package.json +1 -1
  141. package/dist/cjs/isCheckoutMobile-f491ca7c.js +0 -8
  142. package/dist/esm/isCheckoutMobile-8846dccb.js +0 -6
  143. package/dist/esm-es5/cart-228e1ef7.js +0 -1
  144. package/dist/esm-es5/isCheckoutMobile-8846dccb.js +0 -1
  145. package/dist/esm-es5/submitGtag-c3727595.js +0 -1
  146. package/dist/zonos-elements/p-0679e872.system.entry.js +0 -1
  147. package/dist/zonos-elements/p-09dbb0e9.entry.js +0 -1
  148. package/dist/zonos-elements/p-770e5b9e.js +0 -1
  149. package/dist/zonos-elements/p-81a54668.js +0 -1
  150. package/dist/zonos-elements/p-94bbf247.system.js +0 -1
  151. package/dist/zonos-elements/p-960e4021.system.js +0 -1
  152. package/dist/zonos-elements/p-aed0098c.system.js +0 -1
  153. package/dist/zonos-elements/p-d11b2449.js +0 -1
@@ -6,6 +6,16 @@ import { zonosStore } from "../../store/zonosStore";
6
6
  import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
7
7
  import { containsNonLatinChars } from "../../utils/containsNonLatinChars";
8
8
  import { logError } from "../../utils/logging/logError";
9
+ import { sendErrorLog } from "../../utils/logging/sendErrorLog";
10
+ const mappedFields = {
11
+ city: 'City',
12
+ country: 'Country',
13
+ line1: 'Address line 1',
14
+ line2: 'Address line 2',
15
+ name: 'Name',
16
+ postal_code: 'Postal code',
17
+ state: 'State',
18
+ };
9
19
  /**
10
20
  * This component is a wrapper for the stripe address element that would render default style object
11
21
  */
@@ -15,7 +25,8 @@ export class ZonosAddress {
15
25
  this.titleText = undefined;
16
26
  this.defaultAddress = null;
17
27
  this.stripe = window.Zonos.stripe;
18
- this.hasInvalidCharacters = false;
28
+ this.reportedInvalidCharacters = false;
29
+ this.invalidCharacterList = null;
19
30
  this.isDirtyAddress = false;
20
31
  }
21
32
  getStripeAddressInstance() {
@@ -41,13 +52,9 @@ export class ZonosAddress {
41
52
  stripeStore.stripeAddressEventData = event;
42
53
  break;
43
54
  }
44
- const hasInvalidCharacters = this.checkInvalidCharacters(event);
45
- this.invalidCharacters.emit(hasInvalidCharacters);
46
- this.hasInvalidCharacters = hasInvalidCharacters;
47
- if (hasInvalidCharacters) {
48
- // no need to prefetch landed cost if the address contains invalid characters
49
- return;
50
- }
55
+ const invalidCharacterList = this.checkInvalidCharacters(event);
56
+ this.invalidCharacterList = invalidCharacterList;
57
+ this.invalidCharacters.emit(!!invalidCharacterList);
51
58
  }
52
59
  updateAddressElement({ stripeAddressElement, type, }) {
53
60
  if (type === 'shipping') {
@@ -60,7 +67,7 @@ export class ZonosAddress {
60
67
  // Do nothing if the allowed character sets is ALL or the address is incomplete
61
68
  if (!address.complete ||
62
69
  zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
63
- return false;
70
+ return null;
64
71
  }
65
72
  const { address: addressValue, firstName, lastName, name } = address.value;
66
73
  const { city, country, line1, line2, postal_code, state } = addressValue;
@@ -73,11 +80,29 @@ export class ZonosAddress {
73
80
  postal_code,
74
81
  state,
75
82
  });
76
- // emit event if the address contains invalid characters
77
- if (Object.keys(invalidList).length) {
78
- return true;
83
+ if (!Object.keys(invalidList).length) {
84
+ return null;
85
+ }
86
+ // send error event only once so we know what value is invalid
87
+ if (!this.reportedInvalidCharacters) {
88
+ this.reportedInvalidCharacters = true;
89
+ void sendErrorLog({
90
+ endpoint: 'NonLatinInput',
91
+ errors: Object.keys(invalidList).map(fieldName => {
92
+ var _a;
93
+ if (fieldName !== 'name') {
94
+ // trim all number so we don't send sensitive information
95
+ const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
96
+ return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
97
+ }
98
+ const customerName = name || `${firstName} ${lastName}`;
99
+ const trimmedName = customerName.replace(/[\d\w]+/g, '');
100
+ return `Invalid character found ${fieldName}: "${trimmedName}"`;
101
+ }),
102
+ metadata: {},
103
+ });
79
104
  }
80
- return false;
105
+ return invalidList;
81
106
  }
82
107
  async watchInitStripe() {
83
108
  var _a, _b;
@@ -176,7 +201,7 @@ export class ZonosAddress {
176
201
  }
177
202
  render() {
178
203
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
179
- return (h(Host, { key: '81b9d2e822eea4eb85a3d7d21ff645c9f0841f30', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'cd180e130f161233fd05365f9250913214846ced', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'b4d15f56e1215305367c071c4d9be985b09245b8', class: "zonos--address-component" }), this.hasInvalidCharacters && (h("zonos-banner", { bannerTitle: translate('Please ensure your text uses the Latin alphabet only (A-Z, a-z).'), intent: "error" }))));
204
+ return (h(Host, { key: 'b1ad2f6c9c23e6411bf1adccdd34b3aa4f5250b1', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '786a733a44925a670393b72bf0ae3db5ba59f9a1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'b9d58cbc17abf5daf5d13ffdebc7485c3ac6457d', class: "zonos--address-component" }), this.invalidCharacterList && (h("zonos-banner", { bannerTitle: translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (h("zonos-text", null, `- ${translate(mappedFields[fieldName])}: ${translate('only supports Latin characters (A-Z, a-z)')}`)))))));
180
205
  }
181
206
  static get is() { return "zonos-address"; }
182
207
  static get encapsulation() { return "scoped"; }
@@ -253,7 +278,8 @@ export class ZonosAddress {
253
278
  static get states() {
254
279
  return {
255
280
  "stripe": {},
256
- "hasInvalidCharacters": {},
281
+ "reportedInvalidCharacters": {},
282
+ "invalidCharacterList": {},
257
283
  "isDirtyAddress": {}
258
284
  };
259
285
  }
@@ -0,0 +1,8 @@
1
+ import { handleFetch } from "../handleFetch";
2
+ export const sendLoadScriptLog = async (params) => {
3
+ const scriptLoadLogBody = Object.assign({ href: window.location.href }, params);
4
+ void handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/log-script-load`, {
5
+ body: scriptLoadLogBody,
6
+ method: 'POST',
7
+ });
8
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,16 @@ export const accountHolderType = {
2
2
  Company: 'COMPANY',
3
3
  Individual: 'INDIVIDUAL',
4
4
  };
5
+ export const accountingFeeType = {
6
+ BugFix: 'BUG_FIX',
7
+ DutyTaxFee: 'DUTY_TAX_FEE',
8
+ General: 'GENERAL',
9
+ Item: 'ITEM',
10
+ LandedCostGuarantee: 'LANDED_COST_GUARANTEE',
11
+ MerchantProcessing: 'MERCHANT_PROCESSING',
12
+ Shipping: 'SHIPPING',
13
+ Transaction: 'TRANSACTION',
14
+ };
5
15
  export const addressMatchThreshold = {
6
16
  ExactAdministrativeArea: 'EXACT_ADMINISTRATIVE_AREA',
7
17
  ExactCountry: 'EXACT_COUNTRY',
@@ -17,10 +27,23 @@ export const addressResult = {
17
27
  Unavailable: 'UNAVAILABLE',
18
28
  Valid: 'VALID',
19
29
  };
30
+ export const adjustmentRecordType = {
31
+ ConnectAccountAdjustment: 'CONNECT_ACCOUNT_ADJUSTMENT',
32
+ CreditNote: 'CREDIT_NOTE',
33
+ InvoiceLineRecord: 'INVOICE_LINE_RECORD',
34
+ };
35
+ export const adjustmentType = {
36
+ Charge: 'CHARGE',
37
+ Credit: 'CREDIT',
38
+ };
20
39
  export const alcoholRecipientType = {
21
40
  Consumer: 'CONSUMER',
22
41
  Licensee: 'LICENSEE',
23
42
  };
43
+ export const allowedCharacterSets = {
44
+ All: 'ALL',
45
+ Latin: 'LATIN',
46
+ };
24
47
  export const analyticsProviderStatus = {
25
48
  Disabled: 'DISABLED',
26
49
  Enabled: 'ENABLED',
@@ -743,16 +766,8 @@ export const credentialProvider = {
743
766
  };
744
767
  export const creditBehaviorTypeCode = {
745
768
  CreditAccount: 'CREDIT_ACCOUNT',
746
- CreditInvoice: 'CREDIT_INVOICE',
747
769
  RefundPayment: 'REFUND_PAYMENT',
748
770
  };
749
- export const creditNoteStatusCode = {
750
- Failed: 'FAILED',
751
- Issued: 'ISSUED',
752
- Pending: 'PENDING',
753
- Processed: 'PROCESSED',
754
- Voided: 'VOIDED',
755
- };
756
771
  export const creditReasonTypeCode = {
757
772
  Duplicate: 'DUPLICATE',
758
773
  Fraudulent: 'FRAUDULENT',
@@ -1194,6 +1209,10 @@ export const inclusivePriceSettingStatus = {
1194
1209
  Disabled: 'DISABLED',
1195
1210
  Enabled: 'ENABLED',
1196
1211
  };
1212
+ export const inclusivePriceStatus = {
1213
+ Active: 'ACTIVE',
1214
+ Inactive: 'INACTIVE',
1215
+ };
1197
1216
  export const incotermCode = {
1198
1217
  Cif: 'CIF',
1199
1218
  Custom: 'CUSTOM',
@@ -1252,12 +1271,6 @@ export const invoiceLanguageCode = {
1252
1271
  ZhHk: 'ZH_HK',
1253
1272
  ZhTw: 'ZH_TW',
1254
1273
  };
1255
- export const invoiceLineRecordStatusCode = {
1256
- Failed: 'FAILED',
1257
- Pending: 'PENDING',
1258
- Processed: 'PROCESSED',
1259
- Voided: 'VOIDED',
1260
- };
1261
1274
  export const invoiceStatus = {
1262
1275
  Received: 'RECEIVED',
1263
1276
  Reconciled: 'RECONCILED',
@@ -1656,6 +1669,14 @@ export const pddpAmountType = {
1656
1669
  ShoppingCartValue: 'SHOPPING_CART_VALUE',
1657
1670
  SurchargeValue: 'SURCHARGE_VALUE',
1658
1671
  };
1672
+ export const pddpCountrySpecStatus = {
1673
+ Active: 'ACTIVE',
1674
+ Disabled: 'DISABLED',
1675
+ };
1676
+ export const pddpStatus = {
1677
+ Active: 'ACTIVE',
1678
+ Disabled: 'DISABLED',
1679
+ };
1659
1680
  export const pickupBuildingType = {
1660
1681
  Apartment: 'APARTMENT',
1661
1682
  Building: 'BUILDING',
@@ -1675,6 +1696,12 @@ export const pickupCategory = {
1675
1696
  SameDay: 'SAME_DAY',
1676
1697
  SameDayCity: 'SAME_DAY_CITY',
1677
1698
  };
1699
+ export const processingStatusCode = {
1700
+ Failed: 'FAILED',
1701
+ Pending: 'PENDING',
1702
+ Processed: 'PROCESSED',
1703
+ Voided: 'VOIDED',
1704
+ };
1678
1705
  export const propertyType = {
1679
1706
  Commercial: 'COMMERCIAL',
1680
1707
  Residental: 'RESIDENTAL',
@@ -1834,6 +1861,10 @@ export const stripePriceBillingScheme = {
1834
1861
  PerUnit: 'PER_UNIT',
1835
1862
  Tiered: 'TIERED',
1836
1863
  };
1864
+ export const stripePriceType = {
1865
+ OneTime: 'ONE_TIME',
1866
+ Recurring: 'RECURRING',
1867
+ };
1837
1868
  export const stripeSubscriptionStatus = {
1838
1869
  Active: 'ACTIVE',
1839
1870
  Canceled: 'CANCELED',
@@ -442,6 +442,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
442
442
  CreateErrorEvent(variables, requestHeaders) {
443
443
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CreateErrorEvent', 'mutation');
444
444
  },
445
+ CreateScriptLoadEvent(variables, requestHeaders) {
446
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CreateScriptLoadEvent', 'mutation');
447
+ },
445
448
  DeleteAllStoreReserveOrders(variables, requestHeaders) {
446
449
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'DeleteAllStoreReserveOrders', 'mutation');
447
450
  },
@@ -0,0 +1,21 @@
1
+ import { h as handleFetch } from './stripe.js';
2
+
3
+ const sendErrorLog = async ({ endpoint, errors, metadata }) => {
4
+ const userAgentData = 'userAgentData' in window.navigator
5
+ ? // userAgentData is not yet supported in all browsers
6
+ window.navigator.userAgentData
7
+ : null;
8
+ const errorObject = {
9
+ endpoint,
10
+ errors,
11
+ metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
12
+ ? userAgentData
13
+ : window.navigator.userAgent }, metadata),
14
+ };
15
+ void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
16
+ body: errorObject,
17
+ method: 'POST',
18
+ });
19
+ };
20
+
21
+ export { sendErrorLog as s };