import{q as t}from"./index-CqfREQhZ.js";import{C as i,P as m}from"./products-Q1MHi1iw.js";const s="amazingsoko_admin_session",p="Info@amazingsoko.com";function c(e){typeof window>"u"||localStorage.setItem(s,JSON.stringify(e))}function d(){typeof window>"u"||localStorage.removeItem(s)}function l(){if(typeof window>"u")return null;const e=localStorage.getItem(s);if(!e)return null;try{return JSON.parse(e)}catch{return null}}async function S(e,a){try{const r=await fetch(t("/api/admin-login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({email:e.trim().toLowerCase(),password:a})}),n=await r.json();return!r.ok||!n.ok?{ok:!1,error:n?.error||"Invalid credentials"}:(c(n.user),{ok:!0})}catch(r){return{ok:!1,error:r instanceof Error?r.message:"Login failed"}}}async function g(){d()}async function y(){const e=l();return e?{authed:!0,user:e}:{authed:!1}}const o=[["Aline Uwase","aline@example.com","+250 788 111 222"],["Eric Mugisha","eric@example.com","+250 788 222 333"],["Diane Ingabire","diane@example.com","+250 788 333 444"],["Jean-Paul K.","jp@example.com","+250 788 444 555"],["Sandra Niyo","sandra@example.com","+250 788 555 666"],["Patrick Habimana","patrick@example.com","+250 788 666 777"],["Grace Mukamana","grace@example.com","+250 788 777 888"],["Kevin Iradukunda","kevin@example.com","+250 788 888 999"]],A=[{name:"Jan",sales:42e5,orders:124},{name:"Feb",sales:51e5,orders:156},{name:"Mar",sales:48e5,orders:142},{name:"Apr",sales:63e5,orders:189},{name:"May",sales:71e5,orders:218},{name:"Jun",sales:68e5,orders:205},{name:"Jul",sales:82e5,orders:246},{name:"Aug",sales:91e5,orders:278},{name:"Sep",sales:87e5,orders:261},{name:"Oct",sales:98e5,orders:295},{name:"Nov",sales:112e5,orders:332},{name:"Dec",sales:125e5,orders:378}],w=[{name:"Direct",value:38},{name:"Search",value:27},{name:"Social",value:21},{name:"Referral",value:14}],I=i.slice(0,6).map((e,a)=>({name:e.name,value:95-a*11}));m.slice(0,8).map((e,a)=>({id:`r${a+1}`,product:e.name,customer:o[a%o.length][0],rating:5-a%3,comment:["Great quality, fast delivery!","Exactly as described.","Loved it, highly recommend.","Decent for the price."][a%4],status:a%4===3?"Pending":"Approved",date:`2026-05-${String(15-a%14).padStart(2,"0")}`}));const v=[{id:1,type:"order",title:"New order",body:"A new order just came in",time:"2 min ago",read:!1},{id:2,type:"stock",title:"Low stock alert",body:"Some products are running low",time:"1 hr ago",read:!1},{id:3,type:"review",title:"New review",body:"A customer left a 5-star review",time:"3 hr ago",read:!0}],h=[];export{p as A,v as N,h as O,A as S,I as T,w as a,S as b,g as c,y as g};
