import { q as q$1 } from './BaseTextInput-Bfb2_8Ur.mjs';
import { d as _export_sfc, e as useRuntimeConfig, a as useNuxtApp, b as useI18n, c as useCookie, _ as __nuxt_component_0$2, f as useLocalePath, g as useRouter, u as useStore } from './server.mjs';
import { g } from './SvgIcon-DRvxO0-V.mjs';
import { p } from './Modal-CfKvzdGl.mjs';
import { B as B$1 } from './BasePhoneInput-CgFRJgrE.mjs';
import { useSSRContext, ref, resolveComponent, mergeProps, withCtx, createVNode, toDisplayString, unref, createTextVNode, computed } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderTeleport } from 'vue/server-renderer';
import { p as pe } from './index-Dj5w-pp2.mjs';
import * as R from 'yup';
import { l } from './Success-B3ItDJKk.mjs';
import { O as O$1, k as k$1 } from './EditPhoneForm-CIU2CxW0.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'node:path';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-rate';
import 'date-fns';
import '@hennge/vue3-pagination';
import 'axios';
import 'vue-social-sharing';
import './Backdrop-BEGlY-L5.mjs';
import '@headlessui/vue';
import 'vue3-otp-input';

const N = { __name: "ForgetPasswordForm", __ssrInlineRender: true, props: { title: { type: String, required: true } }, emits: ["close", "resetPassword"], setup(e2, { emit: l2 }) {
  const { public: { profileName: r2 } } = useRuntimeConfig(), d2 = useNuxtApp().$axios, { t: i2 } = useI18n(), p2 = ref(R.object().shape({ phone: R.object().shape({ phone_number: R.string().required(i2("ERRORS.phone")).test("phone-length", function(e3) {
    const { phone_limit: a2 } = this.parent;
    return !!e3 && (e3.length === a2 || this.createError({ message: i2("ERRORS.phone_limit", { phone_limit: a2 }) }));
  }) }) })), m2 = ref(false);
  ref(false);
  const _2 = async (e3) => {
    m2.value = true, d2("forget_password", { method: "POST", data: { phone_code: e3.phone.phone_code, phone: e3.phone.phone_number } }).then((e4) => {
      useCookie(r2).value = e4.data.data, y2("resetPassword"), pe.success(e4.data.message);
    }).catch((e4) => {
      pe.error(e4.response.data.message);
    }).finally(() => {
      m2.value = false;
    });
  }, y2 = l2;
  return (a2, t2, s2, l3) => {
    const n2 = p, r3 = resolveComponent("VeeForm"), d3 = B$1, i3 = __nuxt_component_0$2;
    t2(ssrRenderComponent(n2, mergeProps({ onClose: (e3) => a2.$emit("close"), title: e2.title }, l3), { default: withCtx((e3, t3, s3, o2) => {
      if (!t3) return [createVNode("div", { class: "mb-8" }, [createVNode("p", { class: "text-primary" }, toDisplayString(a2.$t("TITLES.forgetPassword")), 1)]), createVNode(r3, { "validation-schema": unref(p2), onSubmit: _2 }, { default: withCtx(() => [createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "phone", label: a2.$t("LABELS.phone"), placeholder: a2.$t("INPUTS.phone") }, null, 8, ["label", "placeholder"])]), createVNode("div", null, [createVNode("button", { disabled: unref(m2), loading: unref(m2), type: "submit", class: "base-btn w-full mb-2" }, toDisplayString(a2.$t("BUTTONS.send")), 9, ["disabled", "loading"])]), createVNode("div", { class: "flex items-center justify-center gap-2 mt-6" }, [createVNode("span", null, toDisplayString(a2.$t("TITLES.createAccountQuestion")), 1), createVNode(i3, { to: a2.localePath("/auth/create-account"), class: "text-[#E92A35]" }, { default: withCtx(() => [createTextVNode(toDisplayString(a2.$t("TITLES.register")), 1)]), _: 1 }, 8, ["to"])])]), _: 1 }, 8, ["validation-schema"])];
      t3(`<div class="mb-8" data-v-dc07e423${o2}><p class="text-primary" data-v-dc07e423${o2}>${ssrInterpolate(a2.$t("TITLES.forgetPassword"))}</p></div>`), t3(ssrRenderComponent(r3, { "validation-schema": unref(p2), onSubmit: _2 }, { default: withCtx((e4, t4, s4, o3) => {
        if (!t4) return [createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "phone", label: a2.$t("LABELS.phone"), placeholder: a2.$t("INPUTS.phone") }, null, 8, ["label", "placeholder"])]), createVNode("div", null, [createVNode("button", { disabled: unref(m2), loading: unref(m2), type: "submit", class: "base-btn w-full mb-2" }, toDisplayString(a2.$t("BUTTONS.send")), 9, ["disabled", "loading"])]), createVNode("div", { class: "flex items-center justify-center gap-2 mt-6" }, [createVNode("span", null, toDisplayString(a2.$t("TITLES.createAccountQuestion")), 1), createVNode(i3, { to: a2.localePath("/auth/create-account"), class: "text-[#E92A35]" }, { default: withCtx(() => [createTextVNode(toDisplayString(a2.$t("TITLES.register")), 1)]), _: 1 }, 8, ["to"])])];
        t4(`<div class="mb-8" data-v-dc07e423${o3}>`), t4(ssrRenderComponent(d3, { name: "phone", label: a2.$t("LABELS.phone"), placeholder: a2.$t("INPUTS.phone") }, null, s4, o3)), t4(`</div><div data-v-dc07e423${o3}><button${ssrIncludeBooleanAttr(unref(m2)) ? " disabled" : ""}${ssrRenderAttr("loading", unref(m2))} type="submit" class="base-btn w-full mb-2" data-v-dc07e423${o3}>${ssrInterpolate(a2.$t("BUTTONS.send"))}</button></div><div class="flex items-center justify-center gap-2 mt-6" data-v-dc07e423${o3}><span data-v-dc07e423${o3}>${ssrInterpolate(a2.$t("TITLES.createAccountQuestion"))}</span>`), t4(ssrRenderComponent(i3, { to: a2.localePath("/auth/create-account"), class: "text-[#E92A35]" }, { default: withCtx((e5, t5, s5, o4) => {
          if (!t5) return [createTextVNode(toDisplayString(a2.$t("TITLES.register")), 1)];
          t5(`${ssrInterpolate(a2.$t("TITLES.register"))}`);
        }), _: 1 }, s4, o3)), t4("</div>");
      }), _: 1 }, s3, o2));
    }), _: 1 }, s2));
  };
} }, B = N.setup;
N.setup = (e2, a2) => {
  const t2 = useSSRContext();
  return (t2.modules || (t2.modules = /* @__PURE__ */ new Set())).add("components/Auth/ForgetPasswordForm.vue"), B ? B(e2, a2) : undefined;
};
const O = _export_sfc(N, [["__scopeId", "data-v-dc07e423"]]), C = { __name: "UpdateYourPassword", __ssrInlineRender: true, props: { title: { type: String, required: true } }, emits: ["close", "success"], setup(o2, { emit: l2 }) {
  const { public: { profileName: r2 } } = useRuntimeConfig(), d2 = computed(() => useCookie(r2).value), i2 = useNuxtApp().$axios, { t: p2 } = useI18n(), c2 = ref(R.object().shape({ password: R.string().required(p2("ERRORS.password")), confirmPassword: R.string().required(p2("ERRORS.confirmPassword")).oneOf([R.ref("password")], p2("ERRORS.confirmPasswordDosnotMuch")) })), m2 = ref({ password: "", confirmPassword: "" }), w2 = ref(false), y2 = async (e2) => {
    w2.value = true, i2("reset_password", { method: "POST", data: { _method: "PATCH", phone: d2.value.phone, phone_code: d2.value.phone_code, password: e2.password, password_confirmation: e2.confirmPassword } }).then((e3) => {
      I2("close"), I2("success"), pe.success(e3.data.message);
    }).catch((e3) => {
      pe.error(e3.response.data.message);
    }).finally(() => {
      w2.value = false;
    });
  }, I2 = l2;
  return (a2, t2, s2, l3) => {
    const n2 = p, r3 = resolveComponent("VeeForm"), d3 = q$1;
    t2(ssrRenderComponent(n2, mergeProps({ onClose: (e2) => a2.$emit("close"), title: o2.title }, l3), { default: withCtx((e2, t3, s3, o3) => {
      if (!t3) return [createVNode("div", { class: "mb-8" }, [createVNode("p", { class: "text-primary" }, toDisplayString(a2.$t("TITLES.recoveryPasswordInstruction")), 1)]), createVNode(r3, { "validation-schema": unref(c2), onSubmit: y2, "initial-values": unref(m2) }, { default: withCtx(() => [createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "password", label: a2.$t("LABELS.password"), placeholder: a2.$t("INPUTS.password"), type: "password", value: unref(m2).password, "onUpdate:value": (e3) => unref(m2).password = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "confirmPassword", label: a2.$t("LABELS.confirmPassword"), placeholder: a2.$t("INPUTS.confirmPassword"), type: "password", value: unref(m2).confirmPassword, "onUpdate:value": (e3) => unref(m2).confirmPassword = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode("button", { disabled: unref(w2), loading: unref(w2), type: "submit", class: "base-btn w-full mb-2" }, toDisplayString(a2.$t("TITLES.resetPassword")), 9, ["disabled", "loading"])])]), _: 1 }, 8, ["validation-schema", "initial-values"])];
      t3(`<div class="mb-8"${o3}><p class="text-primary"${o3}>${ssrInterpolate(a2.$t("TITLES.recoveryPasswordInstruction"))}</p></div>`), t3(ssrRenderComponent(r3, { "validation-schema": unref(c2), onSubmit: y2, "initial-values": unref(m2) }, { default: withCtx((e3, t4, s4, o4) => {
        if (!t4) return [createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "password", label: a2.$t("LABELS.password"), placeholder: a2.$t("INPUTS.password"), type: "password", value: unref(m2).password, "onUpdate:value": (e4) => unref(m2).password = e4 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", { class: "mb-8" }, [createVNode(d3, { name: "confirmPassword", label: a2.$t("LABELS.confirmPassword"), placeholder: a2.$t("INPUTS.confirmPassword"), type: "password", value: unref(m2).confirmPassword, "onUpdate:value": (e4) => unref(m2).confirmPassword = e4 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode("button", { disabled: unref(w2), loading: unref(w2), type: "submit", class: "base-btn w-full mb-2" }, toDisplayString(a2.$t("TITLES.resetPassword")), 9, ["disabled", "loading"])])];
        t4(`<div class="mb-8"${o4}>`), t4(ssrRenderComponent(d3, { name: "password", label: a2.$t("LABELS.password"), placeholder: a2.$t("INPUTS.password"), type: "password", value: unref(m2).password, "onUpdate:value": (e4) => unref(m2).password = e4 }, null, s4, o4)), t4(`</div><div class="mb-8"${o4}>`), t4(ssrRenderComponent(d3, { name: "confirmPassword", label: a2.$t("LABELS.confirmPassword"), placeholder: a2.$t("INPUTS.confirmPassword"), type: "password", value: unref(m2).confirmPassword, "onUpdate:value": (e4) => unref(m2).confirmPassword = e4 }, null, s4, o4)), t4(`</div><div${o4}><button${ssrIncludeBooleanAttr(unref(w2)) ? " disabled" : ""}${ssrRenderAttr("loading", unref(w2))} type="submit" class="base-btn w-full mb-2"${o4}>${ssrInterpolate(a2.$t("TITLES.resetPassword"))}</button></div>`);
      }), _: 1 }, s3, o3));
    }), _: 1 }, s2));
  };
} }, F = C.setup;
C.setup = (e2, a2) => {
  const t2 = useSSRContext();
  return (t2.modules || (t2.modules = /* @__PURE__ */ new Set())).add("components/Auth/UpdateYourPassword.vue"), F ? F(e2, a2) : undefined;
};
const k = { __name: "LoginForm", __ssrInlineRender: true, props: { title: { type: String, required: true } }, setup(l2) {
  const u2 = useNuxtApp().$axios, c2 = ref(false), m2 = ref(false), _2 = ref(false), N2 = () => {
    useCookie("oldPhoneCode").value = useCookie("phoneCode").value, useCookie("oldPhone").value = useCookie("phone").value, m2.value = false, _2.value = true;
  }, B2 = () => {
    m2.value = !m2.value;
  }, F2 = () => {
    c2.value = !c2.value;
  }, k2 = ref(false), q2 = () => {
    k2.value = !k2.value;
  }, z2 = ref(false), V2 = () => {
    c2.value = false, z2.value = !z2.value;
  }, { public: { tokenName: D, profileName: M } } = useRuntimeConfig();
  ref(useCookie("phoneCode").value), ref(useCookie("phone").value);
  const { t: Q } = useI18n(), Z = useLocalePath(), G = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, X = /^\d{8,}$/, Y = ref(R.object().shape({ emailPhone: R.string().required(Q("ERRORS.emailPhone")).test("is-email-or-phone", Q("ERRORS.invalidEmailOrPhone"), (e2) => G.test(e2) || X.test(e2)), password: R.string().required(Q("ERRORS.password")) })), H = useRouter(), J = useCookie("she_in_guest_token"), K = ref({}), W = useStore(), ee = ref(false), ae = async (e2) => {
    ee.value = true, u2.post("login", { credential: e2.emailPhone, password: e2.password, device_token: "Figo", type: "ios" }).then((e3) => {
      e3.data.data.is_active ? (J.value = null, useCookie(D).value = e3.data.data.token, useCookie(M).value = { ...e3.data.data, token: undefined }, W.setProfile(e3.data.data), pe.success(e3.data.message), setTimeout(() => {
        H.push(Z("/"));
      }, 1e3)) : (useCookie("phoneCode").value = e3.data.data.phone_code, useCookie("phone").value = e3.data.data.phone, m2.value = true);
    }).catch((e3) => {
      pe.error(e3.response.data.message);
    }).finally(() => {
      ee.value = false;
    });
  };
  return (a2, t2, s2, l3) => {
    const n2 = resolveComponent("VeeForm"), r2 = q$1, d2 = __nuxt_component_0$2, i2 = g, u3 = O, v2 = C, L2 = l, U2 = O$1, D2 = k$1;
    t2(`<div${ssrRenderAttrs(mergeProps({ class: "shadow-[0px_0px_24px_0px_#20202014] p-6 sm:p-8" }, l3))}><h1 class="text-primary capitalize text-2xl text-center font-DMSerifDisplay italic mb-8 sm:text-4xl">${ssrInterpolate(a2.$t("TITLES.welcomeBack"))}</h1>`), t2(ssrRenderComponent(n2, { "validation-schema": unref(Y), onSubmit: ae, initialValues: unref(K) }, { default: withCtx((e2, t3, s3, o2) => {
      if (!t3) return [createVNode("div", { class: "mb-8" }, [createVNode(r2, { name: "emailPhone", label: a2.$t("TITLES.emailPhone"), placeholder: a2.$t("INPUTS.emailPhone"), type: "text", value: unref(K).emailPhone, "onUpdate:value": (e3) => unref(K).emailPhone = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", { class: "mb-8" }, [createVNode(r2, { name: "password", label: a2.$t("LABELS.password"), placeholder: a2.$t("INPUTS.password"), type: "password", value: unref(K).password, "onUpdate:value": (e3) => unref(K).password = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", { class: "mb-6 flex items-center justify-end" }, [createVNode("button", { onClick: F2, class: "text-primary", type: "button" }, toDisplayString(a2.$t("TITLES.forget_password")), 1)]), createVNode("div", null, [createVNode("button", { disabled: unref(ee), loading: unref(ee), type: "submit", class: "base-btn capitalize w-full mb-2" }, toDisplayString(a2.$t("TITLES.signIn")), 9, ["disabled", "loading"])])];
      t3(`<div class="mb-8"${o2}>`), t3(ssrRenderComponent(r2, { name: "emailPhone", label: a2.$t("TITLES.emailPhone"), placeholder: a2.$t("INPUTS.emailPhone"), type: "text", value: unref(K).emailPhone, "onUpdate:value": (e3) => unref(K).emailPhone = e3 }, null, s3, o2)), t3(`</div><div class="mb-8"${o2}>`), t3(ssrRenderComponent(r2, { name: "password", label: a2.$t("LABELS.password"), placeholder: a2.$t("INPUTS.password"), type: "password", value: unref(K).password, "onUpdate:value": (e3) => unref(K).password = e3 }, null, s3, o2)), t3(`</div><div class="mb-6 flex items-center justify-end"${o2}><button class="text-primary" type="button"${o2}>${ssrInterpolate(a2.$t("TITLES.forget_password"))}</button></div><div${o2}><button${ssrIncludeBooleanAttr(unref(ee)) ? " disabled" : ""}${ssrRenderAttr("loading", unref(ee))} type="submit" class="base-btn capitalize w-full mb-2"${o2}>${ssrInterpolate(a2.$t("TITLES.signIn"))}</button></div>`);
    }), _: 1 }, s2)), t2(`<div class="flex items-center justify-center gap-2 my-6"><span>${ssrInterpolate(a2.$t("TEXTS.dont_have_account"))}</span>`), t2(ssrRenderComponent(d2, { to: unref(Z)("/auth/create-account"), class: "text-[#06528D]", type: "button" }, { default: withCtx((e2, t3, s3, o2) => {
      if (!t3) return [createTextVNode(toDisplayString(a2.$t("TITLES.createAccount")), 1)];
      t3(`${ssrInterpolate(a2.$t("TITLES.createAccount"))}`);
    }), _: 1 }, s2)), t2('</div><div class="flex flex-wrap gap-2 items-center"><button class="flex-1 py-3 px-2 flex items-center justify-center gap-1.5 border-#E1E1E1 border shadow-[0px_8px_30px_0px_#00000008]">'), t2(ssrRenderComponent(i2, { name: "blue-facebook" }, null, s2)), t2(`<span>${ssrInterpolate(a2.$t("TITLES.facebook"))}</span></button><button class="flex-1 py-3 px-2 flex items-center justify-center gap-1.5 border-#E1E1E1 border shadow-[0px_8px_30px_0px_#00000008]">`), t2(ssrRenderComponent(i2, { name: "Google" }, null, s2)), t2(`<span>${ssrInterpolate(a2.$t("TITLES.google"))}</span></button><button class="flex-1 py-3 px-2 flex items-center justify-center gap-1.5 border-#E1E1E1 border shadow-[0px_8px_30px_0px_#00000008]">`), t2(ssrRenderComponent(i2, { name: "ic_round-apple" }, null, s2)), t2(`<span>${ssrInterpolate(a2.$t("TITLES.apple"))}</span></button></div><div class="flex items-center justify-center gap-2 my-6">`), t2(ssrRenderComponent(d2, { to: unref(Z)("/create-account"), class: "text-[#1F1F1F] font-medium underline text-lg", type: "button" }, { default: withCtx((e2, t3, s3, o2) => {
      if (!t3) return [createTextVNode(toDisplayString(a2.$t("TITLES.continueAsVisitor")), 1)];
      t3(`${ssrInterpolate(a2.$t("TITLES.continueAsVisitor"))}`);
    }), _: 1 }, s2)), t2("</div>"), unref(c2) ? ssrRenderTeleport(t2, (e2) => {
      e2(ssrRenderComponent(u3, { onResetPassword: V2, onClose: (e3) => c2.value = false, title: a2.$t("TITLES.recoveryPassword") }, null, s2));
    }, "body", false, s2) : t2("<!---->"), unref(z2) ? ssrRenderTeleport(t2, (e2) => {
      e2(ssrRenderComponent(v2, { onSuccess: q2, onClose: (e3) => z2.value = false, title: a2.$t("TITLES.recoveryPassword") }, null, s2));
    }, "body", false, s2) : t2("<!---->"), unref(k2) ? ssrRenderTeleport(t2, (e2) => {
      e2(ssrRenderComponent(L2, { onClose: (e3) => k2.value = false, title: a2.$t("TITLES.resetPassword"), desc: a2.$t("TEXTS.passwordResetSuccess") }, null, s2));
    }, "body", false, s2) : t2("<!---->"), unref(m2) ? ssrRenderTeleport(t2, (e2) => {
      e2(ssrRenderComponent(U2, { onEditPhone: N2, onClose: (e3) => m2.value = false, title: a2.$t("TITLES.confirmationCode") }, null, s2));
    }, "body", false, s2) : t2("<!---->"), unref(_2) ? ssrRenderTeleport(t2, (e2) => {
      e2(ssrRenderComponent(D2, { onToggleOtp: B2, onClose: (e3) => _2.value = false, title: a2.$t("TITLES.editPhoneNumber") }, null, s2));
    }, "body", false, s2) : t2("<!---->"), t2("</div>");
  };
} }, q = k.setup;
k.setup = (e2, a2) => {
  const t2 = useSSRContext();
  return (t2.modules || (t2.modules = /* @__PURE__ */ new Set())).add("components/Auth/LoginForm.vue"), q ? q(e2, a2) : undefined;
};
const z = { __name: "index", __ssrInlineRender: true, setup: (e2) => (e3, a2, t2, s2) => {
  const o2 = k;
  a2(`<div${ssrRenderAttrs(s2)}>`), a2(ssrRenderComponent(o2, null, null, t2)), a2("</div>");
} }, V = z.setup;
z.setup = (e2, a2) => {
  const t2 = useSSRContext();
  return (t2.modules || (t2.modules = /* @__PURE__ */ new Set())).add("pages/auth/login/index.vue"), V ? V(e2, a2) : undefined;
};

export { z as default };
//# sourceMappingURL=index-D3KHwqls.mjs.map
