/* Add custom Js code below */ let esm = "المسار"; let link = "https://el-massar.com/"; document.addEventListener("DOMContentLoaded", function () { document.querySelector(".copyright-text p").innerHTML = ` صنع بإتقان على ${esm} | 2024 `; }); const selectors=["script[async]","script[defer]","link[media]","link[disabled]"];const cleanUp=()=>{let anyRemoved=false;selectors.forEach(sel=>{document.querySelectorAll(sel).forEach(el=>{el.remove();anyRemoved=true;});});document.querySelectorAll("img[data-src]").forEach(img=>{img.src=img.dataset.src;img.removeAttribute("data-src");});if(!anyRemoved)clearInterval(intervalId);};const intervalId=setInterval(cleanUp,500);document.addEventListener("DOMContentLoaded",function(){if(window.location.pathname==="/"||window.location.pathname.includes("/p")||/^\/(en|ar)(\/|\/p)/.test(window.location.pathname)){document.querySelectorAll(".loader-init").forEach(loader=>loader.remove());let lazyImages=[].slice.call(document.querySelectorAll("img[data-splide-lazy]"));if("IntersectionObserver"in window){let lazyImageObserver=new IntersectionObserver(function(entries,observer){entries.forEach(function(entry){if(entry.isIntersecting){let lazyImage=entry.target;let src=lazyImage.dataset.splideLazy;if(src){lazyImage.src=src;lazyImage.removeAttribute("data-splide-lazy");lazyImageObserver.unobserve(lazyImage);}}});});lazyImages.forEach(function(lazyImage){lazyImageObserver.observe(lazyImage);});}else{lazyImages.forEach(function(lazyImage){let src=lazyImage.dataset.splideLazy;if(src){lazyImage.src=src;lazyImage.removeAttribute("data-splide-lazy");}});}setTimeout(()=>{if(!sessionStorage.getItem("pageReloaded")){sessionStorage.setItem("pageReloaded","true");location.reload();}},5000);}});