UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

173 lines (171 loc) 5.66 kB
/** * VERSION: 2.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000305348 * BUILD_DATE: Sat Sep 27 2025 19:11:45 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { h as R, g as t, R as T, j as s, v as k, w as P, P as z, x as q, T as O, U as w, W as B, f as d, y as L, z as W, E as H, e as K, b as j, X as A, Y as G, G as U, H as X, M as Y, I as J, k as Q, V as Z, n as _ } from "../sheerid.js"; const $ = ({ verificationService: a }) => { var p, b, u, h, C, i, x, g, M, I, N; const o = a.viewModel, { fieldValidationErrors: n } = a, r = a.verificationResponse, E = R(r), y = P(), m = (p = t("memberId")) == null ? void 0 : p.requireIfOptional, f = o.localeChoice.value, l = (e, F) => { const V = _( o, (D) => { D[e] = F; } ); a.updateViewModel(V); }; return T.useEffect(() => { m ? a.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : a.updateViewModel( { fieldsToSkipValidation: ["memberId"] }, { partial: !0 } ); }, [m]), /* @__PURE__ */ s.jsxs( k, { verificationService: a, step: r.currentStep, children: [ /* @__PURE__ */ s.jsx( z, { verificationService: a, classNameIdentifier: "member-personal-info" } ), /* @__PURE__ */ s.jsx(q, { verificationService: a }), /* @__PURE__ */ s.jsx( O, { verificationService: a, disabled: (b = t("country")) == null ? void 0 : b.disabled } ), /* @__PURE__ */ s.jsx( w, { value: a.viewModel.organization, verificationService: a, isErrored: !!n.organization, disabled: (u = t("organization")) == null ? void 0 : u.disabled, onChange: (e) => { B(e, a), d("organization", e, a); } } ), /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ s.jsx( L, { value: o.firstName, isErrored: !!n.firstName, disabled: (h = t("firstName")) == null ? void 0 : h.disabled, onChange: (e) => { l("firstName", e), d("firstName", e, a); } } ), /* @__PURE__ */ s.jsx( W, { value: o.lastName, isErrored: !!n.lastName, disabled: (C = t("lastName")) == null ? void 0 : C.disabled, onChange: (e) => { l("lastName", e), d("lastName", e, a); } } ) ] }), /* @__PURE__ */ s.jsx( H, { value: o.email, isErrored: !!n.email, explanation: /* @__PURE__ */ s.jsx(j, { id: "emailExplanation", defaultMessage: " " }), onChange: (e) => { l("email", e), d("email", e, a); }, onKeyDown: (e) => K(e), disabled: (i = t("email")) == null ? void 0 : i.disabled } ), /* @__PURE__ */ s.jsx( A, { errorId: n.birthDate, locale: f, isRequired: (x = t("birthDate")) == null ? void 0 : x.requireIfOptional, onChange: (e) => { l("birthDate", e), d("birthDate", e, a); }, value: o.birthDate, disabled: (g = t("birthDate")) == null ? void 0 : g.disabled } ), /* @__PURE__ */ s.jsx( G, { value: o.memberId, isErrored: !!n.memberId, isRequired: m, disabled: (M = t("memberId")) == null ? void 0 : M.disabled, onChange: (e) => { l("memberId", e), d("memberId", e, a); } } ), a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx( U, { isRequired: !!a.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!n.phoneNumber, onChange: (e) => { l("phoneNumber", e), d("phoneNumber", e, a); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: (I = t("phoneNumber")) == null ? void 0 : I.disabled } ) : null, y.customFormFields.map((e) => /* @__PURE__ */ s.jsx(X, { config: e, verificationService: a })), /* @__PURE__ */ s.jsx( Y, { verificationService: a, isErrored: !!n.marketConsentValue, onChange: (e) => { l("metadata", { ...a.viewModel.metadata, marketConsentValue: e }), d("marketConsentValue", e, a); }, viewModel: o, disabled: (N = t("marketConsentValue")) == null ? void 0 : N.disabled } ), /* @__PURE__ */ s.jsx(J, { suffix: "CollectAboveSubmit" }), /* @__PURE__ */ s.jsx( Q, { step: Z.collectMemberPersonalInfo, verificationService: a, viewModel: o, failedInstantMatch: E, buttonText: /* @__PURE__ */ s.jsx( j, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Membership Status" } ) } ) ] } ); }, c = $; export { c as default };