@zonos/elements 1.3.287 → 1.3.289

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 (220) hide show
  1. package/dist/cjs/{cart-CV4buPlT.js → cart-WLQb2hbe.js} +1 -1
  2. package/dist/cjs/{collect-jzWKzrV7.js → collect-B92uIdsY.js} +2 -2
  3. package/dist/cjs/{getMissingRequiredShippingFields-r5vYIqoX.js → getMissingRequiredShippingFields-5w62gTIB.js} +1 -1
  4. package/dist/cjs/{hasInclusivePrice-BZMQohG9.js → hasInclusivePrice-hmV0Inld.js} +1 -1
  5. package/dist/cjs/index.cjs.js +8 -9
  6. package/dist/cjs/{invoice-CHw-mJdS.js → invoice-Bal1mqYR.js} +2 -2
  7. package/dist/cjs/{localization-CxXsmxs5.js → localization-C5HPlCNK.js} +191 -68
  8. package/dist/cjs/{paypal-BLuHeOJH.js → paypal-o164C26_.js} +2 -2
  9. package/dist/cjs/{placeTestOrder-VK_CMeq0.js → placeTestOrder-C7tAipav.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-CC4CAy-a.js → renderCheckoutCurrency-Bpx-vrTQ.js} +2 -2
  11. package/dist/cjs/{shouldShowLanguageSelect-Bj_jKWPK.js → shouldShowLanguageSelect-CtwkMt8b.js} +1 -1
  12. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +7 -7
  13. package/dist/cjs/zonos-address-display_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
  15. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-card_5.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +9 -9
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +8 -8
  21. package/dist/cjs/zonos-collect.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
  23. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +8 -8
  29. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  30. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  31. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
  32. package/dist/cjs/zonos-stripe-input.cjs.entry.js +1 -1
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
  34. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  35. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +7 -4
  36. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  37. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +1 -1
  38. package/dist/collection/components/main/zonos-controller.js +2 -2
  39. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -2
  40. package/dist/collection/components/store/hello/localization.js +69 -34
  41. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  42. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -3
  43. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  44. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
  45. package/dist/collection/components/utils/api/getLocalization.js +2 -2
  46. package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -4
  47. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +1 -0
  48. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +2 -0
  49. package/dist/collection/components/utils/formatDate.js +1 -3
  50. package/dist/collection/components/utils/getOverridenZCountry.js +3 -5
  51. package/dist/collection/components/utils/hello/countryOverrideStorage.js +49 -0
  52. package/dist/collection/components/utils/hello/getZCountryUrlParam.js +5 -9
  53. package/dist/collection/components/utils/hello/isCountryCode.js +1 -0
  54. package/dist/collection/components/utils/hello/isCountryInShippingZone.js +8 -0
  55. package/dist/collection/components/utils/hello/reconcileRememberedCountryOverride.js +37 -0
  56. package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +27 -20
  57. package/dist/collection/environment.js +0 -1
  58. package/dist/collection/scripts/_stripe.js +0 -2
  59. package/dist/collection/scripts/_zonosBase.js +1 -1
  60. package/dist/collection/types/generated/graphql.frontend.types.js +218 -63
  61. package/dist/collection/types/generated/graphql.internal.types.js +643 -147
  62. package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -0
  63. package/dist/collection/utils/generateCloudflareDeployUrl.js +5 -2
  64. package/dist/esm/{cart-ekBk_gxV.js → cart-BDc4RTBJ.js} +1 -1
  65. package/dist/esm/{collect-33rMINDo.js → collect-NRCK3t-M.js} +2 -2
  66. package/dist/esm/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-D-B-N1NH.js} +1 -1
  67. package/dist/esm/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-Bti4iudO.js} +1 -1
  68. package/dist/esm/index.js +8 -9
  69. package/dist/esm/{invoice-BNDWuVsD.js → invoice-DsvQvu4a.js} +2 -2
  70. package/dist/esm/{localization-AOqYXGdP.js → localization-Bs6hVcKV.js} +191 -69
  71. package/dist/esm/{paypal-CW1D2XqZ.js → paypal-BqyEZS_u.js} +2 -2
  72. package/dist/esm/{placeTestOrder-nhmsLLOA.js → placeTestOrder-x3xwMAnW.js} +2 -2
  73. package/dist/esm/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-DIBdWKN1.js} +2 -2
  74. package/dist/esm/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-Bb9sbQ41.js} +1 -1
  75. package/dist/esm/zonos-address-completion-dialog_7.entry.js +7 -7
  76. package/dist/esm/zonos-address-display_2.entry.js +1 -1
  77. package/dist/esm/zonos-address_4.entry.js +4 -4
  78. package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
  79. package/dist/esm/zonos-card_5.entry.js +4 -4
  80. package/dist/esm/zonos-cart-items_12.entry.js +9 -9
  81. package/dist/esm/zonos-checkout.entry.js +6 -6
  82. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  83. package/dist/esm/zonos-collect-finish_6.entry.js +8 -8
  84. package/dist/esm/zonos-collect.entry.js +5 -5
  85. package/dist/esm/zonos-controller.entry.js +4 -4
  86. package/dist/esm/zonos-country-flag.entry.js +1 -1
  87. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  88. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  89. package/dist/esm/zonos-hello.entry.js +1 -1
  90. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  91. package/dist/esm/zonos-invoice-finish_5.entry.js +8 -8
  92. package/dist/esm/zonos-invoice.entry.js +4 -4
  93. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  94. package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
  95. package/dist/esm/zonos-stripe-input.entry.js +1 -1
  96. package/dist/esm-es5/{cart-ekBk_gxV.js → cart-BDc4RTBJ.js} +1 -1
  97. package/dist/esm-es5/{collect-33rMINDo.js → collect-NRCK3t-M.js} +1 -1
  98. package/dist/esm-es5/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-D-B-N1NH.js} +1 -1
  99. package/dist/esm-es5/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-Bti4iudO.js} +1 -1
  100. package/dist/esm-es5/index.js +6 -8
  101. package/dist/esm-es5/{invoice-BNDWuVsD.js → invoice-DsvQvu4a.js} +1 -1
  102. package/dist/esm-es5/{localization-AOqYXGdP.js → localization-Bs6hVcKV.js} +74 -68
  103. package/dist/esm-es5/{paypal-CW1D2XqZ.js → paypal-BqyEZS_u.js} +1 -1
  104. package/dist/esm-es5/{placeTestOrder-nhmsLLOA.js → placeTestOrder-x3xwMAnW.js} +1 -1
  105. package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-DIBdWKN1.js} +1 -1
  106. package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-Bb9sbQ41.js} +1 -1
  107. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +3 -3
  108. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  109. package/dist/esm-es5/zonos-address_4.entry.js +2 -2
  110. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  111. package/dist/esm-es5/zonos-card_5.entry.js +2 -2
  112. package/dist/esm-es5/zonos-cart-items_12.entry.js +2 -2
  113. package/dist/esm-es5/zonos-checkout.entry.js +4 -4
  114. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  115. package/dist/esm-es5/zonos-collect-finish_6.entry.js +2 -2
  116. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  117. package/dist/esm-es5/zonos-controller.entry.js +3 -3
  118. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  119. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  121. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  122. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  123. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +2 -2
  124. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  125. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  126. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  127. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  128. package/dist/scripts/index.js +1 -1
  129. package/dist/scripts/loadZonos.js +1 -1
  130. package/dist/scripts/zonos.js +1 -1
  131. package/dist/types/components/store/hello/localization.d.ts +2 -1
  132. package/dist/types/components/utils/api/getLocalization.d.ts +3 -1
  133. package/dist/types/components/utils/getOverridenZCountry.d.ts +2 -3
  134. package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +5 -0
  135. package/dist/types/components/utils/hello/isCountryCode.d.ts +2 -0
  136. package/dist/types/components/utils/hello/isCountryInShippingZone.d.ts +2 -0
  137. package/dist/types/components/utils/hello/reconcileRememberedCountryOverride.d.ts +18 -0
  138. package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +8 -4
  139. package/dist/types/types/generated/graphql.frontend.types.d.ts +41 -52
  140. package/dist/types/types/generated/graphql.frontend.types.ts +226 -114
  141. package/dist/types/types/generated/graphql.internal.types.d.ts +231 -94
  142. package/dist/types/types/generated/graphql.internal.types.ts +712 -245
  143. package/dist/types/utils/formattedCloudflareApiUrl.d.ts +1 -0
  144. package/dist/types/utils/generateCloudflareDeployUrl.d.ts +5 -2
  145. package/dist/zonos-elements/index.esm.js +1 -1
  146. package/dist/zonos-elements/p-02628b9f.entry.js +1 -0
  147. package/dist/zonos-elements/{p-04cc0dac.system.entry.js → p-02ff6f8b.system.entry.js} +38 -38
  148. package/dist/zonos-elements/p-037d3688.entry.js +1 -0
  149. package/dist/zonos-elements/{p-02ef0f99.system.entry.js → p-03fbe813.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-5a631080.system.entry.js → p-0ff26236.system.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-f2cedbcd.system.entry.js → p-163b81c0.system.entry.js} +6 -6
  152. package/dist/zonos-elements/{p-e9320825.entry.js → p-18021e6b.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-dcdbc610.system.entry.js → p-22fab1ba.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-b14819ab.system.entry.js → p-2466b5f0.system.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-daf9fa07.system.entry.js → p-317d4665.system.entry.js} +19 -19
  156. package/dist/zonos-elements/{p-d55b9664.system.entry.js → p-36559431.system.entry.js} +17 -17
  157. package/dist/zonos-elements/{p-f27317d3.system.entry.js → p-3cc27e0e.system.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-891b47d7.entry.js → p-3d536086.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-a38e62cc.entry.js → p-3e59d41c.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-64e7bc5b.entry.js → p-4625058a.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-5024df2d.system.entry.js → p-56159b7c.system.entry.js} +60 -60
  162. package/dist/zonos-elements/p-5e074243.entry.js +1 -0
  163. package/dist/zonos-elements/{p-9818f823.entry.js → p-5eb82be3.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-cf5688f7.entry.js → p-628a0f7f.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-5d3079e8.entry.js → p-635341d6.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-cdffc9b6.entry.js → p-68e0180a.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-6b0afaa7.entry.js → p-6c6c65f0.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-04bfcd72.system.entry.js → p-72b6a006.system.entry.js} +18 -18
  169. package/dist/zonos-elements/{p-4973f8d8.system.entry.js → p-8cac7911.system.entry.js} +8 -8
  170. package/dist/zonos-elements/p-97f848f6.entry.js +1 -0
  171. package/dist/zonos-elements/p-9H2p9XKE.js +1 -0
  172. package/dist/zonos-elements/{p-CJCoACvU.js → p-B6X55m0b.js} +2 -2
  173. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  174. package/dist/zonos-elements/{p-D31lQiWo.system.js → p-BybDGrH4.system.js} +4 -4
  175. package/dist/zonos-elements/{p-DTgv0QpG.js → p-CGkdA4pY.js} +1 -1
  176. package/dist/zonos-elements/{p-D5AtAlJx.system.js → p-CH6tsv9B.system.js} +1 -1
  177. package/dist/zonos-elements/{p-CYdt69j5.system.js → p-CQyFoOXW.system.js} +23 -23
  178. package/dist/zonos-elements/{p-B2EZRfoq.system.js → p-CVQ7-7E2.system.js} +18 -18
  179. package/dist/zonos-elements/{p-DIJaXkiE.system.js → p-Cd9xIgx7.system.js} +111 -105
  180. package/dist/zonos-elements/{p-CQqNJo0D.system.js → p-ClUEwqZW.system.js} +4 -4
  181. package/dist/zonos-elements/{p-DkpYo2Fs.js → p-CpvnCfKt.js} +1 -1
  182. package/dist/zonos-elements/p-CtKp6AQ4.js +1 -0
  183. package/dist/zonos-elements/{p-DGsEWFDU.system.js → p-CuhGrJBA.system.js} +1 -1
  184. package/dist/zonos-elements/{p-D-DawUYF.system.js → p-D2fOB4Wn.system.js} +1 -1
  185. package/dist/zonos-elements/{p-Dw-5yD9y.system.js → p-D4WI0B6-.system.js} +6 -8
  186. package/dist/zonos-elements/{p-CKTIJ2Gr.js → p-DdpeA8cH.js} +1 -1
  187. package/dist/zonos-elements/p-DkirvyAh.js +1 -0
  188. package/dist/zonos-elements/{p-DHwpNxG9.js → p-DqEtY53c.js} +1 -1
  189. package/dist/zonos-elements/{p-DjuFsKLG.js → p-MHVIIOVE.js} +1 -1
  190. package/dist/zonos-elements/{p-DPW1yXt9.system.js → p-NL_Eiq6m.system.js} +65 -65
  191. package/dist/zonos-elements/{p-Dj-O6VfM.system.js → p-UM1aYZBV.system.js} +2 -2
  192. package/dist/zonos-elements/p-a6354d15.entry.js +1 -0
  193. package/dist/zonos-elements/{p-8cd3f1e2.entry.js → p-b78bab27.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-629f09dc.system.entry.js → p-b88e521e.system.entry.js} +24 -24
  195. package/dist/zonos-elements/{p-450ed170.system.entry.js → p-b96666ca.system.entry.js} +3 -3
  196. package/dist/zonos-elements/{p-39c8a898.entry.js → p-c090cc60.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-cadf6b63.system.entry.js → p-c4713ff1.system.entry.js} +10 -10
  198. package/dist/zonos-elements/{p-ea8790aa.entry.js → p-c5f17bad.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-f57495dc.entry.js → p-cc17a230.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-7ae48e31.entry.js → p-cf53f67a.entry.js} +1 -1
  201. package/dist/zonos-elements/{p-7a5d2211.system.entry.js → p-d261f27c.system.entry.js} +15 -15
  202. package/dist/zonos-elements/{p-e101d722.system.entry.js → p-d451d5bc.system.entry.js} +4 -4
  203. package/dist/zonos-elements/{p-d33dfc78.system.entry.js → p-d9527bd7.system.entry.js} +35 -35
  204. package/dist/zonos-elements/{p-f6e0aeba.system.entry.js → p-e126e9bd.system.entry.js} +176 -176
  205. package/dist/zonos-elements/{p-e284d329.entry.js → p-e582ae2a.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-5562a955.system.entry.js → p-e9a3bc27.system.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-844a743a.entry.js → p-f44631d5.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-5836d426.system.entry.js → p-fcfac62f.system.entry.js} +1 -1
  209. package/dist/zonos-elements/p-opB7B9YB.js +1 -0
  210. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  211. package/package.json +12 -11
  212. package/dist/zonos-elements/p-2ba738ec.entry.js +0 -1
  213. package/dist/zonos-elements/p-4a54f664.entry.js +0 -1
  214. package/dist/zonos-elements/p-6f742021.entry.js +0 -1
  215. package/dist/zonos-elements/p-89ddab88.entry.js +0 -1
  216. package/dist/zonos-elements/p-C19J2XSh.js +0 -1
  217. package/dist/zonos-elements/p-LypTHRUC.js +0 -1
  218. package/dist/zonos-elements/p-adfee3a3.entry.js +0 -1
  219. package/dist/zonos-elements/p-lGLcGvEA.js +0 -1
  220. package/dist/zonos-elements/p-pfIceXbY.js +0 -1
