@zonos/elements 1.3.233 → 1.3.234

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 (413) hide show
  1. package/dist/cjs/{cart-bc615014.js → cart-22ced7cc.js} +33 -29
  2. package/dist/cjs/{shouldRenderTaxIdInput-9b8a8de1.js → containsNonLatinChars-2be5129b.js} +0 -23
  3. package/dist/cjs/{hasInclusivePrice-84145546.js → hasInclusivePrice-ca85cabd.js} +1 -1
  4. package/dist/cjs/index.cjs.js +11 -7
  5. package/dist/cjs/invoice-8fd4242c.js +151 -0
  6. package/dist/cjs/{renderFallback-c2576fbe.js → isCollectMobileTablet-7962c57f.js} +2 -11
  7. package/dist/cjs/isInvoiceMobileTablet-dde41e4e.js +15 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{translationStore-08d3ff9c.js → localization-8ef6250a.js} +1059 -1
  10. package/dist/cjs/{paypal-1d6f1a71.js → paypal-4a086f84.js} +7 -8
  11. package/dist/cjs/placeTestOrder-f25d08ee.js +45 -0
  12. package/dist/cjs/{placeTestOrder-a5469e40.js → renderCheckoutCurrency-5494e45b.js} +2 -42
  13. package/dist/cjs/renderFallback-78b54537.js +12 -0
  14. package/dist/cjs/shouldRenderTaxIdInput-eda13ef8.js +25 -0
  15. package/dist/cjs/throttle-7dd64984.js +76 -0
  16. package/dist/cjs/{zonos-address_11.cjs.entry.js → zonos-address-display_9.cjs.entry.js} +62 -668
  17. package/dist/cjs/zonos-address_4.cjs.entry.js +715 -0
  18. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  19. package/dist/cjs/{zonos-banner_2.cjs.entry.js → zonos-banner.cjs.entry.js} +0 -40
  20. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  21. package/dist/cjs/{zonos-empty-state-payment_4.cjs.entry.js → zonos-card_5.cjs.entry.js} +44 -6
  22. package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +75 -92
  23. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -21
  24. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -6
  26. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +66 -65
  27. package/dist/cjs/zonos-collect.cjs.entry.js +25 -25
  28. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-controller.cjs.entry.js +39 -10
  30. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -2
  31. package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -11
  32. package/dist/cjs/zonos-elements.cjs.js +1 -1
  33. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +30 -31
  34. package/dist/cjs/zonos-hello.cjs.entry.js +7 -8
  35. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  36. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +94 -0
  37. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +686 -0
  38. package/dist/cjs/zonos-invoice.cjs.entry.js +466 -0
  39. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -6
  40. package/dist/cjs/zonos-link.cjs.entry.js +24 -0
  41. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  42. package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
  43. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  44. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  45. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  46. package/dist/collection/collection-manifest.json +8 -0
  47. package/dist/collection/components/checkout/zonos-invoice/assets/ChevronDownIcon.svg +1 -0
  48. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/assets/empty-item.jpeg +0 -0
  49. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.css +72 -0
  50. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +87 -0
  51. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/RemoveIcon.svg +1 -0
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/SuccessIcon.svg +1 -0
  53. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.css +90 -0
  54. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +405 -0
  55. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/chevronDownIcon.svg +1 -0
  56. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/globe.svg +3 -0
  57. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconDark.svg +10 -0
  58. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconLight.svg +10 -0
  59. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosWordmark.svg +7 -0
  60. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.css +155 -0
  61. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +165 -0
  62. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronDownIcon.svg +1 -0
  63. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronUpIcon.svg +1 -0
  64. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.css +117 -0
  65. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.js +175 -0
  66. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/CheckmarkLineIcon.svg +1 -0
  67. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/RemoveLineIcon.svg +1 -0
  68. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.css +98 -0
  69. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +368 -0
  70. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.css +71 -0
  71. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +151 -0
  72. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.css +83 -0
  73. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +65 -0
  74. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.css +350 -0
  75. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.js +545 -0
  76. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  77. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  78. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  79. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  80. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  81. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  82. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  83. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  84. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  85. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  86. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  87. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  88. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  89. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  90. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  91. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  92. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  93. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  94. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  95. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +5 -5
  96. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  97. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  98. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  99. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  100. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  101. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  102. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  103. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  104. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  105. package/dist/collection/components/main/zonos-controller.js +45 -4
  106. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  107. package/dist/collection/components/store/checkout/invoice.js +148 -0
  108. package/dist/collection/components/store/checkout/stripe.js +8 -3
  109. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  110. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  111. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  112. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  113. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  114. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  115. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  116. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  117. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  118. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  119. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  120. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  121. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  122. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  123. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  124. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  125. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  126. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  127. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  128. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  129. package/dist/collection/components/stripe/zonos-address/zonos-address.js +8 -5
  130. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  131. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  132. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  133. package/dist/collection/components/utils/checkout/initInvoice.js +15 -0
  134. package/dist/collection/components/utils/checkout/isInvoiceMobileTablet.js +10 -0
  135. package/dist/collection/scripts/_zonosBase.js +4 -0
  136. package/dist/esm/{cart-14f305b3.js → cart-66aecbb3.js} +9 -5
  137. package/dist/esm/{shouldRenderTaxIdInput-8bc112bb.js → containsNonLatinChars-2d8810c3.js} +1 -23
  138. package/dist/esm/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  139. package/dist/esm/index.js +11 -7
  140. package/dist/esm/invoice-c7452847.js +146 -0
  141. package/dist/esm/{renderFallback-dbf1e3ae.js → isCollectMobileTablet-921002b0.js} +3 -11
  142. package/dist/esm/isInvoiceMobileTablet-1f7b614e.js +12 -0
  143. package/dist/esm/loader.js +1 -1
  144. package/dist/esm/{translationStore-690c4e04.js → localization-04b05867.js} +1041 -2
  145. package/dist/esm/{paypal-fded8844.js → paypal-56564874.js} +2 -3
  146. package/dist/esm/placeTestOrder-6b9eda9e.js +43 -0
  147. package/dist/esm/{placeTestOrder-2250f719.js → renderCheckoutCurrency-cb808110.js} +3 -42
  148. package/dist/esm/renderFallback-3f010b48.js +10 -0
  149. package/dist/esm/shouldRenderTaxIdInput-d45ceeb4.js +23 -0
  150. package/dist/esm/throttle-ce2432ab.js +74 -0
  151. package/dist/esm/{zonos-address_11.entry.js → zonos-address-display_9.entry.js} +32 -636
  152. package/dist/esm/zonos-address_4.entry.js +708 -0
  153. package/dist/esm/zonos-badge.entry.js +3 -3
  154. package/dist/esm/{zonos-banner_2.entry.js → zonos-banner.entry.js} +1 -40
  155. package/dist/esm/zonos-button_3.entry.js +3 -3
  156. package/dist/esm/{zonos-empty-state-payment_4.entry.js → zonos-card_5.entry.js} +44 -7
  157. package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_12.entry.js} +15 -31
  158. package/dist/esm/zonos-checkout.entry.js +3 -4
  159. package/dist/esm/zonos-collapse.entry.js +2 -2
  160. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -6
  161. package/dist/esm/zonos-collect-finish_6.entry.js +7 -6
  162. package/dist/esm/zonos-collect.entry.js +5 -5
  163. package/dist/esm/zonos-component.entry.js +1 -1
  164. package/dist/esm/zonos-controller.entry.js +39 -10
  165. package/dist/esm/zonos-country-flag.entry.js +1 -2
  166. package/dist/esm/zonos-country-select_4.entry.js +10 -11
  167. package/dist/esm/zonos-elements.js +1 -1
  168. package/dist/esm/zonos-hello-dialog.entry.js +6 -7
  169. package/dist/esm/zonos-hello.entry.js +1 -2
  170. package/dist/esm/zonos-input.entry.js +4 -4
  171. package/dist/esm/zonos-invoice-cart-items_2.entry.js +89 -0
  172. package/dist/esm/zonos-invoice-finish_5.entry.js +678 -0
  173. package/dist/esm/zonos-invoice.entry.js +462 -0
  174. package/dist/esm/zonos-language-select_2.entry.js +5 -6
  175. package/dist/esm/zonos-link.entry.js +20 -0
  176. package/dist/esm/zonos-logo.entry.js +2 -2
  177. package/dist/esm/zonos-stripe-input.entry.js +5 -5
  178. package/dist/esm/zonos-toggle.entry.js +2 -2
  179. package/dist/esm/zonos-tooltip.entry.js +2 -2
  180. package/dist/esm/zonos-v-stack.entry.js +2 -2
  181. package/dist/esm-es5/cart-66aecbb3.js +1 -0
  182. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  183. package/dist/esm-es5/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  184. package/dist/esm-es5/index.js +1 -1
  185. package/dist/esm-es5/invoice-c7452847.js +1 -0
  186. package/dist/esm-es5/isCollectMobileTablet-921002b0.js +1 -0
  187. package/dist/esm-es5/isInvoiceMobileTablet-1f7b614e.js +1 -0
  188. package/dist/esm-es5/loader.js +1 -1
  189. package/dist/esm-es5/localization-04b05867.js +1 -0
  190. package/dist/esm-es5/{paypal-fded8844.js → paypal-56564874.js} +1 -1
  191. package/dist/esm-es5/placeTestOrder-6b9eda9e.js +1 -0
  192. package/dist/esm-es5/renderCheckoutCurrency-cb808110.js +1 -0
  193. package/dist/esm-es5/renderFallback-3f010b48.js +1 -0
  194. package/dist/esm-es5/shouldRenderTaxIdInput-d45ceeb4.js +1 -0
  195. package/dist/esm-es5/throttle-ce2432ab.js +1 -0
  196. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -0
  197. package/dist/esm-es5/zonos-address_4.entry.js +1 -0
  198. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  199. package/dist/esm-es5/zonos-banner.entry.js +1 -0
  200. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  201. package/dist/esm-es5/zonos-card_5.entry.js +1 -0
  202. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  203. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  204. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  205. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  206. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  207. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  208. package/dist/esm-es5/zonos-component.entry.js +1 -1
  209. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  210. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  211. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  212. package/dist/esm-es5/zonos-elements.js +1 -1
  213. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  214. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  215. package/dist/esm-es5/zonos-input.entry.js +1 -1
  216. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -0
  217. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -0
  218. package/dist/esm-es5/zonos-invoice.entry.js +1 -0
  219. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  220. package/dist/esm-es5/zonos-link.entry.js +1 -0
  221. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  222. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  223. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  224. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  225. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  226. package/dist/scripts/index.d.ts +356 -0
  227. package/dist/scripts/index.js +1 -1
  228. package/dist/scripts/loadZonos.js +1 -1
  229. package/dist/scripts/zonos.js +1 -1
  230. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.d.ts +10 -0
  231. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.d.ts +50 -0
  232. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.d.ts +25 -0
  233. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.d.ts +28 -0
  234. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.d.ts +62 -0
  235. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.d.ts +22 -0
  236. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.d.ts +7 -0
  237. package/dist/types/components/checkout/zonos-invoice/zonos-invoice.d.ts +86 -0
  238. package/dist/types/components/main/zonos-controller.d.ts +4 -0
  239. package/dist/types/components/store/checkout/invoice.d.ts +19 -0
  240. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  241. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  242. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  243. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  244. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  245. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  246. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  247. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  248. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  249. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  250. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  251. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  252. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  253. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  254. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  255. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  256. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  257. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  258. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  259. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  260. package/dist/types/components/utils/checkout/initInvoice.d.ts +1 -0
  261. package/dist/types/components/utils/checkout/isInvoiceMobileTablet.d.ts +4 -0
  262. package/dist/types/components.d.ts +351 -0
  263. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  264. package/dist/types/types/checkout/api/CheckoutSession.d.ts +4 -0
  265. package/dist/types/types/checkout/api/PartyInfo.d.ts +21 -0
  266. package/dist/zonos-elements/index.esm.js +1 -1
  267. package/dist/zonos-elements/p-00719e49.entry.js +1 -0
  268. package/dist/zonos-elements/p-01b0a2e2.js +1 -0
  269. package/dist/zonos-elements/p-01dada4e.js +1 -0
  270. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  271. package/dist/zonos-elements/p-0cd5bcb3.entry.js +1 -0
  272. package/dist/zonos-elements/p-0e82fcea.entry.js +1 -0
  273. package/dist/zonos-elements/p-10316d4d.system.entry.js +1 -0
  274. package/dist/zonos-elements/{p-0a90dd80.system.entry.js → p-121c60c1.system.entry.js} +1 -1
  275. package/dist/zonos-elements/{p-bf9d889f.entry.js → p-14314ad3.entry.js} +1 -1
  276. package/dist/zonos-elements/p-170314a3.js +1 -0
  277. package/dist/zonos-elements/p-17a09191.entry.js +1 -0
  278. package/dist/zonos-elements/p-18bc6c7a.entry.js +1 -0
  279. package/dist/zonos-elements/{p-a25428eb.system.js → p-18d20206.system.js} +2 -2
  280. package/dist/zonos-elements/p-1a30fe18.system.entry.js +1 -0
  281. package/dist/zonos-elements/{p-c7b658cb.entry.js → p-1c4d12f0.entry.js} +1 -1
  282. package/dist/zonos-elements/p-1f3549c6.js +1 -0
  283. package/dist/zonos-elements/p-2250e585.entry.js +1 -0
  284. package/dist/zonos-elements/p-248dd596.system.entry.js +1 -0
  285. package/dist/zonos-elements/{p-5f398c28.entry.js → p-264690d7.entry.js} +1 -1
  286. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  287. package/dist/zonos-elements/p-27f6930b.js +1 -0
  288. package/dist/zonos-elements/{p-eea0eb57.system.entry.js → p-2f869f2c.system.entry.js} +1 -1
  289. package/dist/zonos-elements/p-30c661b3.system.entry.js +1 -0
  290. package/dist/zonos-elements/p-34bf7bbe.system.js +1 -0
  291. package/dist/zonos-elements/p-38913b2f.entry.js +1 -0
  292. package/dist/zonos-elements/p-3bec13dd.system.js +1 -0
  293. package/dist/zonos-elements/{p-00ec22b2.entry.js → p-43a22d85.entry.js} +1 -1
  294. package/dist/zonos-elements/p-44b50260.entry.js +1 -0
  295. package/dist/zonos-elements/p-48dc96f9.system.entry.js +1 -0
  296. package/dist/zonos-elements/p-4aa86184.system.entry.js +1 -0
  297. package/dist/zonos-elements/p-4d594c8e.system.js +1 -0
  298. package/dist/zonos-elements/p-4ffbb0d6.system.js +1 -0
  299. package/dist/zonos-elements/{p-452fb638.system.entry.js → p-5062dcf3.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-c5cb2364.system.entry.js → p-57cee1b5.system.entry.js} +1 -1
  301. package/dist/zonos-elements/p-59a76f73.entry.js +1 -0
  302. package/dist/zonos-elements/{p-d556c6d1.system.entry.js → p-5afb9260.system.entry.js} +1 -1
  303. package/dist/zonos-elements/p-5e9b45f7.entry.js +1 -0
  304. package/dist/zonos-elements/{p-88ea9f82.entry.js → p-6626d240.entry.js} +1 -1
  305. package/dist/zonos-elements/p-6688473e.entry.js +1 -0
  306. package/dist/zonos-elements/p-6f23a26a.system.js +1 -0
  307. package/dist/zonos-elements/{p-82739127.js → p-73c737aa.js} +2 -2
  308. package/dist/zonos-elements/p-757d4c62.system.entry.js +1 -0
  309. package/dist/zonos-elements/p-7aa50ef2.entry.js +1 -0
  310. package/dist/zonos-elements/p-7e17667d.js +1 -0
  311. package/dist/zonos-elements/p-7e469c5c.entry.js +1 -0
  312. package/dist/zonos-elements/p-7f91617c.system.entry.js +1 -0
  313. package/dist/zonos-elements/p-81e3eb5b.js +1 -0
  314. package/dist/zonos-elements/p-82febf70.system.js +1 -0
  315. package/dist/zonos-elements/{p-770852bf.system.entry.js → p-836db369.system.entry.js} +1 -1
  316. package/dist/zonos-elements/p-83b3f824.system.entry.js +1 -0
  317. package/dist/zonos-elements/p-851011aa.system.entry.js +1 -0
  318. package/dist/zonos-elements/{p-936b54c1.entry.js → p-865536f0.entry.js} +1 -1
  319. package/dist/zonos-elements/{p-b1fd1ec2.system.entry.js → p-8792fef2.system.entry.js} +1 -1
  320. package/dist/zonos-elements/p-890bfc42.system.entry.js +1 -0
  321. package/dist/zonos-elements/{p-c288c6da.system.entry.js → p-89a5e936.system.entry.js} +1 -1
  322. package/dist/zonos-elements/p-8af188f8.system.js +1 -0
  323. package/dist/zonos-elements/p-8d3a62fb.entry.js +1 -0
  324. package/dist/zonos-elements/{p-00ac999f.system.entry.js → p-8dc025c7.system.entry.js} +1 -1
  325. package/dist/zonos-elements/p-944d00da.entry.js +1 -0
  326. package/dist/zonos-elements/p-9479f155.system.js +1 -0
  327. package/dist/zonos-elements/p-95dc475b.system.js +1 -0
  328. package/dist/zonos-elements/p-976afc17.system.js +1 -0
  329. package/dist/zonos-elements/p-97d56c21.system.entry.js +1 -0
  330. package/dist/zonos-elements/p-9b9bfb6d.entry.js +1 -0
  331. package/dist/zonos-elements/{p-55e2e4ed.entry.js → p-9f1bd9b8.entry.js} +1 -1
  332. package/dist/zonos-elements/p-9fa32fdf.js +1 -0
  333. package/dist/zonos-elements/p-a2a0bf4e.js +1 -0
  334. package/dist/zonos-elements/p-a610c24e.system.entry.js +1 -0
  335. package/dist/zonos-elements/{p-9b8750f3.entry.js → p-aedd3911.entry.js} +1 -1
  336. package/dist/zonos-elements/{p-db628e49.system.entry.js → p-b5c31ca4.system.entry.js} +1 -1
  337. package/dist/zonos-elements/p-ba456282.system.entry.js +1 -0
  338. package/dist/zonos-elements/{p-31af91f0.entry.js → p-bd603c1a.entry.js} +1 -1
  339. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  340. package/dist/zonos-elements/p-dc5fb21c.js +1 -0
  341. package/dist/zonos-elements/p-dc94d7eb.js +1 -0
  342. package/dist/zonos-elements/p-e5e64e16.system.js +1 -0
  343. package/dist/zonos-elements/{p-540cec7e.system.entry.js → p-e9e6bea7.system.entry.js} +1 -1
  344. package/dist/zonos-elements/p-eb9ee025.system.js +1 -0
  345. package/dist/zonos-elements/p-ed8ae947.system.entry.js +1 -0
  346. package/dist/zonos-elements/p-f1d9dd4e.entry.js +1 -0
  347. package/dist/zonos-elements/p-f3962950.system.entry.js +1 -0
  348. package/dist/zonos-elements/p-f4e976ae.entry.js +1 -0
  349. package/dist/zonos-elements/p-f513b231.entry.js +1 -0
  350. package/dist/zonos-elements/p-f64207fa.system.entry.js +1 -0
  351. package/dist/zonos-elements/{p-31975752.entry.js → p-fa322dc1.entry.js} +1 -1
  352. package/dist/zonos-elements/p-fb9fb873.system.entry.js +1 -0
  353. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  354. package/package.json +1 -1
  355. package/dist/cjs/localization-39516612.js +0 -884
  356. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +0 -168
  357. package/dist/esm/localization-c5029ffc.js +0 -863
  358. package/dist/esm/zonos-confirm-dialog_2.entry.js +0 -163
  359. package/dist/esm-es5/cart-14f305b3.js +0 -1
  360. package/dist/esm-es5/localization-c5029ffc.js +0 -1
  361. package/dist/esm-es5/placeTestOrder-2250f719.js +0 -1
  362. package/dist/esm-es5/renderFallback-dbf1e3ae.js +0 -1
  363. package/dist/esm-es5/shouldRenderTaxIdInput-8bc112bb.js +0 -1
  364. package/dist/esm-es5/translationStore-690c4e04.js +0 -1
  365. package/dist/esm-es5/zonos-address_11.entry.js +0 -1
  366. package/dist/esm-es5/zonos-banner_2.entry.js +0 -1
  367. package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
  368. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +0 -1
  369. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +0 -1
  370. package/dist/zonos-elements/p-03ff7b01.system.entry.js +0 -1
  371. package/dist/zonos-elements/p-100f6a88.system.entry.js +0 -1
  372. package/dist/zonos-elements/p-143d706b.entry.js +0 -1
  373. package/dist/zonos-elements/p-14d7489d.js +0 -1
  374. package/dist/zonos-elements/p-1bfae137.entry.js +0 -1
  375. package/dist/zonos-elements/p-1d5aa016.system.js +0 -1
  376. package/dist/zonos-elements/p-1eae4987.entry.js +0 -1
  377. package/dist/zonos-elements/p-23b45714.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-2557b96b.js +0 -1
  379. package/dist/zonos-elements/p-2ca8b037.entry.js +0 -1
  380. package/dist/zonos-elements/p-2dbcecf4.entry.js +0 -1
  381. package/dist/zonos-elements/p-316f9052.system.entry.js +0 -1
  382. package/dist/zonos-elements/p-3185968f.entry.js +0 -1
  383. package/dist/zonos-elements/p-4e41143a.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-52b87408.system.entry.js +0 -1
  385. package/dist/zonos-elements/p-561be3a2.system.js +0 -1
  386. package/dist/zonos-elements/p-5c680f72.js +0 -1
  387. package/dist/zonos-elements/p-5f77d19e.js +0 -1
  388. package/dist/zonos-elements/p-74ca7739.entry.js +0 -1
  389. package/dist/zonos-elements/p-767a31a8.system.js +0 -1
  390. package/dist/zonos-elements/p-78a6e775.system.js +0 -1
  391. package/dist/zonos-elements/p-7c705c76.system.js +0 -1
  392. package/dist/zonos-elements/p-81ba2820.system.entry.js +0 -1
  393. package/dist/zonos-elements/p-84078c57.system.js +0 -1
  394. package/dist/zonos-elements/p-8a23bbf5.js +0 -1
  395. package/dist/zonos-elements/p-905d2490.entry.js +0 -1
  396. package/dist/zonos-elements/p-93f2e1ee.system.entry.js +0 -1
  397. package/dist/zonos-elements/p-a0a4e43d.system.entry.js +0 -1
  398. package/dist/zonos-elements/p-a2819807.system.entry.js +0 -1
  399. package/dist/zonos-elements/p-a6e74856.entry.js +0 -1
  400. package/dist/zonos-elements/p-ae940a99.js +0 -1
  401. package/dist/zonos-elements/p-b7ea5f4f.system.entry.js +0 -1
  402. package/dist/zonos-elements/p-c0c458f7.system.entry.js +0 -1
  403. package/dist/zonos-elements/p-c1ecab92.entry.js +0 -1
  404. package/dist/zonos-elements/p-c50cc926.entry.js +0 -1
  405. package/dist/zonos-elements/p-cf765af3.system.js +0 -1
  406. package/dist/zonos-elements/p-e03e1a62.entry.js +0 -1
  407. package/dist/zonos-elements/p-e7874318.system.entry.js +0 -1
  408. package/dist/zonos-elements/p-e8949e7e.entry.js +0 -1
  409. package/dist/zonos-elements/p-ea0b5d10.system.js +0 -1
  410. package/dist/zonos-elements/p-eae3462c.entry.js +0 -1
  411. package/dist/zonos-elements/p-eeb1081e.js +0 -1
  412. package/dist/zonos-elements/p-f892595d.system.entry.js +0 -1
  413. package/dist/zonos-elements/p-fd3b46ee.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{z as e,c as t}from"./p-b2a0ab4a.js";import{s as o,l as n,e as s,f as r,b as i}from"./p-2557b96b.js";import{t as a}from"./p-5f77d19e.js";import{f as d,h as l,g as c,a as u,s as m,l as p,j as v}from"./p-41dd1cb8.js";import{l as h,b as y}from"./p-0a377722.js";import{i as g}from"./p-57fa64d7.js";import{g as w}from"./p-1f894984.js";const f=({firstName:e,lastName:t,name:o})=>{var n;if(!o&&!e&&!t)return{firstName:"",lastName:""};const s=(null==o?void 0:o.split(/\s+/))||[];return{firstName:(null==e?void 0:e.trim())||(null===(n=s[0])||void 0===n?void 0:n.trim())||"",lastName:(null==t?void 0:t.trim())||s.slice(1).join(" ").trim()||""}},b=({currentAddress:e,translatedAddress:t})=>{var o,n,s,r,i,a;const{city:d,country:l,line1:c,line2:u,postal_code:m,state:p}=e.value.address,v=e.value.name||[e.value.firstName,e.value.lastName].join(" ");return{city:(null===(o=t.city)||void 0===o?void 0:o[d])||d,country:l,line1:(null===(n=t.line1)||void 0===n?void 0:n[c])||c,line2:(null===(s=t.line2)||void 0===s?void 0:s[u||""])||u||"",name:(null===(r=t.name)||void 0===r?void 0:r[v])||v,phone:e.value.phone||"",postal_code:(null===(i=t.postal_code)||void 0===i?void 0:i[m])||m,state:(null===(a=t.state)||void 0===a?void 0:a[p])||p}},S=e=>{var t;const r="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),i=L.stripeLinkEventData,a=L.stripeAddressEventData,d=L.stripeShippingSameAsBilling?L.stripeAddressEventData:L.stripeBillingAddressEventData;if(!a||!d)throw new Error("Missing stripe address data");const l=b({currentAddress:a,translatedAddress:L.translatedAddress.address}),{firstName:c,lastName:u}=f({name:l.name}),m=b({currentAddress:d,translatedAddress:L.translatedAddress.address}),{firstName:p,lastName:v}=f({name:m.name}),h=s()||"US";return{billingAddress:{addressLine1:m.line1,addressLine2:m.line2||"",city:m.city,country:m.country,postalCode:m.postal_code,state:m.state},billingContact:{firstName:p,lastName:v,phone:m.phone},cartCurrencyCode:null===(t=se.items[0])||void 0===t?void 0:t.currencyCode,cartId:e,checkoutSessionCountry:h||n.selectedCountryCode||void 0,checkoutSessionId:o.checkoutSessionId||"",contact:{companyName:L.companyName,email:null==i?void 0:i.value.email,firstName:c,lastName:u,phone:l.phone},isTest:!!r,landedCostAdjustments:se.promoCode?[{amount:0,productId:null,promoCode:se.promoCode,sku:null,type:"PROMO_CODE"}]:[],shipToTaxId:L.taxId,shippingAddress:{addressLine1:l.line1,addressLine2:l.line2,city:l.city,country:l.country,postalCode:l.postal_code,state:l.state}}},C=()=>{const e="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),t=L.stripeLinkEventData,n=L.stripeAddressEventData,s=L.stripeShippingSameAsBilling?L.stripeAddressEventData:L.stripeBillingAddressEventData;if(h({stripeAddressData:n,stripeBillingAddressData:s},"info"),!n||!s)throw new Error("Missing stripe address data");const r=b({currentAddress:n,translatedAddress:L.translatedAddress.address}),{firstName:i,lastName:a}=f({name:r.name}),d=b({currentAddress:s,translatedAddress:L.translatedAddress.address}),{firstName:l,lastName:c}=f({name:d.name}),u=se.adjustments.map((e=>({amount:e.amount,name:e.description||null,productId:e.productId,sku:e.sku,type:e.type}))),m=se.promoCode?[{amount:0,productId:null,promoCode:se.promoCode,sku:null,type:"PROMO_CODE"},...u]:u;return{billingAddress:{addressLine1:d.line1,addressLine2:d.line2||"",city:d.city,country:d.country,postalCode:d.postal_code,state:d.state},billingContact:{firstName:l,lastName:c,phone:d.phone},checkoutSessionId:o.checkoutSessionId||"",contact:{companyName:L.companyName,email:null==t?void 0:t.value.email,firstName:i,lastName:a,phone:r.phone},isTest:e,items:se.items,landedCostAdjustments:m,shipToTaxId:L.taxId,shippingAddress:{addressLine1:r.line1,addressLine2:r.line2,city:r.city,country:r.country,postalCode:r.postal_code,state:r.state}}};const O=async t=>{const o=window.Zonos.cartId;if(!o)return await(async t=>{var o;const n=e.checkoutSettings.buildLandedCost;if(n){const e=await(async e=>{var t,o,n,s,r;const i=C(),a=await e({billingAddress:i.billingAddress,billingContact:i.billingContact,checkoutSessionId:i.checkoutSessionId,contact:i.contact,landedCostAdjustments:i.landedCostAdjustments,publicCredential:window.Zonos.zonosApiKey||"",shippingAddress:i.shippingAddress,zonosApiRoute:d.vercel});if(!a||!(null===(t=a.checkoutSessionWorkflow)||void 0===t?void 0:t.length)&&(null===(o=a.errors)||void 0===o?void 0:o.length))throw new Error(`Failed to build landed cost: ${(null===(s=null===(n=null==a?void 0:a.errors)||void 0===n?void 0:n[0])||void 0===s?void 0:s.message)||"Unknown error"}`);const{errors:c,json:u}=await l("/api/zonos-elements/validate-landed-cost",{body:a,headers:{"Content-Type":"application/json"},method:"POST"});if(!u||c.length)throw new Error(`Invalid landed cost object: ${(null===(r=c.find(Boolean))||void 0===r?void 0:r.message)||"Unknown error"}`);return a})(n);return e}const{errors:s,json:r}=await l("/api/zonos-elements/calculate-landed-cost",{body:C(),method:"POST",signal:null==t?void 0:t.signal});if(s.length||!r){if("The user aborted a request."===(null===(o=s[0])||void 0===o?void 0:o.message))throw new Error("The landed cost calculation request was aborted to initiate a new one.");if(s.forEach((e=>{console.warn(`Error calculating landed cost: ${e.message}`)})),!r)throw new Error("Failed to calculate landed cost");return r}return r})(t);const n=await(async({abortController:e,cartId:t})=>{var o,n,s,r,i;const{errors:a,json:d}=await l("/api/zonos-elements/cart-calculate-landed-cost",{body:S(t),method:"POST",signal:null==e?void 0:e.signal});if(a.length||!d){const e="string"==typeof(null===(o=a[0])||void 0===o?void 0:o.message)&&("The user aborted a request."===(null===(n=a[0])||void 0===n?void 0:n.message)||(null===(s=a[0])||void 0===s?void 0:s.message.includes("signal is aborted"))||(null===(r=a[0])||void 0===r?void 0:r.message.includes("The operation was aborted"))||(null===(i=a[0])||void 0===i?void 0:i.message.includes("Fetch is aborted")));throw new Error(e?"The landed cost calculation request was aborted to initiate a new one.":"Failed to calculate landed cost")}return d})({abortController:t,cartId:o}),{cartWorkflow:s}=n,r=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(o[n[s]]=e[n[s]])}return o}(n,["cartWorkflow"]);return Object.assign(Object.assign({},r),{itemCreateWorkflow:s.items})},A=async({checkoutSessionId:t,eventName:o,metadata:s})=>{var r,i;const a=Date.now(),d=[...window.Zonos.trackEventLogs];window.Zonos.trackEventLogs.push({checkoutSessionId:t,eventCreated:a,eventName:o});const p=window.location.href.includes("zonos.com")&&!window.location.href.includes("checkout.zonos.com")||!!(null===(r=window.Zonos)||void 0===r?void 0:r.zonosQaUrl)||!!(null===(i=window.Zonos)||void 0===i?void 0:i.debug);if((c()||u()||p)&&!window.Zonos.zonosConversionTest)return;const v=n.selectedCountryCode,h=e.organizationId;if(!t)return void m({endpoint:"trackConversionEventMetric",errors:[`Event "${o}" - No checkout session id found`],metadata:{allLogs:y,checkoutSessionId:t,eventName:o,metadata:s,organizationId:h,trackEventLogs:d}});h||m({endpoint:"trackConversionEventMetric",errors:[`Event "${o}" - No organization id found`],metadata:{allLogs:y,checkoutSessionId:t,eventName:o,metadata:s,organizationId:h,trackEventLogs:d}});const g={checkoutSessionId:t,countryCode:v,eventCreated:a,eventName:o,metadata:Object.assign(Object.assign({},s),{trackEventLogs:d}),organizationId:h};await l("/api/zonos-elements/track-conversion-event",{body:g,method:"POST"})},k=({address:e,invalidAdddressList:t})=>{if(!e)return;if(!t)return;const o={};return t.city&&(o.city=e.city),t.line1&&(o.line1=e.line1),t.line2&&(o.line2=e.line2),t.postal_code&&(o.postal_code=e.postal_code),t.state&&(o.state=e.state),t.name&&(o.name=e.name),Object.keys(o).length?o:void 0},I=e=>e.sort(((e,t)=>e.amount-t.amount)),N=async()=>{var e;const{errors:t,json:n}=await(async()=>{if(!o.checkoutSessionId)return{errors:[{message:"No checkout session id found"}],json:null};const e=new URLSearchParams;e.set("checkoutSessionId",o.checkoutSessionId);const{errors:t,json:n}=await l(`/api/zonos-elements/get-checkout-session?${e.toString()}`);return{errors:t,json:n}})();return t.length||!n?(p("Failed to retrieve checkout session info before confirming payment ",t),m({endpoint:"validateCheckoutSession",errors:t.map((e=>e.message)),metadata:{allLogs:y}}),{errorMessage:a("Unable to retrieve the checkout session at the moment. Please try again or contact our support team."),valid:!1}):(null===(e=n.checkoutSession.landedCost)||void 0===e?void 0:e.id)?{errorMessage:"",valid:!0}:(p("Landed cost is not found in the checkout session before confirming payment."),m({endpoint:"validateCheckoutSession",errors:["No landed cost found before confirming payment"],metadata:{allLogs:y}}),{errorMessage:a('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),valid:!1})},j=({theme:t})=>{const o={".AccordionItem":{color:"var(--colorText)"},".AccordionItem--selected":{color:"var(--colorText)"},".Action":{color:"var(--colorText)"},".Input":{boxShadow:"none",fontSize:e.appearance.fontSizeInputValue?`${e.appearance.fontSizeInputValue}px`:void 0,padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"},".Label--resting":{fontSize:e.appearance.fontSizeInputLabel?`${e.appearance.fontSizeInputLabel}px`:void 0},".PickerItem--highlight":{boxShadow:"0 0 0 2px var(--colorBackground)"},".PickerItem--highlight:hover":{backgroundColor:"var(--colorBackground)",boxShadow:"none"},".PickerItem--new":{color:"var(--colorText)"},".Tab--selected":{borderStyle:"solid",borderWidth:"1px"}};return"DARK"===t?Object.assign(Object.assign({},o),{".Action":Object.assign(Object.assign({},o[".Action"]),{color:"white"}),".PickerItem--new":Object.assign(Object.assign({},o[".PickerItem--new"]),{color:"white"})}):o},T=({borderStyle:e,theme:t})=>"DARK"===t?{borderRadius:w({overrideBorderStyle:e}),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"}:{borderRadius:w({overrideBorderStyle:e}),iconMenuColor:"var(--colorText)",iconMenuHoverColor:"var(--colorText)"},{onChange:E,reset:P,state:L}=t((()=>({checkoutSettlementCurrency:"USD",clientSecret:sessionStorage.getItem("zonos--client-secret")||"",companyName:"",companyNameUsedWhenAsyncAddressUpdate:"",customAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:!1,state:""},customBillingAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:!1,state:""},customErrorMessage:null,customerProfile:null,fetchingLandedCostAbortController:null,hasPaymentError:!1,isFetchingLandedCost:!1,isFetchingSession:!1,partyBillingId:null,partyShippingId:null,shouldInventoryRefund:!1,shouldRenderPayInUsdButton:!1,skipPaymentIntent:"0"!==new URLSearchParams(window.location.search).get("skipPaymentIntent"),stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenAsyncAddressUpdate:null,stripeAddressUsedWhenFetchingLC:null,stripeAddressUsedWhenValidatingAddress:null,stripeBillingAddressElement:null,stripeBillingAddressEventData:null,stripeBillingAddressUsedWhenAsyncAddressUpdate:null,stripeBillingAddressUsedWhenFetchingLC:null,stripeBillingAddressUsedWhenValidatingAddress:null,stripeCustomerSessionClientSecret:null,stripeElements:null,stripeElementsForBillingAddress:null,stripeElementsOptions:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null,stripeShippingSameAsBilling:!0,taxId:"",taxIdUsedWhenAsyncAddressUpdate:"",translatedAddress:{address:{},billingAddress:{},firstName:{},lastName:{},name:{}}}))),D=()=>{window.sessionStorage.removeItem("zonos--bigcommerce-domestic-checkout-shipping")},x=e=>{window.sessionStorage.setItem("zonos--bigcommerce-domestic-checkout-shipping",JSON.stringify(e))},R=()=>{const e=window.sessionStorage.getItem("zonos--bigcommerce-domestic-checkout-shipping");return v(e)},U=async t=>{var o,s;const r=L.clientSecret;if(!L.stripe)return void h("Skip. Stripe is not initialized");const i=(({clientSecret:t,overrideBorderRadius:o,overridePrimaryColor:s,overrideSecondaryColor:r,overrideTheme:i,paypalEnabled:a})=>{const d=s||e.appearance.colorPrimary,l=r||e.appearance.colorSecondary,c=d&&g(d)?"night":"flat",u="DARK"===i?"night":"flat",m=a?["external_paypal"]:[];return{appearance:{labels:"floating",rules:Object.assign({},j({theme:i||"LIGHT"})),theme:i?u:c,variables:Object.assign(Object.assign({},T({borderStyle:o,theme:"LIGHT"})),{colorPrimary:l})},clientSecret:t||void 0,customerSessionClientSecret:L.stripeCustomerSessionClientSecret||void 0,externalPaymentMethodTypes:[...m],locale:n.selectedLocale}})({clientSecret:r,overrideBorderRadius:null==t?void 0:t.overrideBorderRadius,overridePrimaryColor:null==t?void 0:t.overridePrimaryColor,overrideSecondaryColor:null==t?void 0:t.overrideSecondaryColor,overrideTheme:null==t?void 0:t.overrideTheme,paypalEnabled:null==t?void 0:t.paypalEnabled}),a=JSON.stringify(i)===JSON.stringify(L.stripeElementsOptions);if(!L.stripeElements||!L.stripeElementsForBillingAddress)return L.stripeElementsForBillingAddress=null===(o=L.stripe)||void 0===o?void 0:o.elements(i),h("Stripe elements for billing address initialized"),L.stripeElements=null===(s=L.stripe)||void 0===s?void 0:s.elements(i),L.stripeElementsOptions=i,void h("Stripe elements initialized");a||(L.stripeElements.update(i),L.stripeElementsForBillingAddress.update(i),L.stripeElementsOptions=i,L.stripeElements.fetchUpdates()),h("Stripe elements updated")},_=()=>{sessionStorage.removeItem("zonos--client-secret"),P(),L.stripe=window.Zonos.stripe},z=({address:e,firstName:t,lastName:n,name:s,phone:r})=>{const{firstName:i,lastName:a}=f({firstName:t,lastName:n,name:s});return i&&a||m({endpoint:"PARTY_CREATE_NO_NAME_FOUND",errors:["No name found"],metadata:{allLogs:y,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,firstName:t,lastName:n,name:s}}),r||m({endpoint:"PARTY_CREATE_NO_PHONE_FOUND",errors:["No phone found"],metadata:{allLogs:y,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,phone:r}}),{city:e.city,country:e.country,firstName:i,lastName:a,line1:e.line1,line2:e.line2,phone:r||"",postal_code:e.postal_code,state:e.state}},B=async()=>{var e,t,n,s;if(!(null===(e=L.stripeAddressEventData)||void 0===e?void 0:e.complete)||!L.stripeShippingSameAsBilling&&!(null===(t=L.stripeBillingAddressEventData)||void 0===t?void 0:t.complete)||!L.stripeBillingAddressEventData)return{partiesCreated:!1};if(!se.landedCostData)return{partiesCreated:!1};const r=null===(n=se.landedCostData.find(Boolean))||void 0===n?void 0:n.landedCost.rootId;if(!r)return m({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:y,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId}}),{partiesCreated:!1};const i=(()=>{var e,t,o,n,s,r;const i=JSON.stringify(null===(e=L.stripeLinkUsedWhenFetchingLC)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=L.stripeLinkEventData)||void 0===t?void 0:t.value),a=JSON.stringify(null===(o=L.stripeAddressUsedWhenAsyncAddressUpdate)||void 0===o?void 0:o.value)!==JSON.stringify(null===(n=L.stripeAddressEventData)||void 0===n?void 0:n.value),d=!L.stripeShippingSameAsBilling&&JSON.stringify(null===(s=L.stripeBillingAddressUsedWhenAsyncAddressUpdate)||void 0===s?void 0:s.value)!==JSON.stringify(null===(r=L.stripeBillingAddressEventData)||void 0===r?void 0:r.value);return i||a||d||L.taxIdUsedWhenAsyncAddressUpdate!==L.taxId||L.companyNameUsedWhenAsyncAddressUpdate!==L.companyName})();if(!i)return{partiesCreated:!1};const a=z({address:L.stripeAddressEventData.value.address,firstName:L.stripeAddressEventData.value.firstName,lastName:L.stripeAddressEventData.value.lastName,name:L.stripeAddressEventData.value.name,phone:L.stripeAddressEventData.value.phone}),d=L.stripeShippingSameAsBilling?a:z({address:L.stripeBillingAddressEventData.value.address,firstName:L.stripeBillingAddressEventData.value.firstName,lastName:L.stripeBillingAddressEventData.value.lastName,name:L.stripeBillingAddressEventData.value.name,phone:L.stripeBillingAddressEventData.value.phone}),c="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),{errors:u,json:v}=await l("/api/zonos-elements/create-parties",{body:{address:a,billingAddress:d,companyName:L.companyName,email:(null===(s=L.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",isTest:c,rootId:r,taxId:L.taxId},method:"POST"});return u.length||!v?(p("Error occurs when creating parties",JSON.stringify(u,null,2)),m({endpoint:"PF_PARTY_CREATE_FAILED",errors:["Failed to create parties"],metadata:{allLogs:y,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,errors:u,json:v}}),{partiesCreated:!1}):(L.companyNameUsedWhenAsyncAddressUpdate=L.companyName,L.stripeAddressUsedWhenAsyncAddressUpdate=L.stripeAddressEventData,L.stripeBillingAddressUsedWhenAsyncAddressUpdate=L.stripeBillingAddressEventData,L.taxIdUsedWhenAsyncAddressUpdate=L.taxId,L.partyBillingId=v.billToPartyId,L.partyShippingId=v.shipToPartyId,{partiesCreated:!0})},F=e=>({countryCode:e.address.country,postalCode:e.address.postal_code,state:e.address.state}),J=async t=>{var n,s,r,i;const a=(null==t?void 0:t.retries)||0,d=!!(null==t?void 0:t.applyingPromocode),l=(()=>{var e;const t=se.landedCostData&&(null===(e=se.landedCostData.find(Boolean))||void 0===e?void 0:e.subtotals.items)!==se.subtotal,o=(()=>{var e,t;const o=JSON.stringify(null===(e=L.stripeLinkUsedWhenFetchingLC)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=L.stripeLinkEventData)||void 0===t?void 0:t.value),n=L.stripeAddressEventData&&JSON.stringify(F(L.stripeAddressEventData.value))!==JSON.stringify(L.stripeAddressUsedWhenFetchingLC),s=!L.stripeShippingSameAsBilling&&L.stripeBillingAddressEventData&&JSON.stringify(F(L.stripeBillingAddressEventData.value))!==JSON.stringify(L.stripeBillingAddressUsedWhenFetchingLC);return o||n||s})();return h("isPrefetchInfoOutdated","info",{isAddressOutdated:o}),!se.landedCostData&&!L.isFetchingLandedCost||o||t})();if(!(()=>{var t,o,n,s;const r=!!(null===(t=L.stripeLinkEventData)||void 0===t?void 0:t.complete),i=!!(null===(o=L.stripeAddressEventData)||void 0===o?void 0:o.complete),a=L.stripeShippingSameAsBilling?i:!!(null===(n=L.stripeBillingAddressEventData)||void 0===n?void 0:n.complete),d=(t=>{var o,n;const s=null===(o=e.genericSettings)||void 0===o?void 0:o.countryFields,r=null===(n=e.genericSettings)||void 0===n?void 0:n.stripeCountryFieldLabels;return"stripe"===se.addressFormRenderType&&(r&&t in r?r[t]:null)||(s&&t in s?s[t]:null)})((null===(s=L.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)||"US");return!!(i&&a&&r)||(d&&L.stripeAddressEventData?r&&L.stripeAddressEventData.value.firstName&&L.stripeAddressEventData.value.lastName&&L.stripeAddressEventData.value.address.line1.length>0&&(!d.stateRequired||d.stateRequired&&L.stripeAddressEventData.value.address.state.length>0)&&(!d.zipRequired||d.zipRequired&&L.stripeAddressEventData.value.address.postal_code.length>=3)&&L.stripeAddressEventData.value.phone&&L.stripeAddressEventData.value.phone.length>0:i&&a&&r)})())return{isRequestNotReady:!0};if(l&&(null===(n=L.fetchingLandedCostAbortController)||void 0===n||n.abort(),L.fetchingLandedCostAbortController=null),!l&&!d)return{isRequestNotReady:!1};a?(L.isFetchingLandedCost=!1,setTimeout((()=>{L.isFetchingLandedCost=!0}),300)):L.isFetchingLandedCost=!0,L.stripeAddressEventData&&(L.stripeAddressUsedWhenFetchingLC={countryCode:L.stripeAddressEventData.value.address.country,postalCode:L.stripeAddressEventData.value.address.postal_code,state:L.stripeAddressEventData.value.address.state}),L.stripeBillingAddressEventData&&(L.stripeBillingAddressUsedWhenFetchingLC={countryCode:L.stripeBillingAddressEventData.value.address.country,postalCode:L.stripeBillingAddressEventData.value.address.postal_code,state:L.stripeBillingAddressEventData.value.address.state}),L.stripeLinkEventData&&(L.stripeLinkUsedWhenFetchingLC=Object.assign({},L.stripeLinkEventData));try{fe(),await(async()=>{var e;const t=new AbortController;L.fetchingLandedCostAbortController=t,fe();const{checkoutSessionWorkflow:n,errors:s,itemCreateWorkflow:r,landedCostCalculateWorkflow:i,partyCreateWorkflow:a,shipmentRatingCalculateWorkflow:d}=await O(t);se.customQuotingError=(null===(e=null==s?void 0:s.find((e=>{var t;return"CUSTOM"===(null===(t=e.extensions)||void 0===t?void 0:t.ruleMessageType)})))||void 0===e?void 0:e.message)||null,se.shippingData=I((null==d?void 0:d.filter(Boolean))||[]),de(r),L.fetchingLandedCostAbortController=null,se.partiesData=(null==a?void 0:a.filter(Boolean))||[],se.landedCostData=(null==n?void 0:n.map((e=>{const t=null==i?void 0:i.find((t=>(null==t?void 0:t.id)===e.landedCostId));return t?Object.assign(Object.assign({},e),{landedCost:t}):null})).filter(Boolean))||[],(null==n?void 0:n.length)&&A({checkoutSessionId:o.checkoutSessionId,eventName:"checkout_quoteReceived"});const l=se.promoCodeApplied&&!se.landedCostData.find((e=>{var t;return null===(t=e.landedCost.appliedAdjustments)||void 0===t?void 0:t.find((e=>"PROMO_CODE"===e.type))}));se.promoCodeError=l,l||sessionStorage.setItem("zonos--promo-code",se.promoCode)})();const e=null===(s=se.shippingData)||void 0===s?void 0:s.find(Boolean),t=null===(r=se.landedCostData)||void 0===r?void 0:r.find((t=>t.landedCost.shipmentRating.id===(null==e?void 0:e.id))),n=t?t.subtotals:null;n&&ue({method:(null==t?void 0:t.landedCost.method)||"DDP",subtotals:n})}catch(e){if(se.landedCostData=[],se.shippingData=[],e instanceof Error&&e.message&&!["The landed cost calculation request was aborted to initiate a new one."].includes(e.message)){if(a<1)return await J(Object.assign(Object.assign({},t),{retries:(a||0)+1})),{isRequestNotReady:!1};const o=null===(i=L.stripeAddressEventData)||void 0===i?void 0:i.value;m({endpoint:`Failed to fetch landed cost (${a} retries)`,errors:[e.message],metadata:{cartId:window.Zonos.cartId,shipToAddress:o}})}p(e)}return L.isFetchingLandedCost=!1,{isRequestNotReady:!1}},M=async()=>{var e,t;await J({applyingPromocode:!0}),"payment"===se.step&&Se(),await B();const o=null===(e=se.shippingData)||void 0===e?void 0:e.find(Boolean),n=null===(t=se.landedCostData)||void 0===t?void 0:t.find((e=>e.landedCost.id===(null==o?void 0:o.id)));o&&n&&await ye({applySubtotalsOnly:!1,landedCostId:n.landedCostId,selectedShippingOption:o})},W=()=>{se.promoCode="",sessionStorage.removeItem("zonos--promo-code"),se.promoCodeError=!1,se.promoCodeApplied=!1},$=async()=>{"payment"===se.step&&Se(),W(),await M()},q=e=>{let t=[],o=!0;const n=window.Zonos.isCollect;switch(e){case"succeeded":t=[a("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"",a("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")],n&&(t=[a("Thank you for submitting your payment. We appreciate your prompt attention."),"",a("A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.")]),o=!1;break;case"requires_capture":case"processing":t=[a("Payment processing. We'll update you when payment is received.")],o=!1;break;case"requires_payment_method":t=[a("Payment failed. Please try another payment method.")],n&&(t=[a("Payment failed. Please reload the page and try another payment method.")]);break;case"requires_action":o=!1,t=[a("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.")];default:t=[a("Something went wrong.")]}return{isError:o,messages:t}},Y=async()=>{var t,o;const{onInventoryCheck:n}=e.checkoutSettings,s=!!(null===(o=null===(t=window.Zonos.cartData)||void 0===t?void 0:t.metadata.find((e=>"referenceId"===e.key)))||void 0===o?void 0:o.value);if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&s){const{errors:e,json:t}=await l("/api/zonos-elements/legacy/inventory-check",{body:{cartData:window.Zonos.cartData},method:"POST"});return e.length||!t?(p("Error occurs when handling inventory refund","warn",JSON.stringify(e)),null):t.available&&204!==t.status?t.available||200===t.status?(L.shouldInventoryRefund=!0,null):null:a("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.")}if("function"!=typeof n)return null;try{return await n({items:se.items})}catch(e){const t=e instanceof Error?e.message:"Unknown error";throw m({endpoint:"onInventoryCheck",errors:[`cartId: ${window.Zonos.cartId} - ${t}`],metadata:{cartId:window.Zonos.cartId,href:window.location.href,items:se.items}}),e}},H=async()=>{var e,t;const o=!!(null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.metadata.find((e=>"referenceId"===e.key)))||void 0===t?void 0:t.value);window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&o&&await l("/api/zonos-elements/legacy/inventory-refund",{body:{cartData:window.Zonos.cartData},method:"POST"})},K=async({clientSecret:e,storybookForceStatus:t})=>{if(t){const{isError:e,messages:o}=q(t);return{error:e,messages:o}}const o=e||L.clientSecret;if(!L.stripe||!o)return p("Failed to retrieve payment intent. Stripe is not initialized"),{error:!0,message:[a("Something went wrong.")]};const{paymentIntent:n}=await L.stripe.retrievePaymentIntent(o),s=null==n?void 0:n.status,{isError:r,messages:i}=q(s);return{error:r,messages:i,paymentIntentId:null==n?void 0:n.id,paymentMethod:null==n?void 0:n.payment_method,status:s}},G=async e=>{var t,n;const s=!!(null===(t=L.stripePaymentEventData)||void 0===t?void 0:t.complete),r=L.stripeElements,i=L.stripe,d=L.clientSecret;if(L.customErrorMessage=null,!(null===(n=se.selectedLandedCost)||void 0===n?void 0:n.landedCost.id)&&!(null==e?void 0:e.noLandedCostCheck))throw new Error("Attempted to confirm the payment when no landed cost is found in store");const l=await N();if(!l.valid)throw L.customErrorMessage=l.errorMessage,new Error(l.errorMessage);const c=o.checkoutSessionId;if(i&&r&&s&&d&&c){const e=new URL(window.location.href);e.searchParams.set("payment_intent_client_secret",d),e.searchParams.set("zonosCheckoutSessionId",c),A({checkoutSessionId:c,eventName:"checkout_paymentInfoCompleted"});const{error:t,paymentIntent:o}=await i.confirmPayment({confirmParams:{return_url:e.toString()},elements:r,redirect:"if_required"});if(h("Payment intent confirmed","info",{error:t,paymentIntent:o}),"requires_action"===(null==o?void 0:o.status))throw new Error(a("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction."));if(t){if("card_error"===t.type||"validation_error"===t.type)throw new Error(t.message);if("invalid_request_error"===t.type&&"payment_intent_unexpected_state"===t.code)return;throw new Error("An unexpected error occurred.")}if("requires_payment_method"===o.status)throw new Error(a("Payment failed. Please try another payment method."))}},V=()=>{var e;const t=se.items.reduce(((e,t)=>e+t.amount*t.quantity),0),s=o.enabledVariantTestKeys||[];return{adjustmentsAmount:se.adjustments.reduce(((e,t)=>e+t.amount),0),cartId:window.Zonos.cartId,currency:(null===(e=se.items.find(Boolean))||void 0===e?void 0:e.currencyCode)||"",customerAuthenticationToken:se.customerAuthenticationToken||void 0,isCollect:window.Zonos.isCollect,itemsAmount:t,metadata:[{key:"language",value:n.selectedLocale}],presentmentCountryCode:n.selectedCountryCode,skipPaymentIntent:L.skipPaymentIntent,varianceTestInput:s}},Z=async()=>{var e;if(!o.checkoutSessionId)return m({endpoint:"Error creating payment intent",errors:["No checkout session id found when retrieving payment intent"],metadata:{allLogs:y,cartId:window.Zonos.cartId}}),void ce({messages:[a("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:a("Error creating Checkout")});const{errors:t,json:n}=await l("/api/zonos-elements/create-payment-intent",{body:{checkoutSessionId:o.checkoutSessionId},method:"POST"}),s=null===(e=null==n?void 0:n.checkoutSessionPaymentIntentCreate)||void 0===e?void 0:e.clientSecret;if(t.length||!s)return p("Error occurs when getting payment intent",JSON.stringify(t,null,2)),m({endpoint:"Error creating payment intent",errors:t.map((e=>e.message)),metadata:{allLogs:y,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,clientSecret:s}}),void ce({messages:[a("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:a("Error creating Checkout")});pe(n.checkoutSessionPaymentIntentCreate)},Q=async()=>{var e,t;if(!n.targetCurrency)return p("Failed to create checkout session - missing localizationStore.targetCurrency"),!1;L.isFetchingSession=!0;const o=V();h("Checkout session body","info",o);const{errors:s,json:r}=await l("/api/zonos-elements/create-checkout-session",{body:o,method:"POST"});if(L.isFetchingSession=!1,s.length||!r){const t=null===(e=s.find((e=>e.message)))||void 0===e?void 0:e.message;if(Array.isArray(t)&&t.some((e=>"Cart is expired."===e.message)))throw new Error("Cart is expired.");return p("Error occurred when creating checkout session",JSON.stringify(s,null,2)),!1}const i=r.checkoutSessionCreate;return pe(i),ue({method:(null===(t=i.landedCost)||void 0===t?void 0:t.method)||"DDP",subtotals:i.subtotals}),h("Exchange rate updated for cart items (checkout session create)","info",se.exchangeRate),h("done-init-checkout-session"),!0},X=async()=>{const t=o.checkoutSessionId;if(!t)return p("Failed to update checkout session base currency"),!1;if("LOCAL"===e.checkoutSettings.allowedSettlementCurrencies)return h('allowedSettlementCurrencies: "LOCAL". Skip updating checkout session base currency'),!0;const{json:n}=await l("/api/zonos-elements/update-checkout-session-base-currency",{body:{checkoutSessionId:t,currencyCode:L.checkoutSettlementCurrency},method:"POST"}),s=null==n?void 0:n.checkoutSessionBaseCurrencyUpdate.subtotals.presentmentCurrencyCode;return n&&s===L.checkoutSettlementCurrency?(h(`Updated checkout session to settlement currency "${s}".`),!0):(p("Failed to update checkout session base currency"),!1)},ee=({currentAddress:e,translatedAddressResult:t})=>{const o={};if(!t)return o;const{city:n,line1:s,line2:r,name:i,postal_code:a,state:d}=t;return e.city&&n&&(o.city={[e.city]:n}),e.line1&&s&&(o.line1={[e.line1]:s}),e.line2&&r&&(o.line2={[e.line2]:r}),e.postal_code&&a&&(o.postal_code={[e.postal_code]:a}),e.state&&d&&(o.state={[e.state]:d}),e.name&&i&&(o.name={[e.name]:i}),o},te=async({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t})=>{var o,n,s,r;const i=(({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t,stripeAddressEventData:o,stripeBillingAddressEventData:n,stripeShippingSameAsBilling:s})=>{const r=!!(null==o?void 0:o.complete);if(!r||!(s?r:null==n?void 0:n.complete))return null;if(!e&&!t)return null;const i=o.value,a=(null==n?void 0:n.value)||null,{firstName:d,lastName:l}=f({firstName:i.firstName,lastName:i.lastName,name:i.name}),c=`${d} ${l}`,{firstName:u,lastName:m}=f({firstName:null==a?void 0:a.firstName,lastName:null==a?void 0:a.lastName,name:(null==a?void 0:a.name)||""}),p=u&&m?`${u} ${m}`:"",v=i.address,h=null==a?void 0:a.address;return{address:k({address:Object.assign(Object.assign({},v),{name:c}),invalidAdddressList:e}),billingAddress:s?void 0:k({address:h?Object.assign(Object.assign({},h),{name:p}):null,invalidAdddressList:t}),destinationCountry:v.country}})({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t,stripeAddressEventData:L.stripeAddressEventData,stripeBillingAddressEventData:L.stripeBillingAddressEventData,stripeShippingSameAsBilling:L.stripeShippingSameAsBilling});if(!i)return void(L.translatedAddress={address:{},billingAddress:{}});const a=(()=>{var e,t,o,n;const s=JSON.stringify(null===(e=L.stripeAddressUsedWhenValidatingAddress)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=L.stripeAddressEventData)||void 0===t?void 0:t.value),r=!L.stripeShippingSameAsBilling&&JSON.stringify(null===(o=L.stripeBillingAddressEventData)||void 0===o?void 0:o.value)!==JSON.stringify(null===(n=L.stripeBillingAddressUsedWhenValidatingAddress)||void 0===n?void 0:n.value);return s||r})();if(!a)return;const{errors:d,json:c}=await l("/api/zonos-elements/validate-address",{body:i,method:"POST"});if(d.length||!c)return p("Error occurs when translating address to latin",JSON.stringify(d,null,2)),void(L.translatedAddress={address:{},billingAddress:{}});L.stripeAddressUsedWhenValidatingAddress=L.stripeAddressEventData,L.stripeBillingAddressUsedWhenValidatingAddress=L.stripeBillingAddressEventData;const u=null===(o=L.stripeAddressEventData)||void 0===o?void 0:o.value.address,m=null===(n=L.stripeBillingAddressEventData)||void 0===n?void 0:n.value.address;L.translatedAddress={address:u?ee({currentAddress:Object.assign(Object.assign({},u),{name:null===(s=L.stripeAddressEventData)||void 0===s?void 0:s.value.name}),translatedAddressResult:c.address||null}):{},billingAddress:L.stripeShippingSameAsBilling?{}:ee({currentAddress:Object.assign(Object.assign({},m),{name:null===(r=L.stripeBillingAddressEventData)||void 0===r?void 0:r.value.name}),translatedAddressResult:c.billingAddress||null})}};E("clientSecret",(e=>{e&&L.stripe&&sessionStorage.setItem("zonos--client-secret",e),e||sessionStorage.removeItem("zonos--client-secret")}));const{onChange:oe,reset:ne,state:se}=t((()=>({addressFormRenderType:"stripe",adjustmentTotal:0,adjustments:[],checkoutSession:null,checkoutSessionTimeoutShow:!1,checkoutTimeoutInterval:null,currency:"USD",customQuotingError:null,customerAuthenticationToken:null,displayBaseCurrency:!1,dutiesTaxesFees:null,dutiesTaxesFeesEstimate:null,error:null,exchangeRate:null,externalConfirmationPageURL:null,inventoryCheckErrorMessage:null,isSelectedShippingAboveDeminimis:!1,isSelectedShippingGuarantee:!1,isStagingMode:u(),items:[],landedCostData:null,landedCostMethod:"DDP",partiesData:[],promoCode:sessionStorage.getItem("zonos--promo-code")||"",promoCodeApplied:!!sessionStorage.getItem("zonos--promo-code"),promoCodeError:!1,restrictedItems:[],selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,shouldHideDiscountInput:!1,step:"customer-info",subtotal:0,tabItems:{"customer-info":{index:1,isDone:!1,label:"Customer",value:"customer-info"},shipping:{index:2,isDone:!1,label:"Shipping",value:"shipping"},payment:{index:3,isDone:!1,label:"Payment",value:"payment"}},total:0}))),re=e=>{switch(e){case"DAYS":return a("days");case"WEEKS":return a("weeks");default:return a("business days")}},ie=e=>{var t;const o=null===(t=e.shippingProfile)||void 0===t?void 0:t.transitTime;return(null==o?void 0:o.min)&&(null==o?void 0:o.max)&&(null==o?void 0:o.type)?{maxTransit:o.max,minTransit:o.min,unit:re(o.type)}:null},ae=({item1:e,item2:t})=>!(!e||!t)&&(t.sku&&e.sku&&e.sku===t.sku||t.description&&e.description&&e.description===t.description||e.name&&t.name&&e.name===t.name),de=e=>{h("Checking item restrictions");const t=e.map((e=>{if(!e.restriction)return null;const{restriction:t}=e,o=se.items.find((t=>ae({item1:t,item2:e})));return Object.assign(Object.assign({matchedItem:o},e),{restriction:t})})).filter(Boolean);return se.restrictedItems=t,se.items=se.items.map((e=>Object.assign(Object.assign({},e),{isRestricted:!!t.find((t=>ae({item1:t,item2:e})))}))),{cartItems:se.items,restrictedItems:t}},le=()=>{o.checkoutSessionId=null,ne()},ce=({messages:e,title:t})=>{le(),_(),se.step="error",se.error={messages:e,title:t}},ue=({dutiesTaxesFeesEstimate:e,method:t,subtotals:o})=>{se.exchangeRate=o.exchangeRate,se.adjustmentTotal=o.adjustments,se.dutiesTaxesFees="DAP"===t?null:o.landedCostTotal,se.subtotal=o.items,se.total=o.total,se.currency=o.presentmentCurrencyCode,se.dutiesTaxesFeesEstimate=e||null},me=()=>!!se.items.filter((e=>e.amount>0)).find((e=>!e.isRestricted)),pe=e=>{var t,n,s,a,d;L.clientSecret=e.clientSecret,L.stripeCustomerSessionClientSecret=e.customerSessionClientSecret,L.customerProfile=e.customerProfile,se.checkoutSession=e,e.id||m({endpoint:"cartStoreSetCheckoutSession",errors:["Missing checkout session id in checkout session"],metadata:{allLogs:y,checkoutSession:e}}),e.id&&(o.checkoutSessionId=e.id);const l=r(e.varianceTestResults||[]);i(l);const c=(null===(s=null===(n=null===(t=se.checkoutSession)||void 0===t?void 0:t.metadata)||void 0===n?void 0:n.find((e=>"externalConfirmationPageURL"===(null==e?void 0:e.key))))||void 0===s?void 0:s.value)||(null===(d=null===(a=window.Zonos.cartData)||void 0===a?void 0:a.metadata.find((e=>"externalConfirmationPageURL"===(null==e?void 0:e.key))))||void 0===d?void 0:d.value)||null;c&&(h(`Found externalConfirmationPageURL: ${c}`),se.externalConfirmationPageURL=c)},ve=async({adjustmentsAmount:e,cartId:t,currency:s,dutiesTaxesFeesEstimate:r,itemsAmount:i,landedCostId:d,shouldInitSessionOnFailure:c})=>{var u;if(d&&se.selectedLandedCost&&(ue({dutiesTaxesFeesEstimate:r,method:se.landedCostMethod,subtotals:se.selectedLandedCost.subtotals}),h("Exchange rate updated for cart items (landed cost subtotal)","info",se.exchangeRate)),!o.checkoutSessionId)return h("Could not update cart total without checkout session id","info"),!1;const{errors:m,json:v}=await(async({adjustmentsAmount:e,cartId:t,currency:s,id:r,itemsAmount:i,landedCostId:a,presentmentCountryCode:d})=>{const c=o.enabledVariantTestKeys||[],{errors:u,json:m}=await l("/api/zonos-elements/update-checkout-session",{body:{adjustmentsAmount:e,billToPartyId:L.partyBillingId,cartId:t,currency:s,customerAuthenticationToken:se.customerAuthenticationToken||void 0,id:r,itemsAmount:i,landedCostId:a,metadata:[{key:"language",value:n.selectedLocale}],presentmentCountryCode:d,shipToPartyId:L.partyShippingId,skipPaymentIntent:L.skipPaymentIntent,varianceTestInput:c},method:"POST"});return u.length||!m?(p("Error occurs when updating checkout session",JSON.stringify(u,null,2)),{errors:u,json:m}):{errors:[],json:m}})({adjustmentsAmount:e,billToPartyId:L.partyBillingId,cartId:t,currency:s,id:o.checkoutSessionId,itemsAmount:i,landedCostId:d,presentmentCountryCode:n.selectedCountryCode,shipToPartyId:L.partyShippingId,varianceTestInput:o.enabledVariantTestKeys||[]});if(m.length>0||!v){if(p("Error occurs when updating checkout session."),c){h("Initiating checkout session on failure","info");const e=await Q();return h(`stripeStoreInitCheckoutSession: ${e}`),!!e||(ce({messages:[a("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:a("Error creating Checkout")}),!1)}return!1}return d||(ue({method:(null===(u=v.checkoutSessionUpdate.landedCost)||void 0===u?void 0:u.method)||"DDP",subtotals:v.checkoutSessionUpdate.subtotals}),h("Exchange rate updated for cart items (checkout session update)","info",se.exchangeRate)),pe(v.checkoutSessionUpdate),!0},he=t=>{var o,n,s;return"DAP"===t.method&&(null===(n=null===(o=e.genericSettings)||void 0===o?void 0:o.domesticCountries)||void 0===n?void 0:n.includes((null===(s=L.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)||"US"))||"DAP"===t.method&&t.remittance.length&&"ZONOS"===t.landedCostGuaranteeCode?"DDP":t.method},ye=async({applySubtotalsOnly:t,landedCostId:n,selectedShippingOption:s})=>{var r,i,a,d,l,c,u,m,p,v,y;h("Updating selected shipping option","info",{landedCostId:n,selectedShippingOption:s}),se.selectedShippingOption=s;const g=ie(se.selectedShippingOption);if(g){const{maxTransit:e,minTransit:t,unit:o}=g;se.selectedShippingOptionTransitTime=`${t}-${e} ${o}`}else se.selectedShippingOptionTransitTime="";const w=null===(r=se.landedCostData)||void 0===r?void 0:r.find((e=>e.landedCostId===n));if(se.selectedLandedCost=w||null,!w)return!1;const f=((null===(i=w.landedCost.amountSubtotals)||void 0===i?void 0:i.landedCostTotal)||0)*w.subtotals.exchangeRate.rate;f&&h(`DAP quote, using estimate: ${f}`,"info"),se.landedCostMethod=he(w.landedCost),se.shipping=w.subtotals.shipping;const b="ZONOS"===(null===(a=null==w?void 0:w.landedCost)||void 0===a?void 0:a.landedCostGuaranteeCode),S=!!(null===(l=null===(d=null==w?void 0:w.landedCost)||void 0===d?void 0:d.deMinimis)||void 0===l?void 0:l.find((e=>["DUTY","TAX"].includes(e.type)&&"ABOVE"===e.threshold)));se.isSelectedShippingAboveDeminimis=S,se.isSelectedShippingGuarantee=b;let C=!1;t?(ue({dutiesTaxesFeesEstimate:f,method:se.landedCostMethod,subtotals:w.subtotals}),h("Exchange rate updated for cart items (landed cost subtotal)","info",se.exchangeRate),C=!0):C=await ve({adjustmentsAmount:se.adjustmentTotal,billToPartyId:L.partyBillingId,cartId:window.Zonos.cartId,dutiesTaxesFeesEstimate:f,landedCostId:null===(c=w.landedCost)||void 0===c?void 0:c.id,shipToPartyId:L.partyShippingId,varianceTestInput:o.enabledVariantTestKeys||[]});const O=null===(u=se.items.find(Boolean))||void 0===u?void 0:u.currencyCode,A=(null===(m=L.stripeAddressEventData)||void 0===m?void 0:m.value.address.country)||"US";return L.shouldRenderPayInUsdButton="USD"===O&&"LOCAL_AND_USD"===e.checkoutSettings.allowedSettlementCurrencies&&"USD"!==(null===(p=se.checkoutSession)||void 0===p?void 0:p.subtotals.presentmentCurrencyCode)&&!!(null===(y=null===(v=e.genericSettings)||void 0===v?void 0:v.usdSettlementCountryEnabled)||void 0===y?void 0:y.includes(A)),C},ge=({isPreview:e,sessionTimeout:t})=>{if(e)return;const o=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout"),n=o&&!isNaN(parseInt(o,10))?parseInt(o,10):t;h(`==START CHECKOUT TIMEOUT - ${n}==`),se.checkoutTimeoutInterval=setTimeout((()=>{se.checkoutSessionTimeoutShow=!0}),n)},we=()=>{se.checkoutTimeoutInterval&&(clearTimeout(se.checkoutTimeoutInterval),se.checkoutTimeoutInterval=null)},fe=()=>{se.items=se.items.map((e=>Object.assign(Object.assign({},e),{isRestricted:!1}))),se.restrictedItems=[]},be=async({adjustments:e,cartItems:t,landedCostId:n,shouldInitSessionOnFailure:s=!0})=>{var r;se.adjustments=e,se.items=t.map((e=>Object.assign(Object.assign({},e),{isRestricted:!1})));const i=null===(r=t.find(Boolean))||void 0===r?void 0:r.currencyCode,a=t.reduce(((e,t)=>e+t.amount*t.quantity),0),d=e.reduce(((e,t)=>e+t.amount),0);i&&a&&(se.currency=i,L.isFetchingSession=!0,await ve({adjustmentsAmount:d,billToPartyId:L.partyBillingId,cartId:window.Zonos.cartId,currency:i,dutiesTaxesFeesEstimate:0,itemsAmount:a,landedCostId:n,shipToPartyId:L.partyShippingId,shouldInitSessionOnFailure:s,varianceTestInput:o.enabledVariantTestKeys||[]}),L.isFetchingSession=!1)},Se=()=>{"shipping"===se.step?(se.step="customer-info",se.tabItems=Object.assign(Object.assign({},se.tabItems),{"customer-info":Object.assign(Object.assign({},se.tabItems.shipping),{isDone:!1})})):"payment"===se.step?(se.step="shipping",se.tabItems=Object.assign(Object.assign({},se.tabItems),{shipping:Object.assign(Object.assign({},se.tabItems.shipping),{isDone:!1})})):"finish"===se.step&&(se.step="payment",se.tabItems=Object.assign(Object.assign({},se.tabItems),{payment:Object.assign(Object.assign({},se.tabItems.payment),{isDone:!1})}))},Ce=()=>{"customer-info"===se.step?(se.step="shipping",se.tabItems=Object.assign(Object.assign({},se.tabItems),{"customer-info":Object.assign(Object.assign({},se.tabItems["customer-info"]),{isDone:!0})})):"shipping"===se.step?(se.step="payment",se.tabItems=Object.assign(Object.assign({},se.tabItems),{shipping:Object.assign(Object.assign({},se.tabItems.shipping),{isDone:!0})})):"payment"===se.step&&(se.step="finish")},Oe=()=>{se.step="customer-info",se.tabItems=Object.assign(Object.assign({},se.tabItems),{"customer-info":Object.assign(Object.assign({},se.tabItems["customer-info"]),{isDone:!1}),payment:Object.assign(Object.assign({},se.tabItems.payment),{isDone:!1}),shipping:Object.assign(Object.assign({},se.tabItems.shipping),{isDone:!1})}),se.selectedShippingOption=null,se.isSelectedShippingAboveDeminimis=!1,se.isSelectedShippingGuarantee=!1,se.selectedShippingOptionTransitTime="",se.dutiesTaxesFees=0,se.dutiesTaxesFeesEstimate=0,se.shipping=0,se.total=se.subtotal};export{N as A,E as B,z as C,ye as D,me as E,M as F,$ as G,W as H,q as I,te as J,f as K,B as L,ie as M,he as N,I as O,D as a,x as b,L as c,K as d,se as e,be as f,le as g,Oe as h,U as i,we as j,Q as k,Z as l,ge as m,V as n,ce as o,pe as p,J as q,Ce as r,R as s,A as t,X as u,Y as v,G as w,H as x,_ as y,oe as z}