@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
191 lines (189 loc) • 6.18 kB
JavaScript
/**
* 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 { m as g, b as x, j as e, P as E, g as l, _ as j, o as n, n as N, F as p, U as T, V as i, e as M } from "../sheerid.js";
import { s as P } from "./FormFieldTypeahead-C6eS7yJg.js";
import { B as f } from "./militaryStepHelpers-0OUuQpBw.js";
import { C as F } from "./ChangeLocaleComponent-DUnfgQuX.js";
import { C as I } from "./CountryComponentWrapper-Ceq-eink.js";
import { E as k, P as y } from "./PersonalInfoStepSubmitButton-j44RdZDq.js";
import { F as D, L as V, P as B, a as L, M as O, C as z } from "./CaptchaComponent-SmUa6m52.js";
import { P as A } from "./PostalCodeComponent-DrCcV90W.js";
import { T as R } from "./TeacherSchoolComponent-BSHPjiwQ.js";
import { P as W } from "./PersonalInfoStepWrapper-PV06WMKL.js";
const w = ({
verificationService: a
}) => {
const { viewModel: o } = a, { fieldValidationErrors: d } = a, r = a.verificationResponse, h = g(r), C = M(), u = o.localeChoice.value, t = (s, m) => {
const b = {
[s]: m
};
a.updateViewModel(b, { partial: !0 });
};
return x.useEffect(() => {
const s = (a.viewModel?.fieldsToSkipValidation || []).filter(
(m) => m !== "birthDate"
);
a.programTheme.idCheckAddOnEnabled ? t("fieldsToSkipValidation", s) : (t("birthDate", ""), t("fieldsToSkipValidation", [...s, "birthDate"]));
}, [a.programTheme.idCheckAddOnEnabled]), /* @__PURE__ */ e.jsxs(
W,
{
verificationService: a,
step: r.currentStep,
children: [
/* @__PURE__ */ e.jsx(
E,
{
verificationService: a,
classNameIdentifier: "teacher-personal-info"
}
),
/* @__PURE__ */ e.jsx(F, { verificationService: a }),
/* @__PURE__ */ e.jsx(
I,
{
verificationService: a,
disabled: l("country")?.disabled
}
),
/* @__PURE__ */ e.jsx(
R,
{
value: a.viewModel.organization,
verificationService: a,
isErrored: !!d.organization,
disabled: l("organization")?.disabled,
onChange: (s) => {
j(s, a), n("organization", s, a);
}
}
),
/* @__PURE__ */ e.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ e.jsx(
D,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: l("firstName")?.disabled,
onChange: (s) => {
t("firstName", s), n("firstName", s, a);
}
}
),
/* @__PURE__ */ e.jsx(
V,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: l("lastName")?.disabled,
onChange: (s) => {
t("lastName", s), n("lastName", s, a);
}
}
)
] }),
a.programTheme.idCheckAddOnEnabled ? /* @__PURE__ */ e.jsx(
f,
{
errorId: d.birthDate,
locale: u,
disabled: l("birthDate")?.disabled,
onChange: (s) => {
t("birthDate", s), n("birthDate", s, a);
},
value: o.birthDate
}
) : null,
/* @__PURE__ */ e.jsx(
k,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ e.jsx(
p,
{
id: "emailExplanation",
defaultMessage: "Must be your school-issued email address"
}
),
onChange: (s) => {
t("email", s), n("email", s, a);
},
onKeyDown: (s) => N(s),
disabled: l("email")?.disabled
}
),
a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ e.jsx(
B,
{
isRequired: !!a.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (s) => {
t("phoneNumber", s), n("phoneNumber", s, a);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: l("phoneNumber")?.disabled
}
) : null,
P(a.programTheme, o) ? /* @__PURE__ */ e.jsx(
A,
{
isErrored: !!d.postalCode,
onChange: (s) => {
t("postalCode", s), n("postalCode", s, a);
},
value: o.postalCode,
disabled: l("postalCode")?.disabled
}
) : null,
C.customFormFields.map((s) => /* @__PURE__ */ e.jsx(L, { config: s, verificationService: a })),
/* @__PURE__ */ e.jsx(
O,
{
verificationService: a,
isErrored: !!d.marketConsentValue,
onChange: (s) => {
t("metadata", {
...a.viewModel.metadata,
marketConsentValue: s
}), n("marketConsentValue", s, a);
},
viewModel: o,
disabled: l("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ e.jsx(T, { verificationService: a, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ e.jsx(
z,
{
verificationService: a,
isErrored: !!d.captchaToken
}
),
/* @__PURE__ */ e.jsx(
y,
{
step: i.collectTeacherPersonalInfo,
verificationService: a,
viewModel: o,
failedInstantMatch: h,
buttonText: /* @__PURE__ */ e.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Teacher Status"
}
)
}
)
]
}
);
}, Z = w;
export {
Z as default
};