@@ -1,4 +1,4 @@
1
- var __awaiter=this&&this.__awaiter||function(e,r,n,t){function o(e){return e instanceof n?e:new n((function(r){r(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t["throw"](e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(r){return u([e,r])}}function u(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(t=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=r.call(e,n)}catch(e){s=[6,e];o=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,r,n){if(n||arguments.length===2)for(var t=0,o=r.length,i;t<o;t++){if(i||!(t in r)){if(!i)i=Array.prototype.slice.call(r,0,t);i[t]=r[t]}}return e.concat(i||Array.prototype.slice.call(r))};System.register(["./p-CPnR_T0a.system.js","./p-DIJaXkiE.system.js","./p-BbgqQIHv.system.js","./p-zVLAvre1.system.js","./p-DW-fW8yR.system.js","./p-BSgVcCxT.system.js","./p-Cby4EkFu.system.js"],(function(e){"use strict";var r,n,t,o,i,a,s,u,d,l,c,v,f,p,m,h,w,y,g,b;return{setters:[function(e){r=e.c;n=e.z},function(e){t=e.s;o=e.t;i=e.k;a=e.l;s=e.f;u=e.d},function(e){d=e.l;l=e.b},function(e){c=e.h;v=e.l;f=e.f;p=e.g;m=e.a;h=e.s;w=e.j},function(e){y=e.i},function(e){g=e.g},function(e){b=e.e}],execute:function(){var _=this;var S=e("g",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o;return __generator(this,(function(i){switch(i.label){case 0:if(!t.checkoutSessionId){return[2/*return*/,{errors:[{message:"No checkout session id found"}],json:null}]}e=new URLSearchParams;e.set("checkoutSessionId",t.checkoutSessionId);return[4/*yield*/,c("/api/zonos-elements/get-checkout-session?".concat(e.toString()))];case 1:r=i.sent(),n=r.errors,o=r.json;return[2/*return*/,{errors:n,json:o}]}}))}))}));var O=r((function(){return{amountToApply:null,appliedAmount:null,availableBalance:null,error:null,isApplying:false,isEnabled:false,orderIdCreated:null,remainingBalance:null,useFullBalance:true}})),A=O.reset,C=O.state;e("R",C);
1
+ var __awaiter=this&&this.__awaiter||function(e,r,n,t){function o(e){return e instanceof n?e:new n((function(r){r(e)}))}return new(n||(n=Promise))((function(n,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t["throw"](e))}catch(e){i(e)}}function u(e){e.done?n(e.value):o(e.value).then(a,s)}u((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(r){return u([e,r])}}function u(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(t=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=r.call(e,n)}catch(e){s=[6,e];o=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,r,n){if(n||arguments.length===2)for(var t=0,o=r.length,i;t<o;t++){if(i||!(t in r)){if(!i)i=Array.prototype.slice.call(r,0,t);i[t]=r[t]}}return e.concat(i||Array.prototype.slice.call(r))};System.register(["./p-CPnR_T0a.system.js","./p-Cd9xIgx7.system.js","./p-BbgqQIHv.system.js","./p-zVLAvre1.system.js","./p-DW-fW8yR.system.js","./p-BSgVcCxT.system.js","./p-Cby4EkFu.system.js"],(function(e){"use strict";var r,n,t,o,i,a,s,u,d,l,c,v,f,p,m,h,w,y,g,b;return{setters:[function(e){r=e.c;n=e.z},function(e){t=e.s;o=e.t;i=e.m;a=e.l;s=e.f;u=e.e},function(e){d=e.l;l=e.b},function(e){c=e.h;v=e.l;f=e.f;p=e.g;m=e.a;h=e.s;w=e.j},function(e){y=e.i},function(e){g=e.g},function(e){b=e.e}],execute:function(){var _=this;var S=e("g",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o;return __generator(this,(function(i){switch(i.label){case 0:if(!t.checkoutSessionId){return[2/*return*/,{errors:[{message:"No checkout session id found"}],json:null}]}e=new URLSearchParams;e.set("checkoutSessionId",t.checkoutSessionId);return[4/*yield*/,c("/api/zonos-elements/get-checkout-session?".concat(e.toString()))];case 1:r=i.sent(),n=r.errors,o=r.json;return[2/*return*/,{errors:n,json:o}]}}))}))}));var O=r((function(){return{amountToApply:null,appliedAmount:null,availableBalance:null,error:null,isApplying:false,isEnabled:false,orderIdCreated:null,remainingBalance:null,useFullBalance:true}})),A=O.reset,C=O.state;e("R",C);
2
2
  /**
3
3
  * Reset store credit store to initial state
4
4
  */var k=e("S",(function(){A()}));
@@ -24,12 +24,12 @@ var __awaiter=this&&this.__awaiter||function(e,r,n,t){function o(e){return e ins
24
24
  * Validates against available balance and cart total
25
25
  */var N=e("a5",(function(e){if(e===null){C.amountToApply=null;C.error=null;return}
26
26
  // Validate amount
27
- if(e<=0){C.error="Amount must be greater than zero";return}if(C.availableBalance!==null&&e>C.availableBalance){C.error="Amount exceeds available balance";return}var r=Xe.total+(Xe.storeCredit||0);if(e>r){C.error="Amount exceeds order total";return}C.error=null;C.amountToApply=e}));
27
+ if(e<=0){C.error="Amount must be greater than zero";return}if(C.availableBalance!==null&&e>C.availableBalance){C.error="Amount exceeds available balance";return}var r=Qe.total+(Qe.storeCredit||0);if(e>r){C.error="Amount exceeds order total";return}C.error=null;C.amountToApply=e}));
28
28
  /**
29
29
  * Toggle whether to use full balance or custom amount.
30
30
  * When switching to custom mode, clears the applied amount so the user
31
31
  * must explicitly apply via the Apply button.
32
- */var j=e("a3",(function(e){C.useFullBalance=e;C.error=null;if(e&&C.availableBalance!==null){var r=Xe.total+(Xe.storeCredit||0);var n=Math.min(C.availableBalance,r);C.amountToApply=n}else if(!e){C.amountToApply=null}}));
32
+ */var j=e("a3",(function(e){C.useFullBalance=e;C.error=null;if(e&&C.availableBalance!==null){var r=Qe.total+(Qe.storeCredit||0);var n=Math.min(C.availableBalance,r);C.amountToApply=n}else if(!e){C.amountToApply=null}}));
33
33
  /**
34
34
  * Get the storeCreditApplication input for checkout session update.
35
35
  * Sends mode: 'NONE' when store credit is not being used to clear any
@@ -37,7 +37,7 @@ if(e<=0){C.error="Amount must be greater than zero";return}if(C.availableBalance
37
37
  */var D=function(){if(!C.isEnabled||C.amountToApply===null){return{mode:"NONE"}}if(C.useFullBalance){return{mode:"FULL"}}return{amount:C.amountToApply,mode:"PARTIAL"}};
38
38
  /**
39
39
  * Get the effective amount to apply based on settings
40
- */var L=e("K",(function(){if(!C.isEnabled||C.availableBalance===null){return 0}if(C.useFullBalance){return Math.min(C.availableBalance,Xe.total+(Xe.storeCredit||0))}return C.amountToApply||0}));
40
+ */var L=e("K",(function(){if(!C.isEnabled||C.availableBalance===null){return 0}if(C.useFullBalance){return Math.min(C.availableBalance,Qe.total+(Qe.storeCredit||0))}return C.amountToApply||0}));
41
41
  /**
42
42
  * Check whether the effective store credit amount covers the full order total.
43
43
  * When true, the Stripe/PayPal payment flow should be skipped and
@@ -46,14 +46,14 @@ if(e<=0){C.error="Amount must be greater than zero";return}if(C.availableBalance
46
46
  * Relies on the backend's computed `cartStore.total` (remaining amount to pay
47
47
  * after store credit) rather than a client-side comparison, which avoids issues
48
48
  * with currency mismatches or rounding.
49
- */var R=e("B",(function(){
49
+ */var x=e("B",(function(){
50
50
  // Only consider full coverage after the backend has confirmed store credit
51
51
  // was applied (cartStore.storeCredit > 0) and the remaining total is 0.
52
- return C.amountToApply!==null&&C.amountToApply>0&&Xe.storeCredit>0&&Xe.total<=0}));
52
+ return C.amountToApply!==null&&C.amountToApply>0&&Qe.storeCredit>0&&Qe.total<=0}));
53
53
  /**
54
54
  * Create an order paid entirely by store credit.
55
55
  * Should only be called when `storeCreditStoreCoversFullAmount()` is true.
56
- */var x=e("D",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,a,s,u,l,f,p,l;return __generator(this,(function(m){switch(m.label){case 0:o=t.checkoutSessionId;if(!o){i="No checkout session found";v(i);C.error=i;return[2/*return*/,{error:i,orderId:null,success:false}]}d("Creating store credit order","info",{checkoutSessionId:o});m.label=1;case 1:m.trys.push([1,3,,4]);return[4/*yield*/,c("/api/zonos-elements/store-credit/order-create",{body:{checkoutSessionId:o},method:"POST"})];case 2:a=m.sent(),s=a.errors,u=a.json;if(s.length>0||!u){l=((e=s[0])===null||e===void 0?void 0:e.message)||"Failed to create store credit order";v(l);C.error=l;return[2/*return*/,{error:l,orderId:null,success:false}]}f=((n=(r=u.checkoutSessionStoreCreditOrderCreate)===null||r===void 0?void 0:r.order)===null||n===void 0?void 0:n.id)||null;C.orderIdCreated=f;d("Store credit order created","info",{orderId:f});return[2/*return*/,{error:null,orderId:f,success:true}];case 3:p=m.sent();l=p instanceof Error?p.message:"Failed to create store credit order";v(l);C.error=l;return[2/*return*/,{error:l,orderId:null,success:false}];case 4:return[2/*return*/]}}))}))}));var U=["termsAndConditions","privacyPolicy","refundPolicy","shippingPolicy","warrantyPolicy"];
56
+ */var R=e("D",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,a,s,u,l,f,p,l;return __generator(this,(function(m){switch(m.label){case 0:o=t.checkoutSessionId;if(!o){i="No checkout session found";v(i);C.error=i;return[2/*return*/,{error:i,orderId:null,success:false}]}d("Creating store credit order","info",{checkoutSessionId:o});m.label=1;case 1:m.trys.push([1,3,,4]);return[4/*yield*/,c("/api/zonos-elements/store-credit/order-create",{body:{checkoutSessionId:o},method:"POST"})];case 2:a=m.sent(),s=a.errors,u=a.json;if(s.length>0||!u){l=((e=s[0])===null||e===void 0?void 0:e.message)||"Failed to create store credit order";v(l);C.error=l;return[2/*return*/,{error:l,orderId:null,success:false}]}f=((n=(r=u.checkoutSessionStoreCreditOrderCreate)===null||r===void 0?void 0:r.order)===null||n===void 0?void 0:n.id)||null;C.orderIdCreated=f;d("Store credit order created","info",{orderId:f});return[2/*return*/,{error:null,orderId:f,success:true}];case 3:p=m.sent();l=p instanceof Error?p.message:"Failed to create store credit order";v(l);C.error=l;return[2/*return*/,{error:l,orderId:null,success:false}];case 4:return[2/*return*/]}}))}))}));var U=["termsAndConditions","privacyPolicy","refundPolicy","shippingPolicy","warrantyPolicy"];
57
57
  // Reuses the lowercase `'Privacy policy'` key already translated in 19 locales
58
58
  // (also used by the checkout footer) — the other four are new keys that follow
59
59
  // the same lowercase convention for visual consistency in the joined consent line.
@@ -91,28 +91,28 @@ var d=Y({currentAddress:s,translatedAddress:le.translatedAddress.address});var l
91
91
  // the address as complete when both fields are filled.
92
92
  firstName:m,lastName:h,phone:f.phone},
93
93
  // Use the first item's currency code
