@zonos/elements 1.3.6 → 1.3.7-alpha.1

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 (306) hide show
  1. package/dist/cjs/{localization-2c9f5765.js → cart-89d9fff4.js} +863 -89
  2. package/dist/cjs/formatStringWithLinks-52341fc7.js +17 -0
  3. package/dist/cjs/{getBorderRadius-b252096d.js → getBorderRadius-d8f18958.js} +1 -1
  4. package/dist/cjs/{isDarkColor-168002d6.js → isDarkColor-57860b44.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/submitGtag-24740560.js +55 -0
  7. package/dist/cjs/zonos-address_4.cjs.entry.js +36 -18
  8. package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
  9. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-button_3.cjs.entry.js +8 -8
  11. package/dist/cjs/zonos-card_2.cjs.entry.js +10 -8
  12. package/dist/cjs/zonos-cart-items_9.cjs.entry.js +66 -56
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +170 -34
  14. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-controller.cjs.entry.js +51 -32
  16. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -3
  17. package/dist/cjs/zonos-country-select_3.cjs.entry.js +21 -12
  18. package/dist/cjs/zonos-elements.cjs.js +1 -1
  19. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +23 -19
  20. package/dist/cjs/zonos-hello.cjs.entry.js +51 -34
  21. package/dist/cjs/zonos-link.cjs.entry.js +24 -0
  22. package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
  23. package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-payment.cjs.entry.js +5 -6
  25. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
  26. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  28. package/dist/cjs/{zonosStore-5d94dabb.js → zonosStore-138c5555.js} +9 -7
  29. package/dist/collection/collection-manifest.json +1 -0
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -6
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +27 -13
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +39 -18
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +5 -1
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -6
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -0
  39. package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +54 -0
  40. package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +97 -0
  41. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  42. package/dist/collection/components/common/zonos-button/zonos-button.css +2 -0
  43. package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
  44. package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
  45. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  46. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +26 -6
  47. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +8 -2
  48. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -2
  49. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  50. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  51. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  52. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  53. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
  54. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  55. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  56. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  57. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +50 -11
  58. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  59. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -3
  60. package/dist/collection/components/main/zonos-controller.js +1 -1
  61. package/dist/collection/components/store/checkout/cart.js +2 -2
  62. package/dist/collection/components/store/checkout/stripe.js +29 -4
  63. package/dist/collection/components/store/hello/localization.js +34 -7
  64. package/dist/collection/components/store/zonosStore.js +9 -7
  65. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  66. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  67. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  68. package/dist/collection/components/utils/api/trackConversionEvent.js +22 -0
  69. package/dist/collection/components/utils/checkout/isShippableCountry.js +15 -0
  70. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +111 -0
  71. package/dist/collection/components/utils/formatStringWithLinks.js +13 -0
  72. package/dist/collection/components/utils/handleFetch.js +1 -1
  73. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +25 -28
  74. package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +2 -1
  75. package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +8 -6
  76. package/dist/collection/components/utils/hello/initHello.js +23 -3
  77. package/dist/collection/components/utils/logging/log.js +20 -9
  78. package/dist/collection/components/utils/logging/logError.js +2 -1
  79. package/dist/collection/components/utils/logging/sendErrorLog.js +12 -0
  80. package/dist/collection/scripts/checkIfLoadVersionDomain.js +35 -0
  81. package/dist/collection/scripts/zonosBase.js +21 -31
  82. package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
  83. package/dist/collection/types/generated/graphql.customer.types.js +7 -4
  84. package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
  85. package/dist/components/stripe.js +4097 -7
  86. package/dist/components/submitGtag.js +1 -1
  87. package/dist/components/trackConversionEvent.js +24 -0
  88. package/dist/components/zonos-address2.js +2 -3
  89. package/dist/components/zonos-badge2.js +3 -3
  90. package/dist/components/zonos-button2.js +5 -5
  91. package/dist/components/zonos-card2.js +2 -2
  92. package/dist/components/zonos-cart-subtotal2.js +2 -8
  93. package/dist/components/zonos-checkbox2.js +3 -3
  94. package/dist/components/zonos-checkout-finish2.js +44 -16
  95. package/dist/components/zonos-checkout-footer2.js +1 -1
  96. package/dist/components/zonos-checkout-payment2.js +2 -3
  97. package/dist/components/zonos-checkout.js +157 -19
  98. package/dist/components/zonos-collapse2.js +26 -6
  99. package/dist/components/zonos-component.js +1 -1
  100. package/dist/components/zonos-controller.js +25 -6
  101. package/dist/components/zonos-country-flag2.js +1 -1
  102. package/dist/components/zonos-country-select2.js +9 -3
  103. package/dist/components/zonos-custom-message2.js +18 -3
  104. package/dist/components/zonos-customer-info2.js +4 -3
  105. package/dist/components/zonos-dialog2.js +3 -3
  106. package/dist/components/zonos-hello-dialog-footer2.js +3 -3
  107. package/dist/components/zonos-hello-dialog2.js +6 -5
  108. package/dist/components/zonos-hello.js +23 -7
  109. package/dist/components/zonos-language-select2.js +3 -3
  110. package/dist/components/zonos-link-authentication2.js +1 -1
  111. package/dist/components/zonos-link.d.ts +11 -0
  112. package/dist/components/zonos-link.js +43 -0
  113. package/dist/components/zonos-logo.js +2 -2
  114. package/dist/components/zonos-payment2.js +1 -1
  115. package/dist/components/zonos-review2.js +2 -8
  116. package/dist/components/zonos-select-dialog-header2.js +2 -2
  117. package/dist/components/zonos-shipping-rich-radio2.js +1 -1
  118. package/dist/components/zonos-shipping2.js +7 -3
  119. package/dist/components/zonos-tooltip2.js +2 -2
  120. package/dist/components/zonos-v-stack2.js +2 -2
  121. package/dist/components/zonosStore.js +9 -7
  122. package/dist/esm/{localization-d8f6453b.js → cart-1bbb7662.js} +846 -90
  123. package/dist/esm/formatStringWithLinks-9e819405.js +15 -0
  124. package/dist/esm/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
  125. package/dist/esm/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/esm/submitGtag-d3d11f1a.js +51 -0
  128. package/dist/esm/zonos-address_4.entry.js +33 -15
  129. package/dist/esm/zonos-badge_2.entry.js +6 -6
  130. package/dist/esm/zonos-banner.entry.js +1 -1
  131. package/dist/esm/zonos-button_3.entry.js +8 -8
  132. package/dist/esm/zonos-card_2.entry.js +8 -6
  133. package/dist/esm/zonos-cart-items_9.entry.js +47 -37
  134. package/dist/esm/zonos-checkout.entry.js +158 -22
  135. package/dist/esm/zonos-component.entry.js +1 -1
  136. package/dist/esm/zonos-controller.entry.js +28 -9
  137. package/dist/esm/zonos-country-flag.entry.js +4 -2
  138. package/dist/esm/zonos-country-select_3.entry.js +19 -10
  139. package/dist/esm/zonos-elements.js +1 -1
  140. package/dist/esm/zonos-hello-dialog.entry.js +9 -5
  141. package/dist/esm/zonos-hello.entry.js +24 -7
  142. package/dist/esm/zonos-link.entry.js +20 -0
  143. package/dist/esm/zonos-logo.entry.js +3 -3
  144. package/dist/esm/zonos-notification.entry.js +1 -1
  145. package/dist/esm/zonos-payment.entry.js +5 -6
  146. package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
  147. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  148. package/dist/esm/zonos-text.entry.js +1 -1
  149. package/dist/esm/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +9 -7
  150. package/dist/esm-es5/cart-1bbb7662.js +1 -0
  151. package/dist/esm-es5/formatStringWithLinks-9e819405.js +1 -0
  152. package/dist/esm-es5/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
  153. package/dist/esm-es5/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
  154. package/dist/esm-es5/loader.js +1 -1
  155. package/dist/esm-es5/submitGtag-d3d11f1a.js +1 -0
  156. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  157. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  158. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  159. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  160. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  161. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
  162. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  163. package/dist/esm-es5/zonos-component.entry.js +1 -1
  164. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  165. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  166. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  167. package/dist/esm-es5/zonos-elements.js +1 -1
  168. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  169. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  170. package/dist/esm-es5/zonos-link.entry.js +1 -0
  171. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  172. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  173. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  174. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  175. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  176. package/dist/esm-es5/zonos-text.entry.js +1 -1
  177. package/dist/esm-es5/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +1 -1
  178. package/dist/scripts/checkIfLoadVersionDomain.js +1 -0
  179. package/dist/scripts/loadStripe.js +1 -1
  180. package/dist/scripts/loadZonos.js +1 -1
  181. package/dist/scripts/stripe.js +1 -1
  182. package/dist/scripts/zonos.js +1 -1
  183. package/dist/scripts/zonosBase.js +1 -1
  184. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -1
  185. package/dist/types/components/common/component-template/zonos-link/zonos-link.d.ts +19 -0
  186. package/dist/types/components/common/zonos-collapse/zonos-collapse.d.ts +1 -0
  187. package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +2 -0
  188. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +9 -3
  189. package/dist/types/components/store/checkout/cart.d.ts +6 -3
  190. package/dist/types/components/store/checkout/stripe.d.ts +26 -1
  191. package/dist/types/components/store/hello/localization.d.ts +1 -1
  192. package/dist/types/components/store/zonosStore.d.ts +2 -1
  193. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  194. package/dist/types/components/utils/api/trackConversionEvent.d.ts +3 -0
  195. package/dist/types/components/utils/checkout/isShippableCountry.d.ts +1 -0
  196. package/dist/types/components/utils/checkout/watchBigcommerceDomesticCheckout.d.ts +20 -0
  197. package/dist/types/components/utils/formatStringWithLinks.d.ts +1 -0
  198. package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
  199. package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
  200. package/dist/types/components/utils/logging/log.d.ts +1 -1
  201. package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -0
  202. package/dist/types/components.d.ts +53 -3
  203. package/dist/types/scripts/checkIfLoadVersionDomain.d.ts +13 -0
  204. package/dist/types/scripts/zonosBase.d.ts +2 -0
  205. package/dist/types/types/ICountryJson.d.ts +2 -1
  206. package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
  207. package/dist/types/types/generated/graphql.customer.types.d.ts +23 -53
  208. package/dist/types/types/generated/graphql.customer.types.ts +42 -62
  209. package/dist/types/types/generated/graphql.frontend.types.d.ts +9 -1
  210. package/dist/types/types/generated/graphql.frontend.types.ts +19 -1
  211. package/dist/zonos-elements/p-0318632a.entry.js +1 -0
  212. package/dist/zonos-elements/p-066c5893.system.js +1 -1
  213. package/dist/zonos-elements/p-07966463.entry.js +1 -0
  214. package/dist/zonos-elements/p-0c0aa552.js +1 -0
  215. package/dist/zonos-elements/p-127b480c.entry.js +1 -0
  216. package/dist/zonos-elements/p-135ab559.system.entry.js +1 -0
  217. package/dist/zonos-elements/{p-b81a0577.system.entry.js → p-143dc0d9.system.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-32bca9c8.system.entry.js → p-14d27ce1.system.entry.js} +1 -1
  219. package/dist/zonos-elements/p-15a80c4a.entry.js +1 -0
  220. package/dist/zonos-elements/p-17e87be1.entry.js +1 -0
  221. package/dist/zonos-elements/{p-0c7480a5.entry.js → p-1e0dd491.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-a33745e9.entry.js → p-279d1c5f.entry.js} +1 -1
  223. package/dist/zonos-elements/p-2d6557ee.system.js +1 -0
  224. package/dist/zonos-elements/p-314be538.system.entry.js +1 -0
  225. package/dist/zonos-elements/{p-dd7729fd.system.entry.js → p-328b7f6f.system.entry.js} +1 -1
  226. package/dist/zonos-elements/p-354603b3.system.entry.js +1 -0
  227. package/dist/zonos-elements/{p-50287643.system.js → p-49f6a985.system.js} +1 -1
  228. package/dist/zonos-elements/p-57b65321.system.entry.js +1 -0
  229. package/dist/zonos-elements/p-58c1ddef.system.js +1 -0
  230. package/dist/zonos-elements/{p-06652d87.system.entry.js → p-58e2f6a1.system.entry.js} +1 -1
  231. package/dist/zonos-elements/p-5ee03db0.system.entry.js +1 -0
  232. package/dist/zonos-elements/{p-5a113c3d.system.entry.js → p-61e5cf29.system.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-49a764e9.system.entry.js → p-799d8a17.system.entry.js} +1 -1
  234. package/dist/zonos-elements/p-7a32526c.entry.js +1 -0
  235. package/dist/zonos-elements/p-7b87b82f.js +1 -0
  236. package/dist/zonos-elements/{p-9cbbf261.system.entry.js → p-7c45ce37.system.entry.js} +1 -1
  237. package/dist/zonos-elements/p-84f4f00f.entry.js +1 -0
  238. package/dist/zonos-elements/{p-e8a9bc56.entry.js → p-857cfe35.entry.js} +1 -1
  239. package/dist/zonos-elements/p-87e9c42f.entry.js +1 -0
  240. package/dist/zonos-elements/{p-e99d79d9.system.js → p-91797d4e.system.js} +1 -1
  241. package/dist/zonos-elements/{p-17550a10.js → p-95e0fc06.js} +1 -1
  242. package/dist/zonos-elements/{p-7a6144b1.entry.js → p-a3cc0f84.entry.js} +1 -1
  243. package/dist/zonos-elements/p-a5f12396.entry.js +1 -0
  244. package/dist/zonos-elements/p-a87561b8.js +1 -0
  245. package/dist/zonos-elements/{p-ba43275e.entry.js → p-ac0a7b8f.entry.js} +1 -1
  246. package/dist/zonos-elements/p-ae82a9ae.js +1 -0
  247. package/dist/zonos-elements/p-b0462325.system.entry.js +1 -0
  248. package/dist/zonos-elements/p-b2c0ec71.system.entry.js +1 -0
  249. package/dist/zonos-elements/{p-fcc4f140.system.js → p-b4725505.system.js} +1 -1
  250. package/dist/zonos-elements/p-bef54fb1.entry.js +1 -0
  251. package/dist/zonos-elements/p-c0d431f6.system.entry.js +1 -0
  252. package/dist/zonos-elements/p-d054788b.system.js +1 -0
  253. package/dist/zonos-elements/p-d407c93a.system.entry.js +1 -0
  254. package/dist/zonos-elements/p-e55dd932.js +1 -0
  255. package/dist/zonos-elements/p-ec37439e.entry.js +1 -0
  256. package/dist/zonos-elements/p-edace42b.entry.js +1 -0
  257. package/dist/zonos-elements/p-f478c814.system.entry.js +1 -0
  258. package/dist/zonos-elements/{p-7dd8e8ba.system.entry.js → p-f6eaef7b.system.entry.js} +1 -1
  259. package/dist/zonos-elements/{p-bd6a2095.entry.js → p-f7c36fcc.entry.js} +1 -1
  260. package/dist/zonos-elements/p-f862b97f.system.entry.js +1 -0
  261. package/dist/zonos-elements/p-fd642725.entry.js +1 -0
  262. package/dist/zonos-elements/p-fdb72530.system.entry.js +1 -0
  263. package/dist/zonos-elements/{p-a4de3fb2.entry.js → p-ff64ddc5.entry.js} +1 -1
  264. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  265. package/package.json +1 -1
  266. package/dist/cjs/cart-b8bbf22d.js +0 -698
  267. package/dist/cjs/submitGtag-792fe45d.js +0 -21
  268. package/dist/collection/scripts/extractZonosQaUrl.js +0 -26
  269. package/dist/components/localization.js +0 -4016
  270. package/dist/esm/cart-bc3bb22e.js +0 -682
  271. package/dist/esm/submitGtag-bebe2cb0.js +0 -19
  272. package/dist/esm-es5/cart-bc3bb22e.js +0 -1
  273. package/dist/esm-es5/localization-d8f6453b.js +0 -1
  274. package/dist/esm-es5/submitGtag-bebe2cb0.js +0 -1
  275. package/dist/types/scripts/extractZonosQaUrl.d.ts +0 -11
  276. package/dist/zonos-elements/p-00d63df1.system.entry.js +0 -1
  277. package/dist/zonos-elements/p-04f63cea.entry.js +0 -1
  278. package/dist/zonos-elements/p-16b74c31.system.js +0 -1
  279. package/dist/zonos-elements/p-1d16a6fb.js +0 -1
  280. package/dist/zonos-elements/p-1ea68e3b.entry.js +0 -1
  281. package/dist/zonos-elements/p-1ed530cc.entry.js +0 -1
  282. package/dist/zonos-elements/p-289c8b1a.system.entry.js +0 -1
  283. package/dist/zonos-elements/p-2a00c270.system.entry.js +0 -1
  284. package/dist/zonos-elements/p-37f53a79.entry.js +0 -1
  285. package/dist/zonos-elements/p-394cf1cf.js +0 -1
  286. package/dist/zonos-elements/p-3ef27745.js +0 -1
  287. package/dist/zonos-elements/p-458fd100.system.entry.js +0 -1
  288. package/dist/zonos-elements/p-47fac33f.js +0 -1
  289. package/dist/zonos-elements/p-4fafb2a5.system.entry.js +0 -1
  290. package/dist/zonos-elements/p-4fb71a93.js +0 -1
  291. package/dist/zonos-elements/p-5276c61b.system.entry.js +0 -1
  292. package/dist/zonos-elements/p-6308b347.entry.js +0 -1
  293. package/dist/zonos-elements/p-63d1b1fe.entry.js +0 -1
  294. package/dist/zonos-elements/p-7347ee7c.system.entry.js +0 -1
  295. package/dist/zonos-elements/p-8c26a080.system.js +0 -1
  296. package/dist/zonos-elements/p-96aabe02.entry.js +0 -1
  297. package/dist/zonos-elements/p-a682fd38.system.entry.js +0 -1
  298. package/dist/zonos-elements/p-ba1a111a.system.entry.js +0 -1
  299. package/dist/zonos-elements/p-c4321084.system.entry.js +0 -1
  300. package/dist/zonos-elements/p-cdf114a2.entry.js +0 -1
  301. package/dist/zonos-elements/p-d5ae3cbb.system.entry.js +0 -1
  302. package/dist/zonos-elements/p-d5d7c8f5.entry.js +0 -1
  303. package/dist/zonos-elements/p-de339fb6.entry.js +0 -1
  304. package/dist/zonos-elements/p-ec25f180.entry.js +0 -1
  305. package/dist/zonos-elements/p-f49dfd06.system.js +0 -1
  306. package/dist/zonos-elements/p-f6f5f644.entry.js +0 -1
@@ -1,11 +1,10 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-b5be4dc3.js';
2
- import { c as cartStore, s as stripeStore, l as stripeStoreRetrievePayment, j as stripeStoreReset, m as cartStoreUpdateSelectedShippingOption, n as cartStoreGetShippingTransitInfo } from './cart-bc3bb22e.js';
3
- import { t as translate, h as handleFetch, l as localizationStore } from './localization-d8f6453b.js';
4
- import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-e6c7be3a.js';
5
- import { g as getBorderRadius } from './getBorderRadius-e9736f7e.js';
6
- import { s as submitGtag } from './submitGtag-bebe2cb0.js';
2
+ import { f as cartStore, t as translate, u as handleFetch, q as stripeStoreReset, j as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as cartStoreUpdateSelectedShippingOption, F as cartStoreGetShippingTransitInfo } from './cart-1bbb7662.js';
3
+ import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-00bce01b.js';
4
+ import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag } from './submitGtag-d3d11f1a.js';
5
+ import { g as getBorderRadius } from './getBorderRadius-19787feb.js';
7
6
  import { c as classes } from './classes-0d95c529.js';
