@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
194 lines (192 loc) • 6.27 kB
JavaScript
/**
* WARNING: This file is intended to be used within MySheerID.
* This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID.
*/
/**
* VERSION: 2.230.0-alpha.0
* BUILD_TIMESTAMP: 1778694697559
* BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9
*/
import { m as M, g as t, R as g, j as a, P as I, _ as j, o as n, n as N, F as b, U as E, V as f, p as F, e as y } from "../_mysheerid-preview.js";
import { F as P, L as V, P as T, a as k, M as D, C as R } from "./CaptchaComponent-CnWyxiTy.js";
import { E as q, P as z } from "./PersonalInfoStepSubmitButton-v_kWLmEw.js";
import { B } from "./militaryStepHelpers-jW2_4c1l.js";
import { M as L } from "./MemberIdComponent-oanWSvQh.js";
import { C as O } from "./ChangeLocaleComponent-Cu2DR-Q3.js";
import { M as w } from "./MembershipOrganizationComponent-yu-UNXIK.js";
import { C as W } from "./CountryComponentWrapper--2UQ7mXP.js";
import { P as H } from "./PersonalInfoStepWrapper-BOBNCgik.js";
const K = ({ verificationService: s }) => {
const o = s.viewModel, { fieldValidationErrors: d } = s, p = s.verificationResponse, u = M(p), C = y(), l = t("memberId")?.requireIfOptional, i = o.localeChoice.value, m = (e, r) => {
const h = F(
o,
(x) => {
x[e] = r;
}
);
s.updateViewModel(h);
};
return g.useEffect(() => {
const e = (s.viewModel?.fieldsToSkipValidation || []).filter(
(r) => r !== "memberId"
);
l ? s.updateViewModel({ fieldsToSkipValidation: e }, { partial: !0 }) : s.updateViewModel(
{ fieldsToSkipValidation: [...e, "memberId"] },
{ partial: !0 }
);
}, [l]), /* @__PURE__ */ a.jsxs(
H,
{
verificationService: s,
step: p.currentStep,
children: [
/* @__PURE__ */ a.jsx(
I,
{
verificationService: s,
classNameIdentifier: "member-personal-info"
}
),
/* @__PURE__ */ a.jsx(O, { verificationService: s }),
/* @__PURE__ */ a.jsx(
W,
{
verificationService: s,
disabled: t("country")?.disabled
}
),
/* @__PURE__ */ a.jsx(
w,
{
value: s.viewModel.organization,
verificationService: s,
isErrored: !!d.organization,
disabled: t("organization")?.disabled,
onChange: (e) => {
j(e, s), n("organization", e, s);
}
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
P,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: t("firstName")?.disabled,
onChange: (e) => {
m("firstName", e), n("firstName", e, s);
}
}
),
/* @__PURE__ */ a.jsx(
V,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: t("lastName")?.disabled,
onChange: (e) => {
m("lastName", e), n("lastName", e, s);
}
}
)
] }),
/* @__PURE__ */ a.jsx(
q,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ a.jsx(b, { id: "emailExplanation", defaultMessage: " " }),
onChange: (e) => {
m("email", e), n("email", e, s);
},
onKeyDown: (e) => N(e),
disabled: t("email")?.disabled
}
),
/* @__PURE__ */ a.jsx(
B,
{
errorId: d.birthDate,
locale: i,
isRequired: t("birthDate")?.requireIfOptional,
onChange: (e) => {
m("birthDate", e), n("birthDate", e, s);
},
value: o.birthDate,
disabled: t("birthDate")?.disabled
}
),
/* @__PURE__ */ a.jsx(
L,
{
value: o.memberId,
isErrored: !!d.memberId,
isRequired: l,
disabled: t("memberId")?.disabled,
onChange: (e) => {
m("memberId", e), n("memberId", e, s);
}
}
),
s.programTheme.isSmsNotifierConfigured || s.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
T,
{
isRequired: !!s.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (e) => {
m("phoneNumber", e), n("phoneNumber", e, s);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: t("phoneNumber")?.disabled
}
) : null,
C.customFormFields.map((e) => /* @__PURE__ */ a.jsx(k, { config: e, verificationService: s })),
/* @__PURE__ */ a.jsx(
D,
{
verificationService: s,
isErrored: !!d.marketConsentValue,
onChange: (e) => {
m("metadata", {
...s.viewModel.metadata,
marketConsentValue: e
}), n("marketConsentValue", e, s);
},
viewModel: o,
disabled: t("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ a.jsx(E, { verificationService: s, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
R,
{
verificationService: s,
isErrored: !!d.captchaToken
}
),
/* @__PURE__ */ a.jsx(
z,
{
step: f.collectMemberPersonalInfo,
verificationService: s,
viewModel: o,
failedInstantMatch: u,
buttonText: /* @__PURE__ */ a.jsx(
b,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Membership Status"
}
)
}
)
]
}
);
}, $ = K;
export {
$ as default
};