module.exports=[33095,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={default:function(){return k},getImageProps:function(){return j}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});let f=a.r(33354),g=a.r(94915),h=a.r(67161),i=f._(a.r(2305));function j(a){let{props:b}=(0,g.getImgProps)(a,{defaultLoader:i.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[a,c]of Object.entries(b))void 0===c&&delete b[a];return{props:b}}let k=h.Image},71987,(a,b,c)=>{b.exports=a.r(33095)},51235,a=>{"use strict";var b=a.i(87924),c=a.i(15925),d=a.i(71987),e=a.i(72131);a.s(["AdminGalleryManager",0,function(){let a=(0,c.useTranslations)("admin"),[f,g]=(0,e.useState)([]),[h,i]=(0,e.useState)(!0);async function j(){let a=await fetch("/api/admin/gallery");a.ok&&g(await a.json())}async function k(a){let b={url:String(a.get("url")??""),altEn:String(a.get("altEn")??""),altAr:String(a.get("altAr")??""),altRu:String(a.get("altRu")??""),altIt:String(a.get("altIt")??"")};(await fetch("/api/admin/gallery",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b)})).ok&&await j()}async function l(a){confirm("Delete?")&&(await fetch(`/api/admin/gallery?id=${encodeURIComponent(a)}`,{method:"DELETE"}),await j())}return((0,e.useEffect)(()=>{(async()=>{await j(),i(!1)})()},[]),h)?(0,b.jsx)("p",{className:"text-muted",children:"…"}):(0,b.jsxs)("div",{className:"space-y-10",children:[(0,b.jsx)("p",{className:"text-sm text-muted",children:a("galleryLead")}),(0,b.jsxs)("form",{onSubmit:async a=>{a.preventDefault();let b=new FormData(a.currentTarget);await k(b),a.currentTarget.reset()},className:"grid gap-3 rounded-xl border border-border bg-card/40 p-6 md:grid-cols-2",children:[(0,b.jsxs)("div",{className:"md:col-span-2",children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("url")}),(0,b.jsx)("input",{required:!0,name:"url",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm",placeholder:"https://…"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("altEn")}),(0,b.jsx)("input",{name:"altEn",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("altAr")}),(0,b.jsx)("input",{name:"altAr",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("altRu")}),(0,b.jsx)("input",{name:"altRu",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"mb-1 block text-sm text-muted",children:a("altIt")}),(0,b.jsx)("input",{name:"altIt",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,b.jsx)("div",{className:"md:col-span-2",children:(0,b.jsx)("button",{type:"submit",className:"rounded-md bg-gold px-4 py-2 text-sm font-medium text-background",children:a("addImage")})})]}),0===f.length?(0,b.jsx)("p",{className:"text-muted",children:a("noImages")}):(0,b.jsx)("ul",{className:"grid gap-6 md:grid-cols-2",children:f.map(c=>(0,b.jsxs)("li",{className:"overflow-hidden rounded-xl border border-border bg-card/30",children:[(0,b.jsx)("div",{className:"relative aspect-video w-full bg-background",children:(0,b.jsx)(d.default,{src:c.url,alt:c.altEn||"img",fill:!0,className:"object-cover",unoptimized:!0})}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2 p-3",children:[(0,b.jsx)("p",{className:"truncate text-xs text-muted",children:c.url}),(0,b.jsx)("button",{type:"button",onClick:()=>l(c.id),className:"shrink-0 text-sm text-red-400 hover:underline",children:a("delete")})]})]},c.id))})]})}])}];

//# sourceMappingURL=_0r_vegy._.js.map