@sheerid/jslib-nightly
Version:
SheerID JavaScript Library
219 lines (217 loc) • 6.93 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 { j as a, N as h, O as x, m as y, x as i, a2 as E, f as t, as as u, at as j, a4 as N, o as n, T as M, U as I, W as T, ac as F, au as k, av as P, X as V, E as f, n as A, Y as R, Z as z, _ as B, $ as L, p as q, V as w, r as D } from "./es6-OV3Jb0XZ.js";
import { injectIntl as O, FormattedHTMLMessage as p } from "react-intl";
const W = ({
intl: C,
verificationService: e
}) => {
const o = e.viewModel, { fieldValidationErrors: d } = e, b = x(), m = (s, r) => {
const l = D(
o,
(g) => {
g[s] = r;
}
);
e.updateViewModel(l);
};
return /* @__PURE__ */ a.jsxs(
h,
{
verificationService: e,
step: e.verificationResponse.currentStep,
children: [
/* @__PURE__ */ a.jsx(
y,
{
verificationService: e,
classNameIdentifier: "employment"
}
),
/* @__PURE__ */ a.jsx(i, { verificationService: e }),
/* @__PURE__ */ a.jsx(
E,
{
verificationService: e,
disabled: t("country")?.disabled,
viewModelDraftDecorator: (s, r) => {
const l = s;
l.shouldCollectAddress = u(
r,
e.programTheme.config.countries
), l.shouldCollectAddress ? l.fieldsToSkipValidation = void 0 : (l.address1 = "", l.city = "", l.state = "", l.postalCode = "", l.fieldsToSkipValidation = ["address1", "city", "state", "postalCode"]);
}
}
),
/* @__PURE__ */ a.jsx(
j,
{
value: e.viewModel.organization,
verificationService: e,
isErrored: !!d.organization,
disabled: t("organization")?.disabled,
onChange: (s) => {
N(s, e), n("organization", s, e);
}
}
),
/* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
/* @__PURE__ */ a.jsx(
M,
{
value: o.firstName,
isErrored: !!d.firstName,
disabled: t("firstName")?.disabled,
onChange: (s) => {
m("firstName", s), n("firstName", s, e);
}
}
),
/* @__PURE__ */ a.jsx(
I,
{
value: o.lastName,
isErrored: !!d.lastName,
disabled: t("lastName")?.disabled,
onChange: (s) => {
m("lastName", s), n("lastName", s, e);
}
}
)
] }),
u(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsx(
T,
{
isErrored: !!d.address1,
errorId: d.address1,
onChange: (s) => {
m("address1", s), n("address1", s, e);
},
isRequired: !0,
value: o.address1,
disabled: t("address1")?.disabled,
explanation: /* @__PURE__ */ a.jsx(p, { id: "addressExplanation", defaultMessage: "Use your home address" })
}
) : null,
u(
o.countryChoice,
e.programTheme.config.countries
) ? /* @__PURE__ */ a.jsxs("div", { className: "sid-thirds", children: [
/* @__PURE__ */ a.jsx(
F,
{
isErrored: !!d.city,
errorId: d.city,
onChange: (s) => {
m("city", s), n("city", s, e);
},
value: o.city,
isRequired: !0,
disabled: t("city")?.disabled
}
),
/* @__PURE__ */ a.jsx(
k,
{
isRequired: !0,
options: P(e.programTheme, C),
value: o.state || void 0,
isErrored: !!d.state,
onChange: async (s) => {
const r = s ? s.value : void 0;
m("state", r), n("state", r, e);
},
label: /* @__PURE__ */ a.jsx(p, { id: "state", defaultMessage: "State" }),
disabled: t("state")?.disabled
}
),
/* @__PURE__ */ a.jsx(
V,
{
isErrored: !!d.postalCode,
onChange: (s) => {
m("postalCode", s), n("postalCode", s, e);
},
value: o.postalCode,
disabled: t("postalCode")?.disabled
}
)
] }) : null,
/* @__PURE__ */ a.jsx(
f,
{
value: o.email,
isErrored: !!d.email,
explanation: /* @__PURE__ */ a.jsx(
p,
{
id: "emailExplanation",
defaultMessage: "Use your work email if you have one"
}
),
onChange: (s) => {
m("email", s), n("email", s, e);
},
onKeyDown: (s) => A(s),
disabled: t("email")?.disabled
}
),
e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
R,
{
isRequired: !!e.programTheme.smsLoopEnabled,
value: o.phoneNumber,
isErrored: !!d.phoneNumber,
onChange: (s) => {
m("phoneNumber", s), n("phoneNumber", s, e);
},
selectedCountryCode: o.countryChoice && o.countryChoice.value,
disabled: t("phoneNumber")?.disabled
}
) : null,
b.customFormFields.map((s) => /* @__PURE__ */ a.jsx(z, { config: s, verificationService: e })),
/* @__PURE__ */ a.jsx(
B,
{
verificationService: e,
isErrored: !!d.marketConsentValue,
onChange: (s) => {
m("metadata", {
...e.viewModel.metadata,
marketConsentValue: s
}), n("marketConsentValue", s, e);
},
viewModel: o,
disabled: t("marketConsentValue")?.disabled
}
),
/* @__PURE__ */ a.jsx(L, { verificationService: e, suffix: "CollectAboveSubmit" }),
/* @__PURE__ */ a.jsx(
q,
{
step: w.collectEmployeePersonalInfo,
verificationService: e,
viewModel: o,
buttonText: /* @__PURE__ */ a.jsx(
p,
{
id: "step.personalInfo.submitButtonText",
defaultMessage: "Verify My Employment Status"
}
)
}
)
]
}
);
}, K = O(W);
export {
K as default
};