@zonos/elements 1.3.280 → 1.3.282
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/{TaxId-12acedde.js → TaxId-cd9d490e.js} +1 -1
- package/dist/cjs/{cart-0fa312a5.js → cart-dc31b242.js} +3 -2
- package/dist/cjs/{collect-f9c4ca7c.js → collect-463ab3d7.js} +2 -2
- package/dist/cjs/getMissingRequiredShippingFields-7cd21100.js +50 -0
- package/dist/cjs/{hasInclusivePrice-95431bca.js → hasInclusivePrice-d14b9d71.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{invoice-ce757565.js → invoice-8c995041.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-7fded969.js → localization-491121ad.js} +320 -80
- package/dist/cjs/{paypal-57ab3ab6.js → paypal-2a4c374c.js} +2 -2
- package/dist/cjs/{placeTestOrder-35e0d3bd.js → placeTestOrder-a940a2e9.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-41d48407.js → renderCheckoutCurrency-ab39875a.js} +2 -2
- package/dist/cjs/{shouldRenderTaxIdInput-b8abf6de.js → shouldRenderTaxIdInput-7d19556c.js} +1 -1
- package/dist/cjs/{zonos-address-display_8.cjs.entry.js → zonos-address-completion-dialog_7.cjs.entry.js} +143 -151
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +150 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +75 -14
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +10 -10
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +97 -25
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +7 -7
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +20 -20
- package/dist/cjs/zonos-collect.cjs.entry.js +5 -5
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +7 -7
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +9 -9
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +15 -15
- package/dist/cjs/zonos-invoice.cjs.entry.js +5 -5
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -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-policy-consent_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
- 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 +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.css +105 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +341 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +5 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +52 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
- 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.js +2 -2
- 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/zonos-skeleton.js +1 -1
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
- 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 +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +16 -4
- package/dist/collection/components/store/translationStore/strings.base.js +16 -4
- package/dist/collection/components/store/translationStore/strings.chinese.js +16 -4
- package/dist/collection/components/store/translationStore/strings.danish.js +16 -4
- package/dist/collection/components/store/translationStore/strings.dutch.js +16 -4
- package/dist/collection/components/store/translationStore/strings.french.js +16 -4
- package/dist/collection/components/store/translationStore/strings.german.js +16 -4
- package/dist/collection/components/store/translationStore/strings.hebrew.js +16 -4
- package/dist/collection/components/store/translationStore/strings.indonesian.js +16 -4
- package/dist/collection/components/store/translationStore/strings.italian.js +16 -4
- package/dist/collection/components/store/translationStore/strings.japanese.js +16 -4
- package/dist/collection/components/store/translationStore/strings.korean.js +16 -4
- package/dist/collection/components/store/translationStore/strings.norwegian.js +16 -4
- package/dist/collection/components/store/translationStore/strings.polish.js +16 -4
- package/dist/collection/components/store/translationStore/strings.portuguese.js +16 -4
- package/dist/collection/components/store/translationStore/strings.russian.js +16 -4
- package/dist/collection/components/store/translationStore/strings.spanish.js +16 -4
- package/dist/collection/components/store/translationStore/strings.swedish.js +16 -4
- package/dist/collection/components/store/translationStore/strings.turkish.js +16 -4
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +16 -4
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +11 -6
- 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-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/applyAddressCompletion.js +23 -0
- package/dist/collection/components/utils/checkout/buildAddressContacts.js +57 -0
- package/dist/collection/components/utils/checkout/getMissingRequiredShippingFields.js +44 -0
- package/dist/collection/components/utils/taxIdValidationResult.js +6 -3
- package/dist/collection/types/checkout/TaxId.js +1 -1
- package/dist/esm/{TaxId-50d72254.js → TaxId-63a14057.js} +1 -1
- package/dist/esm/{cart-4699e6ab.js → cart-5282f6c1.js} +3 -3
- package/dist/esm/{collect-24cc2e12.js → collect-fdbab973.js} +2 -2
- package/dist/esm/getMissingRequiredShippingFields-bdeecbff.js +47 -0
- package/dist/esm/{hasInclusivePrice-f81ddcd6.js → hasInclusivePrice-161e203f.js} +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/{invoice-575dc93d.js → invoice-cf6ad79e.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-da2f407f.js → localization-0953a048.js} +320 -80
- package/dist/esm/{paypal-d4436abd.js → paypal-7c82eac4.js} +2 -2
- package/dist/esm/{placeTestOrder-d87b2c6a.js → placeTestOrder-6a746207.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-08526996.js → renderCheckoutCurrency-44f897a1.js} +2 -2
- package/dist/esm/{shouldRenderTaxIdInput-2572bf77.js → shouldRenderTaxIdInput-ef7b5860.js} +1 -1
- package/dist/esm/{zonos-address-display_8.entry.js → zonos-address-completion-dialog_7.entry.js} +144 -151
- package/dist/esm/zonos-address-display_2.entry.js +145 -0
- package/dist/esm/zonos-address_4.entry.js +75 -14
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +10 -10
- package/dist/esm/zonos-cart-items_12.entry.js +98 -26
- package/dist/esm/zonos-checkbox_2.entry.js +5 -5
- package/dist/esm/zonos-checkout.entry.js +4 -4
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +7 -7
- package/dist/esm/zonos-collect-finish_6.entry.js +20 -20
- package/dist/esm/zonos-collect.entry.js +5 -5
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +4 -4
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +7 -7
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +9 -9
- package/dist/esm/zonos-invoice-finish_5.entry.js +15 -15
- package/dist/esm/zonos-invoice.entry.js +5 -5
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
- package/dist/esm/zonos-stripe-input.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/{TaxId-50d72254.js → TaxId-63a14057.js} +1 -1
- package/dist/esm-es5/{cart-4699e6ab.js → cart-5282f6c1.js} +1 -1
- package/dist/esm-es5/{collect-24cc2e12.js → collect-fdbab973.js} +1 -1
- package/dist/esm-es5/getMissingRequiredShippingFields-bdeecbff.js +1 -0
- package/dist/esm-es5/{hasInclusivePrice-f81ddcd6.js → hasInclusivePrice-161e203f.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-575dc93d.js → invoice-cf6ad79e.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-0953a048.js +1 -0
- package/dist/esm-es5/{paypal-d4436abd.js → paypal-7c82eac4.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-d87b2c6a.js → placeTestOrder-6a746207.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-08526996.js → renderCheckoutCurrency-44f897a1.js} +1 -1
- package/dist/esm-es5/{shouldRenderTaxIdInput-2572bf77.js → shouldRenderTaxIdInput-ef7b5860.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -0
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +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-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.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 +125 -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-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.d.ts +75 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +16 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.base.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.danish.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.french.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.german.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.italian.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.korean.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.polish.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.russian.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +14 -2
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +14 -2
- package/dist/types/components/utils/checkout/applyAddressCompletion.d.ts +25 -0
- package/dist/types/components/utils/checkout/buildAddressContacts.d.ts +21 -0
- package/dist/types/components/utils/checkout/getMissingRequiredShippingFields.d.ts +35 -0
- package/dist/types/components/utils/taxIdValidationResult.d.ts +1 -1
- package/dist/types/components.d.ts +97 -0
- package/dist/types/types/checkout/TaxId.d.ts +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-b330e451.system.js → p-0287f9cd.system.js} +1 -1
- package/dist/zonos-elements/{p-5aee5de5.system.entry.js → p-05cb0a0d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f90cb36.entry.js → p-0fb4e032.entry.js} +1 -1
- package/dist/zonos-elements/{p-dbd5be5d.entry.js → p-10584546.entry.js} +1 -1
- package/dist/zonos-elements/p-193fc2da.entry.js +1 -0
- package/dist/zonos-elements/p-1977f4b5.js +1 -0
- package/dist/zonos-elements/p-1cf5e2ce.system.entry.js +1 -0
- package/dist/zonos-elements/p-1cf76dd3.entry.js +1 -0
- package/dist/zonos-elements/p-1d31b966.system.js +1 -0
- package/dist/zonos-elements/{p-0ad6a92b.system.entry.js → p-21489ff1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-734d646b.entry.js → p-21f7d57b.entry.js} +1 -1
- package/dist/zonos-elements/{p-b8c019b9.system.js → p-2394b186.system.js} +1 -1
- package/dist/zonos-elements/{p-5b54f10c.entry.js → p-23eee868.entry.js} +1 -1
- package/dist/zonos-elements/{p-b5f67807.entry.js → p-26bf0c31.entry.js} +1 -1
- package/dist/zonos-elements/{p-40a0c1d3.system.js → p-28ee0860.system.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-6bea1787.entry.js → p-30cfc9f4.entry.js} +1 -1
- package/dist/zonos-elements/{p-aff7112b.entry.js → p-323279b8.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c54aaec.entry.js → p-32b53999.entry.js} +1 -1
- package/dist/zonos-elements/{p-c15476a1.system.entry.js → p-333f6018.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3642dd99.entry.js +1 -0
- package/dist/zonos-elements/p-3c62acbd.js +1 -0
- package/dist/zonos-elements/{p-fc2d5dd9.entry.js → p-4417475f.entry.js} +1 -1
- package/dist/zonos-elements/p-543b25f9.entry.js +1 -0
- package/dist/zonos-elements/{p-1992fd91.entry.js → p-55c5977b.entry.js} +1 -1
- package/dist/zonos-elements/{p-72c1bd64.entry.js → p-56e9a29e.entry.js} +1 -1
- package/dist/zonos-elements/p-59518657.entry.js +1 -0
- package/dist/zonos-elements/p-5953208b.js +1 -0
- package/dist/zonos-elements/p-5987dea1.js +1 -0
- package/dist/zonos-elements/{p-a44591f6.system.entry.js → p-5a37683b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-36b311f9.system.entry.js → p-5b11bbca.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b05da593.system.entry.js → p-5d6b018c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-63b462dd.system.entry.js +1 -0
- package/dist/zonos-elements/p-646e6b47.system.entry.js +1 -0
- package/dist/zonos-elements/{p-81c4f04a.system.entry.js → p-68631285.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-12452213.entry.js → p-6f874ed9.entry.js} +1 -1
- package/dist/zonos-elements/p-71fc8a22.js +1 -0
- package/dist/zonos-elements/{p-c4a479ad.entry.js → p-76e36d6d.entry.js} +1 -1
- package/dist/zonos-elements/{p-a3d3ce5d.system.entry.js → p-781b3345.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-275fa2da.js → p-7ab15d20.js} +1 -1
- package/dist/zonos-elements/{p-48d55793.system.js → p-7ac8846c.system.js} +1 -1
- package/dist/zonos-elements/{p-96e7b465.js → p-7c70e0c7.js} +1 -1
- package/dist/zonos-elements/p-8418aa07.entry.js +1 -0
- package/dist/zonos-elements/{p-99e8743e.system.entry.js → p-8fa3a8f8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-944148db.system.entry.js → p-8fb15a6b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6451537c.entry.js → p-95042e71.entry.js} +1 -1
- package/dist/zonos-elements/p-987b5d8f.js +1 -0
- package/dist/zonos-elements/{p-2b8345d8.system.js → p-989cb22b.system.js} +1 -1
- package/dist/zonos-elements/{p-2dbdf883.system.js → p-a4eddf6c.system.js} +1 -1
- package/dist/zonos-elements/p-a553e132.js +1 -0
- package/dist/zonos-elements/{p-6197aa73.system.entry.js → p-aa1f3060.system.entry.js} +1 -1
- package/dist/zonos-elements/p-aa37f436.system.entry.js +1 -0
- package/dist/zonos-elements/{p-788a16bb.system.js → p-ab61ef19.system.js} +1 -1
- package/dist/zonos-elements/{p-362215b6.system.entry.js → p-b91a8f31.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-15097876.system.entry.js → p-b93013f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b361d2b.js → p-bcf5cffb.js} +1 -1
- package/dist/zonos-elements/{p-807e7ebc.entry.js → p-c121b2b8.entry.js} +1 -1
- package/dist/zonos-elements/{p-66223935.system.entry.js → p-c12ca8fe.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c5bfe522.system.js +1 -0
- package/dist/zonos-elements/{p-732e7373.system.entry.js → p-c634546a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3759c70.js → p-c8bc4ede.js} +1 -1
- package/dist/zonos-elements/{p-a7f0e824.system.entry.js → p-c8df5eee.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-43a14674.system.entry.js → p-c9e44c77.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cf0c8c77.system.entry.js → p-ca9231a0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e058b4e.entry.js → p-cb376f03.entry.js} +1 -1
- package/dist/zonos-elements/{p-016b5bde.system.js → p-cd3f7fd7.system.js} +1 -1
- package/dist/zonos-elements/{p-b6cd6e62.system.entry.js → p-d06486ba.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-db9cb522.entry.js → p-d0767f88.entry.js} +1 -1
- package/dist/zonos-elements/{p-46f88c11.system.entry.js → p-d2cb99ee.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ddd0e703.system.entry.js +1 -0
- package/dist/zonos-elements/{p-85796e67.entry.js → p-dfd83cff.entry.js} +1 -1
- package/dist/zonos-elements/{p-4efd7178.entry.js → p-e0cbc7c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6049eef.system.entry.js → p-e101b0de.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-dd6da3de.entry.js → p-e3d0d8ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-a30f03d6.system.js → p-e57f862d.system.js} +1 -1
- package/dist/zonos-elements/{p-1bb85ff1.entry.js → p-e6e3a303.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d4201d5.entry.js → p-ef2c264c.entry.js} +1 -1
- package/dist/zonos-elements/{p-564c7bb5.system.entry.js → p-f1298203.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0adab1d5.system.entry.js → p-f1aa60fd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-429ab545.system.entry.js → p-f1dbeb85.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2825431d.entry.js → p-f2431e47.entry.js} +1 -1
- package/dist/zonos-elements/{p-29c1703c.system.entry.js → p-f2511b86.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-08e78d79.entry.js → p-fa80a973.entry.js} +1 -1
- package/dist/zonos-elements/p-fb8dc23f.system.js +1 -0
- package/dist/zonos-elements/{p-f59514e9.entry.js → p-fc45b3a5.entry.js} +1 -1
- package/dist/zonos-elements/{p-3068247c.system.entry.js → p-fdd7ec44.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/localization-da2f407f.js +0 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +0 -1
- package/dist/zonos-elements/p-19f4e77a.entry.js +0 -1
- package/dist/zonos-elements/p-28b1c189.entry.js +0 -1
- package/dist/zonos-elements/p-39e2642f.js +0 -1
- package/dist/zonos-elements/p-3f8f4c78.js +0 -1
- package/dist/zonos-elements/p-63a383f4.js +0 -1
- package/dist/zonos-elements/p-65fe75e1.entry.js +0 -1
- package/dist/zonos-elements/p-67b2e46c.js +0 -1
- package/dist/zonos-elements/p-7237ec6f.system.entry.js +0 -1
- package/dist/zonos-elements/p-75da4ba0.entry.js +0 -1
- package/dist/zonos-elements/p-79b6070a.js +0 -1
- package/dist/zonos-elements/p-94329e56.js +0 -1
- package/dist/zonos-elements/p-a5afcea1.system.entry.js +0 -1
- package/dist/zonos-elements/p-c2014d57.system.entry.js +0 -1
- package/dist/zonos-elements/p-dff1d3be.entry.js +0 -1
- package/dist/zonos-elements/p-ec53c436.system.entry.js +0 -1
- package/dist/zonos-elements/p-f55a2352.system.js +0 -1
- package/dist/zonos-elements/p-fd2d4d04.system.js +0 -1
|
@@ -119,6 +119,9 @@ export declare const stringsVietnamese: {
|
|
|
119
119
|
'Company name (optional)': {
|
|
120
120
|
value: string;
|
|
121
121
|
};
|
|
122
|
+
'Complete your shipping address': {
|
|
123
|
+
value: string;
|
|
124
|
+
};
|
|
122
125
|
Confirm: {
|
|
123
126
|
value: string;
|
|
124
127
|
};
|
|
@@ -308,7 +311,7 @@ export declare const stringsVietnamese: {
|
|
|
308
311
|
'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).': {
|
|
309
312
|
value: string;
|
|
310
313
|
};
|
|
311
|
-
'Invalid RFC format. Must be 12\u201313 uppercase letters and numbers only.': {
|
|
314
|
+
'Invalid RFC or CURP format. Must be a 12\u201313 character RFC or an 18 character CURP, uppercase letters and numbers only.': {
|
|
312
315
|
value: string;
|
|
313
316
|
};
|
|
314
317
|
'Invalid promo code': {
|
|
@@ -512,7 +515,7 @@ export declare const stringsVietnamese: {
|
|
|
512
515
|
Quantity: {
|
|
513
516
|
value: string;
|
|
514
517
|
};
|
|
515
|
-
'RFC number': {
|
|
518
|
+
'RFC or CURP number': {
|
|
516
519
|
value: string;
|
|
517
520
|
};
|
|
518
521
|
'Refund policy': {
|
|
@@ -536,6 +539,9 @@ export declare const stringsVietnamese: {
|
|
|
536
539
|
'Return to merchant site': {
|
|
537
540
|
value: string;
|
|
538
541
|
};
|
|
542
|
+
'Save and continue': {
|
|
543
|
+
value: string;
|
|
544
|
+
};
|
|
539
545
|
'Search countries': {
|
|
540
546
|
value: string;
|
|
541
547
|
};
|
|
@@ -554,6 +560,9 @@ export declare const stringsVietnamese: {
|
|
|
554
560
|
'Select a language': {
|
|
555
561
|
value: string;
|
|
556
562
|
};
|
|
563
|
+
'Selected address': {
|
|
564
|
+
value: string;
|
|
565
|
+
};
|
|
557
566
|
'Session does not have valid landed cost. Please contact [organizationName] for assistance.': {
|
|
558
567
|
value: string;
|
|
559
568
|
};
|
|
@@ -698,6 +707,9 @@ export declare const stringsVietnamese: {
|
|
|
698
707
|
"There's been an error updating your checkout session. Please reload and try again or contact support if the error persists": {
|
|
699
708
|
value: string;
|
|
700
709
|
};
|
|
710
|
+
'This saved address is missing information required to ship internationally. Please add the details below.': {
|
|
711
|
+
value: string;
|
|
712
|
+
};
|
|
701
713
|
'To ensure delivery all address details must be in Latin characters.': {
|
|
702
714
|
value: string;
|
|
703
715
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { StripeAddressElementChangeEvent } from '@stripe/stripe-js';
|
|
2
|
+
/**
|
|
3
|
+
* Values captured in the completion dialog for the fields that were missing from the Stripe
|
|
4
|
+
* Link address. Only the keys that were actually requested (and therefore provided) are present.
|
|
5
|
+
* When the last name is missing we also capture the first name, so the customer can correct the
|
|
6
|
+
* whole name at once (Link often stores just a first name in its single name input).
|
|
7
|
+
*/
|
|
8
|
+
export type AddressCompletionSubmit = {
|
|
9
|
+
firstName?: string;
|
|
10
|
+
lastName?: string;
|
|
11
|
+
postal_code?: string;
|
|
12
|
+
state?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Merge the fields captured in the completion dialog back into a Stripe shipping address event,
|
|
16
|
+
* rebuilding the full name from the extracted first name and the provided/known last name and
|
|
17
|
+
* marking the address complete. Fields the customer wasn't asked for are left untouched.
|
|
18
|
+
*
|
|
19
|
+
* Pure: returns a new event object rather than mutating the input, so it can be unit-tested and
|
|
20
|
+
* assigned straight to the store.
|
|
21
|
+
*/
|
|
22
|
+
export declare const applyAddressCompletion: ({ data, event, }: {
|
|
23
|
+
data: AddressCompletionSubmit;
|
|
24
|
+
event: StripeAddressElementChangeEvent;
|
|
25
|
+
}) => StripeAddressElementChangeEvent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ContactOption, StripeAddressElementChangeEvent } from '@stripe/stripe-js';
|
|
2
|
+
/**
|
|
3
|
+
* Map a Stripe address change event value into a Stripe `ContactOption`, used to
|
|
4
|
+
* pre-seed the address element's saved-address (contacts) list on remount.
|
|
5
|
+
*/
|
|
6
|
+
export declare const mapAddressEventToContact: (value: StripeAddressElementChangeEvent["value"]) => ContactOption;
|
|
7
|
+
/**
|
|
8
|
+
* Build a dedupe key for a contact so we don't add a duplicate saved address. Compared
|
|
9
|
+
* case- and whitespace-insensitively on the distinguishing fields.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getContactDedupKey: (contact: ContactOption) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Prepend the currently selected address (from the latest Stripe address event) to the
|
|
14
|
+
* list of default saved addresses so it stays selected when the address element is
|
|
15
|
+
* remounted (e.g. navigating between the customer and shipping steps). Avoids adding a
|
|
16
|
+
* duplicate contact when the current address already exists in the list.
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildAddressContacts: ({ currentEvent, defaultAddress, }: {
|
|
19
|
+
currentEvent: StripeAddressElementChangeEvent | null;
|
|
20
|
+
defaultAddress: ContactOption[];
|
|
21
|
+
}) => ContactOption[];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { StripeAddressElementChangeEvent } from '@stripe/stripe-js';
|
|
2
|
+
/**
|
|
3
|
+
* Minimum number of characters we treat as a valid postal code. Mirrors the
|
|
4
|
+
* landed-cost readiness check in `stripe.ts` (`isAddressReadyToRequestLandedCost`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const MIN_POSTAL_CODE_LENGTH = 3;
|
|
7
|
+
export type MissingShippingFieldKey = 'lastName' | 'postal_code' | 'state';
|
|
8
|
+
export type MissingShippingField = {
|
|
9
|
+
key: MissingShippingFieldKey;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The subset of per-country field requirements this check needs. Both the Zonos
|
|
13
|
+
* `CountryFields` config and the Stripe-derived country field list satisfy this shape,
|
|
14
|
+
* so callers can pass whatever `getCountryField` (in `stripe.ts`) returns.
|
|
15
|
+
*/
|
|
16
|
+
export type RequiredFieldConfig = {
|
|
17
|
+
stateRequired: boolean;
|
|
18
|
+
zipRequired: boolean;
|
|
19
|
+
} | null;
|
|
20
|
+
/**
|
|
21
|
+
* Determine which Zonos-required shipping fields are still missing even though Stripe
|
|
22
|
+
* reports the address as complete.
|
|
23
|
+
*
|
|
24
|
+
* Stripe Link autofills a saved address from a single name input, so it may return only a
|
|
25
|
+
* first name and, for some countries, omit the state / postal code while still reporting
|
|
26
|
+
* `complete: true`. This surfaces the fields Zonos needs for international shipping so the
|
|
27
|
+
* customer can supply just those, without duplicating fields Stripe already captures.
|
|
28
|
+
*
|
|
29
|
+
* Pure: the caller resolves `countryField` (via `getCountryField`) and passes it in, so
|
|
30
|
+
* this can be unit-tested without the stores.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getMissingRequiredShippingFields: ({ countryField, event, }: {
|
|
33
|
+
countryField: RequiredFieldConfig;
|
|
34
|
+
event: StripeAddressElementChangeEvent | null;
|
|
35
|
+
}) => MissingShippingField[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type TaxIdValidationResult = {
|
|
2
|
-
error: 'Tax id is required' | 'Invalid RFC format. Must be 12–13 uppercase letters and numbers only.' | 'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).';
|
|
2
|
+
error: 'Tax id is required' | 'Invalid RFC or CURP format. Must be a 12–13 character RFC or an 18 character CURP, uppercase letters and numbers only.' | 'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).';
|
|
3
3
|
valid: false;
|
|
4
4
|
} | {
|
|
5
5
|
error: null;
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { ContactOption, PaymentIntent, Stripe, StripeAddressElementChangeEvent } from "@stripe/stripe-js";
|
|
9
|
+
import { MissingShippingField } from "./components/utils/checkout/getMissingRequiredShippingFields";
|
|
9
10
|
import { EnteredInfo, TranslatedAddressObject } from "./types/checkout/TranslatedText";
|
|
11
|
+
import { AddressCompletionSubmit } from "./components/utils/checkout/applyAddressCompletion";
|
|
10
12
|
import { EventPayloadMap, IframeSuggestionsResponsePayload } from "./components/utils/iframe/IframeHelpers";
|
|
11
13
|
import { SubmitEventData } from "./components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog";
|
|
12
14
|
import { CheckboxColorPrefix, Color, ColorPrefix } from "./types/styles/Color";
|
|
@@ -32,7 +34,9 @@ import { SelectOption } from "./components/common/zonos-stripe-select/zonos-stri
|
|
|
32
34
|
import { ToggleItem } from "./types/common-ui/Toggle";
|
|
33
35
|
import { VirtualScrollRenderItem } from "./types/common-ui/VirtualScroll";
|
|
34
36
|
export { ContactOption, PaymentIntent, Stripe, StripeAddressElementChangeEvent } from "@stripe/stripe-js";
|
|
37
|
+
export { MissingShippingField } from "./components/utils/checkout/getMissingRequiredShippingFields";
|
|
35
38
|
export { EnteredInfo, TranslatedAddressObject } from "./types/checkout/TranslatedText";
|
|
39
|
+
export { AddressCompletionSubmit } from "./components/utils/checkout/applyAddressCompletion";
|
|
36
40
|
export { EventPayloadMap, IframeSuggestionsResponsePayload } from "./components/utils/iframe/IframeHelpers";
|
|
37
41
|
export { SubmitEventData } from "./components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog";
|
|
38
42
|
export { CheckboxColorPrefix, Color, ColorPrefix } from "./types/styles/Color";
|
|
@@ -80,6 +84,36 @@ export namespace Components {
|
|
|
80
84
|
*/
|
|
81
85
|
"type": 'billing' | 'shipping';
|
|
82
86
|
}
|
|
87
|
+
interface ZonosAddressCompletionDialog {
|
|
88
|
+
/**
|
|
89
|
+
* Whether or not the continue button is loading
|
|
90
|
+
*/
|
|
91
|
+
"continueLoading": boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Whether or not the dialog is open
|
|
94
|
+
*/
|
|
95
|
+
"dialogOpen": boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether or not the dialog is rendered in mobile mode
|
|
98
|
+
*/
|
|
99
|
+
"isMobile": boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The Zonos-required fields still missing from the selected address
|
|
102
|
+
*/
|
|
103
|
+
"missingFields": MissingShippingField[];
|
|
104
|
+
/**
|
|
105
|
+
* The shipping address selected from Stripe, shown read-only for context
|
|
106
|
+
*/
|
|
107
|
+
"shippingAddress": EnteredInfo;
|
|
108
|
+
/**
|
|
109
|
+
* Button color of the submit button
|
|
110
|
+
*/
|
|
111
|
+
"submitBtnColor"?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Button type of the submit button
|
|
114
|
+
*/
|
|
115
|
+
"submitBtnType"?: HTMLZonosButtonElement['variant'];
|
|
116
|
+
}
|
|
83
117
|
interface ZonosAddressDisplay {
|
|
84
118
|
/**
|
|
85
119
|
* Title for the address display
|
|
@@ -1568,6 +1602,10 @@ export interface ZonosAddressCustomEvent<T> extends CustomEvent<T> {
|
|
|
1568
1602
|
detail: T;
|
|
1569
1603
|
target: HTMLZonosAddressElement;
|
|
1570
1604
|
}
|
|
1605
|
+
export interface ZonosAddressCompletionDialogCustomEvent<T> extends CustomEvent<T> {
|
|
1606
|
+
detail: T;
|
|
1607
|
+
target: HTMLZonosAddressCompletionDialogElement;
|
|
1608
|
+
}
|
|
1571
1609
|
export interface ZonosAddressFormCustomEvent<T> extends CustomEvent<T> {
|
|
1572
1610
|
detail: T;
|
|
1573
1611
|
target: HTMLZonosAddressFormElement;
|
|
@@ -1699,6 +1737,24 @@ declare global {
|
|
|
1699
1737
|
prototype: HTMLZonosAddressElement;
|
|
1700
1738
|
new (): HTMLZonosAddressElement;
|
|
1701
1739
|
};
|
|
1740
|
+
interface HTMLZonosAddressCompletionDialogElementEventMap {
|
|
1741
|
+
"closeCompletionDialog": void;
|
|
1742
|
+
"completionSubmit": AddressCompletionSubmit;
|
|
1743
|
+
}
|
|
1744
|
+
interface HTMLZonosAddressCompletionDialogElement extends Components.ZonosAddressCompletionDialog, HTMLStencilElement {
|
|
1745
|
+
addEventListener<K extends keyof HTMLZonosAddressCompletionDialogElementEventMap>(type: K, listener: (this: HTMLZonosAddressCompletionDialogElement, ev: ZonosAddressCompletionDialogCustomEvent<HTMLZonosAddressCompletionDialogElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1746
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1747
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1748
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1749
|
+
removeEventListener<K extends keyof HTMLZonosAddressCompletionDialogElementEventMap>(type: K, listener: (this: HTMLZonosAddressCompletionDialogElement, ev: ZonosAddressCompletionDialogCustomEvent<HTMLZonosAddressCompletionDialogElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1750
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1751
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1752
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1753
|
+
}
|
|
1754
|
+
var HTMLZonosAddressCompletionDialogElement: {
|
|
1755
|
+
prototype: HTMLZonosAddressCompletionDialogElement;
|
|
1756
|
+
new (): HTMLZonosAddressCompletionDialogElement;
|
|
1757
|
+
};
|
|
1702
1758
|
interface HTMLZonosAddressDisplayElement extends Components.ZonosAddressDisplay, HTMLStencilElement {
|
|
1703
1759
|
}
|
|
1704
1760
|
var HTMLZonosAddressDisplayElement: {
|
|
@@ -2512,6 +2568,7 @@ declare global {
|
|
|
2512
2568
|
};
|
|
2513
2569
|
interface HTMLElementTagNameMap {
|
|
2514
2570
|
"zonos-address": HTMLZonosAddressElement;
|
|
2571
|
+
"zonos-address-completion-dialog": HTMLZonosAddressCompletionDialogElement;
|
|
2515
2572
|
"zonos-address-display": HTMLZonosAddressDisplayElement;
|
|
2516
2573
|
"zonos-address-form": HTMLZonosAddressFormElement;
|
|
2517
2574
|
"zonos-address-suggestions": HTMLZonosAddressSuggestionsElement;
|
|
@@ -2622,6 +2679,44 @@ declare namespace LocalJSX {
|
|
|
2622
2679
|
*/
|
|
2623
2680
|
"type": 'billing' | 'shipping';
|
|
2624
2681
|
}
|
|
2682
|
+
interface ZonosAddressCompletionDialog {
|
|
2683
|
+
/**
|
|
2684
|
+
* Whether or not the continue button is loading
|
|
2685
|
+
*/
|
|
2686
|
+
"continueLoading"?: boolean;
|
|
2687
|
+
/**
|
|
2688
|
+
* Whether or not the dialog is open
|
|
2689
|
+
*/
|
|
2690
|
+
"dialogOpen"?: boolean;
|
|
2691
|
+
/**
|
|
2692
|
+
* Whether or not the dialog is rendered in mobile mode
|
|
2693
|
+
*/
|
|
2694
|
+
"isMobile"?: boolean;
|
|
2695
|
+
/**
|
|
2696
|
+
* The Zonos-required fields still missing from the selected address
|
|
2697
|
+
*/
|
|
2698
|
+
"missingFields"?: MissingShippingField[];
|
|
2699
|
+
/**
|
|
2700
|
+
* Close dialog button click
|
|
2701
|
+
*/
|
|
2702
|
+
"onCloseCompletionDialog"?: (event: ZonosAddressCompletionDialogCustomEvent<void>) => void;
|
|
2703
|
+
/**
|
|
2704
|
+
* Emitted with the captured values when the customer completes the missing fields
|
|
2705
|
+
*/
|
|
2706
|
+
"onCompletionSubmit"?: (event: ZonosAddressCompletionDialogCustomEvent<AddressCompletionSubmit>) => void;
|
|
2707
|
+
/**
|
|
2708
|
+
* The shipping address selected from Stripe, shown read-only for context
|
|
2709
|
+
*/
|
|
2710
|
+
"shippingAddress": EnteredInfo;
|
|
2711
|
+
/**
|
|
2712
|
+
* Button color of the submit button
|
|
2713
|
+
*/
|
|
2714
|
+
"submitBtnColor"?: string;
|
|
2715
|
+
/**
|
|
2716
|
+
* Button type of the submit button
|
|
2717
|
+
*/
|
|
2718
|
+
"submitBtnType"?: HTMLZonosButtonElement['variant'];
|
|
2719
|
+
}
|
|
2625
2720
|
interface ZonosAddressDisplay {
|
|
2626
2721
|
/**
|
|
2627
2722
|
* Title for the address display
|
|
@@ -4191,6 +4286,7 @@ declare namespace LocalJSX {
|
|
|
4191
4286
|
}
|
|
4192
4287
|
interface IntrinsicElements {
|
|
4193
4288
|
"zonos-address": ZonosAddress;
|
|
4289
|
+
"zonos-address-completion-dialog": ZonosAddressCompletionDialog;
|
|
4194
4290
|
"zonos-address-display": ZonosAddressDisplay;
|
|
4195
4291
|
"zonos-address-form": ZonosAddressForm;
|
|
4196
4292
|
"zonos-address-suggestions": ZonosAddressSuggestions;
|
|
@@ -4275,6 +4371,7 @@ declare module "@stencil/core" {
|
|
|
4275
4371
|
export namespace JSX {
|
|
4276
4372
|
interface IntrinsicElements {
|
|
4277
4373
|
"zonos-address": LocalJSX.ZonosAddress & JSXBase.HTMLAttributes<HTMLZonosAddressElement>;
|
|
4374
|
+
"zonos-address-completion-dialog": LocalJSX.ZonosAddressCompletionDialog & JSXBase.HTMLAttributes<HTMLZonosAddressCompletionDialogElement>;
|
|
4278
4375
|
"zonos-address-display": LocalJSX.ZonosAddressDisplay & JSXBase.HTMLAttributes<HTMLZonosAddressDisplayElement>;
|
|
4279
4376
|
"zonos-address-form": LocalJSX.ZonosAddressForm & JSXBase.HTMLAttributes<HTMLZonosAddressFormElement>;
|
|
4280
4377
|
"zonos-address-suggestions": LocalJSX.ZonosAddressSuggestions & JSXBase.HTMLAttributes<HTMLZonosAddressSuggestionsElement>;
|
|
@@ -104,7 +104,7 @@ export declare const shipToTaxIdLabels: {
|
|
|
104
104
|
readonly placeholder: "DE123456789";
|
|
105
105
|
};
|
|
106
106
|
readonly MX: {
|
|
107
|
-
readonly friendlyName: "RFC number";
|
|
107
|
+
readonly friendlyName: "RFC or CURP number";
|
|
108
108
|
readonly placeholder: "XAXX010101000";
|
|
109
109
|
};
|
|
110
110
|
readonly NL: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as v}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],h="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.280.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=e=>(null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b),I=Promise.resolve().then((()=>(()=>{var e,n;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(n=window.Zonos)||void 0===n?void 0:n.buildCartDetail))})()?N(null):null));let k=!1;I.catch((e=>{k||console.warn(e)}));const R=async({cartId:e,retries:n})=>{const t=i(),s=o(),d=p()||void 0,c=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&c.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${c.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:d,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),R({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const $=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),Z=Date.now(),A="https://v1.3.280.js.zonos.com",L=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.280",U="https://fonts.googleapis.com",C=/^https:\/\/fonts\.googleapis\.com/;class E{}T=E,E.doneInit=!1,E.cartSettings=null,E.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),E.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),E._paypalMockResponse=null,E.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,E.isBigCommerce=!1,E.releaseDate="1783609436334",E.isLegacyCheckout=!1,E.googleAnalyticId=null,E.googleAnalyticReady=!1,E.facebookPixelId=null,E.facebookPixelReady=!1,E.startLoadTime=Z,E.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",E.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),E.overrideUseCustomAddressForm=!1,E.isCollect=!1,E.isInvoice=!1,E.isNpm=!0,E.zonosQaUrl=null,E.zonosQaUrlApi=null,E.trackEventLogs=[],E.version="v1.3.280",E.modeAlerted=!1,E.cartData=null,E.paypal=null,E.zonosMode=null,E.IframeService=t,E.getCurrentTimestamp=()=>(new Date).getTime(),E.zonosController=null,E.loadTimeApiInfoList=[],E.logIntervalId=null,E.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.createCartId=null==o?void 0:o.createCartId,T.buildCartDetail=null==o?void 0:o.buildCartDetail,T.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,"undefined"!=typeof window&&window.parent===window&&(T.googleAnalyticReady=!0,T.facebookPixelReady=!0),T.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.zonosMode=T.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await R({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||v){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:d,overrideCurrencyFormat:c}}),T.doneInit=!0},E.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${v}`)){const e=document.createElement("button");e.id=v,e.style.display="none",document.body.appendChild(e)}},E.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},E.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},E.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${v}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},E.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},E.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},E.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},E.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},E.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},E.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{var n;k=!0;const o=Date.now();return((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(null!==(n=await I)&&void 0!==n?n:await N(null),e,o)})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,r("Zonos controller injected!")},E.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},E.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return L;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.280";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.280";case"vercel":return A}};return T.isNpm&&S()||n()},E.injectZonosCdn=()=>{T.injectScript({cdnType:h,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:h,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},E.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},E.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:h,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},E.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!C.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},E.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},E.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const P=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],F=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],D=[...P,...F];export{E as Zonos,D as checkoutSessionAttributeKeys,F as checkoutSessionImmutableAttributeKeys,P as checkoutSessionMutableAttributeKeys}
|
|
1
|
+
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as v}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-bcf5cffb.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],h="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.282.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=e=>(null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b),I=Promise.resolve().then((()=>(()=>{var e,n;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(n=window.Zonos)||void 0===n?void 0:n.buildCartDetail))})()?N(null):null));let k=!1;I.catch((e=>{k||console.warn(e)}));const R=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),R({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const $=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),Z=Date.now(),A="https://v1.3.282.js.zonos.com",L=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.282",U="https://fonts.googleapis.com",C=/^https:\/\/fonts\.googleapis\.com/;class E{}T=E,E.doneInit=!1,E.cartSettings=null,E.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),E.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),E._paypalMockResponse=null,E.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,E.isBigCommerce=!1,E.releaseDate="1784821022355",E.isLegacyCheckout=!1,E.googleAnalyticId=null,E.googleAnalyticReady=!1,E.facebookPixelId=null,E.facebookPixelReady=!1,E.startLoadTime=Z,E.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",E.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),E.overrideUseCustomAddressForm=!1,E.isCollect=!1,E.isInvoice=!1,E.isNpm=!0,E.zonosQaUrl=null,E.zonosQaUrlApi=null,E.trackEventLogs=[],E.version="v1.3.282",E.modeAlerted=!1,E.cartData=null,E.paypal=null,E.zonosMode=null,E.IframeService=t,E.getCurrentTimestamp=()=>(new Date).getTime(),E.zonosController=null,E.loadTimeApiInfoList=[],E.logIntervalId=null,E.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.createCartId=null==o?void 0:o.createCartId,T.buildCartDetail=null==o?void 0:o.buildCartDetail,T.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,"undefined"!=typeof window&&window.parent===window&&(T.googleAnalyticReady=!0,T.facebookPixelReady=!0),T.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.zonosMode=T.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await R({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||v){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),T.doneInit=!0},E.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${v}`)){const e=document.createElement("button");e.id=v,e.style.display="none",document.body.appendChild(e)}},E.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},E.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},E.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${v}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},E.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},E.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},E.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},E.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},E.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},E.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{var n;k=!0;const o=Date.now();return((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(null!==(n=await I)&&void 0!==n?n:await N(null),e,o)})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,r("Zonos controller injected!")},E.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},E.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return L;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.282";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.282";case"vercel":return A}};return T.isNpm&&S()||n()},E.injectZonosCdn=()=>{T.injectScript({cdnType:h,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:h,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},E.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},E.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:h,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},E.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!C.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},E.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},E.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const P=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],F=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],D=[...P,...F];export{E as Zonos,D as checkoutSessionAttributeKeys,F as checkoutSessionImmutableAttributeKeys,P as checkoutSessionMutableAttributeKeys}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-fb8dc23f.system.js","./p-1d31b966.system.js"],(function(r){"use strict";var n,v,u;return{setters:[function(r){n=r.d},function(r){v=r.w;u=r.h}],execute:function(){var t=function(){var r,v;var u=n.displayBaseCurrency;var t=u&&((r=n.exchangeRate)===null||r===void 0?void 0:r.sourceCurrencyCode)?(v=n.exchangeRate)===null||v===void 0?void 0:v.sourceCurrencyCode:n.currency;return t};var a=r("r",(function(r){var a=r.amount,e=r.isForeign;var i,o;var c=((i=n.exchangeRate)===null||i===void 0?void 0:i.rate)||1;var s=e?a:v(a);var d=n.currency;var f=(o=n.items[0])===null||o===void 0?void 0:o.currencyCode;if(f===d){return u({amount:s,currency:d})}var l=n.displayBaseCurrency;var m=t();if(e){var y=l?s/c:s;return u({amount:y,currency:m})}var b=l?s:s*c;return u({amount:b,currency:m})}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-7261e245.system.js","./p-47a1d469.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,a,
|
|
1
|
+
System.register(["./p-7261e245.system.js","./p-47a1d469.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,a,i;return{setters:[function(t){s=t.r;o=t.h;n=t.a},function(t){a=t.f},function(t){i=t.c},function(){}],execute:function(){var e=":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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";var r=e;var c=t("zonos_v_stack",function(){function t(t){s(this,t);this.spacing=24}t.prototype.render=function(){return o(n,{key:"55d608e49a9d0a95c23902c68f555d3d17e34675",style:{"--zonos--font-family":a()}},o("div",{key:"529887c92438dd3793d2c4737ff2ae52abe560cb",class:i(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},o("slot",{key:"2a3c3c193aa74b9829dca73bddfdbd3dbed4c6c6"})))};return t}());c.style=r}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as e,a as t,g as s}from"./p-ce75b047.js";import{d as l}from"./p-7bdce9d4.js";import{l as i,k as n,t as r,g as h,n as a,o as d,p as c,q as m,h as z,r as g}from"./p-3f8f4c78.js";import{z as p,g as w,m as f}from"./p-9a417eeb.js";import{c as b}from"./p-b4b7f705.js";import{h as u,l as v}from"./p-41dd1cb8.js";import{g as x}from"./p-5883217a.js";import{l as y}from"./p-0a377722.js";const k=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},L=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:l,restrictionBehavior:i}=p.helloSettings;l&&s||y("Hello could not check item restrictions - must provide title and description selectors.");const r=l&&n(l)&&document.querySelectorAll(l)||[],h=s&&n(s)&&document.querySelectorAll(s)||[];if(r.length!==h.length)return y("Hello could not check item restrictions - Title and description selectors do not match"),[];const a="RESTRICT_AND_BLOCK"===i,d=a&&t&&n(t)&&document.querySelectorAll(t)||[];a&&d.length!==h.length&&y('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const c=[];for(let t=0;t<r.length;t++){const s=r[t],l=h[t];if(s&&l){const i={cartButtonNode:d[t]||null,description:(null===(o=l.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};c.push(i)}}return c},C=class{constructor(e){o(this,e),this.showPeekMessage=!1,this.zonosStoreHelloSettings=p.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1,this.getHelloPeekMessage=o=>{if(("productDetail"===p.currentHelloPage||"productList"===p.currentHelloPage)&&this.allRestrictedItems.length){const o=r("click to learn more");return`${r("productDetail"===p.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(p.currentHelloPage){case"cart":return r("Prepay duties and taxes at checkout");case"productList":case"productDetail":return r("See duty and tax thresholds");default:return r("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==p.currentHelloPage&&"productList"!==p.currentHelloPage||"DISABLED"===p.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=i;if(!e)return v("Hello could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const l={items:o,shipFrom:e,shipTo:t},{errors:i,json:n}=await u("/api/zonos-elements/check-item-restrictions",{body:l,method:"POST"});return i.length||!n?(v(`Error fetching item restrictions: ${null===(s=i.find(Boolean))||void 0===s?void 0:s.message}`),[]):n.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(p.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=p.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=L();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=l((()=>{const{productTitleElementSelector:o}=p.helloSettings;if(o){const o=L();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{var o;const e=new MutationObserver(this.handleProductCountChange);e.observe(document.body,{childList:!0,subtree:!0}),null===(o=this.observerWatcher)||void 0===o||o.push(e)},this.watchPriceChange=()=>{var o;const e=new MutationObserver((()=>{this.displayCurrency()}));e.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),null===(o=this.observerWatcher)||void 0===o||o.push(e)},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&h(o.searchParams))!==i.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,p.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=p.helloSettings;return k(o)?"cart":k(t)?"productDetail":k(s)?"productList":k(e)?"home":""})();const e=new URL(window.location.href);if(!h(e.searchParams))return void a(i.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return x(this.helloRef)}}showDialogHandler(o){var e;if(o){const o=null===(e=this.helloElement)||void 0===e?void 0:e.parentElement;o&&o.parentElement===document.body&&(o.style.zIndex="2147483647",document.body.appendChild(o))}}async getCountryList(){return i.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&p.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}disconnectedCallback(){var o;null===(o=this.observerWatcher)||void 0===o||o.forEach((o=>o.disconnect()))}async displayCurrency(){"DISABLED"!==p.helloSettings.currencyBehavior&&(i.exchangeRate?d():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return c(o)}async convert(o){return m(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||i.selectedCountryCode&&"function"==typeof p.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=p.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||p.helloSettings.mobileLocation,e=this.desktopLocationOverride||p.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!!this.desktopLocationOverride||!p.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(e?e.includes("LEFT"):this.shouldAnimateLeftDesktop()),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=w(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=p.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>o&&new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:l,targetCurrency:n}=i,{isOnLeft:r,isOnTop:h,shouldFloat:a}=this.getHelloLocation(),d=f(p.appearance,this.appearanceSettingsOverride||null),{theme:c}=d,m=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(p.organizationName);const z=g()&&!!l;z&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:n});const w=null==(u=p.helloSettings.widgetSize)||!Number.isFinite(u)||u<=0?18:Math.min(64,Math.max(18,u));var u;return e(t,{class:"zonos--hello zonos--elements","data-theme":c,style:{"--zonos-elements-hello-widget-size":`${w}px`}},z&&e("div",{class:b(["zonos--hello-wrapper",a&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",r&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",a&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o),type:"button"},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),e("div",{class:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",r&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",a&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:r,appearanceSettings:d,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:m,setIsOpen:this.changeShowDialog}))))}get helloElement(){return s(this)}static get watchers(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};C.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block;--zonos-elements-hello-widget-size:18px;--zonos-elements-hello-bubble-padding:max(\n 6px,\n calc(var(--zonos-elements-hello-widget-size) * 0.22)\n );--zonos-elements-hello-bubble-size:calc(\n var(--zonos-elements-hello-widget-size) +\n var(--zonos-elements-hello-bubble-padding) * 2 + 2px\n )}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px;width:auto;height:auto;z-index:1001}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:var(--zonos-elements-hello-bubble-padding);border-radius:9999px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);left:0;-webkit-transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 calc(var(--zonos-elements-hello-bubble-size) / 2);border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:calc(var(--zonos-elements-hello-bubble-size) / 2);border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2)}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;height:var(--zonos-elements-hello-widget-size);width:var(--zonos-elements-hello-widget-size)}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{C as zonos_hello}
|
|
1
|
+
import{r as o,h as e,a as t,g as s}from"./p-ce75b047.js";import{d as l}from"./p-7bdce9d4.js";import{l as i,k as n,t as r,g as h,n as a,o as d,p as c,q as m,h as z,r as g}from"./p-71fc8a22.js";import{z as p,g as w,m as f}from"./p-9a417eeb.js";import{c as b}from"./p-b4b7f705.js";import{h as u,l as v}from"./p-41dd1cb8.js";import{g as x}from"./p-5883217a.js";import{l as y}from"./p-0a377722.js";const k=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},L=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:l,restrictionBehavior:i}=p.helloSettings;l&&s||y("Hello could not check item restrictions - must provide title and description selectors.");const r=l&&n(l)&&document.querySelectorAll(l)||[],h=s&&n(s)&&document.querySelectorAll(s)||[];if(r.length!==h.length)return y("Hello could not check item restrictions - Title and description selectors do not match"),[];const a="RESTRICT_AND_BLOCK"===i,d=a&&t&&n(t)&&document.querySelectorAll(t)||[];a&&d.length!==h.length&&y('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const c=[];for(let t=0;t<r.length;t++){const s=r[t],l=h[t];if(s&&l){const i={cartButtonNode:d[t]||null,description:(null===(o=l.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};c.push(i)}}return c},C=class{constructor(e){o(this,e),this.showPeekMessage=!1,this.zonosStoreHelloSettings=p.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1,this.getHelloPeekMessage=o=>{if(("productDetail"===p.currentHelloPage||"productList"===p.currentHelloPage)&&this.allRestrictedItems.length){const o=r("click to learn more");return`${r("productDetail"===p.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(p.currentHelloPage){case"cart":return r("Prepay duties and taxes at checkout");case"productList":case"productDetail":return r("See duty and tax thresholds");default:return r("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==p.currentHelloPage&&"productList"!==p.currentHelloPage||"DISABLED"===p.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=i;if(!e)return v("Hello could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const l={items:o,shipFrom:e,shipTo:t},{errors:i,json:n}=await u("/api/zonos-elements/check-item-restrictions",{body:l,method:"POST"});return i.length||!n?(v(`Error fetching item restrictions: ${null===(s=i.find(Boolean))||void 0===s?void 0:s.message}`),[]):n.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(p.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=p.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=L();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=l((()=>{const{productTitleElementSelector:o}=p.helloSettings;if(o){const o=L();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{var o;const e=new MutationObserver(this.handleProductCountChange);e.observe(document.body,{childList:!0,subtree:!0}),null===(o=this.observerWatcher)||void 0===o||o.push(e)},this.watchPriceChange=()=>{var o;const e=new MutationObserver((()=>{this.displayCurrency()}));e.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),null===(o=this.observerWatcher)||void 0===o||o.push(e)},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&h(o.searchParams))!==i.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,p.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=p.helloSettings;return k(o)?"cart":k(t)?"productDetail":k(s)?"productList":k(e)?"home":""})();const e=new URL(window.location.href);if(!h(e.searchParams))return void a(i.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return x(this.helloRef)}}showDialogHandler(o){var e;if(o){const o=null===(e=this.helloElement)||void 0===e?void 0:e.parentElement;o&&o.parentElement===document.body&&(o.style.zIndex="2147483647",document.body.appendChild(o))}}async getCountryList(){return i.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&p.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}disconnectedCallback(){var o;null===(o=this.observerWatcher)||void 0===o||o.forEach((o=>o.disconnect()))}async displayCurrency(){"DISABLED"!==p.helloSettings.currencyBehavior&&(i.exchangeRate?d():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return c(o)}async convert(o){return m(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||i.selectedCountryCode&&"function"==typeof p.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=p.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||p.helloSettings.mobileLocation,e=this.desktopLocationOverride||p.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!!this.desktopLocationOverride||!p.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(e?e.includes("LEFT"):this.shouldAnimateLeftDesktop()),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=w(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=p.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>o&&new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:l,targetCurrency:n}=i,{isOnLeft:r,isOnTop:h,shouldFloat:a}=this.getHelloLocation(),d=f(p.appearance,this.appearanceSettingsOverride||null),{theme:c}=d,m=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(p.organizationName);const z=g()&&!!l;z&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:n});const w=null==(u=p.helloSettings.widgetSize)||!Number.isFinite(u)||u<=0?18:Math.min(64,Math.max(18,u));var u;return e(t,{class:"zonos--hello zonos--elements","data-theme":c,style:{"--zonos-elements-hello-widget-size":`${w}px`}},z&&e("div",{class:b(["zonos--hello-wrapper",a&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",r&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",a&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o),type:"button"},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),e("div",{class:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",r&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",a&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:r,appearanceSettings:d,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:m,setIsOpen:this.changeShowDialog}))))}get helloElement(){return s(this)}static get watchers(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};C.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block;--zonos-elements-hello-widget-size:18px;--zonos-elements-hello-bubble-padding:max(\n 6px,\n calc(var(--zonos-elements-hello-widget-size) * 0.22)\n );--zonos-elements-hello-bubble-size:calc(\n var(--zonos-elements-hello-widget-size) +\n var(--zonos-elements-hello-bubble-padding) * 2 + 2px\n )}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px;width:auto;height:auto;z-index:1001}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:var(--zonos-elements-hello-bubble-padding);border-radius:9999px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-left-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);left:0;-webkit-transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(-100% + var(--zonos-elements-hello-bubble-size) / 2));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 calc(var(--zonos-elements-hello-bubble-size) / 2);border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:calc(var(--zonos-elements-hello-bubble-size) / 2);border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));transform:translateX(calc(100% - var(--zonos-elements-hello-bubble-size) / 2));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2);border-bottom-right-radius:calc(var(--zonos-elements-hello-bubble-size) / 2)}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center;height:var(--zonos-elements-hello-widget-size);width:var(--zonos-elements-hello-widget-size)}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{C as zonos_hello}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,e as t,h as s,a as e}from"./p-ce75b047.js";import{d as a}from"./p-
|
|
1
|
+
import{r as o,e as t,h as s,a as e}from"./p-ce75b047.js";import{d as a}from"./p-5953208b.js";import{c as n}from"./p-cc6ad18a.js";import{f as i}from"./p-9a417eeb.js";import{c as r}from"./p-b4b7f705.js";import{s as h}from"./p-96d77739.js";import"./p-71fc8a22.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";import"./p-34d6eb83.js";import"./p-f1aea919.js";import"./p-bcf5cffb.js";const l=class{constructor(t){o(this,t),this.errorImages=[]}render(){const o=t("./assets/empty-item.jpeg"),i=a.items.filter((o=>!o.isRestricted));return s(e,{key:"1ce09299c7be0b28d85a5bf5b6d0cd1272b305a2",class:"zonos--collect-cart-items zonos--elements"},s("table",{key:"a964c41a141ad4490e3213054d25dd688dca6d18",class:"zonos--cart-table"},s("tbody",{key:"dbc155d72b4de43839b0e2fc8b8704e5c885a5ec"},i.map((t=>{const e=t.imageUrl,a=n(t.name);return s("tr",{class:"zonos--collect-cart-item"},s("td",{class:"zonos--column zonos--cart-item-image"},e&&!this.errorImages.includes(e)?s("img",{alt:t.name,onError:()=>{this.errorImages=[...this.errorImages,e]},src:t.imageUrl,style:{"min-width":"40px"},width:40}):s("img",{alt:t.name,src:o,width:40})),s("td",{class:"zonos--column zonos--cart-item-name"},s("div",null,a.map((o=>s("zonos-text",{type:"semiBoldLabel"},o))))))})))))}static get assetsDirs(){return["assets"]}};l.style=":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 .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";const c=class{constructor(t){o(this,t),this.spacing=24}render(){return s(e,{key:"029e16a802574614fb1d7cf1c7142425bf5a8dd2",style:{"--spacing":`${this.spacing}px`,"--zonos--font-family":i()}},s("slot",{key:"9894338cb38887b8757182f8ed2a4ce1bcff0eaf"}))}};c.style=":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:row;flex-direction:row;gap:var(--spacing, 24px)}";const m=class{constructor(t){o(this,t),this.skeletonWidth="100%",this.skeletonHeight="14px"}render(){return s(e,{key:"b5450df7f385c16cc93b492ba8e3369f131db069",class:r(["zonos--elements zonos--skeleton"]),style:h({"--zonos--skeleton-height":this.skeletonHeight,"--zonos--skeleton-width":this.skeletonWidth})})}};m.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block;background:var(--zonos-elements-gray-200);border-radius:var(--zonos-elements-radius-12);width:var(--zonos--skeleton-width);height:var(--zonos--skeleton-height);min-height:var(--zonos--skeleton-height);max-width:100%}";export{l as zonos_collect_cart_items,c as zonos_h_stack,m as zonos_skeleton}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,h as s,a as e,d as t}from"./p-ce75b047.js";import{t as i,l as n}from"./p-71fc8a22.js";import{i as a}from"./p-0c64dbbb.js";import{f as d}from"./p-9a417eeb.js";import{c as l}from"./p-b4b7f705.js";import{g as r}from"./p-f1aea919.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";const h=class{constructor(s){o(this,s)}render(){var o;const{city:t,country:d,email:l,line1:r,line2:h,name:c,phone:f,postal_code:m,state:b}=this.currentAddress,p=null===(o=n.shippingZoneCountries)||void 0===o?void 0:o[d],z=({bold:o,content:e})=>{const t=a(e)?"red-600":"gray-1000";return s("zonos-text",{textColor:t,type:o?"boldLabel":"body"},e)};return s(e,{class:"zonos--address-form zonos--elements"},s("div",{class:"zonos--title"},s("zonos-text",{textColor:"gray-700",type:"smallHeader"},i("shipping"===this.addressType?"Shipping":"Billing"))),s("div",{class:"zonos--address-group"},c&&s("div",{class:"zonos--address-line"},z({bold:!0,content:c})),l&&s("div",{class:"zonos--address-line"},z({content:l})),f&&s("div",{class:"zonos--address-line"},z({content:f})),r&&s("div",{class:"zonos--address-line"},z({content:r})),h&&s("div",{class:"zonos--address-line"},z({content:h})),s("div",{class:"zonos--address-line"},t&&z({content:t}),b&&z({content:b}),m&&z({content:m})),p&&s("div",{class:"zonos--address-line"},s("zonos-country-flag",{class:"zonos--country-flag",countryCode:p.code})," ",z({content:p.displayName}))))}};h.style=':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 .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const c=class{constructor(s){o(this,s),this.closeDialog=t(this,"closeDialog",3),this.open=!1,this.headerText="",this.width="460px",this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1,this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=o=>{o.target!==o.currentTarget||this.noClickOutside||this.closeDialog.emit()}}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(o){"Escape"===o.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){const o=r({overrideBorderStyle:this.borderStyle});return s(e,{key:"93de5ea91ebef1927a2d7dc91a00f87277755ac7",class:l(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":d(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},s("div",{key:"86330a3de751f262a3f0f80fbeb436bb6e2b206f",class:"zonos--backdrop"}),s("div",{key:"a6702c9a9b5bba9f3523503cd85ba6e6ae77fc9d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},s("div",{key:"2c4d6e9170fbe80a2ea249d3f40cbc72e5df05d3",class:"zonos--dialog"},this.isLoading&&s("div",{key:"e83dcb53e9cd7504d588b124c6468535e81ce71d",class:"zonos--loading"},s("zonos-spinner",{key:"5e8b3451b5358c76c2fdf47a0ad5eecc8394d012",size:30}),this.loadingTitle&&s("zonos-text",{key:"671203125d8fd7e8cb811b61b7190f826221507a",class:"zonos--loading-title",size:"l",weight:700},this.loadingTitle),this.loadingText&&s("zonos-text",{key:"791a95ed2bdad0c3bfb136c9e42d7d8e920110d9",class:"zonos--loading-text"},this.loadingText)),(this.headerText||!this.noCloseButton)&&s("div",{key:"8d4f7a2e12cd56d6341cf5aa17be1a7f151ca45b",class:"zonos--header"},this.headerText&&s("h3",{key:"4bdd26b40a2209ccf44d85440cfbf173724f9aaa",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&s("zonos-button",{key:"c8f5d7eaff8c9ba94d60d587b5601472e80ea79a",class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:this.closeButtonHandler,title:"Close dialog",variant:"subtle"})),s("div",{key:"e5d91fb3bb3546e559566f8782aa9d939d0f1d04",class:l(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},s("slot",{key:"2da7a3c7a978bb520c255a0043f96bf15b2dd006"})),s("slot",{key:"38ec2165a11c9cc2b121122124482590f9cd31e9",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};c.style=":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 .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:4px;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--loading-text,:host .zonos--loading-title{max-width:100%;padding:0 32px;text-align:center}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";export{h as zonos_address_display,c as zonos_dialog}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as e}from"./p-5953208b.js";const l=3,a=({countryField:l,event:a})=>{var o,t,n;if(!a)return[];const{value:s}=a,i=[],{lastName:r}=e({firstName:s.firstName,lastName:s.lastName,name:s.name});return r.trim()||i.push({key:"lastName"}),(null==l?void 0:l.stateRequired)&&!(null===(o=s.address.state)||void 0===o?void 0:o.trim())&&i.push({key:"state"}),(null==l?void 0:l.zipRequired)&&(null!==(n=null===(t=s.address.postal_code)||void 0===t?void 0:t.trim().length)&&void 0!==n?n:0)<3&&i.push({key:"postal_code"}),i};export{l as M,a as g}
|