(()=>{var e={};e.id=9674,e.ids=[9674],e.modules={53524:e=>{"use strict";e.exports=require("@prisma/client")},47849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},55403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},94749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},50852:e=>{"use strict";e.exports=require("async_hooks")},32081:e=>{"use strict";e.exports=require("child_process")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},73292:e=>{"use strict";e.exports=require("fs/promises")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},76224:e=>{"use strict";e.exports=require("tty")},73837:e=>{"use strict";e.exports=require("util")},31252:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>i.ZP,__next_app__:()=>x,originalPathname:()=>o,pages:()=>c,routeModule:()=>h,tree:()=>d});var r=s(50482),a=s(69108),i=s(83543),n=s(68300),l={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>n[e]);s.d(t,l);let d=["",{children:["admin",{children:["users",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,75002)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\users\\page.tsx"]}]},{loading:[()=>Promise.resolve().then(s.bind(s,27293)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\users\\loading.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,82050)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\layout.tsx"],loading:[()=>Promise.resolve().then(s.bind(s,98338)),"C:\\test2\\pagecraft-ai\\src\\app\\admin\\loading.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,43625)),"C:\\test2\\pagecraft-ai\\src\\app\\layout.tsx"],error:[()=>Promise.resolve().then(s.bind(s,24117)),"C:\\test2\\pagecraft-ai\\src\\app\\error.tsx"],"not-found":[()=>Promise.resolve().then(s.bind(s,48206)),"C:\\test2\\pagecraft-ai\\src\\app\\not-found.tsx"]}],c=["C:\\test2\\pagecraft-ai\\src\\app\\admin\\users\\page.tsx"],o="/admin/users/page",x={require:s,loadChunk:()=>Promise.resolve()},h=new r.AppPageRouteModule({definition:{kind:a.x.APP_PAGE,page:"/admin/users/page",pathname:"/admin/users",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},92120:(e,t,s)=>{Promise.resolve().then(s.bind(s,31414))},88534:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]])},63024:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},80895:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]])},33037:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]])},67711:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},7060:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},71532:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},97751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},85674:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},96885:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},42739:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},38852:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},27860:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]])},23485:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},38271:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},15366:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]])},28240:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]])},32817:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]])},89895:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,s(69224).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},31414:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var r=s(95344),a=s(3729),i=s(66543),n=s(9885),l=s(96885),d=s(28765),c=s(42739),o=s(23485);/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let x=(0,s(69224).Z)("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);var h=s(80895),m=s(7060),u=s(38271),p=s(11453);function g(){let{lang:e}=(0,n.Z)(),t="ar"===e,[s,g]=(0,a.useState)(""),[y,j]=(0,a.useState)(""),[v,f]=(0,a.useState)(null),[b,N]=(0,a.useState)(""),[w,k]=(0,a.useState)(null),[Z,C]=(0,a.useState)(""),M=y?`/api/admin/users?search=${encodeURIComponent(y)}`:"/api/admin/users",{data:q=[],isLoading:P,mutate:S}=(0,i.ZP)(M),A=()=>j(s),_=async(e,t)=>{let s=await fetch("/api/admin/users",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e,...t})});if(s.ok)await S(void 0,{revalidate:!0});else{let e=await s.json();alert(e.error||"Failed")}},E=e=>{e.suspended?_(e.id,{suspended:!1}):(k(e),C(""))},D=async()=>{w&&(await _(w.id,{suspended:!0,reason:Z||void 0}),k(null),C(""))},F=async e=>{if(!confirm(t?"هل أنت متأكد من حذف هذا المستخدم نهائياً؟":"Permanently delete this user?"))return;let s=await fetch(`/api/admin/users?userId=${e}`,{method:"DELETE"});if(s.ok)S();else{let e=await s.json();alert(e.error||"Failed")}},L=async e=>{let t=parseInt(b);isNaN(t)||t<0||(await _(e,{pagesLimit:t}),f(null))};return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-6",children:[(0,r.jsxs)("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-white",children:t?"إدارة المستخدمين":"Users Management"}),r.jsx("p",{className:"text-sm text-gray-400",children:t?`${q.length} مستخدم`:`${q.length} users`})]}),(0,r.jsxs)("a",{href:"/api/admin/export?type=users",className:"flex items-center gap-2 px-4 py-2 text-sm border rounded-lg border-white/[0.1] text-gray-400 hover:text-white hover:bg-white/[0.06] transition-colors",children:[r.jsx(l.Z,{className:"h-4 w-4"}),t?"تصدير CSV":"Export CSV"]})]}),(0,r.jsxs)("div",{className:"flex gap-2 mb-6",children:[(0,r.jsxs)("div",{className:"relative flex-1 max-w-md",children:[r.jsx(d.Z,{className:`absolute ${t?"right-3":"left-3"} top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500`}),r.jsx("input",{type:"text",value:s,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&A(),placeholder:t?"بحث بالاسم أو الإيميل...":"Search by name or email...",className:`w-full ${t?"pr-10 pl-4":"pl-10 pr-4"} py-2 border rounded-lg text-sm bg-white/[0.03] border-white/[0.08] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/30 focus:border-indigo-500/30`})]}),r.jsx("button",{onClick:A,className:"px-4 py-2 bg-indigo-500 text-white rounded-lg text-sm font-medium hover:bg-indigo-400 transition-colors",children:t?"بحث":"Search"})]}),P?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx(c.Z,{className:"h-8 w-8 animate-spin text-gray-500"})}):0===q.length?r.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.03] overflow-hidden",children:r.jsx("div",{className:"text-center py-12 text-gray-500",children:t?"لا يوجد مستخدمون":"No users found"})}):(0,r.jsxs)(r.Fragment,{children:[r.jsx("div",{className:"hidden md:block rounded-2xl border border-white/[0.06] bg-white/[0.03] overflow-hidden",children:r.jsx("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:(0,r.jsxs)("tr",{className:`bg-white/[0.03] ${t?"text-right":"text-left"}`,children:[r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"المستخدم":"User"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"الخطة":"Plan"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"الصلاحية":"Role"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"حد الصفحات":"Pages Limit"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"الصفحات":"Pages"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"الحالة":"Status"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"انضم":"Joined"}),r.jsx("th",{className:"py-3 px-4 font-medium text-gray-400",children:t?"إجراءات":"Actions"})]})}),r.jsx("tbody",{children:q.map(e=>(0,r.jsxs)("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.02] transition-colors",children:[(0,r.jsxs)("td",{className:"py-3 px-4",children:[r.jsx("div",{className:"font-medium text-white",children:e.name||"—"}),r.jsx("div",{className:"text-xs text-gray-500",children:e.email})]}),r.jsx("td",{className:"py-3 px-4",children:(0,r.jsxs)("select",{value:e.plan,onChange:t=>_(e.id,{plan:t.target.value}),className:"text-xs border rounded px-2 py-1 bg-[#12121f] border-white/[0.1] text-gray-300 cursor-pointer",children:[r.jsx("option",{value:"FREE",children:"Free"}),r.jsx("option",{value:"PRO",children:"Pro"}),r.jsx("option",{value:"BUSINESS",children:"Business"})]})}),r.jsx("td",{className:"py-3 px-4",children:(0,r.jsxs)("button",{onClick:()=>_(e.id,{role:"ADMIN"===e.role?"USER":"ADMIN"}),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium transition-colors ${"ADMIN"===e.role?"bg-purple-500/10 text-purple-400 hover:bg-purple-500/20":"bg-white/[0.05] text-gray-400 hover:bg-white/[0.08]"}`,children:["ADMIN"===e.role?r.jsx(o.Z,{className:"h-3 w-3"}):r.jsx(x,{className:"h-3 w-3"}),e.role]})}),r.jsx("td",{className:"py-3 px-4",children:v===e.id?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"number",value:b,onChange:e=>N(e.target.value),onKeyDown:t=>"Enter"===t.key&&L(e.id),className:"w-16 border rounded px-1 py-0.5 text-xs bg-[#12121f] border-white/[0.1] text-white",autoFocus:!0}),r.jsx("button",{onClick:()=>L(e.id),className:"text-xs text-green-400 font-medium",children:"✓"}),r.jsx("button",{onClick:()=>f(null),className:"text-xs text-gray-500",children:"✕"})]}):r.jsx("button",{onClick:()=>{f(e.id),N(String(e.pagesLimit))},className:"text-sm text-cyan-400 hover:underline cursor-pointer font-medium",children:e.pagesLimit})}),r.jsx("td",{className:"py-3 px-4 text-gray-400",children:e._count.pages}),r.jsx("td",{className:"py-3 px-4",children:r.jsx("button",{onClick:()=>E(e),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium transition-colors ${e.suspended?"bg-red-500/10 text-red-400 hover:bg-red-500/20":"bg-green-500/10 text-green-400 hover:bg-green-500/20"}`,children:e.suspended?(0,r.jsxs)(r.Fragment,{children:[r.jsx(h.Z,{className:"h-3 w-3"}),t?"محظور":"Suspended"]}):(0,r.jsxs)(r.Fragment,{children:[r.jsx(m.Z,{className:"h-3 w-3"}),t?"نشط":"Active"]})})}),r.jsx("td",{className:"py-3 px-4 text-xs text-gray-500",children:(0,p.p)(e.createdAt)}),r.jsx("td",{className:"py-3 px-4",children:r.jsx("button",{onClick:()=>F(e.id),className:"p-1.5 rounded-md text-red-400 hover:bg-red-500/[0.08] hover:text-red-300 transition-colors",title:t?"حذف":"Delete",children:r.jsx(u.Z,{className:"h-4 w-4"})})})]},e.id))})]})})}),r.jsx("div",{className:"md:hidden space-y-3",children:q.map(e=>(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.03] p-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"font-medium text-white truncate",children:e.name||"—"}),r.jsx("div",{className:"text-xs text-gray-500 truncate",children:e.email})]}),r.jsx("button",{onClick:()=>F(e.id),className:"p-1.5 rounded-md text-red-400 hover:bg-red-500/[0.08] shrink-0",children:r.jsx(u.Z,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-gray-500 text-xs",children:t?"الخطة":"Plan"}),r.jsx("div",{children:(0,r.jsxs)("select",{value:e.plan,onChange:t=>_(e.id,{plan:t.target.value}),className:"text-xs border rounded px-2 py-1 bg-[#12121f] border-white/[0.1] text-gray-300 cursor-pointer mt-0.5",children:[r.jsx("option",{value:"FREE",children:"Free"}),r.jsx("option",{value:"PRO",children:"Pro"}),r.jsx("option",{value:"BUSINESS",children:"Business"})]})})]}),(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-gray-500 text-xs",children:t?"الصلاحية":"Role"}),r.jsx("div",{className:"mt-0.5",children:(0,r.jsxs)("button",{onClick:()=>_(e.id,{role:"ADMIN"===e.role?"USER":"ADMIN"}),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${"ADMIN"===e.role?"bg-purple-500/10 text-purple-400":"bg-white/[0.05] text-gray-400"}`,children:["ADMIN"===e.role?r.jsx(o.Z,{className:"h-3 w-3"}):r.jsx(x,{className:"h-3 w-3"}),e.role]})})]}),(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-gray-500 text-xs",children:t?"حد الصفحات":"Limit"}),r.jsx("div",{className:"mt-0.5",children:v===e.id?(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[r.jsx("input",{type:"number",value:b,onChange:e=>N(e.target.value),onKeyDown:t=>"Enter"===t.key&&L(e.id),className:"w-14 border rounded px-1 py-0.5 text-xs bg-[#12121f] border-white/[0.1] text-white",autoFocus:!0}),r.jsx("button",{onClick:()=>L(e.id),className:"text-xs text-green-400",children:"✓"}),r.jsx("button",{onClick:()=>f(null),className:"text-xs text-gray-500",children:"✕"})]}):r.jsx("button",{onClick:()=>{f(e.id),N(String(e.pagesLimit))},className:"text-sm text-cyan-400 hover:underline font-medium",children:e.pagesLimit})})]}),(0,r.jsxs)("div",{children:[r.jsx("span",{className:"text-gray-500 text-xs",children:t?"الصفحات":"Pages"}),r.jsx("div",{className:"text-gray-300 mt-0.5",children:e._count.pages})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-white/[0.04]",children:[r.jsx("button",{onClick:()=>E(e),className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${e.suspended?"bg-red-500/10 text-red-400":"bg-green-500/10 text-green-400"}`,children:e.suspended?(0,r.jsxs)(r.Fragment,{children:[r.jsx(h.Z,{className:"h-3 w-3"}),t?"محظور":"Suspended"]}):(0,r.jsxs)(r.Fragment,{children:[r.jsx(m.Z,{className:"h-3 w-3"}),t?"نشط":"Active"]})}),r.jsx("span",{className:"text-xs text-gray-500",children:(0,p.p)(e.createdAt)})]})]},e.id))})]}),w&&r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"bg-[#1a1a2e] border border-white/[0.1] rounded-2xl p-6 w-full max-w-md mx-4 shadow-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[r.jsx("div",{className:"p-2 rounded-lg bg-orange-500/10",children:r.jsx(h.Z,{className:"h-5 w-5 text-orange-400"})}),(0,r.jsxs)("div",{children:[r.jsx("h3",{className:"text-lg font-semibold text-white",children:t?"تعليق المستخدم":"Suspend User"}),r.jsx("p",{className:"text-sm text-gray-400",children:w.name||w.email})]})]}),r.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t?"سبب التعليق (اختياري)":"Reason for suspension (optional)"}),r.jsx("textarea",{value:Z,onChange:e=>C(e.target.value),placeholder:t?"مثال: مخالفة شروط الاستخدام...":"e.g. Terms of service violation...",className:"w-full px-3 py-2 border rounded-lg text-sm bg-white/[0.03] border-white/[0.08] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-orange-500/30 focus:border-orange-500/30 resize-none",rows:3,dir:t?"rtl":"ltr",autoFocus:!0}),(0,r.jsxs)("div",{className:"flex gap-3 mt-4",children:[r.jsx("button",{onClick:D,className:"flex-1 px-4 py-2 text-sm font-medium text-white bg-orange-500 hover:bg-orange-400 rounded-lg transition-colors",children:t?"تأكيد التعليق":"Confirm Suspend"}),r.jsx("button",{onClick:()=>{k(null),C("")},className:"flex-1 px-4 py-2 text-sm font-medium text-gray-400 bg-white/[0.05] hover:bg-white/[0.08] rounded-lg transition-colors",children:t?"إلغاء":"Cancel"})]})]})})]})}},11453:(e,t,s)=>{"use strict";s.d(t,{cn:()=>i,p:()=>n});var r=s(56815),a=s(79377);function i(...e){return(0,a.m6)((0,r.W)(e))}function n(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e))}},27293:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var r=s(25036);function a(){return(0,r.jsxs)("div",{className:"animate-pulse",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,r.jsxs)("div",{children:[r.jsx("div",{className:"h-7 w-48 bg-white/[0.06] rounded mb-2"}),r.jsx("div",{className:"h-4 w-24 bg-white/[0.06] rounded"})]}),r.jsx("div",{className:"h-10 w-32 bg-white/[0.06] rounded"})]}),r.jsx("div",{className:"h-10 w-80 bg-white/[0.06] rounded mb-6"}),r.jsx("div",{className:"h-96 rounded-2xl border border-white/[0.06] bg-white/[0.03]"})]})}},75002:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>i,__esModule:()=>a,default:()=>n});let r=(0,s(86843).createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\admin\users\page.tsx`),{__esModule:a,$$typeof:i}=r,n=r.default}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),r=t.X(0,[1638,5312,3207,6632,3910,9043],()=>s(31252));module.exports=r})();