"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),h=require("react-router-dom"),r=require("lucide-react"),o=require("./index-2wUhd9Lu.js");function b(){const[s,c]=t.useState(""),[a,i]=t.useState(!1),[n,d]=t.useState(null),[m,x]=t.useState(!1),u=async l=>{l.preventDefault(),d(null),i(!0);try{await o.authApi.forgotPassword(s),x(!0)}catch(g){d(g?.message||"Une erreur est survenue")}finally{i(!1)}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-8",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("div",{className:"flex justify-end mb-8",children:e.jsx(o.ThemeSwitcher,{})}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-2xl shadow-xl p-8",children:[m?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(r.CheckCircle2,{className:"w-10 h-10 text-green-600 dark:text-green-400"})}),e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Email envoyé !"}),e.jsxs("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:["Si un compte existe avec l'adresse ",e.jsx("strong",{children:s}),", vous recevrez un lien de réinitialisation."]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"N'oubliez pas de vérifier vos spams."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-blue-100 dark:bg-blue-900/30 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(r.Mail,{className:"w-8 h-8 text-blue-600 dark:text-blue-400"})}),e.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Mot de passe oublié ?"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Entrez votre email et nous vous enverrons un lien pour réinitialiser votre mot de passe."})]}),n&&e.jsxs("div",{className:"mb-6 p-4 bg-red-500/10 border border-red-500/20 rounded-lg flex items-start gap-3",children:[e.jsx(r.AlertCircle,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-red-500",children:n})]}),e.jsxs("form",{onSubmit:u,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Adresse email"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:e.jsx(r.Mail,{className:"h-5 w-5 text-gray-400"})}),e.jsx("input",{id:"email",type:"email",value:s,onChange:l=>c(l.target.value),className:"block w-full pl-10 pr-3 py-2.5 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"vous@exemple.com",required:!0,autoComplete:"email",disabled:a})]})]}),e.jsx("button",{type:"submit",disabled:a,className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-lg font-medium hover:from-blue-700 hover:to-purple-700 disabled:opacity-50 transition-all",children:a?e.jsxs(e.Fragment,{children:[e.jsx(r.Loader2,{className:"h-5 w-5 animate-spin"}),"Envoi en cours..."]}):"Envoyer le lien"})]})]}),e.jsx("div",{className:"mt-6 pt-6 border-t border-gray-200 dark:border-gray-700",children:e.jsxs(h.Link,{to:"/login",className:"flex items-center justify-center gap-2 text-sm text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:[e.jsx(r.ArrowLeft,{className:"w-4 h-4"}),"Retour à la connexion"]})})]})]})})}exports.ForgotPasswordPage=b;
//# sourceMappingURL=ForgotPasswordPage-0u49E4Pw.js.map