8
- import { i as isDarkColor } from './isDarkColor-e982fa09.js';
7
+ import { i as isDarkColor } from './isDarkColor-2344e7a5.js';
9
8
  import { l as languages } from './ILanguage-97790bee.js';
10
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
11
10
 
@@ -61,7 +60,6 @@ const ZonosCartSubtotal = class {
61
60
  registerInstance(this, hostRef);
62
61
  }
63
62
  render() {
64
- const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;
65
63
  const showDutyTaxesInfo = cartStore.step === 'payment' || cartStore.step === 'shipping';
66
64
  const renderShippingInfo = () => {
67
65
  if (!cartStore.selectedShippingOption) {
@@ -83,11 +81,7 @@ const ZonosCartSubtotal = class {
83
81
  currency: cartStore.currency,
84
82
  })
85
83
  : '-', cartStore.isSelectedShippingGuarantee && (h("zonos-badge", null, translate('Guaranteed'))))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
86
- amount:
87
- // show total without taxes when step is shipping, show total with taxes when step is payment
88
- cartStore.step === 'shipping'
89
- ? totalWithoutTaxes
90
- : cartStore.total,
84
+ amount: cartStore.total,
91
85
  currency: cartStore.currency,
92
86
  })))))));
93
87
  }
@@ -121,25 +115,34 @@ const ZonosCheckoutFinish = class {
121
115
  this.handleSuccessBehavior = (orderId) => {
122
116
  const { successBehavior } = zonosStore.checkoutSettings;
123
117
  switch (successBehavior) {
124
- case 'REDIRECT_TO_SUCCESS_PAGE':
118
+ case 'REDIRECT_TO_SUCCESS_PAGE': {
125
119
  const redirectUrl = zonosStore.checkoutSettings.successRedirectUrl;
126
120
  if (redirectUrl) {
121
+ // reset store and checkout session id before redirecting
122
+ stripeStoreReset();
123
+ cartStore.checkoutSessionId = null;
127
124
  window.location.href = `${redirectUrl}?zOrderNumber=${orderId}`;
128
125
  }
129
126
  // If no redirect URL, break and display Zonos success page
130
127
  break;
128
+ }
131
129
  case 'CLOSE_MODAL':
132
130
  this.closeClickHandler();
133
131
  break;
132
+ case 'ZONOS_SUCCESS_PAGE':
133
+ default:
134
+ // Do nothing, display Zonos success page
135
+ this.isLoading = false;
136
+ break;
134
137
  }
135
138
  };
136
139
  // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
137
140
  this.getPullOrder = async (attempts = 0) => {
138
141
  const order = await this.pullOrder();
139
142
  if (order) {
143
+ void trackConversionEvent('checkout_orderCompleted');
140
144
  this.order = order;
141
145
  this.handleSuccessBehavior(order.id);
142
- this.isLoading = false;
143
146
  }
144
147
  else if (!order && attempts < 5) {
145
148
  // Wait for 1 second before the next attempt
@@ -149,18 +152,16 @@ const ZonosCheckoutFinish = class {
149
152
  else {
150
153
  // Set loading to false to display generic success page and log error
151
154
  this.isLoading = false;
152
- const errorObject = {
153
- endpoint: `${"https://v1.route.js.zonos.com"}/api/zonos-elements/get-order`,
155
+ const baseUrl = "https://v1.route.js.zonos.com";
156
+ const checkoutSessionId = cartStore.checkoutSessionId;
157
+ void sendErrorLog({
158
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
154
159
  errors: ['Order not found after multiple attempts'],
155
160
  metadata: {
156
161
  checkoutSessionId: cartStore.checkoutSessionId || '',
157
162
  domain: window.location.hostname,
158
163
  storeId: zonosStore.storeId,
159
164
  },
160
- };
161
- void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
162
- body: errorObject,
163
- method: 'POST',
164
165
  });
165
166
  }
166
167
  };
@@ -168,7 +169,7 @@ const ZonosCheckoutFinish = class {
168
169
  this.isLoading = true;
169
170
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
170
171
  if (clientSecret || this.storybookForceStatus) {
171
- const { error, messages } = await stripeStoreRetrievePayment({
172
+ const { error, messages, paymentMethod } = await stripeStoreRetrievePayment({
172
173
  clientSecret,
173
174
  storybookForceStatus: this.storybookForceStatus,
174
175
  });
@@ -182,6 +183,9 @@ const ZonosCheckoutFinish = class {
182
183
  }
183
184
  else {
184
185
  submitGtag('zonos-checkout-success');
186
+ void trackConversionEvent('checkout_paymentInfoCompleted', {
187
+ paymentMethod,
188
+ });
185
189
  const successEvent = new CustomEvent('zonos-checkout-success', {
186
190
  detail: {
187
191
  message: 'Zonos Checkout successfully processed order',
@@ -191,12 +195,18 @@ const ZonosCheckoutFinish = class {
191
195
  }
192
196
  // Attempt to pull the order details from the graph every second on 5 attempts
193
197
  if (this.notificationType === 'success') {
194
- this.isLoading = true;
195
- void this.getPullOrder();
198
+ // wait this to finish before resetting store and checkout session id
199
+ await this.getPullOrder();
200
+ }
201
+ else {
202
+ this.isLoading = false;
196
203
  }
197
204
  }
205
+ else {
206
+ this.isLoading = false;
207
+ }
198
208
  stripeStoreReset();
199
- this.isLoading = false;
209
+ cartStore.checkoutSessionId = null;
200
210
  };
201
211
  this.closeClickHandler = () => {
202
212
  this.closeClick.emit();
@@ -229,7 +239,7 @@ const ZonosCheckoutFinish = class {
229
239
  // const totalItems = this.order?.items?.reduce((acc, item) => {
230
240
  // return acc + item.quantity;
231
241
  // }, 0);
232
- return (h(Host, { key: '9a09eb68e5e6d256f72798bb5119ad1ff467fd70', class: "zonos--checkout-finish zonos--elements", style: {
242
+ return (h(Host, { key: 'fe08bfd0c0b60f4dce1aa9a6f3ba273dccd70a92', class: "zonos--checkout-finish zonos--elements", style: {
233
243
  '--border-radius': getBorderRadius(this.borderRadius),
234
244
  } }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h(Fragment, null, h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon$1, iconColor: 'red-800', size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping')))))));
235
245
  }
@@ -279,7 +289,7 @@ const ZonosCheckoutFooter = class {
279
289
  };
280
290
  ZonosCheckoutFooter.style = ZonosCheckoutFooterStyle0;
281
291
 
282
- const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}";
292
+ const zonosCheckoutPaymentCss = ".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h zonos-button.sc-zonos-checkout-payment{-webkit-box-shadow:0 0 1px 0 var(--amino-gray-600);box-shadow:0 0 1px 0 var(--amino-gray-600)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}";
283
293
  const ZonosCheckoutPaymentStyle0 = zonosCheckoutPaymentCss;
284
294
 
285
295
  const ZonosCheckoutPayment = class {
@@ -323,7 +333,7 @@ const ZonosCheckoutPayment = class {
323
333
  };
324
334
  ZonosCheckoutPayment.style = ZonosCheckoutPaymentStyle0;
325
335
 
326
- const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";
336
+ const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-webkit-box-shadow:0 0 1px 0 var(--amino-gray-600);box-shadow:0 0 1px 0 var(--amino-gray-600)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-5px;padding-top:var(--amino-space-8);margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";
327
337
  const ZonosCustomerInfoStyle0 = zonosCustomerInfoCss;
328
338
 
329
339
  const ZonosCustomerInfo = class {
@@ -346,6 +356,7 @@ const ZonosCustomerInfo = class {
346
356
  if (!this.disabled) {
347
357
  // submit google tag when the form is complete
348
358
  submitGtag('zonos-checkout-customer-info');
359
+ void trackConversionEvent('checkout_customerInfoCompleted');
349
360
  }
350
361
  }
351
362
  render() {
@@ -425,7 +436,7 @@ const ZonosDialog = class {
425
436
  document.body.style.overflow = 'auto';
426
437
  }
427
438
  const borderStyle = getBorderRadius(this.borderStyle);
428
- return (h(Host, { key: 'dd232b16db7f6a6216f91af19c8b735b7eb528c7', class: classes([
439
+ return (h(Host, { key: '3927d9cf0ebbd8b497a0ec42328c4392925d198a', class: classes([
429
440
  'zonos--elements',
430
441
  this.open && 'open',
431
442
  this.isLoading && 'is-loading',
@@ -436,10 +447,10 @@ const ZonosDialog = class {
436
447
  '--font-family': zonosStoreFontFamily(),
437
448
  '--height': this.height || 'initial',
438
449
  '--width': this.width,
439
- } }, h("div", { key: '23751fcbfe7a51856589d45feb59ed51ca3f86fa', class: "zonos--backdrop" }), h("div", { key: '3f5af0c470ad69e68b978753ece8d2687c99ab7c', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'e137a76e1a3e2cfc6403628fe804eb23d1bb1282', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: '46e89cdfaffd1190f4916206deb452002f40f24f', class: classes([
450
+ } }, h("div", { key: 'df93af61bfd856db3a572cdb98f60a8dd5c5bb7d', class: "zonos--backdrop" }), h("div", { key: 'f306feb4858dff642fbfd731e5aad849a8f29941', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'b914ea2e54fb2af825008ae28e235c461dce67e9', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: '19219c0c8d167bbacec992ba10b1fe0f31a8b8f6', class: classes([
440
451
  'zonos--body',
441
452
  this.noBodyPadding && 'zonos--no-body-padding',
442
- ]) }, h("slot", { key: 'e8acb4a5e48ad4a0aeb057799f5abeb56eb8d1ea' })), this.footerRightAction && (h("div", { class: "zonos--footer" }, h("div", { class: "zonos--footer-right-action" }, this.footerRightAction)))))));
453
+ ]) }, h("slot", { key: '38f9b83418dacd47cc2395f253a32ff0a6723d54' })), this.footerRightAction && (h("div", { class: "zonos--footer" }, h("div", { class: "zonos--footer-right-action" }, this.footerRightAction)))))));
443
454
  }
444
455
  static get assetsDirs() { return ["assets"]; }
445
456
  };
@@ -471,7 +482,6 @@ const ZonosReview = class {
471
482
  ? 'boldSubheader'
472
483
  : 'secondaryPageHeader';
473
484
  const titleTextColor = this.isMobile ? 'gray-1200' : 'gray-800';
474
- const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;
475
485
  const renderCollapseIcon = () => {
476
486
  // only display the collapse icon if the component is being rendered with mobile styles
477
487
  if (!this.isMobile) {
@@ -486,11 +496,7 @@ const ZonosReview = class {
486
496
  'zonos--review zonos--elements',
487
497
  this.isMobile && 'mobile',
488
498
  ]) }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: titleTextColor, type: titleTextType }, translate('Pay'), " ", zonosStore.organizationName), renderCollapseIcon()), h("div", { class: "zonos--total-pay" }, h("zonos-text", { type: totalTextType }, formatCurrency({
489
- amount:
490
- // show total without taxes when step is shipping, show total with taxes when step is payment
491
- cartStore.step === 'shipping'
492
- ? totalWithoutTaxes
493
- : cartStore.total,
499
+ amount: cartStore.total,
494
500
  currency: cartStore.currency,
495
501
  })))));
496
502
  }
@@ -498,7 +504,7 @@ const ZonosReview = class {
498
504
  };
499
505
  ZonosReview.style = ZonosReviewStyle0;
500
506
 
501
- const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";
507
+ const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--amino-gray-600);box-shadow:0 0 1px 0 var(--amino-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";
502
508
  const ZonosShippingStyle0 = zonosShippingCss;
503
509
 
504
510
  const ZonosShipping = class {
@@ -535,9 +541,13 @@ const ZonosShipping = class {
535
541
  this.disabled = true;
536
542
  }
537
543
  watchFormComplete() {
544
+ var _a;
538
545
  if (!this.disabled) {
539
546
  // submit google tag when the form is complete
540
547
  submitGtag('zonos-checkout-shipping-info');
548
+ void trackConversionEvent('checkout_shippingInfoCompleted', {
549
+ serviceLevelId: (_a = this.selectedShippingMethod) === null || _a === void 0 ? void 0 : _a.value,
550
+ });
541
551
  }
542
552
  }
543
553
  render() {
@@ -1,12 +1,131 @@
1
1
  import { r as registerInstance, h, F as Fragment, H as Host } from './index-b5be4dc3.js';
2
- import { i as initStripeElements, c as cartStore, a as cartStoreUpdateItems, b as cartStoreReset, s as stripeStore, d as stripeStoreInitCheckoutSession, e as cartStoreUpdateToErrorState, f as stripeStorePrefetchLandedCost, g as cartStoreNextStep, h as stripeStoreConfirmPayment, j as stripeStoreReset, k as cartStorePreviousStep } from './cart-bc3bb22e.js';
3
- import { l as localizationStore, a as log, t as translate } from './localization-d8f6453b.js';
4
- import { z as zonosStore, m as mergeConfig } from './zonosStore-e6c7be3a.js';
2
+ import { l as localizationStore, a as log, s as stripeStoreGetDomesticShippingSession, b as localizationStoreUpdateSelectedCountryCode, c as stripeStoreCleanupDomesticShippingSession, d as logError, e as stripeStoreSaveDomesticShippingSession, i as initStripeElements, f as cartStore, g as cartStoreUpdateItems, h as cartStoreReset, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset, r as cartStorePreviousStep, t as translate } from './cart-1bbb7662.js';
3
+ import { z as zonosStore, m as mergeConfig } from './zonosStore-00bce01b.js';
4
+ import { s as sendErrorLog, a as submitGtag, t as trackConversionEvent } from './submitGtag-d3d11f1a.js';
5
5
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
7
- import { g as getBorderRadius } from './getBorderRadius-e9736f7e.js';
8
- import { i as isDarkColor } from './isDarkColor-e982fa09.js';
9
- import { s as submitGtag } from './submitGtag-bebe2cb0.js';
7
+ import { g as getBorderRadius } from './getBorderRadius-19787feb.js';
8
+ import { i as isDarkColor } from './isDarkColor-2344e7a5.js';
9
+
10
+ const isShippableCountry = (showLog = true) => {
11
+ if (!localizationStore.localizationLoaded) {
12
+ return false;
13
+ }
14
+ // if localization is loaded and the localization is not a shippable country, keep the original click event
15
+ if (!localizationStore.isShippableCountry) {
16
+ if (showLog) {
17
+ log(`Checkout: not shippable country`);
18
+ }
19
+ return false;
20
+ }
21
+ return true;
22
+ };
23
+
24
+ /**
25
+ * Watch for changes in domestic checkout step, this is to redirect user to home page and open checkout if user enters the ship to country that's in the shipping zone
26
+ * @note Only works on default bigcommerce checkout page
27
+ */
28
+ const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShippingAddressSessionFound, }) => {
29
+ if (!window.Zonos.isBigCommerce) {
30
+ return;
31
+ }
32
+ const observer = new MutationObserver(async () => {
33
+ const domesticRedirectedButton = document.querySelector(domesticRedirectedBtnSelector);
34
+ const shippingAddressSession = stripeStoreGetDomesticShippingSession();
35
+ // append a hidden button to the body if the shipping address session is found
36
+ if (!domesticRedirectedButton && shippingAddressSession) {
37
+ // create a hidden button to trigger the click event
38
+ const button = document.createElement('button');
39
+ button.style.display = 'none';
40
+ button.id = 'zonos--domestic-redirected-checkout-button';
41
+ document.body.appendChild(button);
42
+ onShippingAddressSessionFound === null || onShippingAddressSessionFound === void 0 ? void 0 : onShippingAddressSessionFound(shippingAddressSession);
43
+ // disconnect the observer after we found the shipping continue button
44
+ observer.disconnect();
45
+ return;
46
+ }
47
+ const shipToCountryElement = document.querySelector('select[name="shippingAddress.countryCode"]');
48
+ // make sure the continue button is available
49
+ const shippingCountinueBtnEle = document.querySelector('#checkout-shipping-continue');
50
+ if (!shipToCountryElement || !shippingCountinueBtnEle) {
51
+ // do nothing if shipping country and the continue button is not found
52
+ return;
53
+ }
54
+ // disconnect the observer after we found the shipping continue button
55
+ observer.disconnect();
56
+ shippingCountinueBtnEle.addEventListener('click', async (e) => {
57
+ var _a, _b;
58
+ const shippingCountry = shipToCountryElement.value;
59
+ if (!shippingCountry) {
60
+ // do nothing if shipping country is not found
61
+ return;
62
+ }
63
+ // update the country code in localization store and check if it's shippable
64
+ localizationStoreUpdateSelectedCountryCode(shippingCountry);
65
+ // do nothing if the country is still domestic
66
+ if (!isShippableCountry(false)) {
67
+ // cleanup the domestic shipping session if it's domestic because we will open the intl checkout after redirecting
68
+ stripeStoreCleanupDomesticShippingSession();
69
+ return;
70
+ }
71
+ // get value of shipping address state
72
+ const shipToFormElement = document.querySelector('form');
73
+ if (!shipToFormElement) {
74
+ return;
75
+ }
76
+ const formData = new FormData(shipToFormElement);
77
+ const shipAddress1Element = document.querySelector('input#addressLine1Input');
78
+ const shippingAddress = {
79
+ address1: (_a = formData.get('shippingAddress.address1')) !== null && _a !== void 0 ? _a :
80
+ // in Canada, the address1 is not included in the form, try to get value from input id instead.
81
+ (shipAddress1Element && shipAddress1Element.value),
82
+ address2: formData.get('shippingAddress.address2'),
83
+ city: formData.get('shippingAddress.city'),
84
+ countryCode: formData.get('shippingAddress.countryCode'),
85
+ firstName: formData.get('shippingAddress.firstName'),
86
+ lastName: formData.get('shippingAddress.lastName'),
87
+ phone: formData.get('shippingAddress.phone'),
88
+ postalCode: formData.get('shippingAddress.postalCode'),
89
+ stateOrProvince: (_b = formData.get('shippingAddress.stateOrProvince')) !== null && _b !== void 0 ? _b : formData.get('shippingAddress.stateOrProvinceCode'),
90
+ };
91
+ if (Object.values(shippingAddress).some(value => value === undefined || value === null)) {
92
+ logError('One or more shipping address field is missing', Object.entries(shippingAddress));
93
+ void sendErrorLog({
94
+ endpoint: 'No endpoint, domestic checkout form missing fields',
95
+ errors: [
96
+ 'Bigcommerce: One or more shipping address field is missing in the domestic checkout form',
97
+ JSON.stringify(Object.entries(shippingAddress)),
98
+ ],
99
+ metadata: {
100
+ domain: window.location.hostname,
101
+ storeId: zonosStore.storeId,
102
+ },
103
+ });
104
+ return;
105
+ }
106
+ // save the shipping address to session storage
107
+ stripeStoreSaveDomesticShippingSession({
108
+ address1: shippingAddress.address1,
109
+ address2: shippingAddress.address2,
110
+ city: shippingAddress.city,
111
+ countryCode: shippingAddress.countryCode,
112
+ firstName: shippingAddress.firstName,
113
+ lastName: shippingAddress.lastName,
114
+ phone: shippingAddress.phone,
115
+ postalCode: shippingAddress.postalCode,
116
+ state: shippingAddress.stateOrProvince,
117
+ });
118
+ e.preventDefault();
119
+ e.stopPropagation();
120
+ // redirect to home page, home page then will open the checkout dialog if having domestic shipping session
121
+ window.location.href = '/';
122
+ });
123
+ });
124
+ observer.observe(document.body, {
125
+ childList: true,
126
+ subtree: true,
127
+ });
128
+ };
10
129
 
11
130
  const LeftArrow = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
12
131
 
@@ -34,19 +153,6 @@ const ZonosCheckout = class {
34
153
  overrideTheme: this.isMobile ? theme : undefined,
35
154
  });
36
155
  };
37
- this.isShippableCountry = (showLog = true) => {
38
- if (!localizationStore.localizationLoaded) {
39
- return false;
40
- }
41
- // if localization is loaded and the localization is not a shippable country, keep the original click event
42
- if (!localizationStore.isShippableCountry) {
43
- if (showLog) {
44
- log(`Checkout: not shippable country`);
45
- }
46
- return false;
47
- }
48
- return true;
49
- };
50
156
  this.getCurrentLocalePageEnum = () => {
51
157
  switch (cartStore.step) {
52
158
  case 'customer-info':
@@ -73,6 +179,7 @@ const ZonosCheckout = class {
73
179
  this.isMobile = false;
74
180
  this.zonosReviewRef = undefined;
75
181
  this.storybookPaymentStatusOverride = undefined;
182
+ this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
76
183
  }
77
184
  /**
78
185
  * Init cart info handler event
@@ -118,7 +225,8 @@ const ZonosCheckout = class {
118
225
  // do nothing if button element is not found
119
226
  return;
120
227
  }
121
- const buttonAnchorElements = document.querySelectorAll(buttonAnchorSelector);
228
+ // also attach event to hidden button if user was redirected with shipping address session
229
+ const buttonAnchorElements = document.querySelectorAll(`${buttonAnchorSelector}, ${this.domesticRedirectedBtnSelector}`);
122
230
  // only attach event once, and looping through all of the button elements
123
231
  buttonAnchorElements.forEach(button => {
124
232
  const isEventAttached = button.getAttribute('data-zonos-checkout-attached');
@@ -128,7 +236,7 @@ const ZonosCheckout = class {
128
236
  }
129
237
  button.addEventListener('click', async (e) => {
130
238
  // do nothing if it's not shippable country
131
- if (!this.isShippableCountry()) {
239
+ if (!isShippableCountry()) {
132
240
  return;
133
241
  }
134
242
  e.preventDefault();
@@ -144,6 +252,7 @@ const ZonosCheckout = class {
144
252
  throw new Error('Error building cart');
145
253
  }
146
254
  submitGtag('zonos-checkout-start');
255
+ void trackConversionEvent('checkout_open');
147
256
  }
148
257
  catch (err) {
149
258
  // stop loading
@@ -158,6 +267,14 @@ const ZonosCheckout = class {
158
267
  });
159
268
  button.removeAttribute('disabled');
160
269
  button.setAttribute('data-zonos-checkout-attached', 'true');
270
+ // if this button is the hidden button, trigger the click event
271
+ if (button.matches(this.domesticRedirectedBtnSelector)) {
272
+ button.dispatchEvent(new CustomEvent('click'));
273
+ // cleanup shipping session after button is clicked
274
+ stripeStoreCleanupDomesticShippingSession();
275
+ // remove the button after it's clicked
276
+ button.remove();
277
+ }
161
278
  });
162
279
  }
163
280
  appearanceSettingsOverrideChanged() {
@@ -173,6 +290,25 @@ const ZonosCheckout = class {
173
290
  async init() {
174
291
  stripeStore.stripe = window.Zonos.stripe;
175
292
  this.stripe = window.Zonos.stripe;
293
+ // check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
294
+ watchBigcommerceDomesticCheckout({
295
+ domesticRedirectedBtnSelector: this.domesticRedirectedBtnSelector,
296
+ onShippingAddressSessionFound: shippingAddressSession => {
297
+ // prefilled the default address if shipping address session is found for checkout on open
298
+ this.defaultAddress = {
299
+ address: {
300
+ city: shippingAddressSession.city,
301
+ country: shippingAddressSession.countryCode,
302
+ line1: shippingAddressSession.address1,
303
+ line2: shippingAddressSession.address2,
304
+ postal_code: shippingAddressSession.postalCode,
305
+ state: shippingAddressSession.state,
306
+ },
307
+ name: `${shippingAddressSession.firstName} ${shippingAddressSession.lastName}`,
308
+ phone: shippingAddressSession.phone,
309
+ };
310
+ },
311
+ });
176
312
  const hideInternationalOrderInterval = setInterval(() => {
177
313
  const internationalSelector = window.Zonos.internationalHideSelector;
178
314
  if (!internationalSelector) {
@@ -181,7 +317,7 @@ const ZonosCheckout = class {
181
317
  return;
182
318
  }
183
319
  // hide the selector if it's international
184
- const isInternationalOrder = this.isShippableCountry(false);
320
+ const isInternationalOrder = isShippableCountry(false);
185
321
  const selector = document.querySelectorAll(internationalSelector);
186
322
  if (!isInternationalOrder) {
187
323
  // show the selector when it's domestic
@@ -18,7 +18,7 @@ const ZonosComponent = class {
18
18
  return format(this.first, this.middle, this.last);
19
19
  }
20
20
  render() {
21
- return h("div", { key: 'cf376a9b1970bd04cdadf820112c081666c8bef2' }, "Hello, World! I'm ", this.getText());
21
+ return h("div", { key: '3b7429a0c03b00f0a80e15a94bebd08aedaafe51' }, "Hello, World! I'm ", this.getText());
22
22
  }
23
23
  };
24
24
  ZonosComponent.style = ZonosComponentStyle0;
@@ -1,9 +1,8 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-b5be4dc3.js';
2
- import { s as stripeStore } from './cart-bc3bb22e.js';
3
- import { h as handleFetch, b as logError, i as isValidSelector, a as log, c as initLocalizationStore, d as localizationStoreUpdateSelectedCountryCode } from './localization-d8f6453b.js';
4
- import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-e6c7be3a.js';
5
- import './isDarkColor-e982fa09.js';
6
- import './getBorderRadius-e9736f7e.js';
2
+ import { u as handleFetch, d as logError, v as isValidSelector, a as log, j as stripeStore, w as initLocalizationStore, b as localizationStoreUpdateSelectedCountryCode } from './cart-1bbb7662.js';
3
+ import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-00bce01b.js';
4
+ import './isDarkColor-2344e7a5.js';
5
+ import './getBorderRadius-19787feb.js';
7
6
 
8
7
  const getZonosSettings = async () => {
9
8
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
@@ -36,13 +35,16 @@ const initCheckout = (config) => {
36
35
  injectCheckoutElement();
37
36
  };
38
37
 
39
- const injectHelloComponent = (triggerAnchorElement) => {
38
+ const injectHelloComponent = (anchorElementSelector) => {
39
+ const triggerAnchorElement = document.querySelector(anchorElementSelector);
40
40
  // append checkout component if doesn't exist
41
41
  const helloElement = document.querySelector('zonos-hello');
42
42
  if (!helloElement && triggerAnchorElement) {
43
43
  const newHelloElement = document.createElement('zonos-hello');
44
44
  triggerAnchorElement.appendChild(newHelloElement);
45
+ return true;
45
46
  }
47
+ return false;
46
48
  };
47
49
  const initHello = async (helloSettings) => {
48
50
  const { anchorElementSelector } = helloSettings;
@@ -51,9 +53,26 @@ const initHello = async (helloSettings) => {
51
53
  logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
52
54
  return;
53
55
  }
54
- const triggerElement = document.querySelector(anchorElementSelector);
55
56
  log('Hello init complete');
56
- injectHelloComponent(triggerElement);
57
+ const isHelloInjected = injectHelloComponent(anchorElementSelector);
58
+ // keep watching for the anchor element to be added to the DOM, then inject hello component
59
+ if (!isHelloInjected) {
60
+ const observer = new MutationObserver(() => {
61
+ const injected = injectHelloComponent(anchorElementSelector);
62
+ if (injected) {
63
+ // disconnect observer if hello is successfully injected
64
+ observer.disconnect();
65
+ }
66
+ });
67
+ observer.observe(document.body, {
68
+ childList: true,
69
+ subtree: true,
70
+ });
71
+ // kill observer after 5 seconds if the hello still not injected, if the hello still not injected after 10 seconds, it's likely that the selector the user doesn't want to use hello
72
+ setTimeout(() => {
73
+ observer.disconnect();
74
+ }, 5000);
75
+ }
57
76
  };
58
77
 
59
78
  const zonosControllerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{visibility:hidden;opacity:0;height:0}";
@@ -207,7 +226,7 @@ const ZonosController = class {
207
226
  zonosStore.organizationName = organizationName;
208
227
  }
209
228
  render() {
210
- return h(Host, { key: '5650218b8eef4246ff1b131fcd1a06319800c2e3', class: "zonos--elements" });
229
+ return h(Host, { key: 'a220a3ebe75df167eefc892c59efdcaf05a53601', class: "zonos--elements" });
211
230
  }
212
231
  };
213
232
  ZonosController.style = ZonosControllerStyle0;
@@ -1,7 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-b5be4dc3.js';
2
- import { l as localizationStore } from './localization-d8f6453b.js';
3
- import { d as zonosStoreFontFamily } from './zonosStore-e6c7be3a.js';
2
+ import { l as localizationStore } from './cart-1bbb7662.js';
3
+ import { d as zonosStoreFontFamily } from './zonosStore-00bce01b.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
+ import './isDarkColor-2344e7a5.js';
6
+ import './getBorderRadius-19787feb.js';
5
7
 
6
8
  const zonosCountryFlagCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
7
9
  const ZonosCountryFlagStyle0 = zonosCountryFlagCss;