94
- cartCurrencyCode:(r=Xe.items[0])===null||r===void 0?void 0:r.currencyCode,cartId:e,checkoutSessionCountry:w||a.selectedCountryCode||undefined,checkoutSessionId:t.checkoutSessionId||"",contact:{companyName:le.companyName,email:o===null||o===void 0?void 0:o.value.email,
94
+ cartCurrencyCode:(r=Qe.items[0])===null||r===void 0?void 0:r.currencyCode,cartId:e,checkoutSessionCountry:w||a.selectedCountryCode||undefined,checkoutSessionId:t.checkoutSessionId||"",contact:{companyName:le.companyName,email:o===null||o===void 0?void 0:o.value.email,
95
95
  // firstName and lastName should be valid now since stripe only mark
96
96
  // the address as complete when both fields are filled.
97
- firstName:c,lastName:v,phone:d.phone},isTest:!!n,landedCostAdjustments:Xe.promoCode?[{amount:0,productId:null,promoCode:Xe.promoCode,sku:null,type:"PROMO_CODE"}]:[],shipToShortAddressCode:le.shortAddressCode,shipToTaxId:le.taxId,shippingAddress:{addressLine1:d.line1,addressLine2:d.line2,city:d.city,country:d.country,postalCode:d.postal_code,state:d.state}}};var K=function(){var e=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";
97
+ firstName:c,lastName:v,phone:d.phone},isTest:!!n,landedCostAdjustments:Qe.promoCode?[{amount:0,productId:null,promoCode:Qe.promoCode,sku:null,type:"PROMO_CODE"}]:[],shipToShortAddressCode:le.shortAddressCode,shipToTaxId:le.taxId,shippingAddress:{addressLine1:d.line1,addressLine2:d.line2,city:d.city,country:d.country,postalCode:d.postal_code,state:d.state}}};var K=function(){var e=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";
98
98
  // maybe we don't need email now for prefetch the landed cost
99
99
  var r=le.stripeLinkEventData;var n=le.stripeAddressEventData;var o=le.stripeShippingSameAsBilling?le.stripeAddressEventData:le.stripeBillingAddressEventData;d({stripeAddressData:n,stripeBillingAddressData:o},"info");if(!n||!o){throw new Error("Missing stripe address data")}
100
100
  // Attempt to get translated address if available
101
- var i=Y({currentAddress:n,translatedAddress:le.translatedAddress.address});var a=W({name:i.name}),s=a.firstName,u=a.lastName;var l=Y({currentAddress:o,translatedAddress:le.translatedAddress.address});var c=W({name:l.name}),v=c.firstName,f=c.lastName;var p=Xe.adjustments.map((function(e){return{amount:e.amount,name:e.description||null,productId:e.productId,sku:e.sku,type:e.type}}));var m=Xe.promoCode?__spreadArray([{amount:0,productId:null,promoCode:Xe.promoCode,sku:null,type:"PROMO_CODE"}],p,true):p;return{billingAddress:{addressLine1:l.line1,addressLine2:l.line2||"",city:l.city,country:l.country,postalCode:l.postal_code,state:l.state},billingContact:{
101
+ var i=Y({currentAddress:n,translatedAddress:le.translatedAddress.address});var a=W({name:i.name}),s=a.firstName,u=a.lastName;var l=Y({currentAddress:o,translatedAddress:le.translatedAddress.address});var c=W({name:l.name}),v=c.firstName,f=c.lastName;var p=Qe.adjustments.map((function(e){return{amount:e.amount,name:e.description||null,productId:e.productId,sku:e.sku,type:e.type}}));var m=Qe.promoCode?__spreadArray([{amount:0,productId:null,promoCode:Qe.promoCode,sku:null,type:"PROMO_CODE"}],p,true):p;return{billingAddress:{addressLine1:l.line1,addressLine2:l.line2||"",city:l.city,country:l.country,postalCode:l.postal_code,state:l.state},billingContact:{
102
102
  // firstName and lastName should be valid now since stripe only mark
103
103
  // the address as complete when both fields are filled.
104
104
  firstName:v,lastName:f,phone:l.phone},checkoutSessionId:t.checkoutSessionId||"",contact:{companyName:le.companyName,email:r===null||r===void 0?void 0:r.value.email,
105
105
  // firstName and lastName should be valid now since stripe only mark
106
106
  // the address as complete when both fields are filled.
107
- firstName:s,lastName:u,phone:i.phone},isTest:e,items:Xe.items,landedCostAdjustments:m,shipToShortAddressCode:le.shortAddressCode,shipToTaxId:le.taxId,shippingAddress:{addressLine1:i.line1,addressLine2:i.line2,city:i.city,country:i.country,postalCode:i.postal_code,state:i.state}}};var V=function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i,a,s,u,d,l;return __generator(this,(function(v){switch(v.label){case 0:a=K();return[4/*yield*/,e({billingAddress:a.billingAddress,billingContact:a.billingContact,checkoutSessionId:a.checkoutSessionId,contact:a.contact,landedCostAdjustments:a.landedCostAdjustments,
107
+ firstName:s,lastName:u,phone:i.phone},isTest:e,items:Qe.items,landedCostAdjustments:m,shipToShortAddressCode:le.shortAddressCode,shipToTaxId:le.taxId,shippingAddress:{addressLine1:i.line1,addressLine2:i.line2,city:i.city,country:i.country,postalCode:i.postal_code,state:i.state}}};var V=function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i,a,s,u,d,l;return __generator(this,(function(v){switch(v.label){case 0:a=K();return[4/*yield*/,e({billingAddress:a.billingAddress,billingContact:a.billingContact,checkoutSessionId:a.checkoutSessionId,contact:a.contact,landedCostAdjustments:a.landedCostAdjustments,
108
108
  // zonosApiKey should always be available
109
- publicCredential:window.Zonos.zonosApiKey||"",shippingAddress:a.shippingAddress,zonosApiRoute:f["vercel"]},{promoCode:Xe.promoCode})];case 1:s=v.sent();if(!s||
109
+ publicCredential:window.Zonos.zonosApiKey||"",shippingAddress:a.shippingAddress,zonosApiRoute:f["vercel"]},{promoCode:Qe.promoCode})];case 1:s=v.sent();if(!s||
110
110
  // Only show errors if there are no rate back (checkoutSessionWorkflow) and there are errors
111
111
  !((r=s.checkoutSessionWorkflow)===null||r===void 0?void 0:r.length)&&((n=s.errors)===null||n===void 0?void 0:n.length)){throw new Error("Failed to build landed cost: ".concat(((o=(t=s===null||s===void 0?void 0:s.errors)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.message)||"Unknown error"))}return[4/*yield*/,c("/api/zonos-elements/validate-landed-cost",{body:s,headers:{"Content-Type":"application/json"},method:"POST"})];case 2:u=v.sent(),d=u.errors,l=u.json;if(!l||d.length){throw new Error("Invalid landed cost object: ".concat(((i=d.find(Boolean))===null||i===void 0?void 0:i.message)||"Unknown error"))}return[2/*return*/,s]}}))}))};var G=function(e){return __awaiter(_,void 0,void 0,(function(){var r,t,o,i,a,s,u;return __generator(this,(function(d){switch(d.label){case 0:t=n.checkoutSettings.buildLandedCost;if(!t)return[3/*break*/,2];return[4/*yield*/,V(t)];case 1:o=d.sent();return[2/*return*/,o];case 2:return[4/*yield*/,c("/api/zonos-elements/calculate-landed-cost",{body:K(),method:"POST",signal:e===null||e===void 0?void 0:e.signal})];case 3:i=d.sent(),a=i.errors,s=i.json;if(a.length||!s){u=((r=a[0])===null||r===void 0?void 0:r.message)==="The user aborted a request.";if(u){throw new Error("The landed cost calculation request was aborted to initiate a new one.")}
112
112
  // We want to show any successful quotes even if there are errors
113
113
  a.forEach((function(e){
114
114
  // eslint-disable-next-line no-console
115
- console.warn("Error calculating landed cost: ".concat(e.message))}));if(!s){throw new Error("Failed to calculate landed cost")}return[2/*return*/,s]}return[2/*return*/,s]}}))}))};var X=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,t,o,i,a,s,u,d,l;var v=e.abortController,f=e.cartId;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,c("/api/zonos-elements/cart-calculate-landed-cost",{body:H(f),method:"POST",signal:v===null||v===void 0?void 0:v.signal})];case 1:a=e.sent(),s=a.errors,u=a.json;if(s.length||!u){d=typeof((r=s[0])===null||r===void 0?void 0:r.message)==="string"&&(((n=s[0])===null||n===void 0?void 0:n.message)==="The user aborted a request."||((t=s[0])===null||t===void 0?void 0:t.message.includes("signal is aborted"))||((o=s[0])===null||o===void 0?void 0:o.message.includes("The operation was aborted"))||((i=s[0])===null||i===void 0?void 0:i.message.includes("Fetch is aborted")));l=d?"The landed cost calculation request was aborted to initiate a new one.":"Failed to calculate landed cost";throw new Error(l)}return[2/*return*/,u]}}))}))};var Q=undefined&&undefined.__rest||function(e,r){var n={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0)n[t]=e[t];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o]))n[t[o]]=e[t[o]]}return n};var Z=function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i;return __generator(this,(function(a){switch(a.label){case 0:r=window.Zonos.cartId;if(!!r)return[3/*break*/,2];return[4/*yield*/,G(e)];case 1:n=a.sent();return[2/*return*/,n];case 2:return[4/*yield*/,X({abortController:e,cartId:r})];case 3:t=a.sent(),o=t.cartWorkflow,i=Q(t,["cartWorkflow"]);return[2/*return*/,Object.assign(Object.assign({},i),{itemCreateWorkflow:o.items})]}}))}))};var $=e("t",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,t,o,i,s,u,d,v,f;var w=e.checkoutSessionId,y=e.eventName,g=e.metadata;return __generator(this,(function(e){switch(e.label){case 0:o=Date.now();i=__spreadArray([],window.Zonos.trackEventLogs,true);window.Zonos.trackEventLogs.push({checkoutSessionId:w,eventCreated:o,eventName:y});s=
115
+ console.warn("Error calculating landed cost: ".concat(e.message))}));if(!s){throw new Error("Failed to calculate landed cost")}return[2/*return*/,s]}return[2/*return*/,s]}}))}))};var Q=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,t,o,i,a,s,u,d,l;var v=e.abortController,f=e.cartId;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,c("/api/zonos-elements/cart-calculate-landed-cost",{body:H(f),method:"POST",signal:v===null||v===void 0?void 0:v.signal})];case 1:a=e.sent(),s=a.errors,u=a.json;if(s.length||!u){d=typeof((r=s[0])===null||r===void 0?void 0:r.message)==="string"&&(((n=s[0])===null||n===void 0?void 0:n.message)==="The user aborted a request."||((t=s[0])===null||t===void 0?void 0:t.message.includes("signal is aborted"))||((o=s[0])===null||o===void 0?void 0:o.message.includes("The operation was aborted"))||((i=s[0])===null||i===void 0?void 0:i.message.includes("Fetch is aborted")));l=d?"The landed cost calculation request was aborted to initiate a new one.":"Failed to calculate landed cost";throw new Error(l)}return[2/*return*/,u]}}))}))};var X=undefined&&undefined.__rest||function(e,r){var n={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0)n[t]=e[t];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o]))n[t[o]]=e[t[o]]}return n};var Z=function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i;return __generator(this,(function(a){switch(a.label){case 0:r=window.Zonos.cartId;if(!!r)return[3/*break*/,2];return[4/*yield*/,G(e)];case 1:n=a.sent();return[2/*return*/,n];case 2:return[4/*yield*/,Q({abortController:e,cartId:r})];case 3:t=a.sent(),o=t.cartWorkflow,i=X(t,["cartWorkflow"]);return[2/*return*/,Object.assign(Object.assign({},i),{itemCreateWorkflow:o.items})]}}))}))};var $=e("t",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,t,o,i,s,u,d,v,f;var w=e.checkoutSessionId,y=e.eventName,g=e.metadata;return __generator(this,(function(e){switch(e.label){case 0:o=Date.now();i=__spreadArray([],window.Zonos.trackEventLogs,true);window.Zonos.trackEventLogs.push({checkoutSessionId:w,eventCreated:o,eventName:y});s=
116
116
  // if the url includes zonos.com and not hosted checkout (checkout.zonos.com), it means we are on the development site (dashboard, preview zonos domain or main zonos.com)
117
117
  window.location.href.includes("zonos.com")&&!window.location.href.includes("checkout.zonos.com")||!!((r=window.Zonos)===null||r===void 0?void 0:r.zonosQaUrl)||!!((t=window.Zonos)===null||t===void 0?void 0:t.debug);u=p()||m();if((u||s)&&
118
118
  // if found, it means we want to test the conversion event in development site, or test mode and staging mode
@@ -202,17 +202,17 @@ le.stripe=window.Zonos.stripe}));var we=function(){var e,r,n,t;var o=JSON.string
202
202
  /**
203
203
  * If user updates the address after prefetching the landed cost, should always create and attach
204
204
  * @caveat this will cause the scenario goes wrong after prefetching landed cost, with the current logic, it won't create party because nothing change after the prefetch happened
205
- */var u=(e=Xe.partiesData.find((function(e){return e.type==="DESTINATION"})))===null||e===void 0?void 0:e.id;var d=(r=Xe.partiesData.find((function(e){return e.type==="PAYOR"})))===null||r===void 0?void 0:r.id;
205
+ */var u=(e=Qe.partiesData.find((function(e){return e.type==="DESTINATION"})))===null||e===void 0?void 0:e.id;var d=(r=Qe.partiesData.find((function(e){return e.type==="PAYOR"})))===null||r===void 0?void 0:r.id;
206
206
  // If haven't prefetched landed cost, there is no need to update address async
207
207
  if(!u||!d){return false}
208
208
  // If we don't have landed cost parties data, should way
209
209
  if(le.partyShippingId!==u||le.partyBillingId!==d){return true}var l=JSON.stringify((n=le.stripeLinkUsedWhenFetchingLC)===null||n===void 0?void 0:n.value)!==JSON.stringify((t=le.stripeLinkEventData)===null||t===void 0?void 0:t.value);var c=JSON.stringify((o=le.stripeAddressUsedWhenAsyncAddressUpdate)===null||o===void 0?void 0:o.value)!==JSON.stringify((i=le.stripeAddressEventData)===null||i===void 0?void 0:i.value);var v=!le.stripeShippingSameAsBilling&&JSON.stringify((a=le.stripeBillingAddressUsedWhenAsyncAddressUpdate)===null||a===void 0?void 0:a.value)!==JSON.stringify((s=le.stripeBillingAddressEventData)===null||s===void 0?void 0:s.value);var f=le.taxIdUsedWhenAsyncAddressUpdate!==le.taxId;var p=le.companyNameUsedWhenAsyncAddressUpdate!==le.companyName;return l||c||v||f||p};var ge=e("a0",(function(e){var r=e.address,n=e.firstName,o=e.lastName,i=e.name,a=e.phone;var s=W({firstName:n,lastName:o,name:i}),u=s.firstName,d=s.lastName;if(!u||!d){void h({endpoint:"PARTY_CREATE_NO_NAME_FOUND",errors:["No name found"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:t.checkoutSessionId,firstName:n,lastName:o,name:i}})}if(!a){void h({endpoint:"PARTY_CREATE_NO_PHONE_FOUND",errors:["No phone found"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:t.checkoutSessionId,phone:a}})}return{city:r.city,country:r.country,firstName:u,lastName:d,line1:r.line1,line2:r.line2,phone:a||"",postal_code:r.postal_code,state:r.state}}));var be=e("X",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,a,s,u,d,f,p,m;return __generator(this,(function(w){switch(w.label){case 0:if(!((e=le.stripeAddressEventData)===null||e===void 0?void 0:e.complete)||!le.stripeShippingSameAsBilling&&!((r=le.stripeBillingAddressEventData)===null||r===void 0?void 0:r.complete)||!le.stripeBillingAddressEventData){return[2/*return*/,{partiesCreated:false}]}
210
210
  // If there is no landed cost data, no need to create parties
211
- if(!Xe.landedCostData){return[2/*return*/,{partiesCreated:false}]}i=(n=Xe.landedCostData.find(Boolean))===null||n===void 0?void 0:n.landedCost.rootId;if(!i){
211
+ if(!Qe.landedCostData){return[2/*return*/,{partiesCreated:false}]}i=(n=Qe.landedCostData.find(Boolean))===null||n===void 0?void 0:n.landedCost.rootId;if(!i){
212
212
  // do nothing if we don't have selected landed cost
213
213
  void h({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:t.checkoutSessionId}});return[2/*return*/,{partiesCreated:false}]}a=ye();if(!a){return[2/*return*/,{partiesCreated:false}]}s=ge({address:le.stripeAddressEventData.value.address,firstName:le.stripeAddressEventData.value.firstName,lastName:le.stripeAddressEventData.value.lastName,name:le.stripeAddressEventData.value.name,phone:le.stripeAddressEventData.value.phone});u=le.stripeShippingSameAsBilling?s:ge({address:le.stripeBillingAddressEventData.value.address,firstName:le.stripeBillingAddressEventData.value.firstName,lastName:le.stripeBillingAddressEventData.value.lastName,name:le.stripeBillingAddressEventData.value.name,phone:le.stripeBillingAddressEventData.value.phone});d=new URLSearchParams(window.location.search).get("zonosE2ETest")==="1";return[4/*yield*/,c("/api/zonos-elements/create-parties",{body:{address:s,billingAddress:u,companyName:le.companyName,email:((o=le.stripeLinkEventData)===null||o===void 0?void 0:o.value.email)||"",isTest:d,rootId:i,shortAddressCode:le.shortAddressCode,taxId:le.taxId},method:"POST"})];case 1:f=w.sent(),p=f.errors,m=f.json;if(p.length||!m){v("Error occurs when creating parties",JSON.stringify(p,null,2));void h({endpoint:"PF_PARTY_CREATE_FAILED",errors:["Failed to create parties"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:t.checkoutSessionId,errors:p,json:m}});return[2/*return*/,{partiesCreated:false}]}le.companyNameUsedWhenAsyncAddressUpdate=le.companyName;le.stripeAddressUsedWhenAsyncAddressUpdate=le.stripeAddressEventData;le.stripeBillingAddressUsedWhenAsyncAddressUpdate=le.stripeBillingAddressEventData;le.taxIdUsedWhenAsyncAddressUpdate=le.taxId;le.partyBillingId=m.billToPartyId;le.partyShippingId=m.shipToPartyId;
214
214
  // Update parties data with the new parties id
215
- Xe.partiesData=Xe.partiesData.map((function(e){if(e.type==="DESTINATION"&&e.id!==m.shipToPartyId){return Object.assign(Object.assign({},e),{id:m.shipToPartyId})}if(e.type==="PAYOR"&&e.id!==m.billToPartyId){return Object.assign(Object.assign({},e),{id:m.billToPartyId})}return e}));return[2/*return*/,{partiesCreated:true}]}}))}))}));
215
+ Qe.partiesData=Qe.partiesData.map((function(e){if(e.type==="DESTINATION"&&e.id!==m.shipToPartyId){return Object.assign(Object.assign({},e),{id:m.shipToPartyId})}if(e.type==="PAYOR"&&e.id!==m.billToPartyId){return Object.assign(Object.assign({},e),{id:m.billToPartyId})}return e}));return[2/*return*/,{partiesCreated:true}]}}))}))}));
216
216
  /**
217
217
  * Extract only the necessary address info for landed cost prefetch
218
218
  */var _e=function(e){return{countryCode:e.address.country,postalCode:e.address.postal_code,state:e.address.state}};var Se=function(){var e,r;var n=JSON.stringify((e=le.stripeLinkUsedWhenFetchingLC)===null||e===void 0?void 0:e.value)!==JSON.stringify((r=le.stripeLinkEventData)===null||r===void 0?void 0:r.value);var t=le.stripeAddressEventData&&JSON.stringify(_e(le.stripeAddressEventData.value))!==JSON.stringify(le.stripeAddressUsedWhenFetchingLC);var o=!le.stripeShippingSameAsBilling&&le.stripeBillingAddressEventData&&JSON.stringify(_e(le.stripeBillingAddressEventData.value))!==JSON.stringify(le.stripeBillingAddressUsedWhenFetchingLC);return n||t||o};
