UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

219 lines (217 loc) • 7.21 kB
/** * VERSION: 2.230.0-alpha.0 * BUILD_TIMESTAMP: 1778694684677 * BUILD_DATE: Wed May 13 2026 17:51:24 GMT+0000 (Coordinated Universal Time) * BUILD_COMMIT: 7af1c105d5485ac4ed1190c56d492bb4590667a9 */ import { i as j, m as F, j as o, P as N, g as n, o as d, a1 as M, a2 as I, A as z, p as g, h as m, n as y, F as i, U as P, V as R, e as f, a3 as D } from "../sheerid.js"; import { F as T, L as k, P as L, a as B, M as O, C as V } from "./CaptchaComponent-SmUa6m52.js"; import { E as A, P as W } from "./PersonalInfoStepSubmitButton-j44RdZDq.js"; import { B as q } from "./militaryStepHelpers-0OUuQpBw.js"; import { S as w } from "./StatusComponent-C6J1B7Tl.js"; import { F as H } from "./FirstResponderOrganizationComponent-Bru1a0U7.js"; import { P as K } from "./PostalCodeComponent-DrCcV90W.js"; import { C as U } from "./CountryComponentWrapper-Ceq-eink.js"; import { C as G } from "./ChangeLocaleComponent-DUnfgQuX.js"; import { P as J } from "./PersonalInfoStepWrapper-PV06WMKL.js"; const Q = ({ intl: C, verificationService: a }) => { const e = a.viewModel, { fieldValidationErrors: t } = a, p = a.verificationResponse, b = F(p), h = f(), x = e.localeChoice.value, l = (s, u) => { const r = g( e, (E) => { E[s] = u; } ); a.updateViewModel(r); }; return /* @__PURE__ */ o.jsxs( J, { verificationService: a, step: p.currentStep, children: [ /* @__PURE__ */ o.jsx( N, { verificationService: a, classNameIdentifier: "first-responder" } ), /* @__PURE__ */ o.jsx(G, { verificationService: a }), /* @__PURE__ */ o.jsx( U, { verificationService: a, disabled: n("country")?.disabled } ), /* @__PURE__ */ o.jsx( w, { segmentId: "first-responder", value: { value: e.status, label: I(C, e.status, D) }, isErrored: !!t.status, errorId: "invalidFirstResponderStatus", disabled: n("status")?.disabled, options: M(C, p.availableStatuses), onChange: (s) => { l("status", s ? s.value : ""), d( "status", s ? s.value : "", a ); } } ), /* @__PURE__ */ o.jsx( H, { isErrored: !!t.organization, onChange: (s = z.organization) => { const u = g(e, (r) => { r.organization = { id: s.id, idExtended: s.idExtended, name: s.name, source: s.source }, e.organization && e.organization.source !== void 0 && (r.organization.source = e.organization.source), m(() => a.programTheme.openOrgSearchEnabled) && m(() => s.id) === 0 && m(() => s.name, "").length > 0 ? r.postalCode = e.postalCode ? e.postalCode : "" : (e.postalCode || e.postalCode === "") && delete r.postalCode; }); a.updateViewModel(u), d("organization", s, a); }, value: a.viewModel.organization, verificationService: a, disabled: n("organization")?.disabled } ), /* @__PURE__ */ o.jsxs("div", { className: "sid-names", children: [ /* @__PURE__ */ o.jsx( T, { value: e.firstName, isErrored: !!t.firstName, disabled: n("firstName")?.disabled, onChange: (s) => { l("firstName", s), d("firstName", s, a); } } ), /* @__PURE__ */ o.jsx( k, { value: e.lastName, isErrored: !!t.lastName, disabled: n("lastName")?.disabled, onChange: (s) => { l("lastName", s), d("lastName", s, a); } } ) ] }), /* @__PURE__ */ o.jsx( q, { errorId: t.birthDate, locale: x, onChange: (s) => { l("birthDate", s), d("birthDate", s, a); }, value: e.birthDate, disabled: n("birthDate")?.disabled } ), /* @__PURE__ */ o.jsx( A, { value: e.email, isErrored: !!t.email, explanation: /* @__PURE__ */ o.jsx( i, { id: "emailExplanation", defaultMessage: "Needed to send you your unique code" } ), onChange: (s) => { l("email", s), d("email", s, a); }, onKeyDown: (s) => y(s), disabled: n("email")?.disabled } ), a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ o.jsx( L, { isRequired: !!a.programTheme.smsLoopEnabled, value: e.phoneNumber, isErrored: !!t.phoneNumber, onChange: (s) => { l("phoneNumber", s), d("phoneNumber", s, a); }, selectedCountryCode: e.countryChoice && e.countryChoice.value, disabled: n("phoneNumber")?.disabled } ) : null, m(() => a.programTheme.openOrgSearchEnabled) && m(() => e.organization.id) === 0 && m(() => e.organization.name, "").length > 0 && /* @__PURE__ */ o.jsx( K, { isErrored: !!t.postalCode, onChange: (s) => { l("postalCode", s), d("postalCode", s, a); }, value: e.postalCode, disabled: n("postalCode")?.disabled } ), h.customFormFields.map((s) => /* @__PURE__ */ o.jsx(B, { config: s, verificationService: a })), /* @__PURE__ */ o.jsx( O, { verificationService: a, isErrored: !!t.marketConsentValue, onChange: (s) => { l("metadata", { ...a.viewModel.metadata, marketConsentValue: s }), d("marketConsentValue", s, a); }, viewModel: e, disabled: n("marketConsentValue")?.disabled } ), /* @__PURE__ */ o.jsx(P, { verificationService: a, suffix: "CollectAboveSubmit" }), /* @__PURE__ */ o.jsx( V, { verificationService: a, isErrored: !!t.captchaToken } ), /* @__PURE__ */ o.jsx( W, { step: R.collectFirstResponderPersonalInfo, verificationService: a, viewModel: e, failedInstantMatch: b, buttonText: /* @__PURE__ */ o.jsx( i, { id: "step.personalInfo.submitButtonText", defaultMessage: "Verify My First Responder Status" } ) } ) ] } ); }, es = j(Q); export { es as default };