@zonos/elements 1.3.6 → 1.3.7-alpha.1
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/{localization-2c9f5765.js → cart-89d9fff4.js} +863 -89
- package/dist/cjs/formatStringWithLinks-52341fc7.js +17 -0
- package/dist/cjs/{getBorderRadius-b252096d.js → getBorderRadius-d8f18958.js} +1 -1
- package/dist/cjs/{isDarkColor-168002d6.js → isDarkColor-57860b44.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/submitGtag-24740560.js +55 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +36 -18
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-card_2.cjs.entry.js +10 -8
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +66 -56
- package/dist/cjs/zonos-checkout.cjs.entry.js +170 -34
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +51 -32
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -3
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +21 -12
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +23 -19
- package/dist/cjs/zonos-hello.cjs.entry.js +51 -34
- package/dist/cjs/zonos-link.cjs.entry.js +24 -0
- package/dist/cjs/zonos-logo.cjs.entry.js +3 -3
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -6
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-5d94dabb.js → zonosStore-138c5555.js} +9 -7
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +27 -13
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +39 -18
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +5 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +2 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +54 -0
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +97 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +2 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-card/zonos-card.js +2 -2
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +26 -6
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +8 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +4 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +50 -11
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -3
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +29 -4
- package/dist/collection/components/store/hello/localization.js +34 -7
- package/dist/collection/components/store/zonosStore.js +9 -7
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/api/trackConversionEvent.js +22 -0
- package/dist/collection/components/utils/checkout/isShippableCountry.js +15 -0
- package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +111 -0
- package/dist/collection/components/utils/formatStringWithLinks.js +13 -0
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +25 -28
- package/dist/collection/components/utils/hello/currencyConversion/getCurrencyElements.js +2 -1
- package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +8 -6
- package/dist/collection/components/utils/hello/initHello.js +23 -3
- package/dist/collection/components/utils/logging/log.js +20 -9
- package/dist/collection/components/utils/logging/logError.js +2 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +12 -0
- package/dist/collection/scripts/checkIfLoadVersionDomain.js +35 -0
- package/dist/collection/scripts/zonosBase.js +21 -31
- package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
- package/dist/collection/types/generated/graphql.customer.types.js +7 -4
- package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
- package/dist/components/stripe.js +4097 -7
- package/dist/components/submitGtag.js +1 -1
- package/dist/components/trackConversionEvent.js +24 -0
- package/dist/components/zonos-address2.js +2 -3
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +5 -5
- package/dist/components/zonos-card2.js +2 -2
- package/dist/components/zonos-cart-subtotal2.js +2 -8
- package/dist/components/zonos-checkbox2.js +3 -3
- package/dist/components/zonos-checkout-finish2.js +44 -16
- package/dist/components/zonos-checkout-footer2.js +1 -1
- package/dist/components/zonos-checkout-payment2.js +2 -3
- package/dist/components/zonos-checkout.js +157 -19
- package/dist/components/zonos-collapse2.js +26 -6
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +25 -6
- package/dist/components/zonos-country-flag2.js +1 -1
- package/dist/components/zonos-country-select2.js +9 -3
- package/dist/components/zonos-custom-message2.js +18 -3
- package/dist/components/zonos-customer-info2.js +4 -3
- package/dist/components/zonos-dialog2.js +3 -3
- package/dist/components/zonos-hello-dialog-footer2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +6 -5
- package/dist/components/zonos-hello.js +23 -7
- package/dist/components/zonos-language-select2.js +3 -3
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/components/zonos-link.d.ts +11 -0
- package/dist/components/zonos-link.js +43 -0
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +2 -8
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping2.js +7 -3
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/components/zonosStore.js +9 -7
- package/dist/esm/{localization-d8f6453b.js → cart-1bbb7662.js} +846 -90
- package/dist/esm/formatStringWithLinks-9e819405.js +15 -0
- package/dist/esm/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/submitGtag-d3d11f1a.js +51 -0
- package/dist/esm/zonos-address_4.entry.js +33 -15
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +8 -8
- package/dist/esm/zonos-card_2.entry.js +8 -6
- package/dist/esm/zonos-cart-items_9.entry.js +47 -37
- package/dist/esm/zonos-checkout.entry.js +158 -22
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +28 -9
- package/dist/esm/zonos-country-flag.entry.js +4 -2
- package/dist/esm/zonos-country-select_3.entry.js +19 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +9 -5
- package/dist/esm/zonos-hello.entry.js +24 -7
- package/dist/esm/zonos-link.entry.js +20 -0
- package/dist/esm/zonos-logo.entry.js +3 -3
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -6
- package/dist/esm/zonos-select-dialog-header_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +9 -7
- package/dist/esm-es5/cart-1bbb7662.js +1 -0
- package/dist/esm-es5/formatStringWithLinks-9e819405.js +1 -0
- package/dist/esm-es5/{getBorderRadius-e9736f7e.js → getBorderRadius-19787feb.js} +1 -1
- package/dist/esm-es5/{isDarkColor-e982fa09.js → isDarkColor-2344e7a5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-d3d11f1a.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.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_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -0
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-e6c7be3a.js → zonosStore-00bce01b.js} +1 -1
- package/dist/scripts/checkIfLoadVersionDomain.js +1 -0
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -1
- package/dist/types/components/common/component-template/zonos-link/zonos-link.d.ts +19 -0
- package/dist/types/components/common/zonos-collapse/zonos-collapse.d.ts +1 -0
- package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +2 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +9 -3
- package/dist/types/components/store/checkout/cart.d.ts +6 -3
- package/dist/types/components/store/checkout/stripe.d.ts +26 -1
- package/dist/types/components/store/hello/localization.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +2 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +3 -0
- package/dist/types/components/utils/checkout/isShippableCountry.d.ts +1 -0
- package/dist/types/components/utils/checkout/watchBigcommerceDomesticCheckout.d.ts +20 -0
- package/dist/types/components/utils/formatStringWithLinks.d.ts +1 -0
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
- package/dist/types/components/utils/logging/log.d.ts +1 -1
- package/dist/types/components/utils/logging/sendErrorLog.d.ts +7 -0
- package/dist/types/components.d.ts +53 -3
- package/dist/types/scripts/checkIfLoadVersionDomain.d.ts +13 -0
- package/dist/types/scripts/zonosBase.d.ts +2 -0
- package/dist/types/types/ICountryJson.d.ts +2 -1
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +23 -53
- package/dist/types/types/generated/graphql.customer.types.ts +42 -62
- package/dist/types/types/generated/graphql.frontend.types.d.ts +9 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +19 -1
- package/dist/zonos-elements/p-0318632a.entry.js +1 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-07966463.entry.js +1 -0
- package/dist/zonos-elements/p-0c0aa552.js +1 -0
- package/dist/zonos-elements/p-127b480c.entry.js +1 -0
- package/dist/zonos-elements/p-135ab559.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b81a0577.system.entry.js → p-143dc0d9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-32bca9c8.system.entry.js → p-14d27ce1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-15a80c4a.entry.js +1 -0
- package/dist/zonos-elements/p-17e87be1.entry.js +1 -0
- package/dist/zonos-elements/{p-0c7480a5.entry.js → p-1e0dd491.entry.js} +1 -1
- package/dist/zonos-elements/{p-a33745e9.entry.js → p-279d1c5f.entry.js} +1 -1
- package/dist/zonos-elements/p-2d6557ee.system.js +1 -0
- package/dist/zonos-elements/p-314be538.system.entry.js +1 -0
- package/dist/zonos-elements/{p-dd7729fd.system.entry.js → p-328b7f6f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-354603b3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-50287643.system.js → p-49f6a985.system.js} +1 -1
- package/dist/zonos-elements/p-57b65321.system.entry.js +1 -0
- package/dist/zonos-elements/p-58c1ddef.system.js +1 -0
- package/dist/zonos-elements/{p-06652d87.system.entry.js → p-58e2f6a1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5ee03db0.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5a113c3d.system.entry.js → p-61e5cf29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-49a764e9.system.entry.js → p-799d8a17.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7a32526c.entry.js +1 -0
- package/dist/zonos-elements/p-7b87b82f.js +1 -0
- package/dist/zonos-elements/{p-9cbbf261.system.entry.js → p-7c45ce37.system.entry.js} +1 -1
- package/dist/zonos-elements/p-84f4f00f.entry.js +1 -0
- package/dist/zonos-elements/{p-e8a9bc56.entry.js → p-857cfe35.entry.js} +1 -1
- package/dist/zonos-elements/p-87e9c42f.entry.js +1 -0
- package/dist/zonos-elements/{p-e99d79d9.system.js → p-91797d4e.system.js} +1 -1
- package/dist/zonos-elements/{p-17550a10.js → p-95e0fc06.js} +1 -1
- package/dist/zonos-elements/{p-7a6144b1.entry.js → p-a3cc0f84.entry.js} +1 -1
- package/dist/zonos-elements/p-a5f12396.entry.js +1 -0
- package/dist/zonos-elements/p-a87561b8.js +1 -0
- package/dist/zonos-elements/{p-ba43275e.entry.js → p-ac0a7b8f.entry.js} +1 -1
- package/dist/zonos-elements/p-ae82a9ae.js +1 -0
- package/dist/zonos-elements/p-b0462325.system.entry.js +1 -0
- package/dist/zonos-elements/p-b2c0ec71.system.entry.js +1 -0
- package/dist/zonos-elements/{p-fcc4f140.system.js → p-b4725505.system.js} +1 -1
- package/dist/zonos-elements/p-bef54fb1.entry.js +1 -0
- package/dist/zonos-elements/p-c0d431f6.system.entry.js +1 -0
- package/dist/zonos-elements/p-d054788b.system.js +1 -0
- package/dist/zonos-elements/p-d407c93a.system.entry.js +1 -0
- package/dist/zonos-elements/p-e55dd932.js +1 -0
- package/dist/zonos-elements/p-ec37439e.entry.js +1 -0
- package/dist/zonos-elements/p-edace42b.entry.js +1 -0
- package/dist/zonos-elements/p-f478c814.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7dd8e8ba.system.entry.js → p-f6eaef7b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bd6a2095.entry.js → p-f7c36fcc.entry.js} +1 -1
- package/dist/zonos-elements/p-f862b97f.system.entry.js +1 -0
- package/dist/zonos-elements/p-fd642725.entry.js +1 -0
- package/dist/zonos-elements/p-fdb72530.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a4de3fb2.entry.js → p-ff64ddc5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/cart-b8bbf22d.js +0 -698
- package/dist/cjs/submitGtag-792fe45d.js +0 -21
- package/dist/collection/scripts/extractZonosQaUrl.js +0 -26
- package/dist/components/localization.js +0 -4016
- package/dist/esm/cart-bc3bb22e.js +0 -682
- package/dist/esm/submitGtag-bebe2cb0.js +0 -19
- package/dist/esm-es5/cart-bc3bb22e.js +0 -1
- package/dist/esm-es5/localization-d8f6453b.js +0 -1
- package/dist/esm-es5/submitGtag-bebe2cb0.js +0 -1
- package/dist/types/scripts/extractZonosQaUrl.d.ts +0 -11
- package/dist/zonos-elements/p-00d63df1.system.entry.js +0 -1
- package/dist/zonos-elements/p-04f63cea.entry.js +0 -1
- package/dist/zonos-elements/p-16b74c31.system.js +0 -1
- package/dist/zonos-elements/p-1d16a6fb.js +0 -1
- package/dist/zonos-elements/p-1ea68e3b.entry.js +0 -1
- package/dist/zonos-elements/p-1ed530cc.entry.js +0 -1
- package/dist/zonos-elements/p-289c8b1a.system.entry.js +0 -1
- package/dist/zonos-elements/p-2a00c270.system.entry.js +0 -1
- package/dist/zonos-elements/p-37f53a79.entry.js +0 -1
- package/dist/zonos-elements/p-394cf1cf.js +0 -1
- package/dist/zonos-elements/p-3ef27745.js +0 -1
- package/dist/zonos-elements/p-458fd100.system.entry.js +0 -1
- package/dist/zonos-elements/p-47fac33f.js +0 -1
- package/dist/zonos-elements/p-4fafb2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fb71a93.js +0 -1
- package/dist/zonos-elements/p-5276c61b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6308b347.entry.js +0 -1
- package/dist/zonos-elements/p-63d1b1fe.entry.js +0 -1
- package/dist/zonos-elements/p-7347ee7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-8c26a080.system.js +0 -1
- package/dist/zonos-elements/p-96aabe02.entry.js +0 -1
- package/dist/zonos-elements/p-a682fd38.system.entry.js +0 -1
- package/dist/zonos-elements/p-ba1a111a.system.entry.js +0 -1
- package/dist/zonos-elements/p-c4321084.system.entry.js +0 -1
- package/dist/zonos-elements/p-cdf114a2.entry.js +0 -1
- package/dist/zonos-elements/p-d5ae3cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-d5d7c8f5.entry.js +0 -1
- package/dist/zonos-elements/p-de339fb6.entry.js +0 -1
- package/dist/zonos-elements/p-ec25f180.entry.js +0 -1
- package/dist/zonos-elements/p-f49dfd06.system.js +0 -1
- package/dist/zonos-elements/p-f6f5f644.entry.js +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
|
|
2
|
-
import { i as initStripeElements, c as cartStore,
|
|
3
|
-
import { a as localizationStore, b as log, t as translate } from './localization.js';
|
|
2
|
+
import { b as localizationStore, d as log, e as stripeStoreGetDomesticShippingSession, f as localizationStoreUpdateSelectedCountryCode, g as stripeStoreCleanupDomesticShippingSession, l as logError, h as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as cartStore, j as cartStoreUpdateItems, k as cartStoreReset, s as stripeStore, m as stripeStoreInitCheckoutSession, n as cartStoreUpdateToErrorState, t as translate, a as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset, r as cartStorePreviousStep } from './stripe.js';
|
|
4
3
|
import { z as zonosStore, m as mergeConfig } from './zonosStore.js';
|
|
4
|
+
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
5
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile.js';
|
|
6
|
+
import { s as sendErrorLog, d as defineCustomElement$k } from './zonos-checkout-finish2.js';
|
|
6
7
|
import { c as classes } from './classes.js';
|
|
7
8
|
import { g as getBorderRadius } from './getBorderRadius.js';
|
|
8
9
|
import { i as isDarkColor } from './isDarkColor.js';
|
|
@@ -15,7 +16,6 @@ import { d as defineCustomElement$o } from './zonos-card2.js';
|
|
|
15
16
|
import { d as defineCustomElement$n } from './zonos-cart-items2.js';
|
|
16
17
|
import { d as defineCustomElement$m } from './zonos-cart-subtotal2.js';
|
|
17
18
|
import { d as defineCustomElement$l } from './zonos-checkbox2.js';
|
|
18
|
-
import { d as defineCustomElement$k } from './zonos-checkout-finish2.js';
|
|
19
19
|
import { d as defineCustomElement$j } from './zonos-checkout-footer2.js';
|
|
20
20
|
import { d as defineCustomElement$i } from './zonos-checkout-payment2.js';
|
|
21
21
|
import { d as defineCustomElement$h } from './zonos-collapse2.js';
|
|
@@ -35,6 +35,126 @@ import { d as defineCustomElement$4 } from './zonos-text2.js';
|
|
|
35
35
|
import { d as defineCustomElement$3 } from './zonos-tooltip2.js';
|
|
36
36
|
import { d as defineCustomElement$2 } from './zonos-v-stack2.js';
|
|
37
37
|
|
|
38
|
+
const isShippableCountry = (showLog = true) => {
|
|
39
|
+
if (!localizationStore.localizationLoaded) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
43
|
+
if (!localizationStore.isShippableCountry) {
|
|
44
|
+
if (showLog) {
|
|
45
|
+
log(`Checkout: not shippable country`);
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Watch for changes in domestic checkout step, this is to redirect user to home page and open checkout if user enters the ship to country that's in the shipping zone
|
|
54
|
+
* @note Only works on default bigcommerce checkout page
|
|
55
|
+
*/
|
|
56
|
+
const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShippingAddressSessionFound, }) => {
|
|
57
|
+
if (!window.Zonos.isBigCommerce) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const observer = new MutationObserver(async () => {
|
|
61
|
+
const domesticRedirectedButton = document.querySelector(domesticRedirectedBtnSelector);
|
|
62
|
+
const shippingAddressSession = stripeStoreGetDomesticShippingSession();
|
|
63
|
+
// append a hidden button to the body if the shipping address session is found
|
|
64
|
+
if (!domesticRedirectedButton && shippingAddressSession) {
|
|
65
|
+
// create a hidden button to trigger the click event
|
|
66
|
+
const button = document.createElement('button');
|
|
67
|
+
button.style.display = 'none';
|
|
68
|
+
button.id = 'zonos--domestic-redirected-checkout-button';
|
|
69
|
+
document.body.appendChild(button);
|
|
70
|
+
onShippingAddressSessionFound === null || onShippingAddressSessionFound === void 0 ? void 0 : onShippingAddressSessionFound(shippingAddressSession);
|
|
71
|
+
// disconnect the observer after we found the shipping continue button
|
|
72
|
+
observer.disconnect();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const shipToCountryElement = document.querySelector('select[name="shippingAddress.countryCode"]');
|
|
76
|
+
// make sure the continue button is available
|
|
77
|
+
const shippingCountinueBtnEle = document.querySelector('#checkout-shipping-continue');
|
|
78
|
+
if (!shipToCountryElement || !shippingCountinueBtnEle) {
|
|
79
|
+
// do nothing if shipping country and the continue button is not found
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// disconnect the observer after we found the shipping continue button
|
|
83
|
+
observer.disconnect();
|
|
84
|
+
shippingCountinueBtnEle.addEventListener('click', async (e) => {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
const shippingCountry = shipToCountryElement.value;
|
|
87
|
+
if (!shippingCountry) {
|
|
88
|
+
// do nothing if shipping country is not found
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
// update the country code in localization store and check if it's shippable
|
|
92
|
+
localizationStoreUpdateSelectedCountryCode(shippingCountry);
|
|
93
|
+
// do nothing if the country is still domestic
|
|
94
|
+
if (!isShippableCountry(false)) {
|
|
95
|
+
// cleanup the domestic shipping session if it's domestic because we will open the intl checkout after redirecting
|
|
96
|
+
stripeStoreCleanupDomesticShippingSession();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// get value of shipping address state
|
|
100
|
+
const shipToFormElement = document.querySelector('form');
|
|
101
|
+
if (!shipToFormElement) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const formData = new FormData(shipToFormElement);
|
|
105
|
+
const shipAddress1Element = document.querySelector('input#addressLine1Input');
|
|
106
|
+
const shippingAddress = {
|
|
107
|
+
address1: (_a = formData.get('shippingAddress.address1')) !== null && _a !== void 0 ? _a :
|
|
108
|
+
// in Canada, the address1 is not included in the form, try to get value from input id instead.
|
|
109
|
+
(shipAddress1Element && shipAddress1Element.value),
|
|
110
|
+
address2: formData.get('shippingAddress.address2'),
|
|
111
|
+
city: formData.get('shippingAddress.city'),
|
|
112
|
+
countryCode: formData.get('shippingAddress.countryCode'),
|
|
113
|
+
firstName: formData.get('shippingAddress.firstName'),
|
|
114
|
+
lastName: formData.get('shippingAddress.lastName'),
|
|
115
|
+
phone: formData.get('shippingAddress.phone'),
|
|
116
|
+
postalCode: formData.get('shippingAddress.postalCode'),
|
|
117
|
+
stateOrProvince: (_b = formData.get('shippingAddress.stateOrProvince')) !== null && _b !== void 0 ? _b : formData.get('shippingAddress.stateOrProvinceCode'),
|
|
118
|
+
};
|
|
119
|
+
if (Object.values(shippingAddress).some(value => value === undefined || value === null)) {
|
|
120
|
+
logError('One or more shipping address field is missing', Object.entries(shippingAddress));
|
|
121
|
+
void sendErrorLog({
|
|
122
|
+
endpoint: 'No endpoint, domestic checkout form missing fields',
|
|
123
|
+
errors: [
|
|
124
|
+
'Bigcommerce: One or more shipping address field is missing in the domestic checkout form',
|
|
125
|
+
JSON.stringify(Object.entries(shippingAddress)),
|
|
126
|
+
],
|
|
127
|
+
metadata: {
|
|
128
|
+
domain: window.location.hostname,
|
|
129
|
+
storeId: zonosStore.storeId,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// save the shipping address to session storage
|
|
135
|
+
stripeStoreSaveDomesticShippingSession({
|
|
136
|
+
address1: shippingAddress.address1,
|
|
137
|
+
address2: shippingAddress.address2,
|
|
138
|
+
city: shippingAddress.city,
|
|
139
|
+
countryCode: shippingAddress.countryCode,
|
|
140
|
+
firstName: shippingAddress.firstName,
|
|
141
|
+
lastName: shippingAddress.lastName,
|
|
142
|
+
phone: shippingAddress.phone,
|
|
143
|
+
postalCode: shippingAddress.postalCode,
|
|
144
|
+
state: shippingAddress.stateOrProvince,
|
|
145
|
+
});
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
e.stopPropagation();
|
|
148
|
+
// redirect to home page, home page then will open the checkout dialog if having domestic shipping session
|
|
149
|
+
window.location.href = '/';
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
observer.observe(document.body, {
|
|
153
|
+
childList: true,
|
|
154
|
+
subtree: true,
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
38
158
|
const LeftArrow = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
39
159
|
|
|
40
160
|
const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
|
|
@@ -62,19 +182,6 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
62
182
|
overrideTheme: this.isMobile ? theme : undefined,
|
|
63
183
|
});
|
|
64
184
|
};
|
|
65
|
-
this.isShippableCountry = (showLog = true) => {
|
|
66
|
-
if (!localizationStore.localizationLoaded) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
70
|
-
if (!localizationStore.isShippableCountry) {
|
|
71
|
-
if (showLog) {
|
|
72
|
-
log(`Checkout: not shippable country`);
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
return true;
|
|
77
|
-
};
|
|
78
185
|
this.getCurrentLocalePageEnum = () => {
|
|
79
186
|
switch (cartStore.step) {
|
|
80
187
|
case 'customer-info':
|
|
@@ -101,6 +208,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
101
208
|
this.isMobile = false;
|
|
102
209
|
this.zonosReviewRef = undefined;
|
|
103
210
|
this.storybookPaymentStatusOverride = undefined;
|
|
211
|
+
this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
|
|
104
212
|
}
|
|
105
213
|
/**
|
|
106
214
|
* Init cart info handler event
|
|
@@ -146,7 +254,8 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
146
254
|
// do nothing if button element is not found
|
|
147
255
|
return;
|
|
148
256
|
}
|
|
149
|
-
|
|
257
|
+
// also attach event to hidden button if user was redirected with shipping address session
|
|
258
|
+
const buttonAnchorElements = document.querySelectorAll(`${buttonAnchorSelector}, ${this.domesticRedirectedBtnSelector}`);
|
|
150
259
|
// only attach event once, and looping through all of the button elements
|
|
151
260
|
buttonAnchorElements.forEach(button => {
|
|
152
261
|
const isEventAttached = button.getAttribute('data-zonos-checkout-attached');
|
|
@@ -156,7 +265,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
156
265
|
}
|
|
157
266
|
button.addEventListener('click', async (e) => {
|
|
158
267
|
// do nothing if it's not shippable country
|
|
159
|
-
if (!
|
|
268
|
+
if (!isShippableCountry()) {
|
|
160
269
|
return;
|
|
161
270
|
}
|
|
162
271
|
e.preventDefault();
|
|
@@ -172,6 +281,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
172
281
|
throw new Error('Error building cart');
|
|
173
282
|
}
|
|
174
283
|
submitGtag('zonos-checkout-start');
|
|
284
|
+
void trackConversionEvent('checkout_open');
|
|
175
285
|
}
|
|
176
286
|
catch (err) {
|
|
177
287
|
// stop loading
|
|
@@ -186,6 +296,14 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
186
296
|
});
|
|
187
297
|
button.removeAttribute('disabled');
|
|
188
298
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
299
|
+
// if this button is the hidden button, trigger the click event
|
|
300
|
+
if (button.matches(this.domesticRedirectedBtnSelector)) {
|
|
301
|
+
button.dispatchEvent(new CustomEvent('click'));
|
|
302
|
+
// cleanup shipping session after button is clicked
|
|
303
|
+
stripeStoreCleanupDomesticShippingSession();
|
|
304
|
+
// remove the button after it's clicked
|
|
305
|
+
button.remove();
|
|
306
|
+
}
|
|
189
307
|
});
|
|
190
308
|
}
|
|
191
309
|
appearanceSettingsOverrideChanged() {
|
|
@@ -201,6 +319,25 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
201
319
|
async init() {
|
|
202
320
|
stripeStore.stripe = window.Zonos.stripe;
|
|
203
321
|
this.stripe = window.Zonos.stripe;
|
|
322
|
+
// check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
|
|
323
|
+
watchBigcommerceDomesticCheckout({
|
|
324
|
+
domesticRedirectedBtnSelector: this.domesticRedirectedBtnSelector,
|
|
325
|
+
onShippingAddressSessionFound: shippingAddressSession => {
|
|
326
|
+
// prefilled the default address if shipping address session is found for checkout on open
|
|
327
|
+
this.defaultAddress = {
|
|
328
|
+
address: {
|
|
329
|
+
city: shippingAddressSession.city,
|
|
330
|
+
country: shippingAddressSession.countryCode,
|
|
331
|
+
line1: shippingAddressSession.address1,
|
|
332
|
+
line2: shippingAddressSession.address2,
|
|
333
|
+
postal_code: shippingAddressSession.postalCode,
|
|
334
|
+
state: shippingAddressSession.state,
|
|
335
|
+
},
|
|
336
|
+
name: `${shippingAddressSession.firstName} ${shippingAddressSession.lastName}`,
|
|
337
|
+
phone: shippingAddressSession.phone,
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
});
|
|
204
341
|
const hideInternationalOrderInterval = setInterval(() => {
|
|
205
342
|
const internationalSelector = window.Zonos.internationalHideSelector;
|
|
206
343
|
if (!internationalSelector) {
|
|
@@ -209,7 +346,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
209
346
|
return;
|
|
210
347
|
}
|
|
211
348
|
// hide the selector if it's international
|
|
212
|
-
const isInternationalOrder =
|
|
349
|
+
const isInternationalOrder = isShippableCountry(false);
|
|
213
350
|
const selector = document.querySelectorAll(internationalSelector);
|
|
214
351
|
if (!isInternationalOrder) {
|
|
215
352
|
// show the selector when it's domestic
|
|
@@ -431,6 +568,7 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
|
|
|
431
568
|
"isMobile": [32],
|
|
432
569
|
"zonosReviewRef": [32],
|
|
433
570
|
"storybookPaymentStatusOverride": [32],
|
|
571
|
+
"domesticRedirectedBtnSelector": [32],
|
|
434
572
|
"closeDialogHandler": [64],
|
|
435
573
|
"init": [64],
|
|
436
574
|
"setToFinishStep": [64]
|
|
@@ -12,6 +12,7 @@ const ZonosCollapse = /*@__PURE__*/ proxyCustomElement(class ZonosCollapse exten
|
|
|
12
12
|
this.collapsed = false;
|
|
13
13
|
this.collapseSize = 0;
|
|
14
14
|
this.height = this.el.scrollHeight;
|
|
15
|
+
this.iframe = null;
|
|
15
16
|
}
|
|
16
17
|
getElementHeight() {
|
|
17
18
|
const fullHeight = `${this.height}px`;
|
|
@@ -23,23 +24,42 @@ const ZonosCollapse = /*@__PURE__*/ proxyCustomElement(class ZonosCollapse exten
|
|
|
23
24
|
}
|
|
24
25
|
componentDidRender() {
|
|
25
26
|
var _a, _b, _c;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
this.iframe =
|
|
28
|
+
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
|
|
29
|
+
(_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
|
|
30
|
+
if (!this.iframe) {
|
|
31
|
+
// this should never happen since it's inside of resize callback
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.height = parseFloat(getComputedStyle(this.iframe).height);
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
37
|
render() {
|
|
31
|
-
this.
|
|
32
|
-
|
|
38
|
+
if (!this.collapsed) {
|
|
39
|
+
// wait for the collapse animation to finish, then set overflow to visible
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
// if the element collapsed state is still not changed, set overflow to visible
|
|
42
|
+
if (!this.collapsed) {
|
|
43
|
+
this.el.style.overflow = 'visible';
|
|
44
|
+
}
|
|
45
|
+
}, 300);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// set overflow to hidden to prevent content from showing when collapsed
|
|
49
|
+
this.el.style.overflow = 'hidden';
|
|
50
|
+
}
|
|
51
|
+
return (h(Host, { key: '7ac8b898feadfb4424b3b48a98135cb18994f4e0', class: 'zonos--elements zonos--collapse', style: {
|
|
33
52
|
'--font-family': zonosStoreFontFamily(),
|
|
34
53
|
height: this.getElementHeight(),
|
|
35
|
-
} }, h("div", { key: '
|
|
54
|
+
} }, h("div", { key: '4a527ec319b59041196284d4d9a8f22b943a74e6' }, h("iframe", { key: '2fb51c16e13ca90561b1b1e6cab89d87e4a37a47', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: '6d7849f6c35be611446b0da36d657396e5ca3122' }))));
|
|
36
55
|
}
|
|
37
56
|
get el() { return this; }
|
|
38
57
|
static get style() { return ZonosCollapseStyle0; }
|
|
39
58
|
}, [1, "zonos-collapse", {
|
|
40
59
|
"collapsed": [4],
|
|
41
60
|
"collapseSize": [2, "collapse-size"],
|
|
42
|
-
"height": [32]
|
|
61
|
+
"height": [32],
|
|
62
|
+
"iframe": [32]
|
|
43
63
|
}]);
|
|
44
64
|
function defineCustomElement() {
|
|
45
65
|
if (typeof customElements === "undefined") {
|
|
@@ -20,7 +20,7 @@ const ZonosComponent$1 = /*@__PURE__*/ proxyCustomElement(class ZonosComponent e
|
|
|
20
20
|
return format(this.first, this.middle, this.last);
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return h("div", { key: '
|
|
23
|
+
return h("div", { key: '3b7429a0c03b00f0a80e15a94bebd08aedaafe51' }, "Hello, World! I'm ", this.getText());
|
|
24
24
|
}
|
|
25
25
|
static get style() { return ZonosComponentStyle0; }
|
|
26
26
|
}, [1, "zonos-component", {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as stripeStore } from './stripe.js';
|
|
3
|
-
import { h as handleFetch, l as logError, i as isValidSelector, b as log, d as initLocalizationStore, e as localizationStoreUpdateSelectedCountryCode } from './localization.js';
|
|
2
|
+
import { u as handleFetch, l as logError, z as isValidSelector, d as log, s as stripeStore, A as initLocalizationStore, f as localizationStoreUpdateSelectedCountryCode } from './stripe.js';
|
|
4
3
|
import { z as zonosStore, d as zonosStoreInitSetting, a as zonosStoreFontFamily } from './zonosStore.js';
|
|
5
4
|
import { d as defineCustomElement$3 } from './zonos-notification2.js';
|
|
6
5
|
import { d as defineCustomElement$2 } from './zonos-text2.js';
|
|
@@ -36,13 +35,16 @@ const initCheckout = (config) => {
|
|
|
36
35
|
injectCheckoutElement();
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
const injectHelloComponent = (
|
|
38
|
+
const injectHelloComponent = (anchorElementSelector) => {
|
|
39
|
+
const triggerAnchorElement = document.querySelector(anchorElementSelector);
|
|
40
40
|
// append checkout component if doesn't exist
|
|
41
41
|
const helloElement = document.querySelector('zonos-hello');
|
|
42
42
|
if (!helloElement && triggerAnchorElement) {
|
|
43
43
|
const newHelloElement = document.createElement('zonos-hello');
|
|
44
44
|
triggerAnchorElement.appendChild(newHelloElement);
|
|
45
|
+
return true;
|
|
45
46
|
}
|
|
47
|
+
return false;
|
|
46
48
|
};
|
|
47
49
|
const initHello = async (helloSettings) => {
|
|
48
50
|
const { anchorElementSelector } = helloSettings;
|
|
@@ -51,9 +53,26 @@ const initHello = async (helloSettings) => {
|
|
|
51
53
|
logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
|
-
const triggerElement = document.querySelector(anchorElementSelector);
|
|
55
56
|
log('Hello init complete');
|
|
56
|
-
injectHelloComponent(
|
|
57
|
+
const isHelloInjected = injectHelloComponent(anchorElementSelector);
|
|
58
|
+
// keep watching for the anchor element to be added to the DOM, then inject hello component
|
|
59
|
+
if (!isHelloInjected) {
|
|
60
|
+
const observer = new MutationObserver(() => {
|
|
61
|
+
const injected = injectHelloComponent(anchorElementSelector);
|
|
62
|
+
if (injected) {
|
|
63
|
+
// disconnect observer if hello is successfully injected
|
|
64
|
+
observer.disconnect();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
observer.observe(document.body, {
|
|
68
|
+
childList: true,
|
|
69
|
+
subtree: true,
|
|
70
|
+
});
|
|
71
|
+
// kill observer after 5 seconds if the hello still not injected, if the hello still not injected after 10 seconds, it's likely that the selector the user doesn't want to use hello
|
|
72
|
+
setTimeout(() => {
|
|
73
|
+
observer.disconnect();
|
|
74
|
+
}, 5000);
|
|
75
|
+
}
|
|
57
76
|
};
|
|
58
77
|
|
|
59
78
|
const zonosControllerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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}";
|
|
@@ -209,7 +228,7 @@ const ZonosController$1 = /*@__PURE__*/ proxyCustomElement(class ZonosController
|
|
|
209
228
|
zonosStore.organizationName = organizationName;
|
|
210
229
|
}
|
|
211
230
|
render() {
|
|
212
|
-
return h(Host, { key: '
|
|
231
|
+
return h(Host, { key: 'a220a3ebe75df167eefc892c59efdcaf05a53601', class: "zonos--elements" });
|
|
213
232
|
}
|
|
214
233
|
static get style() { return ZonosControllerStyle0; }
|
|
215
234
|
}, [1, "zonos-controller", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { b as localizationStore } from './stripe.js';
|
|
3
3
|
import { a as zonosStoreFontFamily } from './zonosStore.js';
|
|
4
4
|
import { c as classes } from './classes.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { f as localizationStoreUpdateSelectedCountryCode, b as localizationStore } from './stripe.js';
|
|
3
3
|
import { a as zonosStoreFontFamily } from './zonosStore.js';
|
|
4
4
|
import { d as defineCustomElement$7 } from './zonos-button2.js';
|
|
5
5
|
import { d as defineCustomElement$6 } from './zonos-country-flag2.js';
|
|
@@ -1814,6 +1814,11 @@ const ZonosCountrySelect = /*@__PURE__*/ proxyCustomElement(class ZonosCountrySe
|
|
|
1814
1814
|
this.handleOnClose = () => { };
|
|
1815
1815
|
this.inputValue = '';
|
|
1816
1816
|
}
|
|
1817
|
+
componentDidRender() {
|
|
1818
|
+
var _a, _b;
|
|
1819
|
+
// focus the input on render
|
|
1820
|
+
(_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select-input')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
1821
|
+
}
|
|
1817
1822
|
render() {
|
|
1818
1823
|
const { shippingZoneCountries } = localizationStore;
|
|
1819
1824
|
const countries = shippingZoneCountries
|
|
@@ -1826,10 +1831,11 @@ const ZonosCountrySelect = /*@__PURE__*/ proxyCustomElement(class ZonosCountrySe
|
|
|
1826
1831
|
const filteredCountries = this.inputValue
|
|
1827
1832
|
? fuseObject.map(country => country.item)
|
|
1828
1833
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
1829
|
-
return (h(Host, { key: '
|
|
1834
|
+
return (h(Host, { key: '2b8e15643f92ac489706aff7623b1d1efdebce70', class: "zonos--elements", style: {
|
|
1830
1835
|
'--font-family': zonosStoreFontFamily(),
|
|
1831
|
-
} }, h("div", { key: '
|
|
1836
|
+
} }, h("div", { key: '06b0c7765d8144ca102c9033e74cf1edb14743ac', class: "zonos--country-select" }, h("zonos-v-stack", { key: 'f2af99575f518acb753448f7cb1f7aecd790de9d', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '296b92c476439aace00f6817b452a3fd3e1d353d', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, h("input", { key: 'd988b856392f88a66bcc3016ccf55107bda4a411', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), h("div", { key: '4376bec824141dd7d2dbfb84f465ac4a48e1d050', class: "zonos--country-select-content" }, filteredCountries.map(country => (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
1832
1837
|
}
|
|
1838
|
+
get ele() { return this; }
|
|
1833
1839
|
static get style() { return ZonosCountrySelectStyle0; }
|
|
1834
1840
|
}, [1, "zonos-country-select", {
|
|
1835
1841
|
"handleOnClose": [16],
|
|
@@ -4,6 +4,20 @@ import { d as defineCustomElement$3 } from './zonos-card2.js';
|
|
|
4
4
|
import { d as defineCustomElement$2 } from './zonos-icon2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
6
6
|
|
|
7
|
+
const formatStringWithLinks = (str) => {
|
|
8
|
+
// Match Markdown-style links or standalone URLs not in Markdown format
|
|
9
|
+
const linkRegex = /\[([^\]]+)\]\((https?:\/\/[^\s\)]+)\)|(https?:\/\/[^\s]+)/g;
|
|
10
|
+
const messageWithLinks = str.replace(linkRegex, (_match, text, markdownUrl, url) => {
|
|
11
|
+
if (markdownUrl) {
|
|
12
|
+
return `<zonos-link href="${markdownUrl}" target="_blank" rel="noopener noreferrer">${text}</zonos-link>`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
return `<zonos-link href="${url}" target="_blank" rel="noopener noreferrer">${url}</zonos-link>`;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return messageWithLinks;
|
|
19
|
+
};
|
|
20
|
+
|
|
7
21
|
const zonosCustomMessageCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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 .zonos--custom-message{background:var(--amino-gray-50);border-radius:var(--amino-radius-6)}:host .zonos--custom-message .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}";
|
|
8
22
|
const ZonosCustomMessageStyle0 = zonosCustomMessageCss;
|
|
9
23
|
|
|
@@ -16,9 +30,10 @@ const ZonosCustomMessage = /*@__PURE__*/ proxyCustomElement(class ZonosCustomMes
|
|
|
16
30
|
this.message = '';
|
|
17
31
|
}
|
|
18
32
|
render() {
|
|
19
|
-
|
|
33
|
+
const messageWithLinks = formatStringWithLinks(this.message);
|
|
34
|
+
return (h(Host, { key: '73091a3267f0989e8820800054aebc75168dc5d6', class: "zonos--elements", style: {
|
|
20
35
|
'--font-family': zonosStoreFontFamily(),
|
|
21
|
-
} }, this.message && (h("zonos-card", { class: "zonos--custom-message", spacing: "12px" }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Custom message", content: this.icon }), h("zonos-text",
|
|
36
|
+
} }, this.message && (h("zonos-card", { class: "zonos--custom-message", spacing: "12px" }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { innerHTML: messageWithLinks }))))));
|
|
22
37
|
}
|
|
23
38
|
static get style() { return ZonosCustomMessageStyle0; }
|
|
24
39
|
}, [1, "zonos-custom-message", {
|
|
@@ -54,4 +69,4 @@ function defineCustomElement() {
|
|
|
54
69
|
} });
|
|
55
70
|
}
|
|
56
71
|
|
|
57
|
-
export { ZonosCustomMessage as Z, defineCustomElement as d };
|
|
72
|
+
export { ZonosCustomMessage as Z, defineCustomElement as d, formatStringWithLinks as f };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as stripeStore } from './stripe.js';
|
|
3
|
-
import { t as
|
|
2
|
+
import { s as stripeStore, t as translate } from './stripe.js';
|
|
3
|
+
import { t as trackConversionEvent } from './trackConversionEvent.js';
|
|
4
4
|
import { s as submitGtag } from './submitGtag.js';
|
|
5
5
|
import { d as defineCustomElement$7 } from './zonos-address2.js';
|
|
6
6
|
import { d as defineCustomElement$6 } from './zonos-button2.js';
|
|
@@ -10,7 +10,7 @@ import { d as defineCustomElement$3 } from './zonos-link-authentication2.js';
|
|
|
10
10
|
import { d as defineCustomElement$2 } from './zonos-spinner2.js';
|
|
11
11
|
import { d as defineCustomElement$1 } from './zonos-text2.js';
|
|
12
12
|
|
|
13
|
-
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:
|
|
13
|
+
const zonosCustomerInfoCss = ".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:var(--amino-space-16)}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-webkit-box-shadow:0 0 1px 0 var(--amino-gray-600);box-shadow:0 0 1px 0 var(--amino-gray-600)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-5px;padding-top:var(--amino-space-8);margin-top:var(--amino-space-12);background:var(--primary-color, var(--amino-gray-0))}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";
|
|
14
14
|
const ZonosCustomerInfoStyle0 = zonosCustomerInfoCss;
|
|
15
15
|
|
|
16
16
|
const ZonosCustomerInfo = /*@__PURE__*/ proxyCustomElement(class ZonosCustomerInfo extends HTMLElement {
|
|
@@ -34,6 +34,7 @@ const ZonosCustomerInfo = /*@__PURE__*/ proxyCustomElement(class ZonosCustomerIn
|
|
|
34
34
|
if (!this.disabled) {
|
|
35
35
|
// submit google tag when the form is complete
|
|
36
36
|
submitGtag('zonos-checkout-customer-info');
|
|
37
|
+
void trackConversionEvent('checkout_customerInfoCompleted');
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
render() {
|
|
@@ -58,7 +58,7 @@ const ZonosDialog = /*@__PURE__*/ proxyCustomElement(class ZonosDialog extends H
|
|
|
58
58
|
document.body.style.overflow = 'auto';
|
|
59
59
|
}
|
|
60
60
|
const borderStyle = getBorderRadius(this.borderStyle);
|
|
61
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: '3927d9cf0ebbd8b497a0ec42328c4392925d198a', class: classes([
|
|
62
62
|
'zonos--elements',
|
|
63
63
|
this.open && 'open',
|
|
64
64
|
this.isLoading && 'is-loading',
|
|
@@ -69,10 +69,10 @@ const ZonosDialog = /*@__PURE__*/ proxyCustomElement(class ZonosDialog extends H
|
|
|
69
69
|
'--font-family': zonosStoreFontFamily(),
|
|
70
70
|
'--height': this.height || 'initial',
|
|
71
71
|
'--width': this.width,
|
|
72
|
-
} }, h("div", { key: '
|
|
72
|
+
} }, h("div", { key: 'df93af61bfd856db3a572cdb98f60a8dd5c5bb7d', class: "zonos--backdrop" }), h("div", { key: 'f306feb4858dff642fbfd731e5aad849a8f29941', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'b914ea2e54fb2af825008ae28e235c461dce67e9', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: '19219c0c8d167bbacec992ba10b1fe0f31a8b8f6', class: classes([
|
|
73
73
|
'zonos--body',
|
|
74
74
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
75
|
-
]) }, h("slot", { key: '
|
|
75
|
+
]) }, h("slot", { key: '38f9b83418dacd47cc2395f253a32ff0a6723d54' })), this.footerRightAction && (h("div", { class: "zonos--footer" }, h("div", { class: "zonos--footer-right-action" }, this.footerRightAction)))))));
|
|
76
76
|
}
|
|
77
77
|
static get assetsDirs() { return ["assets"]; }
|
|
78
78
|
static get style() { return ZonosDialogStyle0; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { b as localizationStore } from './stripe.js';
|
|
3
3
|
import { i as isDarkColor } from './isDarkColor.js';
|
|
4
4
|
import { l as languages } from './ILanguage.js';
|
|
5
5
|
import { d as defineCustomElement$4 } from './zonos-button2.js';
|
|
@@ -36,9 +36,9 @@ const ZonosHelloDialogFooter = /*@__PURE__*/ proxyCustomElement(class ZonosHello
|
|
|
36
36
|
const primaryColor = (_a = this.appearanceSettings) === null || _a === void 0 ? void 0 : _a.colorPrimary;
|
|
37
37
|
const footerTheme = primaryColor && isDarkColor(primaryColor) ? 'DARK' : 'LIGHT';
|
|
38
38
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: 'f97688788d9f6d1a640f054a2a22dbae6955b83c', class: "zonos--elements" }, h("div", { key: '3539323f9044acef3890fc072bdd981e2495fc18', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
|
|
40
40
|
'--primary-color': (_c = this.appearanceSettings) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
41
|
-
} }, h("a", { key: '
|
|
41
|
+
} }, h("a", { key: '5e30052240f87211c6f0092ef6a27c217f3ecefb', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: 'c60142bcd26086c2944ac3464885ca1f96e5cfbe', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), h("div", { key: '67297b4c557ee5b49a4406a459588f2924183195', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '9348bff826187730f36d191f7e01f516f2b9785c', buttonColor: "gray-1200", icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: 'ecf1a8639e8e92a07a0e774abb560de53c19587c', buttonColor: "gray-1200", icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
42
42
|
}
|
|
43
43
|
static get style() { return ZonosHelloDialogFooterStyle0; }
|
|
44
44
|
}, [1, "zonos-hello-dialog-footer", {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import {
|
|
2
|
+
import { G as currencyFormat, b as localizationStore, t as translate } from './stripe.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore.js';
|
|
4
4
|
import { c as classes } from './classes.js';
|
|
5
|
+
import { f as formatStringWithLinks, d as defineCustomElement$8 } from './zonos-custom-message2.js';
|
|
5
6
|
import { d as defineCustomElement$d } from './zonos-banner2.js';
|
|
6
7
|
import { d as defineCustomElement$c } from './zonos-button2.js';
|
|
7
8
|
import { d as defineCustomElement$b } from './zonos-card2.js';
|
|
8
9
|
import { d as defineCustomElement$a } from './zonos-country-flag2.js';
|
|
9
10
|
import { d as defineCustomElement$9 } from './zonos-country-select2.js';
|
|
10
|
-
import { d as defineCustomElement$8 } from './zonos-custom-message2.js';
|
|
11
11
|
import { d as defineCustomElement$7 } from './zonos-hello-dialog-footer2.js';
|
|
12
12
|
import { d as defineCustomElement$6 } from './zonos-icon2.js';
|
|
13
13
|
import { d as defineCustomElement$5 } from './zonos-language-select2.js';
|
|
@@ -131,18 +131,19 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
|
|
|
131
131
|
const animateFromBottom = this.dialogRef && getHasMoreSpaceAbove(this.dialogRef);
|
|
132
132
|
const { customMessages } = localizationStore;
|
|
133
133
|
const welcomeMessage = `${translate('Welcome to')} ${zonosStore.organizationName}!`;
|
|
134
|
-
const
|
|
134
|
+
const defaultMessageStr = ((_a = customMessages.find(x => x.pageName === 'hello_default')) === null || _a === void 0 ? void 0 : _a.message) ||
|
|
135
135
|
translate('Know about duties and taxes before you buy. Shop with confidence!');
|
|
136
|
+
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
136
137
|
const currentPage = this.getCurrentPageEnum();
|
|
137
138
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
138
|
-
return (h(Host, { key: '
|
|
139
|
+
return (h(Host, { key: 'd5ac86955cf9f9a22e47fe2154dee6e10f6a9361', class: "zonos--elements" }, h("div", { key: 'd34dd3f937330cd5fdd2d7a11dc321c215983146', "aria-hidden": "true", class: classes([
|
|
139
140
|
'zonos--hello-dialog',
|
|
140
141
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
141
142
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
142
143
|
!!this.mobileLocationOverride &&
|
|
143
144
|
'zonos--hello-dialog-mobile-override',
|
|
144
145
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
145
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { textColor: "gray-800" }
|
|
146
|
+
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
|
|
146
147
|
var _a;
|
|
147
148
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
148
149
|
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: BagIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", null, h("zonos-country-select", { handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", null, h("zonos-language-select", { handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|