@zonos/elements 1.3.39 → 1.3.41

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 (303) hide show
  1. package/dist/cjs/{cart-c7212410.js → cart-497bb434.js} +300 -7
  2. package/dist/cjs/{getBorderRadius-074b46ef.js → getBorderRadius-4413e191.js} +1 -1
  3. package/dist/cjs/{index-b071017b.js → index-d56e0a8b.js} +242 -169
  4. package/dist/cjs/index.cjs.js +10 -4
  5. package/dist/cjs/{isDarkColor-371a3b1a.js → isDarkColor-4eb96a1e.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/paypal-e65a287a.js +461 -0
  8. package/dist/cjs/{submitGtag-7a679d92.js → sendErrorLog-c3c315a9.js} +2 -19
  9. package/dist/cjs/zonos-address_8.cjs.entry.js +11 -11
  10. package/dist/cjs/zonos-badge_2.cjs.entry.js +4 -4
  11. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
  13. package/dist/cjs/zonos-card.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +76 -38
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +43 -70
  16. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-controller.cjs.entry.js +15 -15
  18. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  19. package/dist/cjs/{zonos-country-select_3.cjs.entry.js → zonos-country-select_4.cjs.entry.js} +100 -14
  20. package/dist/cjs/zonos-elements.cjs.js +3 -3
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
  22. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  23. package/dist/cjs/zonos-input.cjs.entry.js +7 -7
  24. package/dist/cjs/zonos-language-select_2.cjs.entry.js +9 -9
  25. package/dist/cjs/zonos-link.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  27. package/dist/cjs/{zonos-notification_2.cjs.entry.js → zonos-notification_3.cjs.entry.js} +59 -7
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  30. package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
  31. package/dist/cjs/{zonosStore-4c6c85da.js → zonosStore-56401fdb.js} +5 -1
  32. package/dist/collection/__tests__/build-utils/urlCheckOne.js +3 -1
  33. package/dist/collection/collection-manifest.json +3 -1
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +1 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +39 -8
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +1 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -1
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +37 -22
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +30 -60
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +1 -0
  43. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -0
  44. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +14 -4
  45. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  46. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  47. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  48. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  49. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  50. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  51. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  52. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  53. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  54. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  55. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.css +46 -0
  56. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +177 -0
  57. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  58. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  59. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  60. package/dist/collection/components/main/zonos-controller.js +22 -8
  61. package/dist/collection/components/paypal/zonos-paypal-payment.css +37 -0
  62. package/dist/collection/components/paypal/zonos-paypal-payment.js +92 -0
  63. package/dist/collection/components/store/checkout/cart.js +26 -1
  64. package/dist/collection/components/store/checkout/paypal.js +219 -0
  65. package/dist/collection/components/store/checkout/stripe.js +16 -4
  66. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  67. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  68. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  69. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  70. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  71. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  72. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  73. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  74. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  75. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  76. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  77. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  78. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  79. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  80. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  81. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  82. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  83. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  84. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  85. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  86. package/dist/collection/components/store/zonosStore.js +4 -0
  87. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  88. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  89. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -3
  90. package/dist/collection/components/utils/api/getZonosSettings.js +3 -3
  91. package/dist/collection/components/utils/api/paypalCaptureOrder.js +8 -0
  92. package/dist/collection/components/utils/api/paypalCreateOrder.js +8 -0
  93. package/dist/collection/components/utils/getContrastColor.js +6 -2
  94. package/dist/collection/components/utils/handleFetch.js +6 -1
  95. package/dist/collection/components/utils/isContrastColor.js +7 -0
  96. package/dist/collection/environment.js +4 -5
  97. package/dist/collection/scripts/_getZonosQaUrl.js +4 -0
  98. package/dist/collection/scripts/_zonosBase.js +2 -0
  99. package/dist/collection/styles/stripe/addressRuleStyle.js +6 -0
  100. package/dist/collection/types/generated/graphql.customer.types.js +35 -0
  101. package/dist/esm/{cart-eb75b113.js → cart-f53c9f90.js} +296 -8
  102. package/dist/esm/{getBorderRadius-947c24de.js → getBorderRadius-3ba98361.js} +1 -1
  103. package/dist/esm/{index-3b46f3c3.js → index-86b8247e.js} +242 -169
  104. package/dist/esm/index.js +10 -4
  105. package/dist/esm/{isDarkColor-f8324c10.js → isDarkColor-3119e351.js} +1 -1
  106. package/dist/esm/loader.js +3 -3
  107. package/dist/esm/paypal-72296ae6.js +453 -0
  108. package/dist/esm/{submitGtag-0bc0baa0.js → sendErrorLog-f8d3ec4b.js} +3 -19
  109. package/dist/esm/zonos-address_8.entry.js +11 -11
  110. package/dist/esm/zonos-badge_2.entry.js +4 -4
  111. package/dist/esm/zonos-banner.entry.js +2 -2
  112. package/dist/esm/zonos-button_3.entry.js +4 -4
  113. package/dist/esm/zonos-card.entry.js +3 -3
  114. package/dist/esm/zonos-cart-items_12.entry.js +63 -25
  115. package/dist/esm/zonos-checkout.entry.js +34 -61
  116. package/dist/esm/zonos-component.entry.js +2 -2
  117. package/dist/esm/zonos-controller.entry.js +15 -15
  118. package/dist/esm/zonos-country-flag.entry.js +5 -5
  119. package/dist/esm/{zonos-country-select_3.entry.js → zonos-country-select_4.entry.js} +100 -15
  120. package/dist/esm/zonos-elements.js +4 -4
  121. package/dist/esm/zonos-hello-dialog.entry.js +9 -9
  122. package/dist/esm/zonos-hello.entry.js +5 -5
  123. package/dist/esm/zonos-input.entry.js +7 -7
  124. package/dist/esm/zonos-language-select_2.entry.js +9 -9
  125. package/dist/esm/zonos-link.entry.js +2 -2
  126. package/dist/esm/zonos-logo.entry.js +4 -4
  127. package/dist/esm/{zonos-notification_2.entry.js → zonos-notification_3.entry.js} +60 -9
  128. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  129. package/dist/esm/zonos-text.entry.js +2 -2
  130. package/dist/esm/zonos-v-stack.entry.js +4 -4
  131. package/dist/esm/{zonosStore-ba9e541e.js → zonosStore-8fc9ceb2.js} +5 -1
  132. package/dist/esm-es5/cart-f53c9f90.js +1 -0
  133. package/dist/esm-es5/{getBorderRadius-947c24de.js → getBorderRadius-3ba98361.js} +1 -1
  134. package/dist/esm-es5/index-86b8247e.js +2 -0
  135. package/dist/esm-es5/index.js +1 -1
  136. package/dist/esm-es5/{isDarkColor-f8324c10.js → isDarkColor-3119e351.js} +1 -1
  137. package/dist/esm-es5/loader.js +1 -1
  138. package/dist/esm-es5/paypal-72296ae6.js +17 -0
  139. package/dist/esm-es5/sendErrorLog-f8d3ec4b.js +1 -0
  140. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  141. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  142. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  143. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  144. package/dist/esm-es5/zonos-card.entry.js +1 -1
  145. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  146. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  147. package/dist/esm-es5/zonos-component.entry.js +1 -1
  148. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  149. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  150. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -0
  151. package/dist/esm-es5/zonos-elements.js +1 -1
  152. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  153. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  154. package/dist/esm-es5/zonos-input.entry.js +1 -1
  155. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  156. package/dist/esm-es5/zonos-link.entry.js +1 -1
  157. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  158. package/dist/esm-es5/zonos-notification_3.entry.js +1 -0
  159. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  160. package/dist/esm-es5/zonos-text.entry.js +1 -1
  161. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  162. package/dist/esm-es5/{zonosStore-ba9e541e.js → zonosStore-8fc9ceb2.js} +1 -1
  163. package/dist/scripts/index.d.ts +170 -6
  164. package/dist/scripts/index.js +1 -1
  165. package/dist/scripts/loadZonos.js +1 -1
  166. package/dist/scripts/zonos.js +1 -1
  167. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -1
  168. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +8 -4
  169. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -20
  170. package/dist/types/components/common/zonos-virtual-scroll/zonos-virtual-scroll.d.ts +32 -0
  171. package/dist/types/components/main/zonos-controller.d.ts +6 -0
  172. package/dist/types/components/paypal/zonos-paypal-payment.d.ts +17 -0
  173. package/dist/types/components/store/checkout/cart.d.ts +19 -1
  174. package/dist/types/components/store/checkout/paypal.d.ts +28 -0
  175. package/dist/types/components/store/checkout/stripe.d.ts +10 -1
  176. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  177. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  178. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  179. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  180. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  181. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  182. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  183. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  184. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  185. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  186. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  187. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  188. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  189. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  190. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  191. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  192. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  193. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  194. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  195. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  196. package/dist/types/components/store/translationStore.d.ts +1 -1
  197. package/dist/types/components/store/zonosStore.d.ts +4 -0
  198. package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -0
  199. package/dist/types/components/utils/api/paypalCaptureOrder.d.ts +10 -0
  200. package/dist/types/components/utils/api/paypalCreateOrder.d.ts +9 -0
  201. package/dist/types/components/utils/handleFetch.d.ts +4 -0
  202. package/dist/types/components/utils/isContrastColor.d.ts +4 -0
  203. package/dist/types/components.d.ts +129 -6
  204. package/dist/types/scripts/_zonosBase.d.ts +9 -1
  205. package/dist/types/stencil-public-runtime.d.ts +3 -10
  206. package/dist/types/types/checkout/CheckoutConfig.d.ts +14 -1
  207. package/dist/types/types/generated/graphql.customer.types.d.ts +71 -11
  208. package/dist/types/types/generated/graphql.customer.types.ts +103 -11
  209. package/dist/zonos-elements/index.esm.js +1 -1
  210. package/dist/zonos-elements/{p-71882ac9.system.entry.js → p-0229282c.system.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-5821856c.js → p-04054425.js} +1 -1
  212. package/dist/zonos-elements/p-05cdd3b4.js +17 -0
  213. package/dist/zonos-elements/{p-a8b934c2.entry.js → p-0f9804e3.entry.js} +1 -1
  214. package/dist/zonos-elements/p-12266c9e.js +1 -0
  215. package/dist/zonos-elements/{p-01304a58.system.entry.js → p-14067782.system.entry.js} +1 -1
  216. package/dist/zonos-elements/p-1a89c54a.js +1 -0
  217. package/dist/zonos-elements/{p-d2992457.system.entry.js → p-1e4f7997.system.entry.js} +1 -1
  218. package/dist/zonos-elements/p-1ee2fa70.system.entry.js +1 -0
  219. package/dist/zonos-elements/{p-63a27875.entry.js → p-25633055.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-e37440ad.system.js → p-40c21634.system.js} +1 -1
  221. package/dist/zonos-elements/p-4db5be24.system.entry.js +1 -0
  222. package/dist/zonos-elements/{p-da2e5289.system.entry.js → p-4f454a91.system.entry.js} +1 -1
  223. package/dist/zonos-elements/p-52947dab.system.entry.js +1 -0
  224. package/dist/zonos-elements/{p-62ed4236.entry.js → p-52fa9aab.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-31b3d26b.js → p-52fb6876.js} +1 -1
  226. package/dist/zonos-elements/p-539974db.system.js +1 -0
  227. package/dist/zonos-elements/p-5922c099.entry.js +1 -0
  228. package/dist/zonos-elements/p-5b7da777.js +2 -0
  229. package/dist/zonos-elements/p-5fe10991.system.entry.js +1 -0
  230. package/dist/zonos-elements/p-678f1888.entry.js +1 -0
  231. package/dist/zonos-elements/p-67f22fbf.system.entry.js +1 -0
  232. package/dist/zonos-elements/{p-9a1c0d02.js → p-6ac72711.js} +1 -1
  233. package/dist/zonos-elements/{p-ed333de6.system.entry.js → p-6bb0b7d2.system.entry.js} +1 -1
  234. package/dist/zonos-elements/p-6de1c78a.entry.js +1 -0
  235. package/dist/zonos-elements/{p-d8c1eb99.entry.js → p-6de38759.entry.js} +1 -1
  236. package/dist/zonos-elements/{p-a21ec316.system.entry.js → p-6fbb4565.system.entry.js} +1 -1
  237. package/dist/zonos-elements/{p-6c3390b7.entry.js → p-706d2bad.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-73ba4398.system.entry.js → p-717028a2.system.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-8acdf43b.system.entry.js → p-7833fa53.system.entry.js} +1 -1
  240. package/dist/zonos-elements/p-79fd4f3c.system.js +1 -0
  241. package/dist/zonos-elements/p-8809964a.system.js +1 -0
  242. package/dist/zonos-elements/{p-3541e6dd.entry.js → p-8b01aafb.entry.js} +1 -1
  243. package/dist/zonos-elements/{p-2aa72606.entry.js → p-9220f63d.entry.js} +1 -1
  244. package/dist/zonos-elements/{p-699a5376.entry.js → p-9420f9db.entry.js} +1 -1
  245. package/dist/zonos-elements/p-9525cc44.system.js +1 -0
  246. package/dist/zonos-elements/{p-c21802e9.entry.js → p-9a319774.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-3523c3b4.entry.js → p-9d1f13c2.entry.js} +1 -1
  248. package/dist/zonos-elements/{p-c0fcc0fa.system.entry.js → p-9eadd9a7.system.entry.js} +1 -1
  249. package/dist/zonos-elements/{p-966ab4e7.system.entry.js → p-a3e2592b.system.entry.js} +1 -1
  250. package/dist/zonos-elements/{p-f06bb776.system.entry.js → p-ab11cca6.system.entry.js} +1 -1
  251. package/dist/zonos-elements/p-b3e825dc.system.js +17 -0
  252. package/dist/zonos-elements/{p-9d29f3f4.system.entry.js → p-b689309d.system.entry.js} +1 -1
  253. package/dist/zonos-elements/p-c460665d.system.js +1 -0
  254. package/dist/zonos-elements/p-c4617501.entry.js +1 -0
  255. package/dist/zonos-elements/{p-b903af96.system.entry.js → p-c4bb2949.system.entry.js} +1 -1
  256. package/dist/zonos-elements/{p-c3619b3d.entry.js → p-c7301a88.entry.js} +1 -1
  257. package/dist/zonos-elements/p-c78dd680.system.js +1 -0
  258. package/dist/zonos-elements/p-d86c89e3.entry.js +1 -0
  259. package/dist/zonos-elements/{p-e3c014ae.entry.js → p-dc368ad5.entry.js} +1 -1
  260. package/dist/zonos-elements/{p-18b28104.entry.js → p-de53d9c3.entry.js} +1 -1
  261. package/dist/zonos-elements/p-df69fa38.system.entry.js +1 -0
  262. package/dist/zonos-elements/{p-22882fd6.entry.js → p-e07bf9ea.entry.js} +1 -1
  263. package/dist/zonos-elements/{p-9de374a7.system.entry.js → p-e8f7fb29.system.entry.js} +1 -1
  264. package/dist/zonos-elements/{p-59f37de3.entry.js → p-f35ee203.entry.js} +1 -1
  265. package/dist/zonos-elements/p-fd061229.system.js +2 -0
  266. package/dist/zonos-elements/p-fd54fbb9.system.entry.js +1 -0
  267. package/dist/zonos-elements/p-fdb4347f.entry.js +1 -0
  268. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  269. package/dist/zonos-elements/zonos-elements.js +1 -1
  270. package/loader/cdn.js +1 -2
  271. package/loader/index.cjs.js +1 -2
  272. package/loader/index.d.ts +3 -0
  273. package/loader/index.es2017.js +1 -2
  274. package/loader/index.js +1 -2
  275. package/package.json +12 -11
  276. package/dist/esm-es5/cart-eb75b113.js +0 -1
  277. package/dist/esm-es5/index-3b46f3c3.js +0 -2
  278. package/dist/esm-es5/submitGtag-0bc0baa0.js +0 -1
  279. package/dist/esm-es5/zonos-country-select_3.entry.js +0 -1
  280. package/dist/esm-es5/zonos-notification_2.entry.js +0 -1
  281. package/dist/zonos-elements/p-02405211.system.entry.js +0 -1
  282. package/dist/zonos-elements/p-085548f2.entry.js +0 -1
  283. package/dist/zonos-elements/p-0b538ed4.system.js +0 -1
  284. package/dist/zonos-elements/p-2a45c837.system.entry.js +0 -1
  285. package/dist/zonos-elements/p-357322ea.system.entry.js +0 -1
  286. package/dist/zonos-elements/p-3f5e2e5c.system.entry.js +0 -1
  287. package/dist/zonos-elements/p-53acc999.js +0 -1
  288. package/dist/zonos-elements/p-548ac127.entry.js +0 -1
  289. package/dist/zonos-elements/p-5609876a.system.entry.js +0 -1
  290. package/dist/zonos-elements/p-6f9448bb.entry.js +0 -1
  291. package/dist/zonos-elements/p-70262120.system.js +0 -1
  292. package/dist/zonos-elements/p-878293fe.js +0 -1
  293. package/dist/zonos-elements/p-97d74f84.system.js +0 -1
  294. package/dist/zonos-elements/p-a393c1db.system.entry.js +0 -1
  295. package/dist/zonos-elements/p-a8cb25de.system.js +0 -1
  296. package/dist/zonos-elements/p-abe8ea12.system.js +0 -1
  297. package/dist/zonos-elements/p-ae04d3ff.entry.js +0 -1
  298. package/dist/zonos-elements/p-b684f8aa.system.entry.js +0 -1
  299. package/dist/zonos-elements/p-ce347974.js +0 -2
  300. package/dist/zonos-elements/p-d99232c5.system.js +0 -2
  301. package/dist/zonos-elements/p-e0bf9666.system.js +0 -1
  302. package/dist/zonos-elements/p-e1db1bc9.entry.js +0 -1
  303. package/dist/zonos-elements/p-e74ca4bc.entry.js +0 -1
@@ -1,6 +1,7 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore } from "../../../store/checkout/cart";
3
- import { stripeStore, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
3
+ import { paypalStore, paypalStoreReset, } from "../../../store/checkout/paypal";
4
+ import { stripeStore, stripeStoreMessageBasedOnStatus, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
4
5
  import { translate } from "../../../store/translationStore";
5
6
  import { zonosStore } from "../../../store/zonosStore";
6
7
  import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
@@ -102,7 +103,7 @@ export class ZonosCheckoutFinish {
102
103
  this.notificationActionText = successPageActionText;
103
104
  }
104
105
  };
105
- this.checkPaymentStatus = async () => {
106
+ this.checkStripePaymentStatus = async () => {
106
107
  this.isLoading = true;
107
108
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
108
109
  if (clientSecret || this.storybookForceStatus) {
@@ -115,8 +116,6 @@ export class ZonosCheckoutFinish {
115
116
  this.notificationTitle = error
116
117
  ? translate('Payment failed')
117
118
  : translate("You're all set!");
118
- // override title if notification type is success
119
- this.useOverrideSuccessNotification();
120
119
  if (error) {
121
120
  submitGtag('zonos-checkout-payment-fail');
122
121
  }
@@ -132,6 +131,8 @@ export class ZonosCheckoutFinish {
132
131
  }
133
132
  // Attempt to pull the order details from the graph every second on 5 attempts. Only pull if checkoutSessionId is available
134
133
  if (this.notificationType === 'success' && cartStore.checkoutSessionId) {
134
+ // override title if notification type is success
135
+ this.useOverrideSuccessNotification();
135
136
  // wait this to finish before resetting store and checkout session id
136
137
  await this.getPullOrder();
137
138
  }
@@ -145,6 +146,31 @@ export class ZonosCheckoutFinish {
145
146
  stripeStoreReset();
146
147
  cartStore.checkoutSessionId = null;
147
148
  };
149
+ this.checkPaypalPaymentStatus = async () => {
150
+ this.isLoading = true;
151
+ // render error message if there's an error
152
+ if (paypalStore.paypalErrorMessage) {
153
+ this.notificationType = 'error';
154
+ this.notificationTitle = translate('Payment failed');
155
+ this.notificationMessages = [paypalStore.paypalErrorMessage];
156
+ this.isLoading = false;
157
+ return;
158
+ }
159
+ if (paypalStore.orderIdCreated) {
160
+ this.notificationType = 'success';
161
+ this.notificationTitle = translate("You're all set!");
162
+ this.notificationMessages =
163
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
164
+ // override title if notification type is success
165
+ this.useOverrideSuccessNotification();
166
+ // wait this to finish before resetting store and checkout session id
167
+ await this.getPullOrder();
168
+ }
169
+ this.isLoading = false;
170
+ stripeStoreReset();
171
+ paypalStoreReset();
172
+ cartStore.checkoutSessionId = null;
173
+ };
148
174
  this.closeClickHandler = () => {
149
175
  this.closeClick.emit();
150
176
  };
@@ -167,17 +193,22 @@ export class ZonosCheckoutFinish {
167
193
  this.isLoading = false;
168
194
  return;
169
195
  }
170
- void this.checkPaymentStatus();
196
+ if (paypalStore.orderIdCreated) {
197
+ void this.checkPaypalPaymentStatus();
198
+ }
199
+ else {
200
+ void this.checkStripePaymentStatus();
201
+ }
171
202
  }
172
203
  render() {
173
204
  var _a, _b;
174
205
  const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || ((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
175
206
  const isTestMode = getIsTestMode();
176
- return (h(Host, { key: 'd36ab5e23e09a467b2616ade463baec9626c0157', class: "zonos--checkout-finish zonos--elements", style: {
207
+ return (h(Host, { key: '4e00e5d3d8de136e4161fdea6afba86616748d66', class: "zonos--checkout-finish zonos--elements", style: {
177
208
  '--border-radius': getBorderRadius({
178
209
  overrideBorderStyle: this.borderRadius,
179
210
  }),
180
- } }, this.isLoading && (h("div", { key: '58181470e5a3e75655bde5bf91ac4a857a8144f8', class: "loading-wrapper" }, h("zonos-spinner", { key: 'b1aba8ef89c9fbce271d6c3226f32e0a0dd1561d' }))), !this.isLoading && (h("div", { key: 'd02576373b5a3affc73906e125d443ce12e6c8d6', class: "zonos--finish-details" }, h("div", { key: 'ba06598ed291e565663c5b321e9419215cd2832a', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '55c453a319a693280518a4b2c2f502a1cc90dc2a', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("zonos-badge", { key: '31042753fb3a1ef5155314c1d55abc067c6a6d31', badgeColor: "transparent" }, orderId)), h("zonos-text", { key: 'e9eceec74357986169f829a1c650f1e4b1605245', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: '7c6e8b61be1bf7cc3c84ed369f438af7b1ad60c0', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'bb567e9a67e6895b7f3c97e6d02584ba9f279acd', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '50afe47a9e5d25759b4f82bb619f5de7fc56f260', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '6cf9d0d670aa07ade295aa5ef3781dcd65e4d812', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
211
+ } }, this.isLoading && (h("div", { key: '6b4f755402951c5fd0e5150ccd05542b85ca2121', class: "loading-wrapper" }, h("zonos-spinner", { key: 'a3e6b561c6796891b33d273b9729d0f8fab4a308' }))), !this.isLoading && (h("div", { key: '798bfa6f1ee9f7b682e0d7389654f5b3d1549ba6', class: "zonos--finish-details" }, h("div", { key: 'cd7a52c193aa3bb5ef2e49e6027bf0448de14046', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'b4c5751d55a3ef5d06e68a1065dc017b455a9d1f', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("zonos-badge", { key: 'd8c13fb55fe83d1caf26efbd037da866b26af108', badgeColor: "transparent" }, orderId)), h("zonos-text", { key: '5ae6e0d1b42e7d0ab578229d8c9eebcd660b78db', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: '0a3447480fe0ddcff91579602621b9ee70ae2a64', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'c3374a72c1e2d9350f152c7e2016463bf0a7f02e', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '7d34001e6798162cbcb1d9ef8949d15617c64362', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'e217f0bde5d4b0df0220983a32ae8853469d1d23', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
181
212
  }
182
213
  static get is() { return "zonos-checkout-finish"; }
183
214
  static get encapsulation() { return "shadow"; }
@@ -228,7 +259,7 @@ export class ZonosCheckoutFinish {
228
259
  "PaymentIntent": {
229
260
  "location": "import",
230
261
  "path": "@stripe/stripe-js",
231
- "id": ""
262
+ "id": "node_modules::PaymentIntent"
232
263
  }
233
264
  }
234
265
  },
@@ -96,6 +96,7 @@
96
96
  transform-origin: bottom left;
97
97
  opacity: 0;
98
98
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
99
+ overscroll-behavior: contain;
99
100
  }
100
101
  :host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar {
101
102
  width: 10px;
@@ -47,6 +47,7 @@
47
47
  display: flex;
48
48
  flex-direction: column;
49
49
  flex: 1;
50
+ overscroll-behavior: contain;
50
51
  }
51
52
  :host .zonos--group::-webkit-scrollbar {
52
53
  width: 10px;
@@ -79,10 +80,15 @@
79
80
  position: sticky;
80
81
  display: flex;
81
82
  justify-content: center;
83
+ flex-direction: column;
84
+ gap: 12px;
82
85
  bottom: 0;
83
- margin-top: 12px;
86
+ padding-top: 12px;
84
87
  background: var(--primary-color, var(--zonos-elements-gray-0));
85
88
  }
89
+ :host .zonos--group-btn zonos-text {
90
+ text-align: center;
91
+ }
86
92
  :host .zonos--group-btn zonos-button {
87
93
  width: 100%;
88
94
  }
@@ -1,5 +1,6 @@
1
1
  import { h, Host, } from "@stencil/core";
2
2
  import { cartStore } from "../../../store/checkout/cart";
3
+ import { paypalStore, paypalStoreHasPaypalEnabled, } from "../../../store/checkout/paypal";
3
4
  import { stripeStore } from "../../../store/checkout/stripe";
4
5
  import { translate } from "../../../store/translationStore";
5
6
  import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
@@ -23,9 +24,9 @@ export class ZonosCheckoutPayment {
23
24
  this.showErrorBanner = true;
24
25
  return;
25
26
  }
26
- this.continueClicked.emit();
27
27
  // submit google tag when the form is complete
28
28
  submitGtag('zonos-checkout-payment-info');
29
+ this.continueClicked.emit();
29
30
  };
30
31
  this.copyCardToClipboard = (cardNumber) => {
31
32
  void navigator.clipboard.writeText(cardNumber);
@@ -35,7 +36,6 @@ export class ZonosCheckoutPayment {
35
36
  type: 'success',
36
37
  });
37
38
  };
38
- this.paymentError = false;
39
39
  this.submitBtnType = undefined;
40
40
  this.continueLoading = false;
41
41
  this.submitBtnColor = undefined;
@@ -50,14 +50,17 @@ export class ZonosCheckoutPayment {
50
50
  this.showErrorBanner = !this.handleValidate();
51
51
  }
52
52
  const isTestMode = getIsTestMode();
53
- return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.paymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
53
+ const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
54
+ return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
54
55
  // use primary type when on mobile mode
55
56
  variant: this.submitBtnType }, translate('Pay [orderTotal]', {
56
57
  orderTotal: currencyFormat({
57
58
  amount: cartStore.total,
58
59
  currency: cartStore.currency,
59
60
  }),
60
- }))), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
61
+ })), hasPaypalEnabled && (h("zonos-text", { type: "smallHeader" }, translate('or'))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
62
+ this.paypalSessionDone.emit(orderId);
63
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit() })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
61
64
  }
62
65
  static get is() { return "zonos-checkout-payment"; }
63
66
  static get encapsulation() { return "scoped"; }
@@ -73,24 +76,6 @@ export class ZonosCheckoutPayment {
73
76
  }
74
77
  static get properties() {
75
78
  return {
76
- "paymentError": {
77
- "type": "boolean",
78
- "mutable": false,
79
- "complexType": {
80
- "original": "boolean",
81
- "resolved": "boolean",
82
- "references": {}
83
- },
84
- "required": false,
85
- "optional": false,
86
- "docs": {
87
- "tags": [],
88
- "text": "Error occurred during payment"
89
- },
90
- "attribute": "payment-error",
91
- "reflect": false,
92
- "defaultValue": "false"
93
- },
94
79
  "submitBtnType": {
95
80
  "type": "string",
96
81
  "mutable": false,
@@ -171,6 +156,36 @@ export class ZonosCheckoutPayment {
171
156
  "resolved": "void",
172
157
  "references": {}
173
158
  }
159
+ }, {
160
+ "method": "paypalSessionFailed",
161
+ "name": "paypalSessionFailed",
162
+ "bubbles": true,
163
+ "cancelable": true,
164
+ "composed": true,
165
+ "docs": {
166
+ "tags": [],
167
+ "text": "Event to emit when the paypal session failed"
168
+ },
169
+ "complexType": {
170
+ "original": "void",
171
+ "resolved": "void",
172
+ "references": {}
173
+ }
174
+ }, {
175
+ "method": "paypalSessionDone",
176
+ "name": "paypalSessionDone",
177
+ "bubbles": true,
178
+ "cancelable": true,
179
+ "composed": true,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": "Event to emit when the paypal session is done"
183
+ },
184
+ "complexType": {
185
+ "original": "string",
186
+ "resolved": "string",
187
+ "references": {}
188
+ }
174
189
  }];
175
190
  }
176
191
  }
@@ -31,6 +31,9 @@
31
31
  -webkit-font-smoothing: antialiased;
32
32
  }
33
33
 
34
+ :host * {
35
+ overscroll-behavior: contain;
36
+ }
34
37
  :host *::-webkit-scrollbar {
35
38
  width: 10px;
36
39
  }
@@ -1,6 +1,7 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
- import { cartStore, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
- import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
2
+ import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
+ import { paypalInitScript } from "../../store/checkout/paypal";
4
+ import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
4
5
  import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
5
6
  import { translate } from "../../store/translationStore";
6
7
  import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
@@ -62,7 +63,6 @@ export class ZonosCheckout {
62
63
  this.open = this.forceDialogOpen;
63
64
  this.stripe = window.Zonos.stripe;
64
65
  this.submitLoading = false;
65
- this.paymentError = false;
66
66
  this.collapseReviewMobile = true;
67
67
  this.isAttachError = false;
68
68
  this.isMobile = false;
@@ -72,8 +72,6 @@ export class ZonosCheckout {
72
72
  this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
73
73
  this.isLegacyCheckout = false;
74
74
  this.confirmDialogOpen = false;
75
- this.showSessionTimoutScreen = false;
76
- this.checkoutTimeoutInterval = null;
77
75
  this.inventoryCheckErrorMessage = null;
78
76
  }
79
77
  /**
@@ -115,7 +113,7 @@ export class ZonosCheckout {
115
113
  // reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
116
114
  cartStoreResetTabItems();
117
115
  // clear the checkout session timeout timer when checkout dialog close action is triggered
118
- this.clearCheckoutTimeoutInterval();
116
+ cartStoreClearCheckoutInterval();
119
117
  /**
120
118
  * Trigger callback when the checkout is closed
121
119
  */
@@ -148,30 +146,6 @@ export class ZonosCheckout {
148
146
  await this.applyStripeTheme();
149
147
  return true;
150
148
  }
151
- clearCheckoutTimeoutInterval() {
152
- if (this.checkoutTimeoutInterval) {
153
- clearTimeout(this.checkoutTimeoutInterval);
154
- this.checkoutTimeoutInterval = null;
155
- }
156
- }
157
- startCheckoutTimeoutInterval() {
158
- // do nothing if in preview mode
159
- if (this.preview) {
160
- return;
161
- }
162
- const timeoutQuery = new URLSearchParams(window.location.search).get('zonosCheckoutTimeout');
163
- const timeout =
164
- // timeout query is mainly for testing purpose
165
- timeoutQuery && !isNaN(parseInt(timeoutQuery, 10))
166
- ? parseInt(timeoutQuery, 10)
167
- : CHECKOUT_SESSION_TIMEOUT;
168
- log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
169
- // start a timer to validate the price
170
- this.checkoutTimeoutInterval = setTimeout(() => {
171
- // Show session timeout alert
172
- this.showSessionTimoutScreen = true;
173
- }, timeout);
174
- }
175
149
  reloadCheckoutSession() {
176
150
  window.location.reload();
177
151
  }
@@ -212,7 +186,10 @@ export class ZonosCheckout {
212
186
  throw new Error('Error building cart');
213
187
  }
214
188
  // start the timer to validate the price
215
- this.startCheckoutTimeoutInterval();
189
+ cartStoreStartCheckoutInterval({
190
+ isPreview: this.preview,
191
+ sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
192
+ });
216
193
  submitGtag('zonos-checkout-start');
217
194
  void trackConversionEvent('checkout_open');
218
195
  }
@@ -379,6 +356,10 @@ export class ZonosCheckout {
379
356
  const interval = setInterval(() => {
380
357
  if (cartStore.landedCostData || !stripeStore.isFetchingLandedCost) {
381
358
  if (cartStore.landedCostData) {
359
+ // start init paypal with the presentment currency when landed cost is fetched
360
+ void paypalInitScript({
361
+ currency: cartStore.currency,
362
+ });
382
363
  // only go to next step if landed cost data is ready
383
364
  cartStoreNextStep();
384
365
  }
@@ -397,41 +378,31 @@ export class ZonosCheckout {
397
378
  }
398
379
  handleInventoryCheckDialogCancel() {
399
380
  // reset inventory check message to close the inventory check alert
400
- this.inventoryCheckErrorMessage = null;
381
+ cartStore.inventoryCheckErrorMessage = null;
401
382
  }
402
383
  handleInventoryCheckDialogConfirm() {
403
384
  // reset inventory check message to close the inventory check alert
404
- this.inventoryCheckErrorMessage = null;
385
+ cartStore.inventoryCheckErrorMessage = null;
405
386
  // close the dialog
406
387
  void this.closeDialogHandler({ confirmed: true });
407
388
  }
408
- /**
409
- * Handle inventory check and returns error message if the callback provided.
410
- */
411
- async handleInventoryCheck() {
412
- const { onInventoryCheck } = zonosStore.checkoutSettings;
413
- if (typeof onInventoryCheck !== 'function') {
414
- return null;
415
- }
416
- const message = await onInventoryCheck({ items: cartStore.items });
417
- return message;
418
- }
419
- async handleCheckoutPaymentContinue() {
389
+ async handleStripePaymentContinue() {
420
390
  // reset error state
421
- this.paymentError = false;
391
+ stripeStore.hasPaymentError = false;
422
392
  this.submitLoading = true;
423
393
  // reset inventory check message
424
- this.inventoryCheckErrorMessage = null;
394
+ cartStore.inventoryCheckErrorMessage = null;
425
395
  try {
426
396
  // check inventory before proceeding to payment
427
- this.inventoryCheckErrorMessage = await this.handleInventoryCheck();
397
+ cartStore.inventoryCheckErrorMessage =
398
+ await stripeStoreHandleInventoryCheck();
428
399
  }
429
400
  catch (err) {
430
401
  // If user provide callback and it throw an exception, default to this message and stop the payment.
431
- this.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
402
+ cartStore.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
432
403
  }
433
404
  // Don't proceed to payment if there's an error message
434
- if (this.inventoryCheckErrorMessage) {
405
+ if (cartStore.inventoryCheckErrorMessage) {
435
406
  // stop the submit loading state
436
407
  this.submitLoading = false;
437
408
  return;
@@ -440,11 +411,11 @@ export class ZonosCheckout {
440
411
  await stripeStoreConfirmPayment();
441
412
  cartStoreNextStep();
442
413
  // clear the checkout session timeout timer when purchase is complete
443
- this.clearCheckoutTimeoutInterval();
414
+ cartStoreClearCheckoutInterval();
444
415
  }
445
416
  catch (err) {
446
417
  logError(err);
447
- this.paymentError = true;
418
+ stripeStore.hasPaymentError = true;
448
419
  }
449
420
  this.submitLoading = false;
450
421
  }
@@ -560,14 +531,16 @@ export class ZonosCheckout {
560
531
  this.isMobile ? '--zonos-elements-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
561
532
  };
562
533
  const renderContent = () => {
563
- if (this.showSessionTimoutScreen) {
534
+ if (cartStore.checkoutSessionTimeoutShow) {
564
535
  return (h("zonos-rest-state", { class: "zonos--session-timeout", restStateSubtitle: translate('Your checkout session has expired. Please reload the page to continue.'), restStateTitle: translate('Session timed out'), restStateType: 'Warning' }, h("zonos-button", { onClick: () => this.reloadCheckoutSession(), variant: "primary" }, translate('Reload'))));
565
536
  }
566
537
  return (h("div", { class: 'zonos--content', style: {
567
538
  '--border-radius': getBorderRadius({ overrideBorderStyle: style }),
568
539
  } }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
569
540
  '--primary-color': !this.isMobile ? colorPrimary : '',
570
- } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
541
+ } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: async () => {
542
+ await this.handleStripePaymentContinue();
543
+ }, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
571
544
  // do nothing if it's not mobile
572
545
  if (!this.isMobile) {
573
546
  return;
@@ -596,9 +569,9 @@ export class ZonosCheckout {
596
569
  // Mark user selected confirm to close the dialog
597
570
  onConfirmClicked: () => this.closeDialogHandler({ confirmed: true }) }), h("zonos-confirm-dialog", { class: "zonos--inventory-check-failure-dialog", dialogConfirmBtnText: translate('Return to cart'), dialogIntent: "danger",
598
571
  // Show dialog if inventory check error message is not null
599
- dialogOpen: !!this.inventoryCheckErrorMessage,
572
+ dialogOpen: !!cartStore.inventoryCheckErrorMessage,
600
573
  // If diallog is in open state, the message should not be null
601
- dialogSubtitle: this.inventoryCheckErrorMessage, dialogTitle: translate("Couldn't place order"), dialogType: "alert", onCancelClicked: () => {
574
+ dialogSubtitle: cartStore.inventoryCheckErrorMessage, dialogTitle: translate("Couldn't place order"), dialogType: "alert", onCancelClicked: () => {
602
575
  this.handleInventoryCheckDialogCancel();
603
576
  },
604
577
  // Mark user selected confirm to close the dialog
@@ -727,7 +700,6 @@ export class ZonosCheckout {
727
700
  "open": {},
728
701
  "stripe": {},
729
702
  "submitLoading": {},
730
- "paymentError": {},
731
703
  "collapseReviewMobile": {},
732
704
  "isAttachError": {},
733
705
  "isMobile": {},
@@ -737,8 +709,6 @@ export class ZonosCheckout {
737
709
  "legacyCheckoutHiddenBtnSelector": {},
738
710
  "isLegacyCheckout": {},
739
711
  "confirmDialogOpen": {},
740
- "showSessionTimoutScreen": {},
741
- "checkoutTimeoutInterval": {},
742
712
  "inventoryCheckErrorMessage": {}
743
713
  };
744
714
  }
@@ -798,7 +768,7 @@ export class ZonosCheckout {
798
768
  "PaymentIntent": {
799
769
  "location": "import",
800
770
  "path": "@stripe/stripe-js",
801
- "id": ""
771
+ "id": "node_modules::PaymentIntent"
802
772
  }
803
773
  },
804
774
  "return": "Promise<void>"
@@ -61,6 +61,7 @@
61
61
  margin-bottom: 20px;
62
62
  overflow: auto;
63
63
  padding: 5px;
64
+ overscroll-behavior: contain;
64
65
  }
65
66
  :host .zonos--group::-webkit-scrollbar {
66
67
  width: 10px;
@@ -49,6 +49,7 @@
49
49
  margin-bottom: 20px;
50
50
  overflow: auto;
51
51
  padding: 5px;
52
+ overscroll-behavior: contain;
52
53
  }
53
54
  :host .zonos--group::-webkit-scrollbar {
54
55
  width: 10px;
@@ -51,6 +51,14 @@
51
51
  padding: 16px;
52
52
  padding-top: 0px;
53
53
  }
54
+ :host .zonos--country-select .zonos--country-select-content .no-country {
55
+ position: absolute;
56
+ left: 17px;
57
+ }
58
+ :host .zonos--country-select .zonos--country-select-content .zonos--country-filter-content {
59
+ height: 300px;
60
+ display: block;
61
+ }
54
62
  :host .zonos--country-select .zonos--country-select-country {
55
63
  display: flex;
56
64
  gap: 16px;
@@ -1,6 +1,7 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import Fuse from "fuse.js";
3
3
  import { localizationStore, localizationStoreUpdateSelectedCountryCode, } from "../../store/hello/localization";
4
+ import { translate } from "../../store/translationStore";
4
5
  import { zonosStoreFontFamily } from "../../store/zonosStore";
5
6
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
6
7
  import GreenCheckDuotoneIcon from "./assets/greenCheckDuotone.svg";
@@ -16,7 +17,7 @@ export class ZonosCountrySelect {
16
17
  const input = event.target;
17
18
  this.inputValue = input.value;
18
19
  // query the country list container
19
- const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select');
20
+ const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-filter-content');
20
21
  // scroll to top every time the input changes
21
22
  if (countryListSelector) {
22
23
  countryListSelector.scrollTop = 0;
@@ -28,21 +29,30 @@ export class ZonosCountrySelect {
28
29
  componentDidRender() {
29
30
  var _a, _b;
30
31
  // focus the input on render
31
- (_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select-input')) === null || _b === void 0 ? void 0 : _b.focus();
32
+ (_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-filter-content')) === null || _b === void 0 ? void 0 : _b.focus();
32
33
  }
33
34
  render() {
34
35
  const { helloCountryList } = localizationStore;
35
36
  const countries = helloCountryList ? Object.values(helloCountryList) : [];
36
37
  const fuse = new Fuse(countries, {
38
+ includeScore: true,
37
39
  keys: ['displayName'],
40
+ threshold: 0.3,
38
41
  });
39
42
  const fuseObject = fuse.search(this.inputValue.toLowerCase());
40
43
  const filteredCountries = this.inputValue
41
44
  ? fuseObject.map(country => country.item)
42
45
  : countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
43
- return (h(Host, { key: '2337dcb4bbca5520cb6a4e9426167916c548ef59', class: "zonos--elements", style: {
46
+ const isEmpty = !filteredCountries.length;
47
+ return (h(Host, { key: '1e17d188428f8caeb495389f7870c3052d3cfb4a', class: "zonos--elements", style: {
44
48
  '--font-family': zonosStoreFontFamily(),
45
- } }, h("div", { key: '7cb0f80536b6e89f23be24cc4860e84bfa7ab362', class: "zonos--country-select" }, h("zonos-v-stack", { key: 'fef186dbafd5e4d16e6f1486d3122c1297ef7f2d', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '19ad548f3ab7aa6afdeaacd48d8b7c5821ba13e1', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, h("input", { key: 'f7367680dbde6fb432dc778aed5a94291d1226c4', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), h("div", { key: 'e0765ab18a86a913edd7eec82452c0a9e5291f86', class: "zonos--country-select-content" }, filteredCountries.map(country => (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
49
+ } }, h("div", { key: '2f6d0f239a4fad7c48349878b53dc8cb426aa022', class: "zonos--country-select" }, h("zonos-v-stack", { key: '76ad667603fce800457dae6d8951abe97e5db9d8', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '091416c3c6b91d3b50dd033d8bca0df79841871b', handleOnClose: () => this.handleOnClose(), label: translate('Select a country') }, h("input", { key: '0c5d12e941bf7824594ebdd4b353ba833b6d9418', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: translate('Search countries'), value: this.inputValue }))), h("div", { key: '9ff13fd2b3528ddff2bd379baa0b2ec919a6f928', class: "zonos--country-select-content" }, isEmpty && (h("zonos-text", { key: '9cf46a7a706d335930eeedcc3663571c5dbaaafc', class: "no-country", textColor: "gray-800" }, translate('No countries found'))), h("zonos-virtual-scroll", { key: '297237f0e2179ea95a49ae4872f6cc216026dd47', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index => {
50
+ const country = filteredCountries[index];
51
+ if (!country) {
52
+ return null;
53
+ }
54
+ return (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 }))));
55
+ } })))));
46
56
  }
47
57
  static get is() { return "zonos-country-select"; }
48
58
  static get encapsulation() { return "shadow"; }
@@ -8,9 +8,9 @@ export class ZonosCustomMessage {
8
8
  }
9
9
  render() {
10
10
  const messageWithLinks = formatStringWithLinks(this.message);
11
- return (h(Host, { key: '37b59a5aad442e9c20b8ed03672c73c315b45538', class: "zonos--elements", style: {
11
+ return (h(Host, { key: 'd6d31b58cf5396c136d81a5969b418c79229c930', class: "zonos--elements", style: {
12
12
  '--font-family': zonosStoreFontFamily(),
13
- } }, this.message && (h("zonos-card", { key: '5de7e44deb7c0544789a9d2b306fc8b2cad338b8', class: "zonos--custom-message", spacing: "12px" }, h("div", { key: 'c911e94eb1d7cbaf1db2126d14a6eeed8932ff97', class: "zonos--flex-message" }, h("zonos-icon", { key: '35c7f483046b78e9dffe87370d6b2f9435bc0ec1', "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { key: 'fdbc136b2a01fd5df35a3b01aa82bb9d088083e0', innerHTML: messageWithLinks }))))));
13
+ } }, this.message && (h("zonos-card", { key: '4c62131117e23bbe475fb6f59a5e9bba8bc7d552', class: "zonos--custom-message", spacing: "12px" }, h("div", { key: '7ec3cbde2204fe0fa3b52844109bf0379677d567', class: "zonos--flex-message" }, h("zonos-icon", { key: 'cad94039767bd3d93fe9995aee34e8eb42fb707c', "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { key: 'f5bd77fafded83fefd99c45f0a78cf5c72459e47', innerHTML: messageWithLinks }))))));
14
14
  }
15
15
  static get is() { return "zonos-custom-message"; }
16
16
  static get encapsulation() { return "shadow"; }
@@ -59,7 +59,7 @@ export class ZonosDialog {
59
59
  const borderStyle = getBorderRadius({
60
60
  overrideBorderStyle: this.borderStyle,
61
61
  });
62
- return (h(Host, { key: '018771d0e01311ae520abcf33fbd64316794b202', class: classes([
62
+ return (h(Host, { key: '03735385e07c7f6c8a87df42ad95f8c9d9533668', class: classes([
63
63
  'zonos--elements',
64
64
  this.open && 'open',
65
65
  this.isLoading && 'is-loading',
@@ -71,10 +71,10 @@ export class ZonosDialog {
71
71
  '--height': this.height || 'initial',
72
72
  '--min-height': this.minHeight || '500px',
73
73
  '--width': this.width,
74
- } }, h("div", { key: 'a86c9f8465054fde894bbdd71149e59d97e8cbcf', class: "zonos--backdrop" }), h("div", { key: 'b2f0c86fa0e768474ba4d522f8c2b8157f89cd56', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '26cd8a7b98d38c53dcf4789c8781f0c1ced99633', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '34d0ba841a9af9ca2ff6d21d0471113cc86cdec3', class: "zonos--loading" }, h("zonos-spinner", { key: '0109778b1a9734de0959035e3975414fb1cac1be', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: 'f80a4c337727500ee1ad92c1d80d7b3088eccc0f', class: "zonos--header" }, this.headerText && (h("h3", { key: '92b078fbbcd9ca5f8bf178fc67f2bee817d1e961', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: '698e45fffd466f22b6179aa220d35fe39ee5374c', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: 'a4012e5a48d5fbcc77cac038d8a39fe05f332008', class: classes([
74
+ } }, h("div", { key: 'da5d599e1a247f7e3364e6f5c9b2eae3db9539f5', class: "zonos--backdrop" }), h("div", { key: 'cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '471d8a069d4f580233bdb3e9e971efdb268ef57d', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '57220007aabcaef133c2c0782fa238cc43d63964', class: "zonos--loading" }, h("zonos-spinner", { key: '0298b754341abd61ec07706128d05df5332f915d', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: '5103dbc1c7593a8042505f767d8290825f9d10e7', class: "zonos--header" }, this.headerText && (h("h3", { key: 'a2d9cd4c8cb359aa64cf104a172ca960068c20a0', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: 'de9bf8a949344d19fcb8bfb496719282553be194', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: '1ec2cdca0f186cd0b28602580022ed0cb4b0eec9', class: classes([
75
75
  'zonos--body',
76
76
  this.noBodyPadding && 'zonos--no-body-padding',
77
- ]) }, h("slot", { key: 'd64b381cb91afde4ddbde58348a62612d9871c8e' })), h("slot", { key: '4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144', name: "dialog-footer" })))));
77
+ ]) }, h("slot", { key: '5071d921f48bf792a951a390d83b121e32771668' })), h("slot", { key: 'c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99', name: "dialog-footer" })))));
78
78
  }
79
79
  static get is() { return "zonos-dialog"; }
80
80
  static get encapsulation() { return "shadow"; }