
/**
 *   VERSION: 2.240.0-alpha.1
 *   BUILD_TIMESTAMP: 1780360168537
 *   BUILD_DATE: Tue Jun 02 2026 00:29:28 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 758cedd37e00f49a728d704d9ed36884f0f12d79
 */
import { i as n, j as e, F as i, R as l, w as b, L as g, M as f, N as x, O as h, b as j, l as C, V as M } from "../sheerid.js";
import { F as O } from "./FormFieldText-CPwStdCx.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);
  }, []), b(() => 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(
            g,
            {
              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) => {
                x({ ...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 ${h(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 })
      ]
    }
  );
}, N = n(L);
export {
  N as default
};
