PageSourceSearch

https://dietacademy.jp/_app/ResetPassword-tcIy-LVE.js

js dietacademy.jp collected 2026-10-07 11:50:39 UTC 5,543 bytes, 1 lines download raw bytes

1import{c as w,j as e,L as x,b as y}from"./index-D5yTtBfj.js";import{u as C,r as t}from"./react-w2_hd-Mb.js";import{B as u}from"./Button-C7FFXeG3.js";import{N as F,$ as L,aJ as k,_ as h,a8 as z,ai as B}from"./lucide-ZnjHBfqS.js";import"./supabase-DkYWVPkI.js";const A=()=>{const{t:s}=w(),i=C(),[n,p]=t.useState(""),[l,f]=t.useState(""),[c,d]=t.useState(!1),[m,o]=t.useState(""),[b,g]=t.useState(!1),[j,v]=t.useState(!1);t.useEffect(()=>{setTimeout(()=>v(!0),50)},[]);const N=async r=>{if(r.preventDefault(),o(""),n.length<6){o(s("auth.reset.minChars"));return}if(n!==l){o(s("auth.reset.notMatch"));return}d(!0);try{const{error:a}=await y.auth.updateUser({password:n});if(a)throw a;g(!0)}catch(a){console.error(a),o(a.message||s("auth.reset.error"))}finally{d(!1)}};return b?e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-orange-50 via-stone-50 to-amber-50 flex items-center justify-center p-4 relative overflow-hidden",children:[e.jsx("div",{className:"absolute top-4 right-4 z-50",children:e.jsx(x,{})}),e.jsxs("div",{className:"w-full max-w-md bg-white rounded-[2.5rem] p-8 sm:p-10 shadow-[0_20px_60px_-15px_rgba(0,0,0,0.06)] border border-stone-100 text-center space-y-6",children:[e.jsx("div",{className:"w-20 h-20 bg-emerald-50 rounded-3xl flex items-center justify-center mx-auto text-emerald-500 border border-emerald-100",children:e.jsx(F,{size:40})}),e.jsx("h1",{className:"text-2xl font-bold text-stone-800 font-serif-jp",children:s("auth.reset.successTitle")}),e.jsx("p",{className:"text-stone-500 text-sm leading-relaxed",children:s("auth.reset.successDesc")}),e.jsx(u,{variant:"orange",fullWidth:!0,size:"lg",onClick:()=>i("/member"),children:s("auth.reset.goToLogin")})]})]}):e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-orange-50 via-stone-50 to-amber-50 flex items-center justify-center p-4 relative overflow-hidden",children:[e.jsx("div",{className:"absolute -top-[20%] -right-[10%] w-[50%] h-[90%] bg-gradient-to-bl from-orange-200/30 via-transparent to-transparent rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute -bottom-[20%] -left-[10%] w-[40%] h-[80%] bg-gradient-to-tr from-rose-200/20 via-transparent to-transparent rounded-full blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute top-4 right-4 z-50",children:e.jsx(x,{})}),e.jsxs("div",{className:`w-full max-w-md relative z-10 transition-all duration-700 ${j?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-8 scale-95"}`,children:[e.jsx("div",{className:"text-center mb-6",children:e.jsx("span",{className:"text-[#FF8C6B] font-bold text-[10px] tracking-[0.3em] uppercase",children:"Diet Academy"})}),e.jsxs("div",{className:"bg-white rounded-[2.5rem] p-8 sm:p-10 shadow-[0_20px_60px_-15px_rgba(0,0,0,0.06)] border border-stone-100",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-orange-50 rounded-2xl flex items-center justify-center text-[#FF8C6B] mx-auto mb-4 border border-orange-100",children:e.jsx(L,{size:32,strokeWidth:1.5})}),e.jsx("h1",{className:"text-2xl font-bold text-stone-800 font-serif-jp",children:s("auth.reset.title")}),e.jsx("p",{className:"text-stone-400 text-sm mt-2 font-medium",children:s("auth.reset.subtitle")})]}),m&&e.jsxs("div",{className:"bg-red-50 text-red-600 p-4 rounded-xl flex items-start gap-3 mb-6 text-sm border border-red-100",children:[e.jsx(k,{size:18,className:"flex-shrink-0 mt-0.5"}),e.jsx("span",{children:m})]}),e.jsxs("form",{onSubmit:N,className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-stone-500 tracking-wider ml-1",children:s("auth.reset.newPassword")}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-stone-300 group-focus-within:text-[#FF8C6B] transition-colors",children:e.jsx(h,{size:18})}),e.jsx("input",{type:"password",value:n,onChange:r=>p(r.target.value),className:"w-full bg-stone-50 border border-stone-200 rounded-2xl py-3.5 pl-12 pr-4 outline-none focus:border-[#FF8C6B] focus:ring-4 focus:ring-[#FF8C6B]/5 transition-all font-medium text-stone-800",placeholder:"••••••••",required:!0,minLength:6})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{className:"text-xs font-bold text-stone-500 tracking-wider ml-1",children:s("auth.reset.confirmPassword")}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none text-stone-300 group-focus-within:text-[#FF8C6B] transition-colors",children:e.jsx(h,{size:18})}
1),e.jsx("input",{type:"password",value:l,onChange:r=>f(r.target.value),className:"w-full bg-stone-50 border border-stone-200 rounded-2xl py-3.5 pl-12 pr-4 outline-none focus:border-[#FF8C6B] focus:ring-4 focus:ring-[#FF8C6B]/5 transition-all font-medium text-stone-800",placeholder:"••••••••",required:!0,minLength:6})]})]}),e.jsx(u,{type:"submit",fullWidth:!0,size:"lg",variant:"orange",className:"h-14 mt-2",disabled:c,children:c?e.jsx(z,{className:"animate-spin"}):s("auth.reset.button")})]}),e.jsx("div",{className:"mt-6 pt-5 border-t border-stone-100 text-center",children:e.jsxs("button",{onClick:()=>i("/member"),className:"inline-flex items-center gap-2 text-stone-400 hover:text-stone-600 text-xs font-medium transition-colors",children:[e.jsx(B,{size:14}),s("auth.forgot.backToLogin")]})})]})]})]})};export{A as ResetPassword};

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.