@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
175 lines (173 loc) • 5.75 kB
JavaScript
/**
* VERSION: 2.113.0-alpha.0
* BUILD_TIMESTAMP: 1750184680813
* BUILD_DATE: Tue Jun 17 2025 18:24:40 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88
*/
import { k as T, f as t, j as s, M as k, N as R, m as q, w as O, a1 as P, a2 as z, a3 as w, u as n, O as B, T as L, E as W, n as _, a4 as H, a5 as K, X as A, Y as X, Z as Y, _ as Z, o as G, V as J, q as Q } from "./es6-B9qAIX4x.js";
import U from "react";
import { FormattedHTMLMessage as j } from "react-intl";
const $ = ({ verificationService: e }) => {
var p, b, u, h, C, i, x, M, g, I, N;
const o = e.viewModel, { fieldValidationErrors: d } = e, r = e.verificationResponse, E = T(r), f = R(), m = (p = t("memberId")) == null ? void 0 : p.requireIfOptional, y = o.localeChoice.value, l = (a, F) => {
const V = Q(
o,
(D) => {
D[a] = F;
}
);
e.updateViewModel(V);
};
return U.useEffect(() => {
m ? e.updateViewModel({ fieldsToSkipValidation: [] }, { partial: !0 }) : e.updateViewModel(
{ fieldsToSkipValidation: ["memberId"] },
{ partial: !0 }
);
}, [m]), /* @__PURE__ */ s.jsxs(
k,
{
verificationService: e,
step: r.currentStep,
children: [
/* @__PURE__ */ s.jsx(
q,
{
verificationService: e,
classNameIdentifier: "member-personal-info"
}
),
/* @__PURE__ */ s.jsx(O, { verificationService: e }),
/* @__PURE__ */ s.jsx(
P,
{
verificationService: e,
disabled: (b = t("country")) == null ? void 0 : b.disabled
}
),
/* @__PURE__ */ s.jsx(
z,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: (u = t("organization")) == null ? void 0 : u.disabled,
onChange: (a) => {
w(a, e), n("organization", a, e);
}
}
),
/* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ s.jsx(
B,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: (h = t("firstName")) == null ? void 0 : h.disabled,
onChange: (a) => {
l("firstName", a), n("firstName", a, e);
}
}
),
/* @__PURE__ */ s.jsx(
L,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: (C = t("lastName")) == null ? void 0 : C.disabled,
onChange: (a) => {
l("lastName", a), n("lastName", a, e);
}
}
)
] }),
/* @__PURE__ */ s.jsx(
W,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ s.jsx(j, { id: "emailExplanation", defaultMessage: " " }),
onChange: (a) => {
l("email", a), n("email", a, e);
},
onKeyDown: (a) => _(a),
disabled: (i = t("email")) == null ? void 0 : i.disabled
}
),
/* @__PURE__ */ s.jsx(
H,
{
errorId: d.birthDate,
locale: y,
isRequired: (x = t("birthDate")) == null ? void 0 : x.requireIfOptional,
onChange: (a) => {
l("birthDate", a), n("birthDate", a, e);
},
value: o.birthDate,
disabled: (M = t("birthDate")) == null ? void 0 : M.disabled
}
),
/* @__PURE__ */ s.jsx(
K,
{
value: o.memberId,
isErrored: !!d.memberId,
isRequired: m,
disabled: (g = t("memberId")) == null ? void 0 : g.disabled,
onChange: (a) => {
l("memberId", a), n("memberId", a, e);
}
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
A,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (a) => {
l("phoneNumber", a), n("phoneNumber", a, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: (I = t("phoneNumber")) == null ? void 0 : I.disabled
}
) : null,
f.customFormFields.map((a) => /* @__PURE__ */ s.jsx(X, { config: a, verificationService: e })),
/* @__PURE__ */ s.jsx(
Y,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (a) => {
l("metadata", {
...e.viewModel.metadata,
marketConsentValue: a
}), n("marketConsentValue", a, e);
},
viewModel: o,
disabled: (N = t("marketConsentValue")) == null ? void 0 : N.disabled
}
),
/* @__PURE__ */ s.jsx(Z, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ s.jsx(
G,
{
step: J.collectMemberPersonalInfo,
verificationService: e,
viewModel: o,
failedInstantMatch: E,
buttonText: /* @__PURE__ */ s.jsx(
j,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Membership Status"
}
)
}
)
]
}
);
}, ee = $;
export {
ee as default
};