
/**
 *   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 j, h as E, a4 as P, R as c, j as s, P as F, g as t, u as l, F as r, a5 as T, a1 as V, e as k, Y as D, V as R, A as K, b as L } from "../_mysheerid-preview.js";
import { u as B } from "./useCollectFieldsEndpoint-BI8aEDFI.js";
import { i as O } from "./FormFieldText-BEmRFdkH.js";
import { F as w, L as z, B as q, P as A, a as H, M as W, C as Y } from "./CaptchaComponent-D-uHsjvA.js";
import { E as $, P as G } from "./PersonalInfoStepSubmitButton-Z9sp6sjQ.js";
import { P as U } from "./PostalCodeComponent-CAw364H-.js";
import { S as J } from "./StatusComponent-SifKfxUA.js";
import { M as Q } from "./MedicalProfessionalOrganizationComponent-CpryV9AE.js";
import { C as X } from "./CountryComponentWrapper-CE7M9L4O.js";
import { M as Z } from "./MemberIdComponent-UCKQ2CMp.js";
import { C as _ } from "./ChangeLocaleComponent-B5F9Azun.js";
import { P as S } from "./PersonalInfoStepWrapper-DgSuVlBj.js";
const v = {
  AT: "gbrNummer",
  ES: "numeroColegiado",
  DK: "autorisationsId",
  CH: "globalLocationNumber",
  IE: "registrationNumber",
  GB: "registrationNumber"
}, C = (i) => {
  const a = v[i] || "registrationNumber";
  return {
    labelKey: `step.collectMedicalPersonalInfo.${a}Label`,
    explanationKey: `step.collectMedicalPersonalInfo.${a}Explanation`
  };
}, ee = ({
  intl: i,
  verificationService: a
}) => {
  const o = a.viewModel, { fieldValidationErrors: n } = a, m = a.verificationResponse, g = E(m), h = L(), x = o.localeChoice.value, d = (e, u) => {
    const N = K(o, e, u);
    a.updateViewModel(N);
  }, { isFieldOptional: M, availableStatuses: I } = B({
    verificationId: m.verificationId,
    currentStep: m.currentStep,
    viewModel: o
  }), p = M("memberId"), f = o.countryChoice?.value, b = O(
    a.programTheme,
    f
  ), y = P(
    i,
    I ?? m.availableStatuses
  );
  return c.useEffect(() => {
    const e = (a.viewModel?.fieldsToSkipValidation || []).filter(
      (u) => u !== "memberId"
    );
    p ? a.updateViewModel({ fieldsToSkipValidation: e }, { partial: !0 }) : a.updateViewModel(
      { fieldsToSkipValidation: [...e, "memberId"] },
      { partial: !0 }
    );
  }, [p]), /* @__PURE__ */ s.jsxs(
    S,
    {
      verificationService: a,
      step: m.currentStep,
      children: [
        /* @__PURE__ */ s.jsx(
          F,
          {
            verificationService: a,
            classNameIdentifier: "medical-personal-info"
          }
        ),
        /* @__PURE__ */ s.jsx(_, { verificationService: a }),
        /* @__PURE__ */ s.jsx(
          X,
          {
            verificationService: a,
            disabled: t("country")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(
          J,
          {
            segmentId: "medical",
            value: {
              value: o.status,
              label: T(i, o.status)
            },
            isErrored: !!n.status,
            options: y,
            disabled: b || t("status")?.disabled,
            explanation: b ? /* @__PURE__ */ s.jsx(r, { id: "chooseCountry", defaultMessage: "Choose a country first" }) : void 0,
            onChange: (e) => {
              d("status", e ? e.value : ""), l(
                "status",
                e ? e.value : "",
                a
              );
            }
          }
        ),
        /* @__PURE__ */ s.jsx(
          Q,
          {
            isErrored: !!n.organization,
            onChange: (e) => {
              V(e, a), l("organization", e, a);
            },
            value: a.viewModel.organization,
            verificationService: a,
            disabled: t("organization")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsxs("div", { className: "sid-names", children: [
          /* @__PURE__ */ s.jsx(
            w,
            {
              value: o.firstName,
              isErrored: !!n.firstName,
              disabled: t("firstName")?.disabled,
              onChange: (e) => {
                d("firstName", e), l("firstName", e, a);
              }
            }
          ),
          /* @__PURE__ */ s.jsx(
            z,
            {
              value: o.lastName,
              isErrored: !!n.lastName,
              disabled: t("lastName")?.disabled,
              onChange: (e) => {
                d("lastName", e), l("lastName", e, a);
              }
            }
          )
        ] }),
        /* @__PURE__ */ s.jsx(
          q,
          {
            errorId: n.birthDate,
            locale: x,
            disabled: t("birthDate")?.disabled,
            onChange: (e) => {
              d("birthDate", e), l("birthDate", e, a);
            },
            value: o.birthDate
          }
        ),
        /* @__PURE__ */ s.jsx(
          U,
          {
            isErrored: !!n.postalCode,
            onChange: (e) => {
              d("postalCode", e), l("postalCode", e, a);
            },
            value: o.postalCode,
            disabled: t("postalCode")?.disabled,
            explanation: /* @__PURE__ */ s.jsx(
              r,
              {
                id: "postalCodeExplanation",
                defaultMessage: "Use the location on file with your licensing body"
              }
            )
          }
        ),
        /* @__PURE__ */ s.jsx(
          $,
          {
            value: o.email,
            isErrored: !!n.email,
            explanation: /* @__PURE__ */ s.jsx(
              r,
              {
                id: "emailExplanation",
                defaultMessage: "Needed to send you your unique code"
              }
            ),
            onChange: (e) => {
              d("email", e), l("email", e, a);
            },
            onKeyDown: (e) => k(e),
            disabled: t("email")?.disabled
          }
        ),
        a.programTheme.isSmsNotifierConfigured || a.programTheme.smsLoopEnabled ? /* @__PURE__ */ s.jsx(
          A,
          {
            isRequired: !!a.programTheme.smsLoopEnabled,
            value: o.phoneNumber,
            isErrored: !!n.phoneNumber,
            onChange: (e) => {
              d("phoneNumber", e), l("phoneNumber", e, a);
            },
            selectedCountryCode: o.countryChoice && o.countryChoice.value,
            disabled: t("phoneNumber")?.disabled
          }
        ) : null,
        p && /* @__PURE__ */ s.jsx(
          Z,
          {
            value: o.memberId,
            isErrored: !!n.memberId,
            isRequired: t("memberId")?.requireIfOptional,
            disabled: t("memberId")?.disabled,
            onChange: (e) => {
              d("memberId", e), l("memberId", e, a);
            },
            explanation: /* @__PURE__ */ s.jsx(
              r,
              {
                id: C(o.country).explanationKey,
                defaultMessage: "Your Professional Membership Registration Number"
              }
            ),
            label: /* @__PURE__ */ s.jsx(
              r,
              {
                id: C(o.country).labelKey,
                defaultMessage: "Registration Number"
              }
            )
          }
        ),
        h.customFormFields.map((e) => /* @__PURE__ */ s.jsx(H, { config: e, verificationService: a })),
        /* @__PURE__ */ s.jsx(
          W,
          {
            verificationService: a,
            isErrored: !!n.marketConsentValue,
            onChange: (e) => {
              d("metadata", {
                ...a.viewModel.metadata,
                marketConsentValue: e
              }), l("marketConsentValue", e, a);
            },
            viewModel: o,
            disabled: t("marketConsentValue")?.disabled
          }
        ),
        /* @__PURE__ */ s.jsx(D, { verificationService: a, suffix: "CollectAboveSubmit" }),
        /* @__PURE__ */ s.jsx(
          Y,
          {
            verificationService: a,
            isErrored: !!n.captchaToken
          }
        ),
        /* @__PURE__ */ s.jsx(
          G,
          {
            step: R.collectMedicalProfessionalPersonalInfo,
            verificationService: a,
            viewModel: o,
            failedInstantMatch: g,
            buttonText: /* @__PURE__ */ s.jsx(
              r,
              {
                id: "step.personalInfo.submitButtonText",
                defaultMessage: "Verify My Medical Professional Status"
              }
            )
          }
        )
      ]
    }
  );
}, be = j(
  ee
);
export {
  be as default
};
