UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

243 lines (241 loc) • 7.57 kB
/** * WARNING: This file is intended to be used within MySheerID. * This file is not intended for use in other contexts and there are no guarantees about its behavior outside of MySheerID. */ /** * VERSION: 2.230.0-alpha.0 * BUILD_TIMESTAMP: 1778694697559 * BUILD_DATE: Wed May 13 2026 17:51:37 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9 */ import { i as x, m as I, j as a, P as f, g as n, o as l, _ as L, F as u, n as j, U as M, V as R, p as P, e as T } from "../_mysheerid-preview.js"; import { B as A } from "./militaryStepHelpers-jW2_4c1l.js"; import { E as y, P as F } from "./PersonalInfoStepSubmitButton-v_kWLmEw.js"; import { F as O, L as D, P as _, a as V, M as k, C as B } from "./CaptchaComponent-CnWyxiTy.js"; import { S as z } from "./StatusComponent-pmuIhuXi.js"; import { L as G } from "./LicensedProfessionalOrganizationComponent-C5pc7hVJ.js"; import { P as H } from "./PostalCodeComponent-KXVfZkLx.js"; import { C as W } from "./ChangeLocaleComponent-Cu2DR-Q3.js"; import { C as c } from "./CountryComponentWrapper--2UQ7mXP.js"; import { P as w } from "./PersonalInfoStepWrapper-BOBNCgik.js"; const K = { 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" }, U = ({ intl: C, verificationService: e }) => { const o = e.viewModel, { fieldValidationErrors: t } = e, p = e.verificationResponse, b = I(p), E = o.localeChoice.value, h = T(), d = (s, r) => { const m = P( o, (N) => { N[s] = r; } ); e.updateViewModel(m); }, i = (s) => s ? C.formatHTMLMessage({ id: s, defaultMessage: K[s] }) : "", g = () => { const s = p.availableStatuses, r = []; if (s) for (const m of s) r.push({ value: m, label: i(m) }); return r; }; return /* @__PURE__ */ a.jsxs( w, { verificationService: e, step: p.currentStep, children: [ /* @__PURE__ */ a.jsx( f, { verificationService: e, classNameIdentifier: "licensed-professional" } ), /* @__PURE__ */ a.jsx(W, { verificationService: e }), /* @__PURE__ */ a.jsx( c, { verificationService: e, disabled: n("country")?.disabled } ), /* @__PURE__ */ a.jsx( z, { segmentId: "licensed-professional", value: { value: o.statuses ? o.statuses[0] : "", label: o.statuses ? i(o.statuses[0]) : "" }, isErrored: !!t.statuses, options: g(), disabled: n("statuses")?.disabled, onChange: (s) => { const r = s ? [s.value] : []; d("statuses", r), l( "statuses", s ? s.value : "", e ); } } ), /* @__PURE__ */ a.jsx( G, { isErrored: !!t.organization, onChange: (s) => { L(s, e), l("organization", s, e); }, value: e.viewModel.organization, verificationService: e, disabled: n("organization")?.disabled } ), /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ a.jsx( O, { value: o.firstName, isErrored: !!t.firstName, disabled: n("firstName")?.disabled, onChange: (s) => { d("firstName", s), l("firstName", s, e); } } ), /* @__PURE__ */ a.jsx( D, { value: o.lastName, isErrored: !!t.lastName, disabled: n("lastName")?.disabled, onChange: (s) => { d("lastName", s), l("lastName", s, e); } } ) ] }), /* @__PURE__ */ a.jsx( A, { errorId: t.birthDate, locale: E, onChange: (s) => { d("birthDate", s), l("birthDate", s, e); }, value: o.birthDate, disabled: n("birthDate")?.disabled } ), /* @__PURE__ */ a.jsx( H, { isErrored: !!t.postalCode, onChange: (s) => { d("postalCode", s), l("postalCode", s, e); }, value: o.postalCode, disabled: n("postalCode")?.disabled, explanation: /* @__PURE__ */ a.jsx( u, { id: "postalCodeExplanation", defaultMessage: "Use the location on file with your licensing body" } ) } ), /* @__PURE__ */ a.jsx( y, { value: o.email, isErrored: !!t.email, explanation: /* @__PURE__ */ a.jsx( u, { id: "emailExplanation", defaultMessage: "Needed to send you your unique code" } ), onChange: (s) => { d("email", s), l("email", s, e); }, onKeyDown: (s) => j(s), disabled: n("email")?.disabled } ), e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx( _, { isRequired: !!e.programTheme.smsLoopEnabled, value: o.phoneNumber, isErrored: !!t.phoneNumber, onChange: (s) => { d("phoneNumber", s), l("phoneNumber", s, e); }, selectedCountryCode: o.countryChoice && o.countryChoice.value, disabled: n("phoneNumber")?.disabled } ) : null, h.customFormFields.map((s) => /* @__PURE__ */ a.jsx(V, { config: s, verificationService: e })), /* @__PURE__ */ a.jsx( k, { verificationService: e, isErrored: !!t.marketConsentValue, onChange: (s) => { d("metadata", { ...e.viewModel.metadata, marketConsentValue: s }), l("marketConsentValue", s, e); }, viewModel: o, disabled: n("marketConsentValue")?.disabled } ), /* @__PURE__ */ a.jsx(M, { verificationService: e, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ a.jsx( B, { verificationService: e, isErrored: !!t.captchaToken } ), /* @__PURE__ */ a.jsx( F, { step: R.collectLicensedProfessionalPersonalInfo, verificationService: e, viewModel: o, failedInstantMatch: b, buttonText: /* @__PURE__ */ a.jsx( u, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My Licensed Professional Status" } ) } ) ] } ); }, es = x( U ); export { es as default };