(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78917,e=>{"use strict";let t=(0,e.i(75254).default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],78917)},2155,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(78917),i=e.i(78583),r=e.i(31278),l=e.i(75254);let n=(0,l.default)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),d=(0,l.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var c=e.i(37727),o=e.i(75157);e.s(["SecureImageViewer",0,function({src:e,alt:l,mimeType:m="image/jpeg",className:h,imageClassName:u="h-full w-full object-cover"}){let[x,b]=(0,a.useState)(!1),[f,p]=(0,a.useState)(!0),[g,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(1),y=(m??"").startsWith("image/");return((0,a.useEffect)(()=>{if(!x)return;let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&b(!1)};return window.addEventListener("keydown",t),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[x]),y)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{b(!0),p(!0),v(!1),w(1)},className:(0,o.cn)("relative block overflow-hidden bg-[var(--surface-muted)]",h),"aria-label":`عرض ${l} بحجم كبير`,children:[(0,t.jsx)("img",{src:e,alt:l,className:u}),(0,t.jsx)("span",{className:"absolute inset-x-0 bottom-0 bg-black/65 px-3 py-2 text-xs font-bold text-white",children:"عرض الصورة"})]}),x?(0,t.jsx)("div",{className:"fixed inset-0 z-50 grid overflow-y-auto bg-black/80 p-3 sm:p-6",role:"dialog","aria-modal":"true","aria-label":l,onMouseDown:e=>{e.target===e.currentTarget&&b(!1)},children:(0,t.jsxs)("div",{className:"mx-auto flex h-full max-h-[calc(100dvh-1.5rem)] w-full min-w-0 max-w-6xl flex-col overflow-hidden rounded-md bg-white sm:max-h-[calc(100dvh-3rem)]",children:[(0,t.jsxs)("div",{className:"flex min-h-14 min-w-0 items-center justify-between gap-2 border-b px-2 sm:gap-3 sm:px-4",children:[(0,t.jsx)("p",{className:"min-w-0 truncate text-sm font-black",children:l}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>w(e=>Math.max(1,e-.25)),className:"grid size-10 shrink-0 place-items-center rounded-md hover:bg-[var(--surface-muted)]",title:"تصغير","aria-label":"تصغير الصورة",children:(0,t.jsx)(n,{size:18,"aria-hidden":!0})}),(0,t.jsx)("button",{type:"button",onClick:()=>w(e=>Math.min(4,e+.25)),className:"grid size-10 shrink-0 place-items-center rounded-md hover:bg-[var(--surface-muted)]",title:"تكبير","aria-label":"تكبير الصورة",children:(0,t.jsx)(d,{size:18,"aria-hidden":!0})}),(0,t.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"grid size-10 shrink-0 place-items-center rounded-md hover:bg-[var(--surface-muted)]",title:"فتح بالحجم الأصلي","aria-label":"فتح الصورة بالحجم الأصلي",children:(0,t.jsx)(s.ExternalLink,{size:18,"aria-hidden":!0})}),(0,t.jsx)("button",{type:"button",onClick:()=>b(!1),className:"grid size-10 shrink-0 place-items-center rounded-md hover:bg-[var(--surface-muted)]",title:"إغلاق","aria-label":"إغلاق عارض الصورة",children:(0,t.jsx)(c.X,{size:20,"aria-hidden":!0})})]})]}),(0,t.jsxs)("div",{className:"relative min-h-0 flex-1 overflow-auto bg-[#111815] touch-pan-x touch-pan-y",children:[f?(0,t.jsx)("div",{className:"absolute inset-0 z-10 grid place-items-center text-white",children:(0,t.jsxs)("div",{className:"grid justify-items-center gap-3 text-sm font-bold",children:[(0,t.jsx)(r.Loader2,{size:28,className:"animate-spin","aria-hidden":!0}),"جارٍ تحميل الصورة..."]})}):null,g?(0,t.jsx)("div",{className:"absolute inset-0 z-10 grid place-items-center p-5 text-center text-sm font-bold text-white",children:"تعذر تحميل الصورة. تحقق من الاتصال والصلاحيات ثم أعد المحاولة."}):null,(0,t.jsx)("img",{src:e,alt:l,onLoad:()=>p(!1),onError:()=>{p(!1),v(!0)},className:"mx-auto block max-w-none origin-top object-contain transition-transform",style:{transform:`scale(${j})`,width:1===j?"100%":"auto",minHeight:"100%"}})]})]})}):null]}):(0,t.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:(0,o.cn)("grid place-items-center bg-[var(--surface-muted)] text-[var(--primary)]",h),title:"فتح الملف",children:(0,t.jsx)(i.FileText,{size:30,"aria-hidden":!0})})}],2155)}]);