(function () { if (typeof Slideshow === "undefined") return; var BaseSlideshow = Slideshow; // Keep one .deco per slideshow (the showcase loop appends one per item). function removeExtraDeco() { document.querySelectorAll(".slides").forEach(function (slides) { var decos = slides.querySelectorAll(":scope > .deco"); for (var i = 1; i < decos.length; i++) decos[i].remove(); }); } // Items without any slide (empty gallery, no video) get an inert slideshow // instead of throwing and stopping every item after them. Slideshow = function (el) { removeExtraDeco(); if (!el || !el.querySelector(".slide")) { return { DOM: { el: el, slides: [], slidesInner: [], deco: null }, current: 0, slidesTotal: 0, isAnimating: false, next: function () {}, prev: function () {}, navigate: function () {}, }; } return new BaseSlideshow(el); }; })();