(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,94909,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0});var r={default:function(){return o},getImageProps:function(){return c}};for(var l in r)Object.defineProperty(a,l,{enumerable:!0,get:r[l]});let s=e.r(55682),d=e.r(8927),n=e.r(5500),i=s._(e.r(1948));function c(e){let{props:t}=(0,d.getImgProps)(e,{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[e,a]of Object.entries(t))void 0===a&&delete t[e];return{props:t}}let o=n.Image},57688,(e,t,a)=>{t.exports=e.r(94909)},24791,e=>{"use strict";var t=e.i(43476),a=e.i(48148),r=e.i(57688),l=e.i(71645);e.s(["AdminGalleryManager",0,function(){let e=(0,a.useTranslations)("admin"),[s,d]=(0,l.useState)([]),[n,i]=(0,l.useState)(!0);async function c(){let e=await fetch("/api/admin/gallery");e.ok&&d(await e.json())}async function o(e){let t={url:String(e.get("url")??""),altEn:String(e.get("altEn")??""),altAr:String(e.get("altAr")??""),altRu:String(e.get("altRu")??""),altIt:String(e.get("altIt")??"")};(await fetch("/api/admin/gallery",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok&&await c()}async function m(e){confirm("Delete?")&&(await fetch(`/api/admin/gallery?id=${encodeURIComponent(e)}`,{method:"DELETE"}),await c())}return((0,l.useEffect)(()=>{(async()=>{await c(),i(!1)})()},[]),n)?(0,t.jsx)("p",{className:"text-muted",children:"…"}):(0,t.jsxs)("div",{className:"space-y-10",children:[(0,t.jsx)("p",{className:"text-sm text-muted",children:e("galleryLead")}),(0,t.jsxs)("form",{onSubmit:async e=>{e.preventDefault();let t=new FormData(e.currentTarget);await o(t),e.currentTarget.reset()},className:"grid gap-3 rounded-xl border border-border bg-card/40 p-6 md:grid-cols-2",children:[(0,t.jsxs)("div",{className:"md:col-span-2",children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("url")}),(0,t.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,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("altEn")}),(0,t.jsx)("input",{name:"altEn",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("altAr")}),(0,t.jsx)("input",{name:"altAr",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("altRu")}),(0,t.jsx)("input",{name:"altRu",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"mb-1 block text-sm text-muted",children:e("altIt")}),(0,t.jsx)("input",{name:"altIt",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm"})]}),(0,t.jsx)("div",{className:"md:col-span-2",children:(0,t.jsx)("button",{type:"submit",className:"rounded-md bg-gold px-4 py-2 text-sm font-medium text-background",children:e("addImage")})})]}),0===s.length?(0,t.jsx)("p",{className:"text-muted",children:e("noImages")}):(0,t.jsx)("ul",{className:"grid gap-6 md:grid-cols-2",children:s.map(a=>(0,t.jsxs)("li",{className:"overflow-hidden rounded-xl border border-border bg-card/30",children:[(0,t.jsx)("div",{className:"relative aspect-video w-full bg-background",children:(0,t.jsx)(r.default,{src:a.url,alt:a.altEn||"img",fill:!0,className:"object-cover",unoptimized:!0})}),(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 p-3",children:[(0,t.jsx)("p",{className:"truncate text-xs text-muted",children:a.url}),(0,t.jsx)("button",{type:"button",onClick:()=>m(a.id),className:"shrink-0 text-sm text-red-400 hover:underline",children:e("delete")})]})]},a.id))})]})}])}]);