@zonos/elements 1.3.289 → 1.3.291
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/{cart-WLQb2hbe.js → cart-B6Aty-21.js} +3 -3
- package/dist/cjs/{collect-B92uIdsY.js → collect-Oeo5tjN5.js} +3 -3
- package/dist/cjs/{debounce-5sZmmlCI.js → debounce-Cd2emZPn.js} +2 -2
- package/dist/cjs/{debounce-Nu2lJW4A.js → debounce-vY0QYT6o.js} +1 -1
- package/dist/cjs/{getBorderRadius-DGZiQu09.js → getBorderRadius-CyYZw4qq.js} +1 -1
- package/dist/cjs/{getMissingRequiredShippingFields-5w62gTIB.js → getMissingRequiredShippingFields-D03ICqss.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-hmV0Inld.js → hasInclusivePrice-CPCoVeU3.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-Bal1mqYR.js → invoice-Cj8W7NW0.js} +3 -3
- package/dist/cjs/{localization-C5HPlCNK.js → localization-BzNeXeDe.js} +25 -16
- package/dist/cjs/{paypal-o164C26_.js → paypal-CuKshRmZ.js} +4 -4
- package/dist/cjs/{placeTestOrder-C7tAipav.js → placeTestOrder-7czjwkjm.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-Bpx-vrTQ.js → renderCheckoutCurrency-BH8t2b2x.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-CtwkMt8b.js → shouldShowLanguageSelect-yAbtCmd8.js} +1 -1
- package/dist/cjs/{submitGtag-CcEL-w5D.js → submitGtag-D79e8u6s.js} +1 -1
- package/dist/cjs/{throttle-BcxGntLr.js → throttle-zSVRQLC0.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-Dltl5RBx.js → updateCheckoutSessionAttributes-jMtfOL2m.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +7 -7
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +14 -14
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +10 -10
- package/dist/cjs/zonos-collect.cjs.entry.js +7 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -5
- 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 +129 -51
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +10 -10
- package/dist/cjs/zonos-invoice.cjs.entry.js +7 -7
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-BCNYr6Tk.js → zonosStore-Bx9jK82G.js} +2 -0
- package/dist/collection/components/hello/zonos-hello/zonos-hello.css +17 -15
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +29 -52
- package/dist/collection/components/store/hello/localization.js +4 -1
- package/dist/collection/components/store/zonosStore.js +2 -0
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +20 -14
- package/dist/collection/components/utils/hello/resolveHelloFloatPlacement.js +98 -0
- package/dist/collection/types/generated/graphql.internal.types.js +176 -9
- package/dist/esm/{cart-BDc4RTBJ.js → cart-BoQp8Ema.js} +3 -3
- package/dist/esm/{collect-NRCK3t-M.js → collect-CdrR5OBy.js} +3 -3
- package/dist/esm/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +1 -1
- package/dist/esm/{debounce-DWPsxJsW.js → debounce-CrmpwbEE.js} +2 -2
- package/dist/esm/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm/{getMissingRequiredShippingFields-D-B-N1NH.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +1 -1
- package/dist/esm/{hasInclusivePrice-Bti4iudO.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-DsvQvu4a.js → invoice-S1KahJ_Z.js} +3 -3
- package/dist/esm/{localization-Bs6hVcKV.js → localization-BIh-4pc_.js} +25 -16
- package/dist/esm/{paypal-BqyEZS_u.js → paypal-DNfvnuUU.js} +4 -4
- package/dist/esm/{placeTestOrder-x3xwMAnW.js → placeTestOrder-CQaMKFOg.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-DIBdWKN1.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-Bb9sbQ41.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
- package/dist/esm/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +7 -7
- package/dist/esm/zonos-address-display_2.entry.js +3 -3
- package/dist/esm/zonos-address_4.entry.js +6 -6
- package/dist/esm/zonos-airwallex-payment.entry.js +5 -5
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +6 -6
- package/dist/esm/zonos-cart-items_12.entry.js +14 -14
- package/dist/esm/zonos-checkbox_2.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
- package/dist/esm/zonos-collect-finish_6.entry.js +10 -10
- package/dist/esm/zonos-collect.entry.js +7 -7
- package/dist/esm/zonos-controller.entry.js +5 -5
- 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 +129 -51
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +6 -6
- package/dist/esm/zonos-invoice-finish_5.entry.js +10 -10
- package/dist/esm/zonos-invoice.entry.js +7 -7
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +2 -0
- package/dist/esm-es5/{cart-BDc4RTBJ.js → cart-BoQp8Ema.js} +1 -1
- package/dist/esm-es5/{collect-NRCK3t-M.js → collect-CdrR5OBy.js} +1 -1
- package/dist/esm-es5/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +7 -7
- package/dist/esm-es5/debounce-CrmpwbEE.js +1 -0
- package/dist/esm-es5/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-D-B-N1NH.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +3 -3
- package/dist/esm-es5/{hasInclusivePrice-Bti4iudO.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
- package/dist/esm-es5/index.js +4 -4
- package/dist/esm-es5/{invoice-DsvQvu4a.js → invoice-S1KahJ_Z.js} +1 -1
- package/dist/esm-es5/{localization-Bs6hVcKV.js → localization-BIh-4pc_.js} +14 -4
- package/dist/esm-es5/{paypal-BqyEZS_u.js → paypal-DNfvnuUU.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-x3xwMAnW.js → placeTestOrder-CQaMKFOg.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-DIBdWKN1.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
- package/dist/esm-es5/{shouldShowLanguageSelect-Bb9sbQ41.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
- package/dist/esm-es5/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm-es5/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm-es5/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
- 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-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- 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 +1 -1
- 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 +21 -24
- package/dist/esm-es5/zonos-input.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-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +1 -1
- package/dist/scripts/index.d.ts +36 -6
- 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/hello/zonos-hello/zonos-hello.d.ts +5 -3
- package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +1 -1
- package/dist/types/components/utils/hello/resolveHelloFloatPlacement.d.ts +39 -0
- package/dist/types/components.d.ts +4 -6
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +10 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +239 -11
- package/dist/types/types/generated/graphql.internal.types.ts +302 -15
- package/dist/types/types/hello/HelloConfig.d.ts +12 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-d9527bd7.system.entry.js → p-04bded81.system.entry.js} +45 -45
- package/dist/zonos-elements/{p-18021e6b.entry.js → p-06fe2939.entry.js} +1 -1
- package/dist/zonos-elements/{p-058f07aa.system.entry.js → p-0a4a7742.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d261f27c.system.entry.js → p-0b81f8b9.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-c5f17bad.entry.js → p-0fca452b.entry.js} +1 -1
- package/dist/zonos-elements/{p-72b6a006.system.entry.js → p-11defdca.system.entry.js} +18 -18
- package/dist/zonos-elements/{p-1568ab06.system.entry.js → p-1409de3b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2466b5f0.system.entry.js → p-17c7ea4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8328f44d.entry.js → p-193d9722.entry.js} +1 -1
- package/dist/zonos-elements/{p-22fab1ba.system.entry.js → p-195f6e38.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc5306fe.system.entry.js → p-1bac5ac1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-128485dc.entry.js → p-1c150f26.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4713ff1.system.entry.js → p-23352709.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-cc949df1.system.entry.js → p-244e0302.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9a3bc27.system.entry.js → p-249c1ee1.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-7681798d.entry.js → p-24f3c547.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c08d36b.entry.js → p-2603dce0.entry.js} +1 -1
- package/dist/zonos-elements/{p-b78bab27.entry.js → p-34656e6c.entry.js} +1 -1
- package/dist/zonos-elements/{p-4625058a.entry.js → p-39ee1558.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8fd756a.system.entry.js → p-474e8a92.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ff26236.system.entry.js → p-4806b264.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-56159b7c.system.entry.js → p-5016d71b.system.entry.js} +58 -58
- package/dist/zonos-elements/{p-b96666ca.system.entry.js → p-51400242.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-e126e9bd.system.entry.js → p-5236c676.system.entry.js} +80 -80
- package/dist/zonos-elements/{p-cf53f67a.entry.js → p-550d4eea.entry.js} +1 -1
- package/dist/zonos-elements/{p-36559431.system.entry.js → p-552fbde1.system.entry.js} +21 -21
- package/dist/zonos-elements/{p-a6faab6a.entry.js → p-55916c90.entry.js} +1 -1
- package/dist/zonos-elements/{p-317d4665.system.entry.js → p-5b80aff2.system.entry.js} +15 -15
- package/dist/zonos-elements/p-69c3e367.system.entry.js +118 -0
- package/dist/zonos-elements/{p-3cc27e0e.system.entry.js → p-6abec43f.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-635341d6.entry.js → p-6c41b00c.entry.js} +1 -1
- package/dist/zonos-elements/{p-d451d5bc.system.entry.js → p-6db7c0b1.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-cc17a230.entry.js → p-6e296228.entry.js} +1 -1
- package/dist/zonos-elements/{p-beeb9d36.system.entry.js → p-756d303f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-B6X55m0b.js → p-7abqRc9V.js} +2 -2
- package/dist/zonos-elements/{p-3d536086.entry.js → p-82595838.entry.js} +1 -1
- package/dist/zonos-elements/{p-34d1545a.entry.js → p-83aa1c8c.entry.js} +1 -1
- package/dist/zonos-elements/{p-CaUXHglQ.system.js → p-8PPEbm_0.system.js} +9 -9
- package/dist/zonos-elements/{p-b6deae2b.system.entry.js → p-92fe9a1f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-5eb82be3.entry.js → p-938fc1e4.entry.js} +1 -1
- package/dist/zonos-elements/{p-CZl1nwqv.system.js → p-B4Ufchqh.system.js} +3 -3
- package/dist/zonos-elements/p-BGktDPwA.system.js +1 -0
- package/dist/zonos-elements/{p-D2fOB4Wn.system.js → p-Be3Hpms1.system.js} +1 -1
- package/dist/zonos-elements/{p-D0erXw7p.js → p-BpDCLBwW.js} +1 -1
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CPnR_T0a.system.js → p-BuU_p5DP.system.js} +58 -58
- package/dist/zonos-elements/{p-CaAod213.system.js → p-CBx5nYet.system.js} +1 -1
- package/dist/zonos-elements/{p-UM1aYZBV.system.js → p-CEK_Wk6v.system.js} +1 -1
- package/dist/zonos-elements/p-CFbfEmjN.js +1 -0
- package/dist/zonos-elements/{p-nU86HJ5w.js → p-CUaf1cEg.js} +1 -1
- package/dist/zonos-elements/p-C_z9WL8a.js +1 -0
- package/dist/zonos-elements/p-CcJF6xhQ.js +1 -0
- package/dist/zonos-elements/p-Cxuiqv1I.js +1 -0
- package/dist/zonos-elements/p-D-bZg-Pc.js +1 -0
- package/dist/zonos-elements/{p-CH6tsv9B.system.js → p-D4MevhAL.system.js} +3 -3
- package/dist/zonos-elements/{p-BybDGrH4.system.js → p-DI2vXnXc.system.js} +3 -3
- package/dist/zonos-elements/{p-CQyFoOXW.system.js → p-DNc279vN.system.js} +13 -13
- package/dist/zonos-elements/{p-Cd9xIgx7.system.js → p-DOD2I44l.system.js} +92 -82
- package/dist/zonos-elements/p-DQZncB2d.system.js +9 -0
- package/dist/zonos-elements/{p-NL_Eiq6m.system.js → p-DS-qw_qc.system.js} +15 -15
- package/dist/zonos-elements/p-DZ2mevDK.js +1 -0
- package/dist/zonos-elements/{p-uV7m6KrY.system.js → p-DoEHepOc.system.js} +1 -1
- package/dist/zonos-elements/{p-D4WI0B6-.system.js → p-DuufSrhH.system.js} +4 -4
- package/dist/zonos-elements/{p-MHVIIOVE.js → p-DzLNk-Pf.js} +1 -1
- package/dist/zonos-elements/{p-DqEtY53c.js → p-FRWZayxL.js} +1 -1
- package/dist/zonos-elements/p-Mrz_lnC1.js +1 -0
- package/dist/zonos-elements/{p-CtEsvWI6.js → p-W82paT5F.js} +1 -1
- package/dist/zonos-elements/{p-CVQ7-7E2.system.js → p-XDxdMlQl.system.js} +22 -22
- package/dist/zonos-elements/{p-CuhGrJBA.system.js → p-XqkqjeNV.system.js} +1 -1
- package/dist/zonos-elements/{p-8cac7911.system.entry.js → p-a40fd99b.system.entry.js} +12 -12
- package/dist/zonos-elements/{p-b68ca96f.entry.js → p-a938c174.entry.js} +1 -1
- package/dist/zonos-elements/{p-9ebe9a36.entry.js → p-acd50b0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-fcfac62f.system.entry.js → p-b2dd7f02.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f603278.system.entry.js → p-b5882fbb.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-e582ae2a.entry.js → p-b79036fc.entry.js} +1 -1
- package/dist/zonos-elements/{p-6c6c65f0.entry.js → p-bb3546c0.entry.js} +1 -1
- package/dist/zonos-elements/{p-02628b9f.entry.js → p-c1cbfdba.entry.js} +1 -1
- package/dist/zonos-elements/{p-b88e521e.system.entry.js → p-c3646ae6.system.entry.js} +19 -19
- package/dist/zonos-elements/{p-be64d823.system.entry.js → p-c403f004.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c090cc60.entry.js → p-c47ce656.entry.js} +1 -1
- package/dist/zonos-elements/{p-68e0180a.entry.js → p-c5bab786.entry.js} +1 -1
- package/dist/zonos-elements/{p-628a0f7f.entry.js → p-c961caaf.entry.js} +1 -1
- package/dist/zonos-elements/p-c9QtIdJX.js +1 -0
- package/dist/zonos-elements/{p-CGkdA4pY.js → p-clDfq9AL.js} +1 -1
- package/dist/zonos-elements/p-d168023b.entry.js +1 -0
- package/dist/zonos-elements/{p-3e59d41c.entry.js → p-d3d0656a.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b6482ef.entry.js → p-d4d2b39e.entry.js} +1 -1
- package/dist/zonos-elements/p-d74bc3e8.entry.js +1 -0
- package/dist/zonos-elements/p-db87b0dd.entry.js +1 -0
- package/dist/zonos-elements/{p-f44631d5.entry.js → p-dea26048.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e074243.entry.js → p-defc2d18.entry.js} +1 -1
- package/dist/zonos-elements/{p-bdba7d9e.system.entry.js → p-dfc87b10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-03fbe813.system.entry.js → p-e005b6a5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-02ff6f8b.system.entry.js → p-e0e9cff5.system.entry.js} +42 -42
- package/dist/zonos-elements/p-f8b50aa0.entry.js +1 -0
- package/dist/zonos-elements/{p-ClUEwqZW.system.js → p-kaOxUR9u.system.js} +6 -6
- package/dist/zonos-elements/p-rVp8hgWw.js +1 -0
- package/dist/zonos-elements/{p-i1iCWKdv.js → p-sz4L-ZnB.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/debounce-DWPsxJsW.js +0 -1
- package/dist/zonos-elements/p-037d3688.entry.js +0 -1
- package/dist/zonos-elements/p-0466650f.entry.js +0 -1
- package/dist/zonos-elements/p-163b81c0.system.entry.js +0 -121
- package/dist/zonos-elements/p-3ERbuo5a.js +0 -1
- package/dist/zonos-elements/p-97f848f6.entry.js +0 -1
- package/dist/zonos-elements/p-9H2p9XKE.js +0 -1
- package/dist/zonos-elements/p-BANhKkF2.system.js +0 -1
- package/dist/zonos-elements/p-BJufDgh3.js +0 -1
- package/dist/zonos-elements/p-BSgVcCxT.system.js +0 -9
- package/dist/zonos-elements/p-CpvnCfKt.js +0 -1
- package/dist/zonos-elements/p-CtKp6AQ4.js +0 -1
- package/dist/zonos-elements/p-DdpeA8cH.js +0 -1
- package/dist/zonos-elements/p-DkirvyAh.js +0 -1
- package/dist/zonos-elements/p-a6354d15.entry.js +0 -1
- package/dist/zonos-elements/p-opB7B9YB.js +0 -1
- package/dist/zonos-elements/p-t_ClFAJR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=s(0),u["throw"]=s(1),u["return"]=s(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=s(0),u["throw"]=s(1),u["return"]=s(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-DS-qw_qc.system.js","./p-DOD2I44l.system.js","./p-BuU_p5DP.system.js","./p-CKhl__Kc.system.js","./p-zVLAvre1.system.js","./p-BbgqQIHv.system.js","./p-DoEHepOc.system.js","./p-DW-fW8yR.system.js","./p-DQZncB2d.system.js","./p-Cby4EkFu.system.js"],(function(t){"use strict";var n,e,i,o,r,u,s,c,a,f,l,d,h,v,w,p,m,g,_,y;return{setters:[function(t){n=t.r;e=t.d;i=t.h;o=t.a},function(t){r=t.b},function(t){u=t.m;s=t.n;c=t.o;a=t.s;f=t.d},function(t){l=t.z;d=t.a;h=t.b},function(t){v=t.g;w=t.i;p=t.a},function(t){m=t.h;g=t.l},function(t){_=t.l},function(t){y=t.e},null,null,null],execute:function(){var b=this;var S=function(){return __awaiter(b,void 0,void 0,(function(){var t,n,e,i,o,r,s;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){_("Reusing cached zonos settings");return[2/*return*/,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=v();n=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){n.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}e=u();if(e){n.set("zCountry",e)}return[4/*yield*/,m("/api/zonos-elements/zonos-settings?".concat(n.toString()))];case 1:i=c.sent(),o=i.errors,r=i.json,s=i.zonosMode;if(o.length){g("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2/*return*/,{errors:o,json:null,zonosMode:s}]}return[2/*return*/,{errors:[],json:r,zonosMode:s}]}}))}))};var z=function(){
|
|
2
2
|
// append checkout component if doesn't exist
|
|
3
3
|
var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var j=function(t){
|
|
4
4
|
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
@@ -6,11 +6,11 @@ if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!
|
|
|
6
6
|
// do nothing if checkout button anchor is not set
|
|
7
7
|
return}
|
|
8
8
|
// check if checkout button anchor selector user pass in is valid
|
|
9
|
-
if(t.placeOrderButtonSelector&&!s(t.placeOrderButtonSelector)){g('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!s(t.alwaysTriggerInternationalCheckoutSelector)){g('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}z()};var
|
|
9
|
+
if(t.placeOrderButtonSelector&&!s(t.placeOrderButtonSelector)){g('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!s(t.alwaysTriggerInternationalCheckoutSelector)){g('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}z()};var O=function(){
|
|
10
10
|
// append checkout component if doesn't exist
|
|
11
|
-
var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var
|
|
11
|
+
var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var I=function(){
|
|
12
12
|
// allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
|
|
13
|
-
if(!window.Zonos.cartData){return}
|
|
13
|
+
if(!window.Zonos.cartData){return}O()};var k=function(){
|
|
14
14
|
// append checkout component if doesn't exist
|
|
15
15
|
var t=document.querySelector("zonos-invoice");if(!t){var n=document.createElement("zonos-invoice");document.body.appendChild(n)}};var C=function(){
|
|
16
16
|
// allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
|
|
@@ -23,12 +23,12 @@ if(!window.Zonos.cartData){return}k()};var A="zonos-domestic-element-hide-style"
|
|
|
23
23
|
* When not supported, we distribute the prefix across each top-level
|
|
24
24
|
* comma-separated piece instead — so the rule still applies in that
|
|
25
25
|
* environment.
|
|
26
|
-
*/var
|
|
26
|
+
*/var E=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();
|
|
27
27
|
/**
|
|
28
28
|
* Split a CSS selector string on top-level commas. Commas inside parentheses
|
|
29
29
|
* (`:not(.a, .b)`, `:nth-child(2n+1)`) or attribute brackets
|
|
30
30
|
* (`[data-foo=","]`) are preserved as part of the piece.
|
|
31
|
-
*/var
|
|
31
|
+
*/var T=function(t){var n=[];var e=0;var i=0;var o="";for(var r=0;r<t.length;r++){var u=t[r];if(u==="("){e++}else if(u===")"){e--}else if(u==="["){i++}else if(u==="]"){i--}if(u===","&&e===0&&i===0){var s=o.trim();if(s){n.push(s)}o=""}else{o+=u}}var c=o.trim();if(c){n.push(c)}return n};
|
|
32
32
|
/**
|
|
33
33
|
* Build the fully-scoped selector that will land in the injected `<style>`
|
|
34
34
|
* tag. Exported so tests can exercise both branches of the `:is()`-support
|
|
@@ -38,7 +38,7 @@ if(!window.Zonos.cartData){return}k()};var A="zonos-domestic-element-hide-style"
|
|
|
38
38
|
// top-level comma-separated piece. Parentheses/brackets are respected,
|
|
39
39
|
// so pseudo-classes that take selector lists (`:not(.a, .b)`) and
|
|
40
40
|
// attribute selectors that contain commas stay intact.
|
|
41
|
-
return
|
|
41
|
+
return T(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};
|
|
42
42
|
/**
|
|
43
43
|
* Inject a `<style>` tag that hides storefront elements matching the
|
|
44
44
|
* merchant-configured `checkoutSettings.domesticElementSelector`, scoped to
|
|
@@ -46,45 +46,45 @@ return E(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};
|
|
|
46
46
|
* shipping zone (Hello sets the body class). The exact selector we emit is
|
|
47
47
|
* also the selector we validate — see [[buildDomesticHideSelector]] for the
|
|
48
48
|
* `:is()`-support branching.
|
|
49
|
-
*/var
|
|
49
|
+
*/var L=function(t){if(typeof document==="undefined"||!t){return}var n=P({merchantSelector:t,supportsIs:E});
|
|
50
50
|
// The browser's own parser is the source of truth — `document.querySelector`
|
|
51
51
|
// throws `DOMException(SyntaxError)` for syntactically invalid selectors.
|
|
52
52
|
// Validating the exact string we're about to emit catches both malformed
|
|
53
53
|
// input and payloads that close `:is(` early to escape the wrapper.
|
|
54
54
|
try{document.querySelector(n)}catch(e){_('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(n,'")'),"warn");return}
|
|
55
55
|
// Already injected — settings can re-emit on hot reload during dev.
|
|
56
|
-
if(document.getElementById(A)){return}var e=document.createElement("style");e.id=A;e.textContent="".concat(n," { display: none !important; }");(document.head||document.body).appendChild(e);_("Zonos domestic element hide style injected")};var
|
|
56
|
+
if(document.getElementById(A)){return}var e=document.createElement("style");e.id=A;e.textContent="".concat(n," { display: none !important; }");(document.head||document.body).appendChild(e);_("Zonos domestic element hide style injected")};var x=function(t){var n=document.querySelector(t);
|
|
57
57
|
// append checkout component if doesn't exist
|
|
58
|
-
var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var
|
|
58
|
+
var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var D=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};
|
|
59
59
|
/**
|
|
60
60
|
* Injects the hello mobile wrapper to the DOM and returns the anchor element selector
|
|
61
61
|
* @returns anchor element selector
|
|
62
|
-
*/var
|
|
62
|
+
*/var F=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return i};var B=function(t){return __awaiter(b,void 0,void 0,(function(){var n,e,i,o,r;return __generator(this,(function(u){if(window.Zonos.isLegacyCheckout){_("Hello is disabled when isLegacyCheckout","info");return[2/*return*/]}n=t.anchorElementSelector;e=n;
|
|
63
63
|
/**
|
|
64
64
|
* Use default mobile anchor only if desktopLocation is provided and no anchorElementSelector is provided
|
|
65
65
|
* So for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
66
|
-
**/if(!t.anchorElementSelector&&t.desktopLocation){i=
|
|
66
|
+
**/if(!t.anchorElementSelector&&t.desktopLocation){i=F({position:"bottom-right"});e=i}
|
|
67
67
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
68
|
-
if(!e||!s(e)){g('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2/*return*/]}_("Hello init complete");o=
|
|
68
|
+
if(!e||!s(e)){g('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2/*return*/]}_("Hello init complete");o=x(e);
|
|
69
69
|
// keep watching for the anchor element to be added to the DOM, then inject hello component
|
|
70
|
-
if(!o){r=new MutationObserver((function(){var t=
|
|
70
|
+
if(!o){r=new MutationObserver((function(){var t=x(e);if(t){
|
|
71
71
|
// disconnect observer if hello is successfully injected
|
|
72
72
|
r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){
|
|
73
73
|
// inject hello to mobile anchor if hello is still not found
|
|
74
|
-
|
|
74
|
+
x(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){_("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=F({position:D(t.notFoundElementFallback)});x(n)}}),3e3)}return[2/*return*/]}))}))};
|
|
75
75
|
/**
|
|
76
76
|
* Base class for iframe communication
|
|
77
|
-
*/var
|
|
77
|
+
*/var G=/** @class */function(){function t(t,n){var e=this;this.targetId=t;this.allowedEvents=n;this.listeners=new Map;this.handleMessage=function(t){var n,i,o;var r=t.data;var u=((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||((o=(i=e.iframe)===null||i===void 0?void 0:i.contentDocument)===null||o===void 0?void 0:o.defaultView);
|
|
78
78
|
// check if the message is from the same src
|
|
79
79
|
if(t.source!==u){return}if(!e.isValidMessage(r)){return}var s=e.listeners.get(r.type);s===null||s===void 0?void 0:s.forEach((function(t){try{t(r.payload)}catch(t){g("Error in event listener:",t)}}))};this.initializeEventListeners();
|
|
80
80
|
// get the iframe element
|
|
81
81
|
this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}_("[CheckoutAddressService] listening to ".concat(t),"info");var i=n;var o=this.listeners.get(t);if(o){o.add(i)}return function(){var n=e.listeners.get(t);if(n){n.delete(i)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();
|
|
82
82
|
/**
|
|
83
83
|
* Service for communicating with the Google Places iframe
|
|
84
|
-
*/var
|
|
84
|
+
*/var H=/** @class */function(t){__extends(n,t);function n(){_("=== [Google Places Service] Initializing","info");return t.call(this,w.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}n.prototype.sendMessage=function(t,n){var e;if(!((e=this.iframe)===null||e===void 0?void 0:e.contentWindow)){return}var i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:n,type:t};_("GooglePlacesService] parent --\x3e ".concat(t),"info",n);this.iframe.contentWindow.postMessage(i,"*")};n.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};n.prototype.fetchSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!n){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[n],input:e},type:i})};n.prototype.selectPlace=function(t){var n=t.placeId,e=t.type;this.sendMessage("placeSelected",{placeId:n,type:e})};return n}(G);
|
|
85
85
|
/**
|
|
86
86
|
* Checkout service for managing address selection and validation
|
|
87
|
-
*/var
|
|
87
|
+
*/var R=/** @class */function(){function t(){var t=this;this.googlePlaceInitialized=false;_("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new H;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};
|
|
88
88
|
/**
|
|
89
89
|
* Set up event listeners for address suggestions
|
|
90
90
|
*/t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};
|
|
@@ -96,13 +96,13 @@ this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventLi
|
|
|
96
96
|
*/t.prototype.getAddressSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:n,query:e,type:i})};
|
|
97
97
|
/**
|
|
98
98
|
* Select an address from suggestions
|
|
99
|
-
*/t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var M=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{visibility:hidden;opacity:0;height:0}"};var
|
|
99
|
+
*/t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var M=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{visibility:hidden;opacity:0;height:0}"};var U=t("zonos_controller",/** @class */function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7)}
|
|
100
100
|
/**
|
|
101
101
|
* Method to initialize checkout element
|
|
102
|
-
*/t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2/*return*/]}r.stripe=t;void j(
|
|
102
|
+
*/t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2/*return*/]}r.stripe=t;void j(l.checkoutSettings);_("init checkout element");return[2/*return*/]}))}))};
|
|
103
103
|
/**
|
|
104
104
|
* Method to initialize Collect element
|
|
105
|
-
*/t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2/*return*/]}r.stripe=t;void
|
|
105
|
+
*/t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2/*return*/]}r.stripe=t;void I();_("init Collect element");return[2/*return*/]}))}))};
|
|
106
106
|
/**
|
|
107
107
|
* Method to initialize Collect element
|
|
108
108
|
*/t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Invoice element","warn");return[2/*return*/]}r.stripe=t;void C();_("init Invoice element");return[2/*return*/]}))}))};
|
|
@@ -111,15 +111,15 @@ this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventLi
|
|
|
111
111
|
*/t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};
|
|
112
112
|
/**
|
|
113
113
|
* Setup google font
|
|
114
|
-
*/t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||
|
|
114
|
+
*/t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||d();if(i==="Inter"){if(!t){
|
|
115
115
|
// Do nothing if font is Inter, since we already inject it on start
|
|
116
|
-
return[2/*return*/]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");
|
|
116
|
+
return[2/*return*/]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4/*yield*/,m("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:r=a.sent(),u=r.errors,s=r.json;
|
|
117
117
|
// Keep using Inter font, font in the setting maybe outdated and not found in google font, API will return Inter font instead
|
|
118
|
-
if(u.length>0){_("Failed to load font ".concat(i),"warn");
|
|
118
|
+
if(u.length>0){_("Failed to load font ".concat(i),"warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"});return[2/*return*/]}c=s===null||s===void 0?void 0:s.fontUrl;if(c){(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,c)}if(!t){return[2/*return*/]}
|
|
119
119
|
// apply override font
|
|
120
|
-
_("[FONT] ".concat(t," font override applied"));
|
|
120
|
+
_("[FONT] ".concat(t," font override applied"));l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t});return[2/*return*/]}}))}))};t.prototype.handleLocationChange=function(){
|
|
121
121
|
// re-inject hello component if the location changes
|
|
122
|
-
void B(
|
|
122
|
+
void B(l.helloSettings)};
|
|
123
123
|
/**
|
|
124
124
|
* Init history listener to know when the location changes to re-inject hello component
|
|
125
125
|
*/t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}
|
|
@@ -128,9 +128,9 @@ if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoic
|
|
|
128
128
|
// Custom HTML may set window.Zonos.googleAnalyticId / window.Zonos.facebookPixelId; trigger relay ping so parent configures GA / FB Pixel
|
|
129
129
|
y()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t===null||t===void 0?void 0:t.genericSettings;if(!n){return[2/*return*/]}e=n.signedTokenGooglePlaces;if(!e){return[2/*return*/]}
|
|
130
130
|
// Create private iframe to load google places api
|
|
131
|
-
|
|
131
|
+
p({id:w.GOOGLE_PLACES,onload:function(){
|
|
132
132
|
// init checkout address service
|
|
133
|
-
|
|
133
|
+
l.checkoutAddressService=new R},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(e)});return[2/*return*/]}))}))};t.prototype.buildBaseConfig=function(t){var n,e;var i=Object.assign(Object.assign({},this.config.checkoutSettings),{
|
|
134
134
|
// Don't allow to override settlement currencies setting. This setting is only configured by Zonos
|
|
135
135
|
allowedSettlementCurrencies:undefined,
|
|
136
136
|
// Don't allow to override capture delay setting. This setting is only configured by Zonos
|
|
@@ -145,36 +145,36 @@ checkoutSettings:undefined})}
|
|
|
145
145
|
var o=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((n=this.config.checkoutSettings)===null||n===void 0?void 0:n.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{
|
|
146
146
|
// Set success redirect url to store url if it's legacy checkout.
|
|
147
147
|
// when success behavior is CLOSE_MODAL, use the default success behavior and update the keep shopping button link to their store, because just redirect user without confirmation page would confuse them
|
|
148
|
-
successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();
|
|
148
|
+
successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();l.zonosApiKey=this.zonosApiKey;
|
|
149
149
|
// running with scope async function to avoid blocking the main thread
|
|
150
|
-
(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,u,s,a,f,
|
|
150
|
+
(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,u,s,a,f,d,v,w,p,m,g,y,b;var z=this;return __generator(this,(function(j){switch(j.label){case 0:return[4/*yield*/,S()];case 1:u=j.sent(),s=u.errors,a=u.json,f=u.zonosMode;if(((n=(t=s[0])===null||t===void 0?void 0:t.type)===null||n===void 0?void 0:n.toString())==="403"){_("Failed to load zonos settings. This domain may not have access","warn");return[2/*return*/]}d=((e=a===null||a===void 0?void 0:a.checkoutSettings)===null||e===void 0?void 0:e.customHTML)||"";this.injectCustomHTML(d);
|
|
151
151
|
// init zonos notification
|
|
152
152
|
this.initZonosNotification();v=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){
|
|
153
153
|
// Try to use new settings first for legacy stores
|
|
154
154
|
return((t=a===null||a===void 0?void 0:a.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=z.config.appearance)===null||n===void 0?void 0:n.logoUrl)}
|
|
155
155
|
// Otherwise respect override
|
|
156
|
-
return(e=z.config.appearance)===null||e===void 0?void 0:e.logoUrl};w=this.buildBaseConfig(a);
|
|
156
|
+
return(e=z.config.appearance)===null||e===void 0?void 0:e.logoUrl};w=this.buildBaseConfig(a);p=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:v()})}),w);
|
|
157
157
|
// load default setting if failed to load user settings
|
|
158
|
-
h({overrideSettings:
|
|
158
|
+
h({overrideSettings:p,zonosSettings:a});l.zonosMode=f;
|
|
159
159
|
// Inject the merchant's domestic-element hide style now that
|
|
160
160
|
// checkoutSettings have been merged into the store.
|
|
161
|
-
|
|
161
|
+
L(l.checkoutSettings.domesticElementSelector);
|
|
162
162
|
// setup google font after store loaded
|
|
163
|
-
void this.setupGoogleFont();if(
|
|
163
|
+
void this.setupGoogleFont();if(l.helloSettings.visibilityStatus==="DISABLED"){
|
|
164
164
|
// Store owner disabled this intentionally
|
|
165
|
-
_("=== Hello is disabled by store owner ===","warn")}if(
|
|
165
|
+
_("=== Hello is disabled by store owner ===","warn")}if(l.helloSettings&&l.helloSettings.visibilityStatus==="ENABLED"){_("Initializing hello");void B(l.helloSettings)}
|
|
166
166
|
// init localization store
|
|
167
167
|
return[4/*yield*/,c()];case 2:
|
|
168
168
|
// init localization store
|
|
169
|
-
j.sent();
|
|
169
|
+
j.sent();m=((i=a===null||a===void 0?void 0:a.checkoutSettings)===null||i===void 0?void 0:i.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!m||!this.stripeInitEvent){_("Checkout failed to load -- missing publishable key","warn");return[2/*return*/]}if(window.Zonos.isCollect||window.Zonos.isInvoice){
|
|
170
170
|
// send publishable key out to load stripe
|
|
171
|
-
this.stripeInitEvent.emit({publishableKey:
|
|
171
|
+
this.stripeInitEvent.emit({publishableKey:m.token});
|
|
172
172
|
// init google places service
|
|
173
|
-
void this.initGooglePlacesService(a);return[2/*return*/]}if(
|
|
173
|
+
void this.initGooglePlacesService(a);return[2/*return*/]}if(l.checkoutSettings.subscriptionStatus==="INACTIVE"){_('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");_("zonos controller loaded");return[2/*return*/]}if(l.checkoutSettings.visibilityStatus==="DISABLED"){_("=== Checkout is disabled by store owner ===","warn");_("zonos controller loaded");return[2/*return*/]}g=
|
|
174
174
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- gating Stripe load also honors the legacy callback
|
|
175
|
-
typeof((o=
|
|
175
|
+
typeof((o=l.checkoutSettings)===null||o===void 0?void 0:o.buildCartDetail)==="function"||typeof((r=l.checkoutSettings)===null||r===void 0?void 0:r.createCartId)==="function";y=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");b=!!(window.Zonos.cartId&&window.Zonos.cartData)||!!y;if(!g&&!b){_("Skip loading Stripe because no cart callback (buildCartDetail/createCartId), prefetched cart, or payment client secret is present","warn");return[2/*return*/]}
|
|
176
176
|
// send publishable key out to load stripe
|
|
177
|
-
this.stripeInitEvent.emit({publishableKey:
|
|
177
|
+
this.stripeInitEvent.emit({publishableKey:m.token});
|
|
178
178
|
// init google places service
|
|
179
179
|
void this.initGooglePlacesService(a);return[2/*return*/]}}))}))})();return[2/*return*/]}))}))};
|
|
180
180
|
/**
|
|
@@ -192,7 +192,7 @@ void this.initGooglePlacesService(a);return[2/*return*/]}}))}))})();return[2/*re
|
|
|
192
192
|
*/t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){_("Override country code to ".concat(t));void f({isInitializing:false,newSelectedCountryCode:t});return[2/*return*/]}))}))};
|
|
193
193
|
/**
|
|
194
194
|
* Get appearance from setting
|
|
195
|
-
*/t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2/*return*/,
|
|
195
|
+
*/t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2/*return*/,l.appearance]}))}))};
|
|
196
196
|
/**
|
|
197
197
|
* Update the organizationName
|
|
198
|
-
*/t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){
|
|
198
|
+
*/t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l.organizationName=t;return[2/*return*/]}))}))};t.prototype.render=function(){return i(o,{key:"1714865012d806892f03e03896ee2f04aa1a729d",class:"zonos--elements"})};return t}());U.style=M()}}}));
|
|
@@ -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 c,i as r,c as a,g as d,d as l,e as u,f as h,p as m,h as p,j as g,k as f,l as w,m as z,n as k,o as v,t as y,q as C,r 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 E,E as D,F as P,G as U,H as j,I as N,J as R,K as $}from"./p-FRWZayxL.js";import{p as F,s as M,a as H,b as Z}from"./p-7abqRc9V.js";import{f as K,a as V,b as W,i as Q,l as G,c as q,d as Y,g as J,s as X,V as oo,e as eo,t as to,h as so,j as no}from"./p-clDfq9AL.js";import{z as io,g as co,m as ro}from"./p-W82paT5F.js";import{b as ao}from"./p-BycjkdlE.js";import{h as lo,g as uo,j as ho,l as mo,b as po,s as go,a as fo,i as wo}from"./p-DE4a-QD5.js";import{u as zo}from"./p-CUaf1cEg.js";import{l as ko,g as vo,b as yo}from"./p-BJmZPrZl.js";import{_ as Co,c as bo,d as So,a as xo,g as Io}from"./p-D5SpFsQJ.js";import{c as To}from"./p-BJHSB96f.js";import{c as Ao}from"./p-XQfWgQLB.js";import{g as Oo}from"./p-C_z9WL8a.js";import{i as Bo}from"./p-YdrG78th.js";import{s as Lo}from"./p-BTIeCf3T.js";import{R as _o}from"./p-C2QMVeWW.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";import"./p-Cxuiqv1I.js";import"./p-BpDCLBwW.js";const Eo="isInternationalCheckout",Do=({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),uo()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(Eo,"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),uo()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Po=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"),uo()&&e.searchParams.set("zonosTestMode","1"),e.toString()},Uo={customerGroupId:null,shouldBypass:!1};let jo=null;const No=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Uo};const i=null===(e=io.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return io.loadedConfig?{conclusive:!0,result:Uo}:{conclusive:!1,result:Uo};const c=o?o.checkoutId:await V();if(!c)return ko("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Uo};const r=o?o.checkout:await W(c);if(!r)return ko("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Uo};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return ko("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Uo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return ko(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||jo!==t||(jo=null),e)));return jo=t,t},Ro=async(o={})=>o.forceRefresh||!jo?No(o.preFetched):jo,$o={guestCheckoutType:null},Fo="zonos--bc-checkout-settings",Mo={redirectUrl:null,shouldForceLogin:!1};let Ho=null;const Zo=()=>{if(!Ho){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return $o;const e=null===(o=io.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return ko("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),$o;const t=(o=>{try{const e=window.localStorage.getItem(Fo);if(!e)return null;const t=ho(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 lo("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return ko("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),$o;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(Fo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:(Ho===o&&(Ho=null),!1))).catch((()=>(Ho===o&&(Ho=null),!1)));Ho=o}return Ho},Ko=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Mo;if(!await Zo())return Mo;const e=o?o.checkoutId:await V();if(!e)return Mo;const t=o?o.checkout:await W(e);return t?Q(t)?Mo:(ko("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:Do(),shouldForceLogin:!0}):(ko("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Mo)},Vo="data-zonos-login-from-rewritten",Wo='a[href*="login.php?action=create_account"]:not(['+Vo+"])",Qo=()=>{const o=document.querySelectorAll(Wo);if(!o.length)return;const e=Do({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Vo,"true")}))},Go=(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||""}},qo=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),Yo=(o=!0,e)=>{if(!G.localizationLoaded)return!1;if(e){const t=q(e);return o&&!t&&ko(`Checkout: ${e} is not a shippable country: ${t}`),t}return!!G.isShippableCountry||(o&&ko("Checkout: not shippable country"),!1)},Jo='select[name="shippingAddress.countryCode"]',Xo=({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const c=async o=>{var t;const s=document.querySelector((null===(t=io.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||Jo),n=(null==s?void 0:s.value)||o;if(!n)return"noAction";if(!Yo(!1,n))return"noAction";const c=await V(),r={checkout:c?await W(c):null,checkoutId:c},{shouldBypass:a}=await Ro({forceRefresh:!0,preFetched:r});if(a)return ko("Bypass customer group detected on BC checkout, stopping interval","info"),"bypass";const d=await Ko({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,"redirected";e&&await e(),Y({isInitializing:!1,newSelectedCountryCode:n,persistOverride:!1});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({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=Po("/"),"redirected"};let r=!1,a=!1;let d=!1,l=!1,u=!1,h=!1,m=!1;const p=new MutationObserver((async()=>{var g;const f=document.querySelector(o),w=n();if(!f&&w){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(w),void p.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void p.disconnect();if(!h&&!u){u=!0,m=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await V();if(!m)return"noAction";const p=await W(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Ro({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 z=w.countryCode;if(!Yo(!1,z))return"noAction";if(ko(e?`Logged-in user has international shipping address: ${z}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${z}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return ko("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const k=await Ko({preFetched:g});return k.shouldForceLogin&&k.redirectUrl?(window.location.href=k.redirectUrl,"redirected"):(o&&await o(),Y({isInitializing:!1,newSelectedCountryCode:z,persistOverride:!1}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:z,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",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=Po("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void p.disconnect();"optedOut"===o&&(h=!0,(o=>{a||(a=!0,document.addEventListener("click",(e=>{if(r)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 V();if(n){const s=await W(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=io.genericSettings)||void 0===s?void 0:s.bigcommerceDomesticCheckoutCountrySelector)||Jo);return(null==i?void 0:i.value)||null})()}catch(o){mo("Error resolving selected shipping country on BC continue",o)}o&&Yo(!1,o)&&e.disconnect(),"redirected"===(o?await c(o):"noAction")&&(t=!1)}catch(o){mo("Error handling BC continue international redirect",o)}t&&(r=!0,o.click(),r=!1)})(s,o))}),!0))})(p))}catch(o){mo("Error checking logged-in user shipping address",o)}finally{u=!1,m=!1}}const z=document.querySelector((null===(g=io.genericSettings)||void 0===g?void 0:g.bigcommerceDomesticCheckoutCountrySelector)||Jo);if(!z)return;if(ko("Domestic checkout found - Listening for shipping country change","info",{value:z.value}),l)return;l=!0,p.disconnect();const k=setInterval((async()=>{if(!d&&!m){d=!0;try{const o=await c();if("redirected"===o||"bypass"===o)return void clearInterval(k);d=!1}catch(o){d=!1}}}),1e3),v=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(v);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(v),e.on("change",(o=>{const e=o.value.address.country;e&&!m&&c(e)})))}),500)}));p.observe(document.body,{childList:!0,subtree:!0})};let oe=0;const ee=o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},te=async({cartId:o,retries:e})=>{const t=uo(),{errors:s,json:n}=await lo("/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?(ko("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),te({cartId:o,retries:e-1})):i?null:n};var se='<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 ne=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=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||io.appearance.theme;await r({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:F()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${bo}`),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 ko("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(ko("Payment intent exist, checking stripe payment intent status"),!n)return ko("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(ko(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,X.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(ko("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(ko("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedOrderModificationSession=async o=>{X.checkoutSessionId=o;const{errors:e,json:t}=await d();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 a({clientSecret:s.clientSecret});if("processing"===o||"succeeded"===o)return c.clientSecret=s.clientSecret,this.setToFinishStep(o),!0}return!1},this.initializeTestKeys=()=>{var o;X.enabledVariantTestKeys=(null==(o=X.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=io.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return eo(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof io.checkoutSettings.createCartId&&!!io.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;ko("[TEST] - Registering hosted vs native test");const o=ee("hosted_vs_native");if(o)return void ko(`[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 lo("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:K(t)})({testKeys:["hosted_vs_native"]});if(!e)return void ko("[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()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:X.enabledVariantTestKeys||[],mergeTestObj:e});eo(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=ee("hosted_vs_native");if(ko(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof io.checkoutSettings.createCartId)return ko("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return ko("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=io.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return ko("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};ko('"createCartId" is provided, start building cart');const t=await io.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);ko("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=J(o)||G.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),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:X.checkoutSessionId||void 0,hostedCheckoutUrl:io.genericSettings.hostedCheckoutUrl,isTestMode:uo(),isVariantTest:!0},i),n));return ko(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(l.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=l.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 V();if(!o)return;const e=await W(o);if(!Q(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:c,selectedCountryCode:r}=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=Go(o,a);if(!e)continue;if(!c(e.address.country))continue;const t=qo(e);u.has(t)||(u.add(t),h.push(e))}return r?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===r;return t===(e.option.address.country===r)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>Yo(!1,o),selectedCountryCode:G.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,ko(`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=io.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||(X.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&&(X.checkoutSessionId=e);const t=X.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(ee("hosted_vs_native")?eo(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+oo,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),eo(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){u({adjustments:l.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,M({event:"zonos-checkout-close",metadata:{checkoutSessionId:X.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==l.step||h(),this.preview||m(),l.step="customer-info",p(),g(),null===(t=(e=io.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){var o;if("function"==typeof io.checkoutSettings.createCartId){ko('"createCartId" is provided, start building cart'),l.customMessage=[];const o=await io.checkoutSettings.createCartId();let e;"object"==typeof o?(ko("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),l.customerAuthenticationToken=o.customerAuthenticationToken||null,l.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}=Co(o);if(!t&&!e)return mo("[ZONOS - loadZonos] invalid cart id"),null;const s=await te({cartId:o,retries:5});return ko("[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}):(mo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return mo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=ao(s);await u({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){ko("tempCartUUID is provided, start building cart");const e=null===(o=window.Zonos.cartData.references)||void 0===o?void 0:o.checkoutSessionId;if(e){if(ko("Setting checkout session id from cart reference","info",e),await this.recoverCompletedOrderModificationSession(e))return c.isFetchingSession=!1,!0;X.checkoutSessionId=e}else ko("Clear checkout session id from storage so we start from a fresh session for this cart"),X.checkoutSessionId=null;const{adjustments:t,cartItems:s}=ao(window.Zonos.cartData);await u({adjustments:t,cartItems:s})}else if(io.checkoutSettings.buildCartDetail&&G.selectedCountryCode){ko("build cart detail");const o=await io.checkoutSettings.buildCartDetail({countryCode:G.selectedCountryCode,currencyCode:G.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));ko("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 u({adjustments:s,cartItems:e})}if(!X.checkoutSessionId){const o=await f();if(ko(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}l.isStagingMode||w(),await this.applyStripeTheme();const{successBehavior:e,successRedirectUrl:t}=io.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===e||"CLOSE_MODAL"===e&&!!t||!!l.externalConfirmationPageURL,z()&&(l.step="payment"),!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=ho(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;ko(`=== 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 ko(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,ko("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){X.checkoutSessionId&&zo({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:X.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,X.checkoutSessionId&&zo({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:X.checkoutSessionId})}markTheSessionAsAbandonedCart(){X.checkoutSessionId&&zo({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:X.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||io.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=io.checkoutSettings.placeOrderButtonSelector,e=io.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${bo}`);if(ko(`attach checkout ${o}`,"info",{href:window.location.href}),ko(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${So}`,`#${bo}`,`#${xo}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(ko(`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),a=t.matches(`#${xo}`),d=t.matches(`#${So}`)||t.matches(`#${bo}`);if(!window.Zonos.isLegacyCheckout&&(!Yo()||((o=!0)=>!G.localizationLoaded||!!G.isDisabledCountry&&(o&&ko("Checkout: disabled country"),!0))())&&!r&&!a&&!d)return;o.preventDefault(),o.stopPropagation(),ko("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;ko("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 lo("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),oe++,oe>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),io.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 Ro();if(o)return ko("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Po("/checkout"));const e=await Ko();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.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 k()}catch(e){o=to("Unable to check inventory. Please try again.")}if(o)return l.inventoryCheckErrorMessage=o,c.isFetchingSession=!1,void(this.open=!1)}null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:X.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),v({isPreview:this.preview,sessionTimeout:54e5}),M({event:"zonos-checkout-start",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await lo("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(l.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=vo(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:yo},po()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};lo("/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:yo},po()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};lo("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),Io()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,mo(o),this.isCartExpired)return void(c.isFetchingSession=!0);go({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:yo,cartId:window.Zonos.cartId,checkoutSessionBody:C(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||io.onlineStoreSettings.url}}),b({messages:[to("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:to("Error creating Checkout")})}}}),{capture:!0,passive:!1}),io.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${So}`)&&(t.dispatchEvent(Ao("click")),S(),t.remove()),t.matches(`#${bo}`)&&(t.dispatchEvent(Ao("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;ko("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||J(h)||G.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);ko("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=J(o)||G.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&G.shippingZoneCountries&&!(t in G.shippingZoneCountries)?ko(`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:c,phone:r}],ko("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):ko("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){l.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,l.isStagingMode=fo(),void 0!==this.overrideStagingMode&&(l.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=io.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&No()})(),window.Zonos.isBigCommerce&&Zo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Qo();const o=new MutationObserver((()=>{Qo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),Xo({domesticRedirectedBtnSelector:So,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();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(ko("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)):ko("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(Eo))return;o.searchParams.delete(Eo),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!G.localizationLoaded||!G.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),ko("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${xo}`);if(o)return clearInterval(t),void o.dispatchEvent(Ao("click"));Date.now()-e>15e3&&(clearInterval(t),ko("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){l.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){x(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${xo}`);o&&o.dispatchEvent(Ao("click"))}async handleCustomerInfoContinue(){var o,e,t,s;M({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await I();n&&"stripe"===l.addressFormRenderType&&go({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===l.step?c.isFetchingLandedCost||(l.landedCostData&&(Z({currency:l.currency}),T()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){T()}handleInventoryCheckDialogConfirm(){l.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"===c.checkoutSettlementCurrency&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=A();try{if(H.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,l.inventoryCheckErrorMessage=null,!await O())return c.hasPaymentError=!0,c.customErrorMessage=to("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:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{l.inventoryCheckErrorMessage=await k()}catch(o){l.inventoryCheckErrorMessage=to("Unable to check inventory. Please try again.")}if(l.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if($()>0){const o=await B();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||to("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(L()){try{const o=await _();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await E();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||to("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await D({noLandedCostCheck:z()}),T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(P(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(U.locked=!1)}}async handleFinishClick(){if(j(),this.preview)return l.step="customer-info",void await this.init();if(h(),m(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||io.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=wo(this.mobile),this.applyStripeTheme(),ko(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=wo(this.mobile),this.applyStripeTheme(),ko(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=co(this.appearanceSettingsOverride.theme))}handleAddressChange(){j()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return ko("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);ko("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.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=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){ko("==== 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=wo(this.mobile),this.isIframed=window.self!==window.top,ko(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[so("selectedLocale",(()=>{this.applyStripeTheme()})),N("selectedShippingOption",(()=>{var o,e,t,s;const n=l.selectedShippingOption;(null===(o=io.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=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),R("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=io.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==io.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&io.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,ko(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Po("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),ko(`mobile: ${this.isMobile}`)}disconnectedCallback(){j(),h(),m(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==l.step&&"error"!==l.step&&!c.stripeElements||c.isFetchingSession,d=z(),{colorPrimary:u,colorSecondary:h,logoUrl:m,style:p}=ro(io.appearance,this.appearanceSettingsOverride||null),g="ENABLED"===io.appearance.zonosAttribution,f=io.appearance.theme,w=u&&Bo(u)?"DARK":"LIGHT",k=this.isMobile?f:w,v=this.isMobile?void 0:h,{customMessages:y}=G,C=null===(o=y.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,b=this.getCurrentLocalePageEnum(),S=y.filter((o=>o.pageName===b)),x=this.getBaseCurrencySettlementInfo(),I=()=>{const o=this.preview?`${m}?timestamp=${Date.now()}`:m;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${io.organizationName} logo`,src:o}))},T=uo(),A=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||fo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},I(),T&&e("zonos-badge",{badgeColor:"orange",size:"small"},to("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},to("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")),!d&&e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),S.map((o=>e("zonos-custom-message",{icon:se,message:o.message}))))},O=()=>l.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:to("Your checkout session has expired. Please reload the page to continue."),restStateTitle:to("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},to("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":Oo({overrideBorderStyle:p})}},"finish"!==l.step&&"error"!==l.step&&e(t,null,e("div",{class:"zonos--left","data-theme":k,style:Lo({"--zonos--primary-color":this.isMobile?void 0:u})},!this.isMobile&&A(),"customer-info"===l.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:v}),"shipping"===l.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:v}),"payment"===l.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:v})),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:_o}),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:v}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:se,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:se,message:C}))))),("finish"===l.step||"error"===l.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:_o}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:f})),e("zonos-checkout-finish",{borderRadius:p,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===l.step&&l.error?Object.assign(Object.assign({},l.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:To(["zonos--checkout zonos--elements","payment"===l.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:a,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:to("You will be redirected to international checkout shortly."),loadingTitle:to("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:to("You will be redirected to domestic checkout shortly."),loadingTitle:to("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:to("Stay on this page"),dialogConfirmBtnText:to("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:to("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:to("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:to("Don't close"),dialogConfirmBtnText:to("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:to("Would you like to close checkout and return to the site?"),dialogTitle:to("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:to("Return to merchant site"),dialogConfirmBtnText:to("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?to("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)}):to("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:to("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:to("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,to("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"},to("View GAA Form."))),dialogTitle:to("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:to("Return to cart"),dialogIntent:"danger",dialogOpen:!!l.inventoryCheckErrorMessage,dialogSubtitle:l.inventoryCheckErrorMessage,dialogTitle:to("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),x&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:to("Cancel"),dialogConfirmBtnText:to("Pay [orderTotal]",{orderTotal:no({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:to("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:to("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:to("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:to("You are being sent back to the shop to re-add items to your cart."),dialogTitle:to("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}]}}};ne.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{ne as zonos_checkout}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-DS-qw_qc.system.js","./p-DOD2I44l.system.js"],(function(r){"use strict";var n,v,u;return{setters:[function(r){n=r.d},function(r){v=r.B;u=r.j}],execute:function(){var t=function(){var r,v;var u=n.displayBaseCurrency;var t=u&&((r=n.exchangeRate)===null||r===void 0?void 0:r.sourceCurrencyCode)?(v=n.exchangeRate)===null||v===void 0?void 0:v.sourceCurrencyCode:n.currency;return t};
|
|
2
2
|
/**
|
|
3
3
|
* Unified currency rendering for checkout amounts.
|
|
4
4
|
* @note This is only to display, not for calculations.
|
|
5
|
-
*/var a=r("r",(function(r){var a=r.amount,
|
|
5
|
+
*/var a=r("r",(function(r){var a=r.amount,e=r.isForeign;var i,o;var c=((i=n.exchangeRate)===null||i===void 0?void 0:i.rate)||1;
|
|
6
6
|
// If the amount already in foreign currency, no need to apply the inclusive effective rate since it's already has the inclusive effective rate applied
|
|
7
|
-
var s=
|
|
7
|
+
var s=e?a:v(a);var l=n.currency;var d=(o=n.items[0])===null||o===void 0?void 0:o.currencyCode;
|
|
8
8
|
// If the item currency is the same as the presentment currency, we can just return the amount in the presentment currency in the same format
|
|
9
|
-
if(
|
|
9
|
+
if(d===l){return u({amount:s,currency:l})}var f=n.displayBaseCurrency;var m=t();if(e){
|
|
10
10
|
// Amount is in foreign currency, divide by the rate to convert it to the base currency if displaying in base currency
|
|
11
|
-
var y=
|
|
11
|
+
var y=f?s/c:s;return u({amount:y,currency:m})}
|
|
12
12
|
// Amount is already in base currency, need to multiply rate to convert to foreign currency if display in foreign currency
|
|
13
|
-
var
|
|
13
|
+
var D=f?s:s*c;return u({amount:D,currency:m})}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o}from"./p-clDfq9AL.js";const r="gkjqw123",l="Kq93wqw3",v=()=>{var v;return null===(v=o.inclusivePricingConfigurations)||void 0===v?void 0:v.some((o=>{var v,i;return"ENABLED"===(null===(v=o.configurations[r])||void 0===v?void 0:v.status)||"ENABLED"===(null===(i=o.configurations[l])||void 0===i?void 0:i.status)}))};export{r as D,l as T,v as h}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"./p-
|
|
1
|
+
import{z as o}from"./p-W82paT5F.js";import{g as t}from"./p-DE4a-QD5.js";import{l as e}from"./p-BJmZPrZl.js";const n="zonos-analytic",i={fbq:!1,gtag:!1},a=[];let d=!1;const s=()=>"undefined"!=typeof window&&window.parent!==window,r=()=>{d||(d=!0,window.addEventListener("message",(o=>{var t;if("zonos-analytics-relay-ready"!==(null===(t=o.data)||void 0===t?void 0:t.type))return;const e=o.data.provider||"gtag";i[e]=!0,void 0!==window.Zonos&&("gtag"===e?window.Zonos.googleAnalyticReady=!0:window.Zonos.facebookPixelReady=!0),(()=>{const o=[];for(;a.length>0;){const t=a.shift();if(i[t.provider])try{window.parent.postMessage({event:t.event,fbqMode:t.fbqMode,metadata:t.payload,provider:t.provider,type:n},"*")}catch(o){}else o.push(t)}a.push(...o)})()})))},w=()=>{if(s()){r();try{const o=void 0!==window.Zonos?window.Zonos:void 0;window.parent.postMessage({facebookPixelId:null==o?void 0:o.facebookPixelId,googleAnalyticId:null==o?void 0:o.googleAnalyticId,type:"zonos-analytics-relay-ping"},"*")}catch(o){}}},c=o=>{if(r(),i[o.provider])try{window.parent.postMessage({event:o.event,fbqMode:o.fbqMode,metadata:o.payload,provider:o.provider,type:n},"*")}catch(o){}else a.push(o),w()},l=s,p=()=>{s()&&(i.gtag&&i.fbq||w())},f=({event:n,metadata:i})=>{if(!(()=>{const t=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));return!!t&&"ENABLED"===t.status})())return;const a=t(),d=Object.assign(Object.assign({},i),a&&{isTestMode:!0}),s=Object.fromEntries(Object.entries(d).filter((([o,t])=>null!==t)));l()?c({event:n,payload:s,provider:"gtag"}):"function"==typeof window.gtag&&(e("Zonos submits gtag event","log",n),window.gtag("event",n,s))};export{c as a,p as e,l as i,f as s}
|