module.exports=[97626,a=>{"use strict";var b=a.i(48333),c=a.i(81235),d=a.i(93465);let e="seller_token_v1",f="seller_session_v1";async function g(a){try{let b=await a.json();return b?.message||b?.error||""}catch{try{return await a.text()}catch{return""}}}function h(){let a=(0,d.useRouter)(),h=(0,c.useMemo)(()=>process.env.NEXT_PUBLIC_API_BASE||"http://localhost:5000",[]),[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),q=async()=>{n("");let b=i.trim().toLowerCase(),c=k.trim();if(!b||!c)return n("Email এবং Password দিন");p(!0);try{let d=await fetch(`${h}/api/sellers/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:b,password:c})});if(!d.ok){let a=await g(d);throw Error(a||"Wrong Email / Password")}let i=await d.json();if(!i?.token)throw Error("Token পাওয়া যায়নি");localStorage.setItem(e,i.token),localStorage.setItem(f,JSON.stringify({sellerId:i.seller?.id,name:i.seller?.name,email:i.seller?.email,ts:new Date().toISOString()}));try{document.cookie=`${e}=${encodeURIComponent(i.token)}; Max-Age=2592000; Path=/; SameSite=Lax`,document.cookie=`${f}=${encodeURIComponent(JSON.stringify({sellerId:i.seller?.id,name:i.seller?.name}))}; Max-Age=2592000; Path=/; SameSite=Lax`}catch{}a.replace("/seller")}catch(a){n(a?.message||"Login failed")}finally{p(!1)}};return(0,b.jsx)("div",{className:"min-h-screen bg-[#0f0f0f] flex items-center justify-center px-4",children:(0,b.jsxs)("div",{className:"w-full max-w-[520px] bg-[#1b1b1b] border border-white/10 rounded-3xl p-8",children:[(0,b.jsx)("div",{className:"text-white text-2xl font-bold",children:"Seller Login"}),(0,b.jsx)("div",{className:"text-gray-400 text-sm mt-2",children:"Login with your Email and Password"}),(0,b.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-gray-300 text-sm",children:"Email"}),(0,b.jsx)("input",{value:i,onChange:a=>j(a.target.value),placeholder:"seller@email.com",className:"mt-2 w-full rounded-2xl px-5 py-3 bg-[#2a2a2a] text-white outline-none border border-white/10 focus:border-white/30"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-gray-300 text-sm",children:"Password"}),(0,b.jsx)("input",{value:k,onChange:a=>l(a.target.value),placeholder:"password",type:"password",className:"mt-2 w-full rounded-2xl px-5 py-3 bg-[#2a2a2a] text-white outline-none border border-white/10 focus:border-white/30",onKeyDown:a=>{"Enter"===a.key&&q()}})]}),m&&(0,b.jsx)("div",{className:"text-red-400 text-sm",children:m}),(0,b.jsx)("button",{onClick:q,disabled:o,className:"mt-2 w-full rounded-2xl py-3 bg-white text-black font-semibold hover:opacity-90 active:scale-[0.99] transition disabled:opacity-60",children:o?"Logging in...":"Login"})]})]})})}a.s(["default",()=>h])}];

//# sourceMappingURL=Downloads_ui-main-fixed_ui-main_app_seller_login_page_tsx_29044cc2._.js.map