@@ -221,28 +221,28 @@ Xe.partiesData=Xe.partiesData.map((function(e){if(e.type==="DESTINATION"&&e.id!=
221
221
  * Purpose is to resend the request if the info used when fetching landed cost is different from the current info
222
222
  */var Oe=function(){var e;
223
223
  // Mark the landed cost is outdated since the item total amount has changed (items total didn't match with the cart subtotal)
224
- var r=Xe.landedCostData&&((e=Xe.landedCostData.find(Boolean))===null||e===void 0?void 0:e.subtotals.items)!==Xe.subtotal;var n=Se();d("isPrefetchInfoOutdated","info",{isAddressOutdated:n});
224
+ var r=Qe.landedCostData&&((e=Qe.landedCostData.find(Boolean))===null||e===void 0?void 0:e.subtotals.items)!==Qe.subtotal;var n=Se();d("isPrefetchInfoOutdated","info",{isAddressOutdated:n});
225
225
  // if landed cost data is not available, we need to fetch it
226
- return!Xe.landedCostData&&!le.isFetchingLandedCost||n||r};var Ae=e("W",(function(e){var r,t;var o=(r=n.genericSettings)===null||r===void 0?void 0:r.countryFields;var i=(t=n.genericSettings)===null||t===void 0?void 0:t.stripeCountryFieldLabels;var a=i&&e in i?i[e]:null;var s=o&&e in o?o[e]:null;
226
+ return!Qe.landedCostData&&!le.isFetchingLandedCost||n||r};var Ae=e("W",(function(e){var r,t;var o=(r=n.genericSettings)===null||r===void 0?void 0:r.countryFields;var i=(t=n.genericSettings)===null||t===void 0?void 0:t.stripeCountryFieldLabels;var a=i&&e in i?i[e]:null;var s=o&&e in o?o[e]:null;
227
227
  /**
228
228
  * If the address form is using Stripe component, use Stripe country field label if there is one, if not just use one from our countryFieldLabel data
229
229
  * stripeCountryFieldLabels is the list we collect from Stripe, and extract only country that state/zip is required and different from what we have in our countryFieldLabel data
230
- **/if(Xe.addressFormRenderType==="stripe"){return a||s}return s}));var Ce=function(){var e,r,n,t;var o=!!((e=le.stripeLinkEventData)===null||e===void 0?void 0:e.complete);var i=!!((r=le.stripeAddressEventData)===null||r===void 0?void 0:r.complete);var a=le.stripeShippingSameAsBilling?i:!!((n=le.stripeBillingAddressEventData)===null||n===void 0?void 0:n.complete);var s=((t=le.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country)||"US";var u=Ae(s);if(i&&a&&o){return true}
230
+ **/if(Qe.addressFormRenderType==="stripe"){return a||s}return s}));var Ce=function(){var e,r,n,t;var o=!!((e=le.stripeLinkEventData)===null||e===void 0?void 0:e.complete);var i=!!((r=le.stripeAddressEventData)===null||r===void 0?void 0:r.complete);var a=le.stripeShippingSameAsBilling?i:!!((n=le.stripeBillingAddressEventData)===null||n===void 0?void 0:n.complete);var s=((t=le.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country)||"US";var u=Ae(s);if(i&&a&&o){return true}
231
231
  // Only send landed cost request if the address is complete when we can't get the country field
232
232
  if(!u||!le.stripeAddressEventData){return i&&a&&o}var d=le.stripeAddressEventData.value.address.line1.length>0;var l=le.stripeAddressEventData.value.firstName&&le.stripeAddressEventData.value.lastName;var c=!u.stateRequired||u.stateRequired&&le.stripeAddressEventData.value.address.state.length>0;var v=!u.zipRequired||u.zipRequired&&le.stripeAddressEventData.value.address.postal_code.length>=3;var f=le.stripeAddressEventData.value.phone&&le.stripeAddressEventData.value.phone.length>0;return o&&l&&d&&c&&v&&f};var ke=function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,a,s,u,d,l,c;return __generator(this,(function(v){switch(v.label){case 0:r=new AbortController;le.fetchingLandedCostAbortController=r;
233
233
  // Reset cart items to non-restricted state and restricted item list
234
234
  pr();return[4/*yield*/,Z(r)];case 1:n=v.sent(),o=n.checkoutSessionWorkflow,i=n.errors,a=n.itemCreateWorkflow,s=n.landedCostCalculateWorkflow,u=n.partyCreateWorkflow,d=n.shipmentRatingCalculateWorkflow;
235
235
  // Surface a custom "no quote" message when either a rule (ruleMessageType CUSTOM) or a country
236
236
  // constraint (source COUNTRY_CONSTRAINT) blocked shipment rating with an authored message.
237
- Xe.customQuotingError=((e=i===null||i===void 0?void 0:i.find((function(e){var r,n;return((r=e.extensions)===null||r===void 0?void 0:r.ruleMessageType)==="CUSTOM"||((n=e.extensions)===null||n===void 0?void 0:n.source)==="COUNTRY_CONSTRAINT"})))===null||e===void 0?void 0:e.message)||null;Xe.shippingData=ne((d===null||d===void 0?void 0:d.filter(Boolean))||[]);
237
+ Qe.customQuotingError=((e=i===null||i===void 0?void 0:i.find((function(e){var r,n;return((r=e.extensions)===null||r===void 0?void 0:r.ruleMessageType)==="CUSTOM"||((n=e.extensions)===null||n===void 0?void 0:n.source)==="COUNTRY_CONSTRAINT"})))===null||e===void 0?void 0:e.message)||null;Qe.shippingData=ne((d===null||d===void 0?void 0:d.filter(Boolean))||[]);
238
238
  // check and update cart items with restrictions
239
239
  er(a);
240
240
  // reset abort controller after we are done
241
- le.fetchingLandedCostAbortController=null;Xe.partiesData=(u===null||u===void 0?void 0:u.filter(Boolean))||[];
241
+ le.fetchingLandedCostAbortController=null;Qe.partiesData=(u===null||u===void 0?void 0:u.filter(Boolean))||[];
242
242
  // update cart store with landed cost info
243
- Xe.landedCostData=(o===null||o===void 0?void 0:o.map((function(e){var r=s===null||s===void 0?void 0:s.find((function(r){return(r===null||r===void 0?void 0:r.id)===e.landedCostId}));if(!r){return null}return Object.assign(Object.assign({},e),{landedCost:r})})).filter(Boolean))||[];l=t.checkoutSessionId;if(o===null||o===void 0?void 0:o.length){void $({checkoutSessionId:l,eventName:"checkout_quoteReceived"})}c=Xe.promoCodeApplied&&!Xe.landedCostData.find((function(e){var r;return(r=e.landedCost.appliedAdjustments)===null||r===void 0?void 0:r.find((function(e){return e.type==="PROMO_CODE"}))}));Xe.promoCodeError=c;
243
+ Qe.landedCostData=(o===null||o===void 0?void 0:o.map((function(e){var r=s===null||s===void 0?void 0:s.find((function(r){return(r===null||r===void 0?void 0:r.id)===e.landedCostId}));if(!r){return null}return Object.assign(Object.assign({},e),{landedCost:r})})).filter(Boolean))||[];l=t.checkoutSessionId;if(o===null||o===void 0?void 0:o.length){void $({checkoutSessionId:l,eventName:"checkout_quoteReceived"})}c=Qe.promoCodeApplied&&!Qe.landedCostData.find((function(e){var r;return(r=e.landedCost.appliedAdjustments)===null||r===void 0?void 0:r.find((function(e){return e.type==="PROMO_CODE"}))}));Qe.promoCodeError=c;
244
244
  // When promocode is valid, set promoCode to session storage so if user close the modal, we can still reapply for them
245
- if(!c){sessionStorage.setItem("zonos--promo-code",Xe.promoCode)}return[2/*return*/]}}))}))};var Ie=e("w",(function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i,a,s,u,d,l,c,f,p,m;return __generator(this,(function(w){switch(w.label){case 0:i=(e===null||e===void 0?void 0:e.retries)||0;a=!!(e===null||e===void 0?void 0:e.applyingPromocode);s=Oe();u=Ce();
245
+ if(!c){sessionStorage.setItem("zonos--promo-code",Qe.promoCode)}return[2/*return*/]}}))}))};var Ie=e("w",(function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,t,o,i,a,s,u,d,l,c,f,p,m;return __generator(this,(function(w){switch(w.label){case 0:i=(e===null||e===void 0?void 0:e.retries)||0;a=!!(e===null||e===void 0?void 0:e.applyingPromocode);s=Oe();u=Ce();
246
246
  // Should not do anything if the address is not ready to request landed cost
247
247
  if(!u){return[2/*return*/,{isRequestNotReady:true}]}if(s){
248
248
  // if the info used when fetching landed cost is different from the current info, abort the previous request
@@ -256,25 +256,25 @@ pr();
256
256
  // fetch and apply landed cost
257
257
  return[4/*yield*/,ke()];case 2:
258
258
  // fetch and apply landed cost
259
- w.sent();d=(n=Xe.shippingData)===null||n===void 0?void 0:n.find(Boolean);l=(t=Xe.landedCostData)===null||t===void 0?void 0:t.find((function(e){return e.landedCost.shipmentRating.id===(d===null||d===void 0?void 0:d.id)}));c=!!l?l.subtotals:null;if(c){
259
+ w.sent();d=(n=Qe.shippingData)===null||n===void 0?void 0:n.find(Boolean);l=(t=Qe.landedCostData)===null||t===void 0?void 0:t.find((function(e){return e.landedCost.shipmentRating.id===(d===null||d===void 0?void 0:d.id)}));c=!!l?l.subtotals:null;if(c){
260
260
  // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
261
261
  or({method:(l===null||l===void 0?void 0:l.landedCost.method)||"DDP",subtotals:c})}return[3/*break*/,7];case 3:f=w.sent();
262
262
  // default to empty array if we failed to fetch landed cost, so we can show the error message
263
- Xe.landedCostData=[];Xe.shippingData=[];p=["The landed cost calculation request was aborted to initiate a new one."];if(!(f instanceof Error&&f.message&&!p.includes(f.message)))return[3/*break*/,6];if(!(i<1))return[3/*break*/,5];
263
+ Qe.landedCostData=[];Qe.shippingData=[];p=["The landed cost calculation request was aborted to initiate a new one."];if(!(f instanceof Error&&f.message&&!p.includes(f.message)))return[3/*break*/,6];if(!(i<1))return[3/*break*/,5];
264
264
  // retry fetching landed cost one more time
265
265
  return[4/*yield*/,Ie(Object.assign(Object.assign({},e),{retries:(i||0)+1}))];case 4:
266
266
  // retry fetching landed cost one more time
267
267
  w.sent();return[2/*return*/,{isRequestNotReady:false}];case 5:m=(o=le.stripeAddressEventData)===null||o===void 0?void 0:o.value;void h({endpoint:"Failed to fetch landed cost (".concat(i," retries)"),errors:[f.message],metadata:{cartId:window.Zonos.cartId,shipToAddress:m}});w.label=6;case 6:v(f);return[3/*break*/,7];case 7:le.isFetchingLandedCost=false;return[2/*return*/,{isRequestNotReady:false}]}}))}))}));var Te=e("N",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,t;return __generator(this,(function(o){switch(o.label){case 0:return[4/*yield*/,Ie({applyingPromocode:true})];case 1:o.sent();
268
268
  // Go back to shipping step if we are in payment step so user can reselect shipping method
269
- if(Xe.step==="payment"){wr()}
269
+ if(Qe.step==="payment"){wr()}
270
270
  // async update address with new root id from the new quote
271
271
  return[4/*yield*/,be()];case 2:
272
272
  // async update address with new root id from the new quote
273
- o.sent();n=(e=Xe.shippingData)===null||e===void 0?void 0:e.find(Boolean);t=(r=Xe.landedCostData)===null||r===void 0?void 0:r.find((function(e){return e.landedCost.id===(n===null||n===void 0?void 0:n.id)}));if(!n||!t){return[2/*return*/]}return[4/*yield*/,lr({applySubtotalsOnly:false,landedCostId:t.landedCostId,selectedShippingOption:n})];case 3:o.sent();return[2/*return*/]}}))}))}));var Ee=e("P",(function(){Xe.promoCode="";sessionStorage.removeItem("zonos--promo-code");
273
+ o.sent();n=(e=Qe.shippingData)===null||e===void 0?void 0:e.find(Boolean);t=(r=Qe.landedCostData)===null||r===void 0?void 0:r.find((function(e){return e.landedCost.id===(n===null||n===void 0?void 0:n.id)}));if(!n||!t){return[2/*return*/]}return[4/*yield*/,lr({applySubtotalsOnly:false,landedCostId:t.landedCostId,selectedShippingOption:n})];case 3:o.sent();return[2/*return*/]}}))}))}));var Ee=e("P",(function(){Qe.promoCode="";sessionStorage.removeItem("zonos--promo-code");
274
274
  // reset promocode error state
275
- Xe.promoCodeError=false;Xe.promoCodeApplied=false}));var Pe=e("O",(function(){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:
275
+ Qe.promoCodeError=false;Qe.promoCodeApplied=false}));var Pe=e("O",(function(){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:
276
276
  // Go back to shipping step if we are in payment step so user can reselect shipping method
277
- if(Xe.step==="payment"){wr()}Ee();return[4/*yield*/,Te()];case 1:e.sent();return[2/*return*/]}}))}))}));var Ne=e("Q",(function(e){var r=[];var n=true;var t=window.Zonos.isCollect;var i=window.Zonos.isInvoice;
277
+ if(Qe.step==="payment"){wr()}Ee();return[4/*yield*/,Te()];case 1:e.sent();return[2/*return*/]}}))}))}));var Ne=e("Q",(function(e){var r=[];var n=true;var t=window.Zonos.isCollect;var i=window.Zonos.isInvoice;
278
278
  // Inspect the PaymentIntent `status` to indicate the status of the payment
279
279
  // to your customer.
280
280
 
@@ -287,7 +287,7 @@ switch(e){case"succeeded":{r=[o("Your payment went through successfully! Thank y
287
287
  * Handle inventory check and returns error message if the callback provided.
288
288
  */var je=e("n",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,t,i,a,s,u,d,l,d;return __generator(this,(function(p){switch(p.label){case 0:t=n.checkoutSettings.onInventoryCheck;i=!!((r=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.metadata.find((function(e){return e.key==="referenceId"})))===null||r===void 0?void 0:r.value);if(!(window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&i))return[3/*break*/,2];return[4/*yield*/,c("/api/zonos-elements/legacy/inventory-check",{body:{cartData:window.Zonos.cartData},method:"POST"})];case 1:a=p.sent(),s=a.errors,u=a.json;if(s.length||!u){v("Error occurs when handling inventory refund","warn",JSON.stringify(s));return[2/*return*/,null]}
289
289
  // Proceed if the item is available
290
- if(!u.available||u.status===204){return[2/*return*/,o("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.")]}if(u.available||u.status===200){le.shouldInventoryRefund=true;return[2/*return*/,null]}return[2/*return*/,null];case 2:if(typeof t!=="function"){return[2/*return*/,null]}p.label=3;case 3:p.trys.push([3,5,,6]);return[4/*yield*/,t({items:Xe.items},{translate:o,zonosApiRoute:f["vercel"]})];case 4:d=p.sent();return[2/*return*/,d];case 5:l=p.sent();d=l instanceof Error?l.message:"Unknown error";void h({endpoint:"onInventoryCheck",errors:["cartId: ".concat(window.Zonos.cartId," - ").concat(d)],metadata:{cartId:window.Zonos.cartId,href:window.location.href,items:Xe.items}});throw l;case 6:return[2/*return*/]}}))}))}));
290
+ if(!u.available||u.status===204){return[2/*return*/,o("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.")]}if(u.available||u.status===200){le.shouldInventoryRefund=true;return[2/*return*/,null]}return[2/*return*/,null];case 2:if(typeof t!=="function"){return[2/*return*/,null]}p.label=3;case 3:p.trys.push([3,5,,6]);return[4/*yield*/,t({items:Qe.items},{translate:o,zonosApiRoute:f["vercel"]})];case 4:d=p.sent();return[2/*return*/,d];case 5:l=p.sent();d=l instanceof Error?l.message:"Unknown error";void h({endpoint:"onInventoryCheck",errors:["cartId: ".concat(window.Zonos.cartId," - ").concat(d)],metadata:{cartId:window.Zonos.cartId,href:window.location.href,items:Qe.items}});throw l;case 6:return[2/*return*/]}}))}))}));
291
291
  /**
292
292
  * Handle inventory check and returns error message if the callback provided.
293
293
  */var De=e("F",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(t){switch(t.label){case 0:n=!!((r=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.metadata.find((function(e){return e.key==="referenceId"})))===null||r===void 0?void 0:r.value);
@@ -301,7 +301,7 @@ t.sent();return[2/*return*/]}}))}))}));var Le=e("c",(function(e){return __awaite
301
301
  // secret) can't be evaluated by Stripe. Do not treat it as a successful Stripe
302
302
  // payment — return an error so callers don't run success analytics / order
303
303
  // polling off a secret Stripe never confirmed.
304
- if(!i.includes("_secret_")){return[2/*return*/,{error:true,messages:[o("Something went wrong.")]}]}return[4/*yield*/,le.stripe.retrievePaymentIntent(i)];case 1:a=e.sent().paymentIntent;s=a===null||a===void 0?void 0:a.status;u=Ne(s),d=u.isError,l=u.messages;return[2/*return*/,{amount:a===null||a===void 0?void 0:a.amount,currency:a===null||a===void 0?void 0:a.currency,error:d,messages:l,paymentIntentId:a===null||a===void 0?void 0:a.id,paymentMethod:a===null||a===void 0?void 0:a.payment_method,status:s}]}}))}))}));var Re=e("E",(function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,i,a,s,u,l,c,v,f,p,m;return __generator(this,(function(h){switch(h.label){case 0:i=!!((r=le.stripePaymentEventData)===null||r===void 0?void 0:r.complete);a=le.stripeElements;s=le.stripe;u=le.clientSecret;le.customErrorMessage=null;if(!((n=Xe.selectedLandedCost)===null||n===void 0?void 0:n.landedCost.id)&&!(e===null||e===void 0?void 0:e.noLandedCostCheck)){throw new Error("Attempted to confirm the payment when no landed cost is found in store")}return[4/*yield*/,te()];case 1:l=h.sent();if(!l.valid){le.customErrorMessage=l.errorMessage;throw new Error(l.errorMessage)}c=t.checkoutSessionId;if(!(s&&a&&i&&u&&c))return[3/*break*/,3];v=new URL(window.location.href);v.searchParams.set("payment_intent_client_secret",u);v.searchParams.set("zonosCheckoutSessionId",c);void $({checkoutSessionId:c,eventName:"checkout_paymentInfoCompleted"});return[4/*yield*/,s.confirmPayment({confirmParams:{return_url:v.toString()},elements:a,redirect:"if_required"})];case 2:f=h.sent(),p=f.error,m=f.paymentIntent;d("Payment intent confirmed","info",{error:p,paymentIntent:m});if((m===null||m===void 0?void 0:m.status)==="requires_action"){throw new Error(o("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction."))}if(p){if(p.type==="card_error"||p.type==="validation_error"){throw new Error(p.message)}if(p.type==="invalid_request_error"){if(p.code==="payment_intent_unexpected_state"){
304
+ if(!i.includes("_secret_")){return[2/*return*/,{error:true,messages:[o("Something went wrong.")]}]}return[4/*yield*/,le.stripe.retrievePaymentIntent(i)];case 1:a=e.sent().paymentIntent;s=a===null||a===void 0?void 0:a.status;u=Ne(s),d=u.isError,l=u.messages;return[2/*return*/,{amount:a===null||a===void 0?void 0:a.amount,currency:a===null||a===void 0?void 0:a.currency,error:d,messages:l,paymentIntentId:a===null||a===void 0?void 0:a.id,paymentMethod:a===null||a===void 0?void 0:a.payment_method,status:s}]}}))}))}));var xe=e("E",(function(e){return __awaiter(_,void 0,void 0,(function(){var r,n,i,a,s,u,l,c,v,f,p,m;return __generator(this,(function(h){switch(h.label){case 0:i=!!((r=le.stripePaymentEventData)===null||r===void 0?void 0:r.complete);a=le.stripeElements;s=le.stripe;u=le.clientSecret;le.customErrorMessage=null;if(!((n=Qe.selectedLandedCost)===null||n===void 0?void 0:n.landedCost.id)&&!(e===null||e===void 0?void 0:e.noLandedCostCheck)){throw new Error("Attempted to confirm the payment when no landed cost is found in store")}return[4/*yield*/,te()];case 1:l=h.sent();if(!l.valid){le.customErrorMessage=l.errorMessage;throw new Error(l.errorMessage)}c=t.checkoutSessionId;if(!(s&&a&&i&&u&&c))return[3/*break*/,3];v=new URL(window.location.href);v.searchParams.set("payment_intent_client_secret",u);v.searchParams.set("zonosCheckoutSessionId",c);void $({checkoutSessionId:c,eventName:"checkout_paymentInfoCompleted"});return[4/*yield*/,s.confirmPayment({confirmParams:{return_url:v.toString()},elements:a,redirect:"if_required"})];case 2:f=h.sent(),p=f.error,m=f.paymentIntent;d("Payment intent confirmed","info",{error:p,paymentIntent:m});if((m===null||m===void 0?void 0:m.status)==="requires_action"){throw new Error(o("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction."))}if(p){if(p.type==="card_error"||p.type==="validation_error"){throw new Error(p.message)}if(p.type==="invalid_request_error"){if(p.code==="payment_intent_unexpected_state"){
305
305
  // PaymentIntent was canceled or expired, or status is `require_capture`.
306
306
  // don't throw error here because we will reset the checkout session last step
307
307
  return[2/*return*/]}}throw new Error("An unexpected error occurred.")}if(m.status==="requires_payment_method"){
@@ -314,7 +314,7 @@ throw new Error(o("Payment failed. Please try another payment method."))}h.label
314
314
  *
315
315
  * The recorded value captures which policies were shown, the URLs the buyer
316
316
  * agreed to, the active locale, and the snapshotted acceptance timestamp.
317
- */var xe=function(){if(!J.accepted){return null}var e=M();if(!e.length){return null}return{key:"merchantPolicyConsent",value:JSON.stringify({
317
+ */var Re=function(){if(!J.accepted){return null}var e=M();if(!e.length){return null}return{key:"merchantPolicyConsent",value:JSON.stringify({
318
318
  // Use the timestamp snapshotted when the buyer first accepted, so any
319
319
  // later session-metadata update keeps the original moment of consent
320
320
  // for audit purposes. Fall back to "now" as a safety net for the
@@ -326,7 +326,7 @@ acceptedAt:J.acceptedAt||(new Date).toISOString(),locale:a.selectedLocale,polici
326
326
  * determined server-side by the billing company; this override is primarily used
327
327
  * for testing. Returns `undefined` when the param is missing or not a valid
328
328
  * processor.
329
- */var Ue=function(){var e=new URLSearchParams(window.location.search).get("paymentProcessor");var r=function(e){return Object.values(ae).some((function(r){return r===e}))};return e&&r(e)?e:undefined};var ze=e("q",(function(){var e;var r=Xe.items.reduce((function(e,r){return e+r.amount*r.quantity}),0);var n=t.enabledVariantTestKeys||[];var o={adjustmentsAmount:Xe.adjustments.reduce((function(e,r){return e+r.amount}),0),cartId:window.Zonos.cartId,currency:((e=Xe.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"",customerAuthenticationToken:Xe.customerAuthenticationToken||undefined,isCollect:!!window.Zonos.isCollect,isInvoice:!!window.Zonos.isInvoice,itemsAmount:r,metadata:[{key:"language",value:a.selectedLocale}],paymentProcessor:Ue(),presentmentCountryCode:a.selectedCountryCode,skipPaymentIntent:le.skipPaymentIntent,varianceTestInput:n};return o}));var Be=e("l",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,i,a;return __generator(this,(function(s){switch(s.label){case 0:if(!t.checkoutSessionId){
329
+ */var Ue=function(){var e=new URLSearchParams(window.location.search).get("paymentProcessor");var r=function(e){return Object.values(ae).some((function(r){return r===e}))};return e&&r(e)?e:undefined};var ze=e("q",(function(){var e;var r=Qe.items.reduce((function(e,r){return e+r.amount*r.quantity}),0);var n=t.enabledVariantTestKeys||[];var o={adjustmentsAmount:Qe.adjustments.reduce((function(e,r){return e+r.amount}),0),cartId:window.Zonos.cartId,currency:((e=Qe.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"",customerAuthenticationToken:Qe.customerAuthenticationToken||undefined,isCollect:!!window.Zonos.isCollect,isInvoice:!!window.Zonos.isInvoice,itemsAmount:r,metadata:[{key:"language",value:a.selectedLocale}],paymentProcessor:Ue(),presentmentCountryCode:a.selectedCountryCode,skipPaymentIntent:le.skipPaymentIntent,varianceTestInput:n};return o}));var Be=e("l",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,i,a;return __generator(this,(function(s){switch(s.label){case 0:if(!t.checkoutSessionId){
330
330
  // We want to log the error anytime we fail to create a checkout session
331
331
  void h({endpoint:"Error creating payment intent",errors:["No checkout session id found when retrieving payment intent"],metadata:{allLogs:l,cartId:window.Zonos.cartId}});tr({messages:[o("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:o("Error creating Checkout")});return[2/*return*/]}return[4/*yield*/,c("/api/zonos-elements/create-payment-intent",{body:{checkoutSessionId:t.checkoutSessionId},method:"POST"})];case 1:r=s.sent(),n=r.errors,i=r.json;a=(e=i===null||i===void 0?void 0:i.checkoutSessionPaymentIntentCreate)===null||e===void 0?void 0:e.clientSecret;if(n.length||!a){v("Error occurs when getting payment intent",JSON.stringify(n,null,2));
332
332
  // We want to log the error anytime we fail to create a payment intent
@@ -340,7 +340,7 @@ sr(i.checkoutSessionPaymentIntentCreate);return[2/*return*/]}}))}))}));
340
340
  // check if the error is related to expired cart and thow error so we can show error message accordingly
341
341
  if(Array.isArray(s)&&s.some((function(e){return e.message==="Cart is expired."}))){throw new Error("Cart is expired.")}v("Error occurred when creating checkout session",JSON.stringify(o,null,2));return[2/*return*/,false]}u=i.checkoutSessionCreate;
342
342
  // update cart store with updated information
343
- sr(u);or({method:((r=u.landedCost)===null||r===void 0?void 0:r.method)||"DDP",subtotals:u.subtotals});d("Exchange rate updated for cart items (checkout session create)","info",Xe.exchangeRate);d("done-init-checkout-session");return[2/*return*/,true]}}))}))}));var Je=e("z",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,o;return __generator(this,(function(i){switch(i.label){case 0:e=t.checkoutSessionId;
343
+ sr(u);or({method:((r=u.landedCost)===null||r===void 0?void 0:r.method)||"DDP",subtotals:u.subtotals});d("Exchange rate updated for cart items (checkout session create)","info",Qe.exchangeRate);d("done-init-checkout-session");return[2/*return*/,true]}}))}))}));var Je=e("z",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r,o;return __generator(this,(function(i){switch(i.label){case 0:e=t.checkoutSessionId;
344
344
  // Checkout session id should be available at this point
345
345
  if(!e){v("Failed to update checkout session base currency");return[2/*return*/,false]}
346
346
  // Only update checkout session currency if setting is enabled
@@ -349,7 +349,7 @@ if(n.checkoutSettings.allowedSettlementCurrencies==="LOCAL"){d('allowedSettlemen
349
349
  if(!r||o!==le.checkoutSettlementCurrency){v("Failed to update checkout session base currency");return[2/*return*/,false]}d('Updated checkout session to settlement currency "'.concat(o,'".'));return[2/*return*/,true]}}))}))}));
350
350
  /**
351
351
  * Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
352
- */var Me=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,o,i;var s=e.adjustmentsAmount,u=e.cartId,d=e.currency,l=e.id,f=e.itemsAmount,p=e.landedCostId,m=e.presentmentCountryCode,h=e.storeCreditApplication;return __generator(this,(function(e){switch(e.label){case 0:r=t.enabledVariantTestKeys||[];return[4/*yield*/,c("/api/zonos-elements/update-checkout-session",{body:{adjustmentsAmount:s,billToPartyId:le.partyBillingId,cartId:u,currency:d,customerAuthenticationToken:Xe.customerAuthenticationToken||undefined,id:l,itemsAmount:f,landedCostId:p,metadata:[{key:"language",value:a.selectedLocale}],presentmentCountryCode:m,shipToPartyId:le.partyShippingId,skipPaymentIntent:le.skipPaymentIntent,storeCreditApplication:h,varianceTestInput:r},method:"POST"})];case 1:n=e.sent(),o=n.errors,i=n.json;if(o.length||!i){v("Error occurs when updating checkout session",JSON.stringify(o,null,2));return[2/*return*/,{errors:o,json:i}]}return[2/*return*/,{errors:[],json:i}]}}))}))};
352
+ */var Me=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,o,i;var s=e.adjustmentsAmount,u=e.cartId,d=e.currency,l=e.id,f=e.itemsAmount,p=e.landedCostId,m=e.presentmentCountryCode,h=e.storeCreditApplication;return __generator(this,(function(e){switch(e.label){case 0:r=t.enabledVariantTestKeys||[];return[4/*yield*/,c("/api/zonos-elements/update-checkout-session",{body:{adjustmentsAmount:s,billToPartyId:le.partyBillingId,cartId:u,currency:d,customerAuthenticationToken:Qe.customerAuthenticationToken||undefined,id:l,itemsAmount:f,landedCostId:p,metadata:[{key:"language",value:a.selectedLocale}],presentmentCountryCode:m,shipToPartyId:le.partyShippingId,skipPaymentIntent:le.skipPaymentIntent,storeCreditApplication:h,varianceTestInput:r},method:"POST"})];case 1:n=e.sent(),o=n.errors,i=n.json;if(o.length||!i){v("Error occurs when updating checkout session",JSON.stringify(o,null,2));return[2/*return*/,{errors:o,json:i}]}return[2/*return*/,{errors:[],json:i}]}}))}))};
353
353
  /**
354
354
  * Pushes the buyer's policy consent into the checkout session's metadata via the
355
355
  * dedicated metadata-only mutation. Called from the payment continue handler so
@@ -359,7 +359,7 @@ if(!r||o!==le.checkoutSettlementCurrency){v("Failed to update checkout session b
359
359
  * because this fires at the end of the payment phase, when we don't want to
360
360
  * touch landed-cost / cart / party state. No-op when no policies are configured,
361
361
  * when consent hasn't been accepted, or when there is no active session ID.
362
- */var qe=e("T",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:e=xe();if(!e){return[2/*return*/,{errors:[]}]}if(!t.checkoutSessionId){return[2/*return*/,{errors:[]}]}return[4/*yield*/,c("/api/zonos-elements/update-checkout-session-metadata",{body:{id:t.checkoutSessionId,metadata:[e]},method:"POST"})];case 1:r=n.sent().errors;if(r.length){
362
+ */var qe=e("T",(function(){return __awaiter(_,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:e=Re();if(!e){return[2/*return*/,{errors:[]}]}if(!t.checkoutSessionId){return[2/*return*/,{errors:[]}]}return[4/*yield*/,c("/api/zonos-elements/update-checkout-session-metadata",{body:{id:t.checkoutSessionId,metadata:[e]},method:"POST"})];case 1:r=n.sent().errors;if(r.length){
363
363
  // Surface failures loudly so we have observability on consent records that
364
364
  // didn't persist — callers don't block payment, but the failure is logged.
365
365
  v("Failed to record merchant policy consent on checkout session",JSON.stringify(r,null,2));return[2/*return*/,{errors:r.map((function(e){return e.message||"Unknown error"}))}]}return[2/*return*/,{errors:[]}]}}))}))}));
