@odus/checkout 1.5.2 → 1.7.0
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/api/createApplePaySession.mutation.d.ts +9 -0
- package/dist/api/createApplePaySession.mutation.d.ts.map +1 -0
- package/dist/api/getCheckoutDetails.query.d.ts +18 -0
- package/dist/api/getCheckoutDetails.query.d.ts.map +1 -0
- package/dist/api/getSupportedPaymentMethods.query.d.ts +7 -0
- package/dist/api/getSupportedPaymentMethods.query.d.ts.map +1 -0
- package/dist/checkout.es.js +65 -65
- package/dist/components/Component.d.ts +70 -0
- package/dist/components/Component.d.ts.map +1 -0
- package/dist/components/ComponentFactory.d.ts +48 -0
- package/dist/components/ComponentFactory.d.ts.map +1 -0
- package/dist/components/checkout/card-elements/CardCvvElement.d.ts +28 -0
- package/dist/components/checkout/card-elements/CardCvvElement.d.ts.map +1 -0
- package/dist/components/checkout/card-elements/CardNumberElement.d.ts +32 -0
- package/dist/components/checkout/card-elements/CardNumberElement.d.ts.map +1 -0
- package/dist/components/checkout/card-elements/index.d.ts +3 -0
- package/dist/components/checkout/card-elements/index.d.ts.map +1 -0
- package/dist/components/checkout/form/AddressSection.d.ts +53 -0
- package/dist/components/checkout/form/AddressSection.d.ts.map +1 -0
- package/dist/components/checkout/form/CardSection.d.ts +113 -0
- package/dist/components/checkout/form/CardSection.d.ts.map +1 -0
- package/dist/components/checkout/form/CardholderSection.d.ts +42 -0
- package/dist/components/checkout/form/CardholderSection.d.ts.map +1 -0
- package/dist/components/checkout/form/EmailField.d.ts +27 -0
- package/dist/components/checkout/form/EmailField.d.ts.map +1 -0
- package/dist/components/checkout/form/Form.d.ts +88 -0
- package/dist/components/checkout/form/Form.d.ts.map +1 -0
- package/dist/components/checkout/form/FormComponentManager.d.ts +116 -0
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -0
- package/dist/components/checkout/form/FormEventHandler.d.ts +34 -0
- package/dist/components/checkout/form/FormEventHandler.d.ts.map +1 -0
- package/dist/components/checkout/form/FormStateCoordinator.d.ts +60 -0
- package/dist/components/checkout/form/FormStateCoordinator.d.ts.map +1 -0
- package/dist/components/checkout/form/FormUIManager.d.ts +34 -0
- package/dist/components/checkout/form/FormUIManager.d.ts.map +1 -0
- package/dist/components/checkout/form/PaymentMethods.d.ts +42 -0
- package/dist/components/checkout/form/PaymentMethods.d.ts.map +1 -0
- package/dist/components/checkout/form/PaymentSeparator.d.ts +11 -0
- package/dist/components/checkout/form/PaymentSeparator.d.ts.map +1 -0
- package/dist/components/checkout/form/PhoneCountrySelector.d.ts +25 -0
- package/dist/components/checkout/form/PhoneCountrySelector.d.ts.map +1 -0
- package/dist/components/checkout/form/PhoneNumberField.d.ts +51 -0
- package/dist/components/checkout/form/PhoneNumberField.d.ts.map +1 -0
- package/dist/components/checkout/form/SubmitButton.d.ts +16 -0
- package/dist/components/checkout/form/SubmitButton.d.ts.map +1 -0
- package/dist/components/checkout/form/index.d.ts +10 -0
- package/dist/components/checkout/form/index.d.ts.map +1 -0
- package/dist/components/checkout/index.d.ts +2 -0
- package/dist/components/checkout/index.d.ts.map +1 -0
- package/dist/components/common/Alert.d.ts +12 -0
- package/dist/components/common/Alert.d.ts.map +1 -0
- package/dist/components/common/Button.d.ts +24 -0
- package/dist/components/common/Button.d.ts.map +1 -0
- package/dist/components/common/CountryDialCodeDropdown.d.ts +45 -0
- package/dist/components/common/CountryDialCodeDropdown.d.ts.map +1 -0
- package/dist/components/common/FormSkeleton.d.ts +8 -0
- package/dist/components/common/FormSkeleton.d.ts.map +1 -0
- package/dist/components/common/HelperText.d.ts +15 -0
- package/dist/components/common/HelperText.d.ts.map +1 -0
- package/dist/components/common/Input.d.ts +37 -0
- package/dist/components/common/Input.d.ts.map +1 -0
- package/dist/components/common/InputLabel.d.ts +15 -0
- package/dist/components/common/InputLabel.d.ts.map +1 -0
- package/dist/components/common/Select.d.ts +54 -0
- package/dist/components/common/Select.d.ts.map +1 -0
- package/dist/components/common/Spinner.d.ts +11 -0
- package/dist/components/common/Spinner.d.ts.map +1 -0
- package/dist/components/common/index.d.ts +8 -0
- package/dist/components/common/index.d.ts.map +1 -0
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts +43 -0
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts.map +1 -0
- package/dist/components/payment-methods/index.d.ts +3 -0
- package/dist/components/payment-methods/index.d.ts.map +1 -0
- package/dist/components/payment-methods/paypal/PaypalButton.d.ts +21 -0
- package/dist/components/payment-methods/paypal/PaypalButton.d.ts.map +1 -0
- package/dist/core/api/CheckoutAPI.service.d.ts +36 -0
- package/dist/core/api/CheckoutAPI.service.d.ts.map +1 -0
- package/dist/core/constants/emailDomains.constant.d.ts +2 -0
- package/dist/core/constants/emailDomains.constant.d.ts.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/state/CheckoutState.service.d.ts +13 -0
- package/dist/core/state/CheckoutState.service.d.ts.map +1 -0
- package/dist/core/validation/index.d.ts +2 -0
- package/dist/core/validation/index.d.ts.map +1 -0
- package/dist/core/vgs/VGSCollectService.d.ts +102 -0
- package/dist/core/vgs/VGSCollectService.d.ts.map +1 -0
- package/dist/core/vgs/index.d.ts +4 -0
- package/dist/core/vgs/index.d.ts.map +1 -0
- package/dist/core/vgs/vgs.constants.d.ts +4 -0
- package/dist/core/vgs/vgs.constants.d.ts.map +1 -0
- package/dist/core/vgs/vgsFieldErrors.d.ts +8 -0
- package/dist/core/vgs/vgsFieldErrors.d.ts.map +1 -0
- package/dist/elements/AddressCityElement.d.ts +12 -0
- package/dist/elements/AddressCityElement.d.ts.map +1 -0
- package/dist/elements/AddressCountryElement.d.ts +14 -0
- package/dist/elements/AddressCountryElement.d.ts.map +1 -0
- package/dist/elements/AddressFirstNameElement.d.ts +12 -0
- package/dist/elements/AddressFirstNameElement.d.ts.map +1 -0
- package/dist/elements/AddressLastNameElement.d.ts +12 -0
- package/dist/elements/AddressLastNameElement.d.ts.map +1 -0
- package/dist/elements/AddressStateElement.d.ts +16 -0
- package/dist/elements/AddressStateElement.d.ts.map +1 -0
- package/dist/elements/AddressStreetElement.d.ts +12 -0
- package/dist/elements/AddressStreetElement.d.ts.map +1 -0
- package/dist/elements/AddressZipCodeElement.d.ts +12 -0
- package/dist/elements/AddressZipCodeElement.d.ts.map +1 -0
- package/dist/elements/ApplePayElement.d.ts +41 -0
- package/dist/elements/ApplePayElement.d.ts.map +1 -0
- package/dist/elements/BaseElement.d.ts +28 -0
- package/dist/elements/BaseElement.d.ts.map +1 -0
- package/dist/elements/CardElement.d.ts +32 -0
- package/dist/elements/CardElement.d.ts.map +1 -0
- package/dist/elements/CardholderElement.d.ts +12 -0
- package/dist/elements/CardholderElement.d.ts.map +1 -0
- package/dist/elements/EmailElement.d.ts +12 -0
- package/dist/elements/EmailElement.d.ts.map +1 -0
- package/dist/elements/ErrorElement.d.ts +13 -0
- package/dist/elements/ErrorElement.d.ts.map +1 -0
- package/dist/elements/OdusElements.d.ts +79 -0
- package/dist/elements/OdusElements.d.ts.map +1 -0
- package/dist/elements/PayPalElement.d.ts +17 -0
- package/dist/elements/PayPalElement.d.ts.map +1 -0
- package/dist/elements/PhoneElement.d.ts +13 -0
- package/dist/elements/PhoneElement.d.ts.map +1 -0
- package/dist/elements/card/NativeCardAdapter.d.ts +35 -0
- package/dist/elements/card/NativeCardAdapter.d.ts.map +1 -0
- package/dist/elements/card/VgsCardAdapter.d.ts +31 -0
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -0
- package/dist/elements/cardElement.constants.d.ts +5 -0
- package/dist/elements/cardElement.constants.d.ts.map +1 -0
- package/dist/elements/index.d.ts +19 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/theme/index.d.ts +26 -0
- package/dist/elements/theme/index.d.ts.map +1 -0
- package/dist/elements/types/CardPayload.type.d.ts +13 -0
- package/dist/elements/types/CardPayload.type.d.ts.map +1 -0
- package/dist/elements/types/index.d.ts +65 -0
- package/dist/elements/types/index.d.ts.map +1 -0
- package/dist/elements.es.js +278 -223
- package/dist/factories/createCheckoutProfile.d.ts +25 -0
- package/dist/factories/createCheckoutProfile.d.ts.map +1 -0
- package/dist/factories/createForm.d.ts +21 -0
- package/dist/factories/createForm.d.ts.map +1 -0
- package/dist/factories/createTranslation.d.ts +13 -0
- package/dist/factories/createTranslation.d.ts.map +1 -0
- package/dist/factories/index.d.ts +4 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/locales/cs.json.d.ts +77 -0
- package/dist/locales/de.json.d.ts +77 -0
- package/dist/locales/en.json.d.ts +77 -0
- package/dist/locales/es.json.d.ts +77 -0
- package/dist/locales/fr.json.d.ts +77 -0
- package/dist/locales/it.json.d.ts +77 -0
- package/dist/locales/nl.json.d.ts +77 -0
- package/dist/locales/pl.json.d.ts +77 -0
- package/dist/locales/pt.json.d.ts +77 -0
- package/dist/locales/sk.json.d.ts +77 -0
- package/dist/locales/tr.json.d.ts +77 -0
- package/dist/package.json +2 -2
- package/dist/phone.js +808 -786
- package/dist/services/checkout/Checkout.service.d.ts +30 -0
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -0
- package/dist/services/checkout/CheckoutAPI.service.d.ts +2 -0
- package/dist/services/checkout/CheckoutAPI.service.d.ts.map +1 -0
- package/dist/services/checkout/CheckoutForm.service.d.ts +53 -0
- package/dist/services/checkout/CheckoutForm.service.d.ts.map +1 -0
- package/dist/services/checkout/CheckoutState.service.d.ts +2 -0
- package/dist/services/checkout/CheckoutState.service.d.ts.map +1 -0
- package/dist/services/i18n/Translation.service.d.ts +15 -0
- package/dist/services/i18n/Translation.service.d.ts.map +1 -0
- package/dist/services/telemetry/Telemetry.service.d.ts +15 -0
- package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -0
- package/dist/shared.js +27 -24
- package/dist/state/EventBus.d.ts +33 -0
- package/dist/state/EventBus.d.ts.map +1 -0
- package/dist/state/Store.d.ts +42 -0
- package/dist/state/Store.d.ts.map +1 -0
- package/dist/state/TranslationStore.d.ts +28 -0
- package/dist/state/TranslationStore.d.ts.map +1 -0
- package/dist/state/index.d.ts +4 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/types/api/ApiError.type.d.ts +7 -0
- package/dist/types/api/ApiError.type.d.ts.map +1 -0
- package/dist/types/checkout/CheckoutCallback.type.d.ts +8 -0
- package/dist/types/checkout/CheckoutCallback.type.d.ts.map +1 -0
- package/dist/types/checkout/CheckoutConfig.type.d.ts +128 -0
- package/dist/types/checkout/CheckoutConfig.type.d.ts.map +1 -0
- package/dist/types/checkout/CheckoutInstance.type.d.ts +16 -0
- package/dist/types/checkout/CheckoutInstance.type.d.ts.map +1 -0
- package/dist/types/checkout/CheckoutProfile.type.d.ts +77 -0
- package/dist/types/checkout/CheckoutProfile.type.d.ts.map +1 -0
- package/dist/types/checkout/CheckoutState.type.d.ts +5 -0
- package/dist/types/checkout/CheckoutState.type.d.ts.map +1 -0
- package/dist/types/common/FormData.type.d.ts +42 -0
- package/dist/types/common/FormData.type.d.ts.map +1 -0
- package/dist/types/common/FormErrors.type.d.ts +9 -0
- package/dist/types/common/FormErrors.type.d.ts.map +1 -0
- package/dist/types/common/FormTouched.type.d.ts +9 -0
- package/dist/types/common/FormTouched.type.d.ts.map +1 -0
- package/dist/types/common/Locale.type.d.ts +2 -0
- package/dist/types/common/Locale.type.d.ts.map +1 -0
- package/dist/types/common/createIframeConfig.type.d.ts +2 -0
- package/dist/types/common/createIframeConfig.type.d.ts.map +1 -0
- package/dist/types/payment/CardType.type.d.ts +2 -0
- package/dist/types/payment/CardType.type.d.ts.map +1 -0
- package/dist/types/payment/Payment.type.d.ts +126 -0
- package/dist/types/payment/Payment.type.d.ts.map +1 -0
- package/dist/types/payment/PaymentMethod.type.d.ts +15 -0
- package/dist/types/payment/PaymentMethod.type.d.ts.map +1 -0
- package/dist/types/payment/PaymentResult.type.d.ts +2 -0
- package/dist/types/payment/PaymentResult.type.d.ts.map +1 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +62 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -0
- package/dist/utils/applePay/isApplePayAvailable.util.d.ts +2 -0
- package/dist/utils/applePay/isApplePayAvailable.util.d.ts.map +1 -0
- package/dist/utils/card/detectCardBrand.d.ts +3 -0
- package/dist/utils/card/detectCardBrand.d.ts.map +1 -0
- package/dist/utils/card/luhnCheck.d.ts +7 -0
- package/dist/utils/card/luhnCheck.d.ts.map +1 -0
- package/dist/utils/country/countryNames.d.ts +36 -0
- package/dist/utils/country/countryNames.d.ts.map +1 -0
- package/dist/utils/dom/appendGoogleFont.d.ts +7 -0
- package/dist/utils/dom/appendGoogleFont.d.ts.map +1 -0
- package/dist/utils/dom/createSyntheticEvent.util.d.ts +12 -0
- package/dist/utils/dom/createSyntheticEvent.util.d.ts.map +1 -0
- package/dist/utils/dom/fetchGoogleFontFace.d.ts +2 -0
- package/dist/utils/dom/fetchGoogleFontFace.d.ts.map +1 -0
- package/dist/utils/dom/index.d.ts +5 -0
- package/dist/utils/dom/index.d.ts.map +1 -0
- package/dist/utils/dom/restoreCursorAfterFormat.util.d.ts +2 -0
- package/dist/utils/dom/restoreCursorAfterFormat.util.d.ts.map +1 -0
- package/dist/utils/focus/FocusManager.d.ts +57 -0
- package/dist/utils/focus/FocusManager.d.ts.map +1 -0
- package/dist/utils/focus/index.d.ts +2 -0
- package/dist/utils/focus/index.d.ts.map +1 -0
- package/dist/utils/formatters/formatters.d.ts +6 -0
- package/dist/utils/formatters/formatters.d.ts.map +1 -0
- package/dist/utils/helpers/checkForMissingDot.util.d.ts +2 -0
- package/dist/utils/helpers/checkForMissingDot.util.d.ts.map +1 -0
- package/dist/utils/helpers/environments/getBaseUrl.dev.d.ts +2 -0
- package/dist/utils/helpers/environments/getBaseUrl.dev.d.ts.map +1 -0
- package/dist/utils/helpers/environments/getBaseUrl.prod.d.ts +3 -0
- package/dist/utils/helpers/environments/getBaseUrl.prod.d.ts.map +1 -0
- package/dist/utils/helpers/findSimilarDomains.util.d.ts +2 -0
- package/dist/utils/helpers/findSimilarDomains.util.d.ts.map +1 -0
- package/dist/utils/helpers/getBaseUrl.util.d.ts +3 -0
- package/dist/utils/helpers/getBaseUrl.util.d.ts.map +1 -0
- package/dist/utils/helpers/getTelemetryUrl.util.d.ts +3 -0
- package/dist/utils/helpers/getTelemetryUrl.util.d.ts.map +1 -0
- package/dist/utils/helpers/hasAddressConfiguration.util.d.ts +10 -0
- package/dist/utils/helpers/hasAddressConfiguration.util.d.ts.map +1 -0
- package/dist/utils/helpers/isLocalhost.util.d.ts +2 -0
- package/dist/utils/helpers/isLocalhost.util.d.ts.map +1 -0
- package/dist/utils/helpers/levenshteinDistance.util.d.ts +2 -0
- package/dist/utils/helpers/levenshteinDistance.util.d.ts.map +1 -0
- package/dist/utils/helpers/styleUtils.d.ts +20 -0
- package/dist/utils/helpers/styleUtils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/phone/countryDialCodes.d.ts +23 -0
- package/dist/utils/phone/countryDialCodes.d.ts.map +1 -0
- package/dist/utils/phone/lazyPhoneModule.d.ts +6 -0
- package/dist/utils/phone/lazyPhoneModule.d.ts.map +1 -0
- package/dist/utils/phone/phoneBundle.d.ts +4 -0
- package/dist/utils/phone/phoneBundle.d.ts.map +1 -0
- package/dist/utils/phone/phoneFormatter.d.ts +32 -0
- package/dist/utils/phone/phoneFormatter.d.ts.map +1 -0
- package/dist/utils/state/stateNames.d.ts +20 -0
- package/dist/utils/state/stateNames.d.ts.map +1 -0
- package/dist/utils/validation/createValidationSchema.d.ts +21 -0
- package/dist/utils/validation/createValidationSchema.d.ts.map +1 -0
- package/dist/utils/validation/emailValidator.d.ts +15 -0
- package/dist/utils/validation/emailValidator.d.ts.map +1 -0
- package/dist/utils/validation/index.d.ts +3 -0
- package/dist/utils/validation/index.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/elements.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as e, C as t, F as n, J as r, L as i, P as a, R as o, S as s, a as c, b as l, c as u, h as d, i as f, l as p, m, n as h, o as g, r as _, t as v, u as y, w as b, y as x, z as ee } from "./shared.js";
|
|
2
2
|
//#region libs/checkout/src/assets/styles/helperText.css?inline
|
|
3
|
-
var
|
|
3
|
+
var S = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inherit);max-height:100px;margin-top:4px;font-size:12px;font-weight:500;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out;display:block;overflow:hidden}.form-helper-text-hidden{opacity:0;max-height:0;margin-top:0;overflow:hidden}", C = ".input-wrapper{box-sizing:border-box;flex-direction:column;align-items:stretch;width:100%;min-width:0;display:flex}.input-wrapper *{box-sizing:border-box}.form-input{opacity:1;font-size:var(--odus-input-font-size,16px);font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input[name=cardNumber]{padding-right:100px}.form-input-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", w = ".input-label{font-family:var(--odus-font-family,inherit);font-size:var(--odus-label-font-size,14px);font-weight:var(--odus-label-font-weight,400);color:var(--odus-label-color,var(--odus-color-text,#1a1a1a));letter-spacing:var(--odus-label-letter-spacing,normal);line-height:var(--odus-label-line-height,1.4);margin-bottom:var(--odus-label-margin-bottom,6px)}", T = ":host{--odus-font-family:system-ui, sans-serif;--odus-font-size:16px;--odus-color-error:#dc2727;--odus-color-text:#1a1a1a;--odus-color-background:#fff;--odus-border-color:#e0e0e0;--odus-border-radius:6px;--odus-spacing-sm:8px;--odus-spacing-md:16px;--odus-spacing-lg:24px;--odus-input-height:44px;--odus-input-padding:8px 12px;--odus-input-font-size:var(--odus-font-size);--odus-input-font-weight:400;--odus-input-letter-spacing:.02em;--odus-input-line-height:1.5;--odus-input-placeholder-color:#717173;--odus-input-placeholder-opacity:.3;--odus-input-focus-shadow:0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d;--odus-label-font-size:14px;--odus-label-font-weight:400;--odus-label-color:var(--odus-color-text);--odus-label-letter-spacing:normal;--odus-label-line-height:1.4;--odus-label-margin-bottom:6px;--odus-card-gap:12px;--odus-button-height:48px;--odus-button-border-radius:var(--odus-border-radius)}.form-input{opacity:1;font-weight:var(--odus-input-font-weight,400);letter-spacing:var(--odus-input-letter-spacing,.02em);box-shadow:0 0 0 1px var(--odus-border-color,#e0e0e0), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d;background:var(--odus-color-background,#fff);padding:var(--odus-input-padding,8px 12px);line-height:var(--odus-input-line-height,1.5);z-index:0;box-sizing:border-box;border:none;outline:none;flex:1;width:100%;min-height:0;transition:box-shadow .1s ease-in,border-radius .2s ease-in}.form-input::placeholder{color:var(--odus-input-placeholder-color,#717173);opacity:var(--odus-input-placeholder-opacity,.3)}.form-input:focus{box-shadow:var(--odus-input-focus-shadow,0 0 0 1px #3297d3b3, 0 1px 1px 0 #00000012, 0 0 0 4px #3297d34d);z-index:2;position:relative}.input-label{font-family:var(--odus-font-family,inherit)!important;font-size:var(--odus-label-font-size,14px)!important;font-weight:var(--odus-label-font-weight,400)!important;color:var(--odus-label-color,var(--odus-color-text,#1a1a1a))!important;letter-spacing:var(--odus-label-letter-spacing,normal)!important;line-height:var(--odus-label-line-height,1.4)!important;margin-bottom:var(--odus-label-margin-bottom,6px)!important}.form-helper-text{font-family:var(--odus-font-family,inherit)!important}", E = class {
|
|
4
4
|
shadowRoot = null;
|
|
5
5
|
host = null;
|
|
6
6
|
options = {};
|
|
@@ -64,36 +64,36 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
64
64
|
this.options.callbacks?.[e]?.(t);
|
|
65
65
|
}
|
|
66
66
|
getCss() {
|
|
67
|
-
return
|
|
67
|
+
return T;
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, D = class extends E {
|
|
70
70
|
_value = "";
|
|
71
71
|
_error = null;
|
|
72
72
|
_input = null;
|
|
73
73
|
render() {
|
|
74
74
|
if (!this.shadowRoot) return;
|
|
75
75
|
this._input?.getElement().remove();
|
|
76
|
-
let { t: e } =
|
|
77
|
-
this._input = new
|
|
76
|
+
let { t: e } = t();
|
|
77
|
+
this._input = new y({
|
|
78
78
|
name: "billingAddress.city",
|
|
79
|
-
label: e("address.townCity"),
|
|
79
|
+
label: this.options.label ?? e("address.townCity"),
|
|
80
80
|
error: !1,
|
|
81
|
-
placeholder: e("address.placeholder.city"),
|
|
81
|
+
placeholder: this.options.placeholder ?? e("address.placeholder.city"),
|
|
82
82
|
value: this._value,
|
|
83
83
|
autocomplete: "address-level2",
|
|
84
84
|
onChange: (e) => {
|
|
85
85
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
86
86
|
}
|
|
87
87
|
}), this._input.addEventListener("blur", () => {
|
|
88
|
-
let { t: e } =
|
|
88
|
+
let { t: e } = t();
|
|
89
89
|
this._error = this._value.trim() ? null : e("validation.townCityRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
90
90
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
91
91
|
}
|
|
92
92
|
getCss() {
|
|
93
93
|
return super.getCss() + [
|
|
94
|
-
S,
|
|
95
94
|
C,
|
|
96
|
-
|
|
95
|
+
w,
|
|
96
|
+
S
|
|
97
97
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
98
98
|
}
|
|
99
99
|
getValue() {
|
|
@@ -105,7 +105,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
105
105
|
getError() {
|
|
106
106
|
return this._error;
|
|
107
107
|
}
|
|
108
|
-
},
|
|
108
|
+
}, O = ".form-select{opacity:1;letter-spacing:.02em;padding:var(--odus-input-padding,8px 12px);z-index:0;box-sizing:border-box;cursor:pointer;appearance:none;background:#fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23717173' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") right 12px center no-repeat;border:none;outline:none;flex:1;width:100%;min-height:0;padding-right:32px;font-weight:400;line-height:1.5;transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.form-select-error{box-shadow:0 0 0 1px var(--odus-color-error,#dc2727), 0 2px 4px 0 #00000012, 0 1px 1.5px 0 #0000000d}.form-select-placeholder{color:#d4d4d5}.form-select option[disabled]{color:#717173;opacity:.5}.form-select:focus{z-index:2;position:relative;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}", k = class extends E {
|
|
109
109
|
_value = "";
|
|
110
110
|
_error = null;
|
|
111
111
|
_select = null;
|
|
@@ -116,28 +116,28 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
116
116
|
render() {
|
|
117
117
|
if (!this.shadowRoot) return;
|
|
118
118
|
this._select?.getElement().remove(), this.options.initialValue && !this._value && (this._value = String(this.options.initialValue), this.emit("change", this._value));
|
|
119
|
-
let { t: e, locale:
|
|
120
|
-
this._select = new
|
|
119
|
+
let { t: e, locale: n } = t();
|
|
120
|
+
this._select = new p({
|
|
121
121
|
name: "billingAddress.country",
|
|
122
|
-
label: e("address.chooseCountry"),
|
|
122
|
+
label: this.options.label ?? e("address.chooseCountry"),
|
|
123
123
|
error: !1,
|
|
124
|
-
placeholder: e("address.chooseCountry"),
|
|
124
|
+
placeholder: this.options.placeholder ?? e("address.chooseCountry"),
|
|
125
125
|
value: this._value,
|
|
126
|
-
options: d(this._allowedCountries,
|
|
126
|
+
options: d(this._allowedCountries, n),
|
|
127
127
|
autocomplete: "country",
|
|
128
128
|
onChange: (e) => {
|
|
129
129
|
this._value = e.target.value, this._error = null, this.emit("change", this._value);
|
|
130
130
|
}
|
|
131
131
|
}), this._select.addEventListener("blur", () => {
|
|
132
|
-
let { t: e } =
|
|
132
|
+
let { t: e } = t();
|
|
133
133
|
this._error = this._value ? null : e("validation.countryRequired"), this._select?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
134
134
|
}), this.shadowRoot.appendChild(this._select.getElement());
|
|
135
135
|
}
|
|
136
136
|
getCss() {
|
|
137
137
|
return super.getCss() + [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
w,
|
|
139
|
+
S,
|
|
140
|
+
O
|
|
141
141
|
].join("\n") + "\n :host { display: block; }\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-select-error {\n color: var(--odus-color-error, #dc2727) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
142
142
|
}
|
|
143
143
|
getValue() {
|
|
@@ -149,34 +149,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
149
149
|
getError() {
|
|
150
150
|
return this._error;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, A = class extends E {
|
|
153
153
|
_value = "";
|
|
154
154
|
_error = null;
|
|
155
155
|
_input = null;
|
|
156
156
|
render() {
|
|
157
157
|
if (!this.shadowRoot) return;
|
|
158
158
|
this._input?.getElement().remove();
|
|
159
|
-
let { t: e } =
|
|
160
|
-
this._input = new
|
|
159
|
+
let { t: e } = t();
|
|
160
|
+
this._input = new y({
|
|
161
161
|
name: "billingAddress.firstName",
|
|
162
|
-
label: e("address.firstName"),
|
|
162
|
+
label: this.options.label ?? e("address.firstName"),
|
|
163
163
|
error: !1,
|
|
164
|
-
placeholder: e("address.placeholder.firstName"),
|
|
164
|
+
placeholder: this.options.placeholder ?? e("address.placeholder.firstName"),
|
|
165
165
|
value: this._value,
|
|
166
166
|
autocomplete: "given-name",
|
|
167
167
|
onChange: (e) => {
|
|
168
168
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
169
169
|
}
|
|
170
170
|
}), this._input.addEventListener("blur", () => {
|
|
171
|
-
let { t: e } =
|
|
171
|
+
let { t: e } = t();
|
|
172
172
|
this._error = this._value.trim() ? null : e("validation.firstNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
173
173
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
174
174
|
}
|
|
175
175
|
getCss() {
|
|
176
176
|
return super.getCss() + [
|
|
177
|
-
S,
|
|
178
177
|
C,
|
|
179
|
-
|
|
178
|
+
w,
|
|
179
|
+
S
|
|
180
180
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
181
181
|
}
|
|
182
182
|
getValue() {
|
|
@@ -188,34 +188,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
188
188
|
getError() {
|
|
189
189
|
return this._error;
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, j = class extends E {
|
|
192
192
|
_value = "";
|
|
193
193
|
_error = null;
|
|
194
194
|
_input = null;
|
|
195
195
|
render() {
|
|
196
196
|
if (!this.shadowRoot) return;
|
|
197
197
|
this._input?.getElement().remove();
|
|
198
|
-
let { t: e } =
|
|
199
|
-
this._input = new
|
|
198
|
+
let { t: e } = t();
|
|
199
|
+
this._input = new y({
|
|
200
200
|
name: "billingAddress.lastName",
|
|
201
|
-
label: e("address.lastName"),
|
|
201
|
+
label: this.options.label ?? e("address.lastName"),
|
|
202
202
|
error: !1,
|
|
203
|
-
placeholder: e("address.placeholder.lastName"),
|
|
203
|
+
placeholder: this.options.placeholder ?? e("address.placeholder.lastName"),
|
|
204
204
|
value: this._value,
|
|
205
205
|
autocomplete: "family-name",
|
|
206
206
|
onChange: (e) => {
|
|
207
207
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
208
208
|
}
|
|
209
209
|
}), this._input.addEventListener("blur", () => {
|
|
210
|
-
let { t: e } =
|
|
210
|
+
let { t: e } = t();
|
|
211
211
|
this._error = this._value.trim() ? null : e("validation.lastNameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
212
212
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
213
213
|
}
|
|
214
214
|
getCss() {
|
|
215
215
|
return super.getCss() + [
|
|
216
|
-
S,
|
|
217
216
|
C,
|
|
218
|
-
|
|
217
|
+
w,
|
|
218
|
+
S
|
|
219
219
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
220
220
|
}
|
|
221
221
|
getValue() {
|
|
@@ -227,35 +227,35 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
227
227
|
getError() {
|
|
228
228
|
return this._error;
|
|
229
229
|
}
|
|
230
|
-
},
|
|
230
|
+
}, M = /* @__PURE__ */ new Set(["US", "CA"]), N = class extends E {
|
|
231
231
|
_value = "";
|
|
232
232
|
_country = "";
|
|
233
233
|
_input = null;
|
|
234
234
|
_select = null;
|
|
235
235
|
setCountry(e) {
|
|
236
|
-
let
|
|
236
|
+
let n = this._country;
|
|
237
237
|
if (this._country = e, !this.shadowRoot) return;
|
|
238
|
-
let
|
|
239
|
-
if (
|
|
240
|
-
let { t } =
|
|
241
|
-
this._select?.setOptions(
|
|
238
|
+
let r = M.has(n), i = M.has(e);
|
|
239
|
+
if (r && i && n !== e) {
|
|
240
|
+
let { t: n } = t(), r = e, i = n(r === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
241
|
+
this._select?.setOptions(m(r), this.options.placeholder ?? i), this._value = "", this.emit("change", this._value);
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
r !== i && (this._value = "", this.render(), this.emit("change", this._value));
|
|
245
245
|
}
|
|
246
246
|
render() {
|
|
247
|
-
if (this.shadowRoot) if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null,
|
|
247
|
+
if (this.shadowRoot) if (this._input?.getElement().remove(), this._select?.getElement().remove(), this._input = null, this._select = null, M.has(this._country)) {
|
|
248
248
|
let e = this._country;
|
|
249
249
|
this._renderSelect(e);
|
|
250
250
|
} else this._renderInput();
|
|
251
251
|
}
|
|
252
252
|
_renderInput() {
|
|
253
|
-
let { t: e } =
|
|
254
|
-
this._input = new
|
|
253
|
+
let { t: e } = t();
|
|
254
|
+
this._input = new y({
|
|
255
255
|
name: "billingAddress.state",
|
|
256
|
-
label: e("address.state"),
|
|
256
|
+
label: this.options.label ?? e("address.state"),
|
|
257
257
|
error: !1,
|
|
258
|
-
placeholder: e("address.state"),
|
|
258
|
+
placeholder: this.options.placeholder ?? e("address.state"),
|
|
259
259
|
value: this._value,
|
|
260
260
|
autocomplete: "address-level1",
|
|
261
261
|
onChange: (e) => {
|
|
@@ -267,14 +267,14 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
267
267
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
268
268
|
}
|
|
269
269
|
_renderSelect(e) {
|
|
270
|
-
let { t } =
|
|
271
|
-
this._select = new
|
|
270
|
+
let { t: n } = t(), r = m(e), i = n(e === "US" ? "address.chooseState" : "address.chooseProvince");
|
|
271
|
+
this._select = new p({
|
|
272
272
|
name: "billingAddress.state",
|
|
273
|
-
label:
|
|
273
|
+
label: this.options.label ?? n("address.state"),
|
|
274
274
|
error: !1,
|
|
275
|
-
placeholder:
|
|
275
|
+
placeholder: this.options.placeholder ?? i,
|
|
276
276
|
value: this._value,
|
|
277
|
-
options:
|
|
277
|
+
options: r,
|
|
278
278
|
autocomplete: "address-level1",
|
|
279
279
|
onChange: (e) => {
|
|
280
280
|
this._value = e.target.value, this._select?.setError(!1), this.emit("change", this._value);
|
|
@@ -286,10 +286,10 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
286
286
|
}
|
|
287
287
|
getCss() {
|
|
288
288
|
return super.getCss() + [
|
|
289
|
-
S,
|
|
290
289
|
C,
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
w,
|
|
291
|
+
S,
|
|
292
|
+
O
|
|
293
293
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background-color: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus,\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error,\n .form-select-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
294
294
|
}
|
|
295
295
|
getValue() {
|
|
@@ -300,22 +300,22 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
300
300
|
}
|
|
301
301
|
getError() {
|
|
302
302
|
if (this.getIsValid()) return null;
|
|
303
|
-
let { t: e } =
|
|
303
|
+
let { t: e } = t();
|
|
304
304
|
return e("validation.stateRequired");
|
|
305
305
|
}
|
|
306
|
-
},
|
|
306
|
+
}, P = class extends E {
|
|
307
307
|
_value = "";
|
|
308
308
|
_error = null;
|
|
309
309
|
_input = null;
|
|
310
310
|
render() {
|
|
311
311
|
if (!this.shadowRoot) return;
|
|
312
312
|
this._input?.getElement().remove();
|
|
313
|
-
let { t: e } =
|
|
314
|
-
this._input = new
|
|
313
|
+
let { t: e } = t();
|
|
314
|
+
this._input = new y({
|
|
315
315
|
name: "billingAddress.street",
|
|
316
|
-
label: e("address.addressLine1"),
|
|
316
|
+
label: this.options.label ?? e("address.addressLine1"),
|
|
317
317
|
error: !1,
|
|
318
|
-
placeholder: e("address.placeholder.street"),
|
|
318
|
+
placeholder: this.options.placeholder ?? e("address.placeholder.street"),
|
|
319
319
|
value: this._value,
|
|
320
320
|
autocomplete: "street-address",
|
|
321
321
|
maxLength: this.options.maxLength,
|
|
@@ -327,15 +327,15 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
327
327
|
this.emit("change", this._value);
|
|
328
328
|
}
|
|
329
329
|
}), this._input.addEventListener("blur", () => {
|
|
330
|
-
let { t: e } =
|
|
330
|
+
let { t: e } = t();
|
|
331
331
|
this._error = this._value.trim() ? null : e("validation.addressLine1Required"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
332
332
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
333
333
|
}
|
|
334
334
|
getCss() {
|
|
335
335
|
return super.getCss() + [
|
|
336
|
-
S,
|
|
337
336
|
C,
|
|
338
|
-
|
|
337
|
+
w,
|
|
338
|
+
S
|
|
339
339
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
340
340
|
}
|
|
341
341
|
getValue() {
|
|
@@ -347,34 +347,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
347
347
|
getError() {
|
|
348
348
|
return this._error;
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, F = class extends E {
|
|
351
351
|
_value = "";
|
|
352
352
|
_error = null;
|
|
353
353
|
_input = null;
|
|
354
354
|
render() {
|
|
355
355
|
if (!this.shadowRoot) return;
|
|
356
356
|
this._input?.getElement().remove();
|
|
357
|
-
let { t: e } =
|
|
358
|
-
this._input = new
|
|
357
|
+
let { t: e } = t();
|
|
358
|
+
this._input = new y({
|
|
359
359
|
name: "billingAddress.zipCode",
|
|
360
|
-
label: e("address.postalCode"),
|
|
360
|
+
label: this.options.label ?? e("address.postalCode"),
|
|
361
361
|
error: !1,
|
|
362
|
-
placeholder: e("address.placeholder.zipCode"),
|
|
362
|
+
placeholder: this.options.placeholder ?? e("address.placeholder.zipCode"),
|
|
363
363
|
value: this._value,
|
|
364
364
|
autocomplete: "postal-code",
|
|
365
365
|
onChange: (e) => {
|
|
366
366
|
this._value = e.target.value, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
367
367
|
}
|
|
368
368
|
}), this._input.addEventListener("blur", () => {
|
|
369
|
-
let { t: e } =
|
|
369
|
+
let { t: e } = t();
|
|
370
370
|
this._error = this._value.trim() ? null : e("validation.postalCodeRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
371
371
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
372
372
|
}
|
|
373
373
|
getCss() {
|
|
374
374
|
return super.getCss() + [
|
|
375
|
-
S,
|
|
376
375
|
C,
|
|
377
|
-
|
|
376
|
+
w,
|
|
377
|
+
S
|
|
378
378
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
379
379
|
}
|
|
380
380
|
getValue() {
|
|
@@ -386,7 +386,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
386
386
|
getError() {
|
|
387
387
|
return this._error;
|
|
388
388
|
}
|
|
389
|
-
},
|
|
389
|
+
}, te = "apple-pay-button{appearance:-apple-pay-button;-apple-pay-button-type:plain;-apple-pay-button-style:black;cursor:pointer;box-sizing:border-box;border-radius:4px;width:100%;height:40px;min-height:40px;display:inline-block}apple-pay-button:hover{filter:brightness(.9)}", I = {
|
|
390
390
|
name: "odus-elements",
|
|
391
391
|
styles: {
|
|
392
392
|
fontSize: 14,
|
|
@@ -410,18 +410,34 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
410
410
|
}
|
|
411
411
|
},
|
|
412
412
|
additionalPaymentMethods: {}
|
|
413
|
-
}, L = class extends
|
|
413
|
+
}, L = class extends E {
|
|
414
414
|
_paymentContext = null;
|
|
415
415
|
_applePayData = null;
|
|
416
416
|
_authorized = !1;
|
|
417
417
|
_button = null;
|
|
418
|
+
_isAvailable = !1;
|
|
419
|
+
get isAvailable() {
|
|
420
|
+
return this._isAvailable;
|
|
421
|
+
}
|
|
418
422
|
setPaymentContext(e) {
|
|
419
423
|
this._paymentContext = e, this.isMounted && this.render();
|
|
420
424
|
}
|
|
421
425
|
render() {
|
|
422
|
-
if (!this.shadowRoot
|
|
426
|
+
if (!this.shadowRoot) return;
|
|
427
|
+
if (this._button?.getElement().remove(), this._button = null, !this._paymentContext) {
|
|
428
|
+
this._setAvailability(!1);
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
423
431
|
let { paymentId: e, checkoutKey: t, environment: n, checkoutDetails: r, displayName: i, countries: a, requiredBillingContactFields: o, requiredShippingContactFields: s, onAuthorize: c } = this._paymentContext;
|
|
424
|
-
a?.length && r?.countryCode && !a.map((e) => e.toUpperCase()).includes(r.countryCode.toUpperCase())
|
|
432
|
+
if (a?.length && r?.countryCode && !a.map((e) => e.toUpperCase()).includes(r.countryCode.toUpperCase())) {
|
|
433
|
+
this._setAvailability(!1);
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
if (!f()) {
|
|
437
|
+
this._setAvailability(!1);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
this._button = new _({
|
|
425
441
|
checkoutProfile: I,
|
|
426
442
|
paymentId: e,
|
|
427
443
|
checkoutKey: t,
|
|
@@ -433,10 +449,13 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
433
449
|
onSubmit: async ({ applePayData: e }) => {
|
|
434
450
|
e && (this._applePayData = e, this._authorized = !0, this.emit("change", e), await c(e));
|
|
435
451
|
}
|
|
436
|
-
}), this.shadowRoot.appendChild(this._button.getElement()));
|
|
452
|
+
}), this.shadowRoot.appendChild(this._button.getElement()), this._setAvailability(!0);
|
|
453
|
+
}
|
|
454
|
+
_setAvailability(e) {
|
|
455
|
+
this._isAvailable = e, this.host && (e ? this.host.style.removeProperty("display") : this.host.style.display = "none");
|
|
437
456
|
}
|
|
438
457
|
getCss() {
|
|
439
|
-
return super.getCss() +
|
|
458
|
+
return super.getCss() + te + "\n :host { display: block; }\n apple-pay-button {\n width: 100%;\n height: var(--odus-button-height, 48px);\n border-radius: var(--odus-button-border-radius, 6px);\n }\n ";
|
|
440
459
|
}
|
|
441
460
|
getValue() {
|
|
442
461
|
return this._applePayData;
|
|
@@ -476,16 +495,16 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
476
495
|
_cardExpiry = "";
|
|
477
496
|
_cardCvv = "";
|
|
478
497
|
_section = null;
|
|
479
|
-
_focusManager = new
|
|
498
|
+
_focusManager = new x();
|
|
480
499
|
_touchedFields = /* @__PURE__ */ new Set();
|
|
481
500
|
_focusHandlers = [];
|
|
482
501
|
get section() {
|
|
483
502
|
return this._section;
|
|
484
503
|
}
|
|
485
|
-
renderSection(e,
|
|
504
|
+
renderSection(e, r, i) {
|
|
486
505
|
this._section?.getElement().remove();
|
|
487
|
-
let { t:
|
|
488
|
-
this._section = new
|
|
506
|
+
let { t: o } = t();
|
|
507
|
+
this._section = new g({
|
|
489
508
|
checkoutProfile: V,
|
|
490
509
|
cardNumber: this._cardNumber,
|
|
491
510
|
cardNumberTouched: !1,
|
|
@@ -493,29 +512,29 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
493
512
|
cardCvvTouched: !1,
|
|
494
513
|
cardExpiry: this._cardExpiry,
|
|
495
514
|
cardExpiryTouched: !1,
|
|
496
|
-
translationFunc:
|
|
515
|
+
translationFunc: o,
|
|
497
516
|
onChange: (e) => {
|
|
498
|
-
let
|
|
499
|
-
if (
|
|
500
|
-
else if (
|
|
501
|
-
let e =
|
|
517
|
+
let t = e.target;
|
|
518
|
+
if (t.name === "cardNumber") this._cardNumber = t.value;
|
|
519
|
+
else if (t.name === "cardExpiry") {
|
|
520
|
+
let e = n.cardExpiry(t.value);
|
|
502
521
|
this._cardExpiry = e, this._section?.updateCardExpiry(e);
|
|
503
|
-
} else
|
|
504
|
-
this._touchedFields.add(
|
|
522
|
+
} else t.name === "cardCvv" && (this._cardCvv = t.value);
|
|
523
|
+
this._touchedFields.add(t.name), this._updateFocusManagerState(), r(this.getValue());
|
|
505
524
|
},
|
|
506
525
|
onBlur: (e) => {
|
|
507
|
-
let t = e.target,
|
|
508
|
-
if (this._touchedFields.add(
|
|
509
|
-
let e =
|
|
526
|
+
let t = e.target, n = t.name ?? "cardExpiry", r = a();
|
|
527
|
+
if (this._touchedFields.add(n), t.name === "cardNumber") {
|
|
528
|
+
let e = r.cardNumber(this._cardNumber);
|
|
510
529
|
this._section?.updateCardNumber(this._cardNumber, e, !0);
|
|
511
530
|
} else if (t.name === "cardCvv") {
|
|
512
|
-
let e =
|
|
531
|
+
let e = r.cardCvv(this._cardCvv, this._cardNumber);
|
|
513
532
|
this._section?.updateCardCvv(this._cardCvv, e, !0);
|
|
514
533
|
} else {
|
|
515
|
-
let e =
|
|
534
|
+
let e = r.cardExpiry(this._cardExpiry);
|
|
516
535
|
this._section?.updateCardExpiry(this._cardExpiry, e, !0);
|
|
517
536
|
}
|
|
518
|
-
this._updateFocusManagerState(),
|
|
537
|
+
this._updateFocusManagerState(), i(this.getValue());
|
|
519
538
|
}
|
|
520
539
|
}), e.appendChild(this._section.getElement()), this._registerFocusFields();
|
|
521
540
|
}
|
|
@@ -526,23 +545,23 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
526
545
|
cvv: this._cardCvv
|
|
527
546
|
};
|
|
528
547
|
}
|
|
529
|
-
async getPayload(
|
|
530
|
-
let
|
|
531
|
-
|
|
532
|
-
let
|
|
533
|
-
return
|
|
534
|
-
encryptedCardNumber:
|
|
535
|
-
encryptedCvv:
|
|
536
|
-
expMonth:
|
|
537
|
-
expYear:
|
|
548
|
+
async getPayload(t) {
|
|
549
|
+
let n = t === "live" ? B : z, r = new e();
|
|
550
|
+
r.setPublicKey(n);
|
|
551
|
+
let i = this._cardNumber.replace(/\s+/g, ""), a = this._cardExpiry.replace(/\s+/g, "").split("/"), o = a[0] ?? "", s = a[1] ?? "";
|
|
552
|
+
return s.length === 2 && (s = `20${s}`), {
|
|
553
|
+
encryptedCardNumber: r.encrypt(i),
|
|
554
|
+
encryptedCvv: r.encrypt(this._cardCvv),
|
|
555
|
+
expMonth: o,
|
|
556
|
+
expYear: s
|
|
538
557
|
};
|
|
539
558
|
}
|
|
540
559
|
isValid() {
|
|
541
|
-
let e =
|
|
560
|
+
let e = a(), t = this._cardCvv.length >= 3;
|
|
542
561
|
return !e.cardNumber(this._cardNumber) && !e.cardExpiry(this._cardExpiry) && t;
|
|
543
562
|
}
|
|
544
563
|
getError() {
|
|
545
|
-
let e =
|
|
564
|
+
let e = a();
|
|
546
565
|
return e.cardNumber(this._cardNumber) ?? e.cardExpiry(this._cardExpiry) ?? null;
|
|
547
566
|
}
|
|
548
567
|
destroy() {
|
|
@@ -568,19 +587,42 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
568
587
|
this._focusHandlers = [];
|
|
569
588
|
}
|
|
570
589
|
_updateFocusManagerState() {
|
|
571
|
-
let e =
|
|
590
|
+
let e = a(), t = {
|
|
572
591
|
cardNumber: this._cardNumber,
|
|
573
592
|
cardExpiry: this._cardExpiry,
|
|
574
593
|
cardCvv: this._cardCvv,
|
|
575
594
|
name: "",
|
|
576
595
|
email: ""
|
|
577
|
-
}, n = {},
|
|
578
|
-
|
|
596
|
+
}, n = {}, r = e.cardNumber(this._cardNumber), i = e.cardExpiry(this._cardExpiry), o = e.cardCvv(this._cardCvv, this._cardNumber);
|
|
597
|
+
r && (n.cardNumber = r), i && (n.cardExpiry = i), o && (n.cardCvv = o);
|
|
579
598
|
let s = {};
|
|
580
599
|
for (let e of this._touchedFields) s[e] = !0;
|
|
581
600
|
this._focusManager.handleStateUpdate(t, n, s);
|
|
582
601
|
}
|
|
583
|
-
}, U =
|
|
602
|
+
}, U = {
|
|
603
|
+
"--odus-font-family": "system-ui, sans-serif",
|
|
604
|
+
"--odus-font-size": "16px",
|
|
605
|
+
"--odus-color-error": "#dc2727",
|
|
606
|
+
"--odus-color-text": "#1a1a1a",
|
|
607
|
+
"--odus-color-background": "#ffffff",
|
|
608
|
+
"--odus-border-color": "#e0e0e0",
|
|
609
|
+
"--odus-border-radius": "6px",
|
|
610
|
+
"--odus-spacing-sm": "8px",
|
|
611
|
+
"--odus-spacing-md": "16px",
|
|
612
|
+
"--odus-spacing-lg": "24px",
|
|
613
|
+
"--odus-input-height": "44px",
|
|
614
|
+
"--odus-input-padding": "8px 12px",
|
|
615
|
+
"--odus-input-font-size": "var(--odus-font-size)",
|
|
616
|
+
"--odus-input-font-weight": "400",
|
|
617
|
+
"--odus-input-letter-spacing": "0.02em",
|
|
618
|
+
"--odus-input-line-height": "1.5",
|
|
619
|
+
"--odus-input-placeholder-color": "#717173",
|
|
620
|
+
"--odus-input-placeholder-opacity": "0.3",
|
|
621
|
+
"--odus-input-focus-shadow": "0 0 0 1px rgba(50, 151, 211, 0.7), 0 1px 1px 0 rgba(0, 0, 0, 0.07), 0 0 0 4px rgba(50, 151, 211, 0.3)",
|
|
622
|
+
"--odus-card-gap": "12px",
|
|
623
|
+
"--odus-button-height": "48px",
|
|
624
|
+
"--odus-button-border-radius": "var(--odus-border-radius)"
|
|
625
|
+
}["--odus-font-size"], W = class {
|
|
584
626
|
_vgsService;
|
|
585
627
|
_vgsJwt;
|
|
586
628
|
_vgsState = {};
|
|
@@ -590,16 +632,16 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
590
632
|
_environment = "test";
|
|
591
633
|
_section = null;
|
|
592
634
|
_initGeneration = 0;
|
|
593
|
-
constructor(e,
|
|
594
|
-
this._vgsJwt = e, this._environment =
|
|
635
|
+
constructor(e, t) {
|
|
636
|
+
this._vgsJwt = e, this._environment = t, this._vgsService = new i();
|
|
595
637
|
}
|
|
596
638
|
get section() {
|
|
597
639
|
return this._section;
|
|
598
640
|
}
|
|
599
|
-
renderSection(e,
|
|
641
|
+
renderSection(e, n) {
|
|
600
642
|
this._section?.getElement().remove();
|
|
601
|
-
let { t:
|
|
602
|
-
this._section = new
|
|
643
|
+
let { t: r } = t();
|
|
644
|
+
this._section = new g({
|
|
603
645
|
checkoutProfile: V,
|
|
604
646
|
cardNumber: "",
|
|
605
647
|
cardNumberTouched: !1,
|
|
@@ -607,11 +649,11 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
607
649
|
cardCvvTouched: !1,
|
|
608
650
|
cardExpiry: "",
|
|
609
651
|
cardExpiryTouched: !1,
|
|
610
|
-
translationFunc:
|
|
652
|
+
translationFunc: r,
|
|
611
653
|
onChange: () => {},
|
|
612
654
|
onBlur: () => {},
|
|
613
655
|
vgsService: this._vgsService
|
|
614
|
-
}), e.appendChild(this._section.getElement()), this._onChangeEmit =
|
|
656
|
+
}), e.appendChild(this._section.getElement()), this._onChangeEmit = n;
|
|
615
657
|
}
|
|
616
658
|
_onChangeEmit = null;
|
|
617
659
|
initVgs() {
|
|
@@ -634,12 +676,12 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
634
676
|
return this._vgsFieldsValid;
|
|
635
677
|
}
|
|
636
678
|
getError() {
|
|
637
|
-
let { t: e } =
|
|
679
|
+
let { t: e } = t();
|
|
638
680
|
for (let [t, n] of Object.entries(this._vgsState)) {
|
|
639
681
|
if (!n?.isTouched || n.isFocused || n.isValid) continue;
|
|
640
682
|
let r = n.errors?.[0];
|
|
641
683
|
if (!r) continue;
|
|
642
|
-
let i =
|
|
684
|
+
let i = u(t, r.code);
|
|
643
685
|
if (i) return e(i);
|
|
644
686
|
}
|
|
645
687
|
return null;
|
|
@@ -663,16 +705,16 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
663
705
|
}
|
|
664
706
|
_reinitWithTheme() {
|
|
665
707
|
this._vgsReinitTimer && clearTimeout(this._vgsReinitTimer), this._vgsReinitTimer = setTimeout(() => {
|
|
666
|
-
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new
|
|
708
|
+
this._vgsReinitTimer = null, this._vgsService.destroy(), this._vgsService = new i(), this._section?.setVgsService(this._vgsService), this.initVgs();
|
|
667
709
|
}, 300);
|
|
668
710
|
}
|
|
669
711
|
_buildProfileFromTheme(e) {
|
|
670
|
-
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ??
|
|
712
|
+
let t = e["--odus-input-font-size"] ?? e["--odus-font-size"] ?? U, n = e["--odus-font-family"] ?? V.styles.fontFamily, r = e["--odus-color-text"] ?? V.styles.textColor, i = e["--odus-border-radius"] ?? `${V.styles.borderRadius}px`;
|
|
671
713
|
return {
|
|
672
714
|
...V,
|
|
673
715
|
styles: {
|
|
674
716
|
...V.styles,
|
|
675
|
-
fontSize: parseInt(t, 10) ||
|
|
717
|
+
fontSize: parseInt(t, 10) || parseInt(U, 10),
|
|
676
718
|
fontFamily: n,
|
|
677
719
|
textColor: r,
|
|
678
720
|
borderRadius: parseInt(i, 10) || V.styles.borderRadius
|
|
@@ -681,28 +723,28 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
681
723
|
}
|
|
682
724
|
async _mountFields(e) {
|
|
683
725
|
if (!this._section) return;
|
|
684
|
-
let
|
|
685
|
-
this._section.updateVgsWrapperStyles(
|
|
686
|
-
let
|
|
687
|
-
for (let e of Object.values(
|
|
726
|
+
let n = this._buildProfileFromTheme(this._currentTheme), r = this._currentTheme["--odus-border-color"] ?? "#e0e0e0";
|
|
727
|
+
this._section.updateVgsWrapperStyles(r, n.styles.borderRadius);
|
|
728
|
+
let i = this._section.getVgsContainerIds();
|
|
729
|
+
for (let e of Object.values(i)) {
|
|
688
730
|
if (!e) continue;
|
|
689
731
|
let t = document.getElementById(e);
|
|
690
732
|
t && t.querySelectorAll("iframe").forEach((e) => e.remove());
|
|
691
733
|
}
|
|
692
|
-
let
|
|
734
|
+
let a = await l(n.styles.fontFamily);
|
|
693
735
|
if (e !== this._initGeneration) return;
|
|
694
|
-
let
|
|
695
|
-
borderColor:
|
|
736
|
+
let o = this._section.buildVgsFieldCss(n, a, {
|
|
737
|
+
borderColor: r,
|
|
696
738
|
backgroundColor: this._currentTheme["--odus-color-background"],
|
|
697
739
|
placeholderColor: this._currentTheme["--odus-input-placeholder-color"],
|
|
698
740
|
placeholderOpacity: this._currentTheme["--odus-input-placeholder-opacity"],
|
|
699
741
|
padding: this._currentTheme["--odus-input-padding"]
|
|
700
|
-
}), { t: s } =
|
|
742
|
+
}), { t: s } = t();
|
|
701
743
|
this._vgsService.mountCardFields({
|
|
702
|
-
cardNumber:
|
|
703
|
-
cardExpiry:
|
|
704
|
-
cardCvv:
|
|
705
|
-
},
|
|
744
|
+
cardNumber: i.cardNumber ? `#${i.cardNumber}` : void 0,
|
|
745
|
+
cardExpiry: i.cardExpiry ? `#${i.cardExpiry}` : void 0,
|
|
746
|
+
cardCvv: i.cardCvv ? `#${i.cardCvv}` : void 0
|
|
747
|
+
}, o, {
|
|
706
748
|
cardNumber: "1234 5678 9012 3456",
|
|
707
749
|
cardExpiry: s("cardExpiry"),
|
|
708
750
|
cardCvv: "CVV",
|
|
@@ -715,8 +757,8 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
715
757
|
}
|
|
716
758
|
_handleStateChange(e) {
|
|
717
759
|
this._vgsState = e, this._vgsFieldsValid = Object.values(e).every((e) => e?.isValid === !0);
|
|
718
|
-
let { t } =
|
|
719
|
-
this._section?.handleVgsStateChange(e,
|
|
760
|
+
let { t: n } = t(), r = this._deriveFieldErrors(n);
|
|
761
|
+
this._section?.handleVgsStateChange(e, r), this._onChangeEmit?.();
|
|
720
762
|
}
|
|
721
763
|
_deriveFieldErrors(e) {
|
|
722
764
|
let t = {};
|
|
@@ -724,12 +766,12 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
724
766
|
if (!r?.isTouched || r.isFocused || r.isValid) continue;
|
|
725
767
|
let i = r.errors?.[0];
|
|
726
768
|
if (!i) continue;
|
|
727
|
-
let a =
|
|
769
|
+
let a = u(n, i.code);
|
|
728
770
|
a && (t[n] = e(a));
|
|
729
771
|
}
|
|
730
772
|
return t;
|
|
731
773
|
}
|
|
732
|
-
},
|
|
774
|
+
}, G = class extends E {
|
|
733
775
|
_environment = "test";
|
|
734
776
|
_isVgsMode = !1;
|
|
735
777
|
_mountContainer = null;
|
|
@@ -742,7 +784,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
742
784
|
this._environment = e;
|
|
743
785
|
}
|
|
744
786
|
setVgsJwt(e) {
|
|
745
|
-
this._isVgsMode = !0, this._vgsAdapter = new
|
|
787
|
+
this._isVgsMode = !0, this._vgsAdapter = new W(e, this._environment), this.isMounted && this._mountContainer && (this.unmount(), this.mount(this._mountContainer));
|
|
746
788
|
}
|
|
747
789
|
mount(e) {
|
|
748
790
|
this.isMounted && this.unmount();
|
|
@@ -783,9 +825,9 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
783
825
|
}
|
|
784
826
|
getCss() {
|
|
785
827
|
return super.getCss() + [
|
|
786
|
-
S,
|
|
787
828
|
C,
|
|
788
|
-
|
|
829
|
+
w,
|
|
830
|
+
S,
|
|
789
831
|
R
|
|
790
832
|
].join("\n") + "\n :host { display: block; }\n .card-grid {\n display: flex;\n flex-direction: column;\n gap: var(--odus-card-gap, 12px);\n }\n .card-details {\n display: flex;\n gap: var(--odus-card-gap, 12px);\n }\n .form-input,\n .form-select {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus,\n .form-select:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error,\n .form-select-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
791
833
|
}
|
|
@@ -809,19 +851,19 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
809
851
|
getError() {
|
|
810
852
|
return this._isVgsMode ? this._vgsAdapter?.getError() ?? null : this._nativeAdapter.getError();
|
|
811
853
|
}
|
|
812
|
-
},
|
|
854
|
+
}, K = class extends E {
|
|
813
855
|
_value = "";
|
|
814
856
|
_error = null;
|
|
815
857
|
_input = null;
|
|
816
858
|
render() {
|
|
817
859
|
if (!this.shadowRoot) return;
|
|
818
860
|
this._input?.getElement().remove();
|
|
819
|
-
let { t: e } =
|
|
820
|
-
this._input = new
|
|
861
|
+
let { t: e } = t();
|
|
862
|
+
this._input = new y({
|
|
821
863
|
name: "billingAddress.cardholderName",
|
|
822
|
-
label: e("cardholderNameLabel"),
|
|
864
|
+
label: this.options.label ?? e("cardholderNameLabel"),
|
|
823
865
|
error: !1,
|
|
824
|
-
placeholder: e("cardholderNamePlaceholder"),
|
|
866
|
+
placeholder: this.options.placeholder ?? e("cardholderNamePlaceholder"),
|
|
825
867
|
value: this._value,
|
|
826
868
|
autocomplete: "cc-name",
|
|
827
869
|
onChange: (e) => {
|
|
@@ -829,15 +871,15 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
829
871
|
t !== n && this._input?.setValue(n), this._value = n, this._error = null, this._input?.setError(!1), this.emit("change", this._value);
|
|
830
872
|
}
|
|
831
873
|
}), this._input.addEventListener("blur", () => {
|
|
832
|
-
let { t: e } =
|
|
874
|
+
let { t: e } = t();
|
|
833
875
|
this._error = this._value.trim() ? null : e("validation.nameRequired"), this._input?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._value);
|
|
834
876
|
}), this.shadowRoot.appendChild(this._input.getElement());
|
|
835
877
|
}
|
|
836
878
|
getCss() {
|
|
837
879
|
return super.getCss() + [
|
|
838
|
-
S,
|
|
839
880
|
C,
|
|
840
|
-
|
|
881
|
+
w,
|
|
882
|
+
S
|
|
841
883
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
842
884
|
}
|
|
843
885
|
getValue() {
|
|
@@ -849,7 +891,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
849
891
|
getError() {
|
|
850
892
|
return this._error;
|
|
851
893
|
}
|
|
852
|
-
},
|
|
894
|
+
}, q = {
|
|
853
895
|
name: "odus-elements",
|
|
854
896
|
styles: {
|
|
855
897
|
fontSize: 14,
|
|
@@ -873,63 +915,65 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
873
915
|
}
|
|
874
916
|
},
|
|
875
917
|
additionalPaymentMethods: {}
|
|
876
|
-
},
|
|
918
|
+
}, J = class extends E {
|
|
877
919
|
_email = "";
|
|
878
920
|
_error = null;
|
|
879
921
|
_field = null;
|
|
880
922
|
render() {
|
|
881
923
|
if (!this.shadowRoot) return;
|
|
882
924
|
this._field?.getElement().remove(), this.options.initialValue && !this._email && (this._email = String(this.options.initialValue));
|
|
883
|
-
let { t: e } =
|
|
884
|
-
this._field = new
|
|
925
|
+
let { t: e } = t();
|
|
926
|
+
this._field = new c({
|
|
885
927
|
value: this._email,
|
|
886
928
|
error: !1,
|
|
887
|
-
checkoutProfile:
|
|
929
|
+
checkoutProfile: q,
|
|
888
930
|
translationFunc: e,
|
|
931
|
+
label: this.options.label,
|
|
932
|
+
placeholder: this.options.placeholder,
|
|
889
933
|
onChange: (e) => {
|
|
890
934
|
let t = e.target;
|
|
891
935
|
this._email = t.value ?? this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._email);
|
|
892
936
|
},
|
|
893
937
|
onBlur: () => {
|
|
894
|
-
let e =
|
|
938
|
+
let e = a();
|
|
895
939
|
this._error = e.email(this._email) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._email);
|
|
896
940
|
}
|
|
897
941
|
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
898
942
|
}
|
|
899
943
|
getCss() {
|
|
900
944
|
return super.getCss() + [
|
|
901
|
-
S,
|
|
902
945
|
C,
|
|
903
|
-
|
|
946
|
+
w,
|
|
947
|
+
S
|
|
904
948
|
].join("\n") + "\n :host { display: block; }\n .form-input {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-input:focus {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
905
949
|
}
|
|
906
950
|
getValue() {
|
|
907
951
|
return this._email;
|
|
908
952
|
}
|
|
909
953
|
getIsValid() {
|
|
910
|
-
return !
|
|
954
|
+
return !a().email(this._email);
|
|
911
955
|
}
|
|
912
956
|
getError() {
|
|
913
957
|
return this._error;
|
|
914
958
|
}
|
|
915
|
-
},
|
|
959
|
+
}, Y = "@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.error-alert{background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;animation:.3s ease-out slideIn;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f}.error-alert-content{align-items:flex-start;gap:12px;display:flex}.error-alert-icon-container{color:#dc2626;background-color:#fee2e2;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;display:flex}.error-alert-icon{color:#dc2626}.error-alert-text-container{flex:1;min-width:0}.error-alert-title{color:#991b1b;margin:0 0 4px;font-size:14px;font-weight:600;line-height:1.4}.error-alert-message{font-family:var(--odus-font-family,inherit);color:#7f1d1d;word-break:break-word;margin:0;font-size:14px;line-height:1.5}", X = class extends E {
|
|
916
960
|
_alert = null;
|
|
917
961
|
_message = null;
|
|
918
962
|
render() {
|
|
919
|
-
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new
|
|
963
|
+
this.shadowRoot && (this._alert?.getElement().remove(), this._alert = null, this._message && (this._alert = new v({ message: this._message }), this.shadowRoot.appendChild(this._alert.getElement())));
|
|
920
964
|
}
|
|
921
965
|
setError(e) {
|
|
922
966
|
if (this._message = e, !this.shadowRoot) {
|
|
923
967
|
this.emit("error", e);
|
|
924
968
|
return;
|
|
925
969
|
}
|
|
926
|
-
this._alert ? this._alert.setMessage(e) : (this._alert = new
|
|
970
|
+
this._alert ? this._alert.setMessage(e) : (this._alert = new v({ message: e }), this.shadowRoot.appendChild(this._alert.getElement())), this.emit("error", e);
|
|
927
971
|
}
|
|
928
972
|
clearError() {
|
|
929
973
|
this._message = null, this._alert?.getElement().remove(), this._alert = null;
|
|
930
974
|
}
|
|
931
975
|
getCss() {
|
|
932
|
-
return super.getCss() +
|
|
976
|
+
return super.getCss() + Y + "\n :host { display: block; }\n .error-alert-icon,\n .error-alert-icon-container {\n color: var(--odus-color-error, #e53e3e) !important;\n }\n .error-alert-message {\n color: var(--odus-color-text, #1a1a1a) !important;\n }\n ";
|
|
933
977
|
}
|
|
934
978
|
getValue() {
|
|
935
979
|
return null;
|
|
@@ -940,7 +984,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
940
984
|
getError() {
|
|
941
985
|
return this._message;
|
|
942
986
|
}
|
|
943
|
-
},
|
|
987
|
+
}, Z = ".paypal{color:#253b80;text-transform:none;cursor:pointer;background-color:#ffc439;border-radius:4px;padding:8px 16px;font-weight:700;box-shadow:0 2px 4px #0000001a}.paypal:hover{filter:brightness(.95);background-color:#ffc439}.paypal-icon-container{justify-content:center;align-items:center;display:flex}.paypal-icon-container img{width:69px;height:22px}", ne = {
|
|
944
988
|
name: "odus-elements",
|
|
945
989
|
styles: {
|
|
946
990
|
fontSize: 14,
|
|
@@ -964,7 +1008,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
964
1008
|
}
|
|
965
1009
|
},
|
|
966
1010
|
additionalPaymentMethods: {}
|
|
967
|
-
}, Q = class extends
|
|
1011
|
+
}, Q = class extends E {
|
|
968
1012
|
_paymentContext = null;
|
|
969
1013
|
_button = null;
|
|
970
1014
|
setPaymentContext(e) {
|
|
@@ -973,8 +1017,8 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
973
1017
|
render() {
|
|
974
1018
|
if (!this.shadowRoot || (this._button?.getElement().remove(), this._button = null, !this._paymentContext)) return;
|
|
975
1019
|
let { onAuthorize: e } = this._paymentContext;
|
|
976
|
-
this._button = new
|
|
977
|
-
checkoutProfile:
|
|
1020
|
+
this._button = new h({
|
|
1021
|
+
checkoutProfile: ne,
|
|
978
1022
|
onSubmit: async () => {
|
|
979
1023
|
this._button?.setSubmitting(!0);
|
|
980
1024
|
try {
|
|
@@ -986,7 +1030,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
986
1030
|
}), this.shadowRoot.appendChild(this._button.getElement());
|
|
987
1031
|
}
|
|
988
1032
|
getCss() {
|
|
989
|
-
return super.getCss() +
|
|
1033
|
+
return super.getCss() + Z + "\n :host { display: block; }\n .paypal {\n width: 100%;\n box-sizing: border-box;\n border-radius: var(--odus-button-border-radius, 6px);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n ";
|
|
990
1034
|
}
|
|
991
1035
|
getValue() {
|
|
992
1036
|
return null;
|
|
@@ -997,7 +1041,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
997
1041
|
getError() {
|
|
998
1042
|
return null;
|
|
999
1043
|
}
|
|
1000
|
-
},
|
|
1044
|
+
}, re = ".country-dial-code-dropdown{display:inline-block;position:relative}.country-dial-code-trigger{padding:var(--odus-input-padding,8px 12px);cursor:pointer;letter-spacing:.02em;font-weight:400;line-height:var(--odus-input-line-height,1.5);white-space:nowrap;box-sizing:border-box;background:#fff;border:none;border-right:1px solid #e0e0e0;align-items:center;gap:6px;padding-right:8px;transition:all .1s ease-in;display:flex}.country-dial-code-trigger:hover{background:#f5f5f5}.country-dial-code-trigger:focus{outline:none}.country-dial-code-trigger .country-flag{font-size:14px;line-height:1}.country-dial-code-trigger .country-chevron{color:#717173;flex-shrink:0;transition:transform .15s}.country-dial-code-trigger[aria-expanded=true] .country-chevron{transform:rotate(180deg)}.country-dial-code-panel{z-index:10000;background:#fff;border-radius:8px;flex-direction:column;width:280px;max-height:360px;display:flex;position:fixed;top:0;left:0;overflow:hidden;box-shadow:0 0 0 1px #0000000d,0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.country-dial-code-panel.hidden{display:none}.country-search-wrapper{border-bottom:1px solid #e0e0e0;flex-shrink:0;padding:12px}.country-search{width:100%;font-size:inherit;box-sizing:border-box;border:1px solid #e0e0e0;border-radius:6px;outline:none;padding:6px 12px;font-family:inherit;transition:all .1s ease-in}.country-search:focus{border-color:#3297d3b3;box-shadow:0 0 0 3px #3297d31a}.country-search::placeholder{color:#717173;opacity:.6}.countries-list{flex:1;min-height:0;overflow-y:auto}.countries-list::-webkit-scrollbar{width:8px}.countries-list::-webkit-scrollbar-track{background:#f5f5f5}.countries-list::-webkit-scrollbar-thumb{background:#d0d0d0;border-radius:4px}.countries-list::-webkit-scrollbar-thumb:hover{background:#b0b0b0}.country-group-header{color:#717173;text-transform:uppercase;letter-spacing:.05em;z-index:1;background:#fafafa;padding:8px 16px 4px;font-size:12px;font-weight:600;position:sticky;top:0}.country-item{cursor:pointer;text-align:left;width:100%;color:inherit;background:#fff;border:none;align-items:center;gap:12px;padding:10px 16px;font-family:inherit;font-size:14px;transition:background .1s;display:flex}.country-item:hover{background:#f5f5f5}.country-item.selected{color:#3297d3;background:#3297d314}.country-item:focus{background:#f0f0f0;outline:none}.country-item .country-flag{flex-shrink:0;font-size:20px;line-height:1}.country-item .country-name{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.country-item .country-dial-code{color:#717173;flex-shrink:0;font-size:.95em}.country-item.selected .country-dial-code{color:#3297d3cc}.no-results{text-align:center;color:#717173;padding:24px 16px;font-size:14px}.phone-number-field-wrapper{width:100%;display:flex}.phone-number-field-container{border-radius:inherit;background:#fff;align-items:center;width:100%;transition:box-shadow .1s ease-in,border-radius .2s ease-in;display:flex;position:relative;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d}.phone-number-field-container.focused{z-index:2;box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.phone-number-field-container.error{box-shadow:0 0 0 1px #dc2727,0 2px 4px #dc27271a}.phone-number-field-container.error.focused{box-shadow:0 0 0 1px #dc2727,0 1px 1px #00000012,0 0 0 4px #dc272733}.phone-number-field-container .country-select-wrapper{padding:var(--odus-input-padding,8px 12px);border-top-left-radius:var(--phone-border-radius,0px);border-bottom-left-radius:var(--phone-border-radius,0px);white-space:nowrap;background:0 0;flex-shrink:0;align-items:center;gap:4px;padding-right:6px;display:flex;position:relative}.phone-number-field-container .country-select-wrapper .country-flag{pointer-events:none;font-size:14px;line-height:1}.phone-number-field-container .country-select-wrapper .country-chevron{color:#717173;pointer-events:none;flex-shrink:0;align-items:center;display:flex}.phone-number-field-container .country-select-wrapper .country-select{cursor:pointer;opacity:0;background:0 0;border:none;outline:none;width:100%;height:100%;position:absolute;inset:0}.phone-number-field-container .phone-input-wrapper{flex:1;min-width:0}.phone-number-field-container .phone-input-wrapper .form-input{box-shadow:none;border-radius:0;border-top-right-radius:var(--phone-border-radius,0px);border-bottom-right-radius:var(--phone-border-radius,0px);padding:var(--odus-input-padding,8px 2px);border:none}.phone-number-field-container .phone-input-wrapper .form-input:focus{box-shadow:none;z-index:auto}", ie = {
|
|
1001
1045
|
name: "odus-elements",
|
|
1002
1046
|
styles: {
|
|
1003
1047
|
fontSize: 14,
|
|
@@ -1021,7 +1065,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1021
1065
|
}
|
|
1022
1066
|
},
|
|
1023
1067
|
additionalPaymentMethods: {}
|
|
1024
|
-
}, $ = class extends
|
|
1068
|
+
}, $ = class extends E {
|
|
1025
1069
|
_phone = "";
|
|
1026
1070
|
_error = null;
|
|
1027
1071
|
_field = null;
|
|
@@ -1030,21 +1074,24 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1030
1074
|
if (!this.shadowRoot) return;
|
|
1031
1075
|
this._field?.destroy(), this._field?.getElement().remove(), this._field = null, this.options.initialValue && !this._phone && (this._phone = String(this.options.initialValue));
|
|
1032
1076
|
let e = ++this._renderGeneration;
|
|
1033
|
-
|
|
1077
|
+
ee().then(({ PhoneNumberField: n }) => {
|
|
1034
1078
|
if (!this.shadowRoot || this._renderGeneration !== e) return;
|
|
1035
|
-
let { t:
|
|
1036
|
-
this._field = new
|
|
1079
|
+
let { t: r, locale: i } = t();
|
|
1080
|
+
this._field = new n({
|
|
1037
1081
|
value: this._phone,
|
|
1038
1082
|
error: !1,
|
|
1039
|
-
checkoutProfile:
|
|
1040
|
-
translationFunc:
|
|
1083
|
+
checkoutProfile: ie,
|
|
1084
|
+
translationFunc: r,
|
|
1041
1085
|
locale: i,
|
|
1086
|
+
label: this.options.label,
|
|
1087
|
+
placeholder: this.options.placeholder,
|
|
1088
|
+
defaultCountry: this.options.defaultCountry,
|
|
1042
1089
|
onChange: () => {
|
|
1043
1090
|
this._phone = this._field?.getValue() ?? "", this._error = null, this._field?.setError(!1), this.emit("change", this._phone);
|
|
1044
1091
|
},
|
|
1045
1092
|
onBlur: () => {
|
|
1046
1093
|
this._phone = this._field?.getValue() ?? "";
|
|
1047
|
-
let e =
|
|
1094
|
+
let e = a(), t = this._field?.getCountry();
|
|
1048
1095
|
this._error = e.phoneNumber(this._phone, t) ?? null, this._field?.setError(!!this._error, this._error ?? void 0), this.emit("blur", this._phone);
|
|
1049
1096
|
}
|
|
1050
1097
|
}), this.shadowRoot.appendChild(this._field.getElement());
|
|
@@ -1052,23 +1099,23 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1052
1099
|
}
|
|
1053
1100
|
getCss() {
|
|
1054
1101
|
return super.getCss() + [
|
|
1055
|
-
S,
|
|
1056
1102
|
C,
|
|
1057
|
-
|
|
1058
|
-
|
|
1103
|
+
w,
|
|
1104
|
+
S,
|
|
1105
|
+
re
|
|
1059
1106
|
].join("\n") + "\n :host { display: block; }\n .form-input,\n .country-select-wrapper {\n color: var(--odus-color-text, #1a1a1a) !important;\n font-family: var(--odus-font-family, system-ui, sans-serif) !important;\n font-size: var(--odus-input-font-size, 16px) !important;\n background: var(--odus-color-background, #ffffff) !important;\n border-radius: 0 !important;\n box-shadow: none !important;\n }\n .phone-number-field-container {\n min-height: calc(var(--odus-input-font-size, 16px) * 1.5 + 16px);\n box-shadow:\n 0 0 0 1px var(--odus-border-color, #e0e0e0),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n border-radius: var(--odus-border-radius, 6px) !important;\n overflow: hidden;\n }\n .phone-number-field-container:focus-within {\n box-shadow: var(\n --odus-input-focus-shadow,\n 0 0 0 1px rgba(50, 151, 211, 0.7),\n 0 1px 1px 0 rgba(0, 0, 0, 0.07),\n 0 0 0 4px rgba(50, 151, 211, 0.3)\n ) !important;\n }\n .phone-number-field-container.error {\n box-shadow: 0 0 0 1px var(--odus-color-error, #dc2727) !important;\n }\n .form-input:focus {\n box-shadow: none !important;\n outline: none !important;\n }\n .form-input-error {\n box-shadow:\n 0 0 0 1px var(--odus-color-error, #dc2727),\n 0 2px 4px 0 rgba(0, 0, 0, 0.07),\n 0 1px 1.5px 0 rgba(0, 0, 0, 0.05) !important;\n }\n .form-helper-text {\n color: var(--odus-color-error, #dc2727) !important;\n }\n ";
|
|
1060
1107
|
}
|
|
1061
1108
|
getValue() {
|
|
1062
1109
|
return this._phone;
|
|
1063
1110
|
}
|
|
1064
1111
|
getIsValid() {
|
|
1065
|
-
let e =
|
|
1112
|
+
let e = a(), t = this._field?.getCountry();
|
|
1066
1113
|
return !e.phoneNumber(this._phone, t);
|
|
1067
1114
|
}
|
|
1068
1115
|
getError() {
|
|
1069
1116
|
return this._error;
|
|
1070
1117
|
}
|
|
1071
|
-
},
|
|
1118
|
+
}, ae = class {
|
|
1072
1119
|
_config;
|
|
1073
1120
|
_apiService;
|
|
1074
1121
|
_changeListeners = [];
|
|
@@ -1090,18 +1137,18 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1090
1137
|
_paypal;
|
|
1091
1138
|
_error;
|
|
1092
1139
|
elements;
|
|
1093
|
-
constructor(
|
|
1094
|
-
this._config =
|
|
1095
|
-
let
|
|
1096
|
-
Object.defineProperty(
|
|
1097
|
-
get: () => (this._email || (this._email = new
|
|
1140
|
+
constructor(e) {
|
|
1141
|
+
this._config = e, this._callbacks = { ...e.callbacks }, e.locale && b.setLocale(e.locale), this._apiService = new o(e.apiKey, e.environment);
|
|
1142
|
+
let t = {};
|
|
1143
|
+
Object.defineProperty(t, "email", {
|
|
1144
|
+
get: () => (this._email || (this._email = new J(), this._trackElement(this._email)), this._email),
|
|
1098
1145
|
enumerable: !0
|
|
1099
|
-
}), Object.defineProperty(
|
|
1146
|
+
}), Object.defineProperty(t, "phone", {
|
|
1100
1147
|
get: () => (this._phone || (this._phone = new $(), this._trackElement(this._phone)), this._phone),
|
|
1101
1148
|
enumerable: !0
|
|
1102
1149
|
});
|
|
1103
|
-
let
|
|
1104
|
-
Object.defineProperty(
|
|
1150
|
+
let n = {};
|
|
1151
|
+
Object.defineProperty(n, "applePay", {
|
|
1105
1152
|
get: () => (this._applePay || (this._applePay = new L(), this._trackElement(this._applePay), this._paymentState.paymentId && this._paymentState.checkoutKey && this._applePay.setPaymentContext({
|
|
1106
1153
|
paymentId: this._paymentState.paymentId,
|
|
1107
1154
|
checkoutKey: this._paymentState.checkoutKey,
|
|
@@ -1114,7 +1161,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1114
1161
|
})
|
|
1115
1162
|
})), this._applePay),
|
|
1116
1163
|
enumerable: !0
|
|
1117
|
-
}), Object.defineProperty(
|
|
1164
|
+
}), Object.defineProperty(n, "payPal", {
|
|
1118
1165
|
get: () => (this._paypal || (this._paypal = new Q(), this._trackElement(this._paypal), this._paymentState.paymentId && this._paymentState.checkoutKey && this._paypal.setPaymentContext({
|
|
1119
1166
|
paymentId: this._paymentState.paymentId,
|
|
1120
1167
|
checkoutKey: this._paymentState.checkoutKey,
|
|
@@ -1122,53 +1169,53 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1122
1169
|
})), this._paypal),
|
|
1123
1170
|
enumerable: !0
|
|
1124
1171
|
});
|
|
1125
|
-
let
|
|
1126
|
-
Object.defineProperty(
|
|
1127
|
-
get: () => (this._addressStreet || (this._addressStreet = new
|
|
1172
|
+
let r = {};
|
|
1173
|
+
Object.defineProperty(r, "street", {
|
|
1174
|
+
get: () => (this._addressStreet || (this._addressStreet = new P(), this._trackElement(this._addressStreet)), this._addressStreet),
|
|
1128
1175
|
enumerable: !0
|
|
1129
|
-
}), Object.defineProperty(
|
|
1130
|
-
get: () => (this._addressFirstName || (this._addressFirstName = new
|
|
1176
|
+
}), Object.defineProperty(r, "firstName", {
|
|
1177
|
+
get: () => (this._addressFirstName || (this._addressFirstName = new A(), this._trackElement(this._addressFirstName)), this._addressFirstName),
|
|
1131
1178
|
enumerable: !0
|
|
1132
|
-
}), Object.defineProperty(
|
|
1133
|
-
get: () => (this._addressLastName || (this._addressLastName = new
|
|
1179
|
+
}), Object.defineProperty(r, "lastName", {
|
|
1180
|
+
get: () => (this._addressLastName || (this._addressLastName = new j(), this._trackElement(this._addressLastName)), this._addressLastName),
|
|
1134
1181
|
enumerable: !0
|
|
1135
|
-
}), Object.defineProperty(
|
|
1136
|
-
get: () => (this._addressCity || (this._addressCity = new
|
|
1182
|
+
}), Object.defineProperty(r, "city", {
|
|
1183
|
+
get: () => (this._addressCity || (this._addressCity = new D(), this._trackElement(this._addressCity)), this._addressCity),
|
|
1137
1184
|
enumerable: !0
|
|
1138
|
-
}), Object.defineProperty(
|
|
1139
|
-
get: () => (this._addressState || (this._addressState = new
|
|
1185
|
+
}), Object.defineProperty(r, "state", {
|
|
1186
|
+
get: () => (this._addressState || (this._addressState = new N(), this._trackElement(this._addressState), this._addressCountry?.value && this._addressState.setCountry(this._addressCountry.value)), this._addressState),
|
|
1140
1187
|
enumerable: !0
|
|
1141
|
-
}), Object.defineProperty(
|
|
1142
|
-
get: () => (this._addressZipCode || (this._addressZipCode = new
|
|
1188
|
+
}), Object.defineProperty(r, "zipCode", {
|
|
1189
|
+
get: () => (this._addressZipCode || (this._addressZipCode = new F(), this._trackElement(this._addressZipCode)), this._addressZipCode),
|
|
1143
1190
|
enumerable: !0
|
|
1144
|
-
}), Object.defineProperty(
|
|
1145
|
-
get: () => (this._addressCountry || (this._addressCountry = new
|
|
1191
|
+
}), Object.defineProperty(r, "country", {
|
|
1192
|
+
get: () => (this._addressCountry || (this._addressCountry = new k(), this._trackElement(this._addressCountry), this._addressCountry.on("change", (e) => {
|
|
1146
1193
|
this._addressState?.setCountry(e);
|
|
1147
1194
|
})), this._addressCountry),
|
|
1148
1195
|
enumerable: !0
|
|
1149
1196
|
});
|
|
1150
|
-
let
|
|
1151
|
-
contact:
|
|
1152
|
-
express:
|
|
1197
|
+
let i = {
|
|
1198
|
+
contact: t,
|
|
1199
|
+
express: n
|
|
1153
1200
|
};
|
|
1154
|
-
Object.defineProperty(
|
|
1155
|
-
get: () => (this._card || (this._card = new
|
|
1201
|
+
Object.defineProperty(i, "card", {
|
|
1202
|
+
get: () => (this._card || (this._card = new G(), this._card.setEnvironment(this._config.environment), this._trackElement(this._card), this._paymentState.vgsJwt && this._card.setVgsJwt(this._paymentState.vgsJwt)), this._card),
|
|
1156
1203
|
enumerable: !0
|
|
1157
|
-
}), Object.defineProperty(
|
|
1158
|
-
get: () => (this._cardholderName || (this._cardholderName = new
|
|
1204
|
+
}), Object.defineProperty(i, "cardholderName", {
|
|
1205
|
+
get: () => (this._cardholderName || (this._cardholderName = new K(), this._trackElement(this._cardholderName)), this._cardholderName),
|
|
1159
1206
|
enumerable: !0
|
|
1160
|
-
}), Object.defineProperty(
|
|
1161
|
-
get: () =>
|
|
1207
|
+
}), Object.defineProperty(i, "address", {
|
|
1208
|
+
get: () => r,
|
|
1162
1209
|
enumerable: !0
|
|
1163
|
-
}), Object.defineProperty(
|
|
1164
|
-
get: () => (this._error || (this._error = new
|
|
1210
|
+
}), Object.defineProperty(i, "error", {
|
|
1211
|
+
get: () => (this._error || (this._error = new X(), this._trackElement(this._error)), this._error),
|
|
1165
1212
|
enumerable: !0
|
|
1166
|
-
}), this.elements =
|
|
1213
|
+
}), this.elements = i;
|
|
1167
1214
|
}
|
|
1168
1215
|
async associatePayment(e, t) {
|
|
1169
1216
|
if (!e || !t) throw Error("paymentId and checkoutKey are required");
|
|
1170
1217
|
this._paymentState.paymentId = e, this._paymentState.checkoutKey = t;
|
|
1171
|
-
let n = await
|
|
1218
|
+
let n = await r({
|
|
1172
1219
|
id: e,
|
|
1173
1220
|
checkoutKey: t,
|
|
1174
1221
|
environment: this._config.environment
|
|
@@ -1194,8 +1241,8 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1194
1241
|
});
|
|
1195
1242
|
}
|
|
1196
1243
|
validate() {
|
|
1197
|
-
let e = {}, { t } =
|
|
1198
|
-
return this._card?.isMounted && !this._card.isValid && (e.card = this._card.error ??
|
|
1244
|
+
let e = {}, { t: n } = t();
|
|
1245
|
+
return this._card?.isMounted && !this._card.isValid && (e.card = this._card.error ?? n("validation.cardNumberInvalid")), this._email?.isMounted && !this._email.isValid && (e.email = this._email.error ?? n("validation.emailInvalid")), this._phone?.isMounted && !this._phone.isValid && (e.phone = this._phone.error ?? n("validation.phoneNumberInvalid")), this._addressStreet?.isMounted && !this._addressStreet.isValid && (e["address.street"] = this._addressStreet.error ?? n("validation.addressLine1Required")), this._addressCity?.isMounted && !this._addressCity.isValid && (e["address.city"] = this._addressCity.error ?? n("validation.townCityRequired")), this._addressCountry?.isMounted && !this._addressCountry.isValid && (e["address.country"] = this._addressCountry.error ?? n("validation.countryRequired")), this._addressFirstName?.isMounted && !this._addressFirstName.isValid && (e["address.firstName"] = this._addressFirstName.error ?? n("validation.firstNameRequired")), this._addressLastName?.isMounted && !this._addressLastName.isValid && (e["address.lastName"] = this._addressLastName.error ?? n("validation.lastNameRequired")), this._cardholderName?.isMounted && !this._cardholderName.isValid && (e.cardholderName = this._cardholderName.error ?? n("validation.nameRequired")), this._addressState?.isMounted && !this._addressState.isValid && (e["address.state"] = this._addressState.error ?? n("validation.stateRequired")), this._addressZipCode?.isMounted && !this._addressZipCode.isValid && (e["address.zipCode"] = this._addressZipCode.error ?? n("validation.postalCodeRequired")), this._applePay?.isMounted && !this._applePay.isValid && (e.applePay = "Apple Pay authorization required"), this._paypal?.isMounted && !this._paypal.isValid && (e.paypal = "PayPal authorization required"), {
|
|
1199
1246
|
valid: Object.keys(e).length === 0,
|
|
1200
1247
|
errors: e
|
|
1201
1248
|
};
|
|
@@ -1261,7 +1308,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1261
1308
|
let t = e["--odus-font-family"];
|
|
1262
1309
|
if (t) {
|
|
1263
1310
|
this._fontCleanup?.();
|
|
1264
|
-
let { cleanup: e } =
|
|
1311
|
+
let { cleanup: e } = s({ fontFamily: t });
|
|
1265
1312
|
this._fontCleanup = e;
|
|
1266
1313
|
}
|
|
1267
1314
|
for (let t of this._allElements()) t.setTheme(e);
|
|
@@ -1306,6 +1353,7 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1306
1353
|
].filter((e) => e !== void 0);
|
|
1307
1354
|
}
|
|
1308
1355
|
async _executeAuthorization({ formData: e, applePayData: t, customCustomerData: n }) {
|
|
1356
|
+
this._emitLoadingState(!0);
|
|
1309
1357
|
try {
|
|
1310
1358
|
let r = await this._apiService.authorizePayment({
|
|
1311
1359
|
paymentId: this._paymentState.paymentId,
|
|
@@ -1318,8 +1366,15 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1318
1366
|
this._handlePaymentResponse(r);
|
|
1319
1367
|
} catch (e) {
|
|
1320
1368
|
this._handleAuthorizationError(e);
|
|
1369
|
+
} finally {
|
|
1370
|
+
this._emitLoadingState(!1);
|
|
1321
1371
|
}
|
|
1322
1372
|
}
|
|
1373
|
+
_emitLoadingState(e) {
|
|
1374
|
+
try {
|
|
1375
|
+
this._callbacks.onLoadingStateChange?.(e);
|
|
1376
|
+
} catch {}
|
|
1377
|
+
}
|
|
1323
1378
|
_handlePaymentResponse(e) {
|
|
1324
1379
|
if (e.latestTransaction.status === "authorized") {
|
|
1325
1380
|
this._callbacks.onPaymentSucceeded?.(e.latestTransaction.status);
|
|
@@ -1337,4 +1392,4 @@ var x = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family,inhe
|
|
|
1337
1392
|
}
|
|
1338
1393
|
};
|
|
1339
1394
|
//#endregion
|
|
1340
|
-
export {
|
|
1395
|
+
export { D as AddressCityElement, k as AddressCountryElement, A as AddressFirstNameElement, j as AddressLastNameElement, N as AddressStateElement, P as AddressStreetElement, F as AddressZipCodeElement, L as ApplePayElement, E as BaseElement, G as CardElement, K as CardholderElement, J as EmailElement, X as ErrorElement, ae as OdusElements, Q as PayPalElement, $ as PhoneElement };
|