UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

219 lines (217 loc) • 7.19 kB
/** * VERSION: 2.113.0-alpha.0 * BUILD_TIMESTAMP: 1750184600854 * BUILD_DATE: Tue Jun 17 2025 18:23:20 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 896154e79f58fffa6d52f3ed37f2db760a63df88 */ import { i as P, j as a, t as k, v as V, P as f, w as z, Q as A, g as t, a3 as u, a4 as B, U as R, u as n, x as w, y as D, z as L, b as p, a0 as q, a5 as H, a6 as O, B as U, E as W, e as K, D as G, G as Q, M as J, H as X, f as Y, V as Z, m as _ } from "../sheerid.js"; const $ = ({ intl: I, verificationService: e }) => { var C, b, g, h, x, y, i, E, j, N, M; const o = e.viewModel, { fieldValidationErrors: d } = e, T = V(), m = (s, r) => { const l = _( o, (F) => { F[s] = r; } ); e.updateViewModel(l); }; return /* @__PURE__ */ a.jsxs( k, { verificationService: e, step: e.verificationResponse.currentStep, children: [ /* @__PURE__ */ a.jsx( f, { verificationService: e, classNameIdentifier: "employment" } ), /* @__PURE__ */ a.jsx(z, { verificationService: e }), /* @__PURE__ */ a.jsx( A, { verificationService: e, disabled: (C = t("country")) == null ? void 0 : C.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( B, { value: e.viewModel.organization, verificationService: e, isErrored: !!d.organization, disabled: (b = t("organization")) == null ? void 0 : b.disabled, onChange: (s) => { R(s, e), n("organization", s, e); } } ), /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ a.jsx( w, { value: o.firstName, isErrored: !!d.firstName, disabled: (g = t("firstName")) == null ? void 0 : g.disabled, onChange: (s) => { m("firstName", s), n("firstName", s, e); } } ), /* @__PURE__ */ a.jsx( D, { value: o.lastName, isErrored: !!d.lastName, disabled: (h = t("lastName")) == null ? void 0 : h.disabled, onChange: (s) => { m("lastName", s), n("lastName", s, e); } } ) ] }), u( o.countryChoice, e.programTheme.config.countries ) ? /* @__PURE__ */ a.jsx( L, { isErrored: !!d.address1, errorId: d.address1, onChange: (s) => { m("address1", s), n("address1", s, e); }, isRequired: !0, value: o.address1, disabled: (x = t("address1")) == null ? void 0 : x.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( q, { isErrored: !!d.city, errorId: d.city, onChange: (s) => { m("city", s), n("city", s, e); }, value: o.city, isRequired: !0, disabled: (y = t("city")) == null ? void 0 : y.disabled } ), /* @__PURE__ */ a.jsx( H, { isRequired: !0, options: O(e.programTheme, I), 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: (i = t("state")) == null ? void 0 : i.disabled } ), /* @__PURE__ */ a.jsx( U, { isErrored: !!d.postalCode, onChange: (s) => { m("postalCode", s), n("postalCode", s, e); }, value: o.postalCode, disabled: (E = t("postalCode")) == null ? void 0 : E.disabled } ) ] }) : null, /* @__PURE__ */ a.jsx( W, { 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) => K(s), disabled: (j = t("email")) == null ? void 0 : j.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( G, { 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: (N = t("phoneNumber")) == null ? void 0 : N.disabled } ) : null, T.customFormFields.map((s) => /* @__PURE__ */ a.jsx(Q, { config: s, verificationService: e })), /* @__PURE__ */ a.jsx( J, { verificationService: e, isErrored: !!d.marketConsentValue, onChange: (s) => { m("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), n("marketConsentValue", s, e); }, viewModel: o, disabled: (M = t("marketConsentValue")) == null ? void 0 : M.disabled } ), /* @__PURE__ */ a.jsx(X, { verificationService: e, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( Y, { step: Z.collectEmployeePersonalInfo, verificationService: e, viewModel: o, buttonText: /* @__PURE__ */ a.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Employment Status" } ) } ) ] } ); }, S = P($); export { S as default };