@zonos/elements 1.3.273 → 1.3.275

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 (271) hide show
  1. package/dist/cjs/{cart-660e115c.js → cart-73d7ecdc.js} +4 -4
  2. package/dist/cjs/{cleanHtmlMarkdown-31da84b7.js → cleanHtmlMarkdown-57147de7.js} +180 -356
  3. package/dist/cjs/{collect-286a9d04.js → collect-32ea7a37.js} +3 -3
  4. package/dist/cjs/{debounce-7990f5ea.js → debounce-9a712c79.js} +1 -1
  5. package/dist/cjs/{getBorderRadius-fc683d94.js → getBorderRadius-4da24d7c.js} +1 -1
  6. package/dist/cjs/{getContrastColor-d5134ef3.js → getContrastColor-2fb235b8.js} +2 -2
  7. package/dist/cjs/{hasInclusivePrice-b35e81aa.js → hasInclusivePrice-38ebedfb.js} +1 -1
  8. package/dist/cjs/index.cjs.js +7 -7
  9. package/dist/cjs/{invoice-f032089f.js → invoice-df662cd1.js} +3 -3
  10. package/dist/cjs/{isContrastColor-76592c92.js → isContrastColor-ef24b7aa.js} +1 -1
  11. package/dist/cjs/{isDarkColor-5d6ca405.js → isDarkColor-ebc74b4d.js} +1 -1
  12. package/dist/cjs/{localization-f4a64f6f.js → localization-09e91031.js} +1 -1
  13. package/dist/cjs/{paypal-125259ab.js → paypal-11acb15f.js} +5 -5
  14. package/dist/cjs/{placeTestOrder-02001a99.js → placeTestOrder-e0f80338.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-cad156a7.js → renderCheckoutCurrency-d902f973.js} +2 -2
  16. package/dist/cjs/{submitGtag-4906b161.js → submitGtag-74762255.js} +1 -1
  17. package/dist/cjs/{throttle-02c2e917.js → throttle-34f7abf1.js} +2 -2
  18. package/dist/cjs/{updateCheckoutSessionAttributes-47d73942.js → updateCheckoutSessionAttributes-f595319d.js} +1 -1
  19. package/dist/cjs/zonos-address-display_8.cjs.entry.js +444 -202
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
  21. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +6 -6
  22. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  25. package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
  26. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +15 -15
  27. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
  28. package/dist/cjs/zonos-checkout.cjs.entry.js +10 -10
  29. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -6
  31. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
  32. package/dist/cjs/zonos-collect.cjs.entry.js +9 -9
  33. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  34. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1514 -1692
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +3 -3
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +7 -7
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +9 -9
  42. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  43. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  44. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +6 -6
  45. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +5 -5
  46. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  49. package/dist/esm/{cart-23e29950.js → cart-c3cd0036.js} +4 -4
  50. package/dist/esm/{cleanHtmlMarkdown-5f7856f2.js → cleanHtmlMarkdown-87d195f6.js} +180 -356
  51. package/dist/esm/{collect-a235299d.js → collect-a7a4696c.js} +3 -3
  52. package/dist/esm/{debounce-58e4ff3e.js → debounce-c8d67b17.js} +1 -1
  53. package/dist/esm/{getBorderRadius-d23f47a6.js → getBorderRadius-dc982fe6.js} +1 -1
  54. package/dist/esm/{getContrastColor-f0bd5b65.js → getContrastColor-af895b60.js} +2 -2
  55. package/dist/esm/{hasInclusivePrice-5e106f84.js → hasInclusivePrice-93a88196.js} +1 -1
  56. package/dist/esm/index.js +7 -7
  57. package/dist/esm/{invoice-78f069c7.js → invoice-5a07bb03.js} +3 -3
  58. package/dist/esm/{isContrastColor-fbddacb6.js → isContrastColor-089de6ac.js} +1 -1
  59. package/dist/esm/{isDarkColor-566f04c5.js → isDarkColor-039ef212.js} +1 -1
  60. package/dist/esm/{localization-17546792.js → localization-a185c345.js} +1 -1
  61. package/dist/esm/{paypal-5bc6b0d0.js → paypal-cc558697.js} +5 -5
  62. package/dist/esm/{placeTestOrder-e842854a.js → placeTestOrder-92847316.js} +2 -2
  63. package/dist/esm/{renderCheckoutCurrency-e3953f67.js → renderCheckoutCurrency-34aaa81e.js} +2 -2
  64. package/dist/esm/{submitGtag-c7ea1f2a.js → submitGtag-dc54f5b9.js} +1 -1
  65. package/dist/esm/{throttle-f09d0659.js → throttle-44bfb6b5.js} +2 -2
  66. package/dist/esm/{updateCheckoutSessionAttributes-40e301a4.js → updateCheckoutSessionAttributes-e0a282d9.js} +1 -1
  67. package/dist/esm/zonos-address-display_8.entry.js +444 -202
  68. package/dist/esm/zonos-address_4.entry.js +7 -7
  69. package/dist/esm/zonos-airwallex-payment.entry.js +6 -6
  70. package/dist/esm/zonos-badge.entry.js +1 -1
  71. package/dist/esm/zonos-banner.entry.js +1 -1
  72. package/dist/esm/zonos-button_3.entry.js +3 -3
  73. package/dist/esm/zonos-card_5.entry.js +8 -8
  74. package/dist/esm/zonos-cart-items_12.entry.js +15 -15
  75. package/dist/esm/zonos-checkbox_2.entry.js +3 -3
  76. package/dist/esm/zonos-checkout.entry.js +10 -10
  77. package/dist/esm/zonos-collapse.entry.js +1 -1
  78. package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -6
  79. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  80. package/dist/esm/zonos-collect.entry.js +9 -9
  81. package/dist/esm/zonos-controller.entry.js +6 -6
  82. package/dist/esm/zonos-country-flag.entry.js +2 -2
  83. package/dist/esm/zonos-country-select_4.entry.js +1514 -1692
  84. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  85. package/dist/esm/zonos-hello.entry.js +3 -3
  86. package/dist/esm/zonos-input.entry.js +2 -2
  87. package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
  88. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  89. package/dist/esm/zonos-invoice.entry.js +9 -9
  90. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  91. package/dist/esm/zonos-logo.entry.js +1 -1
  92. package/dist/esm/zonos-policy-consent_2.entry.js +6 -6
  93. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  94. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  95. package/dist/esm/zonos-text.entry.js +1 -1
  96. package/dist/esm/zonos-v-stack.entry.js +1 -1
  97. package/dist/esm-es5/{cart-23e29950.js → cart-c3cd0036.js} +1 -1
  98. package/dist/esm-es5/cleanHtmlMarkdown-87d195f6.js +1 -0
  99. package/dist/esm-es5/{collect-a235299d.js → collect-a7a4696c.js} +1 -1
  100. package/dist/esm-es5/{debounce-58e4ff3e.js → debounce-c8d67b17.js} +1 -1
  101. package/dist/esm-es5/{getBorderRadius-d23f47a6.js → getBorderRadius-dc982fe6.js} +1 -1
  102. package/dist/esm-es5/{getContrastColor-f0bd5b65.js → getContrastColor-af895b60.js} +1 -1
  103. package/dist/esm-es5/{hasInclusivePrice-5e106f84.js → hasInclusivePrice-93a88196.js} +1 -1
  104. package/dist/esm-es5/index.js +1 -1
  105. package/dist/esm-es5/{invoice-78f069c7.js → invoice-5a07bb03.js} +1 -1
  106. package/dist/esm-es5/{isContrastColor-fbddacb6.js → isContrastColor-089de6ac.js} +1 -1
  107. package/dist/esm-es5/{isDarkColor-566f04c5.js → isDarkColor-039ef212.js} +1 -1
  108. package/dist/esm-es5/{localization-17546792.js → localization-a185c345.js} +1 -1
  109. package/dist/esm-es5/{paypal-5bc6b0d0.js → paypal-cc558697.js} +1 -1
  110. package/dist/esm-es5/{placeTestOrder-e842854a.js → placeTestOrder-92847316.js} +1 -1
  111. package/dist/esm-es5/{renderCheckoutCurrency-e3953f67.js → renderCheckoutCurrency-34aaa81e.js} +1 -1
  112. package/dist/esm-es5/{submitGtag-c7ea1f2a.js → submitGtag-dc54f5b9.js} +1 -1
  113. package/dist/esm-es5/throttle-44bfb6b5.js +1 -0
  114. package/dist/esm-es5/{updateCheckoutSessionAttributes-40e301a4.js → updateCheckoutSessionAttributes-e0a282d9.js} +1 -1
  115. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  116. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  117. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  118. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  119. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  120. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  121. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  122. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  123. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  124. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  125. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  126. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  127. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  128. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  129. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  130. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  131. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  132. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  133. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  134. package/dist/esm-es5/zonos-input.entry.js +1 -1
  135. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  136. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  137. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  138. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  139. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  140. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  141. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  142. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  143. package/dist/esm-es5/zonos-text.entry.js +1 -1
  144. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  145. package/dist/generated/countryFieldLabels.json +1 -0
  146. package/dist/scripts/analyticsRelayOnInit.js +1 -1
  147. package/dist/scripts/blurCurrencyOnInit.js +1 -1
  148. package/dist/scripts/index.js +1 -1
  149. package/dist/scripts/loadZonos.js +1 -1
  150. package/dist/scripts/zonos.js +1 -1
  151. package/dist/zonos-elements/index.esm.js +1 -1
  152. package/dist/zonos-elements/{p-d25759fb.system.js → p-03c357f5.system.js} +1 -1
  153. package/dist/zonos-elements/{p-41619f29.js → p-043e9a84.js} +1 -1
  154. package/dist/zonos-elements/{p-59b10526.entry.js → p-08e78d79.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-c846a5f3.system.entry.js → p-0ad6a92b.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-b59fc3fa.system.entry.js → p-0e1f13ff.system.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-306e5499.system.entry.js → p-12396d79.system.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-c6823974.system.entry.js → p-15097876.system.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-9f5fb332.js → p-1735a69b.js} +1 -1
  160. package/dist/zonos-elements/p-1906c8f7.js +1 -0
  161. package/dist/zonos-elements/{p-055ef910.entry.js → p-1992fd91.entry.js} +1 -1
  162. package/dist/zonos-elements/p-1de258c3.js +1 -0
  163. package/dist/zonos-elements/{p-abd485df.entry.js → p-216d31ca.entry.js} +1 -1
  164. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  165. package/dist/zonos-elements/{p-a1a05de4.system.entry.js → p-29c1703c.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-e9afd736.system.entry.js → p-2b2122bc.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-9574695a.system.js → p-2bdfa429.system.js} +1 -1
  168. package/dist/zonos-elements/{p-33910e8b.js → p-2c0a627d.js} +1 -1
  169. package/dist/zonos-elements/p-30e9a6d7.system.js +1 -0
  170. package/dist/zonos-elements/{p-33d4be28.js → p-34d6eb83.js} +1 -1
  171. package/dist/zonos-elements/p-35fd0fdb.js +1 -0
  172. package/dist/zonos-elements/p-387f33ae.js +1 -0
  173. package/dist/zonos-elements/p-38d2da0d.entry.js +1 -0
  174. package/dist/zonos-elements/{p-08b48608.entry.js → p-391ea5c2.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-1a4083be.system.js → p-3980e553.system.js} +1 -1
  176. package/dist/zonos-elements/p-3b479012.js +1 -0
  177. package/dist/zonos-elements/{p-896fb969.js → p-3d28353a.js} +1 -1
  178. package/dist/zonos-elements/{p-328fd90e.entry.js → p-3e058b4e.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-86a9f048.system.entry.js → p-3e914f69.system.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-62c68aee.system.js → p-3ea7643b.system.js} +1 -1
  181. package/dist/zonos-elements/{p-f53c8a9f.entry.js → p-3f8050ab.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-daf57db3.system.entry.js → p-3fa307d1.system.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-0a54dae6.system.entry.js → p-429ab545.system.entry.js} +1 -1
  184. package/dist/zonos-elements/p-4900096c.system.entry.js +1 -0
  185. package/dist/zonos-elements/{p-f053975e.system.js → p-496accce.system.js} +1 -1
  186. package/dist/zonos-elements/{p-12a05647.entry.js → p-4efd7178.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-9cd41234.system.entry.js → p-51b537a6.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-4b371b65.entry.js → p-5427bf51.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-ad961f5d.entry.js → p-577b543c.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-10571f94.system.entry.js → p-5aee5de5.system.entry.js} +1 -1
  191. package/dist/zonos-elements/p-5c30d04b.js +1 -0
  192. package/dist/zonos-elements/{p-8e77a3cd.system.entry.js → p-5ce8b3c3.system.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-dcef2202.entry.js → p-5d4201d5.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-80df7e0b.system.entry.js → p-6146bfaa.system.entry.js} +1 -1
  195. package/dist/zonos-elements/{p-e548b8ec.entry.js → p-62609f19.entry.js} +1 -1
  196. package/dist/zonos-elements/{p-97917371.system.entry.js → p-70fd21c4.system.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-013575f2.entry.js → p-785d6f43.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-1f31f5a0.system.entry.js → p-79f58524.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-4df08fc4.js → p-7bdce9d4.js} +1 -1
  200. package/dist/zonos-elements/{p-e8cb382e.entry.js → p-819f182e.entry.js} +1 -1
  201. package/dist/zonos-elements/{p-14018649.system.js → p-863cfab2.system.js} +2 -2
  202. package/dist/zonos-elements/{p-4a960329.system.entry.js → p-8873d332.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-c83bc4b3.entry.js → p-8c54aaec.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-49d8a10f.entry.js → p-9295b932.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-f0eb6317.system.entry.js → p-93c6c2df.system.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-d5e66ea6.entry.js → p-96972001.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-3eba657b.system.entry.js → p-99e8743e.system.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-42948a52.js → p-9cb80484.js} +1 -1
  209. package/dist/zonos-elements/{p-31577ebd.entry.js → p-9d80357b.entry.js} +1 -1
  210. package/dist/zonos-elements/p-a1bd3a53.system.js +1 -0
  211. package/dist/zonos-elements/p-a1f59d6d.system.entry.js +1 -0
  212. package/dist/zonos-elements/{p-6c19310e.system.entry.js → p-a2353242.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-e8ec88a9.system.entry.js → p-a33e1549.system.entry.js} +1 -1
  214. package/dist/zonos-elements/p-a3c116d6.system.js +1 -0
  215. package/dist/zonos-elements/{p-5aa35d1c.system.entry.js → p-a3d3ce5d.system.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-27e50593.system.entry.js → p-a44591f6.system.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-2197d6ab.js → p-a7028453.js} +1 -1
  218. package/dist/zonos-elements/p-a9d01bfa.entry.js +1 -0
  219. package/dist/zonos-elements/{p-ccd14aa5.entry.js → p-ac762358.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-0b59076d.system.entry.js → p-b376aba7.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-cc508de8.entry.js → p-b5f67807.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-8c4761d1.system.entry.js → p-b9034a75.system.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-9b003a15.system.entry.js → p-b9359002.system.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-91b921a4.system.js → p-be233925.system.js} +1 -1
  225. package/dist/zonos-elements/{p-919c5500.entry.js → p-c68a7f3e.entry.js} +1 -1
  226. package/dist/zonos-elements/p-cc6ad18a.js +1 -0
  227. package/dist/zonos-elements/{p-c1463da7.entry.js → p-d1e84608.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-bf8c98ab.system.js → p-d1f2e532.system.js} +1 -1
  229. package/dist/zonos-elements/{p-171d0f9f.system.js → p-d62dab88.system.js} +1 -1
  230. package/dist/zonos-elements/{p-2a1247f4.system.entry.js → p-d6d18115.system.entry.js} +1 -1
  231. package/dist/zonos-elements/{p-5d65be06.system.js → p-d706852e.system.js} +1 -1
  232. package/dist/zonos-elements/{p-df55536b.entry.js → p-daab3824.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-7d9d2407.system.js → p-dab78981.system.js} +1 -1
  234. package/dist/zonos-elements/{p-990d1495.system.entry.js → p-db65c60b.system.entry.js} +1 -1
  235. package/dist/zonos-elements/{p-e9c8a235.js → p-e3376f43.js} +1 -1
  236. package/dist/zonos-elements/{p-fcaec700.system.js → p-e562d953.system.js} +1 -1
  237. package/dist/zonos-elements/{p-c13d2e3f.entry.js → p-e5f25b27.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-bc919de1.system.js → p-e977562b.system.js} +1 -1
  239. package/dist/zonos-elements/{p-1678d8b4.system.entry.js → p-e9e3c951.system.entry.js} +1 -1
  240. package/dist/zonos-elements/{p-46e72a90.entry.js → p-ee70bd2e.entry.js} +1 -1
  241. package/dist/zonos-elements/{p-a968ccba.entry.js → p-ee920b9b.entry.js} +1 -1
  242. package/dist/zonos-elements/{p-3dc3596b.js → p-f1aea919.js} +1 -1
  243. package/dist/zonos-elements/p-f29bcf8b.system.js +1 -0
  244. package/dist/zonos-elements/{p-f72642de.entry.js → p-f59514e9.entry.js} +1 -1
  245. package/dist/zonos-elements/{p-52bd7be3.system.js → p-f61c0eef.system.js} +1 -1
  246. package/dist/zonos-elements/{p-9c3276c8.entry.js → p-f97da77c.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-df6fbf3f.entry.js → p-fb830355.entry.js} +1 -1
  248. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  249. package/package.json +14 -36
  250. package/dist/esm-es5/cleanHtmlMarkdown-5f7856f2.js +0 -1
  251. package/dist/esm-es5/throttle-f09d0659.js +0 -1
  252. package/dist/zonos-elements/p-14d6542f.system.js +0 -1
  253. package/dist/zonos-elements/p-18af6aaa.system.js +0 -1
  254. package/dist/zonos-elements/p-1a105d6e.system.entry.js +0 -1
  255. package/dist/zonos-elements/p-3b28fc76.js +0 -1
  256. package/dist/zonos-elements/p-539bc46c.js +0 -1
  257. package/dist/zonos-elements/p-5dd86dd9.system.js +0 -1
  258. package/dist/zonos-elements/p-7eb47eb0.entry.js +0 -1
  259. package/dist/zonos-elements/p-8af57c2a.js +0 -1
  260. package/dist/zonos-elements/p-90d22087.system.js +0 -1
  261. package/dist/zonos-elements/p-9581bffb.js +0 -1
  262. package/dist/zonos-elements/p-ac8cfdc0.js +0 -1
  263. package/dist/zonos-elements/p-b5c01288.system.entry.js +0 -1
  264. package/dist/zonos-elements/p-cd34ecf2.js +0 -1
  265. package/dist/zonos-elements/p-e643346a.entry.js +0 -1
  266. package/dist/zonos-elements/p-f1cc659c.js +0 -1
  267. /package/dist/cjs/{zonosStore-45a87908.js → zonosStore-fee716c9.js} +0 -0
  268. /package/dist/esm/{zonosStore-8e19daff.js → zonosStore-b7d3f9b0.js} +0 -0
  269. /package/dist/esm-es5/{zonosStore-8e19daff.js → zonosStore-b7d3f9b0.js} +0 -0
  270. /package/dist/zonos-elements/{p-3e7ee89d.system.js → p-47a1d469.system.js} +0 -0
  271. /package/dist/zonos-elements/{p-701d9a7c.js → p-9a417eeb.js} +0 -0
