PageSourceSearch

https://www.boutiqueavivre.fr/_next/static/chunks/38kejt3yxtugq.js

js boutiqueavivre.fr collected 2026-10-09 02:56:00 UTC 31,854 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,912818,e=>{"use strict";var a=e.i(843476),r=e.i(72790),s=e.i(57263),t=e.i(994814),i=e.i(63209),o=e.i(871689),c=e.i(643531),l=e.i(678078),n=e.i(737152),d=e.i(85557),x=e.i(618566),m=e.i(271645),h=e.i(653145),u=e.i(846696),p=e.i(681307),g=e.i(570932),f=e.i(762146),b=e.i(997495),y=e.i(817259),v=e.i(607253);let j=/[a-z]/,k=/[A-Z]/,w=/\d/,N=/[!@#$%^&*(),.?":{}|<>]/,C=p.z.object({firstName:p.z.string().min(2,"Le prénom doit contenir au moins 2 caractères"),lastName:p.z.string().min(2,"Le nom doit contenir au moins 2 caractères"),email:p.z.string().email("Email invalide").min(1,"L'email est requis"),password:p.z.string().min(8,"Le mot de passe doit contenir au moins 8 caractères").regex(j,"Le mot de passe doit contenir au moins une lettre minuscule").regex(k,"Au moins une majuscule est requise").regex(w,"Au moins un chiffre est requis").regex(N,"Au moins un caractère spécial est requis"),confirmPassword:p.z.string().min(1,"Veuillez confirmer votre mot de passe"),isArchitect:p.z.boolean().optional()}).refine(e=>e.password===e.confirmPassword,{message:"Les mots de passe ne correspondent pas",path:["confirmPassword"]});e.s(["f",0,function({onSuccess:e,onSwitchToLogin:p,showTitle:L=!0,showLinks:S=!0,showArchitectToggle:z=!1,defaultIsArchitect:M=!1}){let[A,V]=(0,m.useState)(!1),[P,q]=(0,m.useState)(!1),[E,U]=(0,m.useState)(!1),[_,R]=(0,m.useState)(1),[B,T]=(0,m.useState)(!1),[F,O]=(0,m.useState)("connecting"),[H,$]=(0,m.useState)(null),[W,I]=(0,m.useState)(null),D=(0,x.useRouter)(),G=y.api.auth.register.useMutation({}),[J,K]=(0,m.useState)({hasMinLength:!1,hasLowerCase:!1,hasUpperCase:!1,hasNumber:!1,hasSpecialChar:!1});m.default.useEffect(()=>{(async()=>{let e=await (0,g.N)();e&&$(e)})()},[]);let X=(0,h.G)({resolver:(0,t.f)(C),defaultValues:{firstName:"",lastName:"",email:"",password:"",confirmPassword:"",isArchitect:M},mode:"onChange"}),Z=m.default.useCallback(e=>{K({hasMinLength:e.length>=8,hasLowerCase:j.test(e),hasUpperCase:k.test(e),hasNumber:w.test(e),hasSpecialChar:N.test(e)})},[]);m.default.useEffect(()=>{let e=X.watch((e,{name:a})=>{"password"===a&&e.password&&Z(e.password)});return()=>e.unsubscribe()},[X.watch,Z]);let{dirtyFields:Q,errors:Y}=X.formState,ee=e=>Y[e]?"border-red-400 focus:border-red-500 focus:ring-red-200":Q[e]?"border-emerald-400 focus:border-emerald-500 focus:ring-emerald-200":"border-gray-300 dark:border-gray-600 focus:border-[#1a1a1a] dark:focus:border-[#888] focus:ring-[#1a1a1a] dark:focus:ring-[#888]",ea=e=>Q[e]&&!Y[e],er=J.hasMinLength&&J.hasLowerCase&&J.hasUpperCase&&J.hasNumber&&J.hasSpecialChar,es=async()=>{I(null),await X.trigger(["email","password","confirmPassword"])&&R(2)};async function et(a){U(!0),I(null);try{let r=await G.mutateAsync({password:a.password,email:a.email,firstName:a.firstName,lastName:a.lastName,confirmPassword:a.confirmPassword,isArchitect:a.isArchitect??void 0});if(r.success){console.log("✅ Registration successful - attempting automatic login"),u.toast.success("Votre compte a été créé avec succès !"),T(!0),O("connecting");try{console.log("🔄 Starting automatic login process with NextAuth..."),console.log("📧 Login credentials:",{email:a.email,site:window.location.hostname});let r=(0,f.f)({site:window.location.hostname,email:a.email,password:a.password,csrfToken:H}),s=await (0,g.O)("credentials",r);console.log("🔐 NextAuth signIn result:",s),s?.error?(console.error("❌ Automatic login failed:",s),O("error"),setTimeout(()=>{T(!1),D.push("/votre-espace?fromRegistration=true")},2e3)):s?.url?.includes("?csrf=true")?(console.error("❌ CSRF validation failed"),O("error"),setTimeout(()=>{T(!1),D.push("/votre-espace?fromRegistration=true")},2e3)):(console.log("✅ Authentication successful!"),O("success"),setTimeout(()=>{T(!1),e?e():D.push("/votre-espace")},1500))}catch(e){console.error("💥 Automatic login error:",e),e instanceof Error&&console.error("❌ Error message:",e.message),O("error"),setTimeout(()=>{T(!1),D.push("/votre-espace?fromRegistration=true")},2e3)}}else"USER_EXISTS"===r.code?(I("Un utilisateur avec cet email existe déjà."),X.setError("email",{message:"Cet email est déjà utilisé"})):"USER_NOT_CREATED"===r.code?I("Le compte n'a pas pu être créé. Veuillez réessayer."):I("Une erreur s'est produite lors de la création de votre compte.")}catch(e){console.error("Erreur d'inscription:",e),I("Une erreur s'est produite lors de la création de votre compte.")}finally{U(!1)}}return(0,a.jsxs)("div",{className:"mx-auto w-full max-w-md",children:[L&&(0,a.jsxs)("div",{className:"mb-4 text-center",children:[(0,a.jsx)("h1",{className:"mb-1 font-light text-2xl text-gray-900 dark:text-white tracking-tight",children:"Créer un compte"}),(0,a.jsx)("p",{className:"text-gray-600 dark:text-gray-300 text-sm",children:"Rejoignez notre c
1ommunauté"})]}),W&&(0,a.jsx)("div",{className:"mb-4 border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950/50 p-4",children:(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(i.f,{className:"h-5 w-5 flex-shrink-0 text-red-500 dark:text-red-400"}),(0,a.jsx)("p",{className:"font-medium text-red-700 dark:text-red-300 text-sm",children:W})]})}),(0,a.jsxs)("form",{className:"space-y-2",onSubmit:X.handleSubmit(et),children:[(0,a.jsxs)(d.o,{initial:!1,mode:"wait",children:[1===_&&(0,a.jsxs)(d.c.div,{className:"space-y-2",initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-16},transition:{duration:.18,ease:"easeOut"},children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"email",children:"Adresse email"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.f,{id:"email",placeholder:"[email protected]",type:"email",...X.register("email"),className:(0,b.c)("h-12 w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 text-base transition-colors focus:ring-opacity-20 dark:focus:ring-opacity-30",ee("email")),required:!0}),ea("email")&&(0,a.jsx)(c.f,{className:"absolute top-1/2 right-3 h-5 w-5 -translate-y-1/2 text-emerald-500"})]}),Y.email&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(i.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:Y.email.message})]})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"password",children:"Mot de passe"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.f,{id:"password",placeholder:"Votre mot de passe",type:A?"text":"password",...X.register("password"),onFocus:()=>q(!0),onBlur:()=>q(!1),className:(0,b.c)("h-12 w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 pr-12 text-base transition-colors focus:ring-opacity-20 dark:focus:ring-opacity-30",ee("password")),required:!0}),(0,a.jsxs)("div",{className:"absolute top-1/2 right-3 -translate-y-1/2 flex items-center gap-1",children:[ea("password")&&(0,a.jsx)(c.f,{className:"h-5 w-5 text-emerald-500"}),(0,a.jsx)("button",{"aria-label":A?"Masquer le mot de passe":"Afficher le mot de passe",className:"p-1 text-gray-500 dark:text-gray-400 transition-colors hover:text-gray-700 dark:hover:text-gray-200",onMouseDown:e=>e.preventDefault(),onClick:()=>V(!A),tabIndex:-1,type:"button",children:A?(0,a.jsx)(n.f,{size:20}):(0,a.jsx)(l.f,{size:20})})]})]}),Y.password&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(i.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:Y.password.message})]})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"confirmPassword",children:"Confirmer le mot de passe"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.f,{id:"confirmPassword",placeholder:"Confirmer votre mot de passe",type:"password",...X.register("confirmPassword"),className:(0,b.c)("h-12 w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 text-base transition-colors focus:ring-opacity-20 dark:focus:ring-opacity-30",ee("confirmPassword")),required:!0}),ea("confirmPassword")&&(0,a.jsx)(c.f,{className:"absolute top-1/2 right-3 h-5 w-5 -translate-y-1/2 text-emerald-500"})]}),Y.confirmPassword&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(i.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:Y.confirmPassword.message})]})]}),(P||!er)&&(0,a.jsxs)("div",{className:"space-y-1 border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 p-3",children:[(0,a.jsx)("h4",{className:"mb-2 font-medium text-gray-700 dark:text-gray-300 text-sm",children:"Votre mot de passe doit contenir :"}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3 text-sm",children:[(0,a.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${J.hasMinLength?"bg-[#1a1a1a]":"bg-gray-300 dark:bg-gray-600"}`,children:J.hasMinLength&&(0,a.jsx)("svg",{className:"h-2.5 w-2.5 text-white",f
1ill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3})})}),(0,a.jsx)("span",{className:J.hasMinLength?"text-[#1a1a1a] dark:text-[#ccc]":"text-gray-600 dark:text-gray-400",children:"Au moins 8 caractères"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 text-sm",children:[(0,a.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${J.hasLowerCase?"bg-[#1a1a1a]":"bg-gray-300 dark:bg-gray-600"}`,children:J.hasLowerCase&&(0,a.jsx)("svg",{className:"h-2.5 w-2.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3})})}),(0,a.jsx)("span",{className:J.hasLowerCase?"text-[#1a1a1a] dark:text-[#ccc]":"text-gray-600 dark:text-gray-400",children:"Au moins 1 minuscule"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 text-sm",children:[(0,a.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${J.hasUpperCase?"bg-[#1a1a1a]":"bg-gray-300 dark:bg-gray-600"}`,children:J.hasUpperCase&&(0,a.jsx)("svg",{className:"h-2.5 w-2.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3})})}),(0,a.jsx)("span",{className:J.hasUpperCase?"text-[#1a1a1a] dark:text-[#ccc]":"text-gray-600 dark:text-gray-400",children:"Au moins 1 majuscule"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 text-sm",children:[(0,a.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${J.hasNumber?"bg-[#1a1a1a]":"bg-gray-300 dark:bg-gray-600"}`,children:J.hasNumber&&(0,a.jsx)("svg",{className:"h-2.5 w-2.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3})})}),(0,a.jsx)("span",{className:J.hasNumber?"text-[#1a1a1a] dark:text-[#ccc]":"text-gray-600 dark:text-gray-400",children:"Au moins 1 chiffre"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 text-sm",children:[(0,a.jsx)("div",{className:`flex h-4 w-4 items-center justify-center rounded-full ${J.hasSpecialChar?"bg-[#1a1a1a]":"bg-gray-300 dark:bg-gray-600"}`,children:J.hasSpecialChar&&(0,a.jsx)("svg",{className:"h-2.5 w-2.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3})})}),(0,a.jsx)("span",{className:J.hasSpecialChar?"text-[#1a1a1a] dark:text-[#ccc]":"text-gray-600 dark:text-gray-400",children:"Au moins 1 caractère spécial"})]})]})]})]},"step-1"),2===_&&(0,a.jsxs)(d.c.div,{className:"space-y-2",initial:{opacity:0,x:16},animate:{opacity:1,x:0},exit:{opacity:0,x:-16},transition:{duration:.18,ease:"easeOut"},children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"firstName",children:"Prénom"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.f,{id:"firstName",placeholder:"Votre prénom",type:"text",...X.register("firstName"),className:(0,b.c)("h-12 w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 text-base transition-colors focus:ring-opacity-20 dark:focus:ring-opacity-30",ee("firstName")),required:!0}),ea("firstName")&&(0,a.jsx)(c.f,{className:"absolute top-1/2 right-3 h-5 w-5 -translate-y-1/2 text-emerald-500"})]}),Y.firstName&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(i.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:Y.firstName.message})]})]}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"lastName",children:"Nom"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.f,{id:"lastName",placeholder:"Votre nom",type:"text",...X.register("lastName"),className:(0,b.c)("h-12 w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 text-base transition-colors focus:ring-opacity-20 dark:focus:ring-opacity-30",ee("lastName")),required:!0}),ea("lastName")&&(0,a.jsx)(c.f,{className:"absolute top-1/2 right-3 h-5 w-5 -translate-y-1/2 text-emerald-500"})]}),Y.lastName&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(i.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:Y.lastName.message})]})]}),z&&(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-3 rounded-md border border-gray-200 bg-[var(--avivre-surface-soft)] p-3 dark:border-gray-700 dark:bg-gray-800/50",children:[(0,a.jsx)("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 accent-[var(--avivre-program)]",...X.register("isArchitect")}
1),(0,a.jsxs)("span",{className:"text-sm leading-snug text-gray-800 dark:text-gray-200",children:[(0,a.jsx)("span",{className:"font-medium",children:"Je suis architecte"}),(0,a.jsx)("span",{className:"mt-0.5 block text-gray-500 dark:text-gray-400",children:"Candidater aux Prix Maisons À Vivre et gérer mes projets."})]})]})]},"step-2")]}),1===_?(0,a.jsx)(r.f,{className:"h-10 w-full bg-[#1a1a1a] font-medium text-base text-white shadow-sm transition-all duration-200 hover:bg-black hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50",type:"button",onClick:es,children:"Créer un compte 1/2"}):(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(r.f,{className:"h-10 w-full bg-[#1a1a1a] font-medium text-base text-white shadow-sm transition-all duration-200 hover:bg-black hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50",disabled:E,type:"submit",children:E?(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),(0,a.jsx)("span",{children:"Création en cours..."})]}):"Créer un compte 2/2"}),(0,a.jsxs)("button",{type:"button",className:"flex items-center gap-1 text-sm text-gray-500 transition-colors hover:text-[#1a1a1a] dark:text-gray-400 dark:hover:text-white",onClick:()=>{I(null),R(1)},disabled:E,children:[(0,a.jsx)(o.f,{className:"h-3.5 w-3.5"}),"Retour"]})]})]}),S&&(0,a.jsx)(v.f,{redirect:"/votre-espace",setError:I,label:"Ou s'inscrire avec"}),(L||p)&&(0,a.jsx)("div",{className:"mt-6 text-center",children:(0,a.jsxs)("p",{className:"text-gray-600 dark:text-gray-300 text-sm",children:["Vous possédez déjà un compte ?"," ",p?(0,a.jsx)("button",{className:"font-medium text-[var(--avivre-secondary)] transition-colors hover:text-black dark:hover:text-white",onClick:p,type:"button",children:"Se connecter"}):(0,a.jsx)("a",{className:"font-medium text-[var(--avivre-secondary)] transition-colors hover:text-black dark:hover:text-white",href:"/login",children:"Se connecter"})]})}),B&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,a.jsx)("div",{className:"mx-4 max-w-md bg-white dark:bg-gray-900 p-8 shadow-xl border border-gray-200 dark:border-gray-800",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("div",{className:"mb-4",children:["connecting"===F&&(0,a.jsx)("div",{className:"mx-auto h-16 w-16 animate-spin rounded-full border-4 border-[#1a1a1a] border-t-transparent"}),"success"===F&&(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-[#1a1a1a]/15 dark:bg-[#1a1a1a]/20",children:(0,a.jsx)("svg",{className:"h-8 w-8 text-[#1a1a1a] dark:text-[#ccc]",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M5 13l4 4L19 7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})}),"error"===F&&(0,a.jsx)("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/50",children:(0,a.jsx)("svg",{className:"h-8 w-8 text-red-600 dark:text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2})})})]}),(0,a.jsxs)("h3",{className:"mb-2 font-semibold text-gray-900 dark:text-white text-lg",children:["connecting"===F&&"Connexion automatique en cours...","success"===F&&"Connexion réussie !","error"===F&&"Connexion automatique échouée"]}),(0,a.jsxs)("p",{className:"mb-4 text-gray-600 dark:text-gray-300 text-sm",children:["connecting"===F&&"Nous vous connectons automatiquement à votre nouveau compte.","success"===F&&"Vous allez être redirigé vers votre tableau de bord.","error"===F&&"Vous serez redirigé vers votre espace pour vous connecter manuellement."]}),"connecting"===F&&(0,a.jsx)("div",{className:"mb-4 h-2 w-full bg-gray-200 dark:bg-gray-700",children:(0,a.jsx)("div",{className:"h-2 w-3/4 animate-pulse bg-[#1a1a1a]"})})]})})})]})}])},765962,607253,e=>{"use strict";var a=e.i(843476),r=e.i(72790),s=e.i(395645),t=e.i(57263),i=e.i(994814),o=e.i(63209),c=e.i(678078),l=e.i(737152),n=e.i(618566),d=e.i(271645),x=e.i(653145),m=e.i(846696),h=e.i(681307),u=e.i(570932),p=e.i(997495),g=e.i(398363);function f({redirect:e,setError:r,label:s="Ou continuer avec"}){return(0,a.jsxs)("div",{className:"mt-8",children:[(0,a.jsxs)("div",{className:"relative mb-4",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-gray-200 dark:border-gray-700 border-t"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,a.jsx)("span",{className:"bg-white dark:bg-gray-900 px-4 text-gray-500 dark:text-gray-400",children:s})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsx)(y,{provider:"google",redirect:e,setError:r}),(0,a.jsx)(y,{provider:"linkedin",redirect:e,setError:r})]})]})}let b={google:"Google",github:"GitHub",linkedin:"LinkedIn"};function y({provider:e,redirect:r,setError:s}){let t=b[e];return(0,a.jsxs)("a",{href:`/api/auth/oidc-login?provider=${e}&redirect=${encodeURIComponent(r)}`,onClick:a=>(0,g.f)(a,r,s,e),"aria-label":`Continuer avec ${t}`,title:`Continuer avec ${t}`,className:(0,p.c)("flex h-12 items-center justify-center gap-2 border transition-colors","google"===e&&"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 hover:border-[#1a1a1a] dark:hover:border-white","github"===e&&"border-[#1a1a1a] bg-[#1a1a1a] text-white hover:bg-black","linkedin"===e&&"border-[#0a66c2] bg-[#0a66c2] text-white hover:bg-[#08508f]"),children:[(0,a.jsx)(v,{provider:e,className:"h-5 w-5 shrink-0"}),(0,a.jsx)("span",{className:"sr-only",children:t})]})}function v({provider:e,className:r}){return"google"===e?(0,a.jsxs)("svg",{className:r,viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,a.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}):"github"===e?(0,a.jsx)("svg",{className:r,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}):(0,a.jsx)("svg",{className:r,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.268 2.37 4.268 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.063 2.063 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})})}e.s(["f",0,f],607253);let j=h.z.object({email:h.z.string().max(60,"Doit contenir 60 caractères maximum").min(1,"Veuillez saisir votre identifiant de connexion"),password:h.z.string().min(1,"Veuillez saisir votre mot de passe")});e.s(["default",0,function({onSuccess:e,onSwitchToSignup:h,onSwitchToLostPassword:g,showTitle:b=!0,showLinks:y=!0,isMobileInline:v=!1,title:k="Se connecter",description:w="Accédez à votre espace personnel",signupPrompt:N="Vous n'avez pas de compte ?",signupLabel:C="Créer un compte",signupHref:L="/inscription"}){let[S,z]=(0,d.useState)(!1),[M,A]=(0,d.useState)(!1),[V,P]=(0,d.useState)(null),[q,E]=(0,d.useState)(!1),U=(0,n.useRouter)(),_=(0,n.use
1SearchParams)(),R=_.get("redirect"),B=_.get("email")??"",T=(0,u.U)(),F=(0,x.G)({resolver:(0,i.f)(j),defaultValues:{email:B,password:""}});async function O(a){try{A(!0),P(null);let r=await fetch("/api/auth/password-login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({email:a.email,password:a.password,redirect:R&&R.startsWith("/")?R:void 0})}),s=await r.json().catch(()=>({}));if(!r.ok||!s.success){let e=function(e,a){switch(e){case"invalid_credentials":return a||"Email ou mot de passe incorrect.";case"rate_limited":return a||"Trop de tentatives. Veuillez patienter quelques minutes avant de réessayer.";case"account_blocked":return a||"Ce compte est désactivé. Contactez le support.";case"user_not_found":return"Aucun compte trouvé pour cette adresse email.";case"missing_credentials":return"Veuillez saisir votre email et votre mot de passe.";case"token_invalid":case"config_error":return"Une erreur d'authentification s'est produite, veuillez réessayer.";default:return a||"Une erreur s'est produite. Veuillez réessayer."}}(s.error||"unknown",s.message);P(e),m.toast.error(e);return}P(null),m.toast.success("Connexion réussie"),"function"==typeof T.refresh&&await T.refresh(),e?e():(U.push(s.redirect||"/votre-espace"),U.refresh())}catch(a){console.error("LoginForm: network/unexpected error",a);let e=a.message||"Une erreur s'est produite";P(e),m.toast.error(e)}finally{A(!1)}}return(0,a.jsxs)("div",{className:"mx-auto w-full max-w-md font-josefin",children:[b&&(0,a.jsxs)("div",{className:"mb-8 text-center",children:[(0,a.jsx)("h1",{className:"mb-2 font-light text-3xl text-gray-900 dark:text-white tracking-tight",children:k}),(0,a.jsx)("p",{className:"text-base text-gray-600 dark:text-gray-300",children:w})]}),V&&(0,a.jsx)("div",{className:"mb-6 border border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-950/50 p-4",children:(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(o.f,{className:"h-5 w-5 flex-shrink-0 text-red-500 dark:text-red-400"}),(0,a.jsx)("p",{className:"font-medium text-red-700 dark:text-red-300 text-sm",children:V})]})}),(0,a.jsxs)("form",{className:(0,p.c)("space-y-6",v&&"space-y-4"),onSubmit:F.handleSubmit(O),children:[(0,a.jsxs)("div",{className:(0,p.c)("space-y-2",v&&"space-y-0"),children:[!v&&(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"email",children:"Adresse email"}),(0,a.jsx)(t.f,{id:"email",placeholder:v?"Adresse email":"[email protected]",type:"email",...F.register("email"),className:(0,p.c)("w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 text-base transition-colors",v?"h-[38px] rounded-[30px] border border-[#bebebe] text-[15px] placeholder:text-[rgba(78,78,78,0.6)] focus:border-[#1a1a1a] dark:focus:border-[#888]":"h-12 border-gray-300 dark:border-gray-600 focus:border-[#1a1a1a] dark:focus:border-[#888] focus:ring-[#1a1a1a] dark:focus:ring-[#888] focus:ring-opacity-20 dark:focus:ring-opacity-30"),required:!0}),F.formState.errors.email&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(o.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:F.formState.errors.email.message})]})]}),(0,a.jsxs)("div",{className:(0,p.c)("space-y-2",v&&"space-y-0"),children:[!v&&(0,a.jsx)("label",{className:"block font-medium text-gray-700 dark:text-gray-300 text-sm",htmlFor:"password",children:"Mot de passe"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(t.f,{id:"password",placeholder:v?"Mot de passe":"Votre mot de passe",type:S?"text":"password",...F.register("password"),className:(0,p.c)("w-full bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-4 py-3 pr-12 text-base transition-colors",v?"h-[38px] rounded-[30px] border border-[#bebebe] text-[15px] placeholder:text-[rgba(78,78,78,0.6)] focus:border-[#1a1a1a] dark:focus:border-[#888]":"h-12 border-gray-300 dark:border-gray-600 focus:border-[#1a1a1a] dark:focus:border-[#888] focus:ring-[#1a1a1a] dark:focus:ring-[#888] focus:ring-opacity-20 dark:focus:ring-opacity-30"),required:!0}),(0,a.jsx)("button",{"aria-label":S?"Masquer le mot de passe":"Afficher le mot de passe",className:"-translate-y-1/2 absolute top-1/2 right-3 p-1 text-gray-500 dark:text-gray-400 transition-colors hover:text-gray-700 dark:hover:text-gray-200",onClick:()=>z(!S),tabIndex:-1,type:"button",children:S?(0,a.jsx)(l.f,{size:20}):(0,a.jsx)(c.f,{size:20})})]}),F.formState.errors.password&&(0,a.jsxs)("p",{className:"flex items-center space-x-1 text-red-600 text-sm",children:[(0,a.jsx)(o.f,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:F.formState.errors.password.message})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(s.f,{checked:q,onCheckedChange:E,className:(0,p.c)("data-[state=checked]:bg-[#1a1a1a] data-[state=unchecked]:bg-gray-300 [&>span]:data-[state=checked]:translate-x-[calc(100%+2px)]",v?"h-[17px] w-[34px]":"h-5 w-9"),id:"remember"}),(0,a.jsx)("label",{className:(0,p.c)("cursor-pointer font-normal",v?"text-black dark:text-white text-[12px] leading-[18px]":"text-gray-700 dark:text-gray-300 text-sm"),htmlFor:"remember",children:v?"Rester connecté":"Je reste connecté"})]}),g?(0,a.jsx)("button",{className:(0,p.c)("font-medium text-sm transition-colors",v?"text-black dark:text-white text-xs hover:text-black":"text-[var(--avivre-secondary)] hover:text-black dark:hover:text-white"),onClick:g,type:"button",children:"Mot de passe oublié ?"}):(0,a.jsx)("a",{className:(0,p.c)("font-medium text-sm transition-colors",v?"text-black dark:text-white text-xs hover:text-black":"text-[var(--avivre-secondary)] hover:text-black dark:hover:text-white"),href:"/mot-de-passe-oublie",children:"Mot de passe oublié ?"})]}),(0,a.jsx)(r.f,{className:(0,p.c)("h-[57px] w-full font-medium text-white shadow-sm transition-all duration-200 hover:shadow-md disabled:cursor-not-allowed disabled:opacity-50",v?"rounded-[30px] bg-[#1a1a1a] hover:bg-black opacity-90 text-[20px]":"bg-[#1a1a1a] hover:bg-black text-base"),disabled:M,type:"submit",children:M?(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),(0,a.jsx)("span",{children:"Connexion en cours..."})]}):"Se connecter"})]}),y&&(0,a.jsx)(f,{redirect:R||"/votre-espace",setError:P}),y&&(0,a.jsxs)("div",{className:"mt-6 space-y-3 text-center",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-gray-200 dark:border-gray-700 border-t"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-sm",children:(0,a.jsx)("span",{className:"bg-white dark:bg-gray-900 px-4 text-gray-500 dark:text-gray-400",children:"Ou"})})]}),(0,a.jsxs)("p",{className:"text-gray-600 dark:text-gray-300 text-sm",children:[N," ",h?(0,a.jsx)("button",{className:"font-medium text-[var(--avivre-secondary)] transition-colors hover:text-black dark:hover:text-white",onClick:h,type:"button",children:C}):(0,a.jsx)("a",{className:"font-medium text-[var(--avivre-secondary)] transition-colors hover:text-black dark:hover:text-white",href:L,children:C})]})]})]})}],765962)},180127,e=>{"use strict";var a=e.i(475254);let r=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],s=(0,a.f)("arrow-left",r);e.s(["__iconNode",0,r,"default",0,s])},871689,e=>{"use strict";var a=e.i(180127);e.s(["f",()=>a.default])},678078,737152,e=>{"use strict";var a=e.i(389183);e.s(["f",()=>a.default],678078);var r=e.i(211749);e.s(["f",()=>r.default],737152)},692891,e=>{"use strict";var a=e.i(475254);let r=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}
1],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],s=(0,a.f)("log-in",r);e.s(["__iconNode",0,r,"default",0,s])},204997,e=>{"use strict";var a=e.i(692891);e.s(["f",()=>a.default])},827330,e=>{"use strict";var a=e.i(475254);let r=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],s=(0,a.f)("user-plus",r);e.s(["__iconNode",0,r,"default",0,s])},879002,e=>{"use strict";var a=e.i(827330);e.s(["f",()=>a.default])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.