@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
174 lines (172 loc) • 5.51 kB
JavaScript
/**
* VERSION: 2.154.0-alpha.1
* BUILD_TIMESTAMP: 1763401626706
* BUILD_DATE: Mon Nov 17 2025 17:47:06 GMT+0000 (Coordinated Universal Time)
* BUILD_COMMIT: 73f4468155aaed0f31ab0d59dc3394018b939b6d
*/
import { k as g, j as e, N as x, O as E, m as N, x as j, a2 as T, f as d, a7 as M, a4 as I, o as n, T as y, U as i, a5 as k, E as F, n as D, Y as P, a8 as V, X as f, Z as O, _ as z, $ as B, p as L, V as A } from "./es6-OV3Jb0XZ.js";
import { useEffect as R } from "react";
import { FormattedHTMLMessage as r } from "react-intl";
const W = ({
verificationService: a
}) => {
const { viewModel: o } = a, { fieldValidationErrors: l } = a, m = a.verificationResponse, p = g(m), h = E(), u = o.localeChoice.value, t = (s, C) => {
const b = {
[s]: C
};
a.updateViewModel(b, { partial: !0 });
};
return R(() => {
a.programTheme.idCheckAddOnEnabled ? t("fieldsToSkipValidation", []) : (t("birthDate", ""), t("fieldsToSkipValidation", ["birthDate"]));
}, [a.programTheme.idCheckAddOnEnabled]), /* @__PURE__ */ e.jsxs(
x,
{
verificationService: a,
step: m.currentStep,
children: [
/* @__PURE__ */ e.jsx(
N,
{
verificationService: a,
classNameIdentifier: "teacher-personal-info"
}
),
/* @__PURE__ */ e.jsx(j, { verificationService: a }),
/* @__PURE__ */ e.jsx(
T,
{
verificationService: a,
disabled: d("country")?.disabled
}
),
/* @__PURE__ */ e.jsx(
M,
{
value: a.viewModel.organization,
verificationService: a,
isErrored: !!l.organization,
disabled: d("organization")?.disabled,
onChange: (s) => {
I(s, a), n("organization", s, a);
}
}
),
/* @__PURE__ */ e.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ e.jsx(
y,
{
value: o.firstName,
isErrored: !!l.firstName,
disabled: d("firstName")?.disabled,
onChange: (s) => {
t("firstName", s), n("firstName", s, a);
}
}
),
/* @__PURE__ */ e.jsx(
i,
{
value: o.lastName,
isErrored: !!l.lastName,
disabled: d("lastName")?.disabled,
onChange: (s) => {
t("lastName", s), n("lastName", s, a);
}
}
)
] }),
a.programTheme.idCheckAddOnEnabled ? /* @__PURE__ */ e.jsx(
k,
{
errorId: l.birthDate,
locale: u,
disabled: d("birthDate")?.disabled,
onChange: (s) => {
t("birthDate", s), n("birthDate", s, a);
},
value: o.birthDate
}
) : null,
/* @__PURE__ */ e.jsx(
F,
{
value: o.email,
isErrored: !!l.email,
explanation: /* @__PURE__ */ e.jsx(
r,
{
id: "emailExplanation",
defaultMessage: "Must be your school-issued email address"
}
),
onChange: (s) => {
t("email", s), n("email", s, a);
},
onKeyDown: (s) => D(s),
disabled: d("email")?.disabled
}
),
a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ e.jsx(
P,
{
isRequired: !!a.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!l.phoneNumber,
onChange: (s) => {
t("phoneNumber", s), n("phoneNumber", s, a);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: d("phoneNumber")?.disabled
}
) : null,
V(a.programTheme, o) ? /* @__PURE__ */ e.jsx(
f,
{
isErrored: !!l.postalCode,
onChange: (s) => {
t("postalCode", s), n("postalCode", s, a);
},
value: o.postalCode,
disabled: d("postalCode")?.disabled
}
) : null,
h.customFormFields.map((s) => /* @__PURE__ */ e.jsx(O, { config: s, verificationService: a })),
/* @__PURE__ */ e.jsx(
z,
{
verificationService: a,
isErrored: !!l.marketConsentValue,
onChange: (s) => {
t("metadata", {
...a.viewModel.metadata,
marketConsentValue: s
}), n("marketConsentValue", s, a);
},
viewModel: o,
disabled: d("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ e.jsx(B, { verificationService: a, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ e.jsx(
L,
{
step: A.collectTeacherPersonalInfo,
verificationService: a,
viewModel: o,
failedInstantMatch: p,
buttonText: /* @__PURE__ */ e.jsx(
r,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Teacher Status"
}
)
}
)
]
}
);
}, w = W;
export {
w as default
};