PageSourceSearch

https://www.emirates247.com/assets/Article-DB5YVZSt.js

js emirates247.com collected 2026-09-24 09:16:41 UTC 28,358 bytes, 1 lines download raw bytes

1import{a as d,j as e}from"./vendor-react-CDFIE44H.js";import{a as we,L as v}from"./vendor-router-nJKcHAGV.js";import{u as I}from"./vendor-query-B9sxao7i.js";import{a as je,b as ye,g as le,c as oe,d as ae,r as ve,e as Ne,f as R,L as G,S as ke,h as C,i as Se,j as Ee,A as Ie,k as Re,l as Te,m as re,o as Ae,D as J,p as Le,P as Ce}from"./index-OPY5UkRl.js";import{P as $e}from"./PageBreadcrumb-D0Q-otY_.js";import{L as _e,F as De,g as Pe,h as Be,f as Ue,e as Me}from"./vendor-icons-BsQZz6Pl.js";import"./vendor-radix-Cxb7F2zo.js";import"./vendor-utils-DSOPSYhy.js";function ce({images:t,title:r}){const[a,l]=d.useState(0),[c,m]=d.useState(new Set),g=d.useRef(0),b=()=>l(s=>s===0?t.length-1:s-1),w=()=>l(s=>s===t.length-1?0:s+1),h=t[a],N=c.has(a);return e.jsxs("div",{className:"mb-8","data-testid":"gallery-slider",children:[e.jsxs("div",{className:"relative w-full aspect-[16/9] rounded-sm overflow-hidden bg-slate-100 dark:bg-slate-800 flex items-center justify-center",onTouchStart:s=>{g.current=s.touches[0].clientX},onTouchEnd:s=>{const u=g.current-s.changedTouches[0].clientX;Math.abs(u)>50&&(u>0?w():b())},children:[N?e.jsx(J,{}):e.jsx("img",{src:h.url,alt:h.caption||`${r} - Image ${a+1}`,className:"img-fill",loading:a===0?"eager":"lazy",fetchPriority:a===0?"high":void 0,"data-testid":`img-gallery-${a}`,onError:()=>m(s=>new Set(s).add(a))}),e.jsx("button",{onClick:b,className:"absolute left-2 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-black/50 hover:bg-black/70 text-white flex items-center justify-center transition-colors z-20","data-testid":"button-gallery-prev","aria-label":"Previous image",children:e.jsx(Ue,{className:"w-6 h-6"})}),e.jsx("button",{onClick:w,className:"absolute right-2 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-black/50 hover:bg-black/70 text-white flex items-center justify-center transition-colors z-20","data-testid":"button-gallery-next","aria-label":"Next image",children:e.jsx(Me,{className:"w-6 h-6"})}),e.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-black/60 text-white text-xs font-bold px-3 py-1 rounded-full z-20","data-testid":"text-gallery-counter",children:[a+1," / ",t.length]})]}),(h.caption||h.credit)&&!N&&e.jsxs("p",{className:"text-xs text-slate-500 mt-2 text-left",children:[h.caption&&e.jsx("span",{children:h.caption}),h.credit&&e.jsxs("span",{children:[" | Credit: ",h.credit]})]}),e.jsx("div",{className:"flex gap-1.5 mt-3 overflow-x-auto pb-2",children:t.map((s,u)=>e.jsx("button",{onClick:()=>l(u),className:`shrink-0 w-16 h-12 rounded overflow-hidden border-2 transition-colors ${u===a?"border-primary":"border-transparent opacity-60 hover:opacity-100"}`,"data-testid":`button-gallery-thumb-${u}`,children:e.jsx("img",{src:s.url,alt:s.caption||`Thumbnail ${u+1}`,className:"w-full h-full object-cover",loading:"lazy"})},u))})]})}const Oe=new Set(["a","an","the","and","or","but","in","on","at","to","for","of","with","by","from","is","it","its","as","are","
1was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","not","no","nor","so","if","then","than","that","this","these","those","what","which","who","whom","how","when","where","why","all","each","every","both","few","more","most","other","some","such","only","own","same","too","very","just","also","into","over","after","before","between","under","up","out","about","says","said","new","vs","per","via","amid","during","against","among"]);function ie(t){if(!t)return[];const r=t.replace(/[^a-zA-Z0-9\s'-]/g,"").split(/\s+/).filter(a=>a.length>2&&!Oe.has(a.toLowerCase())).map(a=>a.charAt(0).toUpperCase()+a.slice(1));return Array.from(new Set(r)).slice(0,8)}function Fe(t,r){if(!t)return["",""];let a=0,l=0;for(;l<t.length;){const c=t.indexOf("</p>",l);if(c===-1)break;if(a++,a>=r)return[t.slice(0,c+4),t.slice(c+4)];l=c+4}return[t,""]}function ze(t){const r=[],a=/<div\s+class="e247-inline-carousel"\s+data-images='([^']*(?:&#39;[^']*)*)'><\/div>/gi;let l=0,c;for(;(c=a.exec(t))!==null;){c.index>l&&r.push({type:"html",content:t.slice(l,c.index)});try{const m=JSON.parse(c[1].replace(/&#39;/g,"'"));m.length>0&&r.push({type:"carousel",images:m})}catch{}l=c.index+c[0].length}return l<t.length&&r.push({type:"html",content:t.slice(l)}),r}function ne({html:t,title:r}){const a=ze(t);return e.jsx(e.Fragment,{children:a.map((l,c)=>l.type==="html"?l.content?e.jsx(He,{html:l.content},c):null:e.jsx("div",{className:"not-prose my-6",children:e.jsx(ce,{images:l.images,title:r})},c))})}function He({html:t}){const r=d.useRef(null);return d.useEffect(()=>{const a=r.current;a&&(a.innerHTML=t,Je(t,a))},[t]),e.jsx("div",{ref:r})}function Qe({articleId:t}){const r=d.useRef(null);return d.useEffect(()=>{const a=r.current;if(!a)return;const l=a.nextElementSibling;l?.tagName==="SCRIPT"&&l.src.includes("npxai.newspublish.org")&&l.remove();const c=document.createElement("script");return c.src="https://npxai.newspublish.org/api/widget-compact.js",c.setAttribute("data-article-url",""),c.setAttribute("data-title-selector","h1"),c.setAttribute("data-body-selector","article"),c.async=!0,a.parentNode?.insertBefore(c,a.nextSibling),()=>{c.remove()}},[t]),e.jsx("div",{ref:r,id:`ai-engine-widget-${t}`,className:"not-prose mt-6 mb-[10px]"})}function Ge({articles:t}){return e.jsxs("div",{className:"not-prose my-8","data-testid":"section-inline-related",children:[e.jsx("span",{className:"text-primary text-sm font-bold uppercase tracking-wider mb-4 block",children:"Read Also"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-4 border-t border-slate-200 dark:border-slate-700 pt-4",children:t.map((r,a)=>e.jsxs(v,{href:R(r),className:`group flex items-start gap-3 flex-1 min-w-0${a>=2?" hidden sm:flex":""}`,"data-testid":`link-inline-related-${r.id}`,children:[r.image?e.jsx("div",{className:"shrink-0 rounded overflow-hidden",style:{width:130,height:73,backgroundImage:`url(${r.image})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",flexShrink:0},role:"img","aria-label":r.title}):e.jsx("div",{className:"shrink-0 rounded overflow-hidden relative",style:{width:130,height:73,flexShrink:0},children:e.jsx(J,{})}),e.jsx("p",{className:"text-sm font-semibold leading-snug line-clamp-3 text-slate-800 dark:text-slate-200 group-hover:text-primary transition-colors min-w-0",children:r.title})]},r.id))})]})}function Je(t,r){try{const a=t.toLowerCase();if(a.includes("twitter-tweet")||a.includes("twitter.com")||a.includes("x.com")){const l=()=>{try{if(!r?.isConnected)return!0;const m=window.twttr;return typeof m?.widgets?.load!="function"?!1:(m.widgets.load(r),!0)}catch{return!1}},c=()=>{if(l())return;let m=0;const g=window.setInterval(()=>{m+=1,(l()||m>=50)&&window.clearInterval(g)},100)};if(!l()&&!document.querySelector('script[src*="platform.twitter.com/widgets.js"]')){const m=document.createElement("script");m.src="https://platform.twitter.com/widgets.js",m.async=!0,m.charset="utf-8",m.onload=c,m.onerror=()=>{},document.head.appendChild(m)}c()}}catch{}try{if(t.includes("instagram.com/p/")||t.includes("instagram-media")||t.includes("embed-instagram")){const a=window.instgrm;if(a?.Embeds?.process)try{a.Embeds.process()}catch{}else if(!document.querySelector('script[src*="instagram.com/embed.js"]')){const l=document.createElement("script");l.src="https://www.instagram.com/embed.js",l.async=!0,l.onerror=()=>{},document.head.appendChild(l)}}}catch{}try{if((t.includes("truthsocial.com")||t.includes("mastodon-embed")||t.includes("embed-truthsocial"))&&!document.querySelector('script[src*="truthsocial.com/embed.js"]')){const a=document.createElement("script");a.src="https://truthsocial.com/embed.js",a.async=!0,a.onerror=()=>{},document.head.appendChild(a)}}catch{}}function We({article:t,textSize:r,onTextSizeChange:a,isFirst:l,aiWidgetEnabled:c}){const[m,g]=d.useState(!1),b=oe(t.sectionId),w=le(t.sectionId),h=R(t);d.useEffect(()=>{g(!1)},[t.id]);const[N,s]=Fe(t.body,3);return e.jsxs("article",{className:"article-entry","data-article-id":t.id,"data-article-url":h,"data-article-title":t.seoTitle||t.title,children:[e.jsx($e,{items:[{name:b,href:`/${w}`},{name:t.title}],className:"mb-3 text-xs"}),e.jsxs("div",{className:"mb-4 flex items-center gap-2 flex-wrap",children:[e.jsx(v,{href:`/${w}`,className:`text-primary font-bold text-sm tracking-wider hover:underline ${b==="Dubai-it"?"":"uppercase"}`,"data-testid":"link-article-section",children:b}),t.isExclusive&&e.jsx("span",{className:"bg-amber-500 text-white text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-sm","data-testid":"label-exclusive",children:"Exclusive"}),t.isBreakingNews&&e.jsx("span",{className:"bg-primary text-white text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-sm","data-testid":"label-breaking-news",children:"Breaking News"}),t.isLiveBlog&&e.jsxs("span",{className:"bg-primary text-white text-[10px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-sm flex items-center gap-1","data-testid":"label-live-blog",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse inline-block"}),"Live"]})]}),e.jsx("h1",{className:"text-3xl md:text-5xl font-serif font-bold leading-tight mb-6 text-slate-900 dark:text-white","data-testid":"text-article-title",children:t.title}),t.subtitle&&e.jsx("p",{className:"text-xl text-muted-foreground mb-4 font-serif italic",children:t.subtitle}),t.authorId>0&&t.authorInfo&&Object.keys(t.authorInfo).length>0&&e.jsxs(v,{href:Te(t.authorName,t.authorId),className:"flex items-center gap-3 mb-4 group","data-testid":"author-card",children:[t.authorInfo.author_image&&e.jsx("img",{src:t.authorInfo.author_image,alt:t.authorName,className:"w-[60px] h-[60px] rounded-full object-cover border border-slate-200 group-hover:border-primary transition-colors",width:60,height:60,loading:"lazy",decoding:"async","data-testid":"img-author-avatar"}),e.jsx("span",{className:"text-lg font-semibold text-slate-800 dark:text-slate-200 group-hover:text-primary transition-colors","data-testid":"text-article-author",children:t.authorName})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between border-y border-slate-200 py-3 mb-6 gap-4",children:[e.jsxs("div",{className:"text-sm text-slate-600 font-medium flex items-center gap-4",children:[t.authorId<=0&&t.authorName&&e.jsxs("span",{"data-testid":"text-article-author-inline",children:["By ",t.authorName]}),e.jsxs("span",{"data-testid":"text-article-date",children:["Publish time: ",re(t.publishTime)]}),Ae(t)&&e.jsxs("span",{"data-testid":"text-article-modified",children:["Last edited: ",re(t.modifiedTime)]}),t.timeReading>0&&e.jsxs("span",{children:[t.timeReading," min read"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold uppercase text-slate-500 mr-2",children:"Share"}),e.jsx("button",{onClick:()=>window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(window.location.href)}`,"_blank"),className:"w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white hover:opacity-90 transition-opacity",title:"Share on Facebook","data-testid":"button-share-facebook",children:e.jsx(De,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(window.location.href)}&text=${encodeURIComponent(t.title)}`,"_blank"),className:"w-8 h-8 rounded-full bg-black flex items-center justify-center text-white hover:opacity-90 transition-opacity",title:"Share on X","data-testid":"button-share-x",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 22.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),e.jsx("button",{onClick:()=>
1window.open(`https://api.whatsapp.com/send?text=${encodeURIComponent(t.title+" "+window.location.href)}`,"_blank"),className:"w-8 h-8 rounded-full bg-green-500 flex items-center justify-center text-white hover:opacity-90 transition-opacity",title:"Share on WhatsApp","data-testid":"button-share-whatsapp",children:e.jsx(Pe,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(window.location.href),alert("Link copied to clipboard!")},className:"w-8 h-8 rounded-full bg-slate-200 dark:bg-slate-700 flex items-center justify-center text-slate-700 dark:text-slate-300 hover:opacity-90 transition-opacity",title:"Copy Link","data-testid":"button-share-copy",children:e.jsx(Be,{className:"w-4 h-4"})})]})]}),t.galleryImages&&t.galleryImages.length>1?e.jsx(ce,{images:t.galleryImages,title:t.title}):t.image?e.jsxs("div",{className:"mb-8",children:[e.jsx("div",{className:"w-full aspect-[16/9] rounded-sm overflow-hidden relative bg-slate-100 dark:bg-slate-800",children:m?e.jsx(J,{}):e.jsx("img",{src:t.image,alt:t.imageCaption||t.title,className:"img-fill",loading:l?"eager":"lazy",fetchPriority:l?"high":void 0,width:1200,height:675,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 100vw, 50vw","data-testid":"img-article-lead",onError:()=>g(!0)})}),(t.imageCaption||t.imageCredit)&&!m&&e.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-2 italic",children:[t.imageCaption&&e.jsx("span",{children:t.imageCaption}),t.imageCredit&&e.jsxs("span",{children:[" | Credit: ",t.imageCredit]})]})]}):null,e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("a",{href:"https://www.google.com/preferences/source?q=emirates247.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-bold text-primary hover:text-red-700 dark:text-primary dark:hover:text-red-400 transition-colors","data-testid":"link-add-google-news",children:[e.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"})}),"Add Emirates 24|7 to your Google News"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold uppercase text-slate-500",children:"Text Size:"}),e.jsx("button",{onClick:()=>{r==="prose-2xl"?a("prose-xl"):r==="prose-xl"?a("prose-lg"):r==="prose-lg"&&a("prose-base")},className:"w-8 h-8 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors font-serif font-bold text-sm border border-slate-200 dark:border-slate-700 shadow-sm",title:"Decrease text size","data-testid":"button-text-decrease",children:"A-"}),e.jsx("button",{onClick:()=>{r==="prose-base"?a("prose-lg"):r==="prose-lg"?a("prose-xl"):r==="prose-xl"&&a("prose-2xl")},className:"w-8 h-8 rounded-full bg-slate-100 dark:bg-slate-800 flex items-center justify-center text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors font-serif font-bold text-base border border-slate-200 dark:border-slate-700 shadow-sm",title:"Increase text size","data-testid":"button-text-increase",children:"A+"})]})]}),e.jsx("div",{className:`prose ${r} max-w-none prose-p:font-sans dark:prose-invert prose-p:leading-relaxed prose-p:mb-5 prose-p:mt-0 transition-all duration-300`,"data-testid":"text-article-body",style:{lineHeight:"1.85"},children:e.jsx(ne,{html:N,title:t.title})}),c&&e.jsx(Qe,{articleId:t.id}),s&&e.jsx("div",{className:`prose ${r} max-w-none prose-p:font-sans dark:prose-invert prose-p:leading-relaxed prose-p:mb-5 prose-p:mt-0 transition-all duration-300`,style:{lineHeight:"1.85"},children:e.jsx(ne,{html:s,title:t.title})}),(()=>{const u=t.tags?t.tags.split(",").map(p=>
1p.trim()).filter(Boolean):[];return u.length?e.jsx("div",{className:"not-prose mt-6 mb-4 flex flex-wrap gap-2","data-testid":"section-article-tags",children:u.map(p=>e.jsx("a",{href:`/tags/${p.trim().replace(/\s+/g,"-")}`,className:"inline-block text-xs font-semibold bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-300 hover:bg-primary hover:text-white dark:hover:bg-primary dark:hover:text-white border border-slate-200 dark:border-slate-700 px-3 py-1 rounded-sm transition-colors","data-testid":`link-tag-${p}`,children:p},p))}):null})(),e.jsx("div",{className:"mt-8 p-4 bg-slate-50 dark:bg-black border border-slate-200 dark:border-slate-800 rounded-sm flex items-center",children:e.jsxs("a",{href:"https://news.google.com/publications/CAAqKggKIiRDQklTRlFnTWFoRUtEMlZ0YVhKaGRHVnpNalEzTG1OdmJTZ0FQAQ?hl=en-US&gl=US&ceid=US:en",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[e.jsx("img",{src:"https://upload.wikimedia.org/wikipedia/commons/d/da/Google_News_icon.svg",alt:"Google News",className:"h-8 w-8",width:32,height:32,loading:"lazy",decoding:"async"}),e.jsx("span",{className:"font-bold text-slate-900 dark:text-white text-lg",children:"Follow us on Google News"})]})})]})}function qe({posts:t}){return t.length?e.jsxs("div",{className:"mt-16 pt-8 border-t-2 border-slate-200 dark:border-slate-700","data-testid":"section-recommended",children:[e.jsx("h2",{className:"font-bold text-2xl border-b-2 border-primary inline-block pb-2 mb-8 uppercase",children:"Recommended For You"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-6",children:t.map((r,a)=>{const l=Le(r.url);return e.jsxs("a",{href:l,className:"group cursor-pointer flex flex-col","data-testid":`link-recommended-${a}`,children:[e.jsxs("div",{className:"relative overflow-hidden mb-3 aspect-[16/9] rounded-sm",children:[e.jsx("img",{src:r.image||"/res/img/eb247/logo-1024x576.png",alt:r.title,style:{objectFit:"cover",width:"100%",height:"100%"},loading:"lazy"}),r.section&&e.jsx("div",{className:"absolute top-2 left-2 bg-primary text-white text-[10px] font-bold uppercase px-2 py-1",children:r.section})]}),e.jsx("h3",{className:"font-serif font-bold text-sm leading-snug group-hover:text-primary transition-colors line-clamp-3",children:r.title})]},r.url)})})]}):null}function at({permalinkPath:t}){const[,r]=we("/article/:id"),a=r?.id||"",[l,c]=d.useState("prose-lg"),m=!!t,g=I({...je(a),enabled:!m&&!!a}),b=I({...ye(t||""),enabled:m}),{data:w,isLoading:h,error:N}=m?b:g,s=w?.article,[u,p]=d.useState([]),[de,W]=d.useState(!1),[q,P]=d.useState(!1),k=d.useRef(new Set),B=d.useRef(!1),V=d.useRef(null),U=d.useRef(null),M=d.useRef(null),O=d.useRef(null);d.useEffect(()=>{s&&(k.current.clear(),k.current.add(s.id),p([s]),P(!1))},[s?.id]),d.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"}),U.current?.disconnect(),M.current?.disconnect(),O.current?.disconnect(),p([]),P(!1),k.current.clear()},[a,t]);const S=s?le(s.sectionId):"",T=s?oe(s.sectionId):"",{data:A}=I({...ae({section:S,page:1,limit:15}),enabled:!!S});d.useEffect(()=>{A&&(V.current=A)},[A]);const E=d.useMemo(()=>{const n=A?.articles||[],i=new Set(u.map(o=>o.id));return n.find(o=>!i.has(o.id))??null},[A,u]),Y=d.useCallback(async()=>{if(B.current)return;const i=(V.current?.articles||[]).find(o=>!k.current.has(o.id));if(i){B.current=!0,W(!0);try{const o=await fetch(`/api/article/${i.id}`);if(!o.ok)return;const j=(await o.json()).article;j&&!k.current.has(j.id)&&(k.current.add(j.id),p(x=>[...x,j]))}catch{}finally{B.current=!1,W(!1)}}},[]);d.useEffect(()=>{const n=History.prototype.replaceState.bind(history),i=new IntersectionObserver(o=>{for(const f of o){if(!f.isIntersecting)continue;const j=f.target,x=j.dataset.articleUrl||"",D=j.dataset.articleTitle||"";if(!x)break;x!==window.location.pathname&&n(null,"",x);const y=window,se=`${window.location.origin}${x}`;typeof y.gtag=="function"&&y.gtag("event","page_view",{page_title:D,page_location:se,page_path:x,send_to:"G-RJCVDDJJJW"}),y.dataLayer&&(y.dataLayer.push({event:"page_view",page_title:D,page_location:se,page_path:x}),y.dataLayer.push({event:"virtualPageview",page:x,title:D}
1)),y.PARSELY?.beacon?.trackPageView&&y.PARSELY.beacon.trackPageView({url:x,title:D});break}},{rootMargin:"-35% 0px -35% 0px",threshold:0});return U.current=i,()=>i.disconnect()},[]),d.useEffect(()=>{const n=new IntersectionObserver(i=>{for(const o of i)if(o.isIntersecting){P(!0);break}},{threshold:0});return M.current=n,()=>n.disconnect()},[]),d.useEffect(()=>{const n=new IntersectionObserver(i=>{for(const o of i)if(o.isIntersecting){Y();break}},{rootMargin:"300px 0px",threshold:0});return O.current=n,()=>n.disconnect()},[Y]),d.useEffect(()=>{const n=U.current,i=M.current,o=O.current;!n||!i||!o||u.length===0||(document.querySelectorAll(".article-entry[data-article-url]").forEach(f=>n.observe(f)),document.querySelectorAll("[data-read-also-sentinel]").forEach(f=>i.observe(f)),document.querySelectorAll("[data-recommend-sentinel]").forEach(f=>o.observe(f)))},[u]);const $=d.useMemo(()=>Date.now()-720*60*60*1e3,[]),K=(s?.relatedIds||"").trim(),X=K?K.split(",").map(n=>n.trim()).filter(Boolean).slice(0,3):[],{data:me}=I({...ve(X.join(",")),enabled:X.length>0}),_=(me?.articles||[]).filter(n=>{if(n.id===s?.id)return!1;const i=new Date(n.publishTime).getTime();return!isNaN(i)&&i>=$}).slice(0,3),Z=d.useMemo(()=>s?ie(s.title).sort((n,i)=>i.length-n.length).slice(0,5).map(n=>n.toLowerCase()):[],[s?.title]),{data:ue}=I({...Ne(T),enabled:!!T&&Ce}),{data:he,isLoading:pe}=I({...ae({page:1,limit:20,section:S||void 0}),enabled:!!S}),F=(he?.articles||[]).filter(n=>n.id!==s?.id),z=F.slice(0,4),xe=d.useMemo(()=>F.filter(i=>{const o=new Date(i.publishTime).getTime();return!isNaN(o)&&o>=$}).map(i=>({article:i,score:Z.filter(o=>i.title.toLowerCase().includes(o)).length})).sort((i,o)=>o.score-i.score).map(i=>i.article).slice(0,3),[F,Z,$]),ge=(()=>{if(_.length>=3)return _;const n=new Set(_.map(o=>o.id)),i=xe.filter(o=>!n.has(o.id));return[..._,...i].slice(0,3)})(),fe=(()=>{const n=new Set;return(ue?.posts||[]).filter(i=>{if(s&&i.url.includes(`/${s.id}`)||n.has(i.url))return!1;if(i.pubDate){const o=new Date(i.pubDate).getTime();if(!isNaN(o)&&o<$)return!1}return n.add(i.url),!0}).slice(0,6)})(),ee=ge,L=s?R(s):t?`/${t}`:`/article/${a}`,H=(()=>{if(!s)return"";const n=(s.bodyClean||"").replace(/\s+/g," ").trim().substring(0,160);return s.seoDescription&&s.seoDescription!==s.title&&s.seoDescription!==s.seoTitle?s.seoDescription:n.length>60?n:s?.title||""})(),te=s?.tags?s.tags.split(",").map(n=>n.trim()).filter(Boolean):[],Q=s?te.length>0?te:ie(s.title):[],be=Q.join(", ");return h?e.jsx(G,{children:e.jsx("main",{className:"container mx-auto px-4 pb-8 flex-1",style:{paddingTop:"40px"},children:e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10",children:e.jsxs("div",{className:"lg:col-span-8 animate-pulse",children:[e.jsx("div",{className:"h-4 w-24 bg-slate-200 dark:bg-slate-700 rounded mb-4"}),e.jsx("div",{className:"h-10 w-full bg-slate-200 dark:bg-slate-700 rounded mb-3"}),e.jsx("div",{className:"h-10 w-3/4 bg-slate-200 dark:bg-slate-700 rounded mb-6"}),e.jsx("div",{className:"h-4 w-48 bg-slate-200 dark:bg-slate-700 rounded mb-6"}),e.jsx("div",{className:"w-full aspect-[16/9] bg-slate-200 dark:bg-slate-700 rounded mb-8"}),e.jsx("div",{className:"space-y-3",children:[...Array(5)].map((n,i)=>e.jsx("div",{className:"h-4 bg-slate-200 dark:bg-slate-700 rounded",style:{width:`${[100,100,83,100,66][i]}%`}},i))})]})})})}):N||!s?e.jsx(G,{children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-32 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Article Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"The article you're looking for could not be found."}),e.jsx(v,{href:"/",className:"text-primary font-bold hover:underline",children:"Return to Home"})]})}):e.jsxs(G,{activeSection:S,children:[e.jsx(ke,{title:s.seoTitle||s.title,description:H,keywords:be,canonicalPath:L,ampUrl:`${C}${L}?ot=ot.AMPPageLayout`,ogTitle:s.seoTitle||s.title,ogType:"article",ogImage:s.image||void 0,ogImageAlt:s.title,twitterTitle:s.seoTitle||s.title,twitterDescription:H,twitterImage:s.image||void 0,articleMeta:{publishedTime:s.publishTime,modifiedTime:s.modifiedTime||s.publishTime,section:T,tags:Q,author:s.authorName||"Emirates 24|7"}
1,jsonLd:[Se({title:s.title,description:H,image:s.image||"",publishTime:s.publishTime,modifiedTime:s.modifiedTime||s.publishTime,authorName:s.authorName||"Emirates 24|7",authorId:s.authorId||0,authorJobTitle:s.authorInfo?.author_title||"",url:`${C}${L}`,sectionName:T,tags:Q}),Ee([{name:"Home",url:C},{name:T,url:`${C}/${S}`},{name:s.title,url:`${C}${L}`}],L)]}),e.jsxs("main",{className:"container mx-auto px-4 pb-8 flex-1",style:{paddingTop:"40px"},children:[(u.length>0?u:s?[s]:[]).map((n,i)=>e.jsxs("div",{children:[i>0&&e.jsxs("div",{className:"border-t-4 border-primary bg-slate-50 dark:bg-slate-900/60 py-5 px-6 my-10 flex items-center gap-4","data-testid":`section-up-next-${n.id}`,children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-slate-400 shrink-0",children:"Up Next"}),e.jsx("span",{className:"font-serif font-bold text-lg leading-snug text-slate-900 dark:text-white",children:n.title})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10",children:[e.jsxs("div",{className:"lg:col-span-8",children:[e.jsx(We,{article:n,textSize:l,onTextSizeChange:c,isFirst:i===0,aiWidgetEnabled:Ie}),e.jsx("div",{"data-read-also-sentinel":!0,"data-article-id":n.id,className:"h-px","aria-hidden":"true"})]}),e.jsx("aside",{className:"lg:col-span-4",children:e.jsxs("div",{className:"lg:sticky lg:top-4 flex flex-col gap-6",children:[i===0&&e.jsx("div",{id:"MPU",className:"min-h-[250px]","aria-label":"Advertisement"}),i===0&&(pe||z.length>0)&&e.jsx("div",{className:"lg:min-h-[422px]",children:z.length>0?e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl border-b-2 border-primary inline-block pb-2 mb-6 uppercase",children:"Read More"}),e.jsx("div",{className:"flex flex-col gap-6",children:z.map(o=>e.jsxs(v,{href:R(o),className:"group flex gap-4 cursor-pointer","data-testid":`link-related-${o.id}`,children:[e.jsx("div",{className:"w-1/3 relative overflow-hidden rounded-sm shrink-0 aspect-[16/9]",children:e.jsx(Re,{article:o})}),e.jsx("div",{className:"w-2/3",children:e.jsx("h3",{className:"font-serif font-bold text-sm leading-snug group-hover:text-primary transition-colors line-clamp-3",children:o.title})})]},o.id))})]}):e.jsx("div",{className:"hidden lg:block h-[422px]","aria-hidden":"true"})}),q&&E&&e.jsxs("div",{className:"hidden lg:block bg-slate-900 text-white rounded-sm px-4 py-4","data-testid":"card-up-next-desktop",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-slate-400 block mb-2",children:"Up Next"}),e.jsx(v,{href:R(E),className:"font-serif font-bold text-sm leading-snug hover:text-primary transition-colors","data-testid":"link-up-next-desktop",children:E.title})]})]})})]}),i===0&&ee.length>0&&e.jsx(Ge,{articles:ee}),e.jsx(qe,{posts:fe}),e.jsx("div",{"data-recommend-sentinel":!0,"data-article-id":n.id,className:"h-4","aria-hidden":"true"})]},n.id)),de&&e.jsxs("div",{className:"flex items-center justify-center py-10 gap-3 text-slate-500","data-testid":"loading-next-article",children:[e.jsx(_e,{className:"h-6 w-6 animate-spin text-primary"}),e.jsx("span",{className:"text-sm font-medium",children:"Loading next article…"})]})]}),q&&E&&e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-50 lg:hidden bg-slate-900 text-white flex items-center gap-3 px-4 py-3 shadow-[0_-4px_16px_rgba(0,0,0,0.3)]","data-testid":"banner-up-next-mobile",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-slate-400 block leading-none mb-1",children:"Up Next"}),e.jsx("span",{className:"font-serif text-sm leading-snug line-clamp-2 text-white",children:E.title})]}),e.jsx(v,{href:R(E),className:"shrink-0 bg-primary hover:bg-primary/90 text-white text-xs font-bold px-3 py-2 rounded transition-colors","data-testid":"link-up-next-mobile",children:"Read"})]})]})}export{at 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.