!(function (i) {
    "function" == typeof define && define.amd
        ? define(["jquery"], i)
        : "object" == typeof module && module.exports
          ? (module.exports = function (t, e) {
                return (
                    void 0 === e && (e = "undefined" != typeof window ? require("jquery") : require("jquery")(t)),
                    i(e),
                    e
                );
            })
          : i(jQuery);
})(function (d) {
    function n(t, e) {
        (this.settings = e),
            this.checkSettings(),
            (this.imgAnalyzerTimeout = null),
            (this.entries = null),
            (this.buildingRow = { entriesBuff: [], width: 0, height: 0, aspectRatio: 0 }),
            (this.lastFetchedEntry = null),
            (this.lastAnalyzedIndex = -1),
            (this.yield = { every: 2, flushed: 0 }),
            (this.border = 0 <= e.border ? e.border : e.margins),
            (this.maxRowHeight = this.retrieveMaxRowHeight()),
            (this.suffixRanges = this.retrieveSuffixRanges()),
            (this.offY = this.border),
            (this.rows = 0),
            (this.spinner = {
                phase: 0,
                timeSlot: 150,
                $el: d('<div class="spinner"><span></span><span></span><span></span></div>'),
                intervalId: null,
            }),
            (this.scrollBarOn = !1),
            (this.checkWidthIntervalId = null),
            (this.galleryWidth = t.width()),
            (this.$gallery = t);
    }
    (n.prototype.getSuffix = function (t, e) {
        for (var i = e < t ? t : e, s = 0; s < this.suffixRanges.length; s++)
            if (i <= this.suffixRanges[s]) return this.settings.sizeRangeSuffixes[this.suffixRanges[s]];
        return this.settings.sizeRangeSuffixes[this.suffixRanges[s - 1]];
    }),
        (n.prototype.removeSuffix = function (t, e) {
            return t.substring(0, t.length - e.length);
        }),
        (n.prototype.endsWith = function (t, e) {
            return -1 !== t.indexOf(e, t.length - e.length);
        }),
        (n.prototype.getUsedSuffix = function (t) {
            for (var e in this.settings.sizeRangeSuffixes)
                if (this.settings.sizeRangeSuffixes.hasOwnProperty(e)) {
                    if (0 === this.settings.sizeRangeSuffixes[e].length) continue;
                    if (this.endsWith(t, this.settings.sizeRangeSuffixes[e])) return this.settings.sizeRangeSuffixes[e];
                }
            return "";
        }),
        (n.prototype.newSrc = function (t, e, i, s) {
            var o, n, r;
            return (
                this.settings.thumbnailPath
                    ? (r = this.settings.thumbnailPath(t, e, i, s))
                    : ((n = null !== (o = t.match(this.settings.extension)) ? o[0] : ""),
                      (r = t.replace(this.settings.extension, "")),
                      (r = this.removeSuffix(r, this.getUsedSuffix(r))),
                      (r += this.getSuffix(e, i) + n)),
                r
            );
        }),
        (n.prototype.showImg = function (t, e) {
            this.settings.cssAnimation
                ? (t.addClass("entry-visible"), e && e())
                : (t.stop().fadeTo(this.settings.imagesAnimationDuration, 1, e),
                  t.find(this.settings.imgSelector).stop().fadeTo(this.settings.imagesAnimationDuration, 1, e));
        }),
        (n.prototype.extractImgSrcFromImage = function (t) {
            var e = void 0 !== t.data("safe-src") ? t.data("safe-src") : t.attr("src");
            return t.data("jg.originalSrc", e), e;
        }),
        (n.prototype.imgFromEntry = function (t) {
            var e = t.find(this.settings.imgSelector);
            return 0 === e.length ? null : e;
        }),
        (n.prototype.captionFromEntry = function (t) {
            var e = t.find("> .caption");
            return 0 === e.length ? null : e;
        }),
        (n.prototype.displayEntry = function (t, e, i, s, o, n) {
            t.width(s), t.height(n), t.css("top", i), t.css("left", e);
            var r,
                l,
                a,
                h = this.imgFromEntry(t);
            null !== h
                ? (h.css("width", s),
                  h.css("height", o),
                  h.css("margin-left", -s / 2),
                  h.css("margin-top", -o / 2),
                  (r = h.attr("src")),
                  (l = this.newSrc(r, s, o, h[0])),
                  h.one("error", function () {
                      h.attr("src", h.data("jg.originalSrc"));
                  }),
                  (a = function () {
                      r !== l && h.attr("src", l);
                  }),
                  "skipped" === t.data("jg.loaded")
                      ? this.onImageEvent(
                            r,
                            d.proxy(function () {
                                this.showImg(t, a), t.data("jg.loaded", !0);
                            }, this)
                        )
                      : this.showImg(t, a))
                : this.showImg(t),
                this.displayEntryCaption(t);
        }),
        (n.prototype.displayEntryCaption = function (t) {
            var e,
                i,
                s = this.imgFromEntry(t);
            null !== s && this.settings.captions
                ? (null === (e = this.captionFromEntry(t)) &&
                      ((i = s.attr("alt")),
                      this.isValidCaption(i) || (i = t.attr("title")),
                      this.isValidCaption(i) &&
                          ((e = d('<div class="caption">' + i + "</div>")),
                          t.append(e),
                          t.data("jg.createdCaption", !0))),
                  null !== e &&
                      (this.settings.cssAnimation ||
                          e.stop().fadeTo(0, this.settings.captionSettings.nonVisibleOpacity),
                      this.addCaptionEventsHandlers(t)))
                : this.removeCaptionEventsHandlers(t);
        }),
        (n.prototype.isValidCaption = function (t) {
            return void 0 !== t && 0 < t.length;
        }),
        (n.prototype.onEntryMouseEnterForCaption = function (t) {
            var e = this.captionFromEntry(d(t.currentTarget));
            this.settings.cssAnimation
                ? e.addClass("caption-visible").removeClass("caption-hidden")
                : e
                      .stop()
                      .fadeTo(
                          this.settings.captionSettings.animationDuration,
                          this.settings.captionSettings.visibleOpacity
                      );
        }),
        (n.prototype.onEntryMouseLeaveForCaption = function (t) {
            var e = this.captionFromEntry(d(t.currentTarget));
            this.settings.cssAnimation
                ? e.removeClass("caption-visible").removeClass("caption-hidden")
                : e
                      .stop()
                      .fadeTo(
                          this.settings.captionSettings.animationDuration,
                          this.settings.captionSettings.nonVisibleOpacity
                      );
        }),
        (n.prototype.addCaptionEventsHandlers = function (t) {
            var e = t.data("jg.captionMouseEvents");
            void 0 === e &&
                ((e = {
                    mouseenter: d.proxy(this.onEntryMouseEnterForCaption, this),
                    mouseleave: d.proxy(this.onEntryMouseLeaveForCaption, this),
                }),
                t.on("mouseenter", void 0, void 0, e.mouseenter),
                t.on("mouseleave", void 0, void 0, e.mouseleave),
                t.data("jg.captionMouseEvents", e));
        }),
        (n.prototype.removeCaptionEventsHandlers = function (t) {
            var e = t.data("jg.captionMouseEvents");
            void 0 !== e &&
                (t.off("mouseenter", void 0, e.mouseenter),
                t.off("mouseleave", void 0, e.mouseleave),
                t.removeData("jg.captionMouseEvents"));
        }),
        (n.prototype.clearBuildingRow = function () {
            (this.buildingRow.entriesBuff = []), (this.buildingRow.aspectRatio = 0), (this.buildingRow.width = 0);
        }),
        (n.prototype.prepareBuildingRow = function (t) {
            var e,
                i,
                s,
                o,
                n,
                r = !0,
                l = 0,
                a =
                    this.galleryWidth -
                    2 * this.border -
                    (this.buildingRow.entriesBuff.length - 1) * this.settings.margins,
                h = a / this.buildingRow.aspectRatio,
                d = this.settings.rowHeight,
                u = this.buildingRow.width / a > this.settings.justifyThreshold;
            if (t && "hide" === this.settings.lastRow && !u) {
                for (e = 0; e < this.buildingRow.entriesBuff.length; e++)
                    (i = this.buildingRow.entriesBuff[e]),
                        this.settings.cssAnimation
                            ? i.removeClass("entry-visible")
                            : (i.stop().fadeTo(0, 0.1), i.find("> img, > a > img").fadeTo(0, 0));
                return -1;
            }
            for (
                t &&
                    !u &&
                    "justify" !== this.settings.lastRow &&
                    "hide" !== this.settings.lastRow &&
                    ((r = !1),
                    0 < this.rows &&
                        (r =
                            ((d = (this.offY - this.border - this.settings.margins * this.rows) / this.rows) *
                                this.buildingRow.aspectRatio) /
                                a >
                            this.settings.justifyThreshold)),
                    e = 0;
                e < this.buildingRow.entriesBuff.length;
                e++
            )
                (s = (i = this.buildingRow.entriesBuff[e]).data("jg.width") / i.data("jg.height")),
                    (n = r ? ((o = e === this.buildingRow.entriesBuff.length - 1 ? a : h * s), h) : ((o = d * s), d)),
                    (a -= Math.round(o)),
                    i.data("jg.jwidth", Math.round(o)),
                    i.data("jg.jheight", Math.ceil(n)),
                    (0 === e || n < l) && (l = n);
            return (this.buildingRow.height = l), r;
        }),
        (n.prototype.flushRow = function (t) {
            var e,
                i = this.settings,
                s = this.border,
                o = this.prepareBuildingRow(t);
            if (t && "hide" === i.lastRow && -1 === o) this.clearBuildingRow();
            else {
                if (
                    (this.maxRowHeight &&
                        this.maxRowHeight < this.buildingRow.height &&
                        (this.buildingRow.height = this.maxRowHeight),
                    t && ("center" === i.lastRow || "right" === i.lastRow))
                ) {
                    for (
                        var n =
                                this.galleryWidth -
                                2 * this.border -
                                (this.buildingRow.entriesBuff.length - 1) * i.margins,
                            r = 0;
                        r < this.buildingRow.entriesBuff.length;
                        r++
                    )
                        n -= (e = this.buildingRow.entriesBuff[r]).data("jg.jwidth");
                    "center" === i.lastRow ? (s += n / 2) : "right" === i.lastRow && (s += n);
                }
                var l = this.buildingRow.entriesBuff.length - 1;
                for (r = 0; r <= l; r++)
                    (e = this.buildingRow.entriesBuff[this.settings.rtl ? l - r : r]),
                        this.displayEntry(
                            e,
                            s,
                            this.offY,
                            e.data("jg.jwidth"),
                            e.data("jg.jheight"),
                            this.buildingRow.height
                        ),
                        (s += e.data("jg.jwidth") + i.margins);
                (this.galleryHeightToSet = this.offY + this.buildingRow.height + this.border),
                    this.setGalleryTempHeight(this.galleryHeightToSet + this.getSpinnerHeight()),
                    (!t || (this.buildingRow.height <= i.rowHeight && o)) &&
                        ((this.offY += this.buildingRow.height + i.margins),
                        (this.rows += 1),
                        this.clearBuildingRow(),
                        this.settings.triggerEvent.call(this, "jg.rowflush"));
            }
        });
    var e = 0;
    function i() {
        return d("body").height() > d(window).height();
    }
    (n.prototype.rememberGalleryHeight = function () {
        (e = this.$gallery.height()), this.$gallery.height(e);
    }),
        (n.prototype.setGalleryTempHeight = function (t) {
            (e = Math.max(t, e)), this.$gallery.height(e);
        }),
        (n.prototype.setGalleryFinalHeight = function (t) {
            (e = t), this.$gallery.height(t);
        }),
        (n.prototype.checkWidth = function () {
            this.checkWidthIntervalId = setInterval(
                d.proxy(function () {
                    var t;
                    this.$gallery.is(":visible") &&
                        ((t = parseFloat(this.$gallery.width())),
                        i() === this.scrollBarOn
                            ? Math.abs(t - this.galleryWidth) > this.settings.refreshSensitivity &&
                              ((this.galleryWidth = t),
                              this.rewind(),
                              this.rememberGalleryHeight(),
                              this.startImgAnalyzer(!0))
                            : ((this.scrollBarOn = i()), (this.galleryWidth = t)));
                }, this),
                this.settings.refreshTime
            );
        }),
        (n.prototype.isSpinnerActive = function () {
            return null !== this.spinner.intervalId;
        }),
        (n.prototype.getSpinnerHeight = function () {
            return this.spinner.$el.innerHeight();
        }),
        (n.prototype.stopLoadingSpinnerAnimation = function () {
            clearInterval(this.spinner.intervalId),
                (this.spinner.intervalId = null),
                this.setGalleryTempHeight(this.$gallery.height() - this.getSpinnerHeight()),
                this.spinner.$el.detach();
        }),
        (n.prototype.startLoadingSpinnerAnimation = function () {
            var t = this.spinner,
                e = t.$el.find("span");
            clearInterval(t.intervalId),
                this.$gallery.append(t.$el),
                this.setGalleryTempHeight(this.offY + this.buildingRow.height + this.getSpinnerHeight()),
                (t.intervalId = setInterval(function () {
                    t.phase < e.length
                        ? e.eq(t.phase).fadeTo(t.timeSlot, 1)
                        : e.eq(t.phase - e.length).fadeTo(t.timeSlot, 0),
                        (t.phase = (t.phase + 1) % (2 * e.length));
                }, t.timeSlot));
        }),
        (n.prototype.rewind = function () {
            (this.lastFetchedEntry = null),
                (this.lastAnalyzedIndex = -1),
                (this.offY = this.border),
                (this.rows = 0),
                this.clearBuildingRow();
        }),
        (n.prototype.updateEntries = function (t) {
            var e =
                t && null != this.lastFetchedEntry
                    ? d(this.lastFetchedEntry).nextAll(this.settings.selector).toArray()
                    : ((this.entries = []), this.$gallery.children(this.settings.selector).toArray());
            return (
                0 < e.length &&
                    (d.isFunction(this.settings.sort)
                        ? (e = this.sortArray(e))
                        : this.settings.randomize && (e = this.shuffleArray(e)),
                    (this.lastFetchedEntry = e[e.length - 1]),
                    this.settings.filter ? (e = this.filterArray(e)) : this.resetFilters(e)),
                (this.entries = this.entries.concat(e)),
                !0
            );
        }),
        (n.prototype.insertToGallery = function (t) {
            var e = this;
            d.each(t, function () {
                d(this).appendTo(e.$gallery);
            });
        }),
        (n.prototype.shuffleArray = function (t) {
            for (var e, i, s = t.length - 1; 0 < s; s--)
                (e = Math.floor(Math.random() * (s + 1))), (i = t[s]), (t[s] = t[e]), (t[e] = i);
            return this.insertToGallery(t), t;
        }),
        (n.prototype.sortArray = function (t) {
            return t.sort(this.settings.sort), this.insertToGallery(t), t;
        }),
        (n.prototype.resetFilters = function (t) {
            for (var e = 0; e < t.length; e++) d(t[e]).removeClass("jg-filtered");
        }),
        (n.prototype.filterArray = function (t) {
            var i = this.settings;
            if ("string" === d.type(i.filter))
                return t.filter(function (t) {
                    var e = d(t);
                    return e.is(i.filter)
                        ? (e.removeClass("jg-filtered"), !0)
                        : (e.addClass("jg-filtered").removeClass("jg-visible"), !1);
                });
            if (d.isFunction(i.filter)) {
                for (var e = t.filter(i.filter), s = 0; s < t.length; s++)
                    -1 === e.indexOf(t[s])
                        ? d(t[s]).addClass("jg-filtered").removeClass("jg-visible")
                        : d(t[s]).removeClass("jg-filtered");
                return e;
            }
        }),
        (n.prototype.destroy = function () {
            clearInterval(this.checkWidthIntervalId),
                d.each(
                    this.entries,
                    d.proxy(function (t, e) {
                        var i = d(e);
                        i.css("width", ""),
                            i.css("height", ""),
                            i.css("top", ""),
                            i.css("left", ""),
                            i.data("jg.loaded", void 0),
                            i.removeClass("jg-entry");
                        var s = this.imgFromEntry(i);
                        s.css("width", ""),
                            s.css("height", ""),
                            s.css("margin-left", ""),
                            s.css("margin-top", ""),
                            s.attr("src", s.data("jg.originalSrc")),
                            s.data("jg.originalSrc", void 0),
                            this.removeCaptionEventsHandlers(i);
                        var o = this.captionFromEntry(i);
                        i.data("jg.createdCaption")
                            ? (i.data("jg.createdCaption", void 0), null !== o && o.remove())
                            : null !== o && o.fadeTo(0, 1);
                    }, this)
                ),
                this.$gallery.css("height", ""),
                this.$gallery.removeClass("justified-gallery"),
                this.$gallery.data("jg.controller", void 0);
        }),
        (n.prototype.analyzeImages = function (t) {
            for (var e = this.lastAnalyzedIndex + 1; e < this.entries.length; e++) {
                var i = d(this.entries[e]);
                if (!0 === i.data("jg.loaded") || "skipped" === i.data("jg.loaded")) {
                    var s =
                            this.galleryWidth -
                            2 * this.border -
                            (this.buildingRow.entriesBuff.length - 1) * this.settings.margins,
                        o = i.data("jg.width") / i.data("jg.height");
                    if (
                        s / (this.buildingRow.aspectRatio + o) < this.settings.rowHeight &&
                        (this.flushRow(!1), ++this.yield.flushed >= this.yield.every)
                    )
                        return void this.startImgAnalyzer(t);
                    this.buildingRow.entriesBuff.push(i),
                        (this.buildingRow.aspectRatio += o),
                        (this.buildingRow.width += o * this.settings.rowHeight),
                        (this.lastAnalyzedIndex = e);
                } else if ("error" !== i.data("jg.loaded")) return;
            }
            0 < this.buildingRow.entriesBuff.length && this.flushRow(!0),
                this.isSpinnerActive() && this.stopLoadingSpinnerAnimation(),
                this.stopImgAnalyzerStarter(),
                this.settings.triggerEvent.call(this, t ? "jg.resize" : "jg.complete"),
                this.setGalleryFinalHeight(this.galleryHeightToSet);
        }),
        (n.prototype.stopImgAnalyzerStarter = function () {
            (this.yield.flushed = 0),
                null !== this.imgAnalyzerTimeout &&
                    (clearTimeout(this.imgAnalyzerTimeout), (this.imgAnalyzerTimeout = null));
        }),
        (n.prototype.startImgAnalyzer = function (t) {
            var e = this;
            this.stopImgAnalyzerStarter(),
                (this.imgAnalyzerTimeout = setTimeout(function () {
                    e.analyzeImages(t);
                }, 0.001));
        }),
        (n.prototype.onImageEvent = function (t, e, i) {
            var s, o;
            (e || i) &&
                ((s = new Image()),
                (o = d(s)),
                e &&
                    o.one("load", function () {
                        o.off("load error"), e(s);
                    }),
                i &&
                    o.one("error", function () {
                        o.off("load error"), i(s);
                    }),
                (s.src = t));
        }),
        (n.prototype.init = function () {
            var l = !1,
                a = !1,
                h = this;
            d.each(this.entries, function (t, e) {
                var i = d(e),
                    s = h.imgFromEntry(i);
                if ((i.addClass("jg-entry"), !0 !== i.data("jg.loaded") && "skipped" !== i.data("jg.loaded")))
                    if (
                        (null !== h.settings.rel && i.attr("rel", h.settings.rel),
                        null !== h.settings.target && i.attr("target", h.settings.target),
                        null !== s)
                    ) {
                        var o = h.extractImgSrcFromImage(s);
                        if ((s.attr("src", o), !1 === h.settings.waitThumbnailsLoad)) {
                            var n = parseFloat(s.prop("width")),
                                r = parseFloat(s.prop("height"));
                            if (!isNaN(n) && !isNaN(r))
                                return (
                                    i.data("jg.width", n),
                                    i.data("jg.height", r),
                                    i.data("jg.loaded", "skipped"),
                                    (a = !0),
                                    h.startImgAnalyzer(!1),
                                    !0
                                );
                        }
                        i.data("jg.loaded", !1),
                            (l = !0),
                            h.isSpinnerActive() || h.startLoadingSpinnerAnimation(),
                            h.onImageEvent(
                                o,
                                function (t) {
                                    i.data("jg.width", t.width),
                                        i.data("jg.height", t.height),
                                        i.data("jg.loaded", !0),
                                        h.startImgAnalyzer(!1);
                                },
                                function () {
                                    i.data("jg.loaded", "error"), h.startImgAnalyzer(!1);
                                }
                            );
                    } else
                        i.data("jg.loaded", !0),
                            i.data("jg.width", i.width() | parseFloat(i.css("width")) | 1),
                            i.data("jg.height", i.height() | parseFloat(i.css("height")) | 1);
            }),
                l || a || this.startImgAnalyzer(!1),
                this.checkWidth();
        }),
        (n.prototype.checkOrConvertNumber = function (t, e) {
            if (("string" === d.type(t[e]) && (t[e] = parseFloat(t[e])), "number" !== d.type(t[e])))
                throw e + " must be a number";
            if (isNaN(t[e])) throw "invalid number for " + e;
        }),
        (n.prototype.checkSizeRangesSuffixes = function () {
            if ("object" !== d.type(this.settings.sizeRangeSuffixes))
                throw "sizeRangeSuffixes must be defined and must be an object";
            var t = [];
            for (var e in this.settings.sizeRangeSuffixes)
                this.settings.sizeRangeSuffixes.hasOwnProperty(e) && t.push(e);
            for (var i = { 0: "" }, s = 0; s < t.length; s++)
                if ("string" === d.type(t[s]))
                    try {
                        i[parseInt(t[s].replace(/^[a-z]+/, ""), 10)] = this.settings.sizeRangeSuffixes[t[s]];
                    } catch (t) {
                        throw "sizeRangeSuffixes keys must contains correct numbers (" + t + ")";
                    }
                else i[t[s]] = this.settings.sizeRangeSuffixes[t[s]];
            this.settings.sizeRangeSuffixes = i;
        }),
        (n.prototype.retrieveMaxRowHeight = function () {
            var t = null,
                e = this.settings.rowHeight;
            if ("string" === d.type(this.settings.maxRowHeight))
                t = this.settings.maxRowHeight.match(/^[0-9]+%$/)
                    ? (e * parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1])) / 100
                    : parseFloat(this.settings.maxRowHeight);
            else {
                if ("number" !== d.type(this.settings.maxRowHeight)) {
                    if (!1 === this.settings.maxRowHeight || null == this.settings.maxRowHeight) return null;
                    throw "maxRowHeight must be a number or a percentage";
                }
                t = this.settings.maxRowHeight;
            }
            if (isNaN(t)) throw "invalid number for maxRowHeight";
            return t < e && (t = e), t;
        }),
        (n.prototype.checkSettings = function () {
            this.checkSizeRangesSuffixes(),
                this.checkOrConvertNumber(this.settings, "rowHeight"),
                this.checkOrConvertNumber(this.settings, "margins"),
                this.checkOrConvertNumber(this.settings, "border");
            var t = ["justify", "nojustify", "left", "center", "right", "hide"];
            if (-1 === t.indexOf(this.settings.lastRow)) throw "lastRow must be one of: " + t.join(", ");
            if (
                (this.checkOrConvertNumber(this.settings, "justifyThreshold"),
                this.settings.justifyThreshold < 0 || 1 < this.settings.justifyThreshold)
            )
                throw "justifyThreshold must be in the interval [0,1]";
            if ("boolean" !== d.type(this.settings.cssAnimation)) throw "cssAnimation must be a boolean";
            if ("boolean" !== d.type(this.settings.captions)) throw "captions must be a boolean";
            if (
                (this.checkOrConvertNumber(this.settings.captionSettings, "animationDuration"),
                this.checkOrConvertNumber(this.settings.captionSettings, "visibleOpacity"),
                this.settings.captionSettings.visibleOpacity < 0 || 1 < this.settings.captionSettings.visibleOpacity)
            )
                throw "captionSettings.visibleOpacity must be in the interval [0, 1]";
            if (
                (this.checkOrConvertNumber(this.settings.captionSettings, "nonVisibleOpacity"),
                this.settings.captionSettings.nonVisibleOpacity < 0 ||
                    1 < this.settings.captionSettings.nonVisibleOpacity)
            )
                throw "captionSettings.nonVisibleOpacity must be in the interval [0, 1]";
            if (
                (this.checkOrConvertNumber(this.settings, "imagesAnimationDuration"),
                this.checkOrConvertNumber(this.settings, "refreshTime"),
                this.checkOrConvertNumber(this.settings, "refreshSensitivity"),
                "boolean" !== d.type(this.settings.randomize))
            )
                throw "randomize must be a boolean";
            if ("string" !== d.type(this.settings.selector)) throw "selector must be a string";
            if (!1 !== this.settings.sort && !d.isFunction(this.settings.sort))
                throw "sort must be false or a comparison function";
            if (
                !1 !== this.settings.filter &&
                !d.isFunction(this.settings.filter) &&
                "string" !== d.type(this.settings.filter)
            )
                throw "filter must be false, a string or a filter function";
        }),
        (n.prototype.retrieveSuffixRanges = function () {
            var t = [];
            for (var e in this.settings.sizeRangeSuffixes)
                this.settings.sizeRangeSuffixes.hasOwnProperty(e) && t.push(parseInt(e, 10));
            return (
                t.sort(function (t, e) {
                    return e < t ? 1 : t < e ? -1 : 0;
                }),
                t
            );
        }),
        (n.prototype.updateSettings = function (t) {
            (this.settings = d.extend({}, this.settings, t)),
                this.checkSettings(),
                (this.border = 0 <= this.settings.border ? this.settings.border : this.settings.margins),
                (this.maxRowHeight = this.retrieveMaxRowHeight()),
                (this.suffixRanges = this.retrieveSuffixRanges());
        }),
        (n.prototype.defaults = {
            sizeRangeSuffixes: {},
            thumbnailPath: void 0,
            rowHeight: 120,
            maxRowHeight: !1,
            margins: 1,
            border: -1,
            lastRow: "nojustify",
            justifyThreshold: 0.9,
            waitThumbnailsLoad: !0,
            captions: !0,
            cssAnimation: !0,
            imagesAnimationDuration: 500,
            captionSettings: { animationDuration: 500, visibleOpacity: 0.7, nonVisibleOpacity: 0 },
            rel: null,
            target: null,
            extension: /\.[^.\\/]+$/,
            refreshTime: 200,
            refreshSensitivity: 0,
            randomize: !1,
            rtl: !1,
            sort: !1,
            filter: !1,
            selector: "a, div:not(.spinner)",
            imgSelector: "> img, > a > img",
            triggerEvent: function (t) {
                this.$gallery.trigger(t);
            },
        }),
        (d.fn.justifiedGallery = function (o) {
            return this.each(function (t, e) {
                var i = d(e);
                i.addClass("justified-gallery");
                var s = i.data("jg.controller");
                if (void 0 === s) {
                    if (null != o && "object" !== d.type(o)) {
                        if ("destroy" === o) return;
                        throw "The argument must be an object";
                    }
                    (s = new n(i, d.extend({}, n.prototype.defaults, o))), i.data("jg.controller", s);
                } else if ("norewind" !== o) {
                    if ("destroy" === o) return void s.destroy();
                    s.updateSettings(o), s.rewind();
                }
                s.updateEntries("norewind" === o) && s.init();
            });
        });
}),
    (function (t) {
        "function" == typeof define && define.amd
            ? define(["jquery"], t)
            : "object" == typeof exports
              ? (module.exports = t)
              : t(jQuery);
    })(function (g) {
        var c,
            m,
            t = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
            e =
                "onwheel" in document || 9 <= document.documentMode
                    ? ["wheel"]
                    : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
            f = Array.prototype.slice;
        if (g.event.fixHooks) for (var i = t.length; i; ) g.event.fixHooks[t[--i]] = g.event.mouseHooks;
        var p = (g.event.special.mousewheel = {
            version: "3.1.12",
            setup: function () {
                if (this.addEventListener) for (var t = e.length; t; ) this.addEventListener(e[--t], s, !1);
                else this.onmousewheel = s;
                g.data(this, "mousewheel-line-height", p.getLineHeight(this)),
                    g.data(this, "mousewheel-page-height", p.getPageHeight(this));
            },
            teardown: function () {
                if (this.removeEventListener) for (var t = e.length; t; ) this.removeEventListener(e[--t], s, !1);
                else this.onmousewheel = null;
                g.removeData(this, "mousewheel-line-height"), g.removeData(this, "mousewheel-page-height");
            },
            getLineHeight: function (t) {
                var e = g(t),
                    i = e["offsetParent" in g.fn ? "offsetParent" : "parent"]();
                return (
                    i.length || (i = g("body")),
                    parseInt(i.css("fontSize"), 10) || parseInt(e.css("fontSize"), 10) || 16
                );
            },
            getPageHeight: function (t) {
                return g(t).height();
            },
            settings: { adjustOldDeltas: !0, normalizeOffset: !0 },
        });
        function s(t) {
            var e,
                i,
                s,
                o,
                n = t || window.event,
                r = f.call(arguments, 1),
                l = 0,
                a = 0,
                h = 0,
                d = 0,
                u = 0;
            if (
                (((t = g.event.fix(n)).type = "mousewheel"),
                "detail" in n && (h = -1 * n.detail),
                "wheelDelta" in n && (h = n.wheelDelta),
                "wheelDeltaY" in n && (h = n.wheelDeltaY),
                "wheelDeltaX" in n && (a = -1 * n.wheelDeltaX),
                "axis" in n && n.axis === n.HORIZONTAL_AXIS && ((a = -1 * h), (h = 0)),
                (l = 0 === h ? a : h),
                "deltaY" in n && (l = h = -1 * n.deltaY),
                "deltaX" in n && ((a = n.deltaX), 0 === h && (l = -1 * a)),
                0 !== h || 0 !== a)
            )
                return (
                    1 === n.deltaMode
                        ? ((l *= i = g.data(this, "mousewheel-line-height")), (h *= i), (a *= i))
                        : 2 === n.deltaMode && ((l *= s = g.data(this, "mousewheel-page-height")), (h *= s), (a *= s)),
                    (e = Math.max(Math.abs(h), Math.abs(a))),
                    (!m || e < m) && b(n, (m = e)) && (m /= 40),
                    b(n, e) && ((l /= 40), (a /= 40), (h /= 40)),
                    (l = Math[1 <= l ? "floor" : "ceil"](l / m)),
                    (a = Math[1 <= a ? "floor" : "ceil"](a / m)),
                    (h = Math[1 <= h ? "floor" : "ceil"](h / m)),
                    p.settings.normalizeOffset &&
                        this.getBoundingClientRect &&
                        ((o = this.getBoundingClientRect()), (d = t.clientX - o.left), (u = t.clientY - o.top)),
                    (t.deltaX = a),
                    (t.deltaY = h),
                    (t.deltaFactor = m),
                    (t.offsetX = d),
                    (t.offsetY = u),
                    (t.deltaMode = 0),
                    r.unshift(t, l, a, h),
                    c && clearTimeout(c),
                    (c = setTimeout(y, 200)),
                    (g.event.dispatch || g.event.handle).apply(this, r)
                );
        }
        function y() {
            m = null;
        }
        function b(t, e) {
            return p.settings.adjustOldDeltas && "mousewheel" === t.type && e % 120 == 0;
        }
        g.fn.extend({
            mousewheel: function (t) {
                return t ? this.bind("mousewheel", t) : this.trigger("mousewheel");
            },
            unmousewheel: function (t) {
                return this.unbind("mousewheel", t);
            },
        });
    }),
    (function () {
        "use strict";
        var i = {
            mode: "lg-slide",
            cssEasing: "ease",
            easing: "linear",
            speed: 600,
            height: "100%",
            width: "100%",
            addClass: "",
            startClass: "lg-start-zoom",
            backdropDuration: 150,
            hideBarsDelay: 6e3,
            useLeft: !1,
            ariaLabelledby: "",
            ariaDescribedby: "",
            closable: !0,
            loop: !0,
            escKey: !0,
            keyPress: !0,
            controls: !0,
            slideEndAnimatoin: !0,
            hideControlOnEnd: !1,
            mousewheel: !0,
            getCaptionFromTitleOrAlt: !0,
            appendSubHtmlTo: ".lg-sub-html",
            subHtmlSelectorRelative: !1,
            preload: 1,
            showAfterLoad: !0,
            selector: "",
            selectWithin: "",
            nextHtml:
                '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',
            prevHtml:
                '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',
            index: !1,
            iframeMaxWidth: "100%",
            download: !0,
            counter: !0,
            appendCounterTo: ".lg-toolbar",
            swipeThreshold: 50,
            enableSwipe: !0,
            enableDrag: !0,
            dynamic: !1,
            dynamicEl: [],
            galleryId: 1,
        };
        function e(t, e) {
            if (
                ((this.el = t),
                (this.$el = $(t)),
                (this.s = $.extend({}, i, e)),
                this.s.dynamic &&
                    "undefined" !== this.s.dynamicEl &&
                    this.s.dynamicEl.constructor === Array &&
                    !this.s.dynamicEl.length)
            )
                throw "When using dynamic mode, you must also define dynamicEl as an Array.";
            return (
                (this.modules = {}),
                (this.lGalleryOn = !1),
                (this.lgBusy = !1),
                (this.hideBartimeout = !1),
                (this.isTouch = "ontouchstart" in document.documentElement),
                this.s.slideEndAnimatoin && (this.s.hideControlOnEnd = !1),
                this.s.dynamic
                    ? (this.$items = this.s.dynamicEl)
                    : "this" === this.s.selector
                      ? (this.$items = this.$el)
                      : "" !== this.s.selector
                        ? this.s.selectWithin
                            ? (this.$items = $(this.s.selectWithin).find(this.s.selector))
                            : (this.$items = this.$el.find($(this.s.selector)))
                        : (this.$items = this.$el.children()),
                (this.$slide = ""),
                (this.$outer = ""),
                this.init(),
                this
            );
        }
        (e.prototype.init = function () {
            var t = this;
            t.s.preload > t.$items.length && (t.s.preload = t.$items.length);
            var e = window.location.hash;
            0 < e.indexOf("lg=" + this.s.galleryId) &&
                ((t.index = parseInt(e.split("&slide=")[1], 10)),
                $("body").addClass("lg-from-hash"),
                $("body").hasClass("lg-on") ||
                    (setTimeout(function () {
                        t.build(t.index);
                    }),
                    $("body").addClass("lg-on"))),
                t.s.dynamic
                    ? (t.$el.trigger("onBeforeOpen.lg"),
                      (t.index = t.s.index || 0),
                      $("body").hasClass("lg-on") ||
                          setTimeout(function () {
                              t.build(t.index), $("body").addClass("lg-on");
                          }))
                    : t.$items.on("click.lgcustom", function (e) {
                          try {
                              e.preventDefault(), e.preventDefault();
                          } catch (t) {
                              e.returnValue = !1;
                          }
                          t.$el.trigger("onBeforeOpen.lg"),
                              (t.index = t.s.index || t.$items.index(this)),
                              $("body").hasClass("lg-on") || (t.build(t.index), $("body").addClass("lg-on"));
                      });
        }),
            (e.prototype.build = function (t) {
                var e = this;
                e.structure(),
                    $.each($.fn.lightGallery.modules, function (t) {
                        e.modules[t] = new $.fn.lightGallery.modules[t](e.el);
                    }),
                    e.slide(t, !1, !1, !1),
                    e.s.keyPress && e.keyPress(),
                    1 < e.$items.length
                        ? (e.arrow(),
                          setTimeout(function () {
                              e.enableDrag(), e.enableSwipe();
                          }, 50),
                          e.s.mousewheel && e.mousewheel())
                        : e.$slide.on("click.lg", function () {
                              e.$el.trigger("onSlideClick.lg");
                          }),
                    e.counter(),
                    e.closeGallery(),
                    e.$el.trigger("onAfterOpen.lg"),
                    e.$outer.on("mousemove.lg click.lg touchstart.lg", function () {
                        e.$outer.removeClass("lg-hide-items"),
                            clearTimeout(e.hideBartimeout),
                            (e.hideBartimeout = setTimeout(function () {
                                e.$outer.addClass("lg-hide-items");
                            }, e.s.hideBarsDelay));
                    }),
                    e.$outer.trigger("mousemove.lg");
            }),
            (e.prototype.structure = function () {
                var t = "",
                    e = "",
                    i = 0,
                    s = "",
                    o = this;
                for (
                    $("body").append('<div class="lg-backdrop"></div>'),
                        $(".lg-backdrop").css("transition-duration", this.s.backdropDuration + "ms"),
                        i = 0;
                    i < this.$items.length;
                    i++
                )
                    t += '<div class="lg-item"></div>';
                this.s.controls &&
                    1 < this.$items.length &&
                    (e =
                        '<div class="lg-actions"><button aria-label="Previous slide" class="lg-prev lg-icon">' +
                        this.s.prevHtml +
                        '</button><button aria-label="Next slide" class="lg-next lg-icon">' +
                        this.s.nextHtml +
                        "</button></div>"),
                    ".lg-sub-html" === this.s.appendSubHtmlTo &&
                        (s = '<div role="status" aria-live="polite" class="lg-sub-html"></div>');
                var n,
                    r =
                        '<div tabindex="-1" aria-modal="true" ' +
                        (this.s.ariaLabelledby ? 'aria-labelledby="' + this.s.ariaLabelledby + '"' : "") +
                        " " +
                        (this.s.ariaDescribedby ? 'aria-describedby="' + this.s.ariaDescribedby + '"' : "") +
                        ' role="dialog" class="lg-outer ' +
                        this.s.addClass +
                        " " +
                        this.s.startClass +
                        '"><div class="lg" style="width:' +
                        this.s.width +
                        "; height:" +
                        this.s.height +
                        '"><div class="lg-inner">' +
                         t +
                        '</div><div class="lg-toolbar lg-group"><button aria-label="Close gallery" class="lg-close lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div>' +
                        e +
                        s +
                        "</div></div>";
                $("body").append(r),
                    (this.$outer = $(".lg-outer")),
                    this.$outer.focus(),
                    (this.$slide = this.$outer.find(".lg-item")),
                    this.s.useLeft
                        ? (this.$outer.addClass("lg-use-left"), (this.s.mode = "lg-slide"))
                        : this.$outer.addClass("lg-use-css3"),
                    o.setTop(),
                    $(window).on("resize.lg orientationchange.lg", function () {
                        setTimeout(function () {
                            o.setTop();
                        }, 100);
                    }),
                    this.$slide.eq(this.index).addClass("lg-current"),
                    this.doCss()
                        ? this.$outer.addClass("lg-css3")
                        : (this.$outer.addClass("lg-css"), (this.s.speed = 0)),
                    this.$outer.addClass(this.s.mode),
                    this.s.enableDrag && 1 < this.$items.length && this.$outer.addClass("lg-grab"),
                    this.s.showAfterLoad && this.$outer.addClass("lg-show-after-load"),
                    this.doCss() &&
                        ((n = this.$outer.find(".lg-inner")).css("transition-timing-function", this.s.cssEasing),
                        n.css("transition-duration", this.s.speed + "ms")),
                    setTimeout(function () {
                        $(".lg-backdrop").addClass("in");
                    }),
                    setTimeout(function () {
                        o.$outer.addClass("lg-visible");
                    }, this.s.backdropDuration),
                    this.s.download &&
                        this.$outer
                            .find(".lg-toolbar")
                            .append(
                                '<a id="lg-download" aria-label="Download" target="_blank" download class="lg-download lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg></a>'
                            ),
                    (this.prevScrollTop = $(window).scrollTop());
            }),
            (e.prototype.setTop = function () {
                var t, e, i;
                "100%" !== this.s.height &&
                    ((e = ((t = $(window).height()) - parseInt(this.s.height, 10)) / 2),
                    (i = this.$outer.find(".lg")),
                    t >= parseInt(this.s.height, 10) ? i.css("top", e + "px") : i.css("top", "0px"));
            }),
            (e.prototype.doCss = function () {
                return !!(function () {
                    for (
                        var t = [
                                "transition",
                                "MozTransition",
                                "WebkitTransition",
                                "OTransition",
                                "msTransition",
                                "KhtmlTransition",
                            ],
                            e = document.documentElement,
                            i = 0,
                            i = 0;
                        i < t.length;
                        i++
                    )
                        if (t[i] in e.style) return !0;
                })();
            }),
            (e.prototype.isVideo = function (t, e) {
                var i = this.s.dynamic ? this.s.dynamicEl[e].html : this.$items.eq(e).attr("data-html");
                if (!t)
                    return i
                        ? { html5: !0 }
                        : (console.error(
                              "lightGallery :- data-src is not provided on slide item " +
                                  (e + 1) +
                                  ". Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html"
                          ),
                          !1);
                var s = t.match(
                        /\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i
                    ),
                    o = t.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i),
                    n = t.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i),
                    r = t.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);
                return s ? { youtube: s } : o ? { vimeo: o } : n ? { dailymotion: n } : r ? { vk: r } : void 0;
            }),
            (e.prototype.counter = function () {
                this.s.counter &&
                    $(this.s.appendCounterTo).append(
                        '<div id="lg-counter" role="status" aria-live="polite"><span id="lg-counter-current">' +
                            (parseInt(this.index, 10) + 1) +
                            '</span> / <span id="lg-counter-all">' +
                            this.$items.length +
                            "</span></div>"
                    );
            }),
            (e.prototype.addHtml = function (t) {
                var e,
                    i,
                    s,
                    o = null;
                this.s.dynamic
                    ? this.s.dynamicEl[t].subHtmlUrl
                        ? (e = this.s.dynamicEl[t].subHtmlUrl)
                        : (o = this.s.dynamicEl[t].subHtml)
                    : (i = this.$items.eq(t)).attr("data-sub-html-url")
                      ? (e = i.attr("data-sub-html-url"))
                      : ((o = i.attr("data-sub-html")),
                        this.s.getCaptionFromTitleOrAlt &&
                            !o &&
                            (o = i.attr("title") || i.find("img").first().attr("alt"))),
                    e ||
                        (null != o
                            ? ("." !== (s = o.substring(0, 1)) && "#" !== s) ||
                              (o = this.s.subHtmlSelectorRelative && !this.s.dynamic ? i.find(o).html() : $(o).html())
                            : (o = "")),
                    ".lg-sub-html" === this.s.appendSubHtmlTo
                        ? e
                            ? this.$outer.find(this.s.appendSubHtmlTo).load(e)
                            : this.$outer.find(this.s.appendSubHtmlTo).html(o)
                        : e
                          ? this.$slide.eq(t).load(e)
                          : this.$slide.eq(t).append(o),
                    null != o &&
                        ("" === o
                            ? this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html")
                            : this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),
                    this.$el.trigger("onAfterAppendSubHtml.lg", [t]);
            }),
            (e.prototype.preload = function (t) {
                for (var e = 1, i = 1, e = 1; e <= this.s.preload && !(e >= this.$items.length - t); e++)
                    this.loadContent(t + e, !1, 0);
                for (i = 1; i <= this.s.preload && !(t - i < 0); i++) this.loadContent(t - i, !1, 0);
            }),
            (e.prototype.loadContent = function (e, t, i) {
                function s(t) {
                    for (var e = [], i = [], s = 0; s < t.length; s++) {
                        var o = t[s].split(" ");
                        "" === o[0] && o.splice(0, 1), i.push(o[0]), e.push(o[1]);
                    }
                    for (var n = $(window).width(), r = 0; r < e.length; r++)
                        if (parseInt(e[r], 10) > n) {
                            l = i[r];
                            break;
                        }
                }
                var o,
                    l,
                    n,
                    r,
                    a,
                    h,
                    d,
                    u = this,
                    g = !1,
                    c = u.s.dynamic
                        ? (u.s.dynamicEl[e].poster && ((g = !0), (n = u.s.dynamicEl[e].poster)),
                          (a = u.s.dynamicEl[e].html),
                          (l = u.s.dynamicEl[e].src),
                          (h = u.s.dynamicEl[e].alt),
                          u.s.dynamicEl[e].responsive && s(u.s.dynamicEl[e].responsive.split(",")),
                          (r = u.s.dynamicEl[e].srcset),
                          u.s.dynamicEl[e].sizes)
                        : ((d = u.$items.eq(e)).attr("data-poster") && ((g = !0), (n = d.attr("data-poster"))),
                          (a = d.attr("data-html")),
                          (l = d.attr("href") || d.attr("data-src")),
                          (h = d.attr("title") || d.find("img").first().attr("alt")),
                          d.attr("data-responsive") && s(d.attr("data-responsive").split(",")),
                          (r = d.attr("data-srcset")),
                          d.attr("data-sizes")),
                    m = !1;
                u.s.dynamic
                    ? u.s.dynamicEl[e].iframe && (m = !0)
                    : "true" === u.$items.eq(e).attr("data-iframe") && (m = !0);
                var f,
                    p = u.isVideo(l, e);
                if (!u.$slide.eq(e).hasClass("lg-loaded")) {
                    if (
                        (m
                            ? u.$slide
                                  .eq(e)
                                  .prepend(
                                      '<div class="lg-video-cont lg-has-iframe" style="max-width:' +
                                          u.s.iframeMaxWidth +
                                          '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' +
                                          l +
                                          '"  allowfullscreen="true"></iframe></div></div>'
                                  )
                            : g
                              ? ((f = ""),
                                (f =
                                    p && p.youtube ? "lg-has-youtube" : p && p.vimeo ? "lg-has-vimeo" : "lg-has-html5"),
                                u.$slide
                                    .eq(e)
                                    .prepend(
                                        '<div class="lg-video-cont ' +
                                            f +
                                            ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' +
                                            n +
                                            '" /></div></div>'
                                    ))
                              : p
                                ? (u.$slide
                                      .eq(e)
                                      .prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'),
                                  u.$el.trigger("hasVideo.lg", [e, l, a]))
                                : ((h = h ? 'alt="' + h + '"' : ""),
                                  u.$slide
                                      .eq(e)
                                      .prepend(
                                          '<div class="lg-img-wrap"><img class="lg-object lg-image" ' +
                                              h +
                                              ' src="' +
                                              l +
                                              '" /></div>'
                                      )),
                        u.$el.trigger("onAferAppendSlide.lg", [e]),
                        (o = u.$slide.eq(e).find(".lg-object")),
                        c && o.attr("sizes", c),
                        r)
                    ) {
                        o.attr("srcset", r);
                        try {
                            picturefill({ elements: [o[0]] });
                        } catch (t) {
                            console.warn(
                                "lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document."
                            );
                        }
                    }
                    ".lg-sub-html" !== this.s.appendSubHtmlTo && u.addHtml(e), u.$slide.eq(e).addClass("lg-loaded");
                }
                u.$slide
                    .eq(e)
                    .find(".lg-object")
                    .on("load.lg error.lg", function () {
                        var t = 0;
                        i && !$("body").hasClass("lg-from-hash") && (t = i),
                            setTimeout(function () {
                                u.$slide.eq(e).addClass("lg-complete"),
                                    u.$el.trigger("onSlideItemLoad.lg", [e, i || 0]);
                            }, t);
                    }),
                    p && p.html5 && !g && u.$slide.eq(e).addClass("lg-complete"),
                    !0 === t &&
                        (u.$slide.eq(e).hasClass("lg-complete")
                            ? u.preload(e)
                            : u.$slide
                                  .eq(e)
                                  .find(".lg-object")
                                  .on("load.lg error.lg", function () {
                                      u.preload(e);
                                  }));
            }),
            (e.prototype.slide = function (t, e, i, s) {
                var o,
                    n,
                    r,
                    l,
                    a,
                    h = this.$outer.find(".lg-current").index(),
                    d = this;
                (d.lGalleryOn && h === t) ||
                    ((o = this.$slide.length),
                    (n = d.lGalleryOn ? this.s.speed : 0),
                    d.lgBusy ||
                        (this.s.download &&
                            ((r = d.s.dynamic
                                ? !1 !== d.s.dynamicEl[t].downloadUrl &&
                                  (d.s.dynamicEl[t].downloadUrl || d.s.dynamicEl[t].src)
                                : "false" !== d.$items.eq(t).attr("data-download-url") &&
                                  (d.$items.eq(t).attr("data-download-url") ||
                                      d.$items.eq(t).attr("href") ||
                                      d.$items.eq(t).attr("data-src")))
                                ? ($("#lg-download").attr("href", r), d.$outer.removeClass("lg-hide-download"))
                                : d.$outer.addClass("lg-hide-download")),
                        this.$el.trigger("onBeforeSlide.lg", [h, t, e, i]),
                        (d.lgBusy = !0),
                        clearTimeout(d.hideBartimeout),
                        ".lg-sub-html" === this.s.appendSubHtmlTo &&
                            setTimeout(function () {
                                d.addHtml(t);
                            }, n),
                        this.arrowDisable(t),
                        s || (t < h ? (s = "prev") : h < t && (s = "next")),
                        e
                            ? (this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),
                              2 < o
                                  ? ((l = t - 1),
                                    (a = t + 1),
                                    ((0 === t && h === o - 1) || (t === o - 1 && 0 === h)) && ((a = 0), (l = o - 1)))
                                  : ((l = 0), (a = 1)),
                              "prev" === s
                                  ? d.$slide.eq(a).addClass("lg-next-slide")
                                  : d.$slide.eq(l).addClass("lg-prev-slide"),
                              d.$slide.eq(t).addClass("lg-current"))
                            : (d.$outer.addClass("lg-no-trans"),
                              this.$slide.removeClass("lg-prev-slide lg-next-slide"),
                              "prev" === s
                                  ? (this.$slide.eq(t).addClass("lg-prev-slide"),
                                    this.$slide.eq(h).addClass("lg-next-slide"))
                                  : (this.$slide.eq(t).addClass("lg-next-slide"),
                                    this.$slide.eq(h).addClass("lg-prev-slide")),
                              setTimeout(function () {
                                  d.$slide.removeClass("lg-current"),
                                      d.$slide.eq(t).addClass("lg-current"),
                                      d.$outer.removeClass("lg-no-trans");
                              }, 50)),
                        d.lGalleryOn
                            ? (setTimeout(function () {
                                  d.loadContent(t, !0, 0);
                              }, this.s.speed + 50),
                              setTimeout(function () {
                                  (d.lgBusy = !1), d.$el.trigger("onAfterSlide.lg", [h, t, e, i]);
                              }, this.s.speed))
                            : (d.loadContent(t, !0, d.s.backdropDuration),
                              (d.lgBusy = !1),
                              d.$el.trigger("onAfterSlide.lg", [h, t, e, i])),
                        (d.lGalleryOn = !0),
                        this.s.counter && $("#lg-counter-current").text(t + 1)),
                    (d.index = t));
            }),
            (e.prototype.goToNextSlide = function (t) {
                var e = this,
                    i = e.s.loop;
                t && e.$slide.length < 3 && (i = !1),
                    e.lgBusy ||
                        (e.index + 1 < e.$slide.length
                            ? (e.index++,
                              e.$el.trigger("onBeforeNextSlide.lg", [e.index]),
                              e.slide(e.index, t, !1, "next"))
                            : i
                              ? ((e.index = 0),
                                e.$el.trigger("onBeforeNextSlide.lg", [e.index]),
                                e.slide(e.index, t, !1, "next"))
                              : e.s.slideEndAnimatoin &&
                                !t &&
                                (e.$outer.addClass("lg-right-end"),
                                setTimeout(function () {
                                    e.$outer.removeClass("lg-right-end");
                                }, 400)));
            }),
            (e.prototype.goToPrevSlide = function (t) {
                var e = this,
                    i = e.s.loop;
                t && e.$slide.length < 3 && (i = !1),
                    e.lgBusy ||
                        (0 < e.index
                            ? (e.index--,
                              e.$el.trigger("onBeforePrevSlide.lg", [e.index, t]),
                              e.slide(e.index, t, !1, "prev"))
                            : i
                              ? ((e.index = e.$items.length - 1),
                                e.$el.trigger("onBeforePrevSlide.lg", [e.index, t]),
                                e.slide(e.index, t, !1, "prev"))
                              : e.s.slideEndAnimatoin &&
                                !t &&
                                (e.$outer.addClass("lg-left-end"),
                                setTimeout(function () {
                                    e.$outer.removeClass("lg-left-end");
                                }, 400)));
            }),
            (e.prototype.keyPress = function () {
                var e = this;
                1 < this.$items.length &&
                    $(window).on("keyup.lg", function (t) {
                        1 < e.$items.length &&
                            (37 === t.keyCode && (t.preventDefault(), e.goToPrevSlide()),
                            39 === t.keyCode && (t.preventDefault(), e.goToNextSlide()));
                    }),
                    $(window).on("keydown.lg", function (t) {
                        !0 === e.s.escKey &&
                            27 === t.keyCode &&
                            (t.preventDefault(),
                            e.$outer.hasClass("lg-thumb-open") ? e.$outer.removeClass("lg-thumb-open") : e.destroy());
                    });
            }),
            (e.prototype.arrow = function () {
                var t = this;
                this.$outer.find(".lg-prev").on("click.lg", function () {
                    t.goToPrevSlide();
                }),
                    this.$outer.find(".lg-next").on("click.lg", function () {
                        t.goToNextSlide();
                    });
            }),
            (e.prototype.arrowDisable = function (t) {
                !this.s.loop &&
                    this.s.hideControlOnEnd &&
                    (t + 1 < this.$slide.length
                        ? this.$outer.find(".lg-next").removeAttr("disabled").removeClass("disabled")
                        : this.$outer.find(".lg-next").attr("disabled", "disabled").addClass("disabled"),
                    0 < t
                        ? this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled")
                        : this.$outer.find(".lg-prev").attr("disabled", "disabled").addClass("disabled"));
            }),
            (e.prototype.setTranslate = function (t, e, i) {
                this.s.useLeft ? t.css("left", e) : t.css({ transform: "translate3d(" + e + "px, " + i + "px, 0px)" });
            }),
            (e.prototype.touchMove = function (t, e) {
                var i = e - t;
                15 < Math.abs(i) &&
                    (this.$outer.addClass("lg-dragging"),
                    this.setTranslate(this.$slide.eq(this.index), i, 0),
                    this.setTranslate($(".lg-prev-slide"), -this.$slide.eq(this.index).width() + i, 0),
                    this.setTranslate($(".lg-next-slide"), this.$slide.eq(this.index).width() + i, 0));
            }),
            (e.prototype.touchEnd = function (t) {
                var e = this;
                "lg-slide" !== e.s.mode && e.$outer.addClass("lg-slide"),
                    this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity", "0"),
                    setTimeout(function () {
                        e.$outer.removeClass("lg-dragging"),
                            t < 0 && Math.abs(t) > e.s.swipeThreshold
                                ? e.goToNextSlide(!0)
                                : 0 < t && Math.abs(t) > e.s.swipeThreshold
                                  ? e.goToPrevSlide(!0)
                                  : Math.abs(t) < 5 && e.$el.trigger("onSlideClick.lg"),
                            e.$slide.removeAttr("style");
                    }),
                    setTimeout(function () {
                        e.$outer.hasClass("lg-dragging") || "lg-slide" === e.s.mode || e.$outer.removeClass("lg-slide");
                    }, e.s.speed + 100);
            }),
            (e.prototype.enableSwipe = function () {
                var e = this,
                    i = 0,
                    s = 0,
                    o = !1;
                e.s.enableSwipe &&
                    e.doCss() &&
                    (e.$slide.on("touchstart.lg", function (t) {
                        e.$outer.hasClass("lg-zoomed") ||
                            e.lgBusy ||
                            (t.preventDefault(), e.manageSwipeClass(), (i = t.originalEvent.targetTouches[0].pageX));
                    }),
                    e.$slide.on("touchmove.lg", function (t) {
                        e.$outer.hasClass("lg-zoomed") ||
                            (t.preventDefault(),
                            (s = t.originalEvent.targetTouches[0].pageX),
                            e.touchMove(i, s),
                            (o = !0));
                    }),
                    e.$slide.on("touchend.lg", function () {
                        e.$outer.hasClass("lg-zoomed") ||
                            (o ? ((o = !1), e.touchEnd(s - i)) : e.$el.trigger("onSlideClick.lg"));
                    }));
            }),
            (e.prototype.enableDrag = function () {
                var e = this,
                    i = 0,
                    s = 0,
                    o = !1,
                    n = !1;
                e.s.enableDrag &&
                    e.doCss() &&
                    (e.$slide.on("mousedown.lg", function (t) {
                        e.$outer.hasClass("lg-zoomed") ||
                            e.lgBusy ||
                            $(t.target).text().trim() ||
                            (t.preventDefault(),
                            e.manageSwipeClass(),
                            (i = t.pageX),
                            (o = !0),
                            (e.$outer.scrollLeft += 1),
                            --e.$outer.scrollLeft,
                            e.$outer.removeClass("lg-grab").addClass("lg-grabbing"),
                            e.$el.trigger("onDragstart.lg"));
                    }),
                    $(window).on("mousemove.lg", function (t) {
                        o && ((n = !0), (s = t.pageX), e.touchMove(i, s), e.$el.trigger("onDragmove.lg"));
                    }),
                    $(window).on("mouseup.lg", function (t) {
                        n
                            ? ((n = !1), e.touchEnd(s - i), e.$el.trigger("onDragend.lg"))
                            : ($(t.target).hasClass("lg-object") || $(t.target).hasClass("lg-video-play")) &&
                              e.$el.trigger("onSlideClick.lg"),
                            o && ((o = !1), e.$outer.removeClass("lg-grabbing").addClass("lg-grab"));
                    }));
            }),
            (e.prototype.manageSwipeClass = function () {
                var t = this.index + 1,
                    e = this.index - 1;
                this.s.loop &&
                    2 < this.$slide.length &&
                    (0 === this.index
                        ? (e = this.$slide.length - 1)
                        : this.index === this.$slide.length - 1 && (t = 0)),
                    this.$slide.removeClass("lg-next-slide lg-prev-slide"),
                    -1 < e && this.$slide.eq(e).addClass("lg-prev-slide"),
                    this.$slide.eq(t).addClass("lg-next-slide");
            }),
            (e.prototype.mousewheel = function () {
                var e = this;
                e.$outer.on("mousewheel.lg", function (t) {
                    t.deltaY && (0 < t.deltaY ? e.goToPrevSlide() : e.goToNextSlide(), t.preventDefault());
                });
            }),
            (e.prototype.closeGallery = function () {
                var e = this,
                    i = !1;
                this.$outer.find(".lg-close").on("click.lg", function () {
                    e.destroy();
                }),
                    e.s.closable &&
                        (e.$outer.on("mousedown.lg", function (t) {
                            i = !!(
                                $(t.target).is(".lg-outer") ||
                                $(t.target).is(".lg-item ") ||
                                $(t.target).is(".lg-img-wrap")
                            );
                        }),
                        e.$outer.on("mousemove.lg", function () {
                            i = !1;
                        }),
                        e.$outer.on("mouseup.lg", function (t) {
                            ($(t.target).is(".lg-outer") ||
                                $(t.target).is(".lg-item ") ||
                                ($(t.target).is(".lg-img-wrap") && i)) &&
                                (e.$outer.hasClass("lg-dragging") || e.destroy());
                        }));
            }),
            (e.prototype.destroy = function (t) {
                var e = this;
                t || (e.$el.trigger("onBeforeClose.lg"), $(window).scrollTop(e.prevScrollTop)),
                    t &&
                        (e.s.dynamic || this.$items.off("click.lg click.lgcustom"), $.removeData(e.el, "lightGallery")),
                    this.$el.off(".lg.tm"),
                    $.each($.fn.lightGallery.modules, function (t) {
                        e.modules[t] && e.modules[t].destroy();
                    }),
                    (this.lGalleryOn = !1),
                    clearTimeout(e.hideBartimeout),
                    (this.hideBartimeout = !1),
                    $(window).off(".lg"),
                    $("body").removeClass("lg-on lg-from-hash"),
                    e.$outer && e.$outer.removeClass("lg-visible"),
                    $(".lg-backdrop").removeClass("in"),
                    setTimeout(function () {
                        e.$outer && e.$outer.remove(),
                            $(".lg-backdrop").remove(),
                            t || e.$el.trigger("onCloseAfter.lg"),
                            e.$el.focus();
                    }, e.s.backdropDuration + 50);
            }),
            ($.fn.lightGallery = function (t) {
                return this.each(function () {
                    if ($.data(this, "lightGallery"))
                        try {
                            $(this).data("lightGallery").init();
                        } catch (t) {
                            console.error("lightGallery has not initiated properly");
                        }
                    else $.data(this, "lightGallery", new e(this, t));
                });
            }),
            ($.fn.lightGallery.modules = {});
    })(),
    (function (t, e) {
        "function" == typeof define && define.amd
            ? define(["jquery"], e)
            : "object" == typeof module && module.exports
              ? (module.exports = e(require("jquery")))
              : e(t.jQuery);
    })(this, function (i) {
        !(function () {
            "use strict";
            function t(t) {
                return (
                    (this.core = i(t).data("lightGallery")),
                    (this.$el = i(t)),
                    !(this.core.$items.length < 2) &&
                        ((this.core.s = i.extend({}, e, this.core.s)),
                        (this.interval = !1),
                        (this.fromAuto = !0),
                        (this.canceledOnTouch = !1),
                        (this.fourceAutoplayTemp = this.core.s.fourceAutoplay),
                        this.core.doCss() || (this.core.s.progressBar = !1),
                        this.init(),
                        this)
                );
            }
            var e = {
                autoplay: !1,
                pause: 5e3,
                progressBar: !0,
                fourceAutoplay: !1,
                autoplayControls: !0,
                appendAutoplayControlsTo: ".lg-toolbar",
            };
            (t.prototype.init = function () {
                var t = this;
                t.core.s.autoplayControls && t.controls(),
                    t.core.s.progressBar &&
                        t.core.$outer
                            .find(".lg")
                            .append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),
                    t.progress(),
                    t.core.s.autoplay &&
                        t.$el.one("onSlideItemLoad.lg.tm", function () {
                            t.startlAuto();
                        }),
                    t.$el.on("onDragstart.lg.tm touchstart.lg.tm", function () {
                        t.interval && (t.cancelAuto(), (t.canceledOnTouch = !0));
                    }),
                    t.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm", function () {
                        !t.interval && t.canceledOnTouch && (t.startlAuto(), (t.canceledOnTouch = !1));
                    });
            }),
                (t.prototype.progress = function () {
                    var t,
                        e,
                        i = this;
                    i.$el.on("onBeforeSlide.lg.tm", function () {
                        i.core.s.progressBar &&
                            i.fromAuto &&
                            ((t = i.core.$outer.find(".lg-progress-bar")),
                            (e = i.core.$outer.find(".lg-progress")),
                            i.interval &&
                                (e.removeAttr("style"),
                                t.removeClass("lg-start"),
                                setTimeout(function () {
                                    e.css("transition", "width " + (i.core.s.speed + i.core.s.pause) + "ms ease 0s"),
                                        t.addClass("lg-start");
                                }, 20))),
                            i.fromAuto || i.core.s.fourceAutoplay || i.cancelAuto(),
                            (i.fromAuto = !1);
                    });
                }),
                (t.prototype.controls = function () {
                    var t = this;
                    i(this.core.s.appendAutoplayControlsTo).append(
                        '<button aria-label="Toggle autoplay" class="lg-autoplay-button lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg></button>'
                    ),
                        t.core.$outer.find(".lg-autoplay-button").on("click.lg", function () {
                            i(t.core.$outer).hasClass("lg-show-autoplay")
                                ? (t.cancelAuto(), (t.core.s.fourceAutoplay = !1))
                                : t.interval || (t.startlAuto(), (t.core.s.fourceAutoplay = t.fourceAutoplayTemp));
                        });
                }),
                (t.prototype.startlAuto = function () {
                    var t = this;
                    t.core.$outer
                        .find(".lg-progress")
                        .css("transition", "width " + (t.core.s.speed + t.core.s.pause) + "ms ease 0s"),
                        t.core.$outer.addClass("lg-show-autoplay"),
                        t.core.$outer.find(".lg-progress-bar").addClass("lg-start"),
                        t.core.$outer
                            .find(".lg-autoplay-button")
                            .html(
                                '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>'
                            ),
                        (t.interval = setInterval(function () {
                            t.core.index + 1 < t.core.$items.length ? t.core.index++ : (t.core.index = 0),
                                (t.fromAuto = !0),
                                t.core.slide(t.core.index, !1, !1, "next");
                        }, t.core.s.speed + t.core.s.pause));
                }),
                (t.prototype.cancelAuto = function () {
                    clearInterval(this.interval),
                        (this.interval = !1),
                        this.core.$outer.find(".lg-progress").removeAttr("style"),
                        this.core.$outer.removeClass("lg-show-autoplay"),
                        this.core.$outer.find(".lg-progress-bar").removeClass("lg-start"),
                        this.core.$outer
                            .find(".lg-autoplay-button")
                            .html(
                                '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>'
                            );
                }),
                (t.prototype.destroy = function () {
                    this.cancelAuto(), this.core.$outer.find(".lg-progress-bar").remove();
                }),
                (i.fn.lightGallery.modules.autoplay = t);
        })();
    }),
    (function (t, e) {
        "function" == typeof define && define.amd
            ? define(["jquery"], e)
            : "object" == typeof module && module.exports
              ? (module.exports = e(require("jquery")))
              : e(t.jQuery);
    })(this, function (s) {
        !(function () {
            "use strict";
            var e = { fullScreen: !0 };
            function i() {
                return (
                    document.fullscreenElement ||
                    document.mozFullScreenElement ||
                    document.webkitFullscreenElement ||
                    document.msFullscreenElement
                );
            }
            function t(t) {
                return (
                    (this.core = s(t).data("lightGallery")),
                    (this.$el = s(t)),
                    (this.core.s = s.extend({}, e, this.core.s)),
                    this.init(),
                    this
                );
            }
            (t.prototype.init = function () {
                var t = "";
                if (this.core.s.fullScreen) {
                    if (
                        !(
                            document.fullscreenEnabled ||
                            document.webkitFullscreenEnabled ||
                            document.mozFullScreenEnabled ||
                            document.msFullscreenEnabled
                        )
                    )
                        return;
                    (t = '<button aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg></button>'),
                        this.core.$outer.find(".lg-toolbar").append(t),
                        this.fullScreen();
                }
            }),
                (t.prototype.requestFullscreen = function () {
                    var t = document.documentElement;
                    t.requestFullscreen
                        ? t.requestFullscreen()
                        : t.msRequestFullscreen
                          ? t.msRequestFullscreen()
                          : t.mozRequestFullScreen
                            ? t.mozRequestFullScreen()
                            : t.webkitRequestFullscreen && t.webkitRequestFullscreen();
                }),
                (t.prototype.exitFullscreen = function () {
                    document.exitFullscreen
                        ? document.exitFullscreen()
                        : document.msExitFullscreen
                          ? document.msExitFullscreen()
                          : document.mozCancelFullScreen
                            ? document.mozCancelFullScreen()
                            : document.webkitExitFullscreen && document.webkitExitFullscreen();
                }),
                (t.prototype.fullScreen = function () {
                    var t = this;
                    s(document).on(
                        "fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg",
                        function () {
                            t.core.$outer.toggleClass("lg-fullscreen-on");
                        }
                    ),
                        this.core.$outer.find(".lg-fullscreen").on("click.lg", function () {
                            i() ? t.exitFullscreen() : t.requestFullscreen();
                        });
                }),
                (t.prototype.destroy = function () {
                    i() && this.exitFullscreen(),
                        s(document).off(
                            "fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg"
                        );
                }),
                (s.fn.lightGallery.modules.fullscreen = t);
        })();
    }),
    (function (t) {
        "function" == typeof define && define.amd
            ? define(["jquery"], t)
            : "object" == typeof exports
              ? (module.exports = t(require("jquery")))
              : t(jQuery);
    })(function (i) {
        !(function () {
            "use strict";
            function t(t) {
                return (
                    (this.core = i(t).data("lightGallery")),
                    (this.core.s = i.extend({}, e, this.core.s)),
                    this.core.s.hash && ((this.oldHash = window.location.hash), this.init()),
                    this
                );
            }
            var e = { hash: !0 };
            (t.prototype.init = function () {
                var e,
                    s = this;
                s.core.$el.on("onAfterSlide.lg.tm", function (t, e, i) {
                    history.replaceState
                        ? history.replaceState(
                              null,
                              null,
                              window.location.pathname +
                                  window.location.search +
                                  "#lg=" +
                                  s.core.s.galleryId +
                                  "&slide=" +
                                  i
                          )
                        : (window.location.hash = "lg=" + s.core.s.galleryId + "&slide=" + i);
                }),
                    i(window).on("hashchange.lg.hash", function () {
                        e = window.location.hash;
                        var t = parseInt(e.split("&slide=")[1], 10);
                        -1 < e.indexOf("lg=" + s.core.s.galleryId)
                            ? s.core.slide(t, !1, !1)
                            : s.core.lGalleryOn && s.core.destroy();
                    });
            }),
                (t.prototype.destroy = function () {
                    this.core.s.hash &&
                        (this.oldHash && this.oldHash.indexOf("lg=" + this.core.s.galleryId) < 0
                            ? history.replaceState
                                ? history.replaceState(null, null, this.oldHash)
                                : (window.location.hash = this.oldHash)
                            : history.replaceState
                              ? history.replaceState(
                                    null,
                                    document.title,
                                    window.location.pathname + window.location.search
                                )
                              : (window.location.hash = ""),
                        this.core.$el.off(".lg.hash"));
                }),
                (i.fn.lightGallery.modules.hash = t);
        })();
    }),
    (function (t) {
        "function" == typeof define && define.amd
            ? define(["jquery"], t)
            : "object" == typeof exports
              ? (module.exports = t(require("jquery")))
              : t(jQuery);
    })(function (r) {
        !(function () {
            "use strict";
            function t(t) {
                return (
                    (this.core = r(t).data("lightGallery")),
                    (this.$el = r(t)),
                    (this.core.s = r.extend({}, e, this.core.s)),
                    this.core.s.pager && 1 < this.core.$items.length && this.init(),
                    this
                );
            }
            var e = { pager: !1 };
            (t.prototype.init = function () {
                var s,
                    t,
                    e,
                    i = this,
                    o = "";
                if ((i.core.$outer.find(".lg").append('<div class="lg-pager-outer"></div>'), i.core.s.dynamic))
                    for (var n = 0; n < i.core.s.dynamicEl.length; n++)
                        o +=
                            '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' +
                            i.core.s.dynamicEl[n].thumb +
                            '" /></div></span>';
                else
                    i.core.$items.each(function () {
                        i.core.s.exThumbImage
                            ? (o +=
                                  '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' +
                                  r(this).attr(i.core.s.exThumbImage) +
                                  '" /></div></span>')
                            : (o +=
                                  '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' +
                                  r(this).find("img").attr("src") +
                                  '" /></div></span>');
                    });
                (t = i.core.$outer.find(".lg-pager-outer")).html(o),
                    (s = i.core.$outer.find(".lg-pager-cont")).on("click.lg touchend.lg", function () {
                        var t = r(this);
                        (i.core.index = t.index()), i.core.slide(i.core.index, !1, !0, !1);
                    }),
                    t.on("mouseover.lg", function () {
                        clearTimeout(e), t.addClass("lg-pager-hover");
                    }),
                    t.on("mouseout.lg", function () {
                        e = setTimeout(function () {
                            t.removeClass("lg-pager-hover");
                        });
                    }),
                    i.core.$el.on("onBeforeSlide.lg.tm", function (t, e, i) {
                        s.removeClass("lg-pager-active"), s.eq(i).addClass("lg-pager-active");
                    });
            }),
                (t.prototype.destroy = function () {}),
                (r.fn.lightGallery.modules.pager = t);
        })();
    }),
    (function (t, e) {
        "function" == typeof define && define.amd
            ? define(["jquery"], e)
            : "object" == typeof module && module.exports
              ? (module.exports = e(require("jquery")))
              : e(t.jQuery);
    })(this, function (h) {
        !(function () {
            "use strict";
            function t(t) {
                return (
                    (this.core = h(t).data("lightGallery")),
                    (this.core.s = h.extend({}, e, this.core.s)),
                    (this.$el = h(t)),
                    (this.$thumbOuter = null),
                    (this.thumbOuterWidth = 0),
                    (this.thumbTotalWidth =
                        this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)),
                    (this.thumbIndex = this.core.index),
                    this.core.s.animateThumb && (this.core.s.thumbHeight = "100%"),
                    (this.left = 0),
                    this.init(),
                    this
                );
            }
            var e = {
                thumbnail: !0,
                animateThumb: !0,
                currentPagerPosition: "middle",
                thumbWidth: 100,
                thumbHeight: "80px",
                thumbContHeight: 100,
                thumbMargin: 5,
                exThumbImage: !1,
                showThumbByDefault: !0,
                toogleThumb: !0,
                pullCaptionUp: !0,
                enableThumbDrag: !0,
                enableThumbSwipe: !0,
                swipeThreshold: 50,
                loadYoutubeThumbnail: !0,
                youtubeThumbSize: 1,
                loadVimeoThumbnail: !0,
                vimeoThumbSize: "thumbnail_small",
                loadDailymotionThumbnail: !0,
            };
            (t.prototype.init = function () {
                var t = this;
                this.core.s.thumbnail &&
                    1 < this.core.$items.length &&
                    (this.core.s.showThumbByDefault &&
                        setTimeout(function () {
                            t.core.$outer.addClass("lg-thumb-open");
                        }, 700),
                    this.core.s.pullCaptionUp && this.core.$outer.addClass("lg-pull-caption-up"),
                    this.build(),
                    this.core.s.animateThumb && this.core.doCss()
                        ? (this.core.s.enableThumbDrag && this.enableThumbDrag(),
                          this.core.s.enableThumbSwipe && this.enableThumbSwipe(),
                          (this.thumbClickable = !1))
                        : (this.thumbClickable = !0),
                    this.toogle(),
                    this.thumbkeyPress());
            }),
                (t.prototype.build = function () {
                    var t,
                        r = this,
                        l = "",
                        a = "";
                    switch (this.core.s.vimeoThumbSize) {
                        case "thumbnail_large":
                            a = "640";
                            break;
                        case "thumbnail_medium":
                            a = "200x150";
                            break;
                        case "thumbnail_small":
                            a = "100x75";
                    }
                    function e(t, e, i) {
                        var s,
                            o = r.core.isVideo(t, i) || {},
                            n = "";
                        o.youtube || o.vimeo || o.dailymotion
                            ? o.youtube
                                ? (s = r.core.s.loadYoutubeThumbnail
                                      ? "//img.youtube.com/vi/" +
                                        o.youtube[1] +
                                        "/" +
                                        r.core.s.youtubeThumbSize +
                                        ".jpg"
                                      : e)
                                : o.vimeo
                                  ? r.core.s.loadVimeoThumbnail
                                      ? ((s = "//i.vimeocdn.com/video/error_" + a + ".jpg"), (n = o.vimeo[1]))
                                      : (s = e)
                                  : o.dailymotion &&
                                    (s = r.core.s.loadDailymotionThumbnail
                                        ? "//www.dailymotion.com/thumbnail/video/" + o.dailymotion[1]
                                        : e)
                            : (s = e),
                            (l +=
                                '<div data-vimeo-id="' +
                                n +
                                '" class="lg-thumb-item" style="width:' +
                                r.core.s.thumbWidth +
                                "px; height: " +
                                r.core.s.thumbHeight +
                                "; margin-right: " +
                                r.core.s.thumbMargin +
                                'px"><img src="' +
                                s +
                                '" /></div>'),
                            (n = "");
                    }
                    if (
                        (r.core.$outer.addClass("lg-has-thumb"),
                        r.core.$outer
                            .find(".lg")
                            .append('<div class="lg-thumb-outer"><div class="lg-thumb lg-group"></div></div>'),
                        (r.$thumbOuter = r.core.$outer.find(".lg-thumb-outer")),
                        (r.thumbOuterWidth = r.$thumbOuter.width()),
                        r.core.s.animateThumb &&
                            r.core.$outer
                                .find(".lg-thumb")
                                .css({ width: r.thumbTotalWidth + "px", position: "relative" }),
                        this.core.s.animateThumb && r.$thumbOuter.css("height", r.core.s.thumbContHeight + "px"),
                        r.core.s.dynamic)
                    )
                        for (var i = 0; i < r.core.s.dynamicEl.length; i++)
                            e(r.core.s.dynamicEl[i].src, r.core.s.dynamicEl[i].thumb, i);
                    else
                        r.core.$items.each(function (t) {
                            r.core.s.exThumbImage
                                ? e(
                                      h(this).attr("href") || h(this).attr("data-src"),
                                      h(this).attr(r.core.s.exThumbImage),
                                      t
                                  )
                                : e(
                                      h(this).attr("href") || h(this).attr("data-src"),
                                      h(this).find("img").attr("src"),
                                      t
                                  );
                        });
                    r.core.$outer.find(".lg-thumb").html(l),
                        (t = r.core.$outer.find(".lg-thumb-item")).each(function () {
                            var e = h(this),
                                t = e.attr("data-vimeo-id");
                            t &&
                                h.getJSON(
                                    "//www.vimeo.com/api/v2/video/" + t + ".json?callback=?",
                                    { format: "json" },
                                    function (t) {
                                        e.find("img").attr("src", t[0][r.core.s.vimeoThumbSize]);
                                    }
                                );
                        }),
                        t.eq(r.core.index).addClass("active"),
                        r.core.$el.on("onBeforeSlide.lg.tm", function () {
                            t.removeClass("active"), t.eq(r.core.index).addClass("active");
                        }),
                        t.on("click.lg touchend.lg", function () {
                            var t = h(this);
                            setTimeout(function () {
                                ((!r.thumbClickable || r.core.lgBusy) && r.core.doCss()) ||
                                    ((r.core.index = t.index()), r.core.slide(r.core.index, !1, !0, !1));
                            }, 50);
                        }),
                        r.core.$el.on("onBeforeSlide.lg.tm", function () {
                            r.animateThumb(r.core.index);
                        }),
                        h(window).on("resize.lg.thumb orientationchange.lg.thumb", function () {
                            setTimeout(function () {
                                r.animateThumb(r.core.index), (r.thumbOuterWidth = r.$thumbOuter.width());
                            }, 200);
                        });
                }),
                (t.prototype.setTranslate = function (t) {
                    this.core.$outer.find(".lg-thumb").css({ transform: "translate3d(-" + t + "px, 0px, 0px)" });
                }),
                (t.prototype.animateThumb = function (t) {
                    var e,
                        i = this.core.$outer.find(".lg-thumb");
                    if (this.core.s.animateThumb) {
                        switch (this.core.s.currentPagerPosition) {
                            case "left":
                                e = 0;
                                break;
                            case "middle":
                                e = this.thumbOuterWidth / 2 - this.core.s.thumbWidth / 2;
                                break;
                            case "right":
                                e = this.thumbOuterWidth - this.core.s.thumbWidth;
                        }
                        (this.left = (this.core.s.thumbWidth + this.core.s.thumbMargin) * t - 1 - e),
                            this.left > this.thumbTotalWidth - this.thumbOuterWidth &&
                                (this.left = this.thumbTotalWidth - this.thumbOuterWidth),
                            this.left < 0 && (this.left = 0),
                            this.core.lGalleryOn
                                ? (i.hasClass("on") ||
                                      this.core.$outer
                                          .find(".lg-thumb")
                                          .css("transition-duration", this.core.s.speed + "ms"),
                                  this.core.doCss() || i.animate({ left: -this.left + "px" }, this.core.s.speed))
                                : this.core.doCss() || i.css("left", -this.left + "px"),
                            this.setTranslate(this.left);
                    }
                }),
                (t.prototype.enableThumbDrag = function () {
                    var e = this,
                        i = 0,
                        s = 0,
                        o = !1,
                        n = !1,
                        r = 0;
                    e.$thumbOuter.addClass("lg-grab"),
                        e.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb", function (t) {
                            e.thumbTotalWidth > e.thumbOuterWidth &&
                                (t.preventDefault(),
                                (i = t.pageX),
                                (o = !0),
                                (e.core.$outer.scrollLeft += 1),
                                --e.core.$outer.scrollLeft,
                                (e.thumbClickable = !1),
                                e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"));
                        }),
                        h(window).on("mousemove.lg.thumb", function (t) {
                            o &&
                                ((r = e.left),
                                (n = !0),
                                (s = t.pageX),
                                e.$thumbOuter.addClass("lg-dragging"),
                                (r -= s - i) > e.thumbTotalWidth - e.thumbOuterWidth &&
                                    (r = e.thumbTotalWidth - e.thumbOuterWidth),
                                r < 0 && (r = 0),
                                e.setTranslate(r));
                        }),
                        h(window).on("mouseup.lg.thumb", function () {
                            n
                                ? ((n = !1),
                                  e.$thumbOuter.removeClass("lg-dragging"),
                                  (e.left = r),
                                  Math.abs(s - i) < e.core.s.swipeThreshold && (e.thumbClickable = !0))
                                : (e.thumbClickable = !0),
                                o && ((o = !1), e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab"));
                        });
                }),
                (t.prototype.enableThumbSwipe = function () {
                    var e = this,
                        i = 0,
                        s = 0,
                        o = !1,
                        n = 0;
                    e.core.$outer.find(".lg-thumb").on("touchstart.lg", function (t) {
                        e.thumbTotalWidth > e.thumbOuterWidth &&
                            (t.preventDefault(), (i = t.originalEvent.targetTouches[0].pageX), (e.thumbClickable = !1));
                    }),
                        e.core.$outer.find(".lg-thumb").on("touchmove.lg", function (t) {
                            e.thumbTotalWidth > e.thumbOuterWidth &&
                                (t.preventDefault(),
                                (s = t.originalEvent.targetTouches[0].pageX),
                                (o = !0),
                                e.$thumbOuter.addClass("lg-dragging"),
                                (n = e.left),
                                (n -= s - i) > e.thumbTotalWidth - e.thumbOuterWidth &&
                                    (n = e.thumbTotalWidth - e.thumbOuterWidth),
                                n < 0 && (n = 0),
                                e.setTranslate(n));
                        }),
                        e.core.$outer.find(".lg-thumb").on("touchend.lg", function () {
                            e.thumbTotalWidth > e.thumbOuterWidth && o
                                ? ((o = !1),
                                  e.$thumbOuter.removeClass("lg-dragging"),
                                  Math.abs(s - i) < e.core.s.swipeThreshold && (e.thumbClickable = !0),
                                  (e.left = n))
                                : (e.thumbClickable = !0);
                        });
                }),
                (t.prototype.toogle = function () {
                    var t = this;
                    t.core.s.toogleThumb &&
                        (t.core.$outer.addClass("lg-can-toggle"),
                        t.$thumbOuter.append(
                            '<button aria-label="Toggle thumbnails" class="lg-toogle-thumb lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg></button>'
                        ),
                        t.core.$outer.find(".lg-toogle-thumb").on("click.lg", function () {
                            t.core.$outer.toggleClass("lg-thumb-open");
                        }));
                }),
                (t.prototype.thumbkeyPress = function () {
                    var e = this;
                    h(window).on("keydown.lg.thumb", function (t) {
                        38 === t.keyCode
                            ? (t.preventDefault(), e.core.$outer.addClass("lg-thumb-open"))
                            : 40 === t.keyCode && (t.preventDefault(), e.core.$outer.removeClass("lg-thumb-open"));
                    });
                }),
                (t.prototype.destroy = function () {
                    this.core.s.thumbnail &&
                        1 < this.core.$items.length &&
                        (h(window).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),
                        this.$thumbOuter.remove(),
                        this.core.$outer.removeClass("lg-has-thumb"));
                }),
                (h.fn.lightGallery.modules.Thumbnail = t);
        })();
    }),
    (function (t, e) {
        "function" == typeof define && define.amd
            ? define(["jquery"], e)
            : "object" == typeof module && module.exports
              ? (module.exports = e(require("jquery")))
              : e(t.jQuery);
    })(this, function (u) {
        !(function () {
            "use strict";
            function t(t) {
                return (
                    (this.core = u(t).data("lightGallery")),
                    (this.core.s = u.extend({}, s, this.core.s)),
                    this.core.s.zoom &&
                        this.core.doCss() &&
                        (this.init(),
                        (this.zoomabletimeout = !1),
                        (this.pageX = u(window).width() / 2),
                        (this.pageY = u(window).height() / 2 + u(window).scrollTop())),
                    this
                );
            }
            var e,
                i,
                s = {
                    scale: 1,
                    zoom: !0,
                    actualSize: !0,
                    enableZoomAfter: 300,
                    useLeftForZoom:
                        ((e = !1),
                        (i = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)) &&
                            parseInt(i[2], 10) < 54 &&
                            (e = !0),
                        e),
                };
            (t.prototype.init = function () {
                var r = this,
                    t =
                         '<button aria-label="Zoom in" id="lg-zoom-in" class="lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="11" y1="8" x2="11" y2="14"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg></button><button aria-label="Zoom out" id="lg-zoom-out" class="lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line><line x1="8" y1="11" x2="14" y2="11"></line></svg></button>';
                r.core.s.actualSize &&
                    (t +=
                        '<button aria-label="Actual size" id="lg-actual-size" class="lg-icon"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" y1="3" x2="14" y2="10"></line><line x1="3" y1="21" x2="10" y2="14"></line></svg></button>'),
                    r.core.s.useLeftForZoom
                        ? r.core.$outer.addClass("lg-use-left-for-zoom")
                        : r.core.$outer.addClass("lg-use-transition-for-zoom"),
                    this.core.$outer.find(".lg-toolbar").append(t),
                    r.core.$el.on("onSlideItemLoad.lg.tm.zoom", function (t, e, i) {
                        var s = r.core.s.enableZoomAfter + i;
                        u("body").hasClass("lg-from-hash") && i ? (s = 0) : u("body").removeClass("lg-from-hash"),
                            (r.zoomabletimeout = setTimeout(function () {
                                r.core.$slide.eq(e).addClass("lg-zoomable");
                            }, s + 30));
                    });
                function e(t) {
                    var e = r.core.$outer.find(".lg-current .lg-image"),
                        i = (u(window).width() - e.prop("offsetWidth")) / 2,
                        s = (u(window).height() - e.prop("offsetHeight")) / 2 + u(window).scrollTop(),
                        o = (t - 1) * (r.pageX - i),
                        n = (t - 1) * (r.pageY - s);
                    e.css("transform", "scale3d(" + t + ", " + t + ", 1)").attr("data-scale", t),
                        r.core.s.useLeftForZoom
                            ? e
                                  .parent()
                                  .css({ left: -o + "px", top: -n + "px" })
                                  .attr("data-x", o)
                                  .attr("data-y", n)
                            : e
                                  .parent()
                                  .css("transform", "translate3d(-" + o + "px, -" + n + "px, 0)")
                                  .attr("data-x", o)
                                  .attr("data-y", n);
                }
                function l() {
                    1 < a ? r.core.$outer.addClass("lg-zoomed") : r.resetZoom(), a < 1 && (a = 1), e(a);
                }
                function s(t, e, i, s) {
                    var o = e.prop("offsetWidth"),
                        n = r.core.s.dynamic
                            ? r.core.s.dynamicEl[i].width || e[0].naturalWidth || o
                            : r.core.$items.eq(i).attr("data-width") || e[0].naturalWidth || o;
                    r.core.$outer.hasClass("lg-zoomed") ? (a = 1) : o < n && (a = n / o || 2),
                        s
                            ? ((r.pageX = u(window).width() / 2),
                              (r.pageY = u(window).height() / 2 + u(window).scrollTop()))
                            : ((r.pageX = t.pageX || t.originalEvent.targetTouches[0].pageX),
                              (r.pageY = t.pageY || t.originalEvent.targetTouches[0].pageY)),
                        l(),
                        setTimeout(function () {
                            r.core.$outer.removeClass("lg-grabbing").addClass("lg-grab");
                        }, 10);
                }
                var a = 1,
                    o = !1;
                r.core.$el.on("onAferAppendSlide.lg.tm.zoom", function (t, e) {
                    var i = r.core.$slide.eq(e).find(".lg-image");
                    i.on("dblclick", function (t) {
                        s(t, i, e);
                    }),
                        i.on("touchstart", function (t) {
                            o
                                ? (clearTimeout(o), (o = null), s(t, i, e))
                                : (o = setTimeout(function () {
                                      o = null;
                                  }, 300)),
                                t.preventDefault();
                        });
                }),
                    u(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom", function () {
                        (r.pageX = u(window).width() / 2),
                            (r.pageY = u(window).height() / 2 + u(window).scrollTop()),
                            e(a);
                    }),
                    u("#lg-zoom-out").on("click.lg", function () {
                        r.core.$outer.find(".lg-current .lg-image").length && ((a -= r.core.s.scale), l());
                    }),
                    u("#lg-zoom-in").on("click.lg", function () {
                        r.core.$outer.find(".lg-current .lg-image").length && ((a += r.core.s.scale), l());
                    }),
                    u("#lg-actual-size").on("click.lg", function (t) {
                        s(t, r.core.$slide.eq(r.core.index).find(".lg-image"), r.core.index, !0);
                    }),
                    r.core.$el.on("onBeforeSlide.lg.tm", function () {
                        (a = 1), r.resetZoom();
                    }),
                    r.zoomDrag(),
                    r.zoomSwipe();
            }),
                (t.prototype.resetZoom = function () {
                    this.core.$outer.removeClass("lg-zoomed"),
                        this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),
                        this.core.$slide.find(".lg-image").removeAttr("style data-scale"),
                        (this.pageX = u(window).width() / 2),
                        (this.pageY = u(window).height() / 2 + u(window).scrollTop());
                }),
                (t.prototype.zoomSwipe = function () {
                    var o = this,
                        n = {},
                        r = {},
                        l = !1,
                        a = !1,
                        h = !1;
                    o.core.$slide.on("touchstart.lg", function (t) {
                        var e;
                        o.core.$outer.hasClass("lg-zoomed") &&
                            ((e = o.core.$slide.eq(o.core.index).find(".lg-object")),
                            (h = e.prop("offsetHeight") * e.attr("data-scale") > o.core.$outer.find(".lg").height()),
                            ((a = e.prop("offsetWidth") * e.attr("data-scale") > o.core.$outer.find(".lg").width()) ||
                                h) &&
                                (t.preventDefault(),
                                (n = {
                                    x: t.originalEvent.targetTouches[0].pageX,
                                    y: t.originalEvent.targetTouches[0].pageY,
                                })));
                    }),
                        o.core.$slide.on("touchmove.lg", function (t) {
                            var e, i, s;
                            o.core.$outer.hasClass("lg-zoomed") &&
                                ((e = o.core.$slide.eq(o.core.index).find(".lg-img-wrap")),
                                t.preventDefault(),
                                (l = !0),
                                (r = {
                                    x: t.originalEvent.targetTouches[0].pageX,
                                    y: t.originalEvent.targetTouches[0].pageY,
                                }),
                                o.core.$outer.addClass("lg-zoom-dragging"),
                                (s = h ? -Math.abs(e.attr("data-y")) + (r.y - n.y) : -Math.abs(e.attr("data-y"))),
                                (i = a ? -Math.abs(e.attr("data-x")) + (r.x - n.x) : -Math.abs(e.attr("data-x"))),
                                (15 < Math.abs(r.x - n.x) || 15 < Math.abs(r.y - n.y)) &&
                                    (o.core.s.useLeftForZoom
                                        ? e.css({ left: i + "px", top: s + "px" })
                                        : e.css("transform", "translate3d(" + i + "px, " + s + "px, 0)")));
                        }),
                        o.core.$slide.on("touchend.lg", function () {
                            o.core.$outer.hasClass("lg-zoomed") &&
                                l &&
                                ((l = !1), o.core.$outer.removeClass("lg-zoom-dragging"), o.touchendZoom(n, r, a, h));
                        });
                }),
                (t.prototype.zoomDrag = function () {
                    var o = this,
                        n = {},
                        r = {},
                        l = !1,
                        a = !1,
                        h = !1,
                        d = !1;
                    o.core.$slide.on("mousedown.lg.zoom", function (t) {
                        var e = o.core.$slide.eq(o.core.index).find(".lg-object");
                        (d = e.prop("offsetHeight") * e.attr("data-scale") > o.core.$outer.find(".lg").height()),
                            (h = e.prop("offsetWidth") * e.attr("data-scale") > o.core.$outer.find(".lg").width()),
                            o.core.$outer.hasClass("lg-zoomed") &&
                                u(t.target).hasClass("lg-object") &&
                                (h || d) &&
                                (t.preventDefault(),
                                (n = { x: t.pageX, y: t.pageY }),
                                (l = !0),
                                (o.core.$outer.scrollLeft += 1),
                                --o.core.$outer.scrollLeft,
                                o.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"));
                    }),
                        u(window).on("mousemove.lg.zoom", function (t) {
                            var e, i, s;
                            l &&
                                ((e = o.core.$slide.eq(o.core.index).find(".lg-img-wrap")),
                                (a = !0),
                                (r = { x: t.pageX, y: t.pageY }),
                                o.core.$outer.addClass("lg-zoom-dragging"),
                                (s = d ? -Math.abs(e.attr("data-y")) + (r.y - n.y) : -Math.abs(e.attr("data-y"))),
                                (i = h ? -Math.abs(e.attr("data-x")) + (r.x - n.x) : -Math.abs(e.attr("data-x"))),
                                o.core.s.useLeftForZoom
                                    ? e.css({ left: i + "px", top: s + "px" })
                                    : e.css("transform", "translate3d(" + i + "px, " + s + "px, 0)"));
                        }),
                        u(window).on("mouseup.lg.zoom", function (t) {
                            l &&
                                ((l = !1),
                                o.core.$outer.removeClass("lg-zoom-dragging"),
                                !a ||
                                    (n.x === r.x && n.y === r.y) ||
                                    ((r = { x: t.pageX, y: t.pageY }), o.touchendZoom(n, r, h, d)),
                                (a = !1)),
                                o.core.$outer.removeClass("lg-grabbing").addClass("lg-grab");
                        });
                }),
                (t.prototype.touchendZoom = function (t, e, i, s) {
                    var o = this,
                        n = o.core.$slide.eq(o.core.index).find(".lg-img-wrap"),
                        r = o.core.$slide.eq(o.core.index).find(".lg-object"),
                        l = -Math.abs(n.attr("data-x")) + (e.x - t.x),
                        a = -Math.abs(n.attr("data-y")) + (e.y - t.y),
                        h = (o.core.$outer.find(".lg").height() - r.prop("offsetHeight")) / 2,
                        d = Math.abs(
                            r.prop("offsetHeight") * Math.abs(r.attr("data-scale")) -
                                o.core.$outer.find(".lg").height() +
                                h
                        ),
                        u = (o.core.$outer.find(".lg").width() - r.prop("offsetWidth")) / 2,
                        g = Math.abs(
                            r.prop("offsetWidth") * Math.abs(r.attr("data-scale")) -
                                o.core.$outer.find(".lg").width() +
                                u
                        );
                    (15 < Math.abs(e.x - t.x) || 15 < Math.abs(e.y - t.y)) &&
                        (s && (a <= -d ? (a = -d) : -h <= a && (a = -h)),
                        i && (l <= -g ? (l = -g) : -u <= l && (l = -u)),
                        s ? n.attr("data-y", Math.abs(a)) : (a = -Math.abs(n.attr("data-y"))),
                        i ? n.attr("data-x", Math.abs(l)) : (l = -Math.abs(n.attr("data-x"))),
                        o.core.s.useLeftForZoom
                            ? n.css({ left: l + "px", top: a + "px" })
                            : n.css("transform", "translate3d(" + l + "px, " + a + "px, 0)"));
                }),
                (t.prototype.destroy = function () {
                    var t = this;
                    t.core.$el.off(".lg.zoom"),
                        u(window).off(".lg.zoom"),
                        t.core.$slide.off(".lg.zoom"),
                        t.core.$el.off(".lg.tm.zoom"),
                        t.resetZoom(),
                        clearTimeout(t.zoomabletimeout),
                        (t.zoomabletimeout = !1);
                }),
                (u.fn.lightGallery.modules.zoom = t);
        })();
    });
