
/**
 *   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.239.0-alpha.0
 *   BUILD_TIMESTAMP: 1780013005605
 *   BUILD_DATE: Fri May 29 2026 00:03:25 GMT+0000 (Coordinated Universal Time)
 *   BUILD_COMMIT: 3344b6c0fd9fa858907db310cfb1ef5e0d224da2
 */
import { i as b, g as n, j as a, a as y, F as p, P as j, a8 as h, a1 as E, u as r, $ as M, e as f, Y as N, V as F, k as T, b as I } from "../_mysheerid-preview.js";
import { F as P, L as k, P as V, a as z, M as A, C as L } from "./CaptchaComponent-D-uHsjvA.js";
import { E as w, P as H } from "./PersonalInfoStepSubmitButton-Z9sp6sjQ.js";
import { A as R } from "./AddressComponent-DUqzTLlm.js";
import { C as B } from "./City-ZWfRdxoz.js";
import { S as O } from "./StateSelectComponent-DJIfavwM.js";
import { F as q } from "./FormFieldTypeahead-BeJtNfmN.js";
import { P as D } from "./PostalCodeComponent-CAw364H-.js";
import { C as U } from "./CountryComponentWrapper-CE7M9L4O.js";
import { C as W } from "./ChangeLocaleComponent-B5F9Azun.js";
import { P as K } from "./PersonalInfoStepWrapper-DgSuVlBj.js";
const Y = ({
  value: i,
  isErrored: e,
  onChange: o,
  verificationService: d,
  intl: C,
  placeholder: l = "",
  disabled: s = !1
}) => n("organization")?.hidden ? null : /* @__PURE__ */ a.jsx(
  q,
  {
    fieldId: "company",
    value: i,
    verificationService: d,
    onChange: (t) => o(t),
    placeholder: l || C.formatHTMLMessage({ id: "companyPlaceholder", defaultMessage: "Company" }),
    label: /* @__PURE__ */ a.jsx(p, { id: "company", defaultMessage: "Company" }),
    errorMessage: e && /* @__PURE__ */ a.jsx(
      p,
      {
        id: "errorId.invalidOrganization",
        defaultMessage: "You must select an organization from the list"
      }
    ),
    orgSearchUrl: y(
      d.viewModel,
      d.programTheme
    ),
    showPlaceholderAndHideLabel: !!l,
    disabled: s
  }
), $ = b(Y), G = ({
  intl: i,
  verificationService: e
}) => {
  const o = e.viewModel, { fieldValidationErrors: d } = e, C = I(), l = (s, m) => {
    const t = T(
      o,
      (u) => {
        u[s] = m;
      }
    );
    e.updateViewModel(t);
  };
  return /* @__PURE__ */ a.jsxs(
    K,
    {
      verificationService: e,
      step: e.verificationResponse.currentStep,
      children: [
        /* @__PURE__ */ a.jsx(
          j,
          {
            verificationService: e,
            classNameIdentifier: "employment"
          }
        ),
        /* @__PURE__ */ a.jsx(W, { verificationService: e }),
        /* @__PURE__ */ a.jsx(
          U,
          {
            verificationService: e,
            disabled: n("country")?.disabled,
            viewModelDraftDecorator: (s, m) => {
              const t = s;
              t.shouldCollectAddress = h(
                m,
                e.programTheme.config.countries
              );
              const u = ["address1", "city", "state", "postalCode"], g = (t.fieldsToSkipValidation || []).filter(
                (x) => !u.includes(x)
              );
              t.shouldCollectAddress ? t.fieldsToSkipValidation = g.length ? g : void 0 : (t.address1 = "", t.city = "", t.state = "", t.postalCode = "", t.fieldsToSkipValidation = [...g, ...u]);
            }
          }
        ),
        /* @__PURE__ */ a.jsx(
          $,
          {
            value: e.viewModel.organization,
            verificationService: e,
            isErrored: !!d.organization,
            disabled: n("organization")?.disabled,
            onChange: (s) => {
              E(s, e), r("organization", s, e);
            }
          }
        ),
        /* @__PURE__ */ a.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ a.jsx(
            P,
            {
              value: o.firstName,
              isErrored: !!d.firstName,
              disabled: n("firstName")?.disabled,
              onChange: (s) => {
                l("firstName", s), r("firstName", s, e);
              }
            }
          ),
          /* @__PURE__ */ a.jsx(
            k,
            {
              value: o.lastName,
              isErrored: !!d.lastName,
              disabled: n("lastName")?.disabled,
              onChange: (s) => {
                l("lastName", s), r("lastName", s, e);
              }
            }
          )
        ] }),
        h(
          o.countryChoice,
          e.programTheme.config.countries
        ) ? /* @__PURE__ */ a.jsx(
          R,
          {
            isErrored: !!d.address1,
            errorId: d.address1,
            onChange: (s) => {
              l("address1", s), r("address1", s, e);
            },
            isRequired: !0,
            value: o.address1,
            disabled: n("address1")?.disabled,
            explanation: /* @__PURE__ */ a.jsx(p, { id: "addressExplanation", defaultMessage: "Use your home address" })
          }
        ) : null,
        h(
          o.countryChoice,
          e.programTheme.config.countries
        ) ? /* @__PURE__ */ a.jsxs("div", { className: "sid-thirds", children: [
          /* @__PURE__ */ a.jsx(
            B,
            {
              isErrored: !!d.city,
              errorId: d.city,
              onChange: (s) => {
                l("city", s), r("city", s, e);
              },
              value: o.city,
              isRequired: !0,
              disabled: n("city")?.disabled
            }
          ),
          /* @__PURE__ */ a.jsx(
            O,
            {
              isRequired: !0,
              options: M(e.programTheme, i),
              value: o.state || void 0,
              isErrored: !!d.state,
              onChange: async (s) => {
                const m = s ? s.value : void 0;
                l("state", m), r("state", m, e);
              },
              label: /* @__PURE__ */ a.jsx(p, { id: "state", defaultMessage: "State" }),
              disabled: n("state")?.disabled
            }
          ),
          /* @__PURE__ */ a.jsx(
            D,
            {
              isErrored: !!d.postalCode,
              onChange: (s) => {
                l("postalCode", s), r("postalCode", s, e);
              },
              value: o.postalCode,
              disabled: n("postalCode")?.disabled
            }
          )
        ] }) : null,
        /* @__PURE__ */ a.jsx(
          w,
          {
            value: o.email,
            isErrored: !!d.email,
            explanation: /* @__PURE__ */ a.jsx(
              p,
              {
                id: "emailExplanation",
                defaultMessage: "Use your work email if you have one"
              }
            ),
            onChange: (s) => {
              l("email", s), r("email", s, e);
            },
            onKeyDown: (s) => f(s),
            disabled: n("email")?.disabled
          }
        ),
        e.programTheme.isSmsNotifierConfigured || e.programTheme.smsLoopEnabled ? /* @__PURE__ */ a.jsx(
          V,
          {
            isRequired: !!e.programTheme.smsLoopEnabled,
            value: o.phoneNumber,
            isErrored: !!d.phoneNumber,
            onChange: (s) => {
              l("phoneNumber", s), r("phoneNumber", s, e);
            },
            selectedCountryCode: o.countryChoice && o.countryChoice.value,
            disabled: n("phoneNumber")?.disabled
          }
        ) : null,
        C.customFormFields.map((s) => /* @__PURE__ */ a.jsx(z, { config: s, verificationService: e })),
        /* @__PURE__ */ a.jsx(
          A,
          {
            verificationService: e,
            isErrored: !!d.marketConsentValue,
            onChange: (s) => {
              l("metadata", {
                ...e.viewModel.metadata,
                marketConsentValue: s
              }), r("marketConsentValue", s, e);
            },
            viewModel: o,
            disabled: n("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ a.jsx(N, { verificationService: e, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ a.jsx(
          L,
          {
            verificationService: e,
            isErrored: !!d.captchaToken
          }
        ),
        /* @__PURE__ */ a.jsx(
          H,
          {
            step: F.collectEmployeePersonalInfo,
            verificationService: e,
            viewModel: o,
            buttonText: /* @__PURE__ */ a.jsx(
              p,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Employment Status"
              }
            )
          }
        )
      ]
    }
  );
}, os = b(G);
export {
  os as default
};
