UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

199 lines (197 loc) • 6.55 kB
/** * VERSION: 2.230.0-alpha.0 * BUILD_TIMESTAMP: 1778694684677 * BUILD_DATE: Wed May 13 2026 17:51:24 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9 */ import { i as I, m as F, $ as P, a0 as M, h as c, R, o as d, j as o, P as D, g as r, n as A, F as u, U as T, V, x as k, e as q } from "../sheerid.js"; import { u as B } from "./useCollectFieldsEndpoint-DqTjyVEr.js"; import { F as L, L as U, P as W, a as w, M as H, C as K } from "./CaptchaComponent-SmUa6m52.js"; import { E as O, P as $ } from "./PersonalInfoStepSubmitButton-j44RdZDq.js"; import { B as z } from "./militaryStepHelpers-0OUuQpBw.js"; import { P as G } from "./PostalCodeComponent-DrCcV90W.js"; import { C as J } from "./CountryComponentWrapper-Ceq-eink.js"; import { C as Q } from "./City-yVVnZQTP.js"; import { A as X } from "./AddressComponent-AiyIPiCz.js"; import { C as Y } from "./ChangeLocaleComponent-DUnfgQuX.js"; import { P as Z } from "./PersonalInfoStepWrapper-PV06WMKL.js"; const _ = ({ verificationService: s, intl: C }) => { const a = s.viewModel, { fieldValidationErrors: t } = s, l = s.verificationResponse, h = F(l), i = P( s.programTheme, C ), b = M(i), m = c(() => a.countryChoice.value, b.value), g = m === "US" ? [{ key: "postalCode" }] : [], x = m !== "US" || s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled, N = m !== "US" || s.programTheme.smsLoopEnabled, y = a.localeChoice.value, j = q(); !t.phoneNumber && l.errorIds && l.errorIds.includes("invalidPhoneNumber") && s.updateFieldValidationErrors({ ...t, phoneNumber: "invalidPhoneNumber" }); const n = (e, E) => { const f = k(a, e, E); s.updateViewModel(f); }, { isFieldRequired: p } = B({ verificationId: l.verificationId, currentStep: l.currentStep, viewModel: a, defaultRequiredFields: g }); return R.useEffect(() => { d("phoneNumber", a.phoneNumber, s); }, [a.country]), /* @__PURE__ */ o.jsxs( Z, { verificationService: s, step: l.currentStep, children: [ /* @__PURE__ */ o.jsx(D, { verificationService: s, classNameIdentifier: "age" }), /* @__PURE__ */ o.jsx(Y, { verificationService: s }), /* @__PURE__ */ o.jsx( J, { verificationService: s, disabled: r("country")?.disabled } ), /* @__PURE__ */ o.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ o.jsx( L, { value: a.firstName, isErrored: !!t.firstName, disabled: r("firstName")?.disabled, onChange: (e) => { n("firstName", e), d("firstName", e, s); } } ), /* @__PURE__ */ o.jsx( U, { value: a.lastName, isErrored: !!t.lastName, disabled: r("lastName")?.disabled, onChange: (e) => { n("lastName", e), d("lastName", e, s); } } ) ] }), /* @__PURE__ */ o.jsx( z, { errorId: t.birthDate, locale: y, onChange: (e) => { n("birthDate", e), d("birthDate", e, s); }, value: a.birthDate, disabled: r("birthDate")?.disabled } ), p("city") && /* @__PURE__ */ o.jsx( Q, { value: a.city, isRequired: !0, isErrored: !!t.city, errorId: t.city, disabled: r("city")?.disabled, onChange: (e) => { n("city", e), d("city", e, s); } } ), p("address1") && /* @__PURE__ */ o.jsx( X, { value: a.address1, isRequired: !0, isErrored: !!t.address1, errorId: t.address1, onChange: (e) => { n("address1", e), d("address1", e, s); } } ), p("postalCode") && /* @__PURE__ */ o.jsx( G, { isErrored: !!t.postalCode, onChange: (e) => { n("postalCode", e), d("postalCode", e, s); }, value: a.postalCode, disabled: r("postalCode")?.disabled } ), /* @__PURE__ */ o.jsx( O, { value: a.email, isErrored: !!t.email, explanation: /* @__PURE__ */ o.jsx(u, { id: "emailExplanation", defaultMessage: " " }), onChange: (e) => { n("email", e), d("email", e, s); }, onKeyDown: (e) => A(e), disabled: r("email")?.disabled } ), x ? /* @__PURE__ */ o.jsx( W, { isRequired: N, value: a.phoneNumber, isErrored: !!t.phoneNumber, onChange: (e) => { n("phoneNumber", e), d("phoneNumber", e, s); }, selectedCountryCode: a.countryChoice && a.countryChoice.value, disabled: r("phoneNumber")?.disabled } ) : null, j.customFormFields.map((e) => /* @__PURE__ */ o.jsx(w, { config: e, verificationService: s })), /* @__PURE__ */ o.jsx( H, { verificationService: s, isErrored: !!t.marketConsentValue, onChange: (e) => { n("metadata", { ...s.viewModel.metadata, marketConsentValue: e }), d("marketConsentValue", e, s); }, viewModel: a, disabled: r("marketConsentValue")?.disabled } ), /* @__PURE__ */ o.jsx(T, { verificationService: s, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ o.jsx( K, { verificationService: s, isErrored: !!t.captchaToken } ), /* @__PURE__ */ o.jsx( $, { step: V.collectAgePersonalInfo, verificationService: s, viewModel: a, failedInstantMatch: h, buttonText: /* @__PURE__ */ o.jsx( u, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify and continue" } ) } ) ] } ); }, me = I(_); export { me as default };