@zonos/elements 1.3.218 → 1.3.220

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 (395) hide show
  1. package/dist/cjs/buildCartItemsByTempCart-309fcebf.js +28 -0
  2. package/dist/cjs/{cart-c54d05ce.js → cart-9a9ae4b9.js} +90 -47
  3. package/dist/cjs/cleanHtmlMarkdown-577d0a77.js +999 -0
  4. package/dist/cjs/index.cjs.js +19 -9
  5. package/dist/cjs/isCollectMobileTablet-7a9413e3.js +175 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/localization-0169b27d.js +738 -0
  8. package/dist/cjs/{paypal-d36b5dd1.js → paypal-9ee374a0.js} +12 -8
  9. package/dist/cjs/placeTestOrder-0dfff170.js +93 -0
  10. package/dist/cjs/{localization-ab7e1902.js → translationStore-0c67178f.js} +1023 -734
  11. package/dist/cjs/zonos-address_11.cjs.entry.js +116 -74
  12. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  13. package/dist/cjs/{zonos-banner.cjs.entry.js → zonos-banner_2.cjs.entry.js} +40 -0
  14. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  15. package/dist/cjs/{zonos-cart-items_14.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +70 -1292
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +25 -48
  17. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +92 -0
  19. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +811 -0
  20. package/dist/cjs/zonos-collect.cjs.entry.js +468 -0
  21. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +168 -0
  23. package/dist/cjs/zonos-controller.cjs.entry.js +84 -28
  24. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -1
  25. package/dist/cjs/zonos-country-select_4.cjs.entry.js +11 -10
  26. package/dist/cjs/zonos-elements.cjs.js +1 -1
  27. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +23 -5
  28. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +34 -33
  29. package/dist/cjs/zonos-hello.cjs.entry.js +8 -7
  30. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  31. package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -5
  32. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  33. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -5
  35. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  36. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  37. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  38. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  39. package/dist/collection/collection-manifest.json +10 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -1
  42. package/dist/collection/components/checkout/zonos-collect/assets/ChevronDownIcon.svg +1 -0
  43. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/assets/empty-item.jpeg +0 -0
  44. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.css +60 -0
  45. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +39 -0
  46. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/RemoveIcon.svg +1 -0
  47. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/SuccessIcon.svg +1 -0
  48. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.css +90 -0
  49. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +405 -0
  50. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/chevronDownIcon.svg +1 -0
  51. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/globe.svg +3 -0
  52. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconDark.svg +10 -0
  53. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconLight.svg +10 -0
  54. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosWordmark.svg +7 -0
  55. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +152 -0
  56. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +164 -0
  57. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronDownIcon.svg +1 -0
  58. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronUpIcon.svg +1 -0
  59. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.css +109 -0
  60. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +194 -0
  61. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/CheckmarkLineIcon.svg +1 -0
  62. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/RemoveLineIcon.svg +1 -0
  63. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.css +98 -0
  64. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +369 -0
  65. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.css +71 -0
  66. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +151 -0
  67. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.css +78 -0
  68. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +115 -0
  69. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +349 -0
  70. package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +547 -0
  71. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  72. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  73. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  74. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  75. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  76. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  77. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  78. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  79. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  80. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  81. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.css +38 -0
  82. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +63 -0
  83. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  84. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  85. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  86. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  87. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  88. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  89. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  90. package/dist/collection/components/common/zonos-skeleton/assets/RemoveLineIcon.svg +3 -0
  91. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.css +40 -0
  92. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +102 -0
  93. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +8 -5
  94. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  95. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  96. package/dist/collection/components/common/zonos-text/zonos-text.css +1 -0
  97. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  98. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  99. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  100. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  101. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  102. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  103. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  104. package/dist/collection/components/main/zonos-controller.js +91 -25
  105. package/dist/collection/components/paypal/zonos-paypal-payment.js +13 -2
  106. package/dist/collection/components/store/checkout/cart.js +36 -15
  107. package/dist/collection/components/store/checkout/collect.js +160 -0
  108. package/dist/collection/components/store/checkout/paypal.js +4 -2
  109. package/dist/collection/components/store/checkout/stripe.js +31 -12
  110. package/dist/collection/components/store/translationStore/strings.arabic.js +51 -0
  111. package/dist/collection/components/store/translationStore/strings.base.js +51 -0
  112. package/dist/collection/components/store/translationStore/strings.chinese.js +51 -0
  113. package/dist/collection/components/store/translationStore/strings.danish.js +51 -0
  114. package/dist/collection/components/store/translationStore/strings.dutch.js +51 -0
  115. package/dist/collection/components/store/translationStore/strings.french.js +51 -0
  116. package/dist/collection/components/store/translationStore/strings.german.js +51 -0
  117. package/dist/collection/components/store/translationStore/strings.hebrew.js +51 -0
  118. package/dist/collection/components/store/translationStore/strings.indonesian.js +51 -0
  119. package/dist/collection/components/store/translationStore/strings.italian.js +51 -0
  120. package/dist/collection/components/store/translationStore/strings.japanese.js +51 -0
  121. package/dist/collection/components/store/translationStore/strings.korean.js +51 -0
  122. package/dist/collection/components/store/translationStore/strings.norwegian.js +51 -0
  123. package/dist/collection/components/store/translationStore/strings.polish.js +51 -0
  124. package/dist/collection/components/store/translationStore/strings.portuguese.js +51 -0
  125. package/dist/collection/components/store/translationStore/strings.russian.js +51 -0
  126. package/dist/collection/components/store/translationStore/strings.spanish.js +51 -0
  127. package/dist/collection/components/store/translationStore/strings.swedish.js +51 -0
  128. package/dist/collection/components/store/translationStore/strings.turkish.js +51 -0
  129. package/dist/collection/components/store/translationStore/strings.vietnamese.js +51 -0
  130. package/dist/collection/components/store/translationStore.js +2 -1
  131. package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -18
  132. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  133. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  134. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -4
  135. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +9 -1
  136. package/dist/collection/components/utils/checkout/initCollect.js +15 -0
  137. package/dist/collection/components/utils/checkout/isCollectMobileTablet.js +10 -0
  138. package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -1
  139. package/dist/collection/components/utils/renderFallback.js +7 -0
  140. package/dist/collection/scripts/_getZonosQaUrl.js +5 -1
  141. package/dist/collection/scripts/_zonosBase.js +7 -1
  142. package/dist/collection/types/checkout/api/PartyInfo.js +1 -0
  143. package/dist/collection/types/generated/graphql.internal.types.js +113 -0
  144. package/dist/collection/types/index.js +1 -0
  145. package/dist/esm/buildCartItemsByTempCart-c4488f73.js +26 -0
  146. package/dist/esm/{cart-bb0ee971.js → cart-b2dd578c.js} +68 -27
  147. package/dist/esm/cleanHtmlMarkdown-b5b18743.js +997 -0
  148. package/dist/esm/index.js +19 -9
  149. package/dist/esm/isCollectMobileTablet-7f9a5e2b.js +168 -0
  150. package/dist/esm/loader.js +1 -1
  151. package/dist/esm/localization-d7125e4e.js +719 -0
  152. package/dist/esm/{paypal-bd4520eb.js → paypal-555bbf1e.js} +7 -4
  153. package/dist/esm/placeTestOrder-2d67c1a9.js +90 -0
  154. package/dist/esm/{localization-d8326254.js → translationStore-13502f49.js} +1023 -718
  155. package/dist/esm/zonos-address_11.entry.js +85 -43
  156. package/dist/esm/zonos-badge.entry.js +3 -3
  157. package/dist/esm/{zonos-banner.entry.js → zonos-banner_2.entry.js} +40 -1
  158. package/dist/esm/zonos-button_3.entry.js +3 -3
  159. package/dist/esm/{zonos-cart-items_14.entry.js → zonos-cart-items_12.entry.js} +20 -1240
  160. package/dist/esm/zonos-checkout.entry.js +6 -29
  161. package/dist/esm/zonos-collapse.entry.js +2 -2
  162. package/dist/esm/zonos-collect-cart-items_3.entry.js +86 -0
  163. package/dist/esm/zonos-collect-finish_6.entry.js +802 -0
  164. package/dist/esm/zonos-collect.entry.js +464 -0
  165. package/dist/esm/zonos-component.entry.js +1 -1
  166. package/dist/esm/zonos-confirm-dialog_2.entry.js +163 -0
  167. package/dist/esm/zonos-controller.entry.js +84 -28
  168. package/dist/esm/zonos-country-flag.entry.js +2 -1
  169. package/dist/esm/zonos-country-select_4.entry.js +11 -10
  170. package/dist/esm/zonos-elements.js +1 -1
  171. package/dist/esm/zonos-empty-state-payment_4.entry.js +23 -5
  172. package/dist/esm/zonos-hello-dialog.entry.js +6 -5
  173. package/dist/esm/zonos-hello.entry.js +2 -1
  174. package/dist/esm/zonos-input.entry.js +4 -4
  175. package/dist/esm/zonos-language-select_2.entry.js +6 -5
  176. package/dist/esm/zonos-link.entry.js +1 -1
  177. package/dist/esm/zonos-logo.entry.js +2 -2
  178. package/dist/esm/zonos-stripe-input.entry.js +9 -6
  179. package/dist/esm/zonos-text.entry.js +1 -1
  180. package/dist/esm/zonos-toggle.entry.js +2 -2
  181. package/dist/esm/zonos-tooltip.entry.js +2 -2
  182. package/dist/esm/zonos-v-stack.entry.js +2 -2
  183. package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +1 -0
  184. package/dist/esm-es5/cart-b2dd578c.js +1 -0
  185. package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +1 -0
  186. package/dist/esm-es5/index.js +1 -1
  187. package/dist/esm-es5/isCollectMobileTablet-7f9a5e2b.js +1 -0
  188. package/dist/esm-es5/loader.js +1 -1
  189. package/dist/esm-es5/localization-d7125e4e.js +1 -0
  190. package/dist/esm-es5/paypal-555bbf1e.js +17 -0
  191. package/dist/esm-es5/placeTestOrder-2d67c1a9.js +1 -0
  192. package/dist/esm-es5/translationStore-13502f49.js +1 -0
  193. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  194. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  195. package/dist/esm-es5/zonos-banner_2.entry.js +1 -0
  196. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  197. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  198. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  199. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  200. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -0
  201. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -0
  202. package/dist/esm-es5/zonos-collect.entry.js +1 -0
  203. package/dist/esm-es5/zonos-component.entry.js +1 -1
  204. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -0
  205. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  206. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  207. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  208. package/dist/esm-es5/zonos-elements.js +1 -1
  209. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  210. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  211. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  212. package/dist/esm-es5/zonos-input.entry.js +1 -1
  213. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  214. package/dist/esm-es5/zonos-link.entry.js +1 -1
  215. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  216. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  217. package/dist/esm-es5/zonos-text.entry.js +1 -1
  218. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  219. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  220. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  221. package/dist/scripts/index.d.ts +470 -2
  222. package/dist/scripts/index.js +1 -1
  223. package/dist/scripts/loadZonos.js +1 -1
  224. package/dist/scripts/zonos.js +1 -1
  225. package/dist/types/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.d.ts +4 -0
  226. package/dist/types/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.d.ts +50 -0
  227. package/dist/types/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.d.ts +25 -0
  228. package/dist/types/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.d.ts +29 -0
  229. package/dist/types/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.d.ts +62 -0
  230. package/dist/types/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.d.ts +22 -0
  231. package/dist/types/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.d.ts +10 -0
  232. package/dist/types/components/checkout/zonos-collect/zonos-collect.d.ts +86 -0
  233. package/dist/types/components/common/zonos-h-stack/zonos-h-stack.d.ts +9 -0
  234. package/dist/types/components/common/zonos-skeleton/zonos-skeleton.d.ts +17 -0
  235. package/dist/types/components/main/zonos-controller.d.ts +5 -0
  236. package/dist/types/components/paypal/zonos-paypal-payment.d.ts +3 -0
  237. package/dist/types/components/store/checkout/cart.d.ts +23 -3
  238. package/dist/types/components/store/checkout/collect.d.ts +21 -0
  239. package/dist/types/components/store/checkout/paypal.d.ts +4 -3
  240. package/dist/types/components/store/checkout/stripe.d.ts +6 -2
  241. package/dist/types/components/store/translationStore/strings.arabic.d.ts +51 -0
  242. package/dist/types/components/store/translationStore/strings.base.d.ts +51 -0
  243. package/dist/types/components/store/translationStore/strings.chinese.d.ts +51 -0
  244. package/dist/types/components/store/translationStore/strings.danish.d.ts +51 -0
  245. package/dist/types/components/store/translationStore/strings.dutch.d.ts +51 -0
  246. package/dist/types/components/store/translationStore/strings.french.d.ts +51 -0
  247. package/dist/types/components/store/translationStore/strings.german.d.ts +51 -0
  248. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +51 -0
  249. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +51 -0
  250. package/dist/types/components/store/translationStore/strings.italian.d.ts +51 -0
  251. package/dist/types/components/store/translationStore/strings.japanese.d.ts +51 -0
  252. package/dist/types/components/store/translationStore/strings.korean.d.ts +51 -0
  253. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +51 -0
  254. package/dist/types/components/store/translationStore/strings.polish.d.ts +51 -0
  255. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +51 -0
  256. package/dist/types/components/store/translationStore/strings.russian.d.ts +51 -0
  257. package/dist/types/components/store/translationStore/strings.spanish.d.ts +51 -0
  258. package/dist/types/components/store/translationStore/strings.swedish.d.ts +51 -0
  259. package/dist/types/components/store/translationStore/strings.turkish.d.ts +51 -0
  260. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +51 -0
  261. package/dist/types/components/store/translationStore.d.ts +2 -1
  262. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -2
  263. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +3 -1
  264. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  265. package/dist/types/components/utils/checkout/initCollect.d.ts +1 -0
  266. package/dist/types/components/utils/checkout/isCollectMobileTablet.d.ts +4 -0
  267. package/dist/types/components/utils/renderFallback.d.ts +6 -0
  268. package/dist/types/components.d.ts +401 -2
  269. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  270. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  271. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  272. package/dist/types/types/checkout/api/CreateParty.d.ts +24 -0
  273. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -1
  274. package/dist/types/types/checkout/api/PartyInfo.d.ts +24 -0
  275. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  276. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  277. package/dist/types/types/generated/graphql.internal.types.d.ts +616 -5
  278. package/dist/types/types/generated/graphql.internal.types.ts +626 -6
  279. package/dist/types/types/index.d.ts +1 -0
  280. package/dist/zonos-elements/index.esm.js +1 -1
  281. package/dist/zonos-elements/{p-7b5de646.entry.js → p-02667a58.entry.js} +1 -1
  282. package/dist/zonos-elements/p-031d646e.system.js +1 -0
  283. package/dist/zonos-elements/p-0e07e1d6.entry.js +1 -0
  284. package/dist/zonos-elements/p-0ef2a242.js +1 -0
  285. package/dist/zonos-elements/p-126087a2.system.entry.js +1 -0
  286. package/dist/zonos-elements/{p-c7d5d45d.entry.js → p-14f9bc8c.entry.js} +1 -1
  287. package/dist/zonos-elements/p-27d9abab.js +1 -0
  288. package/dist/zonos-elements/p-2813d72e.system.js +1 -0
  289. package/dist/zonos-elements/p-295d9c07.system.entry.js +1 -0
  290. package/dist/zonos-elements/p-29c80a34.js +1 -0
  291. package/dist/zonos-elements/p-2a6c964d.js +1 -0
  292. package/dist/zonos-elements/p-2b3c7c77.system.entry.js +1 -0
  293. package/dist/zonos-elements/p-2b8897d1.system.entry.js +1 -0
  294. package/dist/zonos-elements/{p-544c173a.system.entry.js → p-30432622.system.entry.js} +1 -1
  295. package/dist/zonos-elements/p-3462e9e4.system.entry.js +1 -0
  296. package/dist/zonos-elements/p-372c2fc5.entry.js +1 -0
  297. package/dist/zonos-elements/p-3c1b1be1.system.entry.js +1 -0
  298. package/dist/zonos-elements/p-40a4266f.js +1 -0
  299. package/dist/zonos-elements/{p-47ffacd8.system.entry.js → p-421dfb66.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-288761b1.system.entry.js → p-4f8563ad.system.entry.js} +1 -1
  301. package/dist/zonos-elements/p-52d35358.system.entry.js +1 -0
  302. package/dist/zonos-elements/p-567f7de7.entry.js +1 -0
  303. package/dist/zonos-elements/p-5d9410da.entry.js +1 -0
  304. package/dist/zonos-elements/p-637b22ee.system.entry.js +1 -0
  305. package/dist/zonos-elements/p-63a42823.entry.js +1 -0
  306. package/dist/zonos-elements/p-69451a50.system.js +1 -0
  307. package/dist/zonos-elements/p-6b3a0874.entry.js +1 -0
  308. package/dist/zonos-elements/p-73c1e91f.js +1 -0
  309. package/dist/zonos-elements/p-759ef3ca.entry.js +1 -0
  310. package/dist/zonos-elements/p-79d8c3f3.system.entry.js +1 -0
  311. package/dist/zonos-elements/{p-3f31901f.entry.js → p-7c4e7651.entry.js} +1 -1
  312. package/dist/zonos-elements/{p-1c45cd15.entry.js → p-7d2d2c94.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-1ac8bfbb.system.entry.js → p-7e5bd9af.system.entry.js} +1 -1
  314. package/dist/zonos-elements/p-7ecbb2cb.entry.js +1 -0
  315. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  316. package/dist/zonos-elements/p-82e88a33.system.js +1 -0
  317. package/dist/zonos-elements/p-849b47aa.entry.js +1 -0
  318. package/dist/zonos-elements/p-8dd47520.system.entry.js +1 -0
  319. package/dist/zonos-elements/p-932600b7.js +1 -0
  320. package/dist/zonos-elements/p-960e0ab1.system.entry.js +1 -0
  321. package/dist/zonos-elements/p-9c5b8239.system.js +1 -0
  322. package/dist/zonos-elements/{p-d55aec11.system.entry.js → p-9fdd3264.system.entry.js} +1 -1
  323. package/dist/zonos-elements/p-a08a005d.entry.js +1 -0
  324. package/dist/zonos-elements/p-a10de7fb.entry.js +1 -0
  325. package/dist/zonos-elements/p-a49b5e7f.system.entry.js +1 -0
  326. package/dist/zonos-elements/{p-62813488.entry.js → p-a5b0a636.entry.js} +1 -1
  327. package/dist/zonos-elements/p-a61a9b65.system.entry.js +1 -0
  328. package/dist/zonos-elements/{p-d6fa2dc2.entry.js → p-a77ed1b9.entry.js} +1 -1
  329. package/dist/zonos-elements/{p-eeb01de6.system.entry.js → p-a800965d.system.entry.js} +1 -1
  330. package/dist/zonos-elements/p-b2ae8eb7.system.js +1 -0
  331. package/dist/zonos-elements/p-b3d5bcf9.entry.js +1 -0
  332. package/dist/zonos-elements/{p-da4c01da.system.entry.js → p-b669050d.system.entry.js} +1 -1
  333. package/dist/zonos-elements/p-b9e9b82f.system.entry.js +1 -0
  334. package/dist/zonos-elements/{p-714c28b1.system.entry.js → p-ba18c5f5.system.entry.js} +1 -1
  335. package/dist/zonos-elements/p-bbf48b31.entry.js +1 -0
  336. package/dist/zonos-elements/{p-77666360.entry.js → p-c4b3c878.entry.js} +1 -1
  337. package/dist/zonos-elements/p-c7b57886.js +17 -0
  338. package/dist/zonos-elements/p-c803753e.entry.js +1 -0
  339. package/dist/zonos-elements/{p-e640e8b8.entry.js → p-cbb01de9.entry.js} +1 -1
  340. package/dist/zonos-elements/p-ce15d62d.system.js +1 -0
  341. package/dist/zonos-elements/p-d291e964.system.entry.js +1 -0
  342. package/dist/zonos-elements/p-d3485a03.system.js +1 -0
  343. package/dist/zonos-elements/{p-59eaebe3.system.entry.js → p-de626806.system.entry.js} +1 -1
  344. package/dist/zonos-elements/p-e5388438.system.entry.js +1 -0
  345. package/dist/zonos-elements/p-e77b6e42.entry.js +1 -0
  346. package/dist/zonos-elements/p-ea8aff21.system.js +17 -0
  347. package/dist/zonos-elements/{p-7ab62a26.system.entry.js → p-eb6a35ce.system.entry.js} +1 -1
  348. package/dist/zonos-elements/{p-92cc26b7.system.entry.js → p-ee6f8c02.system.entry.js} +1 -1
  349. package/dist/zonos-elements/{p-a98b1e8d.entry.js → p-efa6203f.entry.js} +1 -1
  350. package/dist/zonos-elements/{p-edc77ea1.entry.js → p-f4fa8720.entry.js} +1 -1
  351. package/dist/zonos-elements/{p-ebaaaee9.entry.js → p-fa90adb8.entry.js} +1 -1
  352. package/dist/zonos-elements/p-fe7e2dc4.entry.js +1 -0
  353. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  354. package/package.json +1 -1
  355. package/dist/cjs/zonos-card.cjs.entry.js +0 -49
  356. package/dist/esm/zonos-card.entry.js +0 -45
  357. package/dist/esm-es5/cart-bb0ee971.js +0 -1
  358. package/dist/esm-es5/localization-d8326254.js +0 -1
  359. package/dist/esm-es5/paypal-bd4520eb.js +0 -17
  360. package/dist/esm-es5/zonos-banner.entry.js +0 -1
  361. package/dist/esm-es5/zonos-card.entry.js +0 -1
  362. package/dist/esm-es5/zonos-cart-items_14.entry.js +0 -1
  363. package/dist/zonos-elements/p-043f57e8.system.entry.js +0 -1
  364. package/dist/zonos-elements/p-0631d2b9.js +0 -1
  365. package/dist/zonos-elements/p-0a6ac265.system.js +0 -1
  366. package/dist/zonos-elements/p-0f041dc5.system.entry.js +0 -1
  367. package/dist/zonos-elements/p-1432a217.system.entry.js +0 -1
  368. package/dist/zonos-elements/p-1b51b738.system.entry.js +0 -1
  369. package/dist/zonos-elements/p-3a1513ae.system.entry.js +0 -1
  370. package/dist/zonos-elements/p-3b8d11dd.entry.js +0 -1
  371. package/dist/zonos-elements/p-4333afcb.entry.js +0 -1
  372. package/dist/zonos-elements/p-4d0d89da.system.entry.js +0 -1
  373. package/dist/zonos-elements/p-5dd9cb44.system.entry.js +0 -1
  374. package/dist/zonos-elements/p-605a21ac.entry.js +0 -1
  375. package/dist/zonos-elements/p-674981ad.system.js +0 -1
  376. package/dist/zonos-elements/p-6d090b53.entry.js +0 -1
  377. package/dist/zonos-elements/p-73c8c551.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-795d223d.entry.js +0 -1
  379. package/dist/zonos-elements/p-8218ff62.system.entry.js +0 -1
  380. package/dist/zonos-elements/p-82f80c8a.entry.js +0 -1
  381. package/dist/zonos-elements/p-88f7256d.js +0 -1
  382. package/dist/zonos-elements/p-8b083884.entry.js +0 -1
  383. package/dist/zonos-elements/p-a449940d.entry.js +0 -1
  384. package/dist/zonos-elements/p-a5a4ad2f.entry.js +0 -1
  385. package/dist/zonos-elements/p-a5d45585.system.entry.js +0 -1
  386. package/dist/zonos-elements/p-a751e819.system.entry.js +0 -1
  387. package/dist/zonos-elements/p-ad556be6.entry.js +0 -1
  388. package/dist/zonos-elements/p-b4792af0.entry.js +0 -1
  389. package/dist/zonos-elements/p-b9ff6458.entry.js +0 -1
  390. package/dist/zonos-elements/p-d3dbae8c.system.js +0 -1
  391. package/dist/zonos-elements/p-ebb9b902.system.js +0 -17
  392. package/dist/zonos-elements/p-ef1ce617.system.entry.js +0 -1
  393. package/dist/zonos-elements/p-ef75da6f.js +0 -17
  394. package/dist/zonos-elements/p-f3dbe934.entry.js +0 -1
  395. package/dist/zonos-elements/p-f741407e.system.entry.js +0 -1
@@ -0,0 +1,802 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-55a03023.js';
2
+ import { c as stripeStore, d as stripeStoreRetrievePayment, t as trackConversionEvent, G as stripeStoreResetPromoCode, y as stripeStoreReset, H as stripeStoreMessageBasedOnStatus, e as cartStore, r as cartStoreNextStep, K as cartStoreOnChange } from './cart-b2dd578c.js';
3
+ import { s as submitGtag, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-555bbf1e.js';
4
+ import { s as storageStore, l as localizationStore } from './localization-d7125e4e.js';
5
+ import { t as translate, b as translationStoreOnChange } from './translationStore-13502f49.js';
6
+ import { z as zonosStore } from './zonosStore-c456b933.js';
7
+ import { h as handleFetch, l as log, s as sendErrorLog, d as allLogs, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-99218189.js';
8
+ import { c as createCustomEvent } from './createCustomEvent-58159025.js';
9
+ import { g as getBorderRadius } from './getBorderRadius-87593ff4.js';
10
+ import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-7f9a5e2b.js';
11
+ import { c as classes } from './classes-0d95c529.js';
12
+ import { l as languages } from './ILanguage-cd6acb72.js';
13
+ import { r as renderCheckoutCurrency, p as placeTestOrder } from './placeTestOrder-2d67c1a9.js';
14
+ import './isDarkColor-1f58b6be.js';
15
+ import './VarianceTest-fef2d958.js';
16
+
17
+ const RemoveIcon = `<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
18
+
19
+ const SuccessIcon = `<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
20
+
21
+ const zonosCollectFinishCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";
22
+ const ZonosCollectFinishStyle0 = zonosCollectFinishCss;
23
+
24
+ /**
25
+ * Maximum number of retries to pull order info (gap between each retry is 1 second)
26
+ */
27
+ const MAX_RETRIES = 30;
28
+ const ZonosCollectFinish = class {
29
+ constructor(hostRef) {
30
+ registerInstance(this, hostRef);
31
+ this.closeClick = createEvent(this, "closeClick", 7);
32
+ /**
33
+ * The border radius style of the dialog
34
+ */
35
+ this.borderRadius = 'ROUNDED';
36
+ /**
37
+ * The confirmation id for the collect order
38
+ */
39
+ this.confirmationId = null;
40
+ this.isLoading = true;
41
+ this.notificationType = 'success';
42
+ this.notificationTitle = '';
43
+ this.notificationMessages = [];
44
+ this.notificationActionText = translate('Keep shopping');
45
+ this.order = null;
46
+ /**
47
+ * Is waiting to redirect to a different page
48
+ */
49
+ this.isWaitingToRedirect = true;
50
+ this.pullOrder = async () => {
51
+ var _a, _b;
52
+ const checkoutSessionId = storageStore.checkoutSessionId;
53
+ const searchParams = new URLSearchParams();
54
+ searchParams.set('checkoutSessionId', checkoutSessionId || '');
55
+ const { baseUrl, errors, json } = await handleFetch(`/api/zonos-elements/get-order?${searchParams.toString()}`);
56
+ if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
57
+ return {
58
+ baseUrl,
59
+ order: null,
60
+ };
61
+ }
62
+ // onOrderSuccess callback may be provided on Zonos.init
63
+ await ((_b = (_a = zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, {
64
+ zonosApiRoute: baseUrl,
65
+ zonosOrder: json,
66
+ }));
67
+ return {
68
+ baseUrl,
69
+ order: json,
70
+ };
71
+ };
72
+ this.handleSuccessBehavior = async () => {
73
+ // Do nothing, display Zonos success page
74
+ this.isLoading = false;
75
+ await this.getPullOrder();
76
+ };
77
+ // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
78
+ this.getPullOrder = async (attempts = 0) => {
79
+ var _a, _b;
80
+ if (attempts === 0) {
81
+ log('=== Start to poll for order info', 'info');
82
+ }
83
+ const { baseUrl, order } = await this.pullOrder();
84
+ const foundLegacyOrderNumber = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
85
+ const checkoutSessionId = storageStore.checkoutSessionId;
86
+ const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
87
+ '0') || MAX_RETRIES;
88
+ log(`=== Polling order (${attempts} attemps)`, 'info');
89
+ if (
90
+ // Order found, in legacy checkout facade and still haven't found the legacy order number
91
+ order) {
92
+ log('=== CollectOrder info found', 'info');
93
+ if (attempts > 10) {
94
+ // Log out all the logs if we have tried more than 10 times
95
+ void sendErrorLog({
96
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
97
+ errors: [`Collect order found after ${attempts} attempts`],
98
+ metadata: {
99
+ allLogs,
100
+ checkoutSessionId: storageStore.checkoutSessionId || '',
101
+ orderId: order.id,
102
+ storeId: zonosStore.storeId,
103
+ },
104
+ });
105
+ }
106
+ this.order = order;
107
+ }
108
+ else if ((!order || !foundLegacyOrderNumber) && attempts < maxRetries) {
109
+ // Wait for 1 second before the next attempt
110
+ await new Promise(resolve => setTimeout(resolve, 1000));
111
+ await this.getPullOrder(attempts + 1);
112
+ }
113
+ else {
114
+ void sendErrorLog({
115
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
116
+ errors: [`Collect order not found after ${maxRetries} attempts`],
117
+ metadata: {
118
+ allLogs,
119
+ checkoutSessionId: storageStore.checkoutSessionId || '',
120
+ storeId: zonosStore.storeId,
121
+ },
122
+ });
123
+ }
124
+ };
125
+ this.checkStripePaymentStatus = async () => {
126
+ const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
127
+ if (clientSecret || this.storybookForceStatus) {
128
+ const { error, messages, status } = await stripeStoreRetrievePayment({
129
+ clientSecret,
130
+ storybookForceStatus: this.storybookForceStatus,
131
+ });
132
+ const isError = status === 'requires_action' || error;
133
+ this.notificationType = isError ? 'error' : 'success';
134
+ this.notificationMessages = messages || [];
135
+ this.notificationTitle = isError
136
+ ? translate('Payment failed')
137
+ : translate("You're all set!");
138
+ log('=== Payment intent retrieve status', 'info', {
139
+ clientSecret,
140
+ error,
141
+ messages,
142
+ status,
143
+ });
144
+ // remove the client secret from the url
145
+ const url = new URL(window.location.href);
146
+ url.searchParams.delete('payment_intent_client_secret');
147
+ url.searchParams.delete('payment_intent');
148
+ url.searchParams.delete('redirect_status');
149
+ // Clean up the url if it's a redirect behavior
150
+ url.searchParams.delete('zonosCheckoutSessionId');
151
+ window.history.replaceState({}, '', url.toString());
152
+ // Payment doesn't go through
153
+ if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
154
+ submitGtag('zonos-checkout-payment-fail');
155
+ void sendErrorLog({
156
+ endpoint: 'Stripe payment failed',
157
+ errors: [
158
+ `Payment intent "${clientSecret.split('_secret_')[0] || clientSecret}" status: ${status} - checkout session: ${storageStore.checkoutSessionId}`,
159
+ ],
160
+ metadata: {
161
+ allLogs,
162
+ credentialToken: window.Zonos.zonosApiKey,
163
+ },
164
+ });
165
+ }
166
+ else {
167
+ submitGtag('zonos-checkout-success');
168
+ const checkoutSessionId = storageStore.checkoutSessionId;
169
+ void trackConversionEvent({
170
+ checkoutSessionId,
171
+ eventName: 'checkout_orderCompleted',
172
+ });
173
+ const successEvent = createCustomEvent('zonos-checkout-success', {
174
+ message: 'Zonos Checkout successfully processed order',
175
+ });
176
+ document.dispatchEvent(successEvent);
177
+ // wait this to finish before resetting store and checkout session id
178
+ await this.handleSuccessBehavior();
179
+ }
180
+ }
181
+ // Make sure to stop the loading spinner even when there's an error
182
+ this.isLoading = false;
183
+ // reset promo when checkout is finished
184
+ stripeStoreResetPromoCode();
185
+ stripeStoreReset();
186
+ storageStore.checkoutSessionId = null;
187
+ };
188
+ this.checkStagingOrderStatus = async () => {
189
+ this.notificationType = 'success';
190
+ this.notificationTitle = translate("You're all set!");
191
+ this.notificationMessages =
192
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
193
+ await this.handleSuccessBehavior();
194
+ // reset promo when checkout is finished
195
+ stripeStoreResetPromoCode();
196
+ stripeStoreReset();
197
+ paypalStoreReset();
198
+ storageStore.checkoutSessionId = null;
199
+ };
200
+ this.checkPaypalPaymentStatus = async () => {
201
+ // render error message if there's an error
202
+ if (paypalStore.paypalErrorMessage) {
203
+ this.notificationType = 'error';
204
+ this.notificationTitle = translate('Payment failed');
205
+ this.notificationMessages = [paypalStore.paypalErrorMessage];
206
+ this.isLoading = false;
207
+ return;
208
+ }
209
+ // show success message right away when order id is already created
210
+ this.isLoading = false;
211
+ if (paypalStore.orderIdCreated) {
212
+ submitGtag('zonos-checkout-success');
213
+ const checkoutSessionId = storageStore.checkoutSessionId;
214
+ void trackConversionEvent({
215
+ checkoutSessionId,
216
+ eventName: 'checkout_orderCompleted',
217
+ });
218
+ this.notificationType = 'success';
219
+ this.notificationTitle = translate("You're all set!");
220
+ this.notificationMessages =
221
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
222
+ // wait this to finish before resetting store and checkout session id
223
+ await this.handleSuccessBehavior();
224
+ }
225
+ // reset promo when checkout is finished
226
+ stripeStoreResetPromoCode();
227
+ stripeStoreReset();
228
+ paypalStoreReset();
229
+ storageStore.checkoutSessionId = null;
230
+ };
231
+ this.getReceiptUrl = ({ cartId }) => {
232
+ const hostUrl = new URL(`${window.location.origin}/receipt`);
233
+ hostUrl.searchParams.set('referenceId', cartId);
234
+ // is test mode
235
+ const isTestMode = getIsTestMode();
236
+ if (isTestMode) {
237
+ hostUrl.searchParams.set('zonosTestMode', '1');
238
+ }
239
+ // Carry over the zonosQaUrl if it exists
240
+ const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
241
+ if (zonosQaUrl) {
242
+ hostUrl.searchParams.set('zonosQaUrl', zonosQaUrl);
243
+ }
244
+ return hostUrl.toString();
245
+ };
246
+ }
247
+ componentDidLoad() {
248
+ if (this.overrideNotification) {
249
+ // just show the notification and don't check any of the payment status
250
+ this.notificationType = this.overrideNotification.type;
251
+ this.notificationTitle = this.overrideNotification.title;
252
+ this.notificationMessages = this.overrideNotification.messages;
253
+ this.isLoading = false;
254
+ return;
255
+ }
256
+ if (cartStore.isStagingMode) {
257
+ void this.checkStagingOrderStatus();
258
+ }
259
+ else if (paypalStore.orderIdCreated) {
260
+ void this.checkPaypalPaymentStatus();
261
+ }
262
+ else {
263
+ void this.checkStripePaymentStatus();
264
+ }
265
+ }
266
+ render() {
267
+ const cartId = window.Zonos.cartId;
268
+ return (h(Host, { key: 'e145b7396302157ccb515c54f99e50faa8ba45e6', class: "zonos--checkout-finish zonos--elements", style: {
269
+ '--zonos--border-radius': getBorderRadius({
270
+ overrideBorderStyle: this.borderRadius,
271
+ }),
272
+ } }, !this.isLoading && (h("div", { key: 'b9df4788f27c935ba7fc47e7c930cd162c8fbebe', class: "zonos--finish-details" }, h("div", { key: 'a510c995880c8698dc98390d0504b70333551c86', 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: '8f84f87bf2365b85acffefe16e8b10cd9227a6e6', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (h("zonos-badge", { key: '0e3f3f71cae6262d6394ad2c5a6d656509b484d5', badgeColor: "gray" }, this.confirmationId)), h("zonos-text", { key: 'c769f2ada1e6b421e373aeb4393560a21d6fcffc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.order && cartId && (h("div", { key: '9972858fadd4d2d9c4f00e54921002ea04a5cc51', class: "zonos--button-container" }, h("zonos-button", { key: 'fe931a552fc1c43b29a1966736379c3c1d0536f6', onClick: () => {
273
+ window.open(this.getReceiptUrl({ cartId }), '_blank');
274
+ }, size: "lg", variant: "primary" }, translate('View receipt')))))))));
275
+ }
276
+ static get assetsDirs() { return ["assets"]; }
277
+ };
278
+ ZonosCollectFinish.style = ZonosCollectFinishStyle0;
279
+
280
+ const Globe = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">
281
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>
282
+ </svg>
283
+ `;
284
+
285
+ const ZonosWordmark = `<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">
286
+ <path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>
287
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>
288
+ <path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>
289
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>
290
+ <path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>
291
+ </svg>
292
+ `;
293
+
294
+ const zonosCollectFooterCss = ":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{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";
295
+ const ZonosCollectFooterStyle0 = zonosCollectFooterCss;
296
+
297
+ const ZonosCollectFooter = class {
298
+ constructor(hostRef) {
299
+ registerInstance(this, hostRef);
300
+ /**
301
+ * Override mobile mode
302
+ */
303
+ this.mobile = false;
304
+ /**
305
+ * Override tablet mode
306
+ */
307
+ this.tablet = false;
308
+ this.showLanguageDialog = false;
309
+ this.isMobile = false;
310
+ this.isTablet = false;
311
+ }
312
+ handleGlobalClick(e) {
313
+ if (!this.el.contains(e.target) && this.showLanguageDialog) {
314
+ this.showLanguageDialog = false;
315
+ }
316
+ }
317
+ toggleLanguageDialog() {
318
+ this.showLanguageDialog = !this.showLanguageDialog;
319
+ }
320
+ handleMobileChange() {
321
+ this.isMobile = isCollectMobile(this.mobile);
322
+ }
323
+ handleTabletChange() {
324
+ this.isTablet = isCollectTablet(this.tablet);
325
+ }
326
+ componentWillLoad() {
327
+ this.isMobile = isCollectMobile(this.mobile);
328
+ this.isTablet = isCollectTablet(this.tablet);
329
+ }
330
+ render() {
331
+ var _a;
332
+ const languageLabel = (_a = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
333
+ // reverse color when on desktop. With the coversheet backdrop, the color should be white
334
+ const colorDesktop = 'gray-1000';
335
+ return (h(Host, { key: '9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e', class: classes([
336
+ 'zonos--elements',
337
+ this.isMobile && 'mobile',
338
+ this.isTablet && 'tablet',
339
+ ]) }, h("div", { key: '250716798bf30901678b16e1ac159810f1d7a6ad', class: "zonos--collect-footer" }, h("div", { key: 'ab61803d4b5348b8978e7dfcb16a5733cca5dd29', class: "zonos--collect-locale-wrapper" }, h("zonos-button", { key: '6c5dcd25d5ef73b2098269d840e291343d30cb81', buttonColor: colorDesktop, class: "zonos--collect-footer-language-button", icon: h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), h("div", { key: 'd1a367cd19b36f1a0f49ccfe78e750218b50a03e', class: classes([
340
+ 'zonos--collect-language-dialog',
341
+ this.showLanguageDialog &&
342
+ 'zonos--collect-language-dialog-open',
343
+ ]) }, h("zonos-language-select", { key: '02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c', handleOnClose: () => this.toggleLanguageDialog() }))), h("div", { key: 'b713a78cbd3d3f131c6c473bb1d979899d40b13b', class: "zonos--collect-footer-icon-wrapper" }, h("div", { key: '97eab5909d556f13fa2acc0628d583d49f13d3a2', class: "zonos--collect-footer-logo" }, h("zonos-text", { key: 'a6488e084f153305eed8d6f65341d7ab00297adb', textColor: colorDesktop }, "Powered by"), h("a", { key: 'c63a6e1064dbd733add1cc3b1df1456484e2f103', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7', autoHeight: true, content: ZonosWordmark, size: 42 }))), h("div", { key: '0862a11838e62f425d38066230b01f445999d751', class: "dot" }), h("a", { key: 'b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, h("zonos-text", { key: 'a675218a36da83427c2ce517a15b1ed5ea5910d6', textColor: colorDesktop }, "Privacy policy"))))));
344
+ }
345
+ get el() { return getElement(this); }
346
+ static get watchers() { return {
347
+ "mobile": ["handleMobileChange"],
348
+ "tablet": ["handleTabletChange"]
349
+ }; }
350
+ };
351
+ ZonosCollectFooter.style = ZonosCollectFooterStyle0;
352
+
353
+ const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
354
+
355
+ const ChevronUpIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
356
+
357
+ const zonosCollectOrderDetailsCss = ":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";
358
+ const ZonosCollectOrderDetailsStyle0 = zonosCollectOrderDetailsCss;
359
+
360
+ const ZonosCollectOrderDetails = class {
361
+ constructor(hostRef) {
362
+ registerInstance(this, hostRef);
363
+ this.collapseClicked = createEvent(this, "collapseClicked", 7);
364
+ /**
365
+ * Whether or not the component is being rendered with mobile styles
366
+ */
367
+ this.mobile = true;
368
+ /**
369
+ * The landed cost id that is used to fetch the shipping address
370
+ */
371
+ this.landedCostId = '';
372
+ this.isMobile = false;
373
+ this.collapseState = this.collapsed;
374
+ }
375
+ handleCollapseChangeFromProp(collapsed) {
376
+ this.collapseState = collapsed;
377
+ }
378
+ handleCollapseChange(collapsed) {
379
+ this.collapseClicked.emit(collapsed);
380
+ }
381
+ handleWindowResize() {
382
+ this.isMobile = isCheckoutMobile(this.mobile);
383
+ }
384
+ componentWillLoad() {
385
+ this.handleWindowResize();
386
+ }
387
+ renderShippingAddress() {
388
+ if (collectStore.isFetchingShippingInfo) {
389
+ return (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, h("zonos-skeleton", { skeletonWidth: "99px" })), h("div", { class: "zonos--collect-order-shipping-info" }, h("zonos-skeleton", { skeletonWidth: "152px" }), h("zonos-h-stack", { spacing: 8 }, h("zonos-skeleton", { skeletonWidth: "75px" }), h("zonos-skeleton", { skeletonWidth: "75px" })), h("zonos-skeleton", { skeletonWidth: "50px" }))));
390
+ }
391
+ const shippingAddress = collectStore.shippingAddress;
392
+ if (!shippingAddress) {
393
+ return null;
394
+ }
395
+ return (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Shipping address')), h("div", { class: "zonos--collect-order-shipping-info" }, [
396
+ [shippingAddress.location.line1, shippingAddress.location.line2]
397
+ .filter(Boolean)
398
+ .join(' '),
399
+ [
400
+ shippingAddress.location.locality,
401
+ shippingAddress.location.administrativeAreaCode,
402
+ shippingAddress.location.postalCode,
403
+ ]
404
+ .filter(Boolean)
405
+ .join(', '),
406
+ shippingAddress.location.countryCode,
407
+ ].map(item => (h("zonos-text", null, item))))));
408
+ }
409
+ render() {
410
+ const renderCollapseIcon = () => {
411
+ if (this.collapseState) {
412
+ return (h("zonos-icon", { "aria-label": "Collapse expanded section", content: ChevronDownIcon, iconColor: "gray-1200" }));
413
+ }
414
+ return (h("zonos-icon", { "aria-label": "Expand collapsed section", content: ChevronUpIcon, iconColor: "gray-1200" }));
415
+ };
416
+ return (h(Host, { class: classes([
417
+ 'zonos--collect-order-details zonos--elements',
418
+ this.isMobile && 'mobile',
419
+ ]) }, h("div", { class: "zonos--wrapper" }, h("button", { class: "zonos--order-details-header", onClick: () => {
420
+ this.collapseState = !this.collapseState;
421
+ }, type: "button" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Order details')), renderCollapseIcon()), h("div", { class: "zonos--order-details-wrapper" }, h("zonos-collapse", { collapsed: this.collapseState }, h("div", { class: "zonos--collect-order-details-content" }, h("zonos-collect-cart-items", null), h("div", { class: "zonos--collect-order-info" }, h("div", { class: "zonos--collect-order-details-row" }, collectStore.amountTotalPaid !== null && (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Total paid')), h("zonos-text", null, renderCheckoutCurrency({
422
+ amount: collectStore.amountTotalPaid || 0,
423
+ isForeign: true,
424
+ })))), collectStore.originCompanyName && (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Ordered from')), h("zonos-text", null, collectStore.originCompanyName || '')))), this.renderShippingAddress())))))));
425
+ }
426
+ static get assetsDirs() { return ["assets"]; }
427
+ static get watchers() { return {
428
+ "collapsed": ["handleCollapseChangeFromProp"],
429
+ "collapseState": ["handleCollapseChange"]
430
+ }; }
431
+ };
432
+ ZonosCollectOrderDetails.style = ZonosCollectOrderDetailsStyle0;
433
+
434
+ const CheckmarkLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
435
+
436
+ const RemoveLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
437
+
438
+ const zonosCollectPaymentCss = ".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-5px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";
439
+ const ZonosCollectPaymentStyle0 = zonosCollectPaymentCss;
440
+
441
+ const ZonosCollectPayment = class {
442
+ constructor(hostRef) {
443
+ registerInstance(this, hostRef);
444
+ this.continueClicked = createEvent(this, "continueClicked", 7);
445
+ this.paypalSessionFailed = createEvent(this, "paypalSessionFailed", 7);
446
+ this.paypalSessionDone = createEvent(this, "paypalSessionDone", 7);
447
+ this.storeUnsubscribeList = [];
448
+ /**
449
+ * Whether or not the continue button is loading
450
+ */
451
+ this.continueLoading = false;
452
+ /**
453
+ * Show error banner when the form is not complete, and user clicks on `Submit` button
454
+ * @default false
455
+ */
456
+ this.showErrorBanner = false;
457
+ /**
458
+ * Show payment error banner when the payment is failed
459
+ */
460
+ this.hasStripePaymentError = false;
461
+ /**
462
+ * Error message when the staging order creation is failed
463
+ */
464
+ this.stagingOrderCreateErrorMessage = '';
465
+ /**
466
+ * Internal state to handle continue loading
467
+ */
468
+ this.internalContinueLoading = this.continueLoading;
469
+ this.handleValidate = () => {
470
+ var _a;
471
+ return !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
472
+ };
473
+ /**
474
+ * handler for continue button click
475
+ */
476
+ this.continueClickHandler = async ({ currencyCode, }) => {
477
+ var _a, _b;
478
+ if (!this.handleValidate()) {
479
+ // Attempt to get the value of the billing address element to validate the form
480
+ void ((_a = stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
481
+ this.showErrorBanner = true;
482
+ // Attempt to submit the form so the missing input error will be shown in Stripe
483
+ void ((_b = stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
484
+ setTimeout(() => {
485
+ var _a;
486
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
487
+ behavior: 'smooth',
488
+ });
489
+ }, 10);
490
+ return;
491
+ }
492
+ stripeStore.checkoutSettlementCurrency = currencyCode;
493
+ // submit google tag when the form is complete
494
+ submitGtag('zonos-checkout-payment-info');
495
+ this.continueClicked.emit();
496
+ };
497
+ this.copyCardToClipboard = async (cardNumber) => {
498
+ try {
499
+ await navigator.clipboard.writeText(cardNumber);
500
+ }
501
+ catch (_a) {
502
+ // Copy happens in the iframe and it's not allowed to copy to the clipboard
503
+ const hiddenTextarea = document.createElement('textarea');
504
+ hiddenTextarea.style.position = 'fixed';
505
+ hiddenTextarea.style.left = '-1000px';
506
+ hiddenTextarea.style.top = '-1000px';
507
+ hiddenTextarea.style.width = '1px';
508
+ hiddenTextarea.style.height = '1px';
509
+ hiddenTextarea.value = cardNumber;
510
+ hiddenTextarea.id = 'zonos-copy-card-number';
511
+ document.body.appendChild(hiddenTextarea);
512
+ hiddenTextarea.select();
513
+ // Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
514
+ // eslint-disable-next-line deprecation/deprecation
515
+ document.execCommand('copy');
516
+ document.body.removeChild(hiddenTextarea);
517
+ }
518
+ window.Zonos.showNotification({
519
+ message: translate('Card number copied to clipboard'),
520
+ timeout: 4000,
521
+ type: 'success',
522
+ });
523
+ };
524
+ this.placeTestOrder = async () => {
525
+ this.internalContinueLoading = true;
526
+ const { errors } = await placeTestOrder();
527
+ if (errors.length) {
528
+ this.stagingOrderCreateErrorMessage =
529
+ errors[0] || 'Failed to create staging order. Please try again.';
530
+ this.internalContinueLoading = false;
531
+ return;
532
+ }
533
+ this.internalContinueLoading = false;
534
+ // continue to the next step
535
+ cartStoreNextStep();
536
+ };
537
+ }
538
+ continueLoadingWatcher() {
539
+ this.internalContinueLoading = this.continueLoading;
540
+ }
541
+ stripePaymentErrorWatcher() {
542
+ if (this.hasStripePaymentError) {
543
+ setTimeout(() => {
544
+ var _a;
545
+ // scroll to the top of the page when the payment error is shown
546
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
547
+ behavior: 'smooth',
548
+ });
549
+ }, 50);
550
+ }
551
+ }
552
+ componentWillLoad() {
553
+ this.storeUnsubscribeList = [
554
+ cartStoreOnChange('currency', () => {
555
+ // start init paypal with the presentment currency when landed cost is fetched
556
+ void paypalInitScript({
557
+ currency: cartStore.currency,
558
+ });
559
+ }),
560
+ ];
561
+ // start init paypal with the presentment currency when landed cost is fetched
562
+ void paypalInitScript({
563
+ currency: cartStore.currency,
564
+ });
565
+ }
566
+ disconnectedCallback() {
567
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
568
+ }
569
+ render() {
570
+ var _a;
571
+ this.hasStripePaymentError = stripeStore.hasPaymentError;
572
+ if (!stripeStore.stripeElements) {
573
+ return null;
574
+ }
575
+ if (!stripeStore.clientSecret) {
576
+ return null;
577
+ }
578
+ // start validate on typing after error banner is shown, and hide it if the form is complete
579
+ if (this.showErrorBanner) {
580
+ this.showErrorBanner = !this.handleValidate();
581
+ }
582
+ const isTestMode = getIsTestMode();
583
+ const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
584
+ const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
585
+ const renderPayment = () => {
586
+ if (isStagingMode) {
587
+ // If in mobile, use the theme from the store since the UI is solely by theme
588
+ const theme = zonosStore.appearance.theme;
589
+ return (h(Fragment, null, this.stagingOrderCreateErrorMessage && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), h("zonos-empty-state-payment", { emptyStateText: translate('No payment method needed for staging'), theme: theme }), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
590
+ void this.placeTestOrder();
591
+ }, size: "lg",
592
+ // use primary type when on mobile mode
593
+ variant: this.submitBtnType }, translate('Place test order')))));
594
+ }
595
+ if (stripeStore.isFetchingSession ||
596
+ collectStore.isFetchingShippingInfo) {
597
+ return null;
598
+ }
599
+ return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
600
+ 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" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
601
+ stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
602
+ stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
603
+ if (!cartStore.checkoutSession) {
604
+ log('Checkout session is not found');
605
+ return;
606
+ }
607
+ await this.continueClickHandler({
608
+ currencyCode: cartStore.checkoutSession.subtotals
609
+ .presentmentCurrencyCode,
610
+ });
611
+ }, size: "lg",
612
+ // use primary type when on mobile mode
613
+ variant: this.submitBtnType }, translate('Pay [orderTotal]', {
614
+ orderTotal: renderCheckoutCurrency({
615
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
616
+ isForeign: true,
617
+ }),
618
+ })), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
619
+ stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
620
+ stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
621
+ await this.continueClickHandler({
622
+ currencyCode: 'USD',
623
+ });
624
+ }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
625
+ this.paypalSessionDone.emit(orderId);
626
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
627
+ display: isPaypalTabSelected ? 'block' : 'none',
628
+ } })), 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)))));
629
+ };
630
+ 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')), renderPayment())));
631
+ }
632
+ get ele() { return getElement(this); }
633
+ static get watchers() { return {
634
+ "continueLoading": ["continueLoadingWatcher"],
635
+ "hasStripePaymentError": ["stripePaymentErrorWatcher"]
636
+ }; }
637
+ };
638
+ ZonosCollectPayment.style = ZonosCollectPaymentStyle0;
639
+
640
+ const renderFallback = ({ content, isLoading, skeletonHeight, skeletonWidth, }) => {
641
+ if (isLoading) {
642
+ return (h("zonos-skeleton", { skeletonHeight: skeletonHeight, skeletonWidth: skeletonWidth }));
643
+ }
644
+ return content;
645
+ };
646
+
647
+ const zonosCollectReviewCss = ":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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:\"\";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}";
648
+ const ZonosCollectReviewStyle0 = zonosCollectReviewCss;
649
+
650
+ const ZonosCollectReview = class {
651
+ constructor(hostRef) {
652
+ registerInstance(this, hostRef);
653
+ /**
654
+ * Whether or not the component is being rendered with mobile styles
655
+ */
656
+ this.mobile = false;
657
+ /**
658
+ * Whether or not the component is being rendered with tablet styles
659
+ */
660
+ this.tablet = false;
661
+ /**
662
+ * Whether or not to show the collapse icon
663
+ * This is controled from the collapsed state of the zonos-collapse component
664
+ * to show the collapse icon
665
+ */
666
+ this.collapsed = false;
667
+ this.isMobile = false;
668
+ this.isTablet = false;
669
+ this.isLoading = true;
670
+ }
671
+ handleWindowResize() {
672
+ this.isMobile = isCollectMobile(this.mobile);
673
+ this.isTablet = isCollectTablet(this.tablet);
674
+ }
675
+ componentWillLoad() {
676
+ this.handleWindowResize();
677
+ // Wait for the data to load
678
+ setTimeout(() => {
679
+ this.isLoading = false;
680
+ }, 1000);
681
+ }
682
+ render() {
683
+ const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
684
+ return (h(Host, { key: '6432c5dd5afd628e33ba26385ecfecb470f1757e', class: classes([
685
+ 'zonos--collect-review zonos--elements',
686
+ this.isMobile && 'mobile',
687
+ this.isTablet && 'tablet',
688
+ ]) }, h("div", { key: 'e4d113ff1268c36119e1f80164b6cfd702c67f75', class: "zonos--title" }, h("zonos-text", { key: 'aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1', textColor: titleTextColor, type: 'semiBoldLabel' }, translate('Pay [organizationName]', {
689
+ organizationName: zonosStore.organizationName,
690
+ }))), h("div", { key: 'fcdaebc734a270742fbe21ff932550994e522ea6', class: "zonos--total-pay" }, renderFallback({
691
+ content: (h("zonos-text", { type: 'secondaryPageHeader' }, renderCheckoutCurrency({
692
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
693
+ isForeign: false,
694
+ }))),
695
+ isLoading: collectStore.isFetchingShippingInfo,
696
+ skeletonHeight: '36px',
697
+ skeletonWidth: '150px',
698
+ }))));
699
+ }
700
+ static get assetsDirs() { return ["assets"]; }
701
+ };
702
+ ZonosCollectReview.style = ZonosCollectReviewStyle0;
703
+
704
+ const zonosCollectSubtotalCss = ":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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";
705
+ const ZonosCollectSubtotalStyle0 = zonosCollectSubtotalCss;
706
+
707
+ const ZonosCollectSubtotal = class {
708
+ constructor(hostRef) {
709
+ registerInstance(this, hostRef);
710
+ this.storeUnsubscribeList = [];
711
+ this.subtotals = {};
712
+ this.initSubtotalData = () => {
713
+ var _a;
714
+ const cartLandedCostSubtotal = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.subtotals;
715
+ if (!cartLandedCostSubtotal) {
716
+ return;
717
+ }
718
+ // Some countries have same name for duties, taxes and fees in their language. If that happens, we need to group their values by name
719
+ const translatedDutyLabel = translate('Duties');
720
+ const translatedTaxLabel = translate('Taxes');
721
+ const translatedFeeLabel = translate('Fees');
722
+ const subtotalMap = {
723
+ [translatedDutyLabel]: 0,
724
+ [translatedFeeLabel]: 0,
725
+ [translatedTaxLabel]: 0,
726
+ };
727
+ const duties = cartLandedCostSubtotal.duties;
728
+ const taxes = cartLandedCostSubtotal.taxes;
729
+ const fees = cartLandedCostSubtotal.fees;
730
+ if (duties !== undefined) {
731
+ subtotalMap[translatedDutyLabel] || (subtotalMap[translatedDutyLabel] = 0);
732
+ subtotalMap[translatedDutyLabel] += duties;
733
+ }
734
+ if (taxes !== undefined) {
735
+ subtotalMap[translatedTaxLabel] || (subtotalMap[translatedTaxLabel] = 0);
736
+ subtotalMap[translatedTaxLabel] += taxes;
737
+ }
738
+ if (fees !== undefined) {
739
+ subtotalMap[translatedFeeLabel] || (subtotalMap[translatedFeeLabel] = 0);
740
+ subtotalMap[translatedFeeLabel] += fees;
741
+ }
742
+ this.subtotals = subtotalMap;
743
+ };
744
+ }
745
+ disconnectedCallback() {
746
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
747
+ }
748
+ componentWillLoad() {
749
+ this.storeUnsubscribeList = [
750
+ cartStoreOnChange('checkoutSession', this.initSubtotalData),
751
+ translationStoreOnChange('translatedChunks', this.initSubtotalData),
752
+ ];
753
+ }
754
+ render() {
755
+ this.initSubtotalData();
756
+ return (h(Host, { key: 'ab687a6e1ec67f6609081036a75e9905ff34c6b1', class: "zonos--collect-subtotal zonos--elements" }, h("table", { key: '303b8c49983e9f7aea4d31400fed53d858eb078d', class: "zonos--collect-table" }, !!this.subtotals[translate('Duties')] && (h("tr", { key: 'a60fa4f1f1afacef0144b86c054f44572576f7af', class: "zonos--row zonos--collect-duty" }, h("td", { key: 'aeaf798e26bbd482196d7208eb05657a1d15dad8', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: '835d817709ae3b7e2d888d618e0856fb2e637e4d', type: "semiBoldLabel" }, translate('Duties'))), h("td", { key: '5bb47a115ea61fa897a3f48bbd10c5f78af3703e', class: "zonos--column" }), h("td", { key: '32632c4beb855ca687c615f5e6c63c82e2e05c80', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
757
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
758
+ amount: this.subtotals[translate('Duties')] || 0,
759
+ isForeign: true,
760
+ }))),
761
+ isLoading: collectStore.isFetchingShippingInfo,
762
+ skeletonHeight: '14px',
763
+ skeletonWidth: '150px',
764
+ })))), !!this.subtotals[translate('Taxes')] && (h("tr", { key: '055bb237dafaea8de18b127641c8fd7e1ece563b', class: "zonos--row zonos--collect-tax" }, h("td", { key: '1e73b140c2c9090ccfb91ce4efca483e8fb56e9e', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: 'a3375ecd77460c78c7c5f59bf7b9b8612cd53e41', type: "semiBoldLabel" }, translate('Taxes'))), h("td", { key: '20685646be29873967c2f335c775046068248ad3', class: "zonos--column" }), h("td", { key: '2e2c6af2c1a7840df03351178ddf3107fcc36494', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
765
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
766
+ amount: this.subtotals[translate('Taxes')] || 0,
767
+ isForeign: true,
768
+ }))),
769
+ isLoading: collectStore.isFetchingShippingInfo,
770
+ skeletonHeight: '14px',
771
+ skeletonWidth: '150px',
772
+ })))), !!this.subtotals[translate('Fees')] && (h("tr", { key: '8157aba5c6a23680b0bc681adc127747f01a2973', class: "zonos--row zonos--collect-fee" }, h("td", { key: '8266654f9e65003f297222bb935013a8b9b3b430', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: '8399000a5f61e4737764b68b89799b409dce6034', type: "semiBoldLabel" }, translate('Fees'))), h("td", { key: '2a9763f2401967ea1bdfa2c17514d18e2a4e0db6', class: "zonos--column" }), h("td", { key: 'ac2f275312c2ba69888e6e57dde8b4b451839b86', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
773
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
774
+ amount: this.subtotals[translate('Fees')] || 0,
775
+ isForeign: true,
776
+ }))),
777
+ isLoading: collectStore.isFetchingShippingInfo,
778
+ skeletonHeight: '14px',
779
+ skeletonWidth: '150px',
780
+ })))), h("tr", { key: 'a293d1b9342251f7326c1ac68e2bab83eae2ed80', class: "zonos--row zonos--collect-spacing" }, h("td", { key: 'c136b1b807f32dc21c131326d70500d2e2c64efe', class: "zonos--column", colSpan: 3 })), h("tr", { key: '59747101f1a9ef7c8fad60e90ea5b8c31015438c', class: "zonos--row zonos--collect-total zonos--collect-total-subtotal" }, h("td", { key: '96d201ba6f3e571adac265127229c94cdc96be2a', class: "zonos--column" }), h("td", { key: 'f2f4cb751e35fc0ebaa803659f26a2314d8bf639', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: 'b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441', type: "label" }, translate('Subtotal'))), h("td", { key: '28b6aea6363b2bef1d072ad77f409ae77976305c', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
781
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
782
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
783
+ isForeign: true,
784
+ }))),
785
+ isLoading: collectStore.isFetchingShippingInfo,
786
+ skeletonHeight: '14px',
787
+ skeletonWidth: '150px',
788
+ }))), h("tr", { key: 'f0072cdd200e8483421265af39a90fb655fb2ef0', class: "zonos--row zonos--collect-total" }, h("td", { key: '88a007048d33c919a6c5f87cf7cd071f83e7448b', class: "zonos--column" }), h("td", { key: '24bba9e9b81ff443dd5ca4832c3169e3605a93b8', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: '594d4e96bec3a2153f6622c6842970ebee5bb463', type: "semiBoldLabel" }, translate('Customs fees total'))), h("td", { key: 'b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
789
+ content: (h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
790
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
791
+ isForeign: true,
792
+ }))),
793
+ isLoading: collectStore.isFetchingShippingInfo,
794
+ skeletonHeight: '14px',
795
+ skeletonWidth: '150px',
796
+ }))))));
797
+ }
798
+ static get assetsDirs() { return ["assets"]; }
799
+ };
800
+ ZonosCollectSubtotal.style = ZonosCollectSubtotalStyle0;
801
+
802
+ export { ZonosCollectFinish as zonos_collect_finish, ZonosCollectFooter as zonos_collect_footer, ZonosCollectOrderDetails as zonos_collect_order_details, ZonosCollectPayment as zonos_collect_payment, ZonosCollectReview as zonos_collect_review, ZonosCollectSubtotal as zonos_collect_subtotal };