@zonos/elements 1.3.233 → 1.3.235

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 (420) hide show
  1. package/dist/cjs/{cart-bc615014.js → cart-22ced7cc.js} +33 -29
  2. package/dist/cjs/{shouldRenderTaxIdInput-9b8a8de1.js → containsNonLatinChars-2be5129b.js} +0 -23
  3. package/dist/cjs/{hasInclusivePrice-84145546.js → hasInclusivePrice-ca85cabd.js} +1 -1
  4. package/dist/cjs/index.cjs.js +11 -7
  5. package/dist/cjs/invoice-8fd4242c.js +151 -0
  6. package/dist/cjs/{renderFallback-c2576fbe.js → isCollectMobileTablet-7962c57f.js} +2 -11
  7. package/dist/cjs/isInvoiceMobileTablet-dde41e4e.js +15 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{translationStore-08d3ff9c.js → localization-8ef6250a.js} +1059 -1
  10. package/dist/cjs/{paypal-1d6f1a71.js → paypal-4a086f84.js} +7 -8
  11. package/dist/cjs/placeTestOrder-f25d08ee.js +45 -0
  12. package/dist/cjs/{placeTestOrder-a5469e40.js → renderCheckoutCurrency-5494e45b.js} +2 -42
  13. package/dist/cjs/renderFallback-78b54537.js +12 -0
  14. package/dist/cjs/shouldRenderTaxIdInput-eda13ef8.js +25 -0
  15. package/dist/cjs/throttle-7dd64984.js +76 -0
  16. package/dist/cjs/{zonos-address_11.cjs.entry.js → zonos-address-display_9.cjs.entry.js} +62 -668
  17. package/dist/cjs/zonos-address_4.cjs.entry.js +715 -0
  18. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  19. package/dist/cjs/{zonos-banner_2.cjs.entry.js → zonos-banner.cjs.entry.js} +0 -40
  20. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  21. package/dist/cjs/{zonos-empty-state-payment_4.cjs.entry.js → zonos-card_5.cjs.entry.js} +44 -6
  22. package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +75 -92
  23. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -21
  24. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -6
  26. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +66 -65
  27. package/dist/cjs/zonos-collect.cjs.entry.js +25 -25
  28. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-controller.cjs.entry.js +39 -10
  30. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -2
  31. package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -11
  32. package/dist/cjs/zonos-elements.cjs.js +1 -1
  33. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +30 -31
  34. package/dist/cjs/zonos-hello.cjs.entry.js +7 -8
  35. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  36. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +94 -0
  37. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +686 -0
  38. package/dist/cjs/zonos-invoice.cjs.entry.js +468 -0
  39. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -6
  40. package/dist/cjs/zonos-link.cjs.entry.js +24 -0
  41. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  42. package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
  43. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  44. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  45. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  46. package/dist/collection/collection-manifest.json +8 -0
  47. package/dist/collection/components/checkout/zonos-invoice/assets/ChevronDownIcon.svg +1 -0
  48. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/assets/empty-item.jpeg +0 -0
  49. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.css +72 -0
  50. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +87 -0
  51. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/RemoveIcon.svg +1 -0
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/SuccessIcon.svg +1 -0
  53. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.css +90 -0
  54. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +405 -0
  55. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/chevronDownIcon.svg +1 -0
  56. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/globe.svg +3 -0
  57. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconDark.svg +10 -0
  58. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconLight.svg +10 -0
  59. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosWordmark.svg +7 -0
  60. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.css +155 -0
  61. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +165 -0
  62. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronDownIcon.svg +1 -0
  63. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronUpIcon.svg +1 -0
  64. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.css +117 -0
  65. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.js +175 -0
  66. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/CheckmarkLineIcon.svg +1 -0
  67. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/RemoveLineIcon.svg +1 -0
  68. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.css +98 -0
  69. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +368 -0
  70. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.css +71 -0
  71. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +151 -0
  72. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.css +83 -0
  73. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +65 -0
  74. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.css +350 -0
  75. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.js +547 -0
  76. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  77. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  78. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  79. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  80. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  81. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  82. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  83. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  84. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  85. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  86. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  87. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  88. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  89. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  90. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  91. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  92. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  93. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  94. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  95. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +5 -5
  96. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  97. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  98. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  99. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  100. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  101. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  102. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  103. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  104. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  105. package/dist/collection/components/main/zonos-controller.js +45 -4
  106. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  107. package/dist/collection/components/store/checkout/invoice.js +148 -0
  108. package/dist/collection/components/store/checkout/stripe.js +8 -3
  109. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  110. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  111. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  112. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  113. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  114. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  115. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  116. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  117. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  118. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  119. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  120. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  121. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  122. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  123. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  124. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  125. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  126. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  127. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  128. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  129. package/dist/collection/components/stripe/zonos-address/zonos-address.js +8 -5
  130. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  131. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  132. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  133. package/dist/collection/components/utils/checkout/initInvoice.js +15 -0
  134. package/dist/collection/components/utils/checkout/isInvoiceMobileTablet.js +10 -0
  135. package/dist/collection/scripts/_zonosBase.js +4 -0
  136. package/dist/collection/types/generated/graphql.frontend.types.js +4 -0
  137. package/dist/collection/types/generated/graphql.internal.types.js +239 -5
  138. package/dist/esm/{cart-14f305b3.js → cart-66aecbb3.js} +9 -5
  139. package/dist/esm/{shouldRenderTaxIdInput-8bc112bb.js → containsNonLatinChars-2d8810c3.js} +1 -23
  140. package/dist/esm/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  141. package/dist/esm/index.js +11 -7
  142. package/dist/esm/invoice-c7452847.js +146 -0
  143. package/dist/esm/{renderFallback-dbf1e3ae.js → isCollectMobileTablet-921002b0.js} +3 -11
  144. package/dist/esm/isInvoiceMobileTablet-1f7b614e.js +12 -0
  145. package/dist/esm/loader.js +1 -1
  146. package/dist/esm/{translationStore-690c4e04.js → localization-04b05867.js} +1041 -2
  147. package/dist/esm/{paypal-fded8844.js → paypal-56564874.js} +2 -3
  148. package/dist/esm/placeTestOrder-6b9eda9e.js +43 -0
  149. package/dist/esm/{placeTestOrder-2250f719.js → renderCheckoutCurrency-cb808110.js} +3 -42
  150. package/dist/esm/renderFallback-3f010b48.js +10 -0
  151. package/dist/esm/shouldRenderTaxIdInput-d45ceeb4.js +23 -0
  152. package/dist/esm/throttle-ce2432ab.js +74 -0
  153. package/dist/esm/{zonos-address_11.entry.js → zonos-address-display_9.entry.js} +32 -636
  154. package/dist/esm/zonos-address_4.entry.js +708 -0
  155. package/dist/esm/zonos-badge.entry.js +3 -3
  156. package/dist/esm/{zonos-banner_2.entry.js → zonos-banner.entry.js} +1 -40
  157. package/dist/esm/zonos-button_3.entry.js +3 -3
  158. package/dist/esm/{zonos-empty-state-payment_4.entry.js → zonos-card_5.entry.js} +44 -7
  159. package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_12.entry.js} +15 -31
  160. package/dist/esm/zonos-checkout.entry.js +3 -4
  161. package/dist/esm/zonos-collapse.entry.js +2 -2
  162. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -6
  163. package/dist/esm/zonos-collect-finish_6.entry.js +7 -6
  164. package/dist/esm/zonos-collect.entry.js +5 -5
  165. package/dist/esm/zonos-component.entry.js +1 -1
  166. package/dist/esm/zonos-controller.entry.js +39 -10
  167. package/dist/esm/zonos-country-flag.entry.js +1 -2
  168. package/dist/esm/zonos-country-select_4.entry.js +10 -11
  169. package/dist/esm/zonos-elements.js +1 -1
  170. package/dist/esm/zonos-hello-dialog.entry.js +6 -7
  171. package/dist/esm/zonos-hello.entry.js +1 -2
  172. package/dist/esm/zonos-input.entry.js +4 -4
  173. package/dist/esm/zonos-invoice-cart-items_2.entry.js +89 -0
  174. package/dist/esm/zonos-invoice-finish_5.entry.js +678 -0
  175. package/dist/esm/zonos-invoice.entry.js +464 -0
  176. package/dist/esm/zonos-language-select_2.entry.js +5 -6
  177. package/dist/esm/zonos-link.entry.js +20 -0
  178. package/dist/esm/zonos-logo.entry.js +2 -2
  179. package/dist/esm/zonos-stripe-input.entry.js +5 -5
  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/cart-66aecbb3.js +1 -0
  184. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  185. package/dist/esm-es5/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  186. package/dist/esm-es5/index.js +1 -1
  187. package/dist/esm-es5/invoice-c7452847.js +1 -0
  188. package/dist/esm-es5/isCollectMobileTablet-921002b0.js +1 -0
  189. package/dist/esm-es5/isInvoiceMobileTablet-1f7b614e.js +1 -0
  190. package/dist/esm-es5/loader.js +1 -1
  191. package/dist/esm-es5/localization-04b05867.js +1 -0
  192. package/dist/esm-es5/{paypal-fded8844.js → paypal-56564874.js} +1 -1
  193. package/dist/esm-es5/placeTestOrder-6b9eda9e.js +1 -0
  194. package/dist/esm-es5/renderCheckoutCurrency-cb808110.js +1 -0
  195. package/dist/esm-es5/renderFallback-3f010b48.js +1 -0
  196. package/dist/esm-es5/shouldRenderTaxIdInput-d45ceeb4.js +1 -0
  197. package/dist/esm-es5/throttle-ce2432ab.js +1 -0
  198. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -0
  199. package/dist/esm-es5/zonos-address_4.entry.js +1 -0
  200. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  201. package/dist/esm-es5/zonos-banner.entry.js +1 -0
  202. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  203. package/dist/esm-es5/zonos-card_5.entry.js +1 -0
  204. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  205. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  206. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  207. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  208. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  209. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  210. package/dist/esm-es5/zonos-component.entry.js +1 -1
  211. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  212. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  213. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  214. package/dist/esm-es5/zonos-elements.js +1 -1
  215. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  216. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  217. package/dist/esm-es5/zonos-input.entry.js +1 -1
  218. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -0
  219. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -0
  220. package/dist/esm-es5/zonos-invoice.entry.js +1 -0
  221. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  222. package/dist/esm-es5/zonos-link.entry.js +1 -0
  223. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  224. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  225. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  226. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  227. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  228. package/dist/scripts/index.d.ts +356 -0
  229. package/dist/scripts/index.js +1 -1
  230. package/dist/scripts/loadZonos.js +1 -1
  231. package/dist/scripts/zonos.js +1 -1
  232. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.d.ts +10 -0
  233. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.d.ts +50 -0
  234. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.d.ts +25 -0
  235. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.d.ts +28 -0
  236. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.d.ts +62 -0
  237. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.d.ts +22 -0
  238. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.d.ts +7 -0
  239. package/dist/types/components/checkout/zonos-invoice/zonos-invoice.d.ts +86 -0
  240. package/dist/types/components/main/zonos-controller.d.ts +4 -0
  241. package/dist/types/components/store/checkout/invoice.d.ts +19 -0
  242. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  243. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  244. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  245. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  246. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  247. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  248. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  249. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  250. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  251. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  252. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  253. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  254. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  255. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  256. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  257. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  258. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  259. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  260. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  261. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  262. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  263. package/dist/types/components/utils/checkout/initInvoice.d.ts +1 -0
  264. package/dist/types/components/utils/checkout/isInvoiceMobileTablet.d.ts +4 -0
  265. package/dist/types/components.d.ts +351 -0
  266. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  267. package/dist/types/types/checkout/api/CheckoutSession.d.ts +4 -0
  268. package/dist/types/types/checkout/api/PartyInfo.d.ts +21 -0
  269. package/dist/types/types/generated/graphql.frontend.types.d.ts +5 -1
  270. package/dist/types/types/generated/graphql.frontend.types.ts +5 -1
  271. package/dist/types/types/generated/graphql.internal.types.d.ts +285 -8
  272. package/dist/types/types/generated/graphql.internal.types.ts +367 -10
  273. package/dist/zonos-elements/index.esm.js +1 -1
  274. package/dist/zonos-elements/p-00719e49.entry.js +1 -0
  275. package/dist/zonos-elements/p-01b0a2e2.js +1 -0
  276. package/dist/zonos-elements/p-01dada4e.js +1 -0
  277. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  278. package/dist/zonos-elements/p-0cd5bcb3.entry.js +1 -0
  279. package/dist/zonos-elements/p-0e82fcea.entry.js +1 -0
  280. package/dist/zonos-elements/p-10316d4d.system.entry.js +1 -0
  281. package/dist/zonos-elements/{p-0a90dd80.system.entry.js → p-121c60c1.system.entry.js} +1 -1
  282. package/dist/zonos-elements/{p-bf9d889f.entry.js → p-14314ad3.entry.js} +1 -1
  283. package/dist/zonos-elements/p-170314a3.js +1 -0
  284. package/dist/zonos-elements/p-17a09191.entry.js +1 -0
  285. package/dist/zonos-elements/p-18bc6c7a.entry.js +1 -0
  286. package/dist/zonos-elements/{p-a25428eb.system.js → p-18d20206.system.js} +2 -2
  287. package/dist/zonos-elements/p-1a30fe18.system.entry.js +1 -0
  288. package/dist/zonos-elements/{p-c7b658cb.entry.js → p-1c4d12f0.entry.js} +1 -1
  289. package/dist/zonos-elements/p-1f3549c6.js +1 -0
  290. package/dist/zonos-elements/p-2250e585.entry.js +1 -0
  291. package/dist/zonos-elements/p-248dd596.system.entry.js +1 -0
  292. package/dist/zonos-elements/{p-5f398c28.entry.js → p-264690d7.entry.js} +1 -1
  293. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  294. package/dist/zonos-elements/p-27f6930b.js +1 -0
  295. package/dist/zonos-elements/{p-eea0eb57.system.entry.js → p-2f869f2c.system.entry.js} +1 -1
  296. package/dist/zonos-elements/p-30c661b3.system.entry.js +1 -0
  297. package/dist/zonos-elements/p-34bf7bbe.system.js +1 -0
  298. package/dist/zonos-elements/p-38913b2f.entry.js +1 -0
  299. package/dist/zonos-elements/p-3bec13dd.system.js +1 -0
  300. package/dist/zonos-elements/{p-00ec22b2.entry.js → p-43a22d85.entry.js} +1 -1
  301. package/dist/zonos-elements/p-44b50260.entry.js +1 -0
  302. package/dist/zonos-elements/p-48dc96f9.system.entry.js +1 -0
  303. package/dist/zonos-elements/p-4aa86184.system.entry.js +1 -0
  304. package/dist/zonos-elements/p-4d594c8e.system.js +1 -0
  305. package/dist/zonos-elements/p-4ffbb0d6.system.js +1 -0
  306. package/dist/zonos-elements/{p-452fb638.system.entry.js → p-5062dcf3.system.entry.js} +1 -1
  307. package/dist/zonos-elements/p-50f31c12.system.entry.js +1 -0
  308. package/dist/zonos-elements/{p-c5cb2364.system.entry.js → p-57cee1b5.system.entry.js} +1 -1
  309. package/dist/zonos-elements/p-59a76f73.entry.js +1 -0
  310. package/dist/zonos-elements/{p-d556c6d1.system.entry.js → p-5afb9260.system.entry.js} +1 -1
  311. package/dist/zonos-elements/{p-88ea9f82.entry.js → p-6626d240.entry.js} +1 -1
  312. package/dist/zonos-elements/p-6688473e.entry.js +1 -0
  313. package/dist/zonos-elements/p-6f23a26a.system.js +1 -0
  314. package/dist/zonos-elements/{p-82739127.js → p-73c737aa.js} +2 -2
  315. package/dist/zonos-elements/p-757d4c62.system.entry.js +1 -0
  316. package/dist/zonos-elements/p-7aa50ef2.entry.js +1 -0
  317. package/dist/zonos-elements/p-7e17667d.js +1 -0
  318. package/dist/zonos-elements/p-7e469c5c.entry.js +1 -0
  319. package/dist/zonos-elements/p-7f91617c.system.entry.js +1 -0
  320. package/dist/zonos-elements/p-81e3eb5b.js +1 -0
  321. package/dist/zonos-elements/p-82febf70.system.js +1 -0
  322. package/dist/zonos-elements/{p-770852bf.system.entry.js → p-836db369.system.entry.js} +1 -1
  323. package/dist/zonos-elements/p-83b3f824.system.entry.js +1 -0
  324. package/dist/zonos-elements/p-851011aa.system.entry.js +1 -0
  325. package/dist/zonos-elements/{p-936b54c1.entry.js → p-865536f0.entry.js} +1 -1
  326. package/dist/zonos-elements/{p-b1fd1ec2.system.entry.js → p-8792fef2.system.entry.js} +1 -1
  327. package/dist/zonos-elements/p-890bfc42.system.entry.js +1 -0
  328. package/dist/zonos-elements/{p-c288c6da.system.entry.js → p-89a5e936.system.entry.js} +1 -1
  329. package/dist/zonos-elements/p-8af188f8.system.js +1 -0
  330. package/dist/zonos-elements/p-8d3a62fb.entry.js +1 -0
  331. package/dist/zonos-elements/{p-00ac999f.system.entry.js → p-8dc025c7.system.entry.js} +1 -1
  332. package/dist/zonos-elements/p-944d00da.entry.js +1 -0
  333. package/dist/zonos-elements/p-9479f155.system.js +1 -0
  334. package/dist/zonos-elements/p-95dc475b.system.js +1 -0
  335. package/dist/zonos-elements/p-976afc17.system.js +1 -0
  336. package/dist/zonos-elements/p-9b9bfb6d.entry.js +1 -0
  337. package/dist/zonos-elements/{p-55e2e4ed.entry.js → p-9f1bd9b8.entry.js} +1 -1
  338. package/dist/zonos-elements/p-9fa32fdf.js +1 -0
  339. package/dist/zonos-elements/p-a2a0bf4e.js +1 -0
  340. package/dist/zonos-elements/p-a610c24e.system.entry.js +1 -0
  341. package/dist/zonos-elements/{p-9b8750f3.entry.js → p-aedd3911.entry.js} +1 -1
  342. package/dist/zonos-elements/{p-db628e49.system.entry.js → p-b5c31ca4.system.entry.js} +1 -1
  343. package/dist/zonos-elements/p-ba456282.system.entry.js +1 -0
  344. package/dist/zonos-elements/{p-31af91f0.entry.js → p-bd603c1a.entry.js} +1 -1
  345. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  346. package/dist/zonos-elements/p-c8cc20d9.system.js +1 -0
  347. package/dist/zonos-elements/p-dc5fb21c.js +1 -0
  348. package/dist/zonos-elements/p-dc94d7eb.js +1 -0
  349. package/dist/zonos-elements/{p-540cec7e.system.entry.js → p-e9e6bea7.system.entry.js} +1 -1
  350. package/dist/zonos-elements/p-eb9ee025.system.js +1 -0
  351. package/dist/zonos-elements/p-ed8ae947.system.entry.js +1 -0
  352. package/dist/zonos-elements/p-f1d4d6da.entry.js +1 -0
  353. package/dist/zonos-elements/p-f1d9dd4e.entry.js +1 -0
  354. package/dist/zonos-elements/p-f3962950.system.entry.js +1 -0
  355. package/dist/zonos-elements/p-f4e976ae.entry.js +1 -0
  356. package/dist/zonos-elements/p-f513b231.entry.js +1 -0
  357. package/dist/zonos-elements/p-f64207fa.system.entry.js +1 -0
  358. package/dist/zonos-elements/{p-31975752.entry.js → p-fa322dc1.entry.js} +1 -1
  359. package/dist/zonos-elements/p-fb9fb873.system.entry.js +1 -0
  360. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  361. package/package.json +1 -1
  362. package/dist/cjs/localization-39516612.js +0 -884
  363. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +0 -168
  364. package/dist/esm/localization-c5029ffc.js +0 -863
  365. package/dist/esm/zonos-confirm-dialog_2.entry.js +0 -163
  366. package/dist/esm-es5/cart-14f305b3.js +0 -1
  367. package/dist/esm-es5/localization-c5029ffc.js +0 -1
  368. package/dist/esm-es5/placeTestOrder-2250f719.js +0 -1
  369. package/dist/esm-es5/renderFallback-dbf1e3ae.js +0 -1
  370. package/dist/esm-es5/shouldRenderTaxIdInput-8bc112bb.js +0 -1
  371. package/dist/esm-es5/translationStore-690c4e04.js +0 -1
  372. package/dist/esm-es5/zonos-address_11.entry.js +0 -1
  373. package/dist/esm-es5/zonos-banner_2.entry.js +0 -1
  374. package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
  375. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +0 -1
  376. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +0 -1
  377. package/dist/zonos-elements/p-03ff7b01.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-100f6a88.system.entry.js +0 -1
  379. package/dist/zonos-elements/p-143d706b.entry.js +0 -1
  380. package/dist/zonos-elements/p-14d7489d.js +0 -1
  381. package/dist/zonos-elements/p-1bfae137.entry.js +0 -1
  382. package/dist/zonos-elements/p-1d5aa016.system.js +0 -1
  383. package/dist/zonos-elements/p-1eae4987.entry.js +0 -1
  384. package/dist/zonos-elements/p-23b45714.system.entry.js +0 -1
  385. package/dist/zonos-elements/p-2557b96b.js +0 -1
  386. package/dist/zonos-elements/p-2ca8b037.entry.js +0 -1
  387. package/dist/zonos-elements/p-2dbcecf4.entry.js +0 -1
  388. package/dist/zonos-elements/p-316f9052.system.entry.js +0 -1
  389. package/dist/zonos-elements/p-3185968f.entry.js +0 -1
  390. package/dist/zonos-elements/p-4e41143a.system.entry.js +0 -1
  391. package/dist/zonos-elements/p-52b87408.system.entry.js +0 -1
  392. package/dist/zonos-elements/p-561be3a2.system.js +0 -1
  393. package/dist/zonos-elements/p-5c680f72.js +0 -1
  394. package/dist/zonos-elements/p-5f77d19e.js +0 -1
  395. package/dist/zonos-elements/p-74ca7739.entry.js +0 -1
  396. package/dist/zonos-elements/p-767a31a8.system.js +0 -1
  397. package/dist/zonos-elements/p-78a6e775.system.js +0 -1
  398. package/dist/zonos-elements/p-7c705c76.system.js +0 -1
  399. package/dist/zonos-elements/p-81ba2820.system.entry.js +0 -1
  400. package/dist/zonos-elements/p-84078c57.system.js +0 -1
  401. package/dist/zonos-elements/p-8a23bbf5.js +0 -1
  402. package/dist/zonos-elements/p-905d2490.entry.js +0 -1
  403. package/dist/zonos-elements/p-93f2e1ee.system.entry.js +0 -1
  404. package/dist/zonos-elements/p-a0a4e43d.system.entry.js +0 -1
  405. package/dist/zonos-elements/p-a2819807.system.entry.js +0 -1
  406. package/dist/zonos-elements/p-a6e74856.entry.js +0 -1
  407. package/dist/zonos-elements/p-ae940a99.js +0 -1
  408. package/dist/zonos-elements/p-b7ea5f4f.system.entry.js +0 -1
  409. package/dist/zonos-elements/p-c0c458f7.system.entry.js +0 -1
  410. package/dist/zonos-elements/p-c1ecab92.entry.js +0 -1
  411. package/dist/zonos-elements/p-c50cc926.entry.js +0 -1
  412. package/dist/zonos-elements/p-cf765af3.system.js +0 -1
  413. package/dist/zonos-elements/p-e03e1a62.entry.js +0 -1
  414. package/dist/zonos-elements/p-e7874318.system.entry.js +0 -1
  415. package/dist/zonos-elements/p-e8949e7e.entry.js +0 -1
  416. package/dist/zonos-elements/p-ea0b5d10.system.js +0 -1
  417. package/dist/zonos-elements/p-eae3462c.entry.js +0 -1
  418. package/dist/zonos-elements/p-eeb1081e.js +0 -1
  419. package/dist/zonos-elements/p-f892595d.system.entry.js +0 -1
  420. package/dist/zonos-elements/p-fd3b46ee.entry.js +0 -1
