(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78445,e=>{"use strict";var t=e.i(59760);let s=(...e)=>e.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim(),a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,t.forwardRef)(({color:e="currentColor",size:a=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:o="",children:n,iconNode:c,...d},x)=>(0,t.createElement)("svg",{ref:x,...l,width:a,height:a,stroke:e,strokeWidth:i?24*Number(r)/Number(a):r,className:s("lucide",o),...!n&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(d)&&{"aria-hidden":"true"},...d},[...c.map(([e,s])=>(0,t.createElement)(e,s)),...Array.isArray(n)?n:[n]])),i=(e,l)=>{let i=(0,t.forwardRef)(({className:i,...o},n)=>(0,t.createElement)(r,{ref:n,iconNode:l,className:s(`lucide-${a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,i),...o}));return i.displayName=a(e),i};e.s(["default",()=>i],78445)},12856,(e,t,s)=>{t.exports=e.r(96479)},54879,e=>{"use strict";let t=(0,e.i(78445).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",()=>t],54879)},50147,e=>{"use strict";let t=(0,e.i(78445).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],50147)},98867,e=>{"use strict";let t=(0,e.i(78445).default)("panels-top-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);e.s(["Layout",()=>t],98867)},19809,e=>{"use strict";let t=(0,e.i(78445).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",()=>t],19809)},54956,e=>{"use strict";let t=(0,e.i(78445).default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);e.s(["Target",()=>t],54956)},49491,e=>{"use strict";let t=(0,e.i(78445).default)("flame",[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]);e.s(["Flame",()=>t],49491)},4248,e=>{"use strict";var t=e.i(30064),s=e.i(12856),a=e.i(18404),l=e.i(59760),r=e.i(50147),i=e.i(19809),o=e.i(54879);let n=(0,e.i(78445).default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var c=e.i(54956),d=e.i(49491),x=e.i(98867);let u=({user:e,onUpdate:s,onBack:a})=>{console.log("[UserProfileSettings DEBUG] PROPS RECEIVED:",{user:e,userId:e?.id,hasOnUpdate:!!s,hasOnBack:!!a});let[u,m]=(0,l.useState)("profile"),[h,p]=(0,l.useState)({name:e.name,bio:e.bio||"",email:e.email,theme:e.preferences.theme,dailyWordGoal:e.preferences.dailyWordGoal});return(0,t.jsx)("div",{className:"h-full bg-slate-50 overflow-y-auto p-8 font-sans",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-10",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-3xl font-black text-slate-900",children:"Mon Compte"}),(0,t.jsx)("p",{className:"text-slate-500",children:"Gérez vos informations personnelles et préférences d'écriture."})]}),(0,t.jsx)("button",{onClick:a,className:"bg-white border border-slate-200 px-4 py-2 rounded-lg text-sm font-bold hover:bg-slate-50 transition-colors",children:"Fermer"})]}),(0,t.jsxs)("div",{className:"flex flex-col md:flex-row gap-8",children:[(0,t.jsxs)("div",{className:"w-full md:w-64 space-y-1",children:[(0,t.jsxs)("button",{onClick:()=>m("profile"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"profile"===u?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,t.jsx)(r.User,{size:18})," Profil Public"]}),(0,t.jsxs)("button",{onClick:()=>m("preferences"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"preferences"===u?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,t.jsx)(x.Layout,{size:18})," Interface & Écriture"]}),(0,t.jsxs)("button",{onClick:()=>m("account"),className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl text-sm font-bold transition-all ${"account"===u?"bg-slate-900 text-white shadow-lg":"text-slate-500 hover:bg-white hover:text-slate-900"}`,children:[(0,t.jsx)(i.Shield,{size:18})," Sécurité & Plan"]})]}),(0,t.jsxs)("div",{className:"flex-1 bg-white rounded-2xl shadow-sm border border-slate-200 p-8",children:["profile"===u&&(0,t.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:[(0,t.jsxs)("div",{className:"flex items-center gap-6 pb-8 border-b border-slate-100",children:[(0,t.jsxs)("div",{className:"relative group",children:[(0,t.jsx)("img",{src:e.avatar,className:"w-24 h-24 rounded-full object-cover border-4 border-slate-50 shadow-md",alt:"Avatar"}),(0,t.jsx)("button",{className:"absolute inset-0 bg-black/40 text-white rounded-full opacity-0 group-hover:opacity-100 flex items-center justify-center transition-opacity",children:(0,t.jsx)(n,{size:20})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-bold text-slate-900 text-lg",children:e.name}),(0,t.jsx)("p",{className:"text-slate-400 text-sm",children:"Membre depuis Janvier 2024"}),(0,t.jsx)("div",{className:"mt-2 flex gap-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-bold text-orange-500",children:[(0,t.jsx)(d.Flame,{size:14,fill:"currentColor"})," ",e.stats.writingStreak," jours de streak"]})})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Nom affiché"}),(0,t.jsx)("input",{type:"text",value:h.name,onChange:e=>p({...h,name:e.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Bio / Citation inspirante"}),(0,t.jsx)("textarea",{value:h.bio,onChange:e=>p({...h,bio:e.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500 h-24 resize-none",placeholder:"Partagez quelques mots sur votre style..."})]})]})]}),"preferences"===u&&(0,t.jsx)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-8",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-2",children:[(0,t.jsx)(c.Target,{size:14})," Objectif quotidien de mots"]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("input",{type:"range",min:"0",max:"5000",step:"100",value:h.dailyWordGoal,onChange:e=>p({...h,dailyWordGoal:parseInt(e.target.value)}),className:"flex-1 accent-blue-600"}),(0,t.jsx)("span",{className:"font-mono font-bold text-blue-600 bg-blue-50 px-3 py-1 rounded-lg",children:h.dailyWordGoal})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest flex items-center gap-2",children:"Thème de l'éditeur"}),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-3",children:["light","sepia","dark"].map(e=>(0,t.jsxs)("button",{onClick:()=>p({...h,theme:e}),className:`p-4 rounded-xl border-2 transition-all flex flex-col items-center gap-2 ${h.theme===e?"border-blue-500 bg-blue-50 text-blue-700":"border-slate-100 hover:border-slate-200 text-slate-500"}`,children:[(0,t.jsx)("div",{className:`w-8 h-8 rounded-full border border-slate-200 ${"light"===e?"bg-white":"sepia"===e?"bg-[#f4ecd8]":"bg-slate-900"}`}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase",children:e})]},e))})]})]})}),"account"===u&&(0,t.jsxs)("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-300",children:[(0,t.jsxs)("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-xl flex justify-between items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"font-bold text-blue-900",children:["Plan ",e.subscription.plan.toUpperCase()]}),(0,t.jsx)("p",{className:"text-xs text-blue-700",children:"Prochaine facturation le 15 Mars 2024"})]}),(0,t.jsx)("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-lg text-xs font-bold hover:bg-blue-700 shadow-md shadow-blue-200",children:"Gérer"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs font-black text-slate-400 uppercase tracking-widest",children:"Email du compte"}),(0,t.jsx)("input",{type:"email",value:h.email,onChange:e=>p({...h,email:e.target.value}),className:"w-full p-3 bg-slate-50 border border-slate-200 rounded-xl outline-none focus:ring-2 focus:ring-blue-500"})]}),(0,t.jsx)("div",{className:"pt-4",children:(0,t.jsx)("button",{className:"text-red-500 text-sm font-bold hover:underline",children:"Supprimer mon compte définitivement"})})]}),(0,t.jsx)("div",{className:"mt-12 pt-8 border-t border-slate-100 flex justify-end",children:(0,t.jsxs)("button",{onClick:()=>{s({name:h.name,bio:h.bio,email:h.email,preferences:{...e.preferences,theme:h.theme,dailyWordGoal:h.dailyWordGoal}}),alert("Profil mis à jour !")},className:"bg-slate-900 text-white px-8 py-3 rounded-xl font-bold flex items-center gap-2 hover:bg-blue-600 transition-all shadow-xl hover:shadow-blue-200",children:[(0,t.jsx)(o.Save,{size:18})," Sauvegarder les modifications"]})})]})]})]})})};function m(){let e=(0,s.useRouter)(),{user:r,loading:i}=(0,a.useAuthContext)();return((0,l.useEffect)(()=>{i||r||e.replace("/login")},[r,i,e]),i||!r)?null:(0,t.jsx)(u,{user:r,onUpdate:e=>console.log("Profile update:",e),onBack:()=>e.push("/dashboard")})}e.s(["default",()=>m],4248)}]);