@zonos/elements 1.3.15-alpha.3 → 1.3.15
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/RemoveIcon-6c79a2a1.js +5 -0
- package/dist/cjs/{cart-1b1d39af.js → cart-db549f04.js} +976 -138
- package/dist/cjs/containsNonLatinChars-2be5129b.js +24 -0
- package/dist/cjs/{getBorderRadius-c8cc2bb3.js → getBorderRadius-44b3eca1.js} +4 -6
- package/dist/cjs/index-654a6001.js +1361 -0
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +8 -0
- package/dist/cjs/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
- package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
- package/dist/cjs/zonos-badge_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/{zonos-button_2.cjs.entry.js → zonos-button_3.cjs.entry.js} +53 -13
- package/dist/cjs/zonos-card_2.cjs.entry.js +10 -10
- package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +135 -109
- package/dist/cjs/zonos-checkout.cjs.entry.js +18 -17
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +12 -12
- package/dist/cjs/zonos-elements.cjs.js +10 -10
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +8 -8
- package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
- package/dist/cjs/zonos-input.cjs.entry.js +57 -0
- package/dist/cjs/zonos-link.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
- package/dist/cjs/zonos-notification.cjs.entry.js +4 -4
- package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +7 -5
- package/dist/cjs/zonos-text.cjs.entry.js +3 -2
- package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
- 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 +5 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +6 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
- package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.css +1 -0
- package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
- package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +1 -0
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +22 -4
- 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-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +3 -3
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
- package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
- package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +4 -2
- package/dist/collection/components/common/zonos-text/zonos-text.js +1 -0
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +7 -8
- 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 +3 -3
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/stripe.js +153 -14
- package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
- package/dist/collection/components/store/translationStore/strings.base.js +36 -6
- package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
- package/dist/collection/components/store/translationStore/strings.french.js +36 -6
- package/dist/collection/components/store/translationStore/strings.german.js +36 -6
- package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
- package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
- package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
- package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
- package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
- package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
- package/dist/collection/components/utils/getBorderRadius.js +3 -5
- package/dist/collection/styles/stripe/defaultVariable.js +2 -2
- package/dist/collection/types/checkout/TranslatedText.js +1 -0
- package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
- package/dist/components/containsNonLatinChars.js +21 -0
- package/dist/components/getBorderRadius.js +3 -5
- package/dist/components/stripe.js +255 -4545
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/translationStore.js +5131 -0
- package/dist/components/zonos-address-display.d.ts +11 -0
- package/dist/components/zonos-address-display.js +6 -0
- package/dist/components/zonos-address-display2.js +64 -0
- package/dist/components/zonos-address-form.d.ts +11 -0
- package/dist/components/zonos-address-form.js +6 -0
- package/dist/components/zonos-address-form2.js +84 -0
- package/dist/components/zonos-address-update-dialog.d.ts +11 -0
- package/dist/components/zonos-address-update-dialog.js +6 -0
- package/dist/components/zonos-address-update-dialog2.js +264 -0
- package/dist/components/zonos-address2.js +3 -93
- package/dist/components/zonos-badge2.js +3 -3
- package/dist/components/zonos-button2.js +18 -9
- package/dist/components/zonos-card2.js +3 -3
- package/dist/components/zonos-cart-items2.js +1 -1
- package/dist/components/zonos-cart-subtotal2.js +2 -1
- package/dist/components/zonos-checkbox2.js +15 -6
- package/dist/components/zonos-checkout-finish2.js +26 -6
- package/dist/components/zonos-checkout-footer2.js +2 -2
- package/dist/components/zonos-checkout-payment2.js +2 -1
- package/dist/components/zonos-checkout-progress-tabs2.js +5 -4
- package/dist/components/zonos-checkout.js +71 -41
- package/dist/components/zonos-collapse2.js +2 -2
- package/dist/components/zonos-component.js +1 -1
- package/dist/components/zonos-controller.js +2 -2
- package/dist/components/zonos-country-select2.js +2 -2
- package/dist/components/zonos-custom-message2.js +2 -2
- package/dist/components/zonos-customer-info2.js +170 -29
- package/dist/components/zonos-dialog2.js +7 -5
- package/dist/components/zonos-hello-dialog-footer2.js +3 -3
- package/dist/components/zonos-hello-dialog2.js +5 -4
- package/dist/components/zonos-hello.js +2 -1
- package/dist/components/zonos-input.d.ts +11 -0
- package/dist/components/zonos-input.js +6 -0
- package/dist/components/zonos-input2.js +78 -0
- package/dist/components/zonos-language-select2.js +4 -3
- package/dist/components/zonos-link-authentication2.js +12 -5
- package/dist/components/zonos-link.js +1 -1
- package/dist/components/zonos-logo.js +2 -2
- package/dist/components/zonos-notification2.js +2 -2
- package/dist/components/zonos-payment2.js +1 -1
- package/dist/components/zonos-review2.js +2 -1
- package/dist/components/zonos-select-dialog-header2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +4 -2
- package/dist/components/zonos-shipping2.js +3 -2
- package/dist/components/zonos-text2.js +1 -0
- package/dist/components/zonos-tooltip2.js +2 -2
- package/dist/components/zonos-v-stack2.js +2 -2
- package/dist/esm/RemoveIcon-f6715b36.js +3 -0
- package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
- package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
- package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
- package/dist/esm/index-e063389c.js +1328 -0
- package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
- package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
- package/dist/esm/zonos-address_8.entry.js +631 -0
- package/dist/esm/zonos-badge_2.entry.js +7 -7
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/{zonos-button_2.entry.js → zonos-button_3.entry.js} +53 -14
- package/dist/esm/zonos-card_2.entry.js +10 -10
- package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +131 -104
- package/dist/esm/zonos-checkout.entry.js +13 -12
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_3.entry.js +12 -12
- package/dist/esm/zonos-elements.js +11 -11
- package/dist/esm/zonos-hello-dialog.entry.js +8 -8
- package/dist/esm/zonos-hello.entry.js +5 -5
- package/dist/esm/zonos-input.entry.js +53 -0
- package/dist/esm/zonos-link.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +4 -4
- package/dist/esm/zonos-notification.entry.js +4 -4
- package/dist/esm/zonos-payment.entry.js +6 -6
- package/dist/esm/zonos-select-dialog-header_2.entry.js +6 -6
- package/dist/esm/zonos-shipping-rich-radio.entry.js +7 -5
- package/dist/esm/zonos-text.entry.js +3 -2
- package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- package/dist/esm-es5/RemoveIcon-f6715b36.js +1 -0
- package/dist/esm-es5/cart-462e89a6.js +1 -0
- package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
- package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
- package/dist/esm-es5/index-e063389c.js +2 -0
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
- package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -0
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -0
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -0
- 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-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
- package/dist/scripts/loadStripe.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/stripe.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
- package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
- package/dist/types/components/store/checkout/stripe.d.ts +25 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
- package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
- package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
- package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
- package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
- package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
- package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
- package/dist/types/components.d.ts +308 -6
- package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
- package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.customer.types.ts +2 -0
- package/dist/zonos-elements/{p-593948b5.system.entry.js → p-029f11dd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-af8391bb.entry.js → p-094c0ee8.entry.js} +1 -1
- package/dist/zonos-elements/p-0c64dbbb.js +1 -0
- package/dist/zonos-elements/p-11504442.entry.js +1 -0
- package/dist/zonos-elements/p-11bef836.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
- package/dist/zonos-elements/p-13ddaf31.js +2 -0
- package/dist/zonos-elements/p-154aaf95.system.js +1 -0
- package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
- package/dist/zonos-elements/{p-5ee8a685.entry.js → p-1e934274.entry.js} +1 -1
- package/dist/zonos-elements/p-20582e58.system.entry.js +1 -0
- package/dist/zonos-elements/{p-bfa8d9a4.system.entry.js → p-2439c82f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2670438c.system.js +1 -0
- package/dist/zonos-elements/p-321226b0.entry.js +1 -0
- package/dist/zonos-elements/{p-d149bc5d.system.entry.js → p-3221530d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9fafda6.entry.js → p-32d27535.entry.js} +1 -1
- package/dist/zonos-elements/p-3d10866d.entry.js +1 -0
- package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
- package/dist/zonos-elements/p-3f05d130.system.entry.js +1 -0
- package/dist/zonos-elements/p-430eefd4.entry.js +1 -0
- package/dist/zonos-elements/{p-fc35d717.system.entry.js → p-49825866.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5525b740.entry.js +1 -0
- package/dist/zonos-elements/p-578f0aad.system.js +1 -0
- package/dist/zonos-elements/{p-3e417d7c.entry.js → p-58a8ef6c.entry.js} +1 -1
- package/dist/zonos-elements/p-5d993965.js +1 -0
- package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-49120f0e.system.entry.js → p-60e262f0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-64b594f4.js +1 -0
- package/dist/zonos-elements/{p-7891f8d2.entry.js → p-66471df6.entry.js} +1 -1
- package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
- package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
- package/dist/zonos-elements/{p-e1ac5b2a.system.entry.js → p-80d78980.system.entry.js} +1 -1
- package/dist/zonos-elements/p-81a54668.js +1 -0
- package/dist/zonos-elements/p-83cc2936.js +1 -0
- package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
- package/dist/zonos-elements/p-8a61a04f.system.entry.js +1 -0
- package/dist/zonos-elements/p-8b32f560.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
- package/dist/zonos-elements/{p-031086ba.system.entry.js → p-94b15a5e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9768840a.system.entry.js → p-9a45fae5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
- package/dist/zonos-elements/p-a6d7ac46.js +1 -0
- package/dist/zonos-elements/{p-2a99c8b5.system.entry.js → p-a6eeb4bd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1950dda7.entry.js → p-a93f2e84.entry.js} +1 -1
- package/dist/zonos-elements/p-aed0098c.system.js +1 -0
- package/dist/zonos-elements/{p-92446677.entry.js → p-b19d51e0.entry.js} +1 -1
- package/dist/zonos-elements/{p-46f9c93e.system.entry.js → p-b9652402.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d3772fd3.entry.js → p-baee62a4.entry.js} +1 -1
- package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cd1cc224.entry.js +1 -0
- package/dist/zonos-elements/{p-ae4a4634.system.entry.js → p-d1b63cec.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d6b103d5.system.js +1 -0
- package/dist/zonos-elements/{p-376bdf70.entry.js → p-da6767d8.entry.js} +1 -1
- package/dist/zonos-elements/p-dde1383b.entry.js +1 -0
- package/dist/zonos-elements/p-df192668.system.js +1 -0
- package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
- package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
- package/dist/zonos-elements/{p-a0abc499.system.entry.js → p-f3d3c754.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f79682b5.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.css +3 -3
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/package.json +3 -2
- package/dist/cjs/index-3b4816ef.js +0 -2088
- package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
- package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
- package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
- package/dist/components/sendErrorLog.js +0 -21
- package/dist/esm/index-0e31d804.js +0 -2055
- package/dist/esm/sendErrorLog-8642e94a.js +0 -26
- package/dist/esm/zonos-address_4.entry.js +0 -381
- package/dist/esm/zonos-icon.entry.js +0 -35
- package/dist/esm-es5/cart-10bcd2e0.js +0 -1
- package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
- package/dist/esm-es5/index-0e31d804.js +0 -2
- package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
- package/dist/esm-es5/submitGtag-84886899.js +0 -1
- package/dist/esm-es5/zonos-address_4.entry.js +0 -1
- package/dist/esm-es5/zonos-button_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
- package/dist/esm-es5/zonos-icon.entry.js +0 -1
- package/dist/scripts/insertTranslations.js +0 -1
- package/dist/zonos-elements/p-0253aeae.entry.js +0 -1
- package/dist/zonos-elements/p-1264b362.entry.js +0 -1
- package/dist/zonos-elements/p-2244534c.js +0 -2
- package/dist/zonos-elements/p-2825570c.system.js +0 -2
- package/dist/zonos-elements/p-33abdb30.js +0 -1
- package/dist/zonos-elements/p-450942a3.system.js +0 -1
- package/dist/zonos-elements/p-48a2b8b0.entry.js +0 -1
- package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
- package/dist/zonos-elements/p-5ff27485.js +0 -1
- package/dist/zonos-elements/p-6d9dbecb.system.entry.js +0 -1
- package/dist/zonos-elements/p-6e8d43de.entry.js +0 -1
- package/dist/zonos-elements/p-6f5761e8.js +0 -1
- package/dist/zonos-elements/p-78d22069.system.entry.js +0 -1
- package/dist/zonos-elements/p-8b44e558.system.js +0 -1
- package/dist/zonos-elements/p-8bc0e56a.system.entry.js +0 -1
- package/dist/zonos-elements/p-9350d19f.entry.js +0 -1
- package/dist/zonos-elements/p-9e8f1065.system.entry.js +0 -1
- package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
- package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
- package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
- package/dist/zonos-elements/p-c6170bec.system.js +0 -1
- package/dist/zonos-elements/p-e705c44c.entry.js +0 -1
- package/dist/zonos-elements/p-ed2e94d2.js +0 -1
- package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-e063389c.js';
|
|
2
|
+
import { k as stripeStore, d as logError, l as localizationStore, t as translate } from './cart-462e89a6.js';
|
|
3
|
+
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
|
+
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
5
|
+
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-33ff08ff.js';
|
|
6
|
+
import { c as classes } from './classes-0d95c529.js';
|
|
7
|
+
import { R as RemoveIcon$1 } from './RemoveIcon-f6715b36.js';
|
|
8
|
+
import { g as getBorderRadius } from './getBorderRadius-567f1786.js';
|
|
9
|
+
import { i as isDarkColor } from './isDarkColor-7f62035a.js';
|
|
10
|
+
|
|
11
|
+
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
|
|
12
|
+
const ZonosAddressStyle0 = zonosAddressCss;
|
|
13
|
+
|
|
14
|
+
const ZonosAddress = class {
|
|
15
|
+
constructor(hostRef) {
|
|
16
|
+
registerInstance(this, hostRef);
|
|
17
|
+
this.invalidCharacters = createEvent(this, "invalidCharacters", 7);
|
|
18
|
+
this.type = undefined;
|
|
19
|
+
this.titleText = undefined;
|
|
20
|
+
this.defaultAddress = null;
|
|
21
|
+
this.stripe = window.Zonos.stripe;
|
|
22
|
+
this.isDirtyAddress = false;
|
|
23
|
+
}
|
|
24
|
+
getStripeAddressInstance() {
|
|
25
|
+
if (this.type === 'billing') {
|
|
26
|
+
return {
|
|
27
|
+
stripeAddressElement: stripeStore.stripeBillingAddressElement,
|
|
28
|
+
stripeAddressEventData: stripeStore.stripeBillingAddressEventData,
|
|
29
|
+
stripeElements: stripeStore.stripeElementsForBillingAddress,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
stripeAddressElement: stripeStore.stripeAddressElement,
|
|
34
|
+
stripeAddressEventData: stripeStore.stripeAddressEventData,
|
|
35
|
+
stripeElements: stripeStore.stripeElements,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
updateAddressEventData({ event, type, }) {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case 'billing':
|
|
41
|
+
stripeStore.stripeBillingAddressEventData = event;
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
stripeStore.stripeAddressEventData = event;
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
updateAddressElement({ stripeAddressElement, type, }) {
|
|
49
|
+
if (type === 'shipping') {
|
|
50
|
+
stripeStore.stripeAddressElement = stripeAddressElement;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
stripeStore.stripeBillingAddressElement = stripeAddressElement;
|
|
54
|
+
}
|
|
55
|
+
async watchInitStripe() {
|
|
56
|
+
var _a, _b;
|
|
57
|
+
this.stripe = window.Zonos.stripe;
|
|
58
|
+
const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
|
|
59
|
+
if (!this.stripe || !stripeElements) {
|
|
60
|
+
logError("Stripe is not initialized. Couldn't load stripe element.");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
|
|
64
|
+
if (!phone) {
|
|
65
|
+
// remove phone from default address if it's not provided, stripe
|
|
66
|
+
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
67
|
+
(_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
|
|
68
|
+
}
|
|
69
|
+
const shippableCountries = localizationStore.shippingZoneCountries;
|
|
70
|
+
const shippingZone = shippableCountries
|
|
71
|
+
? Object.values(shippableCountries).map(country => country.code)
|
|
72
|
+
: [];
|
|
73
|
+
const addressElement = stripeElements.create('address', {
|
|
74
|
+
allowedCountries: this.type === 'shipping' ? shippingZone : [],
|
|
75
|
+
// only show the default address if stripeAddressEventData is not provided
|
|
76
|
+
contacts: this.defaultAddress && !stripeAddressEventData
|
|
77
|
+
? [this.defaultAddress]
|
|
78
|
+
: [],
|
|
79
|
+
defaultValues: {
|
|
80
|
+
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
81
|
+
localizationStore.selectedCountryCode ||
|
|
82
|
+
'AL' }),
|
|
83
|
+
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
84
|
+
lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
|
|
85
|
+
phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
|
|
86
|
+
},
|
|
87
|
+
display: {
|
|
88
|
+
name: 'split',
|
|
89
|
+
},
|
|
90
|
+
fields: {
|
|
91
|
+
phone: 'always',
|
|
92
|
+
},
|
|
93
|
+
mode: this.type,
|
|
94
|
+
validation: {
|
|
95
|
+
phone: {
|
|
96
|
+
required: 'always',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
addressElement.mount(this.el.querySelector('.zonos--address-component'));
|
|
101
|
+
addressElement.on('change', event => {
|
|
102
|
+
const eventValue = event.value;
|
|
103
|
+
if (!this.isDirtyAddress && eventValue.address.line1.length >= 3) {
|
|
104
|
+
this.isDirtyAddress = true;
|
|
105
|
+
// stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
// scroll directly into view if it's mobile
|
|
108
|
+
if (isCheckoutMobile()) {
|
|
109
|
+
this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
// scroll into the end of the page so the address placeholder won't be hidden
|
|
113
|
+
const yOffset = this.type === 'shipping' ? 100 : 600;
|
|
114
|
+
const parentWrapper = this.el.closest('.zonos--group');
|
|
115
|
+
const y = this.el.getBoundingClientRect().top + yOffset;
|
|
116
|
+
parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
|
|
117
|
+
}
|
|
118
|
+
}, 600);
|
|
119
|
+
}
|
|
120
|
+
this.updateAddressEventData({
|
|
121
|
+
event: Object.assign(Object.assign({}, event), { elementMode: this.type, elementType: 'address', value: Object.assign(Object.assign({}, eventValue), { firstName: eventValue.firstName || eventValue.name.split(' ')[0], lastName: eventValue.lastName || eventValue.name.split(' ')[1] }) }),
|
|
122
|
+
type: this.type,
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
this.updateAddressElement({
|
|
126
|
+
stripeAddressElement: addressElement,
|
|
127
|
+
type: this.type,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
disconnectedCallback() {
|
|
131
|
+
// destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
|
|
132
|
+
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
133
|
+
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
134
|
+
}
|
|
135
|
+
componentDidLoad() {
|
|
136
|
+
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
137
|
+
this.isDirtyAddress =
|
|
138
|
+
!!stripeAddressEventData &&
|
|
139
|
+
stripeAddressEventData.value.address.line1.length > 0;
|
|
140
|
+
// @Watch doesn't get trigger on initial load
|
|
141
|
+
void this.watchInitStripe();
|
|
142
|
+
}
|
|
143
|
+
render() {
|
|
144
|
+
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
145
|
+
return (h(Host, { key: 'f45a7bbe9d6b5ffac15671a862b3ad4f2eb4a87b', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'a9119e6e0c4e5c81a7d17ebe4d6bec925404a3dd', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '7dc12043c6e75ebabd646490c390bafdc2cd4a1d', class: "zonos--address-component" })));
|
|
146
|
+
}
|
|
147
|
+
get el() { return getElement(this); }
|
|
148
|
+
static get watchers() { return {
|
|
149
|
+
"stripe": ["watchInitStripe"]
|
|
150
|
+
}; }
|
|
151
|
+
};
|
|
152
|
+
ZonosAddress.style = ZonosAddressStyle0;
|
|
153
|
+
|
|
154
|
+
const zonosAddressDisplayCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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(--amino-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}";
|
|
155
|
+
const ZonosAddressDisplayStyle0 = zonosAddressDisplayCss;
|
|
156
|
+
|
|
157
|
+
const ZonosAddressDisplay = class {
|
|
158
|
+
constructor(hostRef) {
|
|
159
|
+
registerInstance(this, hostRef);
|
|
160
|
+
this.currentAddress = undefined;
|
|
161
|
+
this.addressType = undefined;
|
|
162
|
+
}
|
|
163
|
+
render() {
|
|
164
|
+
var _a;
|
|
165
|
+
const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
|
|
166
|
+
const shippingZoneCountry = (_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
|
|
167
|
+
const renderEnteredInfoText = ({ bold, content, }) => {
|
|
168
|
+
const textColor = isTextContainsNonLatinChars(content)
|
|
169
|
+
? 'red-600'
|
|
170
|
+
: 'gray-1200';
|
|
171
|
+
return (h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
|
|
172
|
+
};
|
|
173
|
+
return (h(Host, { class: "zonos--address-form zonos--elements" }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
174
|
+
? translate('Shipping')
|
|
175
|
+
: translate('Billing'))), h("div", { class: "zonos--address-group" }, name && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (h("div", { class: "zonos--address-line" }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
|
|
176
|
+
content: shippingZoneCountry.displayName,
|
|
177
|
+
}))))));
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
ZonosAddressDisplay.style = ZonosAddressDisplayStyle0;
|
|
181
|
+
|
|
182
|
+
const zonosAddressFormCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";
|
|
183
|
+
const ZonosAddressFormStyle0 = zonosAddressFormCss;
|
|
184
|
+
|
|
185
|
+
const ZonosAddressForm = class {
|
|
186
|
+
constructor(hostRef) {
|
|
187
|
+
registerInstance(this, hostRef);
|
|
188
|
+
this.addressChange = createEvent(this, "addressChange", 7);
|
|
189
|
+
this.onInputChange = ({ key, value, }) => {
|
|
190
|
+
this.addressChange.emit(Object.assign(Object.assign({}, this.localAddress), { [key]: value }));
|
|
191
|
+
};
|
|
192
|
+
this.currentAddress = undefined;
|
|
193
|
+
this.translatedAddress = undefined;
|
|
194
|
+
this.addressType = undefined;
|
|
195
|
+
this.localAddress = this.currentAddress;
|
|
196
|
+
}
|
|
197
|
+
watchCurrentAddress() {
|
|
198
|
+
var _a, _b, _c, _d, _e, _f;
|
|
199
|
+
const { city, line1, line2, name, postal_code, state } = this.currentAddress;
|
|
200
|
+
// Update the local address when the current address changes
|
|
201
|
+
// If translated address is available, use that instead
|
|
202
|
+
this.localAddress = Object.assign(Object.assign({}, this.currentAddress), { city: ((_a = this.translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city, line1: ((_b = this.translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1, line2: ((_c = this.translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2]) || line2, name: ((_d = this.translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name, postal_code: ((_e = this.translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code, state: ((_f = this.translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state });
|
|
203
|
+
}
|
|
204
|
+
componentWillLoad() {
|
|
205
|
+
this.watchCurrentAddress();
|
|
206
|
+
}
|
|
207
|
+
render() {
|
|
208
|
+
const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
|
|
209
|
+
const firstName = name.split(' ')[0] || '';
|
|
210
|
+
const lastName = name.split(' ')[1] || '';
|
|
211
|
+
return (h(Host, { key: '9c1ee87200d1f90e9dfac58c49aabba1777373a9', class: "zonos--address-form zonos--elements" }, h("div", { key: 'eec3416268ff2324fd751408552705086905423d', class: "zonos--title" }, h("zonos-text", { key: 'a4c254f78420dcfc712e1a83b20dd3ac9e64c460', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
212
|
+
? translate('Shipping')
|
|
213
|
+
: translate('Billing'))), h("div", { key: 'b8109545d282fb8c06a2e791c30088018d6ffec0', class: "zonos--address-group" }, h("div", { key: '833a395984cd75242e5d97697fd6566f11932d1b', class: "zonos--contact" }, h("zonos-text", { key: 'e60f574e95162aabf6465b878fc9b16c708e8029', type: "label" }, translate('Contact')), h("zonos-input", { key: '24cd24a362a1bbc76d0c91718c48ae32baa20ae6', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: '84e64ef44eb3b39ac7ab542e07d7a52a95377cae', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: '26621aca0d57a7fee743874b8d11af5f58c91b69', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
214
|
+
key: 'name',
|
|
215
|
+
value: `${e.detail} ${lastName}`,
|
|
216
|
+
}) }), h("zonos-input", { key: '01e3e5038b4a4311dd5874a1213f936451dc300d', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
217
|
+
key: 'name',
|
|
218
|
+
value: `${firstName} ${e.detail}`,
|
|
219
|
+
}) }))), h("div", { key: 'eb42dece28082ff16a453110b3208de5b44b9fdb', class: "zonos--address" }, h("zonos-text", { key: '3557122c716533be7b36a8bd395ea616a7061665', type: "label" }, translate('Address')), h("zonos-input", { key: 'bcc7d84d530f2f3a10537117eb6ef143df7cc8e2', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: '6ce78e25151a129b69b501cf768604134a395e85', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: '6f7a18010e2d8131327154a31ba58544df56768c', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: '48afbf7a3cbd26fddfea4f2799005a51b1c3d3c6', class: "zonos--address-row" }, h("zonos-input", { key: '6decf8c430d8d25b2c555b110009da74e0ac9e5f', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), h("zonos-input", { key: '065e1be213d3cfec7749ab32890f96b0b484a25a', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), h("zonos-input", { key: 'a69244bf84c9fd007c9ad4aad2b6cc6d44420775', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '0bcc89de1ecc4aae8a69d74eff42dfd117ada40b', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
220
|
+
}
|
|
221
|
+
static get watchers() { return {
|
|
222
|
+
"translatedAddress": ["watchCurrentAddress"]
|
|
223
|
+
}; }
|
|
224
|
+
};
|
|
225
|
+
ZonosAddressForm.style = ZonosAddressFormStyle0;
|
|
226
|
+
|
|
227
|
+
const zonosAddressUpdateDialogCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--amino-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--amino-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--amino-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";
|
|
228
|
+
const ZonosAddressUpdateDialogStyle0 = zonosAddressUpdateDialogCss;
|
|
229
|
+
|
|
230
|
+
const ZonosAddressUpdateDialog = class {
|
|
231
|
+
constructor(hostRef) {
|
|
232
|
+
registerInstance(this, hostRef);
|
|
233
|
+
this.closeDialog = createEvent(this, "closeDialog", 7);
|
|
234
|
+
this.continueClicked = createEvent(this, "continueClicked", 7);
|
|
235
|
+
/**
|
|
236
|
+
* handler for close button click
|
|
237
|
+
*/
|
|
238
|
+
this.closeDialogHandler = () => {
|
|
239
|
+
this.closeDialog.emit();
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* Extract value from translated object
|
|
243
|
+
*/
|
|
244
|
+
this.getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
245
|
+
var _a, _b, _c, _d, _e, _f;
|
|
246
|
+
const { city, line1, line2, name, postal_code, state } = currentAddress;
|
|
247
|
+
return {
|
|
248
|
+
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
249
|
+
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
250
|
+
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2]) || line2,
|
|
251
|
+
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
252
|
+
postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
|
|
253
|
+
state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* handler for continue button click
|
|
258
|
+
*/
|
|
259
|
+
this.continueClickHandler = async () => {
|
|
260
|
+
var _a, _b, _c;
|
|
261
|
+
// set spinner for the continue button
|
|
262
|
+
this.continueLoading = true;
|
|
263
|
+
const translatedBillingAddress = this.billingAddress
|
|
264
|
+
? this.getTranslatedAddress({
|
|
265
|
+
currentAddress: this.billingAddress,
|
|
266
|
+
translatedAddress: this.translatedBillingAddressState,
|
|
267
|
+
})
|
|
268
|
+
: null;
|
|
269
|
+
const translatedShippingAddress = this.getTranslatedAddress({
|
|
270
|
+
currentAddress: this.shippingAddress,
|
|
271
|
+
translatedAddress: this.translatedShippingAddressState,
|
|
272
|
+
});
|
|
273
|
+
// check to see if there are still non-latin characters in the translated address
|
|
274
|
+
const shippingNonlatinChars = containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
|
|
275
|
+
// get list of non-latin characters field in the billing address
|
|
276
|
+
const billingNonLatinChars = translatedBillingAddress &&
|
|
277
|
+
this.billingAddress &&
|
|
278
|
+
containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
|
|
279
|
+
const shippingHasNonLatinChars = !!Object.keys(shippingNonlatinChars)
|
|
280
|
+
.length;
|
|
281
|
+
const billingHasNonLatinChars = !!billingNonLatinChars && !!Object.keys(billingNonLatinChars).length;
|
|
282
|
+
// if there are non-latin characters in the translated address, scroll to the error input so user can see and fix it
|
|
283
|
+
if (shippingHasNonLatinChars || billingHasNonLatinChars) {
|
|
284
|
+
// get scroll top of the first input has "has-error" class
|
|
285
|
+
const addressForms = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('zonos-address-form');
|
|
286
|
+
const shippingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[0];
|
|
287
|
+
const billingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[1];
|
|
288
|
+
const errorInput = ((_b = shippingAddressForm === null || shippingAddressForm === void 0 ? void 0 : shippingAddressForm.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.has-error')) ||
|
|
289
|
+
((_c = billingAddressForm === null || billingAddressForm === void 0 ? void 0 : billingAddressForm.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('.has-error'));
|
|
290
|
+
// scroll to the first error input
|
|
291
|
+
if (errorInput) {
|
|
292
|
+
errorInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
293
|
+
}
|
|
294
|
+
this.continueLoading = false;
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
// Submit the translated address to the parent component
|
|
298
|
+
this.continueClicked.emit({
|
|
299
|
+
billingAddress: translatedBillingAddress,
|
|
300
|
+
shippingAddress: translatedShippingAddress,
|
|
301
|
+
});
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* This function builds a state object for a translated address.
|
|
305
|
+
* It takes the current and translated address as input and returns an object where each field is an object itself.
|
|
306
|
+
* The key of each field's object is the current address's field value and the value is the corresponding translated address's field value.
|
|
307
|
+
*
|
|
308
|
+
* @param {Object} params - The parameters for the function.
|
|
309
|
+
* @param {EnteredInfo} params.currentAddress - The current address information.
|
|
310
|
+
* @param {EnteredInfo} params.translatedAddress - The translated address information.
|
|
311
|
+
*
|
|
312
|
+
*/
|
|
313
|
+
this.buildTranslateAddressState = ({ currentAddress, translatedAddress, }) => {
|
|
314
|
+
const { city, line1, line2, name, postal_code, state } = currentAddress;
|
|
315
|
+
return {
|
|
316
|
+
city: {
|
|
317
|
+
[city]: translatedAddress.city,
|
|
318
|
+
},
|
|
319
|
+
line1: {
|
|
320
|
+
[line1]: translatedAddress.line1,
|
|
321
|
+
},
|
|
322
|
+
line2: {
|
|
323
|
+
[line2]: translatedAddress.line2,
|
|
324
|
+
},
|
|
325
|
+
name: {
|
|
326
|
+
[name]: translatedAddress.name,
|
|
327
|
+
},
|
|
328
|
+
postal_code: {
|
|
329
|
+
[postal_code]: translatedAddress.postal_code,
|
|
330
|
+
},
|
|
331
|
+
state: {
|
|
332
|
+
[state]: translatedAddress.state,
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
this.continueLoading = false;
|
|
337
|
+
this.dialogLoading = undefined;
|
|
338
|
+
this.dialogOpen = false;
|
|
339
|
+
this.submitBtnType = undefined;
|
|
340
|
+
this.submitBtnColor = undefined;
|
|
341
|
+
this.isMobile = false;
|
|
342
|
+
this.shippingAddress = undefined;
|
|
343
|
+
this.billingAddress = undefined;
|
|
344
|
+
this.translatedShippingAddress = undefined;
|
|
345
|
+
this.translatedBillingAddress = undefined;
|
|
346
|
+
this.showErrorBanner = false;
|
|
347
|
+
this.translatedShippingAddressState = {};
|
|
348
|
+
this.translatedBillingAddressState = {};
|
|
349
|
+
}
|
|
350
|
+
watchTranslatedShippingAddress() {
|
|
351
|
+
this.translatedShippingAddressState = this.translatedShippingAddress;
|
|
352
|
+
}
|
|
353
|
+
watchTranslatedBillingAddress() {
|
|
354
|
+
this.translatedBillingAddressState = this.translatedBillingAddress;
|
|
355
|
+
}
|
|
356
|
+
componentWillLoad() {
|
|
357
|
+
// update the state with the initial props
|
|
358
|
+
this.watchTranslatedBillingAddress();
|
|
359
|
+
this.watchTranslatedShippingAddress();
|
|
360
|
+
}
|
|
361
|
+
render() {
|
|
362
|
+
// dialog background white, so when the button background is also white, we need to change the button type to outline so it's visible
|
|
363
|
+
const submitBtnColor = this.submitBtnColor || zonosStore.appearance.colorSecondary;
|
|
364
|
+
const submitBtnType = submitBtnColor === '#ffffff'
|
|
365
|
+
? 'outline'
|
|
366
|
+
: this.submitBtnType || 'standard';
|
|
367
|
+
const billing = this.billingAddress;
|
|
368
|
+
const shipping = this.shippingAddress;
|
|
369
|
+
return (h(Host, { key: '03535edacb348258592641baa349e9dcf14bf78c', class: classes([
|
|
370
|
+
'zonos--address-update-dialog zonos--elements',
|
|
371
|
+
this.isMobile && 'mobile',
|
|
372
|
+
]) }, h("zonos-dialog", { key: 'c16871425dffe955d422ffa5b9aee1ece0da2890', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: 'e4fad501f7cfedc5783774d8b1bf785d6947d3c8', class: "zonos--body" }, h("div", { key: '973e7a8097b8c8f60e47e6ad9d8311a64a5a6ff0', class: "zonos--dialog-header" }, h("div", { key: '89c82b6ff3723056d161560da22bd16a992afee7', class: "zonos--dialog-title" }, h("zonos-text", { key: 'bf92ef0b40ea67a492164fedb95dd68b7d023e85', type: "title" }, translate('Update your address')), h("zonos-button", { key: '4e7a1905c976cec396db5c34f633b383bba0d55a', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1 }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("zonos-text", { key: '47b42d8cc14c4757e3fc9f2f43eafbd8d9e9df38' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '28d9804f0a18f143ce541c2c511cbfa21a2a416f', class: "zonos--group" }, h("zonos-text", { key: '43ec5a9fc8594d065b256952ca8e9392fba03839', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: 'b7eb7781ce6aefe20f89b4d5fba190f0102eb5d1', class: "zonos--address-display-group" }, h("zonos-address-display", { key: '152c53176a46575677723ca47386e484c659927a', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: '6c7ac2b49d121c26ce45f09a1eac9ef456d45910', addressType: "billing", currentAddress: billing }))), h("div", { key: '2bda98bb0ac9bafcb009ff36fb97a9fc62ce7e2d', class: "zonos--address-form-section" }, h("zonos-text", { key: '87d3380072a049ccde71ba1b752aedd36830348b', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: '2cb36251c6549da05e272183b2c37478b4166fea', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
373
|
+
const address = e.detail;
|
|
374
|
+
this.translatedShippingAddressState =
|
|
375
|
+
this.buildTranslateAddressState({
|
|
376
|
+
currentAddress: shipping,
|
|
377
|
+
translatedAddress: address,
|
|
378
|
+
});
|
|
379
|
+
}, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: '9bf5ebd6fb08851716a72c855451bfeb3ee0ed68', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
|
|
380
|
+
const address = e.detail;
|
|
381
|
+
this.translatedBillingAddressState =
|
|
382
|
+
this.buildTranslateAddressState({
|
|
383
|
+
currentAddress: billing,
|
|
384
|
+
translatedAddress: address,
|
|
385
|
+
});
|
|
386
|
+
}, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '621df9c8919973b37c62aca5727bde3635086a6b', class: "zonos--group-btn" }, h("div", { key: '95e9fd31418abc8e89ceef24af7cc251ee45ac93', class: "zonos--button-wrapper" }, h("zonos-button", { key: 'bef31fc81e7cc0f2b3f7ab875a29978b07865b6a', class: "zonos--cancel-btn", onClick: () => this.closeDialogHandler(), variant: "subtle" }, translate('Cancel')), h("zonos-button", { key: '9d183153541766b421c3420681c1159ffa599682', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, translate('Update address'))))))));
|
|
387
|
+
}
|
|
388
|
+
get el() { return getElement(this); }
|
|
389
|
+
static get watchers() { return {
|
|
390
|
+
"translatedShippingAddress": ["watchTranslatedShippingAddress"],
|
|
391
|
+
"translatedBillingAddress": ["watchTranslatedBillingAddress"]
|
|
392
|
+
}; }
|
|
393
|
+
};
|
|
394
|
+
ZonosAddressUpdateDialog.style = ZonosAddressUpdateDialogStyle0;
|
|
395
|
+
|
|
396
|
+
const colorPrefixes = [
|
|
397
|
+
'blue',
|
|
398
|
+
'cyan',
|
|
399
|
+
'green',
|
|
400
|
+
'orange',
|
|
401
|
+
'purple',
|
|
402
|
+
'red',
|
|
403
|
+
'gray',
|
|
404
|
+
'glass',
|
|
405
|
+
];
|
|
406
|
+
|
|
407
|
+
const zonosCheckboxCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--amino-gray-400);position:relative;border-radius:var(--border-radius, var(--amino-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--amino-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
|
|
408
|
+
const ZonosCheckboxStyle0 = zonosCheckboxCss;
|
|
409
|
+
|
|
410
|
+
const ZonosCheckbox = class {
|
|
411
|
+
constructor(hostRef) {
|
|
412
|
+
registerInstance(this, hostRef);
|
|
413
|
+
this.checkboxSelected = createEvent(this, "checkboxSelected", 7);
|
|
414
|
+
this.backgroundColor = 'blue';
|
|
415
|
+
this.label = undefined;
|
|
416
|
+
this.isChecked = false;
|
|
417
|
+
this.isDisabled = false;
|
|
418
|
+
this.size = 12;
|
|
419
|
+
this.fontSize = 'base';
|
|
420
|
+
this.borderStyle = undefined;
|
|
421
|
+
}
|
|
422
|
+
onClick() {
|
|
423
|
+
if (this.isDisabled) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
this.checkboxSelected.emit(!this.isChecked);
|
|
427
|
+
}
|
|
428
|
+
render() {
|
|
429
|
+
const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
|
|
430
|
+
const backgroundColor = isBackgroundVariable
|
|
431
|
+
? `var(--amino-${this.backgroundColor}-600)`
|
|
432
|
+
: this.backgroundColor;
|
|
433
|
+
const checkmarkColor = isBackgroundVariable
|
|
434
|
+
? // use lighter color if the color is amino variable
|
|
435
|
+
`var(--amino-${this.backgroundColor}-200)`
|
|
436
|
+
: // if it's not an amino variable, use white if the background is dark, and dark if the background is light
|
|
437
|
+
!isDarkColor(backgroundColor)
|
|
438
|
+
? 'var(--amino-gray-800)'
|
|
439
|
+
: 'var(--amino-gray-0)';
|
|
440
|
+
const borderStyle = getBorderRadius({
|
|
441
|
+
customRoundRadius: '4px',
|
|
442
|
+
overrideBorderStyle: this.borderStyle,
|
|
443
|
+
});
|
|
444
|
+
return (h(Host, { key: '8a3d5f66a7fb956dcb063f1b375bfb80856a80c4', class: classes(['zonos--elements zonos--checkbox']), style: {
|
|
445
|
+
'--background-color': backgroundColor,
|
|
446
|
+
'--border-radius': borderStyle,
|
|
447
|
+
'--font-family': zonosStoreFontFamily(),
|
|
448
|
+
'--size': `${this.size}px`,
|
|
449
|
+
} }, h("label", { key: '95dc70a3821652e588706b570b40272a5f124b7f', class: classes([this.isDisabled && 'disabled']) }, h("input", { key: 'ef61adbd2246fbb934a17b31ea62cd5ce4ff88f7', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
|
|
450
|
+
this.checkboxSelected.emit(e.target.checked);
|
|
451
|
+
}, type: "checkbox" }), h("span", { key: '0587bf8dc5ee1477d91360e20d521efd9853c554', class: "checkmark-container" }, h("svg", { key: '3b7abf05f170aa2c4a31f76763c79ce975a543bc', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '7d16a3850fbdca9fd3af7fa1f64a1715497b9c7b', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: '305600e6860aeba8dfa0f3019d51d1bf91498310', size: this.fontSize }, this.label)))));
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
ZonosCheckbox.style = ZonosCheckboxStyle0;
|
|
455
|
+
|
|
456
|
+
const zonosCollapseCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
|
|
457
|
+
const ZonosCollapseStyle0 = zonosCollapseCss;
|
|
458
|
+
|
|
459
|
+
const ZonosCollapse = class {
|
|
460
|
+
constructor(hostRef) {
|
|
461
|
+
registerInstance(this, hostRef);
|
|
462
|
+
this.collapsed = false;
|
|
463
|
+
this.collapseSize = 0;
|
|
464
|
+
this.height = this.el.scrollHeight;
|
|
465
|
+
this.iframe = null;
|
|
466
|
+
}
|
|
467
|
+
getElementHeight() {
|
|
468
|
+
const fullHeight = `${this.height}px`;
|
|
469
|
+
const collapsedHeight = `${this.collapseSize}px`;
|
|
470
|
+
return this.collapsed ? collapsedHeight : fullHeight;
|
|
471
|
+
}
|
|
472
|
+
componentDidLoad() {
|
|
473
|
+
this.height = this.el.scrollHeight;
|
|
474
|
+
}
|
|
475
|
+
componentDidRender() {
|
|
476
|
+
var _a, _b, _c;
|
|
477
|
+
this.iframe =
|
|
478
|
+
((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
|
|
479
|
+
(_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
|
|
480
|
+
if (!this.iframe) {
|
|
481
|
+
// this should never happen since it's inside of resize callback
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
this.height = parseFloat(getComputedStyle(this.iframe).height);
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
render() {
|
|
488
|
+
if (!this.collapsed) {
|
|
489
|
+
// wait for the collapse animation to finish, then set overflow to visible
|
|
490
|
+
setTimeout(() => {
|
|
491
|
+
// if the element collapsed state is still not changed, set overflow to visible
|
|
492
|
+
if (!this.collapsed) {
|
|
493
|
+
this.el.style.overflow = 'visible';
|
|
494
|
+
}
|
|
495
|
+
}, 300);
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
// set overflow to hidden to prevent content from showing when collapsed
|
|
499
|
+
this.el.style.overflow = 'hidden';
|
|
500
|
+
}
|
|
501
|
+
return (h(Host, { key: '514e75d41d29d70b4ca60230288ae183200b1e12', class: 'zonos--elements zonos--collapse', style: {
|
|
502
|
+
'--font-family': zonosStoreFontFamily(),
|
|
503
|
+
height: this.getElementHeight(),
|
|
504
|
+
} }, h("div", { key: '068aee1d13bde4c83ea8582b34844da7452c907c' }, h("iframe", { key: 'b22fd8ad898a098c244cb817dc6951854505efca', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), h("slot", { key: 'b54783376005085e379c7b8d43218ead1bf8e8ac' }))));
|
|
505
|
+
}
|
|
506
|
+
get el() { return getElement(this); }
|
|
507
|
+
};
|
|
508
|
+
ZonosCollapse.style = ZonosCollapseStyle0;
|
|
509
|
+
|
|
510
|
+
const RemoveIcon = `<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>`;
|
|
511
|
+
|
|
512
|
+
const zonosDialogCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;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;z-index:10002;background:var(--amino-gray-0);border-radius:var(--border-radius, var(--amino-radius-10))}: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(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:10001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-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(--amino-size-md);height:var(--amino-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(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-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:10001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:10002;-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}";
|
|
513
|
+
const ZonosDialogStyle0 = zonosDialogCss;
|
|
514
|
+
|
|
515
|
+
const ZonosDialog = class {
|
|
516
|
+
constructor(hostRef) {
|
|
517
|
+
registerInstance(this, hostRef);
|
|
518
|
+
this.closeDialog = createEvent(this, "closeDialog", 7);
|
|
519
|
+
this.isMobileMode = () => {
|
|
520
|
+
return this.mobile || window.innerWidth <= 768;
|
|
521
|
+
};
|
|
522
|
+
this.closeButtonHandler = () => {
|
|
523
|
+
this.closeDialog.emit();
|
|
524
|
+
};
|
|
525
|
+
this.clickOutsideDialogHandler = (event) => {
|
|
526
|
+
if (event.target === event.currentTarget && !this.noClickOutside) {
|
|
527
|
+
this.closeDialog.emit();
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
this.open = false;
|
|
531
|
+
this.headerText = '';
|
|
532
|
+
this.width = '460px';
|
|
533
|
+
this.height = undefined;
|
|
534
|
+
this.noHeader = false;
|
|
535
|
+
this.noBodyPadding = false;
|
|
536
|
+
this.noBorder = false;
|
|
537
|
+
this.borderStyle = undefined;
|
|
538
|
+
this.noCloseButton = false;
|
|
539
|
+
this.noClickOutside = false;
|
|
540
|
+
this.mobile = false;
|
|
541
|
+
this.isLoading = true;
|
|
542
|
+
this.isMobile = false;
|
|
543
|
+
}
|
|
544
|
+
handleWindowResize() {
|
|
545
|
+
this.isMobile = this.isMobileMode();
|
|
546
|
+
}
|
|
547
|
+
componentDidLoad() {
|
|
548
|
+
this.isMobile = this.isMobileMode();
|
|
549
|
+
}
|
|
550
|
+
render() {
|
|
551
|
+
// disable scroll on the body when dialog is open
|
|
552
|
+
if (this.open) {
|
|
553
|
+
document.body.style.overflow = 'hidden';
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
document.body.style.overflow = 'auto';
|
|
557
|
+
}
|
|
558
|
+
const borderStyle = getBorderRadius({
|
|
559
|
+
overrideBorderStyle: this.borderStyle,
|
|
560
|
+
});
|
|
561
|
+
return (h(Host, { key: '48eb2701a74a7973d3502fd1fdc65ce85a6d71ed', class: classes([
|
|
562
|
+
'zonos--elements',
|
|
563
|
+
this.open && 'open',
|
|
564
|
+
this.isLoading && 'is-loading',
|
|
565
|
+
this.noBorder && 'no-border',
|
|
566
|
+
this.isMobile && 'mobile',
|
|
567
|
+
]), style: {
|
|
568
|
+
'--border-radius': borderStyle,
|
|
569
|
+
'--font-family': zonosStoreFontFamily(),
|
|
570
|
+
'--height': this.height || 'initial',
|
|
571
|
+
'--width': this.width,
|
|
572
|
+
} }, h("div", { key: 'b408d792740d8854bab8ea60bd50ce894a75a836', class: "zonos--backdrop" }), h("div", { key: '04affcf48e0b209fa8dacc74039dad536ed9cd9b', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'c615792a60b2fa51a74af265b7c944a64e9ff18d', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '78d3b571f75c6037fdd694b4621fb9eae48d8ce0', class: "zonos--loading" }, h("zonos-spinner", { key: 'bd96037d5fe1717ebeae5b1ba27b96aa9ec9253d', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: 'cc057cbed99107d7d234d08d38e67cbf0140dc66', class: "zonos--header" }, this.headerText && (h("h3", { key: '587fff6b04981f1c24b44736b3b40044480f68ba', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: '9a1944508996cd8ccb87f68ae175564528af3c4c', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: 'b563c1939c32489b63516cd4dd14df58a32a08cf', class: classes([
|
|
573
|
+
'zonos--body',
|
|
574
|
+
this.noBodyPadding && 'zonos--no-body-padding',
|
|
575
|
+
]) }, h("slot", { key: '39d66d136f630afbac7ced146d3a8ac60d3c9672' })), h("slot", { key: '5bace66c84150024d0203f89fbf8f5c263cb7472', name: "dialog-footer" })))));
|
|
576
|
+
}
|
|
577
|
+
static get assetsDirs() { return ["assets"]; }
|
|
578
|
+
};
|
|
579
|
+
ZonosDialog.style = ZonosDialogStyle0;
|
|
580
|
+
|
|
581
|
+
const zonosLinkAuthenticationCss = ".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";
|
|
582
|
+
const ZonosLinkAuthenticationStyle0 = zonosLinkAuthenticationCss;
|
|
583
|
+
|
|
584
|
+
const ZonosLinkAuthentication = class {
|
|
585
|
+
constructor(hostRef) {
|
|
586
|
+
registerInstance(this, hostRef);
|
|
587
|
+
this.titleText = undefined;
|
|
588
|
+
this.defaultEmail = null;
|
|
589
|
+
this.stripe = stripeStore.stripe;
|
|
590
|
+
}
|
|
591
|
+
watchInitStripe() {
|
|
592
|
+
if (!this.stripe || !stripeStore.stripeElements) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const defaultValues = this.defaultEmail
|
|
596
|
+
? {
|
|
597
|
+
email: this.defaultEmail,
|
|
598
|
+
}
|
|
599
|
+
: undefined;
|
|
600
|
+
// Create and mount the Authentication Element in ${type} mode
|
|
601
|
+
const linkAuthenticationElement = stripeStore.stripeLinkElement ||
|
|
602
|
+
stripeStore.stripeElements.create('linkAuthentication', {
|
|
603
|
+
defaultValues: defaultValues || undefined,
|
|
604
|
+
});
|
|
605
|
+
const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
|
|
606
|
+
if (!linkAuthenticationElementContainer) {
|
|
607
|
+
logError('Cannot find container element for linkAuthenticationElement');
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
linkAuthenticationElement.mount(linkAuthenticationElementContainer);
|
|
611
|
+
linkAuthenticationElement.on('change', event => {
|
|
612
|
+
stripeStore.stripeLinkEventData = event;
|
|
613
|
+
});
|
|
614
|
+
stripeStore.stripeLinkElement = linkAuthenticationElement;
|
|
615
|
+
}
|
|
616
|
+
componentDidLoad() {
|
|
617
|
+
// @Watch doesn't get trigger on initial load
|
|
618
|
+
this.watchInitStripe();
|
|
619
|
+
}
|
|
620
|
+
render() {
|
|
621
|
+
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
622
|
+
return (h(Host, { key: '4a7b9eb534e938f791f70e04756aa9fb1c39f2c7', class: "zonos--link-authentication zonos--elements" }, h("zonos-text", { key: 'cc4fe49ed6d4bd7cec502ef739b9e835e9e26584', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'f04a438d04e6ccd608d7ff61ac300fb09da4f0ce', class: "zonos--link-authentication-component" })));
|
|
623
|
+
}
|
|
624
|
+
get el() { return getElement(this); }
|
|
625
|
+
static get watchers() { return {
|
|
626
|
+
"stripe": ["watchInitStripe"]
|
|
627
|
+
}; }
|
|
628
|
+
};
|
|
629
|
+
ZonosLinkAuthentication.style = ZonosLinkAuthenticationStyle0;
|
|
630
|
+
|
|
631
|
+
export { ZonosAddress as zonos_address, ZonosAddressDisplay as zonos_address_display, ZonosAddressForm as zonos_address_form, ZonosAddressUpdateDialog as zonos_address_update_dialog, ZonosCheckbox as zonos_checkbox, ZonosCollapse as zonos_collapse, ZonosDialog as zonos_dialog, ZonosLinkAuthentication as zonos_link_authentication };
|