UNPKG

@sheerid/jslib-nightly

Version:

SheerID JavaScript Library

137 lines (135 loc) 4.99 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 n, j as e, F as i, R as l, h as g, L as b, I as f, J as h, K as x, a as j, l as C, V as M } from "../sheerid.js"; import { F as O } from "./FormFieldText-CaWtYVur.js"; const w = ({ value: o, isErrored: s, onChange: d, placeholder: r = "" }) => /* @__PURE__ */ e.jsx( O, { fieldId: "overrideCode", value: o, onChange: d, placeholder: "", type: "password", label: /* @__PURE__ */ e.jsx( i, { id: "step.override.verificationOverrideCodeLabel", defaultMessage: "Verification Override Code" } ), errorMessage: s && /* @__PURE__ */ e.jsx( i, { id: "errorId.invalidOverrideCode", defaultMessage: "Invalid Override Code" } ), showPlaceholderAndHideLabel: !!r } ), F = n(w), L = ({ intl: o, verificationService: s }) => { const d = s.viewModel, r = s.verificationResponse, { fieldValidationErrors: m } = s, [t, c] = l.useState(""), a = r.errorIds && r.errorIds.includes("incorrectVerificationOverrideCodeAttemptLimitExceeded"), p = o.formatHTMLMessage({ id: "step.override.errors.codeOverrideLimit", defaultMessage: "Override code limit exceeded." }); l.useEffect(() => { a && c(p); }, []), g(() => r.errorIds.length) && !s.fieldValidationErrors.overrideCode && s.updateFieldValidationErrors({ ...s.fieldValidationErrors, overrideCode: r.errorIds[0] }); const u = () => { C.info("StepOverrideCode submitting form"), s.submitStep( M.override, d, s.verificationResponse ); }; return /* @__PURE__ */ e.jsxs( "div", { id: "sid-step-overrice-code", className: "sid-override-personal-info-container sid-l-container", children: [ /* @__PURE__ */ e.jsxs("div", { role: "main", children: [ /* @__PURE__ */ e.jsx("div", { className: "sid-override-personal-info-logo-container sid-l-horz-center", children: /* @__PURE__ */ e.jsx( b, { verificationService: s, fallbackLogo: /* @__PURE__ */ e.jsx( "img", { className: "sid-override-personal-info-logo-default sid-l-lead-image", alt: "", src: "https://assets-resources.sheerid.com/common/images/2018/icons/sso-step.svg" } ) } ) }), /* @__PURE__ */ e.jsx(f, { align: "center", children: /* @__PURE__ */ e.jsx( i, { id: "step.override.title", defaultMessage: "Unable to Verify Status", tagName: "h1" } ) }), /* @__PURE__ */ e.jsx("div", { className: "sid-header__subtitle-one sid-l-horz-center", children: /* @__PURE__ */ e.jsx( i, { id: "step.override.subtitle", defaultMessage: "Please sign in to your school's web portal. It will open in a new tab." } ) }), /* @__PURE__ */ e.jsx("div", { className: "sid-header__subtitle-one sid-l-horz-center", children: /* @__PURE__ */ e.jsx( i, { id: "step.override.subtitle2", defaultMessage: "This will enable the customer to redeem the offer" } ) }), /* @__PURE__ */ e.jsx( F, { value: d.overrideCode, isErrored: !!m.overrideCode, onChange: (v) => { h({ ...d, overrideCode: v }); } } ), t && /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("p", { children: t }) }), /* @__PURE__ */ e.jsx("div", { className: "sid-form-region sid-submit-wrapper sid-l-space-top-md", children: /* @__PURE__ */ e.jsx("div", { className: "sid-override-submit sid-submit", children: /* @__PURE__ */ e.jsx( "button", { id: "sid-submit-btn-collect-info", onClick: u, type: "button", className: `sid-btn sid-override-submit-btn sid-btn--dark sid-l-full-width ${x(d, s.formValidationOptions) ? "" : "sid-btn--disabled-like"}`, disabled: !!(!d.overrideCode || d.overrideCode.length <= 0 || a), children: /* @__PURE__ */ e.jsx("span", { id: "verify-status-text", children: /* @__PURE__ */ e.jsx( i, { id: "step.override.submitOverrideCodeButtonLabel", defaultMessage: "Submit Override Codes" } ) }) } ) }) }) ] }), /* @__PURE__ */ e.jsx(j, { verificationService: s }) ] } ); }, I = n(L); export { I as default };