@zonos/elements 1.3.218 → 1.3.220
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/buildCartItemsByTempCart-309fcebf.js +28 -0
- package/dist/cjs/{cart-c54d05ce.js → cart-9a9ae4b9.js} +90 -47
- package/dist/cjs/cleanHtmlMarkdown-577d0a77.js +999 -0
- package/dist/cjs/index.cjs.js +19 -9
- package/dist/cjs/isCollectMobileTablet-7a9413e3.js +175 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/localization-0169b27d.js +738 -0
- package/dist/cjs/{paypal-d36b5dd1.js → paypal-9ee374a0.js} +12 -8
- package/dist/cjs/placeTestOrder-0dfff170.js +93 -0
- package/dist/cjs/{localization-ab7e1902.js → translationStore-0c67178f.js} +1023 -734
- package/dist/cjs/zonos-address_11.cjs.entry.js +116 -74
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/{zonos-banner.cjs.entry.js → zonos-banner_2.cjs.entry.js} +40 -0
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/{zonos-cart-items_14.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +70 -1292
- package/dist/cjs/zonos-checkout.cjs.entry.js +25 -48
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +92 -0
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +811 -0
- package/dist/cjs/zonos-collect.cjs.entry.js +468 -0
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +168 -0
- package/dist/cjs/zonos-controller.cjs.entry.js +84 -28
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +11 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +23 -5
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +34 -33
- package/dist/cjs/zonos-hello.cjs.entry.js +8 -7
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +6 -5
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -5
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +10 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -1
- package/dist/collection/components/checkout/zonos-collect/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/assets/empty-item.jpeg +0 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.css +60 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +39 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/RemoveIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/SuccessIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.css +90 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +405 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/chevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/globe.svg +3 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconDark.svg +10 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconLight.svg +10 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosWordmark.svg +7 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +152 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +164 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronDownIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronUpIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.css +109 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +194 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/CheckmarkLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/RemoveLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.css +98 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +369 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.css +71 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +151 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.css +78 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +115 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +349 -0
- package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +547 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.css +38 -0
- package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +63 -0
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-skeleton/assets/RemoveLineIcon.svg +3 -0
- package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.css +40 -0
- package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +102 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +8 -5
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
- package/dist/collection/components/common/zonos-text/zonos-text.css +1 -0
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- 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/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- 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 +4 -4
- package/dist/collection/components/main/zonos-controller.js +91 -25
- package/dist/collection/components/paypal/zonos-paypal-payment.js +13 -2
- package/dist/collection/components/store/checkout/cart.js +36 -15
- package/dist/collection/components/store/checkout/collect.js +160 -0
- package/dist/collection/components/store/checkout/paypal.js +4 -2
- package/dist/collection/components/store/checkout/stripe.js +31 -12
- package/dist/collection/components/store/translationStore/strings.arabic.js +51 -0
- package/dist/collection/components/store/translationStore/strings.base.js +51 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +51 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +51 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +51 -0
- package/dist/collection/components/store/translationStore/strings.french.js +51 -0
- package/dist/collection/components/store/translationStore/strings.german.js +51 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +51 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +51 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +51 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +51 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +51 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +51 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +51 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +51 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +51 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +51 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +51 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +51 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +51 -0
- package/dist/collection/components/store/translationStore.js +2 -1
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -18
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -4
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +9 -1
- package/dist/collection/components/utils/checkout/initCollect.js +15 -0
- package/dist/collection/components/utils/checkout/isCollectMobileTablet.js +10 -0
- package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -1
- package/dist/collection/components/utils/renderFallback.js +7 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +5 -1
- package/dist/collection/scripts/_zonosBase.js +7 -1
- package/dist/collection/types/checkout/api/PartyInfo.js +1 -0
- package/dist/collection/types/generated/graphql.internal.types.js +113 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/buildCartItemsByTempCart-c4488f73.js +26 -0
- package/dist/esm/{cart-bb0ee971.js → cart-b2dd578c.js} +68 -27
- package/dist/esm/cleanHtmlMarkdown-b5b18743.js +997 -0
- package/dist/esm/index.js +19 -9
- package/dist/esm/isCollectMobileTablet-7f9a5e2b.js +168 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/localization-d7125e4e.js +719 -0
- package/dist/esm/{paypal-bd4520eb.js → paypal-555bbf1e.js} +7 -4
- package/dist/esm/placeTestOrder-2d67c1a9.js +90 -0
- package/dist/esm/{localization-d8326254.js → translationStore-13502f49.js} +1023 -718
- package/dist/esm/zonos-address_11.entry.js +85 -43
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/{zonos-banner.entry.js → zonos-banner_2.entry.js} +40 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/{zonos-cart-items_14.entry.js → zonos-cart-items_12.entry.js} +20 -1240
- package/dist/esm/zonos-checkout.entry.js +6 -29
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +86 -0
- package/dist/esm/zonos-collect-finish_6.entry.js +802 -0
- package/dist/esm/zonos-collect.entry.js +464 -0
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-confirm-dialog_2.entry.js +163 -0
- package/dist/esm/zonos-controller.entry.js +84 -28
- package/dist/esm/zonos-country-flag.entry.js +2 -1
- package/dist/esm/zonos-country-select_4.entry.js +11 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +23 -5
- package/dist/esm/zonos-hello-dialog.entry.js +6 -5
- package/dist/esm/zonos-hello.entry.js +2 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +6 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +9 -6
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-toggle.entry.js +2 -2
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +1 -0
- package/dist/esm-es5/cart-b2dd578c.js +1 -0
- package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/isCollectMobileTablet-7f9a5e2b.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-d7125e4e.js +1 -0
- package/dist/esm-es5/paypal-555bbf1e.js +17 -0
- package/dist/esm-es5/placeTestOrder-2d67c1a9.js +1 -0
- package/dist/esm-es5/translationStore-13502f49.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +1 -0
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
- 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 -0
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -0
- package/dist/esm-es5/zonos-collect.entry.js +1 -0
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -0
- 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-elements.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.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-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/scripts/index.d.ts +470 -2
- 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/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.d.ts +4 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.d.ts +50 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.d.ts +25 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.d.ts +29 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.d.ts +62 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.d.ts +22 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.d.ts +10 -0
- package/dist/types/components/checkout/zonos-collect/zonos-collect.d.ts +86 -0
- package/dist/types/components/common/zonos-h-stack/zonos-h-stack.d.ts +9 -0
- package/dist/types/components/common/zonos-skeleton/zonos-skeleton.d.ts +17 -0
- package/dist/types/components/main/zonos-controller.d.ts +5 -0
- package/dist/types/components/paypal/zonos-paypal-payment.d.ts +3 -0
- package/dist/types/components/store/checkout/cart.d.ts +23 -3
- package/dist/types/components/store/checkout/collect.d.ts +21 -0
- package/dist/types/components/store/checkout/paypal.d.ts +4 -3
- package/dist/types/components/store/checkout/stripe.d.ts +6 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +51 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +51 -0
- package/dist/types/components/store/translationStore.d.ts +2 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -2
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +3 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/checkout/initCollect.d.ts +1 -0
- package/dist/types/components/utils/checkout/isCollectMobileTablet.d.ts +4 -0
- package/dist/types/components/utils/renderFallback.d.ts +6 -0
- package/dist/types/components.d.ts +401 -2
- package/dist/types/scripts/_zonosBase.d.ts +5 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
- package/dist/types/types/checkout/api/CreateParty.d.ts +24 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -1
- package/dist/types/types/checkout/api/PartyInfo.d.ts +24 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +616 -5
- package/dist/types/types/generated/graphql.internal.types.ts +626 -6
- package/dist/types/types/index.d.ts +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-7b5de646.entry.js → p-02667a58.entry.js} +1 -1
- package/dist/zonos-elements/p-031d646e.system.js +1 -0
- package/dist/zonos-elements/p-0e07e1d6.entry.js +1 -0
- package/dist/zonos-elements/p-0ef2a242.js +1 -0
- package/dist/zonos-elements/p-126087a2.system.entry.js +1 -0
- package/dist/zonos-elements/{p-c7d5d45d.entry.js → p-14f9bc8c.entry.js} +1 -1
- package/dist/zonos-elements/p-27d9abab.js +1 -0
- package/dist/zonos-elements/p-2813d72e.system.js +1 -0
- package/dist/zonos-elements/p-295d9c07.system.entry.js +1 -0
- package/dist/zonos-elements/p-29c80a34.js +1 -0
- package/dist/zonos-elements/p-2a6c964d.js +1 -0
- package/dist/zonos-elements/p-2b3c7c77.system.entry.js +1 -0
- package/dist/zonos-elements/p-2b8897d1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-544c173a.system.entry.js → p-30432622.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3462e9e4.system.entry.js +1 -0
- package/dist/zonos-elements/p-372c2fc5.entry.js +1 -0
- package/dist/zonos-elements/p-3c1b1be1.system.entry.js +1 -0
- package/dist/zonos-elements/p-40a4266f.js +1 -0
- package/dist/zonos-elements/{p-47ffacd8.system.entry.js → p-421dfb66.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-288761b1.system.entry.js → p-4f8563ad.system.entry.js} +1 -1
- package/dist/zonos-elements/p-52d35358.system.entry.js +1 -0
- package/dist/zonos-elements/p-567f7de7.entry.js +1 -0
- package/dist/zonos-elements/p-5d9410da.entry.js +1 -0
- package/dist/zonos-elements/p-637b22ee.system.entry.js +1 -0
- package/dist/zonos-elements/p-63a42823.entry.js +1 -0
- package/dist/zonos-elements/p-69451a50.system.js +1 -0
- package/dist/zonos-elements/p-6b3a0874.entry.js +1 -0
- package/dist/zonos-elements/p-73c1e91f.js +1 -0
- package/dist/zonos-elements/p-759ef3ca.entry.js +1 -0
- package/dist/zonos-elements/p-79d8c3f3.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3f31901f.entry.js → p-7c4e7651.entry.js} +1 -1
- package/dist/zonos-elements/{p-1c45cd15.entry.js → p-7d2d2c94.entry.js} +1 -1
- package/dist/zonos-elements/{p-1ac8bfbb.system.entry.js → p-7e5bd9af.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7ecbb2cb.entry.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/p-82e88a33.system.js +1 -0
- package/dist/zonos-elements/p-849b47aa.entry.js +1 -0
- package/dist/zonos-elements/p-8dd47520.system.entry.js +1 -0
- package/dist/zonos-elements/p-932600b7.js +1 -0
- package/dist/zonos-elements/p-960e0ab1.system.entry.js +1 -0
- package/dist/zonos-elements/p-9c5b8239.system.js +1 -0
- package/dist/zonos-elements/{p-d55aec11.system.entry.js → p-9fdd3264.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a08a005d.entry.js +1 -0
- package/dist/zonos-elements/p-a10de7fb.entry.js +1 -0
- package/dist/zonos-elements/p-a49b5e7f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-62813488.entry.js → p-a5b0a636.entry.js} +1 -1
- package/dist/zonos-elements/p-a61a9b65.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d6fa2dc2.entry.js → p-a77ed1b9.entry.js} +1 -1
- package/dist/zonos-elements/{p-eeb01de6.system.entry.js → p-a800965d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b2ae8eb7.system.js +1 -0
- package/dist/zonos-elements/p-b3d5bcf9.entry.js +1 -0
- package/dist/zonos-elements/{p-da4c01da.system.entry.js → p-b669050d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b9e9b82f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-714c28b1.system.entry.js → p-ba18c5f5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-bbf48b31.entry.js +1 -0
- package/dist/zonos-elements/{p-77666360.entry.js → p-c4b3c878.entry.js} +1 -1
- package/dist/zonos-elements/p-c7b57886.js +17 -0
- package/dist/zonos-elements/p-c803753e.entry.js +1 -0
- package/dist/zonos-elements/{p-e640e8b8.entry.js → p-cbb01de9.entry.js} +1 -1
- package/dist/zonos-elements/p-ce15d62d.system.js +1 -0
- package/dist/zonos-elements/p-d291e964.system.entry.js +1 -0
- package/dist/zonos-elements/p-d3485a03.system.js +1 -0
- package/dist/zonos-elements/{p-59eaebe3.system.entry.js → p-de626806.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e5388438.system.entry.js +1 -0
- package/dist/zonos-elements/p-e77b6e42.entry.js +1 -0
- package/dist/zonos-elements/p-ea8aff21.system.js +17 -0
- package/dist/zonos-elements/{p-7ab62a26.system.entry.js → p-eb6a35ce.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-92cc26b7.system.entry.js → p-ee6f8c02.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a98b1e8d.entry.js → p-efa6203f.entry.js} +1 -1
- package/dist/zonos-elements/{p-edc77ea1.entry.js → p-f4fa8720.entry.js} +1 -1
- package/dist/zonos-elements/{p-ebaaaee9.entry.js → p-fa90adb8.entry.js} +1 -1
- package/dist/zonos-elements/p-fe7e2dc4.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/zonos-card.cjs.entry.js +0 -49
- package/dist/esm/zonos-card.entry.js +0 -45
- package/dist/esm-es5/cart-bb0ee971.js +0 -1
- package/dist/esm-es5/localization-d8326254.js +0 -1
- package/dist/esm-es5/paypal-bd4520eb.js +0 -17
- package/dist/esm-es5/zonos-banner.entry.js +0 -1
- package/dist/esm-es5/zonos-card.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_14.entry.js +0 -1
- package/dist/zonos-elements/p-043f57e8.system.entry.js +0 -1
- package/dist/zonos-elements/p-0631d2b9.js +0 -1
- package/dist/zonos-elements/p-0a6ac265.system.js +0 -1
- package/dist/zonos-elements/p-0f041dc5.system.entry.js +0 -1
- package/dist/zonos-elements/p-1432a217.system.entry.js +0 -1
- package/dist/zonos-elements/p-1b51b738.system.entry.js +0 -1
- package/dist/zonos-elements/p-3a1513ae.system.entry.js +0 -1
- package/dist/zonos-elements/p-3b8d11dd.entry.js +0 -1
- package/dist/zonos-elements/p-4333afcb.entry.js +0 -1
- package/dist/zonos-elements/p-4d0d89da.system.entry.js +0 -1
- package/dist/zonos-elements/p-5dd9cb44.system.entry.js +0 -1
- package/dist/zonos-elements/p-605a21ac.entry.js +0 -1
- package/dist/zonos-elements/p-674981ad.system.js +0 -1
- package/dist/zonos-elements/p-6d090b53.entry.js +0 -1
- package/dist/zonos-elements/p-73c8c551.system.entry.js +0 -1
- package/dist/zonos-elements/p-795d223d.entry.js +0 -1
- package/dist/zonos-elements/p-8218ff62.system.entry.js +0 -1
- package/dist/zonos-elements/p-82f80c8a.entry.js +0 -1
- package/dist/zonos-elements/p-88f7256d.js +0 -1
- package/dist/zonos-elements/p-8b083884.entry.js +0 -1
- package/dist/zonos-elements/p-a449940d.entry.js +0 -1
- package/dist/zonos-elements/p-a5a4ad2f.entry.js +0 -1
- package/dist/zonos-elements/p-a5d45585.system.entry.js +0 -1
- package/dist/zonos-elements/p-a751e819.system.entry.js +0 -1
- package/dist/zonos-elements/p-ad556be6.entry.js +0 -1
- package/dist/zonos-elements/p-b4792af0.entry.js +0 -1
- package/dist/zonos-elements/p-b9ff6458.entry.js +0 -1
- package/dist/zonos-elements/p-d3dbae8c.system.js +0 -1
- package/dist/zonos-elements/p-ebb9b902.system.js +0 -17
- package/dist/zonos-elements/p-ef1ce617.system.entry.js +0 -1
- package/dist/zonos-elements/p-ef75da6f.js +0 -17
- package/dist/zonos-elements/p-f3dbe934.entry.js +0 -1
- package/dist/zonos-elements/p-f741407e.system.entry.js +0 -1
|
@@ -0,0 +1,811 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-1c710d00.js');
|
|
6
|
+
const cart = require('./cart-9a9ae4b9.js');
|
|
7
|
+
const paypal = require('./paypal-9ee374a0.js');
|
|
8
|
+
const localization = require('./localization-0169b27d.js');
|
|
9
|
+
const translationStore = require('./translationStore-0c67178f.js');
|
|
10
|
+
const zonosStore = require('./zonosStore-f8ee56aa.js');
|
|
11
|
+
const handleFetch = require('./handleFetch-45f35cac.js');
|
|
12
|
+
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
13
|
+
const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
|
|
14
|
+
const isCollectMobileTablet = require('./isCollectMobileTablet-7a9413e3.js');
|
|
15
|
+
const classes = require('./classes-b7918f56.js');
|
|
16
|
+
const ILanguage = require('./ILanguage-98b04442.js');
|
|
17
|
+
const placeTestOrder = require('./placeTestOrder-0dfff170.js');
|
|
18
|
+
require('./isDarkColor-428965f4.js');
|
|
19
|
+
require('./VarianceTest-0cb1e118.js');
|
|
20
|
+
|
|
21
|
+
const RemoveIcon = `<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
22
|
+
|
|
23
|
+
const SuccessIcon = `<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
24
|
+
|
|
25
|
+
const zonosCollectFinishCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";
|
|
26
|
+
const ZonosCollectFinishStyle0 = zonosCollectFinishCss;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Maximum number of retries to pull order info (gap between each retry is 1 second)
|
|
30
|
+
*/
|
|
31
|
+
const MAX_RETRIES = 30;
|
|
32
|
+
const ZonosCollectFinish = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
index.registerInstance(this, hostRef);
|
|
35
|
+
this.closeClick = index.createEvent(this, "closeClick", 7);
|
|
36
|
+
/**
|
|
37
|
+
* The border radius style of the dialog
|
|
38
|
+
*/
|
|
39
|
+
this.borderRadius = 'ROUNDED';
|
|
40
|
+
/**
|
|
41
|
+
* The confirmation id for the collect order
|
|
42
|
+
*/
|
|
43
|
+
this.confirmationId = null;
|
|
44
|
+
this.isLoading = true;
|
|
45
|
+
this.notificationType = 'success';
|
|
46
|
+
this.notificationTitle = '';
|
|
47
|
+
this.notificationMessages = [];
|
|
48
|
+
this.notificationActionText = translationStore.translate('Keep shopping');
|
|
49
|
+
this.order = null;
|
|
50
|
+
/**
|
|
51
|
+
* Is waiting to redirect to a different page
|
|
52
|
+
*/
|
|
53
|
+
this.isWaitingToRedirect = true;
|
|
54
|
+
this.pullOrder = async () => {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
57
|
+
const searchParams = new URLSearchParams();
|
|
58
|
+
searchParams.set('checkoutSessionId', checkoutSessionId || '');
|
|
59
|
+
const { baseUrl, errors, json } = await handleFetch.handleFetch(`/api/zonos-elements/get-order?${searchParams.toString()}`);
|
|
60
|
+
if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
|
|
61
|
+
return {
|
|
62
|
+
baseUrl,
|
|
63
|
+
order: null,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// onOrderSuccess callback may be provided on Zonos.init
|
|
67
|
+
await ((_b = (_a = zonosStore.zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, {
|
|
68
|
+
zonosApiRoute: baseUrl,
|
|
69
|
+
zonosOrder: json,
|
|
70
|
+
}));
|
|
71
|
+
return {
|
|
72
|
+
baseUrl,
|
|
73
|
+
order: json,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
this.handleSuccessBehavior = async () => {
|
|
77
|
+
// Do nothing, display Zonos success page
|
|
78
|
+
this.isLoading = false;
|
|
79
|
+
await this.getPullOrder();
|
|
80
|
+
};
|
|
81
|
+
// TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
|
|
82
|
+
this.getPullOrder = async (attempts = 0) => {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
if (attempts === 0) {
|
|
85
|
+
handleFetch.log('=== Start to poll for order info', 'info');
|
|
86
|
+
}
|
|
87
|
+
const { baseUrl, order } = await this.pullOrder();
|
|
88
|
+
const foundLegacyOrderNumber = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
|
|
89
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
90
|
+
const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
|
|
91
|
+
'0') || MAX_RETRIES;
|
|
92
|
+
handleFetch.log(`=== Polling order (${attempts} attemps)`, 'info');
|
|
93
|
+
if (
|
|
94
|
+
// Order found, in legacy checkout facade and still haven't found the legacy order number
|
|
95
|
+
order) {
|
|
96
|
+
handleFetch.log('=== CollectOrder info found', 'info');
|
|
97
|
+
if (attempts > 10) {
|
|
98
|
+
// Log out all the logs if we have tried more than 10 times
|
|
99
|
+
void handleFetch.sendErrorLog({
|
|
100
|
+
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
|
|
101
|
+
errors: [`Collect order found after ${attempts} attempts`],
|
|
102
|
+
metadata: {
|
|
103
|
+
allLogs: handleFetch.allLogs,
|
|
104
|
+
checkoutSessionId: localization.storageStore.checkoutSessionId || '',
|
|
105
|
+
orderId: order.id,
|
|
106
|
+
storeId: zonosStore.zonosStore.storeId,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
this.order = order;
|
|
111
|
+
}
|
|
112
|
+
else if ((!order || !foundLegacyOrderNumber) && attempts < maxRetries) {
|
|
113
|
+
// Wait for 1 second before the next attempt
|
|
114
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
115
|
+
await this.getPullOrder(attempts + 1);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
void handleFetch.sendErrorLog({
|
|
119
|
+
endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
|
|
120
|
+
errors: [`Collect order not found after ${maxRetries} attempts`],
|
|
121
|
+
metadata: {
|
|
122
|
+
allLogs: handleFetch.allLogs,
|
|
123
|
+
checkoutSessionId: localization.storageStore.checkoutSessionId || '',
|
|
124
|
+
storeId: zonosStore.zonosStore.storeId,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
this.checkStripePaymentStatus = async () => {
|
|
130
|
+
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || cart.stripeStore.clientSecret;
|
|
131
|
+
if (clientSecret || this.storybookForceStatus) {
|
|
132
|
+
const { error, messages, status } = await cart.stripeStoreRetrievePayment({
|
|
133
|
+
clientSecret,
|
|
134
|
+
storybookForceStatus: this.storybookForceStatus,
|
|
135
|
+
});
|
|
136
|
+
const isError = status === 'requires_action' || error;
|
|
137
|
+
this.notificationType = isError ? 'error' : 'success';
|
|
138
|
+
this.notificationMessages = messages || [];
|
|
139
|
+
this.notificationTitle = isError
|
|
140
|
+
? translationStore.translate('Payment failed')
|
|
141
|
+
: translationStore.translate("You're all set!");
|
|
142
|
+
handleFetch.log('=== Payment intent retrieve status', 'info', {
|
|
143
|
+
clientSecret,
|
|
144
|
+
error,
|
|
145
|
+
messages,
|
|
146
|
+
status,
|
|
147
|
+
});
|
|
148
|
+
// remove the client secret from the url
|
|
149
|
+
const url = new URL(window.location.href);
|
|
150
|
+
url.searchParams.delete('payment_intent_client_secret');
|
|
151
|
+
url.searchParams.delete('payment_intent');
|
|
152
|
+
url.searchParams.delete('redirect_status');
|
|
153
|
+
// Clean up the url if it's a redirect behavior
|
|
154
|
+
url.searchParams.delete('zonosCheckoutSessionId');
|
|
155
|
+
window.history.replaceState({}, '', url.toString());
|
|
156
|
+
// Payment doesn't go through
|
|
157
|
+
if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
|
|
158
|
+
paypal.submitGtag('zonos-checkout-payment-fail');
|
|
159
|
+
void handleFetch.sendErrorLog({
|
|
160
|
+
endpoint: 'Stripe payment failed',
|
|
161
|
+
errors: [
|
|
162
|
+
`Payment intent "${clientSecret.split('_secret_')[0] || clientSecret}" status: ${status} - checkout session: ${localization.storageStore.checkoutSessionId}`,
|
|
163
|
+
],
|
|
164
|
+
metadata: {
|
|
165
|
+
allLogs: handleFetch.allLogs,
|
|
166
|
+
credentialToken: window.Zonos.zonosApiKey,
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
paypal.submitGtag('zonos-checkout-success');
|
|
172
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
173
|
+
void cart.trackConversionEvent({
|
|
174
|
+
checkoutSessionId,
|
|
175
|
+
eventName: 'checkout_orderCompleted',
|
|
176
|
+
});
|
|
177
|
+
const successEvent = createCustomEvent.createCustomEvent('zonos-checkout-success', {
|
|
178
|
+
message: 'Zonos Checkout successfully processed order',
|
|
179
|
+
});
|
|
180
|
+
document.dispatchEvent(successEvent);
|
|
181
|
+
// wait this to finish before resetting store and checkout session id
|
|
182
|
+
await this.handleSuccessBehavior();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Make sure to stop the loading spinner even when there's an error
|
|
186
|
+
this.isLoading = false;
|
|
187
|
+
// reset promo when checkout is finished
|
|
188
|
+
cart.stripeStoreResetPromoCode();
|
|
189
|
+
cart.stripeStoreReset();
|
|
190
|
+
localization.storageStore.checkoutSessionId = null;
|
|
191
|
+
};
|
|
192
|
+
this.checkStagingOrderStatus = async () => {
|
|
193
|
+
this.notificationType = 'success';
|
|
194
|
+
this.notificationTitle = translationStore.translate("You're all set!");
|
|
195
|
+
this.notificationMessages =
|
|
196
|
+
cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
|
|
197
|
+
await this.handleSuccessBehavior();
|
|
198
|
+
// reset promo when checkout is finished
|
|
199
|
+
cart.stripeStoreResetPromoCode();
|
|
200
|
+
cart.stripeStoreReset();
|
|
201
|
+
paypal.paypalStoreReset();
|
|
202
|
+
localization.storageStore.checkoutSessionId = null;
|
|
203
|
+
};
|
|
204
|
+
this.checkPaypalPaymentStatus = async () => {
|
|
205
|
+
// render error message if there's an error
|
|
206
|
+
if (paypal.paypalStore.paypalErrorMessage) {
|
|
207
|
+
this.notificationType = 'error';
|
|
208
|
+
this.notificationTitle = translationStore.translate('Payment failed');
|
|
209
|
+
this.notificationMessages = [paypal.paypalStore.paypalErrorMessage];
|
|
210
|
+
this.isLoading = false;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
// show success message right away when order id is already created
|
|
214
|
+
this.isLoading = false;
|
|
215
|
+
if (paypal.paypalStore.orderIdCreated) {
|
|
216
|
+
paypal.submitGtag('zonos-checkout-success');
|
|
217
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
218
|
+
void cart.trackConversionEvent({
|
|
219
|
+
checkoutSessionId,
|
|
220
|
+
eventName: 'checkout_orderCompleted',
|
|
221
|
+
});
|
|
222
|
+
this.notificationType = 'success';
|
|
223
|
+
this.notificationTitle = translationStore.translate("You're all set!");
|
|
224
|
+
this.notificationMessages =
|
|
225
|
+
cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
|
|
226
|
+
// wait this to finish before resetting store and checkout session id
|
|
227
|
+
await this.handleSuccessBehavior();
|
|
228
|
+
}
|
|
229
|
+
// reset promo when checkout is finished
|
|
230
|
+
cart.stripeStoreResetPromoCode();
|
|
231
|
+
cart.stripeStoreReset();
|
|
232
|
+
paypal.paypalStoreReset();
|
|
233
|
+
localization.storageStore.checkoutSessionId = null;
|
|
234
|
+
};
|
|
235
|
+
this.getReceiptUrl = ({ cartId }) => {
|
|
236
|
+
const hostUrl = new URL(`${window.location.origin}/receipt`);
|
|
237
|
+
hostUrl.searchParams.set('referenceId', cartId);
|
|
238
|
+
// is test mode
|
|
239
|
+
const isTestMode = handleFetch.getIsTestMode();
|
|
240
|
+
if (isTestMode) {
|
|
241
|
+
hostUrl.searchParams.set('zonosTestMode', '1');
|
|
242
|
+
}
|
|
243
|
+
// Carry over the zonosQaUrl if it exists
|
|
244
|
+
const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
|
|
245
|
+
if (zonosQaUrl) {
|
|
246
|
+
hostUrl.searchParams.set('zonosQaUrl', zonosQaUrl);
|
|
247
|
+
}
|
|
248
|
+
return hostUrl.toString();
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
componentDidLoad() {
|
|
252
|
+
if (this.overrideNotification) {
|
|
253
|
+
// just show the notification and don't check any of the payment status
|
|
254
|
+
this.notificationType = this.overrideNotification.type;
|
|
255
|
+
this.notificationTitle = this.overrideNotification.title;
|
|
256
|
+
this.notificationMessages = this.overrideNotification.messages;
|
|
257
|
+
this.isLoading = false;
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (cart.cartStore.isStagingMode) {
|
|
261
|
+
void this.checkStagingOrderStatus();
|
|
262
|
+
}
|
|
263
|
+
else if (paypal.paypalStore.orderIdCreated) {
|
|
264
|
+
void this.checkPaypalPaymentStatus();
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
void this.checkStripePaymentStatus();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
render() {
|
|
271
|
+
const cartId = window.Zonos.cartId;
|
|
272
|
+
return (index.h(index.Host, { key: 'e145b7396302157ccb515c54f99e50faa8ba45e6', class: "zonos--checkout-finish zonos--elements", style: {
|
|
273
|
+
'--zonos--border-radius': getBorderRadius.getBorderRadius({
|
|
274
|
+
overrideBorderStyle: this.borderRadius,
|
|
275
|
+
}),
|
|
276
|
+
} }, !this.isLoading && (index.h("div", { key: 'b9df4788f27c935ba7fc47e7c930cd162c8fbebe', class: "zonos--finish-details" }, index.h("div", { key: 'a510c995880c8698dc98390d0504b70333551c86', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '8f84f87bf2365b85acffefe16e8b10cd9227a6e6', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (index.h("zonos-badge", { key: '0e3f3f71cae6262d6394ad2c5a6d656509b484d5', badgeColor: "gray" }, this.confirmationId)), index.h("zonos-text", { key: 'c769f2ada1e6b421e373aeb4393560a21d6fcffc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.order && cartId && (index.h("div", { key: '9972858fadd4d2d9c4f00e54921002ea04a5cc51', class: "zonos--button-container" }, index.h("zonos-button", { key: 'fe931a552fc1c43b29a1966736379c3c1d0536f6', onClick: () => {
|
|
277
|
+
window.open(this.getReceiptUrl({ cartId }), '_blank');
|
|
278
|
+
}, size: "lg", variant: "primary" }, translationStore.translate('View receipt')))))))));
|
|
279
|
+
}
|
|
280
|
+
static get assetsDirs() { return ["assets"]; }
|
|
281
|
+
};
|
|
282
|
+
ZonosCollectFinish.style = ZonosCollectFinishStyle0;
|
|
283
|
+
|
|
284
|
+
const Globe = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">
|
|
285
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>
|
|
286
|
+
</svg>
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
const ZonosWordmark = `<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
290
|
+
<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>
|
|
291
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>
|
|
292
|
+
<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>
|
|
293
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>
|
|
294
|
+
<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>
|
|
295
|
+
</svg>
|
|
296
|
+
`;
|
|
297
|
+
|
|
298
|
+
const zonosCollectFooterCss = ":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{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";
|
|
299
|
+
const ZonosCollectFooterStyle0 = zonosCollectFooterCss;
|
|
300
|
+
|
|
301
|
+
const ZonosCollectFooter = class {
|
|
302
|
+
constructor(hostRef) {
|
|
303
|
+
index.registerInstance(this, hostRef);
|
|
304
|
+
/**
|
|
305
|
+
* Override mobile mode
|
|
306
|
+
*/
|
|
307
|
+
this.mobile = false;
|
|
308
|
+
/**
|
|
309
|
+
* Override tablet mode
|
|
310
|
+
*/
|
|
311
|
+
this.tablet = false;
|
|
312
|
+
this.showLanguageDialog = false;
|
|
313
|
+
this.isMobile = false;
|
|
314
|
+
this.isTablet = false;
|
|
315
|
+
}
|
|
316
|
+
handleGlobalClick(e) {
|
|
317
|
+
if (!this.el.contains(e.target) && this.showLanguageDialog) {
|
|
318
|
+
this.showLanguageDialog = false;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
toggleLanguageDialog() {
|
|
322
|
+
this.showLanguageDialog = !this.showLanguageDialog;
|
|
323
|
+
}
|
|
324
|
+
handleMobileChange() {
|
|
325
|
+
this.isMobile = isCollectMobileTablet.isCollectMobile(this.mobile);
|
|
326
|
+
}
|
|
327
|
+
handleTabletChange() {
|
|
328
|
+
this.isTablet = isCollectMobileTablet.isCollectTablet(this.tablet);
|
|
329
|
+
}
|
|
330
|
+
componentWillLoad() {
|
|
331
|
+
this.isMobile = isCollectMobileTablet.isCollectMobile(this.mobile);
|
|
332
|
+
this.isTablet = isCollectMobileTablet.isCollectTablet(this.tablet);
|
|
333
|
+
}
|
|
334
|
+
render() {
|
|
335
|
+
var _a;
|
|
336
|
+
const languageLabel = (_a = ILanguage.languages.find(x => x.code === localization.localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
|
|
337
|
+
// reverse color when on desktop. With the coversheet backdrop, the color should be white
|
|
338
|
+
const colorDesktop = 'gray-1000';
|
|
339
|
+
return (index.h(index.Host, { key: '9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e', class: classes.classes([
|
|
340
|
+
'zonos--elements',
|
|
341
|
+
this.isMobile && 'mobile',
|
|
342
|
+
this.isTablet && 'tablet',
|
|
343
|
+
]) }, index.h("div", { key: '250716798bf30901678b16e1ac159810f1d7a6ad', class: "zonos--collect-footer" }, index.h("div", { key: 'ab61803d4b5348b8978e7dfcb16a5733cca5dd29', class: "zonos--collect-locale-wrapper" }, index.h("zonos-button", { key: '6c5dcd25d5ef73b2098269d840e291343d30cb81', buttonColor: colorDesktop, class: "zonos--collect-footer-language-button", icon: index.h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), index.h("div", { key: 'd1a367cd19b36f1a0f49ccfe78e750218b50a03e', class: classes.classes([
|
|
344
|
+
'zonos--collect-language-dialog',
|
|
345
|
+
this.showLanguageDialog &&
|
|
346
|
+
'zonos--collect-language-dialog-open',
|
|
347
|
+
]) }, index.h("zonos-language-select", { key: '02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c', handleOnClose: () => this.toggleLanguageDialog() }))), index.h("div", { key: 'b713a78cbd3d3f131c6c473bb1d979899d40b13b', class: "zonos--collect-footer-icon-wrapper" }, index.h("div", { key: '97eab5909d556f13fa2acc0628d583d49f13d3a2', class: "zonos--collect-footer-logo" }, index.h("zonos-text", { key: 'a6488e084f153305eed8d6f65341d7ab00297adb', textColor: colorDesktop }, "Powered by"), index.h("a", { key: 'c63a6e1064dbd733add1cc3b1df1456484e2f103', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, index.h("zonos-icon", { key: '081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7', autoHeight: true, content: ZonosWordmark, size: 42 }))), index.h("div", { key: '0862a11838e62f425d38066230b01f445999d751', class: "dot" }), index.h("a", { key: 'b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, index.h("zonos-text", { key: 'a675218a36da83427c2ce517a15b1ed5ea5910d6', textColor: colorDesktop }, "Privacy policy"))))));
|
|
348
|
+
}
|
|
349
|
+
get el() { return index.getElement(this); }
|
|
350
|
+
static get watchers() { return {
|
|
351
|
+
"mobile": ["handleMobileChange"],
|
|
352
|
+
"tablet": ["handleTabletChange"]
|
|
353
|
+
}; }
|
|
354
|
+
};
|
|
355
|
+
ZonosCollectFooter.style = ZonosCollectFooterStyle0;
|
|
356
|
+
|
|
357
|
+
const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
358
|
+
|
|
359
|
+
const ChevronUpIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
|
|
360
|
+
|
|
361
|
+
const zonosCollectOrderDetailsCss = ":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";
|
|
362
|
+
const ZonosCollectOrderDetailsStyle0 = zonosCollectOrderDetailsCss;
|
|
363
|
+
|
|
364
|
+
const ZonosCollectOrderDetails = class {
|
|
365
|
+
constructor(hostRef) {
|
|
366
|
+
index.registerInstance(this, hostRef);
|
|
367
|
+
this.collapseClicked = index.createEvent(this, "collapseClicked", 7);
|
|
368
|
+
/**
|
|
369
|
+
* Whether or not the component is being rendered with mobile styles
|
|
370
|
+
*/
|
|
371
|
+
this.mobile = true;
|
|
372
|
+
/**
|
|
373
|
+
* The landed cost id that is used to fetch the shipping address
|
|
374
|
+
*/
|
|
375
|
+
this.landedCostId = '';
|
|
376
|
+
this.isMobile = false;
|
|
377
|
+
this.collapseState = this.collapsed;
|
|
378
|
+
}
|
|
379
|
+
handleCollapseChangeFromProp(collapsed) {
|
|
380
|
+
this.collapseState = collapsed;
|
|
381
|
+
}
|
|
382
|
+
handleCollapseChange(collapsed) {
|
|
383
|
+
this.collapseClicked.emit(collapsed);
|
|
384
|
+
}
|
|
385
|
+
handleWindowResize() {
|
|
386
|
+
this.isMobile = handleFetch.isCheckoutMobile(this.mobile);
|
|
387
|
+
}
|
|
388
|
+
componentWillLoad() {
|
|
389
|
+
this.handleWindowResize();
|
|
390
|
+
}
|
|
391
|
+
renderShippingAddress() {
|
|
392
|
+
if (isCollectMobileTablet.collectStore.isFetchingShippingInfo) {
|
|
393
|
+
return (index.h("div", { class: "zonos--collect-order-details-column" }, index.h("zonos-text", { type: "smallHeader" }, index.h("zonos-skeleton", { skeletonWidth: "99px" })), index.h("div", { class: "zonos--collect-order-shipping-info" }, index.h("zonos-skeleton", { skeletonWidth: "152px" }), index.h("zonos-h-stack", { spacing: 8 }, index.h("zonos-skeleton", { skeletonWidth: "75px" }), index.h("zonos-skeleton", { skeletonWidth: "75px" })), index.h("zonos-skeleton", { skeletonWidth: "50px" }))));
|
|
394
|
+
}
|
|
395
|
+
const shippingAddress = isCollectMobileTablet.collectStore.shippingAddress;
|
|
396
|
+
if (!shippingAddress) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
return (index.h("div", { class: "zonos--collect-order-details-column" }, index.h("zonos-text", { type: "smallHeader" }, translationStore.translate('Shipping address')), index.h("div", { class: "zonos--collect-order-shipping-info" }, [
|
|
400
|
+
[shippingAddress.location.line1, shippingAddress.location.line2]
|
|
401
|
+
.filter(Boolean)
|
|
402
|
+
.join(' '),
|
|
403
|
+
[
|
|
404
|
+
shippingAddress.location.locality,
|
|
405
|
+
shippingAddress.location.administrativeAreaCode,
|
|
406
|
+
shippingAddress.location.postalCode,
|
|
407
|
+
]
|
|
408
|
+
.filter(Boolean)
|
|
409
|
+
.join(', '),
|
|
410
|
+
shippingAddress.location.countryCode,
|
|
411
|
+
].map(item => (index.h("zonos-text", null, item))))));
|
|
412
|
+
}
|
|
413
|
+
render() {
|
|
414
|
+
const renderCollapseIcon = () => {
|
|
415
|
+
if (this.collapseState) {
|
|
416
|
+
return (index.h("zonos-icon", { "aria-label": "Collapse expanded section", content: ChevronDownIcon, iconColor: "gray-1200" }));
|
|
417
|
+
}
|
|
418
|
+
return (index.h("zonos-icon", { "aria-label": "Expand collapsed section", content: ChevronUpIcon, iconColor: "gray-1200" }));
|
|
419
|
+
};
|
|
420
|
+
return (index.h(index.Host, { class: classes.classes([
|
|
421
|
+
'zonos--collect-order-details zonos--elements',
|
|
422
|
+
this.isMobile && 'mobile',
|
|
423
|
+
]) }, index.h("div", { class: "zonos--wrapper" }, index.h("button", { class: "zonos--order-details-header", onClick: () => {
|
|
424
|
+
this.collapseState = !this.collapseState;
|
|
425
|
+
}, type: "button" }, index.h("zonos-text", { type: "semiBoldLabel" }, translationStore.translate('Order details')), renderCollapseIcon()), index.h("div", { class: "zonos--order-details-wrapper" }, index.h("zonos-collapse", { collapsed: this.collapseState }, index.h("div", { class: "zonos--collect-order-details-content" }, index.h("zonos-collect-cart-items", null), index.h("div", { class: "zonos--collect-order-info" }, index.h("div", { class: "zonos--collect-order-details-row" }, isCollectMobileTablet.collectStore.amountTotalPaid !== null && (index.h("div", { class: "zonos--collect-order-details-column" }, index.h("zonos-text", { type: "smallHeader" }, translationStore.translate('Total paid')), index.h("zonos-text", null, placeTestOrder.renderCheckoutCurrency({
|
|
426
|
+
amount: isCollectMobileTablet.collectStore.amountTotalPaid || 0,
|
|
427
|
+
isForeign: true,
|
|
428
|
+
})))), isCollectMobileTablet.collectStore.originCompanyName && (index.h("div", { class: "zonos--collect-order-details-column" }, index.h("zonos-text", { type: "smallHeader" }, translationStore.translate('Ordered from')), index.h("zonos-text", null, isCollectMobileTablet.collectStore.originCompanyName || '')))), this.renderShippingAddress())))))));
|
|
429
|
+
}
|
|
430
|
+
static get assetsDirs() { return ["assets"]; }
|
|
431
|
+
static get watchers() { return {
|
|
432
|
+
"collapsed": ["handleCollapseChangeFromProp"],
|
|
433
|
+
"collapseState": ["handleCollapseChange"]
|
|
434
|
+
}; }
|
|
435
|
+
};
|
|
436
|
+
ZonosCollectOrderDetails.style = ZonosCollectOrderDetailsStyle0;
|
|
437
|
+
|
|
438
|
+
const CheckmarkLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
|
|
439
|
+
|
|
440
|
+
const RemoveLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
|
|
441
|
+
|
|
442
|
+
const zonosCollectPaymentCss = ".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-5px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";
|
|
443
|
+
const ZonosCollectPaymentStyle0 = zonosCollectPaymentCss;
|
|
444
|
+
|
|
445
|
+
const ZonosCollectPayment = class {
|
|
446
|
+
constructor(hostRef) {
|
|
447
|
+
index.registerInstance(this, hostRef);
|
|
448
|
+
this.continueClicked = index.createEvent(this, "continueClicked", 7);
|
|
449
|
+
this.paypalSessionFailed = index.createEvent(this, "paypalSessionFailed", 7);
|
|
450
|
+
this.paypalSessionDone = index.createEvent(this, "paypalSessionDone", 7);
|
|
451
|
+
this.storeUnsubscribeList = [];
|
|
452
|
+
/**
|
|
453
|
+
* Whether or not the continue button is loading
|
|
454
|
+
*/
|
|
455
|
+
this.continueLoading = false;
|
|
456
|
+
/**
|
|
457
|
+
* Show error banner when the form is not complete, and user clicks on `Submit` button
|
|
458
|
+
* @default false
|
|
459
|
+
*/
|
|
460
|
+
this.showErrorBanner = false;
|
|
461
|
+
/**
|
|
462
|
+
* Show payment error banner when the payment is failed
|
|
463
|
+
*/
|
|
464
|
+
this.hasStripePaymentError = false;
|
|
465
|
+
/**
|
|
466
|
+
* Error message when the staging order creation is failed
|
|
467
|
+
*/
|
|
468
|
+
this.stagingOrderCreateErrorMessage = '';
|
|
469
|
+
/**
|
|
470
|
+
* Internal state to handle continue loading
|
|
471
|
+
*/
|
|
472
|
+
this.internalContinueLoading = this.continueLoading;
|
|
473
|
+
this.handleValidate = () => {
|
|
474
|
+
var _a;
|
|
475
|
+
return !!((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
|
|
476
|
+
};
|
|
477
|
+
/**
|
|
478
|
+
* handler for continue button click
|
|
479
|
+
*/
|
|
480
|
+
this.continueClickHandler = async ({ currencyCode, }) => {
|
|
481
|
+
var _a, _b;
|
|
482
|
+
if (!this.handleValidate()) {
|
|
483
|
+
// Attempt to get the value of the billing address element to validate the form
|
|
484
|
+
void ((_a = cart.stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
|
|
485
|
+
this.showErrorBanner = true;
|
|
486
|
+
// Attempt to submit the form so the missing input error will be shown in Stripe
|
|
487
|
+
void ((_b = cart.stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
|
|
488
|
+
setTimeout(() => {
|
|
489
|
+
var _a;
|
|
490
|
+
(_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
491
|
+
behavior: 'smooth',
|
|
492
|
+
});
|
|
493
|
+
}, 10);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
cart.stripeStore.checkoutSettlementCurrency = currencyCode;
|
|
497
|
+
// submit google tag when the form is complete
|
|
498
|
+
paypal.submitGtag('zonos-checkout-payment-info');
|
|
499
|
+
this.continueClicked.emit();
|
|
500
|
+
};
|
|
501
|
+
this.copyCardToClipboard = async (cardNumber) => {
|
|
502
|
+
try {
|
|
503
|
+
await navigator.clipboard.writeText(cardNumber);
|
|
504
|
+
}
|
|
505
|
+
catch (_a) {
|
|
506
|
+
// Copy happens in the iframe and it's not allowed to copy to the clipboard
|
|
507
|
+
const hiddenTextarea = document.createElement('textarea');
|
|
508
|
+
hiddenTextarea.style.position = 'fixed';
|
|
509
|
+
hiddenTextarea.style.left = '-1000px';
|
|
510
|
+
hiddenTextarea.style.top = '-1000px';
|
|
511
|
+
hiddenTextarea.style.width = '1px';
|
|
512
|
+
hiddenTextarea.style.height = '1px';
|
|
513
|
+
hiddenTextarea.value = cardNumber;
|
|
514
|
+
hiddenTextarea.id = 'zonos-copy-card-number';
|
|
515
|
+
document.body.appendChild(hiddenTextarea);
|
|
516
|
+
hiddenTextarea.select();
|
|
517
|
+
// Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
|
|
518
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
519
|
+
document.execCommand('copy');
|
|
520
|
+
document.body.removeChild(hiddenTextarea);
|
|
521
|
+
}
|
|
522
|
+
window.Zonos.showNotification({
|
|
523
|
+
message: translationStore.translate('Card number copied to clipboard'),
|
|
524
|
+
timeout: 4000,
|
|
525
|
+
type: 'success',
|
|
526
|
+
});
|
|
527
|
+
};
|
|
528
|
+
this.placeTestOrder = async () => {
|
|
529
|
+
this.internalContinueLoading = true;
|
|
530
|
+
const { errors } = await placeTestOrder.placeTestOrder();
|
|
531
|
+
if (errors.length) {
|
|
532
|
+
this.stagingOrderCreateErrorMessage =
|
|
533
|
+
errors[0] || 'Failed to create staging order. Please try again.';
|
|
534
|
+
this.internalContinueLoading = false;
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
this.internalContinueLoading = false;
|
|
538
|
+
// continue to the next step
|
|
539
|
+
cart.cartStoreNextStep();
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
continueLoadingWatcher() {
|
|
543
|
+
this.internalContinueLoading = this.continueLoading;
|
|
544
|
+
}
|
|
545
|
+
stripePaymentErrorWatcher() {
|
|
546
|
+
if (this.hasStripePaymentError) {
|
|
547
|
+
setTimeout(() => {
|
|
548
|
+
var _a;
|
|
549
|
+
// scroll to the top of the page when the payment error is shown
|
|
550
|
+
(_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
551
|
+
behavior: 'smooth',
|
|
552
|
+
});
|
|
553
|
+
}, 50);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
componentWillLoad() {
|
|
557
|
+
this.storeUnsubscribeList = [
|
|
558
|
+
cart.cartStoreOnChange('currency', () => {
|
|
559
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
560
|
+
void paypal.paypalInitScript({
|
|
561
|
+
currency: cart.cartStore.currency,
|
|
562
|
+
});
|
|
563
|
+
}),
|
|
564
|
+
];
|
|
565
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
566
|
+
void paypal.paypalInitScript({
|
|
567
|
+
currency: cart.cartStore.currency,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
disconnectedCallback() {
|
|
571
|
+
this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
|
|
572
|
+
}
|
|
573
|
+
render() {
|
|
574
|
+
var _a;
|
|
575
|
+
this.hasStripePaymentError = cart.stripeStore.hasPaymentError;
|
|
576
|
+
if (!cart.stripeStore.stripeElements) {
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
if (!cart.stripeStore.clientSecret) {
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
// start validate on typing after error banner is shown, and hide it if the form is complete
|
|
583
|
+
if (this.showErrorBanner) {
|
|
584
|
+
this.showErrorBanner = !this.handleValidate();
|
|
585
|
+
}
|
|
586
|
+
const isTestMode = handleFetch.getIsTestMode();
|
|
587
|
+
const isStagingMode = cart.cartStore.isStagingMode || handleFetch.getIsStagingMode();
|
|
588
|
+
const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
589
|
+
const renderPayment = () => {
|
|
590
|
+
if (isStagingMode) {
|
|
591
|
+
// If in mobile, use the theme from the store since the UI is solely by theme
|
|
592
|
+
const theme = zonosStore.zonosStore.appearance.theme;
|
|
593
|
+
return (index.h(index.Fragment, null, this.stagingOrderCreateErrorMessage && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), index.h("zonos-empty-state-payment", { emptyStateText: translationStore.translate('No payment method needed for staging'), theme: theme }), index.h("div", { class: "zonos--group-btn" }, index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
|
|
594
|
+
void this.placeTestOrder();
|
|
595
|
+
}, size: "lg",
|
|
596
|
+
// use primary type when on mobile mode
|
|
597
|
+
variant: this.submitBtnType }, translationStore.translate('Place test order')))));
|
|
598
|
+
}
|
|
599
|
+
if (cart.stripeStore.isFetchingSession ||
|
|
600
|
+
isCollectMobileTablet.collectStore.isFetchingShippingInfo) {
|
|
601
|
+
return null;
|
|
602
|
+
}
|
|
603
|
+
return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translationStore.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
|
|
604
|
+
translationStore.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
605
|
+
cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
606
|
+
cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
607
|
+
if (!cart.cartStore.checkoutSession) {
|
|
608
|
+
handleFetch.log('Checkout session is not found');
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
await this.continueClickHandler({
|
|
612
|
+
currencyCode: cart.cartStore.checkoutSession.subtotals
|
|
613
|
+
.presentmentCurrencyCode,
|
|
614
|
+
});
|
|
615
|
+
}, size: "lg",
|
|
616
|
+
// use primary type when on mobile mode
|
|
617
|
+
variant: this.submitBtnType }, translationStore.translate('Pay [orderTotal]', {
|
|
618
|
+
orderTotal: placeTestOrder.renderCheckoutCurrency({
|
|
619
|
+
amount: isCollectMobileTablet.collectStore.amountDutyTaxFeeTotal || 0,
|
|
620
|
+
isForeign: true,
|
|
621
|
+
}),
|
|
622
|
+
})), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
|
|
623
|
+
cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
|
|
624
|
+
cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
|
|
625
|
+
await this.continueClickHandler({
|
|
626
|
+
currencyCode: 'USD',
|
|
627
|
+
});
|
|
628
|
+
}, size: "lg", variant: "subtle" }, translationStore.translate('Click to pay in USD'))))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
629
|
+
this.paypalSessionDone.emit(orderId);
|
|
630
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
631
|
+
display: isPaypalTabSelected ? 'block' : 'none',
|
|
632
|
+
} })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, translationStore.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, translationStore.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translationStore.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translationStore.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
|
|
633
|
+
};
|
|
634
|
+
return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translationStore.translate('Payment method')), renderPayment())));
|
|
635
|
+
}
|
|
636
|
+
get ele() { return index.getElement(this); }
|
|
637
|
+
static get watchers() { return {
|
|
638
|
+
"continueLoading": ["continueLoadingWatcher"],
|
|
639
|
+
"hasStripePaymentError": ["stripePaymentErrorWatcher"]
|
|
640
|
+
}; }
|
|
641
|
+
};
|
|
642
|
+
ZonosCollectPayment.style = ZonosCollectPaymentStyle0;
|
|
643
|
+
|
|
644
|
+
const renderFallback = ({ content, isLoading, skeletonHeight, skeletonWidth, }) => {
|
|
645
|
+
if (isLoading) {
|
|
646
|
+
return (index.h("zonos-skeleton", { skeletonHeight: skeletonHeight, skeletonWidth: skeletonWidth }));
|
|
647
|
+
}
|
|
648
|
+
return content;
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
const zonosCollectReviewCss = ":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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:\"\";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}";
|
|
652
|
+
const ZonosCollectReviewStyle0 = zonosCollectReviewCss;
|
|
653
|
+
|
|
654
|
+
const ZonosCollectReview = class {
|
|
655
|
+
constructor(hostRef) {
|
|
656
|
+
index.registerInstance(this, hostRef);
|
|
657
|
+
/**
|
|
658
|
+
* Whether or not the component is being rendered with mobile styles
|
|
659
|
+
*/
|
|
660
|
+
this.mobile = false;
|
|
661
|
+
/**
|
|
662
|
+
* Whether or not the component is being rendered with tablet styles
|
|
663
|
+
*/
|
|
664
|
+
this.tablet = false;
|
|
665
|
+
/**
|
|
666
|
+
* Whether or not to show the collapse icon
|
|
667
|
+
* This is controled from the collapsed state of the zonos-collapse component
|
|
668
|
+
* to show the collapse icon
|
|
669
|
+
*/
|
|
670
|
+
this.collapsed = false;
|
|
671
|
+
this.isMobile = false;
|
|
672
|
+
this.isTablet = false;
|
|
673
|
+
this.isLoading = true;
|
|
674
|
+
}
|
|
675
|
+
handleWindowResize() {
|
|
676
|
+
this.isMobile = isCollectMobileTablet.isCollectMobile(this.mobile);
|
|
677
|
+
this.isTablet = isCollectMobileTablet.isCollectTablet(this.tablet);
|
|
678
|
+
}
|
|
679
|
+
componentWillLoad() {
|
|
680
|
+
this.handleWindowResize();
|
|
681
|
+
// Wait for the data to load
|
|
682
|
+
setTimeout(() => {
|
|
683
|
+
this.isLoading = false;
|
|
684
|
+
}, 1000);
|
|
685
|
+
}
|
|
686
|
+
render() {
|
|
687
|
+
const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
|
|
688
|
+
return (index.h(index.Host, { key: '6432c5dd5afd628e33ba26385ecfecb470f1757e', class: classes.classes([
|
|
689
|
+
'zonos--collect-review zonos--elements',
|
|
690
|
+
this.isMobile && 'mobile',
|
|
691
|
+
this.isTablet && 'tablet',
|
|
692
|
+
]) }, index.h("div", { key: 'e4d113ff1268c36119e1f80164b6cfd702c67f75', class: "zonos--title" }, index.h("zonos-text", { key: 'aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1', textColor: titleTextColor, type: 'semiBoldLabel' }, translationStore.translate('Pay [organizationName]', {
|
|
693
|
+
organizationName: zonosStore.zonosStore.organizationName,
|
|
694
|
+
}))), index.h("div", { key: 'fcdaebc734a270742fbe21ff932550994e522ea6', class: "zonos--total-pay" }, renderFallback({
|
|
695
|
+
content: (index.h("zonos-text", { type: 'secondaryPageHeader' }, placeTestOrder.renderCheckoutCurrency({
|
|
696
|
+
amount: isCollectMobileTablet.collectStore.amountDutyTaxFeeTotal || 0,
|
|
697
|
+
isForeign: false,
|
|
698
|
+
}))),
|
|
699
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
700
|
+
skeletonHeight: '36px',
|
|
701
|
+
skeletonWidth: '150px',
|
|
702
|
+
}))));
|
|
703
|
+
}
|
|
704
|
+
static get assetsDirs() { return ["assets"]; }
|
|
705
|
+
};
|
|
706
|
+
ZonosCollectReview.style = ZonosCollectReviewStyle0;
|
|
707
|
+
|
|
708
|
+
const zonosCollectSubtotalCss = ":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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";
|
|
709
|
+
const ZonosCollectSubtotalStyle0 = zonosCollectSubtotalCss;
|
|
710
|
+
|
|
711
|
+
const ZonosCollectSubtotal = class {
|
|
712
|
+
constructor(hostRef) {
|
|
713
|
+
index.registerInstance(this, hostRef);
|
|
714
|
+
this.storeUnsubscribeList = [];
|
|
715
|
+
this.subtotals = {};
|
|
716
|
+
this.initSubtotalData = () => {
|
|
717
|
+
var _a;
|
|
718
|
+
const cartLandedCostSubtotal = (_a = cart.cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.subtotals;
|
|
719
|
+
if (!cartLandedCostSubtotal) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
// Some countries have same name for duties, taxes and fees in their language. If that happens, we need to group their values by name
|
|
723
|
+
const translatedDutyLabel = translationStore.translate('Duties');
|
|
724
|
+
const translatedTaxLabel = translationStore.translate('Taxes');
|
|
725
|
+
const translatedFeeLabel = translationStore.translate('Fees');
|
|
726
|
+
const subtotalMap = {
|
|
727
|
+
[translatedDutyLabel]: 0,
|
|
728
|
+
[translatedFeeLabel]: 0,
|
|
729
|
+
[translatedTaxLabel]: 0,
|
|
730
|
+
};
|
|
731
|
+
const duties = cartLandedCostSubtotal.duties;
|
|
732
|
+
const taxes = cartLandedCostSubtotal.taxes;
|
|
733
|
+
const fees = cartLandedCostSubtotal.fees;
|
|
734
|
+
if (duties !== undefined) {
|
|
735
|
+
subtotalMap[translatedDutyLabel] || (subtotalMap[translatedDutyLabel] = 0);
|
|
736
|
+
subtotalMap[translatedDutyLabel] += duties;
|
|
737
|
+
}
|
|
738
|
+
if (taxes !== undefined) {
|
|
739
|
+
subtotalMap[translatedTaxLabel] || (subtotalMap[translatedTaxLabel] = 0);
|
|
740
|
+
subtotalMap[translatedTaxLabel] += taxes;
|
|
741
|
+
}
|
|
742
|
+
if (fees !== undefined) {
|
|
743
|
+
subtotalMap[translatedFeeLabel] || (subtotalMap[translatedFeeLabel] = 0);
|
|
744
|
+
subtotalMap[translatedFeeLabel] += fees;
|
|
745
|
+
}
|
|
746
|
+
this.subtotals = subtotalMap;
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
disconnectedCallback() {
|
|
750
|
+
this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
|
|
751
|
+
}
|
|
752
|
+
componentWillLoad() {
|
|
753
|
+
this.storeUnsubscribeList = [
|
|
754
|
+
cart.cartStoreOnChange('checkoutSession', this.initSubtotalData),
|
|
755
|
+
translationStore.translationStoreOnChange('translatedChunks', this.initSubtotalData),
|
|
756
|
+
];
|
|
757
|
+
}
|
|
758
|
+
render() {
|
|
759
|
+
this.initSubtotalData();
|
|
760
|
+
return (index.h(index.Host, { key: 'ab687a6e1ec67f6609081036a75e9905ff34c6b1', class: "zonos--collect-subtotal zonos--elements" }, index.h("table", { key: '303b8c49983e9f7aea4d31400fed53d858eb078d', class: "zonos--collect-table" }, !!this.subtotals[translationStore.translate('Duties')] && (index.h("tr", { key: 'a60fa4f1f1afacef0144b86c054f44572576f7af', class: "zonos--row zonos--collect-duty" }, index.h("td", { key: 'aeaf798e26bbd482196d7208eb05657a1d15dad8', class: "zonos--column zonos--collect-subtotal-title" }, index.h("zonos-text", { key: '835d817709ae3b7e2d888d618e0856fb2e637e4d', type: "semiBoldLabel" }, translationStore.translate('Duties'))), index.h("td", { key: '5bb47a115ea61fa897a3f48bbd10c5f78af3703e', class: "zonos--column" }), index.h("td", { key: '32632c4beb855ca687c615f5e6c63c82e2e05c80', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
|
|
761
|
+
content: (index.h("zonos-text", { type: "label" }, placeTestOrder.renderCheckoutCurrency({
|
|
762
|
+
amount: this.subtotals[translationStore.translate('Duties')] || 0,
|
|
763
|
+
isForeign: true,
|
|
764
|
+
}))),
|
|
765
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
766
|
+
skeletonHeight: '14px',
|
|
767
|
+
skeletonWidth: '150px',
|
|
768
|
+
})))), !!this.subtotals[translationStore.translate('Taxes')] && (index.h("tr", { key: '055bb237dafaea8de18b127641c8fd7e1ece563b', class: "zonos--row zonos--collect-tax" }, index.h("td", { key: '1e73b140c2c9090ccfb91ce4efca483e8fb56e9e', class: "zonos--column zonos--collect-subtotal-title" }, index.h("zonos-text", { key: 'a3375ecd77460c78c7c5f59bf7b9b8612cd53e41', type: "semiBoldLabel" }, translationStore.translate('Taxes'))), index.h("td", { key: '20685646be29873967c2f335c775046068248ad3', class: "zonos--column" }), index.h("td", { key: '2e2c6af2c1a7840df03351178ddf3107fcc36494', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
|
|
769
|
+
content: (index.h("zonos-text", { type: "label" }, placeTestOrder.renderCheckoutCurrency({
|
|
770
|
+
amount: this.subtotals[translationStore.translate('Taxes')] || 0,
|
|
771
|
+
isForeign: true,
|
|
772
|
+
}))),
|
|
773
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
774
|
+
skeletonHeight: '14px',
|
|
775
|
+
skeletonWidth: '150px',
|
|
776
|
+
})))), !!this.subtotals[translationStore.translate('Fees')] && (index.h("tr", { key: '8157aba5c6a23680b0bc681adc127747f01a2973', class: "zonos--row zonos--collect-fee" }, index.h("td", { key: '8266654f9e65003f297222bb935013a8b9b3b430', class: "zonos--column zonos--collect-subtotal-title" }, index.h("zonos-text", { key: '8399000a5f61e4737764b68b89799b409dce6034', type: "semiBoldLabel" }, translationStore.translate('Fees'))), index.h("td", { key: '2a9763f2401967ea1bdfa2c17514d18e2a4e0db6', class: "zonos--column" }), index.h("td", { key: 'ac2f275312c2ba69888e6e57dde8b4b451839b86', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
|
|
777
|
+
content: (index.h("zonos-text", { type: "label" }, placeTestOrder.renderCheckoutCurrency({
|
|
778
|
+
amount: this.subtotals[translationStore.translate('Fees')] || 0,
|
|
779
|
+
isForeign: true,
|
|
780
|
+
}))),
|
|
781
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
782
|
+
skeletonHeight: '14px',
|
|
783
|
+
skeletonWidth: '150px',
|
|
784
|
+
})))), index.h("tr", { key: 'a293d1b9342251f7326c1ac68e2bab83eae2ed80', class: "zonos--row zonos--collect-spacing" }, index.h("td", { key: 'c136b1b807f32dc21c131326d70500d2e2c64efe', class: "zonos--column", colSpan: 3 })), index.h("tr", { key: '59747101f1a9ef7c8fad60e90ea5b8c31015438c', class: "zonos--row zonos--collect-total zonos--collect-total-subtotal" }, index.h("td", { key: '96d201ba6f3e571adac265127229c94cdc96be2a', class: "zonos--column" }), index.h("td", { key: 'f2f4cb751e35fc0ebaa803659f26a2314d8bf639', class: "zonos--column zonos--collect-subtotal-title" }, index.h("zonos-text", { key: 'b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441', type: "label" }, translationStore.translate('Subtotal'))), index.h("td", { key: '28b6aea6363b2bef1d072ad77f409ae77976305c', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
|
|
785
|
+
content: (index.h("zonos-text", { type: "label" }, placeTestOrder.renderCheckoutCurrency({
|
|
786
|
+
amount: isCollectMobileTablet.collectStore.amountDutyTaxFeeTotal || 0,
|
|
787
|
+
isForeign: true,
|
|
788
|
+
}))),
|
|
789
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
790
|
+
skeletonHeight: '14px',
|
|
791
|
+
skeletonWidth: '150px',
|
|
792
|
+
}))), index.h("tr", { key: 'f0072cdd200e8483421265af39a90fb655fb2ef0', class: "zonos--row zonos--collect-total" }, index.h("td", { key: '88a007048d33c919a6c5f87cf7cd071f83e7448b', class: "zonos--column" }), index.h("td", { key: '24bba9e9b81ff443dd5ca4832c3169e3605a93b8', class: "zonos--column zonos--collect-subtotal-title" }, index.h("zonos-text", { key: '594d4e96bec3a2153f6622c6842970ebee5bb463', type: "semiBoldLabel" }, translationStore.translate('Customs fees total'))), index.h("td", { key: 'b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
|
|
793
|
+
content: (index.h("zonos-text", { type: "semiBoldLabel" }, placeTestOrder.renderCheckoutCurrency({
|
|
794
|
+
amount: isCollectMobileTablet.collectStore.amountDutyTaxFeeTotal || 0,
|
|
795
|
+
isForeign: true,
|
|
796
|
+
}))),
|
|
797
|
+
isLoading: isCollectMobileTablet.collectStore.isFetchingShippingInfo,
|
|
798
|
+
skeletonHeight: '14px',
|
|
799
|
+
skeletonWidth: '150px',
|
|
800
|
+
}))))));
|
|
801
|
+
}
|
|
802
|
+
static get assetsDirs() { return ["assets"]; }
|
|
803
|
+
};
|
|
804
|
+
ZonosCollectSubtotal.style = ZonosCollectSubtotalStyle0;
|
|
805
|
+
|
|
806
|
+
exports.zonos_collect_finish = ZonosCollectFinish;
|
|
807
|
+
exports.zonos_collect_footer = ZonosCollectFooter;
|
|
808
|
+
exports.zonos_collect_order_details = ZonosCollectOrderDetails;
|
|
809
|
+
exports.zonos_collect_payment = ZonosCollectPayment;
|
|
810
|
+
exports.zonos_collect_review = ZonosCollectReview;
|
|
811
|
+
exports.zonos_collect_subtotal = ZonosCollectSubtotal;
|