UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

226 lines (224 loc) • 7.11 kB
/** * VERSION: 2.130.0-alpha.4 * BUILD_TIMESTAMP: 1759000374473 * BUILD_DATE: Sat Sep 27 2025 19:12:54 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: be6ef87ab40e8747994d32363389cf39e36a4326 */ import { k as y, j as a, N as O, O as D, m as F, x as _, a2 as V, f as t, ac as k, o as l, a4 as c, T as z, U as B, a5 as G, X as H, E as W, n as w, Y as K, Z as U, _ as q, $ as X, p as Y, V as Z, r as $ } from "./es6-N0LU_o1K.js"; import { injectIntl as J, FormattedHTMLMessage as p } from "react-intl"; import { L as Q } from "./LicensedProfessionalOrganizationComponent-CFfFH2gr.js"; const S = { 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, R = y(u), M = o.localeChoice.value, T = D(), d = (s, r) => { const m = $( o, (A) => { A[s] = r; } ); e.updateViewModel(m); }, i = (s) => s ? j.formatHTMLMessage({ id: s, defaultMessage: S[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( F, { verificationService: e, classNameIdentifier: "licensed-professional" } ), /* @__PURE__ */ a.jsx(_, { verificationService: e }), /* @__PURE__ */ a.jsx( V, { verificationService: e, disabled: (C = t("country")) == null ? void 0 : C.disabled } ), /* @__PURE__ */ a.jsx( k, { 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( Q, { isErrored: !!n.organization, onChange: (s) => { c(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( z, { 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( B, { 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( G, { errorId: n.birthDate, locale: M, onChange: (s) => { d("birthDate", s), l("birthDate", s, e); }, value: o.birthDate, disabled: (N = t("birthDate")) == null ? void 0 : N.disabled } ), /* @__PURE__ */ a.jsx( H, { 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) => w(s), disabled: (I = t("email")) == null ? void 0 : I.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( K, { 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( q, { 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(X, { suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( Y, { step: Z.collectLicensedProfessionalPersonalInfo, verificationService: e, viewModel: o, failedInstantMatch: R, buttonText: /* @__PURE__ */ a.jsx( p, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Licensed Professional Status" } ) } ) ] } ); }, os = J( v ); export { os as default };