import{u as h,c as a,a as s,b as k,e as S,f as _,w as R,d as w,v as b,t as v,g as V,l as M,h as N,r,j as P,i as q,o as l,k as B}from"./index-Bodg7xX-.js";import{_ as C}from"./bmmg-logo-CDMybbK7.js";const T={class:"min-h-screen bg-ink flex items-center justify-center px-6 relative overflow-hidden"},j={class:"relative w-full max-w-sm animate-fade-up"},D={key:0,class:"glass rounded-2xl p-6 space-y-4 shadow-soft text-center"},G={key:1,class:"glass rounded-2xl p-6 space-y-4 shadow-soft text-center"},U={key:0,class:"text-sm text-wine-deep bg-wine/20 border border-wine/40 rounded-lg px-3 py-2 text-cream"},A=["disabled"],H={__name:"ResetPassword",setup(E){const x=P(),f=q(),g=h(),c=M(()=>x.query.token||""),o=r(""),d=r(""),t=r(""),n=r(!1),m=r(!1);async function y(){var i,e;if(t.value="",o.value.length<8){t.value="Password must be at least 8 characters.";return}if(o.value!==d.value){t.value="Passwords don't match.";return}n.value=!0;try{await g.resetPassword(c.value,o.value),m.value=!0,setTimeout(()=>f.push({name:"admin-login"}),2e3)}catch(u){t.value=((e=(i=u.response)==null?void 0:i.data)==null?void 0:e.message)||"Something went wrong. Try again."}finally{n.value=!1}}return(i,e)=>{const u=N("router-link");return l(),a("div",T,[e[8]||(e[8]=s("div",{class:"absolute inset-0 bg-radial-fade pointer-events-none"},null,-1)),s("div",j,[e[7]||(e[7]=k('<div class="text-center mb-10"><div class="inline-flex items-center gap-2.5 mb-6"><img src="'+C+'" alt="BMMG Records" class="w-11 h-11 object-contain"><span class="font-mono text-[11px] tracking-[0.25em] uppercase text-muted">BMMG Records</span></div><h1 class="font-display text-3xl text-cream">Set a new password</h1><p class="text-muted text-sm mt-2">Choose something you haven&#39;t used before.</p></div>',1)),c.value?m.value?(l(),a("div",G,[...e[4]||(e[4]=[s("p",{class:"text-cream text-sm"},"Password updated — redirecting you to sign in…",-1)])])):(l(),a("form",{key:2,onSubmit:R(y,["prevent"]),class:"glass rounded-2xl p-6 space-y-4 shadow-soft"},[s("div",null,[e[5]||(e[5]=s("label",{class:"eyebrow block mb-2",for:"password"},"New password",-1)),w(s("input",{id:"password","onUpdate:modelValue":e[0]||(e[0]=p=>o.value=p),type:"password",required:"",autocomplete:"new-password",class:"w-full bg-black/30 border border-hairline rounded-lg px-4 py-2.5 text-cream placeholder:text-muted/60 focus:border-gold/50 outline-none transition-colors",placeholder:"••••••••"},null,512),[[b,o.value]])]),s("div",null,[e[6]||(e[6]=s("label",{class:"eyebrow block mb-2",for:"confirm-password"},"Confirm password",-1)),w(s("input",{id:"confirm-password","onUpdate:modelValue":e[1]||(e[1]=p=>d.value=p),type:"password",required:"",autocomplete:"new-password",class:"w-full bg-black/30 border border-hairline rounded-lg px-4 py-2.5 text-cream placeholder:text-muted/60 focus:border-gold/50 outline-none transition-colors",placeholder:"••••••••"},null,512),[[b,d.value]])]),t.value?(l(),a("p",U,v(t.value),1)):V("",!0),s("button",{type:"submit",disabled:n.value,class:"w-full bg-gold hover:bg-gold-bright disabled:opacity-50 text-ink font-semibold rounded-lg py-2.5 transition-colors"},v(n.value?"Saving…":"Set new password"),9,A)],32)):(l(),a("div",D,[e[3]||(e[3]=s("p",{class:"text-sm text-wine-deep bg-wine/20 border border-wine/40 rounded-lg px-3 py-2 text-cream"}," This link is missing its reset token. Request a new one below. ",-1)),S(u,{to:{name:"admin-forgot-password"},class:"inline-block text-sm text-gold hover:text-gold-bright transition-colors"},{default:_(()=>[...e[2]||(e[2]=[B(" Request a new reset link ",-1)])]),_:1})]))])])}}};export{H as default};