@@ -409,7 +409,7 @@ if(e&&le.stripe){sessionStorage.setItem("zonos--client-secret",e)}if(!e){session
409
409
  // When user clicked applied button, save promocode into session storage for later use. So if session has promocode, applied button is clicked
410
410
  promoCodeApplied:!!sessionStorage.getItem("zonos--promo-code"),promoCodeError:false,restrictedItems:[],selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,shouldHideDiscountInput:false,step:"customer-info",storeCredit:0,subtotal:0,tabItems:{"customer-info":{index:1,isDone:false,label:"Customer",value:"customer-info"},shipping:{index:2,isDone:false,label:"Shipping",value:"shipping"},
411
411
  // eslint-disable-next-line sort-keys/sort-keys-fix
412
- payment:{index:3,isDone:false,label:"Payment",value:"payment"}},total:0}})),Ve=Ke.onChange,Ge=Ke.reset,Xe=Ke.state;e({I:Ve,d:Xe});var Qe=function(e){switch(e){case"DAYS":return o("days");case"WEEKS":return o("weeks");case"BUSINESS_DAYS":default:return o("business days")}};
412
+ payment:{index:3,isDone:false,label:"Payment",value:"payment"}},total:0}})),Ve=Ke.onChange,Ge=Ke.reset,Qe=Ke.state;e({I:Ve,d:Qe});var Xe=function(e){switch(e){case"DAYS":return o("days");case"WEEKS":return o("weeks");case"BUSINESS_DAYS":default:return o("business days")}};
413
413
  /**
414
414
  * Format shipping transit info to be displayed on UI
415
415
  * @returns
@@ -418,25 +418,25 @@ payment:{index:3,isDone:false,label:"Payment",value:"payment"}},total:0}})),Ve=K
418
418
  * - minTransit: 3
419
419
  */var Ze=e("Z",(function(e){var r;var n=(r=e.shippingProfile)===null||r===void 0?void 0:r.transitTime;
420
420
  // Don't care about falsy 0 values because this is international shipping and 0 days is not feasible
421
- if(!(n===null||n===void 0?void 0:n.min)||!(n===null||n===void 0?void 0:n.max)||!(n===null||n===void 0?void 0:n.type)){return null}return{maxTransit:n.max,minTransit:n.min,unit:Qe(n.type)}}));var $e=function(e){var r=e.item1,n=e.item2;if(!r||!n){return false}return n.sku&&r.sku&&r.sku===n.sku||n.description&&r.description&&r.description===n.description||r.name&&n.name&&r.name===n.name};
421
+ if(!(n===null||n===void 0?void 0:n.min)||!(n===null||n===void 0?void 0:n.max)||!(n===null||n===void 0?void 0:n.type)){return null}return{maxTransit:n.max,minTransit:n.min,unit:Xe(n.type)}}));var $e=function(e){var r=e.item1,n=e.item2;if(!r||!n){return false}return n.sku&&r.sku&&r.sku===n.sku||n.description&&r.description&&r.description===n.description||r.name&&n.name&&r.name===n.name};
422
422
  /**
423
423
  * Check and set restricted items in cart
424
- */var er=function(e){d("Checking item restrictions");var r=e.map((function(e){if(!e.restriction){return null}var r=e.restriction;var n=Xe.items.find((function(r){return $e({item1:r,item2:e})}));return Object.assign(Object.assign({matchedItem:n},e),{restriction:r})})).filter(Boolean);Xe.restrictedItems=r;
424
+ */var er=function(e){d("Checking item restrictions");var r=e.map((function(e){if(!e.restriction){return null}var r=e.restriction;var n=Qe.items.find((function(r){return $e({item1:r,item2:e})}));return Object.assign(Object.assign({matchedItem:n},e),{restriction:r})})).filter(Boolean);Qe.restrictedItems=r;
425
425
  // remove items that are restricted from cart
426
- Xe.items=Xe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:!!r.find((function(r){return $e({item1:r,item2:e})}))})}));return{cartItems:Xe.items,restrictedItems:r}};var rr=null;var nr=e("f",(function(){t.checkoutSessionId=null;
426
+ Qe.items=Qe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:!!r.find((function(r){return $e({item1:r,item2:e})}))})}));return{cartItems:Qe.items,restrictedItems:r}};var rr=null;var nr=e("f",(function(){t.checkoutSessionId=null;
427
427
  // clear pending store credit debounce timer
428
428
  if(rr){clearTimeout(rr);rr=null}
429
429
  // reset store credit store
430
430
  k();
431
431
  // reset cart store
432
- Ge()}));var tr=e("r",(function(e){var r=e.messages,n=e.title;nr();he();Xe.step="error";Xe.error={messages:r,title:n}}));var or=function(e){var r=e.dutiesTaxesFeesEstimate,n=e.method,t=e.subtotals;var o;
432
+ Ge()}));var tr=e("r",(function(e){var r=e.messages,n=e.title;nr();he();Qe.step="error";Qe.error={messages:r,title:n}}));var or=function(e){var r=e.dutiesTaxesFeesEstimate,n=e.method,t=e.subtotals;var o;
433
433
  // update exchange rate so we can use it to display cart items
434
- Xe.exchangeRate=t.exchangeRate;Xe.adjustmentTotal=t.adjustments;Xe.dutiesTaxesFees=n==="DAP"?null:t.landedCostTotal;Xe.storeCredit=(o=t.storeCredit)!==null&&o!==void 0?o:0;Xe.subtotal=t.items;Xe.total=t.total;Xe.currency=t.presentmentCurrencyCode;Xe.dutiesTaxesFeesEstimate=r||null};
434
+ Qe.exchangeRate=t.exchangeRate;Qe.adjustmentTotal=t.adjustments;Qe.dutiesTaxesFees=n==="DAP"?null:t.landedCostTotal;Qe.storeCredit=(o=t.storeCredit)!==null&&o!==void 0?o:0;Qe.subtotal=t.items;Qe.total=t.total;Qe.currency=t.presentmentCurrencyCode;Qe.dutiesTaxesFeesEstimate=r||null};
435
435
  /**
436
436
  * Detect if there are any items in cart that are not restricted and have positive amount, exclude negative amount items
437
437
  */var ir=e("L",(function(){
438
438
  // filter all items with positive amount
439
- var e=Xe.items.filter((function(e){return e.amount>0}));
439
+ var e=Qe.items.filter((function(e){return e.amount>0}));
440
440
  // only check restricted status for items with positive amount
441
441
  // if there is no item restricted found => all items are restricted
442
442
  return!!e.find((function(e){return!e.isRestricted}))}));
