@zonos/elements 1.5.1 → 1.5.3

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 (250) hide show
  1. package/dist/cjs/_isBigCommerceNativeCheckout-3-xbKbAO.js +133 -0
  2. package/dist/cjs/{cart-CiXlehwQ.js → cart-C39TMSgB.js} +27 -13
  3. package/dist/cjs/{collect-Drr8fY-q.js → collect-lF9DenLk.js} +4 -4
  4. package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-svcnpumn.js} +1 -1
  5. package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
  6. package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
  7. package/dist/cjs/index.cjs.js +158 -47
  8. package/dist/cjs/{invoice-5hVfSXpb.js → invoice-BD3pCr8P.js} +3 -3
  9. package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
  10. package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-Bd1qmwiv.js} +4 -4
  11. package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-BMQRvX2q.js} +3 -3
  12. package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-DE2p8CT8.js} +2 -2
  13. package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
  14. package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
  15. package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-BKbk2bhi.js} +2 -2
  16. package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
  17. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +6 -6
  18. package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
  21. package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
  23. package/dist/cjs/zonos-checkout.cjs.entry.js +48 -22
  24. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
  25. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
  26. package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-controller.cjs.entry.js +65 -40
  28. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  29. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  30. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  31. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  32. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
  33. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
  34. package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
  35. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  36. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +14 -4
  39. package/dist/collection/components/main/mountCheckoutWithoutStripe.js +12 -0
  40. package/dist/collection/components/main/zonos-controller.js +26 -10
  41. package/dist/collection/components/store/checkout/cart.js +3 -2
  42. package/dist/collection/components/store/checkout/stripe.js +23 -10
  43. package/dist/collection/components/store/storageStore.js +7 -6
  44. package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
  45. package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
  46. package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +2 -1
  47. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +32 -12
  48. package/dist/collection/components/utils/handleFetch.js +19 -9
  49. package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
  50. package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
  51. package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
  52. package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
  53. package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
  54. package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
  55. package/dist/collection/components/utils/safeStorage.js +39 -0
  56. package/dist/collection/scripts/_bigcommerceCheckoutPath.js +16 -0
  57. package/dist/collection/scripts/_detectBigCommerceHost.js +12 -0
  58. package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
  59. package/dist/collection/scripts/_isBigCommerceNativeCheckout.js +107 -0
  60. package/dist/collection/scripts/_loadStripe.js +15 -4
  61. package/dist/collection/scripts/_zonosBase.js +46 -33
  62. package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
  63. package/dist/collection/types/generated/graphql.internal.types.js +215 -1
  64. package/dist/esm/_isBigCommerceNativeCheckout-Bb90IMVt.js +128 -0
  65. package/dist/esm/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +26 -14
  66. package/dist/esm/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +4 -4
  67. package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +1 -1
  68. package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
  69. package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
  70. package/dist/esm/index.js +158 -47
  71. package/dist/esm/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +3 -3
  72. package/dist/esm/{localization-DHM91diu.js → localization-B5CRzthT.js} +25 -49
  73. package/dist/esm/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +4 -4
  74. package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +3 -3
  75. package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +2 -2
  76. package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
  77. package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
  78. package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +2 -2
  79. package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
  80. package/dist/esm/zonos-address-completion-dialog_7.entry.js +6 -6
  81. package/dist/esm/zonos-address-display_2.entry.js +2 -2
  82. package/dist/esm/zonos-address_4.entry.js +4 -4
  83. package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
  84. package/dist/esm/zonos-card_5.entry.js +5 -5
  85. package/dist/esm/zonos-cart-items_12.entry.js +18 -18
  86. package/dist/esm/zonos-checkout.entry.js +48 -22
  87. package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
  88. package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
  89. package/dist/esm/zonos-collect.entry.js +6 -6
  90. package/dist/esm/zonos-controller.entry.js +65 -40
  91. package/dist/esm/zonos-country-flag.entry.js +2 -2
  92. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  93. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  94. package/dist/esm/zonos-hello.entry.js +2 -2
  95. package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
  96. package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
  97. package/dist/esm/zonos-invoice.entry.js +6 -6
  98. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  99. package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
  100. package/dist/esm-es5/_isBigCommerceNativeCheckout-Bb90IMVt.js +40 -0
  101. package/dist/esm-es5/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +59 -59
  102. package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +2 -2
  103. package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +3 -3
  104. package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
  105. package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
  106. package/dist/esm-es5/index.js +94 -65
  107. package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +1 -1
  108. package/dist/esm-es5/{localization-DHM91diu.js → localization-B5CRzthT.js} +7 -10
  109. package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +1 -1
  110. package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +1 -1
  111. package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +5 -5
  112. package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
  113. package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
  114. package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +1 -1
  115. package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
  116. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +2 -2
  117. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  118. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  119. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  120. package/dist/esm-es5/zonos-card_5.entry.js +6 -6
  121. package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
  122. package/dist/esm-es5/zonos-checkout.entry.js +22 -11
  123. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  124. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  125. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  126. package/dist/esm-es5/zonos-controller.entry.js +21 -12
  127. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  128. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  129. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  130. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  131. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  132. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  133. package/dist/esm-es5/zonos-invoice.entry.js +3 -3
  134. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  135. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  136. package/dist/scripts/index.d.ts +22 -0
  137. package/dist/scripts/index.js +1 -1
  138. package/dist/scripts/loadZonos.js +1 -1
  139. package/dist/scripts/zonos.js +1 -1
  140. package/dist/types/components/main/mountCheckoutWithoutStripe.d.ts +8 -0
  141. package/dist/types/components/store/checkout/stripe.d.ts +4 -1
  142. package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
  143. package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
  144. package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
  145. package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
  146. package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
  147. package/dist/types/components/utils/safeStorage.d.ts +4 -0
  148. package/dist/types/scripts/_bigcommerceCheckoutPath.d.ts +12 -0
  149. package/dist/types/scripts/_detectBigCommerceHost.d.ts +5 -0
  150. package/dist/types/scripts/_isBigCommerceNativeCheckout.d.ts +21 -0
  151. package/dist/types/scripts/_zonosBase.d.ts +16 -0
  152. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  153. package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
  154. package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
  155. package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
  156. package/dist/types/types/generated/graphql.internal.types.ts +341 -1
  157. package/dist/zonos-elements/index.esm.js +1 -1
  158. package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-02faff47.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-216a908d.system.entry.js → p-0c68cbbb.system.entry.js} +2 -2
  160. package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
  161. package/dist/zonos-elements/{p-960070d0.system.entry.js → p-1cd2d097.system.entry.js} +3 -3
  162. package/dist/zonos-elements/{p-1e6db427.entry.js → p-255e411a.entry.js} +1 -1
  163. package/dist/zonos-elements/p-2c_UqKJL.system.js +7 -0
  164. package/dist/zonos-elements/{p-DprOoI2W.system.js → p-3AUMK-5E.system.js} +154 -154
  165. package/dist/zonos-elements/{p-d3345b2c.entry.js → p-3ee87d8b.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-42fa5694.system.entry.js} +10 -10
  167. package/dist/zonos-elements/p-49eaaab8.entry.js +1 -0
  168. package/dist/zonos-elements/{p-fda89981.system.entry.js → p-4ce4c49f.system.entry.js} +3 -3
  169. package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-5622fc50.system.entry.js} +263 -252
  170. package/dist/zonos-elements/{p-5585db86.system.entry.js → p-59457fd9.system.entry.js} +73 -64
  171. package/dist/zonos-elements/{p-65817880.entry.js → p-66398133.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-674323ac.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-678b9214.entry.js → p-71d9a5b7.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-189cc594.system.entry.js → p-81780f8f.system.entry.js} +2 -2
  175. package/dist/zonos-elements/{p-6e691736.entry.js → p-821b83a2.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-877a82d2.system.entry.js} +94 -94
  177. package/dist/zonos-elements/p-8daec112.entry.js +1 -0
  178. package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-93bc75fd.system.entry.js} +13 -13
  179. package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-976b3bf3.system.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-84e76348.entry.js → p-9a4947a5.entry.js} +1 -1
  181. package/dist/zonos-elements/p-9f7693bf.entry.js +1 -0
  182. package/dist/zonos-elements/p-BIJM2Kj-.js +1 -0
  183. package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
  184. package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-BOh4ifdL.system.js} +51 -54
  185. package/dist/zonos-elements/p-BZAX-HmS.js +1 -0
  186. package/dist/zonos-elements/p-Bb90IMVt.js +1 -0
  187. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  188. package/dist/zonos-elements/{p-CbhN65lj.system.js → p-BvoPE_nb.system.js} +1 -1
  189. package/dist/zonos-elements/{p-iAIzUA4k.js → p-C3E55OqH.js} +1 -1
  190. package/dist/zonos-elements/{p-CBUz18kA.system.js → p-C3gF3UV5.system.js} +23 -23
  191. package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-CD2ahEZn.system.js} +1 -1
  192. package/dist/zonos-elements/p-CEBBLbvF.js +1 -0
  193. package/dist/zonos-elements/{p-CGNVm52g.system.js → p-CEV0O_IQ.system.js} +5 -5
  194. package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
  195. package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-CZ-uYiCo.system.js} +1 -1
  196. package/dist/zonos-elements/p-Cn2xE-9t.system.js +256 -0
  197. package/dist/zonos-elements/p-CtvXi9wL.system.js +41 -0
  198. package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Cw_Qnyow.system.js} +3 -3
  199. package/dist/zonos-elements/p-CzXNXgyI.js +1 -0
  200. package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
  201. package/dist/zonos-elements/p-D9OPKqLg.js +1 -0
  202. package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
  203. package/dist/zonos-elements/{p-DpwmHU8R.js → p-Df62LRNs.js} +2 -2
  204. package/dist/zonos-elements/{p-CHKKvuiz.js → p-Lsqrpzc5.js} +1 -1
  205. package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-YQFbWtjn.system.js} +1 -1
  206. package/dist/zonos-elements/p-a27f48e4.entry.js +1 -0
  207. package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-a6bb296c.system.entry.js} +7 -7
  208. package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-abb85879.system.entry.js} +3 -3
  209. package/dist/zonos-elements/{p-12b24ebb.entry.js → p-b8653024.entry.js} +1 -1
  210. package/dist/zonos-elements/p-b9d7a3b6.entry.js +1 -0
  211. package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-be067e12.system.entry.js} +15 -15
  212. package/dist/zonos-elements/p-bmrOH9oh.js +1 -0
  213. package/dist/zonos-elements/p-c185bc23.entry.js +1 -0
  214. package/dist/zonos-elements/{p-2d513aa3.entry.js → p-c6e78de2.entry.js} +1 -1
  215. package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-ca97a1cd.system.entry.js} +3 -3
  216. package/dist/zonos-elements/{p-3e705c9b.entry.js → p-cbb96382.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-dbf4d156.system.entry.js} +14 -14
  218. package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-df240119.system.entry.js} +16 -16
  219. package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-e16e4db6.system.entry.js} +17 -17
  220. package/dist/zonos-elements/{p-064d8829.system.entry.js → p-eb016dd8.system.entry.js} +20 -20
  221. package/dist/zonos-elements/{p-1199baef.system.entry.js → p-eb5c67a0.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-ef5344ea.entry.js → p-ed8a7a7f.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-4917b74d.entry.js → p-ef932fda.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-f792ba5f.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-DiMEP3mh.js → p-fZcKMzE-.js} +1 -1
  226. package/dist/zonos-elements/{p-CMo3ZweU.js → p-fdritVtG.js} +1 -1
  227. package/dist/zonos-elements/p-fffe6376.entry.js +1 -0
  228. package/dist/zonos-elements/p-gEViRqvf.js +1 -0
  229. package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-v8IEjQ2z.system.js} +39 -39
  230. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  231. package/package.json +10 -10
  232. package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
  233. package/dist/zonos-elements/p-107f287b.entry.js +0 -1
  234. package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
  235. package/dist/zonos-elements/p-46b9f0cf.entry.js +0 -1
  236. package/dist/zonos-elements/p-636b71d4.entry.js +0 -1
  237. package/dist/zonos-elements/p-7dc7f328.entry.js +0 -1
  238. package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
  239. package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
  240. package/dist/zonos-elements/p-C70h5mKA.js +0 -1
  241. package/dist/zonos-elements/p-CTiqplrr.js +0 -1
  242. package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
  243. package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
  244. package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
  245. package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
  246. package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
  247. package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
  248. package/dist/zonos-elements/p-U33isUJG.js +0 -1
  249. package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
  250. package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
