1import{r as l,a as e}from"./vendor-react-C1glsnoj.js";import{t as g}from"./index-rokofqb8.js";import{B as y}from"./button-4k_hJVwb.js";import{I as b}from"./input-D6LmcxeZ.js";import{T as N}from"./textarea-Bc3RCgV1.js";import{C as k,b as w,c as C,a as T}from"./card-Cs36IzNN.js";import"./vendor-trpc-Cnk-TBCP.js";import"./vendor-utils-Sp7XtC9M.js";import"./vendor-ui-BTnkxrjv.js";import"./dialog-BJjva6Ij.js";import"./x-ghMSOeu7.js";import"./createLucideIcon-Dh4KttaU.js";import"./usePersistFn-B16_zDMm.js";const f=[{route:"/",label:"Ø§ÙØµÙØØ© Ø§ÙØ±Ø¦ÙØ³ÙØ©"},{route:"/destinations",label:"اÙÙØ¬Ùات Ø§ÙØ³ÙاØÙØ©"},{route:"/offers",label:"Ø§ÙØ¹Ø±Ùض"},{route:"/services",label:"خدÙ
ات Ø³ÙØ§ØÙØ©"},{route:"/payment",label:"Ø·Ø±Ù Ø§ÙØ¯Ùع"},{route:"/news",label:"دÙÙ٠اÙÙ
Ø³Ø§ÙØ±"},{route:"/terms",label:"Ø§ÙØ´Ø±ÙØ· ÙØ§ÙØ£ØÙاÙ
"},{route:"/blog",label:"اÙÙ
دÙÙØ©"}];function E({title:n,description:r,url:o}){return e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:28",className:"bg-white rounded-lg p-4 mb-4 text-right",dir:"rtl",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:29",className:"flex items-center gap-2 mb-1",children:[e.jsx("img",{"data-loc":"client/src/pages/AdminPageSeo.tsx:30",src:"/manus-storage/favicon-32x32_1db550b7.png",alt:"",className:"w-5 h-5 rounded-full"}),e.jsx("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:31",className:"text-sm text-gray-600",children:"sedratravel.com"}),e.jsx("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:32",className:"text-xs text-gray-400",children:o})]}),e.jsx("h3",{"data-loc":"client/src/pages/AdminPageSeo.tsx:34",className:"text-[#1a0dab] text-lg font-normal leading-tight mb-1 line-clamp-1",children:n||"عÙÙØ§Ù Ø§ÙØµÙØØ©"}),e.jsx("p",{"data-loc":"client/src/pages/AdminPageSeo.tsx:37",className:"text-sm text-gray-600 leading-relaxed line-clamp-2",children:r||"ÙØµÙ Ø§ÙØµÙØØ© Ø³ÙØ¸Ùر ÙÙØ§..."})]})}function O(){const{data:n,isLoading:r}=g.admin.settings.list.useQuery(),o=g.admin.settings.save.useMutation(),x=g.useUtils(),[p,u]=l.useState({}),[h,S]=l.useState(!1),[A,d]=l.useState("");l.useEffect(()=>{if(!n)return;const t={};for(const s of f){const a=`pageSeo:${s.route}:`,i=n.find(c=>c.settingKey===a+"title")?.settingValue||"",j=n.find(c=>c.settingKey===a+"description")?.settingValue||"",v=n.find(c=>c.settingKey===a+"keywords")?.settingValue||"";t[s.route]={title:i,description:j,keywords:v}}u(t)},[n]);const m=(t,s,a)=>{u(i=>({...i,[t]:{...i[t],[s]:a}}))},P=async t=>{S(!0),d("");const s=`pageSeo:${t}:`,a=p[t];if(a)try{await o.mutateAsync({settings:[{key:s+"title",value:a.title},{key:s+"description",value:a.description},{key:s+"keywords",value:a.keywords}]}),await x.admin.settings.list.invalidate(),await x.settings.getAll.invalidate(),d(t),setTimeout(()=>d(""),3e3)}catch(i){console.error("Save error:",i)}finally{S(!1)}};return r?e.jsx("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:102",className:"flex items-center justify-center min-h-[400px]",children:e.jsx("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:103",className:"animate-spin w-8 h-8 border-2 border-sedra-cyan border-t-transparent rounded-full"})}):e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:109",className:"space-y-6",dir:"rtl",children:[e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:110",children:[e.jsx("h1",{"data-loc":"client/src/pages/AdminPageSeo.tsx:111",className:"text-2xl font-bold text-cream",children:"إعدادات SEO ÙÙØµÙØØ§Øª"}),e.jsx("p",{"data-loc":"client/src/pages/AdminPageSeo.tsx:112",className:"text-muted-foreground mt-1",children:"تØÙÙ
Ù٠عÙÙØ§Ù ÙÙØµÙ ÙÙÙÙ
ات Ù
ÙØªØ§ØÙØ© ÙÙ ØµÙØØ© ثابتة ÙÙ
ا ØªØ¸ÙØ± ÙÙ ÙØªØ§Ø¦Ø¬ Ø¨ØØ« Ø¬ÙØ¬Ù"})]}),e.jsx("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:115",className:"space-y-6",children:f.map(t=>{const s=p[t.route]||{title:"",description:"",keywords:""};return e.jsxs(k,{"data-loc":"client/src/pages/AdminPageSeo.tsx:119",className:"bg-card border-border",children:[e.jsx(w,{"data-loc":"client/src/pages/AdminPageSeo.tsx:120",className:"pb-3",children:e.jsxs(C,{"data-loc":"client/src/pages/AdminPageSeo.tsx:121",className:"text-lg flex items-center justify-between",children:[e.jsx("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:122",children:t.label}),e.jsx("code",{"data-loc":"client/src/pages/AdminPageSeo.tsx:123",className:"text-xs text-muted-foreground bg-muted px-2 py-1 rounded",dir:"ltr",children:t.route})]})}),e.jsxs(T,{"data-loc":"client/src/pages/AdminPageSeo.tsx:128",className:"space-y-4",children:[e.jsx(E,{"data-loc":"client/src/pages/AdminPageSeo.tsx:130",title:s.title,de
1scription:s.description,url:t.route==="/"?"":t.route}),e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:136",children:[e.jsxs("label",{"data-loc":"client/src/pages/AdminPageSeo.tsx:137",className:"text-sm font-medium text-cream mb-1 block",children:["عÙÙØ§Ù Ø§ÙØµÙØØ© (Title Tag)",e.jsxs("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:139",className:"text-muted-foreground mr-2 text-xs",children:["(",s.title.length,"/60 ØØ±Ù)"]})]}),e.jsx(b,{"data-loc":"client/src/pages/AdminPageSeo.tsx:141",value:s.title,onChange:a=>m(t.route,"title",a.target.value),placeholder:"عÙÙØ§Ù Ø§ÙØµÙØØ© ÙÙ
ا ÙØ¸Ùر ÙÙ Ø¬ÙØ¬Ù",className:"bg-background",maxLength:70})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:150",children:[e.jsxs("label",{"data-loc":"client/src/pages/AdminPageSeo.tsx:151",className:"text-sm font-medium text-cream mb-1 block",children:["ÙØµÙ Ø§ÙØµÙØØ© (Meta Description)",e.jsxs("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:153",className:"text-muted-foreground mr-2 text-xs",children:["(",s.description.length,"/155 ØØ±Ù)"]})]}),e.jsx(N,{"data-loc":"client/src/pages/AdminPageSeo.tsx:155",value:s.description,onChange:a=>m(t.route,"description",a.target.value),placeholder:"ÙØµÙ Ù
ختصر ÙØ¸Ùر أسÙÙ Ø§ÙØ¹ÙÙØ§Ù ÙÙ ÙØªØ§Ø¦Ø¬ Ø§ÙØ¨ØØ«",className:"bg-background resize-none",rows:3,maxLength:160})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:165",children:[e.jsx("label",{"data-loc":"client/src/pages/AdminPageSeo.tsx:166",className:"text-sm font-medium text-cream mb-1 block",children:"اÙÙÙÙ
ات اÙÙ
ÙØªØ§ØÙØ© (3-8 ÙÙÙ
ات Ù
ÙØµÙÙØ© Ø¨ÙØ§ØµÙØ©)"}),e.jsx(b,{"data-loc":"client/src/pages/AdminPageSeo.tsx:169",value:s.keywords,onChange:a=>m(t.route,"keywords",a.target.value),placeholder:"ÙÙÙ
Ø© 1, ÙÙÙ
Ø© 2, ÙÙÙ
Ø© 3",className:"bg-background"})]}),e.jsxs("div",{"data-loc":"client/src/pages/AdminPageSeo.tsx:177",className:"flex items-center gap-3",children:[e.jsx(y,{"data-loc":"client/src/pages/AdminPageSeo.tsx:178",onClick:()=>P(t.route),disabled:h,size:"sm",children:h?"Ø¬Ø§Ø±Ù Ø§ÙØÙØ¸...":"ØÙظ"}),A===t.route&&e.jsx("span",{"data-loc":"client/src/pages/AdminPageSeo.tsx:186",className:"text-green-400 text-sm",children:"â ØªÙ
Ø§ÙØÙØ¸ Ø¨ÙØ¬Ø§Ø"})]})]})]},t.route)})})]})}export{O 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.