@@ -0,0 +1,686 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-69fa8852.js');
6
+ const cart = require('./cart-22ced7cc.js');
7
+ const paypal = require('./paypal-4a086f84.js');
8
+ const localization = require('./localization-8ef6250a.js');
9
+ const zonosStore = require('./zonosStore-37a4b4f4.js');
10
+ const handleFetch = require('./handleFetch-954f30e1.js');
11
+ const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
12
+ const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
13
+ const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
+ const isInvoiceMobileTablet = require('./isInvoiceMobileTablet-dde41e4e.js');
15
+ const classes = require('./classes-b7918f56.js');
16
+ const ILanguage = require('./ILanguage-98b04442.js');
17
+ const invoice = require('./invoice-8fd4242c.js');
18
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-5494e45b.js');
19
+ const placeTestOrder = require('./placeTestOrder-f25d08ee.js');
20
+ const renderFallback = require('./renderFallback-78b54537.js');
21
+ require('./isDarkColor-878e600e.js');
22
+
23
+ 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>`;
24
+
25
+ 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>`;
26
+
27
+ const zonosInvoiceFinishCss = ":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}";
28
+ const ZonosInvoiceFinishStyle0 = zonosInvoiceFinishCss;
29
+
30
+ /**
31
+ * Maximum number of retries to pull order info (gap between each retry is 1 second)
32
+ */
33
+ const MAX_RETRIES = 30;
34
+ const ZonosInvoiceFinish = class {
35
+ constructor(hostRef) {
36
+ index.registerInstance(this, hostRef);
37
+ this.closeClick = index.createEvent(this, "closeClick", 7);
38
+ /**
39
+ * The border radius style of the dialog
40
+ */
41
+ this.borderRadius = 'ROUNDED';
42
+ /**
43
+ * The confirmation id for the invoice order
44
+ */
45
+ this.confirmationId = null;
46
+ this.isLoading = true;
47
+ this.notificationType = 'success';
48
+ this.notificationTitle = '';
49
+ this.notificationMessages = [];
50
+ this.notificationActionText = localization.translate('Keep shopping');
51
+ this.order = null;
52
+ /**
53
+ * Is waiting to redirect to a different page
54
+ */
55
+ this.isWaitingToRedirect = true;
56
+ this.pullOrder = async () => {
57
+ var _a, _b;
58
+ const checkoutSessionId = localization.storageStore.checkoutSessionId;
59
+ const searchParams = new URLSearchParams();
60
+ searchParams.set('checkoutSessionId', checkoutSessionId || '');
61
+ const { baseUrl, errors, json } = await handleFetch.handleFetch(`/api/zonos-elements/get-order?${searchParams.toString()}`);
62
+ if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
63
+ return {
64
+ baseUrl,
65
+ order: null,
66
+ };
67
+ }
68
+ // onOrderSuccess callback may be provided on Zonos.init
69
+ await ((_b = (_a = zonosStore.zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, {
70
+ zonosApiRoute: baseUrl,
71
+ zonosOrder: json,
72
+ }));
73
+ return {
74
+ baseUrl,
75
+ order: json,
76
+ };
77
+ };
78
+ this.handleSuccessBehavior = async () => {
79
+ // Do nothing, display Zonos success page
80
+ this.isLoading = false;
81
+ await this.getPullOrder();
82
+ };
83
+ // 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
84
+ this.getPullOrder = async (attempts = 0) => {
85
+ var _a, _b;
86
+ if (attempts === 0) {
87
+ VarianceTest.log('=== Start to poll for order info', 'info');
88
+ }
89
+ const { baseUrl, order } = await this.pullOrder();
90
+ 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);
91
+ const checkoutSessionId = localization.storageStore.checkoutSessionId;
92
+ const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
93
+ '0') || MAX_RETRIES;
94
+ VarianceTest.log(`=== Polling order (${attempts} attemps)`, 'info');
95
+ if (
96
+ // Order found, in legacy checkout facade and still haven't found the legacy order number
97
+ order) {
98
+ VarianceTest.log('=== InvoiceOrder info found', 'info');
99
+ if (attempts > 10) {
100
+ // Log out all the logs if we have tried more than 10 times
101
+ void handleFetch.sendErrorLog({
102
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
103
+ errors: [`Invoice order found after ${attempts} attempts`],
104
+ metadata: {
105
+ allLogs: VarianceTest.allLogs,
106
+ checkoutSessionId: localization.storageStore.checkoutSessionId || '',
107
+ orderId: order.id,
108
+ storeId: zonosStore.zonosStore.storeId,
109
+ },
110
+ });
111
+ }
112
+ this.order = order;
113
+ }
114
+ else if ((!order || !foundLegacyOrderNumber) && attempts < maxRetries) {
115
+ // Wait for 1 second before the next attempt
116
+ await new Promise(resolve => setTimeout(resolve, 1000));
117
+ await this.getPullOrder(attempts + 1);
118
+ }
119
+ else {
120
+ void handleFetch.sendErrorLog({
121
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
122
+ errors: [`Invoice order not found after ${maxRetries} attempts`],
123
+ metadata: {
124
+ allLogs: VarianceTest.allLogs,
125
+ checkoutSessionId: localization.storageStore.checkoutSessionId || '',
126
+ storeId: zonosStore.zonosStore.storeId,
127
+ },
128
+ });
129
+ }
130
+ };
131
+ this.checkStripePaymentStatus = async () => {
132
+ const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || cart.stripeStore.clientSecret;
133
+ if (clientSecret || this.storybookForceStatus) {
134
+ const { error, messages, status } = await cart.stripeStoreRetrievePayment({
135
+ clientSecret,
136
+ storybookForceStatus: this.storybookForceStatus,
137
+ });
138
+ const isError = status === 'requires_action' || error;
139
+ this.notificationType = isError ? 'error' : 'success';
140
+ this.notificationMessages = messages || [];
141
+ this.notificationTitle = isError
142
+ ? localization.translate('Payment failed')
143
+ : localization.translate("You're all set!");
144
+ VarianceTest.log('=== Payment intent retrieve status', 'info', {
145
+ clientSecret,
146
+ error,
147
+ messages,
148
+ status,
149
+ });
150
+ // remove the client secret from the url
151
+ const url = new URL(window.location.href);
152
+ url.searchParams.delete('payment_intent_client_secret');
153
+ url.searchParams.delete('payment_intent');
154
+ url.searchParams.delete('redirect_status');
155
+ // Clean up the url if it's a redirect behavior
156
+ url.searchParams.delete('zonosCheckoutSessionId');
157
+ window.history.replaceState({}, '', url.toString());
158
+ // Payment doesn't go through
159
+ if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
160
+ paypal.submitGtag('zonos-checkout-payment-fail');
161
+ void handleFetch.sendErrorLog({
162
+ endpoint: 'Stripe payment failed',
163
+ errors: [
164
+ `Payment intent "${clientSecret.split('_secret_')[0] || clientSecret}" status: ${status} - checkout session: ${localization.storageStore.checkoutSessionId}`,
165
+ ],
166
+ metadata: {
167
+ allLogs: VarianceTest.allLogs,
168
+ credentialToken: window.Zonos.zonosApiKey,
169
+ },
170
+ });
171
+ }
172
+ else {
173
+ paypal.submitGtag('zonos-checkout-success');
174
+ const checkoutSessionId = localization.storageStore.checkoutSessionId;
175
+ void cart.trackConversionEvent({
176
+ checkoutSessionId,
177
+ eventName: 'checkout_orderCompleted',
178
+ });
179
+ const successEvent = createCustomEvent.createCustomEvent('zonos-checkout-success', {
180
+ message: 'Zonos Checkout successfully processed order',
181
+ });
182
+ document.dispatchEvent(successEvent);
183
+ // wait this to finish before resetting store and checkout session id
184
+ await this.handleSuccessBehavior();
185
+ }
186
+ }
187
+ // Make sure to stop the loading spinner even when there's an error
188
+ this.isLoading = false;
189
+ // reset promo when checkout is finished
190
+ cart.stripeStoreResetPromoCode();
191
+ cart.stripeStoreReset();
192
+ localization.storageStore.checkoutSessionId = null;
193
+ };
194
+ this.checkStagingOrderStatus = async () => {
195
+ this.notificationType = 'success';
196
+ this.notificationTitle = localization.translate("You're all set!");
197
+ this.notificationMessages =
198
+ cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
199
+ await this.handleSuccessBehavior();
200
+ // reset promo when checkout is finished
201
+ cart.stripeStoreResetPromoCode();
202
+ cart.stripeStoreReset();
203
+ paypal.paypalStoreReset();
204
+ localization.storageStore.checkoutSessionId = null;
205
+ };
206
+ this.checkPaypalPaymentStatus = async () => {
207
+ // render error message if there's an error
208
+ if (paypal.paypalStore.paypalErrorMessage) {
209
+ this.notificationType = 'error';
210
+ this.notificationTitle = localization.translate('Payment failed');
211
+ this.notificationMessages = [paypal.paypalStore.paypalErrorMessage];
212
+ this.isLoading = false;
213
+ return;
214
+ }
215
+ // show success message right away when order id is already created
216
+ this.isLoading = false;
217
+ if (paypal.paypalStore.orderIdCreated) {
218
+ paypal.submitGtag('zonos-checkout-success');
219
+ const checkoutSessionId = localization.storageStore.checkoutSessionId;
220
+ void cart.trackConversionEvent({
221
+ checkoutSessionId,
222
+ eventName: 'checkout_orderCompleted',
223
+ });
224
+ this.notificationType = 'success';
225
+ this.notificationTitle = localization.translate("You're all set!");
226
+ this.notificationMessages =
227
+ cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
228
+ // wait this to finish before resetting store and checkout session id
229
+ await this.handleSuccessBehavior();
230
+ }
231
+ // reset promo when checkout is finished
232
+ cart.stripeStoreResetPromoCode();
233
+ cart.stripeStoreReset();
234
+ paypal.paypalStoreReset();
235
+ localization.storageStore.checkoutSessionId = null;
236
+ };
237
+ this.getReceiptUrl = ({ cartId }) => {
238
+ const hostUrl = new URL(`${window.location.origin}/receipt`);
239
+ hostUrl.searchParams.set('referenceId', cartId);
240
+ // is test mode
241
+ const isTestMode = handleFetch.getIsTestMode();
242
+ if (isTestMode) {
243
+ hostUrl.searchParams.set('zonosTestMode', '1');
244
+ }
245
+ // Carry over the zonosQaUrl if it exists
246
+ const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
247
+ if (zonosQaUrl) {
248
+ hostUrl.searchParams.set('zonosQaUrl', zonosQaUrl);
249
+ }
250
+ return hostUrl.toString();
251
+ };
252
+ }
253
+ componentDidLoad() {
254
+ if (this.overrideNotification) {
255
+ // just show the notification and don't check any of the payment status
256
+ this.notificationType = this.overrideNotification.type;
257
+ this.notificationTitle = this.overrideNotification.title;
258
+ this.notificationMessages = this.overrideNotification.messages;
259
+ this.isLoading = false;
260
+ return;
261
+ }
262
+ if (cart.cartStore.isStagingMode) {
263
+ void this.checkStagingOrderStatus();
264
+ }
265
+ else if (paypal.paypalStore.orderIdCreated) {
266
+ void this.checkPaypalPaymentStatus();
267
+ }
268
+ else {
269
+ void this.checkStripePaymentStatus();
270
+ }
271
+ }
272
+ render() {
273
+ const cartId = window.Zonos.cartId;
274
+ return (index.h(index.Host, { key: '2d8d736241298daa30fdf8935cef67bfa748e2df', class: "zonos--checkout-finish zonos--elements", style: {
275
+ '--zonos--border-radius': getBorderRadius.getBorderRadius({
276
+ overrideBorderStyle: this.borderRadius,
277
+ }),
278
+ } }, !this.isLoading && (index.h("div", { key: '30e1eae6e9ac7289af88f8fe2048d40796dfdf0e', class: "zonos--finish-details" }, index.h("div", { key: '0324e34b72e58d0862ed319576018bd45bd18b18', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '227f3cdda8e9cb0ed15ea91acb88c88d15d3d21c', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: '1458ad439dc56e9ca7641a9ca95f3dfb2fd6b28f', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: '8b0ab258c7beab09b0bc12999198f38813a144b3', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: 'ea6b4f8c1f8cce779fadf358966fece018d9869b', class: "zonos--button-container" }, index.h("zonos-button", { key: 'e5140fa1fab1e3150a2b15915c29d988f54468b2', onClick: () => {
279
+ window.open(this.getReceiptUrl({ cartId }), '_blank');
280
+ }, size: "lg", variant: "primary" }, localization.translate('View receipt')))))))));
281
+ }
282
+ static get assetsDirs() { return ["assets"]; }
283
+ };
284
+ ZonosInvoiceFinish.style = ZonosInvoiceFinishStyle0;
285
+
286
+ 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">
287
+ <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"/>
288
+ </svg>
289
+ `;
290
+
291
+ const ZonosWordmark = `<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">
292
+ <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)"/>
293
+ <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)"/>
294
+ <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)"/>
295
+ <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)"/>
296
+ <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)"/>
297
+ </svg>
298
+ `;
299
+
300
+ const zonosInvoiceFooterCss = ":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--invoice-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--invoice-footer .zonos--invoice-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--invoice-footer .zonos--invoice-footer-icon-wrapper .zonos--invoice-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--invoice-footer .zonos--invoice-footer-icon-wrapper .zonos--invoice-footer-logo a{line-height:0}:host .zonos--invoice-footer .zonos--invoice-footer-icon-wrapper a{text-decoration:none}:host .zonos--invoice-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--invoice-footer .zonos--invoice-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--invoice-footer .zonos--invoice-locale-wrapper{gap:4px}}:host .zonos--invoice-footer .zonos--invoice-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--invoice-footer .zonos--invoice-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--invoice-footer .zonos--invoice-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--invoice-footer .zonos--invoice-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--invoice-footer .zonos--invoice-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--invoice-footer .zonos--invoice-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--invoice-footer .zonos--invoice-language-dialog.zonos--invoice-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--invoice-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile){-ms-flex-order:3;order:3}:host(.mobile) .zonos--invoice-locale-wrapper{display:none}:host(.mobile) .zonos--invoice-footer{-ms-flex-pack:center;justify-content:center}";
301
+ const ZonosInvoiceFooterStyle0 = zonosInvoiceFooterCss;
302
+
303
+ const ZonosInvoiceFooter = class {
304
+ constructor(hostRef) {
305
+ index.registerInstance(this, hostRef);
306
+ /**
307
+ * Override mobile mode
308
+ */
309
+ this.mobile = false;
310
+ /**
311
+ * Override tablet mode
312
+ */
313
+ this.tablet = false;
314
+ this.showLanguageDialog = false;
315
+ this.isMobile = false;
316
+ this.isTablet = false;
317
+ }
318
+ handleGlobalClick(e) {
319
+ if (!this.el.contains(e.target) && this.showLanguageDialog) {
320
+ this.showLanguageDialog = false;
321
+ }
322
+ }
323
+ toggleLanguageDialog() {
324
+ this.showLanguageDialog = !this.showLanguageDialog;
325
+ }
326
+ handleMobileChange() {
327
+ this.isMobile = isInvoiceMobileTablet.isInvoiceMobile(this.mobile);
328
+ }
329
+ handleTabletChange() {
330
+ this.isTablet = isInvoiceMobileTablet.isInvoiceTablet(this.tablet);
331
+ }
332
+ componentWillLoad() {
333
+ this.isMobile = isInvoiceMobileTablet.isInvoiceMobile(this.mobile);
334
+ this.isTablet = isInvoiceMobileTablet.isInvoiceTablet(this.tablet);
335
+ }
336
+ render() {
337
+ var _a;
338
+ const languageLabel = (_a = ILanguage.languages.find(x => x.code === localization.localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
339
+ // reverse color when on desktop. With the coversheet backdrop, the color should be white
340
+ const colorDesktop = 'gray-1000';
341
+ return (index.h(index.Host, { key: 'c84163fd8ab0bc0f2c791028b6896379a4ae6a27', class: classes.classes([
342
+ 'zonos--elements',
343
+ this.isMobile && 'mobile',
344
+ this.isTablet && 'tablet',
345
+ ]) }, index.h("div", { key: '099a3be332fa52c5e7551bdd2a618041c4a6eb22', class: "zonos--invoice-footer" }, index.h("div", { key: 'ab727f45f3a67bcdd51eb29b392462f15eb5fedd', class: "zonos--invoice-locale-wrapper" }, index.h("zonos-button", { key: '3d8431c78d54e0fe630677d0dd4ae2c975a208fa', buttonColor: colorDesktop, class: "zonos--invoice-footer-language-button", icon: index.h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), index.h("div", { key: '2920b4105b6209c4177fc91651dc5d9397d6abf2', class: classes.classes([
346
+ 'zonos--invoice-language-dialog',
347
+ this.showLanguageDialog &&
348
+ 'zonos--invoice-language-dialog-open',
349
+ ]) }, index.h("zonos-language-select", { key: '705e1a4243dc7ebc73c522a82f93c3d833240a95', handleOnClose: () => this.toggleLanguageDialog() }))), index.h("div", { key: '49c2d0ae1f587079b48f12d62d10eb422991255e', class: "zonos--invoice-footer-icon-wrapper" }, index.h("div", { key: '58a4da788527ddf4abd759b5e305e747aa96d540', class: "zonos--invoice-footer-logo" }, index.h("zonos-text", { key: '45bf1af64ec0f0a2e11e8d23361b71f4b4189881', textColor: colorDesktop }, localization.translate('Powered by')), index.h("a", { key: '1dd7224f3e126bcabe60a42c9529ab65c64f0063', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, index.h("zonos-icon", { key: '7dc21ce09b72bf37efd30e2c17b6d8b9328e8c3d', autoHeight: true, content: ZonosWordmark, size: 42 }))), index.h("div", { key: 'a0d053e6745733cd61868c109628a1835f4fe3ed', class: "dot" }), index.h("a", { key: 'fd467e88aa2ed10b707f88ed0d1a5af80af35539', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, index.h("zonos-text", { key: '35db684368ff8abc05c2c7fab22500270b0b7e21', textColor: colorDesktop }, localization.translate('Privacy policy')))))));
350
+ }
351
+ get el() { return index.getElement(this); }
352
+ static get watchers() { return {
353
+ "mobile": ["handleMobileChange"],
354
+ "tablet": ["handleTabletChange"]
355
+ }; }
356
+ };
357
+ ZonosInvoiceFooter.style = ZonosInvoiceFooterStyle0;
358
+
359
+ 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>`;
360
+
361
+ 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>`;
362
+
363
+ const zonosInvoiceOrderDetailsCss = ":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--order-details-header-text{display:-ms-flexbox;display:flex}: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-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}: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--invoice-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}:host .zonos--invoice-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--invoice-order-info .zonos--invoice-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--invoice-order-info .zonos--invoice-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--invoice-order-info .zonos--invoice-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--invoice-order-info .zonos--invoice-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";
364
+ const ZonosInvoiceOrderDetailsStyle0 = zonosInvoiceOrderDetailsCss;
365
+
366
+ const ZonosInvoiceOrderDetails = class {
367
+ constructor(hostRef) {
368
+ index.registerInstance(this, hostRef);
369
+ this.collapseClicked = index.createEvent(this, "collapseClicked", 7);
370
+ /**
371
+ * Whether or not the component is being rendered with mobile styles
372
+ */
373
+ this.mobile = true;
374
+ /**
375
+ * The landed cost id that is used to fetch the shipping address
376
+ */
377
+ this.landedCostId = '';
378
+ this.isMobile = false;
379
+ this.collapseState = this.collapsed;
380
+ }
381
+ handleCollapseChangeFromProp(collapsed) {
382
+ this.collapseState = collapsed;
383
+ }
384
+ handleCollapseChange(collapsed) {
385
+ this.collapseClicked.emit(collapsed);
386
+ }
387
+ handleWindowResize() {
388
+ this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
389
+ }
390
+ componentWillLoad() {
391
+ this.handleWindowResize();
392
+ }
393
+ render() {
394
+ const renderCollapseIcon = () => {
395
+ if (this.collapseState) {
396
+ return (index.h("zonos-icon", { "aria-label": "Collapse expanded section", content: ChevronDownIcon, iconColor: "gray-1200" }));
397
+ }
398
+ return (index.h("zonos-icon", { "aria-label": "Expand collapsed section", content: ChevronUpIcon, iconColor: "gray-1200" }));
399
+ };
400
+ return (index.h(index.Host, { class: classes.classes([
401
+ 'zonos--invoice-order-details zonos--elements',
402
+ this.isMobile && 'mobile',
403
+ ]) }, index.h("div", { class: "zonos--wrapper" }, index.h("button", { class: "zonos--order-details-header", onClick: () => {
404
+ this.collapseState = !this.collapseState;
405
+ }, type: "button" }, index.h("div", { class: "zonos--order-details-header-text" }, index.h("zonos-text", { type: "boldSubheader" }, localization.translate('Pay [organizationName]', {
406
+ organizationName: zonosStore.zonosStore.organizationName,
407
+ })), renderCollapseIcon()), index.h("zonos-text", { type: "boldSubheader" }, renderCheckoutCurrency.renderCheckoutCurrency({
408
+ amount: invoice.invoiceStore.amountTotalDue || 0,
409
+ isForeign: true,
410
+ }))), index.h("div", { class: "zonos--order-details-wrapper" }, index.h("zonos-collapse", { collapsed: this.collapseState }, index.h("div", { class: "zonos--invoice-order-details-content" }, index.h("zonos-invoice-cart-items", { isMobile: this.isMobile }), index.h("zonos-invoice-subtotal", { isMobile: this.isMobile })))))));
411
+ }
412
+ static get assetsDirs() { return ["assets"]; }
413
+ static get watchers() { return {
414
+ "collapsed": ["handleCollapseChangeFromProp"],
415
+ "collapseState": ["handleCollapseChange"]
416
+ }; }
417
+ };
418
+ ZonosInvoiceOrderDetails.style = ZonosInvoiceOrderDetailsStyle0;
419
+
420
+ 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>`;
421
+
422
+ 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>`;
423
+
424
+ const zonosInvoicePaymentCss = ".sc-zonos-invoice-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-invoice-payment-h *.sc-zonos-invoice-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-invoice-payment-h img.sc-zonos-invoice-payment{max-width:100%}.sc-zonos-invoice-payment-h dl.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h dd.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h1.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h2.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h3.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h4.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h5.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h h6.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h hr.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h figure.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h p.sc-zonos-invoice-payment,.sc-zonos-invoice-payment-h pre.sc-zonos-invoice-payment{margin:0}.sc-zonos-invoice-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-invoice-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-invoice-payment-h .zonos--title.sc-zonos-invoice-payment{margin-bottom:24px}.sc-zonos-invoice-payment-h .zonos--group.sc-zonos-invoice-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-invoice-payment-h .zonos--group.sc-zonos-invoice-payment::-webkit-scrollbar{width:10px}.sc-zonos-invoice-payment-h .zonos--group.sc-zonos-invoice-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-invoice-payment-h .zonos--group.sc-zonos-invoice-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-invoice-payment-h .zonos--group.sc-zonos-invoice-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-invoice-payment-h .zonos--payment-error-banner.sc-zonos-invoice-payment{margin-bottom:8px}.sc-zonos-invoice-payment-h .zonos--error-banner.sc-zonos-invoice-payment{margin-bottom:16px}.sc-zonos-invoice-payment-h zonos-button.sc-zonos-invoice-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-invoice-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-invoice-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-invoice-payment-h .zonos--group-btn.sc-zonos-invoice-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-invoice-payment-h .zonos--group-btn.sc-zonos-invoice-payment zonos-text.sc-zonos-invoice-payment{text-align:center}.sc-zonos-invoice-payment-h .zonos--group-btn.sc-zonos-invoice-payment zonos-button.sc-zonos-invoice-payment{width:100%}.sc-zonos-invoice-payment-h .zonos--test-cards.sc-zonos-invoice-payment{margin-top:auto;padding-top:16px}";
425
+ const ZonosInvoicePaymentStyle0 = zonosInvoicePaymentCss;
426
+
427
+ const ZonosInvoicePayment = class {
428
+ constructor(hostRef) {
429
+ index.registerInstance(this, hostRef);
430
+ this.continueClicked = index.createEvent(this, "continueClicked", 7);
431
+ this.paypalSessionFailed = index.createEvent(this, "paypalSessionFailed", 7);
432
+ this.paypalSessionDone = index.createEvent(this, "paypalSessionDone", 7);
433
+ this.storeUnsubscribeList = [];
434
+ /**
435
+ * Whether or not the continue button is loading
436
+ */
437
+ this.continueLoading = false;
438
+ /**
439
+ * Show error banner when the form is not complete, and user clicks on `Submit` button
440
+ * @default false
441
+ */
442
+ this.showErrorBanner = false;
443
+ /**
444
+ * Show payment error banner when the payment is failed
445
+ */
446
+ this.hasStripePaymentError = false;
447
+ /**
448
+ * Error message when the staging order creation is failed
449
+ */
450
+ this.stagingOrderCreateErrorMessage = '';
451
+ /**
452
+ * Internal state to handle continue loading
453
+ */
454
+ this.internalContinueLoading = this.continueLoading;
455
+ this.handleValidate = () => {
456
+ var _a;
457
+ return !!((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
458
+ };
459
+ /**
460
+ * handler for continue button click
461
+ */
462
+ this.continueClickHandler = async ({ currencyCode, }) => {
463
+ var _a, _b;
464
+ if (!this.handleValidate()) {
465
+ // Attempt to get the value of the billing address element to validate the form
466
+ void ((_a = cart.stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
467
+ this.showErrorBanner = true;
468
+ // Attempt to submit the form so the missing input error will be shown in Stripe
469
+ void ((_b = cart.stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
470
+ setTimeout(() => {
471
+ var _a;
472
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
473
+ behavior: 'smooth',
474
+ });
475
+ }, 10);
476
+ return;
477
+ }
478
+ cart.stripeStore.checkoutSettlementCurrency = currencyCode;
479
+ // submit google tag when the form is complete
480
+ paypal.submitGtag('zonos-checkout-payment-info');
481
+ this.continueClicked.emit();
482
+ };
483
+ this.copyCardToClipboard = async (cardNumber) => {
484
+ try {
485
+ await navigator.clipboard.writeText(cardNumber);
486
+ }
487
+ catch (_a) {
488
+ // Copy happens in the iframe and it's not allowed to copy to the clipboard
489
+ const hiddenTextarea = document.createElement('textarea');
490
+ hiddenTextarea.style.position = 'fixed';
491
+ hiddenTextarea.style.left = '-1000px';
492
+ hiddenTextarea.style.top = '-1000px';
493
+ hiddenTextarea.style.width = '1px';
494
+ hiddenTextarea.style.height = '1px';
495
+ hiddenTextarea.value = cardNumber;
496
+ hiddenTextarea.id = 'zonos-copy-card-number';
497
+ document.body.appendChild(hiddenTextarea);
498
+ hiddenTextarea.select();
499
+ // Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
500
+ // eslint-disable-next-line deprecation/deprecation
501
+ document.execCommand('copy');
502
+ document.body.removeChild(hiddenTextarea);
503
+ }
504
+ window.Zonos.showNotification({
505
+ message: localization.translate('Card number copied to clipboard'),
506
+ timeout: 4000,
507
+ type: 'success',
508
+ });
509
+ };
510
+ this.placeTestOrder = async () => {
511
+ this.internalContinueLoading = true;
512
+ const { errors } = await placeTestOrder.placeTestOrder();
513
+ if (errors.length) {
514
+ this.stagingOrderCreateErrorMessage =
515
+ errors[0] || 'Failed to create staging order. Please try again.';
516
+ this.internalContinueLoading = false;
517
+ return;
518
+ }
519
+ this.internalContinueLoading = false;
520
+ // continue to the next step
521
+ cart.cartStoreNextStep();
522
+ };
523
+ }
524
+ continueLoadingWatcher() {
525
+ this.internalContinueLoading = this.continueLoading;
526
+ }
527
+ stripePaymentErrorWatcher() {
528
+ if (this.hasStripePaymentError) {
529
+ setTimeout(() => {
530
+ var _a;
531
+ // scroll to the top of the page when the payment error is shown
532
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
533
+ behavior: 'smooth',
534
+ });
535
+ }, 50);
536
+ }
537
+ }
538
+ componentWillLoad() {
539
+ this.storeUnsubscribeList = [
540
+ cart.cartStoreOnChange('currency', () => {
541
+ // start init paypal with the presentment currency when landed cost is fetched
542
+ void paypal.paypalInitScript({
543
+ currency: cart.cartStore.currency,
544
+ });
545
+ }),
546
+ ];
547
+ // start init paypal with the presentment currency when landed cost is fetched
548
+ void paypal.paypalInitScript({
549
+ currency: cart.cartStore.currency,
550
+ });
551
+ }
552
+ disconnectedCallback() {
553
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
554
+ }
555
+ render() {
556
+ var _a;
557
+ this.hasStripePaymentError = cart.stripeStore.hasPaymentError;
558
+ if (!cart.stripeStore.stripeElements) {
559
+ return null;
560
+ }
561
+ if (!cart.stripeStore.clientSecret) {
562
+ return null;
563
+ }
564
+ // start validate on typing after error banner is shown, and hide it if the form is complete
565
+ if (this.showErrorBanner) {
566
+ this.showErrorBanner = !this.handleValidate();
567
+ }
568
+ const isTestMode = handleFetch.getIsTestMode();
569
+ const isStagingMode = cart.cartStore.isStagingMode || handleFetch.getIsStagingMode();
570
+ const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
571
+ const renderPayment = () => {
572
+ if (isStagingMode) {
573
+ // If in mobile, use the theme from the store since the UI is solely by theme
574
+ const theme = zonosStore.zonosStore.appearance.theme;
575
+ return (index.h(index.Fragment, null, this.stagingOrderCreateErrorMessage && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), index.h("zonos-empty-state-payment", { emptyStateText: localization.translate('No payment method needed for staging'), theme: theme }), index.h("div", { class: "zonos--group-btn" }, index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
576
+ void this.placeTestOrder();
577
+ }, size: "lg",
578
+ // use primary type when on mobile mode
579
+ variant: this.submitBtnType }, localization.translate('Place test order')))));
580
+ }
581
+ if (cart.stripeStore.isFetchingSession || invoice.invoiceStore.isFetchingPayorInfo) {
582
+ return null;
583
+ }
584
+ return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, localization.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
585
+ localization.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
586
+ cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
587
+ cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
588
+ if (!cart.cartStore.checkoutSession) {
589
+ VarianceTest.log('Checkout session is not found');
590
+ return;
591
+ }
592
+ await this.continueClickHandler({
593
+ currencyCode: cart.cartStore.checkoutSession.subtotals
594
+ .presentmentCurrencyCode,
595
+ });
596
+ }, size: "lg",
597
+ // use primary type when on mobile mode
598
+ variant: this.submitBtnType }, localization.translate('Pay [orderTotal]', {
599
+ orderTotal: renderCheckoutCurrency.renderCheckoutCurrency({
600
+ amount: invoice.invoiceStore.amountTotalDue || 0,
601
+ isForeign: true,
602
+ }),
603
+ })), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
604
+ cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
605
+ cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
606
+ await this.continueClickHandler({
607
+ currencyCode: 'USD',
608
+ });
609
+ }, size: "lg", variant: "subtle" }, localization.translate('Click to pay in USD'))))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
610
+ this.paypalSessionDone.emit(orderId);
611
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
612
+ display: isPaypalTabSelected ? 'block' : 'none',
613
+ } })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, localization.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, localization.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, localization.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
614
+ };
615
+ return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, localization.translate('Payment method')), renderPayment())));
616
+ }
617
+ get ele() { return index.getElement(this); }
618
+ static get watchers() { return {
619
+ "continueLoading": ["continueLoadingWatcher"],
620
+ "hasStripePaymentError": ["stripePaymentErrorWatcher"]
621
+ }; }
622
+ };
623
+ ZonosInvoicePayment.style = ZonosInvoicePaymentStyle0;
624
+
625
+ const zonosInvoiceReviewCss = ":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}";
626
+ const ZonosInvoiceReviewStyle0 = zonosInvoiceReviewCss;
627
+
628
+ const ZonosInvoiceReview = class {
629
+ constructor(hostRef) {
630
+ index.registerInstance(this, hostRef);
631
+ /**
632
+ * Whether or not the component is being rendered with mobile styles
633
+ */
634
+ this.mobile = false;
635
+ /**
636
+ * Whether or not the component is being rendered with tablet styles
637
+ */
638
+ this.tablet = false;
639
+ /**
640
+ * Whether or not to show the collapse icon
641
+ * This is controled from the collapsed state of the zonos-collapse component
642
+ * to show the collapse icon
643
+ */
644
+ this.collapsed = false;
645
+ this.isMobile = false;
646
+ this.isTablet = false;
647
+ this.isLoading = true;
648
+ }
649
+ handleWindowResize() {
650
+ this.isMobile = isInvoiceMobileTablet.isInvoiceMobile(this.mobile);
651
+ this.isTablet = isInvoiceMobileTablet.isInvoiceTablet(this.tablet);
652
+ }
653
+ componentWillLoad() {
654
+ this.handleWindowResize();
655
+ // Wait for the data to load
656
+ setTimeout(() => {
657
+ this.isLoading = false;
658
+ }, 1000);
659
+ }
660
+ render() {
661
+ const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
662
+ return (index.h(index.Host, { key: '60da23c47f39a94478f1eb83e003b788aab3b98c', class: classes.classes([
663
+ 'zonos--invoice-review zonos--elements',
664
+ this.isMobile && 'mobile',
665
+ this.isTablet && 'tablet',
666
+ ]) }, index.h("div", { key: '70bbb1973ec1c7197da666ba30be6dc6a20bd386', class: "zonos--title" }, index.h("zonos-text", { key: '35ffffa411ccde7c702b5d5ac3f11d7a8d62916f', textColor: titleTextColor, type: 'semiBoldLabel' }, localization.translate('Pay [organizationName]', {
667
+ organizationName: zonosStore.zonosStore.organizationName,
668
+ }))), index.h("div", { key: 'c965e47314d1c3178b1dd2e54e835c0b91966a81', class: "zonos--total-pay" }, renderFallback.renderFallback({
669
+ content: (index.h("zonos-text", { type: 'secondaryPageHeader' }, renderCheckoutCurrency.renderCheckoutCurrency({
670
+ amount: invoice.invoiceStore.amountTotalDue || 0,
671
+ isForeign: true,
672
+ }))),
673
+ isLoading: invoice.invoiceStore.isFetchingPayorInfo,
674
+ skeletonHeight: '36px',
675
+ skeletonWidth: '150px',
676
+ }))));
677
+ }
678
+ static get assetsDirs() { return ["assets"]; }
679
+ };
680
+ ZonosInvoiceReview.style = ZonosInvoiceReviewStyle0;
681
+
682
+ exports.zonos_invoice_finish = ZonosInvoiceFinish;
683
+ exports.zonos_invoice_footer = ZonosInvoiceFooter;
684
+ exports.zonos_invoice_order_details = ZonosInvoiceOrderDetails;
685
+ exports.zonos_invoice_payment = ZonosInvoicePayment;
686
+ exports.zonos_invoice_review = ZonosInvoiceReview;