PageSourceSearch

https://www.emirates247.com/assets/GalleryWidget-Dr3sXpkg.js

js emirates247.com collected 2026-09-24 09:16:37 UTC 4,048 bytes, 1 lines download raw bytes

1import{a as i,j as t}from"./vendor-react-CDFIE44H.js";import{u as p}from"./vendor-query-B9sxao7i.js";import{L as f}from"./vendor-router-nJKcHAGV.js";import{R as y,f as j}from"./index-OPY5UkRl.js";import{z as v,f as w,e as N}from"./vendor-icons-BsQZz6Pl.js";import"./vendor-radix-Cxb7F2zo.js";import"./vendor-utils-DSOPSYhy.js";function G({article:m}={}){const{data:g}=p({...y(),enabled:m===void 0}),r=m??g?.articles?.[0],[a,u]=i.useState(0),[b,x]=i.useState(!1),n=r?.galleryImages,s=n?.length||0,o=i.useCallback(l=>{b||s===0||(x(!0),u((l+s)%s),setTimeout(()=>x(!1),400))},[b,s]),c=i.useCallback(()=>o(a+1),[o,a]),h=i.useCallback(()=>o(a-1),[o,a]);if(i.useEffect(()=>{if(s<=1)return;const l=setInterval(c,5e3);return()=>clearInterval(l)},[c,s]),!r||!n||s<2)return null;const d=n[a];return t.jsxs("section",{className:"mb-12","data-testid":"gallery-widget",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-5 border-b-2 border-primary pb-2",children:[t.jsx(v,{className:"w-5 h-5 text-primary"}),t.jsx("h2",{className:"text-xl font-bold uppercase tracking-wide text-primary","data-testid":"text-gallery-widget-title",children:"Photo Gallery"})]}),t.jsxs("div",{className:"bg-slate-950 rounded-lg overflow-hidden shadow-xl",children:[t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"relative w-full aspect-[16/9] overflow-hidden",children:n.map((l,e)=>t.jsx("div",{className:`absolute inset-0 transition-opacity duration-500 ease-in-out ${e===a?"opacity-100 z-10":"opacity-0 z-0"}`,children:t.jsx("img",{src:l.url,alt:l.caption||`Slide ${e+1}`,style:{objectFit:"contain",width:"100%",height:"100%",background:"rgb(3 7 18)"},loading:e===0?"eager":"lazy","data-testid":`img-gallery-slide-${e}`})},e))}),t.jsx("div",{className:"absolute top-0 left-0 right-0 bg-gradient-to-b from-black/70 via-black/30 to-transparent p-4 md:p-6 z-20",children:t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex-1 pr-4",children:[t.jsx(f,{href:j(r),className:"text-white font-bold text-lg md:text-xl leading-tight hover:text-primary/90 transition-colors line-clamp-2","data-testid":"link-gallery-article",children:r.title}),r.sectionName&&t.jsx("span",{className:"inline-block mt-2 bg-primary text-white text-[10px] font-bold uppercase px-2 py-0.5 rounded-sm","data-testid":"text-gallery-section",children:r.sectionName})]}),t.jsxs("span",{className:"text-white/80 text-sm font-mono bg-black/40 px-2 py-1 rounded shrink-0","data-testid":"text-gallery-counter",children:[a+1," / ",s]})]})}),t.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4 md:p-6 z-20",children:[t.jsx("p",{className:"text-white/90 text-sm md:text-base leading-relaxed transition-opacity duration-300 min-h-[2.5rem]","data-testid":"text-gallery-caption",children:d.caption||""}),d.credit&&t.jsx("p",{className:"text-white/50 text-xs mt-1","data-testid":"text-gallery-credit",children:d.credit})]}),t.jsx("button",{onClick:h,className:"absolute left-3 top-1/2 -translate-y-1/2 z-30 w-10 h-10 rounded-full bg-black/50 hover:bg-black/80 text-white flex items-center justify-center transition-all backdrop-blur-sm border border-white/10","aria-label":"Previous slide","data-testid":"button-gallery-prev",children:t.jsx(w,{className:"w-5 h-5"})}),t.jsx("button",{onClick:c,className:"absolute right-3 top-1/2 -translate-y-1/2 z-30 w-10 h-10 rounded-full bg-black/50 hover:bg-black/80 text-white flex items-center justify-center transition-all backdrop-blur-sm border border-white/10","aria-label":"Next slide","data-testid":"button-gallery-next",children:t.jsx(N,{className:"w-5 h-5"})})]}),t.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-slate-900",children:n.map((l,e)=>t.jsx("button",{onClick:()=>o(e),className:`transition-all duration-300 rounded-full ${e===a?"w-6 h-2 bg-primary":"w-2 h-2 bg-white/30 hover:bg-white/60"}`,"aria-label":`Go to slide ${e+1}`,"data-testid":`button-gallery-dot-${e}`},e))})]})]})}export{G 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.