document.addEventListener("DOMContentLoaded",(()=>{"function"==typeof lightGallery?document.querySelectorAll(".lcp-gallery").forEach((l=>{const e=l.getAttribute("data-lgsettings"),t="init-on-load"===l.getAttribute("data-gallery-settings"),o=l.classList.contains("lcp-inline-gallery");if(e)try{const i=JSON.parse(e);console.log("LightGallery Settings:",i);const n={lgZoom,lgThumbnail,lgFullScreen:lgFullscreen,lgRotate,lgAutoplay,lgShare,lgComment,lgHash,lgPager,lgVideo,lgMediumZoom};Array.isArray(i.plugins)&&(i.plugins=i.plugins.map((l=>n[l]||l)));let a=null;(!l.classList.contains("lcp-inline-gallery")||t||o)&&(a=lightGallery(l,i),o&&(a.openGallery(0),l.classList.add("initialized"))),l.querySelectorAll(".lcp-gallery-item").forEach(((l,e)=>{l.addEventListener("click",(()=>{a&&"function"==typeof a.openGallery?a.openGallery(e):console.error("LightGallery instance is not initialized correctly or missing openGallery method.")}))}))}catch(l){console.error("Error parsing data-lgsettings JSON:",l)}else console.error("data-lgsettings attribute is missing for a gallery.")})):console.error("LightGallery is not defined")}));