module.exports=[50502,a=>{"use strict";let b;var c,d,e=a.i(87924),f=a.i(72131),g=a.i(50944);let h=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim(),i=a=>{let b=a.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,b,c)=>c?c.toUpperCase():b.toLowerCase());return b.charAt(0).toUpperCase()+b.slice(1)};var j={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 k=(0,f.createContext)({}),l=(0,f.forwardRef)(({color:a,size:b,strokeWidth:c,absoluteStrokeWidth:d,className:e="",children:g,iconNode:i,...l},m)=>{let{size:n=24,strokeWidth:o=2,absoluteStrokeWidth:p=!1,color:q="currentColor",className:r=""}=(0,f.useContext)(k)??{},s=d??p?24*Number(c??o)/Number(b??n):c??o;return(0,f.createElement)("svg",{ref:m,...j,width:b??n??j.width,height:b??n??j.height,stroke:a??q,strokeWidth:s,className:h("lucide",r,e),...!g&&!(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0;return!1})(l)&&{"aria-hidden":"true"},...l},[...i.map(([a,b])=>(0,f.createElement)(a,b)),...Array.isArray(g)?g:[g]])}),m=(c="settings",d=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],(b=(0,f.forwardRef)(({className:a,...b},e)=>(0,f.createElement)(l,{ref:e,iconNode:d,className:h(`lucide-${i(c).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${c}`,a),...b}))).displayName=i(c),b);function n(){let[a,b]=(0,f.useState)(""),[c,d]=(0,f.useState)(""),[h,i]=(0,f.useState)(""),[j,k]=(0,f.useState)(!1),l=(0,g.useRouter)(),n=async b=>{b.preventDefault(),k(!0),i("");try{let b=await fetch("/api/admin/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:c})}),d=await b.json();d.success?l.push("/admin/dashboard"):i(d.message)}catch(a){i("Something went wrong")}finally{k(!1)}};return(0,e.jsx)("main",{className:"min-h-screen bg-[#EFEFEF] flex items-center justify-center font-prompt p-4",children:(0,e.jsxs)("div",{className:"bg-white p-10 rounded-xl shadow-sm w-full max-w-md",children:[(0,e.jsx)("div",{className:"flex justify-center mb-6",children:(0,e.jsx)("div",{className:"text-accent",children:(0,e.jsx)(m,{size:80,strokeWidth:1.5})})}),(0,e.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-bold mb-1",children:"Username"}),(0,e.jsx)("input",{type:"text",className:"w-full border border-gray-300 rounded-lg p-3 outline-none focus:ring-2 focus:ring-primary/20",value:a,onChange:a=>b(a.target.value),required:!0})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"block text-sm font-bold mb-1",children:"Password"}),(0,e.jsx)("input",{type:"password",className:"w-full border border-gray-300 rounded-lg p-3 outline-none focus:ring-2 focus:ring-primary/20",value:c,onChange:a=>d(a.target.value),required:!0})]}),h&&(0,e.jsx)("p",{className:"text-red-500 text-sm text-center",children:h}),(0,e.jsx)("button",{type:"submit",disabled:j,className:"w-full bg-primary text-white py-3 rounded-full text-lg font-bold cursor-pointer hover:bg-blue-900 transition-all active:scale-95 disabled:bg-gray-400 mt-4",children:j?"Logging in...":"Login"})]})]})})}a.s(["default",()=>n],50502)}];

//# sourceMappingURL=src_app_admin_login_page_tsx_6bc5dee1._.js.map