@zonos/elements 1.3.267 → 1.3.269
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-ed2de167.js → cart-87fbbb5a.js} +129 -4
- package/dist/cjs/{debounce-606d1801.js → debounce-7990f5ea.js} +1 -1
- package/dist/cjs/{getBorderRadius-a91911e7.js → getBorderRadius-fc683d94.js} +1 -1
- package/dist/cjs/{getContrastColor-ce80dbe7.js → getContrastColor-d5134ef3.js} +2 -2
- package/dist/cjs/{hasInclusivePrice-bf31fbdb.js → hasInclusivePrice-c86ed1f5.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-542c23e7.js → invoice-952f32c4.js} +3 -3
- package/dist/cjs/{isCollectMobileTablet-fe8149a5.js → isCollectMobileTablet-1cb21c59.js} +3 -3
- package/dist/cjs/{isContrastColor-a02c4889.js → isContrastColor-76592c92.js} +1 -1
- package/dist/cjs/{isDarkColor-e317bb06.js → isDarkColor-5d6ca405.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-66d378ab.js → localization-a969f224.js} +660 -3
- package/dist/cjs/{paypal-d8282578.js → paypal-cfe1e8e9.js} +60 -18
- package/dist/cjs/{placeTestOrder-0a4b9dd7.js → placeTestOrder-613878fb.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-ac9083d9.js → renderCheckoutCurrency-5a333d29.js} +2 -2
- package/dist/cjs/{submitGtag-07a3b09e.js → submitGtag-4906b161.js} +1 -1
- package/dist/cjs/{throttle-8aebac7d.js → throttle-02c2e917.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-a9a97194.js → updateCheckoutSessionAttributes-47d73942.js} +1 -1
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +7 -7
- package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +94 -27
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +124 -154
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -5
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
- package/dist/cjs/zonos-collect.cjs.entry.js +9 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -47
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +7 -7
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
- package/dist/cjs/zonos-invoice.cjs.entry.js +9 -9
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/{zonos-store-credit.cjs.entry.js → zonos-policy-consent_2.cjs.entry.js} +91 -6
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +5 -5
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-0662b95f.js → zonosStore-45a87908.js} +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +7 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +66 -12
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +103 -75
- package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.css +93 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.js +93 -0
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -44
- package/dist/collection/components/store/checkout/paypal.js +57 -14
- package/dist/collection/components/store/checkout/policyConsent.js +58 -0
- package/dist/collection/components/store/checkout/stripe.js +66 -0
- package/dist/collection/components/store/hello/localization.js +12 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +21 -0
- package/dist/collection/components/store/translationStore/strings.base.js +21 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +21 -0
- package/dist/collection/components/store/translationStore/strings.french.js +21 -0
- package/dist/collection/components/store/translationStore/strings.german.js +21 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +21 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +21 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +21 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -0
- package/dist/collection/components/store/zonosStore.js +1 -0
- package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +28 -0
- package/dist/collection/components/utils/checkout/removeBigcommerceCartShipping.js +83 -0
- package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +61 -0
- package/dist/collection/types/generated/graphql.internal.types.js +64 -0
- package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +2 -1
- package/dist/esm/{cart-49082718.js → cart-663ef7d5.js} +125 -5
- package/dist/esm/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
- package/dist/esm/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
- package/dist/esm/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +2 -2
- package/dist/esm/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-16c688e7.js → invoice-db7211a6.js} +3 -3
- package/dist/esm/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +3 -3
- package/dist/esm/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
- package/dist/esm/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-33a9f7ff.js → localization-dc19e8bb.js} +657 -4
- package/dist/esm/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +60 -18
- package/dist/esm/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +2 -2
- package/dist/esm/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
- package/dist/esm/{throttle-882b1f47.js → throttle-f09d0659.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
- package/dist/esm/zonos-address-display_8.entry.js +7 -7
- package/dist/esm/zonos-address_4.entry.js +7 -7
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +8 -8
- package/dist/esm/zonos-cart-items_12.entry.js +94 -27
- package/dist/esm/zonos-checkbox_2.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +113 -143
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -5
- package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
- package/dist/esm/zonos-collect.entry.js +9 -9
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +4 -47
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
- package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
- package/dist/esm/zonos-invoice.entry.js +9 -9
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/{zonos-store-credit.entry.js → zonos-policy-consent_2.entry.js} +91 -7
- package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
- package/dist/esm/zonos-stripe-input.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-9662b071.js → zonosStore-8e19daff.js} +1 -0
- package/dist/esm-es5/cart-663ef7d5.js +1 -0
- package/dist/esm-es5/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
- package/dist/esm-es5/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +1 -1
- package/dist/esm-es5/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-16c688e7.js → invoice-db7211a6.js} +1 -1
- package/dist/esm-es5/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +1 -1
- package/dist/esm-es5/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
- package/dist/esm-es5/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-dc19e8bb.js +1 -0
- package/dist/esm-es5/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +2 -2
- package/dist/esm-es5/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +1 -1
- package/dist/esm-es5/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
- package/dist/esm-es5/throttle-f09d0659.js +1 -0
- package/dist/esm-es5/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-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-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-9662b071.js → zonosStore-8e19daff.js} +1 -1
- package/dist/scripts/index.d.ts +80 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.d.ts +3 -0
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +0 -1
- package/dist/types/components/store/checkout/policyConsent.d.ts +41 -0
- package/dist/types/components/store/checkout/stripe.d.ts +13 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +21 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +21 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +9 -0
- package/dist/types/components/utils/checkout/removeBigcommerceCartShipping.d.ts +18 -0
- package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +16 -0
- package/dist/types/components.d.ts +13 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +23 -6
- package/dist/types/types/checkout/CheckoutConfig.d.ts +23 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +170 -23
- package/dist/types/types/generated/graphql.internal.types.ts +152 -23
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-90c932fd.entry.js → p-049fc407.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a8fcb71.system.entry.js → p-0581cfc9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-097d7819.js +1 -0
- package/dist/zonos-elements/{p-e850e6e7.system.entry.js → p-09d32e53.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1325bbd6.system.entry.js → p-0daed059.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-79e5a629.system.entry.js → p-0e36a7cf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6df4cc2.system.entry.js → p-134c5010.system.entry.js} +1 -1
- package/dist/zonos-elements/p-14d6542f.system.js +1 -0
- package/dist/zonos-elements/{p-0207c91e.system.js → p-18af6aaa.system.js} +1 -1
- package/dist/zonos-elements/p-1bde60d5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9a5a2043.js → p-243dda5f.js} +1 -1
- package/dist/zonos-elements/p-263d14da.system.entry.js +1 -0
- package/dist/zonos-elements/{p-6b6cfc59.system.entry.js → p-26ae4ee7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-71fb6126.entry.js → p-2afecda7.entry.js} +1 -1
- package/dist/zonos-elements/{p-458df669.js → p-2be4335f.js} +1 -1
- package/dist/zonos-elements/p-33a37c42.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d28be518.js → p-33d4be28.js} +1 -1
- package/dist/zonos-elements/{p-26c85188.entry.js → p-344a1fee.entry.js} +1 -1
- package/dist/zonos-elements/p-3b28fc76.js +1 -0
- package/dist/zonos-elements/{p-db3b101a.js → p-3dc3596b.js} +1 -1
- package/dist/zonos-elements/{p-3689821f.system.js → p-3e7ee89d.system.js} +1 -1
- package/dist/zonos-elements/{p-843ced6c.js → p-44147850.js} +1 -1
- package/dist/zonos-elements/{p-71c7a1ff.entry.js → p-488c1af1.entry.js} +1 -1
- package/dist/zonos-elements/{p-3516340a.system.entry.js → p-48ec0b61.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4af88255.entry.js +1 -0
- package/dist/zonos-elements/p-4b6e367d.system.js +1 -0
- package/dist/zonos-elements/{p-ab0b23f2.js → p-4df08fc4.js} +1 -1
- package/dist/zonos-elements/{p-0ed70279.entry.js → p-513e8278.entry.js} +1 -1
- package/dist/zonos-elements/p-52bd7be3.system.js +1 -0
- package/dist/zonos-elements/{p-deaf0e38.system.entry.js → p-536cbab5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-56711a61.js +1 -0
- package/dist/zonos-elements/{p-01497a20.entry.js → p-57b55808.entry.js} +1 -1
- package/dist/zonos-elements/p-57c3c68f.entry.js +1 -0
- package/dist/zonos-elements/{p-a49ba3ae.system.entry.js → p-5b4e5608.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1bf9a1b9.system.js → p-5d65be06.system.js} +1 -1
- package/dist/zonos-elements/{p-1957af5a.system.entry.js → p-5f92db80.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2a6be4a5.entry.js → p-658ab5e2.entry.js} +1 -1
- package/dist/zonos-elements/{p-8f9e95c2.entry.js → p-680da401.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f718ef9.system.js → p-699276f2.system.js} +1 -1
- package/dist/zonos-elements/{p-f3cfd8fa.js → p-701d9a7c.js} +1 -1
- package/dist/zonos-elements/{p-ce103c66.system.entry.js → p-71528303.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8570e88a.system.js → p-7662d32a.system.js} +1 -1
- package/dist/zonos-elements/{p-27061873.entry.js → p-777d396e.entry.js} +1 -1
- package/dist/zonos-elements/{p-46071125.entry.js → p-7aca66cd.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb99a625.system.js → p-7d9d2407.system.js} +1 -1
- package/dist/zonos-elements/{p-7003d093.system.entry.js → p-80df7e0b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b7e4a020.system.entry.js → p-82ce355d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e1799bc.entry.js → p-84d4f04d.entry.js} +1 -1
- package/dist/zonos-elements/{p-180d3e3d.entry.js → p-858103a0.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e0cb5b3.system.entry.js → p-882fb843.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-648f3ada.entry.js → p-889a44fc.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c89d04a.js → p-896fb969.js} +1 -1
- package/dist/zonos-elements/{p-2c854197.system.entry.js → p-8a24701c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cb966d16.system.entry.js → p-8f0bdb87.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8f817a47.system.js +18 -0
- package/dist/zonos-elements/{p-a78bc004.entry.js → p-9092f655.entry.js} +1 -1
- package/dist/zonos-elements/p-90d22087.system.js +1 -0
- package/dist/zonos-elements/{p-1ec9b3b0.entry.js → p-9377b5c2.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6db8883.entry.js → p-9799193c.entry.js} +1 -1
- package/dist/zonos-elements/{p-55fb4ea3.system.entry.js → p-98bea13e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ba9e2612.system.entry.js → p-990d1495.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-601bb27e.entry.js → p-9a509268.entry.js} +1 -1
- package/dist/zonos-elements/{p-a1bad0c3.system.entry.js → p-9ea67d63.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9f5fb332.js +1 -0
- package/dist/zonos-elements/{p-d950b0b4.entry.js → p-a237429e.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d823ea7.system.js → p-a3a79b2f.system.js} +1 -1
- package/dist/zonos-elements/p-ac8cfdc0.js +1 -0
- package/dist/zonos-elements/p-accccb9c.entry.js +1 -0
- package/dist/zonos-elements/p-b0ed0fe7.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b4b23475.entry.js → p-b35a0b1e.entry.js} +1 -1
- package/dist/zonos-elements/{p-bf5c3dd7.system.entry.js → p-b59fc3fa.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-db5f6b8c.entry.js → p-ba127f51.entry.js} +1 -1
- package/dist/zonos-elements/p-bbef037c.js +1 -0
- package/dist/zonos-elements/{p-6a195559.system.js → p-bc919de1.system.js} +1 -1
- package/dist/zonos-elements/p-be64a52e.entry.js +1 -0
- package/dist/zonos-elements/{p-665bfd4f.entry.js → p-c1463da7.entry.js} +1 -1
- package/dist/zonos-elements/{p-311ba000.system.js → p-c2023a08.system.js} +1 -1
- package/dist/zonos-elements/{p-8d5f413c.system.entry.js → p-c4ef873a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c5caf47b.system.js +1 -0
- package/dist/zonos-elements/{p-baf0b24c.system.entry.js → p-c62293d5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-79f3c227.system.entry.js → p-c92a5ae5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cd34ecf2.js +1 -0
- package/dist/zonos-elements/p-cd5444b0.js +17 -0
- package/dist/zonos-elements/{p-cfb0059f.js → p-d437bc28.js} +1 -1
- package/dist/zonos-elements/p-d932973f.system.js +1 -0
- package/dist/zonos-elements/{p-28e2ac3b.entry.js → p-dae881f2.entry.js} +1 -1
- package/dist/zonos-elements/{p-087520f2.system.entry.js → p-df0c8fb6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8571f3ce.entry.js → p-df55536b.entry.js} +1 -1
- package/dist/zonos-elements/p-e05e5825.entry.js +1 -0
- package/dist/zonos-elements/{p-928291e5.entry.js → p-e548b8ec.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e6f85f0.system.js → p-f053975e.system.js} +1 -1
- package/dist/zonos-elements/{p-175c04a4.system.js → p-f5684fc2.system.js} +1 -1
- package/dist/zonos-elements/{p-22ba60f6.system.entry.js → p-fc270539.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-49082718.js +0 -1
- package/dist/esm-es5/localization-33a9f7ff.js +0 -1
- package/dist/esm-es5/throttle-882b1f47.js +0 -1
- package/dist/esm-es5/zonos-store-credit.entry.js +0 -1
- package/dist/zonos-elements/p-029be4a8.entry.js +0 -1
- package/dist/zonos-elements/p-034ab928.system.entry.js +0 -1
- package/dist/zonos-elements/p-07a76716.system.js +0 -1
- package/dist/zonos-elements/p-1f256673.entry.js +0 -1
- package/dist/zonos-elements/p-367a72bc.js +0 -1
- package/dist/zonos-elements/p-3b1b3598.system.js +0 -18
- package/dist/zonos-elements/p-40284821.system.js +0 -1
- package/dist/zonos-elements/p-4980facb.js +0 -1
- package/dist/zonos-elements/p-6987f9c9.js +0 -1
- package/dist/zonos-elements/p-6d81901a.js +0 -1
- package/dist/zonos-elements/p-703fc360.entry.js +0 -1
- package/dist/zonos-elements/p-77c2e465.system.js +0 -1
- package/dist/zonos-elements/p-84dbf474.js +0 -17
- package/dist/zonos-elements/p-9b0a6fe5.system.entry.js +0 -1
- package/dist/zonos-elements/p-adb9827c.js +0 -1
- package/dist/zonos-elements/p-b2d276e1.js +0 -1
- package/dist/zonos-elements/p-b5a26334.system.entry.js +0 -1
- package/dist/zonos-elements/p-b6a36c25.system.js +0 -1
- package/dist/zonos-elements/p-becac995.js +0 -1
- package/dist/zonos-elements/p-c9c17d08.system.entry.js +0 -1
- package/dist/zonos-elements/p-e056ae6b.entry.js +0 -1
- package/dist/zonos-elements/p-e3292be8.system.js +0 -1
- package/dist/zonos-elements/p-e5dfccd8.system.js +0 -1
- package/dist/zonos-elements/p-fb712719.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"./p-
|
|
1
|
+
import{z as o}from"./p-701d9a7c.js";import{g as t}from"./p-41dd1cb8.js";import{l as e}from"./p-0a377722.js";const n="zonos-analytic",i={fbq:!1,gtag:!1},a=[];let d=!1;const s=()=>"undefined"!=typeof window&&window.parent!==window,w=()=>{d||(d=!0,window.addEventListener("message",(o=>{var t;if("zonos-analytics-relay-ready"!==(null===(t=o.data)||void 0===t?void 0:t.type))return;const e=o.data.provider||"gtag";i[e]=!0,void 0!==window.Zonos&&("gtag"===e?window.Zonos.googleAnalyticReady=!0:window.Zonos.facebookPixelReady=!0),(()=>{const o=[];for(;a.length>0;){const t=a.shift();if(i[t.provider])try{window.parent.postMessage({event:t.event,fbqMode:t.fbqMode,metadata:t.payload,provider:t.provider,type:n},"*")}catch(o){}else o.push(t)}a.push(...o)})()})))},r=()=>{if(s()){w();try{const o=void 0!==window.Zonos?window.Zonos:void 0;window.parent.postMessage({facebookPixelId:null==o?void 0:o.facebookPixelId,googleAnalyticId:null==o?void 0:o.googleAnalyticId,type:"zonos-analytics-relay-ping"},"*")}catch(o){}}},c=o=>{if(w(),i[o.provider])try{window.parent.postMessage({event:o.event,fbqMode:o.fbqMode,metadata:o.payload,provider:o.provider,type:n},"*")}catch(o){}else a.push(o),r()},l=s,f=()=>{s()&&(i.gtag&&i.fbq||r())},p=({event:n,metadata:i})=>{if(!(()=>{const t=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));return!!t&&"ENABLED"===t.status})())return;const a=t(),d=Object.assign(Object.assign({},i),a&&{isTestMode:!0}),s=Object.fromEntries(Object.entries(d).filter((([o,t])=>null!==t)));l()?c({event:n,payload:s,provider:"gtag"}):"function"==typeof window.gtag&&(e("Zonos submits gtag event","log",n),window.gtag("event",n,s))};export{f as a,c as e,l as i,p as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-7261e245.system.js","./p-b6a36c25.system.js","./p-77c2e465.system.js","./p-3689821f.system.js","./p-4160bbc2.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-6a195559.system.js","./p-eb99a625.system.js","./p-e5dfccd8.system.js"],(function(t){"use strict";var n,e,i,o,r,u,s,c,a,f,d,l,h,v,w,m,p,g,_,y;return{setters:[function(t){n=t.r;e=t.d;i=t.h;o=t.a},function(t){r=t.b},function(t){u=t.e;s=t.i;c=t.h;a=t.s;f=t.a},function(t){d=t.z;l=t.e;h=t.f},function(t){v=t.g;w=t.i;m=t.a},function(t){p=t.h;g=t.l},function(t){_=t.l},function(t){y=t.a},function(){},function(){}],execute:function(){var b=this;var S=function(){return __awaiter(b,void 0,void 0,(function(){var t,n,e,i,o,r,s;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){_("Reusing cached zonos settings");return[2,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=v();n=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){n.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}e=u();if(e){n.set("zCountry",e)}return[4,p("/api/zonos-elements/zonos-settings?".concat(n.toString()))];case 1:i=c.sent(),o=i.errors,r=i.json,s=i.zonosMode;if(o.length){g("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:o,json:null,zonosMode:s}]}return[2,{errors:[],json:r,zonosMode:s}]}}))}))};var z=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var j=function(t){if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!s(t.placeOrderButtonSelector)){g('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!s(t.alwaysTriggerInternationalCheckoutSelector)){g('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}z()};var O=function(){var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var I=function(){if(!window.Zonos.cartData){return}O()};var k=function(){var t=document.querySelector("zonos-invoice");if(!t){var n=document.createElement("zonos-invoice");document.body.appendChild(n)}};var A=function(){if(!window.Zonos.cartData){return}k()};var C="zonos-domestic-element-hide-style";var T=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();var E=function(t){var n=[];var e=0;var i=0;var o="";for(var r=0;r<t.length;r++){var u=t[r];if(u==="("){e++}else if(u===")"){e--}else if(u==="["){i++}else if(u==="]"){i--}if(u===","&&e===0&&i===0){var s=o.trim();if(s){n.push(s)}o=""}else{o+=u}}var c=o.trim();if(c){n.push(c)}return n};var P=function(t){var n=t.merchantSelector,e=t.supportsIs;if(e){return"body.z-intl :is(".concat(n,")")}return E(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};var x=function(t){if(typeof document==="undefined"||!t){return}var n=P({merchantSelector:t,supportsIs:T});try{document.querySelector(n)}catch(e){_('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(n,'")'),"warn");return}if(document.getElementById(C)){return}var e=document.createElement("style");e.id=C;e.textContent="".concat(n," { display: none !important; }");(document.head||document.body).appendChild(e);_("Zonos domestic element hide style injected")};var L=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var F=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var G=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return i};var B=function(t){return __awaiter(b,void 0,void 0,(function(){var n,e,i,o,r;return __generator(this,(function(u){if(window.Zonos.isLegacyCheckout){_("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){i=G({position:"bottom-right"});e=i}if(!e||!s(e)){g('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}_("Hello init complete");o=L(e);if(!o){r=new MutationObserver((function(){var t=L(e);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){L(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){_("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=G({position:F(t.notFoundElementFallback)});L(n)}}),3e3)}return[2]}))}))};var M=function(){function t(t,n){var e=this;this.targetId=t;this.allowedEvents=n;this.listeners=new Map;this.handleMessage=function(t){var n,i,o;var r=t.data;var u=((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||((o=(i=e.iframe)===null||i===void 0?void 0:i.contentDocument)===null||o===void 0?void 0:o.defaultView);if(t.source!==u){return}if(!e.isValidMessage(r)){return}var s=e.listeners.get(r.type);s===null||s===void 0?void 0:s.forEach((function(t){try{t(r.payload)}catch(t){g("Error in event listener:",t)}}))};this.initializeEventListeners();this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}_("[CheckoutAddressService] listening to ".concat(t),"info");var i=n;var o=this.listeners.get(t);if(o){o.add(i)}return function(){var n=e.listeners.get(t);if(n){n.delete(i)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();var D=function(t){__extends(n,t);function n(){_("=== [Google Places Service] Initializing","info");return t.call(this,w.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}n.prototype.sendMessage=function(t,n){var e;if(!((e=this.iframe)===null||e===void 0?void 0:e.contentWindow)){return}var i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:n,type:t};_("GooglePlacesService] parent --\x3e ".concat(t),"info",n);this.iframe.contentWindow.postMessage(i,"*")};n.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};n.prototype.fetchSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!n){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[n],input:e},type:i})};n.prototype.selectPlace=function(t){var n=t.placeId,e=t.type;this.sendMessage("placeSelected",{placeId:n,type:e})};return n}(M);var H=function(){function t(){var t=this;this.googlePlaceInitialized=false;_("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new D;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.getAddressSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:n,query:e,type:i})};t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var R=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var N=R;var U=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7)}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}r.stripe=t;void j(d.checkoutSettings);_("init checkout element");return[2]}))}))};t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2]}r.stripe=t;void I();_("init Collect element");return[2]}))}))};t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Invoice element","warn");return[2]}r.stripe=t;void A();_("init Invoice element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||h();if(i==="Inter"){if(!t){return[2]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4,p("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:r=a.sent(),u=r.errors,s=r.json;if(u.length>0){_("Failed to load font ".concat(i),"warn");d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:"Inter"});return[2]}c=s===null||s===void 0?void 0:s.fontUrl;if(c){(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,c)}if(!t){return[2]}_("[FONT] ".concat(t," font override applied"));d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void B(d.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){_("=== Skip injecting custom HTML for hosted checkout","info");return}_("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var e=n.content.querySelectorAll("script");e.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}));y()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t===null||t===void 0?void 0:t.genericSettings;if(!n){return[2]}e=n.signedTokenGooglePlaces;if(!e){return[2]}m({id:w.GOOGLE_PLACES,onload:function(){d.checkoutAddressService=new H},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(e)});return[2]}))}))};t.prototype.buildBaseConfig=function(t){var n,e;var i=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:undefined,captureDelay:undefined,subscriptionStatus:undefined});if(window.Zonos.isCollect||window.Zonos.isInvoice){return Object.assign(Object.assign({},this.config),{checkoutSettings:i,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})})}if(!this.config.checkoutSettings){return Object.assign(Object.assign({},this.config),{checkoutSettings:undefined})}var o=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((n=this.config.checkoutSettings)===null||n===void 0?void 0:n.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();d.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,u,s,a,f,h,v,w;var m=this;return __generator(this,(function(p){switch(p.label){case 0:return[4,S()];case 1:o=p.sent(),r=o.errors,u=o.json,s=o.zonosMode;if(((n=(t=r[0])===null||t===void 0?void 0:t.type)===null||n===void 0?void 0:n.toString())==="403"){_("Failed to load zonos settings. This domain may not have access","warn");return[2]}a=((e=u===null||u===void 0?void 0:u.checkoutSettings)===null||e===void 0?void 0:e.customHTML)||"";this.injectCustomHTML(a);this.initZonosNotification();f=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){return((t=u===null||u===void 0?void 0:u.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=m.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(e=m.config.appearance)===null||e===void 0?void 0:e.logoUrl};h=this.buildBaseConfig(u);v=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:f()})}),h);l({overrideSettings:v,zonosSettings:u});d.zonosMode=s;x(d.checkoutSettings.domesticElementSelector);void this.setupGoogleFont();if(d.helloSettings.visibilityStatus==="DISABLED"){_("=== Hello is disabled by store owner ===","warn")}if(d.helloSettings&&d.helloSettings.visibilityStatus==="ENABLED"){_("Initializing hello");void B(d.helloSettings)}return[4,c()];case 2:p.sent();w=((i=u===null||u===void 0?void 0:u.checkoutSettings)===null||i===void 0?void 0:i.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!w||!this.stripeInitEvent){_("Checkout failed to load -- missing publishable key","warn");return[2]}if(window.Zonos.isCollect||window.Zonos.isInvoice){this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(u);return[2]}if(d.checkoutSettings.subscriptionStatus==="INACTIVE"){_('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");_("zonos controller loaded");return[2]}if(d.checkoutSettings.visibilityStatus==="DISABLED"){_("=== Checkout is disabled by store owner ===","warn");_("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(u);return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){_("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;r.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){_("Override country code to ".concat(t));void f({isInitializing:false,newSelectedCountryCode:t});return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,d.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(o,{key:"fe1f262a2bfbf4f6f39c0f23783c132bde8d2dd7",class:"zonos--elements"})};return t}());U.style=N}}}));
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-7261e245.system.js","./p-d932973f.system.js","./p-c5caf47b.system.js","./p-3e7ee89d.system.js","./p-4160bbc2.system.js","./p-01174496.system.js","./p-d938f42f.system.js","./p-bc919de1.system.js","./p-7d9d2407.system.js","./p-14d6542f.system.js"],(function(t){"use strict";var n,e,i,o,r,u,s,c,a,f,d,l,h,v,w,m,p,g,_,y;return{setters:[function(t){n=t.r;e=t.d;i=t.h;o=t.a},function(t){r=t.b},function(t){u=t.j;s=t.k;c=t.m;a=t.s;f=t.c},function(t){d=t.z;l=t.e;h=t.f},function(t){v=t.g;w=t.i;m=t.a},function(t){p=t.h;g=t.l},function(t){_=t.l},function(t){y=t.a},function(){},function(){}],execute:function(){var b=this;var S=function(){return __awaiter(b,void 0,void 0,(function(){var t,n,e,i,o,r,s;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){_("Reusing cached zonos settings");return[2,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=v();n=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){n.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}e=u();if(e){n.set("zCountry",e)}return[4,p("/api/zonos-elements/zonos-settings?".concat(n.toString()))];case 1:i=c.sent(),o=i.errors,r=i.json,s=i.zonosMode;if(o.length){g("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:o,json:null,zonosMode:s}]}return[2,{errors:[],json:r,zonosMode:s}]}}))}))};var z=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var j=function(t){if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!s(t.placeOrderButtonSelector)){g('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!s(t.alwaysTriggerInternationalCheckoutSelector)){g('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}z()};var O=function(){var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var I=function(){if(!window.Zonos.cartData){return}O()};var k=function(){var t=document.querySelector("zonos-invoice");if(!t){var n=document.createElement("zonos-invoice");document.body.appendChild(n)}};var A=function(){if(!window.Zonos.cartData){return}k()};var C="zonos-domestic-element-hide-style";var T=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();var E=function(t){var n=[];var e=0;var i=0;var o="";for(var r=0;r<t.length;r++){var u=t[r];if(u==="("){e++}else if(u===")"){e--}else if(u==="["){i++}else if(u==="]"){i--}if(u===","&&e===0&&i===0){var s=o.trim();if(s){n.push(s)}o=""}else{o+=u}}var c=o.trim();if(c){n.push(c)}return n};var P=function(t){var n=t.merchantSelector,e=t.supportsIs;if(e){return"body.z-intl :is(".concat(n,")")}return E(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};var x=function(t){if(typeof document==="undefined"||!t){return}var n=P({merchantSelector:t,supportsIs:T});try{document.querySelector(n)}catch(e){_('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(n,'")'),"warn");return}if(document.getElementById(C)){return}var e=document.createElement("style");e.id=C;e.textContent="".concat(n," { display: none !important; }");(document.head||document.body).appendChild(e);_("Zonos domestic element hide style injected")};var L=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var F=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var G=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return i};var B=function(t){return __awaiter(b,void 0,void 0,(function(){var n,e,i,o,r;return __generator(this,(function(u){if(window.Zonos.isLegacyCheckout){_("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){i=G({position:"bottom-right"});e=i}if(!e||!s(e)){g('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}_("Hello init complete");o=L(e);if(!o){r=new MutationObserver((function(){var t=L(e);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){L(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){_("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=G({position:F(t.notFoundElementFallback)});L(n)}}),3e3)}return[2]}))}))};var M=function(){function t(t,n){var e=this;this.targetId=t;this.allowedEvents=n;this.listeners=new Map;this.handleMessage=function(t){var n,i,o;var r=t.data;var u=((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||((o=(i=e.iframe)===null||i===void 0?void 0:i.contentDocument)===null||o===void 0?void 0:o.defaultView);if(t.source!==u){return}if(!e.isValidMessage(r)){return}var s=e.listeners.get(r.type);s===null||s===void 0?void 0:s.forEach((function(t){try{t(r.payload)}catch(t){g("Error in event listener:",t)}}))};this.initializeEventListeners();this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}_("[CheckoutAddressService] listening to ".concat(t),"info");var i=n;var o=this.listeners.get(t);if(o){o.add(i)}return function(){var n=e.listeners.get(t);if(n){n.delete(i)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();var D=function(t){__extends(n,t);function n(){_("=== [Google Places Service] Initializing","info");return t.call(this,w.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}n.prototype.sendMessage=function(t,n){var e;if(!((e=this.iframe)===null||e===void 0?void 0:e.contentWindow)){return}var i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:n,type:t};_("GooglePlacesService] parent --\x3e ".concat(t),"info",n);this.iframe.contentWindow.postMessage(i,"*")};n.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};n.prototype.fetchSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!n){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[n],input:e},type:i})};n.prototype.selectPlace=function(t){var n=t.placeId,e=t.type;this.sendMessage("placeSelected",{placeId:n,type:e})};return n}(M);var H=function(){function t(){var t=this;this.googlePlaceInitialized=false;_("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new D;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};t.prototype.getAddressSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:n,query:e,type:i})};t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var R=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var N=R;var U=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7)}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}r.stripe=t;void j(d.checkoutSettings);_("init checkout element");return[2]}))}))};t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2]}r.stripe=t;void I();_("init Collect element");return[2]}))}))};t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Invoice element","warn");return[2]}r.stripe=t;void A();_("init Invoice element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||h();if(i==="Inter"){if(!t){return[2]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4,p("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:r=a.sent(),u=r.errors,s=r.json;if(u.length>0){_("Failed to load font ".concat(i),"warn");d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:"Inter"});return[2]}c=s===null||s===void 0?void 0:s.fontUrl;if(c){(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,c)}if(!t){return[2]}_("[FONT] ".concat(t," font override applied"));d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void B(d.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){_("=== Skip injecting custom HTML for hosted checkout","info");return}_("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var e=n.content.querySelectorAll("script");e.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}));y()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t===null||t===void 0?void 0:t.genericSettings;if(!n){return[2]}e=n.signedTokenGooglePlaces;if(!e){return[2]}m({id:w.GOOGLE_PLACES,onload:function(){d.checkoutAddressService=new H},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(e)});return[2]}))}))};t.prototype.buildBaseConfig=function(t){var n,e;var i=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:undefined,captureDelay:undefined,subscriptionStatus:undefined});if(window.Zonos.isCollect||window.Zonos.isInvoice){return Object.assign(Object.assign({},this.config),{checkoutSettings:i,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})})}if(!this.config.checkoutSettings){return Object.assign(Object.assign({},this.config),{checkoutSettings:undefined})}var o=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((n=this.config.checkoutSettings)===null||n===void 0?void 0:n.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();d.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,u,s,a,f,h,v,w;var m=this;return __generator(this,(function(p){switch(p.label){case 0:return[4,S()];case 1:o=p.sent(),r=o.errors,u=o.json,s=o.zonosMode;if(((n=(t=r[0])===null||t===void 0?void 0:t.type)===null||n===void 0?void 0:n.toString())==="403"){_("Failed to load zonos settings. This domain may not have access","warn");return[2]}a=((e=u===null||u===void 0?void 0:u.checkoutSettings)===null||e===void 0?void 0:e.customHTML)||"";this.injectCustomHTML(a);this.initZonosNotification();f=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){return((t=u===null||u===void 0?void 0:u.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=m.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(e=m.config.appearance)===null||e===void 0?void 0:e.logoUrl};h=this.buildBaseConfig(u);v=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:f()})}),h);l({overrideSettings:v,zonosSettings:u});d.zonosMode=s;x(d.checkoutSettings.domesticElementSelector);void this.setupGoogleFont();if(d.helloSettings.visibilityStatus==="DISABLED"){_("=== Hello is disabled by store owner ===","warn")}if(d.helloSettings&&d.helloSettings.visibilityStatus==="ENABLED"){_("Initializing hello");void B(d.helloSettings)}return[4,c()];case 2:p.sent();w=((i=u===null||u===void 0?void 0:u.checkoutSettings)===null||i===void 0?void 0:i.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!w||!this.stripeInitEvent){_("Checkout failed to load -- missing publishable key","warn");return[2]}if(window.Zonos.isCollect||window.Zonos.isInvoice){this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(u);return[2]}if(d.checkoutSettings.subscriptionStatus==="INACTIVE"){_('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");_("zonos controller loaded");return[2]}if(d.checkoutSettings.visibilityStatus==="DISABLED"){_("=== Checkout is disabled by store owner ===","warn");_("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:w.token});void this.initGooglePlacesService(u);return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){_("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;r.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){_("Override country code to ".concat(t));void f({isInitializing:false,newSelectedCountryCode:t});return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,d.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(o,{key:"fe1f262a2bfbf4f6f39c0f23783c132bde8d2dd7",class:"zonos--elements"})};return t}());U.style=N}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function r(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):i(e.value).then(a,r)}l((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(o){return l([e,o])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=o.call(e,t)}catch(e){r=[6,e];i=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,i=o.length,s;n<i;n++){if(s||!(n in o)){if(!s)s=Array.prototype.slice.call(o,0,n);s[n]=o[n]}}return e.concat(s||Array.prototype.slice.call(o))};System.register(["./p-7261e245.system.js","./p-77c2e465.system.js","./p-3689821f.system.js","./p-23e7c655.system.js","./p-2d6557ee.system.js","./p-07a76716.system.js","./p-bc7bf53e.system.js","./p-2b8345d8.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(e){"use strict";var o,t,n,i,s,a,r,l,d,c,u,h,f,m,g,v;return{setters:[function(e){o=e.r;t=e.d;n=e.h;i=e.F;s=e.a},function(e){a=e.l;r=e.t;l=e.d},function(e){d=e.z},function(e){c=e.c},function(e){u=e.f},function(e){h=e.h;f=e.T;m=e.D},function(e){g=e.g},function(e){v=e.e},function(){},function(){}],execute:function(){var b=function(e){var o=e.getBoundingClientRect();var t=o.top;var n=window.innerHeight-o.bottom;return t>=n};var p=function(e){var o=e.href,t=e.text;return'<zonos-link href="'.concat(o,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var z='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var x='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>';var y='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var C='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var k='<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>';var L=":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--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}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:2147483647}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:0;top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;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;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var D=L;var S=e("zonos_hello_dialog",function(){function e(e){var s=this;o(this,e);this.closeDialog=t(this,"closeDialog",7);this.isOpen=false;this.setIsOpen=function(){};this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false;this.clickOutsideDialogHandler=function(e){if(!e.composedPath().includes(s.dialogRef)&&s.isOpen){s.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(d.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(e){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(o){this.showCountrySelect=e;return[2]}))}))};this.setShowLanguageSelect=function(e){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(o){this.showLanguageSelect=e;return[2]}))}))};this.hasTaxId=function(){var e;return(e=a.countryLandedCost)===null||e===void 0?void 0:e.hasTaxId};this.isDomesticCountry=function(){var e,o;var t=a.selectedCountryCode;return!!t&&!!((o=(e=d.genericSettings)===null||e===void 0?void 0:e.domesticCountries)===null||o===void 0?void 0:o.includes(t))};this.isNoThresholdCountry=function(e){if(!e||!s.hasTaxId()){return false}var o=__spreadArray(["AU","NZ","GB","NO","SG"],v,true);return o.includes(e)};this.getDutyMessage=function(){if(s.isDomesticCountry()){return null}var e=a.countryLandedCost;if(!(e===null||e===void 0?void 0:e.allowLowValueOrders)&&(e===null||e===void 0?void 0:e.countryCode)==="GB"){return r("Duties will apply to all orders.")}var o=(e===null||e===void 0?void 0:e.dutyDeminimus)?l({amount:e.dutyDeminimus}):null;return o?r("Spend up to [threshold] duty free.",{threshold:o}):r("Duties will apply to all orders.")};this.getTaxMessage=function(){var e=a.countryLandedCost;if(s.isDomesticCountry()){return null}if(!(e===null||e===void 0?void 0:e.allowLowValueOrders)&&(e===null||e===void 0?void 0:e.countryCode)==="GB"){return r("Taxes will apply to all orders.")}var o=(e===null||e===void 0?void 0:e.vatTaxDeminimus)?l({amount:e.vatTaxDeminimus}):null;return o&&!s.isNoThresholdCountry(e===null||e===void 0?void 0:e.countryCode)?r("Spend up to [threshold] tax free.",{threshold:o}):r("Taxes will apply to all orders.")};this.getEuDutyTaxMessage=function(e){return["".concat(r("Due to the IOSS tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:r("Learn more.")}))]};this.getUkDutyTaxMessage=function(e){if(e.allowLowValueOrders){return["".concat(r("Due to the UK tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:r("Learn more.")}))]}var o=e.dutyDeminimus;return[r("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o})})]};this.getAustraliaDutyTaxMessage=function(e){if(h()){return[]}return["".concat(r("Due to the Australia tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:r("Learn more.")}))]};this.getNewZealandDutyTaxMessge=function(e){if(h()){return null}return["".concat(r("Due to the New Zealand tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/guides/country-guides/new-zealand/new-zealand-import-taxes",text:r("Learn more.")}))]};this.getNorwayDutyTaxMessage=function(e){if(h()){return null}return["".concat(r("Due to the VOEC tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/guides/country-guides/norway-voec-scheme",text:r("Learn more.")}))]};this.getSingaporeDutyTaxMessage=function(e){if(h()){return null}return["".concat(r("Due to the Singapore tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/singapore-gst-settings",text:r("Learn more.")}))]};this.getInclusivePriceMessage=function(){var e=a.inclusivePricingConfigurations;var o=e===null||e===void 0?void 0:e.find(Boolean);var t=o===null||o===void 0?void 0:o.configurations[f];var n=o===null||o===void 0?void 0:o.configurations[m];if((t===null||t===void 0?void 0:t.status)==="DISABLED"&&(n===null||n===void 0?void 0:n.status)==="DISABLED"){return null}if((n===null||n===void 0?void 0:n.status)==="ENABLED"&&(t===null||t===void 0?void 0:t.status)==="ENABLED"){return{inclusiveType:"DUTIES_TAXES_AND_FEES",message:r("Product prices already include duties, taxes and fees. No additional duties, taxes, or fees will be added at checkout.")}}if((n===null||n===void 0?void 0:n.status)==="ENABLED"){return{inclusiveType:"DUTIES_FEES",message:r("Product prices already include duties and fees. No additional duties or fees will be added at checkout.")}}if((t===null||t===void 0?void 0:t.status)==="ENABLED"){return{inclusiveType:"TAXES",message:r("Product prices already include taxes. No additional taxes will be added at checkout.")}}return null};this.renderHelloMessage=function(e){var o=e.dutyDeMinimisMessage,t=e.inclusivePriceMessage,s=e.taxDeMinimisMessage;if(h()&&t){switch(t.inclusiveType){case"DUTIES_FEES":{return n(i,null,t.message&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty inclusive pricing icon",content:x}),n("zonos-text",{"aria-label":"Duty inclusive pricing message"},t.message)),s&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis icon",content:C}),n("zonos-text",{"aria-label":"Tax de minimis message"},s)))}case"TAXES":{return n(i,null,t.message&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax inclusive pricing icon",content:x}),n("zonos-text",{"aria-label":"Tax inclusive pricing message"},t.message)),o&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis icon",content:z}),n("zonos-text",{"aria-label":"Duty de minimis message"},o)))}case"DUTIES_TAXES_AND_FEES":default:{return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:x}),n("zonos-text",null,t.message))}}}return n(i,null,o&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis icon",content:z}),n("zonos-text",{"aria-label":"Duty de minimis message"},o)),s&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis icon",content:C}),n("zonos-text",{"aria-label":"Tax de minimis message"},s)))};this.getAdditionalDutyTaxMessage=function(){if(!a.countryLandedCost){return null}if(s.isDomesticCountry()){return null}if(!s.hasTaxId()){return null}switch(a.countryLandedCost.countryCode){case"GB":return s.getUkDutyTaxMessage(a.countryLandedCost);case"AU":return s.getAustraliaDutyTaxMessage(a.countryLandedCost);case"NZ":return s.getNewZealandDutyTaxMessge(a.countryLandedCost);case"NO":return s.getNorwayDutyTaxMessage(a.countryLandedCost);case"SG":return s.getSingaporeDutyTaxMessage(a.countryLandedCost);default:if(v.includes(a.countryLandedCost.countryCode)){return s.getEuDutyTaxMessage(a.countryLandedCost)}return null}}}e.prototype.globalClickHandler=function(e){this.clickOutsideDialogHandler(e)};e.prototype.isOpenHandler=function(e){if(!e){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};e.prototype.render=function(){var e=this;var o,t;var i=a.selectedCountryCode;var l=this.getAdditionalDutyTaxMessage();var h=(o=this.animateFromLeftOverride)!==null&&o!==void 0?o:this.dialogRef&&g(this.dialogRef);var f=this.dialogRef&&b(this.dialogRef);var m=a.customMessages;var v=r("Welcome to [storeName]",{storeName:d.organizationName});var p=((t=m.find((function(e){return e.pageName==="hello_default"})))===null||t===void 0?void 0:t.message)||r("Know about duties and taxes before you buy. Shop with confidence!");var z=u(p);var x=this.getCurrentPageEnum();var C=m.filter((function(e){return e.pageName===x}));var L=this.getDutyMessage();var D=this.getTaxMessage();var S=this.getInclusivePriceMessage();return n(s,{key:"4f03947b13c6e6d9f19d3d4241c427f9ef8cb07b",class:"zonos--elements"},n("div",{key:"c5001cd7c4c7bb0fcf2375fc211c9afbd2059f32",class:c(["zonos--hello-dialog",h&&"zonos--hello-dialog-animate-from-left",f&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:function(o){return o&&(e.dialogRef=o)}},!this.showCountrySelect&&!this.showLanguageSelect&&n("div",{key:"cb86aadda605b075152c21009b11f57b87b1d815"},n("div",{key:"77a7e3bd67cd2b19f2adec81f15c642d76151f74",class:"zonos--hello-dialog-content"},n("zonos-button",{key:"ac5d1386f34c2948ea087d64ba60d1af87e76487",class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:k}),noBackground:true,onClick:function(){return e.setIsOpen(false)}}),n("zonos-v-stack",{key:"50fcf820665b013090f8b22bd011b48edd23e47d",spacing:24},n("zonos-country-flag",{key:"fba9eb926c23fdad59d4262582fefd102aa9e721",class:"zonos--hello-country-flag",countryCode:i}),n("zonos-v-stack",{key:"08438a0f1f7ab1ed7aa6077bd8c0c040d10a48e2",class:"zonos--hello-dialog-header",spacing:4},n("zonos-text",{key:"f3ed157753544a886c2362e48d4ff941135f69dd",type:"boldSubheader"},v),n("zonos-text",{key:"989155955d1b6b50e54b38b9aedf71041a1ca57e",innerHTML:z,textColor:"gray-800"})),n("zonos-v-stack",{key:"480acbed038550026005317e0fa41c74db4befe6",spacing:8},this.restrictedItems.map((function(e){var o;return e&&n("zonos-banner",{bannerTitle:e.name,intent:"error"},(o=e.itemRestrictions)===null||o===void 0?void 0:o.map((function(e){return n("zonos-text",{textColor:"red-800"},e===null||e===void 0?void 0:e.note)})))})),(L||D||S||!!(l===null||l===void 0?void 0:l.length))&&n("zonos-card",{key:"ec95384f56843f11e7ef678363c08718ce879bea",spacing:"12px"},n("zonos-v-stack",{key:"e56aedf0bf3c2e698b6911ae0d96f3c46059158e",spacing:12},this.renderHelloMessage({dutyDeMinimisMessage:L,inclusivePriceMessage:S,taxDeMinimisMessage:D}),l===null||l===void 0?void 0:l.map((function(e){return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Additional information for buying goods from selected country icon",content:w}),n("zonos-text",{"aria-label":"Additional information for buying goods from selected country message",innerHTML:e}))})))),C.map((function(e){return n("zonos-custom-message",{icon:y,message:e.message})}))))),n("zonos-hello-dialog-footer",{key:"103bcee4af2a3979a7db3e86b287063bec16310b",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(o){return e.setShowCountrySelect(o)},setShowLanguageSelect:function(o){return e.setShowLanguageSelect(o)}})),this.showCountrySelect&&n("div",{key:"900e288096edd6aa4bcfddd3b80932a11c675a6a"},n("zonos-country-select",{key:"278e3cfe7dcd69332e6257517759ca2c8e959ae0",handleOnClose:function(){return e.setShowCountrySelect(false)}})),this.showLanguageSelect&&n("div",{key:"2d70d0c380fc681492b7b97b4d78677db88a78fc"},n("zonos-language-select",{key:"7debc2fa20436565b00c7f9832b89f388a814a96",handleOnClose:function(){return e.setShowLanguageSelect(false)}}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return e}());S.style=D}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function r(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?t(e.value):i(e.value).then(a,r)}l((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(o){return l([e,o])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=o.call(e,t)}catch(e){r=[6,e];i=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,i=o.length,s;n<i;n++){if(s||!(n in o)){if(!s)s=Array.prototype.slice.call(o,0,n);s[n]=o[n]}}return e.concat(s||Array.prototype.slice.call(o))};System.register(["./p-7261e245.system.js","./p-c5caf47b.system.js","./p-3e7ee89d.system.js","./p-23e7c655.system.js","./p-2d6557ee.system.js","./p-4b6e367d.system.js","./p-bc7bf53e.system.js","./p-2b8345d8.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(e){"use strict";var o,t,n,i,s,a,r,l,d,c,u,h,f,m,g,v;return{setters:[function(e){o=e.r;t=e.d;n=e.h;i=e.F;s=e.a},function(e){a=e.l;r=e.t;l=e.h},function(e){d=e.z},function(e){c=e.c},function(e){u=e.f},function(e){h=e.h;f=e.T;m=e.D},function(e){g=e.g},function(e){v=e.e},function(){},function(){}],execute:function(){var b=function(e){var o=e.getBoundingClientRect();var t=o.top;var n=window.innerHeight-o.bottom;return t>=n};var p=function(e){var o=e.href,t=e.text;return'<zonos-link href="'.concat(o,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var z='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var x='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>';var y='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var C='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var k='<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>';var L=":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--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}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:2147483647}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:0;top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;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;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var D=L;var S=e("zonos_hello_dialog",function(){function e(e){var s=this;o(this,e);this.closeDialog=t(this,"closeDialog",7);this.isOpen=false;this.setIsOpen=function(){};this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false;this.clickOutsideDialogHandler=function(e){if(!e.composedPath().includes(s.dialogRef)&&s.isOpen){s.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(d.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(e){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(o){this.showCountrySelect=e;return[2]}))}))};this.setShowLanguageSelect=function(e){return __awaiter(s,void 0,void 0,(function(){return __generator(this,(function(o){this.showLanguageSelect=e;return[2]}))}))};this.hasTaxId=function(){var e;return(e=a.countryLandedCost)===null||e===void 0?void 0:e.hasTaxId};this.isDomesticCountry=function(){var e,o;var t=a.selectedCountryCode;return!!t&&!!((o=(e=d.genericSettings)===null||e===void 0?void 0:e.domesticCountries)===null||o===void 0?void 0:o.includes(t))};this.isNoThresholdCountry=function(e){if(!e||!s.hasTaxId()){return false}var o=__spreadArray(["AU","NZ","GB","NO","SG"],v,true);return o.includes(e)};this.getDutyMessage=function(){if(s.isDomesticCountry()){return null}var e=a.countryLandedCost;if(!(e===null||e===void 0?void 0:e.allowLowValueOrders)&&(e===null||e===void 0?void 0:e.countryCode)==="GB"){return r("Duties will apply to all orders.")}var o=(e===null||e===void 0?void 0:e.dutyDeminimus)?l({amount:e.dutyDeminimus}):null;return o?r("Spend up to [threshold] duty free.",{threshold:o}):r("Duties will apply to all orders.")};this.getTaxMessage=function(){var e=a.countryLandedCost;if(s.isDomesticCountry()){return null}if(!(e===null||e===void 0?void 0:e.allowLowValueOrders)&&(e===null||e===void 0?void 0:e.countryCode)==="GB"){return r("Taxes will apply to all orders.")}var o=(e===null||e===void 0?void 0:e.vatTaxDeminimus)?l({amount:e.vatTaxDeminimus}):null;return o&&!s.isNoThresholdCountry(e===null||e===void 0?void 0:e.countryCode)?r("Spend up to [threshold] tax free.",{threshold:o}):r("Taxes will apply to all orders.")};this.getEuDutyTaxMessage=function(e){return["".concat(r("Due to the IOSS tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:r("Learn more.")}))]};this.getUkDutyTaxMessage=function(e){if(e.allowLowValueOrders){return["".concat(r("Due to the UK tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:r("Learn more.")}))]}var o=e.dutyDeminimus;return[r("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o})})]};this.getAustraliaDutyTaxMessage=function(e){if(h()){return[]}return["".concat(r("Due to the Australia tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:r("Learn more.")}))]};this.getNewZealandDutyTaxMessge=function(e){if(h()){return null}return["".concat(r("Due to the New Zealand tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/guides/country-guides/new-zealand/new-zealand-import-taxes",text:r("Learn more.")}))]};this.getNorwayDutyTaxMessage=function(e){if(h()){return null}return["".concat(r("Due to the VOEC tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/guides/country-guides/norway-voec-scheme",text:r("Learn more.")}))]};this.getSingaporeDutyTaxMessage=function(e){if(h()){return null}return["".concat(r("Due to the Singapore tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:"".concat(e.vatTaxRate*100,"%")})," ").concat(p({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/singapore-gst-settings",text:r("Learn more.")}))]};this.getInclusivePriceMessage=function(){var e=a.inclusivePricingConfigurations;var o=e===null||e===void 0?void 0:e.find(Boolean);var t=o===null||o===void 0?void 0:o.configurations[f];var n=o===null||o===void 0?void 0:o.configurations[m];if((t===null||t===void 0?void 0:t.status)==="DISABLED"&&(n===null||n===void 0?void 0:n.status)==="DISABLED"){return null}if((n===null||n===void 0?void 0:n.status)==="ENABLED"&&(t===null||t===void 0?void 0:t.status)==="ENABLED"){return{inclusiveType:"DUTIES_TAXES_AND_FEES",message:r("Product prices already include duties, taxes and fees. No additional duties, taxes, or fees will be added at checkout.")}}if((n===null||n===void 0?void 0:n.status)==="ENABLED"){return{inclusiveType:"DUTIES_FEES",message:r("Product prices already include duties and fees. No additional duties or fees will be added at checkout.")}}if((t===null||t===void 0?void 0:t.status)==="ENABLED"){return{inclusiveType:"TAXES",message:r("Product prices already include taxes. No additional taxes will be added at checkout.")}}return null};this.renderHelloMessage=function(e){var o=e.dutyDeMinimisMessage,t=e.inclusivePriceMessage,s=e.taxDeMinimisMessage;if(h()&&t){switch(t.inclusiveType){case"DUTIES_FEES":{return n(i,null,t.message&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty inclusive pricing icon",content:x}),n("zonos-text",{"aria-label":"Duty inclusive pricing message"},t.message)),s&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis icon",content:C}),n("zonos-text",{"aria-label":"Tax de minimis message"},s)))}case"TAXES":{return n(i,null,t.message&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax inclusive pricing icon",content:x}),n("zonos-text",{"aria-label":"Tax inclusive pricing message"},t.message)),o&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis icon",content:z}),n("zonos-text",{"aria-label":"Duty de minimis message"},o)))}case"DUTIES_TAXES_AND_FEES":default:{return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis",content:x}),n("zonos-text",null,t.message))}}}return n(i,null,o&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Duty de minimis icon",content:z}),n("zonos-text",{"aria-label":"Duty de minimis message"},o)),s&&n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Tax de minimis icon",content:C}),n("zonos-text",{"aria-label":"Tax de minimis message"},s)))};this.getAdditionalDutyTaxMessage=function(){if(!a.countryLandedCost){return null}if(s.isDomesticCountry()){return null}if(!s.hasTaxId()){return null}switch(a.countryLandedCost.countryCode){case"GB":return s.getUkDutyTaxMessage(a.countryLandedCost);case"AU":return s.getAustraliaDutyTaxMessage(a.countryLandedCost);case"NZ":return s.getNewZealandDutyTaxMessge(a.countryLandedCost);case"NO":return s.getNorwayDutyTaxMessage(a.countryLandedCost);case"SG":return s.getSingaporeDutyTaxMessage(a.countryLandedCost);default:if(v.includes(a.countryLandedCost.countryCode)){return s.getEuDutyTaxMessage(a.countryLandedCost)}return null}}}e.prototype.globalClickHandler=function(e){this.clickOutsideDialogHandler(e)};e.prototype.isOpenHandler=function(e){if(!e){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};e.prototype.render=function(){var e=this;var o,t;var i=a.selectedCountryCode;var l=this.getAdditionalDutyTaxMessage();var h=(o=this.animateFromLeftOverride)!==null&&o!==void 0?o:this.dialogRef&&g(this.dialogRef);var f=this.dialogRef&&b(this.dialogRef);var m=a.customMessages;var v=r("Welcome to [storeName]",{storeName:d.organizationName});var p=((t=m.find((function(e){return e.pageName==="hello_default"})))===null||t===void 0?void 0:t.message)||r("Know about duties and taxes before you buy. Shop with confidence!");var z=u(p);var x=this.getCurrentPageEnum();var C=m.filter((function(e){return e.pageName===x}));var L=this.getDutyMessage();var D=this.getTaxMessage();var S=this.getInclusivePriceMessage();return n(s,{key:"4f03947b13c6e6d9f19d3d4241c427f9ef8cb07b",class:"zonos--elements"},n("div",{key:"c5001cd7c4c7bb0fcf2375fc211c9afbd2059f32",class:c(["zonos--hello-dialog",h&&"zonos--hello-dialog-animate-from-left",f&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:function(o){return o&&(e.dialogRef=o)}},!this.showCountrySelect&&!this.showLanguageSelect&&n("div",{key:"cb86aadda605b075152c21009b11f57b87b1d815"},n("div",{key:"77a7e3bd67cd2b19f2adec81f15c642d76151f74",class:"zonos--hello-dialog-content"},n("zonos-button",{key:"ac5d1386f34c2948ea087d64ba60d1af87e76487",class:"zonos--close-button",icon:n("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:k}),noBackground:true,onClick:function(){return e.setIsOpen(false)}}),n("zonos-v-stack",{key:"50fcf820665b013090f8b22bd011b48edd23e47d",spacing:24},n("zonos-country-flag",{key:"fba9eb926c23fdad59d4262582fefd102aa9e721",class:"zonos--hello-country-flag",countryCode:i}),n("zonos-v-stack",{key:"08438a0f1f7ab1ed7aa6077bd8c0c040d10a48e2",class:"zonos--hello-dialog-header",spacing:4},n("zonos-text",{key:"f3ed157753544a886c2362e48d4ff941135f69dd",type:"boldSubheader"},v),n("zonos-text",{key:"989155955d1b6b50e54b38b9aedf71041a1ca57e",innerHTML:z,textColor:"gray-800"})),n("zonos-v-stack",{key:"480acbed038550026005317e0fa41c74db4befe6",spacing:8},this.restrictedItems.map((function(e){var o;return e&&n("zonos-banner",{bannerTitle:e.name,intent:"error"},(o=e.itemRestrictions)===null||o===void 0?void 0:o.map((function(e){return n("zonos-text",{textColor:"red-800"},e===null||e===void 0?void 0:e.note)})))})),(L||D||S||!!(l===null||l===void 0?void 0:l.length))&&n("zonos-card",{key:"ec95384f56843f11e7ef678363c08718ce879bea",spacing:"12px"},n("zonos-v-stack",{key:"e56aedf0bf3c2e698b6911ae0d96f3c46059158e",spacing:12},this.renderHelloMessage({dutyDeMinimisMessage:L,inclusivePriceMessage:S,taxDeMinimisMessage:D}),l===null||l===void 0?void 0:l.map((function(e){return n("div",{class:"zonos--flex-message"},n("zonos-icon",{"aria-label":"Additional information for buying goods from selected country icon",content:w}),n("zonos-text",{"aria-label":"Additional information for buying goods from selected country message",innerHTML:e}))})))),C.map((function(e){return n("zonos-custom-message",{icon:y,message:e.message})}))))),n("zonos-hello-dialog-footer",{key:"103bcee4af2a3979a7db3e86b287063bec16310b",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(o){return e.setShowCountrySelect(o)},setShowLanguageSelect:function(o){return e.setShowLanguageSelect(o)}})),this.showCountrySelect&&n("div",{key:"900e288096edd6aa4bcfddd3b80932a11c675a6a"},n("zonos-country-select",{key:"278e3cfe7dcd69332e6257517759ca2c8e959ae0",handleOnClose:function(){return e.setShowCountrySelect(false)}})),this.showLanguageSelect&&n("div",{key:"2d70d0c380fc681492b7b97b4d78677db88a78fc"},n("zonos-language-select",{key:"7debc2fa20436565b00c7f9832b89f388a814a96",handleOnClose:function(){return e.setShowLanguageSelect(false)}}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return e}());S.style=D}}}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,r,e,t){function o(n){return n instanceof e?n:new e((function(r){r(n)}))}return new(e||(e=Promise))((function(e,i){function a(n){try{c(t.next(n))}catch(n){i(n)}}function u(n){try{c(t["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):o(n.value).then(a,u)}c((t=t.apply(n,r||[])).next())}))};var __generator=this&&this.__generator||function(n,r){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(r){return c([n,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=r.call(n,e)}catch(n){u=[6,n];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-3e7ee89d.system.js","./p-d932973f.system.js","./p-c5caf47b.system.js","./p-01174496.system.js","./p-5d65be06.system.js","./p-d938f42f.system.js","./p-bc919de1.system.js"],(function(n){"use strict";var r,e,t,o,i,a,u,c,s,d,f,l,v,p,y,h,b,w,m,_,j,P,k,g,E,O,I;return{setters:[function(n){r=n.z;e=n.c},function(n){t=n.t;o=n.v;i=n.E;a=n.A;u=n.b;c=n.d;s=n.x;d=n.y;f=n.J;l=n.z;v=n.B;p=n.u;y=n.h;h=n.I},function(n){b=n.t;w=n.s},function(n){m=n.h;_=n.g;j=n.l;P=n.j},function(n){k=n.i},function(n){g=n.l},function(n){E=n.i;O=n.e;I=n.s}],execute:function(){
|
|
2
|
+
/*!
|
|
3
|
+
* paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
|
|
4
|
+
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var S=this;function A(n,r){var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0)e[t]=n[t];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(n);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o]))e[t[o]]=n[t[o]]}return e}typeof SuppressedError==="function"?SuppressedError:function(n,r,e){var t=new Error(e);return t.name="SuppressedError",t.error=n,t.suppressed=r,t};function x(n,r){var e=document.querySelector('script[src="'.concat(n,'"]'));if(e===null)return null;var t=M(n,r);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(n){if(o.dataset[n]!==t.dataset[n]){i=false}}));return i?e:null}function B(n){var r=n.url,e=n.attributes,t=n.onSuccess,o=n.onError;var i=M(r,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function T(n){var r=n.sdkBaseUrl,e=n.environment,t=A(n,["sdkBaseUrl","environment"]);var o=r||L(e);var i=t;var a=Object.keys(i).filter((function(n){return typeof i[n]!=="undefined"&&i[n]!==null&&i[n]!==""})).reduce((function(n,r){var e=i[r].toString();r=z(r);if(r.substring(0,4)==="data"||r==="crossorigin"){n.attributes[r]=e}else{n.queryParams[r]=e}return n}),{queryParams:{},attributes:{}}),u=a.queryParams,c=a.attributes;if(u["merchant-id"]&&u["merchant-id"].indexOf(",")!==-1){c["data-merchant-id"]=u["merchant-id"];u["merchant-id"]="*"}return{url:"".concat(o,"?").concat(C(u)),attributes:c}}function z(n){var r=function(n,r){return(r?"-":"")+n.toLowerCase()};return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)}function C(n){var r="";Object.keys(n).forEach((function(e){if(r.length!==0)r+="&";r+=e+"="+n[e]}));return r}function L(n){return n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}function M(n,r){if(r===void 0){r={}}var e=document.createElement("script");e.src=n;Object.keys(r).forEach((function(n){e.setAttribute(n,r[n]);if(n==="data-csp-nonce"){e.setAttribute("nonce",r["data-csp-nonce"])}}));return e}function F(n,r){if(r===void 0){r=Promise}N(n,r);if(typeof document==="undefined")return r.resolve(null);var e=T(n),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=D(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(x(t,o)&&a){return r.resolve(a)}return q({url:t,attributes:o},r).then((function(){var n=D(i);if(n){return n}throw new Error("The window.".concat(i," global variable is not available."))}))}function q(n,r){if(r===void 0){r=Promise}N(n,r);var e=n.url,t=n.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new r((function(n,r){if(typeof document==="undefined")return n();B({url:e,attributes:t,onSuccess:function(){return n()},onError:function(){var n=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(n)}})}))}function D(n){return window[n]}function N(n,r){if(typeof n!=="object"||n===null){throw new Error("Expected an options object.")}var e=n.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof r!=="undefined"&&typeof r!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var R=function(n){return __awaiter(S,[n],void 0,(function(n){var r,e,t;var o=n.checkoutSessionId,i=n.paypalMockResponse;return __generator(this,(function(n){switch(n.label){case 0:return[4,m("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:r=n.sent(),e=r.errors,t=r.json;return[2,{errors:e,json:t}]}}))}))};var U=function(n){return __awaiter(S,[n],void 0,(function(n){var r,e,t;var o=n.checkoutSessionId,i=n.intent;return __generator(this,(function(n){switch(n.label){case 0:return[4,m("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o,intent:i},method:"POST"})];case 1:r=n.sent(),e=r.errors,t=r.json;return[2,{errors:e,json:t}]}}))}))};var Y=undefined&&undefined.__rest||function(n,r){var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0)e[t]=n[t];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(n);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o]))e[t[o]]=n[t[o]]}return e};var Z={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"};var H=function(n){var r;return(r=Z[n])!==null&&r!==void 0?r:null};var G=function(n){if(!n)return false;return Array.isArray(n.items)};var K=function(n){if(!n)return{};if(!G(n)){return Object.assign({},n)}var r=n.currency,e=n.items,t=n.transaction_id,o=n.value,i=Y(n,["currency","items","transaction_id","value"]);var a=e.map((function(n){return{id:n.item_id,item_price:n.price,quantity:n.quantity}}));var u=e.map((function(n){return n.item_id}));var c=e.reduce((function(n,r){return n+r.quantity}),0);var s=Object.assign(Object.assign({},i),{content_ids:u,content_type:"product",contents:a,num_items:c});if(t){s.order_id=t}if(r!==undefined){s.currency=r}if(o!==undefined){s.value=o}return s};var V=function(){var n=r.checkoutSettings.analyticsProviders.find((function(n){return n.type==="FACEBOOK_PIXEL"}));return!!n&&n.status==="ENABLED"};var X=function(n,r,e){if(E()){O({event:r,fbqMode:n,payload:e,provider:"fbq"});return}if(typeof window.fbq==="function"){g("Zonos submits fbq event","log","".concat(n,":").concat(r));window.fbq(n,r,e)}};var J=function(n){var r=n.event,e=n.metadata;if(!V()){return}var t=_();var o=K(e);var i=Object.assign(Object.assign({},o),t&&{isTestMode:true});var a=Object.fromEntries(Object.entries(i).filter((function(n){var r=n[0],e=n[1];return e!==null})));X("trackCustom",r,a);var u=H(r);if(u&&u!==r){X("track",u,a)}};var Q=n("s",(function(n){I(n);J(n)}));var W=e((function(){return{intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),$=W.onChange,nn=W.reset,rn=W.state;n({e:$,c:nn,a:rn});var en=function(n){return __awaiter(S,[n],void 0,(function(n){var r,e,t,o,i,a,u;var c=n.checkoutSessionId;return __generator(this,(function(n){switch(n.label){case 0:t=rn.intent.toUpperCase();return[4,U({checkoutSessionId:c,intent:t})];case 1:o=n.sent(),i=o.errors,a=o.json;u=(r=a===null||a===void 0?void 0:a.paypalOrderCreate)===null||r===void 0?void 0:r.paypalOrderId;if(i.length||!u){throw new Error(((e=i.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,u]}}))}))};var tn=function(n){return __awaiter(S,[n],void 0,(function(n){var r,e,t,o,i,a;var u=n.checkoutSessionId,c=n.paypalMockResponse;return __generator(this,(function(n){switch(n.label){case 0:return[4,R({checkoutSessionId:u,paypalMockResponse:c})];case 1:t=n.sent(),o=t.errors,i=t.json;a=(r=i===null||i===void 0?void 0:i.paypalOrderCapture.order)===null||r===void 0?void 0:r.id;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||b("An unexpected error occurred when processing PayPal order."))}return[2,a]}}))}))};var on=function(n){var r=n.error;var e;var t=P(r.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var i=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!i){rn.paypalErrorMessage=b("An unexpected error occurred when processing PayPal order.")}var a=i[2]||b("An unexpected error occurred when processing PayPal order.");rn.paypalErrorMessage=a};var an=function(n){var e=n.checkoutSessionId,w=n.onPaypalFail,m=n.onPaypalSessionDone,_=n.overrideBorderRaidus,P=n.overridePrimaryColor;var g=P||r.appearance.colorPrimary;var E="#ffc33a";var O=k({backgroundColor1:E,backgroundColor2:g||""});return{createOrder:function(){return __awaiter(S,void 0,void 0,(function(){var n,r,_,P,k,g,E,O,I,S,A;return __generator(this,(function(x){switch(x.label){case 0:void t({checkoutSessionId:e,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}});if(o()&&!i.accepted){i.showError=true;(n=document.querySelector("zonos-policy-consent"))===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth"});w===null||w===void 0?void 0:w();return[2,""]}r=o();if(r){i.locked=true}_=false;x.label=1;case 1:x.trys.push([1,13,14,15]);return[4,a()];case 2:P=x.sent();if(!P.valid){rn.paypalErrorMessage=P.errorMessage;u.hasPaymentError=false;u.customErrorMessage=null;Q({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}});w===null||w===void 0?void 0:w();return[2,""]}rn.paypalErrorMessage=null;c.inventoryCheckErrorMessage=null;x.label=3;case 3:x.trys.push([3,5,,6]);k=c;return[4,s()];case 4:k.inventoryCheckErrorMessage=x.sent();return[3,6];case 5:g=x.sent();c.inventoryCheckErrorMessage=b("Unable to check inventory. Please try again.");return[3,6];case 6:if(c.inventoryCheckErrorMessage){return[2,""]}E=h();if(!(E>0))return[3,8];return[4,d()];case 7:O=x.sent();if(!O.success){rn.paypalErrorMessage=O.error||b("Unable to apply store credit. Please try again.");w===null||w===void 0?void 0:w();return[2,""]}x.label=8;case 8:return[4,f()];case 9:x.sent();if(!l())return[3,11];return[4,v()];case 10:I=x.sent();if(!I.success){rn.paypalErrorMessage=I.error||b("Unable to place order with store credit. Please try again.");w===null||w===void 0?void 0:w();return[2,""]}m===null||m===void 0?void 0:m({orderId:I.orderId||""});p();y();_=true;return[2,""];case 11:return[4,en({checkoutSessionId:e})];case 12:S=x.sent();_=!!S;return[2,S];case 13:A=x.sent();j("Failed to create paypal order",A);rn.paypalErrorMessage=b("Failed to create PayPal order. Please try again, or consider using an alternative method.");u.hasPaymentError=false;u.customErrorMessage=null;Q({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}});w===null||w===void 0?void 0:w();return[2,""];case 14:if(r&&!_){i.locked=false}return[7];case 15:return[2]}}))}))},onApprove:function(n,r){return __awaiter(S,void 0,void 0,(function(){var n,r;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);rn.paypalErrorMessage=null;Q({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:e,paymentMethod:"paypal"}});return[4,tn({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:n=t.sent();rn.orderIdCreated=n;m===null||m===void 0?void 0:m({orderId:n});p();y();return[3,3];case 2:r=t.sent();j("==== Failed to capture paypal order",r);if(r instanceof Error){return[2,on({error:r})]}w===null||w===void 0?void 0:w();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:_==="SHARP"?0:10,color:O?"gold":"blue",shape:"rect"}}};var un=function(){if(!rn.paypalButtons.length){return}rn.paypalButtons.forEach((function(n){return __awaiter(S,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,n.close()];case 1:r.sent();return[2]}}))}))}));rn.paypalButtons=[]};var cn=n("b",(function(n){return __awaiter(S,[n],void 0,(function(n){var e,t,o,i,a,u;var c=n.currency;return __generator(this,(function(n){switch(n.label){case 0:t=!!((e=r.checkoutSettings.externalPaymentMethods)===null||e===void 0?void 0:e.find((function(n){return n.type==="PAYPAL"&&n.status==="ENABLED"})));if(!t){g("=== Paypal is disabled for this store","warn");return[2]}o=r.checkoutSettings.externalServiceTokens.find((function(n){return n.type==="PAYPAL_CLIENT_ID"}));if(!o){g("Failed to load paypal -- missing paypal publishable key","warn");return[2]}i=(!r.zonosMode||r.zonosMode==="production")&&r.checkoutSettings.mode==="LIVE"?"production":"sandbox";a=r.checkoutSettings.captureDelay&&r.checkoutSettings.captureDelay>0;rn.intent=a?"authorize":"capture";g("==== Paypal order intent","info",rn.intent);u=window.Zonos;return[4,F({clientId:o.token,currency:c,environment:i,intent:rn.intent})];case 1:u.paypal=n.sent();rn.paypal=window.Zonos.paypal;g("==== Paypal script loaded");return[2]}}))}))}));var sn=n("d",(function(n){var r;var e=window.Zonos.paypal;if(!e){g("Paypal is not available");return null}var t=w.checkoutSessionId;if(!t){g("Paypal is not available due to checkoutSessionId is not available");return null}g("==== Loading Paypal buttons");un();var o=[(r=e.FUNDING)===null||r===void 0?void 0:r.PAYPAL].filter(Boolean);rn.paypalButtons=o.map((function(r){var o;var i=null;try{i=((o=e.Buttons)===null||o===void 0?void 0:o.call(e,Object.assign(Object.assign({},an(Object.assign({checkoutSessionId:t,fundingSource:r},n))),{fundingSource:r})))||null}catch(n){g("===== Failed to load paypal's \"".concat(r,'" button'),"warn",n)}if(i===null||i===void 0?void 0:i.isEligible()){g("==== Paypal button ".concat(r," loaded"));return i}return null})).filter(Boolean);return rn.paypalButtons}));var dn=n("p",(function(){var n,e;var t=((e=(n=r.checkoutSettings.externalPaymentMethods)===null||n===void 0?void 0:n.find((function(n){return n.type==="PAYPAL"})))===null||e===void 0?void 0:e.status)==="ENABLED";return t||!!rn.paypalButtons.length}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as o,a as s,g as e,d as a}from"./p-ce75b047.js";import{f as n}from"./p-f3cfd8fa.js";import{c as i}from"./p-b4b7f705.js";import{g as r}from"./p-db3b101a.js";import{b as c,t as h}from"./p-6987f9c9.js";import{s as l}from"./p-adb9827c.js";import{l as p}from"./p-41dd1cb8.js";import{d,e as m}from"./p-84dbf474.js";import{l as y}from"./p-0a377722.js";import"./p-d28be518.js";import"./p-6d81901a.js";import"./p-4c89d04a.js";const f=class{constructor(o){t(this,o),this.borderRadius=6,this.spacing="24px"}render(){const t=this.backgroundColor?`var(--zonos-elements-${this.backgroundColor})`:"transparent",e=r({customRoundRadius:`${this.borderRadius}px`,overrideBorderStyle:"ROUNDED"});return o(s,{key:"ae124207be3fbddbd445d74cdf31085401a09c67",style:{"--zonos--font-family":n()}},o("div",{key:"43fe2ffcb7caa0754c93f6d94898156f5169139b",class:i(["styled-card"]),style:{"--zonos--background-color":t,"--zonos--border-radius":e,padding:this.spacing}},this.label&&o("header",{key:"6839065e2e630a841d6ecd7f03b19a93a988e49a",class:"card-header",style:{padding:this.spacing}},o("zonos-text",{key:"498435bbbb60cc6d1d13a304aad321107bd6feaf",type:"subheader"},this.label),o("h-stack",{key:"4de3f042a72b16be374209b393cb174fc7d1b670",spacing:8},this.actions)),o("slot",{key:"add9dac3d8b9a50c0caa37d245f632c6a5e64d7f"}),(this.footerActions||this.footerContent)&&o("footer",{key:"e83f37ed24b44d9b7316579ee28ea51a3da119d8",class:"card-footer",style:{height:this.footerHeight?`${this.footerHeight}px`:"auto",padding:this.spacing}},o("div",{key:"685721d5f7f51c99438f4ddf23cf75122db3223c"},this.footerContent),o("h-stack",{key:"61a44c918aea4994c10b16045564b45135296852",spacing:8},this.footerActions))))}};f.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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";const z=class{constructor(o){t(this,o),this.theme="LIGHT"}render(){return this.el.shadowRoot?(this.el.shadowRoot.innerHTML="DARK"===this.theme?'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n':'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n',o(s,{class:"zonos--elements",style:{"--zonos--font-family":n(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))):null}get el(){return e(this)}};z.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-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{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}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";const g=class{constructor(o){t(this,o),this.notificationArray=[]}async showNotification(t){const o=`id-${Math.random().toString(36).substring(2,9)}`,s=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=[...this.notificationArray,s],setTimeout((()=>{this.updateTransitionClass({id:o,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(o)}),s.timeout)}updateTransitionClass({id:t,transitionClass:o}){this.notificationArray=this.notificationArray.map((s=>s.id===t?Object.assign(Object.assign({},s),{transitionClass:o}):s))}removeNotification(t){this.updateTransitionClass({id:t,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((o=>o.id!==t))}),300)}render(){return o(s,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:i(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":r(),"--zonos--font-family":n()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((t=>o("div",{"aria-hidden":"true",class:i(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:()=>{this.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))))))}};g.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-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";const b=class{constructor(o){t(this,o),this.stripe=c.stripe,this.stripeElements=c.stripeElements,this.isPaymentInfoFilled=!1,this.trackingSent=!1}watchIsPaymentInfoFilled(){var t;this.isPaymentInfoFilled&&!this.trackingSent&&(h({checkoutSessionId:l.checkoutSessionId,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:null===(t=c.stripePaymentEventData)||void 0===t?void 0:t.value.type}}),this.trackingSent=!0)}async watchInitStripe(){var t;if(!this.stripeElements)return;await this.stripeElements.fetchUpdates();const o=c.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:null===(t=c.stripeAddressEventData)||void 0===t?void 0:t.value.address.country}}},layout:"tabs"}),s=this.el.querySelector(".zonos--payment-component");s?(o.mount(s),o.on("change",(t=>{t.complete&&(this.isPaymentInfoFilled=!0),c.stripePaymentEventData=t})),c.stripePaymentElement=o):p("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return o(s,{key:"6bc25553430c9e23c77a0607ad28dc4c9efa66e6",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"e4ba3f581697a799e50fe066e7cc922a206af8e5",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"0247eecadf083f09b67c5f668da845431234750d",class:"zonos--payment-component"}),o("div",{key:"7f63abd0a2c1cbc62f931e44fc44c69b57a4f8ed",class:"zonos--payment-paypal-container"}))}get el(){return e(this)}static get watchers(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};b.style=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";const x=class{constructor(o){t(this,o),this.paypalSessionDone=a(this,"paypalSessionDone",7),this.paypalSessionFail=a(this,"paypalSessionFail",7),this.storeUnsubscribeList=[]}async loadPaypal(){if(!window.Zonos.paypal)return void y("Paypal is not available");const t=d({onPaypalFail:()=>{y("onPaypalFail"),this.paypalSessionFail.emit()},onPaypalSessionDone:({orderId:t})=>{y("onPaypalSessionDone","info",{orderId:t}),this.paypalSessionDone.emit({orderId:t})}});if(!(null==t?void 0:t.length))return void y("There are no paypal buttons available");const o=this.el.querySelector(".zonos--payment-paypal-container");o?t.forEach((async t=>{await t.render(o)})):y("Cannot find container element for paypal buttons")}componentWillLoad(){this.storeUnsubscribeList=[m("paypal",this.loadPaypal.bind(this))]}componentDidLoad(){this.loadPaypal()}disconnectedCallback(){this.storeUnsubscribeList.forEach((t=>t()))}render(){return o(s,{key:"c01e031b29e0089389be2a16e888bd0b7c24dcd8",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"f03c880bde17291f083cfe1f0db6a918f92d720b",class:"zonos--payment-paypal-container"}))}get el(){return e(this)}};x.style=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";export{f as zonos_card,z as zonos_empty_state_payment,g as zonos_notification,b as zonos_payment,x as zonos_paypal_payment}
|
|
1
|
+
import{r as t,h as o,a as s,g as e,d as a}from"./p-ce75b047.js";import{f as n}from"./p-701d9a7c.js";import{c as i}from"./p-b4b7f705.js";import{g as r}from"./p-3dc3596b.js";import{b as c,t as h}from"./p-bbef037c.js";import{s as l}from"./p-097d7819.js";import{l as p}from"./p-41dd1cb8.js";import{d,e as m}from"./p-cd5444b0.js";import{l as y}from"./p-0a377722.js";import"./p-33d4be28.js";import"./p-cd34ecf2.js";import"./p-896fb969.js";const f=class{constructor(o){t(this,o),this.borderRadius=6,this.spacing="24px"}render(){const t=this.backgroundColor?`var(--zonos-elements-${this.backgroundColor})`:"transparent",e=r({customRoundRadius:`${this.borderRadius}px`,overrideBorderStyle:"ROUNDED"});return o(s,{key:"ae124207be3fbddbd445d74cdf31085401a09c67",style:{"--zonos--font-family":n()}},o("div",{key:"43fe2ffcb7caa0754c93f6d94898156f5169139b",class:i(["styled-card"]),style:{"--zonos--background-color":t,"--zonos--border-radius":e,padding:this.spacing}},this.label&&o("header",{key:"6839065e2e630a841d6ecd7f03b19a93a988e49a",class:"card-header",style:{padding:this.spacing}},o("zonos-text",{key:"498435bbbb60cc6d1d13a304aad321107bd6feaf",type:"subheader"},this.label),o("h-stack",{key:"4de3f042a72b16be374209b393cb174fc7d1b670",spacing:8},this.actions)),o("slot",{key:"add9dac3d8b9a50c0caa37d245f632c6a5e64d7f"}),(this.footerActions||this.footerContent)&&o("footer",{key:"e83f37ed24b44d9b7316579ee28ea51a3da119d8",class:"card-footer",style:{height:this.footerHeight?`${this.footerHeight}px`:"auto",padding:this.spacing}},o("div",{key:"685721d5f7f51c99438f4ddf23cf75122db3223c"},this.footerContent),o("h-stack",{key:"61a44c918aea4994c10b16045564b45135296852",spacing:8},this.footerActions))))}};f.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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";const z=class{constructor(o){t(this,o),this.theme="LIGHT"}render(){return this.el.shadowRoot?(this.el.shadowRoot.innerHTML="DARK"===this.theme?'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n':'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n',o(s,{class:"zonos--elements",style:{"--zonos--font-family":n(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))):null}get el(){return e(this)}};z.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-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{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}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";const g=class{constructor(o){t(this,o),this.notificationArray=[]}async showNotification(t){const o=`id-${Math.random().toString(36).substring(2,9)}`,s=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=[...this.notificationArray,s],setTimeout((()=>{this.updateTransitionClass({id:o,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(o)}),s.timeout)}updateTransitionClass({id:t,transitionClass:o}){this.notificationArray=this.notificationArray.map((s=>s.id===t?Object.assign(Object.assign({},s),{transitionClass:o}):s))}removeNotification(t){this.updateTransitionClass({id:t,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((o=>o.id!==t))}),300)}render(){return o(s,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:i(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":r(),"--zonos--font-family":n()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((t=>o("div",{"aria-hidden":"true",class:i(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:()=>{this.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))))))}};g.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-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";const b=class{constructor(o){t(this,o),this.stripe=c.stripe,this.stripeElements=c.stripeElements,this.isPaymentInfoFilled=!1,this.trackingSent=!1}watchIsPaymentInfoFilled(){var t;this.isPaymentInfoFilled&&!this.trackingSent&&(h({checkoutSessionId:l.checkoutSessionId,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:null===(t=c.stripePaymentEventData)||void 0===t?void 0:t.value.type}}),this.trackingSent=!0)}async watchInitStripe(){var t;if(!this.stripeElements)return;await this.stripeElements.fetchUpdates();const o=c.stripePaymentElement||this.stripeElements.create("payment",{defaultValues:{billingDetails:{address:{country:null===(t=c.stripeAddressEventData)||void 0===t?void 0:t.value.address.country}}},layout:"tabs"}),s=this.el.querySelector(".zonos--payment-component");s?(o.mount(s),o.on("change",(t=>{t.complete&&(this.isPaymentInfoFilled=!0),c.stripePaymentEventData=t})),c.stripePaymentElement=o):p("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return o(s,{key:"6bc25553430c9e23c77a0607ad28dc4c9efa66e6",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"e4ba3f581697a799e50fe066e7cc922a206af8e5",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"0247eecadf083f09b67c5f668da845431234750d",class:"zonos--payment-component"}),o("div",{key:"7f63abd0a2c1cbc62f931e44fc44c69b57a4f8ed",class:"zonos--payment-paypal-container"}))}get el(){return e(this)}static get watchers(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};b.style=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";const x=class{constructor(o){t(this,o),this.paypalSessionDone=a(this,"paypalSessionDone",7),this.paypalSessionFail=a(this,"paypalSessionFail",7),this.storeUnsubscribeList=[]}async loadPaypal(){if(!window.Zonos.paypal)return void y("Paypal is not available");const t=d({onPaypalFail:()=>{y("onPaypalFail"),this.paypalSessionFail.emit()},onPaypalSessionDone:({orderId:t})=>{y("onPaypalSessionDone","info",{orderId:t}),this.paypalSessionDone.emit({orderId:t})}});if(!(null==t?void 0:t.length))return void y("There are no paypal buttons available");const o=this.el.querySelector(".zonos--payment-paypal-container");o?t.forEach((async t=>{await t.render(o)})):y("Cannot find container element for paypal buttons")}componentWillLoad(){this.storeUnsubscribeList=[m("paypal",this.loadPaypal.bind(this))]}componentDidLoad(){this.loadPaypal()}disconnectedCallback(){this.storeUnsubscribeList.forEach((t=>t()))}render(){return o(s,{key:"c01e031b29e0089389be2a16e888bd0b7c24dcd8",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"f03c880bde17291f083cfe1f0db6a918f92d720b",class:"zonos--payment-paypal-container"}))}get el(){return e(this)}};x.style=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";export{f as zonos_card,z as zonos_empty_state_payment,g as zonos_notification,b as zonos_payment,x as zonos_paypal_payment}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-f053975e.system.js","./p-3e7ee89d.system.js"],(function(t){"use strict";var e,n;return{setters:[function(t){e=t.d},function(t){n=t.d}],execute:function(){var i=e,r=n;var u="Expected a function";function a(t,e,n){var a=true,f=true;if(typeof t!="function"){throw new TypeError(u)}if(r(n)){a="leading"in n?!!n.leading:a;f="trailing"in n?!!n.trailing:f}return i(t,e,{leading:a,maxWait:e,trailing:f})}var f=t("t",a)}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as t,a as s}from"./p-ce75b047.js";import{d as e}from"./p-
|
|
1
|
+
import{r as o,h as t,a as s}from"./p-ce75b047.js";import{d as e}from"./p-bbef037c.js";import{t as n}from"./p-097d7819.js";import{r as i}from"./p-d437bc28.js";import{c as a}from"./p-b4b7f705.js";import{c as l}from"./p-44147850.js";import{r as c}from"./p-1b8771bb.js";import"./p-701d9a7c.js";import"./p-0a377722.js";import"./p-41dd1cb8.js";import"./p-33d4be28.js";import"./p-3dc3596b.js";const r=class{constructor(t){o(this,t),this.isMobile=!1,this.errorImages=[],this.locale=null}componentWillLoad(){const o=navigator.language;this.locale=o}render(){const o=e.items.filter((o=>!o.isRestricted));return t(s,{key:"55bb132970db23e06698701d7d27e108ff0643e0",class:a(["zonos--invoice-cart-items zonos--elements",this.isMobile&&"mobile"])},t("table",{key:"c9722c17a507ca9fdcb8ca47151d14ba1d74f698",class:"zonos--cart-table"},t("tbody",{key:"d8d318e03bfeefaf687825c6131367e73c0b91ce"},o.map((o=>{var s,e,a,l;const c=null===(e=null===(s=o.attributes)||void 0===s?void 0:s.find((o=>"invoiceId"===o.key||"INVOICE_ID"===o.key)))||void 0===e?void 0:e.value,r=null===(l=null===(a=o.attributes)||void 0===a?void 0:a.find((o=>"invoiceCreatedAt"===o.key)))||void 0===l?void 0:l.value,h=r&&this.locale?new Date(r).toLocaleDateString(this.locale,{day:"numeric",month:"long",year:"numeric"}):null,d=c?`https://dashboard.zonos.com/billing/invoices/${c}`:null;return t("tr",{class:"zonos--invoice-cart-item"},t("td",{class:"zonos--column zonos--cart-item-title"},t("zonos-text",{type:"semiBoldLabel"},n("Invoice:"))),t("td",{class:"zonos--column zonos--cart-item-link"},d&&c&&t("zonos-link",{href:d},c),this.isMobile&&t("zonos-text",{type:"caption"},h)),t("td",{class:"zonos--column zonos--cart-item-created-at"},!this.isMobile&&t("zonos-text",{type:"label"},h)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"label"},i({amount:o.amount,isForeign:!1}))))})))))}static get assetsDirs(){return["assets"]}};r.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:last-child{text-align:right;padding-right:0}:host .zonos--cart-table .zonos--column:first-child{padding-left:0;width:50px}:host .zonos--cart-table .zonos--cart-item-link{text-align:left}:host .zonos--cart-table .zonos--cart-item-created-at{text-align:right}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host(.mobile) table{margin-top:16px}:host(.mobile) table td{vertical-align:top}";const h=class{constructor(t){o(this,t),this.isMobile=!1}render(){return t(s,{key:"a8d7a91a69c2ea3aeee0788f4d9523e1e65915eb",class:a(["zonos--invoice-subtotal zonos--elements",this.isMobile&&"mobile"])},t("table",{key:"fb299d6ea07b48c099fca14e0c16369bf7b93955",class:"zonos--invoice-table"},t("tr",{key:"5b01748b535af171bed832076fcfeb5308279808",class:"zonos--row zonos--invoice-total"},t("td",{key:"829797e7d5560c6f73b661cdc53b473c57c7ad2f",class:"zonos--column"}),t("td",{key:"cc75308e6470b4fa12182001467e7d2ca7915405",class:"zonos--column zonos--invoice-subtotal-title"},t("zonos-text",{key:"38c9de7d3393a999bc06a7bafe033aefa45ead5c",type:"semiBoldLabel"},n("Payment total"))),t("td",{key:"962069d60839b82e374d3c4aae3b2a6709a82017",class:"zonos--column zonos--invoice-subtotal-price"},c({content:t("zonos-text",{type:"semiBoldLabel"},i({amount:l.amountTotalDue||0,isForeign:!0})),isLoading:l.isFetchingPayorInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};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{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--invoice-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--invoice-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--invoice-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--invoice-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--invoice-subtotal-price{text-align:right}:host .zonos--invoice-subtotal-price zonos-text{white-space:nowrap}:host .zonos--invoice-total .zonos--column{padding:16px 0}:host .zonos--invoice-total .zonos--invoice-subtotal-title,:host .zonos--invoice-total .zonos--invoice-subtotal-price{border-top:1px solid var(--zonos-elements-gray-200)}:host .zonos--invoice-subtotal-price zonos-text,:host .zonos--invoice-pay-total zonos-text{white-space:nowrap}:host(.mobile){position:relative;bottom:0}";export{r as zonos_invoice_cart_items,h as zonos_invoice_subtotal}
|