import { jsx as e, jsxs as p } from "react/jsx-runtime";
import { a as u } from "./index.CfQlFjZU.js";
import { a as f } from "./message.CHKnnsjy.js";
import { P as d } from "./PageHeader.BwFpx_pz.js";
import { S as P, M as F } from "./shared.EdGf6tcG.js";
import "react";
import { O as g } from "./Onboarding.BDRBUM0D.js";
import { B as C, a as b } from "./Button.CpTwUWVr.js";
import { F as h } from "./form.BJJLcx4p.js";
import { a as w } from "./TextInput.63vMRxAK.js";
import { u as S } from "./useInputValidation.BmDVJuIZ.js";
const _ = "creator_contentContainerStretch_XcfRU", v = "creator_mainContentContainer_Bn5gp", I = "creator_formContainer_s9D07", N = "creator_sectionFormContainer_rzPDV", x = { contentContainerStretch: _, mainContentContainer: v, formContainer: I, sectionFormContainer: N };
function B({
  email: r = "",
  emailProcessor: s,
  shouldRemoveForm: n,
  loading: o,
  onSubmit: i,
  previousPageUrl: m
}) {
  const t = S(r, s);
  function a(l) {
    l.preventDefault(), i?.({
      email: t.value
    });
  }
  const c = !!o;
  return {
    disabled: !t.value || !!t.isError || !!o,
    disabledEmail: c,
    emailProps: t,
    isNativeForm: !n,
    loading: o,
    previousPageUrl: m,
    onSubmit: a,
    formContainerClassName: x.sectionFormContainer
  };
}
function M({
  disabled: r,
  disabledEmail: s,
  previousPageUrl: n,
  emailProps: o,
  isNativeForm: i,
  loading: m,
  onSubmit: t,
  formContainerClassName: a
}) {
  return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ p(
    h,
    {
      isNative: i,
      formProps: { className: a, onSubmit: t },
      divProps: { className: a },
      children: [
        /* @__PURE__ */ e(
          d,
          {
            title: "Forgot password?",
            previousPageUrl: n,
            height: "auto"
          }
        ),
        /* @__PURE__ */ e(
          w,
          {
            label: "Email",
            name: "email",
            type: "email",
            isDisabled: s,
            ...o
          }
        ),
        /* @__PURE__ */ e(
          C,
          {
            label: "Reset Password",
            size: "full",
            name: "intent",
            value: "reset-password-request",
            type: b.SUBMIT,
            semantic: P.PRIMARY,
            loading: m,
            disabled: r
          }
        ),
        /* @__PURE__ */ e(
          f,
          {
            semantic: F.INFO,
            text: "Need to talk? Get in touch with us at support@komi.io",
            showIcon: !0,
            dismissible: !1
          }
        )
      ]
    }
  ) });
}
const A = u(
  M,
  B
);
export {
  A as F,
  M as a,
  B as u
};
