UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

225 lines (223 loc) • 7.04 kB
/** * VERSION: 2.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000305348 * BUILD_DATE: Sat Sep 27 2025 19:11:45 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { i as A, h as D, j as a, v as O, w as F, P as _, x as V, T as k, g as t, a3 as z, f as l, W as B, y as G, z as H, X as W, D as c, b as p, E as w, e as K, G as q, H as U, M as X, I as J, k as Q, V as S, n as Y } from "../sheerid.js"; import { L as Z } from "./LicensedProfessionalOrganizationComponent-CiYU-2dW.js"; const $ = { LICENSED_COSMETOLOGIST: "Licensed Cosmetologist", LICENSED_REAL_ESTATE_AGENT: "Licensed Real Estate Agent", VETERINARIAN: "Veterinarian", CHILD_CARE_WORKER: "Child Care Worker", LIBRARIAN: "Librarian", INTERIOR_DESIGNER: "Interior Designer", ARCHITECT: "Architect", GENERAL_CONTRACTOR: "General Contractor", NUTRITION_PROFESSIONAL: "Nutrition Professional" }, v = ({ intl: j, verificationService: e }) => { var C, b, E, g, h, N, x, I, L, f; const o = e.viewModel, { fieldValidationErrors: n } = e, u = e.verificationResponse, M = D(u), R = o.localeChoice.value, T = F(), d = (s, r) => { const m = Y( o, (y) => { y[s] = r; } ); e.updateViewModel(m); }, i = (s) => s ? j.formatHTMLMessage({ id: s, defaultMessage: $[s] }) : "", P = () => { const s = u.availableStatuses, r = []; if (s) for (const m of s) r.push({ value: m, label: i(m) }); return r; }; return /* @__PURE__ */ a.jsxs( O, { verificationService: e, step: u.currentStep, children: [ /* @__PURE__ */ a.jsx( _, { verificationService: e, classNameIdentifier: "licensed-professional" } ), /* @__PURE__ */ a.jsx(V, { verificationService: e }), /* @__PURE__ */ a.jsx( k, { verificationService: e, disabled: (C = t("country")) == null ? void 0 : C.disabled } ), /* @__PURE__ */ a.jsx( z, { segmentId: "licensed-professional", value: { value: o.statuses ? o.statuses[0] : "", label: o.statuses ? i(o.statuses[0]) : "" }, isErrored: !!n.statuses, options: P(), disabled: (b = t("statuses")) == null ? void 0 : b.disabled, onChange: (s) => { const r = s ? [s.value] : []; d("statuses", r), l( "statuses", s ? s.value : "", e ); } } ), /* @__PURE__ */ a.jsx( Z, { isErrored: !!n.organization, onChange: (s) => { B(s, e), l("organization", s, e); }, value: e.viewModel.organization, verificationService: e, disabled: (E = t("organization")) == null ? void 0 : E.disabled } ), /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ a.jsx( G, { value: o.firstName, isErrored: !!n.firstName, disabled: (g = t("firstName")) == null ? void 0 : g.disabled, onChange: (s) => { d("firstName", s), l("firstName", s, e); } } ), /* @__PURE__ */ a.jsx( H, { value: o.lastName, isErrored: !!n.lastName, disabled: (h = t("lastName")) == null ? void 0 : h.disabled, onChange: (s) => { d("lastName", s), l("lastName", s, e); } } ) ] }), /* @__PURE__ */ a.jsx( W, { errorId: n.birthDate, locale: R, onChange: (s) => { d("birthDate", s), l("birthDate", s, e); }, value: o.birthDate, disabled: (N = t("birthDate")) == null ? void 0 : N.disabled } ), /* @__PURE__ */ a.jsx( c, { isErrored: !!n.postalCode, onChange: (s) => { d("postalCode", s), l("postalCode", s, e); }, value: o.postalCode, disabled: (x = t("postalCode")) == null ? void 0 : x.disabled, explanation: /* @__PURE__ */ a.jsx( p, { id: "postalCodeExplanation", defaultMessage: "Use the location on file with your licensing body" } ) } ), /* @__PURE__ */ a.jsx( w, { value: o.email, isErrored: !!n.email, explanation: /* @__PURE__ */ a.jsx( p, { id: "emailExplanation", defaultMessage: "Needed to send you your unique code" } ), onChange: (s) => { d("email", s), l("email", s, e); }, onKeyDown: (s) => K(s), disabled: (I = t("email")) == null ? void 0 : I.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( q, { isRequired: !!e.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!n.phoneNumber, onChange: (s) => { d("phoneNumber", s), l("phoneNumber", s, e); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: (L = t("phoneNumber")) == null ? void 0 : L.disabled } ) : null, T.customFormFields.map((s) => /* @__PURE__ */ a.jsx(U, { config: s, verificationService: e })), /* @__PURE__ */ a.jsx( X, { verificationService: e, isErrored: !!n.marketConsentValue, onChange: (s) => { d("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), l("marketConsentValue", s, e); }, viewModel: o, disabled: (f = t("marketConsentValue")) == null ? void 0 : f.disabled } ), /* @__PURE__ */ a.jsx(J, { suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( Q, { step: S.collectLicensedProfessionalPersonalInfo, verificationService: e, viewModel: o, failedInstantMatch: M, buttonText: /* @__PURE__ */ a.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Licensed Professional Status" } ) } ) ] } ); }, as = A( v ); export { as as default };