@zonos/elements 1.3.182 → 1.3.184

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 (139) hide show
  1. package/dist/cjs/{cart-dcd068d1.js → cart-3d0c0f0b.js} +60 -0
  2. package/dist/cjs/index.cjs.js +29 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{paypal-4bbc4779.js → paypal-9eaa9196.js} +1 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +50 -15
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +17 -5
  8. package/dist/cjs/zonos-controller.cjs.entry.js +9 -2
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-elements.cjs.js +1 -1
  12. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +2 -2
  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-language-select_2.cjs.entry.js +1 -1
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +15 -3
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +11 -14
  18. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
  19. package/dist/collection/components/store/translationStore/strings.base.js +3 -0
  20. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
  21. package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
  22. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
  23. package/dist/collection/components/store/translationStore/strings.french.js +3 -0
  24. package/dist/collection/components/store/translationStore/strings.german.js +3 -0
  25. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
  26. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
  27. package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
  28. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
  29. package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
  30. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
  31. package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
  32. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
  33. package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
  34. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
  35. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
  36. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
  37. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
  38. package/dist/collection/components/utils/checkout/initCheckout.js +8 -1
  39. package/dist/collection/components/utils/taxIdValidationResult.js +38 -0
  40. package/dist/collection/scripts/_zonosBase.js +22 -1
  41. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  42. package/dist/collection/types/generated/graphql.internal.types.js +33 -0
  43. package/dist/esm/{cart-d2c86d90.js → cart-3fb04f1f.js} +60 -0
  44. package/dist/esm/index.js +29 -8
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/{paypal-5c0d6407.js → paypal-1f2e863c.js} +1 -1
  47. package/dist/esm/zonos-address_7.entry.js +1 -1
  48. package/dist/esm/zonos-cart-items_13.entry.js +50 -15
  49. package/dist/esm/zonos-checkout.entry.js +17 -5
  50. package/dist/esm/zonos-controller.entry.js +9 -2
  51. package/dist/esm/zonos-country-flag.entry.js +1 -1
  52. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  53. package/dist/esm/zonos-elements.js +1 -1
  54. package/dist/esm/zonos-empty-state-payment_4.entry.js +2 -2
  55. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  56. package/dist/esm/zonos-hello.entry.js +1 -1
  57. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  58. package/dist/esm-es5/cart-3fb04f1f.js +1 -0
  59. package/dist/esm-es5/index.js +1 -1
  60. package/dist/esm-es5/loader.js +1 -1
  61. package/dist/esm-es5/{paypal-5c0d6407.js → paypal-1f2e863c.js} +1 -1
  62. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  63. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  64. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  65. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  66. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  67. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  68. package/dist/esm-es5/zonos-elements.js +1 -1
  69. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  70. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  71. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  72. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  73. package/dist/scripts/index.d.ts +7 -0
  74. package/dist/scripts/index.js +1 -1
  75. package/dist/scripts/loadZonos.js +1 -1
  76. package/dist/scripts/zonos.js +1 -1
  77. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +1 -2
  78. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
  79. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
  80. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
  81. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
  82. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
  83. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
  84. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
  85. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
  86. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
  87. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
  88. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
  89. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
  90. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
  91. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
  92. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
  93. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
  94. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
  95. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
  96. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
  97. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
  98. package/dist/types/components/utils/taxIdValidationResult.d.ts +12 -0
  99. package/dist/types/types/checkout/CheckoutConfig.d.ts +7 -0
  100. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
  101. package/dist/types/types/generated/graphql.frontend.types.ts +3 -0
  102. package/dist/types/types/generated/graphql.internal.types.d.ts +53 -8
  103. package/dist/types/types/generated/graphql.internal.types.ts +63 -8
  104. package/dist/zonos-elements/index.esm.js +1 -1
  105. package/dist/zonos-elements/p-09041efe.entry.js +1 -0
  106. package/dist/zonos-elements/{p-5c695748.entry.js → p-107b08c1.entry.js} +1 -1
  107. package/dist/zonos-elements/{p-a43fba41.js → p-112aecac.js} +1 -1
  108. package/dist/zonos-elements/p-16e4cdb1.entry.js +1 -0
  109. package/dist/zonos-elements/{p-5957eff5.system.entry.js → p-29e8c9e8.system.entry.js} +1 -1
  110. package/dist/zonos-elements/{p-09fbafe4.entry.js → p-43feb95e.entry.js} +1 -1
  111. package/dist/zonos-elements/{p-e42e0cdb.entry.js → p-4622cca6.entry.js} +1 -1
  112. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  113. package/dist/zonos-elements/{p-9d014d94.system.entry.js → p-4ca666ea.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-753811b7.system.entry.js → p-4eff2f8a.system.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-5a71d418.entry.js → p-587568b5.entry.js} +1 -1
  116. package/dist/zonos-elements/{p-99f50bf3.system.js → p-5bebcfc2.system.js} +1 -1
  117. package/dist/zonos-elements/p-642bf613.system.entry.js +1 -0
  118. package/dist/zonos-elements/{p-1cebd67c.entry.js → p-64dbc282.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-5be6b837.system.entry.js → p-7cb87ea7.system.entry.js} +1 -1
  120. package/dist/zonos-elements/{p-57af5f9c.entry.js → p-7decb19b.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-99f17671.entry.js → p-8f640b28.entry.js} +1 -1
  122. package/dist/zonos-elements/p-a69dbe14.js +1 -0
  123. package/dist/zonos-elements/{p-00e5d2be.system.js → p-b1020237.system.js} +1 -1
  124. package/dist/zonos-elements/{p-79e43df6.system.entry.js → p-bc0f885e.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-5e1a782a.system.entry.js → p-c5c8f803.system.entry.js} +1 -1
  126. package/dist/zonos-elements/p-c6d96a42.system.js +1 -0
  127. package/dist/zonos-elements/{p-33de55b8.system.entry.js → p-d367c9ae.system.entry.js} +1 -1
  128. package/dist/zonos-elements/p-d5d39db4.system.entry.js +1 -0
  129. package/dist/zonos-elements/{p-42abd4dd.system.entry.js → p-f66a5c7c.system.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-c3f2b86c.entry.js → p-fa65b53d.entry.js} +1 -1
  131. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  132. package/package.json +1 -1
  133. package/dist/esm-es5/cart-d2c86d90.js +0 -1
  134. package/dist/zonos-elements/p-18ec705b.js +0 -1
  135. package/dist/zonos-elements/p-1b1cdb4c.system.entry.js +0 -1
  136. package/dist/zonos-elements/p-91bc2187.system.js +0 -1
  137. package/dist/zonos-elements/p-a2368c1c.system.entry.js +0 -1
  138. package/dist/zonos-elements/p-d00049db.entry.js +0 -1
  139. package/dist/zonos-elements/p-ff8d9f3a.entry.js +0 -1