@@ -447,9 +447,9 @@ return!!e.find((function(e){return!e.isRestricted}))}));
447
447
  * Single source of truth for this detection — previously duplicated inline
448
448
  * at each call site, which let one of them (the forceDialogOpen/preview init
449
449
  * path) miss it entirely.
450
- */var ar=e("m",(function(){var e,r;return!!(((r=(e=Xe.checkoutSession)===null||e===void 0?void 0:e.order)===null||r===void 0?void 0:r.id)&&!Xe.checkoutSession.completedAt)}));var sr=e("v",(function(e){var r,n,o,i,a,c,v;
450
+ */var ar=e("m",(function(){var e,r;return!!(((r=(e=Qe.checkoutSession)===null||e===void 0?void 0:e.order)===null||r===void 0?void 0:r.id)&&!Qe.checkoutSession.completedAt)}));var sr=e("v",(function(e){var r,n,o,i,a,c,v;
451
451
  // update stripe store with updated information
452
- le.clientSecret=e.clientSecret;le.stripeCustomerSessionClientSecret=e.customerSessionClientSecret;le.customerProfile=e.customerProfile;Xe.checkoutSession=e;
452
+ le.clientSecret=e.clientSecret;le.stripeCustomerSessionClientSecret=e.customerSessionClientSecret;le.customerProfile=e.customerProfile;Qe.checkoutSession=e;
453
453
  // Populate store credit balance from checkout session customer profile
454
454
  I((n=(r=e.customerProfile)===null||r===void 0?void 0:r.storeCreditBalance)!==null&&n!==void 0?n:null);if(!e.id){
455
455
  // Log error to track down the issue
@@ -459,14 +459,14 @@ if(e.id){t.checkoutSessionId=e.id}
459
459
  // Filter the response to only include test keys that we support and then save it to the session
460
460
  var f=s(e.varianceTestResults||[]);u(f);
461
461
  // Check if there is a redirect URL in the metadata to override
462
- var p=((a=(i=(o=Xe.checkoutSession)===null||o===void 0?void 0:o.metadata)===null||i===void 0?void 0:i.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||a===void 0?void 0:a.value)||(
462
+ var p=((a=(i=(o=Qe.checkoutSession)===null||o===void 0?void 0:o.metadata)===null||i===void 0?void 0:i.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||a===void 0?void 0:a.value)||(
463
463
  // Sometimes externalConfirmationPageURL is not in checkoutSession create/update, check if there is a redirect URL in the cart metadata to override
464
- (v=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.metadata.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||v===void 0?void 0:v.value)||null;if(p){d("Found externalConfirmationPageURL: ".concat(p));Xe.externalConfirmationPageURL=p}}));var ur=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,i,s,u,l;var c=e.adjustmentsAmount,f=e.cartId,p=e.currency,m=e.dutiesTaxesFeesEstimate,h=e.itemsAmount,w=e.landedCostId,y=e.shouldInitSessionOnFailure;return __generator(this,(function(e){switch(e.label){case 0:if(w&&Xe.selectedLandedCost){n=Xe.selectedLandedCost.subtotals;or({dutiesTaxesFeesEstimate:m,method:Xe.landedCostMethod,subtotals:n});d("Exchange rate updated for cart items (landed cost subtotal)","info",Xe.exchangeRate)}
464
+ (v=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.metadata.find((function(e){return(e===null||e===void 0?void 0:e.key)==="externalConfirmationPageURL"})))===null||v===void 0?void 0:v.value)||null;if(p){d("Found externalConfirmationPageURL: ".concat(p));Qe.externalConfirmationPageURL=p}}));var ur=function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,i,s,u,l;var c=e.adjustmentsAmount,f=e.cartId,p=e.currency,m=e.dutiesTaxesFeesEstimate,h=e.itemsAmount,w=e.landedCostId,y=e.shouldInitSessionOnFailure;return __generator(this,(function(e){switch(e.label){case 0:if(w&&Qe.selectedLandedCost){n=Qe.selectedLandedCost.subtotals;or({dutiesTaxesFeesEstimate:m,method:Qe.landedCostMethod,subtotals:n});d("Exchange rate updated for cart items (landed cost subtotal)","info",Qe.exchangeRate)}
465
465
  // update checkout session
466
466
  if(!t.checkoutSessionId){d("Could not update cart total without checkout session id","info");return[2/*return*/,false]}return[4/*yield*/,Me({adjustmentsAmount:c,cartId:f,currency:p,id:t.checkoutSessionId,itemsAmount:h,landedCostId:w,presentmentCountryCode:a.selectedCountryCode})];case 1:i=e.sent(),s=i.errors,u=i.json;if(!(s.length>0||!u))return[3/*break*/,4];v("Error occurs when updating checkout session.");if(!y)return[3/*break*/,3];d("Initiating checkout session on failure","info");return[4/*yield*/,Fe()];case 2:l=e.sent();d("stripeStoreInitCheckoutSession: ".concat(l));if(!l){tr({messages:[o("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:o("Error creating Checkout")});return[2/*return*/,false]}return[2/*return*/,true];case 3:return[2/*return*/,false];case 4:if(!w){
467
467
  // This is when we first open the checkout modal and we just want to get info from the old cart session.
468
468
  // use subtotals from checkout session to update cart total
469
- or({method:((r=u.checkoutSessionUpdate.landedCost)===null||r===void 0?void 0:r.method)||"DDP",subtotals:u.checkoutSessionUpdate.subtotals});d("Exchange rate updated for cart items (checkout session update)","info",Xe.exchangeRate)}sr(u.checkoutSessionUpdate);return[2/*return*/,true]}}))}))};
469
+ or({method:((r=u.checkoutSessionUpdate.landedCost)===null||r===void 0?void 0:r.method)||"DDP",subtotals:u.checkoutSessionUpdate.subtotals});d("Exchange rate updated for cart items (checkout session update)","info",Qe.exchangeRate)}sr(u.checkoutSessionUpdate);return[2/*return*/,true]}}))}))};
470
470
  /**
471
471
  * For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
472
472
  */var dr=e("_",(function(e,r){var t,o,i,a;
@@ -474,41 +474,41 @@ or({method:((r=u.checkoutSessionUpdate.landedCost)===null||r===void 0?void 0:r.m
474
474
  if(e.method==="DAP"&&((o=(t=n.genericSettings)===null||t===void 0?void 0:t.domesticCountries)===null||o===void 0?void 0:o.includes(((i=le.stripeAddressEventData)===null||i===void 0?void 0:i.value.address.country)||"US"))){return"DDP"}
475
475
  // EU 3-EUR cutover (05CHECK-893): keep EU POSTAL remittance quotes as DAP so
476
476
  // the shopper is told duties are paid upon delivery, even though we remit.
477
- if(He({deliveryType:r,landedCost:e,shipToCountry:(a=le.stripeAddressEventData)===null||a===void 0?void 0:a.value.address.country})){return"DAP"}if(e.method==="DAP"&&e.remittance.length&&e.landedCostGuaranteeCode==="ZONOS"){return"DDP"}return e.method}));var lr=e("Y",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,t,o,i,a,s,u,l,c,v,f,p,m,h,w,y,g,b,_,S,O,A,C,k,I,T;var E=e.applySubtotalsOnly,P=e.landedCostId,N=e.selectedShippingOption;return __generator(this,(function(e){switch(e.label){case 0:d("Updating selected shipping option","info",{landedCostId:P,selectedShippingOption:N});Xe.selectedShippingOption=N;m=Ze(Xe.selectedShippingOption);if(m){h=m.maxTransit,w=m.minTransit,y=m.unit;Xe.selectedShippingOptionTransitTime="".concat(w,"-").concat(h," ").concat(y)}else{Xe.selectedShippingOptionTransitTime=""}g=(r=Xe.landedCostData)===null||r===void 0?void 0:r.find((function(e){return e.landedCostId===P}));
477
+ if(He({deliveryType:r,landedCost:e,shipToCountry:(a=le.stripeAddressEventData)===null||a===void 0?void 0:a.value.address.country})){return"DAP"}if(e.method==="DAP"&&e.remittance.length&&e.landedCostGuaranteeCode==="ZONOS"){return"DDP"}return e.method}));var lr=e("Y",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,t,o,i,a,s,u,l,c,v,f,p,m,h,w,y,g,b,_,S,O,A,C,k,I,T;var E=e.applySubtotalsOnly,P=e.landedCostId,N=e.selectedShippingOption;return __generator(this,(function(e){switch(e.label){case 0:d("Updating selected shipping option","info",{landedCostId:P,selectedShippingOption:N});Qe.selectedShippingOption=N;m=Ze(Qe.selectedShippingOption);if(m){h=m.maxTransit,w=m.minTransit,y=m.unit;Qe.selectedShippingOptionTransitTime="".concat(w,"-").concat(h," ").concat(y)}else{Qe.selectedShippingOptionTransitTime=""}g=(r=Qe.landedCostData)===null||r===void 0?void 0:r.find((function(e){return e.landedCostId===P}));
478
478
  // save selected landed cost for later use
479
- Xe.selectedLandedCost=g||null;if(!g){
479
+ Qe.selectedLandedCost=g||null;if(!g){
480
480
  // do nothing if we can't find landed cost for selected shipping option
481
- return[2/*return*/,false]}b=((t=g.landedCost.amountSubtotals)===null||t===void 0?void 0:t.landedCostTotal)||0;_=g.subtotals.exchangeRate.rate;S=b*_;if(S){d("DAP quote, using estimate: ".concat(S),"info")}Xe.landedCostMethod=dr(g.landedCost,(o=N.shippingProfile)===null||o===void 0?void 0:o.serviceLevel.deliveryType);
481
+ return[2/*return*/,false]}b=((t=g.landedCost.amountSubtotals)===null||t===void 0?void 0:t.landedCostTotal)||0;_=g.subtotals.exchangeRate.rate;S=b*_;if(S){d("DAP quote, using estimate: ".concat(S),"info")}Qe.landedCostMethod=dr(g.landedCost,(o=N.shippingProfile)===null||o===void 0?void 0:o.serviceLevel.deliveryType);
482
482
  // update shipping value and dutiesTaxFees on selectedShippingOption change
483
- Xe.shipping=g.subtotals.shipping;O=((i=g===null||g===void 0?void 0:g.landedCost)===null||i===void 0?void 0:i.landedCostGuaranteeCode)==="ZONOS";A=!!((s=(a=g===null||g===void 0?void 0:g.landedCost)===null||a===void 0?void 0:a.deMinimis)===null||s===void 0?void 0:s.find((function(e){return["DUTY","TAX"].includes(e.type)&&e.threshold==="ABOVE"})));Xe.isSelectedShippingAboveDeminimis=A;Xe.isSelectedShippingGuarantee=O;C=false;if(!E)return[3/*break*/,1];k=g.subtotals;or({dutiesTaxesFeesEstimate:S,method:Xe.landedCostMethod,subtotals:k});d("Exchange rate updated for cart items (landed cost subtotal)","info",Xe.exchangeRate);C=true;return[3/*break*/,3];case 1:return[4/*yield*/,ur({adjustmentsAmount:Xe.adjustmentTotal,cartId:window.Zonos.cartId,dutiesTaxesFeesEstimate:S,landedCostId:(u=g.landedCost)===null||u===void 0?void 0:u.id})];case 2:
483
+ Qe.shipping=g.subtotals.shipping;O=((i=g===null||g===void 0?void 0:g.landedCost)===null||i===void 0?void 0:i.landedCostGuaranteeCode)==="ZONOS";A=!!((s=(a=g===null||g===void 0?void 0:g.landedCost)===null||a===void 0?void 0:a.deMinimis)===null||s===void 0?void 0:s.find((function(e){return["DUTY","TAX"].includes(e.type)&&e.threshold==="ABOVE"})));Qe.isSelectedShippingAboveDeminimis=A;Qe.isSelectedShippingGuarantee=O;C=false;if(!E)return[3/*break*/,1];k=g.subtotals;or({dutiesTaxesFeesEstimate:S,method:Qe.landedCostMethod,subtotals:k});d("Exchange rate updated for cart items (landed cost subtotal)","info",Qe.exchangeRate);C=true;return[3/*break*/,3];case 1:return[4/*yield*/,ur({adjustmentsAmount:Qe.adjustmentTotal,cartId:window.Zonos.cartId,dutiesTaxesFeesEstimate:S,landedCostId:(u=g.landedCost)===null||u===void 0?void 0:u.id})];case 2:
484
484
  // update session with selected landed cost
485
- C=e.sent();e.label=3;case 3:I=(l=Xe.items.find(Boolean))===null||l===void 0?void 0:l.currencyCode;T=((c=le.stripeAddressEventData)===null||c===void 0?void 0:c.value.address.country)||"US";
485
+ C=e.sent();e.label=3;case 3:I=(l=Qe.items.find(Boolean))===null||l===void 0?void 0:l.currencyCode;T=((c=le.stripeAddressEventData)===null||c===void 0?void 0:c.value.address.country)||"US";
486
486
  // Only show pay in USD button if item's currency is in USD, the setting is enabled and the order presentment currency is not USD, also only in USD settlement ship to country list
487
- le.shouldRenderPayInUsdButton=I==="USD"&&n.checkoutSettings.allowedSettlementCurrencies==="LOCAL_AND_USD"&&((v=Xe.checkoutSession)===null||v===void 0?void 0:v.subtotals.presentmentCurrencyCode)!=="USD"&&!!((p=(f=n.genericSettings)===null||f===void 0?void 0:f.usdSettlementCountryEnabled)===null||p===void 0?void 0:p.includes(T));return[2/*return*/,C]}}))}))}));var cr=e("o",(function(e){var r=e.isPreview,n=e.sessionTimeout;
487
+ le.shouldRenderPayInUsdButton=I==="USD"&&n.checkoutSettings.allowedSettlementCurrencies==="LOCAL_AND_USD"&&((v=Qe.checkoutSession)===null||v===void 0?void 0:v.subtotals.presentmentCurrencyCode)!=="USD"&&!!((p=(f=n.genericSettings)===null||f===void 0?void 0:f.usdSettlementCountryEnabled)===null||p===void 0?void 0:p.includes(T));return[2/*return*/,C]}}))}))}));var cr=e("o",(function(e){var r=e.isPreview,n=e.sessionTimeout;
488
488
  // do nothing if in preview mode
489
489
  if(r){return}var t=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout");var o=
490
490
  // timeout query is mainly for testing purpose
491
- t&&!isNaN(parseInt(t,10))?parseInt(t,10):n;d("==START CHECKOUT TIMEOUT - ".concat(o,"=="));Xe.checkoutTimeoutInterval=setTimeout((function(){Xe.checkoutSessionTimeoutShow=true}),o)}));var vr=e("j",(function(){if(Xe.checkoutTimeoutInterval){clearTimeout(Xe.checkoutTimeoutInterval);Xe.checkoutTimeoutInterval=null}}));var fr=function(e){return e.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}))};var pr=function(){
491
+ t&&!isNaN(parseInt(t,10))?parseInt(t,10):n;d("==START CHECKOUT TIMEOUT - ".concat(o,"=="));Qe.checkoutTimeoutInterval=setTimeout((function(){Qe.checkoutSessionTimeoutShow=true}),o)}));var vr=e("j",(function(){if(Qe.checkoutTimeoutInterval){clearTimeout(Qe.checkoutTimeoutInterval);Qe.checkoutTimeoutInterval=null}}));var fr=function(e){return e.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}))};var pr=function(){
492
492
  // mark all items as not restricted
493
- Xe.items=Xe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}));Xe.restrictedItems=[]};var mr=e("e",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,t,o;var i=e.adjustments,a=e.cartItems,s=e.landedCostId,u=e.shouldInitSessionOnFailure,d=u===void 0?true:u;return __generator(this,(function(e){switch(e.label){case 0:
493
+ Qe.items=Qe.items.map((function(e){return Object.assign(Object.assign({},e),{isRestricted:false})}));Qe.restrictedItems=[]};var mr=e("e",(function(e){return __awaiter(_,[e],void 0,(function(e){var r,n,t,o;var i=e.adjustments,a=e.cartItems,s=e.landedCostId,u=e.shouldInitSessionOnFailure,d=u===void 0?true:u;return __generator(this,(function(e){switch(e.label){case 0:
494
494
  // Update adjustments and items
495
- Xe.adjustments=i;Xe.items=fr(a);n=(r=a.find(Boolean))===null||r===void 0?void 0:r.currencyCode;t=a.reduce((function(e,r){return e+r.amount*r.quantity}),0);o=i.reduce((function(e,r){return e+r.amount}),0);if(!n||!t){
495
+ Qe.adjustments=i;Qe.items=fr(a);n=(r=a.find(Boolean))===null||r===void 0?void 0:r.currencyCode;t=a.reduce((function(e,r){return e+r.amount*r.quantity}),0);o=i.reduce((function(e,r){return e+r.amount}),0);if(!n||!t){
496
496
  // do nothing if we can't get currency or total
497
- return[2/*return*/]}Xe.currency=n;
497
+ return[2/*return*/]}Qe.currency=n;
498
498
  // set loading state here because this is the first load checkout session when we already have checkout session id stored
499
- le.isFetchingSession=true;return[4/*yield*/,ur({adjustmentsAmount:o,cartId:window.Zonos.cartId,currency:n,dutiesTaxesFeesEstimate:0,itemsAmount:t,landedCostId:s,shouldInitSessionOnFailure:d})];case 1:e.sent();le.isFetchingSession=false;return[2/*return*/]}}))}))}));var hr=function(){Xe.selectedShippingOption=null;Xe.isSelectedShippingAboveDeminimis=false;Xe.isSelectedShippingGuarantee=false;Xe.selectedShippingOptionTransitTime="";Xe.dutiesTaxesFees=0;Xe.dutiesTaxesFeesEstimate=0;Xe.shipping=0;
499
+ le.isFetchingSession=true;return[4/*yield*/,ur({adjustmentsAmount:o,cartId:window.Zonos.cartId,currency:n,dutiesTaxesFeesEstimate:0,itemsAmount:t,landedCostId:s,shouldInitSessionOnFailure:d})];case 1:e.sent();le.isFetchingSession=false;return[2/*return*/]}}))}))}));var hr=function(){Qe.selectedShippingOption=null;Qe.isSelectedShippingAboveDeminimis=false;Qe.isSelectedShippingGuarantee=false;Qe.selectedShippingOptionTransitTime="";Qe.dutiesTaxesFees=0;Qe.dutiesTaxesFeesEstimate=0;Qe.shipping=0;
500
500
  // reset total to subtotal
501
- Xe.total=Xe.subtotal};var wr=function(){if(Xe.step==="shipping"){Xe.step="customer-info";
501
+ Qe.total=Qe.subtotal};var wr=function(){if(Qe.step==="shipping"){Qe.step="customer-info";
502
502
  // set shipping step to done
503
- Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{"customer-info":Object.assign(Object.assign({},Xe.tabItems.shipping),{isDone:false})})}else if(Xe.step==="payment"){Xe.step="shipping";
503
+ Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{"customer-info":Object.assign(Object.assign({},Qe.tabItems.shipping),{isDone:false})})}else if(Qe.step==="payment"){Qe.step="shipping";
504
504
  // set shipping step to done
505
- Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{shipping:Object.assign(Object.assign({},Xe.tabItems.shipping),{isDone:false})})}else if(Xe.step==="finish"){Xe.step="payment";
505
+ Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{shipping:Object.assign(Object.assign({},Qe.tabItems.shipping),{isDone:false})})}else if(Qe.step==="finish"){Qe.step="payment";
506
506
  // set shipping step to done
507
- Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{payment:Object.assign(Object.assign({},Xe.tabItems.payment),{isDone:false})})}};var yr=e("x",(function(){if(Xe.step==="customer-info"){Xe.step="shipping";
507
+ Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{payment:Object.assign(Object.assign({},Qe.tabItems.payment),{isDone:false})})}};var yr=e("x",(function(){if(Qe.step==="customer-info"){Qe.step="shipping";
508
508
  // set customer-info step to done
509
- Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{"customer-info":Object.assign(Object.assign({},Xe.tabItems["customer-info"]),{isDone:true})})}else if(Xe.step==="shipping"){Xe.step="payment";
509
+ Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{"customer-info":Object.assign(Object.assign({},Qe.tabItems["customer-info"]),{isDone:true})})}else if(Qe.step==="shipping"){Qe.step="payment";
510
510
  // set shipping step to done
511
- Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{shipping:Object.assign(Object.assign({},Xe.tabItems.shipping),{isDone:true})})}else if(Xe.step==="payment"){Xe.step="finish"}}));var gr=e("h",(function(){Xe.step="customer-info";Xe.tabItems=Object.assign(Object.assign({},Xe.tabItems),{"customer-info":Object.assign(Object.assign({},Xe.tabItems["customer-info"]),{isDone:false}),payment:Object.assign(Object.assign({},Xe.tabItems.payment),{isDone:false}),shipping:Object.assign(Object.assign({},Xe.tabItems.shipping),{isDone:false})});hr()}));var br=function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,s,u,l,c;return __generator(this,(function(f){switch(f.label){case 0:if(!t.checkoutSessionId){d("Could not update store credit without checkout session id","info");return[2/*return*/]}n=Xe.selectedLandedCost;o=Xe.currency||((e=Xe.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"";i=Xe.adjustments.reduce((function(e,r){return e+r.amount}),0);s=Xe.items.reduce((function(e,r){return e+r.amount*r.quantity}),0);return[4/*yield*/,Me({adjustmentsAmount:i,cartId:window.Zonos.cartId,currency:o,id:t.checkoutSessionId,itemsAmount:s,landedCostId:n===null||n===void 0?void 0:n.landedCostId,presentmentCountryCode:a.selectedCountryCode,storeCreditApplication:D()})];case 1:u=f.sent(),l=u.errors,c=u.json;if(l.length>0||!c){v("Error updating checkout session with store credit");return[2/*return*/]}
511
+ Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{shipping:Object.assign(Object.assign({},Qe.tabItems.shipping),{isDone:true})})}else if(Qe.step==="payment"){Qe.step="finish"}}));var gr=e("h",(function(){Qe.step="customer-info";Qe.tabItems=Object.assign(Object.assign({},Qe.tabItems),{"customer-info":Object.assign(Object.assign({},Qe.tabItems["customer-info"]),{isDone:false}),payment:Object.assign(Object.assign({},Qe.tabItems.payment),{isDone:false}),shipping:Object.assign(Object.assign({},Qe.tabItems.shipping),{isDone:false})});hr()}));var br=function(){return __awaiter(_,void 0,void 0,(function(){var e,r,n,o,i,s,u,l,c;return __generator(this,(function(f){switch(f.label){case 0:if(!t.checkoutSessionId){d("Could not update store credit without checkout session id","info");return[2/*return*/]}n=Qe.selectedLandedCost;o=Qe.currency||((e=Qe.items.find(Boolean))===null||e===void 0?void 0:e.currencyCode)||"";i=Qe.adjustments.reduce((function(e,r){return e+r.amount}),0);s=Qe.items.reduce((function(e,r){return e+r.amount*r.quantity}),0);return[4/*yield*/,Me({adjustmentsAmount:i,cartId:window.Zonos.cartId,currency:o,id:t.checkoutSessionId,itemsAmount:s,landedCostId:n===null||n===void 0?void 0:n.landedCostId,presentmentCountryCode:a.selectedCountryCode,storeCreditApplication:D()})];case 1:u=f.sent(),l=u.errors,c=u.json;if(l.length>0||!c){v("Error updating checkout session with store credit");return[2/*return*/]}
512
512
  // Apply updated subtotals from the response
513
513
  or({method:((r=c.checkoutSessionUpdate.landedCost)===null||r===void 0?void 0:r.method)||"DDP",subtotals:c.checkoutSessionUpdate.subtotals});sr(c.checkoutSessionUpdate);return[2/*return*/]}}))}))};
514
514
  /**
@@ -1,7 +1,7 @@
1
- System.register(["./p-DIJaXkiE.system.js"],(function(n){"use strict";var t;return{setters:[function(n){t=n.l}],execute:function(){
1
+ System.register(["./p-Cd9xIgx7.system.js"],(function(n){"use strict";var t;return{setters:[function(n){t=n.l}],execute:function(){
2
2
  /**
3
3
  * Since the backend and the frontend are using the same keys,
4
4
  * make sure to not change the key value below since if it changes
5
5
  * and the frontend script is cached, the formula may not work as expected.
6
6
  */
7
- var r=n("D","gkjqw123");var i=n("T","Kq93wqw3");var u=n("h",(function(){var n;return(n=t.inclusivePricingConfigurations)===null||n===void 0?void 0:n.some((function(n){var t,u;return((t=n.configurations[r])===null||t===void 0?void 0:t.status)==="ENABLED"||((u=n.configurations[i])===null||u===void 0?void 0:u.status)==="ENABLED"}))}))}}}));
7
+ var r=n("D","gkjqw123");var u=n("T","Kq93wqw3");var i=n("h",(function(){var n;return(n=t.inclusivePricingConfigurations)===null||n===void 0?void 0:n.some((function(n){var t,i;return((t=n.configurations[r])===null||t===void 0?void 0:t.status)==="ENABLED"||((i=n.configurations[u])===null||i===void 0?void 0:i.status)==="ENABLED"}))}))}}}));
@@ -0,0 +1 @@
1
+ import{r as o,h as n,a as i,F as s}from"./p-_lt63o7c.js";import{b as e,i as t,c,d as a,r,e as l,k as z,l as d,z as v,E as h,J as m,H as p,f as u}from"./p-DqEtY53c.js";import{i as g,a as b,b as f,c as w}from"./p-DdpeA8cH.js";import{p as x,a as y}from"./p-B6X55m0b.js";import{s as k,t as C,h as I,j,k as S,l as E}from"./p-CGkdA4pY.js";import{z as O}from"./p-CtEsvWI6.js";import{b as L}from"./p-BycjkdlE.js";import{h as T,s as D,l as U,g as A}from"./p-DE4a-QD5.js";import{i as P,a as _}from"./p-Clej0Ffe.js";import{c as N}from"./p-BJHSB96f.js";import{l as B}from"./p-BJmZPrZl.js";import"./p-YdrG78th.js";import"./p-3ERbuo5a.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-i1iCWKdv.js";const F=class{constructor(n){o(this,n),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=e.clientSecret,this.stripeCustomerSessionClientSecret=e.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=a.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:n}}=o;return n?{settlementAmount:(n.discounts||0)+n.items+n.landedCostTotal+n.shipping}:null},this.applyStripeTheme=async()=>{const o=O.appearance.theme;await t({overrideTheme:this.isMobile?o:void 0,paypalEnabled:x()})},this.fetchCheckoutSession=async o=>{const{json:n}=await T("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return n},this.checkStripePaymentIntentStatus=async()=>{var o;const n=!!window.Zonos.cartData,i=new URL(window.location.href).searchParams,s=i.get("payment_intent_client_secret"),t=i.get("zonosCheckoutSessionId");if(B("Payment intent exist, checking stripe payment intent status"),!s)return B("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:n};const{error:a,status:r}=await c({clientSecret:s});if(new URLSearchParams(window.location.search).get("redirect_status")&&t){B(a?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const n=await this.fetchCheckoutSession(t);return this.confirmationId=(null===(o=null==n?void 0:n.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,k.checkoutSessionId=t,e.clientSecret=s,this.setToFinishStep(r),{shouldAllowOrder:!1}}return n?(B("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(B("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=P(this.mobile),this.isTablet=_(this.tablet)}async setToFinishStep(o){e.stripe=window.Zonos.stripe,a.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initInvoiceCart(){var o,n,i,s,e,t,v,h,m,p,u;if(!window.Zonos.cartData)return;const f=null===(n=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===n?void 0:n.currencyCode;f&&(a.currency=f);const w=null===(s=null===(i=window.Zonos.cartData)||void 0===i?void 0:i.references)||void 0===s?void 0:s.checkoutSessionId,x=null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===t?void 0:t.landedCostId;if(!x)return void r({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});w?(B("Setting checkout session id from cart reference","info",w),k.checkoutSessionId=w):(B("Clear checkout session id from storage so we start from a fresh session for the invoice cart"),k.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:n}=L(window.Zonos.cartData);if(await l({adjustments:o,cartItems:n,landedCostId:x,shouldInitSessionOnFailure:!1}),!k.checkoutSessionId&&!w){const o=await z();if(B(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Invoice quote but being used with sandbox credential")}if((!a.checkoutSession||(null===(v=a.checkoutSession)||void 0===v?void 0:v.completedAt))&&w){const o=await this.fetchCheckoutSession(w);if(this.confirmationId=(null===(h=null==o?void 0:o.checkoutSession.landedCost)||void 0===h?void 0:h.shortId)||null,(null==o?void 0:o.checkoutSession.completedAt)&&o.checkoutSession.order)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:n}=await c({clientSecret:o.checkoutSession.clientSecret});if("processing"===n||"succeeded"===n)return void this.setToFinishStep(n)}throw D({endpoint:"INVALID_INVOICE_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:w,cartId:null===(m=window.Zonos.cartData)||void 0===m?void 0:m.id,cartLandedCostId:x}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!a.checkoutSession)throw D({endpoint:"FAIL_TO_UPDATE_CREATE_INVOICE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this invoice cart"],metadata:{cartCheckoutSessionId:w||"N/A",cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:x||"N/A"}}),new Error("Could not update/create checkout session for this invoice cart");d();const i=null===(u=a.checkoutSession)||void 0===u?void 0:u.landedCost;if(!i)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await g(Object.assign(Object.assign({},a.checkoutSession),{id:k.checkoutSessionId||""})),b({landedCostId:i.id}),this.applyStripeTheme()}catch(o){U(o),r({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,n,i,s;if(null===(o=e.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(n=e.stripeLinkEventData)||void 0===n?void 0:n.complete)if(null===(i=e.stripeBillingAddressEventData)||void 0===i?void 0:i.complete)if("USD"!==e.checkoutSettlementCurrency||!e.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,y.paypalErrorMessage=null,e.hasPaymentError=!1,this.submitLoading=!0,a.inventoryCheckErrorMessage=null,!await v())return e.hasPaymentError=!0,e.customErrorMessage=C("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:e.checkoutSettlementCurrency}),void(this.submitLoading=!1);await f();try{return await h({noLandedCostCheck:!0}),a.step="finish",void(this.confirmationId=w.landedCostShortId||(null===(s=a.selectedLandedCost)||void 0===s?void 0:s.landedCostId)||null)}catch(o){U(o),e.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){e.stripe=window.Zonos.stripe,a.step="payment",this.initInvoiceCart(),this.resizeListener(),this.storeUnsubscribeList=[m("clientSecret",(()=>{this.applyStripeTheme()})),I("selectedLocale",(()=>{this.applyStripeTheme()}))],B(`mobile: ${this.isMobile}`)}disconnectedCallback(){p(),u(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=e.clientSecret,e.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=e.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:t,theme:c}=O.appearance,r=()=>{const o=`${t}?timestamp=${Date.now()}`;return n("div",{class:"zonos--logo"},o&&n("img",{alt:`${O.organizationName} logo`,src:o}))},l=A(),z=()=>{var o;const i=new URLSearchParams(window.location.search),e=i.get("zonosQaUrl"),t=i.get("zonosDebug"),c=null===(o=S.find((o=>o.code===E.selectedLocale)))||void 0===o?void 0:o.label;return n(s,null,n("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},n("div",{class:"zonos--logo-wrapper"},r(),l&&n("zonos-badge",{badgeColor:"orange",size:"small"},C("Test mode")),"1"===t&&n("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),e&&n("zonos-badge",{badgeColor:"purple",size:"small"},e)),n("div",{class:"zonos--header-right"},n("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},c,n("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),n("div",{class:N(["zonos--invoice-language-dialog",this.showLanguageDialogMobile&&"zonos--invoice-language-dialog-open"])},n("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))))};return n(i,{class:N(["zonos--invoice zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},(()=>this.isOverlayLoading||e.isFetchingSession?null:n("div",{class:"zonos--content"},"finish"!==a.step&&"error"!==a.step&&n(s,null,(this.isMobile||this.isTablet)&&z(),n("div",{class:"zonos--left","data-theme":c},!this.isMobile&&!this.isTablet&&z(),n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},C("Billing info")),n("zonos-v-stack",{spacing:16},n("zonos-link-authentication",{titleText:""}),n("zonos-address",{titleText:"",type:"billing"})),n("zonos-invoice-payment",{class:N(["zonos--invoice-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),n("div",{class:"zonos--right","data-theme":c},!this.isMobile&&n("zonos-invoice-review",{mobile:this.isMobile,tablet:this.isTablet}),n("div",{class:"zonos--order-details-container"},!this.isMobile&&n("zonos-invoice-cart-items",null),this.isMobile&&n("zonos-invoice-order-details",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReviewMobile=!this.collapseReviewMobile}})),n("div",{class:"flex--wrapper"},!this.isMobile&&n("zonos-v-stack",{spacing:16},n("zonos-invoice-subtotal",null)),!this.isMobile&&!this.isTablet&&n("zonos-invoice-footer",{"data-theme":c,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===a.step||"error"===a.step)&&n("div",{class:"zonos--done","data-theme":c},n("div",{class:"zonos--header"},r()),n("zonos-invoice-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===a.step&&a.error?Object.assign(Object.assign({},a.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===a.step||"error"===a.step)&&n("zonos-invoice-footer",{"data-theme":c,mobile:this.isMobile,tablet:this.isTablet})))(),o&&n("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:C("Cancel"),dialogConfirmBtnText:C("Pay [orderTotal]",{orderTotal:j({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:C("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:C("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),n("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};F.style=".sc-zonos-invoice-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-invoice-h *.sc-zonos-invoice{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-invoice-h img.sc-zonos-invoice{max-width:100%}.sc-zonos-invoice-h dl.sc-zonos-invoice,.sc-zonos-invoice-h dd.sc-zonos-invoice,.sc-zonos-invoice-h h1.sc-zonos-invoice,.sc-zonos-invoice-h h2.sc-zonos-invoice,.sc-zonos-invoice-h h3.sc-zonos-invoice,.sc-zonos-invoice-h h4.sc-zonos-invoice,.sc-zonos-invoice-h h5.sc-zonos-invoice,.sc-zonos-invoice-h h6.sc-zonos-invoice,.sc-zonos-invoice-h hr.sc-zonos-invoice,.sc-zonos-invoice-h figure.sc-zonos-invoice,.sc-zonos-invoice-h p.sc-zonos-invoice,.sc-zonos-invoice-h pre.sc-zonos-invoice{margin:0}.sc-zonos-invoice-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-invoice-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h *.sc-zonos-invoice{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar{width:10px}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--header.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--logo.sc-zonos-invoice{margin-bottom:0}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice zonos-checkout-finish.sc-zonos-invoice{-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{padding:0 8px 8px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--payment-error-banner.sc-zonos-invoice{margin-top:24px}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice .zonos--order-details-container.sc-zonos-invoice{overflow:auto}.sc-zonos-invoice-h .zonos--wrapper.sc-zonos-invoice{overflow:auto;max-height:100%;position:relative}.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice>*.sc-zonos-invoice{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-invoice-h .zonos--header-right.sc-zonos-invoice{display:none}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice img.sc-zonos-invoice{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-invoice-h .zonos--invoice-container.sc-zonos-invoice{overflow:visible}.mobile.sc-zonos-invoice-h,.tablet.sc-zonos-invoice-h{min-width:auto}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding-bottom:0}}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice{margin-bottom:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice{margin-top:8px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{max-height:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:auto}.mobile.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice{margin:0}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px;padding:0 16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{overflow:visible;width:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{gap:32px}.mobile.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{margin-top:0}.mobile.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:56px;top:-56px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--header-right.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:28px;top:-28px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar{width:10px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.zonos--invoice-language-dialog-open.sc-zonos-invoice{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{F as zonos_invoice}