@@ -1 +1 @@
1
- import{r as o,h as e,F as t,a as s}from"./p-ce75b047.js";import{s as n,a as i,b as c,i as r,c as a,d,e as l,f as u,p as h,g as m,h as p,j as g,k as f,l as w,t as z,m as k,n as v,o as y,q as C,r as b,u as S,v as x,w as I,x as T,y as A,z as O,A as _,B as L,C as P,D as U,E as B,F as E,G as D,H as N,I as j}from"./p-33910e8b.js";import{p as R,s as $,a as F,b as M}from"./p-42948a52.js";import{f as H,a as K,b as Z,i as V,l as G,c as W,g as Q,s as Y,V as q,d as J,t as X,e as oo,h as eo}from"./p-41619f29.js";import{z as to,g as so,m as no}from"./p-701d9a7c.js";import{b as io}from"./p-83666056.js";import{h as co,g as ro,j as ao,l as lo,b as uo,s as ho,a as mo,i as po}from"./p-41dd1cb8.js";import{u as go}from"./p-9f5fb332.js";import{l as fo,g as wo,b as zo}from"./p-0a377722.js";import{_ as ko,c as vo,a as yo,d as Co,g as bo}from"./p-b2d81c98.js";import{c as So}from"./p-b4b7f705.js";import{c as xo}from"./p-595f5dd2.js";import{g as Io}from"./p-3dc3596b.js";import{i as To}from"./p-33d4be28.js";import{s as Ao}from"./p-96d77739.js";import{R as Oo}from"./p-08e7107d.js";import"./p-cd34ecf2.js";import"./p-896fb969.js";import"./p-4df08fc4.js";const _o="isInternationalCheckout",Lo=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),ro()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(_o,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),ro()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Po=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),ro()&&e.searchParams.set("zonosTestMode","1"),e.toString()},Uo={customerGroupId:null,shouldBypass:!1};let Bo=null;const Eo=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Uo};const i=null===(e=to.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return to.loadedConfig?{conclusive:!0,result:Uo}:{conclusive:!1,result:Uo};const c=o?o.checkoutId:await K();if(!c)return fo("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Uo};const r=o?o.checkout:await Z(c);if(!r)return fo("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Uo};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return fo("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Uo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return fo(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||Bo!==t||(Bo=null),e)));return Bo=t,t},Do=async(o={})=>o.forceRefresh||!Bo?Eo(o.preFetched):Bo,No={guestCheckoutType:null},jo="zonos--bc-checkout-settings",Ro={redirectUrl:null,shouldForceLogin:!1};let $o=null;const Fo=()=>{if(!$o){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return No;const e=null===(o=to.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return fo("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),No;const t=(o=>{try{const e=window.localStorage.getItem(jo);if(!e)return null;const t=ao(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await co("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return fo("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),No;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(jo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:($o===o&&($o=null),!1))).catch((()=>($o===o&&($o=null),!1)));$o=o}return $o},Mo=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Ro;if(!await Fo())return Ro;const e=o?o.checkoutId:await K();if(!e)return Ro;const t=o?o.checkout:await Z(e);return t?V(t)?Ro:(fo("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:Lo(),shouldForceLogin:!0}):(fo("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Ro)},Ho="data-zonos-login-from-rewritten",Ko='a[href*="login.php?action=create_account"]:not(['+Ho+"])",Zo=()=>{const o=document.querySelectorAll(Ko);if(!o.length)return;const e=Lo({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Ho,"true")}))},Vo=(o,e)=>{if(!o.address1||!o.countryCode)return null;const t=[o.firstName,o.lastName].filter(Boolean).join(" ").trim();return{address:{city:o.city||"",country:o.countryCode,line1:o.address1,line2:o.address2||"",postal_code:o.postalCode||"",state:o.stateOrProvinceCode||o.stateOrProvince||""},email:e,name:t,phone:o.phone||""}},Go=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),Wo=(o=!0,e)=>{var t;if(!G.localizationLoaded)return!1;if(e){const s=!!(null===(t=G.shippingZoneCountries)||void 0===t?void 0:t[e])&&!to.disabledCountries.includes(e);return o&&!s&&fo(`Checkout: ${e} is not a shippable country: ${s}`),s}return!!G.isShippableCountry||(o&&fo("Checkout: not shippable country"),!1)},Qo='select[name="shippingAddress.countryCode"]';let Yo=0;const qo=o=>{var e;const t=null===(e=Y.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},Jo=async({cartId:o,retries:e})=>{const t=ro(),{errors:s,json:n}=await co("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(fo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),Jo({cartId:o,retries:e-1})):i?null:n},Xo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',oe=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||to.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:R()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${vo}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return fo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(fo("Payment intent exist, checking stripe payment intent status"),!n)return fo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(fo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,Y.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(fo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(fo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.initializeTestKeys=()=>{var o;Y.enabledVariantTestKeys=(null==(o=Y.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=to.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=Y.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+q,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return J(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof to.checkoutSettings.createCartId&&!!to.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;fo("[TEST] - Registering hosted vs native test");const o=qo("hosted_vs_native");if(o)return void fo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await co("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:H(t)})({testKeys:["hosted_vs_native"]});if(!e)return void fo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+q,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:Y.enabledVariantTestKeys||[],mergeTestObj:e});J(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=qo("hosted_vs_native");if(fo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof to.checkoutSettings.createCartId)return fo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return fo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=to.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return fo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};fo('"createCartId" is provided, start building cart');const t=await to.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);fo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=Q(o)||G.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:Y.checkoutSessionId||void 0,hostedCheckoutUrl:to.genericSettings.hostedCheckoutUrl,isTestMode:ro(),isVariantTest:!0},i),n));return fo(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=d.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.prefillBigCommerceCustomerAddresses=async()=>{if(!window.Zonos.isBigCommerce)return;if(this.defaultCustomerProfileAddress.length)return;if(Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&"object"==typeof this.defaultAddress&&null!==this.defaultAddress)return;const o=await K();if(!o)return;const e=await Z(o);if(!V(e))return;const t=((o,e)=>{var t,s,n,i;if(!(null===(t=null==o?void 0:o.customer)||void 0===t?void 0:t.id))return[];const{isShippable:c,selectedCountryCode:r}=e,a=o.customer.email||"",d=null!==(n=null===(s=o.consignments)||void 0===s?void 0:s.flatMap((o=>o.shippingAddress?[o.shippingAddress]:[])))&&void 0!==n?n:[],l=null!==(i=o.customer.addresses)&&void 0!==i?i:[],u=new Set,h=[];for(const o of[...l,...d]){const e=Vo(o,a);if(!e)continue;if(!c(e.address.country))continue;const t=Go(e);u.has(t)||(u.add(t),h.push(e))}return r?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===r;return t===(e.option.address.country===r)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>Wo(!1,o),selectedCountryCode:G.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,fo(`Prefilled ${String(t.length)} BigCommerce customer address(es) for logged-in shopper`,"info")))},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=to.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(Y.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(Y.checkoutSessionId=e);const t=Y.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(qo("hosted_vs_native")?J(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+q,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),J(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,$({event:"zonos-checkout-close",metadata:{checkoutSessionId:Y.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||u(),this.preview||h(),d.step="customer-info",m(),p(),null===(t=(e=to.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if("function"==typeof to.checkoutSettings.createCartId){fo('"createCartId" is provided, start building cart'),d.customMessage=[];const o=await to.checkoutSettings.createCartId();let e;"object"==typeof o?(fo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),d.customerAuthenticationToken=o.customerAuthenticationToken||null,d.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((o=>"string"==typeof o)):[]):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=ko(o);if(!t&&!e)return lo("[ZONOS - loadZonos] invalid cart id"),null;const s=await Jo({cartId:o,retries:5});return fo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(lo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return lo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=io(s);await l({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){fo("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:e}=io(window.Zonos.cartData);await l({adjustments:o,cartItems:e})}else if(to.checkoutSettings.buildCartDetail&&G.selectedCountryCode){fo("build cart detail");const o=await to.checkoutSettings.buildCartDetail({countryCode:G.selectedCountryCode,currencyCode:G.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));fo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await l({adjustments:s,cartItems:e})}if(!Y.checkoutSessionId){const o=await g();if(fo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}d.isStagingMode||f(),await this.applyStripeTheme();const{successBehavior:o,successRedirectUrl:e}=to.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===o||"CLOSE_MODAL"===o&&!!e||!!d.externalConfirmationPageURL,!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=ao(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;fo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return fo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,fo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){Y.checkoutSessionId&&go({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:Y.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,Y.checkoutSessionId&&go({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:Y.checkoutSessionId})}markTheSessionAsAbandonedCart(){Y.checkoutSessionId&&go({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:Y.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||to.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=to.checkoutSettings.placeOrderButtonSelector,e=to.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${vo}`);if(fo(`attach checkout ${o}`),fo(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${Co}`,`#${vo}`,`#${yo}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(fo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${yo}`),l=t.matches(`#${Co}`)||t.matches(`#${vo}`);if(!window.Zonos.isLegacyCheckout&&(!Wo()||((o=!0)=>!G.localizationLoaded||!!G.isDisabledCountry&&(o&&fo("Checkout: disabled country"),!0))())&&!r&&!a&&!l)return;o.preventDefault(),o.stopPropagation(),fo("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;fo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await co("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),Yo++,Yo>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),to.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Do();if(o)return fo("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Po("/checkout"));const e=await Mo();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:Y.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),w({isPreview:this.preview,sessionTimeout:54e5}),$({event:"zonos-checkout-start",metadata:{checkoutSessionId:Y.checkoutSessionId}}),z({checkoutSessionId:Y.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await co("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(d.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=wo(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},uo()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};co("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},uo()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};co("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),bo()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,lo(o),this.isCartExpired)return void(c.isFetchingSession=!0);ho({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:zo,cartId:window.Zonos.cartId,checkoutSessionBody:k(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||to.onlineStoreSettings.url}}),v({messages:[X("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:X("Error creating Checkout")})}}}),{capture:!0,passive:!1}),to.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${Co}`)&&(t.dispatchEvent(xo("click")),y(),t.remove()),t.matches(`#${vo}`)&&(t.dispatchEvent(xo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;fo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||Q(h)||G.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);fo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=Q(o)||G.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&G.shippingZoneCountries&&!(t in G.shippingZoneCountries)?fo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],fo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):fo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){d.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,d.isStagingMode=mo(),void 0!==this.overrideStagingMode&&(d.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=to.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&Eo()})(),window.Zonos.isBigCommerce&&Fo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Zo();const o=new MutationObserver((()=>{Zo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),(({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const c=async o=>{var t;const s=document.querySelector((null===(t=to.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||Qo),n=(null==s?void 0:s.value)||o;if(!n)return!1;if(!Wo(!1,n))return!1;const c=await K(),r={checkout:c?await Z(c):null,checkoutId:c},{shouldBypass:a}=await Do({forceRefresh:!0,preFetched:r});if(a)return fo("Bypass customer group detected on BC checkout, stopping interval","info"),!0;const d=await Mo({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,!0;e&&await e(),W({isInitializing:!1,newSelectedCountryCode:n});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=Po("/"),!0};let r=!1,a=!1,d=!1,l=!1,u=!1;const h=new MutationObserver((async()=>{var m;const p=document.querySelector(o),g=n();if(!p&&g){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(g),void h.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void h.disconnect();if(!l&&!d){d=!0,u=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await K();if(!m)return"noAction";const p=await Z(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Do({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const z=w.countryCode;if(!Wo(!1,z))return"noAction";if(fo(e?`Logged-in user has international shipping address: ${z}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${z}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return fo("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const k=await Mo({preFetched:g});return k.shouldForceLogin&&k.redirectUrl?(window.location.href=k.redirectUrl,"redirected"):(o&&await o(),W({isInitializing:!1,newSelectedCountryCode:z}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:z,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=Po("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void h.disconnect();"optedOut"===o&&(l=!0)}catch(o){lo("Error checking logged-in user shipping address",o)}finally{d=!1,u=!1}}const f=document.querySelector((null===(m=to.genericSettings)||void 0===m?void 0:m.bigcommerceDomesticCheckoutCountrySelector)||Qo);if(!f)return;if(fo("Domestic checkout found - Listening for shipping country change","info",{value:f.value}),a)return;a=!0,h.disconnect();const w=setInterval((async()=>{if(!r&&!u){r=!0;try{if(await c())return void clearInterval(w);r=!1}catch(o){r=!1}}}),1e3),z=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(z);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(z),e.on("change",(o=>{const e=o.value.address.country;e&&!u&&c(e)})))}),500)}));h.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:Co,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(fo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):fo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(_o))return;o.searchParams.delete(_o),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!G.localizationLoaded||!G.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),fo("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${yo}`);if(o)return clearInterval(t),void o.dispatchEvent(xo("click"));Date.now()-e>15e3&&(clearInterval(t),fo("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){C(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${yo}`);o&&o.dispatchEvent(xo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;$({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:Y.checkoutSessionId}}),z({checkoutSessionId:Y.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await b();n&&"stripe"===d.addressFormRenderType&&ho({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===d.step?c.isFetchingLandedCost||(d.landedCostData&&(M({currency:d.currency}),S()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){S()}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"===c.checkoutSettlementCurrency&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=x();try{if(F.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null,!await I())return c.hasPaymentError=!0,c.customErrorMessage=X("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{d.inventoryCheckErrorMessage=await T()}catch(o){d.inventoryCheckErrorMessage=X("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if(j()>0){const o=await A();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||X("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(O()){try{const o=await _();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await L();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||X("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);S(),p()}catch(o){lo(o),$({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:Y.checkoutSessionId}}),c.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await P(),S(),p()}catch(o){lo(o),$({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:Y.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(U(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(B.locked=!1)}}async handleFinishClick(){if(E(),this.preview)return d.step="customer-info",void await this.init();if(u(),h(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||to.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=po(this.mobile),this.applyStripeTheme(),fo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=po(this.mobile),this.applyStripeTheme(),fo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=so(this.appearanceSettingsOverride.theme))}handleAddressChange(){E()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return fo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);fo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){fo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=po(this.mobile),this.isIframed=window.self!==window.top,fo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[oo("selectedLocale",(()=>{this.applyStripeTheme()})),D("selectedShippingOption",(()=>{var o,e,t,s;const n=d.selectedShippingOption;(null===(o=to.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),N("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=to.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==to.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&to.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,fo(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Po("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),fo(`mobile: ${this.isMobile}`)}disconnectedCallback(){E(),u(),h(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==d.step&&"error"!==d.step&&!c.stripeElements||c.isFetchingSession,{colorPrimary:l,colorSecondary:u,logoUrl:h,style:m}=no(to.appearance,this.appearanceSettingsOverride||null),p="ENABLED"===to.appearance.zonosAttribution,g=to.appearance.theme,f=l&&To(l)?"DARK":"LIGHT",w=this.isMobile?g:f,z=this.isMobile?void 0:u,{customMessages:k}=G,v=null===(o=k.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,y=this.getCurrentLocalePageEnum(),C=k.filter((o=>o.pageName===y)),b=this.getBaseCurrencySettlementInfo(),S=()=>{const o=this.preview?`${h}?timestamp=${Date.now()}`:h;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${to.organizationName} logo`,src:o}))},x=ro(),I=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||mo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},S(),x&&e("zonos-badge",{badgeColor:"orange",size:"small"},X("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},X("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),C.map((o=>e("zonos-custom-message",{icon:Xo,message:o.message}))))},T=()=>d.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:X("Your checkout session has expired. Please reload the page to continue."),restStateTitle:X("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},X("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":Io({overrideBorderStyle:m})}},"finish"!==d.step&&"error"!==d.step&&e(t,null,e("div",{class:"zonos--left","data-theme":w,style:Ao({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&I(),"customer-info"===d.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:z}),"shipping"===d.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:z}),"payment"===d.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:z})),e("div",{class:"zonos--right","data-theme":g},this.isMobile&&I(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Oo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:z}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Xo,message:v})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Xo,message:v}))))),("finish"===d.step||"error"===d.step)&&e("div",{class:"zonos--done","data-theme":g},e("div",{class:"zonos--header"},S(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Oo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:g})),e("zonos-checkout-finish",{borderRadius:m,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":g,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:So(["zonos--checkout zonos--elements","payment"===d.step&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?T():e("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":g,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},T()),e("zonos-dialog",{isLoading:!0,loadingText:X("You will be redirected to international checkout shortly."),loadingTitle:X("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:X("You will be redirected to domestic checkout shortly."),loadingTitle:X("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:X("Stay on this page"),dialogConfirmBtnText:X("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:X("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:X("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:X("Don't close"),dialogConfirmBtnText:X("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:X("Would you like to close checkout and return to the site?"),dialogTitle:X("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:X("Return to merchant site"),dialogConfirmBtnText:X("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?X("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):X("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:X("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:X("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,X("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},X("View GAA Form."))),dialogTitle:X("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:X("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:X("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),b&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:X("Cancel"),dialogConfirmBtnText:X("Pay [orderTotal]",{orderTotal:eo({amount:b.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:X("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:X("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:X("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:X("You are being sent back to the shop to re-add items to your cart."),dialogTitle:X("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}}};oe.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{oe as zonos_checkout}
1
+ import{r as o,h as e,F as t,a as s}from"./p-ce75b047.js";import{s as n,a as i,b as c,i as r,c as a,d,e as l,f as u,p as h,g as m,h as p,j as g,k as f,l as w,t as z,m as k,n as v,o as y,q as C,r as b,u as S,v as x,w as I,x as T,y as A,z as O,A as _,B as L,C as P,D as U,E as B,F as E,G as D,H as N,I as j}from"./p-2c0a627d.js";import{p as R,s as $,a as F,b as M}from"./p-9cb80484.js";import{f as H,a as K,b as Z,i as V,l as G,c as W,g as Q,s as Y,V as q,d as J,t as X,e as oo,h as eo}from"./p-043e9a84.js";import{z as to,g as so,m as no}from"./p-9a417eeb.js";import{b as io}from"./p-83666056.js";import{h as co,g as ro,j as ao,l as lo,b as uo,s as ho,a as mo,i as po}from"./p-41dd1cb8.js";import{u as go}from"./p-1735a69b.js";import{l as fo,g as wo,b as zo}from"./p-0a377722.js";import{_ as ko,c as vo,a as yo,d as Co,g as bo}from"./p-b2d81c98.js";import{c as So}from"./p-b4b7f705.js";import{c as xo}from"./p-595f5dd2.js";import{g as Io}from"./p-f1aea919.js";import{i as To}from"./p-34d6eb83.js";import{s as Ao}from"./p-96d77739.js";import{R as Oo}from"./p-08e7107d.js";import"./p-5c30d04b.js";import"./p-3d28353a.js";import"./p-7bdce9d4.js";const _o="isInternationalCheckout",Lo=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),ro()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(_o,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),ro()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Po=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),ro()&&e.searchParams.set("zonosTestMode","1"),e.toString()},Uo={customerGroupId:null,shouldBypass:!1};let Bo=null;const Eo=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Uo};const i=null===(e=to.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return to.loadedConfig?{conclusive:!0,result:Uo}:{conclusive:!1,result:Uo};const c=o?o.checkoutId:await K();if(!c)return fo("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Uo};const r=o?o.checkout:await Z(c);if(!r)return fo("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Uo};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return fo("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Uo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return fo(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||Bo!==t||(Bo=null),e)));return Bo=t,t},Do=async(o={})=>o.forceRefresh||!Bo?Eo(o.preFetched):Bo,No={guestCheckoutType:null},jo="zonos--bc-checkout-settings",Ro={redirectUrl:null,shouldForceLogin:!1};let $o=null;const Fo=()=>{if(!$o){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return No;const e=null===(o=to.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return fo("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),No;const t=(o=>{try{const e=window.localStorage.getItem(jo);if(!e)return null;const t=ao(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await co("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return fo("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),No;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(jo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:($o===o&&($o=null),!1))).catch((()=>($o===o&&($o=null),!1)));$o=o}return $o},Mo=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Ro;if(!await Fo())return Ro;const e=o?o.checkoutId:await K();if(!e)return Ro;const t=o?o.checkout:await Z(e);return t?V(t)?Ro:(fo("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:Lo(),shouldForceLogin:!0}):(fo("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Ro)},Ho="data-zonos-login-from-rewritten",Ko='a[href*="login.php?action=create_account"]:not(['+Ho+"])",Zo=()=>{const o=document.querySelectorAll(Ko);if(!o.length)return;const e=Lo({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Ho,"true")}))},Vo=(o,e)=>{if(!o.address1||!o.countryCode)return null;const t=[o.firstName,o.lastName].filter(Boolean).join(" ").trim();return{address:{city:o.city||"",country:o.countryCode,line1:o.address1,line2:o.address2||"",postal_code:o.postalCode||"",state:o.stateOrProvinceCode||o.stateOrProvince||""},email:e,name:t,phone:o.phone||""}},Go=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),Wo=(o=!0,e)=>{var t;if(!G.localizationLoaded)return!1;if(e){const s=!!(null===(t=G.shippingZoneCountries)||void 0===t?void 0:t[e])&&!to.disabledCountries.includes(e);return o&&!s&&fo(`Checkout: ${e} is not a shippable country: ${s}`),s}return!!G.isShippableCountry||(o&&fo("Checkout: not shippable country"),!1)},Qo='select[name="shippingAddress.countryCode"]';let Yo=0;const qo=o=>{var e;const t=null===(e=Y.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},Jo=async({cartId:o,retries:e})=>{const t=ro(),{errors:s,json:n}=await co("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(fo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),Jo({cartId:o,retries:e-1})):i?null:n},Xo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',oe=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||to.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:R()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${vo}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return fo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(fo("Payment intent exist, checking stripe payment intent status"),!n)return fo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(fo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,Y.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(fo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(fo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.initializeTestKeys=()=>{var o;Y.enabledVariantTestKeys=(null==(o=Y.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=to.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=Y.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+q,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return J(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof to.checkoutSettings.createCartId&&!!to.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;fo("[TEST] - Registering hosted vs native test");const o=qo("hosted_vs_native");if(o)return void fo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await co("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:H(t)})({testKeys:["hosted_vs_native"]});if(!e)return void fo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+q,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:Y.enabledVariantTestKeys||[],mergeTestObj:e});J(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=qo("hosted_vs_native");if(fo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof to.checkoutSettings.createCartId)return fo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return fo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=to.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return fo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};fo('"createCartId" is provided, start building cart');const t=await to.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);fo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=Q(o)||G.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:Y.checkoutSessionId||void 0,hostedCheckoutUrl:to.genericSettings.hostedCheckoutUrl,isTestMode:ro(),isVariantTest:!0},i),n));return fo(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=d.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.prefillBigCommerceCustomerAddresses=async()=>{if(!window.Zonos.isBigCommerce)return;if(this.defaultCustomerProfileAddress.length)return;if(Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&"object"==typeof this.defaultAddress&&null!==this.defaultAddress)return;const o=await K();if(!o)return;const e=await Z(o);if(!V(e))return;const t=((o,e)=>{var t,s,n,i;if(!(null===(t=null==o?void 0:o.customer)||void 0===t?void 0:t.id))return[];const{isShippable:c,selectedCountryCode:r}=e,a=o.customer.email||"",d=null!==(n=null===(s=o.consignments)||void 0===s?void 0:s.flatMap((o=>o.shippingAddress?[o.shippingAddress]:[])))&&void 0!==n?n:[],l=null!==(i=o.customer.addresses)&&void 0!==i?i:[],u=new Set,h=[];for(const o of[...l,...d]){const e=Vo(o,a);if(!e)continue;if(!c(e.address.country))continue;const t=Go(e);u.has(t)||(u.add(t),h.push(e))}return r?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===r;return t===(e.option.address.country===r)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>Wo(!1,o),selectedCountryCode:G.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,fo(`Prefilled ${String(t.length)} BigCommerce customer address(es) for logged-in shopper`,"info")))},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=to.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(Y.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(Y.checkoutSessionId=e);const t=Y.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(qo("hosted_vs_native")?J(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+q,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),J(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,$({event:"zonos-checkout-close",metadata:{checkoutSessionId:Y.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||u(),this.preview||h(),d.step="customer-info",m(),p(),null===(t=(e=to.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if("function"==typeof to.checkoutSettings.createCartId){fo('"createCartId" is provided, start building cart'),d.customMessage=[];const o=await to.checkoutSettings.createCartId();let e;"object"==typeof o?(fo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),d.customerAuthenticationToken=o.customerAuthenticationToken||null,d.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((o=>"string"==typeof o)):[]):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=ko(o);if(!t&&!e)return lo("[ZONOS - loadZonos] invalid cart id"),null;const s=await Jo({cartId:o,retries:5});return fo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(lo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return lo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=io(s);await l({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){fo("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:e}=io(window.Zonos.cartData);await l({adjustments:o,cartItems:e})}else if(to.checkoutSettings.buildCartDetail&&G.selectedCountryCode){fo("build cart detail");const o=await to.checkoutSettings.buildCartDetail({countryCode:G.selectedCountryCode,currencyCode:G.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));fo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await l({adjustments:s,cartItems:e})}if(!Y.checkoutSessionId){const o=await g();if(fo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}d.isStagingMode||f(),await this.applyStripeTheme();const{successBehavior:o,successRedirectUrl:e}=to.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===o||"CLOSE_MODAL"===o&&!!e||!!d.externalConfirmationPageURL,!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=ao(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;fo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return fo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,fo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){Y.checkoutSessionId&&go({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:Y.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,Y.checkoutSessionId&&go({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:Y.checkoutSessionId})}markTheSessionAsAbandonedCart(){Y.checkoutSessionId&&go({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:Y.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||to.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=to.checkoutSettings.placeOrderButtonSelector,e=to.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${vo}`);if(fo(`attach checkout ${o}`),fo(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${Co}`,`#${vo}`,`#${yo}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(fo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${yo}`),l=t.matches(`#${Co}`)||t.matches(`#${vo}`);if(!window.Zonos.isLegacyCheckout&&(!Wo()||((o=!0)=>!G.localizationLoaded||!!G.isDisabledCountry&&(o&&fo("Checkout: disabled country"),!0))())&&!r&&!a&&!l)return;o.preventDefault(),o.stopPropagation(),fo("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;fo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await co("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),Yo++,Yo>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),to.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Do();if(o)return fo("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Po("/checkout"));const e=await Mo();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:Y.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),w({isPreview:this.preview,sessionTimeout:54e5}),$({event:"zonos-checkout-start",metadata:{checkoutSessionId:Y.checkoutSessionId}}),z({checkoutSessionId:Y.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await co("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(d.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=wo(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},uo()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};co("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},uo()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};co("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),bo()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,lo(o),this.isCartExpired)return void(c.isFetchingSession=!0);ho({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:zo,cartId:window.Zonos.cartId,checkoutSessionBody:k(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||to.onlineStoreSettings.url}}),v({messages:[X("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:X("Error creating Checkout")})}}}),{capture:!0,passive:!1}),to.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${Co}`)&&(t.dispatchEvent(xo("click")),y(),t.remove()),t.matches(`#${vo}`)&&(t.dispatchEvent(xo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;fo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||Q(h)||G.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);fo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=Q(o)||G.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&G.shippingZoneCountries&&!(t in G.shippingZoneCountries)?fo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],fo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):fo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){d.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,d.isStagingMode=mo(),void 0!==this.overrideStagingMode&&(d.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=to.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&Eo()})(),window.Zonos.isBigCommerce&&Fo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Zo();const o=new MutationObserver((()=>{Zo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),(({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const c=async o=>{var t;const s=document.querySelector((null===(t=to.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||Qo),n=(null==s?void 0:s.value)||o;if(!n)return!1;if(!Wo(!1,n))return!1;const c=await K(),r={checkout:c?await Z(c):null,checkoutId:c},{shouldBypass:a}=await Do({forceRefresh:!0,preFetched:r});if(a)return fo("Bypass customer group detected on BC checkout, stopping interval","info"),!0;const d=await Mo({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,!0;e&&await e(),W({isInitializing:!1,newSelectedCountryCode:n});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=Po("/"),!0};let r=!1,a=!1,d=!1,l=!1,u=!1;const h=new MutationObserver((async()=>{var m;const p=document.querySelector(o),g=n();if(!p&&g){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(g),void h.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void h.disconnect();if(!l&&!d){d=!0,u=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await K();if(!m)return"noAction";const p=await Z(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Do({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const z=w.countryCode;if(!Wo(!1,z))return"noAction";if(fo(e?`Logged-in user has international shipping address: ${z}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${z}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return fo("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const k=await Mo({preFetched:g});return k.shouldForceLogin&&k.redirectUrl?(window.location.href=k.redirectUrl,"redirected"):(o&&await o(),W({isInitializing:!1,newSelectedCountryCode:z}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:z,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=Po("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void h.disconnect();"optedOut"===o&&(l=!0)}catch(o){lo("Error checking logged-in user shipping address",o)}finally{d=!1,u=!1}}const f=document.querySelector((null===(m=to.genericSettings)||void 0===m?void 0:m.bigcommerceDomesticCheckoutCountrySelector)||Qo);if(!f)return;if(fo("Domestic checkout found - Listening for shipping country change","info",{value:f.value}),a)return;a=!0,h.disconnect();const w=setInterval((async()=>{if(!r&&!u){r=!0;try{if(await c())return void clearInterval(w);r=!1}catch(o){r=!1}}}),1e3),z=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(z);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(z),e.on("change",(o=>{const e=o.value.address.country;e&&!u&&c(e)})))}),500)}));h.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:Co,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(fo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):fo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(_o))return;o.searchParams.delete(_o),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!G.localizationLoaded||!G.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),fo("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${yo}`);if(o)return clearInterval(t),void o.dispatchEvent(xo("click"));Date.now()-e>15e3&&(clearInterval(t),fo("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){C(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${yo}`);o&&o.dispatchEvent(xo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;$({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:Y.checkoutSessionId}}),z({checkoutSessionId:Y.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await b();n&&"stripe"===d.addressFormRenderType&&ho({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===d.step?c.isFetchingLandedCost||(d.landedCostData&&(M({currency:d.currency}),S()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){S()}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"===c.checkoutSettlementCurrency&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=x();try{if(F.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null,!await I())return c.hasPaymentError=!0,c.customErrorMessage=X("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{d.inventoryCheckErrorMessage=await T()}catch(o){d.inventoryCheckErrorMessage=X("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if(j()>0){const o=await A();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||X("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(O()){try{const o=await _();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await L();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||X("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);S(),p()}catch(o){lo(o),$({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:Y.checkoutSessionId}}),c.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await P(),S(),p()}catch(o){lo(o),$({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:Y.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(U(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(B.locked=!1)}}async handleFinishClick(){if(E(),this.preview)return d.step="customer-info",void await this.init();if(u(),h(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||to.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=po(this.mobile),this.applyStripeTheme(),fo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=po(this.mobile),this.applyStripeTheme(),fo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=so(this.appearanceSettingsOverride.theme))}handleAddressChange(){E()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return fo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);fo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){fo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=po(this.mobile),this.isIframed=window.self!==window.top,fo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[oo("selectedLocale",(()=>{this.applyStripeTheme()})),D("selectedShippingOption",(()=>{var o,e,t,s;const n=d.selectedShippingOption;(null===(o=to.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),N("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=to.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==to.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&to.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,fo(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Po("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),fo(`mobile: ${this.isMobile}`)}disconnectedCallback(){E(),u(),h(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==d.step&&"error"!==d.step&&!c.stripeElements||c.isFetchingSession,{colorPrimary:l,colorSecondary:u,logoUrl:h,style:m}=no(to.appearance,this.appearanceSettingsOverride||null),p="ENABLED"===to.appearance.zonosAttribution,g=to.appearance.theme,f=l&&To(l)?"DARK":"LIGHT",w=this.isMobile?g:f,z=this.isMobile?void 0:u,{customMessages:k}=G,v=null===(o=k.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,y=this.getCurrentLocalePageEnum(),C=k.filter((o=>o.pageName===y)),b=this.getBaseCurrencySettlementInfo(),S=()=>{const o=this.preview?`${h}?timestamp=${Date.now()}`:h;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${to.organizationName} logo`,src:o}))},x=ro(),I=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||mo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},S(),x&&e("zonos-badge",{badgeColor:"orange",size:"small"},X("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},X("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),C.map((o=>e("zonos-custom-message",{icon:Xo,message:o.message}))))},T=()=>d.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:X("Your checkout session has expired. Please reload the page to continue."),restStateTitle:X("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},X("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":Io({overrideBorderStyle:m})}},"finish"!==d.step&&"error"!==d.step&&e(t,null,e("div",{class:"zonos--left","data-theme":w,style:Ao({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&I(),"customer-info"===d.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:z}),"shipping"===d.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:z}),"payment"===d.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:z})),e("div",{class:"zonos--right","data-theme":g},this.isMobile&&I(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Oo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:z}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Xo,message:v})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Xo,message:v}))))),("finish"===d.step||"error"===d.step)&&e("div",{class:"zonos--done","data-theme":g},e("div",{class:"zonos--header"},S(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Oo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:g})),e("zonos-checkout-finish",{borderRadius:m,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":g,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:So(["zonos--checkout zonos--elements","payment"===d.step&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?T():e("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":g,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},T()),e("zonos-dialog",{isLoading:!0,loadingText:X("You will be redirected to international checkout shortly."),loadingTitle:X("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:X("You will be redirected to domestic checkout shortly."),loadingTitle:X("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:X("Stay on this page"),dialogConfirmBtnText:X("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:X("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:X("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:X("Don't close"),dialogConfirmBtnText:X("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:X("Would you like to close checkout and return to the site?"),dialogTitle:X("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:X("Return to merchant site"),dialogConfirmBtnText:X("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?X("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):X("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:X("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:X("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,X("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},X("View GAA Form."))),dialogTitle:X("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:X("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:X("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),b&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:X("Cancel"),dialogConfirmBtnText:X("Pay [orderTotal]",{orderTotal:eo({amount:b.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:X("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:X("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:X("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:X("You are being sent back to the shop to re-add items to your cart."),dialogTitle:X("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}}};oe.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{oe as zonos_checkout}
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-3e7ee89d.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,e,a;return{setters:[function(t){s=t.r;o=t.h;n=t.a},function(t){e=t.f},function(t){a=t.c},function(){}],execute:function(){var f=":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 i=f;var r=t("zonos_v_stack",function(){function t(t){s(this,t);this.spacing=24}t.prototype.render=function(){return o(n,{key:"773b6654cf2031f3db0eb24781fabb8d8da7a6d2",style:{"--zonos--font-family":e()}},o("div",{key:"d5f58fcd829b7f563f9154cc760df9c6392c2526",class:a(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},o("slot",{key:"d5c7f7f2eca26214cdc6ecbe3ad5dcf4f02d9264"})))};return t}());r.style=i}}}));
1
+ System.register(["./p-7261e245.system.js","./p-47a1d469.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,a,f;return{setters:[function(t){s=t.r;o=t.h;n=t.a},function(t){a=t.f},function(t){f=t.c},function(){}],execute:function(){var i=":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=i;var r=t("zonos_v_stack",function(){function t(t){s(this,t);this.spacing=24}t.prototype.render=function(){return o(n,{key:"773b6654cf2031f3db0eb24781fabb8d8da7a6d2",style:{"--zonos--font-family":a()}},o("div",{key:"d5f58fcd829b7f563f9154cc760df9c6392c2526",class:f(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},o("slot",{key:"d5c7f7f2eca26214cdc6ecbe3ad5dcf4f02d9264"})))};return t}());r.style=e}}}));
@@ -0,0 +1 @@
1
+ import{t as o}from"./p-34d6eb83.js";const r=({backgroundColor1:r,backgroundColor2:a})=>o.readability(r,a)>2.5;export{r as i}
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-bf8c98ab.system.js","./p-171d0f9f.system.js","./p-9574695a.system.js","./p-23e7c655.system.js","./p-d25759fb.system.js","./p-45bd8072.system.js","./p-3e7ee89d.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-7d9d2407.system.js","./p-14d6542f.system.js"],(function(o){"use strict";var t,e,s,n,i,a,l,c,r;return{setters:[function(o){t=o.r;e=o.h;s=o.a},function(o){n=o.d},function(o){i=o.t},function(o){a=o.r},function(o){l=o.c},function(o){c=o.c},function(o){r=o.r},function(){},function(){},function(){},function(){},function(){}],execute:function(){var h=":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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--cart-table .zonos--column:first-child{padding-left:0;width:50px}:host .zonos--cart-table .zonos--cart-item-link{text-align:left}:host .zonos--cart-table .zonos--cart-item-created-at{text-align:right}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host(.mobile) table{margin-top:16px}:host(.mobile) table td{vertical-align:top}";var d=h;var f=o("zonos_invoice_cart_items",function(){function o(o){t(this,o);this.isMobile=false;this.errorImages=[];this.locale=null}o.prototype.componentWillLoad=function(){var o=navigator.language;this.locale=o};o.prototype.render=function(){var o=this;var t=n.items.filter((function(o){return!o.isRestricted}));return e(s,{key:"e6626df96493b9cd9110036f203492c008c8c802",class:l(["zonos--invoice-cart-items zonos--elements",this.isMobile&&"mobile"])},e("table",{key:"9a03b7868010f52560725fb4139a329b2b96066c",class:"zonos--cart-table"},e("tbody",{key:"f1aae5d161654014e4e5e5fd56383664c7fe5635"},t.map((function(t){var s,n,l,c;var r=(n=(s=t.attributes)===null||s===void 0?void 0:s.find((function(o){return o.key==="invoiceId"||o.key==="INVOICE_ID"})))===null||n===void 0?void 0:n.value;var h=(c=(l=t.attributes)===null||l===void 0?void 0:l.find((function(o){return o.key==="invoiceCreatedAt"})))===null||c===void 0?void 0:c.value;var d=h&&o.locale?new Date(h).toLocaleDateString(o.locale,{day:"numeric",month:"long",year:"numeric"}):null;var f=r?"https://dashboard.zonos.com/billing/invoices/".concat(r):null;return e("tr",{class:"zonos--invoice-cart-item"},e("td",{class:"zonos--column zonos--cart-item-title"},e("zonos-text",{type:"semiBoldLabel"},i("Invoice:"))),e("td",{class:"zonos--column zonos--cart-item-link"},f&&r&&e("zonos-link",{href:f},r),o.isMobile&&e("zonos-text",{type:"caption"},d)),e("td",{class:"zonos--column zonos--cart-item-created-at"},!o.isMobile&&e("zonos-text",{type:"label"},d)),e("td",{class:"zonos--column zonos--cart-item-price"},e("zonos-text",{type:"label"},a({amount:t.amount,isForeign:false}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());f.style=d;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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--invoice-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--invoice-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--invoice-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--invoice-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--invoice-subtotal-price{text-align:right}:host .zonos--invoice-subtotal-price zonos-text{white-space:nowrap}:host .zonos--invoice-total .zonos--column{padding:16px 0}:host .zonos--invoice-total .zonos--invoice-subtotal-title,:host .zonos--invoice-total .zonos--invoice-subtotal-price{border-top:1px solid var(--zonos-elements-gray-200)}:host .zonos--invoice-subtotal-price zonos-text,:host .zonos--invoice-pay-total zonos-text{white-space:nowrap}:host(.mobile){position:relative;bottom:0}";var u=m;var z=o("zonos_invoice_subtotal",function(){function o(o){t(this,o);this.isMobile=false}o.prototype.render=function(){return e(s,{key:"869e194bb991686647a27c85e3287f8c87013697",class:l(["zonos--invoice-subtotal zonos--elements",this.isMobile&&"mobile"])},e("table",{key:"4e3a87b6ceeba8663c7d41797826e92a1d8df873",class:"zonos--invoice-table"},e("tr",{key:"4cc0be3427ded6e3dfc92fca9d6acf69915a5d96",class:"zonos--row zonos--invoice-total"},e("td",{key:"ca4cefc97914df89530a6ba06f93412773685d13",class:"zonos--column"}),e("td",{key:"7cad6266e244446fef196403f4e1628b4656c680",class:"zonos--column zonos--invoice-subtotal-title"},e("zonos-text",{key:"311ce310181fec1db2cd31e92e210d345e0c2871",type:"semiBoldLabel"},i("Payment total"))),e("td",{key:"2aa6e7fb76e8a7c0d2b1c56fdcdf63ed2b3bed82",class:"zonos--column zonos--invoice-subtotal-price"},r({content:e("zonos-text",{type:"semiBoldLabel"},a({amount:c.amountTotalDue||0,isForeign:true})),isLoading:c.isFetchingPayorInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());z.style=u}}}));
1
+ System.register(["./p-7261e245.system.js","./p-d1f2e532.system.js","./p-d62dab88.system.js","./p-2bdfa429.system.js","./p-23e7c655.system.js","./p-03c357f5.system.js","./p-45bd8072.system.js","./p-47a1d469.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-dab78981.system.js","./p-30e9a6d7.system.js"],(function(o){"use strict";var t,e,s,n,i,a,l,c,r;return{setters:[function(o){t=o.r;e=o.h;s=o.a},function(o){n=o.d},function(o){i=o.t},function(o){a=o.r},function(o){l=o.c},function(o){c=o.c},function(o){r=o.r},function(){},function(){},function(){},function(){},function(){}],execute:function(){var h=":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--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--cart-table .zonos--column:first-child{padding-left:0;width:50px}:host .zonos--cart-table .zonos--cart-item-link{text-align:left}:host .zonos--cart-table .zonos--cart-item-created-at{text-align:right}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host(.mobile) table{margin-top:16px}:host(.mobile) table td{vertical-align:top}";var d=h;var f=o("zonos_invoice_cart_items",function(){function o(o){t(this,o);this.isMobile=false;this.errorImages=[];this.locale=null}o.prototype.componentWillLoad=function(){var o=navigator.language;this.locale=o};o.prototype.render=function(){var o=this;var t=n.items.filter((function(o){return!o.isRestricted}));return e(s,{key:"e6626df96493b9cd9110036f203492c008c8c802",class:l(["zonos--invoice-cart-items zonos--elements",this.isMobile&&"mobile"])},e("table",{key:"9a03b7868010f52560725fb4139a329b2b96066c",class:"zonos--cart-table"},e("tbody",{key:"f1aae5d161654014e4e5e5fd56383664c7fe5635"},t.map((function(t){var s,n,l,c;var r=(n=(s=t.attributes)===null||s===void 0?void 0:s.find((function(o){return o.key==="invoiceId"||o.key==="INVOICE_ID"})))===null||n===void 0?void 0:n.value;var h=(c=(l=t.attributes)===null||l===void 0?void 0:l.find((function(o){return o.key==="invoiceCreatedAt"})))===null||c===void 0?void 0:c.value;var d=h&&o.locale?new Date(h).toLocaleDateString(o.locale,{day:"numeric",month:"long",year:"numeric"}):null;var f=r?"https://dashboard.zonos.com/billing/invoices/".concat(r):null;return e("tr",{class:"zonos--invoice-cart-item"},e("td",{class:"zonos--column zonos--cart-item-title"},e("zonos-text",{type:"semiBoldLabel"},i("Invoice:"))),e("td",{class:"zonos--column zonos--cart-item-link"},f&&r&&e("zonos-link",{href:f},r),o.isMobile&&e("zonos-text",{type:"caption"},d)),e("td",{class:"zonos--column zonos--cart-item-created-at"},!o.isMobile&&e("zonos-text",{type:"label"},d)),e("td",{class:"zonos--column zonos--cart-item-price"},e("zonos-text",{type:"label"},a({amount:t.amount,isForeign:false}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());f.style=d;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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--invoice-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--invoice-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--invoice-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--invoice-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--invoice-subtotal-price{text-align:right}:host .zonos--invoice-subtotal-price zonos-text{white-space:nowrap}:host .zonos--invoice-total .zonos--column{padding:16px 0}:host .zonos--invoice-total .zonos--invoice-subtotal-title,:host .zonos--invoice-total .zonos--invoice-subtotal-price{border-top:1px solid var(--zonos-elements-gray-200)}:host .zonos--invoice-subtotal-price zonos-text,:host .zonos--invoice-pay-total zonos-text{white-space:nowrap}:host(.mobile){position:relative;bottom:0}";var u=m;var z=o("zonos_invoice_subtotal",function(){function o(o){t(this,o);this.isMobile=false}o.prototype.render=function(){return e(s,{key:"869e194bb991686647a27c85e3287f8c87013697",class:l(["zonos--invoice-subtotal zonos--elements",this.isMobile&&"mobile"])},e("table",{key:"4e3a87b6ceeba8663c7d41797826e92a1d8df873",class:"zonos--invoice-table"},e("tr",{key:"4cc0be3427ded6e3dfc92fca9d6acf69915a5d96",class:"zonos--row zonos--invoice-total"},e("td",{key:"ca4cefc97914df89530a6ba06f93412773685d13",class:"zonos--column"}),e("td",{key:"7cad6266e244446fef196403f4e1628b4656c680",class:"zonos--column zonos--invoice-subtotal-title"},e("zonos-text",{key:"311ce310181fec1db2cd31e92e210d345e0c2871",type:"semiBoldLabel"},i("Payment total"))),e("td",{key:"2aa6e7fb76e8a7c0d2b1c56fdcdf63ed2b3bed82",class:"zonos--column zonos--invoice-subtotal-price"},r({content:e("zonos-text",{type:"semiBoldLabel"},a({amount:c.amountTotalDue||0,isForeign:true})),isLoading:c.isFetchingPayorInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());z.style=u}}}));
@@ -1 +1 @@
1
- import{r as o,h as s,a as t}from"./p-ce75b047.js";import{f as a}from"./p-701d9a7c.js";import{c as r}from"./p-b4b7f705.js";import"./p-0a377722.js";const f=class{constructor(s){o(this,s),this.spacing=24}render(){return s(t,{key:"773b6654cf2031f3db0eb24781fabb8d8da7a6d2",style:{"--zonos--font-family":a()}},s("div",{key:"d5f58fcd829b7f563f9154cc760df9c6392c2526",class:r(["vstack"]),style:{"grid-row-gap":`${this.spacing}px`}},s("slot",{key:"d5c7f7f2eca26214cdc6ecbe3ad5dcf4f02d9264"})))}};f.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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";export{f as zonos_v_stack}
1
+ import{r as o,h as s,a as t}from"./p-ce75b047.js";import{f as a}from"./p-9a417eeb.js";import{c as r}from"./p-b4b7f705.js";import"./p-0a377722.js";const f=class{constructor(s){o(this,s),this.spacing=24}render(){return s(t,{key:"773b6654cf2031f3db0eb24781fabb8d8da7a6d2",style:{"--zonos--font-family":a()}},s("div",{key:"d5f58fcd829b7f563f9154cc760df9c6392c2526",class:r(["vstack"]),style:{"grid-row-gap":`${this.spacing}px`}},s("slot",{key:"d5c7f7f2eca26214cdc6ecbe3ad5dcf4f02d9264"})))}};f.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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";export{f as zonos_v_stack}
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-3e7ee89d.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(o){"use strict";var e,s,r,n,t;return{setters:[function(o){e=o.r;s=o.h;r=o.a},function(o){n=o.f},function(o){t=o.c},function(){}],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{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:"icon header" ". content";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}';var l=a;var i=o("zonos_banner",function(){function o(o){var s=this;e(this,o);this.hasContent=false;this.handleSlotChange=function(){s.hasContent=true}}o.prototype.render=function(){var o=this;var e=function(e){var r=e.color;var n="var(--zonos-elements-".concat(r,"-800)");var a="var(--zonos-elements-".concat(r,"-300)");var l=[o.bannerTitle,s("slot",{onSlotchange:o.handleSlotChange})].filter(Boolean),i=l[0],c=l[1];var d=r==="gray"?"gray-1000":"".concat(r,"-800");return s("div",{class:t(["zonos--container"])},s("div",{class:"zonos--icon-wrapper"},s("svg",{color:n,fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"https://www.w3.org/2000/svg"},s("path",{"clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z","data-is-secondary-color":"true",fill:a,"fill-rule":"evenodd"}),s("path",{"clip-rule":"evenodd",d:"M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:"currentColor","fill-rule":"evenodd"}))),s("div",{class:"zonos--header-wrapper"},s("zonos-text",{textColor:d,type:"label",weight:600},i)),c&&s("div",{class:"zonos--content-wrapper"},s("zonos-text",{textColor:d},c)))};var a=t(["zonos--elements zonos--banner",this.intent]);var l=n();switch(this.intent){case"error":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"red"}));case"info":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"blue"}));case"success":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"green"}));case"warning":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"orange"}));default:return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"gray"}))}};return o}());i.style=l}}}));
1
+ System.register(["./p-7261e245.system.js","./p-47a1d469.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(o){"use strict";var e,s,r,n,t;return{setters:[function(o){e=o.r;s=o.h;r=o.a},function(o){n=o.f},function(o){t=o.c},function(){}],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{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:"icon header" ". content";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}';var l=a;var i=o("zonos_banner",function(){function o(o){var s=this;e(this,o);this.hasContent=false;this.handleSlotChange=function(){s.hasContent=true}}o.prototype.render=function(){var o=this;var e=function(e){var r=e.color;var n="var(--zonos-elements-".concat(r,"-800)");var a="var(--zonos-elements-".concat(r,"-300)");var l=[o.bannerTitle,s("slot",{onSlotchange:o.handleSlotChange})].filter(Boolean),i=l[0],c=l[1];var d=r==="gray"?"gray-1000":"".concat(r,"-800");return s("div",{class:t(["zonos--container"])},s("div",{class:"zonos--icon-wrapper"},s("svg",{color:n,fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"https://www.w3.org/2000/svg"},s("path",{"clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z","data-is-secondary-color":"true",fill:a,"fill-rule":"evenodd"}),s("path",{"clip-rule":"evenodd",d:"M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:"currentColor","fill-rule":"evenodd"}))),s("div",{class:"zonos--header-wrapper"},s("zonos-text",{textColor:d,type:"label",weight:600},i)),c&&s("div",{class:"zonos--content-wrapper"},s("zonos-text",{textColor:d},c)))};var a=t(["zonos--elements zonos--banner",this.intent]);var l=n();switch(this.intent){case"error":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"red"}));case"info":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"blue"}));case"success":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"green"}));case"warning":return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"orange"}));default:return s(r,{class:a,style:{"--zonos--font-family":l}},e({color:"gray"}))}};return o}());i.style=l}}}));
@@ -1 +1 @@
1
- import{r as o,d as s,h as e,a as i,g as t}from"./p-ce75b047.js";import{f as r,z as n}from"./p-701d9a7c.js";import{c as a}from"./p-b4b7f705.js";import{g as l}from"./p-3dc3596b.js";import{g as d}from"./p-ac8cfdc0.js";import{i as h}from"./p-ae393255.js";import"./p-0a377722.js";import"./p-33d4be28.js";import"./p-cd34ecf2.js";const p=class{constructor(e){o(this,e),this.radioSelected=s(this,"radioSelected",7),this.selectedItem=null,this.handleRichRadioSelect=o=>{var s;null===(s=this.radioSelected)||void 0===s||s.emit(o)},this.getRadioItemStyleVariables=()=>{const o=this.borderColor||n.appearance.colorSecondary,s=this.isMobile?"--zonos-elements-gray-0":n.appearance.colorPrimary,e=s&&o?d({backgroundColor:h(s)?window.getComputedStyle(this.ele).getPropertyValue(`--zonos-elements-${s.replace("--zonos-elements-","")}`):s,color:o}):o;return{"--zonos--border-radius":l({overrideBorderStyle:this.borderStyle}),"--zonos--selected-border-color":e||"unset"}}}render(){var o;return e(i,{key:"8d77a01ba101899adb41904a820ba5f4985bc52d",class:"zonos--shipping-rich-radio zonos--elements","data-theme":this.theme,style:Object.assign(Object.assign({},this.getRadioItemStyleVariables()),{"--zonos--font-family":r()})},null===(o=this.items)||void 0===o?void 0:o.map((o=>{var s;const i=(null===(s=this.selectedItem)||void 0===s?void 0:s.value)===o.value;return e("div",{"aria-hidden":"true",class:a(["zonos--shipping-rich-radio-item",i&&"selected"]),onClick:()=>this.handleRichRadioSelect(o)},e("input",{checked:i,class:"zonos--shipping-rich-radio-input",name:"zonos--shipping-rich-radio",type:"radio",value:o.value}),e("div",{class:"zonos--shipping-info"},e("div",{class:"zonos--shipping-detail"},e("zonos-text",{class:"zonos--shipping-label",type:"label"},o.label),(o.sublabel||o.caption)&&e("div",{class:"zonos--sub-detail"},o.sublabel&&e("zonos-text",{textColor:"gray-800"},o.sublabel),o.caption&&e("zonos-text",{textColor:"gray-600"},o.caption))),e("zonos-text",{type:"semiBoldLabel"},o.price)))})))}get ele(){return t(this)}};p.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-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--zonos--selected-border-color, var(--zonos-elements-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:16px;-ms-flex-align:center;align-items:center;gap:16px;cursor:pointer;border:1px solid var(--zonos-elements-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-top-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-bottom-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--zonos--selected-border-color, var(--zonos-elements-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";export{p as zonos_shipping_rich_radio}
1
+ import{r as o,d as s,h as e,a as i,g as t}from"./p-ce75b047.js";import{f as r,z as n}from"./p-9a417eeb.js";import{c as a}from"./p-b4b7f705.js";import{g as l}from"./p-f1aea919.js";import{g as d}from"./p-35fd0fdb.js";import{i as h}from"./p-ae393255.js";import"./p-0a377722.js";import"./p-34d6eb83.js";import"./p-5c30d04b.js";const p=class{constructor(e){o(this,e),this.radioSelected=s(this,"radioSelected",7),this.selectedItem=null,this.handleRichRadioSelect=o=>{var s;null===(s=this.radioSelected)||void 0===s||s.emit(o)},this.getRadioItemStyleVariables=()=>{const o=this.borderColor||n.appearance.colorSecondary,s=this.isMobile?"--zonos-elements-gray-0":n.appearance.colorPrimary,e=s&&o?d({backgroundColor:h(s)?window.getComputedStyle(this.ele).getPropertyValue(`--zonos-elements-${s.replace("--zonos-elements-","")}`):s,color:o}):o;return{"--zonos--border-radius":l({overrideBorderStyle:this.borderStyle}),"--zonos--selected-border-color":e||"unset"}}}render(){var o;return e(i,{key:"8d77a01ba101899adb41904a820ba5f4985bc52d",class:"zonos--shipping-rich-radio zonos--elements","data-theme":this.theme,style:Object.assign(Object.assign({},this.getRadioItemStyleVariables()),{"--zonos--font-family":r()})},null===(o=this.items)||void 0===o?void 0:o.map((o=>{var s;const i=(null===(s=this.selectedItem)||void 0===s?void 0:s.value)===o.value;return e("div",{"aria-hidden":"true",class:a(["zonos--shipping-rich-radio-item",i&&"selected"]),onClick:()=>this.handleRichRadioSelect(o)},e("input",{checked:i,class:"zonos--shipping-rich-radio-input",name:"zonos--shipping-rich-radio",type:"radio",value:o.value}),e("div",{class:"zonos--shipping-info"},e("div",{class:"zonos--shipping-detail"},e("zonos-text",{class:"zonos--shipping-label",type:"label"},o.label),(o.sublabel||o.caption)&&e("div",{class:"zonos--sub-detail"},o.sublabel&&e("zonos-text",{textColor:"gray-800"},o.sublabel),o.caption&&e("zonos-text",{textColor:"gray-600"},o.caption))),e("zonos-text",{type:"semiBoldLabel"},o.price)))})))}get ele(){return t(this)}};p.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-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--zonos--selected-border-color, var(--zonos-elements-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:16px;-ms-flex-align:center;align-items:center;gap:16px;cursor:pointer;border:1px solid var(--zonos-elements-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-top-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-bottom-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--zonos--selected-border-color, var(--zonos-elements-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";export{p as zonos_shipping_rich_radio}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,c){function l(o){try{r(n.next(o))}catch(o){c(o)}}function i(o){try{r(n["throw"](o))}catch(o){c(o)}}function r(o){o.done?t(o.value):s(o.value).then(l,i)}r((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(o){return function(e){return r([o,e])}}function r(i){if(n)throw new TypeError("Generator is already executing.");while(l&&(l=0,i[0]&&(t=0)),t)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:t.label++;return{value:i[1],done:false};case 5:t.label++;s=i[1];i=[0];continue;case 7:i=t.ops.pop();t.trys.pop();continue;default:if(!(c=t.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){t=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){t.label=i[1];break}if(i[0]===6&&t.label<c[1]){t.label=c[1];c=i;break}if(c&&t.label<c[2]){t.label=c[2];t.ops.push(i);break}if(c[2])t.ops.pop();t.trys.pop();continue}i=e.call(o,t)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-1a4083be.system.js","./p-bf8c98ab.system.js","./p-14018649.system.js","./p-171d0f9f.system.js","./p-3e7ee89d.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-2adbbce7.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-45bd8072.system.js","./p-c9e433c0.system.js","./p-7d9d2407.system.js","./p-14d6542f.system.js","./p-5d65be06.system.js","./p-bc919de1.system.js"],(function(o){"use strict";var e,t,n,s,c,l,i,r,a,d,z,u,h,f,m,p,g,b,v,w,x,y,k,_,C,I,S,j,L,A,E,O,T,P,U,N,D,R,B,W,F,H,X,K,V;return{setters:[function(o){e=o.r;t=o.h;n=o.a;s=o.F},function(o){c=o.c;l=o.a;i=o.b;r=o.d;a=o.e;d=o.f;z=o.g;u=o.h;h=o.i},function(o){f=o.b;m=o.i;p=o.d;g=o.c;b=o.n;v=o.e;w=o.j;x=o.k;y=o.w;k=o.C;_=o.H;C=o.F;I=o.f},function(o){S=o.p;j=o.a},function(o){L=o.s;A=o.t;E=o.e;O=o.h;T=o.l},function(o){P=o.z},function(o){U=o.b},function(o){N=o.h;D=o.s;R=o.l;B=o.g},function(o){W=o.i;F=o.a},function(o){H=o.c},function(o){X=o.l},function(o){K=o.r},function(o){V=o.l},function(){},function(){},function(){},function(){}],execute:function(){var q='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var G=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var M=G;var Q=o("zonos_collect",function(){function o(o){var t=this;e(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=f.clientSecret;this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=p.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=P.appearance.theme;return[4,m({overrideTheme:this.isMobile?o:undefined,paypalEnabled:S()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,z;return __generator(this,(function(u){switch(u.label){case 0:e=L.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=u.sent();c.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!l(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}n=t.checkoutSession;i.currency=p.currency;this.confirmationId=((o=n.landedCost)===null||o===void 0?void 0:o.shortId)||null;s=!!n.completedAt||!!n.order;if(!(!s&&n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:z=u.sent().status;s=a(z);u.label=3;case 3:if(s){void this.setToFinishStep();return[2]}void d();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,c,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;n=t.get("payment_intent_client_secret");s=t.get("zonosCheckoutSessionId");X("Payment intent exist, checking stripe payment intent status");if(!n){X("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,g({clientSecret:n})];case 1:c=d.sent(),l=c.error,i=c.status;r=new URLSearchParams(window.location.search).get("redirect_status");if(!(r&&s))return[3,3];if(!l){X("Payment intent is succeeded or in a good state to move forward, show success screen")}else{X("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;L.checkoutSessionId=s;f.clientSecret=n;void this.setToFinishStep(i);return[2,{shouldAllowOrder:false}];case 3:if(!e){X("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}X("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t,n,s,d,d;return __generator(this,(function(z){switch(z.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=z.sent();if(!t){return[2,false]}n=t.checkoutSession;this.confirmationId=((e=n.landedCost)===null||e===void 0?void 0:e.shortId)||null;c.paymentProcessor=n.paymentProcessor||null;s=n.paymentProcessor==="AIRWALLEX";if(s&&n.clientSecret){l(n);i.currency=p.currency}if(n.completedAt||n.order){void this.setToFinishStep("succeeded");return[2,true]}if(!s)return[3,4];if(!(n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:d=z.sent().status;if(a(d)){void this.setToFinishStep();return[2,true]}z.label=3;case 3:return[3,6];case 4:if(!n.clientSecret)return[3,6];return[4,g({clientSecret:n.clientSecret})];case 5:d=z.sent().status;if(d==="processing"||d==="succeeded"){f.clientSecret=n.clientSecret;void this.setToFinishStep(d);return[2,true]}z.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=W(this.mobile);this.isTablet=F(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){f.stripe=window.Zonos.stripe;p.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,r,a,d,h,f,m,g,y,k,_,C,I,S,j,E,O;return __generator(this,(function(T){switch(T.label){case 0:if(!window.Zonos.cartData){return[2]}m=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(m){p.currency=m}g=(n=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||n===void 0?void 0:n.checkoutSessionId;y=(l=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||l===void 0?void 0:l.landedCostId;if(!y){b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[2]}if(g){X("Setting checkout session id from cart reference","info",g);L.checkoutSessionId=g}else{X("Clear checkout session id from storage so we start from a fresh session for the collect cart");L.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:k=T.sent().shouldAllowOrder;if(!k){return[2]}T.label=2;case 2:T.trys.push([2,13,,14]);_=U(window.Zonos.cartData),C=_.adjustments,I=_.cartItems;return[4,v({adjustments:C,cartItems:I,landedCostId:y,shouldInitSessionOnFailure:false})];case 3:T.sent();if(!(!L.checkoutSessionId&&!g))return[3,5];return[4,w()];case 4:S=T.sent();X("stripeStoreInitCheckoutSession: ".concat(S));if(!S){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}T.label=5;case 5:if(!((!p.checkoutSession||((r=p.checkoutSession)===null||r===void 0?void 0:r.completedAt))&&g))return[3,7];return[4,this.recoverCompletedCollectSession(g)];case 6:j=T.sent();if(j){return[2]}void D({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:g,cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:y}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!p.checkoutSession){void D({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:g||"N/A",cartId:(d=window.Zonos.cartData)===null||d===void 0?void 0:d.id,cartLandedCostId:y||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}c.paymentProcessor=p.checkoutSession.paymentProcessor;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,x()];case 8:T.sent();if((h=p.checkoutSession)===null||h===void 0?void 0:h.clientSecret){i.clientSecret=p.checkoutSession.clientSecret;i.currency=p.currency}return[3,10];case 9:void x();T.label=10;case 10:E=(f=p.checkoutSession)===null||f===void 0?void 0:f.landedCost;if(!E){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,z(Object.assign(Object.assign({},p.checkoutSession),{id:L.checkoutSessionId||""}))];case 11:T.sent();void u({landedCostId:E.id});return[4,this.initPaymentProcessor()];case 12:T.sent();return[3,14];case 13:O=T.sent();R(O);b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[3,14];case 14:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:void((o=f.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=f.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=f.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){l=document.querySelector(".zonos--billing-address");l===null||l===void 0?void 0:l.scrollIntoView({behavior:"smooth"});return[2]}i=f.checkoutSettlementCurrency==="USD";if(i&&f.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;j.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;p.inventoryCheckErrorMessage=null;return[4,y()];case 1:r=d.sent();if(!r){f.hasPaymentError=true;f.customErrorMessage=A("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:f.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,h()];case 2:d.sent();d.label=3;case 3:d.trys.push([3,5,,6]);return[4,k({noLandedCostCheck:true})];case 4:d.sent();p.step="finish";this.confirmationId=c.landedCostShortId||((n=p.selectedLandedCost)===null||n===void 0?void 0:n.landedCostId)||null;return[2];case 5:a=d.sent();R(a);f.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;f.stripe=window.Zonos.stripe;p.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[_("clientSecret",(function(){void o.applyStripeTheme()})),E("selectedLocale",(function(){void o.applyStripeTheme()}))];X("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){C();I();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=f.clientSecret;if(f.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var l=P.appearance,i=l.logoUrl,r=l.theme;var a=c.originCompanyName;var d=function(){var o;var e=c.collectLogoUrl?c.collectLogoUrl:((o=P.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&i?"".concat(i,"?timestamp=").concat(Date.now()):"";if(!e){return null}return t("div",{class:"zonos--logo"},t("img",{alt:"".concat(a||P.organizationName," logo"),src:e}))};var z=B();var u=function(){var e;var n=new URLSearchParams(window.location.search);var l=n.get("zonosQaUrl");var i=n.get("zonosDebug");var r=(e=V.find((function(o){return o.code===T.selectedLocale})))===null||e===void 0?void 0:e.label;return t(s,null,t("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},t("div",{class:"zonos--logo-wrapper"},d(),z&&t("zonos-badge",{badgeColor:"orange",size:"small"},A("Test mode")),i==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&t("zonos-badge",{badgeColor:"purple",size:"small"},l)),t("div",{class:"zonos--header-right"},t("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,t("zonos-icon",{"aria-label":"Language select",content:q,iconColor:"gray-1200"})),t("div",{class:H(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),K({content:t("zonos-text",{class:"zonos--header-title",type:"header"},a?A("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:a}):A("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var h=function(){if(o.isOverlayLoading||f.isFetchingSession){return null}return t("div",{class:"zonos--content"},p.step!=="finish"&&p.step!=="error"&&t(s,null,(o.isMobile||o.isTablet)&&u(),t("div",{class:"zonos--left","data-theme":r},!o.isMobile&&!o.isTablet&&u(),c.paymentProcessor!=="AIRWALLEX"&&t(s,null,t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},A("Billing info")),t("zonos-v-stack",{spacing:16},t("zonos-link-authentication",{titleText:""}),t("zonos-address",{titleText:"",type:"billing"}))),t("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;p.step="finish";o.confirmationId=c.landedCostShortId||((e=p.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),t("div",{class:"zonos--right","data-theme":r},t("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),t("div",{class:"zonos--order-details-container"},t("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),t("div",{class:"flex--wrapper"},t("zonos-v-stack",{spacing:16},t("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet})))),(p.step==="finish"||p.step==="error")&&t("div",{class:"zonos--done","data-theme":r},t("div",{class:"zonos--header"},d()),t("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:p.step==="error"&&!!p.error?Object.assign(Object.assign({},p.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||p.step==="finish"||p.step==="error")&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet}))};return t(n,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":r},h(),e&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:A("Cancel"),dialogConfirmBtnText:A("Pay [orderTotal]",{orderTotal:O({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:A("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:A("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Q.style=M}}}));
1
+ var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,c){function l(o){try{r(n.next(o))}catch(o){c(o)}}function i(o){try{r(n["throw"](o))}catch(o){c(o)}}function r(o){o.done?t(o.value):s(o.value).then(l,i)}r((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(o){return function(e){return r([o,e])}}function r(i){if(n)throw new TypeError("Generator is already executing.");while(l&&(l=0,i[0]&&(t=0)),t)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:t.label++;return{value:i[1],done:false};case 5:t.label++;s=i[1];i=[0];continue;case 7:i=t.ops.pop();t.trys.pop();continue;default:if(!(c=t.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){t=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){t.label=i[1];break}if(i[0]===6&&t.label<c[1]){t.label=c[1];c=i;break}if(c&&t.label<c[2]){t.label=c[2];t.ops.push(i);break}if(c[2])t.ops.pop();t.trys.pop();continue}i=e.call(o,t)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-3980e553.system.js","./p-d1f2e532.system.js","./p-863cfab2.system.js","./p-d62dab88.system.js","./p-47a1d469.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-2adbbce7.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-45bd8072.system.js","./p-c9e433c0.system.js","./p-dab78981.system.js","./p-30e9a6d7.system.js","./p-d706852e.system.js","./p-e977562b.system.js"],(function(o){"use strict";var e,t,n,s,c,l,i,r,a,d,z,u,h,f,m,p,g,b,v,w,x,y,k,_,C,I,S,j,L,A,E,O,T,P,U,N,D,R,B,W,F,H,X,K,V;return{setters:[function(o){e=o.r;t=o.h;n=o.a;s=o.F},function(o){c=o.c;l=o.a;i=o.b;r=o.d;a=o.e;d=o.f;z=o.g;u=o.h;h=o.i},function(o){f=o.b;m=o.i;p=o.d;g=o.c;b=o.n;v=o.e;w=o.j;x=o.k;y=o.w;k=o.C;_=o.H;C=o.F;I=o.f},function(o){S=o.p;j=o.a},function(o){L=o.s;A=o.t;E=o.e;O=o.h;T=o.l},function(o){P=o.z},function(o){U=o.b},function(o){N=o.h;D=o.s;R=o.l;B=o.g},function(o){W=o.i;F=o.a},function(o){H=o.c},function(o){X=o.l},function(o){K=o.r},function(o){V=o.l},function(){},function(){},function(){},function(){}],execute:function(){var q='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var G=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var M=G;var Q=o("zonos_collect",function(){function o(o){var t=this;e(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=f.clientSecret;this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=p.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=P.appearance.theme;return[4,m({overrideTheme:this.isMobile?o:undefined,paypalEnabled:S()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,N("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,z;return __generator(this,(function(u){switch(u.label){case 0:e=L.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=u.sent();c.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!l(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}n=t.checkoutSession;i.currency=p.currency;this.confirmationId=((o=n.landedCost)===null||o===void 0?void 0:o.shortId)||null;s=!!n.completedAt||!!n.order;if(!(!s&&n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:z=u.sent().status;s=a(z);u.label=3;case 3:if(s){void this.setToFinishStep();return[2]}void d();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s,c,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;n=t.get("payment_intent_client_secret");s=t.get("zonosCheckoutSessionId");X("Payment intent exist, checking stripe payment intent status");if(!n){X("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,g({clientSecret:n})];case 1:c=d.sent(),l=c.error,i=c.status;r=new URLSearchParams(window.location.search).get("redirect_status");if(!(r&&s))return[3,3];if(!l){X("Payment intent is succeeded or in a good state to move forward, show success screen")}else{X("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;L.checkoutSessionId=s;f.clientSecret=n;void this.setToFinishStep(i);return[2,{shouldAllowOrder:false}];case 3:if(!e){X("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}X("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t,n,s,d,d;return __generator(this,(function(z){switch(z.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=z.sent();if(!t){return[2,false]}n=t.checkoutSession;this.confirmationId=((e=n.landedCost)===null||e===void 0?void 0:e.shortId)||null;c.paymentProcessor=n.paymentProcessor||null;s=n.paymentProcessor==="AIRWALLEX";if(s&&n.clientSecret){l(n);i.currency=p.currency}if(n.completedAt||n.order){void this.setToFinishStep("succeeded");return[2,true]}if(!s)return[3,4];if(!(n.clientSecret&&n.paymentIntentId))return[3,3];return[4,r(n.paymentIntentId)];case 2:d=z.sent().status;if(a(d)){void this.setToFinishStep();return[2,true]}z.label=3;case 3:return[3,6];case 4:if(!n.clientSecret)return[3,6];return[4,g({clientSecret:n.clientSecret})];case 5:d=z.sent().status;if(d==="processing"||d==="succeeded"){f.clientSecret=n.clientSecret;void this.setToFinishStep(d);return[2,true]}z.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=W(this.mobile);this.isTablet=F(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){f.stripe=window.Zonos.stripe;p.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,r,a,d,h,f,m,g,y,k,_,C,I,S,j,E,O;return __generator(this,(function(T){switch(T.label){case 0:if(!window.Zonos.cartData){return[2]}m=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(m){p.currency=m}g=(n=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||n===void 0?void 0:n.checkoutSessionId;y=(l=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||l===void 0?void 0:l.landedCostId;if(!y){b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[2]}if(g){X("Setting checkout session id from cart reference","info",g);L.checkoutSessionId=g}else{X("Clear checkout session id from storage so we start from a fresh session for the collect cart");L.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:k=T.sent().shouldAllowOrder;if(!k){return[2]}T.label=2;case 2:T.trys.push([2,13,,14]);_=U(window.Zonos.cartData),C=_.adjustments,I=_.cartItems;return[4,v({adjustments:C,cartItems:I,landedCostId:y,shouldInitSessionOnFailure:false})];case 3:T.sent();if(!(!L.checkoutSessionId&&!g))return[3,5];return[4,w()];case 4:S=T.sent();X("stripeStoreInitCheckoutSession: ".concat(S));if(!S){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}T.label=5;case 5:if(!((!p.checkoutSession||((r=p.checkoutSession)===null||r===void 0?void 0:r.completedAt))&&g))return[3,7];return[4,this.recoverCompletedCollectSession(g)];case 6:j=T.sent();if(j){return[2]}void D({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:g,cartId:(a=window.Zonos.cartData)===null||a===void 0?void 0:a.id,cartLandedCostId:y}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!p.checkoutSession){void D({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:g||"N/A",cartId:(d=window.Zonos.cartData)===null||d===void 0?void 0:d.id,cartLandedCostId:y||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}c.paymentProcessor=p.checkoutSession.paymentProcessor;if(!(c.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,x()];case 8:T.sent();if((h=p.checkoutSession)===null||h===void 0?void 0:h.clientSecret){i.clientSecret=p.checkoutSession.clientSecret;i.currency=p.currency}return[3,10];case 9:void x();T.label=10;case 10:E=(f=p.checkoutSession)===null||f===void 0?void 0:f.landedCost;if(!E){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,z(Object.assign(Object.assign({},p.checkoutSession),{id:L.checkoutSessionId||""}))];case 11:T.sent();void u({landedCostId:E.id});return[4,this.initPaymentProcessor()];case 12:T.sent();return[3,14];case 13:O=T.sent();R(O);b({messages:[A("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:P.organizationName})],title:A("Invalid session")});return[3,14];case 14:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,l,i,r,a;return __generator(this,(function(d){switch(d.label){case 0:void((o=f.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=f.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=f.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){l=document.querySelector(".zonos--billing-address");l===null||l===void 0?void 0:l.scrollIntoView({behavior:"smooth"});return[2]}i=f.checkoutSettlementCurrency==="USD";if(i&&f.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;j.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;p.inventoryCheckErrorMessage=null;return[4,y()];case 1:r=d.sent();if(!r){f.hasPaymentError=true;f.customErrorMessage=A("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:f.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,h()];case 2:d.sent();d.label=3;case 3:d.trys.push([3,5,,6]);return[4,k({noLandedCostCheck:true})];case 4:d.sent();p.step="finish";this.confirmationId=c.landedCostShortId||((n=p.selectedLandedCost)===null||n===void 0?void 0:n.landedCostId)||null;return[2];case 5:a=d.sent();R(a);f.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;f.stripe=window.Zonos.stripe;p.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[_("clientSecret",(function(){void o.applyStripeTheme()})),E("selectedLocale",(function(){void o.applyStripeTheme()}))];X("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){C();I();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=f.clientSecret;if(f.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=f.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var l=P.appearance,i=l.logoUrl,r=l.theme;var a=c.originCompanyName;var d=function(){var o;var e=c.collectLogoUrl?c.collectLogoUrl:((o=P.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&i?"".concat(i,"?timestamp=").concat(Date.now()):"";if(!e){return null}return t("div",{class:"zonos--logo"},t("img",{alt:"".concat(a||P.organizationName," logo"),src:e}))};var z=B();var u=function(){var e;var n=new URLSearchParams(window.location.search);var l=n.get("zonosQaUrl");var i=n.get("zonosDebug");var r=(e=V.find((function(o){return o.code===T.selectedLocale})))===null||e===void 0?void 0:e.label;return t(s,null,t("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},t("div",{class:"zonos--logo-wrapper"},d(),z&&t("zonos-badge",{badgeColor:"orange",size:"small"},A("Test mode")),i==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),l&&t("zonos-badge",{badgeColor:"purple",size:"small"},l)),t("div",{class:"zonos--header-right"},t("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,t("zonos-icon",{"aria-label":"Language select",content:q,iconColor:"gray-1200"})),t("div",{class:H(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),K({content:t("zonos-text",{class:"zonos--header-title",type:"header"},a?A("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:a}):A("Customs charges from your recent purchase are available for payment")),isLoading:c.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var h=function(){if(o.isOverlayLoading||f.isFetchingSession){return null}return t("div",{class:"zonos--content"},p.step!=="finish"&&p.step!=="error"&&t(s,null,(o.isMobile||o.isTablet)&&u(),t("div",{class:"zonos--left","data-theme":r},!o.isMobile&&!o.isTablet&&u(),c.paymentProcessor!=="AIRWALLEX"&&t(s,null,t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},A("Billing info")),t("zonos-v-stack",{spacing:16},t("zonos-link-authentication",{titleText:""}),t("zonos-address",{titleText:"",type:"billing"}))),t("zonos-collect-payment",{class:H(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;p.step="finish";o.confirmationId=c.landedCostShortId||((e=p.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),t("div",{class:"zonos--right","data-theme":r},t("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),t("div",{class:"zonos--order-details-container"},t("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),t("div",{class:"flex--wrapper"},t("zonos-v-stack",{spacing:16},t("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet})))),(p.step==="finish"||p.step==="error")&&t("div",{class:"zonos--done","data-theme":r},t("div",{class:"zonos--header"},d()),t("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:p.step==="error"&&!!p.error?Object.assign(Object.assign({},p.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||p.step==="finish"||p.step==="error")&&t("zonos-collect-footer",{"data-theme":r,mobile:o.isMobile,tablet:o.isTablet}))};return t(n,{class:H(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":r},h(),e&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:A("Cancel"),dialogConfirmBtnText:A("Pay [orderTotal]",{orderTotal:O({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:A("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:A("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());Q.style=M}}}));