@zonos/elements 1.3.263 → 1.3.264

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 (266) hide show
  1. package/dist/cjs/{cart-02a93797.js → cart-d4486651.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-751ef38b.js → hasInclusivePrice-40358cb1.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-215b8d2b.js → invoice-600fa2a4.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-0d909501.js → isCollectMobileTablet-f56566ef.js} +2 -2
  6. package/dist/cjs/{localization-68ebf7c6.js → localization-06cc0379.js} +15 -1
  7. package/dist/cjs/{paypal-f8a0cca3.js → paypal-52c4a4d4.js} +2 -2
  8. package/dist/cjs/{placeTestOrder-ce734b60.js → placeTestOrder-7c88197a.js} +2 -2
  9. package/dist/cjs/{renderCheckoutCurrency-d163c1c4.js → renderCheckoutCurrency-2ebeff09.js} +2 -2
  10. package/dist/cjs/zonos-address-display_8.cjs.entry.js +19 -19
  11. package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
  12. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
  15. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +17 -15
  16. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +210 -60
  18. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +22 -20
  21. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
  24. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -11
  26. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  29. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -8
  30. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +17 -15
  31. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  32. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  33. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  34. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
  36. package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
  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/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +5 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +4 -2
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +52 -0
  42. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
  43. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +2 -2
  44. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +5 -0
  45. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +5 -3
  46. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
  47. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
  48. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
  49. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +2 -2
  50. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.css +5 -0
  51. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +5 -3
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
  53. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
  54. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  55. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  56. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  57. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  58. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  59. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  60. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  61. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  62. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  63. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  64. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  65. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  66. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  67. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  68. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  69. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  70. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  71. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  72. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  73. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
  74. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  75. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  76. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  77. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  78. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  79. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  80. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  81. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +5 -0
  82. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +4 -2
  83. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  84. package/dist/collection/components/main/zonos-controller.js +1 -1
  85. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  86. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  87. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  88. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  89. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  90. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +1 -1
  91. package/dist/collection/components/utils/checkout/getBigCommerceCustomerAddresses.js +99 -0
  92. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +15 -0
  93. package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +1 -1
  94. package/dist/esm/{cart-34b11708.js → cart-41f41429.js} +1 -1
  95. package/dist/esm/{hasInclusivePrice-dfb21fc9.js → hasInclusivePrice-afc0dd6e.js} +1 -1
  96. package/dist/esm/index.js +7 -7
  97. package/dist/esm/{invoice-6d8bdf21.js → invoice-e6721745.js} +2 -2
  98. package/dist/esm/{isCollectMobileTablet-85403c93.js → isCollectMobileTablet-d02bb448.js} +2 -2
  99. package/dist/esm/{localization-2e523b35.js → localization-ee06df70.js} +15 -1
  100. package/dist/esm/{paypal-d3b3d967.js → paypal-ac74241f.js} +2 -2
  101. package/dist/esm/{placeTestOrder-e1d6dfcd.js → placeTestOrder-0416d327.js} +2 -2
  102. package/dist/esm/{renderCheckoutCurrency-cc72a6c2.js → renderCheckoutCurrency-99da51f5.js} +2 -2
  103. package/dist/esm/zonos-address-display_8.entry.js +19 -19
  104. package/dist/esm/zonos-address_4.entry.js +8 -8
  105. package/dist/esm/zonos-badge.entry.js +3 -3
  106. package/dist/esm/zonos-button_3.entry.js +3 -3
  107. package/dist/esm/zonos-card_5.entry.js +9 -9
  108. package/dist/esm/zonos-cart-items_12.entry.js +17 -15
  109. package/dist/esm/zonos-checkbox_2.entry.js +5 -5
  110. package/dist/esm/zonos-checkout.entry.js +211 -61
  111. package/dist/esm/zonos-collapse.entry.js +2 -2
  112. package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -6
  113. package/dist/esm/zonos-collect-finish_6.entry.js +22 -20
  114. package/dist/esm/zonos-collect.entry.js +4 -4
  115. package/dist/esm/zonos-component.entry.js +1 -1
  116. package/dist/esm/zonos-controller.entry.js +3 -3
  117. package/dist/esm/zonos-country-flag.entry.js +1 -1
  118. package/dist/esm/zonos-country-select_4.entry.js +13 -11
  119. package/dist/esm/zonos-hello-dialog.entry.js +6 -6
  120. package/dist/esm/zonos-hello.entry.js +1 -1
  121. package/dist/esm/zonos-input.entry.js +4 -4
  122. package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -8
  123. package/dist/esm/zonos-invoice-finish_5.entry.js +17 -15
  124. package/dist/esm/zonos-invoice.entry.js +4 -4
  125. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  126. package/dist/esm/zonos-link.entry.js +1 -1
  127. package/dist/esm/zonos-logo.entry.js +2 -2
  128. package/dist/esm/zonos-store-credit.entry.js +3 -3
  129. package/dist/esm/zonos-stripe-input.entry.js +4 -4
  130. package/dist/esm/zonos-tooltip.entry.js +2 -2
  131. package/dist/esm/zonos-v-stack.entry.js +2 -2
  132. package/dist/esm-es5/{cart-34b11708.js → cart-41f41429.js} +1 -1
  133. package/dist/esm-es5/{hasInclusivePrice-dfb21fc9.js → hasInclusivePrice-afc0dd6e.js} +1 -1
  134. package/dist/esm-es5/index.js +1 -1
  135. package/dist/esm-es5/{invoice-6d8bdf21.js → invoice-e6721745.js} +1 -1
  136. package/dist/esm-es5/{isCollectMobileTablet-85403c93.js → isCollectMobileTablet-d02bb448.js} +1 -1
  137. package/dist/esm-es5/{localization-2e523b35.js → localization-ee06df70.js} +1 -1
  138. package/dist/esm-es5/{paypal-d3b3d967.js → paypal-ac74241f.js} +1 -1
  139. package/dist/esm-es5/{placeTestOrder-e1d6dfcd.js → placeTestOrder-0416d327.js} +1 -1
  140. package/dist/esm-es5/{renderCheckoutCurrency-cc72a6c2.js → renderCheckoutCurrency-99da51f5.js} +1 -1
  141. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  142. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  143. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  144. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  145. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  146. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  147. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  148. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  149. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  150. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  151. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  152. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  153. package/dist/esm-es5/zonos-component.entry.js +1 -1
  154. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  155. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  156. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  157. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  158. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  159. package/dist/esm-es5/zonos-input.entry.js +1 -1
  160. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  161. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  162. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  163. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  164. package/dist/esm-es5/zonos-link.entry.js +1 -1
  165. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  166. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  167. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  168. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  169. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  170. package/dist/scripts/index.js +1 -1
  171. package/dist/scripts/loadZonos.js +1 -1
  172. package/dist/scripts/zonos.js +1 -1
  173. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +9 -0
  174. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +22 -11
  175. package/dist/types/components/utils/checkout/getBigCommerceCustomerAddresses.d.ts +26 -0
  176. package/dist/zonos-elements/index.esm.js +1 -1
  177. package/dist/zonos-elements/{p-17b6f9ff.system.entry.js → p-0529a06b.system.entry.js} +1 -1
  178. package/dist/zonos-elements/{p-227a1ecc.system.js → p-076ca381.system.js} +1 -1
  179. package/dist/zonos-elements/{p-bccae0df.entry.js → p-07cdff18.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-dc71be6f.system.entry.js → p-0914b8a1.system.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-155b4425.entry.js → p-0b4ba025.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-c361d520.system.entry.js → p-0f9a04fe.system.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-c2b86522.js → p-14ce8e3a.js} +1 -1
  184. package/dist/zonos-elements/{p-a3936c44.system.entry.js → p-15f70aae.system.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-b1c76c38.system.entry.js → p-16948eea.system.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-5290d104.entry.js → p-1ed2827f.entry.js} +1 -1
  187. package/dist/zonos-elements/p-20e0c24e.entry.js +1 -0
  188. package/dist/zonos-elements/{p-5496e9ae.system.js → p-24aae506.system.js} +1 -1
  189. package/dist/zonos-elements/{p-92f40018.system.entry.js → p-2555ba6b.system.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-1f107c84.entry.js → p-258c0551.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-30b19a4e.system.entry.js → p-274a7c0e.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-fb87172c.entry.js → p-283ffaad.entry.js} +1 -1
  193. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  194. package/dist/zonos-elements/{p-25b5ac23.system.entry.js → p-2c027b67.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-2fc253b3.js +1 -0
  196. package/dist/zonos-elements/{p-e06936f4.entry.js → p-32ecece3.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-de44cccd.system.entry.js → p-349bdc03.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-adeaa7cf.entry.js → p-34dc7755.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-356b2068.js → p-37f47658.js} +1 -1
  200. package/dist/zonos-elements/{p-9c5cce08.system.entry.js → p-3a23ec5f.system.entry.js} +1 -1
  201. package/dist/zonos-elements/p-3bc1adb7.entry.js +1 -0
  202. package/dist/zonos-elements/p-41f2e301.entry.js +1 -0
  203. package/dist/zonos-elements/{p-a50d095f.js → p-4220556e.js} +1 -1
  204. package/dist/zonos-elements/{p-926c33b1.system.entry.js → p-42518502.system.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-2b40fab2.entry.js → p-52077d7c.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-70c485df.js → p-551dd2e0.js} +1 -1
  207. package/dist/zonos-elements/{p-5d32f10f.system.entry.js → p-5678c044.system.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-15161658.entry.js → p-59aa5785.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-20e1a5a0.entry.js → p-66edcaa4.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-b8710131.entry.js → p-6b9ad020.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-a076cf7f.system.js → p-721069c3.system.js} +1 -1
  212. package/dist/zonos-elements/{p-501d16ad.system.entry.js → p-72833da8.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-96f8cea8.entry.js → p-7564d199.entry.js} +1 -1
  214. package/dist/zonos-elements/{p-8331aa21.system.entry.js → p-79f3c227.system.entry.js} +1 -1
  215. package/dist/zonos-elements/p-84c7cae6.system.entry.js +1 -0
  216. package/dist/zonos-elements/{p-0f3b9ed7.entry.js → p-86ed51fd.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-73765370.system.entry.js → p-88596f27.system.entry.js} +1 -1
  218. package/dist/zonos-elements/p-8a01157e.system.entry.js +1 -0
  219. package/dist/zonos-elements/{p-7e313e45.entry.js → p-8a21ed2d.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-191661c6.system.entry.js → p-90a19f4c.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-562fbdab.js → p-90d19cb6.js} +1 -1
  222. package/dist/zonos-elements/{p-024a4af5.entry.js → p-9288878f.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-2381985c.entry.js → p-92a14180.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-22a8b44b.system.js → p-98c53c77.system.js} +1 -1
  225. package/dist/zonos-elements/{p-7297f6bd.system.entry.js → p-9da832b2.system.entry.js} +1 -1
  226. package/dist/zonos-elements/{p-1c1149ff.js → p-9eff0691.js} +1 -1
  227. package/dist/zonos-elements/{p-47a58a38.system.entry.js → p-9f18348f.system.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-1b5d90ee.system.entry.js → p-a2e9b2aa.system.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-51c60875.system.entry.js → p-a5f5993f.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-65ea8ae4.js → p-a901d002.js} +1 -1
  231. package/dist/zonos-elements/{p-fe5303d1.entry.js → p-ab73cbed.entry.js} +1 -1
  232. package/dist/zonos-elements/p-b0526805.system.entry.js +1 -0
  233. package/dist/zonos-elements/{p-bee55d71.entry.js → p-b13d56b9.entry.js} +1 -1
  234. package/dist/zonos-elements/p-b32cd0c5.system.js +1 -0
  235. package/dist/zonos-elements/{p-f440cd53.entry.js → p-b4b23475.entry.js} +1 -1
  236. package/dist/zonos-elements/{p-7b6e65d6.system.js → p-b65bca4b.system.js} +1 -1
  237. package/dist/zonos-elements/p-ba7cf5e8.system.entry.js +1 -0
  238. package/dist/zonos-elements/{p-45ceb26f.system.entry.js → p-c0fffa75.system.entry.js} +1 -1
  239. package/dist/zonos-elements/p-c52bc5ad.system.entry.js +1 -0
  240. package/dist/zonos-elements/{p-07c228a7.entry.js → p-cc481c69.entry.js} +1 -1
  241. package/dist/zonos-elements/p-ccc4f69b.entry.js +1 -0
  242. package/dist/zonos-elements/{p-60a391b8.system.js → p-ce855245.system.js} +1 -1
  243. package/dist/zonos-elements/{p-4d776228.entry.js → p-d1ff24f5.entry.js} +1 -1
  244. package/dist/zonos-elements/p-d6b49830.entry.js +1 -0
  245. package/dist/zonos-elements/{p-b2d462f9.system.js → p-db607fc3.system.js} +1 -1
  246. package/dist/zonos-elements/{p-4d0b8897.system.js → p-dea75665.system.js} +1 -1
  247. package/dist/zonos-elements/{p-6a11cccc.system.entry.js → p-e3bc3917.system.entry.js} +1 -1
  248. package/dist/zonos-elements/{p-e0ea6e24.entry.js → p-e5582c35.entry.js} +1 -1
  249. package/dist/zonos-elements/{p-7dbac3ae.system.entry.js → p-e6cc5a25.system.entry.js} +1 -1
  250. package/dist/zonos-elements/{p-3ae1a543.entry.js → p-f546bd7d.entry.js} +1 -1
  251. package/dist/zonos-elements/{p-235ee1d3.entry.js → p-f9c715ad.entry.js} +1 -1
  252. package/dist/zonos-elements/{p-50a15e3d.system.entry.js → p-fb684748.system.entry.js} +1 -1
  253. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  254. package/package.json +1 -1
  255. package/dist/zonos-elements/p-06d8f294.entry.js +0 -1
  256. package/dist/zonos-elements/p-1fb6b787.entry.js +0 -1
  257. package/dist/zonos-elements/p-3baf98a0.system.entry.js +0 -1
  258. package/dist/zonos-elements/p-4039b72d.system.entry.js +0 -1
  259. package/dist/zonos-elements/p-5834833a.entry.js +0 -1
  260. package/dist/zonos-elements/p-5aa86f9c.entry.js +0 -1
  261. package/dist/zonos-elements/p-79a7998f.system.entry.js +0 -1
  262. package/dist/zonos-elements/p-8603fb37.system.entry.js +0 -1
  263. package/dist/zonos-elements/p-97f0eda6.system.js +0 -1
  264. package/dist/zonos-elements/p-c4d057b0.js +0 -1
  265. package/dist/zonos-elements/p-cda0b441.entry.js +0 -1
  266. package/dist/zonos-elements/p-e4792f63.system.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,o,n){function s(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function r(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n["throw"](t))}catch(t){i(t)}}function l(t){t.done?o(t.value):s(t.value).then(r,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(n=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1];i=a;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(a);break}if(i[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];s=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{t as throttle_1}from"./throttle-882b1f47.js";import{b as stripeStore,t as trackConversionEvent,Q as extractName,E as stripeStoreOnChange,q as stripeStorePrefetchLandedCost,d as cartStore}from"./cart-34b11708.js";import{s as storageStore,r as getFallbackDefaultCountryCode,t as translate,q as storageStoreOnChange,l as localizationStore}from"./localization-2e523b35.js";import{z as zonosStore,g as getZonosStoreTheme,f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{l as logError,i as isCheckoutMobile,s as sendErrorLog}from"./handleFetch-a844cac1.js";import{a as shouldRenderTaxIdInput,s as shouldRenderShortAddressCodeInput}from"./shouldRenderTaxIdInput-2572bf77.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./TaxId-50d72254.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import"./debounce-ab526ca0.js";import"./isDarkColor-0a8453e7.js";import"./ShortAddressCode-7620e622.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function t(t){registerInstance(this,t);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.taxIdChanged=createEvent(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=storageStore.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=throttle_1(stripeStorePrefetchLandedCost,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};t.prototype.updateAddressEventData=function(t){var e=t.event,o=t.type;switch(o){case"billing":stripeStore.stripeBillingAddressEventData=e;break;default:{stripeStore.stripeAddressEventData=e;break}}if(o==="shipping"){if(e.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!storageStore.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var e=t.stripeAddressElement,o=t.type;if(o==="shipping"){stripeStore.stripeAddressElement=e;return}stripeStore.stripeBillingAddressElement=e};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n,s,i,r,a,l,c;var d=this;return __generator(this,(function(h){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),e=t.stripeAddressEventData,o=t.stripeElements;if(!this.stripe||!o){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}n=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));s=localizationStore.shippingZoneCountries;i=s?Object.values(s).map((function(t){return t.code})):[];r=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");a=this.type==="shipping"?i:[];l=(e===null||e===void 0?void 0:e.value.address.country)||getFallbackDefaultCountryCode(a);log("Stripe country code: ".concat(l),"info");c=o.create("address",{allowedCountries:r?[]:a,contacts:n.length&&!e?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},e===null||e===void 0?void 0:e.value.address),{country:l}),firstName:e===null||e===void 0?void 0:e.value.firstName,lastName:e===null||e===void 0?void 0:e.value.lastName,phone:e===null||e===void 0?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));if(e===null||e===void 0?void 0:e.value.address){this.prevCountry=e.value.address.country;this.prevPostalCode=e.value.address.postal_code}c.on("change",(function(t){var e=t.value;if(!d.isDirtyAddress&&e.address.line1.length>=3){d.isDirtyAddress=true;if(!d.isAutoCompleteAdjusted){var o=d.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(o){o.style.zIndex="3"}d.isAutoCompleteAdjusted=true}setTimeout((function(){if(isCheckoutMobile()){d.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=d.type==="shipping"?100:600;var e=d.el.closest(".zonos--group");var o=d.el.getBoundingClientRect().top+t;e===null||e===void 0?void 0:e.scrollTo({behavior:"smooth",top:o})}}),600)}var n=extractName({firstName:e.firstName,lastName:e.lastName,name:e.name}),s=n.firstName,i=n.lastName;d.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:d.type,elementType:"address",value:Object.assign(Object.assign({},e),{firstName:s,lastName:i})}),type:d.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,e){var o=JSON.stringify(e);var n=JSON.stringify(t);if(o===n){return}log("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var s=this.getStripeAddressInstance().stripeAddressElement;s===null||s===void 0?void 0:s.clear();s===null||s===void 0?void 0:s.destroy();if(this.type==="shipping"){stripeStore.stripeAddressEventData=null}else{stripeStore.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return countryRequireTaxId.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var e;if(this.type==="billing"){return null}var o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value.address.country;if(!o){return null}if(!this.isInTaxIdCountry(o)){return null}var n=shouldRenderTaxIdInput({companyName:stripeStore.companyName,countryCode:o});if(!n){return null}var s=shipToTaxIdLabels[o];return h("div",{class:"zonos--tax-id-input"},h("zonos-stripe-input",{inputLabel:translate(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:stripeStore.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(e){stripeStore.taxId=e.detail;t.taxIdChanged.emit(e.detail)}}),this.taxIdErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var e=(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!e){return null}var o=shouldRenderShortAddressCodeInput({countryCode:e});if(!o){return null}return h("div",{class:"zonos--short-address-code-input"},h("zonos-stripe-input",{inputLabel:translate("Short address code"),inputPlaceholder:"RRRD2929",inputValue:stripeStore.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){stripeStore.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=zonosStore.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return h("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:translate("Company name (optional)"),inputValue:stripeStore.companyName,onInputChange:function(t){stripeStore.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=storageStore.checkoutSessionId;this.storeUnsubscribeList=[storageStoreOnChange("checkoutSessionId",(function(){t.checkoutSessionId=storageStore.checkoutSessionId})),stripeStoreOnChange("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),stripeStoreOnChange("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=storageStore.checkoutSessionId;if((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return h(Host,{key:"300434f0623d886693dc101b47cb5cd5f9503d3e",class:classes(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&h("zonos-text",{key:"eb7592c563d728af019db397f4d5e7e9f448f4d7",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("slot",{key:"c9556ead2ad1bf1b462637ae44834dc4f25afa8a",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),h("div",{key:"cecaa1a9b4a176607125106f55b6e4d6cab31705",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}();ZonosAddress.style=ZonosAddressStyle0;var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=":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 .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var ZonosConfirmDialogStyle0=zonosConfirmDialogCss;var ZonosConfirmDialog=function(){function t(t){var e=this;registerInstance(this,t);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);this.dialogTitle=translate("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var e,o;(o=(e=t.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||o===void 0?void 0:o.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var e=getBorderRadius();var o=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"3f86259272e4aee2cb846ee15cad8e616917b020",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":o,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"e4f146413bfb70c1d7c3629da6830482060f975a",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"272c6ef86a66a5e61c7fc1753b4b60ce7bc25aee",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return t.clickOutsideDialogHandler(e)}},h("div",{key:"e533b39f91579923dcd725edf8b602cba80b8857",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},h("div",{key:"16c171b80dbee7c033ea35731afa6537222c7458",class:"wrapper"},h("div",{key:"7f3bd95d72a06ecadf22df0a332292050d9907f9",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"e234a037041b1fc7b558c841ddc03da940213bd7",class:"content"},h("div",{key:"37492c329f9bd02e199828b57a16de616800d0fc",class:"title"},h("zonos-text",{key:"d935e67d0004c8f5c925082f222cff4e95568b6a",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"58acbdb5ace31ece6d900f21637dab17aa797ad8",class:"subtitle"},h("zonos-text",{key:"981f15fc921e9d2ff2749fea94f21859cbf51fe3",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"07e17ccc316ee180a72705f1d76a9c6f2927bfd7",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"6b1b270b13c1a274e93d33ef4c1ca6798499c5c2",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"befd3b801cb8cf5b41c3c74e8947f2977aa77ce1",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosConfirmDialog.style=ZonosConfirmDialogStyle0;var validateEmailValue=function(t){var e=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return e.test(t)};var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var MAX_RETRIES_INITIALIZE_LINK=51;var ZonosLinkAuthentication=function(){function t(t){var e=this;registerInstance(this,t);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=stripeStore.stripe;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var e=validateEmailValue(t);var o={complete:!!e,elementType:"linkAuthentication",empty:!t,value:{email:t}};stripeStore.stripeLinkEventData=o};this.handleNormalEmailInput=function(t){var o;var n=t.detail;e.setCustomEmailInputToLinkEvent(n);(o=e.linkAuthenticationChange)===null||o===void 0?void 0:o.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n;var s=this;return __generator(this,(function(i){switch(i.label){case 0:if(!this.stripe||!stripeStore.stripeElements){return[2]}if(cartStore.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;i.label=1;case 1:i.trys.push([1,2,,6]);e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:t});o=this.el.querySelector(".zonos--link-authentication-component");if(!o){logError("Cannot find container element for linkAuthenticationElement");return[2]}e.mount(o);e.on("change",(function(t){var e;stripeStore.stripeLinkEventData=t;(e=s.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){log("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void sendErrorLog({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:n=i.sent();if(!(n instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<MAX_RETRIES_INITIALIZE_LINK))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:i.sent();void this.watchInitStripe();i.label=4;case 4:if(this.retriesInitializeLink===MAX_RETRIES_INITIALIZE_LINK){void sendErrorLog({endpoint:"stripe-link-authentication-init-error",errors:[n.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}i.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,e){var o,n;log("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:e});if(e===t){return}if(!t){stripeStore.stripeLinkEventData=null}if(cartStore.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(o=stripeStore.stripeLinkElement)===null||o===void 0?void 0:o.clear();(n=stripeStore.stripeLinkElement)===null||n===void 0?void 0:n.destroy();stripeStore.stripeLinkElement=null;stripeStore.stripeLinkEventData=null;log("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[stripeStoreOnChange("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),stripeStoreOnChange("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=stripeStore.clientSecret;return[2]}))}))})),stripeStoreOnChange("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=stripeStore.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;var e=function(){var e;if(cartStore.isStagingMode){return h("zonos-stripe-input",{inputLabel:translate("Email"),inputValue:t.defaultEmail||((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"",isError:t.isEmailError,onBlur:function(){var e;var o=((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"";if(!o){return}var n=validateEmailValue(o);t.isEmailError=!n},onInputChange:t.handleNormalEmailInput})}return h("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return h(Host,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),e(),this.isEmailError&&h("zonos-text",{textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;var zonosLoadingOverlayCss=":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:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var ZonosLoadingOverlayStyle0=zonosLoadingOverlayCss;var ZonosLoadingOverlay=function(){function t(t){registerInstance(this,t);this.open=false;this.size=40}t.prototype.render=function(){return h(Host,{key:"2307e7f2b5db43fa4625097a96fd9182b5a1c729",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"9c7aa8101410becb1341bc2d602638fbccff2dbf",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"ebf5db2566052ee898d8d09aaeceb664a8e264e2",size:this.size,spinnerColor:this.spinnerColor})))};return t}();ZonosLoadingOverlay.style=ZonosLoadingOverlayStyle0;export{ZonosAddress as zonos_address,ZonosConfirmDialog as zonos_confirm_dialog,ZonosLinkAuthentication as zonos_link_authentication,ZonosLoadingOverlay as zonos_loading_overlay};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,o,n){function s(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function r(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n["throw"](t))}catch(t){i(t)}}function l(t){t.done?o(t.value):s(t.value).then(r,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(n=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1];i=a;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(a);break}if(i[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];s=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{t as throttle_1}from"./throttle-882b1f47.js";import{b as stripeStore,t as trackConversionEvent,Q as extractName,E as stripeStoreOnChange,q as stripeStorePrefetchLandedCost,d as cartStore}from"./cart-41f41429.js";import{s as storageStore,r as getFallbackDefaultCountryCode,t as translate,q as storageStoreOnChange,l as localizationStore}from"./localization-ee06df70.js";import{z as zonosStore,g as getZonosStoreTheme,f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{l as logError,i as isCheckoutMobile,s as sendErrorLog}from"./handleFetch-a844cac1.js";import{a as shouldRenderTaxIdInput,s as shouldRenderShortAddressCodeInput}from"./shouldRenderTaxIdInput-2572bf77.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./TaxId-50d72254.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import"./debounce-ab526ca0.js";import"./isDarkColor-0a8453e7.js";import"./ShortAddressCode-7620e622.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function t(t){registerInstance(this,t);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.taxIdChanged=createEvent(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=storageStore.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=throttle_1(stripeStorePrefetchLandedCost,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};t.prototype.updateAddressEventData=function(t){var e=t.event,o=t.type;switch(o){case"billing":stripeStore.stripeBillingAddressEventData=e;break;default:{stripeStore.stripeAddressEventData=e;break}}if(o==="shipping"){if(e.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!storageStore.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var e=t.stripeAddressElement,o=t.type;if(o==="shipping"){stripeStore.stripeAddressElement=e;return}stripeStore.stripeBillingAddressElement=e};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n,s,i,r,a,l,c;var d=this;return __generator(this,(function(h){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),e=t.stripeAddressEventData,o=t.stripeElements;if(!this.stripe||!o){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}n=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));s=localizationStore.shippingZoneCountries;i=s?Object.values(s).map((function(t){return t.code})):[];r=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");a=this.type==="shipping"?i:[];l=(e===null||e===void 0?void 0:e.value.address.country)||getFallbackDefaultCountryCode(a);log("Stripe country code: ".concat(l),"info");c=o.create("address",{allowedCountries:r?[]:a,contacts:n.length&&!e?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},e===null||e===void 0?void 0:e.value.address),{country:l}),firstName:e===null||e===void 0?void 0:e.value.firstName,lastName:e===null||e===void 0?void 0:e.value.lastName,phone:e===null||e===void 0?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));if(e===null||e===void 0?void 0:e.value.address){this.prevCountry=e.value.address.country;this.prevPostalCode=e.value.address.postal_code}c.on("change",(function(t){var e=t.value;if(!d.isDirtyAddress&&e.address.line1.length>=3){d.isDirtyAddress=true;if(!d.isAutoCompleteAdjusted){var o=d.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(o){o.style.zIndex="3"}d.isAutoCompleteAdjusted=true}setTimeout((function(){if(isCheckoutMobile()){d.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=d.type==="shipping"?100:600;var e=d.el.closest(".zonos--group");var o=d.el.getBoundingClientRect().top+t;e===null||e===void 0?void 0:e.scrollTo({behavior:"smooth",top:o})}}),600)}var n=extractName({firstName:e.firstName,lastName:e.lastName,name:e.name}),s=n.firstName,i=n.lastName;d.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:d.type,elementType:"address",value:Object.assign(Object.assign({},e),{firstName:s,lastName:i})}),type:d.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,e){var o=JSON.stringify(e);var n=JSON.stringify(t);if(o===n){return}log("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var s=this.getStripeAddressInstance().stripeAddressElement;s===null||s===void 0?void 0:s.clear();s===null||s===void 0?void 0:s.destroy();if(this.type==="shipping"){stripeStore.stripeAddressEventData=null}else{stripeStore.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return countryRequireTaxId.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var e;if(this.type==="billing"){return null}var o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value.address.country;if(!o){return null}if(!this.isInTaxIdCountry(o)){return null}var n=shouldRenderTaxIdInput({companyName:stripeStore.companyName,countryCode:o});if(!n){return null}var s=shipToTaxIdLabels[o];return h("div",{class:"zonos--tax-id-input"},h("zonos-stripe-input",{inputLabel:translate(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:stripeStore.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(e){stripeStore.taxId=e.detail;t.taxIdChanged.emit(e.detail)}}),this.taxIdErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var e=(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!e){return null}var o=shouldRenderShortAddressCodeInput({countryCode:e});if(!o){return null}return h("div",{class:"zonos--short-address-code-input"},h("zonos-stripe-input",{inputLabel:translate("Short address code"),inputPlaceholder:"RRRD2929",inputValue:stripeStore.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){stripeStore.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=zonosStore.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return h("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:translate("Company name (optional)"),inputValue:stripeStore.companyName,onInputChange:function(t){stripeStore.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=storageStore.checkoutSessionId;this.storeUnsubscribeList=[storageStoreOnChange("checkoutSessionId",(function(){t.checkoutSessionId=storageStore.checkoutSessionId})),stripeStoreOnChange("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),stripeStoreOnChange("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=storageStore.checkoutSessionId;if((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return h(Host,{key:"ebba5be32c456e8b71d397db63e666e5d5df1543",class:classes(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&h("zonos-text",{key:"25f15ea17b50ed055eb98b072850296312785b06",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("slot",{key:"631bc324d1bb96fb9e796b38a6da42ef6ca601a3",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),h("div",{key:"25f88c72f8fc9b788b042f2df2f1b8085132f683",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}();ZonosAddress.style=ZonosAddressStyle0;var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=":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 .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var ZonosConfirmDialogStyle0=zonosConfirmDialogCss;var ZonosConfirmDialog=function(){function t(t){var e=this;registerInstance(this,t);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);this.dialogTitle=translate("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var e,o;(o=(e=t.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||o===void 0?void 0:o.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var e=getBorderRadius();var o=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"ae8a2dd88cbeeb8865f1ed67eae5d42356359d53",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":o,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"c0622ae7cbbe469554716558eb56c452f9693568",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"3c42ad4fb2b793d65f564484126a519e97297743",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return t.clickOutsideDialogHandler(e)}},h("div",{key:"18b46b2281cdf26b4dce3784b91a0ccd45cde7f2",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},h("div",{key:"9455881ea4d3c557b4de814235b0f66519e6fc6b",class:"wrapper"},h("div",{key:"51f52ec83eb9fdbe1af20fdb0d149ce291597468",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"cdd954985d40e509eab4c15d063e1e7c9ebec839",class:"content"},h("div",{key:"0ffddb684d1c33d421e2bf077fec01dba934a1e4",class:"title"},h("zonos-text",{key:"5d778ebc6795ca69caf7df33503b6ec8ea3636c0",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"fab99060495ebeb545477e06417816c7fc8f9f3c",class:"subtitle"},h("zonos-text",{key:"c4baa52a5b53497db336018f62d5999e298d3ccf",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"5d92f093bd1ee37ee54c4e771e73a1d2b6b7bb39",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"0aa3788620a75732d72fca23c16b6b1a2fb694a0",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"a7195241b38061b363cae7b99828b714c96dbbff",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosConfirmDialog.style=ZonosConfirmDialogStyle0;var validateEmailValue=function(t){var e=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return e.test(t)};var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var MAX_RETRIES_INITIALIZE_LINK=51;var ZonosLinkAuthentication=function(){function t(t){var e=this;registerInstance(this,t);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=stripeStore.stripe;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var e=validateEmailValue(t);var o={complete:!!e,elementType:"linkAuthentication",empty:!t,value:{email:t}};stripeStore.stripeLinkEventData=o};this.handleNormalEmailInput=function(t){var o;var n=t.detail;e.setCustomEmailInputToLinkEvent(n);(o=e.linkAuthenticationChange)===null||o===void 0?void 0:o.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n;var s=this;return __generator(this,(function(i){switch(i.label){case 0:if(!this.stripe||!stripeStore.stripeElements){return[2]}if(cartStore.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;i.label=1;case 1:i.trys.push([1,2,,6]);e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:t});o=this.el.querySelector(".zonos--link-authentication-component");if(!o){logError("Cannot find container element for linkAuthenticationElement");return[2]}e.mount(o);e.on("change",(function(t){var e;stripeStore.stripeLinkEventData=t;(e=s.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){log("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void sendErrorLog({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:n=i.sent();if(!(n instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<MAX_RETRIES_INITIALIZE_LINK))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:i.sent();void this.watchInitStripe();i.label=4;case 4:if(this.retriesInitializeLink===MAX_RETRIES_INITIALIZE_LINK){void sendErrorLog({endpoint:"stripe-link-authentication-init-error",errors:[n.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}i.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,e){var o,n;log("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:e});if(e===t){return}if(!t){stripeStore.stripeLinkEventData=null}if(cartStore.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(o=stripeStore.stripeLinkElement)===null||o===void 0?void 0:o.clear();(n=stripeStore.stripeLinkElement)===null||n===void 0?void 0:n.destroy();stripeStore.stripeLinkElement=null;stripeStore.stripeLinkEventData=null;log("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[stripeStoreOnChange("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),stripeStoreOnChange("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=stripeStore.clientSecret;return[2]}))}))})),stripeStoreOnChange("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=stripeStore.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;var e=function(){var e;if(cartStore.isStagingMode){return h("zonos-stripe-input",{inputLabel:translate("Email"),inputValue:t.defaultEmail||((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"",isError:t.isEmailError,onBlur:function(){var e;var o=((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"";if(!o){return}var n=validateEmailValue(o);t.isEmailError=!n},onInputChange:t.handleNormalEmailInput})}return h("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return h(Host,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),e(),this.isEmailError&&h("zonos-text",{textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;var zonosLoadingOverlayCss=":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:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var ZonosLoadingOverlayStyle0=zonosLoadingOverlayCss;var ZonosLoadingOverlay=function(){function t(t){registerInstance(this,t);this.open=false;this.size=40}t.prototype.render=function(){return h(Host,{key:"3f830d0014a8988893b2cbde578035b1b8727ac5",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"84371b0bb118aef5c4ec5e1c6903d699d5402c14",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"cf53766a1bbdf7433c5f7a1cf46e00bbd63f08b3",size:this.size,spinnerColor:this.spinnerColor})))};return t}();ZonosLoadingOverlay.style=ZonosLoadingOverlayStyle0;export{ZonosAddress as zonos_address,ZonosConfirmDialog as zonos_confirm_dialog,ZonosLinkAuthentication as zonos_link_authentication,ZonosLoadingOverlay as zonos_loading_overlay};
@@ -1 +1 @@
1
- import{r as registerInstance,h,a as Host}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{c as classes}from"./classes-0d95c529.js";import"./VarianceTest-572cecf5.js";var RemoveLineIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8282 5.17184C11.0235 5.3671 11.0235 5.68368 10.8282 5.87894L8.70688 8.00026L10.8282 10.1216C11.0235 10.3168 11.0235 10.6334 10.8282 10.8287C10.6329 11.024 10.3164 11.024 10.1211 10.8287L7.99978 8.70737L5.87846 10.8287C5.68319 11.024 5.36661 11.024 5.17135 10.8287C4.97609 10.6334 4.97609 10.3168 5.17135 10.1216L7.29267 8.00026L5.17135 5.87894C4.97609 5.68368 4.97609 5.3671 5.17135 5.17184C5.36661 4.97658 5.68319 4.97658 5.87846 5.17184L7.99978 7.29316L10.1211 5.17184C10.3164 4.97658 10.6329 4.97658 10.8282 5.17184Z" fill="var(--zonos-elements-gray-800)"/>\n</svg>\n';var zonosBadgeCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800);border:1px solid var(--zonos-elements-orange-200)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}:host .transparent{background-color:transparent;border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800)}:host .transparent.bold{background-color:var(--zonos-elements-glass-600);color:var(--zonos-elements-gray-100)}:host .zonos--badge-dismiss{cursor:pointer}";var ZonosBadgeStyle0=zonosBadgeCss;var ZonosBadge=function(){function o(o){registerInstance(this,o);this.bold=false;this.badgeColor="gray";this.iconRight=false;this.size="default";this.rounded=false;this.loading=false}o.prototype.render=function(){var o=this;return h(Host,{key:"dabf6b5d9c4585f9fe62b69655c3043c5d51eb6e",class:classes(["zonos--elements zonos--badge"]),style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"4603e1dbcb6760ae1a18d008cbffc9acc8b1b444",class:classes(["zonos--badge-content",this.badgeColor,this.rounded&&"rounded",this.iconRight&&"icon-right",this.size,this.bold&&"bold"])},this.icon,h("zonos-text",{key:"5d70287727ff5681be1d2f4f0faf32ba39899b4b",textColor:"".concat(this.badgeColor,"-800")},h("slot",{key:"e3ea93273daccab2b37f8240b29041e485d8bcef"})),this.dismissHandler&&h("zonos-icon",{key:"5c09bc191f5ae6f9fe18da4ed15c9f60bab58b03","aria-label":"Remove action",class:"zonos--badge-dismiss",content:RemoveLineIcon,onClick:function(){var e;return(e=o.dismissHandler)===null||e===void 0?void 0:e.call(o)}})))};return o}();ZonosBadge.style=ZonosBadgeStyle0;export{ZonosBadge as zonos_badge};
1
+ import{r as registerInstance,h,a as Host}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{c as classes}from"./classes-0d95c529.js";import"./VarianceTest-572cecf5.js";var RemoveLineIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8282 5.17184C11.0235 5.3671 11.0235 5.68368 10.8282 5.87894L8.70688 8.00026L10.8282 10.1216C11.0235 10.3168 11.0235 10.6334 10.8282 10.8287C10.6329 11.024 10.3164 11.024 10.1211 10.8287L7.99978 8.70737L5.87846 10.8287C5.68319 11.024 5.36661 11.024 5.17135 10.8287C4.97609 10.6334 4.97609 10.3168 5.17135 10.1216L7.29267 8.00026L5.17135 5.87894C4.97609 5.68368 4.97609 5.3671 5.17135 5.17184C5.36661 4.97658 5.68319 4.97658 5.87846 5.17184L7.99978 7.29316L10.1211 5.17184C10.3164 4.97658 10.6329 4.97658 10.8282 5.17184Z" fill="var(--zonos-elements-gray-800)"/>\n</svg>\n';var zonosBadgeCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800);border:1px solid var(--zonos-elements-orange-200)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}:host .transparent{background-color:transparent;border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800)}:host .transparent.bold{background-color:var(--zonos-elements-glass-600);color:var(--zonos-elements-gray-100)}:host .zonos--badge-dismiss{cursor:pointer}";var ZonosBadgeStyle0=zonosBadgeCss;var ZonosBadge=function(){function o(o){registerInstance(this,o);this.bold=false;this.badgeColor="gray";this.iconRight=false;this.size="default";this.rounded=false;this.loading=false}o.prototype.render=function(){var o=this;return h(Host,{key:"76d8a0655e3d4009085f34ea0cbc56c180076081",class:classes(["zonos--elements zonos--badge"]),style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"c512b84c92030ad81f1a6180304fd79c2a3c3708",class:classes(["zonos--badge-content",this.badgeColor,this.rounded&&"rounded",this.iconRight&&"icon-right",this.size,this.bold&&"bold"])},this.icon,h("zonos-text",{key:"680812e8220ca3ad0a18a90c5bb614b5fea13c38",textColor:"".concat(this.badgeColor,"-800")},h("slot",{key:"e939a288add6c2936746ed4b40721d13c38e793c"})),this.dismissHandler&&h("zonos-icon",{key:"fddf84b6af4dda95c6937273d6168fc17290d747","aria-label":"Remove action",class:"zonos--badge-dismiss",content:RemoveLineIcon,onClick:function(){var e;return(e=o.dismissHandler)===null||e===void 0?void 0:e.call(o)}})))};return o}();ZonosBadge.style=ZonosBadgeStyle0;export{ZonosBadge as zonos_badge};
@@ -1 +1 @@
1
- import{r as registerInstance,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{z as zonosStore,f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./helpers-2f6955b1.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import{i as isColorVariable}from"./isColorVariable-0a94004f.js";import{i as isDarkColor}from"./isDarkColor-0a8453e7.js";import{s as styles}from"./styles-6fc2fad9.js";import"./VarianceTest-572cecf5.js";var getButtonTheme=function(o){var e=o||zonosStore.appearance.colorSecondary;var t=e&&isColorVariable(e)?"var(--zonos-elements-".concat(e,")"):e;var n=t&&isDarkColor(t)?"DARK":"LIGHT";return n};var isElementUsingDarkTheme=function(o){return isDarkColor(window.getComputedStyle(o).getPropertyValue("--zonos-elements-gray-0"))};var zonosButtonCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--zonos-elements-radius-10);gap:8px}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--zonos-elements-surface-color);border:none;outline:1px solid var(--zonos-elements-surface-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-weight:var(--zonos--font-weight, 500);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--zonos--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:8px 24px;color:var(--zonos--color, var(--zonos-elements-gray-1000));margin:1px}:host button:not([disabled]):hover{background-image:var(--zonos-elements-button-standard-hover)}:host button:not([disabled]):active{background:var(--zonos-elements-gray-700)}:host button:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button.with-box-shadow{-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard)}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--zonos--background-color, var(--zonos-elements-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--zonos--background-color, var(--zonos-elements-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button{}:host button.sm{height:var(--zonos-elements-size-sm);line-height:var(--zonos-elements-size-sm);padding:4px 8px}:host button.sm:not(.has-content).has-icon{padding:0 4px}:host button.md{height:var(--zonos-elements-size-md);line-height:var(--zonos-elements-size-md);padding:8px 16px}:host button.md:not(.has-content).has-icon{padding:0 8px}:host button.lg{height:var(--zonos-elements-size-lg);line-height:var(--zonos-elements-size-lg);padding:12px 24px}:host button.lg:not(.has-content).has-icon{padding:0 16px}:host button:not(.only-icon).has-icon{gap:8px}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--zonos-elements-font-size-s)}}:host button.override-background{background-color:var(--zonos--background-color, var(--zonos-elements-gray-0));color:var(--zonos--color, var(--zonos-elements-gray-1000));outline:1px solid var(--zonos--background-color, var(--zonos-elements-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--zonos-elements-blue-600);outline:1px solid var(--zonos-elements-blue-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--zonos-elements-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--zonos-elements-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-600)}:host button:not(.override-background).success{background:var(--zonos-elements-green-600);outline:1px solid var(--zonos-elements-green-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--zonos-elements-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--zonos-elements-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--zonos-elements-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-green-400)}:host button:not(.override-background).danger{background:var(--zonos-elements-red-600);outline:1px solid var(--zonos-elements-red-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--zonos-elements-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--zonos-elements-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--zonos-elements-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-red-400)}:host button:not(.override-background).warning{background:var(--zonos-elements-orange-600);outline:1px solid var(--zonos-elements-orange-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--zonos-elements-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--zonos-elements-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--zonos-elements-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--zonos--color, var(--zonos-elements-gray-1000));outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:rgba(0, 0, 0, 0.1)}:host button:not(.override-background).subtle:not([disabled]):active{background:rgba(0, 0, 0, 0.2)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--zonos-elements-button-focus-ring);box-shadow:var(--zonos-elements-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--zonos-elements-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--zonos-elements-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--zonos-elements-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--zonos-elements-radius-4);width:24px}";var ZonosButtonStyle0=zonosButtonCss;var ZonosButton=function(){function o(o){var e=this;registerInstance(this,o);this.inheritedAttributes={};this.isDisabled=false;this.icon=null;this.iconRight=false;this.size="sm";this.variant="standard";this.noBackground=false;this.withBoxShadow=false;this.noPaddingLeft=false;this.noPaddingRight=false;this.loading=false;this.justifyContent="center";this.bold=false;this.hasIcon=!!this.icon;this.hasContent=false;this.handleSlotChange=function(){e.hasContent=true};this.getColorVarProperty=function(o){return o.replace("var(","").replace(")","")};this.getButtonStyle=function(){var o=e.variant||"standard";var t=e.buttonColor&&isColorVariable(e.buttonColor)?"var(--zonos-elements-".concat(e.buttonColor,")"):e.buttonColor;var n=window.getComputedStyle(e.ele).getPropertyValue(e.getColorVarProperty(t||""))||t||"";var s=!isElementUsingDarkTheme(e.ele);var r=!isDarkColor(n);var a=s&&!r||!s&&r;switch(o){case"subtle":{return{color:t,useDarkHoverSubtle:a}}default:{var i=e.backgroundColor&&isColorVariable(e.backgroundColor)?"var(--zonos-elements-".concat(e.backgroundColor,")"):e.backgroundColor;var l=i||zonosStore.appearance.colorSecondary;var d=l&&isColorVariable(e.getColorVarProperty(l))?window.getComputedStyle(e.ele).getPropertyValue(e.getColorVarProperty(l)):l;var h=e.variant!=="subtle"&&d&&isDarkColor(d)?"white":t;return{backgroundColor:l,color:h,spinnerColor:d&&isDarkColor(d)?"white":"black",useDarkHoverSubtle:a}}}}}o.prototype.iconChangeHandler=function(){this.hasIcon=!!this.icon};o.prototype.clickHandler=function(o){if(this.loading||this.isDisabled){o.preventDefault();o.stopPropagation()}};o.prototype.componentWillLoad=function(){this.iconChangeHandler();this.inheritedAttributes=Object.assign(Object.assign({},inheritAriaAttributes(this.ele)),inheritAttributes(this.ele,["tabindex","title","data-form-type","dir"]))};o.prototype.render=function(){var o=this.getButtonStyle(),e=o.backgroundColor,t=o.color,n=o.spinnerColor,s=o.useDarkHoverSubtle;var r=this.loading||this.isDisabled;var a=this.variant||"standard";var i=a==="standard"?getButtonTheme(e):undefined;var l=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"b816d7ac8f86b6256d017de9a7049c008cbfd973",class:classes(["zonos--elements"]),"data-theme":this.theme||i,disabled:r,style:styles({"--zonos--background-color":e,"--zonos--border-radius":l,"--zonos--color":t,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--font-weight":this.bold?"bold":"normal"})},h("button",Object.assign({key:"ddc1bba069df9e03db22fdfb77fe1118e84d0744"},this.inheritedAttributes,{class:classes([this.hasIcon&&"has-icon",this.hasContent&&"has-content",this.noBackground&&"no-background",this.noPaddingLeft&&"no-padding-left",this.noPaddingRight&&"no-padding-right",this.iconRight&&"icon-right",this.withBoxShadow&&"with-box-shadow",s&&"dark-hover-subtle",a,this.size,e&&a==="standard"&&"override-background"]),disabled:r,style:{justifyContent:this.justifyContent}}),this.loading&&h("div",{key:"98c12cd886ada57ae8f571f6a5e1914024198dd5",class:"zonos--spinner-wrapper"},h("zonos-spinner",{key:"22dee22121fabe21d7c6f02b8b48e83b8c1894a7",size:16,spinnerColor:n})),!this.loading&&!this.iconRight&&this.icon,h("slot",{key:"27cbe56b4c77dd5678a2e6685fc05694ab36cab1",onSlotchange:this.handleSlotChange}),!this.loading&&this.iconRight&&this.icon))};Object.defineProperty(o,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{icon:["iconChangeHandler"]}},enumerable:false,configurable:true});return o}();ZonosButton.style=ZonosButtonStyle0;var zonosIconCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--zonos--width);height:var(--zonos--height);fill:var(--zonos--color);color:var(--zonos--color)}";var ZonosIconStyle0=zonosIconCss;var ZonosIcon=function(){function o(o){registerInstance(this,o);this.autoHeight=false;this.iconColor="gray-1000";this.size=24}o.prototype.render=function(){if(!this.content||!this.el.shadowRoot){return null}var o=isColorVariable(this.iconColor)?"var(--zonos-elements-".concat(this.iconColor,")"):this.iconColor;this.el.shadowRoot.innerHTML=this.content;return h(Host,{class:"zonos--elements",style:{"--zonos--color":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":"".concat(this.autoHeight?"auto":"".concat(this.size,"px")),"--zonos--width":"".concat(this.size,"px")}})};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosIcon.style=ZonosIconStyle0;var zonosSpinnerCss=":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:relative;overflow:hidden;width:var(--zonos--size);height:var(--zonos--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--zonos--size);height:var(--zonos--size);stroke:var(--zonos-elements-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--zonos-elements-gray-200)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}:host(.black) circle{stroke:var(--zonos-elements-spinner-stroke-black)}:host(.black) circle.track{stroke:var(--zonos-elements-spinner-track-black)}:host(.white) circle{stroke:var(--zonos-elements-spinner-stroke-white)}:host(.white) circle.track{stroke:var(--zonos-elements-spinner-track-white)}:host(.info) circle{stroke:var(--zonos-elements-blue-600)}:host(.info) circle.track{stroke:var(--zonos-elements-blue-100)}:host(.success) circle{stroke:var(--zonos-elements-green-600)}:host(.success) circle.track{stroke:var(--zonos-elements-green-100)}:host(.danger) circle{stroke:var(--zonos-elements-red-600)}:host(.danger) circle.track{stroke:var(--zonos-elements-red-100)}:host(.warning) circle{stroke:var(--zonos-elements-orange-600)}:host(.warning) circle.track{stroke:var(--zonos-elements-orange-100)}";var ZonosSpinnerStyle0=zonosSpinnerCss;var ZonosSpinner=function(){function o(o){registerInstance(this,o);this.size=32}o.prototype.render=function(){if(!this.el.shadowRoot){return null}return h(Host,{class:classes(["zonos--elements",this.spinnerColor]),style:{"--zonos--size":"".concat(this.size,"px")}},h("svg",{viewBox:"0 0 50 50"},h("circle",{class:"track",cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"}),h("circle",{cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosSpinner.style=ZonosSpinnerStyle0;export{ZonosButton as zonos_button,ZonosIcon as zonos_icon,ZonosSpinner as zonos_spinner};
1
+ import{r as registerInstance,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{z as zonosStore,f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{i as inheritAriaAttributes,a as inheritAttributes}from"./helpers-2f6955b1.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import{i as isColorVariable}from"./isColorVariable-0a94004f.js";import{i as isDarkColor}from"./isDarkColor-0a8453e7.js";import{s as styles}from"./styles-6fc2fad9.js";import"./VarianceTest-572cecf5.js";var getButtonTheme=function(o){var e=o||zonosStore.appearance.colorSecondary;var t=e&&isColorVariable(e)?"var(--zonos-elements-".concat(e,")"):e;var n=t&&isDarkColor(t)?"DARK":"LIGHT";return n};var isElementUsingDarkTheme=function(o){return isDarkColor(window.getComputedStyle(o).getPropertyValue("--zonos-elements-gray-0"))};var zonosButtonCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--zonos-elements-radius-10);gap:8px}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--zonos-elements-surface-color);border:none;outline:1px solid var(--zonos-elements-surface-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-weight:var(--zonos--font-weight, 500);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--zonos--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:8px 24px;color:var(--zonos--color, var(--zonos-elements-gray-1000));margin:1px}:host button:not([disabled]):hover{background-image:var(--zonos-elements-button-standard-hover)}:host button:not([disabled]):active{background:var(--zonos-elements-gray-700)}:host button:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button.with-box-shadow{-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard)}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--zonos--background-color, var(--zonos-elements-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--zonos--background-color, var(--zonos-elements-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button{}:host button.sm{height:var(--zonos-elements-size-sm);line-height:var(--zonos-elements-size-sm);padding:4px 8px}:host button.sm:not(.has-content).has-icon{padding:0 4px}:host button.md{height:var(--zonos-elements-size-md);line-height:var(--zonos-elements-size-md);padding:8px 16px}:host button.md:not(.has-content).has-icon{padding:0 8px}:host button.lg{height:var(--zonos-elements-size-lg);line-height:var(--zonos-elements-size-lg);padding:12px 24px}:host button.lg:not(.has-content).has-icon{padding:0 16px}:host button:not(.only-icon).has-icon{gap:8px}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--zonos-elements-font-size-s)}}:host button.override-background{background-color:var(--zonos--background-color, var(--zonos-elements-gray-0));color:var(--zonos--color, var(--zonos-elements-gray-1000));outline:1px solid var(--zonos--background-color, var(--zonos-elements-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--zonos-elements-blue-600);outline:1px solid var(--zonos-elements-blue-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--zonos-elements-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--zonos-elements-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--zonos-elements-blue-600)}:host button:not(.override-background).success{background:var(--zonos-elements-green-600);outline:1px solid var(--zonos-elements-green-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--zonos-elements-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--zonos-elements-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--zonos-elements-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-green-400)}:host button:not(.override-background).danger{background:var(--zonos-elements-red-600);outline:1px solid var(--zonos-elements-red-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--zonos-elements-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--zonos-elements-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--zonos-elements-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-red-400)}:host button:not(.override-background).warning{background:var(--zonos-elements-orange-600);outline:1px solid var(--zonos-elements-orange-600);color:var(--zonos-elements-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--zonos-elements-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--zonos-elements-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--zonos-elements-focus-button);box-shadow:var(--zonos-elements-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--zonos-elements-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--zonos--color, var(--zonos-elements-gray-1000));outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:rgba(0, 0, 0, 0.1)}:host button:not(.override-background).subtle:not([disabled]):active{background:rgba(0, 0, 0, 0.2)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--zonos-elements-button-focus-ring);box-shadow:var(--zonos-elements-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--zonos-elements-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--zonos-elements-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--zonos-elements-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--zonos-elements-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--zonos-elements-radius-4);width:24px}";var ZonosButtonStyle0=zonosButtonCss;var ZonosButton=function(){function o(o){var e=this;registerInstance(this,o);this.inheritedAttributes={};this.isDisabled=false;this.icon=null;this.iconRight=false;this.size="sm";this.variant="standard";this.noBackground=false;this.withBoxShadow=false;this.noPaddingLeft=false;this.noPaddingRight=false;this.loading=false;this.justifyContent="center";this.bold=false;this.hasIcon=!!this.icon;this.hasContent=false;this.handleSlotChange=function(){e.hasContent=true};this.getColorVarProperty=function(o){return o.replace("var(","").replace(")","")};this.getButtonStyle=function(){var o=e.variant||"standard";var t=e.buttonColor&&isColorVariable(e.buttonColor)?"var(--zonos-elements-".concat(e.buttonColor,")"):e.buttonColor;var n=window.getComputedStyle(e.ele).getPropertyValue(e.getColorVarProperty(t||""))||t||"";var s=!isElementUsingDarkTheme(e.ele);var r=!isDarkColor(n);var a=s&&!r||!s&&r;switch(o){case"subtle":{return{color:t,useDarkHoverSubtle:a}}default:{var i=e.backgroundColor&&isColorVariable(e.backgroundColor)?"var(--zonos-elements-".concat(e.backgroundColor,")"):e.backgroundColor;var l=i||zonosStore.appearance.colorSecondary;var d=l&&isColorVariable(e.getColorVarProperty(l))?window.getComputedStyle(e.ele).getPropertyValue(e.getColorVarProperty(l)):l;var h=e.variant!=="subtle"&&d&&isDarkColor(d)?"white":t;return{backgroundColor:l,color:h,spinnerColor:d&&isDarkColor(d)?"white":"black",useDarkHoverSubtle:a}}}}}o.prototype.iconChangeHandler=function(){this.hasIcon=!!this.icon};o.prototype.clickHandler=function(o){if(this.loading||this.isDisabled){o.preventDefault();o.stopPropagation()}};o.prototype.componentWillLoad=function(){this.iconChangeHandler();this.inheritedAttributes=Object.assign(Object.assign({},inheritAriaAttributes(this.ele)),inheritAttributes(this.ele,["tabindex","title","data-form-type","dir"]))};o.prototype.render=function(){var o=this.getButtonStyle(),e=o.backgroundColor,t=o.color,n=o.spinnerColor,s=o.useDarkHoverSubtle;var r=this.loading||this.isDisabled;var a=this.variant||"standard";var i=a==="standard"?getButtonTheme(e):undefined;var l=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"0e8c9eaa41b5769793e8b598e675f74e76061a7d",class:classes(["zonos--elements"]),"data-theme":this.theme||i,disabled:r,style:styles({"--zonos--background-color":e,"--zonos--border-radius":l,"--zonos--color":t,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--font-weight":this.bold?"bold":"normal"})},h("button",Object.assign({key:"5de21db7f0fb00f327ffb9d9da450269e8493b43"},this.inheritedAttributes,{class:classes([this.hasIcon&&"has-icon",this.hasContent&&"has-content",this.noBackground&&"no-background",this.noPaddingLeft&&"no-padding-left",this.noPaddingRight&&"no-padding-right",this.iconRight&&"icon-right",this.withBoxShadow&&"with-box-shadow",s&&"dark-hover-subtle",a,this.size,e&&a==="standard"&&"override-background"]),disabled:r,style:{justifyContent:this.justifyContent}}),this.loading&&h("div",{key:"ff288d4a7ab7fc79e7e66328e413034e653ddc13",class:"zonos--spinner-wrapper"},h("zonos-spinner",{key:"14f473f5f16407c020ae6163e5ccba00b6b8ea76",size:16,spinnerColor:n})),!this.loading&&!this.iconRight&&this.icon,h("slot",{key:"3fdd8e722cf4cb730f3227fe0562011af106da28",onSlotchange:this.handleSlotChange}),!this.loading&&this.iconRight&&this.icon))};Object.defineProperty(o,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(o.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{icon:["iconChangeHandler"]}},enumerable:false,configurable:true});return o}();ZonosButton.style=ZonosButtonStyle0;var zonosIconCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--zonos--width);height:var(--zonos--height);fill:var(--zonos--color);color:var(--zonos--color)}";var ZonosIconStyle0=zonosIconCss;var ZonosIcon=function(){function o(o){registerInstance(this,o);this.autoHeight=false;this.iconColor="gray-1000";this.size=24}o.prototype.render=function(){if(!this.content||!this.el.shadowRoot){return null}var o=isColorVariable(this.iconColor)?"var(--zonos-elements-".concat(this.iconColor,")"):this.iconColor;this.el.shadowRoot.innerHTML=this.content;return h(Host,{class:"zonos--elements",style:{"--zonos--color":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":"".concat(this.autoHeight?"auto":"".concat(this.size,"px")),"--zonos--width":"".concat(this.size,"px")}})};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosIcon.style=ZonosIconStyle0;var zonosSpinnerCss=":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:relative;overflow:hidden;width:var(--zonos--size);height:var(--zonos--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--zonos--size);height:var(--zonos--size);stroke:var(--zonos-elements-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--zonos-elements-gray-200)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}:host(.black) circle{stroke:var(--zonos-elements-spinner-stroke-black)}:host(.black) circle.track{stroke:var(--zonos-elements-spinner-track-black)}:host(.white) circle{stroke:var(--zonos-elements-spinner-stroke-white)}:host(.white) circle.track{stroke:var(--zonos-elements-spinner-track-white)}:host(.info) circle{stroke:var(--zonos-elements-blue-600)}:host(.info) circle.track{stroke:var(--zonos-elements-blue-100)}:host(.success) circle{stroke:var(--zonos-elements-green-600)}:host(.success) circle.track{stroke:var(--zonos-elements-green-100)}:host(.danger) circle{stroke:var(--zonos-elements-red-600)}:host(.danger) circle.track{stroke:var(--zonos-elements-red-100)}:host(.warning) circle{stroke:var(--zonos-elements-orange-600)}:host(.warning) circle.track{stroke:var(--zonos-elements-orange-100)}";var ZonosSpinnerStyle0=zonosSpinnerCss;var ZonosSpinner=function(){function o(o){registerInstance(this,o);this.size=32}o.prototype.render=function(){if(!this.el.shadowRoot){return null}return h(Host,{class:classes(["zonos--elements",this.spinnerColor]),style:{"--zonos--size":"".concat(this.size,"px")}},h("svg",{viewBox:"0 0 50 50"},h("circle",{class:"track",cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"}),h("circle",{cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosSpinner.style=ZonosSpinnerStyle0;export{ZonosButton as zonos_button,ZonosIcon as zonos_icon,ZonosSpinner as zonos_spinner};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,o,e,n){function s(t){return t instanceof e?t:new e((function(o){o(t)}))}return new(e||(e=Promise))((function(e,a){function i(t){try{c(n.next(t))}catch(t){a(t)}}function r(t){try{c(n["throw"](t))}catch(t){a(t)}}function c(t){t.done?e(t.value):s(t.value).then(i,r)}c((n=n.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,s,a,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(o){return c([t,o])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(e=0)),e)try{if(n=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;s=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){e.label=r[1];break}if(r[0]===6&&e.label<a[1]){e.label=a[1];a=r;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(r);break}if(a[2])e.ops.pop();e.trys.pop();continue}r=o.call(t,e)}catch(t){r=[6,t];s=0}finally{n=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,o,e){if(e||arguments.length===2)for(var n=0,s=o.length,a;n<s;n++){if(a||!(n in o)){if(!a)a=Array.prototype.slice.call(o,0,n);a[n]=o[n]}}return t.concat(a||Array.prototype.slice.call(o))};import{r as registerInstance,h,a as Host,g as getElement,d as createEvent}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import{b as stripeStore,t as trackConversionEvent}from"./cart-34b11708.js";import{s as storageStore}from"./localization-2e523b35.js";import{l as logError}from"./handleFetch-a844cac1.js";import{d as paypalStoreInitButtons,e as paypalStoreOnChange}from"./paypal-d3b3d967.js";import{l as log}from"./VarianceTest-572cecf5.js";import"./isDarkColor-0a8453e7.js";import"./isContrastColor-6bad285e.js";import"./submitGtag-ae9d5d91.js";var zonosCardCss=":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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";var ZonosCardStyle0=zonosCardCss;var ZonosCard=function(){function t(t){registerInstance(this,t);this.borderRadius=6;this.spacing="24px"}t.prototype.render=function(){var t=this.backgroundColor?"var(--zonos-elements-".concat(this.backgroundColor,")"):"transparent";var o=getBorderRadius({customRoundRadius:"".concat(this.borderRadius,"px"),overrideBorderStyle:"ROUNDED"});return h(Host,{key:"000ef115565050082a6e73e1709e014c66b410b7",style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"c9391737f61c4e555643ead25e927376d4e949ba",class:classes(["styled-card"]),style:{"--zonos--background-color":t,"--zonos--border-radius":o,padding:this.spacing}},this.label&&h("header",{key:"9a23e108d3a53adf878bc50cb4c3927ebd8db4a6",class:"card-header",style:{padding:this.spacing}},h("zonos-text",{key:"ea6a44ecec753ff4ff588d2f47843cc242f55f98",type:"subheader"},this.label),h("h-stack",{key:"7da7b584607867884466b311b1c9055c281e3326",spacing:8},this.actions)),h("slot",{key:"d3c458ee2288071bd72bbadc760fa9a0c6333219"}),(this.footerActions||this.footerContent)&&h("footer",{key:"b668c38a177fd5b0d7fe7988d18afe6f40e8082c",class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},h("div",{key:"61b13afeac104d27d76f73c0f869104ce5295197"},this.footerContent),h("h-stack",{key:"3cbdc1beb4e3b2129d9e71cb6c4ed94565a20ba9",spacing:8},this.footerActions))))};return t}();ZonosCard.style=ZonosCardStyle0;var PaymentEmptyStateDarkIcon='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var PaymentEmptyStateLightIcon='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var zonosEmptyStatePaymentCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var ZonosEmptyStatePaymentStyle0=zonosEmptyStatePaymentCss;var ZonosEmptyStatePayment=function(){function t(t){registerInstance(this,t);this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=PaymentEmptyStateDarkIcon}else{this.el.shadowRoot.innerHTML=PaymentEmptyStateLightIcon}return h(Host,{class:"zonos--elements",style:{"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":"100%","--zonos--width":"100%"}},h("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosEmptyStatePayment.style=ZonosEmptyStatePaymentStyle0;var zonosNotificationCss=":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-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var ZonosNotificationStyle0=zonosNotificationCss;var ZonosNotification=function(){function t(t){registerInstance(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o,e;var n=this;return __generator(this,(function(s){o="id-".concat(Math.random().toString(36).substring(2,9));e=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[e],false);setTimeout((function(){n.updateTransitionClass({id:o,transitionClass:"show"})}),50);setTimeout((function(){n.removeNotification(o)}),e.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var o=t.id,e=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===o){return Object.assign(Object.assign({},t),{transitionClass:e})}return t}))};t.prototype.removeNotification=function(t){var o=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){o.notificationArray=o.notificationArray.filter((function(o){return o.id!==t}))}),300)};t.prototype.render=function(){var t=this;return h(Host,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:classes(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":getBorderRadius(),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(o){return h("div",{"aria-hidden":"true",class:classes(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:function(){t.removeNotification(o.id)}},h("zonos-text",{textColor:"gray-0"},o.message))}))))};return t}();ZonosNotification.style=ZonosNotificationStyle0;var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function t(t){registerInstance(this,t);this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements;this.isPaymentInfoFilled=false;this.trackingSent=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var o=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:o,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=stripeStore.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,o,e;var n=this;return __generator(this,(function(s){switch(s.label){case 0:if(!this.stripeElements){return[2]}return[4,this.stripeElements.fetchUpdates()];case 1:s.sent();o=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country}}},layout:"tabs"});e=this.el.querySelector(".zonos--payment-component");if(!e){logError("Cannot find container element for paymentElement");return[2]}o.mount(e);o.on("change",(function(t){if(t.complete){n.isPaymentInfoFilled=true}stripeStore.stripePaymentEventData=t}));stripeStore.stripePaymentElement=o;return[2]}}))}))};t.prototype.componentDidLoad=function(){void this.watchInitStripe()};t.prototype.render=function(){return h(Host,{key:"d6aba7a614610a64012ef6636e19b345623141ec",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{key:"edf8c9ee8d7a9ebf87922a49d9b7420efd80b226",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"3d0d7638a309fdf4dc1ab39bb463a0c35add911d",class:"zonos--payment-component"}),h("div",{key:"a79f98f63bad2a7c5023eeb5bb28ae39997ada27",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}();ZonosPayment.style=ZonosPaymentStyle0;var zonosPaypalPaymentCss=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var ZonosPaypalPaymentStyle0=zonosPaypalPaymentCss;var ZonosPaypalPayment=function(){function t(t){registerInstance(this,t);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.paypalSessionFail=createEvent(this,"paypalSessionFail",7);this.storeUnsubscribeList=[]}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(n){if(!window.Zonos.paypal){log("Paypal is not available");return[2]}t=paypalStoreInitButtons({onPaypalFail:function(){log("onPaypalFail");e.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var o=t.orderId;log("onPaypalSessionDone","info",{orderId:o});e.paypalSessionDone.emit({orderId:o})}});if(!(t===null||t===void 0?void 0:t.length)){log("There are no paypal buttons available");return[2]}o=this.el.querySelector(".zonos--payment-paypal-container");if(!o){log("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.render(o)];case 1:e.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[paypalStoreOnChange("paypal",this.loadPaypal.bind(this))]};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return h(Host,{key:"5745cd59ad8b81a41f8015438afd036621695bbb",class:"zonos--paypal-payment zonos--elements"},h("div",{key:"be5154e55384e2ecd42e2ec6b2be7712fb6ef31b",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosPaypalPayment.style=ZonosPaypalPaymentStyle0;export{ZonosCard as zonos_card,ZonosEmptyStatePayment as zonos_empty_state_payment,ZonosNotification as zonos_notification,ZonosPayment as zonos_payment,ZonosPaypalPayment as zonos_paypal_payment};
1
+ var __awaiter=this&&this.__awaiter||function(t,o,e,n){function a(t){return t instanceof e?t:new e((function(o){o(t)}))}return new(e||(e=Promise))((function(e,s){function i(t){try{c(n.next(t))}catch(t){s(t)}}function r(t){try{c(n["throw"](t))}catch(t){s(t)}}function c(t){t.done?e(t.value):a(t.value).then(i,r)}c((n=n.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(o){return c([t,o])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(e=0)),e)try{if(n=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;a=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(s=e.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){e.label=r[1];break}if(r[0]===6&&e.label<s[1]){e.label=s[1];s=r;break}if(s&&e.label<s[2]){e.label=s[2];e.ops.push(r);break}if(s[2])e.ops.pop();e.trys.pop();continue}r=o.call(t,e)}catch(t){r=[6,t];a=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,o,e){if(e||arguments.length===2)for(var n=0,a=o.length,s;n<a;n++){if(s||!(n in o)){if(!s)s=Array.prototype.slice.call(o,0,n);s[n]=o[n]}}return t.concat(s||Array.prototype.slice.call(o))};import{r as registerInstance,h,a as Host,g as getElement,d as createEvent}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-9662b071.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import{b as stripeStore,t as trackConversionEvent}from"./cart-41f41429.js";import{s as storageStore}from"./localization-ee06df70.js";import{l as logError}from"./handleFetch-a844cac1.js";import{d as paypalStoreInitButtons,e as paypalStoreOnChange}from"./paypal-ac74241f.js";import{l as log}from"./VarianceTest-572cecf5.js";import"./isDarkColor-0a8453e7.js";import"./isContrastColor-6bad285e.js";import"./submitGtag-ae9d5d91.js";var zonosCardCss=":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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";var ZonosCardStyle0=zonosCardCss;var ZonosCard=function(){function t(t){registerInstance(this,t);this.borderRadius=6;this.spacing="24px"}t.prototype.render=function(){var t=this.backgroundColor?"var(--zonos-elements-".concat(this.backgroundColor,")"):"transparent";var o=getBorderRadius({customRoundRadius:"".concat(this.borderRadius,"px"),overrideBorderStyle:"ROUNDED"});return h(Host,{key:"04b66449d19c5862587b5ef4b2f7cb32524b03bd",style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"218a1def4d384b3bf589e87ca657168de2cea3e5",class:classes(["styled-card"]),style:{"--zonos--background-color":t,"--zonos--border-radius":o,padding:this.spacing}},this.label&&h("header",{key:"bc5f2eaa90786860e20e40987df70e0cc9c527bb",class:"card-header",style:{padding:this.spacing}},h("zonos-text",{key:"90be1e3b9cd28f5a7aacf79c65c56e14a37bc019",type:"subheader"},this.label),h("h-stack",{key:"c25845c181e02eadca3cacb2d73c7173ba0a1a50",spacing:8},this.actions)),h("slot",{key:"1e875f0fc6d86ae7cc5bdcdc0fc509bdcc1e1862"}),(this.footerActions||this.footerContent)&&h("footer",{key:"8fdca089c61d02ca14946dc3aaa8cb62c2feae99",class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},h("div",{key:"801f46a84cbb1185185ee35f51bf211f09d5aaee"},this.footerContent),h("h-stack",{key:"c995fab1c343973cf5da3079b99baa8b11af2903",spacing:8},this.footerActions))))};return t}();ZonosCard.style=ZonosCardStyle0;var PaymentEmptyStateDarkIcon='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var PaymentEmptyStateLightIcon='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var zonosEmptyStatePaymentCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var ZonosEmptyStatePaymentStyle0=zonosEmptyStatePaymentCss;var ZonosEmptyStatePayment=function(){function t(t){registerInstance(this,t);this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=PaymentEmptyStateDarkIcon}else{this.el.shadowRoot.innerHTML=PaymentEmptyStateLightIcon}return h(Host,{class:"zonos--elements",style:{"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":"100%","--zonos--width":"100%"}},h("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosEmptyStatePayment.style=ZonosEmptyStatePaymentStyle0;var zonosNotificationCss=":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-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var ZonosNotificationStyle0=zonosNotificationCss;var ZonosNotification=function(){function t(t){registerInstance(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o,e;var n=this;return __generator(this,(function(a){o="id-".concat(Math.random().toString(36).substring(2,9));e=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[e],false);setTimeout((function(){n.updateTransitionClass({id:o,transitionClass:"show"})}),50);setTimeout((function(){n.removeNotification(o)}),e.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var o=t.id,e=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===o){return Object.assign(Object.assign({},t),{transitionClass:e})}return t}))};t.prototype.removeNotification=function(t){var o=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){o.notificationArray=o.notificationArray.filter((function(o){return o.id!==t}))}),300)};t.prototype.render=function(){var t=this;return h(Host,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:classes(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":getBorderRadius(),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(o){return h("div",{"aria-hidden":"true",class:classes(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:function(){t.removeNotification(o.id)}},h("zonos-text",{textColor:"gray-0"},o.message))}))))};return t}();ZonosNotification.style=ZonosNotificationStyle0;var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function t(t){registerInstance(this,t);this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements;this.isPaymentInfoFilled=false;this.trackingSent=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var o=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:o,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=stripeStore.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,o,e;var n=this;return __generator(this,(function(a){switch(a.label){case 0:if(!this.stripeElements){return[2]}return[4,this.stripeElements.fetchUpdates()];case 1:a.sent();o=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country}}},layout:"tabs"});e=this.el.querySelector(".zonos--payment-component");if(!e){logError("Cannot find container element for paymentElement");return[2]}o.mount(e);o.on("change",(function(t){if(t.complete){n.isPaymentInfoFilled=true}stripeStore.stripePaymentEventData=t}));stripeStore.stripePaymentElement=o;return[2]}}))}))};t.prototype.componentDidLoad=function(){void this.watchInitStripe()};t.prototype.render=function(){return h(Host,{key:"6bc25553430c9e23c77a0607ad28dc4c9efa66e6",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{key:"e4ba3f581697a799e50fe066e7cc922a206af8e5",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"0247eecadf083f09b67c5f668da845431234750d",class:"zonos--payment-component"}),h("div",{key:"7f63abd0a2c1cbc62f931e44fc44c69b57a4f8ed",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}();ZonosPayment.style=ZonosPaymentStyle0;var zonosPaypalPaymentCss=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var ZonosPaypalPaymentStyle0=zonosPaypalPaymentCss;var ZonosPaypalPayment=function(){function t(t){registerInstance(this,t);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.paypalSessionFail=createEvent(this,"paypalSessionFail",7);this.storeUnsubscribeList=[]}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(n){if(!window.Zonos.paypal){log("Paypal is not available");return[2]}t=paypalStoreInitButtons({onPaypalFail:function(){log("onPaypalFail");e.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var o=t.orderId;log("onPaypalSessionDone","info",{orderId:o});e.paypalSessionDone.emit({orderId:o})}});if(!(t===null||t===void 0?void 0:t.length)){log("There are no paypal buttons available");return[2]}o=this.el.querySelector(".zonos--payment-paypal-container");if(!o){log("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.render(o)];case 1:e.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[paypalStoreOnChange("paypal",this.loadPaypal.bind(this))]};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return h(Host,{key:"c01e031b29e0089389be2a16e888bd0b7c24dcd8",class:"zonos--paypal-payment zonos--elements"},h("div",{key:"f03c880bde17291f083cfe1f0db6a918f92d720b",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosPaypalPayment.style=ZonosPaypalPaymentStyle0;export{ZonosCard as zonos_card,ZonosEmptyStatePayment as zonos_empty_state_payment,ZonosNotification as zonos_notification,ZonosPayment as zonos_payment,ZonosPaypalPayment as zonos_paypal_payment};