import { QSpace } from './QSpace-afce9c3e.js';
import { QForm, DefaultAuthLayout, AlignCenterMiddleWrap, LogoNameBox, _sfc_main as _sfc_main$6, QPage } from './QForm-3da35848.js';
import { GoBackLoginLink } from './GoBackLoginLink-aa2265c0.js';
import { _sfc_main as _sfc_main$7 } from './AuthSubtitle-9e685bca.js';
import { useForgotStore, computed, openBlock, createBlock, unref, isRef, useAuthStore, useRouter, useQuasar, onUnmounted, withCtx, renderSlot, createVNode, createBaseVNode } from './__federation_expose_Modules-a9c6a6fc.js';
import { emailRules } from './validationUtil-531209ab.js';
import { _sfc_main as _sfc_main$4 } from './AuthTextField-df802034.js';
import { _sfc_main as _sfc_main$5 } from './AuthBtn-d1b681f3.js';

const _sfc_main$3 = {
  __name: 'ForgotIdEmailInput',
  setup(__props) {
    const forgotStore = useForgotStore();
    const email = computed({
      get: () => forgotStore.email,
      set: value => forgotStore.setEmail(value)
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$4, {
        modelValue: unref(email),
        "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => isRef(email) ? email.value = $event : null),
        label: "Email",
        rules: unref(emailRules)
      }, null, 8, ["modelValue", "rules"]);
    };
  }
};

const _sfc_main$2 = {
  __name: 'ForgotIdButton',
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$5, {
        label: "Find my ID",
        color: "primary",
        type: "submit"
      });
    };
  }
};

const _sfc_main$1 = {
  __name: 'ForgotIdForm',
  setup(__props) {
    const forgotStore = useForgotStore();
    const authStore = useAuthStore();
    useRouter();
    const $q = useQuasar();
    const onSubmit = () => {
      authStore.findId().then(() => {
        $q.notify({
          type: 'positive',
          message: 'User ID Requested. Check your email for instructions.'
        });
      });
      // not implemented
      // $q.notify({
      //   type: 'warning',
      //   message: 'Not implemented',
      // });
    };

    onUnmounted(() => {
      forgotStore.reset();
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(QForm, {
        class: "auth-input-form",
        onSubmit: onSubmit
      }, {
        default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
        _: 3
      });
    };
  }
};

const _hoisted_1 = /*#__PURE__*/createBaseVNode("div", null, null, -1);
const _sfc_main = {
  __name: 'ForgotIdPage',
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(DefaultAuthLayout, null, {
        default: withCtx(() => [createVNode(QPage, {
          id: "d1__loginPage",
          class: "flex"
        }, {
          default: withCtx(() => [createVNode(AlignCenterMiddleWrap, null, {
            default: withCtx(() => [createVNode(LogoNameBox), createVNode(QSpace, {
              class: "q-py-md q-mt-xs"
            }), createVNode(_sfc_main$6, {
              title: "Forgot ID ?"
            }), createVNode(QSpace, {
              class: "q-py-sm"
            }), createVNode(_sfc_main$7, {
              title: "You will receive your ID via email."
            }), createVNode(QSpace, {
              class: "q-py-md q-mt-xs"
            }), createVNode(_sfc_main$1, {
              class: ""
            }, {
              default: withCtx(() => [createVNode(_sfc_main$3), createVNode(_sfc_main$2)]),
              _: 1
            }), createVNode(QSpace, {
              class: "q-py-md q-mt-xs"
            }), createVNode(GoBackLoginLink)]),
            _: 1
          })]),
          _: 1
        }), _hoisted_1]),
        _: 1
      });
    };
  }
};

export { _sfc_main as default };