@@ -152,6 +152,9 @@ export declare const stringsChinese: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsDanish: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsDutch: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsFrench: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsGerman: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsHebrew: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsIndonesian: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsItalian: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsJapanese: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsKorean: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsNorwegian: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsPolish: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsPortuguese: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsRussian: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsSpanish: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsSwedish: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsTurkish: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -152,6 +152,9 @@ export declare const stringsVietnamese: {
152
152
  'Hide non-prepaid options': {
153
153
  value: string;
154
154
  };
155
+ 'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
156
+ value: string;
157
+ };
155
158
  'Invalid promo code': {
156
159
  value: string;
157
160
  };
@@ -0,0 +1,12 @@
1
+ type TaxIdValidationResult = {
2
+ error: 'Tax id is required' | 'Invalid RFC format. Must be 12–13 uppercase letters and numbers only.';
3
+ valid: false;
4
+ } | {
5
+ error: null;
6
+ valid: true;
7
+ };
8
+ export declare const taxIdValidationResult: ({ shippingCountry, taxId, }: {
9
+ shippingCountry: string;
10
+ taxId: string;
11
+ }) => TaxIdValidationResult;
12
+ export {};
@@ -40,6 +40,10 @@ export type CheckoutConfig = {
40
40
  * @default LOCAL
41
41
  */
42
42
  allowedSettlementCurrencies: AllowedSettlementCurrencies;
43
+ /**
44
+ * Always trigger International Checkout with this selector regardless of shipping zone
45
+ */
46
+ alwaysTriggerInternationalCheckoutSelector?: string | null;
43
47
  analyticsProviders: Array<{
44
48
  status: AnalyticsProviderStatus;
45
49
  type: AnalyticsProviderType;
@@ -90,6 +94,9 @@ export type CheckoutConfig = {
90
94
  };
91
95
  };
92
96
  organization: string;
97
+ /**
98
+ * Place order button selector that only trigger International Checkout when shopper is in merchant's shipping zones
99
+ */
93
100
  placeOrderButtonSelector: string | null;
94
101
  /**
95
102
  * @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
@@ -85,6 +85,7 @@ export declare const featureAspectKeyEnum: {
85
85
  readonly ClassifySingleRequest: "classify_single_request";
86
86
  readonly ComConsolidation: "com_consolidation";
87
87
  readonly DashboardCheckout_2Settings: "dashboard_checkout_2_settings";
88
+ readonly DashboardChurnedNotification: "dashboard_churned_notification";
88
89
  readonly DashboardHello_2Settings: "dashboard_hello_2_settings";
89
90
  readonly DashboardNewLabelUi: "dashboard_new_label_ui";
90
91
  readonly DashboardOrderApprove: "dashboard_order_approve";
@@ -112,6 +113,7 @@ export declare const featureAudienceNameEnum: {
112
113
  readonly ClassifyBulkMerchant: "classify_bulk_merchant";
113
114
  readonly ClassifyBulkMerchantExportConfidenceScore: "classify_bulk_merchant_export_confidence_score";
114
115
  readonly CustomerSuccess: "customer_success";
116
+ readonly DashboardChurnedNotificationMerchant: "dashboard_churned_notification_merchant";
115
117
  readonly DashboardLabelBetaMerchant: "dashboard_label_beta_merchant";
116
118
  readonly Designer: "designer";
117
119
  readonly DocsContributor: "docs_contributor";
@@ -64,6 +64,7 @@ export const featureAspectKeyEnum = {
64
64
  ClassifySingleRequest: 'classify_single_request',
65
65
  ComConsolidation: 'com_consolidation',
66
66
  DashboardCheckout_2Settings: 'dashboard_checkout_2_settings',
67
+ DashboardChurnedNotification: 'dashboard_churned_notification',
67
68
  DashboardHello_2Settings: 'dashboard_hello_2_settings',
68
69
  DashboardNewLabelUi: 'dashboard_new_label_ui',
69
70
  DashboardOrderApprove: 'dashboard_order_approve',
@@ -95,6 +96,8 @@ export const featureAudienceNameEnum = {
95
96
  ClassifyBulkMerchantExportConfidenceScore:
96
97
  'classify_bulk_merchant_export_confidence_score',
97
98
  CustomerSuccess: 'customer_success',
99
+ DashboardChurnedNotificationMerchant:
100
+ 'dashboard_churned_notification_merchant',
98
101
  DashboardLabelBetaMerchant: 'dashboard_label_beta_merchant',
99
102
  Designer: 'designer',
100
103
  DocsContributor: 'docs_contributor',
@@ -1861,6 +1861,22 @@ export declare const itemRestrictionType: {
1861
1861
  readonly Restriction: "RESTRICTION";
1862
1862
  };
1863
1863
  export type ItemRestrictionType = (typeof itemRestrictionType)[keyof typeof itemRestrictionType];
1864
+ export declare const itemReverseAmountStatus: {
1865
+ readonly Applied: "APPLIED";
1866
+ readonly NotAppliedNegativeValue: "NOT_APPLIED_NEGATIVE_VALUE";
1867
+ readonly NotAppliedUnderDeMinimis: "NOT_APPLIED_UNDER_DE_MINIMIS";
1868
+ };
1869
+ export type ItemReverseAmountStatus = (typeof itemReverseAmountStatus)[keyof typeof itemReverseAmountStatus];
1870
+ export declare const itemReverseAmountType: {
1871
+ readonly Duty: "DUTY";
1872
+ readonly DutyFee: "DUTY_FEE";
1873
+ readonly DutyTax: "DUTY_TAX";
1874
+ readonly DutyTaxFee: "DUTY_TAX_FEE";
1875
+ readonly None: "NONE";
1876
+ readonly Tax: "TAX";
1877
+ readonly TaxFee: "TAX_FEE";
1878
+ };
1879
+ export type ItemReverseAmountType = (typeof itemReverseAmountType)[keyof typeof itemReverseAmountType];
1864
1880
  export declare const itemType: {
1865
1881
  readonly Bundle: "BUNDLE";
1866
1882
  readonly DigitalGood: "DIGITAL_GOOD";
@@ -2343,6 +2359,7 @@ export declare const orderPaymentStatus: {
2343
2359
  readonly PartiallyRefunded: "PARTIALLY_REFUNDED";
2344
2360
  readonly Refunded: "REFUNDED";
2345
2361
  readonly Unpaid: "UNPAID";
2362
+ readonly Voided: "VOIDED";
2346
2363
  };
2347
2364
  export type OrderPaymentStatus = (typeof orderPaymentStatus)[keyof typeof orderPaymentStatus];
2348
2365
  export declare const orderRefundSubtotalType: {
@@ -2608,6 +2625,22 @@ export declare const result: {
2608
2625
  readonly Success: "SUCCESS";
2609
2626
  };
2610
2627
  export type Result = (typeof result)[keyof typeof result];
2628
+ export declare const reverseAmountStatus: {
2629
+ readonly Applied: "APPLIED";
2630
+ readonly NotAppliedNegativeValue: "NOT_APPLIED_NEGATIVE_VALUE";
2631
+ readonly NotAppliedUnderDeMinimis: "NOT_APPLIED_UNDER_DE_MINIMIS";
2632
+ };
2633
+ export type ReverseAmountStatus = (typeof reverseAmountStatus)[keyof typeof reverseAmountStatus];
2634
+ export declare const reverseAmountType: {
2635
+ readonly Duty: "DUTY";
2636
+ readonly DutyFee: "DUTY_FEE";
2637
+ readonly DutyTax: "DUTY_TAX";
2638
+ readonly DutyTaxFee: "DUTY_TAX_FEE";
2639
+ readonly None: "NONE";
2640
+ readonly Tax: "TAX";
2641
+ readonly TaxFee: "TAX_FEE";
2642
+ };
2643
+ export type ReverseAmountType = (typeof reverseAmountType)[keyof typeof reverseAmountType];
2611
2644
  export declare const roundingMethod: {
2612
2645
  readonly Custom: "CUSTOM";
2613
2646
  readonly Hundredth: "HUNDREDTH";
@@ -2619,9 +2652,13 @@ export declare const roundingMethod: {
2619
2652
  export type RoundingMethod = (typeof roundingMethod)[keyof typeof roundingMethod];
2620
2653
  export declare const searchIndex: {
2621
2654
  readonly Catalog: "CATALOG";
2655
+ readonly CatalogRecent: "CATALOG_RECENT";
2622
2656
  readonly Orders: "ORDERS";
2657
+ readonly OrdersRecent: "ORDERS_RECENT";
2623
2658
  readonly Quotes: "QUOTES";
2659
+ readonly QuotesRecent: "QUOTES_RECENT";
2624
2660
  readonly Shipments: "SHIPMENTS";
2661
+ readonly ShipmentsRecent: "SHIPMENTS_RECENT";
2625
2662
  };
2626
2663
  export type SearchIndex = (typeof searchIndex)[keyof typeof searchIndex];
2627
2664
  export declare const serviceLevelAvailability: {
@@ -3590,26 +3627,34 @@ export type ShipmentRatingFragment = {
3590
3627
  };
3591
3628
  export type FulfillmentCenterQuery = {
3592
3629
  fulfillmentCenters: Array<{
3593
- name: string;
3594
3630
  party: {
3595
3631
  location: {
3596
3632
  administrativeArea: string | null;
3597
3633
  administrativeAreaCode: string | null;
3598
3634
  countryCode: CountryCode;
3599
- latitude: number | null;
3600
3635
  line1: string | null;
3601
- line2: string | null;
3602
- line3: string | null;
3603
- line4: string | null;
3604
3636
  locality: string | null;
3605
- longitude: number | null;
3606
- plusCode: string | null;
3607
3637
  postalCode: string | null;
3608
- propertyType: PropertyType | null;
3609
3638
  } | null;
3610
3639
  };
3611
3640
  type: FulfillmentCenterType;
3612
3641
  }> | null;
3642
+ shippingZones: Array<{
3643
+ countryCodes: Array<CountryCode> | null;
3644
+ fulfillmentCenter: {
3645
+ party: {
3646
+ location: {
3647
+ administrativeArea: string | null;
3648
+ administrativeAreaCode: string | null;
3649
+ countryCode: CountryCode;
3650
+ line1: string | null;
3651
+ locality: string | null;
3652
+ postalCode: string | null;
3653
+ } | null;
3654
+ };
3655
+ type: FulfillmentCenterType;
3656
+ } | null;
3657
+ } | null> | null;
3613
3658
  };
3614
3659
  export type PartyInfoQuery = {
3615
3660
  party: {
@@ -2230,6 +2230,27 @@ export const itemRestrictionType = {
2230
2230
  export type ItemRestrictionType =
2231
2231
  (typeof itemRestrictionType)[keyof typeof itemRestrictionType];
2232
2232
 
2233
+ export const itemReverseAmountStatus = {
2234
+ Applied: 'APPLIED',
2235
+ NotAppliedNegativeValue: 'NOT_APPLIED_NEGATIVE_VALUE',
2236
+ NotAppliedUnderDeMinimis: 'NOT_APPLIED_UNDER_DE_MINIMIS',
2237
+ } as const;
2238
+
2239
+ export type ItemReverseAmountStatus =
2240
+ (typeof itemReverseAmountStatus)[keyof typeof itemReverseAmountStatus];
2241
+ export const itemReverseAmountType = {
2242
+ Duty: 'DUTY',
2243
+ DutyFee: 'DUTY_FEE',
2244
+ DutyTax: 'DUTY_TAX',
2245
+ DutyTaxFee: 'DUTY_TAX_FEE',
2246
+ None: 'NONE',
2247
+ Tax: 'TAX',
2248
+ TaxFee: 'TAX_FEE',
2249
+ } as const;
2250
+
2251
+ export type ItemReverseAmountType =
2252
+ (typeof itemReverseAmountType)[keyof typeof itemReverseAmountType];
2253
+
2233
2254
  export const itemType = {
2234
2255
  Bundle: 'BUNDLE',
2235
2256
  DigitalGood: 'DIGITAL_GOOD',
@@ -2826,6 +2847,7 @@ export const orderPaymentStatus = {
2826
2847
  PartiallyRefunded: 'PARTIALLY_REFUNDED',
2827
2848
  Refunded: 'REFUNDED',
2828
2849
  Unpaid: 'UNPAID',
2850
+ Voided: 'VOIDED',
2829
2851
  } as const;
2830
2852
 
2831
2853
  export type OrderPaymentStatus =
@@ -3183,6 +3205,27 @@ export const result = {
3183
3205
 
3184
3206
  export type Result = (typeof result)[keyof typeof result];
3185
3207
 
3208
+ export const reverseAmountStatus = {
3209
+ Applied: 'APPLIED',
3210
+ NotAppliedNegativeValue: 'NOT_APPLIED_NEGATIVE_VALUE',
3211
+ NotAppliedUnderDeMinimis: 'NOT_APPLIED_UNDER_DE_MINIMIS',
3212
+ } as const;
3213
+
3214
+ export type ReverseAmountStatus =
3215
+ (typeof reverseAmountStatus)[keyof typeof reverseAmountStatus];
3216
+ export const reverseAmountType = {
3217
+ Duty: 'DUTY',
3218
+ DutyFee: 'DUTY_FEE',
3219
+ DutyTax: 'DUTY_TAX',
3220
+ DutyTaxFee: 'DUTY_TAX_FEE',
3221
+ None: 'NONE',
3222
+ Tax: 'TAX',
3223
+ TaxFee: 'TAX_FEE',
3224
+ } as const;
3225
+
3226
+ export type ReverseAmountType =
3227
+ (typeof reverseAmountType)[keyof typeof reverseAmountType];
3228
+
3186
3229
  export const roundingMethod = {
3187
3230
  Custom: 'CUSTOM',
3188
3231
  Hundredth: 'HUNDREDTH',
@@ -3197,9 +3240,13 @@ export type RoundingMethod =
3197
3240
 
3198
3241
  export const searchIndex = {
3199
3242
  Catalog: 'CATALOG',
3243
+ CatalogRecent: 'CATALOG_RECENT',
3200
3244
  Orders: 'ORDERS',
3245
+ OrdersRecent: 'ORDERS_RECENT',
3201
3246
  Quotes: 'QUOTES',
3247
+ QuotesRecent: 'QUOTES_RECENT',
3202
3248
  Shipments: 'SHIPMENTS',
3249
+ ShipmentsRecent: 'SHIPMENTS_RECENT',
3203
3250
  } as const;
3204
3251
 
3205
3252
  export type SearchIndex = (typeof searchIndex)[keyof typeof searchIndex];
@@ -4217,26 +4264,34 @@ export type ShipmentRatingFragment = {
4217
4264
 
4218
4265
  export type FulfillmentCenterQuery = {
4219
4266
  fulfillmentCenters: Array<{
4220
- name: string;
4221
4267
  party: {
4222
4268
  location: {
4223
4269
  administrativeArea: string | null;
4224
4270
  administrativeAreaCode: string | null;
4225
4271
  countryCode: CountryCode;
4226
- latitude: number | null;
4227
4272
  line1: string | null;
4228
- line2: string | null;
4229
- line3: string | null;
4230
- line4: string | null;
4231
4273
  locality: string | null;
4232
- longitude: number | null;
4233
- plusCode: string | null;
4234
4274
  postalCode: string | null;
4235
- propertyType: PropertyType | null;
4236
4275
  } | null;
4237
4276
  };
4238
4277
  type: FulfillmentCenterType;
4239
4278
  }> | null;
4279
+ shippingZones: Array<{
4280
+ countryCodes: Array<CountryCode> | null;
4281
+ fulfillmentCenter: {
4282
+ party: {
4283
+ location: {
4284
+ administrativeArea: string | null;
4285
+ administrativeAreaCode: string | null;
4286
+ countryCode: CountryCode;
4287
+ line1: string | null;
4288
+ locality: string | null;
4289
+ postalCode: string | null;
4290
+ } | null;
4291
+ };
4292
+ type: FulfillmentCenterType;
4293
+ } | null;
4294
+ } | null> | null;
4240
4295
  };
4241
4296
 
4242
4297
  export type PartyInfoQuery = {
@@ -1 +1 @@
1
- import{g as e,a as n,l as t,h as o,b as r}from"./p-0fc02cde.js";import{_ as i,c as l}from"./p-fe253cc1.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-fe253cc1.js";export{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./p-5bd927f2.js";const a=["jsdelivr","cdnjs","unpkg","vercel"],u="jsdelivr",m=e=>{const n=a.indexOf(e);return a[n+1]||null},p=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.182.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const s=`https://${n}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s},w="https://js.stripe.com/v3",f=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,h="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let y=null;const v=Promise.resolve().then((()=>{return e=null,null!==y||(y=new Promise(((n,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(h),window.Stripe)n(window.Stripe);else try{let o=(()=>{const e=document.querySelectorAll(`script[src^="${w}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&f.test(t.src))return t}return null})();o&&e?console.warn(h):o||(o=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${w}${n}`;const o=document.head||document.body;return o?(o.appendChild(t),t):(r("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==o||o.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):t(new Error("Stripe.js not available"))})),null==o||o.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else n(null)}))),y;var e}));let g=!1;v.catch((e=>{g||console.warn(e)}));const z=async({cartId:n,retries:s})=>{const r=e(),{errors:i,json:c,zonosMode:d}=await o("/api/zonos-elements/get-cart",{body:{isTestMode:r,tempCartUUID:n},headers:{"Content-Type":"application/json"},method:"POST"}),l=!c||i.length;return l&&s?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s}),await new Promise((e=>setTimeout(e,500))),z({cartId:n,retries:s-1})):l?null:Object.assign(Object.assign({},c),{zonosMode:d})};var S;const j=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),O="https://v1.3.182.js.zonos.com",b=j||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.182",k="https://fonts.googleapis.com",Z=/^https:\/\/fonts\.googleapis\.com/;class I{}S=I,I.doneInit=!1,I.cartSettings=null,I.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),I.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),I._paypalMockResponse=null,I.isBigCommerce=!1,I.releaseDate="1744123643641",I.isLegacyCheckout=!1,I.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",I.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),I.isNpm=!0,I.zonosQaUrl=null,I.zonosQaUrlApi=null,I.trackEventLogs=[],I.version="v1.3.182",I.modeAlerted=!1,I.cartData=null,I.paypal=null,I.zonosMode=null,I.getCurrentTimestamp=()=>(new Date).getTime(),I.zonosController=null,I.loadTimeApiInfoList=[],I.logIntervalId=null,I.init=async s=>{const{appearance:c,checkoutSettings:d,currencyConverter:a,helloSettings:u,onCountryChange:m,overrideCurrencyFormat:w,storeId:f,zonosApiKey:h}=s;if(S.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),S.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${S.version}) ======`),S.zonosApiKey=h,S.storeId=f,S.isNpm){t("====== ZONOS LOADING FROM NPM ======");const c=p();if(c&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${c} ======`,"info");const e=document.createElement("script");return e.src=`${c}/dist/scripts/zonos.js`,document.head.appendChild(e),e.addEventListener("load",(()=>{window.Zonos.isNpm=S.isNpm,window.Zonos.isBigCommerce=S.isBigCommerce,window.Zonos.isLegacyCheckout=S.isLegacyCheckout,window.Zonos.init(s)})),e.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${c}`)})),void(window.isZonosPreview=!0)}if(!h&&!S.cartId)return void r("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!S.cartData&&S.cartId){t("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=i(e);if(!o&&!n)return r("[ZONOS - loadZonos] invalid cart id"),null;const s=await z({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,window.Zonos.zonosMode=s.zonosMode,{cartData:s.cartData,settings:s.settings,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(S.cartId);if(!e)return void r("Failed to get cart data");S.cartData=e.cartData,S.zonosApiKey=e.zonosApiKey,S.cartSettings=e.settings}const d=await(async()=>{const s=e(),i=n();if(!s&&!i||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:c,json:d}=await o("/api/get-test-public-credential");if(c.length||!d)return r("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",c),null;const l=d.publicCredential;return l?(t(`[ZONOS - loadZonos] Retrieve new test public token ${l}`,"info"),l):(r("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();d&&(S.zonosApiKey=d)}const y=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(S.cartId&&S.cartData||y){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${l}`,document.body.appendChild(e)}t("init zonos"),S.restoreNativeBrowserFunctions(),S.injectCustomScriptForHostedCheckout(),S.injectZonosCdn(),S.injectZonosCss(),S.injectFonts(),S.injectController({config:{appearance:c,checkoutSettings:d,currencyConverter:a,helloSettings:u,onCountryChange:m,overrideCurrencyFormat:w}}),S.doneInit=!0},I.injectCustomScriptForHostedCheckout=()=>{const e=S.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),s=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||s)){if(o){t("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(s){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=s.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:s,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},I.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},I.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},I.showNotification=e=>{var n;null===(n=S.zonosController)||void 0===n||n.showNotification(e)},I.updateOrganizationName=e=>{var n;null===(n=S.zonosController)||void 0===n||n.updateOrganizationName(e)},I.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},I.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let t=document.querySelector(`iframe#${n}`);t||(t=document.createElement("iframe"),t.id=n,t.style.display="none",t.style.opacity="0",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.width="1px",t.style.height="1px",t.style.border="none",t.style.overflow="hidden",t.style.visibility="hidden",document.body.appendChild(t));const o=(null===(e=t.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=o,document.body.removeChild(t)},I.injectController=({config:e})=>{var n;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const o=document.createElement("zonos-controller");o.config=e,o.zonosApiKey=S.zonosApiKey||"",o.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;t("loading Stripe");const s=await(async(...e)=>{g=!0;const n=Date.now();return v.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(n.publishableKey);s?(window.Zonos.stripe=s,o.initCheckoutElement(s)):r("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(o),S.zonosController=o,t("Zonos controller injected!")},I.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const s=`${S.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const i=document.head||document.body,c=document.createElement("script");n?c.type="module":c.noModule=!0,c.src=s,c.crossOrigin="anonymous",c.onerror=()=>{r(`Failed to load ${c.src}`);const t=m(e);t&&S.injectScript({cdnType:t,isModule:n,theRestUrl:o})},i.appendChild(c)},I.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return b;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.182";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.182";case"vercel":return O}};return S.isNpm&&p()||n()},I.injectZonosCdn=()=>{S.injectScript({cdnType:u,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),S.injectScript({cdnType:u,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},I.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const t=S.getZonosUrl(e),o=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${O}/`,o.appendChild(s);const i=document.createElement("link");i.rel="stylesheet",i.href=`${t}/${n}`,i.onerror=()=>{r(`Failed to load ${i.href}`);const t=m(e);t&&S.injectStylesheet({cdnType:t,theRestUrl:n})},o.appendChild(i)},I.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(S.injectStylesheet({cdnType:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},I.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void t("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${k}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!Z.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=k,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${k}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),t("Zonos font injected!")},I.setupGoogleFont=e=>{var n;null===(n=S.zonosController)||void 0===n||n.setupGoogleFont(e)},I.injectSupportGoogleFont=e=>{var n;t(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${k}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=k,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=e,s.appendChild(r),t(`[FONT] ${o} font injected!`)};export{I as Zonos}
1
+ import{g as e,a as n,l as t,h as o,b as r}from"./p-0fc02cde.js";import{_ as i,c as l}from"./p-fe253cc1.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-fe253cc1.js";export{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./p-5bd927f2.js";const a=["jsdelivr","cdnjs","unpkg","vercel"],u="jsdelivr",m=e=>{const n=a.indexOf(e);return a[n+1]||null},p=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.184.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const s=`https://${n}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s},w="https://js.stripe.com/v3",f=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,h="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let y=null;const v=Promise.resolve().then((()=>{return e=null,null!==y||(y=new Promise(((n,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(h),window.Stripe)n(window.Stripe);else try{let o=(()=>{const e=document.querySelectorAll(`script[src^="${w}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&f.test(t.src))return t}return null})();o&&e?console.warn(h):o||(o=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${w}${n}`;const o=document.head||document.body;return o?(o.appendChild(t),t):(r("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==o||o.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):t(new Error("Stripe.js not available"))})),null==o||o.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else n(null)}))),y;var e}));let g=!1;v.catch((e=>{g||console.warn(e)}));const z=async({cartId:n,retries:s})=>{const r=e(),{errors:i,json:c,zonosMode:d}=await o("/api/zonos-elements/get-cart",{body:{isTestMode:r,tempCartUUID:n},headers:{"Content-Type":"application/json"},method:"POST"}),l=!c||i.length;return l&&s?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s}),await new Promise((e=>setTimeout(e,500))),z({cartId:n,retries:s-1})):l?null:Object.assign(Object.assign({},c),{zonosMode:d})};var S;const O=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),j="https://v1.3.184.js.zonos.com",b=O||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.184",k="https://fonts.googleapis.com",Z=/^https:\/\/fonts\.googleapis\.com/;class I{}S=I,I.doneInit=!1,I.cartSettings=null,I.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),I.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),I._paypalMockResponse=null,I.isBigCommerce=!1,I.releaseDate="1745332596232",I.isLegacyCheckout=!1,I.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",I.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),I.isNpm=!0,I.zonosQaUrl=null,I.zonosQaUrlApi=null,I.trackEventLogs=[],I.version="v1.3.184",I.modeAlerted=!1,I.cartData=null,I.paypal=null,I.zonosMode=null,I.getCurrentTimestamp=()=>(new Date).getTime(),I.zonosController=null,I.loadTimeApiInfoList=[],I.logIntervalId=null,I.init=async s=>{const{appearance:c,checkoutSettings:d,currencyConverter:a,helloSettings:u,onCountryChange:m,overrideCurrencyFormat:w,storeId:f,zonosApiKey:h}=s;if(S.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),S.doneInit)return;if(t(`====== ZONOS DEBUG MODE: on (${S.version}) ======`),S.zonosApiKey=h,S.storeId=f,S.isNpm){t("====== ZONOS LOADING FROM NPM ======");const c=p();if(c&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${c} ======`,"info");const e=document.createElement("script");return e.src=`${c}/dist/scripts/zonos.js`,document.head.appendChild(e),e.addEventListener("load",(()=>{window.Zonos.isNpm=S.isNpm,window.Zonos.isBigCommerce=S.isBigCommerce,window.Zonos.isLegacyCheckout=S.isLegacyCheckout,window.Zonos.init(s)})),e.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${c}`)})),void(window.isZonosPreview=!0)}if(!h&&!S.cartId)return void r("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!S.cartData&&S.cartId){t("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=i(e);if(!o&&!n)return r("[ZONOS - loadZonos] invalid cart id"),null;const s=await z({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,window.Zonos.zonosMode=s.zonosMode,{cartData:s.cartData,settings:s.settings,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(S.cartId);if(!e)return void r("Failed to get cart data");S.cartData=e.cartData,S.zonosApiKey=e.zonosApiKey,S.cartSettings=e.settings}const d=await(async()=>{const s=e(),i=n();if(!s&&!i||!window.Zonos.zonosApiKey)return null;if(t("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return t("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:c,json:d}=await o("/api/get-test-public-credential");if(c.length||!d)return r("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",c),null;const l=d.publicCredential;return l?(t(`[ZONOS - loadZonos] Retrieve new test public token ${l}`,"info"),l):(r("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();d&&(S.zonosApiKey=d)}const y=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(S.cartId&&S.cartData||y){t("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${l}`,document.body.appendChild(e)}t("init zonos"),S.restoreNativeBrowserFunctions(),S.injectCustomScriptForHostedCheckout(),S.injectZonosCdn(),S.injectZonosCss(),S.injectFonts(),S.injectController({config:{appearance:c,checkoutSettings:d,currencyConverter:a,helloSettings:u,onCountryChange:m,overrideCurrencyFormat:w}}),S.doneInit=!0},I.injectCustomScriptForHostedCheckout=()=>{const e=S.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),s=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||s)){if(o){t("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(s){t("Injecting custom footer script");const e=document.createElement("script");e.textContent=s.value,document.body.appendChild(e)}}else t("Skip injecting custom script for hosted checkout","info",{footerScript:s,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},I.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},I.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},I.showNotification=e=>{var n;null===(n=S.zonosController)||void 0===n||n.showNotification(e)},I.updateOrganizationName=e=>{var n;null===(n=S.zonosController)||void 0===n||n.updateOrganizationName(e)},I.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},I.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let t=document.querySelector(`iframe#${n}`);t||(t=document.createElement("iframe"),t.id=n,t.style.display="none",t.style.opacity="0",t.style.position="absolute",t.style.top="-9999px",t.style.left="-9999px",t.style.width="1px",t.style.height="1px",t.style.border="none",t.style.overflow="hidden",t.style.visibility="hidden",document.body.appendChild(t));const o=(null===(e=t.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=o,document.body.removeChild(t)},I.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{S.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=e,s.zonosApiKey=S.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;t("loading Stripe");const o=await(async(...e)=>{g=!0;const n=Date.now();return v.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,s.initCheckoutElement(o)):r("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),S.zonosController=s,t("Zonos controller injected!")},I.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const s=`${S.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const i=document.head||document.body,c=document.createElement("script");n?c.type="module":c.noModule=!0,c.src=s,c.crossOrigin="anonymous",c.onerror=()=>{r(`Failed to load ${c.src}`);const t=m(e);t&&S.injectScript({cdnType:t,isModule:n,theRestUrl:o})},i.appendChild(c)},I.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return b;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.184";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.184";case"vercel":return j}};return S.isNpm&&p()||n()},I.injectZonosCdn=()=>{S.injectScript({cdnType:u,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),S.injectScript({cdnType:u,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},I.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const t=S.getZonosUrl(e),o=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${j}/`,o.appendChild(s);const i=document.createElement("link");i.rel="stylesheet",i.href=`${t}/${n}`,i.onerror=()=>{r(`Failed to load ${i.href}`);const t=m(e);t&&S.injectStylesheet({cdnType:t,theRestUrl:n})},o.appendChild(i)},I.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(S.injectStylesheet({cdnType:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},I.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void t("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${k}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!Z.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=k,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${k}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),t("Zonos font injected!")},I.setupGoogleFont=e=>{var n;null===(n=S.zonosController)||void 0===n||n.setupGoogleFont(e)},I.injectSupportGoogleFont=e=>{var n;t(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${k}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=k,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=e,s.appendChild(r),t(`[FONT] ${o} font injected!`)};export{I as Zonos}
@@ -0,0 +1 @@
1
+ import{r as o,c as t,h as n,H as e}from"./p-ab68ad11.js";import{G as i,f as s,H as r,e as c,a}from"./p-a69dbe14.js";import{z as l,b as d,d as h}from"./p-30fdcbee.js";import{h as u,b as f,l as m}from"./p-0fc02cde.js";import"./p-98aa88b1.js";import"./p-a1cfbd0a.js";const w=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},p=o=>{switch(o){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},v=({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t},b=async o=>{if(window.Zonos.isLegacyCheckout)return void m("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:t}=o;let n=t;if(!o.anchorElementSelector&&o.desktopLocation){const o=v({position:"bottom-right"});n=o}if(n&&i(n)){if(m("Hello init complete"),!w(n)){const t=new MutationObserver((()=>{w(n)&&t.disconnect()}));t.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{w(n)}),1e3),setTimeout((()=>{if(o.notFoundElementFallback){m(`Hello anchor selector ${o.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${o.notFoundElementFallback}`,"info");const t=v({position:p(o.notFoundElementFallback)});w(t)}}),3e3)}}else f(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)},g=class{constructor(n){o(this,n),this.paypalInitEvent=t(this,"paypalInitEvent",7),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,((t=l.checkoutSettings).placeOrderButtonSelector||t.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!t.placeOrderButtonSelector||i(t.placeOrderButtonSelector)?!t.alwaysTriggerInternationalCheckoutSelector||i(t.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():f(`Selector alwaysTriggerInternationalCheckoutSelector "${t.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):f(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),m("init checkout element")):m("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||h();if("Inter"===e){if(!o)return;m("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o})}const i=new URLSearchParams;i.set("family",e);const{errors:s,json:r}=await u(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0)return m(`Failed to load font ${e}`,"warn"),void(l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"}));const c=null==r?void 0:r.fontUrl;c&&(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,c)),o&&(m(`[FONT] ${o} font override applied`),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o}))}handleLocationChange(){b(l.helloSettings)}initHistoryListener(){const o=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),o.apply(this,arguments)};const t=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)}}injectCustomHTML(o){if(!o)return;if(!window.Zonos.isLegacyCheckout)return void m("=== Skip injecting custom HTML for hosted checkout","info");m("=== Injecting custom HTML for hosted checkout");const t=document.createElement("template");t.innerHTML=o,t.content.querySelectorAll("script").forEach((o=>{const t=document.createElement("script");o.src?(t.src=o.src,t.async=o.async):t.textContent=o.innerHTML,document.body.appendChild(t)}))}async componentWillLoad(){this.initHistoryListener(),l.zonosApiKey=this.zonosApiKey,(async()=>{var o,t,n,e,i,s;const{errors:c,json:a,zonosMode:h}=await(async()=>{if(window.Zonos.cartSettings)return{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const{errors:o,json:t,zonosMode:n}=await u("/api/zonos-elements/zonos-settings");return o.length?(f("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:t,zonosMode:n}})();if("403"===(null===(t=null===(o=c[0])||void 0===o?void 0:o.type)||void 0===t?void 0:t.toString()))return void m("Failed to load zonos settings. This domain may not have access","warn");const w=(null===(n=null==a?void 0:a.checkoutSettings)||void 0===n?void 0:n.customHTML)||"";this.injectCustomHTML(w),this.initZonosNotification();const p=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(e=this.config.checkoutSettings)||void 0===e?void 0:e.successBehavior),v=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var o,t,n;return window.Zonos.isLegacyCheckout?(null===(o=null==a?void 0:a.appearanceSettings)||void 0===o?void 0:o.logoUrl)||(null===(t=this.config.appearance)||void 0===t?void 0:t.logoUrl):null===(n=this.config.appearance)||void 0===n?void 0:n.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0,successBehavior:p?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:p?(null===(i=window.Zonos.cartData)||void 0===i?void 0:i.storeBaseUrl)||(null==a?void 0:a.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl}):void 0});d({overrideSettings:v,zonosSettings:a}),l.zonosMode=h,this.setupGoogleFont(),"DISABLED"===l.helloSettings.visibilityStatus&&m("=== Hello is disabled by store owner ===","warn"),l.helloSettings&&"ENABLED"===l.helloSettings.visibilityStatus&&(m("Initializing hello"),b(l.helloSettings)),await r();const g=(null===(s=null==a?void 0:a.checkoutSettings)||void 0===s?void 0:s.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(g&&this.stripeInitEvent)return"INACTIVE"===l.checkoutSettings.subscriptionStatus?(m('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void m("zonos controller loaded")):"DISABLED"===l.checkoutSettings.visibilityStatus?(m("=== Checkout is disabled by store owner ===","warn"),void m("zonos controller loaded")):void this.stripeInitEvent.emit({publishableKey:g.token});m("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):m("Failed to show notification - zonos-notification not found","warn")}async reset(){c.checkoutSessionId=null,s.clientSecret=""}async overrideConfig(o){d({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){m(`Override country code to ${o}`),a(o)}async getAppearanceSetting(){return l.appearance}async updateOrganizationName(o){l.organizationName=o}render(){return n(e,{key:"eed6d0d8b034a43bb4bccf5937b8eccc5d5744c9",class:"zonos--elements"})}};g.style=":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{visibility:hidden;opacity:0;height:0}";export{g as zonos_controller}
@@ -1 +1 @@
1
- import{r as o,h as s,H as t,d as i}from"./p-ab68ad11.js";import{l as a}from"./p-18ec705b.js";import{d as e}from"./p-30fdcbee.js";import{c as n}from"./p-b4b7f705.js";import"./p-0fc02cde.js";import"./p-98aa88b1.js";import"./p-a1cfbd0a.js";const h=class{constructor(s){o(this,s),this.countryCode=a.selectedCountryCode,this.size=void 0}render(){if(!this.el.shadowRoot||!this.countryCode)return null;const o=`https://zonos-store-assets.s3.amazonaws.com/images/elements-flags/${this.countryCode}.svg`,i=e();return s(t,{class:"zonos--elements",style:this.size?{"--zonos--font-family":i,height:`${this.size}px`,width:`${this.size}px`}:{"--zonos--font-family":i}},s("div",{class:n(["flag-container"])},s("div",{class:"flag-icon",style:{backgroundImage:`url(${o})`}})))}get el(){return i(this)}};h.style=":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-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";export{h as zonos_country_flag}
1
+ import{r as o,h as s,H as t,d as i}from"./p-ab68ad11.js";import{l as a}from"./p-a69dbe14.js";import{d as e}from"./p-30fdcbee.js";import{c as n}from"./p-b4b7f705.js";import"./p-0fc02cde.js";import"./p-98aa88b1.js";import"./p-a1cfbd0a.js";const h=class{constructor(s){o(this,s),this.countryCode=a.selectedCountryCode,this.size=void 0}render(){if(!this.el.shadowRoot||!this.countryCode)return null;const o=`https://zonos-store-assets.s3.amazonaws.com/images/elements-flags/${this.countryCode}.svg`,i=e();return s(t,{class:"zonos--elements",style:this.size?{"--zonos--font-family":i,height:`${this.size}px`,width:`${this.size}px`}:{"--zonos--font-family":i}},s("div",{class:n(["flag-container"])},s("div",{class:"flag-icon",style:{backgroundImage:`url(${o})`}})))}get el(){return i(this)}};h.style=":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-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";export{h as zonos_country_flag}
@@ -1,4 +1,4 @@
1
- import{z as o,c as e}from"./p-30fdcbee.js";import{t as n,F as r,f as t,e as a,z as i,r as s,x as c,k as l}from"./p-18ec705b.js";import{h as u,l as d,b as p,j as v}from"./p-0fc02cde.js";import{t as y}from"./p-98aa88b1.js";
1
+ import{z as o,c as e}from"./p-30fdcbee.js";import{t as n,F as r,f as t,e as a,z as i,r as s,x as c,k as l}from"./p-a69dbe14.js";import{h as u,l as d,b as p,j as v}from"./p-0fc02cde.js";import{t as y}from"./p-98aa88b1.js";
2
2
  /*!
3
3
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
4
4
  * Copyright 2020-present, PayPal, Inc. All rights reserved.