@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.
- package/dist/cjs/_isBigCommerceNativeCheckout-3-xbKbAO.js +133 -0
- package/dist/cjs/{cart-CiXlehwQ.js → cart-C39TMSgB.js} +27 -13
- package/dist/cjs/{collect-Drr8fY-q.js → collect-lF9DenLk.js} +4 -4
- package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-svcnpumn.js} +1 -1
- package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
- package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
- package/dist/cjs/index.cjs.js +158 -47
- package/dist/cjs/{invoice-5hVfSXpb.js → invoice-BD3pCr8P.js} +3 -3
- package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
- package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-Bd1qmwiv.js} +4 -4
- package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-BMQRvX2q.js} +3 -3
- package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-DE2p8CT8.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
- package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
- package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-BKbk2bhi.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +6 -6
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
- package/dist/cjs/zonos-checkout.cjs.entry.js +48 -22
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +65 -40
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +14 -4
- package/dist/collection/components/main/mountCheckoutWithoutStripe.js +12 -0
- package/dist/collection/components/main/zonos-controller.js +26 -10
- package/dist/collection/components/store/checkout/cart.js +3 -2
- package/dist/collection/components/store/checkout/stripe.js +23 -10
- package/dist/collection/components/store/storageStore.js +7 -6
- package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
- package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +2 -1
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +32 -12
- package/dist/collection/components/utils/handleFetch.js +19 -9
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
- package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
- package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
- package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
- package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
- package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
- package/dist/collection/components/utils/safeStorage.js +39 -0
- package/dist/collection/scripts/_bigcommerceCheckoutPath.js +16 -0
- package/dist/collection/scripts/_detectBigCommerceHost.js +12 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
- package/dist/collection/scripts/_isBigCommerceNativeCheckout.js +107 -0
- package/dist/collection/scripts/_loadStripe.js +15 -4
- package/dist/collection/scripts/_zonosBase.js +46 -33
- package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
- package/dist/collection/types/generated/graphql.internal.types.js +215 -1
- package/dist/esm/_isBigCommerceNativeCheckout-Bb90IMVt.js +128 -0
- package/dist/esm/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +26 -14
- package/dist/esm/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +4 -4
- package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +1 -1
- package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
- package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm/index.js +158 -47
- package/dist/esm/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +3 -3
- package/dist/esm/{localization-DHM91diu.js → localization-B5CRzthT.js} +25 -49
- package/dist/esm/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +4 -4
- package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +3 -3
- package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +6 -6
- package/dist/esm/zonos-address-display_2.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +4 -4
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
- package/dist/esm/zonos-card_5.entry.js +5 -5
- package/dist/esm/zonos-cart-items_12.entry.js +18 -18
- package/dist/esm/zonos-checkout.entry.js +48 -22
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js +65 -40
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
- package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
- package/dist/esm/zonos-invoice.entry.js +6 -6
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
- package/dist/esm-es5/_isBigCommerceNativeCheckout-Bb90IMVt.js +40 -0
- package/dist/esm-es5/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +59 -59
- package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +2 -2
- package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +3 -3
- package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
- package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm-es5/index.js +94 -65
- package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +1 -1
- package/dist/esm-es5/{localization-DHM91diu.js → localization-B5CRzthT.js} +7 -10
- package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +5 -5
- package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +1 -1
- package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- 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 +6 -6
- package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
- package/dist/esm-es5/zonos-checkout.entry.js +22 -11
- 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 +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +21 -12
- 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 +3 -3
- 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 +22 -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/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
- package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
- package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
- package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
- package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
- package/dist/types/components/utils/safeStorage.d.ts +4 -0
- 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/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
- package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
- package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
- package/dist/types/types/generated/graphql.internal.types.ts +341 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-02faff47.entry.js} +1 -1
- package/dist/zonos-elements/{p-216a908d.system.entry.js → p-0c68cbbb.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
- package/dist/zonos-elements/{p-960070d0.system.entry.js → p-1cd2d097.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-1e6db427.entry.js → p-255e411a.entry.js} +1 -1
- package/dist/zonos-elements/p-2c_UqKJL.system.js +7 -0
- package/dist/zonos-elements/{p-DprOoI2W.system.js → p-3AUMK-5E.system.js} +154 -154
- package/dist/zonos-elements/{p-d3345b2c.entry.js → p-3ee87d8b.entry.js} +1 -1
- package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-42fa5694.system.entry.js} +10 -10
- package/dist/zonos-elements/p-49eaaab8.entry.js +1 -0
- package/dist/zonos-elements/{p-fda89981.system.entry.js → p-4ce4c49f.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-5622fc50.system.entry.js} +263 -252
- package/dist/zonos-elements/{p-5585db86.system.entry.js → p-59457fd9.system.entry.js} +73 -64
- package/dist/zonos-elements/{p-65817880.entry.js → p-66398133.entry.js} +1 -1
- package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-674323ac.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-678b9214.entry.js → p-71d9a5b7.entry.js} +1 -1
- package/dist/zonos-elements/{p-189cc594.system.entry.js → p-81780f8f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-6e691736.entry.js → p-821b83a2.entry.js} +1 -1
- package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-877a82d2.system.entry.js} +94 -94
- package/dist/zonos-elements/p-8daec112.entry.js +1 -0
- package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-93bc75fd.system.entry.js} +13 -13
- package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-976b3bf3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e76348.entry.js → p-9a4947a5.entry.js} +1 -1
- package/dist/zonos-elements/p-9f7693bf.entry.js +1 -0
- package/dist/zonos-elements/p-BIJM2Kj-.js +1 -0
- package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
- package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-BOh4ifdL.system.js} +51 -54
- 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-CbhN65lj.system.js → p-BvoPE_nb.system.js} +1 -1
- package/dist/zonos-elements/{p-iAIzUA4k.js → p-C3E55OqH.js} +1 -1
- package/dist/zonos-elements/{p-CBUz18kA.system.js → p-C3gF3UV5.system.js} +23 -23
- package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-CD2ahEZn.system.js} +1 -1
- package/dist/zonos-elements/p-CEBBLbvF.js +1 -0
- package/dist/zonos-elements/{p-CGNVm52g.system.js → p-CEV0O_IQ.system.js} +5 -5
- package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
- package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-CZ-uYiCo.system.js} +1 -1
- package/dist/zonos-elements/p-Cn2xE-9t.system.js +256 -0
- package/dist/zonos-elements/p-CtvXi9wL.system.js +41 -0
- package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Cw_Qnyow.system.js} +3 -3
- package/dist/zonos-elements/p-CzXNXgyI.js +1 -0
- package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
- package/dist/zonos-elements/p-D9OPKqLg.js +1 -0
- package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
- package/dist/zonos-elements/{p-DpwmHU8R.js → p-Df62LRNs.js} +2 -2
- package/dist/zonos-elements/{p-CHKKvuiz.js → p-Lsqrpzc5.js} +1 -1
- package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-YQFbWtjn.system.js} +1 -1
- package/dist/zonos-elements/p-a27f48e4.entry.js +1 -0
- package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-a6bb296c.system.entry.js} +7 -7
- package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-abb85879.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-12b24ebb.entry.js → p-b8653024.entry.js} +1 -1
- package/dist/zonos-elements/p-b9d7a3b6.entry.js +1 -0
- package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-be067e12.system.entry.js} +15 -15
- package/dist/zonos-elements/p-bmrOH9oh.js +1 -0
- package/dist/zonos-elements/p-c185bc23.entry.js +1 -0
- package/dist/zonos-elements/{p-2d513aa3.entry.js → p-c6e78de2.entry.js} +1 -1
- package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-ca97a1cd.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-3e705c9b.entry.js → p-cbb96382.entry.js} +1 -1
- package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-dbf4d156.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-df240119.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-e16e4db6.system.entry.js} +17 -17
- package/dist/zonos-elements/{p-064d8829.system.entry.js → p-eb016dd8.system.entry.js} +20 -20
- package/dist/zonos-elements/{p-1199baef.system.entry.js → p-eb5c67a0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef5344ea.entry.js → p-ed8a7a7f.entry.js} +1 -1
- package/dist/zonos-elements/{p-4917b74d.entry.js → p-ef932fda.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-f792ba5f.entry.js} +1 -1
- package/dist/zonos-elements/{p-DiMEP3mh.js → p-fZcKMzE-.js} +1 -1
- package/dist/zonos-elements/{p-CMo3ZweU.js → p-fdritVtG.js} +1 -1
- package/dist/zonos-elements/p-fffe6376.entry.js +1 -0
- package/dist/zonos-elements/p-gEViRqvf.js +1 -0
- package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-v8IEjQ2z.system.js} +39 -39
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +10 -10
- package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
- package/dist/zonos-elements/p-107f287b.entry.js +0 -1
- package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
- package/dist/zonos-elements/p-46b9f0cf.entry.js +0 -1
- package/dist/zonos-elements/p-636b71d4.entry.js +0 -1
- package/dist/zonos-elements/p-7dc7f328.entry.js +0 -1
- package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
- package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
- package/dist/zonos-elements/p-C70h5mKA.js +0 -1
- package/dist/zonos-elements/p-CTiqplrr.js +0 -1
- package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
- package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
- package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
- package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
- package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
- package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
- package/dist/zonos-elements/p-U33isUJG.js +0 -1
- package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
- package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./p-DTgUqgwV.system.js","./p-
|
|
1
|
+
System.register(["./p-DTgUqgwV.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js"],(function(n){"use strict";var e,t,r;return{setters:[function(n){e=n.z},function(n){t=n.g},function(n){r=n.l}],execute:function(){
|
|
2
2
|
/** Message type for zonos-analytic events sent from iframe to parent. */
|
|
3
3
|
var i="zonos-analytic";
|
|
4
4
|
/** Ping sent by iframe to configure parent's analytics relay (e.g. GA, FB Pixel) and get ready signal. */var o="zonos-analytics-relay-ping";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as e,c as o}from"./p-CqB9AfBf.js";import{
|
|
1
|
+
import{z as e,c as o}from"./p-CqB9AfBf.js";import{z as n,m as t,u as r,A as a,I as i,E as s,e as c,h as u,r as l,C as d,V as p,D as f,F as y,M as v}from"./p-CzXNXgyI.js";import{s as b,t as h}from"./p-D9OPKqLg.js";import{h as m,g as w,l as j,j as P}from"./p-gEViRqvf.js";import{i as k}from"./p-CICjAi70.js";import{l as I}from"./p-BJmZPrZl.js";import{i as O,a as E,s as g}from"./p-CJmWr75U.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -14,4 +14,4 @@ import{z as e,c as o}from"./p-CqB9AfBf.js";import{x as n,j as t,t as r,y as a,G
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/function g(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function A(e,o){if(void 0===o&&(o=Promise),C(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,t=e.sdkBaseUrl,r=e.environment,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["sdkBaseUrl","environment"]),i=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(r),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),u=c.queryParams,l=c.attributes;return u["merchant-id"]&&-1!==u["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=u["merchant-id"],u["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=u,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:l}}(e),t=n.url,r=n.attributes,a=r["data-namespace"]||"paypal",i=B(a);return r["data-js-sdk-library"]||(r["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var t=g(e,o),r=n.cloneNode();if(delete r.dataset.uidAuto,Object.keys(r.dataset).length!==Object.keys(t.dataset).length)return null;var a=!0;return Object.keys(r.dataset).forEach((function(e){r.dataset[e]!==t.dataset[e]&&(a=!1)})),a?n:null}(t,r)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),C(e,o);var n=e.url,t=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==t&&"object"!=typeof t)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,t=g(e.url,e.attributes);t.onerror=n,t.onload=o,document.head.insertBefore(t,document.head.firstElementChild)}({url:n,attributes:t,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:t,attributes:r},o).then((function(){var e=B(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function B(e){return window[e]}function C(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const x={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"},T=e=>{if(!e)return{};if(!(e=>!!e&&Array.isArray(e.items))(e))return Object.assign({},e);const{currency:o,items:n,transaction_id:t,value:r}=e,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["currency","items","transaction_id","value"]),i=n.map((e=>({id:e.item_id,item_price:e.price,quantity:e.quantity}))),s=n.map((e=>e.item_id)),c=n.reduce(((e,o)=>e+o.quantity),0),u=Object.assign(Object.assign({},a),{content_ids:s,content_type:"product",contents:i,num_items:c});return t&&(u.order_id=t),void 0!==o&&(u.currency=o),void 0!==r&&(u.value=r),u},z=(e,o,n)=>{O()?E({event:o,fbqMode:e,payload:n,provider:"fbq"}):"function"==typeof window.fbq&&(I("Zonos submits fbq event","log",`${e}:${o}`),window.fbq(e,o,n))},D=o=>{S(o),(({event:o,metadata:n})=>{if(!(()=>{const o=e.checkoutSettings.analyticsProviders.find((e=>"FACEBOOK_PIXEL"===e.type));return!!o&&"ENABLED"===o.status})())return;const t=w(),r=T(n),a=Object.assign(Object.assign({},r),t&&{isTestMode:!0}),i=Object.fromEntries(Object.entries(a).filter((([e,o])=>null!==o)));z("trackCustom",o,i);const s=(e=>{var o;return null!==(o=x[e])&&void 0!==o?o:null})(o);s&&s!==o&&z("track",s,i)})(o)},{onChange:L,reset:M,state:_}=o((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),R=({checkoutSessionId:o,onPaypalFail:b,onPaypalSessionDone:w,overrideBorderRaidus:I,overridePrimaryColor:O})=>({createOrder:async()=>{var e;if(r({checkoutSessionId:o,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}}),a()&&!i.accepted)return i.showError=!0,null===(e=document.querySelector("zonos-policy-consent"))||void 0===e||e.scrollIntoView({behavior:"smooth"}),null==b||b(),"";const P=a();P&&(i.locked=!0);let k=!1;try{const e=await s();if(!e.valid)return _.paypalErrorMessage=e.errorMessage,c.hasPaymentError=!1,c.customErrorMessage=null,D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),"";_.paypalErrorMessage=null,u.inventoryCheckErrorMessage=null;try{u.inventoryCheckErrorMessage=await l()}catch(e){u.inventoryCheckErrorMessage=h("Unable to check inventory. Please try again.")}if(u.inventoryCheckErrorMessage)return"";if(v()>0){const e=await d();if(!e.success)return _.paypalErrorMessage=e.error||h("Unable to apply store credit. Please try again."),null==b||b(),""}if(await p(),f()){const e=await y();return e.success?(null==w||w({orderId:e.orderId||""}),n(),t(),k=!0,""):(_.paypalErrorMessage=e.error||h("Unable to place order with store credit. Please try again."),null==b||b(),"")}const r=await(async({checkoutSessionId:e})=>{var o,n;const t=_.intent.toUpperCase(),{errors:r,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,intent:t}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(r.length||!i)throw new Error((null===(n=r.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:o});return k=!!r,r}catch(e){return j("Failed to create paypal order",e),_.paypalErrorMessage=h("Failed to create PayPal order. Please try again, or consider using an alternative method."),c.hasPaymentError=!1,c.customErrorMessage=null,D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),""}finally{P&&!k&&(i.locked=!1)}},onApprove:async()=>{try{_.paypalErrorMessage=null,D({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:o,paymentMethod:"paypal"}});const e=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,t;const{errors:r,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(r.length||!i)throw new Error((null===(t=r.find(Boolean))||void 0===t?void 0:t.message)||h("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:o,paypalMockResponse:window.Zonos._paypalMockResponse});_.orderIdCreated=e,null==w||w({orderId:e}),n(),t()}catch(e){if(j("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=P(e.message),t=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,r=(null==t?void 0:t.match(/\[(.*?)\] (.*)/i))||[];r||(_.paypalErrorMessage=h("An unexpected error occurred when processing PayPal order."));const a=r[2]||h("An unexpected error occurred when processing PayPal order.");_.paypalErrorMessage=a})({error:e});null==b||b()}},style:{borderRadius:"SHARP"===I?0:10,color:k({backgroundColor1:"#ffc33a",backgroundColor2:O||e.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),q=async({currency:o})=>{var n;if(!(null===(n=e.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void I("=== Paypal is disabled for this store","warn");const t=e.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!t)return void I("Failed to load paypal -- missing paypal publishable key","warn");const r=e.zonosMode&&"production"!==e.zonosMode||"LIVE"!==e.checkoutSettings.mode?"sandbox":"production";_.intent=e.checkoutSettings.captureDelay&&e.checkoutSettings.captureDelay>0?"authorize":"capture",I("==== Paypal order intent","info",_.intent),window.Zonos.paypal=await A({clientId:t.token,currency:o,environment:r,intent:_.intent}),_.paypal=window.Zonos.paypal,I("==== Paypal script loaded")},F=e=>{var o;const n=window.Zonos.paypal;if(!n)return I("Paypal is not available"),null;const t=b.checkoutSessionId;if(!t)return I("Paypal is not available due to checkoutSessionId is not available"),null;I("==== Loading Paypal buttons"),_.paypalButtons.length&&(_.paypalButtons.forEach((async e=>{await e.close()})),_.paypalButtons=[]);const r=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return _.paypalButtons=r.map((o=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},R(Object.assign({checkoutSessionId:t,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){I(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(I(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),_.paypalButtons},N=()=>{var o,n;return"ENABLED"===(null===(n=null===(o=e.checkoutSettings.externalPaymentMethods)||void 0===o?void 0:o.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!_.paypalButtons.length};export{_ as a,q as b,M as c,F as d,L as e,N as p,D as s}
|
|
17
|
+
*/function S(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function A(e,o){if(void 0===o&&(o=Promise),B(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,t=e.sdkBaseUrl,r=e.environment,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["sdkBaseUrl","environment"]),i=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(r),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),u=c.queryParams,l=c.attributes;return u["merchant-id"]&&-1!==u["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=u["merchant-id"],u["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=u,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:l}}(e),t=n.url,r=n.attributes,a=r["data-namespace"]||"paypal",i=C(a);return r["data-js-sdk-library"]||(r["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var t=S(e,o),r=n.cloneNode();if(delete r.dataset.uidAuto,Object.keys(r.dataset).length!==Object.keys(t.dataset).length)return null;var a=!0;return Object.keys(r.dataset).forEach((function(e){r.dataset[e]!==t.dataset[e]&&(a=!1)})),a?n:null}(t,r)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),B(e,o);var n=e.url,t=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==t&&"object"!=typeof t)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,t=S(e.url,e.attributes);t.onerror=n,t.onload=o,document.head.insertBefore(t,document.head.firstElementChild)}({url:n,attributes:t,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:t,attributes:r},o).then((function(){var e=C(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function C(e){return window[e]}function B(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const x={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"},z=e=>{if(!e)return{};if(!(e=>!!e&&Array.isArray(e.items))(e))return Object.assign({},e);const{currency:o,items:n,transaction_id:t,value:r}=e,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["currency","items","transaction_id","value"]),i=n.map((e=>({id:e.item_id,item_price:e.price,quantity:e.quantity}))),s=n.map((e=>e.item_id)),c=n.reduce(((e,o)=>e+o.quantity),0),u=Object.assign(Object.assign({},a),{content_ids:s,content_type:"product",contents:i,num_items:c});return t&&(u.order_id=t),void 0!==o&&(u.currency=o),void 0!==r&&(u.value=r),u},L=(e,o,n)=>{O()?E({event:o,fbqMode:e,payload:n,provider:"fbq"}):"function"==typeof window.fbq&&(I("Zonos submits fbq event","log",`${e}:${o}`),window.fbq(e,o,n))},M=o=>{g(o),(({event:o,metadata:n})=>{if(!(()=>{const o=e.checkoutSettings.analyticsProviders.find((e=>"FACEBOOK_PIXEL"===e.type));return!!o&&"ENABLED"===o.status})())return;const t=w(),r=z(n),a=Object.assign(Object.assign({},r),t&&{isTestMode:!0}),i=Object.fromEntries(Object.entries(a).filter((([e,o])=>null!==o)));L("trackCustom",o,i);const s=(e=>{var o;return null!==(o=x[e])&&void 0!==o?o:null})(o);s&&s!==o&&L("track",s,i)})(o)},{onChange:T,reset:_,state:R}=o((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),q=({checkoutSessionId:o,onPaypalFail:b,onPaypalSessionDone:w,overrideBorderRaidus:I,overridePrimaryColor:O})=>({createOrder:async()=>{var e;if(r({checkoutSessionId:o,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}}),a()&&!i.accepted)return i.showError=!0,null===(e=document.querySelector("zonos-policy-consent"))||void 0===e||e.scrollIntoView({behavior:"smooth"}),null==b||b(),"";const P=a();P&&(i.locked=!0);let k=!1;try{const e=await s();if(!e.valid)return R.paypalErrorMessage=e.errorMessage,c.hasPaymentError=!1,c.customErrorMessage=null,M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),"";R.paypalErrorMessage=null,u.inventoryCheckErrorMessage=null;try{u.inventoryCheckErrorMessage=await l()}catch(e){u.inventoryCheckErrorMessage=h("Unable to check inventory. Please try again.")}if(u.inventoryCheckErrorMessage)return"";if(v()>0){const e=await d();if(!e.success)return R.paypalErrorMessage=e.error||h("Unable to apply store credit. Please try again."),null==b||b(),""}if(await p(),f()){const e=await y();return e.success?(null==w||w({orderId:e.orderId||""}),n(),t(),k=!0,""):(R.paypalErrorMessage=e.error||h("Unable to place order with store credit. Please try again."),null==b||b(),"")}const r=await(async({checkoutSessionId:e})=>{var o,n;const t=R.intent.toUpperCase(),{errors:r,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,intent:t}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(r.length||!i)throw new Error((null===(n=r.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:o});return k=!!r,r}catch(e){return j("Failed to create paypal order",e),R.paypalErrorMessage=h("Failed to create PayPal order. Please try again, or consider using an alternative method."),c.hasPaymentError=!1,c.customErrorMessage=null,M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),""}finally{P&&!k&&(i.locked=!1)}},onApprove:async()=>{try{R.paypalErrorMessage=null,M({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:o,paymentMethod:"paypal"}});const e=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,t;const{errors:r,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(r.length||!i)throw new Error((null===(t=r.find(Boolean))||void 0===t?void 0:t.message)||h("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:o,paypalMockResponse:window.Zonos._paypalMockResponse});R.orderIdCreated=e,null==w||w({orderId:e}),n(),t()}catch(e){if(j("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=P(e.message),t=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,r=(null==t?void 0:t.match(/\[(.*?)\] (.*)/i))||[];r||(R.paypalErrorMessage=h("An unexpected error occurred when processing PayPal order."));const a=r[2]||h("An unexpected error occurred when processing PayPal order.");R.paypalErrorMessage=a})({error:e});null==b||b()}},style:{borderRadius:"SHARP"===I?0:10,color:k({backgroundColor1:"#ffc33a",backgroundColor2:O||e.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),D=async({currency:o})=>{var n;if(!(null===(n=e.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void I("=== Paypal is disabled for this store","warn");const t=e.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!t)return void I("Failed to load paypal -- missing paypal publishable key","warn");const r=e.zonosMode&&"production"!==e.zonosMode||"LIVE"!==e.checkoutSettings.mode?"sandbox":"production";R.intent=e.checkoutSettings.captureDelay&&e.checkoutSettings.captureDelay>0?"authorize":"capture",I("==== Paypal order intent","info",R.intent),window.Zonos.paypal=await A({clientId:t.token,currency:o,environment:r,intent:R.intent}),R.paypal=window.Zonos.paypal,I("==== Paypal script loaded")},F=e=>{var o;const n=window.Zonos.paypal;if(!n)return I("Paypal is not available"),null;const t=b.checkoutSessionId;if(!t)return I("Paypal is not available due to checkoutSessionId is not available"),null;I("==== Loading Paypal buttons"),R.paypalButtons.length&&(R.paypalButtons.forEach((async e=>{await e.close()})),R.paypalButtons=[]);const r=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return R.paypalButtons=r.map((o=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},q(Object.assign({checkoutSessionId:t,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){I(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(I(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),R.paypalButtons},N=()=>{var o,n;return"ENABLED"===(null===(n=null===(o=e.checkoutSettings.externalPaymentMethods)||void 0===o?void 0:o.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!R.paypalButtons.length};export{R as a,D as b,_ as c,F as d,T as e,N as p,M as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,f as r}from"./p-CqB9AfBf.js";import{r as o}from"./p-n5PZKz1k.js";import{h as n}from"./p-_lt63o7c.js";import{
|
|
1
|
+
import{r as e,f as r}from"./p-CqB9AfBf.js";import{r as o}from"./p-n5PZKz1k.js";import{h as n}from"./p-_lt63o7c.js";import{X as t,e as a}from"./p-CzXNXgyI.js";import{t as l}from"./p-D9OPKqLg.js";import{t as u,d as i}from"./p-Dwg61Ft_.js";var s,p,d=r(function(){if(p)return s;p=1;var r=o(),n=e();return s=function(e,o,t){var a=!0,l=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return n(t)&&(a="leading"in t?!!t.leading:a,l="trailing"in t?!!t.trailing:l),r(e,o,{leading:a,maxWait:o,trailing:l})}}());const c=({companyName:e,countryCode:r,errorField:o,errorMessage:s,onTaxIdChange:p,shouldRequirePeruTaxId:d,taxId:c,taxIdType:m})=>{const y=(({companyName:e,countryCode:r,errorField:o,errorMessage:n,shouldRequirePeruTaxId:a,taxIdType:l})=>{var i,s;const{rendered:p,selectedType:d,send:c,typeOptions:m}=t({companyName:e,countryCode:r,shouldRequirePeruTaxId:a,taxIdType:l});if(!p)return null;const y=m?null:u(r);return{inputLabel:null!==(i=null==d?void 0:d.label)&&void 0!==i?i:null==y?void 0:y.friendlyName,inputPlaceholder:null!==(s=null==d?void 0:d.placeholder)&&void 0!==s?s:null==y?void 0:y.placeholder,selectedValue:(null==d?void 0:d.value)||"",showValueInput:c,typeError:"type"===o?n:"",typeOptions:m,valueError:"value"===o?n:""}})({companyName:e,countryCode:r,errorField:o,errorMessage:s,shouldRequirePeruTaxId:d,taxIdType:m});return y?n("div",{class:"zonos--tax-id-input"},y.typeOptions&&n("zonos-stripe-select",{error:y.typeError,isError:!!y.typeError,onSelectChange:e=>{i(e.detail)&&(a.taxIdType=e.detail)},options:y.typeOptions.map((e=>({label:l(e.label),value:e.value}))),selectLabel:l("Tax id type"),selectedValue:y.selectedValue,value:y.selectedValue}),y.showValueInput&&n("zonos-stripe-input",{error:y.valueError,inputLabel:y.inputLabel?l(y.inputLabel):"",inputPlaceholder:y.inputPlaceholder||"",inputValue:c,isError:!!y.valueError,onInputChange:e=>{a.taxId=e.detail,null==p||p(e.detail)}})):null};export{c as r,d as t}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./p-DTgUqgwV.system.js","./p-DIab60nK.system.js","./p-CIevpRv_.system.js","./p-
|
|
1
|
+
System.register(["./p-DTgUqgwV.system.js","./p-DIab60nK.system.js","./p-CIevpRv_.system.js","./p-3AUMK-5E.system.js","./p-BOh4ifdL.system.js","./p-CzKlS3E-.system.js"],(function(e){"use strict";var n,r,t,i,u,o,l,a,s;return{setters:[function(e){n=e.r;r=e.f},function(e){t=e.r},function(e){i=e.h},function(e){u=e.X;o=e.e},function(e){l=e.t},function(e){a=e.t;s=e.d}],execute:function(){var v;var d;function c(){if(d)return v;d=1;var e=t(),r=n();
|
|
2
2
|
/** Error message constants. */var i="Expected a function";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a throttled function that only invokes `func` at most once per
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,h as e,F as t,a as s}from"./p-_lt63o7c.js";import{s as n,a as i,b as r,c,d as a,e as d,i as l,f as u,g as h,h as m,j as p,k as g,p as f,l as w,m as v,n as z,o as k,q as y,r as C,t as b,u as S,v as x,w as I,x as T,y as A,z as O,A as B,B as L,C as _,D as P,E as D,F as E,G as U,H as j,I as N,J as R,K as $,L as F,M}from"./p-CzXNXgyI.js";import{p as K,s as H,a as Z,b as V}from"./p-Df62LRNs.js";import{f as W,a as G,b as Q,i as Y,l as q,c as J,d as X,g as oo,s as eo,V as to,e as so,t as no,h as io,j as ro}from"./p-D9OPKqLg.js";import{z as co,g as ao,m as lo}from"./p-CqB9AfBf.js";import{b as uo}from"./p-BycjkdlE.js";import{h as ho,g as mo,j as po,l as go,d as fo,c as wo,b as vo,s as zo,a as ko,i as yo}from"./p-gEViRqvf.js";import{u as Co}from"./p-BJFa5RwX.js";import{l as bo,g as So,b as xo}from"./p-BJmZPrZl.js";import{_ as Io,c as To,d as Ao,a as Oo,g as Bo}from"./p-D5SpFsQJ.js";import{p as Lo,i as _o}from"./p-Bb90IMVt.js";import{c as Po}from"./p-BJHSB96f.js";import{c as Do}from"./p-XQfWgQLB.js";import{g as Eo}from"./p-r-YGHhLa.js";import{i as Uo}from"./p-YdrG78th.js";import{s as jo}from"./p-BTIeCf3T.js";import{R as No}from"./p-C2QMVeWW.js";import"./p-Dwg61Ft_.js";import"./p-DMIgN_sT.js";import"./p-CICjAi70.js";import"./p-CJmWr75U.js";import"./p-DW7I0zOF.js";import"./p-n5PZKz1k.js";const Ro="isInternationalCheckout",$o=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),mo()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(Ro,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),mo()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Fo=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");return s&&e.searchParams.set("zonosQaUrl",s),"1"===t.get("zonosDebug")&&e.searchParams.set("zonosDebug","1"),mo()&&e.searchParams.set("zonosTestMode","1"),e.toString()},Mo={customerGroupId:null,shouldBypass:!1};let Ko=null;const Ho=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Mo};const i=null===(e=co.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return co.loadedConfig?{conclusive:!0,result:Mo}:{conclusive:!1,result:Mo};const r=o?o.checkoutId:await G();if(!r)return bo("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Mo};const c=o?o.checkout:await Q(r);if(!c)return bo("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Mo};const a=null!==(n=null===(s=null===(t=c.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return bo("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Mo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return bo(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||Ko!==t||(Ko=null),e)));return Ko=t,t},Zo=async(o={})=>o.forceRefresh||!Ko?Ho(o.preFetched):Ko,Vo={guestCheckoutType:null},Wo="zonos--bc-checkout-settings",Go={redirectUrl:null,shouldForceLogin:!1};let Qo=null;const Yo=()=>{if(!Qo){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return Vo;const e=null===(o=co.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return bo("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),Vo;const t=(o=>{try{const e=window.localStorage.getItem(Wo);if(!e)return null;const t=po(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await ho("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return bo("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),Vo;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(Wo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:(Qo===o&&(Qo=null),!1))).catch((()=>(Qo===o&&(Qo=null),!1)));Qo=o}return Qo},qo=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Go;if(!await Yo())return Go;const e=o?o.checkoutId:await G();if(!e)return Go;const t=o?o.checkout:await Q(e);return t?Y(t)?Go:(bo("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:$o(),shouldForceLogin:!0}):(bo("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Go)},Jo="data-zonos-login-from-rewritten",Xo='a[href*="login.php?action=create_account"]:not(['+Jo+"])",oe=()=>{const o=document.querySelectorAll(Xo);if(!o.length)return;const e=$o({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Jo,"true")}))},ee=(o,e)=>{if(!o.address1||!o.countryCode)return null;const t=[o.firstName,o.lastName].filter(Boolean).join(" ").trim();return{address:{city:o.city||"",country:o.countryCode,line1:o.address1,line2:o.address2||"",postal_code:o.postalCode||"",state:o.stateOrProvinceCode||o.stateOrProvince||""},email:e,name:t,phone:o.phone||""}},te=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),se=(o=!0,e)=>{if(!q.localizationLoaded)return!1;if(e){const t=J(e);return o&&!t&&bo(`Checkout: ${e} is not a shippable country: ${t}`),t}return!!q.isShippableCountry||(o&&bo("Checkout: not shippable country"),!1)},ne=["1","true","yes"];let ie=null;const re=()=>{var o;return!(!(null===(o=window.Zonos)||void 0===o?void 0:o.isBigCommerce)||!Lo(window.location.pathname))&&(()=>{const{pathname:o,search:e}=window.location;if(ie&&ie.pathname===o&&ie.search===e)return ie.enabled;const t=new URLSearchParams(e);var s;if(null===(s=t.get("zBypass"))||!ne.includes(s.trim().toLowerCase()))return ie={enabled:!1,pathname:o,search:e},!1;t.delete("zBypass");const n=t.toString(),i=window.location.hash||"";window.history.replaceState(window.history.state,document.title,`${o}${n?`?${n}`:""}${i}`);const r=!0===(null===(a=null===(c=co.checkoutSettings.plugins)||void 0===c?void 0:c.bigcommerce)||void 0===a?void 0:a.allowBypassQuery);var c,a;return ie={enabled:r,pathname:o,search:window.location.search},r})()},ce='select[name="shippingAddress.countryCode"]',ae=({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;if(Lo(window.location.pathname)&&re())return;const d=async o=>{var t;const s=document.querySelector((null===(t=co.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||ce),n=(null==s?void 0:s.value)||o;if(!n)return"noAction";if(!se(!1,n))return"noAction";const i=await G(),r={checkout:i?await Q(i):null,checkoutId:i},{shouldBypass:c}=await Zo({forceRefresh:!0,preFetched:r});if(c)return bo("Bypass customer group detected on BC checkout, stopping interval","info"),"bypass";const d=await qo({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,"redirected";e&&await e(),X({isInitializing:!1,newSelectedCountryCode:n,persistOverride:!1});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return a({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=Fo("/"),"redirected"};let l=!1,u=!1;let h=!1,m=!1,p=!1,g=!1,f=!1;const w=new MutationObserver((async()=>{var v;const z=document.querySelector(o),k=n();if(!z&&k){if(!_o()){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(k),void w.disconnect()}if(!i())return c(),w.disconnect(),void(window.location.href=Fo("/"));r()}if(!Lo(window.location.pathname)||!window.Zonos.isBigCommerce)return void w.disconnect();if(!g&&!p){p=!0,f=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,i,r,c,d,l,u,h;const m=await G();if(!m)return"noAction";const p=await Q(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Zo({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const v=w.countryCode;if(!se(!1,v))return"noAction";if(bo(e?`Logged-in user has international shipping address: ${v}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${v}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return bo("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const z=await qo({preFetched:g});return z.shouldForceLogin&&z.redirectUrl?(window.location.href=z.redirectUrl,"redirected"):(o&&await o(),X({isInitializing:!1,newSelectedCountryCode:v,persistOverride:!1}),a({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(i=w.address2)&&void 0!==i?i:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:v,firstName:null!==(c=w.firstName)&&void 0!==c?c:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=Fo("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void w.disconnect();"optedOut"===o&&(g=!0,(o=>{u||(u=!0,document.addEventListener("click",(e=>{if(l)return;const{target:t}=e;if(!(t instanceof Element))return;const s=t.closest("#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue");s&&(e.preventDefault(),e.stopImmediatePropagation(),(async(o,e)=>{let t=!0;try{let o=null;try{o=await(async()=>{var o,e,t,s;const n=await G();if(n){const s=await Q(n),i=null===(t=null===(e=null===(o=null==s?void 0:s.consignments)||void 0===o?void 0:o[0])||void 0===e?void 0:e.shippingAddress)||void 0===t?void 0:t.countryCode;if(i)return i}const i=document.querySelector((null===(s=co.genericSettings)||void 0===s?void 0:s.bigcommerceDomesticCheckoutCountrySelector)||ce);return(null==i?void 0:i.value)||null})()}catch(o){go("Error resolving selected shipping country on BC continue",o)}o&&se(!1,o)&&e.disconnect(),"redirected"===(o?await d(o):"noAction")&&(t=!1)}catch(o){go("Error handling BC continue international redirect",o)}t&&(l=!0,o.click(),l=!1)})(s,o))}),!0))})(w))}catch(o){go("Error checking logged-in user shipping address",o)}finally{p=!1,f=!1}}const y=document.querySelector((null===(v=co.genericSettings)||void 0===v?void 0:v.bigcommerceDomesticCheckoutCountrySelector)||ce);if(!y)return;if(bo("Domestic checkout found - Listening for shipping country change","info",{value:y.value}),m)return;m=!0,w.disconnect();const C=setInterval((async()=>{if(!h&&!f){h=!0;try{const o=await d();if("redirected"===o||"bypass"===o)return void clearInterval(C);h=!1}catch(o){h=!1}}}),1e3),b=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(b);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(b),e.on("change",(o=>{const e=o.value.address.country;e&&!f&&d(e)})))}),500)}));w.observe(document.body,{childList:!0,subtree:!0})};let de=0;const le=o=>{var e;const t=null===(e=eo.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},ue=async({cartId:o,retries:e})=>{const t=mo(),{errors:s,json:n}=await ho("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(bo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),ue({cartId:o,retries:e-1})):i?null:n};var he='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';const me=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=d.clientSecret,this.stripeCustomerSessionClientSecret=d.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||co.appearance.theme;await l({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:K()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${To}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return bo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(bo("Payment intent exist, checking stripe payment intent status"),!n)return bo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:c}=await u({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(bo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,eo.checkoutSessionId=i,d.clientSecret=n,this.setToFinishStep(c),{shouldAllowOrder:!1}):t?(bo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(bo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedOrderModificationSession=async o=>{eo.checkoutSessionId=o;const{errors:e,json:t}=await h();if(e.length||!t)return!1;const{checkoutSession:s}=t;if(s.completedAt&&s.order)return this.setToFinishStep("succeeded"),!0;if(s.clientSecret){const{status:o}=await u({clientSecret:s.clientSecret});if("processing"===o||"succeeded"===o)return d.clientSecret=s.clientSecret,this.setToFinishStep(o),!0}return!1},this.initializeTestKeys=()=>{var o;eo.enabledVariantTestKeys=(null==(o=eo.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=co.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=eo.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+to,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return so(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>{var o;return(({createCartId:o,enabledTestKeys:e,isBigCommerce:t})=>!t&&"function"==typeof o&&e.includes("hosted_vs_native"))({createCartId:co.checkoutSettings.createCartId,enabledTestKeys:co.enabledVariantTestKeys,isBigCommerce:Boolean(null===(o=window.Zonos)||void 0===o?void 0:o.isBigCommerce)})},this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;bo("[TEST] - Registering hosted vs native test");const o=le("hosted_vs_native");if(o)return void bo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await ho("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:W(t)})({testKeys:["hosted_vs_native"]});if(!e)return void bo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+to,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:eo.enabledVariantTestKeys||[],mergeTestObj:e});so(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=le("hosted_vs_native");if(bo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof co.checkoutSettings.createCartId)return bo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return bo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=co.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return bo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};bo('"createCartId" is provided, start building cart');const t=await co.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);bo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=oo(o)||q.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),r=e("customerAddress2"),c=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:r,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:c,customerPhone:a,customerState:l,customerZip:d}})(),r=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:r,customerFirstName:c,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),c&&g.set("customerFirstName",c),a&&g.set("customerLastName",a),r&&g.set("customerEmail",r),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:eo.checkoutSessionId||void 0,hostedCheckoutUrl:co.genericSettings.hostedCheckoutUrl,isTestMode:mo(),isVariantTest:!0},i),n));return bo(`[TEST] - Redirecting to: ${r}`),window.open(r,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(m.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=m.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.prefillBigCommerceCustomerAddresses=async()=>{if(!window.Zonos.isBigCommerce)return;if(this.defaultCustomerProfileAddress.length)return;if(Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&"object"==typeof this.defaultAddress&&null!==this.defaultAddress)return;const o=await G();if(!o)return;const e=await Q(o);if(!Y(e))return;const t=((o,e)=>{var t,s,n,i;if(!(null===(t=null==o?void 0:o.customer)||void 0===t?void 0:t.id))return[];const{isShippable:r,selectedCountryCode:c}=e,a=o.customer.email||"",d=null!==(n=null===(s=o.consignments)||void 0===s?void 0:s.flatMap((o=>o.shippingAddress?[o.shippingAddress]:[])))&&void 0!==n?n:[],l=null!==(i=o.customer.addresses)&&void 0!==i?i:[],u=new Set,h=[];for(const o of[...l,...d]){const e=ee(o,a);if(!e)continue;if(!r(e.address.country))continue;const t=te(e);u.has(t)||(u.add(t),h.push(e))}return c?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===c;return t===(e.option.address.country===c)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>se(!1,o),selectedCountryCode:q.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,bo(`Prefilled ${String(t.length)} BigCommerce customer address(es) for logged-in shopper`,"info")))},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=co.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(eo.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(eo.checkoutSessionId=e);const t=eo.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(le("hosted_vs_native")?so(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+to,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),so(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){p({adjustments:m.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,H({event:"zonos-checkout-close",metadata:{checkoutSessionId:eo.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==m.step||g(),this.preview||f(),m.step="customer-info",w(),v(),null===(t=(e=co.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){var o;if("function"==typeof co.checkoutSettings.createCartId){bo('"createCartId" is provided, start building cart'),m.customMessage=[];const o=await co.checkoutSettings.createCartId();let e;"object"==typeof o?(bo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),m.customerAuthenticationToken=o.customerAuthenticationToken||null,m.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((o=>"string"==typeof o)):[]):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=Io(o);if(!t&&!e)return go("[ZONOS - loadZonos] invalid cart id"),null;const s=await ue({cartId:o,retries:5});return bo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(go("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return go("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=uo(s);await p({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){bo("tempCartUUID is provided, start building cart");const e=null===(o=window.Zonos.cartData.references)||void 0===o?void 0:o.checkoutSessionId;if(e){if(bo("Setting checkout session id from cart reference","info",e),await this.recoverCompletedOrderModificationSession(e))return d.isFetchingSession=!1,!0;eo.checkoutSessionId=e}else bo("Clear checkout session id from storage so we start from a fresh session for this cart"),eo.checkoutSessionId=null;const{adjustments:t,cartItems:s}=uo(window.Zonos.cartData);await p({adjustments:t,cartItems:s})}else if(co.checkoutSettings.buildCartDetail&&q.selectedCountryCode){bo("build cart detail");const o=await co.checkoutSettings.buildCartDetail({countryCode:q.selectedCountryCode,currencyCode:q.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));bo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await p({adjustments:s,cartItems:e})}if(!eo.checkoutSessionId){const o=await z();if(bo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}m.isStagingMode||k(),await this.applyStripeTheme();const{successBehavior:e,successRedirectUrl:t}=co.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===e||"CLOSE_MODAL"===e&&!!t||!!m.externalConfirmationPageURL,y()&&(m.step="payment"),!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=po(wo("local","zonos--placed-order-info"));if(!o)return void vo("local","zonos--placed-order-info");const e=Date.now()-o.time;bo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return bo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void vo("local","zonos--placed-order-info");this.placedOrderInfo=o,bo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){eo.checkoutSessionId&&Co({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:eo.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,eo.checkoutSessionId&&Co({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:eo.checkoutSessionId})}markTheSessionAsAbandonedCart(){eo.checkoutSessionId&&Co({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:eo.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||co.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=co.checkoutSettings.placeOrderButtonSelector,e=co.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${To}`);if(bo(`attach checkout ${o}`,"info",{href:window.location.href}),bo(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${Ao}`,`#${To}`,`#${Oo}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(bo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),c=t.matches(`#${Oo}`),a=t.matches(`#${Ao}`)||t.matches(`#${To}`);if(!window.Zonos.isLegacyCheckout&&(!se()||((o=!0)=>!q.localizationLoaded||!!q.isDisabledCountry&&(o&&bo("Checkout: disabled country"),!0))())&&!r&&!c&&!a)return;o.preventDefault(),o.stopPropagation(),bo("zonos checkout button clicked");const{shouldAllowOrder:l}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(l){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;bo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await ho("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),de++,de>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),co.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Zo();if(o)return bo("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Fo("/checkout"));const e=await qo();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}d.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");if(!window.Zonos.isLegacyCheckout){let o=null;try{o=await C()}catch(e){o=no("Unable to check inventory. Please try again.")}if(o)return m.inventoryCheckErrorMessage=o,d.isFetchingSession=!1,void(this.open=!1)}null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:eo.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),b({isPreview:this.preview,sessionTimeout:54e5}),H({event:"zonos-checkout-start",metadata:{checkoutSessionId:eo.checkoutSessionId}}),S({checkoutSessionId:eo.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await ho("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(m.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=So(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:xo},fo()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};ho("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:xo},fo()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};ho("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),Bo()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),d.isFetchingSession=!1,go(o),this.isCartExpired)return void(d.isFetchingSession=!0);zo({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:xo,cartId:window.Zonos.cartId,checkoutSessionBody:x(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||co.onlineStoreSettings.url}}),I({messages:[no("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:no("Error creating Checkout")})}}}),{capture:!0,passive:!1}),co.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${Ao}`)&&(t.dispatchEvent(Do("click")),r(),t.remove()),t.matches(`#${To}`)&&(t.dispatchEvent(Do("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;bo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:r,customerLastName:c,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||oo(h)||q.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:r,customerLastName:c,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);bo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=oo(o)||q.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),r=e("customerAddress2"),c=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:r,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:c,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",r=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",c=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&r&&c&&t?t&&q.shippingZoneCountries&&!(t in q.shippingZoneCountries)?bo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:r,phone:c}],bo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):bo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!r&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){m.isStagingMode=!!this.overrideStagingMode}async init(){if(d.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,m.isStagingMode=ko(),void 0!==this.overrideStagingMode&&(m.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=co.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&Ho()})(),window.Zonos.isBigCommerce&&Yo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;oe();const o=new MutationObserver((()=>{oe()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),ae({domesticRedirectedBtnSelector:Ao,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams(),_o())return;const o=setInterval((()=>{d.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(bo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):bo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(Ro))return;o.searchParams.delete(Ro),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!q.localizationLoaded||!q.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),bo("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${Oo}`);if(o)return clearInterval(t),void o.dispatchEvent(Do("click"));Date.now()-e>15e3&&(clearInterval(t),bo("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){m.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){T(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${Oo}`);o&&o.dispatchEvent(Do("click"))}async handleCustomerInfoContinue(){var o,e,t,s;H({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:eo.checkoutSessionId}}),S({checkoutSessionId:eo.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await A();n&&"stripe"===m.addressFormRenderType&&zo({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=d.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=d.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===m.step?d.isFetchingLandedCost||(m.landedCostData&&(V({currency:m.currency}),O()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){O()}handleInventoryCheckDialogConfirm(){m.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"===d.checkoutSettlementCurrency&&d.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=B();try{if(Z.paypalErrorMessage=null,d.hasPaymentError=!1,this.submitLoading=!0,m.inventoryCheckErrorMessage=null,!await L())return d.hasPaymentError=!0,d.customErrorMessage=no("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:d.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{m.inventoryCheckErrorMessage=await C()}catch(o){m.inventoryCheckErrorMessage=no("Unable to check inventory. Please try again.")}if(m.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if(M()>0){const o=await _();if(!o.success)return d.hasPaymentError=!0,d.customErrorMessage=o.error||no("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(P()){try{const o=await D();if(!o.valid)return d.hasPaymentError=!0,d.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await E();if(!e.success)return d.hasPaymentError=!0,d.customErrorMessage=e.error||no("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);O(),v()}catch(o){go(o),H({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:eo.checkoutSessionId}}),d.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await U({noLandedCostCheck:y()}),O(),v()}catch(o){go(o),H({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:eo.checkoutSessionId}}),d.hasPaymentError=!0,d.shouldInventoryRefund&&(j(),d.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(N.locked=!1)}}async handleFinishClick(){if(R(),this.preview)return m.step="customer-info",void await this.init();if(g(),f(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||co.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=yo(this.mobile),this.applyStripeTheme(),bo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=yo(this.mobile),this.applyStripeTheme(),bo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=ao(this.appearanceSettingsOverride.theme))}handleAddressChange(){R()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return bo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);bo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=d.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=d.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){bo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=yo(this.mobile),this.isIframed=window.self!==window.top,bo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[io("selectedLocale",(()=>{this.applyStripeTheme()})),$("selectedShippingOption",(()=>{var o,e,t,s;const n=m.selectedShippingOption;(null===(o=co.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=d.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),F("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=co.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==co.sourceCurrency)return;if(!this.open)return;if(Lo(window.location.pathname))return;const t=o.value.address.country;t&&co.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,bo(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Fo("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),bo(`mobile: ${this.isMobile}`)}disconnectedCallback(){R(),g(),f(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=d.customerProfile,this.clientSecret=d.clientSecret,d.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=d.stripeCustomerSessionClientSecret);const c="finish"!==m.step&&"error"!==m.step&&!d.stripeElements||d.isFetchingSession,a=y(),{colorPrimary:l,colorSecondary:u,logoUrl:h,style:p}=lo(co.appearance,this.appearanceSettingsOverride||null),g="ENABLED"===co.appearance.zonosAttribution,f=co.appearance.theme,w=l&&Uo(l)?"DARK":"LIGHT",v=this.isMobile?f:w,z=this.isMobile?void 0:u,{customMessages:k}=q,C=null===(o=k.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,b=this.getCurrentLocalePageEnum(),S=k.filter((o=>o.pageName===b)),x=this.getBaseCurrencySettlementInfo(),I=()=>{const o=this.preview?`${h}?timestamp=${Date.now()}`:h;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${co.organizationName} logo`,src:o}))},T=mo(),A=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||ko();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},I(),T&&e("zonos-badge",{badgeColor:"orange",size:"small"},no("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},no("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!a&&e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),S.map((o=>e("zonos-custom-message",{icon:he,message:o.message}))))},O=()=>m.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:no("Your checkout session has expired. Please reload the page to continue."),restStateTitle:no("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},no("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":Eo({overrideBorderStyle:p})}},"finish"!==m.step&&"error"!==m.step&&e(t,null,e("div",{class:"zonos--left","data-theme":v,style:jo({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&A(),"customer-info"===m.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:z}),"shipping"===m.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:z}),"payment"===m.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:z})),e("div",{class:"zonos--right","data-theme":f},this.isMobile&&A(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:No}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:z}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:he,message:C})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:he,message:C}))))),("finish"===m.step||"error"===m.step)&&e("div",{class:"zonos--done","data-theme":f},e("div",{class:"zonos--header"},I(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:No}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:f})),e("zonos-checkout-finish",{borderRadius:p,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===m.step&&m.error?Object.assign(Object.assign({},m.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":f,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:Po(["zonos--checkout zonos--elements","payment"===m.step&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?O():e("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":f,height:"980px",isLoading:c,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},O()),e("zonos-dialog",{isLoading:!0,loadingText:no("You will be redirected to international checkout shortly."),loadingTitle:no("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:no("You will be redirected to domestic checkout shortly."),loadingTitle:no("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:no("Stay on this page"),dialogConfirmBtnText:no("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:no("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:no("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:no("Don't close"),dialogConfirmBtnText:no("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:no("Would you like to close checkout and return to the site?"),dialogTitle:no("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:no("Return to merchant site"),dialogConfirmBtnText:no("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?no("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):no("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:no("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:no("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,no("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},no("View GAA Form."))),dialogTitle:no("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:no("Return to cart"),dialogIntent:"danger",dialogOpen:!!m.inventoryCheckErrorMessage,dialogSubtitle:m.inventoryCheckErrorMessage,dialogTitle:no("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),x&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:no("Cancel"),dialogConfirmBtnText:no("Pay [orderTotal]",{orderTotal:ro({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:no("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:no("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:no("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:no("You are being sent back to the shop to re-add items to your cart."),dialogTitle:no("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}}};me.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-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-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{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-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{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-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{me as zonos_checkout}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function l(e){try{a(n["throw"](e))}catch(e){r(e)}}function a(e){e.done?t(e.value):i(e.value).then(s,l)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=l(0),s["throw"]=l(1),s["return"]=l(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(o){return a([e,o])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=o.call(e,t)}catch(e){l=[6,e];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-CIevpRv_.system.js","./p-CYxMfUL7.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function l(e){try{a(n["throw"](e))}catch(e){r(e)}}function a(e){e.done?t(e.value):i(e.value).then(s,l)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=l(0),s["throw"]=l(1),s["return"]=l(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(o){return a([e,o])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=o.call(e,t)}catch(e){l=[6,e];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-CIevpRv_.system.js","./p-CYxMfUL7.system.js","./p-BOh4ifdL.system.js","./p-DTgUqgwV.system.js","./p-C2j7R11h.system.js","./p-D0DkOoAw.system.js","./p-Z99tSPFR.system.js","./p-BbgqQIHv.system.js","./p-DIab60nK.system.js"],(function(e){"use strict";var o,t,n,i,r,s,l,a,h,d,u,f,c,m,v,z,w,g,p,b,x,y,k;return{setters:[function(e){o=e.r;t=e.h;n=e.a;i=e.g},function(e){r=e.d},function(e){s=e.l;l=e.m;a=e.t;h=e.g;d=e.p;u=e.q;f=e.r;c=e.u;m=e.j;v=e.v},function(e){z=e.z;w=e.g;g=e.m},function(e){p=e.c},function(e){b=e.h;x=e.l},function(e){y=e.g},function(e){k=e.l},null],execute:function(){var _=this;var O=function(e){return __awaiter(_,[e],void 0,(function(e){var o,t,n,i,r;var s=e.items,l=e.shipFrom,a=e.shipTo;return __generator(this,(function(e){switch(e.label){case 0:t={items:s,shipFrom:l,shipTo:a};return[4/*yield*/,b("/api/zonos-elements/check-item-restrictions",{body:t,method:"POST"})];case 1:n=e.sent(),i=n.errors,r=n.json;if(i.length||!r){x("Error fetching item restrictions: ".concat((o=i.find(Boolean))===null||o===void 0?void 0:o.message));return[2/*return*/,[]]}return[2/*return*/,r.filter(Boolean)]}}))}))};var L=function(e){return __awaiter(_,void 0,void 0,(function(){var o,t,n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!e.length){return[2/*return*/,[]]}o=s.selectedCountryCode;if(!o){x("Hello could not check item restrictions - No country code selected");return[2/*return*/,[]]}t=e.map((function(e){return{description:e.description,name:e.title}}));return[4/*yield*/,O({items:t,shipFrom:"AD",shipTo:o})];case 1:n=r.sent();i=n.map((function(e){var o;var n=((o=t.filter((function(o){return o.description===e.itemDescription})).find(Boolean))===null||o===void 0?void 0:o.name)||"";return Object.assign(Object.assign({},e),{name:n})}));return[2/*return*/,i]}}))}))};var D=function(e){var o=e===null||e===void 0?void 0:e.replace("www.","").replace("https://","");return o&&new RegExp(o).test(window.location.href)};var j=function(){var e=z.helloSettings,o=e.cartUrlPattern,t=e.homepageUrlPattern,n=e.productDetailUrlPattern,i=e.productListUrlPattern;
|
|
2
2
|
// The 'if' statements are sorted by most specific to least specific to help with regex matching
|
|
3
|
-
if(
|
|
3
|
+
if(D(o)){return"cart"}if(D(n)){return"productDetail"}if(D(i)){return"productList"}if(D(t)){return"home"}return""};
|
|
4
4
|
/**
|
|
5
5
|
* Default Hello widget diameter in pixels. Matches the legacy size that
|
|
6
6
|
* shipped before `widgetSize` became configurable, so existing merchants
|
|
@@ -11,11 +11,11 @@ if(j(o)){return"cart"}if(j(n)){return"productDetail"}if(j(i)){return"productList
|
|
|
11
11
|
* to the default when the merchant has not configured a size, and clamps
|
|
12
12
|
* out-of-range values so the widget always renders within the supported
|
|
13
13
|
* design bounds.
|
|
14
|
-
*/var M=function(e){if(e==null||!Number.isFinite(e)||e<=0){return B}return Math.min(I,Math.max(F,e))};var
|
|
14
|
+
*/var M=function(e){if(e==null||!Number.isFinite(e)||e<=0){return B}return Math.min(I,Math.max(F,e))};var C=function(){var e,o;var t=z.helloSettings,n=t.productAddToCartElementSelector,i=t.productDescriptionElementSelector,r=t.productTitleElementSelector,s=t.restrictionBehavior;if(!r||!i){k("Hello could not check item restrictions - must provide title and description selectors.")}var a=r&&l(r)&&document.querySelectorAll(r)||[];var h=i&&l(i)&&document.querySelectorAll(i)||[];if(a.length!==h.length){
|
|
15
15
|
// If the title and description selectors don't match, kill item restrictions altogether
|
|
16
16
|
k("Hello could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var u=d&&n&&l(n)&&document.querySelectorAll(n)||[];if(d&&u.length!==h.length){
|
|
17
17
|
// If the "add to cart" selectors don't match, log the error and continue
|
|
18
|
-
k('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var m=a[c];var v=h[c];var w=u[c];if(m&&v){var g={cartButtonNode:w||null,description:((e=v.textContent)===null||e===void 0?void 0:e.trim())||"",title:((o=m.textContent)===null||o===void 0?void 0:o.trim())||""};f.push(g)}}return f};var
|
|
18
|
+
k('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var m=a[c];var v=h[c];var w=u[c];if(m&&v){var g={cartButtonNode:w||null,description:((e=v.textContent)===null||e===void 0?void 0:e.trim())||"",title:((o=m.textContent)===null||o===void 0?void 0:o.trim())||""};f.push(g)}}return f};var E=function(e){if(e==null||typeof e!=="object"){return false}var o=e.anchor,t=e.horizontalOffset,n=e.verticalOffset;return typeof o==="string"&&o.length>0&&typeof t==="number"&&Number.isFinite(t)&&typeof n==="number"&&Number.isFinite(n)};var S=function(e){return Boolean(e===null||e===void 0?void 0:e.includes("LEFT"))};var T=function(e){return Boolean(e===null||e===void 0?void 0:e.includes("TOP"))};var X=function(e){var o=e.anchor,t=e.animateFromLeftOverride,n=e.horizontalOffset,i=e.isMobileWindow,r=e.isOnLeft,s=e.shouldFloat,l=e.verticalOffset;return{anchor:o,horizontalOffset:n,isMobileWindow:i,isOnLeft:r!==null&&r!==void 0?r:Boolean(t)||S(o),isOnTop:T(o),shouldFloat:s,verticalOffset:l}};
|
|
19
19
|
/**
|
|
20
20
|
* Resolve active Hello float placement per viewport.
|
|
21
21
|
* Precedence: component enum prop → settings HelloPlacement → settings location enum.
|
|
@@ -24,7 +24,7 @@ k('Hello could not disable "Add to cart" buttons - Title and add to cart selecto
|
|
|
24
24
|
* `shouldFloat` is always true — including when `anchorElementSelector` is set.
|
|
25
25
|
* That matches existing prop-forced float behavior and FR-006 / data-model rules
|
|
26
26
|
* (placement implies floating; enum fallback still respects the anchor selector).
|
|
27
|
-
*/var R=function(e){var o=e.anchorElementSelector,t=e.animateFromLeftOverride,n=e.componentDesktopLocation,i=e.componentMobileLocation,r=e.desktopLocation,s=e.isMobileWindow,l=e.mobileLocation,a=e.settingsDesktopPlacement,h=e.settingsMobilePlacement,d=e.shouldAnimateLeftDesktop;if(s){if(i){return X({anchor:i,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:true,shouldFloat:true,verticalOffset:null})}if(C(h)){return X({anchor:h.anchor,animateFromLeftOverride:t,horizontalOffset:h.horizontalOffset,isMobileWindow:true,shouldFloat:true,verticalOffset:h.verticalOffset})}return X({anchor:l,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:true,shouldFloat:Boolean(l),verticalOffset:null})}if(n){return X({anchor:n,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:false,shouldFloat:true,verticalOffset:null})}if(C(a)){return X({anchor:a.anchor,animateFromLeftOverride:t,horizontalOffset:a.horizontalOffset,isMobileWindow:false,shouldFloat:true,verticalOffset:a.verticalOffset})}var u=!o&&Boolean(r);var f=Boolean(t)||(u&&r?E(r):Boolean(d===null||d===void 0?void 0:d()));return X({anchor:r,horizontalOffset:null,isMobileWindow:false,isOnLeft:f,shouldFloat:u,verticalOffset:null})};var A=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block;--zonos-elements-hello-widget-size:18px;--zonos-elements-hello-bubble-padding:max( 6px, calc(var(--zonos-elements-hello-widget-size) * 0.22) );--zonos-elements-hello-bubble-size:calc( var(--zonos-elements-hello-widget-size) + var(--zonos-elements-hello-bubble-padding) * 2 + 2px )}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{width:auto;height:auto;z-index:1001}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:var(--zonos-elements-hello-bubble-padding);border-radius:9999px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);left:0;-webkit-transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 calc(var(--zonos-elements-hello-bubble-size) / 2);border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:calc(var(--zonos-elements-hello-bubble-size) / 2);border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2)}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;height:var(--zonos-elements-hello-widget-size);width:var(--zonos-elements-hello-widget-size)}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}"};var N=3e3;var W=e("zonos_hello",/** @class */function(){function e(e){var t=this;o(this,e);this.showPeekMessage=false;this.zonosStoreHelloSettings=z.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";
|
|
27
|
+
*/var R=function(e){var o=e.anchorElementSelector,t=e.animateFromLeftOverride,n=e.componentDesktopLocation,i=e.componentMobileLocation,r=e.desktopLocation,s=e.isMobileWindow,l=e.mobileLocation,a=e.settingsDesktopPlacement,h=e.settingsMobilePlacement,d=e.shouldAnimateLeftDesktop;if(s){if(i){return X({anchor:i,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:true,shouldFloat:true,verticalOffset:null})}if(E(h)){return X({anchor:h.anchor,animateFromLeftOverride:t,horizontalOffset:h.horizontalOffset,isMobileWindow:true,shouldFloat:true,verticalOffset:h.verticalOffset})}return X({anchor:l,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:true,shouldFloat:Boolean(l),verticalOffset:null})}if(n){return X({anchor:n,animateFromLeftOverride:t,horizontalOffset:null,isMobileWindow:false,shouldFloat:true,verticalOffset:null})}if(E(a)){return X({anchor:a.anchor,animateFromLeftOverride:t,horizontalOffset:a.horizontalOffset,isMobileWindow:false,shouldFloat:true,verticalOffset:a.verticalOffset})}var u=!o&&Boolean(r);var f=Boolean(t)||(u&&r?S(r):Boolean(d===null||d===void 0?void 0:d()));return X({anchor:r,horizontalOffset:null,isMobileWindow:false,isOnLeft:f,shouldFloat:u,verticalOffset:null})};var A=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block;--zonos-elements-hello-widget-size:18px;--zonos-elements-hello-bubble-padding:max( 6px, calc(var(--zonos-elements-hello-widget-size) * 0.22) );--zonos-elements-hello-bubble-size:calc( var(--zonos-elements-hello-widget-size) + var(--zonos-elements-hello-bubble-padding) * 2 + 2px )}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{width:auto;height:auto;z-index:1001}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:var(--zonos-elements-hello-bubble-padding);border-radius:9999px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);left:0;-webkit-transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 calc(var(--zonos-elements-hello-bubble-size) / 2);border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:calc(var(--zonos-elements-hello-bubble-size) / 2);border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2)}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;height:var(--zonos-elements-hello-widget-size);width:var(--zonos-elements-hello-widget-size)}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:var(--zonos-elements-hello-float-inset-y, 72px);right:var(--zonos-elements-hello-float-inset-x, 32px)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:var(--zonos-elements-hello-float-inset-x, 32px);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:var(--zonos-elements-hello-float-inset-y, 32px)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}"};var N=3e3;var W=e("zonos_hello",/** @class */function(){function e(e){var t=this;o(this,e);this.showPeekMessage=false;this.zonosStoreHelloSettings=z.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";
|
|
28
28
|
/**
|
|
29
29
|
* This array will hold all restricted items handled by Hello thus far
|
|
30
30
|
*/this.allRestrictedItems=[];
|
|
@@ -49,7 +49,7 @@ setTimeout((function(){t.showPeekMessage=false}),N)}}),i)}};this.disableAddToCar
|
|
|
49
49
|
// Remove disabled attribute from all "add to cart" buttons
|
|
50
50
|
if(t.productsOnPage.length){t.productsOnPage.forEach((function(e){var o,n;var i=t.allRestrictedItems.some((function(o){return o.itemDescription===e.description}));
|
|
51
51
|
// if a product description matches a restrictedItems itemDescription, then disable the add to cart button. Otherwise, enable it.
|
|
52
|
-
if(i){(o=e.cartButtonNode)===null||o===void 0?void 0:o.setAttribute("disabled","disabled")}else{(n=e.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var e,o;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=
|
|
52
|
+
if(i){(o=e.cartButtonNode)===null||o===void 0?void 0:o.setAttribute("disabled","disabled")}else{(n=e.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var e,o;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=C();e=this.productsOnPage.filter((function(e){return!i.allFoundProducts.some((function(o){return o.title===e.title}))}));return[4/*yield*/,this.getNewItemRestrictions(e)];case 1:o=r.sent();(t=this.allRestrictedItems).push.apply(t,o);(n=this.allFoundProducts).push.apply(n,e);this.disableAddToCartButtons();return[2/*return*/]}}))}))};this.reloadHelloData=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,this.handleItemRestrictions()];case 1:e.sent();this.triggerShowPeekMessage();return[2/*return*/]}}))}))};this.handleProductCountChange=r((function(){var e=z.helloSettings.productTitleElementSelector;if(e){var o=C();if(t.allFoundProducts.length!==o.length&&window.location.href===t.initialUrl){
|
|
53
53
|
// if allFoundProducts length is 0 (first render or no products), kill item restriction process as initial restrictions are handled in updateHelloOnPageChange
|
|
54
54
|
if(!t.allFoundProducts.length){return}void t.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var e;var o=new MutationObserver(t.handleProductCountChange);o.observe(document.body,{childList:true,subtree:true});(e=t.observerWatcher)===null||e===void 0?void 0:e.push(o)};this.watchPriceChange=function(){var e;var o=new MutationObserver((function(){return void t.displayCurrency()}));o.observe(document.body,{attributes:true,childList:true,subtree:true});(e=t.observerWatcher)===null||e===void 0?void 0:e.push(o)};this.updateHelloOnPageChange=function(){
|
|
55
55
|
// If the product count changes on the same url (loading more products), update the peek message and item restrictions
|
|
@@ -57,7 +57,7 @@ t.watchProductCountChange();
|
|
|
57
57
|
// Check url change on interval. If changed, update the peek message and item restrictions
|
|
58
58
|
setInterval((function(){if(window.location.href!==t.initialUrl){var e=t.initialUrl&&new URL(t.initialUrl);var o=e&&h(e.searchParams);
|
|
59
59
|
// If the zCountry url param changes, reset current item restriction tracking
|
|
60
|
-
if(o!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;z.currentHelloPage=
|
|
60
|
+
if(o!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;z.currentHelloPage=j();var n=new URL(window.location.href);var i=h(n.searchParams);if(!i){d(s.selectedCountryCode);return}void t.reloadHelloData()}}),1e3)};this.changeShowDialog=function(e){t.showDialog=e};
|
|
61
61
|
/**
|
|
62
62
|
* Determine if the peek message should animate from left or not
|
|
63
63
|
*/this.shouldAnimateLeftDesktop=function(){
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=r(0),i["throw"]=r(1),i["return"]=r(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-DTgUqgwV.system.js","./p-C2j7R11h.system.js","./p-zsTASoh2.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=r(0),i["throw"]=r(1),i["return"]=r(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-DTgUqgwV.system.js","./p-C2j7R11h.system.js","./p-zsTASoh2.system.js","./p-3AUMK-5E.system.js","./p-BOh4ifdL.system.js","./p-D0DkOoAw.system.js","./p-v8IEjQ2z.system.js","./p-BbgqQIHv.system.js","./p-CzKlS3E-.system.js","./p-DsBuZ6ob.system.js","./p-DW-fW8yR.system.js","./p-B3GRrRtL.system.js","./p-DXlojp_Y.system.js"],(function(t){"use strict";var n,o,e,s,a,i,r,c,h,l,p,f,y,m,d;return{setters:[function(t){n=t.r;o=t.h;e=t.a;s=t.g;a=t.d},function(t){i=t.a},function(t){r=t.c},function(t){c=t.g},function(t){h=t.e;l=t.u},function(t){p=t.s},function(t){f=t.l},function(t){y=t.d;m=t.e},function(t){d=t.l},null,null,null,null,null],execute:function(){var u=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}"};var b=t("zonos_card",/** @class */function(){function t(t){n(this,t);
|
|
2
2
|
/**
|
|
3
3
|
* The border radius of the card
|
|
4
4
|
* @default 6
|
|
@@ -26,8 +26,8 @@ s.sent();n=h.stripePaymentElement||this.stripeElements.create("payment",{default
|
|
|
26
26
|
// @Watch doesn't get trigger on initial load
|
|
27
27
|
void this.watchInitStripe()};t.prototype.render=function(){
|
|
28
28
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
29
|
-
return o(e,{key:"faf7791e4cbf6bf8c98fe0b2f368f408ef32b644",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"e6103d0e04f9905b90533bf94539aaae1d5aa604",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"b042060ff6fef2d7f20b20ec672b2696cb5f837c",class:"zonos--payment-component"}),o("div",{key:"b6a220513bb964a057c70141dcec89059dbbb0c8",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:[{watchIsPaymentInfoFilled:0}],stripeElements:[{watchInitStripe:0}],stripe:[{watchInitStripe:0}]}},enumerable:false,configurable:true});return t}());I.style=_();var j=function(){return".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}"};var
|
|
29
|
+
return o(e,{key:"faf7791e4cbf6bf8c98fe0b2f368f408ef32b644",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"e6103d0e04f9905b90533bf94539aaae1d5aa604",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"b042060ff6fef2d7f20b20ec672b2696cb5f837c",class:"zonos--payment-component"}),o("div",{key:"b6a220513bb964a057c70141dcec89059dbbb0c8",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:[{watchIsPaymentInfoFilled:0}],stripeElements:[{watchInitStripe:0}],stripe:[{watchInitStripe:0}]}},enumerable:false,configurable:true});return t}());I.style=_();var j=function(){return".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}"};var O=t("zonos_paypal_payment",/** @class */function(){function t(t){n(this,t);this.paypalSessionDone=a(this,"paypalSessionDone",7);this.paypalSessionFail=a(this,"paypalSessionFail",7);this.storeUnsubscribeList=[]}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){d("Paypal is not available");return[2/*return*/]}t=y({onPaypalFail:function(){d("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var n=t.orderId;d("onPaypalSessionDone","info",{orderId:n});o.paypalSessionDone.emit({orderId:n})}});if(!(t===null||t===void 0?void 0:t.length)){d("There are no paypal buttons available");return[2/*return*/]}n=this.el.querySelector(".zonos--payment-paypal-container");if(!n){d("Cannot find container element for paypal buttons");return[2/*return*/]}
|
|
30
30
|
// render paypal buttons
|
|
31
31
|
t.forEach((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4/*yield*/,t.render(n)];case 1:o.sent();return[2/*return*/]}}))}))}));return[2/*return*/]}))}))};t.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[m("paypal",this.loadPaypal.bind(this))]};t.prototype.componentDidLoad=function(){
|
|
32
32
|
// @Watch doesn't get trigger on initial load
|
|
33
|
-
void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return o(e,{key:"50cc936c450fb9afeaf488bfce6b15c2b1c29532",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"5a5f49d4486acb938d4dcffbbc41c15720201f0e",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());
|
|
33
|
+
void this.loadPaypal()};t.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(t){return t()}))};t.prototype.render=function(){return o(e,{key:"50cc936c450fb9afeaf488bfce6b15c2b1c29532",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"5a5f49d4486acb938d4dcffbbc41c15720201f0e",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());O.style=j()}}}));
|