@zonos/elements 1.5.2 → 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.
- package/dist/cjs/_isBigCommerceNativeCheckout-3-xbKbAO.js +133 -0
- package/dist/cjs/{cart-BJpqPdFU.js → cart-C39TMSgB.js} +14 -0
- package/dist/cjs/{collect-CyUttsvB.js → collect-lF9DenLk.js} +2 -2
- package/dist/cjs/{getMissingRequiredShippingFields-DEbNbRAZ.js → getMissingRequiredShippingFields-svcnpumn.js} +1 -1
- package/dist/cjs/index.cjs.js +61 -42
- package/dist/cjs/{invoice-DzRkkpLu.js → invoice-BD3pCr8P.js} +1 -1
- package/dist/cjs/{paypal-DCSqbdjW.js → paypal-Bd1qmwiv.js} +1 -1
- package/dist/cjs/{placeTestOrder-Bkip4PUT.js → placeTestOrder-BMQRvX2q.js} +1 -1
- package/dist/cjs/{renderCheckoutCurrency-BDvEZ3Hv.js → renderCheckoutCurrency-DE2p8CT8.js} +1 -1
- package/dist/cjs/{taxIdFields-e4OCgr8K.js → taxIdFields-BKbk2bhi.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +4 -4
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +5 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +41 -15
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +5 -5
- package/dist/cjs/zonos-collect.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +63 -38
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice.cjs.entry.js +3 -3
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +10 -1
- package/dist/collection/components/main/mountCheckoutWithoutStripe.js +12 -0
- package/dist/collection/components/main/zonos-controller.js +24 -9
- package/dist/collection/components/store/checkout/stripe.js +13 -1
- package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +2 -1
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +32 -12
- package/dist/collection/scripts/_bigcommerceCheckoutPath.js +16 -0
- package/dist/collection/scripts/_detectBigCommerceHost.js +12 -0
- package/dist/collection/scripts/_isBigCommerceNativeCheckout.js +107 -0
- package/dist/collection/scripts/_loadStripe.js +15 -4
- package/dist/collection/scripts/_zonosBase.js +40 -31
- package/dist/esm/_isBigCommerceNativeCheckout-Bb90IMVt.js +128 -0
- package/dist/esm/{cart-BS5mSI8x.js → cart-b84n0nhi.js} +14 -2
- package/dist/esm/{collect-B9ZxDDl7.js → collect-B_AEVONL.js} +3 -3
- package/dist/esm/{getMissingRequiredShippingFields-BkEV865q.js → getMissingRequiredShippingFields-EY10c34-.js} +1 -1
- package/dist/esm/{hasInclusivePrice-zSvDReDb.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm/index.js +61 -42
- package/dist/esm/{invoice-6iTuS6ek.js → invoice-dQ0ONK5Q.js} +2 -2
- package/dist/esm/{localization-CXHiWcJp.js → localization-B5CRzthT.js} +1 -1
- package/dist/esm/{paypal-BE_NVBoy.js → paypal-CF_oM0B6.js} +2 -2
- package/dist/esm/{placeTestOrder-BXA9K9Iy.js → placeTestOrder-BTpfyqPL.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-KMa4HlAf.js → renderCheckoutCurrency-CpeuDWx-.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-BI_ApEsQ.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm/{taxIdFields-BUKnHMaL.js → taxIdFields-BCyXnc9O.js} +2 -2
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +5 -5
- package/dist/esm/zonos-address-display_2.entry.js +1 -1
- package/dist/esm/zonos-address_4.entry.js +3 -3
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +8 -8
- package/dist/esm/zonos-checkout.entry.js +42 -16
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +7 -7
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +63 -38
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +7 -7
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
- package/dist/esm-es5/_isBigCommerceNativeCheckout-Bb90IMVt.js +40 -0
- package/dist/esm-es5/{cart-BS5mSI8x.js → cart-b84n0nhi.js} +9 -9
- package/dist/esm-es5/{collect-B9ZxDDl7.js → collect-B_AEVONL.js} +2 -2
- package/dist/esm-es5/{getMissingRequiredShippingFields-BkEV865q.js → getMissingRequiredShippingFields-EY10c34-.js} +3 -3
- package/dist/esm-es5/{hasInclusivePrice-zSvDReDb.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm-es5/index.js +76 -65
- package/dist/esm-es5/{invoice-6iTuS6ek.js → invoice-dQ0ONK5Q.js} +1 -1
- package/dist/esm-es5/{localization-CXHiWcJp.js → localization-B5CRzthT.js} +1 -1
- package/dist/esm-es5/{paypal-BE_NVBoy.js → paypal-CF_oM0B6.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-BXA9K9Iy.js → placeTestOrder-BTpfyqPL.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-KMa4HlAf.js → renderCheckoutCurrency-CpeuDWx-.js} +4 -4
- package/dist/esm-es5/{shouldShowLanguageSelect-BI_ApEsQ.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm-es5/{taxIdFields-BUKnHMaL.js → taxIdFields-BCyXnc9O.js} +2 -2
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +2 -2
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +20 -9
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +6 -6
- package/dist/esm-es5/zonos-controller.entry.js +22 -13
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +16 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/main/mountCheckoutWithoutStripe.d.ts +8 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -1
- package/dist/types/scripts/_bigcommerceCheckoutPath.d.ts +12 -0
- package/dist/types/scripts/_detectBigCommerceHost.d.ts +5 -0
- package/dist/types/scripts/_isBigCommerceNativeCheckout.d.ts +21 -0
- package/dist/types/scripts/_zonosBase.d.ts +16 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-08b01c96.entry.js → p-02faff47.entry.js} +1 -1
- package/dist/zonos-elements/{p-573a4e7c.system.entry.js → p-0c68cbbb.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-68325c5a.system.entry.js → p-1cd2d097.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-af741506.entry.js → p-255e411a.entry.js} +1 -1
- package/dist/zonos-elements/{p-dJcbnNlE.system.js → p-2c_UqKJL.system.js} +2 -2
- package/dist/zonos-elements/{p-BUfCTQXY.system.js → p-3AUMK-5E.system.js} +113 -113
- package/dist/zonos-elements/{p-dd003161.entry.js → p-3ee87d8b.entry.js} +1 -1
- package/dist/zonos-elements/{p-8f9f859f.system.entry.js → p-42fa5694.system.entry.js} +5 -5
- package/dist/zonos-elements/p-49eaaab8.entry.js +1 -0
- package/dist/zonos-elements/{p-ebc7ea54.system.entry.js → p-4ce4c49f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b3668a4.system.entry.js → p-5622fc50.system.entry.js} +263 -252
- package/dist/zonos-elements/{p-3a506614.system.entry.js → p-59457fd9.system.entry.js} +71 -62
- package/dist/zonos-elements/{p-7fe83919.entry.js → p-66398133.entry.js} +1 -1
- package/dist/zonos-elements/{p-9df31243.system.entry.js → p-674323ac.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-97729873.entry.js → p-71d9a5b7.entry.js} +1 -1
- package/dist/zonos-elements/{p-30bf4700.system.entry.js → p-81780f8f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-1986cc37.entry.js → p-821b83a2.entry.js} +1 -1
- package/dist/zonos-elements/{p-5a296dbc.system.entry.js → p-877a82d2.system.entry.js} +61 -61
- package/dist/zonos-elements/p-8daec112.entry.js +1 -0
- package/dist/zonos-elements/{p-150047b3.system.entry.js → p-93bc75fd.system.entry.js} +19 -19
- package/dist/zonos-elements/{p-b540c636.system.entry.js → p-976b3bf3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4b65f192.entry.js → p-9a4947a5.entry.js} +1 -1
- package/dist/zonos-elements/p-9f7693bf.entry.js +1 -0
- package/dist/zonos-elements/{p-D4xpkSsK.js → p-BIJM2Kj-.js} +1 -1
- package/dist/zonos-elements/{p-D-Lnf8mS.system.js → p-BOh4ifdL.system.js} +2 -2
- package/dist/zonos-elements/p-BZAX-HmS.js +1 -0
- package/dist/zonos-elements/p-Bb90IMVt.js +1 -0
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-DC1OPJDq.system.js → p-BvoPE_nb.system.js} +1 -1
- package/dist/zonos-elements/{p-C5fs3rIR.js → p-C3E55OqH.js} +1 -1
- package/dist/zonos-elements/{p-BnQyot7Y.system.js → p-C3gF3UV5.system.js} +29 -29
- package/dist/zonos-elements/{p-BKUlQxBd.system.js → p-CD2ahEZn.system.js} +1 -1
- package/dist/zonos-elements/p-CEBBLbvF.js +1 -0
- package/dist/zonos-elements/{p-Cp1IAJvW.system.js → p-CEV0O_IQ.system.js} +4 -4
- package/dist/zonos-elements/{p-yv7ekcdG.system.js → p-CZ-uYiCo.system.js} +2 -2
- package/dist/zonos-elements/{p-CP7KnfR3.system.js → p-Cn2xE-9t.system.js} +79 -68
- package/dist/zonos-elements/p-CtvXi9wL.system.js +41 -0
- package/dist/zonos-elements/{p-Dv5a-V6w.system.js → p-Cw_Qnyow.system.js} +1 -1
- package/dist/zonos-elements/p-CzXNXgyI.js +1 -0
- package/dist/zonos-elements/{p-CVRbGFV3.js → p-D9OPKqLg.js} +1 -1
- package/dist/zonos-elements/{p-DrbN3rPL.js → p-Df62LRNs.js} +2 -2
- package/dist/zonos-elements/{p-DKnphvmJ.js → p-Lsqrpzc5.js} +1 -1
- package/dist/zonos-elements/{p-DrS-0mk7.system.js → p-YQFbWtjn.system.js} +1 -1
- package/dist/zonos-elements/p-a27f48e4.entry.js +1 -0
- package/dist/zonos-elements/{p-bb1b414a.system.entry.js → p-a6bb296c.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-13015d34.system.entry.js → p-abb85879.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-383343c7.entry.js → p-b8653024.entry.js} +1 -1
- package/dist/zonos-elements/p-b9d7a3b6.entry.js +1 -0
- package/dist/zonos-elements/{p-96b250d8.system.entry.js → p-be067e12.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-Cl5yV0ak.js → p-bmrOH9oh.js} +1 -1
- package/dist/zonos-elements/{p-71d29603.entry.js → p-c185bc23.entry.js} +1 -1
- package/dist/zonos-elements/{p-13d5b2f9.entry.js → p-c6e78de2.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3c147d2.system.entry.js → p-ca97a1cd.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-0909ef77.entry.js → p-cbb96382.entry.js} +1 -1
- package/dist/zonos-elements/{p-6db7317a.system.entry.js → p-dbf4d156.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-e43470f7.system.entry.js → p-df240119.system.entry.js} +17 -17
- package/dist/zonos-elements/{p-f2ed52bc.system.entry.js → p-e16e4db6.system.entry.js} +15 -15
- package/dist/zonos-elements/{p-7214c953.system.entry.js → p-eb016dd8.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-709d1561.system.entry.js → p-eb5c67a0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e374aaa4.entry.js → p-ed8a7a7f.entry.js} +1 -1
- package/dist/zonos-elements/{p-3466bcba.entry.js → p-ef932fda.entry.js} +1 -1
- package/dist/zonos-elements/{p-bfa9e32a.entry.js → p-f792ba5f.entry.js} +1 -1
- package/dist/zonos-elements/{p-aK18R41t.js → p-fZcKMzE-.js} +1 -1
- package/dist/zonos-elements/{p-C-zdj7MK.js → p-fdritVtG.js} +1 -1
- package/dist/zonos-elements/p-fffe6376.entry.js +1 -0
- package/dist/zonos-elements/{p-CMneHjck.system.js → p-v8IEjQ2z.system.js} +10 -10
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +10 -10
- package/dist/zonos-elements/p-43c0ebe9.entry.js +0 -1
- package/dist/zonos-elements/p-8ac26831.entry.js +0 -1
- package/dist/zonos-elements/p-BI6VAB5B.js +0 -1
- package/dist/zonos-elements/p-BJ_kE5rM.js +0 -1
- package/dist/zonos-elements/p-DATNIakn.js +0 -1
- package/dist/zonos-elements/p-af4ad54b.entry.js +0 -1
- package/dist/zonos-elements/p-bac94956.entry.js +0 -1
- package/dist/zonos-elements/p-cf6bf7a4.entry.js +0 -1
- package/dist/zonos-elements/p-db40b9c3.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stripeStoreGetDomesticShippingSession, stripeStoreSaveDomesticShippingSession, } from "../../store/checkout/stripe";
|
|
1
|
+
import { stripeStoreCleanupDomesticShippingSession, stripeStoreGetDomesticShippingSession, stripeStoreHasDomesticSessionRedirectMarker, stripeStoreMarkDomesticSessionRedirected, stripeStoreSaveDomesticShippingSession, } from "../../store/checkout/stripe";
|
|
2
2
|
import { localizationStoreUpdateSelectedCountryCode } from "../../store/hello/localization";
|
|
3
3
|
import { zonosStore } from "../../store/zonosStore";
|
|
4
4
|
import { fetchBigCommerceCheckout, fetchCheckoutId, } from "./bigcommerceStorefrontApi";
|
|
@@ -9,6 +9,8 @@ import { isBigCommerceCheckoutBypassEnabled } from "./isBigCommerceCheckoutBypas
|
|
|
9
9
|
import { isShippableCountry } from "./isShippableCountry";
|
|
10
10
|
import { log } from "../logging/log";
|
|
11
11
|
import { logError } from "../logging/logError";
|
|
12
|
+
import { pathContainsCheckout } from "../../../scripts/_bigcommerceCheckoutPath";
|
|
13
|
+
import { isBigCommerceNativeCheckout } from "../../../scripts/_isBigCommerceNativeCheckout";
|
|
12
14
|
const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
|
|
13
15
|
/**
|
|
14
16
|
* Native BigCommerce shipping-step "Continue" button. Clicking it commits the
|
|
@@ -112,7 +114,7 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
112
114
|
// Only the native checkout page skips address detection. Storefront pages
|
|
113
115
|
// still run the domestic-session handoff below, and they do not consume
|
|
114
116
|
// a `zBypass` query, so the parameter can survive until `/checkout`.
|
|
115
|
-
if (window.location.pathname
|
|
117
|
+
if (pathContainsCheckout(window.location.pathname) &&
|
|
116
118
|
isBigCommerceCheckoutBypassEnabled()) {
|
|
117
119
|
return;
|
|
118
120
|
}
|
|
@@ -365,17 +367,35 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
|
|
|
365
367
|
const shippingAddressSession = stripeStoreGetDomesticShippingSession();
|
|
366
368
|
// append a hidden button to the body if the shipping address session is found
|
|
367
369
|
if (!domesticRedirectedButton && shippingAddressSession) {
|
|
368
|
-
//
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
370
|
+
// Stripe.js is not loaded on native checkout, so nothing here can click
|
|
371
|
+
// a hidden button or clear this session. Send the shopper to `/` once.
|
|
372
|
+
// Saving or clearing the session drops that hop marker, so a later
|
|
373
|
+
// leftover session still gets its own redirect. If they come back and
|
|
374
|
+
// the session is still set, drop it and keep watching the address.
|
|
375
|
+
if (isBigCommerceNativeCheckout()) {
|
|
376
|
+
if (stripeStoreHasDomesticSessionRedirectMarker()) {
|
|
377
|
+
stripeStoreCleanupDomesticShippingSession();
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
stripeStoreMarkDomesticSessionRedirected();
|
|
381
|
+
observer.disconnect();
|
|
382
|
+
window.location.href = buildBigcommerceRedirectUrl('/');
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
// create a hidden button to trigger the click event
|
|
388
|
+
const button = document.createElement('button');
|
|
389
|
+
button.style.display = 'none';
|
|
390
|
+
button.id = 'zonos--domestic-redirected-checkout-button';
|
|
391
|
+
document.body.appendChild(button);
|
|
392
|
+
onShippingAddressSessionFound === null || onShippingAddressSessionFound === void 0 ? void 0 : onShippingAddressSessionFound(shippingAddressSession);
|
|
393
|
+
// disconnect the observer after we found the shipping continue button
|
|
394
|
+
observer.disconnect();
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
377
397
|
}
|
|
378
|
-
const isBigcommerceDomesticCheckoutPage = window.location.pathname
|
|
398
|
+
const isBigcommerceDomesticCheckoutPage = pathContainsCheckout(window.location.pathname) &&
|
|
379
399
|
window.Zonos.isBigCommerce;
|
|
380
400
|
// Should just disconnect the observer if it's not bigcommerce domestic checkout page
|
|
381
401
|
if (!isBigcommerceDomesticCheckoutPage) {
|
|
@@ -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
|
+
};
|
|
@@ -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
|
-
//
|
|
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
|
|
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
|
|
43
|
+
const maybeStripe = (_a = (await stripePromise)) !== null && _a !== void 0 ? _a : (await loadStripeScript());
|
|
33
44
|
return initStripe(maybeStripe, args, startTime);
|
|
34
45
|
};
|
|
@@ -10,6 +10,7 @@ import { checkIfLoadVersionDomain } from "./_checkIfLoadVersionDomain";
|
|
|
10
10
|
import { getNextFallbackUrl, MAIN_LOAD_CDN_TYPE, } from "./_getNextFallbackUrl";
|
|
11
11
|
import { getWithTestPublicCredential } from "./_getWithTestPublicCredential";
|
|
12
12
|
import { getZonosQaUrl } from "./_getZonosQaUrl";
|
|
13
|
+
import { isBigCommerceNativeCheckout, markBigCommerceHostChecked, } from "./_isBigCommerceNativeCheckout";
|
|
13
14
|
import { zonosLoadStripe } from "./_loadStripe";
|
|
14
15
|
import { getCartIdFromQueryParam } from "./cart/_getCartIdFromParam";
|
|
15
16
|
import { setupCartDataWithSettings } from "./cart/_setupCartDataWithSettings";
|
|
@@ -100,6 +101,9 @@ Zonos.init = async (params) => {
|
|
|
100
101
|
// do nothing if zonos is already initialized
|
|
101
102
|
return;
|
|
102
103
|
}
|
|
104
|
+
// Host detection has already copied `isBigCommerce`. Settle the
|
|
105
|
+
// native-checkout answer once, before buttons or Stripe are touched.
|
|
106
|
+
markBigCommerceHostChecked();
|
|
103
107
|
log(`====== ZONOS DEBUG MODE: on (${_a.version}) ======`);
|
|
104
108
|
_a.zonosApiKey = zonosApiKey;
|
|
105
109
|
_a.storeId = storeId;
|
|
@@ -356,47 +360,52 @@ Zonos.injectController = ({ config, }) => {
|
|
|
356
360
|
if (document.querySelector('zonos-controller')) {
|
|
357
361
|
return;
|
|
358
362
|
}
|
|
359
|
-
//
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
placeOrderButtonSelector
|
|
366
|
-
});
|
|
367
|
-
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
368
|
-
const observer = new MutationObserver(() => {
|
|
363
|
+
// Native BigCommerce checkout never calls attachCheckout, which is what
|
|
364
|
+
// marks these buttons handled. Disabling them here would flicker the
|
|
365
|
+
// store's own buttons after every DOM mutation.
|
|
366
|
+
if (!isBigCommerceNativeCheckout()) {
|
|
367
|
+
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
368
|
+
if ((_b = config.checkoutSettings) === null || _b === void 0 ? void 0 : _b.placeOrderButtonSelector) {
|
|
369
|
+
const placeOrderButtonSelector = config.checkoutSettings.placeOrderButtonSelector;
|
|
369
370
|
_a.disablePlaceOrderButtons({
|
|
370
371
|
config,
|
|
371
372
|
disable: true,
|
|
372
373
|
placeOrderButtonSelector,
|
|
373
374
|
});
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
375
|
+
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
376
|
+
const observer = new MutationObserver(() => {
|
|
377
|
+
_a.disablePlaceOrderButtons({
|
|
378
|
+
config,
|
|
379
|
+
disable: true,
|
|
380
|
+
placeOrderButtonSelector,
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
observer.observe(document.body, {
|
|
384
|
+
childList: true,
|
|
385
|
+
subtree: true,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
// if alwaysTriggerInternationalCheckoutSelector is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
389
|
+
if ((_c = config.checkoutSettings) === null || _c === void 0 ? void 0 : _c.alwaysTriggerInternationalCheckoutSelector) {
|
|
390
|
+
const alwaysTriggerInternationalCheckoutSelector = config.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;
|
|
390
391
|
_a.disablePlaceOrderButtons({
|
|
391
392
|
config,
|
|
392
393
|
disable: true,
|
|
393
394
|
placeOrderButtonSelector: alwaysTriggerInternationalCheckoutSelector,
|
|
394
395
|
});
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
396
|
+
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
397
|
+
const observer = new MutationObserver(() => {
|
|
398
|
+
_a.disablePlaceOrderButtons({
|
|
399
|
+
config,
|
|
400
|
+
disable: true,
|
|
401
|
+
placeOrderButtonSelector: alwaysTriggerInternationalCheckoutSelector,
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
observer.observe(document.body, {
|
|
405
|
+
childList: true,
|
|
406
|
+
subtree: true,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
400
409
|
}
|
|
401
410
|
const zonosController = document.createElement('zonos-controller');
|
|
402
411
|
zonosController.config = config;
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
const pathContainsCheckout = (pathname) => {
|
|
12
|
+
return pathname.includes('/checkout');
|
|
13
|
+
};
|
|
14
|
+
const hasExactCheckoutSegment = (pathname) => {
|
|
15
|
+
return pathname.split('/').some(segment => segment === 'checkout');
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Storefront signals BigCommerce sets before Zonos copies `isBigCommerce`.
|
|
20
|
+
* Shared by the loader script and the Stripe skip so the two cannot drift.
|
|
21
|
+
*/
|
|
22
|
+
const detectBigCommerceHost = () => {
|
|
23
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return (!!window.stencilBootstrap ||
|
|
27
|
+
!!window.bcConfig ||
|
|
28
|
+
!!document.querySelector('script[src*="bigcommerce.com"]'));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const hasCheckoutSegment = () => hasExactCheckoutSegment(window.location.pathname);
|
|
32
|
+
const sharedZonos = () => {
|
|
33
|
+
if (typeof window === 'undefined' || !('Zonos' in window)) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return window.Zonos;
|
|
37
|
+
};
|
|
38
|
+
const isFlaggedBigCommerce = () => {
|
|
39
|
+
var _a;
|
|
40
|
+
return ((_a = sharedZonos()) === null || _a === void 0 ? void 0 : _a.isBigCommerce) === true;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The settled answer lives on `window.Zonos`, the object loadZonos.js,
|
|
44
|
+
* zonos.js, and the component bundle already share.
|
|
45
|
+
*
|
|
46
|
+
* A `true` result sticks for that pathname. A `false` result sticks once
|
|
47
|
+
* the path is not checkout, or once host detection has finished. A checkout
|
|
48
|
+
* path whose BigCommerce signals are not in the page yet stays unset, so a
|
|
49
|
+
* later signal can still settle it.
|
|
50
|
+
*/
|
|
51
|
+
const readSettled = () => {
|
|
52
|
+
const zonos = sharedZonos();
|
|
53
|
+
if (zonos === undefined) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
if (zonos.isBigCommerceNativeCheckoutPath !== window.location.pathname) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
const value = zonos.isBigCommerceNativeCheckout;
|
|
60
|
+
if (value === true || value === false) {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
return undefined;
|
|
64
|
+
};
|
|
65
|
+
const writeSettled = (value) => {
|
|
66
|
+
const zonos = sharedZonos();
|
|
67
|
+
if (zonos !== undefined) {
|
|
68
|
+
zonos.isBigCommerceNativeCheckout = value;
|
|
69
|
+
zonos.isBigCommerceNativeCheckoutPath = window.location.pathname;
|
|
70
|
+
}
|
|
71
|
+
return value;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Call after `isBigCommerce` has been copied from host detection. Writes the
|
|
75
|
+
* settled boolean onto `window.Zonos` for this pathname.
|
|
76
|
+
*/
|
|
77
|
+
const markBigCommerceHostChecked = () => {
|
|
78
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const zonos = sharedZonos();
|
|
82
|
+
if (zonos === undefined) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const native = hasCheckoutSegment() && (detectBigCommerceHost() || isFlaggedBigCommerce());
|
|
86
|
+
zonos.isBigCommerceNativeCheckout = native;
|
|
87
|
+
zonos.isBigCommerceNativeCheckoutPath = window.location.pathname;
|
|
88
|
+
};
|
|
89
|
+
const decide = () => {
|
|
90
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
const settled = readSettled();
|
|
94
|
+
if (settled !== undefined) {
|
|
95
|
+
return settled;
|
|
96
|
+
}
|
|
97
|
+
if (!hasCheckoutSegment()) {
|
|
98
|
+
return writeSettled(false);
|
|
99
|
+
}
|
|
100
|
+
if (detectBigCommerceHost() || isFlaggedBigCommerce()) {
|
|
101
|
+
return writeSettled(true);
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* True when this document is BigCommerce native checkout.
|
|
107
|
+
* Stripe.js injection is owned by `loadStripeScript` in `_loadStripe.ts`.
|
|
108
|
+
* Other callers use this for a different job: skip `attachCheckout`, leave
|
|
109
|
+
* the store's buttons enabled, or hand a leftover domestic session to `/`.
|
|
110
|
+
* An undecided checkout path returns false and is not stored.
|
|
111
|
+
*/
|
|
112
|
+
const isBigCommerceNativeCheckout = () => {
|
|
113
|
+
return decide() === true;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* True when Stripe.js must not be injected. An undecided checkout path
|
|
117
|
+
* holds the script until host detection finishes, instead of storing "not
|
|
118
|
+
* native checkout" and injecting v3 early.
|
|
119
|
+
*/
|
|
120
|
+
const holdStripeForNativeCheckout = () => {
|
|
121
|
+
const decision = decide();
|
|
122
|
+
if (decision === undefined) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
return decision;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export { holdStripeForNativeCheckout as h, isBigCommerceNativeCheckout as i, markBigCommerceHostChecked as m, pathContainsCheckout as p };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore, e as getShouldRequirePeruTaxId } from './zonosStore-BXP9FvIt.js';
|
|
2
|
-
import { s as storageStore, t as translate,
|
|
2
|
+
import { s as storageStore, t as translate, n as getOverridenZCountry, l as localizationStore, f as filterValidTests, e as storageStoreSetEnabledVariantTestKeys } from './localization-B5CRzthT.js';
|
|
3
3
|
import { b as isPeruTaxIdActive, e as taxIdTypeOptionsForCheckout } from './taxIdRules-xYlx7ZXW.js';
|
|
4
4
|
import { e as euCountryCodes, i as isCountryRequireTaxId } from './TaxId-DMIgN_sT.js';
|
|
5
5
|
import { l as log, b as allLogs } from './VarianceTest-BJmZPrZl.js';
|
|
@@ -1081,11 +1081,23 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
|
|
|
1081
1081
|
locale: localizationStore.selectedLocale,
|
|
1082
1082
|
};
|
|
1083
1083
|
};
|
|
1084
|
+
const DOMESTIC_SESSION_REDIRECT_MARKER = 'zonos--bc-domestic-session-redirected';
|
|
1085
|
+
const clearDomesticSessionRedirectMarker = () => {
|
|
1086
|
+
safeRemoveItem('session', DOMESTIC_SESSION_REDIRECT_MARKER);
|
|
1087
|
+
};
|
|
1088
|
+
const stripeStoreHasDomesticSessionRedirectMarker = () => {
|
|
1089
|
+
return safeGetItem('session', DOMESTIC_SESSION_REDIRECT_MARKER) === '1';
|
|
1090
|
+
};
|
|
1091
|
+
const stripeStoreMarkDomesticSessionRedirected = () => {
|
|
1092
|
+
safeSetItem('session', DOMESTIC_SESSION_REDIRECT_MARKER, '1');
|
|
1093
|
+
};
|
|
1084
1094
|
const stripeStoreCleanupDomesticShippingSession = () => {
|
|
1085
1095
|
safeRemoveItem('session', 'zonos--bigcommerce-domestic-checkout-shipping');
|
|
1096
|
+
clearDomesticSessionRedirectMarker();
|
|
1086
1097
|
};
|
|
1087
1098
|
// Save shipping address to session storage
|
|
1088
1099
|
const stripeStoreSaveDomesticShippingSession = (props) => {
|
|
1100
|
+
clearDomesticSessionRedirectMarker();
|
|
1089
1101
|
safeSetItem('session', 'zonos--bigcommerce-domestic-checkout-shipping', JSON.stringify(props));
|
|
1090
1102
|
};
|
|
1091
1103
|
const stripeStoreGetDomesticShippingSession = () => {
|
|
@@ -2775,4 +2787,4 @@ const cartStoreUpdateStoreCredit = () => {
|
|
|
2775
2787
|
}, 300);
|
|
2776
2788
|
};
|
|
2777
2789
|
|
|
2778
|
-
export {
|
|
2790
|
+
export { cartStoreUpdateSelectedShippingOption as $, isPolicyConsentRequired as A, stripeStoreUpdateCheckoutSessionBaseCurrency as B, storeCreditStoreApplyCredit as C, storeCreditStoreCoversFullAmount as D, validateCheckoutSession as E, storeCreditStoreCreateOrder as F, stripeStoreConfirmPayment as G, stripeStoreHandleInventoryRefund as H, policyConsentStore as I, stripeStoreReset as J, cartStoreOnChange as K, stripeStoreOnChange as L, storeCreditStoreGetEffectiveAmount as M, cartStoreHasOneEligibleItem as N, isEuDapRemittance as O, stripeStoreApplyPromoCode as P, stripeStoreRemovePromoCode as Q, stripeStoreResetPromoCode as R, stripeStoreMessageBasedOnStatus as S, storeCreditStore as T, storeCreditStoreReset as U, stripeStoreRecordPolicyConsent as V, extractName as W, resolveTaxIdSelection as X, stripeStoreTranslateAddressToLatin as Y, getCountryField as Z, stripeStoreAsyncAddressUpdate as _, stripeStoreHasDomesticSessionRedirectMarker as a, cartStoreGetShippingTransitInfo as a0, cartStoreGetMethod as a1, sortServiceLevelOptionsByAmount as a2, stripeStoreBuildAddressForPartyCreate as a3, getEnabledPolicies as a4, storeCreditStoreSetEnabled as a5, storeCreditStoreSetUseFullBalance as a6, cartStoreUpdateStoreCredit as a7, storeCreditStoreSetAmount as a8, storeCreditStoreRefreshBalance as a9, stripeStoreCleanupDomesticShippingSession as b, stripeStoreMarkDomesticSessionRedirected as c, stripeStoreSaveDomesticShippingSession as d, stripeStore as e, stripeStoreRetrievePayment as f, getCheckoutSession as g, cartStore as h, initStripeElements as i, cartStoreUpdateItems as j, cartStoreReset as k, cartStoreResetTabItems as l, cartStoreClearCheckoutInterval as m, stripeStoreInitCheckoutSession as n, stripeStoreGetPaymentIntent as o, policyConsentStoreReset as p, cartStoreIsOrderModificationPaymentOnlySession as q, stripeStoreHandleInventoryCheck as r, stripeStoreGetDomesticShippingSession as s, cartStoreStartCheckoutInterval as t, trackConversionEvent as u, getCheckoutSessionBody as v, cartStoreUpdateToErrorState as w, cartStoreSetCheckoutSession as x, stripeStorePrefetchLandedCost as y, cartStoreNextStep as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-BXP9FvIt.js';
|
|
2
|
-
import { t as translate, l as localizationStore, s as storageStore } from './localization-
|
|
2
|
+
import { t as translate, l as localizationStore, s as storageStore } from './localization-B5CRzthT.js';
|
|
3
3
|
import { l as logError$1, h as handleFetch, s as sendErrorLog } from './handleFetch-BFVO7oAR.js';
|
|
4
4
|
import { l as log, b as allLogs } from './VarianceTest-BJmZPrZl.js';
|
|
5
|
-
import {
|
|
5
|
+
import { h as cartStore, $ as cartStoreUpdateSelectedShippingOption, e as stripeStore, a3 as stripeStoreBuildAddressForPartyCreate } from './cart-b84n0nhi.js';
|
|
6
6
|
|
|
7
7
|
// src/constant/common.ts
|
|
8
8
|
function _array_like_to_array(arr, len) {
|
|
@@ -2045,7 +2045,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
2045
2045
|
var e = new Error(message);
|
|
2046
2046
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
2047
2047
|
};
|
|
2048
|
-
var version = "1.35.
|
|
2048
|
+
var version = "1.35.2";
|
|
2049
2049
|
var packageJson = {
|
|
2050
2050
|
version: version};
|
|
2051
2051
|
|