PageSourceSearch

https://adeebco-krcgguzr.manus.space/assets/AdminDashboard-D2XAHbMP.js

js adeebco-krcgguzr.manus.space collected 2026-10-03 05:00:21 UTC 44,564 bytes, 11 lines download raw bytes

1import{c as S,t as x,r as m,j as e,Y as B,P as T,Z as k,_ as U,B as L,X as z,g as _,L as H,A as X,m as $,$ as F,h as Y,C as Z,a0 as q,v as J,w as K,G as V}from"./index-C9BAOTn9.js";import{C as ee}from"./credit-card-BHJgfKE_.js";import{C as P}from"./chart-column-BjRD8jGG.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const se=S("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const te=S("WalletCards",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2",key:"4125el"}],["path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21",key:"1dpki6"}]]),v={slug:"",title:"",description:"",category:"البرمجة",level:"مبتدئ",price:0,isFree:1,active:1},j={title:"",description:"",content:"",lessonOrder:1,active:1};function ae(){const l=x.useUtils(),o=x.admin.courseContent.useQuery(void 0,{refetchOnWindowFocus:!0}),[c,d]=m.useState(null),[s,r]=m.useState(v),[n,t]=m.useState(j),[h,p]=m.useState(null),[f,i]=m.useState(""),g=o.data??[],A=g.find(a=>a.id===c)??null;m.useEffect(()=>{c===null&&g[0]&&(d(g[0].id),r(g[0]))},[g,c]);const u=()=>{i("تم حفظ التغييرات."),l.admin.courseContent.invalidate()},y=x.admin.createCourse.useMutation({onSuccess:a=>{u();const D=a[a.length-1];D&&(d(D.id),r(D))}}),C=x.admin.updateCourse.useMutation({onSuccess:u}),O=x.admin.deleteCourse.useMutation({onSuccess:()=>{d(null),r(v),u()}}),w=x.admin.createLesson.useMutation({onSuccess:()=>{t(j),p(null),u()}}),M=x.admin.updateLesson.useMutation({onSuccess:()=>{t(j),p(null),u()}}),I=x.admin.deleteLesson.useMutation({onSuccess:u}),W=a=>{d(a.id),r(a),t(j),p(null),i("")},E=()=>{i(""),s.id?C.mutate(s):y.mutate(s)},R=()=>{c&&(h?M.mutate({...n,id:h}):w.mutate({...n,courseId:c}))},G=()=>{s.id&&window.confirm("هل تريد حذف الدورة وجميع دروسها؟ لا يمكن التراجع عن هذا الإجراء.")&&O.mutate({id:s.id})},Q=a=>{window.confirm("هل تريد حذف هذا الدرس؟")&&I.mutate({id:a})};return e.jsxs("section",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-8 rounded-[1.75rem] border border-[#72d7ca]/20 bg-[#0e1422] p-5 sm:p-7",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2",children:[e.jsx(B,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"text-[#72d7ca]"}),e.jsx("h2",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-display text-2xl font-extrabold",children:"إدارة الدورات والدروس"})]}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-2 text-sm leading-7 text-slate-500",children:"أضف المحتوى وعدّله أو احذفه من مكان واحد. التعديلات محمية بصلاحية المالك."})]}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{d(null),r(v),i("")},className:"inline-flex items-center justify-center gap-2 rounded-xl bg-[#72d7ca] px-4 py-3 text-sm font-bold text-[#101426] hover:brightness-110",children:[e.jsx(T,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," دورة جديدة"]})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-7 grid gap-6 lg:grid-cols-[0.34fr_0.66fr]",children:[e.jsxs("aside",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"space-y-2 rounded-2xl border border-white/10 bg-[#070a12] p-3",children:[g.map(a=>e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>W(a),className:`w-full rounded-xl p-3 text-right transition ${c===a.id?"bg-[#9f9cff]/15 text-[#d7d5ff]":"text-slate-400 hover:bg-white/[0.05]"}`,children:[e.jsx("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"block text-sm font-bold",children:a.title}),e.jsxs("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 block text-[11px] text-slate-500",children:[a.lessons.length," دروس • ",a.isFree?"مجاني":`${a.price} ريال`]})]},a.id)),g.length===0&&e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"p-4 text-center text-xs text-slate-600",children:"لا توجد دورات بعد."})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"rounded-2xl border border-white/10 bg-[#111827] p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center justify-between",children:[e.jsx("h3",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-bold",children:s.id?"تعديل الدورة":"إضافة دورة"}),s.id&&e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:G,className:"inline-flex items-center gap-1 text-xs font-bold text-rose-300 hover:text-rose-200",children:[e.jsx(k,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-3.5 w-3.5"})," حذف الدورة"]})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 grid gap-3 sm:grid-cols-2",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"اسم الدورة",value:s.title,onChange:a=>r({...s,title:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"المعرّف slug",value:s.slug,onChange:a=>r({...s,slug:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"الفئة",value:s.category,onChange:a=>r({...s,category:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"المستوى",value:s.level,onChange:a=>r({...s,level:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"السعر بالريال",type:"number",value:String(s.price),onChange:a=>r({...s,price:Number(a)||0,isFree:Number(a)>0?0:1}
11)}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2 rounded-xl border border-white/10 px-3 py-2 text-xs text-slate-400",children:[e.jsx("input",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"checkbox",checked:s.isFree===1,onChange:a=>r({...s,isFree:a.target.checked?1:0,price:a.target.checked?0:Math.max(1,s.price)})})," دورة مجانية"]})]}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-3 block text-xs text-slate-500",children:["الوصف",e.jsx("textarea",{"data-loc":"client/src/components/CourseManager.tsx:33",value:s.description,onChange:a=>r({...s,description:a.target.value}),rows:3,className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] p-3 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",disabled:y.isPending||C.isPending,onClick:E,className:"mt-4 inline-flex items-center gap-2 rounded-xl bg-[#9f9cff] px-4 py-3 text-sm font-bold text-[#101426] disabled:opacity-50",children:[e.jsx(U,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," حفظ الدورة"]})]}),A&&e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"rounded-2xl border border-white/10 bg-[#111827] p-5",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",children:[e.jsxs("h3",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-2 font-bold",children:[e.jsx(L,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4 text-[#72d7ca]"})," دروس ",A.title]}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 text-xs text-slate-500",children:"أضف الدرس الأول أو عدّل ترتيب ومحتوى الدروس."})]}),h&&e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{p(null),t(j)},className:"text-slate-500 hover:text-white",children:e.jsx(z,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})})]}),e.jsx("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 space-y-2",children:A.lessons.map(a=>e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-start gap-3 rounded-xl border border-white/10 bg-[#070a12] p-3",children:[e.jsx("span",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"grid h-7 w-7 shrink-0 place-items-center rounded-lg bg-[#72d7ca]/10 text-xs font-bold text-[#9be9df]",children:a.lessonOrder}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"min-w-0 flex-1",children:[e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"font-bold text-slate-200",children:a.title}),e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-1 truncate text-xs text-slate-500",children:a.description})]}),e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>{p(a.id),t(a)},className:"text-[#b9b7ff] hover:text-white","aria-label":"تعديل الدرس",children:e.jsx(se,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})}),e.jsx("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",onClick:()=>Q(a.id),className:"text-rose-300 hover:text-rose-200","aria-label":"حذف الدرس",children:e.jsx(k,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})})]},a.id))}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"mt-4 grid gap-3",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"عنوان الدرس",value:n.title,onChange:a=>t({...n,title:a})}),e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"وصف مختصر",value:n.description,onChange:a=>t({...n,description:a})}),e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"text-xs text-slate-500",children:["محتوى الدرس",e.jsx("textarea",{"data-loc":"client/src/components/CourseManager.tsx:33",value:n.content,onChange:a=>t({...n,content:a.target.value}),rows:5,className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] p-3 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]}),e.jsxs("div",{"data-loc":"client/src/components/CourseManager.tsx:33",className:"flex items-center gap-3",children:[e.jsx(b,{"data-loc":"client/src/components/CourseManager.tsx:33",label:"الترتيب",type:"number",value:String(n.lessonOrder),onChange:a=>t({...n,lessonOrder:Number(a)||1})}),e.jsxs("button",{"data-loc":"client/src/components/CourseManager.tsx:33",type:"button",disabled:w.isPending||M.isPending,onClick:R,className:"mt-5 inline-flex items-center gap-2 rounded-xl bg-[#72d7ca] px-4 py-3 text-sm font-bold text-[#101426] disabled:opacity-50",children:[e.jsx(_,{"data-loc":"client/src/components/CourseManager.tsx:33",className:"h-4 w-4"})," ",h?"حفظ تعديل الدرس":"إضافة الدرس"]}
11)]})]})]}),f&&e.jsx("p",{"data-loc":"client/src/components/CourseManager.tsx:33",role:"status",className:"rounded-xl border border-[#72d7ca]/20 bg-[#72d7ca]/10 px-4 py-3 text-sm text-[#9be9df]",children:f})]})]})]})}function b({label:l,value:o,onChange:c,type:d="text"}){return e.jsxs("label",{"data-loc":"client/src/components/CourseManager.tsx:36",className:"block text-xs text-slate-500",children:[l,e.jsx("input",{"data-loc":"client/src/components/CourseManager.tsx:36",type:d,value:o,onChange:s=>c(s.target.value),className:"mt-2 w-full rounded-xl border border-white/10 bg-[#070a12] px-3 py-2.5 text-sm text-slate-200 outline-none focus:border-[#9f9cff]/60"})]})}const ce={"student-plus":"الطالب بلس","teacher-pro":"المعلم برو",school:"المدارس"};function pe(){const[l,o]=m.useState("all"),[c,d]=m.useState("revenue"),s=x.admin.billingOverview.useQuery(void 0,{refetchOnWindowFocus:!0}),r=x.admin.entertainmentStats.useQuery(void 0,{refetchInterval:3e4,refetchOnWindowFocus:!0}),n=m.useMemo(()=>(s.data?.subscriptions??[]).filter(t=>l==="all"||l==="paid"&&t.paymentStatus==="paid"||l==="pending"&&t.paymentStatus==="pending"||l==="active"&&t.status==="active"),[s.data,l]);return e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",dir:"rtl",className:"min-h-screen bg-[#070a12] px-5 py-8 text-white sm:px-10 sm:py-10",children:[e.jsxs("header",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mx-auto flex max-w-7xl items-center justify-between",children:[e.jsxs(H,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",href:"/owner-dashboard",className:"inline-flex items-center gap-2 text-sm text-slate-400 transition hover:text-white",children:[e.jsx(X,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"h-4 w-4"})," لوحة المالك"]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex items-center gap-3",children:[e.jsx(oe,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx($,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-[#72d7ca]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-display font-bold",children:"لوحة الإدارة"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-[11px] text-slate-500",children:"أديب للتطوير • بيانات محمية"})]})]})]}),e.jsxs("main",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mx-auto mt-10 max-w-7xl",children:[e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"rounded-[2rem] border border-[#9f9cff]/25 bg-gradient-to-br from-[#292657] via-[#18253f] to-[#0d1629] p-8 sm:p-10",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-col gap-5 sm:flex-row sm:items-end sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-sm font-bold text-[#d7d5ff]",children:"مركز الإدارة المالي"}),e.jsx("h1",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-3 font-display text-3xl font-extrabold sm:text-5xl",children:"المشتركون والمدفوعات"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-4 max-w-2xl leading-8 text-slate-300",children:"تابع حالة الاشتراكات والمدفوعات المؤكدة. لا تعرض اللوحة أرقام البطاقات أو البيانات الحساسة."})]}),e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",type:"button",onClick:()=>s.refetch(),className:"inline-flex items-center justify-center gap-2 rounded-xl border border-white/10 bg-white/[0.06] px-4 py-3 text-sm font-bold text-slate-200 hover:bg-white/[0.1]",children:[e.jsx(F,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:`h-4 w-4 ${s.isFetching?"animate-spin":""}`})," تحديث البيانات"]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(ee,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"إجمالي الإيرادات",value:`${s.data?.stats.totalRevenue??"—"} ريال`,tone:"blue",active:c==="revenue",onClick:()=>d("revenue")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(Y,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"عدد الطلاب",value:s.data?.stats.students??"—",tone:"teal",active:c==="students",onClick:()=>d("students")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(L,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"الدورات النشطة",value:s.data?.stats.activeCourses??"—",tone:"purple",active:c==="courses",onClick:()=>d("courses")}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(Z,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"اشتراكات نشطة",value:s.data?.stats.active??"—",tone:"purple"}),e.jsx(N,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",icon:e.jsx(te,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),label:"مدفوعات معلقة",value:s.data?.stats.pending??"—",tone:"orange"})]}),e.jsx("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-5 rounded-2xl border border-white/10 bg-[#0e1422] p-5",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex items-center gap-3",children:[e.jsx(P,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"h-5 w-5 text-[#9be9df]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"text-sm font-bold text-slate-200",children:c==="revenue"?"ملخص الإيرادات":c==="students"?"ملخص الطلاب":"ملخص الدورات"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs leading-6 text-slate-500",children:c==="revenue"?"الإجمالي من الاشتراكات والمدفوعات المؤكدة للدورات.":c==="students"?"عدد الحسابات التعليمية المسجلة في قاعدة البيانات.":"الدورات المنشورة والمتاحة حالياً للطلاب."})]})]})}),e.jsx(re,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",trend:s.data?.trend??[]}),e.jsx(de,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",stats:r.data})," ",e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-8 overflow-hidden rounded-[1.75rem] border border-white/10 bg-[#0e1422]",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-col gap-4 border-b border-white/10 p-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-display text-xl font-extrabold",children:"سجل الاشتراكات"}),e.jsxs("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs text-slate-500",children:[n.length," سجل ظاهر"]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"flex flex-wrap gap-2",children:[e.jsx(q,{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-2 h-4 w-4 text-slate-500"}),[["all","الكل"],["paid","مدفوع"],["pending","معلق"],["active","نشط"]].map(([t,h])=>e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",type:"button",onClick:()=>o(t),className:`rounded-lg px-3 py-2 text-xs font-bold transition ${l===t?"bg-[#9f9cff] text-[#101426]":"bg-white/[0.05] text-slate-400 hover:bg-white/[0.1]"}`,children:h},t))]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"overflow-x-auto",children:[e.jsxs("table",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"w-full min-w-[760px] text-right text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"bg-white/[0.03] text-xs text-slate-500",children:e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:[e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"المشترك"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"الخطة"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"المبلغ"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"حالة الدفع"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"الحالة"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold",children:"آخر تحديث"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",children:n.map(t=>e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"border-t border-white/[0.06] transition hover:bg-white/[0.025]",children:[e.jsxs("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"font-bold text-slate-200",children:t.userName||"مستخدم"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-1 text-xs text-slate-500",children:t.email||"بدون بريد"})]}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-slate-300",children:ce[t.planSlug]||t.planSlug}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 font-bold text-[#9be9df]",children:t.amountSar?`${t.amountSar} ريال`:"حسب الاتفاق"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4",children:e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:`rounded-full px-2.5 py-1 text-[11px] font-bold ${t.paymentStatus==="paid"?"bg-[#72d7ca]/10 text-[#9be9df]":"bg-[#f3a243]/10 text-[#ffd18f]"}`,children:t.paymentStatus==="paid"?"مدفوع":t.paymentStatus==="failed"?"فشل":"معلق"})}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-slate-400",children:t.status==="active"?"نشط":t.status==="canceled"?"ملغى":"معلق"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"px-5 py-4 text-xs text-slate-500",children:new Date(t.updatedAt).toLocaleDateString("ar-SA")})]},t.id))})]}),!s.isLoading&&n.length===0&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"p-10 text-center text-sm text-slate-500",children:"لا توجد سجلات مطابقة لهذا الفلتر."}),s.isLoading&&e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"p-10 text-center text-sm text-slate-500",children:"جارٍ تحميل بيانات الفوترة…"})]})]}),e.jsx(le,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx(ne,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx(ae,{"data-loc":"client/src/pages/AdminDashboard.tsx:15"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:15",className:"mt-5 text-xs leading-6 text-slate-600",children:"الإجمالي المحسوب يعتمد على أسعار الخطط الحالية. بعد ربط Moyasar سيُعتمد فقط على إشعار الدفع الموثوق لتحديث الحالة."})]})]})}function ne(){const l=x.admin.accessAttempts.useQuery(void 0,{refetchInterval:3e4}),o=l.data??[];return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"mt-8 overflow-hidden rounded-[1.75rem] border border-[#78a9ff]/20 bg-[#0e1422]",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"flex items-center justify-between border-b border-white/10 p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"font-display text-xl font-extrabold",children:"سجل أمان الدخول"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"mt-1 text-xs text-slate-500",children:"آخر محاولات فتح خصائص الإدارة — لا يتم حفظ الرمز السري."})]}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",type:"button",onClick:()=>l.refetch(),className:"rounded-xl border border-white/10 px-3 py-2 text-xs font-bold text-slate-300 hover:bg-white/[0.06]",children:"تحديث"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"overflow-x-auto",children:[e.jsxs("table",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"w-full min-w-[680px] text-right text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"bg-white/[0.03] text-xs text-slate-500",children:e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:[e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"الحالة"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"السبب"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"عنوان الشبكة"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"المتصفح"}),e.jsx("th",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:"الوقت"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",children:o.map(c=>e.jsxs("tr",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"border-t border-white/[0.06]",children:[e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3",children:e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:`rounded-full px-2.5 py-1 text-[11px] font-bold ${c.success?"bg-emerald-300/10 text-emerald-300":"bg-rose-300/10 text-rose-300"}`,children:c.success?"ناجح":"فاشل"})}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-slate-300",children:c.reason==="success"?"تم التحقق":c.reason==="invalid-code"?"رمز غير صحيح":"حساب غير مصرح"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-xs text-slate-500",children:c.ipAddress||"غير متاح"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"max-w-[220px] truncate px-5 py-3 text-xs text-slate-500",title:c.userAgent||"",children:c.userAgent||"غير متاح"}),e.jsx("td",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"px-5 py-3 text-xs text-slate-500",children:new Date(c.attemptedAt).toLocaleStr
11ing("ar-SA")})]},c.id))})]}),!l.isLoading&&o.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"p-8 text-center text-sm text-slate-500",children:"لا توجد محاولات مسجلة بعد."}),l.isLoading&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:21",className:"p-8 text-center text-sm text-slate-500",children:"جارٍ تحميل سجل الأمان…"})]})]})}function le(){const[l,o]=m.useState(""),[c,d]=m.useState(""),[s,r]=m.useState(""),n=x.admin.changeOwnerCode.useMutation({onSuccess:()=>{o(""),d(""),r("تم تغيير رمز دخول الإدارة بنجاح.")},onError:t=>r(t.message||"تعذر تغيير الرمز.")});return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-8 rounded-[1.75rem] border border-rose-300/20 bg-[#0e1422] p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"flex items-start gap-3",children:[e.jsx($,{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-1 h-5 w-5 text-rose-200"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"font-display text-xl font-extrabold",children:"تغيير رمز دخول الإدارة"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:"mt-2 text-sm leading-7 text-slate-400",children:"يتطلب الرمز الحالي. يُحفظ الرمز مشفراً ولا يظهر في لوحة التحكم."})]})]}),e.jsxs("form",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",onSubmit:t=>{t.preventDefault(),r(""),c.length===18&&n.mutate({currentCode:l,nextCode:c})},className:"mt-5 grid gap-3 sm:grid-cols-3",children:[e.jsx("input",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",value:l,onChange:t=>o(t.target.value.replace(/\D/g,"").slice(0,64)),type:"password",inputMode:"numeric",autoComplete:"current-password",placeholder:"الرمز الحالي",className:"h-11 rounded-xl border border-white/10 bg-black/20 px-4 text-sm text-white outline-none focus:border-rose-200/50"}),e.jsx("input",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",value:c,onChange:t=>d(t.target.value.replace(/\D/g,"").slice(0,18)),type:"password",inputMode:"numeric",autoComplete:"new-password",placeholder:"الرمز الجديد: 18 رقماً",className:"h-11 rounded-xl border border-white/10 bg-black/20 px-4 text-sm text-white outline-none focus:border-rose-200/50"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",disabled:n.isPending||l.length<8||c.length!==18,className:"rounded-xl bg-rose-200 px-4 py-3 text-sm font-bold text-[#28151d] disabled:cursor-not-allowed disabled:opacity-40",children:n.isPending?"جارٍ الحفظ…":"حفظ الرمز الجديد"})]}),s&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:28",className:`mt-3 text-sm ${s.startsWith("تم")?"text-emerald-300":"text-rose-300"}`,children:s})]})}function N({icon:l,label:o,value:c,tone:d,active:s=!1,onClick:r}){const n={teal:"text-[#72d7ca] border-[#72d7ca]/20",purple:"text-[#9f9cff] border-[#9f9cff]/20",orange:"text-[#f3a243] border-[#f3a243]/20",blue:"text-[#78a9ff] border-[#78a9ff]/20"},t=e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"opacity-80",children:l}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"text-xs text-slate-500",children:o})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"mt-4 font-display text-2xl font-extrabold text-white",children:c}),s&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:"mt-2 text-[11px] font-bold text-[#9be9df]",children:"تم التحديد"})]});return r?e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",type:"button",onClick:r,className:`rounded-2xl border bg-[#0e1422] p-5 text-right transition hover:-translate-y-1 hover:bg-white/[0.06] ${n[d]} ${s?"ring-2 ring-[#9be9df]/40":""}`,children:t}):e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:30",className:`rounded-2xl border bg-[#0e1422] p-5 ${n[d]}`,children:t})}function de({stats:l}){const o=(c,d,s)=>e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"rounded-2xl border border-white/10 bg-white/[0.03] p-4",children:[e.jsx("h3",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:`font-bold ${s}`,children:c}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"mt-3 space-y-2",children:[d.map((r,n)=>e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"flex items-center justify-between gap-3 rounded-lg bg-black/15 px-3 py-2 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"truncate text-slate-300",children:[n+1,". ",r.gameTitle]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"shrink-0 font-bold text-slate-500",children:[r.plays," تشغيل"]})]},r.gameId)),!d.length&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:34",className:"py-3 text-center text-xs text-slate-500",children:"لا توجد بيانات بعد."})]})]});return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-5 rounded-[1.75rem] border border-[#f3a243]/20 bg-gradient-to-br from-[#1b1822] to-[#0e1422] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex items-center gap-3",children:[e.jsx(V,{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"h-5 w-5 text-[#f3a243]"}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",children:[e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"font-display text-xl font-extrabold",children:"إقبال الألعاب"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-1 text-xs text-slate-500",children:"مقارنة واضحة بين الألعاب المجانية والمميزة."})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"flex flex-wrap gap-2 text-xs",children:[e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-lg bg-[#72d7ca]/10 px-3 py-2 font-bold text-[#9be9df]",children:[l?.activeUsers??"—"," مستخدم نشط"]}),e.jsxs("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-lg bg-[#9f9cff]/10 px-3 py-2 font-bold text-[#c9c8ff]",children:[l?.totalPlays??"—"," إجمالي التشغيل"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-5 grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-xl border border-[#72d7ca]/20 bg-[#72d7ca]/[0.06] p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"text-xs text-slate-400",children:"تشغيل الألعاب المجانية"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-2 font-display text-3xl font-extrabold text-[#9be9df]",children:l?.freePlays??"—"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"rounded-xl border border-[#c9c8ff]/20 bg-[#9f9cff]/[0.06] p-4",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"text-xs text-slate-400",children:"تشغيل الألعاب المميزة"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-2 font-display text-3xl font-extrabold text-[#c9c8ff]",children:l?.premiumPlays??"—"})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:35",className:"mt-4 grid gap-3 md:grid-cols-2",children:[o("الأكثر لعباً مجاناً",l?.topFreeGames??[],"text-[#9be9df]"),o("الأكثر لعباً من المميز",l?.to
11pPremiumGames??[],"text-[#c9c8ff]")]})]})}function re({trend:l}){const[o,c]=m.useState("revenue"),d=l.map(n=>o==="revenue"?n.revenue:n.students),s=Math.max(...d,1),r=d.map((n,t)=>`${t*(100/Math.max(d.length-1,1))},${94-n/s*78}`).join(" ");return e.jsxs("section",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-5 rounded-[1.75rem] border border-white/10 bg-[#0e1422] p-5 sm:p-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex items-center gap-2",children:[e.jsx(P,{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"h-5 w-5 text-[#9be9df]"}),e.jsx("h2",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"font-display text-xl font-extrabold",children:"نمو الأداء خلال 7 أيام"})]}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-1 text-xs text-slate-500",children:"تفاعل مع المخطط لتبديل معدل الإيرادات وتسجيل الطلاب."})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"flex gap-2",children:[e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",type:"button",onClick:()=>c("revenue"),className:`rounded-lg px-3 py-2 text-xs font-bold ${o==="revenue"?"bg-[#78a9ff] text-[#101426]":"bg-white/[0.05] text-slate-400"}`,children:"الإيرادات"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",type:"button",onClick:()=>c("students"),className:`rounded-lg px-3 py-2 text-xs font-bold ${o==="students"?"bg-[#72d7ca] text-[#101426]":"bg-white/[0.05] text-slate-400"}`,children:"تسجيل الطلاب"})]})]}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-6 overflow-x-auto",children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"min-w-[560px]",children:[e.jsxs("svg",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",viewBox:"0 0 100 100",className:"h-52 w-full overflow-visible",role:"img","aria-label":o==="revenue"?"مخطط نمو الإيرادات":"مخطط تسجيل الطلاب",children:[e.jsx("defs",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:e.jsxs("linearGradient",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",id:"growthLine",x1:"0",x2:"1",children:[e.jsx("stop",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",offset:"0%",stopColor:"#78a9ff"}),e.jsx("stop",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",offset:"100%",stopColor:"#9f9cff"})]})}),e.jsx("line",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",x1:"0",y1:"94",x2:"100",y2:"94",stroke:"rgba(255,255,255,.12)",strokeWidth:".5"}),e.jsx("polyline",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",points:r,fill:"none",stroke:"url(#growthLine)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),d.map((n,t)=>e.jsx("circle",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",cx:t*(100/Math.max(d.length-1,1)),cy:94-n/s*78,r:"1.8",fill:"#f3a243",children:e.jsx("title",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:`${l[t]?.label??""}: ${n}${o==="revenue"?" ريال":" طالب"}`})},l[t]?.key??t))]}),e.jsx("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",className:"mt-2 flex justify-between text-[10px] text-slate-600",children:l.map(n=>e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:43",children:n.label},n.key))})]})})]})}function oe(){const[l,o]=m.useState(!1),[c,d]=m.useState("all"),s=x.admin.notifications.useQuery(void 0,{refetchInterval:1e4,refetchOnWindowFocus:!0}),r=x.useUtils(),n=x.admin.markNotificationRead.useMutation({onSuccess:()=>r.admin.notifications.invalidate()}),t=x.admin.markAllNotificationsRead.useMutation({onSuccess:()=>r.admin.notifications.invalidate()}),h=s.data??[],p=h.filter(i=>!i.readAt).length,f=h.filter(i=>c==="all"||i.type===c);return e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"relative",children:[e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>o(i=>
11!i),className:"relative grid h-10 w-10 place-items-center rounded-xl border border-white/10 bg-white/[0.05] text-slate-300 transition hover:bg-white/[0.1]","aria-label":"إشعارات الإدارة",children:[e.jsx(J,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"h-4 w-4"}),p>0&&e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"absolute -right-1 -top-1 grid min-h-5 min-w-5 place-items-center rounded-full bg-[#f3a243] px-1 text-[10px] font-extrabold text-[#101426]",children:p>99?"99+":p})]}),l&&e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"absolute left-0 top-12 z-30 w-[min(22rem,calc(100vw-2rem))] rounded-2xl border border-white/10 bg-[#111827] p-3 shadow-2xl",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-center justify-between border-b border-white/10 px-2 pb-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"text-sm font-bold text-white",children:"إشعارات الإدارة"}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[11px] text-slate-500",children:"تتحدث تلقائياً كل 10 ثوانٍ"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-center gap-3",children:[e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>s.refetch(),disabled:s.isFetching,className:"inline-flex items-center gap-1 text-[11px] font-bold text-[#78a9ff] disabled:opacity-50",title:"تحديث الإشعارات",children:[e.jsx(F,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:`h-3.5 w-3.5 ${s.isFetching?"animate-spin":""}`})," تحديث"]}),e.jsxs("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",disabled:!p||t.isPending,onClick:()=>t.mutate(),className:"inline-flex items-center gap-1 text-[11px] font-bold text-[#9be9df] disabled:opacity-40",children:[e.jsx(K,{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"h-3.5 w-3.5"})," تعليم الكل كمقروء"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-3 flex gap-1 rounded-xl bg-white/[0.03] p-1",children:[e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("all"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="all"?"bg-white/[0.1] text-white":"text-slate-500"}`,children:"الكل"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("student-registered"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="student-registered"?"bg-[#72d7ca]/15 text-[#9be9df]":"text-slate-500"}`,children:"تسجيل الطلاب"}),e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>d("payment-received"),className:`flex-1 rounded-lg px-2 py-2 text-[10px] font-bold ${c==="payment-received"?"bg-[#f3a243]/15 text-[#ffd18f]":"text-slate-500"}`,children:"الدفعات"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-2 max-h-80 space-y-2 overflow-y-auto",children:[f.length===0&&e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"px-2 py-8 text-center text-xs text-slate-500",children:"لا توجد إشعارات ضمن هذا التصنيف."}),f.slice(0,20).map(i=>e.jsx("button",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",type:"button",onClick:()=>!i.readAt&&n.mutate({notificationId:i.id}),className:`w-full rounded-xl border p-3 text-right transition hover:bg-white/[0.06] ${i.readAt?"border-white/5 bg-white/[0.02]":"border-[#72d7ca]/25 bg-[#72d7ca]/[0.08]"}`,children:e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"flex items-start gap-2",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:`mt-1 h-2 w-2 shrink-0 rounded-full ${i.readAt?"bg-slate-700":"bg-[#72d7ca]"}`}),e.jsxs("div",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"min-w-0",children:[e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"text-xs font-bold text-slate-200",children:i.title}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[11px] leading-5 text-slate-400",children:i.detail}),e.jsx("p",{"data-loc":"client/src/pages/AdminDashboard.tsx:57",className:"mt-1 text-[10px] text-slate-600",children:new Date(i.createdAt).toLocaleStr
11ing("ar-SA")})]})]})},i.id))]})]})]})}export{pe 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.