1import{c7 as T,cO as F,ce as q,c8 as r,cF as E,bh as I,c9 as e,ca as i,cs as M,ck as o,cn as d,cb as m,cl as R,cm as O,cx as V,cM as w,cy as g}from"./index-B9fS4Gmf.js";import{u as B}from"./useMutation-C_rfsYCG.js";import{F as n}from"./footer-DsCuYE5s.js";import{q as D}from"./queryKeys-CUiEbhif.js";import{C as K}from"./circle-x-CL4-DUTq.js";import{C as U}from"./circle-check-big-CmS1prDt.js";import{L as N}from"./lock-BfNOeBUa.js";function G(){const[,x]=T(),u=F(),{toast:l}=q(),[t,b]=r.useState(""),[h,v]=r.useState(""),[f,y]=r.useState(!1),a=r.useMemo(()=>new URLSearchParams(u).get("token")||"",[u]),{data:C,isLoading:k}=E({queryKey:D.auth.resetToken(a),queryFn:async()=>(await fetch(`/api/auth/verify-reset-token?token=${encodeURIComponent(a)}`)).json(),enabled:!!a,staleTime:1/0,gcTime:300*1e3}),S=C?.valid??!1,p=B({mutationFn:async({token:s,password:L})=>{const c=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:s,password:L})});if(!c.ok)throw new Error(await I(c,"ë¹ë°ë²í¸ ë³ê²½ì ì¤í¨íìµëë¤."));return c.json()},onSuccess:()=>{y(!0)},onError:s=>{l({title:"ì¤ë¥",description:s.message,variant:"destructive"})}}),P=s=>{if(s.preventDefault(),t.length<6){l({title:"ì¤ë¥",description:"ë¹ë°ë²í¸ë 6ì ì´ìì´ì´ì¼ í©ëë¤.",variant:"destructive"});return}if(t!==h){l({title:"ì¤ë¥",description:"ë¹ë°ë²í¸ê° ì¼ì¹íì§ ììµëë¤.",variant:"destructive"});return}p.mutate({token:a,password:t})},j=p.isPending;return k?e.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-slate-50 via-white to-emerald-50/30",children:[e.jsx(i,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(M,{className:"w-12 h-12 animate-spin text-blue-500 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600",children:"í í° íì¸ ì¤..."})]})}),e.jsx(n,{})]}):!S&&!f?e.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-slate-50 via-white to-emerald-50/30",children:[e.jsx(i,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx(o,{className:"w-full max-w-md",children:e.jsxs(d,{className:"pt-6 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(K,{className:"w-8 h-8 text-red-600"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-2",children:"ì í¨íì§ ìì ë§í¬"}),e.jsxs("p",{className:"text-sm text-gray-600 mb-6",children:["ë¹ë°ë²í¸ ì¬ì¤ì ë§í¬ê° ë§ë£ëìê±°ë ì´ë¯¸ ì¬ì©ëììµëë¤.",e.jsx("br",{}),"ë¤ì ë¹ë°ë²í¸ 찾기를 ìì²í´ì£¼ì¸ì."]}),e.jsx(m,{onClick:()=>x("/login"),className:"w-full","data-testid":"button-go-login",children:"ë¡ê·¸ì¸ íì´ì§ë¡ ì´ë"})]})})}),e.jsx(n,{})]}):f?e.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-slate-50 via-white to-emerald-50/30",children:[e.jsx(i,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx(o,{className:"w-full max-w-md",children:e.jsxs(d,{className:"pt-6 text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:e.jsx(U,{className:"w-8 h-8 text-green-600"})}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-2",children:"ë¹ë°ë²í¸ê° ë³ê²½ëììµëë¤"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"ìë¡ì´ ë¹ë°ë²í¸ë¡ ë¡ê·¸ì¸í´ì£¼ì¸ì."}),e.jsx(m,{onClick:()=>x("/login"),className:"w-full","data-testid":"button-go-login-success",children:"ë¡ê·¸ì¸í기"})]})})}),e.jsx(n,{})]}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-slate-50 via-white to-emerald-50/30",children:[e.jsx(i,{}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsxs(o,{className:"w-full max-w-md",children:[e.jsxs(R,{className:"text-center",children:[e.jsx(O,{className:"text-2xl",children:"ì ë¹ë°ë²í¸ ì¤ì "}),e.jsx(V,{children:"ìë¡ì´ ë¹ë°ë²í¸ë¥¼ ì
ë ¥í´ì£¼ì¸ì."})]}),e.jsx(d,{children:e.jsxs("form",{onSubmit:P,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"password",children:"ì ë¹ë°ë²í¸"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(g,{id:"password",type:"password",placeholder:"6ì ì´ì ì
ë ¥",value:t,onChange:s=>b(s.target.value),className:"pl-10","data-testid":"input-new-password",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(w,{htmlFor:"confirmPassword",children:"ë¹ë°ë²í¸ íì¸"}),e.jsxs("div",{className:"relative",children:[e.jsx(N,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(g,{id:"confirmPassword",type:"password",placeholder:"ë¹ë°ë²í¸ ë¤ì ì
ë ¥",value:h,onChange:s=>v(s.target.value),className:"pl-10","data-testid":"input-confirm-password",required:!0})]})]}),e.jsx(m,{type:"submit",className:"w-full",disabled:j,"data-testid":"button-reset-password",children:j?"ë³ê²½ ì¤...":"ë¹ë°ë²í¸ ë³ê²½"})]})})]})}),e.jsx(n,{})]})}
1export{G as 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.