@zonos/elements 1.3.125 → 1.3.127

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 (272) hide show
  1. package/dist/cjs/{cart-7e5608b4.js → cart-3bdaf092.js} +6 -4
  2. package/dist/cjs/index.cjs.js +7 -7
  3. package/dist/cjs/{isColorVariable-6f5a9608.js → isColorVariable-525dbfa7.js} +2 -0
  4. package/dist/cjs/{paypal-4c479f19.js → paypal-2f48ab8d.js} +1 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +23 -23
  6. package/dist/cjs/zonos-badge.cjs.entry.js +5 -5
  7. package/dist/cjs/zonos-banner.cjs.entry.js +6 -6
  8. package/dist/cjs/zonos-button_3.cjs.entry.js +16 -16
  9. package/dist/cjs/zonos-card.cjs.entry.js +8 -8
  10. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +34 -34
  11. package/dist/cjs/zonos-checkout.cjs.entry.js +12 -7
  12. package/dist/cjs/zonos-collapse.cjs.entry.js +4 -4
  13. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  16. package/dist/cjs/zonos-country-select_4.cjs.entry.js +14 -14
  17. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-input.cjs.entry.js +7 -7
  20. package/dist/cjs/zonos-language-select_2.cjs.entry.js +9 -9
  21. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-logo.cjs.entry.js +6 -6
  23. package/dist/cjs/zonos-notification_3.cjs.entry.js +10 -9
  24. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +5 -5
  25. package/dist/cjs/zonos-text.cjs.entry.js +5 -5
  26. package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-tooltip.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +2 -2
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +2 -2
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +2 -2
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +2 -2
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.css +2 -2
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +2 -2
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +3 -3
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +2 -2
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -3
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +5 -5
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +9 -4
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -3
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +2 -2
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -3
  44. package/dist/collection/components/common/zonos-badge/zonos-badge.css +2 -2
  45. package/dist/collection/components/common/zonos-badge/zonos-badge.js +4 -4
  46. package/dist/collection/components/common/zonos-banner/zonos-banner.css +2 -2
  47. package/dist/collection/components/common/zonos-banner/zonos-banner.js +5 -5
  48. package/dist/collection/components/common/zonos-button/zonos-button.css +12 -12
  49. package/dist/collection/components/common/zonos-button/zonos-button.js +7 -7
  50. package/dist/collection/components/common/zonos-card/zonos-card.css +4 -4
  51. package/dist/collection/components/common/zonos-card/zonos-card.js +7 -7
  52. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +7 -7
  53. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +7 -7
  54. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +5 -5
  55. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +5 -5
  56. package/dist/collection/components/common/zonos-collapse/zonos-collapse.css +2 -2
  57. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +3 -3
  58. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.css +4 -4
  59. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +6 -6
  60. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.css +2 -2
  61. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +2 -2
  62. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +2 -2
  63. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  64. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.css +2 -2
  65. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +3 -3
  66. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +7 -7
  67. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +8 -8
  68. package/dist/collection/components/common/zonos-icon/zonos-icon.css +6 -6
  69. package/dist/collection/components/common/zonos-icon/zonos-icon.js +4 -4
  70. package/dist/collection/components/common/zonos-input/zonos-input.css +5 -5
  71. package/dist/collection/components/common/zonos-input/zonos-input.js +6 -6
  72. package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +2 -2
  73. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +3 -3
  74. package/dist/collection/components/common/zonos-link/zonos-link.css +2 -2
  75. package/dist/collection/components/common/zonos-logo/zonos-logo.css +4 -4
  76. package/dist/collection/components/common/zonos-logo/zonos-logo.js +5 -5
  77. package/dist/collection/components/common/zonos-notification/zonos-notification.css +3 -3
  78. package/dist/collection/components/common/zonos-notification/zonos-notification.js +5 -3
  79. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.css +2 -2
  80. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +4 -4
  81. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +2 -2
  82. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +3 -3
  83. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +8 -8
  84. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +3 -3
  85. package/dist/collection/components/common/zonos-spinner/zonos-spinner.css +6 -6
  86. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +1 -1
  87. package/dist/collection/components/common/zonos-text/zonos-text.css +4 -4
  88. package/dist/collection/components/common/zonos-text/zonos-text.js +3 -3
  89. package/dist/collection/components/common/zonos-toggle/zonos-toggle.css +2 -2
  90. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +3 -3
  91. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +2 -2
  92. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.css +2 -2
  93. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +3 -3
  94. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.css +2 -2
  95. package/dist/collection/components/component-template/zonos-component/zonos-component.css +2 -2
  96. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +2 -2
  97. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +3 -3
  98. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +3 -3
  99. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +2 -2
  100. package/dist/collection/components/main/zonos-controller.css +2 -2
  101. package/dist/collection/components/paypal/zonos-paypal-payment.css +2 -2
  102. package/dist/collection/components/stripe/zonos-address/zonos-address.css +2 -2
  103. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.css +2 -2
  104. package/dist/collection/components/stripe/zonos-payment/zonos-payment.css +2 -2
  105. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +6 -4
  106. package/dist/collection/components/utils/isColorVariable.js +2 -0
  107. package/dist/esm/{cart-65c7d5f1.js → cart-519f08e3.js} +6 -4
  108. package/dist/esm/index.js +7 -7
  109. package/dist/esm/{isColorVariable-82457bef.js → isColorVariable-0a94004f.js} +2 -0
  110. package/dist/esm/{paypal-cd96efa7.js → paypal-d0a05eda.js} +1 -1
  111. package/dist/esm/zonos-address_7.entry.js +23 -23
  112. package/dist/esm/zonos-badge.entry.js +5 -5
  113. package/dist/esm/zonos-banner.entry.js +6 -6
  114. package/dist/esm/zonos-button_3.entry.js +16 -16
  115. package/dist/esm/zonos-card.entry.js +8 -8
  116. package/dist/esm/zonos-cart-items_13.entry.js +34 -34
  117. package/dist/esm/zonos-checkout.entry.js +12 -7
  118. package/dist/esm/zonos-collapse.entry.js +4 -4
  119. package/dist/esm/zonos-component.entry.js +1 -1
  120. package/dist/esm/zonos-controller.entry.js +2 -2
  121. package/dist/esm/zonos-country-flag.entry.js +4 -4
  122. package/dist/esm/zonos-country-select_4.entry.js +14 -14
  123. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  124. package/dist/esm/zonos-hello.entry.js +2 -2
  125. package/dist/esm/zonos-input.entry.js +7 -7
  126. package/dist/esm/zonos-language-select_2.entry.js +9 -9
  127. package/dist/esm/zonos-link.entry.js +1 -1
  128. package/dist/esm/zonos-logo.entry.js +6 -6
  129. package/dist/esm/zonos-notification_3.entry.js +10 -9
  130. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  131. package/dist/esm/zonos-text.entry.js +5 -5
  132. package/dist/esm/zonos-toggle.entry.js +4 -4
  133. package/dist/esm/zonos-tooltip.entry.js +1 -1
  134. package/dist/esm/zonos-v-stack.entry.js +4 -4
  135. package/dist/esm-es5/{cart-65c7d5f1.js → cart-519f08e3.js} +1 -1
  136. package/dist/esm-es5/index.js +1 -1
  137. package/dist/esm-es5/isColorVariable-0a94004f.js +1 -0
  138. package/dist/esm-es5/{paypal-cd96efa7.js → paypal-d0a05eda.js} +1 -1
  139. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  140. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  141. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  142. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  143. package/dist/esm-es5/zonos-card.entry.js +1 -1
  144. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  145. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  146. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  147. package/dist/esm-es5/zonos-component.entry.js +1 -1
  148. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  149. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  150. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  151. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  152. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  153. package/dist/esm-es5/zonos-input.entry.js +1 -1
  154. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  155. package/dist/esm-es5/zonos-link.entry.js +1 -1
  156. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  157. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  158. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  159. package/dist/esm-es5/zonos-text.entry.js +1 -1
  160. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  161. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  162. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  163. package/dist/scripts/index.js +1 -1
  164. package/dist/scripts/loadZonos.js +1 -1
  165. package/dist/scripts/zonos.js +1 -1
  166. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  167. package/dist/zonos-elements/index.esm.js +1 -1
  168. package/dist/zonos-elements/p-0082eefd.system.entry.js +1 -0
  169. package/dist/zonos-elements/{p-f8827566.js → p-00ff4f4a.js} +1 -1
  170. package/dist/zonos-elements/p-0bc813a9.system.entry.js +1 -0
  171. package/dist/zonos-elements/p-0c6a933c.entry.js +1 -0
  172. package/dist/zonos-elements/p-0cb426b8.entry.js +1 -0
  173. package/dist/zonos-elements/p-167b7fa8.system.entry.js +1 -0
  174. package/dist/zonos-elements/p-1e4d8228.entry.js +1 -0
  175. package/dist/zonos-elements/{p-988b6d65.system.js → p-1ed1ce99.system.js} +1 -1
  176. package/dist/zonos-elements/{p-c6f74e2c.js → p-2402e12c.js} +1 -1
  177. package/dist/zonos-elements/p-2906956b.entry.js +1 -0
  178. package/dist/zonos-elements/p-2db962f9.system.entry.js +1 -0
  179. package/dist/zonos-elements/p-311f6702.entry.js +1 -0
  180. package/dist/zonos-elements/p-3b5f49f6.system.entry.js +1 -0
  181. package/dist/zonos-elements/{p-b2262a9c.entry.js → p-3dbfe639.entry.js} +1 -1
  182. package/dist/zonos-elements/p-4170b042.entry.js +1 -0
  183. package/dist/zonos-elements/p-4cd1e79c.system.entry.js +1 -0
  184. package/dist/zonos-elements/p-4fee6e7f.system.entry.js +1 -0
  185. package/dist/zonos-elements/p-5610934b.entry.js +1 -0
  186. package/dist/zonos-elements/p-57d93236.entry.js +1 -0
  187. package/dist/zonos-elements/p-5ac777a7.system.entry.js +1 -0
  188. package/dist/zonos-elements/p-61380d53.system.entry.js +1 -0
  189. package/dist/zonos-elements/p-685e395e.entry.js +1 -0
  190. package/dist/zonos-elements/p-6a2bed3e.system.entry.js +1 -0
  191. package/dist/zonos-elements/p-6b0a8709.system.entry.js +1 -0
  192. package/dist/zonos-elements/p-6c047faf.system.entry.js +1 -0
  193. package/dist/zonos-elements/p-6de5611e.entry.js +1 -0
  194. package/dist/zonos-elements/{p-148e7eb7.entry.js → p-723c9d4d.entry.js} +1 -1
  195. package/dist/zonos-elements/p-76d03238.entry.js +1 -0
  196. package/dist/zonos-elements/{p-66303c89.system.entry.js → p-798d715c.entry.js} +1 -1
  197. package/dist/zonos-elements/p-8b3d9796.system.entry.js +1 -0
  198. package/dist/zonos-elements/p-8ca3b73a.entry.js +1 -0
  199. package/dist/zonos-elements/p-8df3d5d0.system.entry.js +1 -0
  200. package/dist/zonos-elements/p-970527fe.entry.js +1 -0
  201. package/dist/zonos-elements/p-9833f37d.system.entry.js +1 -0
  202. package/dist/zonos-elements/p-a372a9a0.entry.js +1 -0
  203. package/dist/zonos-elements/p-a7eaa9ad.entry.js +1 -0
  204. package/dist/zonos-elements/{p-0ceb45a9.system.js → p-abbfde44.system.js} +1 -1
  205. package/dist/zonos-elements/p-ae393255.js +1 -0
  206. package/dist/zonos-elements/p-bc9987f2.system.entry.js +1 -0
  207. package/dist/zonos-elements/{p-f8c7bc1d.entry.js → p-bf2f9095.entry.js} +1 -1
  208. package/dist/zonos-elements/p-c5d1217f.system.js +1 -0
  209. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  210. package/dist/zonos-elements/p-cf7a5119.entry.js +1 -0
  211. package/dist/zonos-elements/p-d6f1b6fa.system.entry.js +1 -0
  212. package/dist/zonos-elements/p-e2cda105.system.entry.js +1 -0
  213. package/dist/zonos-elements/p-e6fad32a.system.entry.js +1 -0
  214. package/dist/zonos-elements/p-e933cbf0.system.entry.js +1 -0
  215. package/dist/zonos-elements/p-ea8663b7.entry.js +1 -0
  216. package/dist/zonos-elements/p-eb6d1e26.system.entry.js +1 -0
  217. package/dist/zonos-elements/p-eca920dc.system.entry.js +1 -0
  218. package/dist/zonos-elements/p-efffbaec.entry.js +1 -0
  219. package/dist/zonos-elements/p-f50f48da.entry.js +1 -0
  220. package/dist/zonos-elements/{p-80a4d1e0.system.js → p-f7d56ce5.system.js} +1 -1
  221. package/dist/zonos-elements/p-f962fc6a.system.entry.js +1 -0
  222. package/dist/zonos-elements/p-fe899c47.entry.js +1 -0
  223. package/dist/zonos-elements/p-ff0a79e6.system.entry.js +1 -0
  224. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/esm-es5/isColorVariable-82457bef.js +0 -1
  227. package/dist/zonos-elements/p-0cedb17a.system.entry.js +0 -1
  228. package/dist/zonos-elements/p-139fd9b9.entry.js +0 -1
  229. package/dist/zonos-elements/p-149612d6.entry.js +0 -1
  230. package/dist/zonos-elements/p-14c67ae2.system.entry.js +0 -1
  231. package/dist/zonos-elements/p-1aed6403.system.entry.js +0 -1
  232. package/dist/zonos-elements/p-1d1c3377.entry.js +0 -1
  233. package/dist/zonos-elements/p-1e4f7997.system.entry.js +0 -1
  234. package/dist/zonos-elements/p-21970d09.system.entry.js +0 -1
  235. package/dist/zonos-elements/p-26be7ea7.entry.js +0 -1
  236. package/dist/zonos-elements/p-28b79606.system.entry.js +0 -1
  237. package/dist/zonos-elements/p-30476a6b.entry.js +0 -1
  238. package/dist/zonos-elements/p-3e2aa5e2.entry.js +0 -1
  239. package/dist/zonos-elements/p-3f5b6e7a.system.entry.js +0 -1
  240. package/dist/zonos-elements/p-4161a0f2.system.entry.js +0 -1
  241. package/dist/zonos-elements/p-44991bcf.entry.js +0 -1
  242. package/dist/zonos-elements/p-46d96a0d.entry.js +0 -1
  243. package/dist/zonos-elements/p-4a107b6f.system.js +0 -1
  244. package/dist/zonos-elements/p-4a3c1449.system.entry.js +0 -1
  245. package/dist/zonos-elements/p-4c6033ed.system.entry.js +0 -1
  246. package/dist/zonos-elements/p-4c64f0ea.system.entry.js +0 -1
  247. package/dist/zonos-elements/p-55d26aaa.system.entry.js +0 -1
  248. package/dist/zonos-elements/p-56370c8b.system.entry.js +0 -1
  249. package/dist/zonos-elements/p-66eb66d1.js +0 -1
  250. package/dist/zonos-elements/p-6de38759.entry.js +0 -1
  251. package/dist/zonos-elements/p-7a4170ba.entry.js +0 -1
  252. package/dist/zonos-elements/p-80733970.system.entry.js +0 -1
  253. package/dist/zonos-elements/p-99ab4440.entry.js +0 -1
  254. package/dist/zonos-elements/p-9a89de05.system.entry.js +0 -1
  255. package/dist/zonos-elements/p-a435037c.entry.js +0 -1
  256. package/dist/zonos-elements/p-a7c24425.system.entry.js +0 -1
  257. package/dist/zonos-elements/p-ada1c7b6.entry.js +0 -1
  258. package/dist/zonos-elements/p-b2247065.entry.js +0 -1
  259. package/dist/zonos-elements/p-b31095d5.system.entry.js +0 -1
  260. package/dist/zonos-elements/p-bb53bce8.entry.js +0 -1
  261. package/dist/zonos-elements/p-d13f3ea0.system.entry.js +0 -1
  262. package/dist/zonos-elements/p-d3472a00.system.entry.js +0 -1
  263. package/dist/zonos-elements/p-d91da318.entry.js +0 -1
  264. package/dist/zonos-elements/p-daba3f99.system.entry.js +0 -1
  265. package/dist/zonos-elements/p-de2fe7f5.entry.js +0 -1
  266. package/dist/zonos-elements/p-e19034a3.entry.js +0 -1
  267. package/dist/zonos-elements/p-e46bd90a.entry.js +0 -1
  268. package/dist/zonos-elements/p-eeb2c2f4.system.entry.js +0 -1
  269. package/dist/zonos-elements/p-f0b32dd6.entry.js +0 -1
  270. package/dist/zonos-elements/p-fe855df9.system.entry.js +0 -1
  271. package/dist/zonos-elements/p-ff6e4ea6.entry.js +0 -1
  272. package/dist/zonos-elements/p-fff6e3d9.system.entry.js +0 -1
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.125.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=S(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),k=new RegExp(`^cart_${Z.source}$`),I=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?k.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.125.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.125",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1731090046100",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.125",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await I($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.125";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.125";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},exports.Zonos=D})();
1
+ (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.127.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=S(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),k=new RegExp(`^cart_${Z.source}$`),I=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?k.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.127.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.127",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1731357857510",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.127",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await I($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.127";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.127";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},exports.Zonos=D})();
@@ -1 +1 @@
1
- (function(){"use strict";function e(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=["cloudflare","vercel"],n=o[0],r={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},t=r[n],s=(e=n)=>{const r=o.indexOf(e),t=o[r+1];return t||null},i=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},a=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},d=(e,o,...n)=>{var r,t;const{elapsedTimePretty:s}=(()=>{const e=performance.now()-a,o=e>1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(2)}ms`;return{elapsedTime:e,elapsedTimePretty:o}})(),i=[`(${s})`,...n];i.map(c).join(" ");if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let d=document.querySelector("iframe#zonos---debug-logging-iframe");d||(d=document.createElement("iframe"),d.id="zonos---debug-logging-iframe",d.style.display="none",d.style.opacity="0",d.style.position="absolute",d.style.top="-9999px",d.style.left="-9999px",d.style.width="1px",d.style.height="1px",d.style.border="none",d.style.overflow="hidden",d.style.visibility="hidden",document.body.appendChild(d));const l=(null===(t=d.contentWindow)||void 0===t?void 0:t.window.console)||window.console;switch(o){case"warn":l.warn(e,...i);break;case"info":l.info(e,...i);break;case"error":l.error(e,...i);break;default:l.groupCollapsed(e,...i),l.trace(),l.groupEnd()}},l=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:i})=>{if(d("sendErrorLog","warn",e,n,o),i){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const a="userAgentData"in window.navigator?window.navigator.userAgentData:null,c={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:a&&a.brands.length>0?a:window.navigator.userAgent},n)};try{fetch(`${t}/api/zonos-elements/log-error`,{body:JSON.stringify(c),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=s();if(!o)return;fetch(`${r[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(c),method:"POST"})}},p=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{const o=await e.text(),n=i(o);if(!n)throw new Error(`Failed to parse content: ${o}`);return n}catch(e){if(n)throw e;return o&&console.error(e),null}},u=async({basePathType:e,options:o,path:t})=>{let s;const i=window.Zonos.zonosQaUrlApi||r[e]||n,a=new URL(i+t),c=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(c));try{s=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const d=s.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&d&&l&&(window.Zonos.modeAlerted=!0),s.ok){return{baseUrl:i,errors:[],json:await p({response:s}),response:s,zonosMode:d}}const u=s.status.toString();try{const e=await p({response:s,shouldThrow:!0});return{baseUrl:i,errors:[{message:JSON.stringify(e),type:u}],json:null,response:s,zonosMode:d}}catch(e){return{baseUrl:i,errors:[{message:`${u}: ${"Unknown error"}`,type:u}],json:null,response:null,zonosMode:d}}},m=async({basePathType:o,options:n,path:t})=>{var a,c;const p=t.startsWith("/api/bigcommerce")?"vercel":o,w=await u({basePathType:p,options:n,path:t}),{errors:g,response:f}=w,h=e(w,["errors","response"]),y=s(p),v=!!g.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),S=y&&v;return v&&l({endpoint:r[p]+t,errors:g.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:p,nextFallbackApiType:y,requestHeaders:null==n?void 0:n.headers,requestPayload:i(null===(a=null==n?void 0:n.body)||void 0===a?void 0:a.toString())||(null===(c=null==n?void 0:n.body)||void 0===c?void 0:c.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),S?(d(`=== "${t}" failed to fetch, trying next fallback ${y}`),m({basePathType:y,options:n,path:t})):Object.assign({errors:g,response:f},h)},w=async(o,r)=>{const t=e(r||{},[]),s=t.body?JSON.stringify(t.body):void 0,i=t.method||"GET",a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},t.headers),c=Object.assign(Object.assign({},t),{body:"GET"===i?void 0:s,headers:a,method:i}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return d(o,"info"),m({basePathType:l||n,options:c,path:o})},g=(e,...o)=>{d(e,"error",...o)},f=["jsdelivr","cdnjs","unpkg","vercel"],h=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},y=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,v=new RegExp(`^${y.source}$`),S=new RegExp(`^cart_${y.source}$`),Z=e=>e?S.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:v.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1},L=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:t}=await w("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),s=!t||r.length;return s&&o?(d("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),L({cartId:e,retries:o-1})):s?null:t};var z;const O=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=h(window.location.href),n="https://v1.3.125.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return d(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),r})(),b=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=h(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const r=`https://${e}.route.js.zonos.com`;return d(`[ZONOS-WARNING] using '${r}' for serverless API`,"warn"),r})();class U{}z=U,U.isNpm=!1,U.isBigCommerce=!1,U.requested=!1,U.cartData=null,U.isLegacyCheckout=!1,U.legacyStoreLogo=null,U.legacyStoreFavicon=null,U.parallelLoadTimes=[],U.parallelLoadState="off",U.releaseDate="1731090046100",U.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:r,scriptLoadUrl:t,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(t)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},r)))}catch(e){}},U.loadScriptLogParallelHandler=async e=>{try{if(z.parallelLoadTimes.push(e),2===z.parallelLoadTimes.length){const e=z.parallelLoadTimes.find((e=>"vercel"===e.type)),o=z.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void l({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});z.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},U.legacyCheckoutErrorHandler=({message:e,metadata:o})=>{g(`[ZONOS - loadZonos] ${e}`),l({endpoint:"LegacyCheckoutInit",errors:[e],metadata:Object.assign(Object.assign({},o),{tempCartUUID:z.cartId})}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},U.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.125";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.125":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.125");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},U.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:r,version:t})=>{var s;t&&(window.Zonos.version=t);const i="vercel"===e?r:z.getGithubCdn({type:e,version:t}),a=O||i,c=a.replace("https://","").replace("http://",""),p=document.createElement("script"),u=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";p.src=`https://${c}/dist/scripts/${u}`,d(`[ZONOS - loadZonos] Injecting "${u}" from "${c}"`,"info");const m="4g"===(null===(s=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n})())||void 0===s?void 0:s.effectiveType),w=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),g=f[0]===e,h=f[1],y="on"===z.parallelLoadState&&m&&g&&h&&!w;y&&z.injectZonos({cdnType:h,initConfig:o,parallelLoaded:!0,vercelUrl:r,version:t});const v=performance.now();p.addEventListener("load",(()=>{var r;if(y||n?z.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:p.src,storeId:z.storeId,type:e}):z.loadScriptLogHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:p.src,storeId:z.storeId,type:e}),z.isBigCommerce||(z.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=O,window.Zonos.zonosQaUrlApi=b,window.Zonos.isBigCommerce=z.isBigCommerce,z.cartId){if(!z.zonosApiKey)throw z.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!z.cartData)throw z.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(z.legacyStoreFavicon&&z.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=z.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=z.cartData,window.Zonos.isLegacyCheckout=z.isLegacyCheckout;const e=z.isLegacyCheckout&&"CLOSE_MODAL"===(null===(r=o.checkoutSettings)||void 0===r?void 0:r.successBehavior),n=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:z.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},o.checkoutSettings),{successBehavior:e?"ZONOS_SUCCESS_PAGE":void 0,successRedirectUrl:e?z.cartData.storeBaseUrl:void 0}),zonosApiKey:z.zonosApiKey});o=n}window.Zonos.version&&(d(`[ZONOS - loadZonos] Execute "Zonos.init" from "${u}" from "${c}"`,"info"),window.Zonos.init(o))})),p.addEventListener("error",(async()=>{const s=(e=>{const o=f.indexOf(e);return f[o+1]||null})(e);if(!y&&!n){if(!s)return;z.injectZonos({cdnType:s,initConfig:o,vercelUrl:r,version:t})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||O)return;if(y||n)return void z.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,isError:!0,scriptLoadUrl:p.src,storeId:z.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?l({endpoint:p.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-v,cdnType:e,loadUrl:a,version:t},shouldPostReleaseErrorReporting:!!s}):l({endpoint:p.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-v}})})),document.head.appendChild(p)},U.init=async e=>{var o;if(O&&!window.isZonosPreview){d(`[ZONOS - loadZonos] Re-inject "loadZonos.js" from zonosQaUrl: ${O}`,"info");const o=document.createElement("script");return o.src=`${O}/dist/scripts/loadZonos.js?timestamp=${Date.now()}`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=!1,window.Zonos.isBigCommerce=z.isBigCommerce,window.Zonos.isLegacyCheckout=z.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${O}`)})),void(window.isZonosPreview=!0)}const n=new URLSearchParams(window.location.search).get("tempCartUUID"),{isDgsCartId:r,isLegacyCartId:t}=Z(n);if(n&&!t&&!r)return void z.legacyCheckoutErrorHandler({message:`[ZONOS - loadZonos] invalid &tempCartUUID=${n}`,metadata:{invalidCartId:!0}});z.cartId=n;const s="https://v1.3.125.js.zonos.com",i=document.querySelector('script[src*="/zonos.js"]'),a=null===(o=document.querySelector("script[src*='/loadZonos.js']"))||void 0===o?void 0:o.src;d(`[ZONOS - init] first load script src: ${a}`,"info"),window.Zonos.zonosQaUrl=O,window.Zonos.zonosQaUrlApi=b,window.Zonos.zonosQaUrl&&d(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&d(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const c=null==a?void 0:a.includes("timestamp=");if(!(z.isNpm||a&&c))return void g("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(i||!a||z.requested)return void d("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!z.cartId)return z.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void g("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(z.requested=!0,z.zonosApiKey=e.zonosApiKey,z.storeId=e.storeId,z.cartId){const e=await(async e=>{const{isDgsCartId:o,isLegacyCartId:n}=Z(e);if(!n&&!o)return g("[ZONOS - loadZonos] invalid cart id"),null;const r=await L({cartId:e,retries:5});return d("[ZONOS - loadZonos] getting temp cart data","info",r),r?{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}:(g("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(z.cartId);if(!e)throw z.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");z.cartData=e.cartData,z.zonosApiKey=e.zonosApiKey,z.legacyStoreLogo=e.storeLogo,z.legacyStoreFavicon=e.storeFavicon,z.storeId=e.storeId,z.zonosApiKey=e.zonosApiKey}if(!z.zonosApiKey)return void g('"zonosApiKey" is required to initialize Zonos');if(!z.storeId)return d("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void z.injectZonos({initConfig:e,vercelUrl:s,version:null});const l=z.storeId||e.storeId;d(`[ZONOS - loadZonos] Store ID: ${l}`,"info");const p=new URLSearchParams;p.set("storeId",l.toString());const{errors:u,json:m}=await w(`/api/get-store-version?${p.toString()}`);if(u.length||!m)return d("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void z.injectZonos({initConfig:e,vercelUrl:s,version:null});const{isDifferent:f,source:h,version:y}=m;if(d(`[ZONOS - loadZonos] Store version: ${y}, source: ${h}`,"info"),f){d(`[ZONOS - loadZonos] Updating saved store version to ${y}`,"info");const e={storeId:l,version:y};w(`/api/set-store-version?${p.toString()}`,{body:e,method:"POST"}).catch((e=>g("Unable to save store's vesrion",e)))}if(!i){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}})({loadScriptSrc:a}),t=r&&!n?o:`${"alpha"===y?"alpha":`v${y}`}.js.zonos.com`,s=r&&!n?null:y;d("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r,loadUrl:t,loadVersion:s,version:y}),z.injectZonos({initConfig:e,vercelUrl:t,version:s})}},void 0===window.Zonos&&(window.Zonos=U)})();
1
+ (function(){"use strict";function e(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=["cloudflare","vercel"],n=o[0],r={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},t=r[n],s=(e=n)=>{const r=o.indexOf(e),t=o[r+1];return t||null},i=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},a=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},d=(e,o,...n)=>{var r,t;const{elapsedTimePretty:s}=(()=>{const e=performance.now()-a,o=e>1e3?`${(e/1e3).toFixed(2)}s`:`${e.toFixed(2)}ms`;return{elapsedTime:e,elapsedTimePretty:o}})(),i=[`(${s})`,...n];i.map(c).join(" ");if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let d=document.querySelector("iframe#zonos---debug-logging-iframe");d||(d=document.createElement("iframe"),d.id="zonos---debug-logging-iframe",d.style.display="none",d.style.opacity="0",d.style.position="absolute",d.style.top="-9999px",d.style.left="-9999px",d.style.width="1px",d.style.height="1px",d.style.border="none",d.style.overflow="hidden",d.style.visibility="hidden",document.body.appendChild(d));const l=(null===(t=d.contentWindow)||void 0===t?void 0:t.window.console)||window.console;switch(o){case"warn":l.warn(e,...i);break;case"info":l.info(e,...i);break;case"error":l.error(e,...i);break;default:l.groupCollapsed(e,...i),l.trace(),l.groupEnd()}},l=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:i})=>{if(d("sendErrorLog","warn",e,n,o),i){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const a="userAgentData"in window.navigator?window.navigator.userAgentData:null,c={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:a&&a.brands.length>0?a:window.navigator.userAgent},n)};try{fetch(`${t}/api/zonos-elements/log-error`,{body:JSON.stringify(c),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=s();if(!o)return;fetch(`${r[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(c),method:"POST"})}},p=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{const o=await e.text(),n=i(o);if(!n)throw new Error(`Failed to parse content: ${o}`);return n}catch(e){if(n)throw e;return o&&console.error(e),null}},u=async({basePathType:e,options:o,path:t})=>{let s;const i=window.Zonos.zonosQaUrlApi||r[e]||n,a=new URL(i+t),c=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(c));try{s=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const d=s.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&d&&l&&(window.Zonos.modeAlerted=!0),s.ok){return{baseUrl:i,errors:[],json:await p({response:s}),response:s,zonosMode:d}}const u=s.status.toString();try{const e=await p({response:s,shouldThrow:!0});return{baseUrl:i,errors:[{message:JSON.stringify(e),type:u}],json:null,response:s,zonosMode:d}}catch(e){return{baseUrl:i,errors:[{message:`${u}: ${"Unknown error"}`,type:u}],json:null,response:null,zonosMode:d}}},m=async({basePathType:o,options:n,path:t})=>{var a,c;const p=t.startsWith("/api/bigcommerce")?"vercel":o,w=await u({basePathType:p,options:n,path:t}),{errors:g,response:f}=w,h=e(w,["errors","response"]),y=s(p),v=!!g.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),S=y&&v;return v&&l({endpoint:r[p]+t,errors:g.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:p,nextFallbackApiType:y,requestHeaders:null==n?void 0:n.headers,requestPayload:i(null===(a=null==n?void 0:n.body)||void 0===a?void 0:a.toString())||(null===(c=null==n?void 0:n.body)||void 0===c?void 0:c.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),S?(d(`=== "${t}" failed to fetch, trying next fallback ${y}`),m({basePathType:y,options:n,path:t})):Object.assign({errors:g,response:f},h)},w=async(o,r)=>{const t=e(r||{},[]),s=t.body?JSON.stringify(t.body):void 0,i=t.method||"GET",a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},t.headers),c=Object.assign(Object.assign({},t),{body:"GET"===i?void 0:s,headers:a,method:i}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return d(o,"info"),m({basePathType:l||n,options:c,path:o})},g=(e,...o)=>{d(e,"error",...o)},f=["jsdelivr","cdnjs","unpkg","vercel"],h=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},y=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,v=new RegExp(`^${y.source}$`),S=new RegExp(`^cart_${y.source}$`),Z=e=>e?S.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:v.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1},L=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:t}=await w("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),s=!t||r.length;return s&&o?(d("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),L({cartId:e,retries:o-1})):s?null:t};var z;const O=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=h(window.location.href),n="https://v1.3.127.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return d(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),r})(),b=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=h(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const r=`https://${e}.route.js.zonos.com`;return d(`[ZONOS-WARNING] using '${r}' for serverless API`,"warn"),r})();class U{}z=U,U.isNpm=!1,U.isBigCommerce=!1,U.requested=!1,U.cartData=null,U.isLegacyCheckout=!1,U.legacyStoreLogo=null,U.legacyStoreFavicon=null,U.parallelLoadTimes=[],U.parallelLoadState="off",U.releaseDate="1731357857510",U.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:r,scriptLoadUrl:t,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(t)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},r)))}catch(e){}},U.loadScriptLogParallelHandler=async e=>{try{if(z.parallelLoadTimes.push(e),2===z.parallelLoadTimes.length){const e=z.parallelLoadTimes.find((e=>"vercel"===e.type)),o=z.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void l({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});z.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},U.legacyCheckoutErrorHandler=({message:e,metadata:o})=>{g(`[ZONOS - loadZonos] ${e}`),l({endpoint:"LegacyCheckoutInit",errors:[e],metadata:Object.assign(Object.assign({},o),{tempCartUUID:z.cartId})}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},U.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.127";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.127":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.127");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},U.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:r,version:t})=>{var s;t&&(window.Zonos.version=t);const i="vercel"===e?r:z.getGithubCdn({type:e,version:t}),a=O||i,c=a.replace("https://","").replace("http://",""),p=document.createElement("script"),u=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";p.src=`https://${c}/dist/scripts/${u}`,d(`[ZONOS - loadZonos] Injecting "${u}" from "${c}"`,"info");const m="4g"===(null===(s=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n})())||void 0===s?void 0:s.effectiveType),w=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),g=f[0]===e,h=f[1],y="on"===z.parallelLoadState&&m&&g&&h&&!w;y&&z.injectZonos({cdnType:h,initConfig:o,parallelLoaded:!0,vercelUrl:r,version:t});const v=performance.now();p.addEventListener("load",(()=>{var r;if(y||n?z.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:p.src,storeId:z.storeId,type:e}):z.loadScriptLogHandler({fallbackLoadTime:performance.now()-v,scriptLoadUrl:p.src,storeId:z.storeId,type:e}),z.isBigCommerce||(z.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=O,window.Zonos.zonosQaUrlApi=b,window.Zonos.isBigCommerce=z.isBigCommerce,z.cartId){if(!z.zonosApiKey)throw z.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!z.cartData)throw z.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(z.legacyStoreFavicon&&z.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=z.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=z.cartData,window.Zonos.isLegacyCheckout=z.isLegacyCheckout;const e=z.isLegacyCheckout&&"CLOSE_MODAL"===(null===(r=o.checkoutSettings)||void 0===r?void 0:r.successBehavior),n=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:z.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},o.checkoutSettings),{successBehavior:e?"ZONOS_SUCCESS_PAGE":void 0,successRedirectUrl:e?z.cartData.storeBaseUrl:void 0}),zonosApiKey:z.zonosApiKey});o=n}window.Zonos.version&&(d(`[ZONOS - loadZonos] Execute "Zonos.init" from "${u}" from "${c}"`,"info"),window.Zonos.init(o))})),p.addEventListener("error",(async()=>{const s=(e=>{const o=f.indexOf(e);return f[o+1]||null})(e);if(!y&&!n){if(!s)return;z.injectZonos({cdnType:s,initConfig:o,vercelUrl:r,version:t})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||O)return;if(y||n)return void z.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-v,isError:!0,scriptLoadUrl:p.src,storeId:z.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?l({endpoint:p.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-v,cdnType:e,loadUrl:a,version:t},shouldPostReleaseErrorReporting:!!s}):l({endpoint:p.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-v}})})),document.head.appendChild(p)},U.init=async e=>{var o;if(O&&!window.isZonosPreview){d(`[ZONOS - loadZonos] Re-inject "loadZonos.js" from zonosQaUrl: ${O}`,"info");const o=document.createElement("script");return o.src=`${O}/dist/scripts/loadZonos.js?timestamp=${Date.now()}`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=!1,window.Zonos.isBigCommerce=z.isBigCommerce,window.Zonos.isLegacyCheckout=z.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${O}`)})),void(window.isZonosPreview=!0)}const n=new URLSearchParams(window.location.search).get("tempCartUUID"),{isDgsCartId:r,isLegacyCartId:t}=Z(n);if(n&&!t&&!r)return void z.legacyCheckoutErrorHandler({message:`[ZONOS - loadZonos] invalid &tempCartUUID=${n}`,metadata:{invalidCartId:!0}});z.cartId=n;const s="https://v1.3.127.js.zonos.com",i=document.querySelector('script[src*="/zonos.js"]'),a=null===(o=document.querySelector("script[src*='/loadZonos.js']"))||void 0===o?void 0:o.src;d(`[ZONOS - init] first load script src: ${a}`,"info"),window.Zonos.zonosQaUrl=O,window.Zonos.zonosQaUrlApi=b,window.Zonos.zonosQaUrl&&d(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&d(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const c=null==a?void 0:a.includes("timestamp=");if(!(z.isNpm||a&&c))return void g("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(i||!a||z.requested)return void d("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!z.cartId)return z.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void g("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(z.requested=!0,z.zonosApiKey=e.zonosApiKey,z.storeId=e.storeId,z.cartId){const e=await(async e=>{const{isDgsCartId:o,isLegacyCartId:n}=Z(e);if(!n&&!o)return g("[ZONOS - loadZonos] invalid cart id"),null;const r=await L({cartId:e,retries:5});return d("[ZONOS - loadZonos] getting temp cart data","info",r),r?{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}:(g("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(z.cartId);if(!e)throw z.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");z.cartData=e.cartData,z.zonosApiKey=e.zonosApiKey,z.legacyStoreLogo=e.storeLogo,z.legacyStoreFavicon=e.storeFavicon,z.storeId=e.storeId,z.zonosApiKey=e.zonosApiKey}if(!z.zonosApiKey)return void g('"zonosApiKey" is required to initialize Zonos');if(!z.storeId)return d("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void z.injectZonos({initConfig:e,vercelUrl:s,version:null});const l=z.storeId||e.storeId;d(`[ZONOS - loadZonos] Store ID: ${l}`,"info");const p=new URLSearchParams;p.set("storeId",l.toString());const{errors:u,json:m}=await w(`/api/get-store-version?${p.toString()}`);if(u.length||!m)return d("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void z.injectZonos({initConfig:e,vercelUrl:s,version:null});const{isDifferent:f,source:h,version:y}=m;if(d(`[ZONOS - loadZonos] Store version: ${y}, source: ${h}`,"info"),f){d(`[ZONOS - loadZonos] Updating saved store version to ${y}`,"info");const e={storeId:l,version:y};w(`/api/set-store-version?${p.toString()}`,{body:e,method:"POST"}).catch((e=>g("Unable to save store's vesrion",e)))}if(!i){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}})({loadScriptSrc:a}),t=r&&!n?o:`${"alpha"===y?"alpha":`v${y}`}.js.zonos.com`,s=r&&!n?null:y;d("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r,loadUrl:t,loadVersion:s,version:y}),z.injectZonos({initConfig:e,vercelUrl:t,version:s})}},void 0===window.Zonos&&(window.Zonos=U)})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.125.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=S(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.125.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.125",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1731090046100",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.125",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.125";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.125";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
1
+ (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.127.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{const o=await e.text(),t=S(o);if(!t)throw new Error(`Failed to parse content: ${o}`);return t}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.127.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.127",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1731357857510",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.127",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.127";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.127";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
@@ -1 +1 @@
1
- <svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>g>
1
+ <svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>
@@ -1 +1 @@
1
- import{l as e,a as n}from"./p-7769b60c.js";import{s as o,c as t}from"./p-a3b195e9.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-a3b195e9.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.125.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},a="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&u.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${a}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.125.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.125",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1731090000621",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.125",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.125";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.125";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}
1
+ import{l as e,a as n}from"./p-7769b60c.js";import{s as o,c as t}from"./p-a3b195e9.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-a3b195e9.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.127.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},a="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&u.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${a}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.127.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.127",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1731357811312",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.127",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.127";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.127";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}
@@ -0,0 +1 @@
1
+ System.register(["./p-fd061229.system.js","./p-23e7c655.system.js"],(function(o){"use strict";var t,s,e,n;return{setters:[function(o){t=o.r;s=o.h;e=o.H},function(o){n=o.c}],execute:function(){var a=":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--tooltip{position:relative}:host .zonos--tooltip .zonos--tooltip-content{position:absolute;bottom:100%;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:12px;background-color:var(--zonos-elements-gray-1000);opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:var(--zonos-elements-radius-4);z-index:100;-webkit-box-shadow:var(--zonos-elements-v3-shadow-large);box-shadow:var(--zonos-elements-v3-shadow-large)}:host .zonos--tooltip .zonos--tooltip-content.zonos--show-tooltip{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var i=a;var r=o("zonos_tooltip",function(){function o(o){t(this,o);this.label="";this.subtitle="";this.showTooltip=false}o.prototype.render=function(){var o=this;return s(e,{key:"24f3b1f73cc320540ab3700213004c267ea04658",class:"zonos--elements"},s("div",{key:"7f52acf90cb5b9f1fd5efdc4fedc4d61a893a646",class:"zonos--tooltip",onMouseEnter:function(){return o.showTooltip=true},onMouseLeave:function(){return o.showTooltip=false}},s("slot",{key:"1871529e8b75c44a71bf1f5bc9e60b81bbc598d2"}),s("div",{key:"c0b9c9c1b3fef5f766d2bad4c5bea48f3d6bbb6f",class:n([this.showTooltip&&"zonos--show-tooltip","zonos--tooltip-content"])},s("zonos-text",{key:"3b106cb439877dffa101f15fb01aff980a64c7cb",size:"s",textColor:"gray-0",type:"boldLabel"},this.label),s("zonos-text",{key:"c0005051e6e1b614b7739718e1a262f6043d56f5",size:"xs",textColor:"gray-0"},this.subtitle))))};return o}());r.style=i}}}));
@@ -1,4 +1,4 @@
1
- import{z as o,c as e}from"./p-91cfbf46.js";import{d as r,w as n,p as t,v as a,h as i}from"./p-c6f74e2c.js";import{h as s,l as c,a as l,j as u}from"./p-7769b60c.js";import{t as d}from"./p-e1ce04b1.js";
1
+ import{z as o,c as e}from"./p-91cfbf46.js";import{d as r,w as n,p as t,v as a,h as i}from"./p-2402e12c.js";import{h as s,l as c,a as l,j as u}from"./p-7769b60c.js";import{t as d}from"./p-e1ce04b1.js";
2
2
  /*!
3
3
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
4
4
  * Copyright 2020-present, PayPal, Inc. All rights reserved.
@@ -0,0 +1 @@
1
+ System.register(["./p-fd061229.system.js","./p-00dc1507.system.js","./p-23e7c655.system.js"],(function(t){"use strict";var o,s,n,a,i;return{setters:[function(t){o=t.r;s=t.h;n=t.H},function(t){a=t.d},function(t){i=t.c}],execute:function(){var r=":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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";var e=r;var c=t("zonos_v_stack",function(){function t(t){o(this,t);this.spacing=24}t.prototype.render=function(){return s(n,{key:"1c12857cdab3dcbfae5135d40cbf276451bbcf81",style:{"--zonos--font-family":a()}},s("div",{key:"8c88f2390c758ed9961daf1d9f5cadb3bd67b928",class:i(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},s("slot",{key:"fa31c9a430b53b837d840827097a56acbd033b8e"})))};return t}());c.style=e}}}));
@@ -0,0 +1 @@
1
+ import{r as t,h as s,H as o,d as e}from"./p-5b7da777.js";import{d as i}from"./p-91cfbf46.js";const h=class{constructor(s){t(this,s),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var t,s,o;this.iframe=(null===(t=this.el.shadowRoot)||void 0===t?void 0:t.querySelector("iframe"))||null,null===(o=null===(s=this.iframe)||void 0===s?void 0:s.contentWindow)||void 0===o||o.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),s(o,{key:"4362f714c77107361d6a12b37611d443b3913360",class:"zonos--elements zonos--collapse",style:{"--zonos--font-family":i(),height:this.getElementHeight()}},s("div",{key:"0d66a5810e4d4e5485680eb07dd4201001ddeeb3"},s("iframe",{key:"8ca06be959cfbb3d791bc93b9db9e6abc820466f",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),s("slot",{key:"cd8be075228fdd276b7d2f12929e49847d7a8b2d"})))}get el(){return e(this)}};h.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";export{h as zonos_collapse}
@@ -0,0 +1 @@
1
+ import{r as o,h as s,H as n,d as a,c as t}from"./p-5b7da777.js";import{d as e}from"./p-91cfbf46.js";import{c as i}from"./p-b4b7f705.js";import{g as p}from"./p-67a32cc5.js";import{j as c}from"./p-2402e12c.js";import{a as m,l as r}from"./p-7769b60c.js";import{d as y}from"./p-00ff4f4a.js";import"./p-e1ce04b1.js";const l=class{constructor(s){o(this,s),this.notificationArray=[]}async showNotification(o){const s=`id-${Math.random().toString(36).substring(2,9)}`,n=Object.assign(Object.assign({},o),{id:s,timeout:o.timeout||5e3,transitionClass:"",type:o.type||"success"});this.notificationArray=[...this.notificationArray,n],setTimeout((()=>{this.updateTransitionClass({id:s,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(s)}),n.timeout)}updateTransitionClass({id:o,transitionClass:s}){this.notificationArray=this.notificationArray.map((n=>n.id===o?Object.assign(Object.assign({},n),{transitionClass:s}):n))}removeNotification(o){this.updateTransitionClass({id:o,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((s=>s.id!==o))}),300)}render(){return s(n,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:i(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":p(),"--zonos--font-family":e()}},s("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((o=>s("div",{"aria-hidden":"true",class:i(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:()=>{this.removeNotification(o.id)}},s("zonos-text",{textColor:"gray-0"},o.message))))))}};l.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-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)}";const h=class{constructor(s){o(this,s),this.titleText=void 0,this.stripe=c.stripe,this.stripeElements=c.stripeElements}watchInitStripe(){if(!this.stripeElements)return;const o=c.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"}),s=this.el.querySelector(".zonos--payment-component");s?(o.mount(s),o.on("change",(o=>{c.stripePaymentEventData=o})),c.stripePaymentElement=o):m("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return s(n,{key:"cf616ec959fd1b7396ed86b23561f459e0da8722",class:"zonos--payment zonos--elements"},this.titleText&&s("zonos-text",{key:"e5564db71ba2c0d67d372cb1804d6d462cdf1b33",class:"zonos--title",type:"semiBoldLabel"},this.titleText),s("div",{key:"3ea47f2c0a541590210d181bc73ecb3fb27e7783",class:"zonos--payment-component"}),s("div",{key:"d3a46a127448568caf4309806e88556594075c12",class:"zonos--payment-paypal-container"}))}get el(){return a(this)}static get watchers(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};h.style=".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}";const z=class{constructor(s){o(this,s),this.paypalSessionDone=t(this,"paypalSessionDone",7),this.paypalSessionFail=t(this,"paypalSessionFail",7)}async loadPaypal(){if(!window.Zonos.paypal)return void r("Paypal is not available");const o=y({onPaypalFail:()=>{r("onPaypalFail"),this.paypalSessionFail.emit()},onPaypalSessionDone:({orderId:o})=>{r("onPaypalSessionDone","info",{orderId:o}),this.paypalSessionDone.emit({orderId:o})}});if(!(null==o?void 0:o.length))return void r("There are no paypal buttons available");const s=this.el.querySelector(".zonos--payment-paypal-container");s?o.forEach((async o=>{await o.render(s)})):r("Cannot find container element for paypal buttons")}componentDidLoad(){this.loadPaypal()}render(){return s(n,{key:"a09fe5b66b1ac971c10529ecb6213479f2870f08",class:"zonos--paypal-payment zonos--elements"},s("div",{key:"6ba337785b8a90965e0cba05fd62681bc92633fe",class:"zonos--payment-paypal-container"}))}get el(){return a(this)}};z.style=".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}";export{l as zonos_notification,h as zonos_payment,z as zonos_paypal_payment}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(o,e,s,t){function n(o){return o instanceof s?o:new s((function(e){e(o)}))}return new(s||(s=Promise))((function(s,i){function a(o){try{d(t.next(o))}catch(o){i(o)}}function r(o){try{d(t["throw"](o))}catch(o){i(o)}}function d(o){o.done?s(o.value):n(o.value).then(a,r)}d((t=t.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(e){return d([o,e])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;n=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=e.call(o,s)}catch(o){r=[6,o];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-f7d56ce5.system.js","./p-aed0098c.system.js","./p-0fa85ff9.system.js","./p-2670438c.system.js","./p-00dc1507.system.js","./p-23e7c655.system.js","./p-2770ba48.system.js","./p-c85b4e43.system.js","./p-c3e98be6.system.js"],(function(o){"use strict";var e,s,t,n,i,a,r,d,l,c,h,f,u,b,p,m,z,v,y,g;return{setters:[function(o){e=o.r;s=o.c;t=o.h;n=o.H;i=o.d},function(o){a=o.j;r=o.S;d=o.l;l=o.p},function(o){c=o.i},function(o){h=o.a;f=o.l},function(o){u=o.i;b=o.c},function(o){p=o.z;m=o.d},function(o){z=o.c},function(o){v=o.R},function(o){y=o.g},function(o){g=o.i}],execute:function(){var x=".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-banner.sc-zonos-address{margin-top:8px}";var k=x;var w=o("zonos_address",function(){function o(o){e(this,o);this.invalidCharacters=s(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}o.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}}return{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}};o.prototype.updateAddressEventData=function(o){var e=o.event,s=o.type;switch(s){case"billing":a.stripeBillingAddressEventData=e;break;default:a.stripeAddressEventData=e;break}};o.prototype.updateAddressElement=function(o){var e=o.stripeAddressElement,s=o.type;if(s==="shipping"){a.stripeAddressElement=e;return}a.stripeBillingAddressElement=e};o.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,s,t,n,i,a,l,u,b,p;var m=this;return __generator(this,(function(z){this.stripe=window.Zonos.stripe;s=this.getStripeAddressInstance(),t=s.stripeAddressEventData,n=s.stripeElements;if(!this.stripe||!n){h("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(o=this.defaultAddress)===null||o===void 0?void 0:o.phone;if(!i){(e=this.defaultAddress)===null||e===void 0?true:delete e.phone}a=d.shippingZoneCountries;l=a?Object.values(a).map((function(o){return o.code})):[];u=this.type==="shipping"?l:[];b=(t===null||t===void 0?void 0:t.value.address.country)||r(u);f("Stripe country code: ".concat(b),"info");p=n.create("address",{allowedCountries:u,contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:b}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});p.mount(this.el.querySelector(".zonos--address-component"));p.on("change",(function(o){var e=o.value;if(!m.isDirtyAddress&&e.address.line1.length>=3){m.isDirtyAddress=true;setTimeout((function(){if(c()){m.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var o=m.type==="shipping"?100:600;var e=m.el.closest(".zonos--group");var s=m.el.getBoundingClientRect().top+o;e===null||e===void 0?void 0:e.scrollTo({behavior:"smooth",top:s})}}),600)}m.updateAddressEventData({event:Object.assign(Object.assign({},o),{elementMode:m.type,elementType:"address",value:Object.assign(Object.assign({},e),{firstName:e.firstName||e.name.split(" ")[0],lastName:e.lastName||e.name.split(" ")[1]})}),type:m.type})}));this.updateAddressElement({stripeAddressElement:p,type:this.type});return[2]}))}))};o.prototype.disconnectedCallback=function(){var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.destroy()};o.prototype.componentDidLoad=function(){var o=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!o&&o.value.address.line1.length>0;void this.watchInitStripe()};o.prototype.render=function(){return t(n,{key:"50871d11c001d37882b61476acdc227fcf3e2abd",class:"zonos--address zonos--elements"},t("zonos-text",{key:"90ffd3b0cc76446c88f3afe864a9bc9ecabb3997",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"98c2bd4c328bc3df138ae61f767b70b18524e877",class:"zonos--address-component"}))};Object.defineProperty(o.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}());w.style=k;var j=':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--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var C=j;var I=o("zonos_address_display",function(){function o(o){e(this,o);this.currentAddress=undefined;this.addressType=undefined}o.prototype.render=function(){var o;var e=this.currentAddress,s=e.city,i=e.country,a=e.email,r=e.line1,c=e.line2,h=e.name,f=e.phone,b=e.postal_code,p=e.state;var m=(o=d.shippingZoneCountries)===null||o===void 0?void 0:o[i];var z=function(o){var e=o.bold,s=o.content;var n=u(s)?"red-600":"gray-1000";return t("zonos-text",{textColor:n,type:e?"boldLabel":"body"},s)};return t(n,{class:"zonos--address-form zonos--elements"},t("div",{class:"zonos--title"},t("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?l("Shipping"):l("Billing"))),t("div",{class:"zonos--address-group"},h&&t("div",{class:"zonos--address-line"},z({bold:true,content:h})),a&&t("div",{class:"zonos--address-line"},z({content:a})),f&&t("div",{class:"zonos--address-line"},z({content:f})),r&&t("div",{class:"zonos--address-line"},z({content:r})),c&&t("div",{class:"zonos--address-line"},z({content:c})),t("div",{class:"zonos--address-line"},s&&z({content:s}),p&&z({content:p}),b&&z({content:b})),m&&t("div",{class:"zonos--address-line"},t("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",z({content:m.displayName}))))};return o}());I.style=C;var A=":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--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var _=A;var O=o("zonos_address_form",function(){function o(o){var t=this;e(this,o);this.addressChange=s(this,"addressChange",7);this.onInputChange=function(o){var e;var s=o.key,n=o.value;t.addressChange.emit(Object.assign(Object.assign({},t.localAddress),(e={},e[s]=n,e)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}o.prototype.watchCurrentAddress=function(){var o,e,s,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((o=this.translatedAddress.city)===null||o===void 0?void 0:o[r])||r,line1:((e=this.translatedAddress.line1)===null||e===void 0?void 0:e[d])||d,line2:((s=this.translatedAddress.line2)===null||s===void 0?void 0:s[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};o.prototype.componentWillLoad=function(){this.watchCurrentAddress()};o.prototype.render=function(){var o=this;var e=this.localAddress,s=e.city,i=e.country,a=e.line1,r=e.line2,d=e.name,c=e.phone,h=e.postal_code,f=e.state;var b=d.split(" ")[0]||"";var p=d.split(" ").slice(1).join(" ")||"";return t(n,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},t("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},t("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?l("Shipping"):l("Billing"))),t("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},t("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},t("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},l("Contact")),t("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:l("Email"),inputValue:this.currentAddress.email,isDisabled:true}),t("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},t("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:l("First name"),inputValue:b,isError:u(b),onInputChange:function(e){return o.onInputChange({key:"name",value:"".concat(e.detail," ").concat(p)})}}),t("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:l("Last name"),inputValue:p,isError:u(p),onInputChange:function(e){return o.onInputChange({key:"name",value:"".concat(b," ").concat(e.detail)})}}))),t("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},t("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},l("Address")),t("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:l("Country"),inputValue:i,isDisabled:true}),t("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:l("Address line 1"),inputValue:a,isError:u(a),onInputChange:function(e){return o.onInputChange({key:"line1",value:e.detail})}}),t("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:l("Address line 2"),inputValue:r,isError:u(r),onInputChange:function(e){return o.onInputChange({key:"line2",value:e.detail})}}),t("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},t("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:l("City"),inputValue:s,isError:u(s),onInputChange:function(e){return o.onInputChange({key:"city",value:e.detail})}}),t("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:l("State/Province"),inputValue:f,isError:u(f),onInputChange:function(e){return o.onInputChange({key:"state",value:e.detail})}})),t("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:l("Postal code"),inputValue:h,isError:u(h),onInputChange:function(e){return o.onInputChange({key:"postal_code",value:e.detail})}}),t("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:l("Phone number"),inputValue:c,onInputChange:function(e){return o.onInputChange({key:"phone",value:e.detail})}}))))};Object.defineProperty(o,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return o}());O.style=_;var L=":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--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var E=L;var B=o("zonos_address_update_dialog",function(){function o(o){var t=this;e(this,o);this.closeUpdateDialog=s(this,"closeUpdateDialog",7);this.continueClicked=s(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){t.closeUpdateDialog.emit()};this.getTranslatedAddress=function(o){var e=o.currentAddress,s=o.translatedAddress;var t,n,i,a,r,d;var l=e.city,c=e.line1,h=e.line2,f=e.name,u=e.postal_code,b=e.state;return{city:((t=s.city)===null||t===void 0?void 0:t[l])||l,line1:((n=s.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=s.line2)===null||i===void 0?void 0:i[h])||h,name:((a=s.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=s.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=s.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,s,t,n,i,a,r,d,l,c,h,f;return __generator(this,(function(u){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=b(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&b(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];f=((e=c===null||c===void 0?void 0:c.shadowRoot)===null||e===void 0?void 0:e.querySelector(".has-error"))||((s=h===null||h===void 0?void 0:h.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"));if(f){f.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(o){var e,s,t,n,i,a;var r=o.currentAddress,d=o.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(e={},e[l]=d.city,e),line1:(s={},s[c]=d.line1,s),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}o.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};o.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};o.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};o.prototype.render=function(){var o=this;var e=this.submitBtnColor||p.appearance.colorSecondary;var s=e==="#ffffff"?"outline":this.submitBtnType||"standard";var i=this.billingAddress;var a=this.shippingAddress;return t(n,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:z(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},t("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},t("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},t("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},t("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},t("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},l("Update your address")),t("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:v}),noBackground:true,onClick:function(){return o.closeUpdateDialogHandler()}})),t("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},l("To ensure delivery all address details must be in Latin characters."))),t("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},t("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},l("What you entered")),t("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},t("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:a}),i&&t("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:i})),t("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},t("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},l("Translated address")),t("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:a,onAddressChange:function(e){var s=e.detail;o.translatedShippingAddressState=o.buildTranslateAddressState({currentAddress:a,translatedAddress:s})},translatedAddress:this.translatedShippingAddressState}),i&&t("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:i,onAddressChange:function(e){var s=e.detail;o.translatedBillingAddressState=o.buildTranslateAddressState({currentAddress:i,translatedAddress:s})},translatedAddress:this.translatedBillingAddressState}))),t("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},t("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},t("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return o.closeUpdateDialogHandler()},variant:"subtle"},l("Cancel")),t("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"sm",variant:s},l("Update address")))))))};Object.defineProperty(o.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return o}());B.style=E;var S=["blue","cyan","green","orange","purple","red","gray","glass"];var V=":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;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var T=V;var D=o("zonos_checkbox",function(){function o(o){e(this,o);this.checkboxSelected=s(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}o.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};o.prototype.render=function(){var o=this;var e=S.includes(this.backgroundColor);var s=e?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var i=e?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!g(s)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var a=y({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return t(n,{key:"a863e05a6e647b9ea8ef8902a4c618f6998894cd",class:z(["zonos--elements zonos--checkbox"]),style:{"--zonos--background-color":s,"--zonos--border-radius":a,"--zonos--font-family":m(),"--zonos--size":"".concat(this.size,"px")}},t("label",{key:"2b84b59d106661937c10e76ccb1c05f887c657ec",class:z([this.isDisabled&&"disabled"])},t("input",{key:"1dc2037bf17c37c8f762f2ac28509e3d607c9e61",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(e){o.checkboxSelected.emit(e.target.checked)},type:"checkbox"}),t("span",{key:"75175e238cbe841c11f43392797a2126d1cd65a8",class:"checkmark-container"},t("svg",{key:"5e853c2248dd1777f0b4029a1b7beeb0fb8a0e1c",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"367494224e826b903acb560cbb93f532502aa4d2","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&t("zonos-text",{key:"573cfdccbd768246996bff4eaed8064b67e90009",size:this.fontSize},this.label)))};return o}());D.style=T;var P='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var M=":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--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{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;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-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);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));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 .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var N=M;var U=o("zonos_dialog",function(){function o(o){var t=this;e(this,o);this.closeDialog=s(this,"closeDialog",3);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!t.open){return}t.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeButtonHandler()}};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var o=y({overrideBorderStyle:this.borderStyle});return t(n,{key:"ba7a8197ab543be448706f9e9691b57738d0caae",class:z(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":m(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},t("div",{key:"b930321b762118180765fa981ec36331fcf582e3",class:"zonos--backdrop"}),t("div",{key:"9e2c43b255342bf5ba2cce5a3ebd3690a855dea4",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},t("div",{key:"ba38ab19c3af855c46cd50cf1c9aac5279158432",class:"zonos--dialog"},this.isLoading&&t("div",{key:"a3ee6a94bb75c349b4f724295d514d3fd2c212dd",class:"zonos--loading"},t("zonos-spinner",{key:"91f094db949bbf1698bebc871f1ae5455f647ead",size:30})),(this.headerText||!this.noCloseButton)&&t("div",{key:"4804b7611ecf1eefb24126c408952941ab535ba4",class:"zonos--header"},this.headerText&&t("h3",{key:"9e8c592e93d3c144553321f59176a2ba7b29ef95",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{key:"35d49072fdeadf26797f9ef82d63b8448100f833",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close dialog",content:P}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),t("div",{key:"f74d2afc8f0296a7ef81e8a3b530fd60d92f3274",class:z(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",{key:"78138acb4bc703c5248687468621e87262b7cc90"})),t("slot",{key:"a98f325d222c53ba779075871fcf6aad5542d743",name:"dialog-footer"}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());U.style=N;var Z=".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 H=Z;var R=o("zonos_link_authentication",function(){function o(o){e(this,o);this.linkAuthenticationChange=s(this,"linkAuthenticationChange",7);this.titleText=undefined;this.defaultEmail=null;this.isEmailError=false;this.stripe=a.stripe}o.prototype.watchInitStripe=function(){var o=this;if(!this.stripe||!a.stripeElements){return}var e=this.defaultEmail?{email:this.defaultEmail}:undefined;var s=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:e||undefined});var t=this.el.querySelector(".zonos--link-authentication-component");if(!t){h("Cannot find container element for linkAuthenticationElement");return}s.mount(t);s.on("change",(function(e){var s;a.stripeLinkEventData=e;(s=o.linkAuthenticationChange)===null||s===void 0?void 0:s.emit()}));a.stripeLinkElement=s};o.prototype.componentDidLoad=function(){this.watchInitStripe()};o.prototype.render=function(){return t(n,{key:"7950960b06faca8192a2132d8543013a99a0e5ba",class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":y()}},t("zonos-text",{key:"1f8f7f96e39f0d0c0b4012846b27fef994aa9db1",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"4b6b2471fe7254cea24b628284451bd46146f001",class:"zonos--link-authentication-component ".concat(this.isEmailError&&"zonos--input-invalid")}),this.isEmailError&&t("zonos-text",{key:"3d55092ae5c569641c0ae915e63abe005f362207",textColor:"red-600"},l("Please enter a valid email address.")))};Object.defineProperty(o.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return o}());R.style=H}}}));
@@ -0,0 +1 @@
1
+ import{r as o,c as s,h as t,H as e}from"./p-5b7da777.js";import{d as n}from"./p-91cfbf46.js";import{c as a}from"./p-b4b7f705.js";const r=class{constructor(t){o(this,t),this.toggleChanged=s(this,"toggleChanged",7),this.options=[],this.value=void 0}render(){return t(e,{key:"c49d16b02ca854ead2b2652cc1e39a423fd67251",class:a(["zonos--elements zonos--toggle"]),style:{"--zonos--font-family":n()}},t("div",{key:"cda75445836db4a4d8466e840eac952a18b3ad48",class:"wrapper"},this.options.map((o=>t("button",{class:a(["zonos--option",o.value===this.value&&"selected"]),key:o.value,onClick:()=>{this.toggleChanged.emit(o.value)}},o.label)))))}};r.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";export{r as zonos_toggle}