PageSourceSearch

https://beefinitive.com/assets/Settings-0NG5H0Y3.js

js beefinitive.com collected 2026-10-08 11:22:32 UTC 57,776 bytes, 1 lines download raw bytes

1import{r as d,j as s}from"./vendor-trpc-BNJGOXGz.js";import{u as js,t as u,e as Ns,c as i,P as fs,B as p}from"./index-2QFcfS8K.js";import{C as N,a as w,b as C,d as M,c as f}from"./card-BDajpTwT.js";import{A as vs}from"./AIImageGenerator-BNpLgU7E.js";import{I as o}from"./input-BN2EXvzm.js";import{L as n}from"./label-N6NopUtw.js";import{D as ns,S as J}from"./DashboardLayout-BvLdCgUs.js";import{T as ys,a as bs,b as W,c as $}from"./tabs-C2nqtPuP.js";import{A as ws,h as Cs,a as ks,b as As,c as Ts,d as Ms,e as Ps,f as Is,g as Ls}from"./alert-dialog-BbT2zCy8.js";import{B as ls}from"./badge-DFJnj6FU.js";import{T as Ss}from"./textarea-TaL4Y_S8.js";import{D as is,d as Ds,a as rs,b as os,c as ds}from"./dialog-JbEtAZdc.js";import{T as Es,a as Us,b as gs,c as O,d as Fs,e as _}from"./table-D2Tzy_v9.js";import{i as Ys,f as zs,a6 as xs,a7 as Gs,n as K,r as q,G as ps,a8 as cs,M as Hs,x as Bs,a0 as Rs,a9 as Ws,aa as $s,ab as Zs,m as ms,ac as Vs,ad as Os,ae as _s,s as hs,P as Js,af as Qs,k as Xs,ag as Ks,ah as qs,ai as se,l as ee}from"./vendor-ui-CO8Y4Ef_.js";import"./vendor-react-BN0qJr-I.js";import"./useComposition-DsKjXeZD.js";import"./index-BldL7dXw.js";import"./Combination-DjkEoW3C.js";import"./index-IFwrAkbB.js";const us=[{name:"أخضر زيتي",primary:"#4a5d23",secondary:"#6b7c3f",accent:"#8fa058"},{name:"أزرق داكن",primary:"#1e3a5f",secondary:"#2d5a87",accent:"#3d7ab0"},{name:"بنفسجي",primary:"#5b3a7d",secondary:"#7a4d9e",accent:"#9a60bf"},{name:"برتقالي",primary:"#c45c26",secondary:"#e07030",accent:"#f08040"},{name:"أحمر قرمزي",primary:"#8b2942",secondary:"#a83a55",accent:"#c54b68"},{name:"ذهبي",primary:"#8b7355",secondary:"#a68b6a",accent:"#c4a882"},{name:"رمادي",primary:"#4a4a4a",secondary:"#6a6a6a",accent:"#8a8a8a"},{name:"أخضر زمردي",primary:"#0d6e5b",secondary:"#109b7e",accent:"#13c8a1"}];function be(){const{hasPermission:E}=js(),P=u.useUtils(),{data:c,isLoading:m}=u.settings.getAll.useQuery(),[h,v]=d.useState(""),[y,k]=d.useState("منصة التدريب"),[Y,z]=d.useState(0),[r,S]=d.useState({primary:"#4a5d23",secondary:"#6b7c3f",accent:"#8fa058"}),[I,A]=d.useState(!1),[T,l]=d.useState(""),[b,U]=d.useState(!1),[F,G]=d.useState(""),H=d.useRef(null),B=d.useRef(null),[t,x]=d.useState({whatsappNumber:"966507577935",phone1:"966507577935",phone2:"966538920797",contactEmail:"[email protected]",locationAddress:"مملكة البحرين - محافظة المحرق",locationLat:"26.2285",locationLng:"50.6001",locationMapZoom:"14",workingHours:"الأحد - الخميس: 9 ص - 5 م",socialInstagram:"",socialTwitter:"",socialLinkedin:"",socialFacebook:"",socialYoutube:"",socialTiktok:"",socialSnapchat:""}),{refetch:ss}=Ns(),Z=u.settings.uploadBrandingImage.useMutation(),R=u.settings.update.useMutation({onSuccess:()=>{P.settings.getAll.invalidate(),ss(),i.success("تم حفظ الإعدادات بنجاح"),Q(r)},onError:e=>{console.error("Settings save error:",e),i.error("حدث خطأ أثناء حفظ الإعدادات: "+e.message)}});d.useEffect(()=>{c&&(c.logoUrl&&v(c.logoUrl),c.pwaIconUrl&&l(c.pwaIconUrl),c.platformName&&k(c.platformName),G(c.metaPixelId||""),c.primaryColor&&S({primary:c.primaryColor,secondary:c.secondaryColor||c.primaryColor,accent:c.accentColor||c.primaryColor}),x({whatsappNumber:c.whatsappNumber||"966507577935",phone1:c.phone1||"966507577935",phone2:c.phone2||"966538920797",contactEmail:c.contactEmail||"[email protected]",locationAddress:c.locationAddress||"مملكة البحرين - محافظة المحرق",locationLat:c.locationLat||"26.2285",locationLng:c.locationLng||"50.6001",locationMapZoom:c.locationMapZoom||"14",workingHours:c.workingHours||"الأحد - الخميس: 9 ص - 5 م",socialInstagram:c.socialInstagram||"",socialTwitter:c.socialTwitter||"",socialLinkedin:c.socialLinkedin||"",socialFacebook:c.socialFacebook||"",socialYoutube:c.socialYoutube||"",socialTiktok:c.socialTiktok||"",socialSnapchat:c.socialSnapchat||""}))},[c]),d.useEffect(()=>{c?.primaryColor&&Q({primary:c.primaryColor,secondary:c.secondaryColor||c.primaryColor,accent:c.accentColor||c.primaryColor})},[c]);const Q=e=>{const g=document.documentElement;g.style.setProperty("--primary-custom",e.primary),g.style.setProperty("--secondary-custom",e.secondary),g.style.setProperty("--accent-custom",e.accent),g.style.setProperty("--color-primary",e.primary)},es=e=>{z(e),S(us[e])},X=async e=>{const g=e.target.files?.[0];if(!g)return;if(!["image/jpeg","image/png","image/webp","image/avif"].includes(g.type)){i.error("يرجى اختيار صورة بصيغة JPG أو PNG أو WebP أو A
1VIF");return}if(g.size>2*1024*1024){i.error("حجم الصورة يجب أن يكون أقل من 2 ميجابايت");return}A(!0);try{const j=new FileReader;j.onloadend=async()=>{try{const L=j.result.split(",")[1],a=await Z.mutateAsync({fileName:g.name,fileData:L,fileType:g.type,purpose:"logo"});v(a.url),i.success("تم رفع الشعار بنجاح")}catch(L){i.error(L?.message||"حدث خطأ أثناء رفع الشعار")}finally{A(!1)}},j.onerror=()=>{A(!1),i.error("حدث خطأ أثناء رفع الشعار")},j.readAsDataURL(g)}catch{A(!1),i.error("حدث خطأ أثناء رفع الشعار")}},V=async e=>{const g=e.target.files?.[0];if(!g)return;if(!["image/jpeg","image/png","image/webp","image/avif"].includes(g.type)){i.error("يرجى اختيار صورة بصيغة JPG أو PNG أو WebP أو AVIF");return}if(g.size>2*1024*1024){i.error("حجم الصورة يجب أن يكون أقل من 2 ميجابايت");return}U(!0);try{const j=new FileReader;j.onloadend=async()=>{try{const L=j.result.split(",")[1],a=await Z.mutateAsync({fileName:g.name,fileData:L,fileType:g.type,purpose:"pwa-icon"});l(a.url),i.success("تم رفع أيقونة التطبيق بنجاح")}catch(L){i.error(L?.message||"حدث خطأ أثناء رفع أيقونة التطبيق")}finally{U(!1)}},j.onerror=()=>{U(!1),i.error("حدث خطأ أثناء رفع الأيقونة")},j.readAsDataURL(g)}catch{U(!1),i.error("حدث خطأ أثناء رفع الأيقونة")}},ts=()=>{const e=F.trim();if(e&&!/^\d{8,20}$/.test(e)){i.error("معرّف Meta Pixel يجب أن يتكون من أرقام فقط");return}console.log("Saving settings:",{logoUrl:h?h.substring(0,50)+"...":"empty",platformName:y,primaryColor:r.primary}),R.mutate({settings:{logoUrl:h,pwaIconUrl:T,platformName:y,primaryColor:r.primary,secondaryColor:r.secondary,accentColor:r.accent,whatsappNumber:t.whatsappNumber,phone1:t.phone1,phone2:t.phone2,contactEmail:t.contactEmail,locationAddress:t.locationAddress,locationLat:t.locationLat,locationLng:t.locationLng,locationMapZoom:t.locationMapZoom,workingHours:t.workingHours,socialInstagram:t.socialInstagram,socialTwitter:t.socialTwitter,socialLinkedin:t.socialLinkedin,socialFacebook:t.socialFacebook,socialYoutube:t.socialYoutube,socialTiktok:t.socialTiktok,socialSnapchat:t.socialSnapchat,metaPixelId:e}})};return m?s.jsx(ns,{"data-loc":"client/src/pages/Settings.tsx:291",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:292",className:"space-y-6",children:[s.jsx(J,{"data-loc":"client/src/pages/Settings.tsx:293",className:"h-10 w-48"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:294",className:"grid gap-6",children:[s.jsx(J,{"data-loc":"client/src/pages/Settings.tsx:295",className:"h-64"}),s.jsx(J,{"data-loc":"client/src/pages/Settings.tsx:296",className:"h-64"})]})]})}):s.jsx(ns,{"data-loc":"client/src/pages/Settings.tsx:304",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:305",className:"space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:307",className:"flex items-center justify-between",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:308",children:[s.jsxs("h1",{"data-loc":"client/src/pages/Settings.tsx:309",className:"text-2xl font-bold flex items-center gap-2",style:{fontFamily:"var(--font-serif)"},children:[s.jsx(Ys,{"data-loc":"client/src/pages/Settings.tsx:310",className:"h-6 w-6"}),"الإعدادات"]}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:313",className:"text-muted-foreground mt-1",children:"تخصيص مظهر المنصة والإعدادات العامة"})]}),E(fs.SETTINGS_EDIT)&&s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:316",onClick:ts,disabled:R.isPending,children:[s.jsx(zs,{"data-loc":"client/src/pages/Settings.tsx:317",className:"h-4 w-4 ml-2"}),R.isPending?"جاري الحفظ...":"حفظ التغييرات"]})]}),s.jsxs(ys,{"data-loc":"client/src/pages/Settings.tsx:323",defaultValue:"branding",className:"space-y-6",children:[s.jsxs(bs,{"data-loc":"client/src/pages/Settings.tsx:324",children:[s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:325",value:"branding",className:"gap-2",children:[s.jsx(xs,{"data-loc":"client/src/pages/Settings.tsx:326",className:"h-4 w-4"}),"الهوية البصرية"]}),s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:329",value:"colors",className:"gap-2",children:[s.jsx(Gs,{"data-loc":"client/src/pages/Settings.tsx:330",className:"h-4 w-4"}),"الألوان"]}),s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:333",value:"contact",className:"gap-2",children:[s.jsx(K,{"data-loc":"client/src/pages/Settings.tsx:334",className:"h-4 w-4"}),"معلومات الاتصال"]}),s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:337",value:"year-closures",className:"gap-2",children:[s.jsx(q,{"data-loc":"client/src/pages/Settings.tsx:338",className:"h-4 w-4"}),"إغلاق حسابات العام"]}),s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:341",value:"social-media",className:"gap-2",children:[s.jsx(ps,{"data-loc":"client/src/pages/Settings.tsx:342",className:"h-4 w-4"}),"السوشيال ميديا"]}),s.jsxs(W,{"data-loc":"client/src/pages/Settings.tsx:345",value:"tracking",className:"gap-2",children:[s.jsx(cs,{"data-loc":"client/src/pages/Settings.tsx:346",className:"h-4 w-4"}),"التتبّع والإعلانات"]})]}),s.jsx($,{"data-loc":"client/src/pages/Settings.tsx:351",value:"tracking",className:"space-y-6",children:s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:352",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:353",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:354",className:"flex items-center gap-2",children:[s.jsx(cs,{"data-loc":"client/src/pages/Settings.tsx:355",className:"h-5 w-5 text-blue-600"}),"Meta Pixel"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:358",children:"أدخل معرّف البكسل الرقمي أو اتركه فارغاً لإيقاف تتبّع Meta. لا تُخزن بيانات العملاء الشخصية ضمن هذا الإعداد."})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:360",className:"space-y-3",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:361",htmlFor:"meta-pixel-id",children:"Meta Pixel ID"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:362",id:"meta-pixel-id",value:F,onChange:e=>G(e.target.value.replace(/\D/g,"")),placeholder:"1369452154238568",inputMode:"numeric",dir:"ltr",className:"max-w-md font-mono"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:371",className:"text-xs text-muted-foreground",children:"سيُستخدم المعرّف الجديد بعد حفظ الإعدادات وتحديث الصفحة. اترك الحقل فارغاً لتعطيل البكسل."})]})]})}),s.jsxs($,{"data-loc":"client/src/pages/Settings.tsx:377",value:"contact",className:"space-y-6",children:[s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:379",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:380",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:381",className:"flex items-center gap-2",children:[s.jsx(K,{"data-loc":"client/src/pages/Settings.tsx:382",className:"h-5 w-5"}),"أرقام الاتصال والواتساب"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:385",children:"تحكم في أرقام الاتصال المعروضة في الموقع وأيقونة الواتساب العائمة"})]}),s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:387",className:"space-y-6",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:388",className:"grid sm:grid-cols-2 gap-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:389",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:390",className:"flex items-center gap-2",children:[s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:391",className:"text-[#25D366] text-lg",children:"●"}),"رقم الواتساب"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:394",value:t.whatsappNumber,onChange:e=>x({...t,whatsappNumber:e.target.value}),placeholder:"966507577935",dir:"ltr",className:"font-mono"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:401",className:"text-xs text-muted-foreground",children:"بدون + أو مسافات"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:403",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:404",className:"flex items-center gap-2",children:[s.jsx(Hs,{"data-loc":"client/src/pages/Settings.tsx:405",className:"h-4 w-4 text-gold"}),"البريد الإلكتروني"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:408",value:t.contactEmail,onChange:e=>x({...t,contactEmail:e.target.value}),placeholder:"[email protected]",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:415",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:416",className:"flex items-center gap-2",children:[s.jsx(K,{"data-loc":"client/src/pages/Settings.tsx:417",className:"h-4 w-4 text-gold"}),"رقم الهاتف الأول"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:420",value:t.phone1,onChange:e=>x({...t,phone1:e.target.value}),placeholder:"966507577935",dir:"ltr",className:"font-mono"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:428",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:429",className:"flex items-center gap-2",children:[s.jsx(K,{"data-loc":"client/src/pages/Settings.tsx:430",className:"h-4 w-4 text-gold"}),"رقم الهاتف الثاني"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:433",value:t.phone2,onChange:e=>x({...t,phone2:e.target.value}),placeholder:"966538920797",dir:"ltr",className:"font-mono"})]})]})})]}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:446",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:447",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:448",className:"flex items-center gap-2",children:[s.jsx(Bs,{"data-loc":"client/src/pages/Settings.tsx:449",className:"h-5 w-5"}),"الموقع الجغرافي والخريطة"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:452",children:"حدد عنوان الموقع وإحداثيات الخريطة التي تظهر في صفحة اتصل بنا"})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:454",className:"space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:455",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:456",children:"العنوان الكامل"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:457",value:t.locationAddress,onChange:e=>x({...t,locationAddress:e.target.value}),placeholder:"مملكة البحرين - محافظة المحرق"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:463",className:"grid sm:grid-cols-3 gap-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:464",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:465",children:"خط العرض (Latitude)"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:466",value:t.locationLat,onChange:e=>x({...t,locationLat:e.target.value}),placeholder:"26.2285",dir:"ltr",className:"font-mono"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:474",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:475",children:"خط الطول (Longitude)"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:476",value:t.locationLng,onChange:e=>x({...t,locationLng:e.target.value}),placeholder:"50.6001",dir:"ltr",className:"font-mono"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:484",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:485",children:"مستوى التكبير (Zoom)"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:486",type:"number",value:t.locationMapZoom,onCh
1ange:e=>x({...t,locationMapZoom:e.target.value}),placeholder:"14",dir:"ltr",min:"1",max:"20"})]})]}),s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:497",className:"bg-muted/50 rounded-lg p-4 border",children:s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:498",className:"text-sm text-muted-foreground",children:'يمكنك الحصول على الإحداثيات من Google Maps بالنقر بزر الماوس الأيمن على الموقع واختيار "ما هنا؟"'})})]})]}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:504",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:505",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:506",className:"flex items-center gap-2",children:[s.jsx(Rs,{"data-loc":"client/src/pages/Settings.tsx:507",className:"h-5 w-5"}),"ساعات العمل"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:510",children:"حدد ساعات العمل التي تظهر في صفحة اتصل بنا"})]}),s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:512",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:513",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:514",children:"ساعات العمل"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:515",value:t.workingHours,onChange:e=>x({...t,workingHours:e.target.value}),placeholder:"الأحد - الخميس: 9 ص - 5 م"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:520",className:"text-xs text-muted-foreground",children:"مثال: الأحد - الخميس: 9 ص - 5 م"})]})})]}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:526",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:527",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:528",className:"flex items-center gap-2",children:[s.jsx(ps,{"data-loc":"client/src/pages/Settings.tsx:529",className:"h-5 w-5"}),"روابط وسائل التواصل الاجتماعي"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:532",children:"أضف روابط حساباتك على وسائل التواصل الاجتماعي - تظهر في صفحة اتصل بنا والفوتر"})]}),s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:534",className:"space-y-4",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:535",className:"grid sm:grid-cols-2 gap-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:536",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:537",className:"flex items-center gap-2",children:[s.jsx(Ws,{"data-loc":"client/src/pages/Settings.tsx:538",className:"h-4 w-4 text-pink-500"}),"Instagram"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:541",value:t.socialInstagram,onChange:e=>x({...t,socialInstagram:e.target.value}),placeholder:"https://instagram.com/yourpage",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:548",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:549",className:"flex items-center gap-2",children:[s.jsx("svg",{"data-loc":"client/src/pages/Settings.tsx:550",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:s.jsx("path",{"data-loc":"client/src/pages/Settings.tsx:550",d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"X (Twitter)"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:553",value:t.socialTwitter,onChange:e=>x({...t,socialTwitter:e.target.value}),placeholder:"https://x.com/yourpage",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:560",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:561",className:"flex items-center gap-2",children:[s.jsx($s,{"data-loc":"client/src/pages/Settings.tsx:562",className:"h-4 w-4 text-blue-600"}),"LinkedIn"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:565",value:t.socialLinkedin,onChange:e=>x({...t,socialLinkedin:e.target.value}),placeholder:"https://linkedin.com/company/yourpage",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:572",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:573",className:"flex items-center gap-2",children:[s.jsx(cs,{"data-loc":"client/src/pages/Settings.tsx:574",className:"h-4 w-4 text-blue-500"}),"Facebook"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:577",value:t.socialFacebook,onChange:e=>x({...t,socialFacebook:e.target.value}),placeholder:"https://facebook.com/yourpage",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:584",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:585",className:"flex items-center gap-2",children:[s.jsx(Zs,{"data-loc":"client/src/pages/Settings.tsx:586",className:"h-4 w-4 text-red-500"}),"YouTube"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:589",value:t.socialYoutube,onChange:e=>x({...t,socialYoutube:e.target.value}),placeholder:"https://youtube.com/@yourchannel",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:596",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:597",className:"flex items-center gap-2",children:[s.jsx("svg",{"data-loc":"client/src/pages/Settings.tsx:598",viewBox:"0 0 24 24",fill:"
1currentColor",className:"h-4 w-4",children:s.jsx("path",{"data-loc":"client/src/pages/Settings.tsx:598",d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})}),"TikTok"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:601",value:t.socialTiktok,onChange:e=>x({...t,socialTiktok:e.target.value}),placeholder:"https://tiktok.com/@yourpage",dir:"ltr"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:608",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:609",className:"flex items-center gap-2",children:[s.jsx("svg",{"data-loc":"client/src/pages/Settings.tsx:610",viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4",children:s.jsx("path",{"data-loc":"client/src/pages/Settings.tsx:610",d:"M12 2C6.477 2 2 6.477 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10c0-5.523-4.477-10-10-10zm5.625 14.375c-.25.438-.813.563-1.25.313-3.438-2.063-7.75-2.5-12.813-1.375-.5.125-1-.188-1.125-.688-.125-.5.188-1 .688-1.125 5.5-1.25 10.25-.75 14.063 1.563.438.25.563.813.313 1.25l.125.063zm1.5-3.438c-.313.5-1 .688-1.5.375-3.938-2.375-9.938-3.063-14.563-1.688-.563.188-1.188-.125-1.375-.688-.188-.563.125-1.188.688-1.375 5.313-1.563 11.875-.813 16.375 1.938.5.313.688 1 .375 1.5v-.063zm.125-3.563c-4.688-2.75-12.438-3-16.938-1.688-.688.188-1.375-.188-1.563-.875-.188-.688.188-1.375.875-1.563 5.188-1.5 13.75-1.25 19.188 1.938.625.375.875 1.188.5 1.813-.375.625-1.188.875-1.813.5l-.25-.125z"})}),"Snapchat"]}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:613",value:t.socialSnapchat,onChange:e=>x({...t,socialSnapchat:e.target.value}),placeholder:"https://snapchat.com/add/yourpage",dir:"ltr"})]})]})})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:625",className:"bg-muted/50 rounded-lg p-4 border",children:[s.jsx("h4",{"data-loc":"client/src/pages/Settings.tsx:626",className:"font-semibold text-sm mb-2",children:"أين تظهر هذه المعلومات؟"}),s.jsxs("ul",{"data-loc":"client/src/pages/Settings.tsx:627",className:"text-sm text-muted-foreground space-y-1",children:[s.jsxs("li",{"data-loc":"client/src/pages/Settings.tsx:628",children:["• ",s.jsx("strong",{"data-loc":"client/src/pages/Settings.tsx:628",children:"صفحة اتصل بنا"})," - تعرض جميع المعلومات والخريطة وروابط السوشيال ميديا"]}),s.jsxs("li",{"data-loc":"client/src/pages/Settings.tsx:629",children:["• ",s.jsx("strong",{"data-loc":"client/src/pages/Settings.tsx:629",children:"أيقونة الواتساب العائمة"})," - تظهر في جميع صفحات الموقع العام"]}),s.jsxs("li",{"data-loc":"client/src/pages/Settings.tsx:630",children:["• ",s.jsx("strong",{"data-loc":"client/src/pages/Settings.tsx:630",children:"الفوتر"})," - يعرض أرقام الهاتف والواتساب والبريد وروابط السوشيال ميديا"]})]})]})]}),s.jsxs($,{"data-loc":"client/src/pages/Settings.tsx:636",value:"branding",className:"space-y-6",children:[s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:637",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:638",children:[s.jsx(C,{"data-loc":"client/src/pages/Settings.tsx:639",children:"الشعار واسم المنصة"}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:640",children:"قم بتخصيص شعار المنصة واسمها"})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:642",className:"space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:644",className:"space-y-4",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:645",children:"شعار المنصة"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:646",className:"flex items-start gap-6",children:[s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:647",className:"w-32 h-32 border-2 border-dashed rounded-lg flex items-center justify-center bg-muted/50 overflow-hidden",children:h?s.jsx("img",{"data-loc":"client/src/pages/Settings.tsx:649",src:h,alt:"Logo",className:"w-full h-full object-contain"}):s.jsx(xs,{"data-loc":"client/src/pages/Settings.tsx:651",className:"h-12 w-12 text-muted-foreground"})}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:654",className:"space-y-2",children:[s.jsx("input",{"data-loc":"client/src/pages/Settings.tsx:655",type:"file",ref:H,onChange:X,accept:"image/*",className:"hidden"}),s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:662",variant:"outline",onClick:()=>H.current?.click(),disabled:I,children:[s.jsx(ms,{"data-loc":"client/src/pages/Settings.tsx:667",className:"h-4 w-4 ml-2"}),I?"جاري الرفع...":"رفع شعار جديد"]}),s.jsx(vs,{"data-loc":"client/src/pages/Settings.tsx:670",onImageGenerated:e=>v(e),defaultPrompt:"شعار احترافي لمنصة تدريبية",buttonLabel:"إنشاء شعار بالذكاء",buttonSize:"sm"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:676",className:"text-xs text-muted-foreground",children:"PNG, JPG أو SVG. الحد الأقصى 2 ميجابايت."}),h&&s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:680",variant:"ghost",size:"sm",className:"text-destructive",onClick:()=>v(""),children:"إزالة الشعار"})]})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:694",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:695",children:"اسم المنصة"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:696",value:y,onChange:e=>k(e.target.value),placeholder:"منصة التدريب",className:"max-w-md"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:702",className:"text-xs text-muted-foreground",children:"سيظهر هذا الاسم في القائمة الجانبية وعنÙ
1ˆØ§Ù† الصفحة"})]})]})]}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:710",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:711",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:712",className:"flex items-center gap-2",children:[s.jsxs("svg",{"data-loc":"client/src/pages/Settings.tsx:713",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("rect",{"data-loc":"client/src/pages/Settings.tsx:713",width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}),s.jsx("path",{"data-loc":"client/src/pages/Settings.tsx:713",d:"M12 18h.01"})]}),"أيقونة التطبيق (PWA)"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:716",children:"الأيقونة التي تظهر على الشاشة الرئيسية للجوال عند تثبيت التطبيق. يفضل أن تكون صورة مربعة (512×512 بكسل على الأقل)"})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:718",className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:719",className:"flex items-start gap-6",children:[s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:720",className:"w-24 h-24 border-2 border-dashed rounded-xl flex items-center justify-center bg-muted/50 overflow-hidden",children:T?s.jsx("img",{"data-loc":"client/src/pages/Settings.tsx:722",src:T,alt:"App Icon",className:"w-full h-full object-cover rounded-xl"}):s.jsx("img",{"data-loc":"client/src/pages/Settings.tsx:724",src:"https://d2xsxph8kpxj0f.cloudfront.net/116757463/2Cfui6dKDoaQSG5hbwXu6R/pwa-icon-192x192_5c60b66d.png",alt:"Default App Icon",className:"w-full h-full object-cover rounded-xl"})}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:727",className:"space-y-2",children:[s.jsx("input",{"data-loc":"client/src/pages/Settings.tsx:728",type:"file",ref:B,onChange:V,accept:"image/*",className:"hidden"}),s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:735",variant:"outline",onClick:()=>B.current?.click(),disabled:b,children:[s.jsx(ms,{"data-loc":"client/src/pages/Settings.tsx:740",className:"h-4 w-4 ml-2"}),b?"جاري الرفع...":"رفع أيقونة جديدة"]}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:743",className:"text-xs text-muted-foreground",children:"PNG أو JPG. صورة مربعة 512×512 بكسل على الأقل. الحد الأقصى 2 ميجابايت."}),T&&s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:747",variant:"ghost",size:"sm",className:"text-destructive",onClick:()=>l(""),children:"إزالة الأيقونة (استخدام الافتراضية)"})]})]}),s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:758",className:"bg-muted/50 rounded-lg p-3 border text-sm text-muted-foreground",children:s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:759",children:"هذه الأيقونة تظهر على الشاشة الرئيسية للجوال عند تثبيت التطبيق، وفي شاشة التحميل (splash screen)، وفي مبدل التطبيقات. يجب نشر الموقع بعد التغيير لتطبيق الأيقونة الجديدة."})})]})]})]}),s.jsx($,{"data-loc":"client/src/pages/Settings.tsx:766",value:"colors",className:"space-y-6",children:s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:767",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:768",children:[s.jsx(C,{"data-loc":"client/src/pages/Settings.tsx:769",children:"ألوان المنصة"}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:770",children:"اختر نظام ألوان جاهز أو قم بتخصيص الألوان يدوياً"})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:772",className:"space-y-6",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:774",className:"space-y-3",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:775",children:"أنظمة ألوان جاهزة"}),s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:776",className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:us.map((e,g)=>s.jsxs("button",{"data-loc":"client/src/pages/Settings.tsx:778",onClick:()=>es(g),className:`relative p-4 rounded-lg border-2 transition-all ${Y===g?"border-primary ring-2 ring-primary/20":"border-border hover:border-primary/50"}`,children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:787",className:"flex gap-1 mb-2",children:[s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:788",className:"w-6 h-6 rounded-full",style:{backgroundColor:e.primary}}),s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:792",className:"w-6 h-6 rounded-full",style:{backgroundColor:e.secondary}}),s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:796",className:"w-6 h-6 rounded-full",style:{backgroundColor:e.accent}})]}),s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:801",className:"text-sm font-medium",children:e.name}),Y===g&&s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:803",className:"absolute top-2 left-2",children:s.jsx(Vs,{"data-loc":"client/src/pages/Settings.tsx:804",className:"h-4 w-4 text-primary"})})]},g))})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:813",className:"space-y-4 pt-4 border-t",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:814",children:"تخصيص الألوان يدوياً"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:815",className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:816",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:817",className:"text-sm text-muted-foreground",children:"اللون الرئيسي"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:818",className:"flex items-center gap-2",children:[s.jsx("input",{"data-loc":"client/src/pages/Settings.tsx:819",type:"color",value:r.primary,onChange:e=>S({...r,primary:e.target.value}),className:"w-12 h-10 rounded cursor-pointer border-0"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:825",value:r.primary,onChange:e=>S({...r,primary:e.target.value}),className:"font-mono"})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:832",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:833",className:"text-sm text-muted-foreground",children:"اللون الثانوي"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:834",className:"flex items-center gap-2",children:[s.jsx("input",{"data-loc":"client/src/pages/Settings.tsx:835",type:"color",value:r.secondary,onChange:e=>S({...r,secondary:e.target.value}),className:"w-12 h-10 rounded cursor-pointer border-0"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:841",value:r.secondary,onChange:e=>S({...r,secondary:e.target.value}),className:"font-mono"})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:848",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:849",className:"text-sm text-muted-foreground",children:"لون التمييز"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:850",className:"flex items-center gap-2",children:[s.jsx("input",{"data-loc":"client/src/pages/Settings.tsx:851",type:"color",value:r.accent,onChange:e=>S({...r,accent:e.target.value}),className:"w-12 h-10 rounded cursor-pointer border-0"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:857",value:r.accent,onChange:e=>S({...r,accent:e.target.value}),className:"font-mono"})]})]})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:868",className:"space-y-3 pt-4 border-t",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:869",children:"معاينة"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:870",className:"p-6 rounded-lg border bg-card",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:871",className:"flex items-center gap-4 mb-4",children:[s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:872",className:"w-10 h-10 rounded-lg flex items-center justify-center text-white font-bold",style:{backgroundColor:r.primary},children:"م"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:878",children:[s.jsx("h3",{"data-loc":"client/src/pages/Settings.tsx:879",className:"font-semibold",style:{color:r.primary},children:y||"منصة التدريب"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:882",className:"text-sm text-muted-foreground",children:"نظرة عامة"})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:885",className:"flex gap-2",children:[s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:886",size:"sm",style:{backgroundColor:r.primary},className:"text-white",children:"زر رئيسي"}),s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:893",size:"sm",variant:"outline",style:{borderColor:r.secondary,color:r.secondary},children:"زر ثانوي"}),s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:900",className:"px-3 py-1 rounded-full text-sm text-white",style:{backgroundColor:r.accent},children:"شارة"})]})]})]})]})]})}),s.jsx($,{"data-loc":"client/src/pages/Settings.tsx:913",value:"year-closures",className:"space-y-6",children:s.jsx(te,{"data-loc":"client/src/pages/Settings.tsx:914"})}),s.jsx($,{"data-loc":"client/src/pages/Settings.tsx:917",value:"social-media",className:"space-y-6",children:s.jsx(ae,{"data-loc":"client/src/pages/Settings.tsx:918"})})]})]})})}function te(){const{data:E,isLoading:P}=u.yearClosures.list.useQuery(),c=u.useUtils(),[m,h]=d.useState(new Date().getFullYear()-1),[v,y]=d.use
1State(""),[k,Y]=d.useState(""),z=u.yearClosures.closeYear.useMutation({onSuccess:()=>{c.yearClosures.list.invalidate(),i.success(`تم إغلاق حسابات عام ${m} بنجاح واعتماد جميع دوراته`),y(""),Y("")},onError:l=>{i.error(l.message||"حدث خطأ أثناء إغلاق السنة")}}),r=u.yearClosures.reopenYear.useMutation({onSuccess:(l,b)=>{c.yearClosures.list.invalidate(),i.success(`تم إعادة فتح حسابات عام ${b.year} بنجاح`)},onError:l=>{i.error(l.message||"حدث خطأ أثناء إعادة فتح السنة")}}),S=new Date().getFullYear(),I=Array.from({length:10},(l,b)=>S-b),A=new Set((E||[]).map(l=>l.year)),T=()=>{if(k!==`إغلاق ${m}`){i.error(`يرجى كتابة "إغلاق ${m}" للتأكيد`);return}z.mutate({year:m,notes:v||void 0})};return P?s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:975",className:"space-y-4",children:[s.jsx(J,{"data-loc":"client/src/pages/Settings.tsx:976",className:"h-64"}),s.jsx(J,{"data-loc":"client/src/pages/Settings.tsx:977",className:"h-32"})]}):s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:983",className:"space-y-6",children:[s.jsx(N,{"data-loc":"client/src/pages/Settings.tsx:985",className:"border-amber-300 bg-amber-50 dark:bg-amber-950/20",children:s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:986",className:"pt-6",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:987",className:"flex items-start gap-3",children:[s.jsx(Os,{"data-loc":"client/src/pages/Settings.tsx:988",className:"h-6 w-6 text-amber-600 mt-0.5 shrink-0"}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:989",children:[s.jsx("h3",{"data-loc":"client/src/pages/Settings.tsx:990",className:"font-bold text-amber-800 dark:text-amber-200",children:"تنبيه مهم"}),s.jsxs("p",{"data-loc":"client/src/pages/Settings.tsx:991",className:"text-sm text-amber-700 dark:text-amber-300 mt-1",children:["إغلاق حسابات العام سيمنع ",s.jsx("strong",{"data-loc":"client/src/pages/Settings.tsx:992",children:"أي تعديل مطلقاً"})," على جميع بيانات تلك السنة بما في ذلك: الدورات، التسجيلات، المصروفات، المصروفات التشغيلية، الخدمات، والمشاريع. كما سيتم اعتماد جميع الدورات في تلك السنة تلقائياً."]})]})]})})}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:1002",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:1003",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:1004",className:"flex items-center gap-2",children:[s.jsx(q,{"data-loc":"client/src/pages/Settings.tsx:1005",className:"h-5 w-5"}),"إغلاق حسابات عام"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:1008",children:"اختر السنة التي تريد إغلاق حساباتها"})]}),s.jsxs(f,{"data-loc":"client/src/pages/Settings.tsx:1010",className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1011",className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1012",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1013",children:"السنة"}),s.jsx("select",{"data-loc":"client/src/pages/Settings.tsx:1014",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:m,onChange:l=>h(Number(l.target.value)),children:I.filter(l=>!A.has(l)).map(l=>s.jsx("option",{"data-loc":"client/src/pages/Settings.tsx:1020",value:l,children:l},l))})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1024",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1025",children:"ملاحظات (اختياري)"}),s.jsx(Ss,{"data-loc":"client/src/pages/Settings.tsx:1026",value:v,onChange:l=>y(l.target.value),placeholder:"سبب الإغلاق أو ملاحظات إضافية...",rows:2})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1035",className:"space-y-2",children:[s.jsxs(n,{"data-loc":"client/src/pages/Settings.tsx:1036",className:"text-destructive",children:['للتأكيد، اكتب "إغلاق ',m,'"']}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1037",value:k,onChange:l=>Y(l.target.value),placeholder:`إغلاق ${m}`,dir:"rtl"})]}),s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:1045",onClick:T,disabled:z.isPending||k!==`إغلاق ${m}`,variant:"destructive",className:"w-full",children:[s.jsx(q,{"data-loc":"client/src/pages/Settings.tsx:1051",className:"h-4 w-4 ml-2"}),z.isPending?"جاري الإغلاق...":`إغلاق حسابات عام ${m}`]})]})]}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:1058",children:[s.jsxs(w,{"data-loc":"client/src/pages/Settings.tsx:1059",children:[s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:1060",className:"flex items-center gap-2",children:[s.jsx(_s,{"data-loc":"client/src/pages/Settings.tsx:1061",className:"h-5 w-5"}),"السنوات المغلقة"]}),s.jsx(M,{"data-loc":"client/src/pages/Settings.tsx:1064",children:"قائمة بالسنوات التي تم إغلاق حساباتها"})]}),s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:1066",children:!E||E.length===0?s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1068",className:"text-center py-8 text-muted-foreground",children:[s.jsx(hs,{"data-loc":"client/src/pages/Settings.tsx:1069",className:"h-12 w-12 mx-auto mb-3 opacity-50"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:1070",children:"لا توجد سنوات مغلقة حالياً"})]}):s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:1073",className:"space-y-3",children:E.map(l=>s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1075",className:"flex items-center justify-between p-4 rounded-lg border bg-card",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1079",className:"flex items-center gap-4",children:[s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:1080",className:"w-12 h-12 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:s.jsx(q,{"data-loc":"client/src/pages/Settings.tsx:1081",className:"h-5 w-5 text-red-600"})}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1083",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1084",className:"flex items-center gap-2",children:[s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:1085",className:"font-bold text-lg",children:l.year}),s.jsx(ls,{"data-loc":"client/src/pages/Settings.tsx:1086",variant:"destructive",className:"text-xs",children:"مغلق"})]}),s.jsxs("p",{"data-loc":"client/src/pages/Settings.tsx:1088",className:"text-sm text-muted-foreground",children:["أغلق بواسطة: ",l.closedByName||"مدير"," • ",new Date(l.closedAt).toLocaleDateString("ar-SA")]}),l.notes&&s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:1092",className:"text-xs text-muted-foreground mt-1",children:l.notes})]})]}),s.jsxs(ws,{"data-loc":"client/src/pages/Settings.tsx:1096",children:[s.jsx(Cs,{"data-loc":"client/src/pages/Settings.tsx:1097",asChild:!0,children:s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:1098",variant:"outline",size:"sm",className:"gap-1",children:[s.jsx(hs,{"data-loc":"client/src/pages/Settings.tsx:1099",className:"h-4 w-4"}),"إعادة فتح"]})}),s.jsxs(ks,{"data-loc":"client/src/pages/Settings.tsx:1103",children:[s.jsxs(As,{"data-loc":"client/src/pages/Settings.tsx:1104",children:[s.jsxs(Ts,{"data-loc":"client/src/pages/Settings.tsx:1105",children:["إعادة فتح حسابات عام ",l.year,"؟"]}
1),s.jsxs(Ms,{"data-loc":"client/src/pages/Settings.tsx:1106",children:["سيتم إعادة فتح حسابات عام ",l.year," والسماح بالتعديل على بياناته. هل أنت متأكد؟"]})]}),s.jsxs(Ps,{"data-loc":"client/src/pages/Settings.tsx:1111",children:[s.jsx(Is,{"data-loc":"client/src/pages/Settings.tsx:1112",children:"إلغاء"}),s.jsx(Ls,{"data-loc":"client/src/pages/Settings.tsx:1113",onClick:()=>r.mutate({year:l.year}),className:"bg-amber-600 hover:bg-amber-700",children:"نعم، إعادة فتح"})]})]})]})]},l.id))})})]})]})}function ae(){const[E,P]=d.useState(!1),[c,m]=d.useState(!1),[h,v]=d.useState(null),[y,k]=d.useState(""),[Y,z]=d.useState({}),[r,S]=d.useState(""),[I,A]=d.useState(""),[T,l]=d.useState(""),[b,U]=d.useState(""),[F,G]=d.useState(""),[H,B]=d.useState(""),t=u.useUtils(),{data:x=[],isLoading:ss}=u.socialMedia.getAll.useQuery(),Z=u.socialMedia.create.useMutation({onSuccess:()=>{i.success("تم إنشاء الحساب بنجاح"),P(!1),V(),t.socialMedia.getAll.invalidate()},onError:a=>i.error(a.message)}),R=u.socialMedia.update.useMutation({onSuccess:()=>{i.success("تم تحديث الحساب بنجاح"),P(!1),V(),t.socialMedia.getAll.invalidate()},onError:a=>i.error(a.message)}),Q=u.socialMedia.delete.useMutation({onSuccess:()=>{i.success("تم حذف الحساب بنجاح"),t.socialMedia.getAll.invalidate()},onError:a=>i.error(a.message)}),es=u.socialMedia.toggle.useMutation({onSuccess:()=>{t.socialMedia.getAll.invalidate()},onError:a=>i.error(a.message)}),X=u.socialMedia.shareViaWhatsApp.useMutation({onSuccess:a=>{window.open(a.whatsappUrl,"_blank"),i.success("تم إرسال البيانات عبر WhatsApp"),m(!1),k(""),t.socialMedia.getShareHistory.invalidate()},onError:a=>i.error(a.message)}),V=()=>{S(""),A(""),l(""),U(""),G(""),B(""),v(null)},ts=()=>{if(!r||!I||!b||!F){i.error("يرجى ملء جميع الحقول المطلوبة");return}Z.mutate({platform:r,accountName:I,url:T||void 0,username:b,password:F,notes:H||void 0})},e=()=>{h&&R.mutate({id:h.id,platform:r||void 0,accountName:I||void 0,url:T||void 0,username:b||void 0,password:F||void 0,notes:H||void 0})},g=async a=>{const D=await t.socialMedia.getById.fetch({id:a.id});S(D.platform),A(D.accountName),l(D.url||""),U(D.username),G(D.password),B(D.notes||""),v(D),P(!0)},as=a=>{v(a),k(""),m(!0)},j=()=>
1{if(!y){i.error("يرجى إدخال رقم الهاتف");return}X.mutate({accountId:h.id,phoneNumber:y})},L=(a,D)=>{navigator.clipboard.writeText(a),i.success(`تم نسخ ${D}`)};return s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1272",className:"space-y-6",dir:"rtl",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1274",className:"flex items-center justify-between flex-wrap gap-3",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1275",children:[s.jsx("h2",{"data-loc":"client/src/pages/Settings.tsx:1276",className:"text-xl font-bold",children:"حسابات السوشيال ميديا والأنظمة"}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:1277",className:"text-muted-foreground text-sm mt-1",children:"أدر بيانات حسابات السوشيال ميديا والأنظمة وشاركها بسهولة عبر WhatsApp"})]}),s.jsxs(is,{"data-loc":"client/src/pages/Settings.tsx:1281",open:E,onOpenChange:a=>{P(a),a||V()},children:[s.jsx(Ds,{"data-loc":"client/src/pages/Settings.tsx:1285",asChild:!0,children:s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:1286",className:"gap-2",children:[s.jsx(Js,{"data-loc":"client/src/pages/Settings.tsx:1286",className:"w-4 h-4"}),"حساب جديد"]})}),s.jsxs(rs,{"data-loc":"client/src/pages/Settings.tsx:1288",className:"max-w-md",dir:"rtl",children:[s.jsx(os,{"data-loc":"client/src/pages/Settings.tsx:1289",children:s.jsx(ds,{"data-loc":"client/src/pages/Settings.tsx:1290",children:h?"تعديل الحساب":"إضافة حساب جديد"})}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1292",className:"space-y-4 pt-2",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1293",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1294",children:"المنصة/النظام *"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1295",placeholder:"مثال: Instagram, Facebook, Gmail, WhatsApp Business",value:r,onChange:a=>S(a.target.value)})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1302",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1303",children:"اسم الحساب *"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1304",placeholder:"مثال: حساب Instagram الرئيسي",value:I,onChange:a=>A(a.target.value)})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1311",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1312",children:"الرابط (اختياري)"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1313",placeholder:"https://instagram.com/beefinitive",value:T,onChange:a=>l(a.target.value)})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1320",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1321",children:"اليوزر نيم / البريد الإلكتروني *"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1322",placeholder:"[email protected]",value:b,onChange:a=>U(a.target.value)})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1329",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1330",children:"الباسوورد *"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1331",type:"password",placeholder:"••••••••",value:F,onChange:a=>G(a.target.value)})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1339",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1340",children:"ملاحظات (اختياري)"}),s.jsx(Ss,{"data-loc":"client/src/pages/Settings.tsx:1341",placeholder:"مثال: 2FA مفعل، بريد الاسترجاع: ...",value:H,onChange:a=>B(a.target.value),rows:3})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1349",className:"flex gap-2 justify-end",children:[s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1350",variant:"outline",onClick:()=>P(!1),children:"إلغاء"}),s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1351",onClick:h?e:ts,disabled:Z.isPending||R.isPending,children:h?"تحديث":"إنشاء"})]})]})]})]})]}),s.jsx(is,{"data-loc":"client/src/pages/Settings.tsx:1364",open:c,onOpenChange:m,children:s.jsxs(rs,{"data-loc":"client/src/pages/Settings.tsx:1365",className:"max-w-md",dir:"rtl",children:[s.jsx(os,{"data-loc":"client/src/pages/Settings.tsx:1366",children:s.jsx(ds,{"data-loc":"client/src/pages/Settings.tsx:1367",children:"إرسال البيانات عبر WhatsApp"})}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1369",className:"space-y-4 pt-2",children:[s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1370",className:"bg-muted/50 rounded-lg p-3 text-sm",children:[s.jsxs("p",{"data-loc":"client/src/pages/Settings.tsx:1371",className:"font-semibold mb-2",children:["الحساب: ",h?.accountName]}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:1372",className:"text-muted-foreground",children:"سيتم إرسال بيانات الحساب (الرابط، اليوزر نيم، الباسوورد) عبر WhatsApp"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1377",className:"space-y-2",children:[s.jsx(n,{"data-loc":"client/src/pages/Settings.tsx:1378",children:"رقم الهاتف (مع رمز الدولة) *"}),s.jsx(o,{"data-loc":"client/src/pages/Settings.tsx:1379",placeholder:"+966501234567",value:y,onChange:a=>k(a.target.value)}),s.jsx("p",{"data-loc":"client/src/pages/Settings.tsx:1384",className:"text-xs text-muted-foreground",children:"أدخل رقم الهاتف كاملاً مع رمز الدولة (مثال: +966 للسعودية)"})]}),s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1389",className:"flex gap-2 justify-end",children:[s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1390",variant:"outline",onClick:()=>m(!1),children:"إلغاء"}),s.jsxs(p,{"data-loc":"client/src/pages/Settings.tsx:1391",onClick:j,disabled:X.isPending,className:"gap-2",children:[s.jsx(Qs,{"data-loc":"client/src/pages/Settings.tsx:1396",className:"w-4 h-4"}),"إرسال عبر WhatsApp"]})]})]})]})}),s.jsxs(N,{"data-loc":"client/src/pages/Settings.tsx:1405",children:[s.jsx(w,{"data-loc":"client/src/pages/Settings.tsx:1406",children:s.jsxs(C,{"data-loc":"client/src/pages/Settings.tsx:1407",className:"flex items-center gap-2",children:[s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:1408",children:"الحسابات المحفوظة"}),s.jsx(ls,{"data-loc":"client/src/pages/Settings.tsx:1409",variant:"outline",children:x.length})]})}),s.jsx(f,{"data-loc":"client/src/pages/Settings.tsx:1412",children:ss?s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:1414",className:"text-center py-8 text-muted-foreground",children:"جاري التحميل..."}):x.length===0?s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:1416",className:"text-center py-8 text-muted-foreground",children:"لا توجد حسابات محفوظة"}):s.jsx("div",{"data-loc":"client/src/pages/Settings.tsx:1418",className:"overflow-x-auto",children:s.jsxs(Es,{"data-loc":"client/src/pages/Settings.tsx:1419",children:[s.jsx(Us,{"data-loc":"client/src/pages/Settings.tsx:1420",children:s.jsxs(gs,{"data-loc":"client/src/pages/Settings.tsx:1421",children:[s.jsx(O,{"data-loc":"client/src/pages/Settings.tsx:1422",children:"المنصة"}),s.jsx(O,{"data-loc":"client/src/pages/Settings.tsx:1423",children:"اسم الحساب"}),s.jsx(O,{"data-loc":"client/src/pages/Settings.tsx:1424",children:"اليوزر نيم"}),s.jsx(O,{"data-loc":"client/src/pages/Settings.tsx:1425",children:"الحالة"}),s.jsx(O,{"data-loc":"client/src/pages/Settings.tsx:1426",children:"الإجراءات"})]})}),s.jsx(Fs,{"data-loc":"client/src/pages/Settings.tsx:1429",children:x.map(a=>s.jsxs(gs,{"data-loc":"client/src/pages/Settings.tsx:1431",children:[s.jsx(_,{"data-loc":"client/src/pages/Settings.tsx:1432",className:"font-medium",children:a.platform}),s.jsx(_,{"data-loc":"client/src/pages/Settings.tsx:1433",children:a.accountName}),s.jsxs(_,{"data-loc":"client/src/pages/Settings.tsx:1434",className:"flex items-center gap-2",children:[s.jsx("span",{"data-loc":"client/src/pages/Settings.tsx:1435",children:a.username}),s.jsx("button",{"data-loc":"client/src/pages/Settings.tsx:1436",onClick:()=>L(a.username,"اليوزر نيم"),className:"text-muted-foreground hover:text-foreground",children:s.jsx(Xs,{"data-loc":"client/src/pages/Settings.tsx:1440",className:"w-4 h-4"})})]}),s.jsx(_,{"data-loc":"client/src/pages/Settings.tsx:1443",children:s.jsx(ls,{"data-loc":"client/src/pages/Settings.tsx:1444",variant:a.isActive?"default":"secondary",children:a.isActive?"نشط":"معطل"})}),s.jsx(_,{"data-loc":"client/src/pages/Settings.tsx:1448",children:s.jsxs("div",{"data-loc":"client/src/pages/Settings.tsx:1449",className:"flex gap-1",children:[s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1450",size:"sm",variant:"ghost",onClick:()=>es.mutate({id:a.id,isActive:!a.isActive}),children:a.isActive?s.jsx(Ks,{"data-loc":"client/src/pages/Settings.tsx:1455",className:"w-4 h-4"}):s.jsx(qs,{"data-loc":"client/src/pages/Settings.tsx:1455",className:"w-4 h-4"})}),s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1457",size:"sm",variant:"ghost",onClick:()=>g(a),children:"تعديل"}),s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1460",size:"sm",variant:"ghost",onClick:()=>as(a),children:s.jsx(se,{"data-loc":"client/src/pages/Settings.tsx:1461",className:"w-4 h-4"})}),s.jsx(p,{"data-loc":"client/src/pages/Settings.tsx:1463",size:"sm",variant:"ghost",onClick:()=>Q.mutate({id:a.id}),children:s.jsx(ee,{"data-loc":"client/src/pages/Settings.tsx:1468",className:"w-4 h-4 text-destructive"})})]})})]},a.id))})]})})})]})]})}export{be 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.