@@ -17,6 +17,7 @@ import { jsonParse } from "./jsonParse";
17
17
  import { log } from "./logging/log";
18
18
  import { prepLoadTimeApiLog } from "./logging/prepLoadTimeApiLog";
19
19
  import { sendErrorLog } from "./logging/sendErrorLog";
20
+ const isGatewayStatus = (status) => status === 502 || status === 503 || status === 504;
20
21
  const getResponseBody = async ({ response, shouldLog = true, shouldThrow = false, }) => {
21
22
  try {
22
23
  const text = await response.text();
@@ -137,28 +138,31 @@ const handleRequest = async ({ basePathType, options, path, }) => {
137
138
  }
138
139
  catch (_a) {
139
140
  const message = 'Unknown error';
141
+ // A gateway HTML or empty body still carries a status a GET can fail over
142
+ // on. Other non-JSON statuses, including 404 and 500, keep the previous
143
+ // null response so they do not fail over.
140
144
  return {
141
145
  baseUrl,
142
146
  errors: [{ message: `${status}: ${message}`, type: status }],
143
147
  json: null,
144
- response: null,
148
+ response: isGatewayStatus(response.status) ? response : null,
145
149
  zonosMode,
146
150
  };
147
151
  }
148
152
  };
149
153
  const handleRequestWithFallback = async ({ basePathType: _basePathType, options, path, }) => {
150
- var _a, _b;
154
+ var _a, _b, _c;
151
155
  // use vercel API if the path is `/api/bigcommerce`
152
156
  const isBigcommerceEndpoint = path.startsWith('/api/bigcommerce');
153
157
  const basePathType = isBigcommerceEndpoint
154
158
  ? 'vercel'
155
159
  : _basePathType;
156
160
  const startTime = performance.now();
157
- const _c = await handleRequest({
161
+ const _d = await handleRequest({
158
162
  basePathType,
159
163
  options,
160
164
  path,
161
- }), { errors, response } = _c, rest = __rest(_c, ["errors", "response"]);
165
+ }), { errors, response } = _d, rest = __rest(_d, ["errors", "response"]);
162
166
  const endTime = performance.now();
163
167
  const duration = endTime - startTime;
164
168
  // Send the load time api log
@@ -180,10 +184,16 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
180
184
  (message.includes('signal is aborted') ||
181
185
  message.includes('The operation was aborted') ||
182
186
  message.includes('Fetch is aborted')));
183
- const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404 || (response === null || response === void 0 ? void 0 : response.status) === 500;
184
- const shouldCallFallback =
185
- // If next fallback is available, and the error is unknown (Failed to fetch) or 404 or 500 (server error)
186
- nextFallbackApiType && isUnknownError;
187
+ const statusCode = response === null || response === void 0 ? void 0 : response.status;
188
+ const gateway = statusCode !== undefined && isGatewayStatus(statusCode);
189
+ // handleFetch sets method, and a missing method is a GET.
190
+ const isIdempotentGet = ((_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase() === 'GET';
191
+ const failedWithoutGateway = !!unknownError || statusCode === 404 || statusCode === 500;
192
+ const isUnknownError = failedWithoutGateway || gateway;
193
+ // Replay 502, 503, and 504 only for GET. A gateway timeout on a POST can
194
+ // mean the first host is still finishing a payment or order write.
195
+ const shouldCallFallback = nextFallbackApiType &&
196
+ (failedWithoutGateway || (gateway && isIdempotentGet));
187
197
  // Should log the error if it's unknown error
188
198
  if (isUnknownError && !isAbortError) {
189
199
  void sendErrorLog({
@@ -193,7 +203,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
193
203
  currentBasePath: basePathType,
194
204
  nextFallbackApiType,
195
205
  requestHeaders: options === null || options === void 0 ? void 0 : options.headers,
196
- requestPayload: jsonParse((_a = options === null || options === void 0 ? void 0 : options.body) === null || _a === void 0 ? void 0 : _a.toString()) || ((_b = options === null || options === void 0 ? void 0 : options.body) === null || _b === void 0 ? void 0 : _b.toString()),
206
+ requestPayload: jsonParse((_b = options === null || options === void 0 ? void 0 : options.body) === null || _b === void 0 ? void 0 : _b.toString()) || ((_c = options === null || options === void 0 ? void 0 : options.body) === null || _c === void 0 ? void 0 : _c.toString()),
197
207
  shouldCallFallback,
198
208
  status: response === null || response === void 0 ? void 0 : response.status,
199
209
  statusText: response === null || response === void 0 ? void 0 : response.statusText,
@@ -1,55 +1,32 @@
1
1
  import { isCountryCode } from "./isCountryCode";
2
+ import { safeGetItem, safeRemoveItem, safeSetItem, } from "../safeStorage";
2
3
  const COUNTRY_OVERRIDE_KEY = 'zonos--country';
3
- const withBlockedStorage = (run) => {
4
- try {
5
- run();
6
- }
7
- catch (_a) {
8
- // localStorage/sessionStorage can throw in blocked-storage contexts
9
- // (Safari private mode, cross-origin iframes).
10
- }
11
- };
12
- const readStoredCountry = (storage) => {
13
- try {
14
- const value = storage.getItem(COUNTRY_OVERRIDE_KEY);
15
- if (!value || !isCountryCode(value)) {
16
- return null;
17
- }
18
- return value;
19
- }
20
- catch (_a) {
4
+ const readStoredCountry = (area) => {
5
+ const value = safeGetItem(area, COUNTRY_OVERRIDE_KEY);
6
+ if (!value || !isCountryCode(value)) {
21
7
  return null;
22
8
  }
9
+ return value;
23
10
  };
24
- const writeOverride = (storage, countryCode) => {
25
- storage.setItem(COUNTRY_OVERRIDE_KEY, countryCode);
26
- };
27
- const withEachStorage = (run) => {
28
- withBlockedStorage(() => run(window.localStorage));
29
- withBlockedStorage(() => run(window.sessionStorage));
30
- };
31
- export const getCountryOverrideStorage = () => {
32
- var _a;
33
- return (_a = readStoredCountry(window.localStorage)) !== null && _a !== void 0 ? _a : readStoredCountry(window.sessionStorage);
34
- };
11
+ export const getCountryOverrideStorage = () => { var _a; return (_a = readStoredCountry('local')) !== null && _a !== void 0 ? _a : readStoredCountry('session'); };
35
12
  export const migrateCountryOverrideStorage = (selectedCountryCode) => {
36
13
  if (!selectedCountryCode) {
37
14
  return;
38
15
  }
39
- withBlockedStorage(() => {
40
- const localCountry = readStoredCountry(window.localStorage);
41
- // Only mirror the country Hello actually kept. A failed localStorage
42
- // clear can leave a discarded country in local; never copy that to
43
- // session for older Elements. Never copy session → local.
44
- if (localCountry === selectedCountryCode) {
45
- writeOverride(window.sessionStorage, localCountry);
46
- }
47
- });
16
+ const localCountry = readStoredCountry('local');
17
+ // Only mirror the country Hello actually kept. A failed localStorage
18
+ // clear can leave a discarded country in local; never copy that to
19
+ // session for older Elements. Never copy session → local.
20
+ if (localCountry === selectedCountryCode) {
21
+ safeSetItem('session', COUNTRY_OVERRIDE_KEY, localCountry);
22
+ }
48
23
  };
49
24
  export const setCountryOverrideStorage = (countryCode) => {
50
25
  // Dual-write so older Elements that only read sessionStorage see the pick.
51
- withEachStorage(storage => writeOverride(storage, countryCode));
26
+ safeSetItem('local', COUNTRY_OVERRIDE_KEY, countryCode);
27
+ safeSetItem('session', COUNTRY_OVERRIDE_KEY, countryCode);
52
28
  };
53
29
  export const clearCountryOverrideStorage = () => {
54
- withEachStorage(storage => storage.removeItem(COUNTRY_OVERRIDE_KEY));
30
+ safeRemoveItem('local', COUNTRY_OVERRIDE_KEY);
31
+ safeRemoveItem('session', COUNTRY_OVERRIDE_KEY);
55
32
  };
@@ -0,0 +1,58 @@
1
+ import { sendErrorLog } from "./sendErrorLog";
2
+ import { thrownMessage } from "./thrownMessage";
3
+ const constructorNotFound = /^Constructor for .+ was not found/;
4
+ const constructorTag = /^Constructor for "?([^#"]+)#/;
5
+ const recordConstructorFailure = (value) => {
6
+ var _a;
7
+ const message = thrownMessage(value, '');
8
+ if (!message || !constructorNotFound.test(message)) {
9
+ return;
10
+ }
11
+ if (typeof window.Zonos === 'undefined') {
12
+ return;
13
+ }
14
+ const capture = window.__zonosConstructorCapture;
15
+ if (!capture) {
16
+ return;
17
+ }
18
+ const tagMatch = constructorTag.exec(message);
19
+ const tag = (_a = tagMatch === null || tagMatch === void 0 ? void 0 : tagMatch[1]) !== null && _a !== void 0 ? _a : '';
20
+ if (capture.reported.has(tag)) {
21
+ return;
22
+ }
23
+ capture.reported.add(tag);
24
+ void sendErrorLog({
25
+ endpoint: 'stencil://constructor',
26
+ errors: [message],
27
+ metadata: {
28
+ shape: 'constructor-not-found',
29
+ tag,
30
+ },
31
+ });
32
+ };
33
+ /**
34
+ * Copy a missing-constructor failure onto the existing error log.
35
+ * Stencil catches `Constructor for "tag#mode" was not found` and passes that
36
+ * Error to `console.error`. One report is sent per tag, then the original
37
+ * console.error still runs. This does not request the chunk again.
38
+ */
39
+ export const installConstructorCapture = () => {
40
+ if (window.__zonosConstructorCapture) {
41
+ return;
42
+ }
43
+ const listener = (event) => {
44
+ recordConstructorFailure(event.reason);
45
+ };
46
+ window.__zonosConstructorCapture = {
47
+ listener,
48
+ reported: new Set(),
49
+ };
50
+ window.addEventListener('unhandledrejection', listener);
51
+ // eslint-disable-next-line no-console -- Stencil reports the missing constructor here
52
+ const originalError = console.error.bind(console);
53
+ // eslint-disable-next-line no-console -- record the Stencil diagnostic, then forward it
54
+ console.error = (...data) => {
55
+ recordConstructorFailure(data[0]);
56
+ originalError(...data);
57
+ };
58
+ };
@@ -0,0 +1,34 @@
1
+ import { sendErrorLog } from "./sendErrorLog";
2
+ import { thrownMessage } from "./thrownMessage";
3
+ const reportedIds = () => {
4
+ if (!window.__zonosReportedBlockedStorage) {
5
+ window.__zonosReportedBlockedStorage = new Set();
6
+ }
7
+ return window.__zonosReportedBlockedStorage;
8
+ };
9
+ /**
10
+ * Record a blocked storage read or write on the existing error log.
11
+ * A throw before `window.Zonos` exists is swallowed and does not use up
12
+ * the per-page dedupe slot, so the later startup read can still report it.
13
+ */
14
+ export const reportBlockedStorage = (area, operation, key, error) => {
15
+ if (typeof window.Zonos === 'undefined') {
16
+ return;
17
+ }
18
+ const dedupeId = `${area}\u0000${operation}\u0000${key}`;
19
+ const reported = reportedIds();
20
+ if (reported.has(dedupeId)) {
21
+ return;
22
+ }
23
+ reported.add(dedupeId);
24
+ void sendErrorLog({
25
+ endpoint: `storage://${area}/${key}`,
26
+ errors: [thrownMessage(error, 'SecurityError')],
27
+ metadata: {
28
+ area,
29
+ key,
30
+ operation,
31
+ shape: 'blocked-storage',
32
+ },
33
+ });
34
+ };
@@ -5,6 +5,13 @@ import { log } from "./log";
5
5
  * @default 1 hour
6
6
  */
7
7
  const postReleaseReportingDuration = 1 * 3600 * 1000; // 1 hour
8
+ const loggedHref = () => {
9
+ const url = new URL(window.location.href);
10
+ url.searchParams.delete('payment_intent');
11
+ url.searchParams.delete('payment_intent_client_secret');
12
+ url.searchParams.delete('redirect_status');
13
+ return url.toString();
14
+ };
8
15
  export const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseErrorReporting, }) => {
9
16
  log('sendErrorLog', 'warn', endpoint, metadata, errors);
10
17
  if (shouldPostReleaseErrorReporting) {
@@ -22,7 +29,7 @@ export const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostRelea
22
29
  const errorObject = {
23
30
  endpoint,
24
31
  errors,
25
- href: window.location.href,
32
+ href: loggedHref(),
26
33
  metadata: Object.assign({ appVersion: window.Zonos.version, domain: window.Zonos.domain, publicCredential: window.Zonos.zonosApiKey, userAgent: userAgentData && userAgentData.brands.length > 0
27
34
  ? userAgentData
28
35
  : window.navigator.userAgent }, metadata),
@@ -0,0 +1,35 @@
1
+ import { sendErrorLog } from "./sendErrorLog";
2
+ import { thrownMessage } from "./thrownMessage";
3
+ const reportInitRejection = (error) => {
4
+ // sendErrorLog prints only when zonosDebug is on. Keep the failure in the
5
+ // merchant console without leaving an unhandled rejection.
6
+ // eslint-disable-next-line no-console -- the page console is the support signal
7
+ console.error(error);
8
+ if (typeof window.Zonos === 'undefined') {
9
+ return;
10
+ }
11
+ void sendErrorLog({
12
+ endpoint: 'zonos://init',
13
+ errors: [thrownMessage(error, 'Unknown init rejection')],
14
+ metadata: {
15
+ shape: 'init-rejection',
16
+ },
17
+ });
18
+ };
19
+ /**
20
+ * Run an init that the caller is not waiting on. The rejection is recorded
21
+ * and not rethrown, so startup does not become an unhandled rejection.
22
+ */
23
+ export const startZonosInit = (start) => {
24
+ let pending;
25
+ try {
26
+ pending = start();
27
+ }
28
+ catch (error) {
29
+ reportInitRejection(error);
30
+ return;
31
+ }
32
+ void pending.catch((error) => {
33
+ reportInitRejection(error);
34
+ });
35
+ };
@@ -0,0 +1,16 @@
1
+ export const thrownMessage = (error, fallback) => {
2
+ if (typeof error === 'string' && error) {
3
+ return error;
4
+ }
5
+ if (error instanceof Error && error.message) {
6
+ return error.message;
7
+ }
8
+ if (typeof error === 'object' &&
9
+ error !== null &&
10
+ 'message' in error &&
11
+ typeof error.message === 'string' &&
12
+ error.message) {
13
+ return error.message;
14
+ }
15
+ return fallback;
16
+ };
@@ -0,0 +1,39 @@
1
+ import { reportBlockedStorage, } from "./logging/reportBlockedStorage";
2
+ /**
3
+ * Touch `window.localStorage` / `window.sessionStorage` inside the try.
4
+ * Safari throws SecurityError on the getter itself when storage is blocked.
5
+ * A missing storage object is the same failure: calling `getItem` on it
6
+ * would report a TypeError instead of blocked storage.
7
+ */
8
+ const storageFor = (area) => {
9
+ const storage = area === 'local' ? window.localStorage : window.sessionStorage;
10
+ if (!storage) {
11
+ throw new DOMException('', 'SecurityError');
12
+ }
13
+ return storage;
14
+ };
15
+ export const safeGetItem = (area, key) => {
16
+ try {
17
+ return storageFor(area).getItem(key);
18
+ }
19
+ catch (error) {
20
+ reportBlockedStorage(area, 'getItem', key, error);
21
+ return null;
22
+ }
23
+ };
24
+ export const safeRemoveItem = (area, key) => {
25
+ try {
26
+ storageFor(area).removeItem(key);
27
+ }
28
+ catch (error) {
29
+ reportBlockedStorage(area, 'removeItem', key, error);
30
+ }
31
+ };
32
+ export const safeSetItem = (area, key, value) => {
33
+ try {
34
+ storageFor(area).setItem(key, value);
35
+ }
36
+ catch (error) {
37
+ reportBlockedStorage(area, 'setItem', key, error);
38
+ }
39
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Two checkout-path rules, kept together so they cannot drift in separate files.
3
+ *
4
+ * `pathContainsCheckout` is the broad rule for zBypass and address detection.
5
+ * It still matches paths such as `checkout-page`.
6
+ *
7
+ * `hasExactCheckoutSegment` is the strict rule for the Stripe.js skip. Only a
8
+ * segment exactly equal to `checkout` counts, so a slug does not drop the
9
+ * payment script.
10
+ */
11
+ export const pathContainsCheckout = (pathname) => {
12
+ return pathname.includes('/checkout');
13
+ };
14
+ export const hasExactCheckoutSegment = (pathname) => {
15
+ return pathname.split('/').some(segment => segment === 'checkout');
16
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Storefront signals BigCommerce sets before Zonos copies `isBigCommerce`.
3
+ * Shared by the loader script and the Stripe skip so the two cannot drift.
4
+ */
5
+ export const detectBigCommerceHost = () => {
6
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
7
+ return false;
8
+ }
9
+ return (!!window.stencilBootstrap ||
10
+ !!window.bcConfig ||
11
+ !!document.querySelector('script[src*="bigcommerce.com"]'));
12
+ };
@@ -1,4 +1,5 @@
1
1
  import { log } from "../components/utils/logging/log";
2
+ import { safeRemoveItem } from "../components/utils/safeStorage";
2
3
  import { extractZonosQaUrl, extractZonosQaUrlApi, } from "./_extractZonosQaUrl";
3
4
  /**
4
5
  * Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
@@ -49,8 +50,8 @@ export const getZonosQaUrl = () => {
49
50
  void fetch(fullUrl)
50
51
  .then(() => {
51
52
  // cleanup checkout session to avoid using the prod session in preview domain
52
- window.sessionStorage.removeItem('zonos--checkout-session-id');
53
- window.sessionStorage.removeItem('zonos--client-secret');
53
+ safeRemoveItem('session', 'zonos--checkout-session-id');
54
+ safeRemoveItem('session', 'zonos--client-secret');
54
55
  })
55
56
  .catch(() => {
56
57
  alert(`[ZONOS-WARNING] '${fullUrl}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);
@@ -0,0 +1,107 @@
1
+ import { hasExactCheckoutSegment } from "./_bigcommerceCheckoutPath";
2
+ import { detectBigCommerceHost } from "./_detectBigCommerceHost";
3
+ const hasCheckoutSegment = () => hasExactCheckoutSegment(window.location.pathname);
4
+ const sharedZonos = () => {
5
+ if (typeof window === 'undefined' || !('Zonos' in window)) {
6
+ return undefined;
7
+ }
8
+ return window.Zonos;
9
+ };
10
+ const isFlaggedBigCommerce = () => {
11
+ var _a;
12
+ return ((_a = sharedZonos()) === null || _a === void 0 ? void 0 : _a.isBigCommerce) === true;
13
+ };
14
+ /**
15
+ * The settled answer lives on `window.Zonos`, the object loadZonos.js,
16
+ * zonos.js, and the component bundle already share.
17
+ *
18
+ * A `true` result sticks for that pathname. A `false` result sticks once
19
+ * the path is not checkout, or once host detection has finished. A checkout
20
+ * path whose BigCommerce signals are not in the page yet stays unset, so a
21
+ * later signal can still settle it.
22
+ */
23
+ const readSettled = () => {
24
+ const zonos = sharedZonos();
25
+ if (zonos === undefined) {
26
+ return undefined;
27
+ }
28
+ if (zonos.isBigCommerceNativeCheckoutPath !== window.location.pathname) {
29
+ return undefined;
30
+ }
31
+ const value = zonos.isBigCommerceNativeCheckout;
32
+ if (value === true || value === false) {
33
+ return value;
34
+ }
35
+ return undefined;
36
+ };
37
+ const writeSettled = (value) => {
38
+ const zonos = sharedZonos();
39
+ if (zonos !== undefined) {
40
+ zonos.isBigCommerceNativeCheckout = value;
41
+ zonos.isBigCommerceNativeCheckoutPath = window.location.pathname;
42
+ }
43
+ return value;
44
+ };
45
+ /**
46
+ * Call after `isBigCommerce` has been copied from host detection. Writes the
47
+ * settled boolean onto `window.Zonos` for this pathname.
48
+ */
49
+ export const markBigCommerceHostChecked = () => {
50
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
51
+ return;
52
+ }
53
+ const zonos = sharedZonos();
54
+ if (zonos === undefined) {
55
+ return;
56
+ }
57
+ const native = hasCheckoutSegment() && (detectBigCommerceHost() || isFlaggedBigCommerce());
58
+ zonos.isBigCommerceNativeCheckout = native;
59
+ zonos.isBigCommerceNativeCheckoutPath = window.location.pathname;
60
+ };
61
+ /** Test helper. Production pages keep the answer for the document. */
62
+ export const resetBigCommerceNativeCheckoutCache = () => {
63
+ const zonos = sharedZonos();
64
+ if (zonos === undefined) {
65
+ return;
66
+ }
67
+ Reflect.deleteProperty(zonos, 'isBigCommerceNativeCheckout');
68
+ Reflect.deleteProperty(zonos, 'isBigCommerceNativeCheckoutPath');
69
+ };
70
+ const decide = () => {
71
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
72
+ return false;
73
+ }
74
+ const settled = readSettled();
75
+ if (settled !== undefined) {
76
+ return settled;
77
+ }
78
+ if (!hasCheckoutSegment()) {
79
+ return writeSettled(false);
80
+ }
81
+ if (detectBigCommerceHost() || isFlaggedBigCommerce()) {
82
+ return writeSettled(true);
83
+ }
84
+ return undefined;
85
+ };
86
+ /**
87
+ * True when this document is BigCommerce native checkout.
88
+ * Stripe.js injection is owned by `loadStripeScript` in `_loadStripe.ts`.
89
+ * Other callers use this for a different job: skip `attachCheckout`, leave
90
+ * the store's buttons enabled, or hand a leftover domestic session to `/`.
91
+ * An undecided checkout path returns false and is not stored.
92
+ */
93
+ export const isBigCommerceNativeCheckout = () => {
94
+ return decide() === true;
95
+ };
96
+ /**
97
+ * True when Stripe.js must not be injected. An undecided checkout path
98
+ * holds the script until host detection finishes, instead of storing "not
99
+ * native checkout" and injecting v3 early.
100
+ */
101
+ export const holdStripeForNativeCheckout = () => {
102
+ const decision = decide();
103
+ if (decision === undefined) {
104
+ return true;
105
+ }
106
+ return decision;
107
+ };
@@ -1,4 +1,5 @@
1
1
  // Execute our own script injection after a tick to give users time to do their
2
+ import { holdStripeForNativeCheckout } from "./_isBigCommerceNativeCheckout";
2
3
  import { initStripe, zonosStripeLoadScript, } from "./_stripe";
3
4
  // own script injection.
4
5
  const hasCheckoutCartCallback = () => {
@@ -7,13 +8,23 @@ const hasCheckoutCartCallback = () => {
7
8
  (typeof ((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.createCartId) === 'function' ||
8
9
  typeof ((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.buildCartDetail) === 'function');
9
10
  };
11
+ /**
12
+ * The only function that may inject Stripe.js. Native BigCommerce checkout
13
+ * returns null before `window.Stripe` is read or `js.stripe.com/v3` is added.
14
+ * Callers decide whether to ask for Stripe. They do not load it themselves.
15
+ */
16
+ const loadStripeScript = () => {
17
+ if (holdStripeForNativeCheckout()) {
18
+ return Promise.resolve(null);
19
+ }
20
+ return zonosStripeLoadScript(null);
21
+ };
10
22
  const stripePromise = Promise.resolve().then(() => {
11
- // Skip eagerly loading Stripe when no checkout cart callback is configured
12
- // (e.g. a Hello-only integration). Stripe is loaded on demand instead.
23
+ // Hello-only pages have no cart callback, so they skip the eager preload.
13
24
  if (!hasCheckoutCartCallback()) {
14
25
  return null;
15
26
  }
16
- return zonosStripeLoadScript(null);
27
+ return loadStripeScript();
17
28
  });
18
29
  let loadCalled = false;
19
30
  stripePromise.catch((err) => {
@@ -29,6 +40,6 @@ export const zonosLoadStripe = async (...args) => {
29
40
  // Fall back to loading Stripe on demand if the eager preload was skipped
30
41
  // (callbacks set after the microtask, or Collect/Invoice flows that don't
31
42
  // use cart callbacks). `zonosStripeLoadScript` is idempotent.
32
- const maybeStripe = (_a = (await stripePromise)) !== null && _a !== void 0 ? _a : (await zonosStripeLoadScript(null));
43
+ const maybeStripe = (_a = (await stripePromise)) !== null && _a !== void 0 ? _a : (await loadStripeScript());
33
44
  return initStripe(maybeStripe, args, startTime);
34
45
  };