Socket
Socket
Sign inDemoInstall

lightgallery

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightgallery - npm Package Compare versions

Comparing version 2.2.0-beta.0 to 2.2.0-beta.1

4

lib/lg-events.js

@@ -29,3 +29,7 @@ "use strict";

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};
//# sourceMappingURL=lg-events.js.map

@@ -6,2 +6,3 @@ "use strict";

rotate: true,
rotateSpeed: 400,
rotateLeft: true,

@@ -8,0 +9,0 @@ rotateRight: true,

@@ -62,2 +62,6 @@ "use strict";

imageWrap.wrap('lg-img-rotate');
_this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.css('transition-duration', _this.settings.rotateSpeed + 'ms');
});

@@ -108,2 +112,5 @@ this.core.outer

this.applyStyles();
this.triggerEvents(lg_events_1.lGEvents.rotateLeft, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -113,2 +120,5 @@ Rotate.prototype.rotateRight = function () {

this.applyStyles();
this.triggerEvents(lg_events_1.lGEvents.rotateRight, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -148,2 +158,5 @@ Rotate.prototype.getCurrentRotation = function (el) {

this.applyStyles();
this.triggerEvents(lg_events_1.lGEvents.flipHorizontal, {
flipHorizontal: this.rotateValuesList[this.core.index][rotateAxis],
});
};

@@ -163,3 +176,12 @@ Rotate.prototype.flipVertical = function () {

this.applyStyles();
this.triggerEvents(lg_events_1.lGEvents.flipVertical, {
flipVertical: this.rotateValuesList[this.core.index][rotateAxis],
});
};
Rotate.prototype.triggerEvents = function (event, detail) {
var _this = this;
setTimeout(function () {
_this.core.LGel.trigger(event, detail);
}, this.settings.rotateSpeed + 10);
};
Rotate.prototype.isImageOrientationChanged = function () {

@@ -166,0 +188,0 @@ var rotateValue = this.rotateValuesList[this.core.index];

352

lib/plugins/zoom/lg-zoom.js

@@ -57,2 +57,3 @@ "use strict";

_this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');
_this.setZoomEssentials();
}, _speed + 30);

@@ -107,3 +108,3 @@ };

};
if (rotateValue === 90) {
if (Math.abs(rotateValue) === 90) {
// Swap axis

@@ -149,10 +150,6 @@ if (axis === 'x') {

};
Zoom.prototype.getDragAllowedAxises = function ($image, rotateValue) {
var $lg = this.core.$lgContent.get();
var scale = parseFloat($image.attr('data-scale')) || 1;
var imgEl = $image.get();
var allowY = this.getImageSize(imgEl, rotateValue, 'y') * scale >
$lg.clientHeight;
var allowX = this.getImageSize(imgEl, rotateValue, 'x') * scale >
$lg.clientWidth;
Zoom.prototype.getDragAllowedAxises = function (rotateValue, scale) {
scale = scale || this.scale || 1;
var allowY = this.imageYSize * scale > this.containerRect.height;
var allowX = this.imageXSize * scale > this.containerRect.width;
if (rotateValue === 90) {

@@ -206,2 +203,19 @@ return {

};
Zoom.prototype.setZoomEssentials = function () {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
this.rotateValue = this.getCurrentRotation(rotateEl);
this.imageYSize = this.getImageSize($image.get(), this.rotateValue, 'y');
this.imageXSize = this.getImageSize($image.get(), this.rotateValue, 'x');
this.containerRect = this.core.outer.get().getBoundingClientRect();
this.modifierX = this.getModifier(this.rotateValue, 'X', rotateEl);
this.modifierY = this.getModifier(this.rotateValue, 'Y', rotateEl);
};
/**

@@ -214,16 +228,13 @@ * @desc Image zoom

Zoom.prototype.zoomImage = function (scale) {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var imageNode = $image.get();
if (!imageNode)
return;
var containerRect = this.core.outer.get().getBoundingClientRect();
// Find offset manually to avoid issue after zoom
var offsetX = (containerRect.width - imageNode.offsetWidth) / 2 +
containerRect.left;
var offsetY = (containerRect.height - imageNode.offsetHeight) / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
var offsetX = (this.containerRect.width - this.imageXSize) / 2 +
this.containerRect.left;
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var offsetY = (this.containerRect.height -
this.imageYSize -
topBottomSpacing * this.modifierX) /
2 +
this.scrollTop +
this.containerRect.top;
var originalX;

@@ -234,17 +245,54 @@ var originalY;

}
var dragAllowedAxises = this.getDragAllowedAxises(Math.abs(this.rotateValue), scale);
var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;
if (this.positionChanged) {
originalX =
parseFloat($image.parent().attr('data-x')) /
(parseFloat($image.attr('data-scale')) - 1);
originalY =
parseFloat($image.parent().attr('data-y')) /
(parseFloat($image.attr('data-scale')) - 1);
this.pageX = originalX + offsetX;
this.pageY = originalY + offsetY;
originalX = this.left / (this.scale - 1);
originalY = this.top / (this.scale - 1);
this.pageX = Math.abs(originalX) + offsetX;
this.pageY = Math.abs(originalY) + offsetY;
this.positionChanged = false;
}
var _x = this.pageX - offsetX;
var _y = this.pageY - offsetY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(this.rotateValue, scale);
var _x = offsetX - this.pageX;
var _y = offsetY - this.pageY;
var x = (scale - 1) * _x;
var y = (scale - 1) * _y;
if (allowX) {
if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {
x = possibleSwipeCords.minX;
}
else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {
x = possibleSwipeCords.maxX;
}
}
else {
if (scale > 1) {
if (x < possibleSwipeCords.minX) {
x = possibleSwipeCords.minX;
}
else if (x > possibleSwipeCords.maxX) {
x = possibleSwipeCords.maxX;
}
}
}
if (allowY) {
if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {
y = possibleSwipeCords.minY;
}
else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {
y = possibleSwipeCords.maxY;
}
}
else {
// If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out
if (scale > 1) {
//If image goes beyond viewport top, use the minim possible translate value
if (y < possibleSwipeCords.minY) {
y = possibleSwipeCords.minY;
}
else if (y > possibleSwipeCords.maxY) {
y = possibleSwipeCords.maxY;
}
}
}
this.setZoomStyles({

@@ -269,9 +317,9 @@ x: x,

var $imageWrap = $image.parent();
$image
.attr('data-scale', style.scale + '')
.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
this.scale = style.scale;
$image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
$dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
var transform = 'translate3d(-' + style.x + 'px, -' + style.y + 'px, 0)';
var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';
$imageWrap.css('transform', transform);
$imageWrap.attr('data-x', style.x).attr('data-y', style.y);
this.left = style.x;
this.top = style.y;
};

@@ -342,5 +390,3 @@ /**

cords.y =
containerRect.height / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
containerRect.height / 2 + this.scrollTop + containerRect.top;
}

@@ -411,8 +457,15 @@ return cords;

// Update zoom on resize and orientationchange
this.core.LGel.on(lg_events_1.lGEvents.containerResize + ".zoom", function () {
this.core.LGel.on(lg_events_1.lGEvents.containerResize + ".zoom " + lg_events_1.lGEvents.rotateRight + ".zoom " + lg_events_1.lGEvents.rotateLeft + ".zoom " + lg_events_1.lGEvents.flipHorizontal + ".zoom " + lg_events_1.lGEvents.flipVertical + ".zoom", function () {
if (!_this.core.lgOpened)
return;
_this.setPageCords();
_this.setZoomEssentials();
_this.zoomImage(_this.scale);
});
// Update zoom on resize and orientationchange
this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () {
if (!_this.core.lgOpened)
return;
_this.scrollTop = _this.$LG(window).scrollTop();
});
this.core.getElementById('lg-zoom-out').on('click.lg', function () {

@@ -435,2 +488,9 @@ if (_this.core.outer.find('.lg-current .lg-image').get()) {

});
this.core.LGel.on(lg_events_1.lGEvents.afterOpen + ".zoom", function () {
_this.scrollTop = _this.$LG(window).scrollTop();
// Set the initial value center
_this.pageX = _this.core.outer.width() / 2;
_this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;
_this.scale = 1;
});
// Reset zoom on slide change

@@ -442,2 +502,3 @@ this.core.LGel.on(lg_events_1.lGEvents.afterSlide + ".zoom", function (event) {

_this.resetZoom(prevIndex);
_this.setZoomEssentials();
});

@@ -451,7 +512,2 @@ // Drag option after zoom

this.positionChanged = false;
// Set the initial value center
this.pageX = this.core.outer.width() / 2;
this.pageY =
this.core.outer.height() / 2 + this.$LG(window).scrollTop();
this.scale = 1;
};

@@ -482,4 +538,7 @@ Zoom.prototype.zoomIn = function (scale) {

.addClass(this.settings.actualSizeIcons.zoomIn);
$item.find('.lg-img-wrap').first().removeAttr('style data-x data-y');
$item.find('.lg-image').first().removeAttr('style data-scale');
$item.find('.lg-img-wrap').first().removeAttr('style');
$item.find('.lg-image').first().removeAttr('style');
this.scale = 1;
this.left = 0;
this.top = 0;
// Reset pagx pagy values to center

@@ -504,2 +563,3 @@ this.setPageCords();

if (e.targetTouches.length === 2 &&
!_this.core.outer.hasClass('lg-first-slide-loading') &&
(_this.$LG(e.target).hasClass('lg-item') ||

@@ -549,7 +609,2 @@ $item.get().contains(e.target))) {

Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration, rotateValue) {
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
var distanceXnew = endCoords.x - startCoords.x;

@@ -571,46 +626,34 @@ var distanceYnew = endCoords.y - startCoords.y;

.first();
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-object')
.first();
var dataX = parseFloat(_LGel.attr('data-x')) || 0;
var dataY = parseFloat(_LGel.attr('data-y')) || 0;
var distance = {};
distance.x =
-Math.abs(dataX) +
distanceXnew * this.getModifier(rotateValue, 'X', rotateEl);
distance.y =
-Math.abs(dataY) +
distanceYnew * this.getModifier(rotateValue, 'Y', rotateEl);
var possibleSwipeCords = this.getPossibleSwipeDragCords($image, rotateValue);
distance.x = this.left + distanceXnew * this.modifierX;
distance.y = this.top + distanceYnew * this.modifierY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(rotateValue);
if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {
if (allowY) {
if (distance.y <= -possibleSwipeCords.maxY) {
distance.y = -possibleSwipeCords.maxY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
distance.y = possibleSwipeCords.minY;
}
else if (distance.y >= -possibleSwipeCords.minY) {
distance.y = -possibleSwipeCords.minY;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
distance.y = possibleSwipeCords.maxY;
}
}
if (allowX) {
if (distance.x <= -possibleSwipeCords.maxX) {
distance.x = -possibleSwipeCords.maxX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
distance.x = possibleSwipeCords.minX;
}
else if (distance.x >= -possibleSwipeCords.minX) {
distance.x = -possibleSwipeCords.minX;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
distance.x = possibleSwipeCords.maxX;
}
}
if (allowY) {
_LGel.attr('data-y', Math.abs(distance.y));
this.top = distance.y;
}
else {
var dataY_1 = parseFloat(_LGel.attr('data-y')) || 0;
distance.y = -Math.abs(dataY_1);
distance.y = this.top;
}
if (allowX) {
_LGel.attr('data-x', Math.abs(distance.x));
this.left = distance.x;
}
else {
var dataX_1 = parseFloat(_LGel.attr('data-x')) || 0;
distance.x = -Math.abs(dataX_1);
distance.x = this.left;
}

@@ -621,54 +664,66 @@ this.setZoomSwipeStyles(_LGel, distance);

};
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl) {
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {
var distance = {};
if (allowY) {
distance.y =
-Math.abs(dataY) +
(endCoords.y - startCoords.y) *
this.getModifier(rotateValue, 'Y', rotateEl);
if (distance.y <= -possibleSwipeCords.maxY) {
var diffMaxY = -possibleSwipeCords.maxY - distance.y;
distance.y = -possibleSwipeCords.maxY - diffMaxY / 6;
this.top + (endCoords.y - startCoords.y) * this.modifierY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
var diffMinY = possibleSwipeCords.minY - distance.y;
distance.y = possibleSwipeCords.minY - diffMinY / 6;
}
else if (distance.y >= -possibleSwipeCords.minY) {
var diffMinY = distance.y - -possibleSwipeCords.minY;
distance.y = -possibleSwipeCords.minY + diffMinY / 6;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
var diffMaxY = distance.y - possibleSwipeCords.maxY;
distance.y = possibleSwipeCords.maxY + diffMaxY / 6;
}
}
else {
distance.y = -Math.abs(dataY);
distance.y = this.top;
}
if (allowX) {
distance.x =
-Math.abs(dataX) +
(endCoords.x - startCoords.x) *
this.getModifier(rotateValue, 'X', rotateEl);
if (distance.x <= -possibleSwipeCords.maxX) {
var diffMaxX = -possibleSwipeCords.maxX - distance.x;
distance.x = -possibleSwipeCords.maxX - diffMaxX / 6;
this.left + (endCoords.x - startCoords.x) * this.modifierX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
var diffMinX = possibleSwipeCords.minX - distance.x;
distance.x = possibleSwipeCords.minX - diffMinX / 6;
}
else if (distance.x >= -possibleSwipeCords.minX) {
var diffMinX = distance.x - -possibleSwipeCords.minX;
distance.x = -possibleSwipeCords.minX + diffMinX / 6;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
var difMaxX = distance.x - possibleSwipeCords.maxX;
distance.x = possibleSwipeCords.maxX + difMaxX / 6;
}
}
else {
distance.x = -Math.abs(dataX);
distance.x = this.left;
}
return distance;
};
Zoom.prototype.getPossibleSwipeDragCords = function ($image, rotateValue) {
var $cont = this.core.$lgContent;
var contHeight = $cont.height();
var contWidth = $cont.width();
var imageYSize = this.getImageSize($image.get(), rotateValue, 'y');
var imageXSize = this.getImageSize($image.get(), rotateValue, 'x');
var dataY = parseFloat($image.attr('data-scale')) || 1;
var elDataScale = Math.abs(dataY);
var minY = (contHeight - imageYSize) / 2;
var maxY = Math.abs(imageYSize * elDataScale - contHeight + minY);
var minX = (contWidth - imageXSize) / 2;
var maxX = Math.abs(imageXSize * elDataScale - contWidth + minX);
if (rotateValue === 90) {
return {
Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {
return x >= minX;
};
Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {
return x <= maxX;
};
Zoom.prototype.isBeyondPossibleTop = function (y, minY) {
return y >= minY;
};
Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {
return y <= maxY;
};
Zoom.prototype.getPossibleSwipeDragCords = function (rotateValue, scale) {
var dataScale = scale || this.scale || 1;
var elDataScale = Math.abs(dataScale);
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var minY = (this.imageYSize - this.containerRect.height) / 2 +
topBottomSpacing * this.modifierX;
var maxY = this.containerRect.height - this.imageYSize * elDataScale + minY;
var minX = (this.imageXSize - this.containerRect.width) / 2;
var maxX = this.containerRect.width - this.imageXSize * elDataScale + minX;
var possibleSwipeCords = {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
if (Math.abs(rotateValue) === 90) {
possibleSwipeCords = {
minY: minX,

@@ -680,10 +735,3 @@ maxY: maxX,

}
else {
return {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
}
return possibleSwipeCords;
};

@@ -704,8 +752,4 @@ Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {

var endTime = new Date();
var dataX = 0;
var dataY = 0;
var possibleSwipeCords;
var _LGel;
var rotateEl = null;
var rotateValue = 0;
var $item = this.core.getSlideItem(this.core.index);

@@ -726,6 +770,2 @@ this.core.$inner.on('touchstart.lg', function (e) {

_this.core.touchAction = 'zoomSwipe';
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -735,17 +775,9 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.first()
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;
allowX = dragAllowedAxises.allowX;
if (allowX || allowY) {
startCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
startCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
}
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
// reset opacity and transition duration

@@ -762,4 +794,4 @@ _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');

_this.core.touchAction = 'zoomSwipe';
endCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
if (Math.abs(endCoords.x - startCoords.x) > 15 ||

@@ -784,3 +816,3 @@ Math.abs(endCoords.y - startCoords.y) > 15) {

var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -795,4 +827,2 @@ });

var isMoved = false;
var rotateEl = null;
var rotateValue = 0;
// Allow x direction drag

@@ -805,4 +835,2 @@ var allowX = false;

var possibleSwipeCords;
var dataY;
var dataX;
var _LGel;

@@ -819,7 +847,2 @@ this.core.outer.on('mousedown.lg.zoom', function (e) {

startTime = new Date();
// execute only on .lg-object
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -829,8 +852,3 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;

@@ -842,7 +860,5 @@ allowX = dragAllowedAxises.allowX;

e.preventDefault();
startCoords = _this.getDragCords(e, Math.abs(rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
startCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
isDragging = true;
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723

@@ -862,4 +878,4 @@ _this.core.outer.get().scrollLeft += 1;

isMoved = true;
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
_this.setZoomSwipeStyles(_LGel, distance);

@@ -877,5 +893,5 @@ }

startCoords.y !== endCoords.y)) {
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -882,0 +898,0 @@ isMoved = false;

@@ -32,3 +32,6 @@ import { GalleryItem, ImageSize } from './lg-utils';

private isDummyImageRemoved;
private mediaContainerPosition;
mediaContainerPosition: {
top: number;
bottom: number;
};
constructor(element: HTMLElement, options?: LightGallerySettings);

@@ -63,2 +66,3 @@ private generateSettings;

* - You need to take care of thumbnails outside the gallery if any
* - user this method only if you want to update slides when the gallery is opened. Otherwise, use `refresh()` method.
* @param items Gallery items

@@ -272,2 +276,3 @@ * @param index After the update operation, which slide gallery should navigate to

refresh(galleryItems?: GalleryItem[]): void;
updateControls(): void;
/**

@@ -277,3 +282,5 @@ * Destroy lightGallery.

*
* @description This method also calls CloseGallery function internally
* @description This method also calls CloseGallery function internally. Returns the time takes to completely close and destroy the instance.
* In case if you want to re-initialize lightGallery right after destroying it, initialize it only once the destroy process is completed.
* You can use refresh method most of the times.
* @category lGPublicMethods

@@ -285,3 +292,3 @@ * @example

*/
destroy(): void;
destroy(): number;
}
/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lightGallery=e()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};"function"!=typeof window.CustomEvent&&(window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r=(s.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},s.prototype._getSelector=function(t,e){return void 0===e&&(e=document),"string"!=typeof t?t:(e=e||document,"#"===t.substring(0,1)?e.querySelector(t):e.querySelectorAll(t))},s.prototype._each=function(t){return this.selector&&(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0)),this},s.prototype._setCssVendorPrefix=function(t,e,i){e=e.replace(/-([a-z])/gi,function(t,e){return e.toUpperCase()});-1!==this.cssVenderPrefixes.indexOf(e)?(t.style[e.charAt(0).toLowerCase()+e.slice(1)]=i,t.style["webkit"+e]=i,t.style["moz"+e]=i,t.style["ms"+e]=i,t.style["o"+e]=i):t.style[e]=i},s.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},s.prototype.isEventMatched=function(t,e){var i=e.split(".");return t.split(".").filter(function(t){return t}).every(function(t){return-1!==i.indexOf(t)})},s.prototype.attr=function(e,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(e):"":(this._each(function(t){t.setAttribute(e,i)}),this)},s.prototype.find=function(t){return C(this._getSelector(t,this.selector))},s.prototype.first=function(){return this.selector&&void 0!==this.selector.length?C(this.selector[0]):C(this.selector)},s.prototype.eq=function(t){return C(this.selector[t])},s.prototype.parent=function(){return C(this.selector.parentElement)},s.prototype.get=function(){return this._getFirstEl()},s.prototype.removeAttr=function(t){var i=t.split(" ");return this._each(function(e){i.forEach(function(t){return e.removeAttribute(t)})}),this},s.prototype.wrap=function(t){if(!this.firstElement)return this;var e=document.createElement("div");return e.className=t,this.firstElement.parentNode.insertBefore(e,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),e.appendChild(this.firstElement),this},s.prototype.addClass=function(t){return void 0===t&&(t=""),this._each(function(e){t.split(" ").forEach(function(t){e.classList.add(t)})}),this},s.prototype.removeClass=function(t){return this._each(function(e){t.split(" ").forEach(function(t){e.classList.remove(t)})}),this},s.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},s.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},s.prototype.toggleClass=function(t){return this.firstElement&&(this.hasClass(t)?this.removeClass(t):this.addClass(t)),this},s.prototype.css=function(e,i){var s=this;return this._each(function(t){s._setCssVendorPrefix(t,e,i)}),this},s.prototype.on=function(t,e){var i=this;return this.selector&&t.split(" ").forEach(function(t){Array.isArray(s.eventListeners[t])||(s.eventListeners[t]=[]),s.eventListeners[t].push(e),i.selector.addEventListener(t.split(".")[0],e)}),this},s.prototype.once=function(t,e){var i=this;return this.on(t,function(){i.off(t),e(t)}),this},s.prototype.off=function(t){var i=this;return this.selector&&Object.keys(s.eventListeners).forEach(function(e){i.isEventMatched(t,e)&&(s.eventListeners[e].forEach(function(t){i.selector.removeEventListener(e.split(".")[0],t)}),s.eventListeners[e]=[])}),this},s.prototype.trigger=function(t,e){if(!this.firstElement)return this;e=new CustomEvent(t.split(".")[0],{detail:e||null});return this.firstElement.dispatchEvent(e),this},s.prototype.load=function(t){var e=this;return fetch(t).then(function(t){e.selector.innerHTML=t}),this},s.prototype.html=function(e){return void 0===e?this.firstElement?this.firstElement.innerHTML:"":(this._each(function(t){t.innerHTML=e}),this)},s.prototype.append=function(e){return this._each(function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):t.appendChild(e)}),this},s.prototype.prepend=function(e){return this._each(function(t){t.insertAdjacentHTML("afterbegin",e)}),this},s.prototype.remove=function(){return this._each(function(t){t.parentNode.removeChild(t)}),this},s.prototype.empty=function(){return this._each(function(t){t.innerHTML=""}),this},s.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},s.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},s.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),e=C("body").style().marginLeft;return{left:t.left-parseFloat(e)+this.scrollLeft(),top:t.top+this.scrollTop()}},s.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},s.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},s.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},s.eventListeners={},s);function s(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}function C(t){return new r(t)}var i=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];var I=function(t,e,i,s){void 0===i&&(i=0);var n=C(t).attr("data-lg-size")||s;if(n){var o=n.split(",");if(o[1])for(var r=window.innerWidth,l=0;l<o.length;l++){var a=o[l];if(r<parseInt(a.split("-")[2],10)){n=a;break}l===o.length-1&&(n=a)}var g=n.split("-"),t=parseInt(g[0],10),s=parseInt(g[1],10),g=e.width(),i=e.height()-i,g=Math.min(g,t),i=Math.min(i,s),i=Math.min(g/t,i/s);return{width:t*i,height:s*i}}},l=function(t,e,i,s,n){if(n){var o=C(t).find("img").first();if(o.get()){var r=e.get().getBoundingClientRect(),l=r.width,a=e.height()-(i+s),t=o.width(),e=o.height(),s=o.style(),r=(l-t)/2-o.offset().left+(parseFloat(s.paddingLeft)||0)+(parseFloat(s.borderLeft)||0)+C(window).scrollLeft()+r.left,i=(a-e)/2-o.offset().top+(parseFloat(s.paddingTop)||0)+(parseFloat(s.borderTop)||0)+C(window).scrollTop()+i;return"translate3d("+(r*=-1)+"px, "+(i*=-1)+"px, 0) scale3d("+t/n.width+", "+e/n.height+", 1)"}}},x=function(t,e,i,s){return'<div class="lg-video-cont lg-has-iframe" style="width:'+e+"; height: "+i+'">\n <iframe class="lg-object" frameborder="0" '+(s?'title="'+s+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},w=function(t,e,i,s,n,o){t="<img "+i+" "+(s?'srcset="'+s+'"':"")+" "+(n?'sizes="'+n+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+e+'" />',e="";return o&&(e=("string"==typeof o?JSON.parse(o):o).map(function(e){var i="";return Object.keys(e).forEach(function(t){i+=" "+t+'="'+e[t]+'"'}),"<source "+i+"></source>"})),e+t},S=function(t){for(var e=[],i=[],s="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),i.push(o[0]),e.push(o[1])}for(var r=window.innerWidth,l=0;l<e.length;l++)if(parseInt(e[l],10)>r){s=i[l];break}return s},T=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},E=function(t,e,i,s){return'<div class="lg-video-cont '+(s&&s.youtube?"lg-has-youtube":s&&s.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+i+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(e||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},n=function(t,e,g,h){var d=[],c=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var s=Array(t),n=0,e=0;e<i;e++)for(var o=arguments[e],r=0,l=o.length;r<l;r++,n++)s[n]=o[r];return s}(i,e);return[].forEach.call(t,function(t){for(var e={},i=0;i<t.attributes.length;i++){var s,n,o=t.attributes[i];o.specified&&(s="href"===(n=o.name)?"src":n=(n=(n=n.replace("data-","")).charAt(0).toLowerCase()+n.slice(1)).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()}),n="",-1<c.indexOf(s)&&(n=s),n&&(e[n]=o.value))}var r=C(t),l=r.find("img").first().attr("alt"),a=r.attr("title"),r=h?r.attr(h):r.find("img").first().attr("src");e.thumb=r,g&&!e.subHtml&&(e.subHtml=a||l||""),e.alt=l||a||"",d.push(e)}),d},o=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},a={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},O="lgAfterAppendSlide",g="lgInit",L="lgHasVideo",h="lgContainerResize",d="lgUpdateSlides",c="lgAfterAppendSubHtml",u="lgBeforeOpen",m="lgAfterOpen",p="lgSlideItemLoad",f="lgBeforeSlide",y="lgAfterSlide",v="lgPosterClick",b="lgDragStart",D="lgDragMove",z="lgDragEnd",G="lgBeforeNextSlide",M="lgBeforePrevSlide",k="lgBeforeClose",A="lgAfterClose",B=0,P=(t.prototype.generateSettings=function(t){this.settings=e(e({},a),t),(this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():o())&&(t=e(e({},this.settings.mobileSettings),this.settings.mobileSettings),this.settings=e(e({},this.settings),t))},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(g,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout(function(){t.enableDrag(),t.enableSwipe()},50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var n=this,o=this,t=0;t<this.items.length;t++)!function(e){var i=o.items[e],t=C(i),s=r.generateUUID();t.attr("data-lg-id",s).on("click.lgcustom-item-"+s,function(t){t.preventDefault();t=n.settings.index||e;n.openGallery(t,i)})}(t)},t.prototype.buildModules=function(){var e=this;this.settings.plugins.forEach(function(t){e.plugins.push(new t(e,C))})},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return C(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return C("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t,e,i,s,n,o,r,l,a=this;this.$container&&this.$container.get()||(l=t="",this.settings.controls&&(t='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(l='<div class="lg-sub-html" role="status" aria-live="polite"></div>'),e="",this.settings.allowMediaOverlap&&(e+="lg-media-overlap "),i=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",s=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",n="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),o=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",r=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",l='\n <div class="'+n+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+i+" "+s+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+e+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+r+"\n "+o+"\n </div>\n "+t+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+l+"\n </div>\n </div> \n </div>\n </div>\n ",C(this.settings.container).css("position","relative").append(l),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms"),l=this.settings.mode+" ",this.manageSingleSlideClassName(),this.settings.enableDrag&&(l+="lg-grab "),this.settings.showAfterLoad&&(l+="lg-show-after-load"),this.outer.addClass(l),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),C(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,function(){a.refreshOnResize()}),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules())},t.prototype.refreshOnResize=function(){var t,e,i;this.lgOpened&&(i=this.galleryItems[this.index].__slideVideoInfo,t=(e=this.getMediaContainerPosition()).top,e=e.bottom,this.currentImageSize=I(this.items[this.index],this.$lgContent,t+e,i&&this.settings.videoMaxSize),i&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved&&(i=this.getDummyImgStyles(this.currentImageSize),this.outer.find(".lg-current .lg-dummy-img").first().attr("style",i)),this.LGel.trigger(h))},t.prototype.resizeVideoSlide=function(t,e){e=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",e)},t.prototype.updateSlides=function(t,e){var i,s;this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length?(i=this.galleryItems[e].src,this.addSlideVideoInfo(t),this.galleryItems=t,this.$inner.empty(),this.currentItemsInDom=[],s=0,this.galleryItems.some(function(t,e){return t.src===i&&(s=e,!0)}),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.updateCounterTotal(),this.LGel.trigger(d)):this.closeGallery()},t.prototype.getItems=function(){return this.items=[],this.settings.dynamic?this.settings.dynamicEl||[]:("this"===this.settings.selector?this.items.push(this.el):this.settings.selector?"string"==typeof this.settings.selector?this.settings.selectWithin?(t=C(this.settings.selectWithin),this.items=t.find(this.settings.selector).get()):this.items=this.el.querySelectorAll(this.settings.selector):this.items=this.settings.selector:this.items=this.el.children,n(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage));var t},t.prototype.openGallery=function(e,t){var i,s,n,o,r=this;void 0===e&&(e=this.settings.index),this.lgOpened||(this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show"),n=this.getItemsToBeInsertedToDom(e,e),this.currentItemsInDom=n,i="",n.forEach(function(t){i=i+'<div id="'+t+'" class="lg-item"></div>'}),this.$inner.append(i),this.addHtml(e),s="",this.mediaContainerPosition=this.getMediaContainerPosition(),n=(o=this.mediaContainerPosition).top,o=o.bottom,this.settings.allowMediaOverlap||this.setMediaContainerPosition(n,o),this.zoomFromOrigin&&t&&(this.currentImageSize=I(t,this.$lgContent,n+o,this.galleryItems[e].__slideVideoInfo&&this.settings.videoMaxSize),s=l(t,this.$lgContent,n,o,this.currentImageSize)),this.zoomFromOrigin&&s||(this.outer.addClass(this.settings.startClass),this.getSlideItem(e).removeClass("lg-complete")),o=this.settings.zoomFromOrigin?100:this.settings.backdropDuration,setTimeout(function(){r.outer.addClass("lg-components-open")},o),this.index=e,this.LGel.trigger(u),this.getSlideItem(e).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=C(window).scrollTop(),setTimeout(function(){var t;r.zoomFromOrigin&&s&&((t=r.getSlideItem(e)).css("transform",s),setTimeout(function(){t.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",r.settings.startAnimationDuration+"ms"),r.outer.addClass("lg-zoom-from-image")}),setTimeout(function(){t.css("transform","translate3d(0, 0, 0)")},100)),setTimeout(function(){r.$backdrop.addClass("in"),r.$container.addClass("lg-show-in")},10),r.zoomFromOrigin&&s||setTimeout(function(){r.outer.addClass("lg-visible")},r.settings.backdropDuration),r.slide(e,!1,!1,!1),r.LGel.trigger(m)}),document.body===this.settings.container&&C("html").addClass("lg-on"))},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,i=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(i?i.clientHeight:0)+e}},t.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$inner.css("top",t+"px").css("bottom",e+"px")},t.prototype.hideBars=function(){var t=this;setTimeout(function(){t.outer.removeClass("lg-hide-items"),0<t.settings.hideBarsDelay&&(t.outer.on("mousemove.lg click.lg touchstart.lg",function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout(function(){t.outer.addClass("lg-hide-items")},t.settings.hideBarsDelay)}),t.outer.trigger("mousemove.lg"))},this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){var t;this.settings.counter&&(t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>",this.outer.find(this.settings.appendCounterTo).append(t))},t.prototype.addHtml=function(t){var e,i,s;this.galleryItems[t].subHtmlUrl?i=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,i||(e?"."!==(s=e.substring(0,1))&&"#"!==s||(e=(this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?C(this.items).eq(t).find(e):C(e)).first().html()):e=""),".lg-sub-html"===this.settings.appendSubHtmlTo?i?this.outer.find(".lg-sub-html").load(i):this.outer.find(".lg-sub-html").html(e):(s=C(this.getSlideItemId(t)),i?s.load(i):s.append('<div class="lg-sub-html">'+e+"</div>")),null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(c,{index:t})},t.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,e,i){var s;if(this.settings.dynamic||(s=C(this.items).eq(e)),s){e=void 0;if(!(e=this.settings.exThumbImage?s.attr(this.settings.exThumbImage):s.find("img").first().attr("src")))return"";e="<img "+i+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+e+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),e}return""},t.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,s=s.sources,n=n?'alt="'+n+'"':"",s='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(e,i,n):w(i,t,n,o,r,s))+"</picture>";e.prepend(s)},t.prototype.onLgObjectLoad=function(t,e,i,s,n){var o=this;n&&this.LGel.trigger(p,{index:e,delay:i||0}),t.find(".lg-object").first().on("load.lg",function(){o.handleLgObjectLoad(t,e,i,s,n)}),setTimeout(function(){t.find(".lg-object").first().on("error.lg",function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')})},s)},t.prototype.handleLgObjectLoad=function(t,e,i,s,n){var o=this;setTimeout(function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(p,{index:e,delay:i||0})},s)},t.prototype.isVideo=function(t,e){if(!t)return this.galleryItems[e].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(e+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var i=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),t=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return i?{youtube:i}:e?{vimeo:e}:t?{wistia:t}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach(function(t,e){t.__slideVideoInfo=i.isVideo(t.src,e)})},t.prototype.loadContent=function(e,t){var i=this,s=this.galleryItems[e],n=C(this.getSlideItemId(e)),o=s.poster,r=s.srcset,l=s.sizes,a=s.sources,g=s.src,h=s.video,d=h&&"string"==typeof h?JSON.parse(h):h;s.responsive&&(c=s.responsive.split(","),g=S(c)||g);var c,u,m,p,f=s.__slideVideoInfo,y="",h=!!s.iframe;n.hasClass("lg-loaded")||(f&&(c=(u=this.mediaContainerPosition).top,u=u.bottom,u=I(this.items[e],this.$lgContent,c+u,f&&this.settings.videoMaxSize),y=this.getVideoContStyle(u)),h?(p=x(g,this.settings.iframeWidth,this.settings.iframeHeight,s.iframeTitle),n.prepend(p)):o?(u="",m=!this.lGalleryOn,(h=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize)&&(u=this.getDummyImageContent(n,e,"")),p=E(o,u||"",y,f),n.prepend(p),h=(h?this.settings.startAnimationDuration:this.settings.backdropDuration)+100,setTimeout(function(){i.LGel.trigger(L,{index:e,src:g,html5Video:d,hasPoster:!0,isFirstSlide:m})},h)):f?(p='<div class="lg-video-cont " style="'+y+'"></div>',n.prepend(p),this.LGel.trigger(L,{index:e,src:g,html5Video:d,hasPoster:!1})):(this.setImgMarkup(g,n,e),(r||a)&&(p=n.find(".lg-object"),this.initPictureFill(p))),this.LGel.trigger(O,{index:e}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(e));var v=0,b=0;this.lGalleryOn||(b=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),b&&!C(document.body).hasClass("lg-from-hash")&&(v=b),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout(function(){n.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")},this.settings.startAnimationDuration+100),n.hasClass("lg-loaded")||setTimeout(function(){n.find(".lg-img-wrap").append(w(e,g,"",r,l,s.sources)),(r||a)&&(t=n.find(".lg-object"),i.initPictureFill(t)),i.onLgObjectLoad(n,e,b,v,!0);var t=n.find(".lg-object").first();T(t.get())?i.loadContentOnLoad(e,n,v):t.on("load.lg error.lg",function(){i.loadContentOnLoad(e,n,v)})},this.settings.startAnimationDuration+100)),n.addClass("lg-loaded"),this.onLgObjectLoad(n,e,b,v,!1),f&&f.html5&&!o&&n.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!n.hasClass("lg-complete_")||this.lGalleryOn||setTimeout(function(){n.addClass("lg-complete")},this.settings.backdropDuration),(this.lGalleryOn=!0)===t&&(n.hasClass("lg-complete_")?this.preload(e):n.find(".lg-object").first().on("load.lg error.lg",function(){i.preload(e)}))},t.prototype.loadContentOnLoad=function(t,e,i){var s=this;setTimeout(function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)},i+300)},t.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3),o=Math.min(o,this.galleryItems.length),i="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach(function(t,e){n.push("lg-item-"+s.lgId+"-"+e)}),n;if(t<(this.galleryItems.length-1)/2){for(var r=t;t-o/2<r&&0<=r;r--)n.push("lg-item-"+this.lgId+"-"+r);for(var l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)n.push("lg-item-"+this.lgId+"-"+r);for(l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(i)&&n.push("lg-item-"+this.lgId+"-"+e),n},t.prototype.organizeSlideItems=function(t,e){var i=this,s=this.getItemsToBeInsertedToDom(t,e,this.settings.numberOfSlideItemsInDom);return s.forEach(function(t){-1===i.currentItemsInDom.indexOf(t)&&i.$inner.append('<div id="'+t+'" class="lg-item"></div>')}),this.currentItemsInDom.forEach(function(t){-1===s.indexOf(t)&&C("#"+t).remove()}),s},t.prototype.getPreviousSlideIndex=function(){var e=0;try{var t=this.outer.find(".lg-current").first().attr("id"),e=parseInt(t.split("-")[3])||0}catch(t){e=0}return e},t.prototype.setDownloadValue=function(t){var e;!this.settings.download||(t=!1!==(e=this.galleryItems[t]).downloadUrl&&(e.downloadUrl||e.src))&&!e.iframe&&this.getElementById("lg-download").attr("href",t)},t.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout(function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout(function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")},50)},this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,e,i,s){var n,o,r,l,a,g,h=this,d=this.getPreviousSlideIndex();this.currentItemsInDom=this.organizeSlideItems(t,d),this.lGalleryOn&&d===t||(n=this.galleryItems.length,this.lgBusy||(this.settings.counter&&this.updateCurrentCounter(t),o=this.getSlideItem(t),r=this.getSlideItem(d),a=(l=this.galleryItems[t]).__slideVideoInfo,this.outer.attr("data-lg-slide-type",this.getSlideType(l)),this.setDownloadValue(t),a&&(l=(g=this.mediaContainerPosition).top,g=g.bottom,g=I(this.items[t],this.$lgContent,l+g,a&&this.settings.videoMaxSize),this.resizeVideoSlide(t,g)),this.LGel.trigger(f,{prevIndex:d,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(t<d?s="prev":d<t&&(s="next")),e?(this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide"),g=a=void 0,2<n?(a=t-1,g=t+1,(0===t&&d===n-1||t===n-1&&0===d)&&(g=0,a=n-1)):(a=0,g=1),"prev"===s?this.getSlideItem(g).addClass("lg-next-slide"):this.getSlideItem(a).addClass("lg-prev-slide"),o.addClass("lg-current")):this.makeSlideAnimation(s,o,r),this.lGalleryOn||this.loadContent(t,!0),setTimeout(function(){h.lGalleryOn&&h.loadContent(t,!0),".lg-sub-html"===h.settings.appendSubHtmlTo&&h.addHtml(t)},(this.lGalleryOn?this.settings.speed+50:50)+(e?0:this.settings.slideDelay)),setTimeout(function(){h.lgBusy=!1,r.removeClass("lg-slide-progress"),h.LGel.trigger(y,{prevIndex:d,index:t,fromTouch:e,fromThumb:i})},(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))),this.index=t)},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,e){var i,s=e.pageX-t.pageX,n=e.pageY-t.pageY,e=!1;this.swipeDirection?e=!0:15<Math.abs(s)?(this.swipeDirection="horizontal",e=!0):15<Math.abs(n)&&(this.swipeDirection="vertical",e=!0),e&&(t=this.getSlideItem(this.index),"horizontal"===this.swipeDirection?(this.outer.addClass("lg-dragging"),this.setTranslate(t,s,0),i=15*(e=t.get().offsetWidth)/100-Math.abs(10*s/100),this.setTranslate(this.outer.find(".lg-prev-slide").first(),s-e-i,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),e+s+i,0)):"vertical"===this.swipeDirection&&this.settings.swipeToClose&&(this.$container.addClass("lg-dragging-vertical"),i=1-Math.abs(n)/window.innerHeight,this.$backdrop.css("opacity",i),i=1-Math.abs(n)/(2*window.innerWidth),this.setTranslate(t,0,n,i,i),100<Math.abs(n)&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")))},t.prototype.touchEnd=function(i,s,n){var o,r=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout(function(){r.$container.removeClass("lg-dragging-vertical"),r.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var t=!0;if("horizontal"===r.swipeDirection){o=i.pageX-s.pageX;var e=Math.abs(i.pageX-s.pageX);o<0&&e>r.settings.swipeThreshold?(r.goToNextSlide(!0),t=!1):0<o&&e>r.settings.swipeThreshold&&(r.goToPrevSlide(!0),t=!1)}else if("vertical"===r.swipeDirection){if(o=Math.abs(i.pageY-s.pageY),r.settings.closable&&r.settings.swipeToClose&&100<o)return void r.closeGallery();r.$backdrop.css("opacity",1)}r.outer.find(".lg-item").removeAttr("style"),t&&Math.abs(i.pageX-s.pageX)<5&&(t=C(n.target),r.isPosterElement(t)&&r.LGel.trigger(v)),r.swipeDirection=void 0}),setTimeout(function(){r.outer.hasClass("lg-dragging")||"lg-slide"===r.settings.mode||r.outer.removeClass("lg-slide")},this.settings.speed+100)},t.prototype.enableSwipe=function(){var i=this,s={},e={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",function(t){t.preventDefault();var e=i.getSlideItem(i.index);!C(t.target).hasClass("lg-item")&&!e.get().contains(t.target)||i.outer.hasClass("lg-zoomed")||i.lgBusy||1!==t.targetTouches.length||(o=!0,i.touchAction="swipe",i.manageSwipeClass(),s={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY})}),this.$inner.on("touchmove.lg",function(t){t.preventDefault(),o&&"swipe"===i.touchAction&&1===t.targetTouches.length&&(e={pageX:t.targetTouches[0].pageX,pageY:t.targetTouches[0].pageY},i.touchMove(s,e),n=!0)}),this.$inner.on("touchend.lg",function(t){"swipe"===i.touchAction&&(n?(n=!1,i.touchEnd(e,s,t)):o&&(t=C(t.target),i.isPosterElement(t)&&i.LGel.trigger(v)),i.touchAction=void 0,o=!1)}))},t.prototype.enableDrag=function(){var i=this,s={},n={},o=!1,r=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",function(t){var e=i.getSlideItem(i.index);(C(t.target).hasClass("lg-item")||e.get().contains(t.target))&&(i.outer.hasClass("lg-zoomed")||i.lgBusy||(t.preventDefault(),i.lgBusy||(i.manageSwipeClass(),s={pageX:t.pageX,pageY:t.pageY},o=!0,i.outer.get().scrollLeft+=1,--i.outer.get().scrollLeft,i.outer.removeClass("lg-grab").addClass("lg-grabbing"),i.LGel.trigger(b))))}),C(window).on("mousemove.lg.global"+this.lgId,function(t){o&&i.lgOpened&&(r=!0,n={pageX:t.pageX,pageY:t.pageY},i.touchMove(s,n),i.LGel.trigger(D))}),C(window).on("mouseup.lg.global"+this.lgId,function(t){var e;i.lgOpened&&(e=C(t.target),r?(r=!1,i.touchEnd(n,s,t),i.LGel.trigger(z)):i.isPosterElement(e)&&i.LGel.trigger(v),o&&(o=!1,i.outer.removeClass("lg-grabbing").addClass("lg-grab")))}))},t.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&2<this.galleryItems.length&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),-1<e&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(G,{index:this.index}),this.slide(this.index,!!t,!1,"next")):i?(this.index=0,this.LGel.trigger(G,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout(function(){e.outer.removeClass("lg-right-end")},400)))},t.prototype.goToPrevSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(0<this.index?(this.index--,this.LGel.trigger(M,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(M,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout(function(){e.outer.removeClass("lg-left-end")},400)))},t.prototype.keyPress=function(){var e=this;C(window).on("keydown.lg.global"+this.lgId,function(t){e.lgOpened&&!0===e.settings.escKey&&27===t.keyCode&&(t.preventDefault(),e.settings.allowMediaOverlap&&e.outer.hasClass("lg-can-toggle")&&e.outer.hasClass("lg-components-open")?e.outer.removeClass("lg-components-open"):e.closeGallery()),e.lgOpened&&1<e.galleryItems.length&&(37===t.keyCode&&(t.preventDefault(),e.goToPrevSlide()),39===t.keyCode&&(t.preventDefault(),e.goToNextSlide()))})},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",function(){t.goToPrevSlide()}),this.getElementById("lg-next").on("click.lg",function(){t.goToNextSlide()})},t.prototype.arrowDisable=function(t){var e,i;!this.settings.loop&&this.settings.hideControlOnEnd&&(e=this.getElementById("lg-prev"),i=this.getElementById("lg-next"),t+1<this.galleryItems.length?e.removeAttr("disabled").removeClass("disabled"):e.attr("disabled","disabled").addClass("disabled"),0<t?i.removeAttr("disabled").removeClass("disabled"):i.attr("disabled","disabled").addClass("disabled"))},t.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},t.prototype.mousewheel=function(){var e=this;this.outer.on("mousewheel.lg",function(t){!t.deltaY||e.galleryItems.length<2||(0<t.deltaY?e.goToPrevSlide():e.goToNextSlide(),t.preventDefault())})},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()})},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var e=C(this.items[t]);e.off("click.lgcustom-item-"+e.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var e,i=this;this.settings.closable&&(e=!1,this.getElementById("lg-close").on("click.lg",function(){i.closeGallery()}),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",function(t){t=C(t.target);e=!!i.isSlideElement(t)}),this.outer.on("mousemove.lg",function(){e=!1}),this.outer.on("mouseup.lg",function(t){t=C(t.target);i.isSlideElement(t)&&e&&(i.outer.hasClass("lg-dragging")||i.closeGallery())})))},t.prototype.closeGallery=function(t){var e=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(k),C(window).scrollTop(this.prevScrollTop);var i,s,n=this.items[this.index];this.zoomFromOrigin&&n&&(i=(o=this.mediaContainerPosition).top,t=o.bottom,o=I(n,this.$lgContent,i+t,this.galleryItems[this.index].__slideVideoInfo&&this.settings.videoMaxSize),s=l(n,this.$lgContent,i,t,o)),this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,C("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var o=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout(function(){e.zoomFromOrigin&&s&&e.outer.removeClass("lg-zoom-from-image"),e.$container.removeClass("lg-show"),e.$backdrop.removeAttr("style").css("transition-duration",e.settings.backdropDuration+"ms"),e.outer.removeClass("lg-closing "+e.settings.startClass),e.getSlideItem(e.index).removeClass("lg-start-end-progress"),e.$inner.empty(),e.lgOpened&&e.LGel.trigger(A,{instance:e}),e.outer.get()&&e.outer.get().blur(),e.lgOpened=!1},o+100),o+100},t.prototype.initModules=function(){this.plugins.forEach(function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}})},t.prototype.destroyModules=function(e){this.plugins.forEach(function(t){try{e?t.destroy():t.closeGallery&&t.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}})},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.openGalleryOnItemClick(),this.updateCounterTotal(),this.manageSingleSlideClassName(),this.LGel.trigger(d)},t.prototype.destroy=function(){var t=this,e=this.closeGallery(!0);setTimeout(function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),C(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()},e)},t);function t(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(B++,this.lgId=B,this.el=t,this.LGel=C(t),this.generateSettings(e),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return function(t,e){return new P(t,e)}});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lightGallery=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),i}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=function(){function t(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}return t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},t.prototype._getSelector=function(t,e){return void 0===e&&(e=document),"string"!=typeof t?t:(e=e||document,"#"===t.substring(0,1)?e.querySelector(t):e.querySelectorAll(t))},t.prototype._each=function(t){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0),this):this},t.prototype._setCssVendorPrefix=function(t,e,i){var s=e.replace(/-([a-z])/gi,(function(t,e){return e.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(s)?(t.style[s.charAt(0).toLowerCase()+s.slice(1)]=i,t.style["webkit"+s]=i,t.style["moz"+s]=i,t.style["ms"+s]=i,t.style["o"+s]=i):t.style[s]=i},t.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},t.prototype.isEventMatched=function(t,e){var i=e.split(".");return t.split(".").filter((function(t){return t})).every((function(t){return-1!==i.indexOf(t)}))},t.prototype.attr=function(t,e){return void 0===e?this.firstElement?this.firstElement.getAttribute(t):"":(this._each((function(i){i.setAttribute(t,e)})),this)},t.prototype.find=function(t){return i(this._getSelector(t,this.selector))},t.prototype.first=function(){return this.selector&&void 0!==this.selector.length?i(this.selector[0]):i(this.selector)},t.prototype.eq=function(t){return i(this.selector[t])},t.prototype.parent=function(){return i(this.selector.parentElement)},t.prototype.get=function(){return this._getFirstEl()},t.prototype.removeAttr=function(t){var e=t.split(" ");return this._each((function(t){e.forEach((function(e){return t.removeAttribute(e)}))})),this},t.prototype.wrap=function(t){if(!this.firstElement)return this;var e=document.createElement("div");return e.className=t,this.firstElement.parentNode.insertBefore(e,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),e.appendChild(this.firstElement),this},t.prototype.addClass=function(t){return void 0===t&&(t=""),this._each((function(e){t.split(" ").forEach((function(t){e.classList.add(t)}))})),this},t.prototype.removeClass=function(t){return this._each((function(e){t.split(" ").forEach((function(t){e.classList.remove(t)}))})),this},t.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},t.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},t.prototype.toggleClass=function(t){return this.firstElement?(this.hasClass(t)?this.removeClass(t):this.addClass(t),this):this},t.prototype.css=function(t,e){var i=this;return this._each((function(s){i._setCssVendorPrefix(s,t,e)})),this},t.prototype.on=function(e,i){var s=this;return this.selector?(e.split(" ").forEach((function(e){Array.isArray(t.eventListeners[e])||(t.eventListeners[e]=[]),t.eventListeners[e].push(i),s.selector.addEventListener(e.split(".")[0],i)})),this):this},t.prototype.once=function(t,e){var i=this;return this.on(t,(function(){i.off(t),e(t)})),this},t.prototype.off=function(e){var i=this;return this.selector?(Object.keys(t.eventListeners).forEach((function(s){i.isEventMatched(e,s)&&(t.eventListeners[s].forEach((function(t){i.selector.removeEventListener(s.split(".")[0],t)})),t.eventListeners[s]=[])})),this):this},t.prototype.trigger=function(t,e){if(!this.firstElement)return this;var i=new CustomEvent(t.split(".")[0],{detail:e||null});return this.firstElement.dispatchEvent(i),this},t.prototype.load=function(t){var e=this;return fetch(t).then((function(t){e.selector.innerHTML=t})),this},t.prototype.html=function(t){return void 0===t?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(e){e.innerHTML=t})),this)},t.prototype.append=function(t){return this._each((function(e){"string"==typeof t?e.insertAdjacentHTML("beforeend",t):e.appendChild(t)})),this},t.prototype.prepend=function(t){return this._each((function(e){e.insertAdjacentHTML("afterbegin",t)})),this},t.prototype.remove=function(){return this._each((function(t){t.parentNode.removeChild(t)})),this},t.prototype.empty=function(){return this._each((function(t){t.innerHTML=""})),this},t.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),e=i("body").style().marginLeft;return{left:t.left-parseFloat(e)+this.scrollLeft(),top:t.top+this.scrollTop()}},t.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},t.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},t.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},t.eventListeners={},t}();function i(t){return new e(t)}var s=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function n(t){return"href"===t?"src":t=(t=(t=t.replace("data-","")).charAt(0).toLowerCase()+t.slice(1)).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}var o=function(t,e,s,n){void 0===s&&(s=0);var o=i(t).attr("data-lg-size")||n;if(o){var r=o.split(",");if(r[1])for(var l=window.innerWidth,a=0;a<r.length;a++){var g=r[a];if(parseInt(g.split("-")[2],10)>l){o=g;break}a===r.length-1&&(o=g)}var h=o.split("-"),d=parseInt(h[0],10),c=parseInt(h[1],10),u=e.width(),m=e.height()-s,p=Math.min(u,d),f=Math.min(m,c),v=Math.min(p/d,f/c);return{width:d*v,height:c*v}}},r=function(t,e,s,n,o){if(o){var r=i(t).find("img").first();if(r.get()){var l=e.get().getBoundingClientRect(),a=l.width,g=e.height()-(s+n),h=r.width(),d=r.height(),c=r.style(),u=(a-h)/2-r.offset().left+(parseFloat(c.paddingLeft)||0)+(parseFloat(c.borderLeft)||0)+i(window).scrollLeft()+l.left,m=(g-d)/2-r.offset().top+(parseFloat(c.paddingTop)||0)+(parseFloat(c.borderTop)||0)+i(window).scrollTop()+s;return"translate3d("+(u*=-1)+"px, "+(m*=-1)+"px, 0) scale3d("+h/o.width+", "+d/o.height+", 1)"}}},l=function(t,e,i,s){return'<div class="lg-video-cont lg-has-iframe" style="width:'+e+"; height: "+i+'">\n <iframe class="lg-object" frameborder="0" '+(s?'title="'+s+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},a=function(t,e,i,s,n,o){var r="<img "+i+" "+(s?'srcset="'+s+'"':"")+" "+(n?'sizes="'+n+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+e+'" />',l="";o&&(l=("string"==typeof o?JSON.parse(o):o).map((function(t){var e="";return Object.keys(t).forEach((function(i){e+=" "+i+'="'+t[i]+'"'})),"<source "+e+"></source>"})));return""+l+r},g=function(t){for(var e=[],i=[],s="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),i.push(o[0]),e.push(o[1])}for(var r=window.innerWidth,l=0;l<e.length;l++)if(parseInt(e[l],10)>r){s=i[l];break}return s},h=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},d=function(t,e,i,s){return'<div class="lg-video-cont '+(s&&s.youtube?"lg-has-youtube":s&&s.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+i+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(e||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},c=function(t,e,o,r){var l=[],a=function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var s=Array(t),n=0;for(e=0;e<i;e++)for(var o=arguments[e],r=0,l=o.length;r<l;r++,n++)s[n]=o[r];return s}(s,e);return[].forEach.call(t,(function(t){for(var e={},s=0;s<t.attributes.length;s++){var g=t.attributes[s];if(g.specified){var h=n(g.name),d="";a.indexOf(h)>-1&&(d=h),d&&(e[d]=g.value)}}var c=i(t),u=c.find("img").first().attr("alt"),m=c.attr("title"),p=r?c.attr(r):c.find("img").first().attr("src");e.thumb=p,o&&!e.subHtml&&(e.subHtml=m||u||""),e.alt=u||m||"",l.push(e)})),l},u=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},m={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},p="lgAfterAppendSlide",f="lgInit",v="lgHasVideo",y="lgContainerResize",b="lgUpdateSlides",C="lgAfterAppendSubHtml",I="lgBeforeOpen",x="lgAfterOpen",w="lgSlideItemLoad",S="lgBeforeSlide",T="lgAfterSlide",E="lgPosterClick",O="lgDragStart",L="lgDragMove",D="lgDragEnd",z="lgBeforeNextSlide",G="lgBeforePrevSlide",M="lgBeforeClose",k="lgAfterClose",A=0,B=function(){function s(t,e){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(A++,this.lgId=A,this.el=t,this.LGel=i(t),this.generateSettings(e),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return s.prototype.generateSettings=function(e){if(this.settings=t(t({},m),e),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():u()){var i=t(t({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=t(t({},this.settings),i)}},s.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},s.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(f,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},s.prototype.openGalleryOnItemClick=function(){for(var t=this,s=function(s){var o=n.items[s],r=i(o),l=e.generateUUID();r.attr("data-lg-id",l).on("click.lgcustom-item-"+l,(function(e){e.preventDefault();var i=t.settings.index||s;t.openGallery(i,o)}))},n=this,o=0;o<this.items.length;o++)s(o)},s.prototype.buildModules=function(){var t=this;this.settings.plugins.forEach((function(e){t.plugins.push(new e(t,i))}))},s.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},s.prototype.getSlideItem=function(t){return i(this.getSlideItemId(t))},s.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},s.prototype.getIdName=function(t){return t+"-"+this.lgId},s.prototype.getElementById=function(t){return i("#"+this.getIdName(t))},s.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},s.prototype.buildStructure=function(){var t=this;if(!(this.$container&&this.$container.get())){var e="",s="";this.settings.controls&&(e='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(s='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var n="";this.settings.allowMediaOverlap&&(n+="lg-media-overlap ");var o=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",r=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",l="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),a=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",g=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",h='\n <div class="'+l+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+o+" "+r+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+n+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+g+"\n "+a+"\n </div>\n "+e+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+s+"\n </div>\n </div> \n </div>\n </div>\n ";i(this.settings.container).css("position","relative").append(h),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var d=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(d+="lg-grab "),this.settings.showAfterLoad&&(d+="lg-show-after-load"),this.outer.addClass(d),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),i(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},s.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].__slideVideoInfo;this.mediaContainerPosition=this.getMediaContainerPosition();var e=this.mediaContainerPosition,i=e.top,s=e.bottom;if(this.currentImageSize=o(this.items[this.index],this.$lgContent,i+s,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var n=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",n)}this.LGel.trigger(y)}},s.prototype.resizeVideoSlide=function(t,e){var i=this.getVideoContStyle(e);this.getSlideItem(t).find(".lg-video-cont").attr("style",i)},s.prototype.updateSlides=function(t,e){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var i=this.galleryItems[e].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var s=0;this.galleryItems.some((function(t,e){return t.src===i&&(s=e,!0)})),this.currentItemsInDom=this.organizeSlideItems(s,-1),this.loadContent(s,!0),this.getSlideItem(s).addClass("lg-current"),this.index=s,this.updateCurrentCounter(s),this.LGel.trigger(b)}else this.closeGallery()},s.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=i(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return c(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},s.prototype.openGallery=function(t,e){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var n=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=n;var l="";n.forEach((function(t){l=l+'<div id="'+t+'" class="lg-item"></div>'})),this.$inner.append(l),this.addHtml(t);var a="";this.mediaContainerPosition=this.getMediaContainerPosition();var g=this.mediaContainerPosition,h=g.top,d=g.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(h,d),this.zoomFromOrigin&&e&&(this.currentImageSize=o(e,this.$lgContent,h+d,this.galleryItems[t].__slideVideoInfo&&this.settings.videoMaxSize),a=r(e,this.$lgContent,h,d,this.currentImageSize)),this.zoomFromOrigin&&a||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var c=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),c),this.index=t,this.LGel.trigger(I),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=i(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&a){var e=s.getSlideItem(t);e.css("transform",a),setTimeout((function(){e.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){e.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&a||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(x)})),document.body===this.settings.container&&i("html").addClass("lg-on")}},s.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,e=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,i=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(i?i.clientHeight:0)+e}},s.prototype.setMediaContainerPosition=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.$inner.css("top",t+"px").css("bottom",e+"px")},s.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},s.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},s.prototype.counter=function(){if(this.settings.counter){var t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(t)}},s.prototype.addHtml=function(t){var e,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:e=this.galleryItems[t].subHtml,!s)if(e){var n=e.substring(0,1);"."!==n&&"#"!==n||(e=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?i(this.items).eq(t).find(e).first().html():i(e).first().html())}else e="";if(".lg-sub-html"===this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(e);else{var o=i(this.getSlideItemId(t));s?o.load(s):o.append('<div class="lg-sub-html">'+e+"</div>")}null!=e&&(""===e?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(C,{index:t})},s.prototype.preload=function(t){for(var e=1;e<=this.settings.preload&&!(e>=this.galleryItems.length-t);e++)this.loadContent(t+e,!1);for(var i=1;i<=this.settings.preload&&!(t-i<0);i++)this.loadContent(t-i,!1)},s.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},s.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},s.prototype.getDummyImageContent=function(t,e,s){var n;if(this.settings.dynamic||(n=i(this.items).eq(e)),n){var o=void 0;if(!(o=this.settings.exThumbImage?n.attr(this.settings.exThumbImage):n.find("img").first().attr("src")))return"";var r="<img "+s+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+o+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),r}return""},s.prototype.setImgMarkup=function(t,e,i){var s=this.galleryItems[i],n=s.alt,o=s.srcset,r=s.sizes,l=s.sources,g=n?'alt="'+n+'"':"",h='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(e,i,g):a(i,t,g,o,r,l))+"</picture>";e.prepend(h)},s.prototype.onLgObjectLoad=function(t,e,i,s,n){var o=this;n&&this.LGel.trigger(w,{index:e,delay:i||0}),t.find(".lg-object").first().on("load.lg",(function(){o.handleLgObjectLoad(t,e,i,s,n)})),setTimeout((function(){t.find(".lg-object").first().on("error.lg",(function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')}))}),s)},s.prototype.handleLgObjectLoad=function(t,e,i,s,n){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(w,{index:e,delay:i||0})}),s)},s.prototype.isVideo=function(t,e){if(!t)return this.galleryItems[e].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(e+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var i=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),s=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),n=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return i?{youtube:i}:s?{vimeo:s}:n?{wistia:n}:void 0},s.prototype.addSlideVideoInfo=function(t){var e=this;t.forEach((function(t,i){t.__slideVideoInfo=e.isVideo(t.src,i)}))},s.prototype.loadContent=function(t,e){var s=this,n=this.galleryItems[t],r=i(this.getSlideItemId(t)),c=n.poster,u=n.srcset,m=n.sizes,f=n.sources,y=n.src,b=n.video,C=b&&"string"==typeof b?JSON.parse(b):b;if(n.responsive){var I=n.responsive.split(",");y=g(I)||y}var x=n.__slideVideoInfo,w="",S=!!n.iframe;if(!r.hasClass("lg-loaded")){if(x){var T=this.mediaContainerPosition,E=T.top,O=T.bottom,L=o(this.items[t],this.$lgContent,E+O,x&&this.settings.videoMaxSize);w=this.getVideoContStyle(L)}if(S){var D=l(y,this.settings.iframeWidth,this.settings.iframeHeight,n.iframeTitle);r.prepend(D)}else if(c){var z="",G=!this.lGalleryOn,M=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;M&&(z=this.getDummyImageContent(r,t,""));D=d(c,z||"",w,x);r.prepend(D);var k=(M?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(v,{index:t,src:y,html5Video:C,hasPoster:!0,isFirstSlide:G})}),k)}else if(x){D='<div class="lg-video-cont " style="'+w+'"></div>';r.prepend(D),this.LGel.trigger(v,{index:t,src:y,html5Video:C,hasPoster:!1})}else if(this.setImgMarkup(y,r,t),u||f){var A=r.find(".lg-object");this.initPictureFill(A)}this.LGel.trigger(p,{index:t}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(t)}var B=0,P=0;this.lGalleryOn||(P=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),P&&!i(document.body).hasClass("lg-from-hash")&&(B=P),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){r.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),r.hasClass("lg-loaded")||setTimeout((function(){if(r.find(".lg-img-wrap").append(a(t,y,"",u,m,n.sources)),u||f){var e=r.find(".lg-object");s.initPictureFill(e)}s.onLgObjectLoad(r,t,P,B,!0);var i=r.find(".lg-object").first();h(i.get())?s.loadContentOnLoad(t,r,B):i.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,r,B)}))}),this.settings.startAnimationDuration+100)),r.addClass("lg-loaded"),this.onLgObjectLoad(r,t,P,B,!1),x&&x.html5&&!c&&r.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!r.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){r.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===e&&(r.hasClass("lg-complete_")?this.preload(t):r.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},s.prototype.loadContentOnLoad=function(t,e,i){var s=this;setTimeout((function(){e.find(".lg-dummy-img").remove(),e.removeClass("lg-first-slide"),s.outer.removeClass("lg-first-slide-loading"),s.isDummyImageRemoved=!0,s.preload(t)}),i+300)},s.prototype.getItemsToBeInsertedToDom=function(t,e,i){var s=this;void 0===i&&(i=0);var n=[],o=Math.max(i,3);o=Math.min(o,this.galleryItems.length);var r="lg-item-"+this.lgId+"-"+e;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,e){n.push("lg-item-"+s.lgId+"-"+e)})),n;if(t<(this.galleryItems.length-1)/2){for(var l=t;l>t-o/2&&l>=0;l--)n.push("lg-item-"+this.lgId+"-"+l);var a=n.length;for(l=0;l<o-a;l++)n.push("lg-item-"+this.lgId+"-"+(t+l+1))}else{for(l=t;l<=this.galleryItems.length-1&&l<t+o/2;l++)n.push("lg-item-"+this.lgId+"-"+l);for(a=n.length,l=0;l<o-a;l++)n.push("lg-item-"+this.lgId+"-"+(t-l-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(r)&&n.push("lg-item-"+this.lgId+"-"+e),n},s.prototype.organizeSlideItems=function(t,e){var s=this,n=this.getItemsToBeInsertedToDom(t,e,this.settings.numberOfSlideItemsInDom);return n.forEach((function(t){-1===s.currentItemsInDom.indexOf(t)&&s.$inner.append('<div id="'+t+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(t){-1===n.indexOf(t)&&i("#"+t).remove()})),n},s.prototype.getPreviousSlideIndex=function(){var t=0;try{var e=this.outer.find(".lg-current").first().attr("id");t=parseInt(e.split("-")[3])||0}catch(e){t=0}return t},s.prototype.setDownloadValue=function(t){if(this.settings.download){var e=this.galleryItems[t],i=!1!==e.downloadUrl&&(e.downloadUrl||e.src);i&&!e.iframe&&this.getElementById("lg-download").attr("href",i)}},s.prototype.makeSlideAnimation=function(t,e,i){var s=this;this.lGalleryOn&&i.addClass("lg-slide-progress"),setTimeout((function(){s.outer.addClass("lg-no-trans"),s.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(e.addClass("lg-prev-slide"),i.addClass("lg-next-slide")):(e.addClass("lg-next-slide"),i.addClass("lg-prev-slide")),setTimeout((function(){s.outer.find(".lg-item").removeClass("lg-current"),e.addClass("lg-current"),s.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},s.prototype.slide=function(t,e,i,s){var n=this,r=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,r),!this.lGalleryOn||r!==t){var l=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var a=this.getSlideItem(t),g=this.getSlideItem(r),h=this.galleryItems[t],d=h.__slideVideoInfo;if(this.outer.attr("data-lg-slide-type",this.getSlideType(h)),this.setDownloadValue(t),d){var c=this.mediaContainerPosition,u=c.top,m=c.bottom,p=o(this.items[t],this.$lgContent,u+m,d&&this.settings.videoMaxSize);this.resizeVideoSlide(t,p)}if(this.LGel.trigger(S,{prevIndex:r,index:t,fromTouch:!!e,fromThumb:!!i}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),s||(t<r?s="prev":t>r&&(s="next")),e){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var f=void 0,v=void 0;l>2?(f=t-1,v=t+1,(0===t&&r===l-1||t===l-1&&0===r)&&(v=0,f=l-1)):(f=0,v=1),"prev"===s?this.getSlideItem(v).addClass("lg-next-slide"):this.getSlideItem(f).addClass("lg-prev-slide"),a.addClass("lg-current")}else this.makeSlideAnimation(s,a,g);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){n.lGalleryOn&&n.loadContent(t,!0),".lg-sub-html"===n.settings.appendSubHtmlTo&&n.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(e?0:this.settings.slideDelay)),setTimeout((function(){n.lgBusy=!1,g.removeClass("lg-slide-progress"),n.LGel.trigger(T,{prevIndex:r,index:t,fromTouch:e,fromThumb:i})}),(this.lGalleryOn?this.settings.speed+100:100)+(e?0:this.settings.slideDelay))}this.index=t}},s.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},s.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},s.prototype.getSlideType=function(t){return t.__slideVideoInfo?"video":t.iframe?"iframe":"image"},s.prototype.touchMove=function(t,e){var i=e.pageX-t.pageX,s=e.pageY-t.pageY,n=!1;if(this.swipeDirection?n=!0:Math.abs(i)>15?(this.swipeDirection="horizontal",n=!0):Math.abs(s)>15&&(this.swipeDirection="vertical",n=!0),n){var o=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){this.outer.addClass("lg-dragging"),this.setTranslate(o,i,0);var r=o.get().offsetWidth,l=15*r/100-Math.abs(10*i/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-r+i-l,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),r+i+l,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){this.$container.addClass("lg-dragging-vertical");var a=1-Math.abs(s)/window.innerHeight;this.$backdrop.css("opacity",a);var g=1-Math.abs(s)/(2*window.innerWidth);this.setTranslate(o,0,s,g,g),Math.abs(s)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},s.prototype.touchEnd=function(t,e,s){var n,o=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){o.$container.removeClass("lg-dragging-vertical"),o.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var r=!0;if("horizontal"===o.swipeDirection){n=t.pageX-e.pageX;var l=Math.abs(t.pageX-e.pageX);n<0&&l>o.settings.swipeThreshold?(o.goToNextSlide(!0),r=!1):n>0&&l>o.settings.swipeThreshold&&(o.goToPrevSlide(!0),r=!1)}else if("vertical"===o.swipeDirection){if(n=Math.abs(t.pageY-e.pageY),o.settings.closable&&o.settings.swipeToClose&&n>100)return void o.closeGallery();o.$backdrop.css("opacity",1)}if(o.outer.find(".lg-item").removeAttr("style"),r&&Math.abs(t.pageX-e.pageX)<5){var a=i(s.target);o.isPosterElement(a)&&o.LGel.trigger(E)}o.swipeDirection=void 0})),setTimeout((function(){o.outer.hasClass("lg-dragging")||"lg-slide"===o.settings.mode||o.outer.removeClass("lg-slide")}),this.settings.speed+100)},s.prototype.enableSwipe=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){s.preventDefault();var n=t.getSlideItem(t.index);!i(s.target).hasClass("lg-item")&&!n.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(o=!0,t.touchAction="swipe",t.manageSwipeClass(),e={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(i){i.preventDefault(),o&&"swipe"===t.touchAction&&1===i.targetTouches.length&&(s={pageX:i.targetTouches[0].pageX,pageY:i.targetTouches[0].pageY},t.touchMove(e,s),n=!0)})),this.$inner.on("touchend.lg",(function(r){if("swipe"===t.touchAction){if(n)n=!1,t.touchEnd(s,e,r);else if(o){var l=i(r.target);t.isPosterElement(l)&&t.LGel.trigger(E)}t.touchAction=void 0,o=!1}})))},s.prototype.enableDrag=function(){var t=this,e={},s={},n=!1,o=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){var o=t.getSlideItem(t.index);(i(s.target).hasClass("lg-item")||o.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),e={pageX:s.pageX,pageY:s.pageY},n=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(O))))})),i(window).on("mousemove.lg.global"+this.lgId,(function(i){n&&t.lgOpened&&(o=!0,s={pageX:i.pageX,pageY:i.pageY},t.touchMove(e,s),t.LGel.trigger(L))})),i(window).on("mouseup.lg.global"+this.lgId,(function(r){if(t.lgOpened){var l=i(r.target);o?(o=!1,t.touchEnd(s,e,r),t.LGel.trigger(D)):t.isPosterElement(l)&&t.LGel.trigger(E),n&&(n=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},s.prototype.manageSwipeClass=function(){var t=this.index+1,e=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?e=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),e>-1&&this.getSlideItem(e).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},s.prototype.goToNextSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(z,{index:this.index}),this.slide(this.index,!!t,!1,"next")):i?(this.index=0,this.LGel.trigger(z,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout((function(){e.outer.removeClass("lg-right-end")}),400)))},s.prototype.goToPrevSlide=function(t){var e=this,i=this.settings.loop;t&&this.galleryItems.length<3&&(i=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):i?(this.index=this.galleryItems.length-1,this.LGel.trigger(G,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){e.outer.removeClass("lg-left-end")}),400)))},s.prototype.keyPress=function(){var t=this;i(window).on("keydown.lg.global"+this.lgId,(function(e){t.lgOpened&&!0===t.settings.escKey&&27===e.keyCode&&(e.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===e.keyCode&&(e.preventDefault(),t.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),t.goToNextSlide()))}))},s.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},s.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var e=this.getElementById("lg-prev"),i=this.getElementById("lg-next");t+1===this.galleryItems.length?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled"),0===t?e.attr("disabled","disabled").addClass("disabled"):e.removeAttr("disabled").removeClass("disabled")}},s.prototype.setTranslate=function(t,e,i,s,n){void 0===s&&(s=1),void 0===n&&(n=1),t.css("transform","translate3d("+e+"px, "+i+"px, 0px) scale3d("+s+", "+n+", 1)")},s.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(e){!e.deltaY||t.galleryItems.length<2||(e.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),e.preventDefault())}))},s.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},s.prototype.isPosterElement=function(t){var e=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||e&&e.contains(t.get())},s.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},s.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var e=i(this.items[t]);e.off("click.lgcustom-item-"+e.attr("data-lg-id"))}},s.prototype.manageCloseGallery=function(){var t=this;if(this.settings.closable){var e=!1;this.getElementById("lg-close").on("click.lg",(function(){t.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(s){var n=i(s.target);e=!!t.isSlideElement(n)})),this.outer.on("mousemove.lg",(function(){e=!1})),this.outer.on("mouseup.lg",(function(s){var n=i(s.target);t.isSlideElement(n)&&e&&(t.outer.hasClass("lg-dragging")||t.closeGallery())})))}},s.prototype.closeGallery=function(t){var e=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(M),i(window).scrollTop(this.prevScrollTop);var s,n=this.items[this.index];if(this.zoomFromOrigin&&n){var l=this.mediaContainerPosition,a=l.top,g=l.bottom,h=o(n,this.$lgContent,a+g,this.galleryItems[this.index].__slideVideoInfo&&this.settings.videoMaxSize);s=r(n,this.$lgContent,a,g,h)}this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,i("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var d=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){e.zoomFromOrigin&&s&&e.outer.removeClass("lg-zoom-from-image"),e.$container.removeClass("lg-show"),e.$backdrop.removeAttr("style").css("transition-duration",e.settings.backdropDuration+"ms"),e.outer.removeClass("lg-closing "+e.settings.startClass),e.getSlideItem(e.index).removeClass("lg-start-end-progress"),e.$inner.empty(),e.lgOpened&&e.LGel.trigger(k,{instance:e}),e.outer.get()&&e.outer.get().blur(),e.lgOpened=!1}),d+100),d+100},s.prototype.initModules=function(){this.plugins.forEach((function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},s.prototype.destroyModules=function(t){this.plugins.forEach((function(e){try{t?e.destroy():e.closeGallery&&e.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},s.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.updateControls(),this.openGalleryOnItemClick(),this.LGel.trigger(b)},s.prototype.updateControls=function(){this.addSlideVideoInfo(this.galleryItems),this.updateCounterTotal(),this.manageSingleSlideClassName()},s.prototype.destroy=function(){var t=this,e=this.closeGallery(!0);return setTimeout((function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),i(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()}),e),e},s}();return function(t,e){return new B(t,e)}}));

@@ -36,3 +36,3 @@ /**

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -56,3 +56,3 @@ * Copyright (c) 2020 Sachin Neravath;

***************************************************************************** */
var it=function(){return(it=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)};!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:null};var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),s}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var st=function(){function t(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}return t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"==t?i:3&i|8).toString(16)}))},t.prototype._getSelector=function(t,i){return void 0===i&&(i=document),"string"!=typeof t?t:(i=i||document,"#"===t.substring(0,1)?i.querySelector(t):i.querySelectorAll(t))},t.prototype._each=function(t){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0),this):this},t.prototype._setCssVendorPrefix=function(t,i,s){var e=i.replace(/-([a-z])/gi,(function(t,i){return i.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(e)?(t.style[e.charAt(0).toLowerCase()+e.slice(1)]=s,t.style["webkit"+e]=s,t.style["moz"+e]=s,t.style["ms"+e]=s,t.style["o"+e]=s):t.style[e]=s},t.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},t.prototype.isEventMatched=function(t,i){var s=i.split(".");return t.split(".").filter((function(t){return t})).every((function(t){return-1!==s.indexOf(t)}))},t.prototype.attr=function(t,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(t):"":(this._each((function(s){s.setAttribute(t,i)})),this)},t.prototype.find=function(t){return et(this._getSelector(t,this.selector))},t.prototype.first=function(){return this.selector&&void 0!==this.selector.length?et(this.selector[0]):et(this.selector)},t.prototype.eq=function(t){return et(this.selector[t])},t.prototype.parent=function(){return et(this.selector.parentElement)},t.prototype.get=function(){return this._getFirstEl()},t.prototype.removeAttr=function(t){var i=t.split(" ");return this._each((function(t){i.forEach((function(i){return t.removeAttribute(i)}))})),this},t.prototype.wrap=function(t){if(!this.firstElement)return this;var i=document.createElement("div");return i.className=t,this.firstElement.parentNode.insertBefore(i,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),i.appendChild(this.firstElement),this},t.prototype.addClass=function(t){return void 0===t&&(t=""),this._each((function(i){t.split(" ").forEach((function(t){i.classList.add(t)}))})),this},t.prototype.removeClass=function(t){return this._each((function(i){t.split(" ").forEach((function(t){i.classList.remove(t)}))})),this},t.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},t.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},t.prototype.toggleClass=function(t){return this.firstElement?(this.hasClass(t)?this.removeClass(t):this.addClass(t),this):this},t.prototype.css=function(t,i){var s=this;return this._each((function(e){s._setCssVendorPrefix(e,t,i)})),this},t.prototype.on=function(i,s){var e=this;return this.selector?(i.split(" ").forEach((function(i){Array.isArray(t.eventListeners[i])||(t.eventListeners[i]=[]),t.eventListeners[i].push(s),e.selector.addEventListener(i.split(".")[0],s)})),this):this},t.prototype.once=function(t,i){var s=this;return this.on(t,(function(){s.off(t),i(t)})),this},t.prototype.off=function(i){var s=this;return this.selector?(Object.keys(t.eventListeners).forEach((function(e){s.isEventMatched(i,e)&&(t.eventListeners[e].forEach((function(t){s.selector.removeEventListener(e.split(".")[0],t)})),t.eventListeners[e]=[])})),this):this},t.prototype.trigger=function(t,i){if(!this.firstElement)return this;var s=new CustomEvent(t.split(".")[0],{detail:i||null});return this.firstElement.dispatchEvent(s),this},t.prototype.load=function(t){var i=this;return fetch(t).then((function(t){i.selector.innerHTML=t})),this},t.prototype.html=function(t){return void 0===t?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(i){i.innerHTML=t})),this)},t.prototype.append=function(t){return this._each((function(i){"string"==typeof t?i.insertAdjacentHTML("beforeend",t):i.appendChild(t)})),this},t.prototype.prepend=function(t){return this._each((function(i){i.insertAdjacentHTML("afterbegin",t)})),this},t.prototype.remove=function(){return this._each((function(t){t.parentNode.removeChild(t)})),this},t.prototype.empty=function(){return this._each((function(t){t.innerHTML=""})),this},t.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),i=et("body").style().marginLeft;return{left:t.left-parseFloat(i)+this.scrollLeft(),top:t.top+this.scrollTop()}},t.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},t.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},t.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},t.eventListeners={},t}();function et(t){return new st(t)}var nt=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function ot(t){return"href"===t?"src":t=(t=(t=t.replace("data-","")).charAt(0).toLowerCase()+t.slice(1)).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}var ht=function(t,i,s,e){void 0===s&&(s=0);var n=et(t).attr("data-lg-size")||e;if(n){var o=n.split(",");if(o[1])for(var h=window.innerWidth,r=0;r<o.length;r++){var l=o[r];if(parseInt(l.split("-")[2],10)>h){n=l;break}r===o.length-1&&(n=l)}var a=n.split("-"),u=parseInt(a[0],10),c=parseInt(a[1],10),d=i.width(),g=i.height()-s,f=Math.min(d,u),v=Math.min(g,c),m=Math.min(f/u,v/c);return{width:u*m,height:c*m}}},rt=function(t,i,s,e,n){if(n){var o=et(t).find("img").first();if(o.get()){var h=i.get().getBoundingClientRect(),r=h.width,l=i.height()-(s+e),a=o.width(),u=o.height(),c=o.style(),d=(r-a)/2-o.offset().left+(parseFloat(c.paddingLeft)||0)+(parseFloat(c.borderLeft)||0)+et(window).scrollLeft()+h.left,g=(l-u)/2-o.offset().top+(parseFloat(c.paddingTop)||0)+(parseFloat(c.borderTop)||0)+et(window).scrollTop()+s;return"translate3d("+(d*=-1)+"px, "+(g*=-1)+"px, 0) scale3d("+a/n.width+", "+u/n.height+", 1)"}}},lt=function(t,i,s,e){return'<div class="lg-video-cont lg-has-iframe" style="width:'+i+"; height: "+s+'">\n <iframe class="lg-object" frameborder="0" '+(e?'title="'+e+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},at=function(t,i,s,e,n,o){var h="<img "+s+" "+(e?'srcset="'+e+'"':"")+" "+(n?'sizes="'+n+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+i+'" />',r="";o&&(r=("string"==typeof o?JSON.parse(o):o).map((function(t){var i="";return Object.keys(t).forEach((function(s){i+=" "+s+'="'+t[s]+'"'})),"<source "+i+"></source>"})));return""+r+h},ut=function(t){for(var i=[],s=[],e="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),s.push(o[0]),i.push(o[1])}for(var h=window.innerWidth,r=0;r<i.length;r++)if(parseInt(i[r],10)>h){e=s[r];break}return e},ct=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},dt=function(t,i,s,e){return'<div class="lg-video-cont '+(e&&e.youtube?"lg-has-youtube":e&&e.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+s+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(i||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},gt=function(t,i,s,e){var n=[],o=function(){for(var t=0,i=0,s=arguments.length;i<s;i++)t+=arguments[i].length;var e=Array(t),n=0;for(i=0;i<s;i++)for(var o=arguments[i],h=0,r=o.length;h<r;h++,n++)e[n]=o[h];return e}(nt,i);return[].forEach.call(t,(function(t){for(var i={},h=0;h<t.attributes.length;h++){var r=t.attributes[h];if(r.specified){var l=ot(r.name),a="";o.indexOf(l)>-1&&(a=l),a&&(i[a]=r.value)}}var u=et(t),c=u.find("img").first().attr("alt"),d=u.attr("title"),g=e?u.attr(e):u.find("img").first().attr("src");i.thumb=g,s&&!i.subHtml&&(i.subHtml=d||c||""),i.alt=c||d||"",n.push(i)})),n},ft=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},vt={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},mt="lgAfterAppendSlide",pt="lgInit",bt="lgHasVideo",yt="lgContainerResize",wt="lgUpdateSlides",xt="lgAfterAppendSubHtml",Tt="lgBeforeOpen",St="lgAfterOpen",kt="lgSlideItemLoad",Ct="lgBeforeSlide",zt="lgAfterSlide",Mt="lgPosterClick",At="lgDragStart",Ot="lgDragMove",jt="lgDragEnd",It="lgBeforeNextSlide",$t="lgBeforePrevSlide",Et="lgBeforeClose",Pt="lgAfterClose",Ut=0,_t=function(){function t(t,i){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(Ut++,this.lgId=Ut,this.el=t,this.LGel=et(t),this.generateSettings(i),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return t.prototype.generateSettings=function(t){if(this.settings=it(it({},vt),t),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():ft()){var i=it(it({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=it(it({},this.settings),i)}},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(pt,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var t=this,i=function(i){var e=s.items[i],n=et(e),o=st.generateUUID();n.attr("data-lg-id",o).on("click.lgcustom-item-"+o,(function(s){s.preventDefault();var n=t.settings.index||i;t.openGallery(n,e)}))},s=this,e=0;e<this.items.length;e++)i(e)},t.prototype.buildModules=function(){var t=this;this.settings.plugins.forEach((function(i){t.plugins.push(new i(t,et))}))},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return et(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return et("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t=this;if(!(this.$container&&this.$container.get())){var i="",s="";this.settings.controls&&(i='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(s='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var e="";this.settings.allowMediaOverlap&&(e+="lg-media-overlap ");var n=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",o=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",h="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),r=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",l=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",a='\n <div class="'+h+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+n+" "+o+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+e+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+l+"\n "+r+"\n </div>\n "+i+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+s+"\n </div>\n </div> \n </div>\n </div>\n ";et(this.settings.container).css("position","relative").append(a),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var u=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(u+="lg-grab "),this.settings.showAfterLoad&&(u+="lg-show-after-load"),this.outer.addClass(u),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),et(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},t.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].i,i=this.getMediaContainerPosition(),s=i.top,e=i.bottom;if(this.currentImageSize=ht(this.items[this.index],this.$lgContent,s+e,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var n=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",n)}this.LGel.trigger(yt)}},t.prototype.resizeVideoSlide=function(t,i){var s=this.getVideoContStyle(i);this.getSlideItem(t).find(".lg-video-cont").attr("style",s)},t.prototype.updateSlides=function(t,i){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var s=this.galleryItems[i].src;this.addSlideVideoInfo(t),this.galleryItems=t,this.$inner.empty(),this.currentItemsInDom=[];var e=0;this.galleryItems.some((function(t,i){return t.src===s&&(e=i,!0)})),this.currentItemsInDom=this.organizeSlideItems(e,-1),this.loadContent(e,!0),this.getSlideItem(e).addClass("lg-current"),this.index=e,this.updateCurrentCounter(e),this.updateCounterTotal(),this.LGel.trigger(wt)}else this.closeGallery()},t.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=et(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return gt(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},t.prototype.openGallery=function(t,i){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var e=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=e;var n="";e.forEach((function(t){n=n+'<div id="'+t+'" class="lg-item"></div>'})),this.$inner.append(n),this.addHtml(t);var o="";this.mediaContainerPosition=this.getMediaContainerPosition();var h=this.mediaContainerPosition,r=h.top,l=h.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(r,l),this.zoomFromOrigin&&i&&(this.currentImageSize=ht(i,this.$lgContent,r+l,this.galleryItems[t].i&&this.settings.videoMaxSize),o=rt(i,this.$lgContent,r,l,this.currentImageSize)),this.zoomFromOrigin&&o||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var a=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),a),this.index=t,this.LGel.trigger(Tt),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=et(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&o){var i=s.getSlideItem(t);i.css("transform",o),setTimeout((function(){i.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){i.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&o||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(St)})),document.body===this.settings.container&&et("html").addClass("lg-on")}},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,i=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},t.prototype.setMediaContainerPosition=function(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.$inner.css("top",t+"px").css("bottom",i+"px")},t.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){if(this.settings.counter){var t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(t)}},t.prototype.addHtml=function(t){var i,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:i=this.galleryItems[t].subHtml,!s)if(i){var e=i.substring(0,1);"."!==e&&"#"!==e||(i=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?et(this.items).eq(t).find(i).first().html():et(i).first().html())}else i="";if(".lg-sub-html"===this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(i);else{var n=et(this.getSlideItemId(t));s?n.load(s):n.append('<div class="lg-sub-html">'+i+"</div>")}null!=i&&(""===i?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(xt,{index:t})},t.prototype.preload=function(t){for(var i=1;i<=this.settings.preload&&!(i>=this.galleryItems.length-t);i++)this.loadContent(t+i,!1);for(var s=1;s<=this.settings.preload&&!(t-s<0);s++)this.loadContent(t-s,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,i,s){var e;if(this.settings.dynamic||(e=et(this.items).eq(i)),e){var n=void 0;if(!(n=this.settings.exThumbImage?e.attr(this.settings.exThumbImage):e.find("img").first().attr("src")))return"";var o="<img "+s+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+n+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),o}return""},t.prototype.setImgMarkup=function(t,i,s){var e=this.galleryItems[s],n=e.alt,o=e.srcset,h=e.sizes,r=e.sources,l=n?'alt="'+n+'"':"",a='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(i,s,l):at(s,t,l,o,h,r))+"</picture>";i.prepend(a)},t.prototype.onLgObjectLoad=function(t,i,s,e,n){var o=this;n&&this.LGel.trigger(kt,{index:i,delay:s||0}),t.find(".lg-object").first().on("load.lg",(function(){o.handleLgObjectLoad(t,i,s,e,n)})),setTimeout((function(){t.find(".lg-object").first().on("error.lg",(function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')}))}),e)},t.prototype.handleLgObjectLoad=function(t,i,s,e,n){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(kt,{index:i,delay:s||0})}),e)},t.prototype.isVideo=function(t,i){if(!t)return this.galleryItems[i].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),n=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:e?{vimeo:e}:n?{wistia:n}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach((function(t,s){t.i=i.isVideo(t.src,s)}))},t.prototype.loadContent=function(t,i){var s=this,e=this.galleryItems[t],n=et(this.getSlideItemId(t)),o=e.poster,h=e.srcset,r=e.sizes,l=e.sources,a=e.src,u=e.video,c=u&&"string"==typeof u?JSON.parse(u):u;if(e.responsive){var d=e.responsive.split(",");a=ut(d)||a}var g=e.i,f="",v=!!e.iframe;if(!n.hasClass("lg-loaded")){if(g){var m=this.mediaContainerPosition,p=m.top,b=m.bottom,y=ht(this.items[t],this.$lgContent,p+b,g&&this.settings.videoMaxSize);f=this.getVideoContStyle(y)}if(v){var w=lt(a,this.settings.iframeWidth,this.settings.iframeHeight,e.iframeTitle);n.prepend(w)}else if(o){var x="",T=!this.lGalleryOn,S=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;S&&(x=this.getDummyImageContent(n,t,""));w=dt(o,x||"",f,g);n.prepend(w);var k=(S?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(bt,{index:t,src:a,html5Video:c,hasPoster:!0,isFirstSlide:T})}),k)}else if(g){w='<div class="lg-video-cont " style="'+f+'"></div>';n.prepend(w),this.LGel.trigger(bt,{index:t,src:a,html5Video:c,hasPoster:!1})}else if(this.setImgMarkup(a,n,t),h||l){var C=n.find(".lg-object");this.initPictureFill(C)}this.LGel.trigger(mt,{index:t}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(t)}var z=0,M=0;this.lGalleryOn||(M=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),M&&!et(document.body).hasClass("lg-from-hash")&&(z=M),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){n.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),n.hasClass("lg-loaded")||setTimeout((function(){if(n.find(".lg-img-wrap").append(at(t,a,"",h,r,e.sources)),h||l){var i=n.find(".lg-object");s.initPictureFill(i)}s.onLgObjectLoad(n,t,M,z,!0);var o=n.find(".lg-object").first();ct(o.get())?s.loadContentOnLoad(t,n,z):o.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,n,z)}))}),this.settings.startAnimationDuration+100)),n.addClass("lg-loaded"),this.onLgObjectLoad(n,t,M,z,!1),g&&g.html5&&!o&&n.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!n.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){n.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(n.hasClass("lg-complete_")?this.preload(t):n.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},t.prototype.loadContentOnLoad=function(t,i,s){var e=this;setTimeout((function(){i.find(".lg-dummy-img").remove(),i.removeClass("lg-first-slide"),e.outer.removeClass("lg-first-slide-loading"),e.isDummyImageRemoved=!0,e.preload(t)}),s+300)},t.prototype.getItemsToBeInsertedToDom=function(t,i,s){var e=this;void 0===s&&(s=0);var n=[],o=Math.max(s,3);o=Math.min(o,this.galleryItems.length);var h="lg-item-"+this.lgId+"-"+i;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,i){n.push("lg-item-"+e.lgId+"-"+i)})),n;if(t<(this.galleryItems.length-1)/2){for(var r=t;r>t-o/2&&r>=0;r--)n.push("lg-item-"+this.lgId+"-"+r);var l=n.length;for(r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)n.push("lg-item-"+this.lgId+"-"+r);for(l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(h)&&n.push("lg-item-"+this.lgId+"-"+i),n},t.prototype.organizeSlideItems=function(t,i){var s=this,e=this.getItemsToBeInsertedToDom(t,i,this.settings.numberOfSlideItemsInDom);return e.forEach((function(t){-1===s.currentItemsInDom.indexOf(t)&&s.$inner.append('<div id="'+t+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(t){-1===e.indexOf(t)&&et("#"+t).remove()})),e},t.prototype.getPreviousSlideIndex=function(){var t=0;try{var i=this.outer.find(".lg-current").first().attr("id");t=parseInt(i.split("-")[3])||0}catch(i){t=0}return t},t.prototype.setDownloadValue=function(t){if(this.settings.download){var i=this.galleryItems[t],s=!1!==i.downloadUrl&&(i.downloadUrl||i.src);s&&!i.iframe&&this.getElementById("lg-download").attr("href",s)}},t.prototype.makeSlideAnimation=function(t,i,s){var e=this;this.lGalleryOn&&s.addClass("lg-slide-progress"),setTimeout((function(){e.outer.addClass("lg-no-trans"),e.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(i.addClass("lg-prev-slide"),s.addClass("lg-next-slide")):(i.addClass("lg-next-slide"),s.addClass("lg-prev-slide")),setTimeout((function(){e.outer.find(".lg-item").removeClass("lg-current"),i.addClass("lg-current"),e.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,i,s,e){var n=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var h=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var r=this.getSlideItem(t),l=this.getSlideItem(o),a=this.galleryItems[t],u=a.i;if(this.outer.attr("data-lg-slide-type",this.getSlideType(a)),this.setDownloadValue(t),u){var c=this.mediaContainerPosition,d=c.top,g=c.bottom,f=ht(this.items[t],this.$lgContent,d+g,u&&this.settings.videoMaxSize);this.resizeVideoSlide(t,f)}if(this.LGel.trigger(Ct,{prevIndex:o,index:t,fromTouch:!!i,fromThumb:!!s}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),e||(t<o?e="prev":t>o&&(e="next")),i){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var v=void 0,m=void 0;h>2?(v=t-1,m=t+1,(0===t&&o===h-1||t===h-1&&0===o)&&(m=0,v=h-1)):(v=0,m=1),"prev"===e?this.getSlideItem(m).addClass("lg-next-slide"):this.getSlideItem(v).addClass("lg-prev-slide"),r.addClass("lg-current")}else this.makeSlideAnimation(e,r,l);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){n.lGalleryOn&&n.loadContent(t,!0),".lg-sub-html"===n.settings.appendSubHtmlTo&&n.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(i?0:this.settings.slideDelay)),setTimeout((function(){n.lgBusy=!1,l.removeClass("lg-slide-progress"),n.LGel.trigger(zt,{prevIndex:o,index:t,fromTouch:i,fromThumb:s})}),(this.lGalleryOn?this.settings.speed+100:100)+(i?0:this.settings.slideDelay))}this.index=t}},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.i?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,i){var s=i.pageX-t.pageX,e=i.pageY-t.pageY,n=!1;if(this.swipeDirection?n=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",n=!0):Math.abs(e)>15&&(this.swipeDirection="vertical",n=!0),n){var o=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){this.outer.addClass("lg-dragging"),this.setTranslate(o,s,0);var h=o.get().offsetWidth,r=15*h/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-h+s-r,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),h+s+r,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){this.$container.addClass("lg-dragging-vertical");var l=1-Math.abs(e)/window.innerHeight;this.$backdrop.css("opacity",l);var a=1-Math.abs(e)/(2*window.innerWidth);this.setTranslate(o,0,e,a,a),Math.abs(e)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},t.prototype.touchEnd=function(t,i,s){var e,n=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){n.$container.removeClass("lg-dragging-vertical"),n.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var o=!0;if("horizontal"===n.swipeDirection){e=t.pageX-i.pageX;var h=Math.abs(t.pageX-i.pageX);e<0&&h>n.settings.swipeThreshold?(n.goToNextSlide(!0),o=!1):e>0&&h>n.settings.swipeThreshold&&(n.goToPrevSlide(!0),o=!1)}else if("vertical"===n.swipeDirection){if(e=Math.abs(t.pageY-i.pageY),n.settings.closable&&n.settings.swipeToClose&&e>100)return void n.closeGallery();n.$backdrop.css("opacity",1)}if(n.outer.find(".lg-item").removeAttr("style"),o&&Math.abs(t.pageX-i.pageX)<5){var r=et(s.target);n.isPosterElement(r)&&n.LGel.trigger(Mt)}n.swipeDirection=void 0})),setTimeout((function(){n.outer.hasClass("lg-dragging")||"lg-slide"===n.settings.mode||n.outer.removeClass("lg-slide")}),this.settings.speed+100)},t.prototype.enableSwipe=function(){var t=this,i={},s={},e=!1,n=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){s.preventDefault();var e=t.getSlideItem(t.index);!et(s.target).hasClass("lg-item")&&!e.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(n=!0,t.touchAction="swipe",t.manageSwipeClass(),i={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){o.preventDefault(),n&&"swipe"===t.touchAction&&1===o.targetTouches.length&&(s={pageX:o.targetTouches[0].pageX,pageY:o.targetTouches[0].pageY},t.touchMove(i,s),e=!0)})),this.$inner.on("touchend.lg",(function(o){if("swipe"===t.touchAction){if(e)e=!1,t.touchEnd(s,i,o);else if(n){var h=et(o.target);t.isPosterElement(h)&&t.LGel.trigger(Mt)}t.touchAction=void 0,n=!1}})))},t.prototype.enableDrag=function(){var t=this,i={},s={},e=!1,n=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){var n=t.getSlideItem(t.index);(et(s.target).hasClass("lg-item")||n.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),i={pageX:s.pageX,pageY:s.pageY},e=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(At))))})),et(window).on("mousemove.lg.global"+this.lgId,(function(o){e&&t.lgOpened&&(n=!0,s={pageX:o.pageX,pageY:o.pageY},t.touchMove(i,s),t.LGel.trigger(Ot))})),et(window).on("mouseup.lg.global"+this.lgId,(function(o){if(t.lgOpened){var h=et(o.target);n?(n=!1,t.touchEnd(s,i,o),t.LGel.trigger(jt)):t.isPosterElement(h)&&t.LGel.trigger(Mt),e&&(e=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},t.prototype.manageSwipeClass=function(){var t=this.index+1,i=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?i=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),i>-1&&this.getSlideItem(i).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(It,{index:this.index}),this.slide(this.index,!!t,!1,"next")):s?(this.index=0,this.LGel.trigger(It,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout((function(){i.outer.removeClass("lg-right-end")}),400)))},t.prototype.goToPrevSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger($t,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):s?(this.index=this.galleryItems.length-1,this.LGel.trigger($t,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){i.outer.removeClass("lg-left-end")}),400)))},t.prototype.keyPress=function(){var t=this;et(window).on("keydown.lg.global"+this.lgId,(function(i){t.lgOpened&&!0===t.settings.escKey&&27===i.keyCode&&(i.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===i.keyCode&&(i.preventDefault(),t.goToPrevSlide()),39===i.keyCode&&(i.preventDefault(),t.goToNextSlide()))}))},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},t.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var i=this.getElementById("lg-prev"),s=this.getElementById("lg-next");t+1<this.galleryItems.length?i.removeAttr("disabled").removeClass("disabled"):i.attr("disabled","disabled").addClass("disabled"),t>0?s.removeAttr("disabled").removeClass("disabled"):s.attr("disabled","disabled").addClass("disabled")}},t.prototype.setTranslate=function(t,i,s,e,n){void 0===e&&(e=1),void 0===n&&(n=1),t.css("transform","translate3d("+i+"px, "+s+"px, 0px) scale3d("+e+", "+n+", 1)")},t.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(i){!i.deltaY||t.galleryItems.length<2||(i.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),i.preventDefault())}))},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var i=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||i&&i.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var i=et(this.items[t]);i.off("click.lgcustom-item-"+i.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var t=this;if(this.settings.closable){var i=!1;this.getElementById("lg-close").on("click.lg",(function(){t.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(s){var e=et(s.target);i=!!t.isSlideElement(e)})),this.outer.on("mousemove.lg",(function(){i=!1})),this.outer.on("mouseup.lg",(function(s){var e=et(s.target);t.isSlideElement(e)&&i&&(t.outer.hasClass("lg-dragging")||t.closeGallery())})))}},t.prototype.closeGallery=function(t){var i=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(Et),et(window).scrollTop(this.prevScrollTop);var s,e=this.items[this.index];if(this.zoomFromOrigin&&e){var n=this.mediaContainerPosition,o=n.top,h=n.bottom,r=ht(e,this.$lgContent,o+h,this.galleryItems[this.index].i&&this.settings.videoMaxSize);s=rt(e,this.$lgContent,o,h,r)}this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,et("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var l=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){i.zoomFromOrigin&&s&&i.outer.removeClass("lg-zoom-from-image"),i.$container.removeClass("lg-show"),i.$backdrop.removeAttr("style").css("transition-duration",i.settings.backdropDuration+"ms"),i.outer.removeClass("lg-closing "+i.settings.startClass),i.getSlideItem(i.index).removeClass("lg-start-end-progress"),i.$inner.empty(),i.lgOpened&&i.LGel.trigger(Pt,{instance:i}),i.outer.get()&&i.outer.get().blur(),i.lgOpened=!1}),l+100),l+100},t.prototype.initModules=function(){this.plugins.forEach((function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},t.prototype.destroyModules=function(t){this.plugins.forEach((function(i){try{t?i.destroy():i.closeGallery&&i.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.openGalleryOnItemClick(),this.updateCounterTotal(),this.manageSingleSlideClassName(),this.LGel.trigger(wt)},t.prototype.destroy=function(){var t=this,i=this.closeGallery(!0);setTimeout((function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),et(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()}),i)},t}();var Dt=function(t,i,s,e){for(var n,o=arguments.length,h=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(i,s,h):n(i,s))||h);return o>3&&h&&Object.defineProperty(i,s,h),h};let Ft=class extends Q{constructor(){super(...arguments),this.settings={}}getSelector(t){const i=t.assignedNodes({flatten:!0});return Array.prototype.filter.call(i,(t=>t.nodeType==Node.ELEMENT_NODE))}firstUpdated(){if(!this.shadowRoot)return;const t=this.shadowRoot.querySelector("slot"),i={selector:this.getSelector(t)},s={...this.settings,...i};this.galleryInstance=new _t(this,s)}handleSlotchange(t){var i,s;const e=this.getSelector(t.target);this.galleryInstance&&(null===(i=this.galleryInstance)||void 0===i?void 0:i.galleryItems.length)!==e.length&&(this.galleryInstance.settings.selector=e,null===(s=this.galleryInstance)||void 0===s||s.refresh())}disconnectedCallback(){super.disconnectedCallback(),this.galleryInstance&&this.galleryInstance.destroy()}render(){return w`
var it=function(){return(it=Object.assign||function(t){for(var i,s=1,e=arguments.length;s<e;s++)for(var n in i=arguments[s])Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n]);return t}).apply(this,arguments)};!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:null};var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),s}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var st=function(){function t(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}return t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"==t?i:3&i|8).toString(16)}))},t.prototype._getSelector=function(t,i){return void 0===i&&(i=document),"string"!=typeof t?t:(i=i||document,"#"===t.substring(0,1)?i.querySelector(t):i.querySelectorAll(t))},t.prototype._each=function(t){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0),this):this},t.prototype._setCssVendorPrefix=function(t,i,s){var e=i.replace(/-([a-z])/gi,(function(t,i){return i.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(e)?(t.style[e.charAt(0).toLowerCase()+e.slice(1)]=s,t.style["webkit"+e]=s,t.style["moz"+e]=s,t.style["ms"+e]=s,t.style["o"+e]=s):t.style[e]=s},t.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},t.prototype.isEventMatched=function(t,i){var s=i.split(".");return t.split(".").filter((function(t){return t})).every((function(t){return-1!==s.indexOf(t)}))},t.prototype.attr=function(t,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(t):"":(this._each((function(s){s.setAttribute(t,i)})),this)},t.prototype.find=function(t){return et(this._getSelector(t,this.selector))},t.prototype.first=function(){return this.selector&&void 0!==this.selector.length?et(this.selector[0]):et(this.selector)},t.prototype.eq=function(t){return et(this.selector[t])},t.prototype.parent=function(){return et(this.selector.parentElement)},t.prototype.get=function(){return this._getFirstEl()},t.prototype.removeAttr=function(t){var i=t.split(" ");return this._each((function(t){i.forEach((function(i){return t.removeAttribute(i)}))})),this},t.prototype.wrap=function(t){if(!this.firstElement)return this;var i=document.createElement("div");return i.className=t,this.firstElement.parentNode.insertBefore(i,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),i.appendChild(this.firstElement),this},t.prototype.addClass=function(t){return void 0===t&&(t=""),this._each((function(i){t.split(" ").forEach((function(t){i.classList.add(t)}))})),this},t.prototype.removeClass=function(t){return this._each((function(i){t.split(" ").forEach((function(t){i.classList.remove(t)}))})),this},t.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},t.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},t.prototype.toggleClass=function(t){return this.firstElement?(this.hasClass(t)?this.removeClass(t):this.addClass(t),this):this},t.prototype.css=function(t,i){var s=this;return this._each((function(e){s._setCssVendorPrefix(e,t,i)})),this},t.prototype.on=function(i,s){var e=this;return this.selector?(i.split(" ").forEach((function(i){Array.isArray(t.eventListeners[i])||(t.eventListeners[i]=[]),t.eventListeners[i].push(s),e.selector.addEventListener(i.split(".")[0],s)})),this):this},t.prototype.once=function(t,i){var s=this;return this.on(t,(function(){s.off(t),i(t)})),this},t.prototype.off=function(i){var s=this;return this.selector?(Object.keys(t.eventListeners).forEach((function(e){s.isEventMatched(i,e)&&(t.eventListeners[e].forEach((function(t){s.selector.removeEventListener(e.split(".")[0],t)})),t.eventListeners[e]=[])})),this):this},t.prototype.trigger=function(t,i){if(!this.firstElement)return this;var s=new CustomEvent(t.split(".")[0],{detail:i||null});return this.firstElement.dispatchEvent(s),this},t.prototype.load=function(t){var i=this;return fetch(t).then((function(t){i.selector.innerHTML=t})),this},t.prototype.html=function(t){return void 0===t?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(i){i.innerHTML=t})),this)},t.prototype.append=function(t){return this._each((function(i){"string"==typeof t?i.insertAdjacentHTML("beforeend",t):i.appendChild(t)})),this},t.prototype.prepend=function(t){return this._each((function(i){i.insertAdjacentHTML("afterbegin",t)})),this},t.prototype.remove=function(){return this._each((function(t){t.parentNode.removeChild(t)})),this},t.prototype.empty=function(){return this._each((function(t){t.innerHTML=""})),this},t.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),i=et("body").style().marginLeft;return{left:t.left-parseFloat(i)+this.scrollLeft(),top:t.top+this.scrollTop()}},t.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},t.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},t.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},t.eventListeners={},t}();function et(t){return new st(t)}var nt=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function ot(t){return"href"===t?"src":t=(t=(t=t.replace("data-","")).charAt(0).toLowerCase()+t.slice(1)).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}var ht=function(t,i,s,e){void 0===s&&(s=0);var n=et(t).attr("data-lg-size")||e;if(n){var o=n.split(",");if(o[1])for(var h=window.innerWidth,r=0;r<o.length;r++){var l=o[r];if(parseInt(l.split("-")[2],10)>h){n=l;break}r===o.length-1&&(n=l)}var a=n.split("-"),u=parseInt(a[0],10),c=parseInt(a[1],10),d=i.width(),g=i.height()-s,f=Math.min(d,u),v=Math.min(g,c),m=Math.min(f/u,v/c);return{width:u*m,height:c*m}}},rt=function(t,i,s,e,n){if(n){var o=et(t).find("img").first();if(o.get()){var h=i.get().getBoundingClientRect(),r=h.width,l=i.height()-(s+e),a=o.width(),u=o.height(),c=o.style(),d=(r-a)/2-o.offset().left+(parseFloat(c.paddingLeft)||0)+(parseFloat(c.borderLeft)||0)+et(window).scrollLeft()+h.left,g=(l-u)/2-o.offset().top+(parseFloat(c.paddingTop)||0)+(parseFloat(c.borderTop)||0)+et(window).scrollTop()+s;return"translate3d("+(d*=-1)+"px, "+(g*=-1)+"px, 0) scale3d("+a/n.width+", "+u/n.height+", 1)"}}},lt=function(t,i,s,e){return'<div class="lg-video-cont lg-has-iframe" style="width:'+i+"; height: "+s+'">\n <iframe class="lg-object" frameborder="0" '+(e?'title="'+e+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},at=function(t,i,s,e,n,o){var h="<img "+s+" "+(e?'srcset="'+e+'"':"")+" "+(n?'sizes="'+n+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+i+'" />',r="";o&&(r=("string"==typeof o?JSON.parse(o):o).map((function(t){var i="";return Object.keys(t).forEach((function(s){i+=" "+s+'="'+t[s]+'"'})),"<source "+i+"></source>"})));return""+r+h},ut=function(t){for(var i=[],s=[],e="",n=0;n<t.length;n++){var o=t[n].split(" ");""===o[0]&&o.splice(0,1),s.push(o[0]),i.push(o[1])}for(var h=window.innerWidth,r=0;r<i.length;r++)if(parseInt(i[r],10)>h){e=s[r];break}return e},ct=function(t){return!!t&&(!!t.complete&&0!==t.naturalWidth)},dt=function(t,i,s,e){return'<div class="lg-video-cont '+(e&&e.youtube?"lg-has-youtube":e&&e.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+s+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(i||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},gt=function(t,i,s,e){var n=[],o=function(){for(var t=0,i=0,s=arguments.length;i<s;i++)t+=arguments[i].length;var e=Array(t),n=0;for(i=0;i<s;i++)for(var o=arguments[i],h=0,r=o.length;h<r;h++,n++)e[n]=o[h];return e}(nt,i);return[].forEach.call(t,(function(t){for(var i={},h=0;h<t.attributes.length;h++){var r=t.attributes[h];if(r.specified){var l=ot(r.name),a="";o.indexOf(l)>-1&&(a=l),a&&(i[a]=r.value)}}var u=et(t),c=u.find("img").first().attr("alt"),d=u.attr("title"),g=e?u.attr(e):u.find("img").first().attr("src");i.thumb=g,s&&!i.subHtml&&(i.subHtml=d||c||""),i.alt=c||d||"",n.push(i)})),n},ft=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},vt={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},mt="lgAfterAppendSlide",pt="lgInit",bt="lgHasVideo",yt="lgContainerResize",wt="lgUpdateSlides",xt="lgAfterAppendSubHtml",Tt="lgBeforeOpen",St="lgAfterOpen",kt="lgSlideItemLoad",Ct="lgBeforeSlide",zt="lgAfterSlide",Mt="lgPosterClick",At="lgDragStart",Ot="lgDragMove",jt="lgDragEnd",It="lgBeforeNextSlide",$t="lgBeforePrevSlide",Et="lgBeforeClose",Pt="lgAfterClose",Ut=0,_t=function(){function t(t,i){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(Ut++,this.lgId=Ut,this.el=t,this.LGel=et(t),this.generateSettings(i),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return t.prototype.generateSettings=function(t){if(this.settings=it(it({},vt),t),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():ft()){var i=it(it({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=it(it({},this.settings),i)}},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(pt,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var t=this,i=function(i){var e=s.items[i],n=et(e),o=st.generateUUID();n.attr("data-lg-id",o).on("click.lgcustom-item-"+o,(function(s){s.preventDefault();var n=t.settings.index||i;t.openGallery(n,e)}))},s=this,e=0;e<this.items.length;e++)i(e)},t.prototype.buildModules=function(){var t=this;this.settings.plugins.forEach((function(i){t.plugins.push(new i(t,et))}))},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return et(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return et("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t=this;if(!(this.$container&&this.$container.get())){var i="",s="";this.settings.controls&&(i='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(s='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var e="";this.settings.allowMediaOverlap&&(e+="lg-media-overlap ");var n=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",o=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",h="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),r=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",l=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",a='\n <div class="'+h+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+n+" "+o+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+e+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+l+"\n "+r+"\n </div>\n "+i+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+s+"\n </div>\n </div> \n </div>\n </div>\n ";et(this.settings.container).css("position","relative").append(a),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var u=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(u+="lg-grab "),this.settings.showAfterLoad&&(u+="lg-show-after-load"),this.outer.addClass(u),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),et(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},t.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].i;this.mediaContainerPosition=this.getMediaContainerPosition();var i=this.mediaContainerPosition,s=i.top,e=i.bottom;if(this.currentImageSize=ht(this.items[this.index],this.$lgContent,s+e,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var n=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",n)}this.LGel.trigger(yt)}},t.prototype.resizeVideoSlide=function(t,i){var s=this.getVideoContStyle(i);this.getSlideItem(t).find(".lg-video-cont").attr("style",s)},t.prototype.updateSlides=function(t,i){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var s=this.galleryItems[i].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var e=0;this.galleryItems.some((function(t,i){return t.src===s&&(e=i,!0)})),this.currentItemsInDom=this.organizeSlideItems(e,-1),this.loadContent(e,!0),this.getSlideItem(e).addClass("lg-current"),this.index=e,this.updateCurrentCounter(e),this.LGel.trigger(wt)}else this.closeGallery()},t.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=et(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return gt(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},t.prototype.openGallery=function(t,i){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var e=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=e;var n="";e.forEach((function(t){n=n+'<div id="'+t+'" class="lg-item"></div>'})),this.$inner.append(n),this.addHtml(t);var o="";this.mediaContainerPosition=this.getMediaContainerPosition();var h=this.mediaContainerPosition,r=h.top,l=h.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(r,l),this.zoomFromOrigin&&i&&(this.currentImageSize=ht(i,this.$lgContent,r+l,this.galleryItems[t].i&&this.settings.videoMaxSize),o=rt(i,this.$lgContent,r,l,this.currentImageSize)),this.zoomFromOrigin&&o||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var a=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),a),this.index=t,this.LGel.trigger(Tt),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=et(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&o){var i=s.getSlideItem(t);i.css("transform",o),setTimeout((function(){i.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){i.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&o||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(St)})),document.body===this.settings.container&&et("html").addClass("lg-on")}},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,i=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},t.prototype.setMediaContainerPosition=function(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.$inner.css("top",t+"px").css("bottom",i+"px")},t.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){if(this.settings.counter){var t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(t)}},t.prototype.addHtml=function(t){var i,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:i=this.galleryItems[t].subHtml,!s)if(i){var e=i.substring(0,1);"."!==e&&"#"!==e||(i=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?et(this.items).eq(t).find(i).first().html():et(i).first().html())}else i="";if(".lg-sub-html"===this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(i);else{var n=et(this.getSlideItemId(t));s?n.load(s):n.append('<div class="lg-sub-html">'+i+"</div>")}null!=i&&(""===i?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(xt,{index:t})},t.prototype.preload=function(t){for(var i=1;i<=this.settings.preload&&!(i>=this.galleryItems.length-t);i++)this.loadContent(t+i,!1);for(var s=1;s<=this.settings.preload&&!(t-s<0);s++)this.loadContent(t-s,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,i,s){var e;if(this.settings.dynamic||(e=et(this.items).eq(i)),e){var n=void 0;if(!(n=this.settings.exThumbImage?e.attr(this.settings.exThumbImage):e.find("img").first().attr("src")))return"";var o="<img "+s+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+n+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),o}return""},t.prototype.setImgMarkup=function(t,i,s){var e=this.galleryItems[s],n=e.alt,o=e.srcset,h=e.sizes,r=e.sources,l=n?'alt="'+n+'"':"",a='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(i,s,l):at(s,t,l,o,h,r))+"</picture>";i.prepend(a)},t.prototype.onLgObjectLoad=function(t,i,s,e,n){var o=this;n&&this.LGel.trigger(kt,{index:i,delay:s||0}),t.find(".lg-object").first().on("load.lg",(function(){o.handleLgObjectLoad(t,i,s,e,n)})),setTimeout((function(){t.find(".lg-object").first().on("error.lg",(function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')}))}),e)},t.prototype.handleLgObjectLoad=function(t,i,s,e,n){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),n||o.LGel.trigger(kt,{index:i,delay:s||0})}),e)},t.prototype.isVideo=function(t,i){if(!t)return this.galleryItems[i].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),e=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),n=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:e?{vimeo:e}:n?{wistia:n}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach((function(t,s){t.i=i.isVideo(t.src,s)}))},t.prototype.loadContent=function(t,i){var s=this,e=this.galleryItems[t],n=et(this.getSlideItemId(t)),o=e.poster,h=e.srcset,r=e.sizes,l=e.sources,a=e.src,u=e.video,c=u&&"string"==typeof u?JSON.parse(u):u;if(e.responsive){var d=e.responsive.split(",");a=ut(d)||a}var g=e.i,f="",v=!!e.iframe;if(!n.hasClass("lg-loaded")){if(g){var m=this.mediaContainerPosition,p=m.top,b=m.bottom,y=ht(this.items[t],this.$lgContent,p+b,g&&this.settings.videoMaxSize);f=this.getVideoContStyle(y)}if(v){var w=lt(a,this.settings.iframeWidth,this.settings.iframeHeight,e.iframeTitle);n.prepend(w)}else if(o){var x="",T=!this.lGalleryOn,S=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;S&&(x=this.getDummyImageContent(n,t,""));w=dt(o,x||"",f,g);n.prepend(w);var k=(S?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(bt,{index:t,src:a,html5Video:c,hasPoster:!0,isFirstSlide:T})}),k)}else if(g){w='<div class="lg-video-cont " style="'+f+'"></div>';n.prepend(w),this.LGel.trigger(bt,{index:t,src:a,html5Video:c,hasPoster:!1})}else if(this.setImgMarkup(a,n,t),h||l){var C=n.find(".lg-object");this.initPictureFill(C)}this.LGel.trigger(mt,{index:t}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(t)}var z=0,M=0;this.lGalleryOn||(M=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),M&&!et(document.body).hasClass("lg-from-hash")&&(z=M),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){n.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),n.hasClass("lg-loaded")||setTimeout((function(){if(n.find(".lg-img-wrap").append(at(t,a,"",h,r,e.sources)),h||l){var i=n.find(".lg-object");s.initPictureFill(i)}s.onLgObjectLoad(n,t,M,z,!0);var o=n.find(".lg-object").first();ct(o.get())?s.loadContentOnLoad(t,n,z):o.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,n,z)}))}),this.settings.startAnimationDuration+100)),n.addClass("lg-loaded"),this.onLgObjectLoad(n,t,M,z,!1),g&&g.html5&&!o&&n.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!n.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){n.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(n.hasClass("lg-complete_")?this.preload(t):n.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},t.prototype.loadContentOnLoad=function(t,i,s){var e=this;setTimeout((function(){i.find(".lg-dummy-img").remove(),i.removeClass("lg-first-slide"),e.outer.removeClass("lg-first-slide-loading"),e.isDummyImageRemoved=!0,e.preload(t)}),s+300)},t.prototype.getItemsToBeInsertedToDom=function(t,i,s){var e=this;void 0===s&&(s=0);var n=[],o=Math.max(s,3);o=Math.min(o,this.galleryItems.length);var h="lg-item-"+this.lgId+"-"+i;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,i){n.push("lg-item-"+e.lgId+"-"+i)})),n;if(t<(this.galleryItems.length-1)/2){for(var r=t;r>t-o/2&&r>=0;r--)n.push("lg-item-"+this.lgId+"-"+r);var l=n.length;for(r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)n.push("lg-item-"+this.lgId+"-"+r);for(l=n.length,r=0;r<o-l;r++)n.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?n.push("lg-item-"+this.lgId+"-0"):0===t&&n.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===n.indexOf(h)&&n.push("lg-item-"+this.lgId+"-"+i),n},t.prototype.organizeSlideItems=function(t,i){var s=this,e=this.getItemsToBeInsertedToDom(t,i,this.settings.numberOfSlideItemsInDom);return e.forEach((function(t){-1===s.currentItemsInDom.indexOf(t)&&s.$inner.append('<div id="'+t+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(t){-1===e.indexOf(t)&&et("#"+t).remove()})),e},t.prototype.getPreviousSlideIndex=function(){var t=0;try{var i=this.outer.find(".lg-current").first().attr("id");t=parseInt(i.split("-")[3])||0}catch(i){t=0}return t},t.prototype.setDownloadValue=function(t){if(this.settings.download){var i=this.galleryItems[t],s=!1!==i.downloadUrl&&(i.downloadUrl||i.src);s&&!i.iframe&&this.getElementById("lg-download").attr("href",s)}},t.prototype.makeSlideAnimation=function(t,i,s){var e=this;this.lGalleryOn&&s.addClass("lg-slide-progress"),setTimeout((function(){e.outer.addClass("lg-no-trans"),e.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(i.addClass("lg-prev-slide"),s.addClass("lg-next-slide")):(i.addClass("lg-next-slide"),s.addClass("lg-prev-slide")),setTimeout((function(){e.outer.find(".lg-item").removeClass("lg-current"),i.addClass("lg-current"),e.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,i,s,e){var n=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var h=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var r=this.getSlideItem(t),l=this.getSlideItem(o),a=this.galleryItems[t],u=a.i;if(this.outer.attr("data-lg-slide-type",this.getSlideType(a)),this.setDownloadValue(t),u){var c=this.mediaContainerPosition,d=c.top,g=c.bottom,f=ht(this.items[t],this.$lgContent,d+g,u&&this.settings.videoMaxSize);this.resizeVideoSlide(t,f)}if(this.LGel.trigger(Ct,{prevIndex:o,index:t,fromTouch:!!i,fromThumb:!!s}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),e||(t<o?e="prev":t>o&&(e="next")),i){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var v=void 0,m=void 0;h>2?(v=t-1,m=t+1,(0===t&&o===h-1||t===h-1&&0===o)&&(m=0,v=h-1)):(v=0,m=1),"prev"===e?this.getSlideItem(m).addClass("lg-next-slide"):this.getSlideItem(v).addClass("lg-prev-slide"),r.addClass("lg-current")}else this.makeSlideAnimation(e,r,l);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){n.lGalleryOn&&n.loadContent(t,!0),".lg-sub-html"===n.settings.appendSubHtmlTo&&n.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(i?0:this.settings.slideDelay)),setTimeout((function(){n.lgBusy=!1,l.removeClass("lg-slide-progress"),n.LGel.trigger(zt,{prevIndex:o,index:t,fromTouch:i,fromThumb:s})}),(this.lGalleryOn?this.settings.speed+100:100)+(i?0:this.settings.slideDelay))}this.index=t}},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.i?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,i){var s=i.pageX-t.pageX,e=i.pageY-t.pageY,n=!1;if(this.swipeDirection?n=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",n=!0):Math.abs(e)>15&&(this.swipeDirection="vertical",n=!0),n){var o=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){this.outer.addClass("lg-dragging"),this.setTranslate(o,s,0);var h=o.get().offsetWidth,r=15*h/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-h+s-r,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),h+s+r,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){this.$container.addClass("lg-dragging-vertical");var l=1-Math.abs(e)/window.innerHeight;this.$backdrop.css("opacity",l);var a=1-Math.abs(e)/(2*window.innerWidth);this.setTranslate(o,0,e,a,a),Math.abs(e)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},t.prototype.touchEnd=function(t,i,s){var e,n=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){n.$container.removeClass("lg-dragging-vertical"),n.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var o=!0;if("horizontal"===n.swipeDirection){e=t.pageX-i.pageX;var h=Math.abs(t.pageX-i.pageX);e<0&&h>n.settings.swipeThreshold?(n.goToNextSlide(!0),o=!1):e>0&&h>n.settings.swipeThreshold&&(n.goToPrevSlide(!0),o=!1)}else if("vertical"===n.swipeDirection){if(e=Math.abs(t.pageY-i.pageY),n.settings.closable&&n.settings.swipeToClose&&e>100)return void n.closeGallery();n.$backdrop.css("opacity",1)}if(n.outer.find(".lg-item").removeAttr("style"),o&&Math.abs(t.pageX-i.pageX)<5){var r=et(s.target);n.isPosterElement(r)&&n.LGel.trigger(Mt)}n.swipeDirection=void 0})),setTimeout((function(){n.outer.hasClass("lg-dragging")||"lg-slide"===n.settings.mode||n.outer.removeClass("lg-slide")}),this.settings.speed+100)},t.prototype.enableSwipe=function(){var t=this,i={},s={},e=!1,n=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){s.preventDefault();var e=t.getSlideItem(t.index);!et(s.target).hasClass("lg-item")&&!e.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(n=!0,t.touchAction="swipe",t.manageSwipeClass(),i={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){o.preventDefault(),n&&"swipe"===t.touchAction&&1===o.targetTouches.length&&(s={pageX:o.targetTouches[0].pageX,pageY:o.targetTouches[0].pageY},t.touchMove(i,s),e=!0)})),this.$inner.on("touchend.lg",(function(o){if("swipe"===t.touchAction){if(e)e=!1,t.touchEnd(s,i,o);else if(n){var h=et(o.target);t.isPosterElement(h)&&t.LGel.trigger(Mt)}t.touchAction=void 0,n=!1}})))},t.prototype.enableDrag=function(){var t=this,i={},s={},e=!1,n=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){var n=t.getSlideItem(t.index);(et(s.target).hasClass("lg-item")||n.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),i={pageX:s.pageX,pageY:s.pageY},e=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(At))))})),et(window).on("mousemove.lg.global"+this.lgId,(function(o){e&&t.lgOpened&&(n=!0,s={pageX:o.pageX,pageY:o.pageY},t.touchMove(i,s),t.LGel.trigger(Ot))})),et(window).on("mouseup.lg.global"+this.lgId,(function(o){if(t.lgOpened){var h=et(o.target);n?(n=!1,t.touchEnd(s,i,o),t.LGel.trigger(jt)):t.isPosterElement(h)&&t.LGel.trigger(Mt),e&&(e=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},t.prototype.manageSwipeClass=function(){var t=this.index+1,i=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?i=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),i>-1&&this.getSlideItem(i).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(It,{index:this.index}),this.slide(this.index,!!t,!1,"next")):s?(this.index=0,this.LGel.trigger(It,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout((function(){i.outer.removeClass("lg-right-end")}),400)))},t.prototype.goToPrevSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger($t,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):s?(this.index=this.galleryItems.length-1,this.LGel.trigger($t,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){i.outer.removeClass("lg-left-end")}),400)))},t.prototype.keyPress=function(){var t=this;et(window).on("keydown.lg.global"+this.lgId,(function(i){t.lgOpened&&!0===t.settings.escKey&&27===i.keyCode&&(i.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===i.keyCode&&(i.preventDefault(),t.goToPrevSlide()),39===i.keyCode&&(i.preventDefault(),t.goToNextSlide()))}))},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},t.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var i=this.getElementById("lg-prev"),s=this.getElementById("lg-next");t+1===this.galleryItems.length?s.attr("disabled","disabled").addClass("disabled"):s.removeAttr("disabled").removeClass("disabled"),0===t?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled")}},t.prototype.setTranslate=function(t,i,s,e,n){void 0===e&&(e=1),void 0===n&&(n=1),t.css("transform","translate3d("+i+"px, "+s+"px, 0px) scale3d("+e+", "+n+", 1)")},t.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(i){!i.deltaY||t.galleryItems.length<2||(i.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),i.preventDefault())}))},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var i=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||i&&i.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var i=et(this.items[t]);i.off("click.lgcustom-item-"+i.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var t=this;if(this.settings.closable){var i=!1;this.getElementById("lg-close").on("click.lg",(function(){t.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(s){var e=et(s.target);i=!!t.isSlideElement(e)})),this.outer.on("mousemove.lg",(function(){i=!1})),this.outer.on("mouseup.lg",(function(s){var e=et(s.target);t.isSlideElement(e)&&i&&(t.outer.hasClass("lg-dragging")||t.closeGallery())})))}},t.prototype.closeGallery=function(t){var i=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(Et),et(window).scrollTop(this.prevScrollTop);var s,e=this.items[this.index];if(this.zoomFromOrigin&&e){var n=this.mediaContainerPosition,o=n.top,h=n.bottom,r=ht(e,this.$lgContent,o+h,this.galleryItems[this.index].i&&this.settings.videoMaxSize);s=rt(e,this.$lgContent,o,h,r)}this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,et("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var l=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){i.zoomFromOrigin&&s&&i.outer.removeClass("lg-zoom-from-image"),i.$container.removeClass("lg-show"),i.$backdrop.removeAttr("style").css("transition-duration",i.settings.backdropDuration+"ms"),i.outer.removeClass("lg-closing "+i.settings.startClass),i.getSlideItem(i.index).removeClass("lg-start-end-progress"),i.$inner.empty(),i.lgOpened&&i.LGel.trigger(Pt,{instance:i}),i.outer.get()&&i.outer.get().blur(),i.lgOpened=!1}),l+100),l+100},t.prototype.initModules=function(){this.plugins.forEach((function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},t.prototype.destroyModules=function(t){this.plugins.forEach((function(i){try{t?i.destroy():i.closeGallery&&i.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.updateControls(),this.openGalleryOnItemClick(),this.LGel.trigger(wt)},t.prototype.updateControls=function(){this.addSlideVideoInfo(this.galleryItems),this.updateCounterTotal(),this.manageSingleSlideClassName()},t.prototype.destroy=function(){var t=this,i=this.closeGallery(!0);return setTimeout((function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),et(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()}),i),i},t}();var Dt=function(t,i,s,e){for(var n,o=arguments.length,h=o<3?i:null===e?e=Object.getOwnPropertyDescriptor(i,s):e,r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(i,s,h):n(i,s))||h);return o>3&&h&&Object.defineProperty(i,s,h),h};let Ft=class extends Q{constructor(){super(...arguments),this.settings={}}getSelector(t){const i=t.assignedNodes({flatten:!0});return Array.prototype.filter.call(i,(t=>t.nodeType==Node.ELEMENT_NODE))}firstUpdated(){if(!this.shadowRoot)return;const t=this.shadowRoot.querySelector("slot"),i={selector:this.getSelector(t)},s={...this.settings,...i};this.galleryInstance=new _t(this,s)}handleSlotchange(t){var i,s;const e=this.getSelector(t.target);this.galleryInstance&&(null===(i=this.galleryInstance)||void 0===i?void 0:i.galleryItems.length)!==e.length&&(this.galleryInstance.settings.selector=e,null===(s=this.galleryInstance)||void 0===s||s.refresh())}disconnectedCallback(){super.disconnectedCallback(),this.galleryInstance&&this.galleryInstance.destroy()}render(){return w`
<div id="container">

@@ -59,0 +59,0 @@ <slot @slotchange=${this.handleSlotchange}></slot>

@@ -14,3 +14,3 @@ var t,i;t=this,i=function(t,i){

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -34,3 +34,3 @@ * Copyright (c) 2020 Sachin Neravath;

***************************************************************************** */
var n=function(){return(n=Object.assign||function(t){for(var i,s=1,n=arguments.length;s<n;s++)for(var e in i=arguments[s])Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}).apply(this,arguments)};!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:null};var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),s}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=function(){function t(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}return t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"==t?i:3&i|8).toString(16)}))},t.prototype._getSelector=function(t,i){return void 0===i&&(i=document),"string"!=typeof t?t:(i=i||document,"#"===t.substring(0,1)?i.querySelector(t):i.querySelectorAll(t))},t.prototype._each=function(t){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0),this):this},t.prototype._setCssVendorPrefix=function(t,i,s){var n=i.replace(/-([a-z])/gi,(function(t,i){return i.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(n)?(t.style[n.charAt(0).toLowerCase()+n.slice(1)]=s,t.style["webkit"+n]=s,t.style["moz"+n]=s,t.style["ms"+n]=s,t.style["o"+n]=s):t.style[n]=s},t.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},t.prototype.isEventMatched=function(t,i){var s=i.split(".");return t.split(".").filter((function(t){return t})).every((function(t){return-1!==s.indexOf(t)}))},t.prototype.attr=function(t,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(t):"":(this._each((function(s){s.setAttribute(t,i)})),this)},t.prototype.find=function(t){return o(this._getSelector(t,this.selector))},t.prototype.first=function(){return this.selector&&void 0!==this.selector.length?o(this.selector[0]):o(this.selector)},t.prototype.eq=function(t){return o(this.selector[t])},t.prototype.parent=function(){return o(this.selector.parentElement)},t.prototype.get=function(){return this._getFirstEl()},t.prototype.removeAttr=function(t){var i=t.split(" ");return this._each((function(t){i.forEach((function(i){return t.removeAttribute(i)}))})),this},t.prototype.wrap=function(t){if(!this.firstElement)return this;var i=document.createElement("div");return i.className=t,this.firstElement.parentNode.insertBefore(i,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),i.appendChild(this.firstElement),this},t.prototype.addClass=function(t){return void 0===t&&(t=""),this._each((function(i){t.split(" ").forEach((function(t){i.classList.add(t)}))})),this},t.prototype.removeClass=function(t){return this._each((function(i){t.split(" ").forEach((function(t){i.classList.remove(t)}))})),this},t.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},t.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},t.prototype.toggleClass=function(t){return this.firstElement?(this.hasClass(t)?this.removeClass(t):this.addClass(t),this):this},t.prototype.css=function(t,i){var s=this;return this._each((function(n){s._setCssVendorPrefix(n,t,i)})),this},t.prototype.on=function(i,s){var n=this;return this.selector?(i.split(" ").forEach((function(i){Array.isArray(t.eventListeners[i])||(t.eventListeners[i]=[]),t.eventListeners[i].push(s),n.selector.addEventListener(i.split(".")[0],s)})),this):this},t.prototype.once=function(t,i){var s=this;return this.on(t,(function(){s.off(t),i(t)})),this},t.prototype.off=function(i){var s=this;return this.selector?(Object.keys(t.eventListeners).forEach((function(n){s.isEventMatched(i,n)&&(t.eventListeners[n].forEach((function(t){s.selector.removeEventListener(n.split(".")[0],t)})),t.eventListeners[n]=[])})),this):this},t.prototype.trigger=function(t,i){if(!this.firstElement)return this;var s=new CustomEvent(t.split(".")[0],{detail:i||null});return this.firstElement.dispatchEvent(s),this},t.prototype.load=function(t){var i=this;return fetch(t).then((function(t){i.selector.innerHTML=t})),this},t.prototype.html=function(t){return void 0===t?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(i){i.innerHTML=t})),this)},t.prototype.append=function(t){return this._each((function(i){"string"==typeof t?i.insertAdjacentHTML("beforeend",t):i.appendChild(t)})),this},t.prototype.prepend=function(t){return this._each((function(i){i.insertAdjacentHTML("afterbegin",t)})),this},t.prototype.remove=function(){return this._each((function(t){t.parentNode.removeChild(t)})),this},t.prototype.empty=function(){return this._each((function(t){t.innerHTML=""})),this},t.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),i=o("body").style().marginLeft;return{left:t.left-parseFloat(i)+this.scrollLeft(),top:t.top+this.scrollTop()}},t.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},t.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},t.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},t.eventListeners={},t}();function o(t){return new e(t)}var h=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function r(t){return"href"===t?"src":t=(t=(t=t.replace("data-","")).charAt(0).toLowerCase()+t.slice(1)).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}var l=function(t,i,s,n){void 0===s&&(s=0);var e=o(t).attr("data-lg-size")||n;if(e){var h=e.split(",");if(h[1])for(var r=window.innerWidth,l=0;l<h.length;l++){var a=h[l];if(parseInt(a.split("-")[2],10)>r){e=a;break}l===h.length-1&&(e=a)}var u=e.split("-"),c=parseInt(u[0],10),g=parseInt(u[1],10),d=i.width(),f=i.height()-s,v=Math.min(d,c),m=Math.min(f,g),p=Math.min(v/c,m/g);return{width:c*p,height:g*p}}},a=function(t,i,s,n,e){if(e){var h=o(t).find("img").first();if(h.get()){var r=i.get().getBoundingClientRect(),l=r.width,a=i.height()-(s+n),u=h.width(),c=h.height(),g=h.style(),d=(l-u)/2-h.offset().left+(parseFloat(g.paddingLeft)||0)+(parseFloat(g.borderLeft)||0)+o(window).scrollLeft()+r.left,f=(a-c)/2-h.offset().top+(parseFloat(g.paddingTop)||0)+(parseFloat(g.borderTop)||0)+o(window).scrollTop()+s;return"translate3d("+(d*=-1)+"px, "+(f*=-1)+"px, 0) scale3d("+u/e.width+", "+c/e.height+", 1)"}}},u=function(t,i,s,n){return'<div class="lg-video-cont lg-has-iframe" style="width:'+i+"; height: "+s+'">\n <iframe class="lg-object" frameborder="0" '+(n?'title="'+n+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},c=function(t,i,s,n,e,o){var h="<img "+s+" "+(n?'srcset="'+n+'"':"")+" "+(e?'sizes="'+e+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+i+'" />',r="";return o&&(r=("string"==typeof o?JSON.parse(o):o).map((function(t){var i="";return Object.keys(t).forEach((function(s){i+=" "+s+'="'+t[s]+'"'})),"<source "+i+"></source>"}))),""+r+h},g=function(t){for(var i=[],s=[],n="",e=0;e<t.length;e++){var o=t[e].split(" ");""===o[0]&&o.splice(0,1),s.push(o[0]),i.push(o[1])}for(var h=window.innerWidth,r=0;r<i.length;r++)if(parseInt(i[r],10)>h){n=s[r];break}return n},d=function(t){return!!t&&!!t.complete&&0!==t.naturalWidth},f=function(t,i,s,n){return'<div class="lg-video-cont '+(n&&n.youtube?"lg-has-youtube":n&&n.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+s+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(i||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},v=function(t,i,s,n){var e=[],l=function(){for(var t=0,i=0,s=arguments.length;i<s;i++)t+=arguments[i].length;var n=Array(t),e=0;for(i=0;i<s;i++)for(var o=arguments[i],h=0,r=o.length;h<r;h++,e++)n[e]=o[h];return n}(h,i);return[].forEach.call(t,(function(t){for(var i={},h=0;h<t.attributes.length;h++){var a=t.attributes[h];if(a.specified){var u=r(a.name),c="";l.indexOf(u)>-1&&(c=u),c&&(i[c]=a.value)}}var g=o(t),d=g.find("img").first().attr("alt"),f=g.attr("title"),v=n?g.attr(n):g.find("img").first().attr("src");i.thumb=v,s&&!i.subHtml&&(i.subHtml=f||d||""),i.alt=d||f||"",e.push(i)})),e},m=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},p={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},b="lgAfterAppendSlide",w="lgInit",y="lgHasVideo",x="lgContainerResize",T="lgUpdateSlides",k="lgAfterAppendSubHtml",z="lgBeforeOpen",M="lgAfterOpen",S="lgSlideItemLoad",j="lgBeforeSlide",A="lgAfterSlide",O="lgPosterClick",C="lgDragStart",I="lgDragMove",F="lgDragEnd",P="lgBeforeNextSlide",D="lgBeforePrevSlide",B="lgBeforeClose",E="lgAfterClose",H=0,_=function(){function t(t,i){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(H++,this.lgId=H,this.el=t,this.LGel=o(t),this.generateSettings(i),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return t.prototype.generateSettings=function(t){if(this.settings=n(n({},p),t),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():m()){var i=n(n({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=n(n({},this.settings),i)}},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(w,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var t=this,i=function(i){var n=s.items[i],h=o(n),r=e.generateUUID();h.attr("data-lg-id",r).on("click.lgcustom-item-"+r,(function(s){s.preventDefault();var e=t.settings.index||i;t.openGallery(e,n)}))},s=this,n=0;n<this.items.length;n++)i(n)},t.prototype.buildModules=function(){var t=this;this.settings.plugins.forEach((function(i){t.plugins.push(new i(t,o))}))},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return o(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return o("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t=this;if(!this.$container||!this.$container.get()){var i="",s="";this.settings.controls&&(i='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(s='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var n="";this.settings.allowMediaOverlap&&(n+="lg-media-overlap ");var e=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",h=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",r="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),l=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",a=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",u='\n <div class="'+r+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+e+" "+h+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+n+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+a+"\n "+l+"\n </div>\n "+i+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+s+"\n </div>\n </div> \n </div>\n </div>\n ";o(this.settings.container).css("position","relative").append(u),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var c=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(c+="lg-grab "),this.settings.showAfterLoad&&(c+="lg-show-after-load"),this.outer.addClass(c),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),o(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},t.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].t,i=this.getMediaContainerPosition(),s=i.top,n=i.bottom;if(this.currentImageSize=l(this.items[this.index],this.$lgContent,s+n,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var e=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",e)}this.LGel.trigger(x)}},t.prototype.resizeVideoSlide=function(t,i){var s=this.getVideoContStyle(i);this.getSlideItem(t).find(".lg-video-cont").attr("style",s)},t.prototype.updateSlides=function(t,i){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var s=this.galleryItems[i].src;this.addSlideVideoInfo(t),this.galleryItems=t,this.$inner.empty(),this.currentItemsInDom=[];var n=0;this.galleryItems.some((function(t,i){return t.src===s&&(n=i,!0)})),this.currentItemsInDom=this.organizeSlideItems(n,-1),this.loadContent(n,!0),this.getSlideItem(n).addClass("lg-current"),this.index=n,this.updateCurrentCounter(n),this.updateCounterTotal(),this.LGel.trigger(T)}else this.closeGallery()},t.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=o(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return v(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},t.prototype.openGallery=function(t,i){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var n=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=n;var e="";n.forEach((function(t){e=e+'<div id="'+t+'" class="lg-item"></div>'})),this.$inner.append(e),this.addHtml(t);var h="";this.mediaContainerPosition=this.getMediaContainerPosition();var r=this.mediaContainerPosition,u=r.top,c=r.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(u,c),this.zoomFromOrigin&&i&&(this.currentImageSize=l(i,this.$lgContent,u+c,this.galleryItems[t].t&&this.settings.videoMaxSize),h=a(i,this.$lgContent,u,c,this.currentImageSize)),this.zoomFromOrigin&&h||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var g=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),g),this.index=t,this.LGel.trigger(z),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=o(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&h){var i=s.getSlideItem(t);i.css("transform",h),setTimeout((function(){i.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){i.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&h||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(M)})),document.body===this.settings.container&&o("html").addClass("lg-on")}},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,i=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},t.prototype.setMediaContainerPosition=function(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.$inner.css("top",t+"px").css("bottom",i+"px")},t.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){if(this.settings.counter){var t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(t)}},t.prototype.addHtml=function(t){var i,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:i=this.galleryItems[t].subHtml,!s)if(i){var n=i.substring(0,1);"."!==n&&"#"!==n||(i=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?o(this.items).eq(t).find(i).first().html():o(i).first().html())}else i="";if(".lg-sub-html"===this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(i);else{var e=o(this.getSlideItemId(t));s?e.load(s):e.append('<div class="lg-sub-html">'+i+"</div>")}null!=i&&(""===i?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(k,{index:t})},t.prototype.preload=function(t){for(var i=1;i<=this.settings.preload&&!(i>=this.galleryItems.length-t);i++)this.loadContent(t+i,!1);for(var s=1;s<=this.settings.preload&&!(t-s<0);s++)this.loadContent(t-s,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,i,s){var n;if(this.settings.dynamic||(n=o(this.items).eq(i)),n){var e=void 0;if(!(e=this.settings.exThumbImage?n.attr(this.settings.exThumbImage):n.find("img").first().attr("src")))return"";var h="<img "+s+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+e+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),h}return""},t.prototype.setImgMarkup=function(t,i,s){var n=this.galleryItems[s],e=n.alt,o=n.srcset,h=n.sizes,r=n.sources,l=e?'alt="'+e+'"':"",a='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(i,s,l):c(s,t,l,o,h,r))+"</picture>";i.prepend(a)},t.prototype.onLgObjectLoad=function(t,i,s,n,e){var o=this;e&&this.LGel.trigger(S,{index:i,delay:s||0}),t.find(".lg-object").first().on("load.lg",(function(){o.handleLgObjectLoad(t,i,s,n,e)})),setTimeout((function(){t.find(".lg-object").first().on("error.lg",(function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')}))}),n)},t.prototype.handleLgObjectLoad=function(t,i,s,n,e){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),e||o.LGel.trigger(S,{index:i,delay:s||0})}),n)},t.prototype.isVideo=function(t,i){if(!t)return this.galleryItems[i].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),n=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),e=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:n?{vimeo:n}:e?{wistia:e}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach((function(t,s){t.t=i.isVideo(t.src,s)}))},t.prototype.loadContent=function(t,i){var s=this,n=this.galleryItems[t],e=o(this.getSlideItemId(t)),h=n.poster,r=n.srcset,a=n.sizes,v=n.sources,m=n.src,p=n.video,w=p&&"string"==typeof p?JSON.parse(p):p;if(n.responsive){var x=n.responsive.split(",");m=g(x)||m}var T=n.t,k="",z=!!n.iframe;if(!e.hasClass("lg-loaded")){if(T){var M=this.mediaContainerPosition,S=M.top,j=M.bottom,A=l(this.items[t],this.$lgContent,S+j,T&&this.settings.videoMaxSize);k=this.getVideoContStyle(A)}if(z){var O=u(m,this.settings.iframeWidth,this.settings.iframeHeight,n.iframeTitle);e.prepend(O)}else if(h){var C="",I=!this.lGalleryOn,F=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;F&&(C=this.getDummyImageContent(e,t,"")),O=f(h,C||"",k,T),e.prepend(O);var P=(F?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(y,{index:t,src:m,html5Video:w,hasPoster:!0,isFirstSlide:I})}),P)}else if(T)O='<div class="lg-video-cont " style="'+k+'"></div>',e.prepend(O),this.LGel.trigger(y,{index:t,src:m,html5Video:w,hasPoster:!1});else if(this.setImgMarkup(m,e,t),r||v){var D=e.find(".lg-object");this.initPictureFill(D)}this.LGel.trigger(b,{index:t}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(t)}var B=0,E=0;this.lGalleryOn||(E=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),E&&!o(document.body).hasClass("lg-from-hash")&&(B=E),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){e.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),e.hasClass("lg-loaded")||setTimeout((function(){if(e.find(".lg-img-wrap").append(c(t,m,"",r,a,n.sources)),r||v){var i=e.find(".lg-object");s.initPictureFill(i)}s.onLgObjectLoad(e,t,E,B,!0);var o=e.find(".lg-object").first();d(o.get())?s.loadContentOnLoad(t,e,B):o.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,e,B)}))}),this.settings.startAnimationDuration+100)),e.addClass("lg-loaded"),this.onLgObjectLoad(e,t,E,B,!1),T&&T.html5&&!h&&e.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!e.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){e.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(e.hasClass("lg-complete_")?this.preload(t):e.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},t.prototype.loadContentOnLoad=function(t,i,s){var n=this;setTimeout((function(){i.find(".lg-dummy-img").remove(),i.removeClass("lg-first-slide"),n.outer.removeClass("lg-first-slide-loading"),n.isDummyImageRemoved=!0,n.preload(t)}),s+300)},t.prototype.getItemsToBeInsertedToDom=function(t,i,s){var n=this;void 0===s&&(s=0);var e=[],o=Math.max(s,3);o=Math.min(o,this.galleryItems.length);var h="lg-item-"+this.lgId+"-"+i;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,i){e.push("lg-item-"+n.lgId+"-"+i)})),e;if(t<(this.galleryItems.length-1)/2){for(var r=t;r>t-o/2&&r>=0;r--)e.push("lg-item-"+this.lgId+"-"+r);var l=e.length;for(r=0;r<o-l;r++)e.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)e.push("lg-item-"+this.lgId+"-"+r);for(l=e.length,r=0;r<o-l;r++)e.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?e.push("lg-item-"+this.lgId+"-0"):0===t&&e.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===e.indexOf(h)&&e.push("lg-item-"+this.lgId+"-"+i),e},t.prototype.organizeSlideItems=function(t,i){var s=this,n=this.getItemsToBeInsertedToDom(t,i,this.settings.numberOfSlideItemsInDom);return n.forEach((function(t){-1===s.currentItemsInDom.indexOf(t)&&s.$inner.append('<div id="'+t+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(t){-1===n.indexOf(t)&&o("#"+t).remove()})),n},t.prototype.getPreviousSlideIndex=function(){var t=0;try{var i=this.outer.find(".lg-current").first().attr("id");t=parseInt(i.split("-")[3])||0}catch(i){t=0}return t},t.prototype.setDownloadValue=function(t){if(this.settings.download){var i=this.galleryItems[t],s=!1!==i.downloadUrl&&(i.downloadUrl||i.src);s&&!i.iframe&&this.getElementById("lg-download").attr("href",s)}},t.prototype.makeSlideAnimation=function(t,i,s){var n=this;this.lGalleryOn&&s.addClass("lg-slide-progress"),setTimeout((function(){n.outer.addClass("lg-no-trans"),n.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(i.addClass("lg-prev-slide"),s.addClass("lg-next-slide")):(i.addClass("lg-next-slide"),s.addClass("lg-prev-slide")),setTimeout((function(){n.outer.find(".lg-item").removeClass("lg-current"),i.addClass("lg-current"),n.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,i,s,n){var e=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var h=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var r=this.getSlideItem(t),a=this.getSlideItem(o),u=this.galleryItems[t],c=u.t;if(this.outer.attr("data-lg-slide-type",this.getSlideType(u)),this.setDownloadValue(t),c){var g=this.mediaContainerPosition,d=g.top,f=g.bottom,v=l(this.items[t],this.$lgContent,d+f,c&&this.settings.videoMaxSize);this.resizeVideoSlide(t,v)}if(this.LGel.trigger(j,{prevIndex:o,index:t,fromTouch:!!i,fromThumb:!!s}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),n||(t<o?n="prev":t>o&&(n="next")),i){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var m=void 0,p=void 0;h>2?(m=t-1,p=t+1,(0===t&&o===h-1||t===h-1&&0===o)&&(p=0,m=h-1)):(m=0,p=1),"prev"===n?this.getSlideItem(p).addClass("lg-next-slide"):this.getSlideItem(m).addClass("lg-prev-slide"),r.addClass("lg-current")}else this.makeSlideAnimation(n,r,a);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){e.lGalleryOn&&e.loadContent(t,!0),".lg-sub-html"===e.settings.appendSubHtmlTo&&e.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(i?0:this.settings.slideDelay)),setTimeout((function(){e.lgBusy=!1,a.removeClass("lg-slide-progress"),e.LGel.trigger(A,{prevIndex:o,index:t,fromTouch:i,fromThumb:s})}),(this.lGalleryOn?this.settings.speed+100:100)+(i?0:this.settings.slideDelay))}this.index=t}},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.t?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,i){var s=i.pageX-t.pageX,n=i.pageY-t.pageY,e=!1;if(this.swipeDirection?e=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",e=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",e=!0),e){var o=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){this.outer.addClass("lg-dragging"),this.setTranslate(o,s,0);var h=o.get().offsetWidth,r=15*h/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-h+s-r,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),h+s+r,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){this.$container.addClass("lg-dragging-vertical");var l=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",l);var a=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(o,0,n,a,a),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},t.prototype.touchEnd=function(t,i,s){var n,e=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){e.$container.removeClass("lg-dragging-vertical"),e.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var h=!0;if("horizontal"===e.swipeDirection){n=t.pageX-i.pageX;var r=Math.abs(t.pageX-i.pageX);n<0&&r>e.settings.swipeThreshold?(e.goToNextSlide(!0),h=!1):n>0&&r>e.settings.swipeThreshold&&(e.goToPrevSlide(!0),h=!1)}else if("vertical"===e.swipeDirection){if(n=Math.abs(t.pageY-i.pageY),e.settings.closable&&e.settings.swipeToClose&&n>100)return void e.closeGallery();e.$backdrop.css("opacity",1)}if(e.outer.find(".lg-item").removeAttr("style"),h&&Math.abs(t.pageX-i.pageX)<5){var l=o(s.target);e.isPosterElement(l)&&e.LGel.trigger(O)}e.swipeDirection=void 0})),setTimeout((function(){e.outer.hasClass("lg-dragging")||"lg-slide"===e.settings.mode||e.outer.removeClass("lg-slide")}),this.settings.speed+100)},t.prototype.enableSwipe=function(){var t=this,i={},s={},n=!1,e=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){s.preventDefault();var n=t.getSlideItem(t.index);!o(s.target).hasClass("lg-item")&&!n.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(e=!0,t.touchAction="swipe",t.manageSwipeClass(),i={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){o.preventDefault(),e&&"swipe"===t.touchAction&&1===o.targetTouches.length&&(s={pageX:o.targetTouches[0].pageX,pageY:o.targetTouches[0].pageY},t.touchMove(i,s),n=!0)})),this.$inner.on("touchend.lg",(function(h){if("swipe"===t.touchAction){if(n)n=!1,t.touchEnd(s,i,h);else if(e){var r=o(h.target);t.isPosterElement(r)&&t.LGel.trigger(O)}t.touchAction=void 0,e=!1}})))},t.prototype.enableDrag=function(){var t=this,i={},s={},n=!1,e=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){var e=t.getSlideItem(t.index);(o(s.target).hasClass("lg-item")||e.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),i={pageX:s.pageX,pageY:s.pageY},n=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(C))))})),o(window).on("mousemove.lg.global"+this.lgId,(function(o){n&&t.lgOpened&&(e=!0,s={pageX:o.pageX,pageY:o.pageY},t.touchMove(i,s),t.LGel.trigger(I))})),o(window).on("mouseup.lg.global"+this.lgId,(function(h){if(t.lgOpened){var r=o(h.target);e?(e=!1,t.touchEnd(s,i,h),t.LGel.trigger(F)):t.isPosterElement(r)&&t.LGel.trigger(O),n&&(n=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},t.prototype.manageSwipeClass=function(){var t=this.index+1,i=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?i=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),i>-1&&this.getSlideItem(i).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(P,{index:this.index}),this.slide(this.index,!!t,!1,"next")):s?(this.index=0,this.LGel.trigger(P,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout((function(){i.outer.removeClass("lg-right-end")}),400)))},t.prototype.goToPrevSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger(D,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):s?(this.index=this.galleryItems.length-1,this.LGel.trigger(D,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){i.outer.removeClass("lg-left-end")}),400)))},t.prototype.keyPress=function(){var t=this;o(window).on("keydown.lg.global"+this.lgId,(function(i){t.lgOpened&&!0===t.settings.escKey&&27===i.keyCode&&(i.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===i.keyCode&&(i.preventDefault(),t.goToPrevSlide()),39===i.keyCode&&(i.preventDefault(),t.goToNextSlide()))}))},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},t.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var i=this.getElementById("lg-prev"),s=this.getElementById("lg-next");t+1<this.galleryItems.length?i.removeAttr("disabled").removeClass("disabled"):i.attr("disabled","disabled").addClass("disabled"),t>0?s.removeAttr("disabled").removeClass("disabled"):s.attr("disabled","disabled").addClass("disabled")}},t.prototype.setTranslate=function(t,i,s,n,e){void 0===n&&(n=1),void 0===e&&(e=1),t.css("transform","translate3d("+i+"px, "+s+"px, 0px) scale3d("+n+", "+e+", 1)")},t.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(i){!i.deltaY||t.galleryItems.length<2||(i.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),i.preventDefault())}))},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var i=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||i&&i.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var i=o(this.items[t]);i.off("click.lgcustom-item-"+i.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var t=this;if(this.settings.closable){var i=!1;this.getElementById("lg-close").on("click.lg",(function(){t.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(s){var n=o(s.target);i=!!t.isSlideElement(n)})),this.outer.on("mousemove.lg",(function(){i=!1})),this.outer.on("mouseup.lg",(function(s){var n=o(s.target);t.isSlideElement(n)&&i&&(t.outer.hasClass("lg-dragging")||t.closeGallery())})))}},t.prototype.closeGallery=function(t){var i=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(B),o(window).scrollTop(this.prevScrollTop);var s,n=this.items[this.index];if(this.zoomFromOrigin&&n){var e=this.mediaContainerPosition,h=e.top,r=e.bottom,u=l(n,this.$lgContent,h+r,this.galleryItems[this.index].t&&this.settings.videoMaxSize);s=a(n,this.$lgContent,h,r,u)}this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,o("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var c=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){i.zoomFromOrigin&&s&&i.outer.removeClass("lg-zoom-from-image"),i.$container.removeClass("lg-show"),i.$backdrop.removeAttr("style").css("transition-duration",i.settings.backdropDuration+"ms"),i.outer.removeClass("lg-closing "+i.settings.startClass),i.getSlideItem(i.index).removeClass("lg-start-end-progress"),i.$inner.empty(),i.lgOpened&&i.LGel.trigger(E,{instance:i}),i.outer.get()&&i.outer.get().blur(),i.lgOpened=!1}),c+100),c+100},t.prototype.initModules=function(){this.plugins.forEach((function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},t.prototype.destroyModules=function(t){this.plugins.forEach((function(i){try{t?i.destroy():i.closeGallery&&i.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.openGalleryOnItemClick(),this.updateCounterTotal(),this.manageSingleSlideClassName(),this.LGel.trigger(T)},t.prototype.destroy=function(){var t=this,i=this.closeGallery(!0);setTimeout((function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),o(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()}),i)},t}(),U=function(t,i,s,n){for(var e,o=arguments.length,h=o<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,s):n,r=t.length-1;r>=0;r--)(e=t[r])&&(h=(o<3?e(h):o>3?e(i,s,h):e(i,s))||h);return o>3&&h&&Object.defineProperty(i,s,h),h};t.LightGalleryLit=class extends i.LitElement{constructor(){super(...arguments),this.settings={}}getSelector(t){const i=t.assignedNodes({flatten:!0});return Array.prototype.filter.call(i,(t=>t.nodeType==Node.ELEMENT_NODE))}firstUpdated(){if(!this.shadowRoot)return;const t=this.shadowRoot.querySelector("slot"),i={selector:this.getSelector(t)},s={...this.settings,...i};this.galleryInstance=new _(this,s)}handleSlotchange(t){var i,s;const n=this.getSelector(t.target);this.galleryInstance&&(null===(i=this.galleryInstance)||void 0===i?void 0:i.galleryItems.length)!==n.length&&(this.galleryInstance.settings.selector=n,null===(s=this.galleryInstance)||void 0===s||s.refresh())}disconnectedCallback(){super.disconnectedCallback(),this.galleryInstance&&this.galleryInstance.destroy()}render(){return i.html`
var n=function(){return(n=Object.assign||function(t){for(var i,s=1,n=arguments.length;s<n;s++)for(var e in i=arguments[s])Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e]);return t}).apply(this,arguments)};!function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(t,i){i=i||{bubbles:!1,cancelable:!1,detail:null};var s=document.createEvent("CustomEvent");return s.initCustomEvent(t,i.bubbles,i.cancelable,i.detail),s}}(),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e=function(){function t(t){return this.cssVenderPrefixes=["TransitionDuration","TransitionTimingFunction","Transform","Transition"],this.selector=this._getSelector(t),this.firstElement=this._getFirstEl(),this}return t.generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"==t?i:3&i|8).toString(16)}))},t.prototype._getSelector=function(t,i){return void 0===i&&(i=document),"string"!=typeof t?t:(i=i||document,"#"===t.substring(0,1)?i.querySelector(t):i.querySelectorAll(t))},t.prototype._each=function(t){return this.selector?(void 0!==this.selector.length?[].forEach.call(this.selector,t):t(this.selector,0),this):this},t.prototype._setCssVendorPrefix=function(t,i,s){var n=i.replace(/-([a-z])/gi,(function(t,i){return i.toUpperCase()}));-1!==this.cssVenderPrefixes.indexOf(n)?(t.style[n.charAt(0).toLowerCase()+n.slice(1)]=s,t.style["webkit"+n]=s,t.style["moz"+n]=s,t.style["ms"+n]=s,t.style["o"+n]=s):t.style[n]=s},t.prototype._getFirstEl=function(){return this.selector&&void 0!==this.selector.length?this.selector[0]:this.selector},t.prototype.isEventMatched=function(t,i){var s=i.split(".");return t.split(".").filter((function(t){return t})).every((function(t){return-1!==s.indexOf(t)}))},t.prototype.attr=function(t,i){return void 0===i?this.firstElement?this.firstElement.getAttribute(t):"":(this._each((function(s){s.setAttribute(t,i)})),this)},t.prototype.find=function(t){return o(this._getSelector(t,this.selector))},t.prototype.first=function(){return this.selector&&void 0!==this.selector.length?o(this.selector[0]):o(this.selector)},t.prototype.eq=function(t){return o(this.selector[t])},t.prototype.parent=function(){return o(this.selector.parentElement)},t.prototype.get=function(){return this._getFirstEl()},t.prototype.removeAttr=function(t){var i=t.split(" ");return this._each((function(t){i.forEach((function(i){return t.removeAttribute(i)}))})),this},t.prototype.wrap=function(t){if(!this.firstElement)return this;var i=document.createElement("div");return i.className=t,this.firstElement.parentNode.insertBefore(i,this.firstElement),this.firstElement.parentNode.removeChild(this.firstElement),i.appendChild(this.firstElement),this},t.prototype.addClass=function(t){return void 0===t&&(t=""),this._each((function(i){t.split(" ").forEach((function(t){i.classList.add(t)}))})),this},t.prototype.removeClass=function(t){return this._each((function(i){t.split(" ").forEach((function(t){i.classList.remove(t)}))})),this},t.prototype.hasClass=function(t){return!!this.firstElement&&this.firstElement.classList.contains(t)},t.prototype.hasAttribute=function(t){return!!this.firstElement&&this.firstElement.hasAttribute(t)},t.prototype.toggleClass=function(t){return this.firstElement?(this.hasClass(t)?this.removeClass(t):this.addClass(t),this):this},t.prototype.css=function(t,i){var s=this;return this._each((function(n){s._setCssVendorPrefix(n,t,i)})),this},t.prototype.on=function(i,s){var n=this;return this.selector?(i.split(" ").forEach((function(i){Array.isArray(t.eventListeners[i])||(t.eventListeners[i]=[]),t.eventListeners[i].push(s),n.selector.addEventListener(i.split(".")[0],s)})),this):this},t.prototype.once=function(t,i){var s=this;return this.on(t,(function(){s.off(t),i(t)})),this},t.prototype.off=function(i){var s=this;return this.selector?(Object.keys(t.eventListeners).forEach((function(n){s.isEventMatched(i,n)&&(t.eventListeners[n].forEach((function(t){s.selector.removeEventListener(n.split(".")[0],t)})),t.eventListeners[n]=[])})),this):this},t.prototype.trigger=function(t,i){if(!this.firstElement)return this;var s=new CustomEvent(t.split(".")[0],{detail:i||null});return this.firstElement.dispatchEvent(s),this},t.prototype.load=function(t){var i=this;return fetch(t).then((function(t){i.selector.innerHTML=t})),this},t.prototype.html=function(t){return void 0===t?this.firstElement?this.firstElement.innerHTML:"":(this._each((function(i){i.innerHTML=t})),this)},t.prototype.append=function(t){return this._each((function(i){"string"==typeof t?i.insertAdjacentHTML("beforeend",t):i.appendChild(t)})),this},t.prototype.prepend=function(t){return this._each((function(i){i.insertAdjacentHTML("afterbegin",t)})),this},t.prototype.remove=function(){return this._each((function(t){t.parentNode.removeChild(t)})),this},t.prototype.empty=function(){return this._each((function(t){t.innerHTML=""})),this},t.prototype.scrollTop=function(t){return void 0!==t?(document.body.scrollTop=t,document.documentElement.scrollTop=t,this):window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},t.prototype.scrollLeft=function(t){return void 0!==t?(document.body.scrollLeft=t,document.documentElement.scrollLeft=t,this):window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},t.prototype.offset=function(){if(!this.firstElement)return{left:0,top:0};var t=this.firstElement.getBoundingClientRect(),i=o("body").style().marginLeft;return{left:t.left-parseFloat(i)+this.scrollLeft(),top:t.top+this.scrollTop()}},t.prototype.style=function(){return this.firstElement?this.firstElement.currentStyle||window.getComputedStyle(this.firstElement):{}},t.prototype.width=function(){var t=this.style();return this.firstElement.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)},t.prototype.height=function(){var t=this.style();return this.firstElement.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)},t.eventListeners={},t}();function o(t){return new e(t)}var h=["src","sources","subHtml","subHtmlUrl","html","video","poster","slideName","responsive","srcset","sizes","iframe","downloadUrl","width","facebookShareUrl","tweetText","iframeTitle","twitterShareUrl","pinterestShareUrl","pinterestText","fbHtml","disqusIdentifier","disqusUrl"];function r(t){return"href"===t?"src":t=(t=(t=t.replace("data-","")).charAt(0).toLowerCase()+t.slice(1)).replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}var l=function(t,i,s,n){void 0===s&&(s=0);var e=o(t).attr("data-lg-size")||n;if(e){var h=e.split(",");if(h[1])for(var r=window.innerWidth,l=0;l<h.length;l++){var a=h[l];if(parseInt(a.split("-")[2],10)>r){e=a;break}l===h.length-1&&(e=a)}var u=e.split("-"),c=parseInt(u[0],10),g=parseInt(u[1],10),d=i.width(),f=i.height()-s,v=Math.min(d,c),m=Math.min(f,g),p=Math.min(v/c,m/g);return{width:c*p,height:g*p}}},a=function(t,i,s,n,e){if(e){var h=o(t).find("img").first();if(h.get()){var r=i.get().getBoundingClientRect(),l=r.width,a=i.height()-(s+n),u=h.width(),c=h.height(),g=h.style(),d=(l-u)/2-h.offset().left+(parseFloat(g.paddingLeft)||0)+(parseFloat(g.borderLeft)||0)+o(window).scrollLeft()+r.left,f=(a-c)/2-h.offset().top+(parseFloat(g.paddingTop)||0)+(parseFloat(g.borderTop)||0)+o(window).scrollTop()+s;return"translate3d("+(d*=-1)+"px, "+(f*=-1)+"px, 0) scale3d("+u/e.width+", "+c/e.height+", 1)"}}},u=function(t,i,s,n){return'<div class="lg-video-cont lg-has-iframe" style="width:'+i+"; height: "+s+'">\n <iframe class="lg-object" frameborder="0" '+(n?'title="'+n+'"':"")+' src="'+t+'" allowfullscreen="true"></iframe>\n </div>'},c=function(t,i,s,n,e,o){var h="<img "+s+" "+(n?'srcset="'+n+'"':"")+" "+(e?'sizes="'+e+'"':"")+' class="lg-object lg-image" data-index="'+t+'" src="'+i+'" />',r="";return o&&(r=("string"==typeof o?JSON.parse(o):o).map((function(t){var i="";return Object.keys(t).forEach((function(s){i+=" "+s+'="'+t[s]+'"'})),"<source "+i+"></source>"}))),""+r+h},g=function(t){for(var i=[],s=[],n="",e=0;e<t.length;e++){var o=t[e].split(" ");""===o[0]&&o.splice(0,1),s.push(o[0]),i.push(o[1])}for(var h=window.innerWidth,r=0;r<i.length;r++)if(parseInt(i[r],10)>h){n=s[r];break}return n},d=function(t){return!!t&&!!t.complete&&0!==t.naturalWidth},f=function(t,i,s,n){return'<div class="lg-video-cont '+(n&&n.youtube?"lg-has-youtube":n&&n.vimeo?"lg-has-vimeo":"lg-has-html5")+'" style="'+s+'">\n <div class="lg-video-play-button">\n <svg\n viewBox="0 0 20 20"\n preserveAspectRatio="xMidYMid"\n focusable="false"\n aria-labelledby="Play video"\n role="img"\n class="lg-video-play-icon"\n >\n <title>Play video</title>\n <polygon class="lg-video-play-icon-inner" points="1,0 20,10 1,20"></polygon>\n </svg>\n <svg class="lg-video-play-icon-bg" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle></svg>\n <svg class="lg-video-play-icon-circle" viewBox="0 0 50 50" focusable="false">\n <circle cx="50%" cy="50%" r="20"></circle>\n </svg>\n </div>\n '+(i||"")+'\n <img class="lg-object lg-video-poster" src="'+t+'" />\n </div>'},v=function(t,i,s,n){var e=[],l=function(){for(var t=0,i=0,s=arguments.length;i<s;i++)t+=arguments[i].length;var n=Array(t),e=0;for(i=0;i<s;i++)for(var o=arguments[i],h=0,r=o.length;h<r;h++,e++)n[e]=o[h];return n}(h,i);return[].forEach.call(t,(function(t){for(var i={},h=0;h<t.attributes.length;h++){var a=t.attributes[h];if(a.specified){var u=r(a.name),c="";l.indexOf(u)>-1&&(c=u),c&&(i[c]=a.value)}}var g=o(t),d=g.find("img").first().attr("alt"),f=g.attr("title"),v=n?g.attr(n):g.find("img").first().attr("src");i.thumb=v,s&&!i.subHtml&&(i.subHtml=f||d||""),i.alt=d||f||"",e.push(i)})),e},m=function(){return/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)},p={mode:"lg-slide",easing:"ease",speed:400,licenseKey:"0000-0000-000-0000",height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:300,container:document.body,startAnimationDuration:400,zoomFromOrigin:!0,hideBarsDelay:0,showBarsAfter:1e4,slideDelay:0,supportLegacyBrowser:!0,allowMediaOverlap:!1,videoMaxSize:"1280-720",defaultCaptionHeight:0,ariaLabelledby:"",ariaDescribedby:"",closable:!0,swipeToClose:!0,closeOnTap:!0,showCloseIcon:!0,showMaximizeIcon:!1,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimation:!0,hideControlOnEnd:!1,mousewheel:!1,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:2,numberOfSlideItemsInDom:10,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:0,iframeWidth:"100%",iframeHeight:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],extraProps:[],exThumbImage:"",isMobile:void 0,mobileSettings:{controls:!1,showCloseIcon:!1,download:!1},plugins:[]},b="lgAfterAppendSlide",w="lgInit",y="lgHasVideo",x="lgContainerResize",T="lgUpdateSlides",k="lgAfterAppendSubHtml",z="lgBeforeOpen",M="lgAfterOpen",S="lgSlideItemLoad",j="lgBeforeSlide",A="lgAfterSlide",O="lgPosterClick",C="lgDragStart",I="lgDragMove",F="lgDragEnd",P="lgBeforeNextSlide",D="lgBeforePrevSlide",B="lgBeforeClose",E="lgAfterClose",H=0,_=function(){function t(t,i){if(this.lgOpened=!1,this.index=0,this.plugins=[],this.lGalleryOn=!1,this.lgBusy=!1,this.currentItemsInDom=[],this.prevScrollTop=0,this.isDummyImageRemoved=!1,this.mediaContainerPosition={top:0,bottom:0},!t)return this;if(H++,this.lgId=H,this.el=t,this.LGel=o(t),this.generateSettings(i),this.buildModules(),this.settings.dynamic&&void 0!==this.settings.dynamicEl&&!Array.isArray(this.settings.dynamicEl))throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.galleryItems=this.getItems(),this.normalizeSettings(),this.init(),this.validateLicense(),this}return t.prototype.generateSettings=function(t){if(this.settings=n(n({},p),t),this.settings.isMobile&&"function"==typeof this.settings.isMobile?this.settings.isMobile():m()){var i=n(n({},this.settings.mobileSettings),this.settings.mobileSettings);this.settings=n(n({},this.settings),i)}},t.prototype.normalizeSettings=function(){this.settings.slideEndAnimation&&(this.settings.hideControlOnEnd=!1),this.settings.closable||(this.settings.swipeToClose=!1),this.zoomFromOrigin=this.settings.zoomFromOrigin,this.settings.dynamic&&(this.zoomFromOrigin=!1),this.settings.container||(this.settings.container=document.body),this.settings.preload=Math.min(this.settings.preload,this.galleryItems.length)},t.prototype.init=function(){var t=this;this.addSlideVideoInfo(this.galleryItems),this.buildStructure(),this.LGel.trigger(w,{instance:this}),this.settings.keyPress&&this.keyPress(),setTimeout((function(){t.enableDrag(),t.enableSwipe()}),50),this.arrow(),this.settings.mousewheel&&this.mousewheel(),this.settings.dynamic||this.openGalleryOnItemClick()},t.prototype.openGalleryOnItemClick=function(){for(var t=this,i=function(i){var n=s.items[i],h=o(n),r=e.generateUUID();h.attr("data-lg-id",r).on("click.lgcustom-item-"+r,(function(s){s.preventDefault();var e=t.settings.index||i;t.openGallery(e,n)}))},s=this,n=0;n<this.items.length;n++)i(n)},t.prototype.buildModules=function(){var t=this;this.settings.plugins.forEach((function(i){t.plugins.push(new i(t,o))}))},t.prototype.validateLicense=function(){this.settings.licenseKey?"0000-0000-000-0000"===this.settings.licenseKey&&console.warn("lightGallery: "+this.settings.licenseKey+" license key is not valid for production use"):console.error("Please provide a valid license key")},t.prototype.getSlideItem=function(t){return o(this.getSlideItemId(t))},t.prototype.getSlideItemId=function(t){return"#lg-item-"+this.lgId+"-"+t},t.prototype.getIdName=function(t){return t+"-"+this.lgId},t.prototype.getElementById=function(t){return o("#"+this.getIdName(t))},t.prototype.manageSingleSlideClassName=function(){this.galleryItems.length<2?this.outer.addClass("lg-single-item"):this.outer.removeClass("lg-single-item")},t.prototype.buildStructure=function(){var t=this;if(!this.$container||!this.$container.get()){var i="",s="";this.settings.controls&&(i='<button type="button" id="'+this.getIdName("lg-prev")+'" aria-label="Previous slide" class="lg-prev lg-icon"> '+this.settings.prevHtml+' </button>\n <button type="button" id="'+this.getIdName("lg-next")+'" aria-label="Next slide" class="lg-next lg-icon"> '+this.settings.nextHtml+" </button>"),".lg-sub-html"===this.settings.appendSubHtmlTo&&(s='<div class="lg-sub-html" role="status" aria-live="polite"></div>');var n="";this.settings.allowMediaOverlap&&(n+="lg-media-overlap ");var e=this.settings.ariaLabelledby?'aria-labelledby="'+this.settings.ariaLabelledby+'"':"",h=this.settings.ariaDescribedby?'aria-describedby="'+this.settings.ariaDescribedby+'"':"",r="lg-container "+this.settings.addClass+" "+(document.body!==this.settings.container?"lg-inline":""),l=this.settings.closable&&this.settings.showCloseIcon?'<button type="button" aria-label="Close gallery" id="'+this.getIdName("lg-close")+'" class="lg-close lg-icon"></button>':"",a=this.settings.showMaximizeIcon?'<button type="button" aria-label="Toggle maximize" id="'+this.getIdName("lg-maximize")+'" class="lg-maximize lg-icon"></button>':"",u='\n <div class="'+r+'" id="'+this.getIdName("lg-container")+'" tabindex="-1" aria-modal="true" '+e+" "+h+' role="dialog"\n >\n <div id="'+this.getIdName("lg-backdrop")+'" class="lg-backdrop"></div>\n\n <div id="'+this.getIdName("lg-outer")+'" class="lg-outer lg-use-css3 lg-css3 lg-hide-items '+n+' ">\n <div id="'+this.getIdName("lg-content")+'" class="lg" style="width: '+this.settings.width+"; height:"+this.settings.height+'">\n <div id="'+this.getIdName("lg-inner")+'" class="lg-inner"></div>\n <div id="'+this.getIdName("lg-toolbar")+'" class="lg-toolbar lg-group">\n '+a+"\n "+l+"\n </div>\n "+i+'\n <div id="'+this.getIdName("lg-components")+'" class="lg-components">\n '+s+"\n </div>\n </div> \n </div>\n </div>\n ";o(this.settings.container).css("position","relative").append(u),this.outer=this.getElementById("lg-outer"),this.$lgContent=this.getElementById("lg-content"),this.$lgComponents=this.getElementById("lg-components"),this.$backdrop=this.getElementById("lg-backdrop"),this.$container=this.getElementById("lg-container"),this.$inner=this.getElementById("lg-inner"),this.$toolbar=this.getElementById("lg-toolbar"),this.$backdrop.css("transition-duration",this.settings.backdropDuration+"ms");var c=this.settings.mode+" ";this.manageSingleSlideClassName(),this.settings.enableDrag&&(c+="lg-grab "),this.settings.showAfterLoad&&(c+="lg-show-after-load"),this.outer.addClass(c),this.$inner.css("transition-timing-function",this.settings.easing),this.$inner.css("transition-duration",this.settings.speed+"ms"),this.settings.download&&this.$toolbar.append('<a id="'+this.getIdName("lg-download")+'" target="_blank" aria-label="Download" download class="lg-download lg-icon"></a>'),this.counter(),o(window).on("resize.lg.global"+this.lgId+" orientationchange.lg.global"+this.lgId,(function(){t.refreshOnResize()})),this.hideBars(),this.manageCloseGallery(),this.toggleMaximize(),this.initModules()}},t.prototype.refreshOnResize=function(){if(this.lgOpened){var t=this.galleryItems[this.index].t;this.mediaContainerPosition=this.getMediaContainerPosition();var i=this.mediaContainerPosition,s=i.top,n=i.bottom;if(this.currentImageSize=l(this.items[this.index],this.$lgContent,s+n,t&&this.settings.videoMaxSize),t&&this.resizeVideoSlide(this.index,this.currentImageSize),this.zoomFromOrigin&&!this.isDummyImageRemoved){var e=this.getDummyImgStyles(this.currentImageSize);this.outer.find(".lg-current .lg-dummy-img").first().attr("style",e)}this.LGel.trigger(x)}},t.prototype.resizeVideoSlide=function(t,i){var s=this.getVideoContStyle(i);this.getSlideItem(t).find(".lg-video-cont").attr("style",s)},t.prototype.updateSlides=function(t,i){if(this.index>t.length-1&&(this.index=t.length-1),1===t.length&&(this.index=0),t.length){var s=this.galleryItems[i].src;this.galleryItems=t,this.updateControls(),this.$inner.empty(),this.currentItemsInDom=[];var n=0;this.galleryItems.some((function(t,i){return t.src===s&&(n=i,!0)})),this.currentItemsInDom=this.organizeSlideItems(n,-1),this.loadContent(n,!0),this.getSlideItem(n).addClass("lg-current"),this.index=n,this.updateCurrentCounter(n),this.LGel.trigger(T)}else this.closeGallery()},t.prototype.getItems=function(){if(this.items=[],this.settings.dynamic)return this.settings.dynamicEl||[];if("this"===this.settings.selector)this.items.push(this.el);else if(this.settings.selector)if("string"==typeof this.settings.selector)if(this.settings.selectWithin){var t=o(this.settings.selectWithin);this.items=t.find(this.settings.selector).get()}else this.items=this.el.querySelectorAll(this.settings.selector);else this.items=this.settings.selector;else this.items=this.el.children;return v(this.items,this.settings.extraProps,this.settings.getCaptionFromTitleOrAlt,this.settings.exThumbImage)},t.prototype.openGallery=function(t,i){var s=this;if(void 0===t&&(t=this.settings.index),!this.lgOpened){this.lgOpened=!0,this.outer.get().focus(),this.outer.removeClass("lg-hide-items"),this.$container.addClass("lg-show");var n=this.getItemsToBeInsertedToDom(t,t);this.currentItemsInDom=n;var e="";n.forEach((function(t){e=e+'<div id="'+t+'" class="lg-item"></div>'})),this.$inner.append(e),this.addHtml(t);var h="";this.mediaContainerPosition=this.getMediaContainerPosition();var r=this.mediaContainerPosition,u=r.top,c=r.bottom;this.settings.allowMediaOverlap||this.setMediaContainerPosition(u,c),this.zoomFromOrigin&&i&&(this.currentImageSize=l(i,this.$lgContent,u+c,this.galleryItems[t].t&&this.settings.videoMaxSize),h=a(i,this.$lgContent,u,c,this.currentImageSize)),this.zoomFromOrigin&&h||(this.outer.addClass(this.settings.startClass),this.getSlideItem(t).removeClass("lg-complete"));var g=this.settings.zoomFromOrigin?100:this.settings.backdropDuration;setTimeout((function(){s.outer.addClass("lg-components-open")}),g),this.index=t,this.LGel.trigger(z),this.getSlideItem(t).addClass("lg-current"),this.lGalleryOn=!1,this.prevScrollTop=o(window).scrollTop(),setTimeout((function(){if(s.zoomFromOrigin&&h){var i=s.getSlideItem(t);i.css("transform",h),setTimeout((function(){i.addClass("lg-start-progress lg-start-end-progress").css("transition-duration",s.settings.startAnimationDuration+"ms"),s.outer.addClass("lg-zoom-from-image")})),setTimeout((function(){i.css("transform","translate3d(0, 0, 0)")}),100)}setTimeout((function(){s.$backdrop.addClass("in"),s.$container.addClass("lg-show-in")}),10),s.zoomFromOrigin&&h||setTimeout((function(){s.outer.addClass("lg-visible")}),s.settings.backdropDuration),s.slide(t,!1,!1,!1),s.LGel.trigger(M)})),document.body===this.settings.container&&o("html").addClass("lg-on")}},t.prototype.getMediaContainerPosition=function(){if(this.settings.allowMediaOverlap)return{top:0,bottom:0};var t=this.$toolbar.get().clientHeight||0,i=this.settings.defaultCaptionHeight||this.outer.find(".lg-sub-html").get().clientHeight,s=this.outer.find(".lg-thumb-outer").get();return{top:t,bottom:(s?s.clientHeight:0)+i}},t.prototype.setMediaContainerPosition=function(t,i){void 0===t&&(t=0),void 0===i&&(i=0),this.$inner.css("top",t+"px").css("bottom",i+"px")},t.prototype.hideBars=function(){var t=this;setTimeout((function(){t.outer.removeClass("lg-hide-items"),t.settings.hideBarsDelay>0&&(t.outer.on("mousemove.lg click.lg touchstart.lg",(function(){t.outer.removeClass("lg-hide-items"),clearTimeout(t.hideBarTimeout),t.hideBarTimeout=setTimeout((function(){t.outer.addClass("lg-hide-items")}),t.settings.hideBarsDelay)})),t.outer.trigger("mousemove.lg"))}),this.settings.showBarsAfter)},t.prototype.initPictureFill=function(t){if(this.settings.supportLegacyBrowser)try{picturefill({elements:[t.get()]})}catch(t){console.warn("lightGallery :- If you want srcset or picture tag to be supported for older browser please include picturefil javascript library in your document.")}},t.prototype.counter=function(){if(this.settings.counter){var t='<div class="lg-counter" role="status" aria-live="polite">\n <span id="'+this.getIdName("lg-counter-current")+'" class="lg-counter-current">'+(this.index+1)+' </span> / \n <span id="'+this.getIdName("lg-counter-all")+'" class="lg-counter-all">'+this.galleryItems.length+" </span></div>";this.outer.find(this.settings.appendCounterTo).append(t)}},t.prototype.addHtml=function(t){var i,s;if(this.galleryItems[t].subHtmlUrl?s=this.galleryItems[t].subHtmlUrl:i=this.galleryItems[t].subHtml,!s)if(i){var n=i.substring(0,1);"."!==n&&"#"!==n||(i=this.settings.subHtmlSelectorRelative&&!this.settings.dynamic?o(this.items).eq(t).find(i).first().html():o(i).first().html())}else i="";if(".lg-sub-html"===this.settings.appendSubHtmlTo)s?this.outer.find(".lg-sub-html").load(s):this.outer.find(".lg-sub-html").html(i);else{var e=o(this.getSlideItemId(t));s?e.load(s):e.append('<div class="lg-sub-html">'+i+"</div>")}null!=i&&(""===i?this.outer.find(this.settings.appendSubHtmlTo).addClass("lg-empty-html"):this.outer.find(this.settings.appendSubHtmlTo).removeClass("lg-empty-html")),this.LGel.trigger(k,{index:t})},t.prototype.preload=function(t){for(var i=1;i<=this.settings.preload&&!(i>=this.galleryItems.length-t);i++)this.loadContent(t+i,!1);for(var s=1;s<=this.settings.preload&&!(t-s<0);s++)this.loadContent(t-s,!1)},t.prototype.getDummyImgStyles=function(t){return t?"width:"+t.width+"px; \n margin-left: -"+t.width/2+"px;\n margin-top: -"+t.height/2+"px; \n height:"+t.height+"px":""},t.prototype.getVideoContStyle=function(t){return t?"width:"+t.width+"px; \n height:"+t.height+"px":""},t.prototype.getDummyImageContent=function(t,i,s){var n;if(this.settings.dynamic||(n=o(this.items).eq(i)),n){var e=void 0;if(!(e=this.settings.exThumbImage?n.attr(this.settings.exThumbImage):n.find("img").first().attr("src")))return"";var h="<img "+s+' style="'+this.getDummyImgStyles(this.currentImageSize)+'" class="lg-dummy-img" src="'+e+'" />';return t.addClass("lg-first-slide"),this.outer.addClass("lg-first-slide-loading"),h}return""},t.prototype.setImgMarkup=function(t,i,s){var n=this.galleryItems[s],e=n.alt,o=n.srcset,h=n.sizes,r=n.sources,l=e?'alt="'+e+'"':"",a='<picture class="lg-img-wrap"> '+(!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize?this.getDummyImageContent(i,s,l):c(s,t,l,o,h,r))+"</picture>";i.prepend(a)},t.prototype.onLgObjectLoad=function(t,i,s,n,e){var o=this;e&&this.LGel.trigger(S,{index:i,delay:s||0}),t.find(".lg-object").first().on("load.lg",(function(){o.handleLgObjectLoad(t,i,s,n,e)})),setTimeout((function(){t.find(".lg-object").first().on("error.lg",(function(){t.addClass("lg-complete lg-complete_"),t.html('<span class="lg-error-msg">Oops... Failed to load content...</span>')}))}),n)},t.prototype.handleLgObjectLoad=function(t,i,s,n,e){var o=this;setTimeout((function(){t.addClass("lg-complete lg-complete_"),e||o.LGel.trigger(S,{index:i,delay:s||0})}),n)},t.prototype.isVideo=function(t,i){if(!t)return this.galleryItems[i].video?{html5:!0}:void console.error("lightGallery :- data-src is not provided on slide item "+(i+1)+". Please make sure the selector property is properly configured. More info - https://www.lightgalleryjs.com/demos/html-markup/");var s=t.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),n=t.match(/\/\/(?:www\.)?(?:player\.)?vimeo.com\/(?:video\/)?([0-9a-z\-_]+)/i),e=t.match(/https?:\/\/(.+)?(wistia\.com|wi\.st)\/(medias|embed)\/([0-9a-z\-_]+)(.*)/);return s?{youtube:s}:n?{vimeo:n}:e?{wistia:e}:void 0},t.prototype.addSlideVideoInfo=function(t){var i=this;t.forEach((function(t,s){t.t=i.isVideo(t.src,s)}))},t.prototype.loadContent=function(t,i){var s=this,n=this.galleryItems[t],e=o(this.getSlideItemId(t)),h=n.poster,r=n.srcset,a=n.sizes,v=n.sources,m=n.src,p=n.video,w=p&&"string"==typeof p?JSON.parse(p):p;if(n.responsive){var x=n.responsive.split(",");m=g(x)||m}var T=n.t,k="",z=!!n.iframe;if(!e.hasClass("lg-loaded")){if(T){var M=this.mediaContainerPosition,S=M.top,j=M.bottom,A=l(this.items[t],this.$lgContent,S+j,T&&this.settings.videoMaxSize);k=this.getVideoContStyle(A)}if(z){var O=u(m,this.settings.iframeWidth,this.settings.iframeHeight,n.iframeTitle);e.prepend(O)}else if(h){var C="",I=!this.lGalleryOn,F=!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize;F&&(C=this.getDummyImageContent(e,t,"")),O=f(h,C||"",k,T),e.prepend(O);var P=(F?this.settings.startAnimationDuration:this.settings.backdropDuration)+100;setTimeout((function(){s.LGel.trigger(y,{index:t,src:m,html5Video:w,hasPoster:!0,isFirstSlide:I})}),P)}else if(T)O='<div class="lg-video-cont " style="'+k+'"></div>',e.prepend(O),this.LGel.trigger(y,{index:t,src:m,html5Video:w,hasPoster:!1});else if(this.setImgMarkup(m,e,t),r||v){var D=e.find(".lg-object");this.initPictureFill(D)}this.LGel.trigger(b,{index:t}),this.lGalleryOn&&".lg-sub-html"!==this.settings.appendSubHtmlTo&&this.addHtml(t)}var B=0,E=0;this.lGalleryOn||(E=this.zoomFromOrigin&&this.currentImageSize?this.settings.startAnimationDuration+10:this.settings.backdropDuration+10),E&&!o(document.body).hasClass("lg-from-hash")&&(B=E),!this.lGalleryOn&&this.zoomFromOrigin&&this.currentImageSize&&(setTimeout((function(){e.removeClass("lg-start-end-progress lg-start-progress").removeAttr("style")}),this.settings.startAnimationDuration+100),e.hasClass("lg-loaded")||setTimeout((function(){if(e.find(".lg-img-wrap").append(c(t,m,"",r,a,n.sources)),r||v){var i=e.find(".lg-object");s.initPictureFill(i)}s.onLgObjectLoad(e,t,E,B,!0);var o=e.find(".lg-object").first();d(o.get())?s.loadContentOnLoad(t,e,B):o.on("load.lg error.lg",(function(){s.loadContentOnLoad(t,e,B)}))}),this.settings.startAnimationDuration+100)),e.addClass("lg-loaded"),this.onLgObjectLoad(e,t,E,B,!1),T&&T.html5&&!h&&e.addClass("lg-complete lg-complete_"),this.zoomFromOrigin&&this.currentImageSize||!e.hasClass("lg-complete_")||this.lGalleryOn||setTimeout((function(){e.addClass("lg-complete")}),this.settings.backdropDuration),this.lGalleryOn=!0,!0===i&&(e.hasClass("lg-complete_")?this.preload(t):e.find(".lg-object").first().on("load.lg error.lg",(function(){s.preload(t)})))},t.prototype.loadContentOnLoad=function(t,i,s){var n=this;setTimeout((function(){i.find(".lg-dummy-img").remove(),i.removeClass("lg-first-slide"),n.outer.removeClass("lg-first-slide-loading"),n.isDummyImageRemoved=!0,n.preload(t)}),s+300)},t.prototype.getItemsToBeInsertedToDom=function(t,i,s){var n=this;void 0===s&&(s=0);var e=[],o=Math.max(s,3);o=Math.min(o,this.galleryItems.length);var h="lg-item-"+this.lgId+"-"+i;if(this.galleryItems.length<=3)return this.galleryItems.forEach((function(t,i){e.push("lg-item-"+n.lgId+"-"+i)})),e;if(t<(this.galleryItems.length-1)/2){for(var r=t;r>t-o/2&&r>=0;r--)e.push("lg-item-"+this.lgId+"-"+r);var l=e.length;for(r=0;r<o-l;r++)e.push("lg-item-"+this.lgId+"-"+(t+r+1))}else{for(r=t;r<=this.galleryItems.length-1&&r<t+o/2;r++)e.push("lg-item-"+this.lgId+"-"+r);for(l=e.length,r=0;r<o-l;r++)e.push("lg-item-"+this.lgId+"-"+(t-r-1))}return this.settings.loop&&(t===this.galleryItems.length-1?e.push("lg-item-"+this.lgId+"-0"):0===t&&e.push("lg-item-"+this.lgId+"-"+(this.galleryItems.length-1))),-1===e.indexOf(h)&&e.push("lg-item-"+this.lgId+"-"+i),e},t.prototype.organizeSlideItems=function(t,i){var s=this,n=this.getItemsToBeInsertedToDom(t,i,this.settings.numberOfSlideItemsInDom);return n.forEach((function(t){-1===s.currentItemsInDom.indexOf(t)&&s.$inner.append('<div id="'+t+'" class="lg-item"></div>')})),this.currentItemsInDom.forEach((function(t){-1===n.indexOf(t)&&o("#"+t).remove()})),n},t.prototype.getPreviousSlideIndex=function(){var t=0;try{var i=this.outer.find(".lg-current").first().attr("id");t=parseInt(i.split("-")[3])||0}catch(i){t=0}return t},t.prototype.setDownloadValue=function(t){if(this.settings.download){var i=this.galleryItems[t],s=!1!==i.downloadUrl&&(i.downloadUrl||i.src);s&&!i.iframe&&this.getElementById("lg-download").attr("href",s)}},t.prototype.makeSlideAnimation=function(t,i,s){var n=this;this.lGalleryOn&&s.addClass("lg-slide-progress"),setTimeout((function(){n.outer.addClass("lg-no-trans"),n.outer.find(".lg-item").removeClass("lg-prev-slide lg-next-slide"),"prev"===t?(i.addClass("lg-prev-slide"),s.addClass("lg-next-slide")):(i.addClass("lg-next-slide"),s.addClass("lg-prev-slide")),setTimeout((function(){n.outer.find(".lg-item").removeClass("lg-current"),i.addClass("lg-current"),n.outer.removeClass("lg-no-trans")}),50)}),this.lGalleryOn?this.settings.slideDelay:0)},t.prototype.slide=function(t,i,s,n){var e=this,o=this.getPreviousSlideIndex();if(this.currentItemsInDom=this.organizeSlideItems(t,o),!this.lGalleryOn||o!==t){var h=this.galleryItems.length;if(!this.lgBusy){this.settings.counter&&this.updateCurrentCounter(t);var r=this.getSlideItem(t),a=this.getSlideItem(o),u=this.galleryItems[t],c=u.t;if(this.outer.attr("data-lg-slide-type",this.getSlideType(u)),this.setDownloadValue(t),c){var g=this.mediaContainerPosition,d=g.top,f=g.bottom,v=l(this.items[t],this.$lgContent,d+f,c&&this.settings.videoMaxSize);this.resizeVideoSlide(t,v)}if(this.LGel.trigger(j,{prevIndex:o,index:t,fromTouch:!!i,fromThumb:!!s}),this.lgBusy=!0,clearTimeout(this.hideBarTimeout),this.arrowDisable(t),n||(t<o?n="prev":t>o&&(n="next")),i){this.outer.find(".lg-item").removeClass("lg-prev-slide lg-current lg-next-slide");var m=void 0,p=void 0;h>2?(m=t-1,p=t+1,(0===t&&o===h-1||t===h-1&&0===o)&&(p=0,m=h-1)):(m=0,p=1),"prev"===n?this.getSlideItem(p).addClass("lg-next-slide"):this.getSlideItem(m).addClass("lg-prev-slide"),r.addClass("lg-current")}else this.makeSlideAnimation(n,r,a);this.lGalleryOn||this.loadContent(t,!0),setTimeout((function(){e.lGalleryOn&&e.loadContent(t,!0),".lg-sub-html"===e.settings.appendSubHtmlTo&&e.addHtml(t)}),(this.lGalleryOn?this.settings.speed+50:50)+(i?0:this.settings.slideDelay)),setTimeout((function(){e.lgBusy=!1,a.removeClass("lg-slide-progress"),e.LGel.trigger(A,{prevIndex:o,index:t,fromTouch:i,fromThumb:s})}),(this.lGalleryOn?this.settings.speed+100:100)+(i?0:this.settings.slideDelay))}this.index=t}},t.prototype.updateCurrentCounter=function(t){this.getElementById("lg-counter-current").html(t+1+"")},t.prototype.updateCounterTotal=function(){this.getElementById("lg-counter-all").html(this.galleryItems.length+"")},t.prototype.getSlideType=function(t){return t.t?"video":t.iframe?"iframe":"image"},t.prototype.touchMove=function(t,i){var s=i.pageX-t.pageX,n=i.pageY-t.pageY,e=!1;if(this.swipeDirection?e=!0:Math.abs(s)>15?(this.swipeDirection="horizontal",e=!0):Math.abs(n)>15&&(this.swipeDirection="vertical",e=!0),e){var o=this.getSlideItem(this.index);if("horizontal"===this.swipeDirection){this.outer.addClass("lg-dragging"),this.setTranslate(o,s,0);var h=o.get().offsetWidth,r=15*h/100-Math.abs(10*s/100);this.setTranslate(this.outer.find(".lg-prev-slide").first(),-h+s-r,0),this.setTranslate(this.outer.find(".lg-next-slide").first(),h+s+r,0)}else if("vertical"===this.swipeDirection&&this.settings.swipeToClose){this.$container.addClass("lg-dragging-vertical");var l=1-Math.abs(n)/window.innerHeight;this.$backdrop.css("opacity",l);var a=1-Math.abs(n)/(2*window.innerWidth);this.setTranslate(o,0,n,a,a),Math.abs(n)>100&&this.outer.addClass("lg-hide-items").removeClass("lg-components-open")}}},t.prototype.touchEnd=function(t,i,s){var n,e=this;"lg-slide"!==this.settings.mode&&this.outer.addClass("lg-slide"),setTimeout((function(){e.$container.removeClass("lg-dragging-vertical"),e.outer.removeClass("lg-dragging lg-hide-items").addClass("lg-components-open");var h=!0;if("horizontal"===e.swipeDirection){n=t.pageX-i.pageX;var r=Math.abs(t.pageX-i.pageX);n<0&&r>e.settings.swipeThreshold?(e.goToNextSlide(!0),h=!1):n>0&&r>e.settings.swipeThreshold&&(e.goToPrevSlide(!0),h=!1)}else if("vertical"===e.swipeDirection){if(n=Math.abs(t.pageY-i.pageY),e.settings.closable&&e.settings.swipeToClose&&n>100)return void e.closeGallery();e.$backdrop.css("opacity",1)}if(e.outer.find(".lg-item").removeAttr("style"),h&&Math.abs(t.pageX-i.pageX)<5){var l=o(s.target);e.isPosterElement(l)&&e.LGel.trigger(O)}e.swipeDirection=void 0})),setTimeout((function(){e.outer.hasClass("lg-dragging")||"lg-slide"===e.settings.mode||e.outer.removeClass("lg-slide")}),this.settings.speed+100)},t.prototype.enableSwipe=function(){var t=this,i={},s={},n=!1,e=!1;this.settings.enableSwipe&&(this.$inner.on("touchstart.lg",(function(s){s.preventDefault();var n=t.getSlideItem(t.index);!o(s.target).hasClass("lg-item")&&!n.get().contains(s.target)||t.outer.hasClass("lg-zoomed")||t.lgBusy||1!==s.targetTouches.length||(e=!0,t.touchAction="swipe",t.manageSwipeClass(),i={pageX:s.targetTouches[0].pageX,pageY:s.targetTouches[0].pageY})})),this.$inner.on("touchmove.lg",(function(o){o.preventDefault(),e&&"swipe"===t.touchAction&&1===o.targetTouches.length&&(s={pageX:o.targetTouches[0].pageX,pageY:o.targetTouches[0].pageY},t.touchMove(i,s),n=!0)})),this.$inner.on("touchend.lg",(function(h){if("swipe"===t.touchAction){if(n)n=!1,t.touchEnd(s,i,h);else if(e){var r=o(h.target);t.isPosterElement(r)&&t.LGel.trigger(O)}t.touchAction=void 0,e=!1}})))},t.prototype.enableDrag=function(){var t=this,i={},s={},n=!1,e=!1;this.settings.enableDrag&&(this.outer.on("mousedown.lg",(function(s){var e=t.getSlideItem(t.index);(o(s.target).hasClass("lg-item")||e.get().contains(s.target))&&(t.outer.hasClass("lg-zoomed")||t.lgBusy||(s.preventDefault(),t.lgBusy||(t.manageSwipeClass(),i={pageX:s.pageX,pageY:s.pageY},n=!0,t.outer.get().scrollLeft+=1,t.outer.get().scrollLeft-=1,t.outer.removeClass("lg-grab").addClass("lg-grabbing"),t.LGel.trigger(C))))})),o(window).on("mousemove.lg.global"+this.lgId,(function(o){n&&t.lgOpened&&(e=!0,s={pageX:o.pageX,pageY:o.pageY},t.touchMove(i,s),t.LGel.trigger(I))})),o(window).on("mouseup.lg.global"+this.lgId,(function(h){if(t.lgOpened){var r=o(h.target);e?(e=!1,t.touchEnd(s,i,h),t.LGel.trigger(F)):t.isPosterElement(r)&&t.LGel.trigger(O),n&&(n=!1,t.outer.removeClass("lg-grabbing").addClass("lg-grab"))}})))},t.prototype.manageSwipeClass=function(){var t=this.index+1,i=this.index-1;this.settings.loop&&this.galleryItems.length>2&&(0===this.index?i=this.galleryItems.length-1:this.index===this.galleryItems.length-1&&(t=0)),this.outer.find(".lg-item").removeClass("lg-next-slide lg-prev-slide"),i>-1&&this.getSlideItem(i).addClass("lg-prev-slide"),this.getSlideItem(t).addClass("lg-next-slide")},t.prototype.goToNextSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index+1<this.galleryItems.length?(this.index++,this.LGel.trigger(P,{index:this.index}),this.slide(this.index,!!t,!1,"next")):s?(this.index=0,this.LGel.trigger(P,{index:this.index}),this.slide(this.index,!!t,!1,"next")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-right-end"),setTimeout((function(){i.outer.removeClass("lg-right-end")}),400)))},t.prototype.goToPrevSlide=function(t){var i=this,s=this.settings.loop;t&&this.galleryItems.length<3&&(s=!1),this.lgBusy||(this.index>0?(this.index--,this.LGel.trigger(D,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):s?(this.index=this.galleryItems.length-1,this.LGel.trigger(D,{index:this.index,fromTouch:t}),this.slide(this.index,!!t,!1,"prev")):this.settings.slideEndAnimation&&!t&&(this.outer.addClass("lg-left-end"),setTimeout((function(){i.outer.removeClass("lg-left-end")}),400)))},t.prototype.keyPress=function(){var t=this;o(window).on("keydown.lg.global"+this.lgId,(function(i){t.lgOpened&&!0===t.settings.escKey&&27===i.keyCode&&(i.preventDefault(),t.settings.allowMediaOverlap&&t.outer.hasClass("lg-can-toggle")&&t.outer.hasClass("lg-components-open")?t.outer.removeClass("lg-components-open"):t.closeGallery()),t.lgOpened&&t.galleryItems.length>1&&(37===i.keyCode&&(i.preventDefault(),t.goToPrevSlide()),39===i.keyCode&&(i.preventDefault(),t.goToNextSlide()))}))},t.prototype.arrow=function(){var t=this;this.getElementById("lg-prev").on("click.lg",(function(){t.goToPrevSlide()})),this.getElementById("lg-next").on("click.lg",(function(){t.goToNextSlide()}))},t.prototype.arrowDisable=function(t){if(!this.settings.loop&&this.settings.hideControlOnEnd){var i=this.getElementById("lg-prev"),s=this.getElementById("lg-next");t+1===this.galleryItems.length?s.attr("disabled","disabled").addClass("disabled"):s.removeAttr("disabled").removeClass("disabled"),0===t?i.attr("disabled","disabled").addClass("disabled"):i.removeAttr("disabled").removeClass("disabled")}},t.prototype.setTranslate=function(t,i,s,n,e){void 0===n&&(n=1),void 0===e&&(e=1),t.css("transform","translate3d("+i+"px, "+s+"px, 0px) scale3d("+n+", "+e+", 1)")},t.prototype.mousewheel=function(){var t=this;this.outer.on("mousewheel.lg",(function(i){!i.deltaY||t.galleryItems.length<2||(i.deltaY>0?t.goToPrevSlide():t.goToNextSlide(),i.preventDefault())}))},t.prototype.isSlideElement=function(t){return t.hasClass("lg-outer")||t.hasClass("lg-item")||t.hasClass("lg-img-wrap")},t.prototype.isPosterElement=function(t){var i=this.getSlideItem(this.index).find(".lg-video-play-button").get();return t.hasClass("lg-video-poster")||t.hasClass("lg-video-play-button")||i&&i.contains(t.get())},t.prototype.toggleMaximize=function(){var t=this;this.getElementById("lg-maximize").on("click.lg",(function(){t.$container.toggleClass("lg-inline"),t.refreshOnResize()}))},t.prototype.invalidateItems=function(){for(var t=0;t<this.items.length;t++){var i=o(this.items[t]);i.off("click.lgcustom-item-"+i.attr("data-lg-id"))}},t.prototype.manageCloseGallery=function(){var t=this;if(this.settings.closable){var i=!1;this.getElementById("lg-close").on("click.lg",(function(){t.closeGallery()})),this.settings.closeOnTap&&(this.outer.on("mousedown.lg",(function(s){var n=o(s.target);i=!!t.isSlideElement(n)})),this.outer.on("mousemove.lg",(function(){i=!1})),this.outer.on("mouseup.lg",(function(s){var n=o(s.target);t.isSlideElement(n)&&i&&(t.outer.hasClass("lg-dragging")||t.closeGallery())})))}},t.prototype.closeGallery=function(t){var i=this;if(!this.lgOpened||!this.settings.closable&&!t)return 0;this.LGel.trigger(B),o(window).scrollTop(this.prevScrollTop);var s,n=this.items[this.index];if(this.zoomFromOrigin&&n){var e=this.mediaContainerPosition,h=e.top,r=e.bottom,u=l(n,this.$lgContent,h+r,this.galleryItems[this.index].t&&this.settings.videoMaxSize);s=a(n,this.$lgContent,h,r,u)}this.zoomFromOrigin&&s?(this.outer.addClass("lg-closing lg-zoom-from-image"),this.getSlideItem(this.index).addClass("lg-start-end-progress").css("transition-duration",this.settings.startAnimationDuration+"ms").css("transform",s)):(this.outer.addClass("lg-hide-items"),this.outer.removeClass("lg-zoom-from-image")),this.destroyModules(),this.lGalleryOn=!1,this.isDummyImageRemoved=!1,this.zoomFromOrigin=this.settings.zoomFromOrigin,clearTimeout(this.hideBarTimeout),this.hideBarTimeout=!1,o("html").removeClass("lg-on"),this.outer.removeClass("lg-visible lg-components-open"),this.$backdrop.removeClass("in").css("opacity",0);var c=this.zoomFromOrigin&&s?Math.max(this.settings.startAnimationDuration,this.settings.backdropDuration):this.settings.backdropDuration;return this.$container.removeClass("lg-show-in"),setTimeout((function(){i.zoomFromOrigin&&s&&i.outer.removeClass("lg-zoom-from-image"),i.$container.removeClass("lg-show"),i.$backdrop.removeAttr("style").css("transition-duration",i.settings.backdropDuration+"ms"),i.outer.removeClass("lg-closing "+i.settings.startClass),i.getSlideItem(i.index).removeClass("lg-start-end-progress"),i.$inner.empty(),i.lgOpened&&i.LGel.trigger(E,{instance:i}),i.outer.get()&&i.outer.get().blur(),i.lgOpened=!1}),c+100),c+100},t.prototype.initModules=function(){this.plugins.forEach((function(t){try{t.init()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly initiated")}}))},t.prototype.destroyModules=function(t){this.plugins.forEach((function(i){try{t?i.destroy():i.closeGallery&&i.closeGallery()}catch(t){console.warn("lightGallery:- make sure lightGallery module is properly destroyed")}}))},t.prototype.refresh=function(t){this.settings.dynamic||this.invalidateItems(),this.galleryItems=t||this.getItems(),this.updateControls(),this.openGalleryOnItemClick(),this.LGel.trigger(T)},t.prototype.updateControls=function(){this.addSlideVideoInfo(this.galleryItems),this.updateCounterTotal(),this.manageSingleSlideClassName()},t.prototype.destroy=function(){var t=this,i=this.closeGallery(!0);return setTimeout((function(){t.destroyModules(!0),t.settings.dynamic||t.invalidateItems(),o(window).off(".lg.global"+t.lgId),t.LGel.off(".lg"),t.$container.remove()}),i),i},t}(),U=function(t,i,s,n){for(var e,o=arguments.length,h=o<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,s):n,r=t.length-1;r>=0;r--)(e=t[r])&&(h=(o<3?e(h):o>3?e(i,s,h):e(i,s))||h);return o>3&&h&&Object.defineProperty(i,s,h),h};t.LightGalleryLit=class extends i.LitElement{constructor(){super(...arguments),this.settings={}}getSelector(t){const i=t.assignedNodes({flatten:!0});return Array.prototype.filter.call(i,(t=>t.nodeType==Node.ELEMENT_NODE))}firstUpdated(){if(!this.shadowRoot)return;const t=this.shadowRoot.querySelector("slot"),i={selector:this.getSelector(t)},s={...this.settings,...i};this.galleryInstance=new _(this,s)}handleSlotchange(t){var i,s;const n=this.getSelector(t.target);this.galleryInstance&&(null===(i=this.galleryInstance)||void 0===i?void 0:i.galleryItems.length)!==n.length&&(this.galleryInstance.settings.selector=n,null===(s=this.galleryInstance)||void 0===s||s.refresh())}disconnectedCallback(){super.disconnectedCallback(),this.galleryInstance&&this.galleryInstance.destroy()}render(){return i.html`
<div id="container">

@@ -37,0 +37,0 @@ <slot @slotchange=${this.handleSlotchange}></slot>

{
"name": "lightgallery",
"version": "2.2.0-beta.0",
"version": "2.2.0-beta.1",
"description": "lightGallery is a feature-rich, modular JavaScript gallery plugin for building beautiful image and video galleries for the web and the mobile",

@@ -5,0 +5,0 @@ "keywords": [

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgAutoplay=e()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},o="lgSlideItemLoad",s="lgBeforeSlide",r="lgAfterSlide",a="lgDragStart",i="lgDragEnd",n={autoplay:!0,slideShowAutoplay:!1,slideShowInterval:5e3,progressBar:!0,forceSlideShowAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"};function t(t){return this.core=t,this.settings=e(e({},n),this.core.settings),this}return t.prototype.init=function(){var t=this;this.settings.autoplay&&(this.interval=!1,this.fromAuto=!0,this.pausedOnTouchDrag=!1,this.pausedOnSlideChange=!1,this.settings.autoplayControls&&this.controls(),this.settings.progressBar&&this.core.$lgContent.append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),this.settings.slideShowAutoplay&&this.core.LGel.once(o+".autoplay",function(){t.startAuto()}),this.core.LGel.on(a+".autoplay touchstart.lg.autoplay",function(){t.interval&&(t.cancelAuto(),t.pausedOnTouchDrag=!0)}),this.core.LGel.on(i+".autoplay touchend.lg.autoplay",function(){!t.interval&&t.pausedOnTouchDrag&&(t.startAuto(),t.pausedOnTouchDrag=!1)}),this.core.LGel.on(s+".autoplay",function(){t.showProgressBar(),!t.fromAuto&&t.interval?(t.cancelAuto(),t.pausedOnSlideChange=!0):t.pausedOnSlideChange=!1,t.fromAuto=!1}),this.core.LGel.on(r+".autoplay",function(){t.pausedOnSlideChange&&!t.interval&&t.settings.forceSlideShowAutoplay&&(t.startAuto(),t.pausedOnSlideChange=!1)}),this.showProgressBar())},t.prototype.showProgressBar=function(){var t,e,o=this;this.settings.progressBar&&this.fromAuto&&(t=this.core.outer.find(".lg-progress-bar"),e=this.core.outer.find(".lg-progress"),this.interval&&(e.removeAttr("style"),t.removeClass("lg-start"),setTimeout(function(){e.css("transition","width "+(o.core.settings.speed+o.settings.slideShowInterval)+"ms ease 0s"),t.addClass("lg-start")},20)))},t.prototype.controls=function(){var t=this;this.core.outer.find(this.settings.appendAutoplayControlsTo).append('<button aria-label="Toggle autoplay" type="button" class="lg-autoplay-button lg-icon"></button>'),this.core.outer.find(".lg-autoplay-button").first().on("click.lg.autoplay",function(){t.core.outer.hasClass("lg-show-autoplay")?t.cancelAuto():t.interval||t.startAuto()})},t.prototype.startAuto=function(){var t=this;this.core.outer.find(".lg-progress").css("transition","width "+(this.core.settings.speed+this.settings.slideShowInterval)+"ms ease 0s"),this.core.outer.addClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").addClass("lg-start"),this.interval=setInterval(function(){t.core.index+1<t.core.galleryItems.length?t.core.index++:t.core.index=0,t.fromAuto=!0,t.core.slide(t.core.index,!1,!1,"next")},this.core.settings.speed+this.settings.slideShowInterval)},t.prototype.cancelAuto=function(){this.interval&&(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")),clearInterval(this.interval),this.interval=!1},t.prototype.closeGallery=function(){this.cancelAuto()},t.prototype.destroy=function(){this.settings.autoplay&&this.core.outer.find(".lg-progress-bar").remove(),this.core.LGel.off(".lg.autoplay"),this.core.LGel.off(".autoplay")},t});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgAutoplay=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,s=arguments.length;o<s;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e="lgSlideItemLoad",o="lgBeforeSlide",s="lgAfterSlide",r="lgDragStart",i="lgDragEnd",a={autoplay:!0,slideShowAutoplay:!1,slideShowInterval:5e3,progressBar:!0,forceSlideShowAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"};return function(){function n(e){return this.core=e,this.settings=t(t({},a),this.core.settings),this}return n.prototype.init=function(){var t=this;this.settings.autoplay&&(this.interval=!1,this.fromAuto=!0,this.pausedOnTouchDrag=!1,this.pausedOnSlideChange=!1,this.settings.autoplayControls&&this.controls(),this.settings.progressBar&&this.core.$lgContent.append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'),this.settings.slideShowAutoplay&&this.core.LGel.once(e+".autoplay",(function(){t.startAuto()})),this.core.LGel.on(r+".autoplay touchstart.lg.autoplay",(function(){t.interval&&(t.cancelAuto(),t.pausedOnTouchDrag=!0)})),this.core.LGel.on(i+".autoplay touchend.lg.autoplay",(function(){!t.interval&&t.pausedOnTouchDrag&&(t.startAuto(),t.pausedOnTouchDrag=!1)})),this.core.LGel.on(o+".autoplay",(function(){t.showProgressBar(),!t.fromAuto&&t.interval?(t.cancelAuto(),t.pausedOnSlideChange=!0):t.pausedOnSlideChange=!1,t.fromAuto=!1})),this.core.LGel.on(s+".autoplay",(function(){t.pausedOnSlideChange&&!t.interval&&t.settings.forceSlideShowAutoplay&&(t.startAuto(),t.pausedOnSlideChange=!1)})),this.showProgressBar())},n.prototype.showProgressBar=function(){var t=this;if(this.settings.progressBar&&this.fromAuto){var e=this.core.outer.find(".lg-progress-bar"),o=this.core.outer.find(".lg-progress");this.interval&&(o.removeAttr("style"),e.removeClass("lg-start"),setTimeout((function(){o.css("transition","width "+(t.core.settings.speed+t.settings.slideShowInterval)+"ms ease 0s"),e.addClass("lg-start")}),20))}},n.prototype.controls=function(){var t=this;this.core.outer.find(this.settings.appendAutoplayControlsTo).append('<button aria-label="Toggle autoplay" type="button" class="lg-autoplay-button lg-icon"></button>'),this.core.outer.find(".lg-autoplay-button").first().on("click.lg.autoplay",(function(){t.core.outer.hasClass("lg-show-autoplay")?t.cancelAuto():t.interval||t.startAuto()}))},n.prototype.startAuto=function(){var t=this;this.core.outer.find(".lg-progress").css("transition","width "+(this.core.settings.speed+this.settings.slideShowInterval)+"ms ease 0s"),this.core.outer.addClass("lg-show-autoplay"),this.core.outer.find(".lg-progress-bar").addClass("lg-start"),this.interval=setInterval((function(){t.core.index+1<t.core.galleryItems.length?t.core.index++:t.core.index=0,t.fromAuto=!0,t.core.slide(t.core.index,!1,!1,"next")}),this.core.settings.speed+this.settings.slideShowInterval)},n.prototype.cancelAuto=function(){this.interval&&(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")),clearInterval(this.interval),this.interval=!1},n.prototype.closeGallery=function(){this.cancelAuto()},n.prototype.destroy=function(){this.settings.autoplay&&this.core.outer.find(".lg-progress-bar").remove(),this.core.LGel.off(".lg.autoplay"),this.core.LGel.off(".autoplay")},n}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgAutoplay = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgAutoplay = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgComment=e()}(this,function(){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i="lgBeforeSlide",s="lgAfterSlide",n={commentBox:!1,fbComments:!1,disqusComments:!1,disqusConfig:{title:void 0,language:"en"},commentsMarkup:'<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>'};function t(t,e){return this.core=t,this.$LG=e,this.settings=o(o({},n),this.core.settings),this}return t.prototype.init=function(){this.settings.commentBox&&(this.setMarkup(),this.toggleCommentBox(),this.settings.fbComments?this.addFbComments():this.settings.disqusComments&&this.addDisqusComments())},t.prototype.setMarkup=function(){this.core.$lgContent.append(this.settings.commentsMarkup+'<div class="lg-comment-overlay"></div>');this.core.$toolbar.append('<button type="button" aria-label="Toggle comments" class="lg-comment-toggle lg-icon"></button>')},t.prototype.toggleCommentBox=function(){var t=this;this.core.outer.find(".lg-comment-toggle").first().on("click.lg.comment",function(){t.core.outer.toggleClass("lg-comment-active")}),this.core.outer.find(".lg-comment-overlay").first().on("click.lg.comment",function(){t.core.outer.removeClass("lg-comment-active")}),this.core.outer.find(".lg-comment-close").first().on("click.lg.comment",function(){t.core.outer.removeClass("lg-comment-active")})},t.prototype.addFbComments=function(){var e=this,o=this;this.core.LGel.on(i+".comment",function(t){t=e.core.galleryItems[t.detail.index].fbHtml;e.core.outer.find(".lg-comment-body").html(t)}),this.core.LGel.on(s+".comment",function(){try{FB.XFBML.parse()}catch(t){o.$LG(window).on("fbAsyncInit",function(){FB.XFBML.parse()})}})},t.prototype.addDisqusComments=function(){var n=this,t=this.$LG("#disqus_thread");t.remove(),this.core.outer.find(".lg-comment-body").append('<div id="disqus_thread"></div>'),this.core.LGel.on(i+".comment",function(){t.html("")}),this.core.LGel.on(s+".comment",function(t){var e=t.detail.index,o=n;setTimeout(function(){try{DISQUS.reset({reload:!0,config:function(){this.page.identifier=o.core.galleryItems[e].disqusIdentifier,this.page.url=o.core.galleryItems[e].disqusURL,this.page.title=o.settings.disqusConfig.title,this.language=o.settings.disqusConfig.language}})}catch(t){console.error("Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/")}},o.core.lGalleryOn?0:1e3)})},t.prototype.destroy=function(){this.core.LGel.off(".lg.comment"),this.core.LGel.off(".comment")},t});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgComment=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},e="lgBeforeSlide",o="lgAfterSlide",n={commentBox:!1,fbComments:!1,disqusComments:!1,disqusConfig:{title:void 0,language:"en"},commentsMarkup:'<div id="lg-comment-box" class="lg-comment-box lg-fb-comment-box"><div class="lg-comment-header"><h3 class="lg-comment-title">Leave a comment.</h3><span class="lg-comment-close lg-icon"></span></div><div class="lg-comment-body"></div></div>'};return function(){function i(e,o){return this.core=e,this.$LG=o,this.settings=t(t({},n),this.core.settings),this}return i.prototype.init=function(){this.settings.commentBox&&(this.setMarkup(),this.toggleCommentBox(),this.settings.fbComments?this.addFbComments():this.settings.disqusComments&&this.addDisqusComments())},i.prototype.setMarkup=function(){this.core.$lgContent.append(this.settings.commentsMarkup+'<div class="lg-comment-overlay"></div>');this.core.$toolbar.append('<button type="button" aria-label="Toggle comments" class="lg-comment-toggle lg-icon"></button>')},i.prototype.toggleCommentBox=function(){var t=this;this.core.outer.find(".lg-comment-toggle").first().on("click.lg.comment",(function(){t.core.outer.toggleClass("lg-comment-active")})),this.core.outer.find(".lg-comment-overlay").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")})),this.core.outer.find(".lg-comment-close").first().on("click.lg.comment",(function(){t.core.outer.removeClass("lg-comment-active")}))},i.prototype.addFbComments=function(){var t=this,n=this;this.core.LGel.on(e+".comment",(function(e){var o=t.core.galleryItems[e.detail.index].fbHtml;t.core.outer.find(".lg-comment-body").html(o)})),this.core.LGel.on(o+".comment",(function(){try{FB.XFBML.parse()}catch(t){n.$LG(window).on("fbAsyncInit",(function(){FB.XFBML.parse()}))}}))},i.prototype.addDisqusComments=function(){var t=this,n=this.$LG("#disqus_thread");n.remove(),this.core.outer.find(".lg-comment-body").append('<div id="disqus_thread"></div>'),this.core.LGel.on(e+".comment",(function(){n.html("")})),this.core.LGel.on(o+".comment",(function(e){var o=e.detail.index,n=t;setTimeout((function(){try{DISQUS.reset({reload:!0,config:function(){this.page.identifier=n.core.galleryItems[o].disqusIdentifier,this.page.url=n.core.galleryItems[o].disqusURL,this.page.title=n.settings.disqusConfig.title,this.language=n.settings.disqusConfig.language}})}catch(t){console.error("Make sure you have included disqus JavaScript code in your document. Ex - https://lg-disqus.disqus.com/admin/install/platforms/universalcode/")}}),n.core.lGalleryOn?0:1e3)}))},i.prototype.destroy=function(){this.core.LGel.off(".lg.comment"),this.core.LGel.off(".comment")},i}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgComment = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgComment = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -4,0 +4,0 @@ * Copyright (c) 2020 Sachin Neravath;

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l():"function"==typeof define&&define.amd?define(l):e.lgFullscreen=l()}(this,function(){"use strict";var n=function(){return(n=Object.assign||function(e){for(var l,n=1,t=arguments.length;n<t;n++)for(var c in l=arguments[n])Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);return e}).apply(this,arguments)},t={fullScreen:!0};function e(e,l){return this.core=e,this.$LG=l,this.settings=n(n({},t),this.core.settings),this}return e.prototype.init=function(){this.settings.fullScreen&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)&&(this.core.$toolbar.append('<button type="button" aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>'),this.fullScreen())},e.prototype.isFullScreen=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},e.prototype.requestFullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},e.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},e.prototype.fullScreen=function(){var e=this;this.$LG(document).on("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId,function(){e.core.lgOpened&&e.core.outer.toggleClass("lg-fullscreen-on")}),this.core.outer.find(".lg-fullscreen").first().on("click.lg",function(){e.isFullScreen()?e.exitFullscreen():e.requestFullscreen()})},e.prototype.closeGallery=function(){this.isFullScreen()&&this.exitFullscreen()},e.prototype.destroy=function(){this.$LG(document).off("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId)},e});
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?module.exports=l():"function"==typeof define&&define.amd?define(l):(e="undefined"!=typeof globalThis?globalThis:e||self).lgFullscreen=l()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var l,n=1,t=arguments.length;n<t;n++)for(var c in l=arguments[n])Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);return e}).apply(this,arguments)},l={fullScreen:!0};return function(){function n(n,t){return this.core=n,this.$LG=t,this.settings=e(e({},l),this.core.settings),this}return n.prototype.init=function(){var e="";if(this.settings.fullScreen){if(!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled))return;e='<button type="button" aria-label="Toggle fullscreen" class="lg-fullscreen lg-icon"></button>',this.core.$toolbar.append(e),this.fullScreen()}},n.prototype.isFullScreen=function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},n.prototype.requestFullscreen=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},n.prototype.exitFullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},n.prototype.fullScreen=function(){var e=this;this.$LG(document).on("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId,(function(){e.core.lgOpened&&e.core.outer.toggleClass("lg-fullscreen-on")})),this.core.outer.find(".lg-fullscreen").first().on("click.lg",(function(){e.isFullScreen()?e.exitFullscreen():e.requestFullscreen()}))},n.prototype.closeGallery=function(){this.isFullScreen()&&this.exitFullscreen()},n.prototype.destroy=function(){this.$LG(document).off("fullscreenchange.lg.global"+this.core.lgId+" \n webkitfullscreenchange.lg.global"+this.core.lgId+" \n mozfullscreenchange.lg.global"+this.core.lgId+" \n MSFullscreenChange.lg.global"+this.core.lgId)},n}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgFullscreen = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgFullscreen = factory());
}(this, (function () { 'use strict';

@@ -14,0 +14,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgHash=e()}(this,function(){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,o=1,i=arguments.length;o<i;o++)for(var s in e=arguments[o])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},e="lgAfterSlide",i="lgAfterClose",s={hash:!0,galleryId:"1",customSlideName:!1};function t(t,e){return this.core=t,this.$LG=e,this.settings=o(o({},s),this.core.settings),this}return t.prototype.init=function(){var t=this;this.settings.hash&&(this.oldHash=window.location.hash,setTimeout(function(){t.buildFromHash()},100),this.core.LGel.on(e+".hash",this.onAfterSlide.bind(this)),this.core.LGel.on(i+".hash",this.onCloseAfter.bind(this)),this.$LG(window).on("hashchange.lg.hash.global"+this.core.lgId,this.onHashchange.bind(this)))},t.prototype.onAfterSlide=function(t){var e=this.core.galleryItems[t.detail.index].slideName,e=this.settings.customSlideName&&e||t.detail.index;history.replaceState?history.replaceState(null,"",window.location.pathname+window.location.search+"#lg="+this.settings.galleryId+"&slide="+e):window.location.hash="lg="+this.settings.galleryId+"&slide="+e},t.prototype.getIndexFromUrl=function(t){void 0===t&&(t=window.location.hash);var e=t.split("&slide=")[1],o=0;if(this.settings.customSlideName)for(var i=0;i<this.core.galleryItems.length;i++){if(this.core.galleryItems[i].slideName===e){o=i;break}}else o=parseInt(e,10);return isNaN(o)?0:o},t.prototype.buildFromHash=function(){var t=window.location.hash;if(0<t.indexOf("lg="+this.settings.galleryId)){this.$LG(document.body).addClass("lg-from-hash");t=this.getIndexFromUrl(t);return this.core.openGallery(t),!0}},t.prototype.onCloseAfter=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.settings.galleryId)<0?history.replaceState?history.replaceState(null,"",this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash=""},t.prototype.onHashchange=function(){var t,e;this.core.lgOpened&&(t=window.location.hash,e=this.getIndexFromUrl(t),-1<t.indexOf("lg="+this.settings.galleryId)?this.core.slide(e,!1,!1):this.core.lGalleryOn&&this.core.closeGallery())},t.prototype.closeGallery=function(){this.settings.hash&&this.$LG(document.body).removeClass("lg-from-hash")},t.prototype.destroy=function(){this.core.LGel.off(".lg.hash"),this.core.LGel.off(".hash"),this.$LG(window).off("hashchange.lg.hash.global"+this.core.lgId)},t});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgHash=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},e="lgAfterSlide",i="lgAfterClose",o={hash:!0,galleryId:"1",customSlideName:!1};return function(){function s(e,i){return this.core=e,this.$LG=i,this.settings=t(t({},o),this.core.settings),this}return s.prototype.init=function(){var t=this;this.settings.hash&&(this.oldHash=window.location.hash,setTimeout((function(){t.buildFromHash()}),100),this.core.LGel.on(e+".hash",this.onAfterSlide.bind(this)),this.core.LGel.on(i+".hash",this.onCloseAfter.bind(this)),this.$LG(window).on("hashchange.lg.hash.global"+this.core.lgId,this.onHashchange.bind(this)))},s.prototype.onAfterSlide=function(t){var e=this.core.galleryItems[t.detail.index].slideName;e=this.settings.customSlideName&&e||t.detail.index,history.replaceState?history.replaceState(null,"",window.location.pathname+window.location.search+"#lg="+this.settings.galleryId+"&slide="+e):window.location.hash="lg="+this.settings.galleryId+"&slide="+e},s.prototype.getIndexFromUrl=function(t){void 0===t&&(t=window.location.hash);var e=t.split("&slide=")[1],i=0;if(this.settings.customSlideName)for(var o=0;o<this.core.galleryItems.length;o++){if(this.core.galleryItems[o].slideName===e){i=o;break}}else i=parseInt(e,10);return isNaN(i)?0:i},s.prototype.buildFromHash=function(){var t=window.location.hash;if(t.indexOf("lg="+this.settings.galleryId)>0){this.$LG(document.body).addClass("lg-from-hash");var e=this.getIndexFromUrl(t);return this.core.openGallery(e),!0}},s.prototype.onCloseAfter=function(){this.oldHash&&this.oldHash.indexOf("lg="+this.settings.galleryId)<0?history.replaceState?history.replaceState(null,"",this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash=""},s.prototype.onHashchange=function(){if(this.core.lgOpened){var t=window.location.hash,e=this.getIndexFromUrl(t);t.indexOf("lg="+this.settings.galleryId)>-1?this.core.slide(e,!1,!1):this.core.lGalleryOn&&this.core.closeGallery()}},s.prototype.closeGallery=function(){this.settings.hash&&this.$LG(document.body).removeClass("lg-from-hash")},s.prototype.destroy=function(){this.core.LGel.off(".lg.hash"),this.core.LGel.off(".hash"),this.$LG(window).off("hashchange.lg.hash.global"+this.core.lgId)},s}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgHash = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgHash = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):o.lgMediumZoom=t()}(this,function(){"use strict";var s=function(){return(s=Object.assign||function(o){for(var t,e=1,s=arguments.length;e<s;e++)for(var i in t=arguments[e])Object.prototype.hasOwnProperty.call(t,i)&&(o[i]=t[i]);return o}).apply(this,arguments)},t="lgBeforeOpen",i={margin:40,mediumZoom:!0,backgroundColor:"#000"};function o(o,t){var e=this;this.core=o,this.$LG=t;t={controls:!(this.core.getMediaContainerPosition=function(){return{top:e.settings.margin,bottom:e.settings.margin}}),download:!1,counter:!1,showCloseIcon:!1,extraProps:["lgBackgroundColor"],closeOnTap:!1,enableSwipe:!1,enableDrag:!1,swipeToClose:!1,addClass:this.core.settings.addClass+" lg-medium-zoom"};return this.core.settings=s(s({},this.core.settings),t),this.settings=s(s(s({},i),this.core.settings),t),this}return o.prototype.toggleItemClass=function(){for(var o=0;o<this.core.items.length;o++){this.$LG(this.core.items[o]).toggleClass("lg-medium-zoom-item")}},o.prototype.init=function(){var o=this;this.settings.mediumZoom&&(this.core.LGel.on(t+".medium",function(){o.core.$backdrop.css("background-color",o.core.galleryItems[o.core.index].lgBackgroundColor||o.settings.backgroundColor)}),this.toggleItemClass(),this.core.outer.on("click.lg.medium",function(){o.core.closeGallery()}))},o.prototype.destroy=function(){this.toggleItemClass()},o});
!function(o,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(o="undefined"!=typeof globalThis?globalThis:o||self).lgMediumZoom=t()}(this,(function(){"use strict";var o=function(){return(o=Object.assign||function(o){for(var t,e=1,i=arguments.length;e<i;e++)for(var n in t=arguments[e])Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o}).apply(this,arguments)},t="lgBeforeOpen",e={margin:40,mediumZoom:!0,backgroundColor:"#000"};return function(){function i(t,i){var n=this;this.core=t,this.$LG=i,this.core.getMediaContainerPosition=function(){return{top:n.settings.margin,bottom:n.settings.margin}};var s={controls:!1,download:!1,counter:!1,showCloseIcon:!1,extraProps:["lgBackgroundColor"],closeOnTap:!1,enableSwipe:!1,enableDrag:!1,swipeToClose:!1,addClass:this.core.settings.addClass+" lg-medium-zoom"};return this.core.settings=o(o({},this.core.settings),s),this.settings=o(o(o({},e),this.core.settings),s),this}return i.prototype.toggleItemClass=function(){for(var o=0;o<this.core.items.length;o++){this.$LG(this.core.items[o]).toggleClass("lg-medium-zoom-item")}},i.prototype.init=function(){var o=this;this.settings.mediumZoom&&(this.core.LGel.on(t+".medium",(function(){o.core.$backdrop.css("background-color",o.core.galleryItems[o.core.index].lgBackgroundColor||o.settings.backgroundColor)})),this.toggleItemClass(),this.core.outer.on("click.lg.medium",(function(){o.core.closeGallery()})))},i.prototype.destroy=function(){this.toggleItemClass()},i}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgMediumZoom = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgMediumZoom = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.lgPager=t()}(this,function(){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},o="lgUpdateSlides",i="lgBeforeSlide",n={pager:!0};function e(e,t){return this.core=e,this.$LG=t,this.settings=r(r({},n),this.core.settings),this}return e.prototype.getPagerHtml=function(e){for(var t="",r=0;r<e.length;r++)t+='<span data-lg-item-id="'+r+'" class="lg-pager-cont"> \n <span data-lg-item-id="'+r+'" class="lg-pager"></span>\n <div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e[r].thumb+'" /></div>\n </span>';return t},e.prototype.init=function(){var e,t,r=this;this.settings.pager&&(this.core.$lgComponents.prepend('<div class="lg-pager-outer"></div>'),(t=this.core.outer.find(".lg-pager-outer")).html(this.getPagerHtml(this.core.galleryItems)),t.first().on("click.lg touchend.lg",function(e){e=r.$LG(e.target);e.hasAttribute("data-lg-item-id")&&(e=parseInt(e.attr("data-lg-item-id")),r.core.slide(e,!1,!0,!1))}),t.first().on("mouseover.lg",function(){clearTimeout(e),t.addClass("lg-pager-hover")}),t.first().on("mouseout.lg",function(){e=setTimeout(function(){t.removeClass("lg-pager-hover")})}),this.core.LGel.on(i+".pager",function(e){e=e.detail.index;r.manageActiveClass.call(r,e)}),this.core.LGel.on(o+".pager",function(){t.empty(),t.html(r.getPagerHtml(r.core.galleryItems)),r.manageActiveClass(r.core.index)}))},e.prototype.manageActiveClass=function(e){var t=this.core.outer.find(".lg-pager-cont");t.removeClass("lg-pager-active"),t.eq(e).addClass("lg-pager-active")},e.prototype.destroy=function(){this.core.outer.find(".lg-pager-outer").remove(),this.core.LGel.off(".lg.pager"),this.core.LGel.off(".pager")},e});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).lgPager=t()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},t="lgUpdateSlides",r="lgBeforeSlide",o={pager:!0};return function(){function i(t,r){return this.core=t,this.$LG=r,this.settings=e(e({},o),this.core.settings),this}return i.prototype.getPagerHtml=function(e){for(var t="",r=0;r<e.length;r++)t+='<span data-lg-item-id="'+r+'" class="lg-pager-cont"> \n <span data-lg-item-id="'+r+'" class="lg-pager"></span>\n <div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="'+e[r].thumb+'" /></div>\n </span>';return t},i.prototype.init=function(){var e=this;if(this.settings.pager){var o;this.core.$lgComponents.prepend('<div class="lg-pager-outer"></div>');var i=this.core.outer.find(".lg-pager-outer");i.html(this.getPagerHtml(this.core.galleryItems)),i.first().on("click.lg touchend.lg",(function(t){var r=e.$LG(t.target);if(r.hasAttribute("data-lg-item-id")){var o=parseInt(r.attr("data-lg-item-id"));e.core.slide(o,!1,!0,!1)}})),i.first().on("mouseover.lg",(function(){clearTimeout(o),i.addClass("lg-pager-hover")})),i.first().on("mouseout.lg",(function(){o=setTimeout((function(){i.removeClass("lg-pager-hover")}))})),this.core.LGel.on(r+".pager",(function(t){var r=t.detail.index;e.manageActiveClass.call(e,r)})),this.core.LGel.on(t+".pager",(function(){i.empty(),i.html(e.getPagerHtml(e.core.galleryItems)),e.manageActiveClass(e.core.index)}))}},i.prototype.manageActiveClass=function(e){var t=this.core.outer.find(".lg-pager-cont");t.removeClass("lg-pager-active"),t.eq(e).addClass("lg-pager-active")},i.prototype.destroy=function(){this.core.outer.find(".lg-pager-outer").remove(),this.core.LGel.off(".lg.pager"),this.core.LGel.off(".pager")},i}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgPager = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgPager = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -61,0 +65,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgRelativeCaption=e()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},t="lgSlideItemLoad",o="lgBeforeSlide",n="lgAfterSlide",i={relativeCaption:!1};function s(t){this.core=t;t={addClass:this.core.settings.addClass+" lg-relative-caption"};return this.core.settings=e(e({},this.core.settings),t),this.settings=e(e(e({},i),this.core.settings),t),this}return s.prototype.init=function(){var i=this;this.settings.relativeCaption&&(this.core.LGel.on(t+".caption",function(t){var t=t.detail,e=t.index,t=t.delay;setTimeout(function(){i.setRelativeCaption(e)},t)}),this.core.LGel.on(n+".caption",function(t){var e=t.detail.index;setTimeout(function(){i.core.getSlideItem(e).hasClass("lg-complete")&&i.setRelativeCaption(e)})}),this.core.LGel.on(o+".caption",function(t){var e=t.detail.index;setTimeout(function(){i.core.getSlideItem(e).removeClass("lg-show-caption")})}))},s.prototype.setCaptionStyle=function(t,e){var i=this.core.getSlideItem(t).find(".lg-relative-caption-item"),o=this.core.getSlideItem(t).find(".lg-sub-html"),t=i.get().getBoundingClientRect(),i=e.bottom;e.height+t.height>=e.bottom&&(i-=t.height),o.css("width",e.width+"px").css("left",e.left+"px").css("top",i+"px")},s.prototype.setRelativeCaption=function(t){var e,i=this.core.getSlideItem(t);i.hasClass("lg-current")&&(e=this.core.getSlideItem(t).find(".lg-object").get().getBoundingClientRect(),this.setCaptionStyle(t,e),i.addClass("lg-show-caption"))},s.prototype.destroy=function(){this.core.LGel.off(".caption")},s});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRelativeCaption=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},e="lgSlideItemLoad",i="lgBeforeSlide",o="lgAfterSlide",n={relativeCaption:!1};return function(){function s(e){this.core=e;var i={addClass:this.core.settings.addClass+" lg-relative-caption"};return this.core.settings=t(t({},this.core.settings),i),this.settings=t(t(t({},n),this.core.settings),i),this}return s.prototype.init=function(){var t=this;this.settings.relativeCaption&&(this.core.LGel.on(e+".caption",(function(e){var i=e.detail,o=i.index,n=i.delay;setTimeout((function(){t.setRelativeCaption(o)}),n)})),this.core.LGel.on(o+".caption",(function(e){var i=e.detail.index;setTimeout((function(){t.core.getSlideItem(i).hasClass("lg-complete")&&t.setRelativeCaption(i)}))})),this.core.LGel.on(i+".caption",(function(e){var i=e.detail.index;setTimeout((function(){t.core.getSlideItem(i).removeClass("lg-show-caption")}))})))},s.prototype.setCaptionStyle=function(t,e){var i=this.core.getSlideItem(t).find(".lg-relative-caption-item"),o=this.core.getSlideItem(t).find(".lg-sub-html"),n=i.get().getBoundingClientRect(),s=e.bottom;e.height+n.height>=e.bottom&&(s-=n.height),o.css("width",e.width+"px").css("left",e.left+"px").css("top",s+"px")},s.prototype.setRelativeCaption=function(t){var e=this.core.getSlideItem(t);if(e.hasClass("lg-current")){var i=this.core.getSlideItem(t).find(".lg-object").get().getBoundingClientRect();this.setCaptionStyle(t,i),e.addClass("lg-show-caption")}},s.prototype.destroy=function(){this.core.LGel.off(".caption")},s}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgRelativeCaption = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgRelativeCaption = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -68,0 +72,0 @@

@@ -7,2 +7,6 @@ export interface RotateSettings {

/**
* Rotate speed in milliseconds
*/
rotateSpeed: number;
/**
* Enable rotate left.

@@ -26,2 +30,3 @@ */

rotate: boolean;
rotateSpeed: number;
rotateLeft: boolean;

@@ -28,0 +33,0 @@ rotateRight: boolean;

@@ -20,2 +20,3 @@ import { LgQuery } from '../../lgQuery';

flipVertical(): void;
triggerEvents(event: string, detail: any): void;
isImageOrientationChanged(): boolean;

@@ -22,0 +23,0 @@ closeGallery(): void;

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -59,2 +59,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -64,2 +68,3 @@

rotate: true,
rotateSpeed: 400,
rotateLeft: true,

@@ -117,2 +122,6 @@ rotateRight: true,

imageWrap.wrap('lg-img-rotate');
_this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.css('transition-duration', _this.settings.rotateSpeed + 'ms');
});

@@ -163,2 +172,5 @@ this.core.outer

this.applyStyles();
this.triggerEvents(lGEvents.rotateLeft, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -168,2 +180,5 @@ Rotate.prototype.rotateRight = function () {

this.applyStyles();
this.triggerEvents(lGEvents.rotateRight, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -203,2 +218,5 @@ Rotate.prototype.getCurrentRotation = function (el) {

this.applyStyles();
this.triggerEvents(lGEvents.flipHorizontal, {
flipHorizontal: this.rotateValuesList[this.core.index][rotateAxis],
});
};

@@ -218,3 +236,12 @@ Rotate.prototype.flipVertical = function () {

this.applyStyles();
this.triggerEvents(lGEvents.flipVertical, {
flipVertical: this.rotateValuesList[this.core.index][rotateAxis],
});
};
Rotate.prototype.triggerEvents = function (event, detail) {
var _this = this;
setTimeout(function () {
_this.core.LGel.trigger(event, detail);
}, this.settings.rotateSpeed + 10);
};
Rotate.prototype.isImageOrientationChanged = function () {

@@ -221,0 +248,0 @@ var rotateValue = this.rotateValuesList[this.core.index];

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgRotate=e()}(this,function(){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},t="lgAfterAppendSlide",o="lgBeforeSlide",r={rotate:!0,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0};function e(t,e){return this.core=t,this.$LG=e,this.settings=i(i({},r),this.core.settings),this}return e.prototype.buildTemplates=function(){var t="";this.settings.flipVertical&&(t+='<button type="button" id="lg-flip-ver" aria-label="flip vertical" class="lg-flip-ver lg-icon"></button>'),this.settings.flipHorizontal&&(t+='<button type="button" id="lg-flip-hor" aria-label="Flip horizontal" class="lg-flip-hor lg-icon"></button>'),this.settings.rotateLeft&&(t+='<button type="button" id="lg-rotate-left" aria-label="Rotate left" class="lg-rotate-left lg-icon"></button>'),this.settings.rotateRight&&(t+='<button type="button" id="lg-rotate-right" aria-label="Rotate right" class="lg-rotate-right lg-icon"></button>'),this.core.$toolbar.append(t)},e.prototype.init=function(){var e=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(t+".rotate",function(t){t=t.detail.index;e.core.getSlideItem(t).find(".lg-img-wrap").first().wrap("lg-img-rotate")}),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(o+".rotate",function(t){e.rotateValuesList[t.detail.index]||(e.rotateValuesList[t.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})}))},e.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},e.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles()},e.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles()},e.prototype.getCurrentRotation=function(t){if(!t)return 0;t=this.$LG(t).style(),t=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform")||"none";if("none"!==t){t=t.split("(")[1].split(")")[0].split(",");if(t){t=Math.round(Math.atan2(t[1],t[0])*(180/Math.PI));return t<0?t+360:t}}return 0},e.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),t=this.getCurrentRotation(t),t=90!==t&&270!==t?"flipHorizontal":"flipVertical";this.rotateValuesList[this.core.index][t]*=-1,this.applyStyles()},e.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),t=this.getCurrentRotation(t),t=90!==t&&270!==t?"flipVertical":"flipHorizontal";this.rotateValuesList[this.core.index][t]*=-1,this.applyStyles()},e.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,t=t.flipVertical<0;return e||i||t},e.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},e.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},e});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgRotate=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e="lgAfterAppendSlide",i="lgBeforeSlide",o="lgRotateLeft",r="lgRotateRight",s="lgFlipHorizontal",a="lgFlipVertical",l={rotate:!0,rotateSpeed:400,rotateLeft:!0,rotateRight:!0,flipHorizontal:!0,flipVertical:!0};return function(){function n(e,i){return this.core=e,this.$LG=i,this.settings=t(t({},l),this.core.settings),this}return n.prototype.buildTemplates=function(){var t="";this.settings.flipVertical&&(t+='<button type="button" id="lg-flip-ver" aria-label="flip vertical" class="lg-flip-ver lg-icon"></button>'),this.settings.flipHorizontal&&(t+='<button type="button" id="lg-flip-hor" aria-label="Flip horizontal" class="lg-flip-hor lg-icon"></button>'),this.settings.rotateLeft&&(t+='<button type="button" id="lg-rotate-left" aria-label="Rotate left" class="lg-rotate-left lg-icon"></button>'),this.settings.rotateRight&&(t+='<button type="button" id="lg-rotate-right" aria-label="Rotate right" class="lg-rotate-right lg-icon"></button>'),this.core.$toolbar.append(t)},n.prototype.init=function(){var t=this;this.settings.rotate&&(this.buildTemplates(),this.rotateValuesList={},this.core.LGel.on(e+".rotate",(function(e){var i=e.detail.index;t.core.getSlideItem(i).find(".lg-img-wrap").first().wrap("lg-img-rotate"),t.core.getSlideItem(t.core.index).find(".lg-img-rotate").css("transition-duration",t.settings.rotateSpeed+"ms")})),this.core.outer.find("#lg-rotate-left").first().on("click.lg",this.rotateLeft.bind(this)),this.core.outer.find("#lg-rotate-right").first().on("click.lg",this.rotateRight.bind(this)),this.core.outer.find("#lg-flip-hor").first().on("click.lg",this.flipHorizontal.bind(this)),this.core.outer.find("#lg-flip-ver").first().on("click.lg",this.flipVertical.bind(this)),this.core.LGel.on(i+".rotate",(function(e){t.rotateValuesList[e.detail.index]||(t.rotateValuesList[e.detail.index]={rotate:0,flipHorizontal:1,flipVertical:1})})))},n.prototype.applyStyles=function(){this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().css("transform","rotate("+this.rotateValuesList[this.core.index].rotate+"deg) scale3d("+this.rotateValuesList[this.core.index].flipHorizontal+", "+this.rotateValuesList[this.core.index].flipVertical+", 1)")},n.prototype.rotateLeft=function(){this.rotateValuesList[this.core.index].rotate-=90,this.applyStyles(),this.triggerEvents(o,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.rotateRight=function(){this.rotateValuesList[this.core.index].rotate+=90,this.applyStyles(),this.triggerEvents(r,{rotate:this.rotateValuesList[this.core.index].rotate})},n.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.$LG(t).style(),i=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";if("none"!==i){var o=i.split("(")[1].split(")")[0].split(",");if(o){var r=Math.round(Math.atan2(o[1],o[0])*(180/Math.PI));return r<0?r+360:r}}return 0},n.prototype.flipHorizontal=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipHorizontal";90!==e&&270!==e||(i="flipVertical"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(s,{flipHorizontal:this.rotateValuesList[this.core.index][i]})},n.prototype.flipVertical=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),e=this.getCurrentRotation(t),i="flipVertical";90!==e&&270!==e||(i="flipHorizontal"),this.rotateValuesList[this.core.index][i]*=-1,this.applyStyles(),this.triggerEvents(a,{flipVertical:this.rotateValuesList[this.core.index][i]})},n.prototype.triggerEvents=function(t,e){var i=this;setTimeout((function(){i.core.LGel.trigger(t,e)}),this.settings.rotateSpeed+10)},n.prototype.isImageOrientationChanged=function(){var t=this.rotateValuesList[this.core.index],e=Math.abs(t.rotate)%360!=0,i=t.flipHorizontal<0,o=t.flipVertical<0;return e||i||o},n.prototype.closeGallery=function(){this.isImageOrientationChanged()&&this.core.getSlideItem(this.core.index).css("opacity",0),this.rotateValuesList={}},n.prototype.destroy=function(){this.core.LGel.off(".lg.rotate"),this.core.LGel.off(".rotate")},n}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgRotate = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgRotate = factory());
}(this, (function () { 'use strict';

@@ -66,2 +66,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -71,2 +75,3 @@

rotate: true,
rotateSpeed: 400,
rotateLeft: true,

@@ -124,2 +129,6 @@ rotateRight: true,

imageWrap.wrap('lg-img-rotate');
_this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.css('transition-duration', _this.settings.rotateSpeed + 'ms');
});

@@ -170,2 +179,5 @@ this.core.outer

this.applyStyles();
this.triggerEvents(lGEvents.rotateLeft, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -175,2 +187,5 @@ Rotate.prototype.rotateRight = function () {

this.applyStyles();
this.triggerEvents(lGEvents.rotateRight, {
rotate: this.rotateValuesList[this.core.index].rotate,
});
};

@@ -210,2 +225,5 @@ Rotate.prototype.getCurrentRotation = function (el) {

this.applyStyles();
this.triggerEvents(lGEvents.flipHorizontal, {
flipHorizontal: this.rotateValuesList[this.core.index][rotateAxis],
});
};

@@ -225,3 +243,12 @@ Rotate.prototype.flipVertical = function () {

this.applyStyles();
this.triggerEvents(lGEvents.flipVertical, {
flipVertical: this.rotateValuesList[this.core.index][rotateAxis],
});
};
Rotate.prototype.triggerEvents = function (event, detail) {
var _this = this;
setTimeout(function () {
_this.core.LGel.trigger(event, detail);
}, this.settings.rotateSpeed + 10);
};
Rotate.prototype.isImageOrientationChanged = function () {

@@ -228,0 +255,0 @@ var rotateValue = this.rotateValuesList[this.core.index];

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -104,2 +104,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -106,0 +110,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgShare=e()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function t(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var o=Array(t),n=0,e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var r={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",pinterest:!0,pinterestDropdownText:"Pinterest",additionalShareOptions:[]};function o(t){return"//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t.facebookShareUrl||window.location.href)}function n(t){var e=encodeURIComponent(t.twitterShareUrl||window.location.href);return"//twitter.com/intent/tweet?text="+t.tweetText+"&url="+e}function i(t){var e=t.pinterestText,r=encodeURIComponent(t.src);return"http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(t.pinterestShareUrl||window.location.href)+"&media="+r+"&description="+e}var s="lgAfterSlide";function a(t){return this.shareOptions=[],this.core=t,this.settings=e(e({},r),this.core.settings),this}return a.prototype.init=function(){this.settings.share&&(this.shareOptions=t(this.getDefaultShareOptions(),this.settings.additionalShareOptions),this.setLgShareMarkup(),this.core.outer.find(".lg-share .lg-dropdown").append(this.getShareListHtml()),this.core.LGel.on(s+".share",this.onAfterSlide.bind(this)))},a.prototype.getShareListHtml=function(){var e="";return this.shareOptions.forEach(function(t){e+=t.dropdownHTML}),e},a.prototype.setLgShareMarkup=function(){var t=this;this.core.$toolbar.append('<button type="button" aria-label="Share" aria-haspopup="true" aria-expanded="false" class="lg-share lg-icon">\n <ul class="lg-dropdown" style="position: absolute;"></ul></button>'),this.core.$lgContent.append('<div class="lg-dropdown-overlay"></div>'),this.core.outer.find(".lg-share").first().on("click.lg",function(){t.core.outer.toggleClass("lg-dropdown-active"),t.core.outer.hasClass("lg-dropdown-active")?t.core.outer.attr("aria-expanded",!0):t.core.outer.attr("aria-expanded",!1)}),this.core.outer.find(".lg-dropdown-overlay").first().on("click.lg",function(){t.core.outer.removeClass("lg-dropdown-active"),t.core.outer.attr("aria-expanded",!1)})},a.prototype.onAfterSlide=function(t){var r=this,t=t.detail.index,o=this.core.galleryItems[t];setTimeout(function(){r.shareOptions.forEach(function(t){var e=t.selector;r.core.outer.find(e).attr("href",t.generateLink(o))})},100)},a.prototype.getShareListItemHTML=function(t,e){return'<li><a class="lg-share-'+t+'" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+e+"</span></a></li>"},a.prototype.getDefaultShareOptions=function(){return t(this.settings.facebook?[{type:"facebook",generateLink:o,dropdownHTML:this.getShareListItemHTML("facebook",this.settings.facebookDropdownText),selector:".lg-share-facebook"}]:[],this.settings.twitter?[{type:"twitter",generateLink:n,dropdownHTML:this.getShareListItemHTML("twitter",this.settings.twitterDropdownText),selector:".lg-share-twitter"}]:[],this.settings.pinterest?[{type:"pinterest",generateLink:i,dropdownHTML:this.getShareListItemHTML("pinterest",this.settings.pinterestDropdownText),selector:".lg-share-pinterest"}]:[])},a.prototype.destroy=function(){this.core.outer.find(".lg-dropdown-overlay").remove(),this.core.outer.find(".lg-share").remove(),this.core.LGel.off(".lg.share"),this.core.LGel.off(".share")},a});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgShare=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var o=Array(t),n=0;for(e=0;e<r;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,n++)o[n]=i[s];return o}var r={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",pinterest:!0,pinterestDropdownText:"Pinterest",additionalShareOptions:[]};function o(t){return"//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(t.facebookShareUrl||window.location.href)}function n(t){var e=encodeURIComponent(t.twitterShareUrl||window.location.href);return"//twitter.com/intent/tweet?text="+t.tweetText+"&url="+e}function i(t){var e=t.pinterestText,r=encodeURIComponent(t.src);return"http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(t.pinterestShareUrl||window.location.href)+"&media="+r+"&description="+e}var s="lgAfterSlide";return function(){function a(e){return this.shareOptions=[],this.core=e,this.settings=t(t({},r),this.core.settings),this}return a.prototype.init=function(){this.settings.share&&(this.shareOptions=e(this.getDefaultShareOptions(),this.settings.additionalShareOptions),this.setLgShareMarkup(),this.core.outer.find(".lg-share .lg-dropdown").append(this.getShareListHtml()),this.core.LGel.on(s+".share",this.onAfterSlide.bind(this)))},a.prototype.getShareListHtml=function(){var t="";return this.shareOptions.forEach((function(e){t+=e.dropdownHTML})),t},a.prototype.setLgShareMarkup=function(){var t=this;this.core.$toolbar.append('<button type="button" aria-label="Share" aria-haspopup="true" aria-expanded="false" class="lg-share lg-icon">\n <ul class="lg-dropdown" style="position: absolute;"></ul></button>'),this.core.$lgContent.append('<div class="lg-dropdown-overlay"></div>'),this.core.outer.find(".lg-share").first().on("click.lg",(function(){t.core.outer.toggleClass("lg-dropdown-active"),t.core.outer.hasClass("lg-dropdown-active")?t.core.outer.attr("aria-expanded",!0):t.core.outer.attr("aria-expanded",!1)})),this.core.outer.find(".lg-dropdown-overlay").first().on("click.lg",(function(){t.core.outer.removeClass("lg-dropdown-active"),t.core.outer.attr("aria-expanded",!1)}))},a.prototype.onAfterSlide=function(t){var e=this,r=t.detail.index,o=this.core.galleryItems[r];setTimeout((function(){e.shareOptions.forEach((function(t){var r=t.selector;e.core.outer.find(r).attr("href",t.generateLink(o))}))}),100)},a.prototype.getShareListItemHTML=function(t,e){return'<li><a class="lg-share-'+t+'" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">'+e+"</span></a></li>"},a.prototype.getDefaultShareOptions=function(){return e(this.settings.facebook?[{type:"facebook",generateLink:o,dropdownHTML:this.getShareListItemHTML("facebook",this.settings.facebookDropdownText),selector:".lg-share-facebook"}]:[],this.settings.twitter?[{type:"twitter",generateLink:n,dropdownHTML:this.getShareListItemHTML("twitter",this.settings.twitterDropdownText),selector:".lg-share-twitter"}]:[],this.settings.pinterest?[{type:"pinterest",generateLink:i,dropdownHTML:this.getShareListItemHTML("pinterest",this.settings.pinterestDropdownText),selector:".lg-share-pinterest"}]:[])},a.prototype.destroy=function(){this.core.outer.find(".lg-dropdown-overlay").remove(),this.core.outer.find(".lg-share").remove(),this.core.LGel.off(".lg.share"),this.core.LGel.off(".share")},a}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgShare = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgShare = factory());
}(this, (function () { 'use strict';

@@ -111,2 +111,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -113,0 +117,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -76,2 +76,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -78,0 +82,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgThumbnail=e()}(this,function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var h in e=arguments[i])Object.prototype.hasOwnProperty.call(e,h)&&(t[h]=e[h]);return t}).apply(this,arguments)},e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1},s="lgContainerResize",h="lgUpdateSlides",n="lgBeforeOpen",o="lgBeforeSlide";function i(t,e){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=t,this.$LG=e,this}return i.prototype.init=function(){this.settings=t(t({},e),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},i.prototype.build=function(){var i=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(t){var e=i.$LG(t.target);e.hasAttribute("data-lg-item-id")&&setTimeout(function(){var t;i.thumbClickable&&!i.core.lgBusy&&(t=parseInt(e.attr("data-lg-item-id")),i.core.slide(t,!1,!0,!1))},50)}),this.core.LGel.on(o+".thumb",function(t){t=t.detail.index;i.animateThumb(t)}),this.core.LGel.on(n+".thumb",function(){i.thumbOuterWidth=i.core.outer.get().offsetWidth}),this.core.LGel.on(h+".thumb",function(){i.rebuildThumbnails()}),this.core.LGel.on(s+".thumb",function(){i.core.lgOpened&&setTimeout(function(){i.thumbOuterWidth=i.core.outer.get().offsetWidth,i.animateThumb(i.core.index),i.thumbOuterWidth=i.core.outer.get().offsetWidth},50)})},i.prototype.setThumbMarkup=function(){var t="lg-thumb-outer ";this.settings.alignThumbnails&&(t+="lg-thumb-align-"+this.settings.alignThumbnails);t='<div class="'+t+'">\n <div class="lg-thumb lg-group">\n </div>\n </div>';this.core.outer.addClass("lg-has-thumb"),(".lg-components"===this.settings.appendThumbnailsTo?this.core.$lgComponents:this.core.outer).append(t),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},i.prototype.enableThumbDrag=function(){var e=this,i={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},s=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(t){e.thumbTotalWidth>e.thumbOuterWidth&&(t.preventDefault(),i.cords.startX=t.pageX,i.startTime=new Date,e.thumbClickable=!1,s=!0,e.core.outer.get().scrollLeft+=1,--e.core.outer.get().scrollLeft,e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(t){e.core.lgOpened&&s&&(i.cords.endX=t.pageX,i=e.onThumbTouchMove(i))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){e.core.lgOpened&&(i.isMoved?i=e.onThumbTouchEnd(i):e.thumbClickable=!0,s&&(s=!1,e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},i.prototype.enableThumbSwipe=function(){var e=this,i={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(t){e.thumbTotalWidth>e.thumbOuterWidth&&(t.preventDefault(),i.cords.startX=t.targetTouches[0].pageX,e.thumbClickable=!1,i.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(t){e.thumbTotalWidth>e.thumbOuterWidth&&(t.preventDefault(),i.cords.endX=t.targetTouches[0].pageX,i=e.onThumbTouchMove(i))}),this.$lgThumb.on("touchend.lg",function(){i.isMoved?i=e.onThumbTouchEnd(i):e.thumbClickable=!0})},i.prototype.rebuildThumbnails=function(){var t=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){t.thumbTotalWidth=t.core.galleryItems.length*(t.settings.thumbWidth+t.settings.thumbMargin),t.$lgThumb.css("width",t.thumbTotalWidth+"px"),t.$lgThumb.empty(),t.setThumbItemHtml(t.core.galleryItems),t.animateThumb(t.core.index)},50),setTimeout(function(){t.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},i.prototype.setTranslate=function(t){this.$lgThumb.css("transform","translate3d(-"+t+"px, 0px, 0px)")},i.prototype.getPossibleTransformX=function(t){return t>this.thumbTotalWidth-this.thumbOuterWidth&&(t=this.thumbTotalWidth-this.thumbOuterWidth),t<0&&(t=0),t},i.prototype.animateThumb=function(t){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var e=0;switch(this.settings.currentPagerPosition){case"left":e=0;break;case"middle":e=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":e=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*t-1-e,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},i.prototype.onThumbTouchMove=function(t){return t.newTranslateX=this.translateX,t.isMoved=!0,t.touchMoveTime=(new Date).valueOf(),t.newTranslateX-=t.cords.endX-t.cords.startX,t.newTranslateX=this.getPossibleTransformX(t.newTranslateX),this.setTranslate(t.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),t},i.prototype.onThumbTouchEnd=function(t){t.isMoved=!1,t.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var e=t.endTime.valueOf()-t.startTime.valueOf(),i=t.cords.endX-t.cords.startX,e=Math.abs(i)/e;return.15<e&&t.endTime.valueOf()-t.touchMoveTime<30?(2<(e+=1)&&(e+=1),e+=e*(Math.abs(i)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(e-1,2)+"settings"),i*=e,this.translateX=this.getPossibleTransformX(this.translateX-i),this.setTranslate(this.translateX)):this.translateX=t.newTranslateX,Math.abs(t.cords.endX-t.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),t},i.prototype.getThumbHtml=function(t,e){var i=this.core.galleryItems[e].__slideVideoInfo||{},t=i.youtube&&this.settings.loadYouTubeThumbnail?"//img.youtube.com/vi/"+i.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":t;return'<div data-lg-item-id="'+e+'" class="lg-thumb-item '+(e===this.core.index?" active":"")+'" \n style="width:'+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+";\n margin-right: "+this.settings.thumbMargin+'px;">\n <img data-lg-item-id="'+e+'" src="'+t+'" />\n </div>'},i.prototype.getThumbItemHtml=function(t){for(var e="",i=0;i<t.length;i++)e+=this.getThumbHtml(t[i].thumb,i);return e},i.prototype.setThumbItemHtml=function(t){t=this.getThumbItemHtml(t);this.$lgThumb.html(t)},i.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},i.prototype.manageActiveClassOnSlideChange=function(){var i=this;this.core.LGel.on(o+".thumb",function(t){var e=i.core.outer.find(".lg-thumb-item"),t=t.detail.index;e.removeClass("active"),e.eq(t).addClass("active")})},i.prototype.toggleThumbBar=function(){var t=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="Toggle thumbnails" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){t.core.outer.toggleClass("lg-components-open")}))},i.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(t){e.core.lgOpened&&e.settings.toggleThumb&&(38===t.keyCode?(t.preventDefault(),e.core.outer.addClass("lg-components-open")):40===t.keyCode&&(t.preventDefault(),e.core.outer.removeClass("lg-components-open")))})},i.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},i});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgThumbnail=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var h in e=arguments[i])Object.prototype.hasOwnProperty.call(e,h)&&(t[h]=e[h]);return t}).apply(this,arguments)},e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1},i="lgContainerResize",s="lgUpdateSlides",h="lgBeforeOpen",n="lgBeforeSlide";return function(){function o(t,e){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=t,this.$LG=e,this}return o.prototype.init=function(){this.settings=t(t({},e),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},o.prototype.build=function(){var t=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",(function(e){var i=t.$LG(e.target);i.hasAttribute("data-lg-item-id")&&setTimeout((function(){if(t.thumbClickable&&!t.core.lgBusy){var e=parseInt(i.attr("data-lg-item-id"));t.core.slide(e,!1,!0,!1)}}),50)})),this.core.LGel.on(n+".thumb",(function(e){var i=e.detail.index;t.animateThumb(i)})),this.core.LGel.on(h+".thumb",(function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth})),this.core.LGel.on(s+".thumb",(function(){t.rebuildThumbnails()})),this.core.LGel.on(i+".thumb",(function(){t.core.lgOpened&&setTimeout((function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth,t.animateThumb(t.core.index),t.thumbOuterWidth=t.core.outer.get().offsetWidth}),50)}))},o.prototype.setThumbMarkup=function(){var t="lg-thumb-outer ";this.settings.alignThumbnails&&(t+="lg-thumb-align-"+this.settings.alignThumbnails);var e='<div class="'+t+'">\n <div class="lg-thumb lg-group">\n </div>\n </div>';this.core.outer.addClass("lg-has-thumb"),".lg-components"===this.settings.appendThumbnailsTo?this.core.$lgComponents.append(e):this.core.outer.append(e),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},o.prototype.enableThumbDrag=function(){var t=this,e={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},i=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",(function(s){t.thumbTotalWidth>t.thumbOuterWidth&&(s.preventDefault(),e.cords.startX=s.pageX,e.startTime=new Date,t.thumbClickable=!1,i=!0,t.core.outer.get().scrollLeft+=1,t.core.outer.get().scrollLeft-=1,t.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))})),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,(function(s){t.core.lgOpened&&i&&(e.cords.endX=s.pageX,e=t.onThumbTouchMove(e))})),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,(function(){t.core.lgOpened&&(e.isMoved?e=t.onThumbTouchEnd(e):t.thumbClickable=!0,i&&(i=!1,t.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))}))},o.prototype.enableThumbSwipe=function(){var t=this,e={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",(function(i){t.thumbTotalWidth>t.thumbOuterWidth&&(i.preventDefault(),e.cords.startX=i.targetTouches[0].pageX,t.thumbClickable=!1,e.startTime=new Date)})),this.$lgThumb.on("touchmove.lg",(function(i){t.thumbTotalWidth>t.thumbOuterWidth&&(i.preventDefault(),e.cords.endX=i.targetTouches[0].pageX,e=t.onThumbTouchMove(e))})),this.$lgThumb.on("touchend.lg",(function(){e.isMoved?e=t.onThumbTouchEnd(e):t.thumbClickable=!0}))},o.prototype.rebuildThumbnails=function(){var t=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout((function(){t.thumbTotalWidth=t.core.galleryItems.length*(t.settings.thumbWidth+t.settings.thumbMargin),t.$lgThumb.css("width",t.thumbTotalWidth+"px"),t.$lgThumb.empty(),t.setThumbItemHtml(t.core.galleryItems),t.animateThumb(t.core.index)}),50),setTimeout((function(){t.$thumbOuter.removeClass("lg-rebuilding-thumbnails")}),200)},o.prototype.setTranslate=function(t){this.$lgThumb.css("transform","translate3d(-"+t+"px, 0px, 0px)")},o.prototype.getPossibleTransformX=function(t){return t>this.thumbTotalWidth-this.thumbOuterWidth&&(t=this.thumbTotalWidth-this.thumbOuterWidth),t<0&&(t=0),t},o.prototype.animateThumb=function(t){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var e=0;switch(this.settings.currentPagerPosition){case"left":e=0;break;case"middle":e=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":e=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*t-1-e,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},o.prototype.onThumbTouchMove=function(t){return t.newTranslateX=this.translateX,t.isMoved=!0,t.touchMoveTime=(new Date).valueOf(),t.newTranslateX-=t.cords.endX-t.cords.startX,t.newTranslateX=this.getPossibleTransformX(t.newTranslateX),this.setTranslate(t.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),t},o.prototype.onThumbTouchEnd=function(t){t.isMoved=!1,t.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var e=t.endTime.valueOf()-t.startTime.valueOf(),i=t.cords.endX-t.cords.startX,s=Math.abs(i)/e;return s>.15&&t.endTime.valueOf()-t.touchMoveTime<30?((s+=1)>2&&(s+=1),s+=s*(Math.abs(i)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),i*=s,this.translateX=this.getPossibleTransformX(this.translateX-i),this.setTranslate(this.translateX)):this.translateX=t.newTranslateX,Math.abs(t.cords.endX-t.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),t},o.prototype.getThumbHtml=function(t,e){var i,s=this.core.galleryItems[e].__slideVideoInfo||{};return i=s.youtube&&this.settings.loadYouTubeThumbnail?"//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":t,'<div data-lg-item-id="'+e+'" class="lg-thumb-item '+(e===this.core.index?" active":"")+'" \n style="width:'+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+";\n margin-right: "+this.settings.thumbMargin+'px;">\n <img data-lg-item-id="'+e+'" src="'+i+'" />\n </div>'},o.prototype.getThumbItemHtml=function(t){for(var e="",i=0;i<t.length;i++)e+=this.getThumbHtml(t[i].thumb,i);return e},o.prototype.setThumbItemHtml=function(t){var e=this.getThumbItemHtml(t);this.$lgThumb.html(e)},o.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},o.prototype.manageActiveClassOnSlideChange=function(){var t=this;this.core.LGel.on(n+".thumb",(function(e){var i=t.core.outer.find(".lg-thumb-item"),s=e.detail.index;i.removeClass("active"),i.eq(s).addClass("active")}))},o.prototype.toggleThumbBar=function(){var t=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="Toggle thumbnails" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",(function(){t.core.outer.toggleClass("lg-components-open")})))},o.prototype.thumbKeyPress=function(){var t=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,(function(e){t.core.lgOpened&&t.settings.toggleThumb&&(38===e.keyCode?(e.preventDefault(),t.core.outer.addClass("lg-components-open")):40===e.keyCode&&(e.preventDefault(),t.core.outer.removeClass("lg-components-open")))}))},o.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},o}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgThumbnail = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgThumbnail = factory());
}(this, (function () { 'use strict';

@@ -83,2 +83,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -85,0 +89,0 @@

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -70,2 +70,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -72,0 +76,0 @@

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):e.lgVideo=o()}(this,function(){"use strict";var o=function(){return(o=Object.assign||function(e){for(var o,i=1,t=arguments.length;i<t;i++)for(var s in o=arguments[i])Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s]);return e}).apply(this,arguments)},i={autoplayFirstVideo:!0,youTubePlayerParams:!1,vimeoPlayerParams:!1,wistiaPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsOptions:{}},e="lgHasVideo",t="lgBeforeSlide",s="lgAfterSlide",l="lgPosterClick";function g(o){return Object.keys(o).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(o[e])}).join("&")}function n(e){return this.core=e,this.settings=o(o({},i),this.core.settings),this}return n.prototype.init=function(){var o=this;this.core.LGel.on(e+".video",this.onHasVideo.bind(this)),this.core.settings.enableSwipe||this.core.settings.enableDrag?this.core.LGel.on(l+".video",function(){var e=o.core.getSlideItem(o.core.index);o.loadVideoOnPosterClick(e)}):this.core.outer.find(".lg-item").first().on("click.lg",function(){var e=o.core.getSlideItem(o.core.index);o.loadVideoOnPosterClick(e)}),this.core.LGel.on(t+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(s+".video",this.onAfterSlide.bind(this))},n.prototype.onHasVideo=function(e){var o=e.detail,i=o.index,t=o.src,s=o.html5Video,e=o.hasPoster,o=o.isFirstSlide;e||(this.appendVideos(this.core.getSlideItem(i),{src:t,addClass:"lg-object",index:i,html5Video:s}),this.gotoNextSlideOnVideoEnd(t,i)),this.settings.autoplayFirstVideo&&o&&(e?(e=this.core.getSlideItem(i),this.loadVideoOnPosterClick(e)):this.playVideo(i))},n.prototype.onBeforeSlide=function(e){var o=e.detail,e=o.prevIndex,o=o.index;this.pauseVideo(e);o=this.core.galleryItems[o].__slideVideoInfo||{};(o.youtube||o.vimeo||o.wistia)&&this.core.outer.addClass("lg-hide-download")},n.prototype.onAfterSlide=function(e){var o=this,i=e.detail.index;this.settings.autoplayVideoOnSlide&&this.core.lGalleryOn&&setTimeout(function(){var e=o.core.getSlideItem(i);e.hasClass("lg-video-loaded")?o.playVideo(i):o.loadVideoOnPosterClick(e)},100)},n.prototype.playVideo=function(e){this.controlVideo(e,"play")},n.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},n.prototype.getVideoHtml=function(e,o,i,t){var s="",l=this.core.galleryItems[i].__slideVideoInfo||{},n=this.core.galleryItems[i],r=(r=n.title||n.alt)?'title="'+r+'"':"",n='allowtransparency="true" \n frameborder="0" \n scrolling="no" \n allowfullscreen \n mozallowfullscreen \n webkitallowfullscreen \n oallowfullscreen \n msallowfullscreen';if(l.youtube)var d="lg-youtube"+i,a="?wmode=opaque&autoplay=0&enablejsapi=1"+(this.settings.youTubePlayerParams?"&"+g(this.settings.youTubePlayerParams):""),s='<iframe allow="autoplay" id='+d+' class="lg-video-object lg-youtube '+o+'" '+r+' src="//www.youtube.com/embed/'+(l.youtube[1]+a)+'" '+n+"></iframe>";else if(l.vimeo){d="lg-vimeo"+i,a=g(this.settings.vimeoPlayerParams);s='<iframe allow="autoplay" id='+d+' class="lg-video-object lg-vimeo '+o+'" '+r+' src="//player.vimeo.com/video/'+(l.vimeo[1]+a)+'" '+n+"></iframe>"}else if(l.wistia){i="lg-wistia"+i,a=g(this.settings.wistiaPlayerParams);s='<iframe allow="autoplay" id="'+i+'" src="//fast.wistia.net/embed/iframe/'+(l.wistia[4]+a)+'" '+r+' class="wistia_embed lg-video-object lg-wistia '+o+'" name="wistia_embed" '+n+"></iframe>"}else if(l.html5){for(var c="",u=0;u<t.source.length;u++)c+='<source src="'+t.source[u].src+'" type="'+t.source[u].type+'">';var f="",h=t.attributes||{};Object.keys(h||{}).forEach(function(e){f+=e+'="'+h[e]+'" '}),s='<video class="lg-video-object lg-html5 '+(this.settings.videojs?"video-js":"")+'" '+f+">\n "+c+"\n Your browser does not support HTML5 video.\n </video>"}return s},n.prototype.appendVideos=function(e,o){var i,t=this.getVideoHtml(o.src,o.addClass,o.index,o.html5Video);e.find(".lg-video-cont").append(t);var s=e.find(".lg-video-object").first();if(this.settings.videojs&&null!==(i=this.core.galleryItems[o.index].__slideVideoInfo)&&void 0!==i&&i.html5)try{return videojs(s.get(),this.settings.videojsOptions)}catch(e){console.error("lightGallery:- Make sure you have included videojs")}},n.prototype.gotoNextSlideOnVideoEnd=function(e,o){var i=this,t=this.core.getSlideItem(o).find(".lg-video-object").first(),o=this.core.galleryItems[o].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(o.html5)t.on("ended",function(){i.core.goToNextSlide()});else if(o.vimeo)try{new Vimeo.Player(t.get()).on("ended",function(){i.core.goToNextSlide()})}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(o.wistia)try{window._wq=window._wq||[],window._wq.push({id:t.attr("id"),onReady:function(e){e.bind("end",function(){i.core.goToNextSlide()})}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},n.prototype.controlVideo=function(e,o){var i=this.core.getSlideItem(e).find(".lg-video-object").first(),e=this.core.galleryItems[e].__slideVideoInfo||{};if(i.get())if(e.youtube)try{i.get().contentWindow.postMessage('{"event":"command","func":"'+o+'Video","args":""}',"*")}catch(e){console.error("lightGallery:- "+e)}else if(e.vimeo)try{new Vimeo.Player(i.get())[o]()}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(e.html5)if(this.settings.videojs)try{videojs(i.get())[o]()}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else i.get()[o]();else if(e.wistia)try{window._wq=window._wq||[],window._wq.push({id:i.attr("id"),onReady:function(e){e[o]()}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},n.prototype.loadVideoOnPosterClick=function(e){var o,i,t,s,l=this;e.hasClass("lg-video-loaded")||(e.hasClass("lg-has-video")?this.playVideo(this.core.index):(e.addClass("lg-has-video"),o=void 0,s=this.core.galleryItems[this.core.index].src,(i=this.core.galleryItems[this.core.index].video)&&(o="string"==typeof i?JSON.parse(i):i),t=this.appendVideos(e,{src:s,addClass:"",index:this.core.index,html5Video:o}),this.gotoNextSlideOnVideoEnd(s,this.core.index),s=e.find(".lg-object").first().get(),e.find(".lg-video-cont").first().append(s),e.addClass("lg-video-loading"),t&&t.ready(function(){t.on("loadedmetadata",function(){l.onVideoLoadAfterPosterClick(e,l.core.index)})}),e.find(".lg-video-object").first().on("load.lg error.lg loadeddata.lg",function(){setTimeout(function(){l.onVideoLoadAfterPosterClick(e,l.core.index)},50)})))},n.prototype.onVideoLoadAfterPosterClick=function(e,o){e.addClass("lg-video-loaded"),this.playVideo(o)},n.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},n});
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).lgVideo=o()}(this,(function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var o,i=1,t=arguments.length;i<t;i++)for(var s in o=arguments[i])Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s]);return e}).apply(this,arguments)},o={autoplayFirstVideo:!0,youTubePlayerParams:!1,vimeoPlayerParams:!1,wistiaPlayerParams:!1,gotoNextSlideOnVideoEnd:!0,autoplayVideoOnSlide:!1,videojs:!1,videojsOptions:{}},i="lgHasVideo",t="lgBeforeSlide",s="lgAfterSlide",l="lgPosterClick";function r(e){return Object.keys(e).map((function(o){return encodeURIComponent(o)+"="+encodeURIComponent(e[o])})).join("&")}return function(){function n(i){return this.core=i,this.settings=e(e({},o),this.core.settings),this}return n.prototype.init=function(){var e=this;this.core.LGel.on(i+".video",this.onHasVideo.bind(this)),this.core.settings.enableSwipe||this.core.settings.enableDrag?this.core.LGel.on(l+".video",(function(){var o=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(o)})):this.core.outer.find(".lg-item").first().on("click.lg",(function(){var o=e.core.getSlideItem(e.core.index);e.loadVideoOnPosterClick(o)})),this.core.LGel.on(t+".video",this.onBeforeSlide.bind(this)),this.core.LGel.on(s+".video",this.onAfterSlide.bind(this))},n.prototype.onHasVideo=function(e){var o=e.detail,i=o.index,t=o.src,s=o.html5Video,l=o.hasPoster,r=o.isFirstSlide;if(l||(this.appendVideos(this.core.getSlideItem(i),{src:t,addClass:"lg-object",index:i,html5Video:s}),this.gotoNextSlideOnVideoEnd(t,i)),this.settings.autoplayFirstVideo&&r)if(l){var n=this.core.getSlideItem(i);this.loadVideoOnPosterClick(n)}else this.playVideo(i)},n.prototype.onBeforeSlide=function(e){var o=e.detail,i=o.prevIndex,t=o.index;this.pauseVideo(i);var s=this.core.galleryItems[t].__slideVideoInfo||{};(s.youtube||s.vimeo||s.wistia)&&this.core.outer.addClass("lg-hide-download")},n.prototype.onAfterSlide=function(e){var o=this,i=e.detail.index;this.settings.autoplayVideoOnSlide&&this.core.lGalleryOn&&setTimeout((function(){var e=o.core.getSlideItem(i);e.hasClass("lg-video-loaded")?o.playVideo(i):o.loadVideoOnPosterClick(e)}),100)},n.prototype.playVideo=function(e){this.controlVideo(e,"play")},n.prototype.pauseVideo=function(e){this.controlVideo(e,"pause")},n.prototype.getVideoHtml=function(e,o,i,t){var s="",l=this.core.galleryItems[i].__slideVideoInfo||{},n=this.core.galleryItems[i],d=n.title||n.alt;d=d?'title="'+d+'"':"";var a='allowtransparency="true" \n frameborder="0" \n scrolling="no" \n allowfullscreen \n mozallowfullscreen \n webkitallowfullscreen \n oallowfullscreen \n msallowfullscreen';if(l.youtube){var c="lg-youtube"+i,u="?wmode=opaque&autoplay=0&enablejsapi=1"+(this.settings.youTubePlayerParams?"&"+r(this.settings.youTubePlayerParams):"");s='<iframe allow="autoplay" id='+c+' class="lg-video-object lg-youtube '+o+'" '+d+' src="//www.youtube.com/embed/'+(l.youtube[1]+u)+'" '+a+"></iframe>"}else if(l.vimeo){c="lg-vimeo"+i,u=r(this.settings.vimeoPlayerParams);s='<iframe allow="autoplay" id='+c+' class="lg-video-object lg-vimeo '+o+'" '+d+' src="//player.vimeo.com/video/'+(l.vimeo[1]+u)+'" '+a+"></iframe>"}else if(l.wistia){var f="lg-wistia"+i;u=r(this.settings.wistiaPlayerParams);s='<iframe allow="autoplay" id="'+f+'" src="//fast.wistia.net/embed/iframe/'+(l.wistia[4]+u)+'" '+d+' class="wistia_embed lg-video-object lg-wistia '+o+'" name="wistia_embed" '+a+"></iframe>"}else if(l.html5){for(var h="",g=0;g<t.source.length;g++)h+='<source src="'+t.source[g].src+'" type="'+t.source[g].type+'">';var y="",v=t.attributes||{};Object.keys(v||{}).forEach((function(e){y+=e+'="'+v[e]+'" '})),s='<video class="lg-video-object lg-html5 '+(this.settings.videojs?"video-js":"")+'" '+y+">\n "+h+"\n Your browser does not support HTML5 video.\n </video>"}return s},n.prototype.appendVideos=function(e,o){var i,t=this.getVideoHtml(o.src,o.addClass,o.index,o.html5Video);e.find(".lg-video-cont").append(t);var s=e.find(".lg-video-object").first();if(this.settings.videojs&&(null===(i=this.core.galleryItems[o.index].__slideVideoInfo)||void 0===i?void 0:i.html5))try{return videojs(s.get(),this.settings.videojsOptions)}catch(e){console.error("lightGallery:- Make sure you have included videojs")}},n.prototype.gotoNextSlideOnVideoEnd=function(e,o){var i=this,t=this.core.getSlideItem(o).find(".lg-video-object").first(),s=this.core.galleryItems[o].__slideVideoInfo||{};if(this.settings.gotoNextSlideOnVideoEnd)if(s.html5)t.on("ended",(function(){i.core.goToNextSlide()}));else if(s.vimeo)try{new Vimeo.Player(t.get()).on("ended",(function(){i.core.goToNextSlide()}))}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(s.wistia)try{window._wq=window._wq||[],window._wq.push({id:t.attr("id"),onReady:function(e){e.bind("end",(function(){i.core.goToNextSlide()}))}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},n.prototype.controlVideo=function(e,o){var i=this.core.getSlideItem(e).find(".lg-video-object").first(),t=this.core.galleryItems[e].__slideVideoInfo||{};if(i.get())if(t.youtube)try{i.get().contentWindow.postMessage('{"event":"command","func":"'+o+'Video","args":""}',"*")}catch(e){console.error("lightGallery:- "+e)}else if(t.vimeo)try{new Vimeo.Player(i.get())[o]()}catch(e){console.error("lightGallery:- Make sure you have included //github.com/vimeo/player.js")}else if(t.html5)if(this.settings.videojs)try{videojs(i.get())[o]()}catch(e){console.error("lightGallery:- Make sure you have included videojs")}else i.get()[o]();else if(t.wistia)try{window._wq=window._wq||[],window._wq.push({id:i.attr("id"),onReady:function(e){e[o]()}})}catch(e){console.error("lightGallery:- Make sure you have included //fast.wistia.com/assets/external/E-v1.js")}},n.prototype.loadVideoOnPosterClick=function(e){var o=this;if(!e.hasClass("lg-video-loaded"))if(e.hasClass("lg-has-video"))this.playVideo(this.core.index);else{e.addClass("lg-has-video");var i=void 0,t=this.core.galleryItems[this.core.index].src,s=this.core.galleryItems[this.core.index].video;s&&(i="string"==typeof s?JSON.parse(s):s);var l=this.appendVideos(e,{src:t,addClass:"",index:this.core.index,html5Video:i});this.gotoNextSlideOnVideoEnd(t,this.core.index);var r=e.find(".lg-object").first().get();e.find(".lg-video-cont").first().append(r),e.addClass("lg-video-loading"),l&&l.ready((function(){l.on("loadedmetadata",(function(){o.onVideoLoadAfterPosterClick(e,o.core.index)}))})),e.find(".lg-video-object").first().on("load.lg error.lg loadeddata.lg",(function(){setTimeout((function(){o.onVideoLoadAfterPosterClick(e,o.core.index)}),50)}))}},n.prototype.onVideoLoadAfterPosterClick=function(e,o){e.addClass("lg-video-loaded"),this.playVideo(o)},n.prototype.destroy=function(){this.core.LGel.off(".lg.video"),this.core.LGel.off(".video")},n}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgVideo = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgVideo = factory());
}(this, (function () { 'use strict';

@@ -77,2 +77,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -79,0 +83,0 @@

@@ -7,2 +7,6 @@ import { LgQuery, lgQuery } from '../../lgQuery';

}
interface DragAllowedAxises {
allowX: boolean;
allowY: boolean;
}
interface ZoomTouchEvent {

@@ -31,2 +35,12 @@ pageX: number;

scale: number;
imageYSize: number;
imageXSize: number;
containerRect: ClientRect;
rotateValue: number;
modifierX: number;
modifierY: number;
dragAllowedAxises: DragAllowedAxises;
top: number;
left: number;
scrollTop: number;
constructor(instance: LightGallery, $LG: LgQuery);

@@ -43,9 +57,6 @@ buildTemplates(): void;

getModifier(rotateValue: number, axis: string, el: HTMLElement): number;
getImageSize($image: HTMLImageElement, rotateValue: number, axis: string): any;
getImageSize($image: HTMLImageElement, rotateValue: number, axis: string): number;
getDragCords(e: MouseEvent, rotateValue: number): Coords;
getSwipeCords(e: TouchEvent, rotateValue: number): Coords;
getDragAllowedAxises($image: lgQuery, rotateValue: number): {
allowX: boolean;
allowY: boolean;
};
getDragAllowedAxises(rotateValue: number, scale?: number): DragAllowedAxises;
/**

@@ -59,2 +70,3 @@ *

getCurrentRotation(el: HTMLElement): number;
setZoomEssentials(): void;
/**

@@ -94,4 +106,8 @@ * @desc Image zoom

touchendZoom(startCoords: Coords, endCoords: Coords, allowX: boolean, allowY: boolean, touchDuration: number, rotateValue: number): void;
getZoomSwipeCords(startCoords: Coords, endCoords: Coords, allowX: any, allowY: any, possibleSwipeCords: PossibleCords, dataY: number, dataX: number, rotateValue: number, rotateEl: HTMLElement): Coords;
getPossibleSwipeDragCords($image: lgQuery, rotateValue: number): PossibleCords;
getZoomSwipeCords(startCoords: Coords, endCoords: Coords, allowX: boolean, allowY: boolean, possibleSwipeCords: PossibleCords): Coords;
private isBeyondPossibleLeft;
private isBeyondPossibleRight;
private isBeyondPossibleTop;
private isBeyondPossibleBottom;
getPossibleSwipeDragCords(rotateValue: number, scale?: number): PossibleCords;
setZoomSwipeStyles(LGel: lgQuery, distance: {

@@ -98,0 +114,0 @@ x: number;

/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -71,2 +71,6 @@ * Copyright (c) 2020 Sachin Neravath;

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -115,2 +119,3 @@

_this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');
_this.setZoomEssentials();
}, _speed + 30);

@@ -165,3 +170,3 @@ };

};
if (rotateValue === 90) {
if (Math.abs(rotateValue) === 90) {
// Swap axis

@@ -207,10 +212,6 @@ if (axis === 'x') {

};
Zoom.prototype.getDragAllowedAxises = function ($image, rotateValue) {
var $lg = this.core.$lgContent.get();
var scale = parseFloat($image.attr('data-scale')) || 1;
var imgEl = $image.get();
var allowY = this.getImageSize(imgEl, rotateValue, 'y') * scale >
$lg.clientHeight;
var allowX = this.getImageSize(imgEl, rotateValue, 'x') * scale >
$lg.clientWidth;
Zoom.prototype.getDragAllowedAxises = function (rotateValue, scale) {
scale = scale || this.scale || 1;
var allowY = this.imageYSize * scale > this.containerRect.height;
var allowX = this.imageXSize * scale > this.containerRect.width;
if (rotateValue === 90) {

@@ -264,2 +265,19 @@ return {

};
Zoom.prototype.setZoomEssentials = function () {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
this.rotateValue = this.getCurrentRotation(rotateEl);
this.imageYSize = this.getImageSize($image.get(), this.rotateValue, 'y');
this.imageXSize = this.getImageSize($image.get(), this.rotateValue, 'x');
this.containerRect = this.core.outer.get().getBoundingClientRect();
this.modifierX = this.getModifier(this.rotateValue, 'X', rotateEl);
this.modifierY = this.getModifier(this.rotateValue, 'Y', rotateEl);
};
/**

@@ -272,16 +290,13 @@ * @desc Image zoom

Zoom.prototype.zoomImage = function (scale) {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var imageNode = $image.get();
if (!imageNode)
return;
var containerRect = this.core.outer.get().getBoundingClientRect();
// Find offset manually to avoid issue after zoom
var offsetX = (containerRect.width - imageNode.offsetWidth) / 2 +
containerRect.left;
var offsetY = (containerRect.height - imageNode.offsetHeight) / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
var offsetX = (this.containerRect.width - this.imageXSize) / 2 +
this.containerRect.left;
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var offsetY = (this.containerRect.height -
this.imageYSize -
topBottomSpacing * this.modifierX) /
2 +
this.scrollTop +
this.containerRect.top;
var originalX;

@@ -292,17 +307,54 @@ var originalY;

}
var dragAllowedAxises = this.getDragAllowedAxises(Math.abs(this.rotateValue), scale);
var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;
if (this.positionChanged) {
originalX =
parseFloat($image.parent().attr('data-x')) /
(parseFloat($image.attr('data-scale')) - 1);
originalY =
parseFloat($image.parent().attr('data-y')) /
(parseFloat($image.attr('data-scale')) - 1);
this.pageX = originalX + offsetX;
this.pageY = originalY + offsetY;
originalX = this.left / (this.scale - 1);
originalY = this.top / (this.scale - 1);
this.pageX = Math.abs(originalX) + offsetX;
this.pageY = Math.abs(originalY) + offsetY;
this.positionChanged = false;
}
var _x = this.pageX - offsetX;
var _y = this.pageY - offsetY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(this.rotateValue, scale);
var _x = offsetX - this.pageX;
var _y = offsetY - this.pageY;
var x = (scale - 1) * _x;
var y = (scale - 1) * _y;
if (allowX) {
if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {
x = possibleSwipeCords.minX;
}
else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {
x = possibleSwipeCords.maxX;
}
}
else {
if (scale > 1) {
if (x < possibleSwipeCords.minX) {
x = possibleSwipeCords.minX;
}
else if (x > possibleSwipeCords.maxX) {
x = possibleSwipeCords.maxX;
}
}
}
if (allowY) {
if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {
y = possibleSwipeCords.minY;
}
else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {
y = possibleSwipeCords.maxY;
}
}
else {
// If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out
if (scale > 1) {
//If image goes beyond viewport top, use the minim possible translate value
if (y < possibleSwipeCords.minY) {
y = possibleSwipeCords.minY;
}
else if (y > possibleSwipeCords.maxY) {
y = possibleSwipeCords.maxY;
}
}
}
this.setZoomStyles({

@@ -327,9 +379,9 @@ x: x,

var $imageWrap = $image.parent();
$image
.attr('data-scale', style.scale + '')
.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
this.scale = style.scale;
$image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
$dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
var transform = 'translate3d(-' + style.x + 'px, -' + style.y + 'px, 0)';
var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';
$imageWrap.css('transform', transform);
$imageWrap.attr('data-x', style.x).attr('data-y', style.y);
this.left = style.x;
this.top = style.y;
};

@@ -400,5 +452,3 @@ /**

cords.y =
containerRect.height / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
containerRect.height / 2 + this.scrollTop + containerRect.top;
}

@@ -469,8 +519,15 @@ return cords;

// Update zoom on resize and orientationchange
this.core.LGel.on(lGEvents.containerResize + ".zoom", function () {
this.core.LGel.on(lGEvents.containerResize + ".zoom " + lGEvents.rotateRight + ".zoom " + lGEvents.rotateLeft + ".zoom " + lGEvents.flipHorizontal + ".zoom " + lGEvents.flipVertical + ".zoom", function () {
if (!_this.core.lgOpened)
return;
_this.setPageCords();
_this.setZoomEssentials();
_this.zoomImage(_this.scale);
});
// Update zoom on resize and orientationchange
this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () {
if (!_this.core.lgOpened)
return;
_this.scrollTop = _this.$LG(window).scrollTop();
});
this.core.getElementById('lg-zoom-out').on('click.lg', function () {

@@ -493,2 +550,9 @@ if (_this.core.outer.find('.lg-current .lg-image').get()) {

});
this.core.LGel.on(lGEvents.afterOpen + ".zoom", function () {
_this.scrollTop = _this.$LG(window).scrollTop();
// Set the initial value center
_this.pageX = _this.core.outer.width() / 2;
_this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;
_this.scale = 1;
});
// Reset zoom on slide change

@@ -500,2 +564,3 @@ this.core.LGel.on(lGEvents.afterSlide + ".zoom", function (event) {

_this.resetZoom(prevIndex);
_this.setZoomEssentials();
});

@@ -509,7 +574,2 @@ // Drag option after zoom

this.positionChanged = false;
// Set the initial value center
this.pageX = this.core.outer.width() / 2;
this.pageY =
this.core.outer.height() / 2 + this.$LG(window).scrollTop();
this.scale = 1;
};

@@ -540,4 +600,7 @@ Zoom.prototype.zoomIn = function (scale) {

.addClass(this.settings.actualSizeIcons.zoomIn);
$item.find('.lg-img-wrap').first().removeAttr('style data-x data-y');
$item.find('.lg-image').first().removeAttr('style data-scale');
$item.find('.lg-img-wrap').first().removeAttr('style');
$item.find('.lg-image').first().removeAttr('style');
this.scale = 1;
this.left = 0;
this.top = 0;
// Reset pagx pagy values to center

@@ -562,2 +625,3 @@ this.setPageCords();

if (e.targetTouches.length === 2 &&
!_this.core.outer.hasClass('lg-first-slide-loading') &&
(_this.$LG(e.target).hasClass('lg-item') ||

@@ -607,7 +671,2 @@ $item.get().contains(e.target))) {

Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration, rotateValue) {
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
var distanceXnew = endCoords.x - startCoords.x;

@@ -629,46 +688,34 @@ var distanceYnew = endCoords.y - startCoords.y;

.first();
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-object')
.first();
var dataX = parseFloat(_LGel.attr('data-x')) || 0;
var dataY = parseFloat(_LGel.attr('data-y')) || 0;
var distance = {};
distance.x =
-Math.abs(dataX) +
distanceXnew * this.getModifier(rotateValue, 'X', rotateEl);
distance.y =
-Math.abs(dataY) +
distanceYnew * this.getModifier(rotateValue, 'Y', rotateEl);
var possibleSwipeCords = this.getPossibleSwipeDragCords($image, rotateValue);
distance.x = this.left + distanceXnew * this.modifierX;
distance.y = this.top + distanceYnew * this.modifierY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(rotateValue);
if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {
if (allowY) {
if (distance.y <= -possibleSwipeCords.maxY) {
distance.y = -possibleSwipeCords.maxY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
distance.y = possibleSwipeCords.minY;
}
else if (distance.y >= -possibleSwipeCords.minY) {
distance.y = -possibleSwipeCords.minY;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
distance.y = possibleSwipeCords.maxY;
}
}
if (allowX) {
if (distance.x <= -possibleSwipeCords.maxX) {
distance.x = -possibleSwipeCords.maxX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
distance.x = possibleSwipeCords.minX;
}
else if (distance.x >= -possibleSwipeCords.minX) {
distance.x = -possibleSwipeCords.minX;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
distance.x = possibleSwipeCords.maxX;
}
}
if (allowY) {
_LGel.attr('data-y', Math.abs(distance.y));
this.top = distance.y;
}
else {
var dataY_1 = parseFloat(_LGel.attr('data-y')) || 0;
distance.y = -Math.abs(dataY_1);
distance.y = this.top;
}
if (allowX) {
_LGel.attr('data-x', Math.abs(distance.x));
this.left = distance.x;
}
else {
var dataX_1 = parseFloat(_LGel.attr('data-x')) || 0;
distance.x = -Math.abs(dataX_1);
distance.x = this.left;
}

@@ -679,54 +726,66 @@ this.setZoomSwipeStyles(_LGel, distance);

};
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl) {
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {
var distance = {};
if (allowY) {
distance.y =
-Math.abs(dataY) +
(endCoords.y - startCoords.y) *
this.getModifier(rotateValue, 'Y', rotateEl);
if (distance.y <= -possibleSwipeCords.maxY) {
var diffMaxY = -possibleSwipeCords.maxY - distance.y;
distance.y = -possibleSwipeCords.maxY - diffMaxY / 6;
this.top + (endCoords.y - startCoords.y) * this.modifierY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
var diffMinY = possibleSwipeCords.minY - distance.y;
distance.y = possibleSwipeCords.minY - diffMinY / 6;
}
else if (distance.y >= -possibleSwipeCords.minY) {
var diffMinY = distance.y - -possibleSwipeCords.minY;
distance.y = -possibleSwipeCords.minY + diffMinY / 6;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
var diffMaxY = distance.y - possibleSwipeCords.maxY;
distance.y = possibleSwipeCords.maxY + diffMaxY / 6;
}
}
else {
distance.y = -Math.abs(dataY);
distance.y = this.top;
}
if (allowX) {
distance.x =
-Math.abs(dataX) +
(endCoords.x - startCoords.x) *
this.getModifier(rotateValue, 'X', rotateEl);
if (distance.x <= -possibleSwipeCords.maxX) {
var diffMaxX = -possibleSwipeCords.maxX - distance.x;
distance.x = -possibleSwipeCords.maxX - diffMaxX / 6;
this.left + (endCoords.x - startCoords.x) * this.modifierX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
var diffMinX = possibleSwipeCords.minX - distance.x;
distance.x = possibleSwipeCords.minX - diffMinX / 6;
}
else if (distance.x >= -possibleSwipeCords.minX) {
var diffMinX = distance.x - -possibleSwipeCords.minX;
distance.x = -possibleSwipeCords.minX + diffMinX / 6;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
var difMaxX = distance.x - possibleSwipeCords.maxX;
distance.x = possibleSwipeCords.maxX + difMaxX / 6;
}
}
else {
distance.x = -Math.abs(dataX);
distance.x = this.left;
}
return distance;
};
Zoom.prototype.getPossibleSwipeDragCords = function ($image, rotateValue) {
var $cont = this.core.$lgContent;
var contHeight = $cont.height();
var contWidth = $cont.width();
var imageYSize = this.getImageSize($image.get(), rotateValue, 'y');
var imageXSize = this.getImageSize($image.get(), rotateValue, 'x');
var dataY = parseFloat($image.attr('data-scale')) || 1;
var elDataScale = Math.abs(dataY);
var minY = (contHeight - imageYSize) / 2;
var maxY = Math.abs(imageYSize * elDataScale - contHeight + minY);
var minX = (contWidth - imageXSize) / 2;
var maxX = Math.abs(imageXSize * elDataScale - contWidth + minX);
if (rotateValue === 90) {
return {
Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {
return x >= minX;
};
Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {
return x <= maxX;
};
Zoom.prototype.isBeyondPossibleTop = function (y, minY) {
return y >= minY;
};
Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {
return y <= maxY;
};
Zoom.prototype.getPossibleSwipeDragCords = function (rotateValue, scale) {
var dataScale = scale || this.scale || 1;
var elDataScale = Math.abs(dataScale);
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var minY = (this.imageYSize - this.containerRect.height) / 2 +
topBottomSpacing * this.modifierX;
var maxY = this.containerRect.height - this.imageYSize * elDataScale + minY;
var minX = (this.imageXSize - this.containerRect.width) / 2;
var maxX = this.containerRect.width - this.imageXSize * elDataScale + minX;
var possibleSwipeCords = {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
if (Math.abs(rotateValue) === 90) {
possibleSwipeCords = {
minY: minX,

@@ -738,10 +797,3 @@ maxY: maxX,

}
else {
return {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
}
return possibleSwipeCords;
};

@@ -762,8 +814,4 @@ Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {

var endTime = new Date();
var dataX = 0;
var dataY = 0;
var possibleSwipeCords;
var _LGel;
var rotateEl = null;
var rotateValue = 0;
var $item = this.core.getSlideItem(this.core.index);

@@ -784,6 +832,2 @@ this.core.$inner.on('touchstart.lg', function (e) {

_this.core.touchAction = 'zoomSwipe';
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -793,17 +837,9 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.first()
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;
allowX = dragAllowedAxises.allowX;
if (allowX || allowY) {
startCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
startCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
}
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
// reset opacity and transition duration

@@ -820,4 +856,4 @@ _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');

_this.core.touchAction = 'zoomSwipe';
endCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
if (Math.abs(endCoords.x - startCoords.x) > 15 ||

@@ -842,3 +878,3 @@ Math.abs(endCoords.y - startCoords.y) > 15) {

var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -853,4 +889,2 @@ });

var isMoved = false;
var rotateEl = null;
var rotateValue = 0;
// Allow x direction drag

@@ -863,4 +897,2 @@ var allowX = false;

var possibleSwipeCords;
var dataY;
var dataX;
var _LGel;

@@ -877,7 +909,2 @@ this.core.outer.on('mousedown.lg.zoom', function (e) {

startTime = new Date();
// execute only on .lg-object
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -887,8 +914,3 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;

@@ -900,7 +922,5 @@ allowX = dragAllowedAxises.allowX;

e.preventDefault();
startCoords = _this.getDragCords(e, Math.abs(rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
startCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
isDragging = true;
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723

@@ -920,4 +940,4 @@ _this.core.outer.get().scrollLeft += 1;

isMoved = true;
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
_this.setZoomSwipeStyles(_LGel, distance);

@@ -935,5 +955,5 @@ }

startCoords.y !== endCoords.y)) {
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -940,0 +960,0 @@ isMoved = false;

/**
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -8,2 +8,2 @@ * Copyright (c) 2020 Sachin Neravath;

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.lgZoom=e()}(this,function(){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,o=1,a=arguments.length;o<a;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a={scale:1,zoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300},t="lgContainerResize",e="lgBeforeOpen",i="lgSlideItemLoad",s="lgAfterSlide";function r(t,e){return this.core=t,this.$LG=e,this.settings=o(o({},a),this.core.settings),this}return r.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="Zoom in" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="Zoom out" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="View actual size" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},r.prototype.enableZoom=function(t){var e=this,o=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?o=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){e.core.getSlideItem(t.detail.index).addClass("lg-zoomable")},o+30)},r.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(i+".zoom",this.enableZoom.bind(this))},r.prototype.getModifier=function(t,e,o){var a=t;t=Math.abs(t);var i=this.getCurrentTransform(o);if(!i)return 1;var s,o=1;return"X"===e?(s=Math.sign(parseFloat(i[0])),0===t||180===t?o=1:90===t&&(o=-90===a&&1===s||90===a&&-1===s?-1:1),o*=s):(s=Math.sign(parseFloat(i[3])),0===t||180===t?o=1:90===t&&(t=parseFloat(i[1]),i=parseFloat(i[2]),o=Math.sign(t*i*a*s)),o*=s),o},r.prototype.getImageSize=function(t,e,o){return 90===e&&(o="x"===o?"y":"x"),t[{y:"offsetHeight",x:"offsetWidth"}[o]]},r.prototype.getDragCords=function(t,e){return 90===e?{x:t.pageY,y:t.pageX}:{x:t.pageX,y:t.pageY}},r.prototype.getSwipeCords=function(t,e){var o=t.targetTouches[0].pageX,t=t.targetTouches[0].pageY;return 90===e?{x:t,y:o}:{x:o,y:t}},r.prototype.getDragAllowedAxises=function(t,e){var o=this.core.$lgContent.get(),a=parseFloat(t.attr("data-scale"))||1,i=t.get(),t=this.getImageSize(i,e,"y")*a>o.clientHeight,o=this.getImageSize(i,e,"x")*a>o.clientWidth;return 90===e?{allowX:t,allowY:o}:{allowX:o,allowY:t}},r.prototype.getCurrentTransform=function(t){if(t){t=window.getComputedStyle(t,null),t=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform")||"none";return"none"!==t?t.split("(")[1].split(")")[0].split(","):void 0}},r.prototype.getCurrentRotation=function(t){if(!t)return 0;t=this.getCurrentTransform(t);return t?Math.round(Math.atan2(parseFloat(t[1]),parseFloat(t[0]))*(180/Math.PI)):0},r.prototype.zoomImage=function(t){var e,o,a=this.core.getSlideItem(this.core.index).find(".lg-image").first(),i=a.get();i&&(o=((e=this.core.outer.get().getBoundingClientRect()).width-i.offsetWidth)/2+e.left,i=(e.height-i.offsetHeight)/2+this.$LG(window).scrollTop()+e.top,1===t&&(this.positionChanged=!1),this.positionChanged&&(e=parseFloat(a.parent().attr("data-x"))/(parseFloat(a.attr("data-scale"))-1),a=parseFloat(a.parent().attr("data-y"))/(parseFloat(a.attr("data-scale"))-1),this.pageX=e+o,this.pageY=a+i,this.positionChanged=!1),o=(t-1)*(this.pageX-o),i=(t-1)*(this.pageY-i),this.setZoomStyles({x:o,y:i,scale:t}))},r.prototype.setZoomStyles=function(t){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first(),a=e.parent();e.attr("data-scale",t.scale+"").css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),o.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");o="translate3d(-"+t.x+"px, -"+t.y+"px, 0)";a.css("transform",o),a.attr("data-x",t.x).attr("data-y",t.y)},r.prototype.setActualSize=function(t,e){var o,a=this;this.core.galleryItems[this.core.index].src&&!this.core.outer.hasClass("lg-first-slide-loading")&&(o=this.getCurrentImageActualSizeScale(),this.core.outer.hasClass("lg-zoomed")?this.scale=1:this.scale=this.getScale(o),this.setPageCords(e),this.beginZoom(this.scale),this.zoomImage(this.scale),setTimeout(function(){a.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},10))},r.prototype.getNaturalWidth=function(t){var e=this.core.getSlideItem(t).find(".lg-image").first(),t=this.core.galleryItems[t].width;return t?parseFloat(t):e.get().naturalWidth},r.prototype.getActualSizeScale=function(t,e){e=e<t?t/e||2:1;return e},r.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,e=this.getNaturalWidth(this.core.index)||t;return this.getActualSizeScale(e,t)},r.prototype.getPageCords=function(t){var e={};return t?(e.x=t.pageX||t.targetTouches[0].pageX,e.y=t.pageY||t.targetTouches[0].pageY):(t=this.core.outer.get().getBoundingClientRect(),e.x=t.width/2+t.left,e.y=t.height/2+this.$LG(window).scrollTop()+t.top),e},r.prototype.setPageCords=function(t){t=this.getPageCords(t);this.pageX=t.x,this.pageY=t.y},r.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),1<t?(this.core.outer.addClass("lg-zoomed"),this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)):this.resetZoom(),1<t},r.prototype.getScale=function(t){var e=this.getCurrentImageActualSizeScale();return t<1?t=1:e<t&&(t=e),t},r.prototype.init=function(){var o,a=this;this.settings.zoom&&(this.buildTemplates(),this.enableZoomOnSlideItemLoad(),o=null,this.core.outer.on("dblclick.lg",function(t){a.$LG(t.target).hasClass("lg-image")&&a.setActualSize(a.core.index,t)}),this.core.outer.on("touchstart.lg",function(t){var e=a.$LG(t.target);1===t.targetTouches.length&&e.hasClass("lg-image")&&(o?(clearTimeout(o),o=null,a.setActualSize(a.core.index,t)):o=setTimeout(function(){o=null},300),t.preventDefault())}),this.core.LGel.on(t+".zoom",function(){a.core.lgOpened&&(a.setPageCords(),a.zoomImage(a.scale))}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){a.core.outer.find(".lg-current .lg-image").get()&&(a.scale-=a.settings.scale,a.scale=a.getScale(a.scale),a.beginZoom(a.scale),a.zoomImage(a.scale))}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){a.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){a.setActualSize(a.core.index)}),this.core.LGel.on(e+".zoom",function(){a.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(s+".zoom",function(t){t=t.detail.prevIndex;a.scale=1,a.positionChanged=!1,a.resetZoom(t)}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.pageX=this.core.outer.width()/2,this.pageY=this.core.outer.height()/2+this.$LG(window).scrollTop(),this.scale=1)},r.prototype.zoomIn=function(t){this.core.galleryItems[this.core.index].src&&(t?this.scale=t:this.scale+=this.settings.scale,this.scale=this.getScale(this.scale),this.beginZoom(this.scale),this.zoomImage(this.scale))},r.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var e=this.core.getElementById("lg-actual-size"),t=this.core.getSlideItem(void 0!==t?t:this.core.index);e.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),t.find(".lg-img-wrap").first().removeAttr("style data-x data-y"),t.find(".lg-image").first().removeAttr("style data-scale"),this.setPageCords()},r.prototype.getTouchDistance=function(t){return Math.sqrt((t.targetTouches[0].pageX-t.targetTouches[1].pageX)*(t.targetTouches[0].pageX-t.targetTouches[1].pageX)+(t.targetTouches[0].pageY-t.targetTouches[1].pageY)*(t.targetTouches[0].pageY-t.targetTouches[1].pageY))},r.prototype.pinchZoom=function(){var e=this,o=0,a=!1,i=1,s=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(t){s=e.core.getSlideItem(e.core.index),t.preventDefault(),2===t.targetTouches.length&&(e.$LG(t.target).hasClass("lg-item")||s.get().contains(t.target))&&(i=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.core.touchAction="pinch",o=e.getTouchDistance(t))}),this.core.$inner.on("touchmove.lg",function(t){t.preventDefault(),2===t.targetTouches.length&&"pinch"===e.core.touchAction&&(e.$LG(t.target).hasClass("lg-item")||s.get().contains(t.target))&&(t=e.getTouchDistance(t),t=o-t,!a&&5<Math.abs(t)&&(a=!0),a&&(e.scale=Math.max(1,i+.008*-t),e.zoomImage(e.scale)))}),this.core.$inner.on("touchend.lg",function(t){"pinch"===e.core.touchAction&&(e.$LG(t.target).hasClass("lg-item")||s.get().contains(t.target))&&(a=!1,o=0,e.scale<=1?e.resetZoom():(e.scale=e.getScale(e.scale),e.zoomImage(e.scale),e.core.outer.addClass("lg-zoomed")),e.core.touchAction=void 0)})},r.prototype.touchendZoom=function(t,e,o,a,i,s){var r=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get(),n=e.x-t.x,l=e.y-t.y,g=Math.abs(n)/i+1,c=Math.abs(l)/i+1;2<g&&(g+=1),2<c&&(c+=1),n*=g,l*=c;e=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),t=this.core.getSlideItem(this.core.index).find(".lg-object").first(),i=parseFloat(e.attr("data-x"))||0,g=parseFloat(e.attr("data-y"))||0,c={};c.x=-Math.abs(i)+n*this.getModifier(s,"X",r),c.y=-Math.abs(g)+l*this.getModifier(s,"Y",r);s=this.getPossibleSwipeDragCords(t,s);(15<Math.abs(n)||15<Math.abs(l))&&(a&&(c.y<=-s.maxY?c.y=-s.maxY:c.y>=-s.minY&&(c.y=-s.minY)),o&&(c.x<=-s.maxX?c.x=-s.maxX:c.x>=-s.minX&&(c.x=-s.minX)),a?e.attr("data-y",Math.abs(c.y)):(a=parseFloat(e.attr("data-y"))||0,c.y=-Math.abs(a)),o?e.attr("data-x",Math.abs(c.x)):(o=parseFloat(e.attr("data-x"))||0,c.x=-Math.abs(o)),this.setZoomSwipeStyles(e,c),this.positionChanged=!0)},r.prototype.getZoomSwipeCords=function(t,e,o,a,i,s,r,n,l){var g,c,h={};return a?(h.y=-Math.abs(s)+(e.y-t.y)*this.getModifier(n,"Y",l),h.y<=-i.maxY?(g=-i.maxY-h.y,h.y=-i.maxY-g/6):h.y>=-i.minY&&(g=h.y- -i.minY,h.y=-i.minY+g/6)):h.y=-Math.abs(s),o?(h.x=-Math.abs(r)+(e.x-t.x)*this.getModifier(n,"X",l),h.x<=-i.maxX?(c=-i.maxX-h.x,h.x=-i.maxX-c/6):h.x>=-i.minX&&(c=h.x- -i.minX,h.x=-i.minX+c/6)):h.x=-Math.abs(r),h},r.prototype.getPossibleSwipeDragCords=function(t,e){var o=this.core.$lgContent,a=o.height(),i=o.width(),s=this.getImageSize(t.get(),e,"y"),r=this.getImageSize(t.get(),e,"x"),o=parseFloat(t.attr("data-scale"))||1,t=Math.abs(o),o=(a-s)/2,s=Math.abs(s*t-a+o),a=(i-r)/2,i=Math.abs(r*t-i+a);return 90===e?{minY:a,maxY:i,minX:o,maxX:s}:{minY:o,maxY:s,minX:a,maxX:i}},r.prototype.setZoomSwipeStyles=function(t,e){t.css("transform","translate3d("+e.x+"px, "+e.y+"px, 0)")},r.prototype.zoomSwipe=function(){var a,i,s=this,r={},e={},o=!1,n=!1,l=!1,g=new Date,c=(new Date,0),h=0,m=null,u=0,d=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(t){var e,o;t.preventDefault(),s.core.galleryItems[s.core.index].src&&(d=s.core.getSlideItem(s.core.index),(s.$LG(t.target).hasClass("lg-item")||d.get().contains(t.target))&&1===t.targetTouches.length&&s.core.outer.hasClass("lg-zoomed")&&(g=new Date,s.core.touchAction="zoomSwipe",e=s.core.getSlideItem(s.core.index).find(".lg-object").first(),i=s.core.getSlideItem(s.core.index).find(".lg-img-wrap").first(),m=s.core.getSlideItem(s.core.index).find(".lg-img-rotate").first().get(),u=s.getCurrentRotation(m),o=s.getDragAllowedAxises(e,Math.abs(u)),l=o.allowY,((n=o.allowX)||l)&&(r=s.getSwipeCords(t,Math.abs(u))),h=parseFloat(i.attr("data-y")),c=parseFloat(i.attr("data-x")),a=s.getPossibleSwipeDragCords(e,u),s.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")))}),this.core.$inner.on("touchmove.lg",function(t){t.preventDefault(),1===t.targetTouches.length&&"zoomSwipe"===s.core.touchAction&&(s.$LG(t.target).hasClass("lg-item")||d.get().contains(t.target))&&(s.core.touchAction="zoomSwipe",e=s.getSwipeCords(t,Math.abs(u)),t=s.getZoomSwipeCords(r,e,n,l,a,h,c,u,m),(15<Math.abs(e.x-r.x)||15<Math.abs(e.y-r.y))&&(o=!0,s.setZoomSwipeStyles(i,t)))}),this.core.$inner.on("touchend.lg",function(t){"zoomSwipe"===s.core.touchAction&&(s.$LG(t.target).hasClass("lg-item")||d.get().contains(t.target))&&(s.core.touchAction=void 0,s.core.outer.removeClass("lg-zoom-dragging"),o&&(o=!1,t=(new Date).valueOf()-g.valueOf(),s.touchendZoom(r,e,n,l,t,u)))})},r.prototype.zoomDrag=function(){var a,e,i,s,r,n,l=this,g={},o={},c=!1,h=!1,m=null,u=0,d=!1,p=!1;this.core.outer.on("mousedown.lg.zoom",function(t){var e,o;l.core.galleryItems[l.core.index].src&&(o=l.core.getSlideItem(l.core.index),(l.$LG(t.target).hasClass("lg-item")||o.get().contains(t.target))&&(a=new Date,e=l.core.getSlideItem(l.core.index).find(".lg-object").first(),n=l.core.getSlideItem(l.core.index).find(".lg-img-wrap").first(),m=l.core.getSlideItem(l.core.index).find(".lg-img-rotate").get(),u=l.getCurrentRotation(m),o=l.getDragAllowedAxises(e,Math.abs(u)),p=o.allowY,d=o.allowX,l.core.outer.hasClass("lg-zoomed")&&l.$LG(t.target).hasClass("lg-object")&&(d||p)&&(t.preventDefault(),g=l.getDragCords(t,Math.abs(u)),i=l.getPossibleSwipeDragCords(e,u),c=!0,s=parseFloat(n.attr("data-y")),r=parseFloat(n.attr("data-x")),l.core.outer.get().scrollLeft+=1,--l.core.outer.get().scrollLeft,l.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))))}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(t){c&&(h=!0,o=l.getDragCords(t,Math.abs(u)),t=l.getZoomSwipeCords(g,o,d,p,i,s,r,u,m),l.setZoomSwipeStyles(n,t))}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(t){c&&(e=new Date,c=!1,l.core.outer.removeClass("lg-zoom-dragging"),!h||g.x===o.x&&g.y===o.y||(o=l.getDragCords(t,Math.abs(u)),t=e.valueOf()-a.valueOf(),l.touchendZoom(g,o,d,p,t,u)),h=!1),l.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},r.prototype.closeGallery=function(){this.resetZoom()},r.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},r});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).lgZoom=e()}(this,(function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,o=1,i=arguments.length;o<i;o++)for(var s in e=arguments[o])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},e={scale:1,zoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300},o="lgContainerResize",i="lgBeforeOpen",s="lgAfterOpen",a="lgSlideItemLoad",r="lgAfterSlide",n="lgRotateLeft",l="lgRotateRight",g="lgFlipHorizontal",c="lgFlipVertical";return function(){function h(o,i){return this.core=o,this.$LG=i,this.settings=t(t({},e),this.core.settings),this}return h.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="Zoom in" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="Zoom out" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="View actual size" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},h.prototype.enableZoom=function(t){var e=this,o=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?o=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout((function(){e.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),e.setZoomEssentials()}),o+30)},h.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(a+".zoom",this.enableZoom.bind(this))},h.prototype.getModifier=function(t,e,o){var i=t;t=Math.abs(t);var s=this.getCurrentTransform(o);if(!s)return 1;var a=1;if("X"===e){var r=Math.sign(parseFloat(s[0]));0===t||180===t?a=1:90===t&&(a=-90===i&&1===r||90===i&&-1===r?-1:1),a*=r}else{var n=Math.sign(parseFloat(s[3]));if(0===t||180===t)a=1;else if(90===t){var l=parseFloat(s[1]),g=parseFloat(s[2]);a=Math.sign(l*g*i*n)}a*=n}return a},h.prototype.getImageSize=function(t,e,o){return 90===Math.abs(e)&&(o="x"===o?"y":"x"),t[{y:"offsetHeight",x:"offsetWidth"}[o]]},h.prototype.getDragCords=function(t,e){return 90===e?{x:t.pageY,y:t.pageX}:{x:t.pageX,y:t.pageY}},h.prototype.getSwipeCords=function(t,e){var o=t.targetTouches[0].pageX,i=t.targetTouches[0].pageY;return 90===e?{x:i,y:o}:{x:o,y:i}},h.prototype.getDragAllowedAxises=function(t,e){e=e||this.scale||1;var o=this.imageYSize*e>this.containerRect.height,i=this.imageXSize*e>this.containerRect.width;return 90===t?{allowX:o,allowY:i}:{allowX:i,allowY:o}},h.prototype.getCurrentTransform=function(t){if(t){var e=window.getComputedStyle(t,null),o=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.getPropertyValue("-ms-transform")||e.getPropertyValue("-o-transform")||e.getPropertyValue("transform")||"none";return"none"!==o?o.split("(")[1].split(")")[0].split(","):void 0}},h.prototype.getCurrentRotation=function(t){if(!t)return 0;var e=this.getCurrentTransform(t);return e?Math.round(Math.atan2(parseFloat(e[1]),parseFloat(e[0]))*(180/Math.PI)):0},h.prototype.setZoomEssentials=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),e=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get();this.rotateValue=this.getCurrentRotation(e),this.imageYSize=this.getImageSize(t.get(),this.rotateValue,"y"),this.imageXSize=this.getImageSize(t.get(),this.rotateValue,"x"),this.containerRect=this.core.outer.get().getBoundingClientRect(),this.modifierX=this.getModifier(this.rotateValue,"X",e),this.modifierY=this.getModifier(this.rotateValue,"Y",e)},h.prototype.zoomImage=function(t){var e,o,i=(this.containerRect.width-this.imageXSize)/2+this.containerRect.left,s=this.core.mediaContainerPosition,a=s.top,r=s.bottom,n=Math.abs(a-r)/2,l=(this.containerRect.height-this.imageYSize-n*this.modifierX)/2+this.scrollTop+this.containerRect.top;1===t&&(this.positionChanged=!1);var g=this.getDragAllowedAxises(Math.abs(this.rotateValue),t),c=g.allowY,h=g.allowX;this.positionChanged&&(e=this.left/(this.scale-1),o=this.top/(this.scale-1),this.pageX=Math.abs(e)+i,this.pageY=Math.abs(o)+l,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(this.rotateValue,t),u=(t-1)*(i-this.pageX),d=(t-1)*(l-this.pageY);h?this.isBeyondPossibleLeft(u,m.minX)?u=m.minX:this.isBeyondPossibleRight(u,m.maxX)&&(u=m.maxX):t>1&&(u<m.minX?u=m.minX:u>m.maxX&&(u=m.maxX)),c?this.isBeyondPossibleTop(d,m.minY)?d=m.minY:this.isBeyondPossibleBottom(d,m.maxY)&&(d=m.maxY):t>1&&(d<m.minY?d=m.minY:d>m.maxY&&(d=m.maxY)),this.setZoomStyles({x:u,y:d,scale:t})},h.prototype.setZoomStyles=function(t){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first(),i=e.parent();this.scale=t.scale,e.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),o.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var s="translate3d("+t.x+"px, "+t.y+"px, 0)";i.css("transform",s),this.left=t.x,this.top=t.y},h.prototype.setActualSize=function(t,e){var o=this;if(this.core.galleryItems[this.core.index].src&&!this.core.outer.hasClass("lg-first-slide-loading")){var i=this.getCurrentImageActualSizeScale();this.core.outer.hasClass("lg-zoomed")?this.scale=1:this.scale=this.getScale(i),this.setPageCords(e),this.beginZoom(this.scale),this.zoomImage(this.scale),setTimeout((function(){o.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}),10)}},h.prototype.getNaturalWidth=function(t){var e=this.core.getSlideItem(t).find(".lg-image").first(),o=this.core.galleryItems[t].width;return o?parseFloat(o):e.get().naturalWidth},h.prototype.getActualSizeScale=function(t,e){return t>e?t/e||2:1},h.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first().get().offsetWidth,e=this.getNaturalWidth(this.core.index)||t;return this.getActualSizeScale(e,t)},h.prototype.getPageCords=function(t){var e={};if(t)e.x=t.pageX||t.targetTouches[0].pageX,e.y=t.pageY||t.targetTouches[0].pageY;else{var o=this.core.outer.get().getBoundingClientRect();e.x=o.width/2+o.left,e.y=o.height/2+this.scrollTop+o.top}return e},h.prototype.setPageCords=function(t){var e=this.getPageCords(t);this.pageX=e.x,this.pageY=e.y},h.prototype.beginZoom=function(t){(this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1)?(this.core.outer.addClass("lg-zoomed"),this.core.getElementById("lg-actual-size").removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)):this.resetZoom();return t>1},h.prototype.getScale=function(t){var e=this.getCurrentImageActualSizeScale();return t<1?t=1:t>e&&(t=e),t},h.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var e=null;this.core.outer.on("dblclick.lg",(function(e){t.$LG(e.target).hasClass("lg-image")&&t.setActualSize(t.core.index,e)})),this.core.outer.on("touchstart.lg",(function(o){var i=t.$LG(o.target);1===o.targetTouches.length&&i.hasClass("lg-image")&&(e?(clearTimeout(e),e=null,t.setActualSize(t.core.index,o)):e=setTimeout((function(){e=null}),300),o.preventDefault())})),this.core.LGel.on(o+".zoom "+l+".zoom "+n+".zoom "+g+".zoom "+c+".zoom",(function(){t.core.lgOpened&&(t.setPageCords(),t.setZoomEssentials(),t.zoomImage(t.scale))})),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,(function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())})),this.core.getElementById("lg-zoom-out").on("click.lg",(function(){t.core.outer.find(".lg-current .lg-image").get()&&(t.scale-=t.settings.scale,t.scale=t.getScale(t.scale),t.beginZoom(t.scale),t.zoomImage(t.scale))})),this.core.getElementById("lg-zoom-in").on("click.lg",(function(){t.zoomIn()})),this.core.getElementById("lg-actual-size").on("click.lg",(function(){t.setActualSize(t.core.index)})),this.core.LGel.on(i+".zoom",(function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")})),this.core.LGel.on(s+".zoom",(function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1})),this.core.LGel.on(r+".zoom",(function(e){var o=e.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.resetZoom(o),t.setZoomEssentials()})),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1}},h.prototype.zoomIn=function(t){this.core.galleryItems[this.core.index].src&&(t?this.scale=t:this.scale+=this.settings.scale,this.scale=this.getScale(this.scale),this.beginZoom(this.scale),this.zoomImage(this.scale))},h.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var e=this.core.getElementById("lg-actual-size"),o=this.core.getSlideItem(void 0!==t?t:this.core.index);e.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),o.find(".lg-img-wrap").first().removeAttr("style"),o.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},h.prototype.getTouchDistance=function(t){return Math.sqrt((t.targetTouches[0].pageX-t.targetTouches[1].pageX)*(t.targetTouches[0].pageX-t.targetTouches[1].pageX)+(t.targetTouches[0].pageY-t.targetTouches[1].pageY)*(t.targetTouches[0].pageY-t.targetTouches[1].pageY))},h.prototype.pinchZoom=function(){var t=this,e=0,o=!1,i=1,s=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",(function(o){s=t.core.getSlideItem(t.core.index),o.preventDefault(),2!==o.targetTouches.length||t.core.outer.hasClass("lg-first-slide-loading")||!t.$LG(o.target).hasClass("lg-item")&&!s.get().contains(o.target)||(i=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.core.touchAction="pinch",e=t.getTouchDistance(o))})),this.core.$inner.on("touchmove.lg",(function(a){if(a.preventDefault(),2===a.targetTouches.length&&"pinch"===t.core.touchAction&&(t.$LG(a.target).hasClass("lg-item")||s.get().contains(a.target))){var r=t.getTouchDistance(a),n=e-r;!o&&Math.abs(n)>5&&(o=!0),o&&(t.scale=Math.max(1,i+.008*-n),t.zoomImage(t.scale))}})),this.core.$inner.on("touchend.lg",(function(i){"pinch"===t.core.touchAction&&(t.$LG(i.target).hasClass("lg-item")||s.get().contains(i.target))&&(o=!1,e=0,t.scale<=1?t.resetZoom():(t.scale=t.getScale(t.scale),t.zoomImage(t.scale),t.core.outer.addClass("lg-zoomed")),t.core.touchAction=void 0)}))},h.prototype.touchendZoom=function(t,e,o,i,s,a){var r=e.x-t.x,n=e.y-t.y,l=Math.abs(r)/s+1,g=Math.abs(n)/s+1;l>2&&(l+=1),g>2&&(g+=1),r*=l,n*=g;var c=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+r*this.modifierX,h.y=this.top+n*this.modifierY;var m=this.getPossibleSwipeDragCords(a);(Math.abs(r)>15||Math.abs(n)>15)&&(i&&(this.isBeyondPossibleTop(h.y,m.minY)?h.y=m.minY:this.isBeyondPossibleBottom(h.y,m.maxY)&&(h.y=m.maxY)),o&&(this.isBeyondPossibleLeft(h.x,m.minX)?h.x=m.minX:this.isBeyondPossibleRight(h.x,m.maxX)&&(h.x=m.maxX)),i?this.top=h.y:h.y=this.top,o?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(c,h),this.positionChanged=!0)},h.prototype.getZoomSwipeCords=function(t,e,o,i,s){var a={};if(i){if(a.y=this.top+(e.y-t.y)*this.modifierY,this.isBeyondPossibleTop(a.y,s.minY)){var r=s.minY-a.y;a.y=s.minY-r/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var n=a.y-s.maxY;a.y=s.maxY+n/6}}else a.y=this.top;if(o){if(a.x=this.left+(e.x-t.x)*this.modifierX,this.isBeyondPossibleLeft(a.x,s.minX)){var l=s.minX-a.x;a.x=s.minX-l/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var g=a.x-s.maxX;a.x=s.maxX+g/6}}else a.x=this.left;return a},h.prototype.isBeyondPossibleLeft=function(t,e){return t>=e},h.prototype.isBeyondPossibleRight=function(t,e){return t<=e},h.prototype.isBeyondPossibleTop=function(t,e){return t>=e},h.prototype.isBeyondPossibleBottom=function(t,e){return t<=e},h.prototype.getPossibleSwipeDragCords=function(t,e){var o=e||this.scale||1,i=Math.abs(o),s=this.core.mediaContainerPosition,a=s.top,r=s.bottom,n=Math.abs(a-r)/2,l=(this.imageYSize-this.containerRect.height)/2+n*this.modifierX,g=this.containerRect.height-this.imageYSize*i+l,c=(this.imageXSize-this.containerRect.width)/2,h=this.containerRect.width-this.imageXSize*i+c,m={minY:l,maxY:g,minX:c,maxX:h};return 90===Math.abs(t)&&(m={minY:c,maxY:h,minX:l,maxX:g}),m},h.prototype.setZoomSwipeStyles=function(t,e){t.css("transform","translate3d("+e.x+"px, "+e.y+"px, 0)")},h.prototype.zoomSwipe=function(){var t,e,o=this,i={},s={},a=!1,r=!1,n=!1,l=new Date,g=(new Date,this.core.getSlideItem(this.core.index));this.core.$inner.on("touchstart.lg",(function(s){if(s.preventDefault(),o.core.galleryItems[o.core.index].src&&(g=o.core.getSlideItem(o.core.index),(o.$LG(s.target).hasClass("lg-item")||g.get().contains(s.target))&&1===s.targetTouches.length&&o.core.outer.hasClass("lg-zoomed"))){l=new Date,o.core.touchAction="zoomSwipe",e=o.core.getSlideItem(o.core.index).find(".lg-img-wrap").first();var a=o.getDragAllowedAxises(Math.abs(o.rotateValue));n=a.allowY,((r=a.allowX)||n)&&(i=o.getSwipeCords(s,Math.abs(o.rotateValue))),t=o.getPossibleSwipeDragCords(o.rotateValue),o.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}})),this.core.$inner.on("touchmove.lg",(function(l){if(l.preventDefault(),1===l.targetTouches.length&&"zoomSwipe"===o.core.touchAction&&(o.$LG(l.target).hasClass("lg-item")||g.get().contains(l.target))){o.core.touchAction="zoomSwipe",s=o.getSwipeCords(l,Math.abs(o.rotateValue));var c=o.getZoomSwipeCords(i,s,r,n,t);(Math.abs(s.x-i.x)>15||Math.abs(s.y-i.y)>15)&&(a=!0,o.setZoomSwipeStyles(e,c))}})),this.core.$inner.on("touchend.lg",(function(t){if("zoomSwipe"===o.core.touchAction&&(o.$LG(t.target).hasClass("lg-item")||g.get().contains(t.target))){if(o.core.touchAction=void 0,o.core.outer.removeClass("lg-zoom-dragging"),!a)return;a=!1;var e=(new Date).valueOf()-l.valueOf();o.touchendZoom(i,s,r,n,e,o.rotateValue)}}))},h.prototype.zoomDrag=function(){var t,e,o,i,s=this,a={},r={},n=!1,l=!1,g=!1,c=!1;this.core.outer.on("mousedown.lg.zoom",(function(e){if(s.core.galleryItems[s.core.index].src){var r=s.core.getSlideItem(s.core.index);if(s.$LG(e.target).hasClass("lg-item")||r.get().contains(e.target)){t=new Date,i=s.core.getSlideItem(s.core.index).find(".lg-img-wrap").first();var l=s.getDragAllowedAxises(Math.abs(s.rotateValue));c=l.allowY,g=l.allowX,s.core.outer.hasClass("lg-zoomed")&&s.$LG(e.target).hasClass("lg-object")&&(g||c)&&(e.preventDefault(),a=s.getDragCords(e,Math.abs(s.rotateValue)),o=s.getPossibleSwipeDragCords(s.rotateValue),n=!0,s.core.outer.get().scrollLeft+=1,s.core.outer.get().scrollLeft-=1,s.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}})),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,(function(t){if(n){l=!0,r=s.getDragCords(t,Math.abs(s.rotateValue));var e=s.getZoomSwipeCords(a,r,g,c,o);s.setZoomSwipeStyles(i,e)}})),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,(function(o){if(n){if(e=new Date,n=!1,s.core.outer.removeClass("lg-zoom-dragging"),l&&(a.x!==r.x||a.y!==r.y)){r=s.getDragCords(o,Math.abs(s.rotateValue));var i=e.valueOf()-t.valueOf();s.touchendZoom(a,r,g,c,i,s.rotateValue)}l=!1}s.core.outer.removeClass("lg-grabbing").addClass("lg-grab")}))},h.prototype.closeGallery=function(){this.resetZoom()},h.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},h}()}));
/*!
* lightgallery | 2.2.0-beta.0 | June 15th 2021
* lightgallery | 2.2.0-beta.1 | July 15th 2021
* http://www.lightgalleryjs.com/

@@ -11,3 +11,3 @@ * Copyright (c) 2020 Sachin Neravath;

typeof define === 'function' && define.amd ? define(factory) :
(global.lgZoom = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.lgZoom = factory());
}(this, (function () { 'use strict';

@@ -78,2 +78,6 @@

afterClose: 'lgAfterClose',
rotateLeft: 'lgRotateLeft',
rotateRight: 'lgRotateRight',
flipHorizontal: 'lgFlipHorizontal',
flipVertical: 'lgFlipVertical',
};

@@ -122,2 +126,3 @@

_this.core.getSlideItem(event.detail.index).addClass('lg-zoomable');
_this.setZoomEssentials();
}, _speed + 30);

@@ -172,3 +177,3 @@ };

};
if (rotateValue === 90) {
if (Math.abs(rotateValue) === 90) {
// Swap axis

@@ -214,10 +219,6 @@ if (axis === 'x') {

};
Zoom.prototype.getDragAllowedAxises = function ($image, rotateValue) {
var $lg = this.core.$lgContent.get();
var scale = parseFloat($image.attr('data-scale')) || 1;
var imgEl = $image.get();
var allowY = this.getImageSize(imgEl, rotateValue, 'y') * scale >
$lg.clientHeight;
var allowX = this.getImageSize(imgEl, rotateValue, 'x') * scale >
$lg.clientWidth;
Zoom.prototype.getDragAllowedAxises = function (rotateValue, scale) {
scale = scale || this.scale || 1;
var allowY = this.imageYSize * scale > this.containerRect.height;
var allowX = this.imageXSize * scale > this.containerRect.width;
if (rotateValue === 90) {

@@ -271,2 +272,19 @@ return {

};
Zoom.prototype.setZoomEssentials = function () {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
this.rotateValue = this.getCurrentRotation(rotateEl);
this.imageYSize = this.getImageSize($image.get(), this.rotateValue, 'y');
this.imageXSize = this.getImageSize($image.get(), this.rotateValue, 'x');
this.containerRect = this.core.outer.get().getBoundingClientRect();
this.modifierX = this.getModifier(this.rotateValue, 'X', rotateEl);
this.modifierY = this.getModifier(this.rotateValue, 'Y', rotateEl);
};
/**

@@ -279,16 +297,13 @@ * @desc Image zoom

Zoom.prototype.zoomImage = function (scale) {
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-image')
.first();
var imageNode = $image.get();
if (!imageNode)
return;
var containerRect = this.core.outer.get().getBoundingClientRect();
// Find offset manually to avoid issue after zoom
var offsetX = (containerRect.width - imageNode.offsetWidth) / 2 +
containerRect.left;
var offsetY = (containerRect.height - imageNode.offsetHeight) / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
var offsetX = (this.containerRect.width - this.imageXSize) / 2 +
this.containerRect.left;
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var offsetY = (this.containerRect.height -
this.imageYSize -
topBottomSpacing * this.modifierX) /
2 +
this.scrollTop +
this.containerRect.top;
var originalX;

@@ -299,17 +314,54 @@ var originalY;

}
var dragAllowedAxises = this.getDragAllowedAxises(Math.abs(this.rotateValue), scale);
var allowY = dragAllowedAxises.allowY, allowX = dragAllowedAxises.allowX;
if (this.positionChanged) {
originalX =
parseFloat($image.parent().attr('data-x')) /
(parseFloat($image.attr('data-scale')) - 1);
originalY =
parseFloat($image.parent().attr('data-y')) /
(parseFloat($image.attr('data-scale')) - 1);
this.pageX = originalX + offsetX;
this.pageY = originalY + offsetY;
originalX = this.left / (this.scale - 1);
originalY = this.top / (this.scale - 1);
this.pageX = Math.abs(originalX) + offsetX;
this.pageY = Math.abs(originalY) + offsetY;
this.positionChanged = false;
}
var _x = this.pageX - offsetX;
var _y = this.pageY - offsetY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(this.rotateValue, scale);
var _x = offsetX - this.pageX;
var _y = offsetY - this.pageY;
var x = (scale - 1) * _x;
var y = (scale - 1) * _y;
if (allowX) {
if (this.isBeyondPossibleLeft(x, possibleSwipeCords.minX)) {
x = possibleSwipeCords.minX;
}
else if (this.isBeyondPossibleRight(x, possibleSwipeCords.maxX)) {
x = possibleSwipeCords.maxX;
}
}
else {
if (scale > 1) {
if (x < possibleSwipeCords.minX) {
x = possibleSwipeCords.minX;
}
else if (x > possibleSwipeCords.maxX) {
x = possibleSwipeCords.maxX;
}
}
}
if (allowY) {
if (this.isBeyondPossibleTop(y, possibleSwipeCords.minY)) {
y = possibleSwipeCords.minY;
}
else if (this.isBeyondPossibleBottom(y, possibleSwipeCords.maxY)) {
y = possibleSwipeCords.maxY;
}
}
else {
// If the translate value based on index of beyond the viewport, utilize the available space to prevent image being cut out
if (scale > 1) {
//If image goes beyond viewport top, use the minim possible translate value
if (y < possibleSwipeCords.minY) {
y = possibleSwipeCords.minY;
}
else if (y > possibleSwipeCords.maxY) {
y = possibleSwipeCords.maxY;
}
}
}
this.setZoomStyles({

@@ -334,9 +386,9 @@ x: x,

var $imageWrap = $image.parent();
$image
.attr('data-scale', style.scale + '')
.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
this.scale = style.scale;
$image.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
$dummyImage.css('transform', 'scale3d(' + style.scale + ', ' + style.scale + ', 1)');
var transform = 'translate3d(-' + style.x + 'px, -' + style.y + 'px, 0)';
var transform = 'translate3d(' + style.x + 'px, ' + style.y + 'px, 0)';
$imageWrap.css('transform', transform);
$imageWrap.attr('data-x', style.x).attr('data-y', style.y);
this.left = style.x;
this.top = style.y;
};

@@ -407,5 +459,3 @@ /**

cords.y =
containerRect.height / 2 +
this.$LG(window).scrollTop() +
containerRect.top;
containerRect.height / 2 + this.scrollTop + containerRect.top;
}

@@ -476,8 +526,15 @@ return cords;

// Update zoom on resize and orientationchange
this.core.LGel.on(lGEvents.containerResize + ".zoom", function () {
this.core.LGel.on(lGEvents.containerResize + ".zoom " + lGEvents.rotateRight + ".zoom " + lGEvents.rotateLeft + ".zoom " + lGEvents.flipHorizontal + ".zoom " + lGEvents.flipVertical + ".zoom", function () {
if (!_this.core.lgOpened)
return;
_this.setPageCords();
_this.setZoomEssentials();
_this.zoomImage(_this.scale);
});
// Update zoom on resize and orientationchange
this.$LG(window).on("scroll.lg.zoom.global" + this.core.lgId, function () {
if (!_this.core.lgOpened)
return;
_this.scrollTop = _this.$LG(window).scrollTop();
});
this.core.getElementById('lg-zoom-out').on('click.lg', function () {

@@ -500,2 +557,9 @@ if (_this.core.outer.find('.lg-current .lg-image').get()) {

});
this.core.LGel.on(lGEvents.afterOpen + ".zoom", function () {
_this.scrollTop = _this.$LG(window).scrollTop();
// Set the initial value center
_this.pageX = _this.core.outer.width() / 2;
_this.pageY = _this.core.outer.height() / 2 + _this.scrollTop;
_this.scale = 1;
});
// Reset zoom on slide change

@@ -507,2 +571,3 @@ this.core.LGel.on(lGEvents.afterSlide + ".zoom", function (event) {

_this.resetZoom(prevIndex);
_this.setZoomEssentials();
});

@@ -516,7 +581,2 @@ // Drag option after zoom

this.positionChanged = false;
// Set the initial value center
this.pageX = this.core.outer.width() / 2;
this.pageY =
this.core.outer.height() / 2 + this.$LG(window).scrollTop();
this.scale = 1;
};

@@ -547,4 +607,7 @@ Zoom.prototype.zoomIn = function (scale) {

.addClass(this.settings.actualSizeIcons.zoomIn);
$item.find('.lg-img-wrap').first().removeAttr('style data-x data-y');
$item.find('.lg-image').first().removeAttr('style data-scale');
$item.find('.lg-img-wrap').first().removeAttr('style');
$item.find('.lg-image').first().removeAttr('style');
this.scale = 1;
this.left = 0;
this.top = 0;
// Reset pagx pagy values to center

@@ -569,2 +632,3 @@ this.setPageCords();

if (e.targetTouches.length === 2 &&
!_this.core.outer.hasClass('lg-first-slide-loading') &&
(_this.$LG(e.target).hasClass('lg-item') ||

@@ -614,7 +678,2 @@ $item.get().contains(e.target))) {

Zoom.prototype.touchendZoom = function (startCoords, endCoords, allowX, allowY, touchDuration, rotateValue) {
var rotateEl = this.core
.getSlideItem(this.core.index)
.find('.lg-img-rotate')
.first()
.get();
var distanceXnew = endCoords.x - startCoords.x;

@@ -636,46 +695,34 @@ var distanceYnew = endCoords.y - startCoords.y;

.first();
var $image = this.core
.getSlideItem(this.core.index)
.find('.lg-object')
.first();
var dataX = parseFloat(_LGel.attr('data-x')) || 0;
var dataY = parseFloat(_LGel.attr('data-y')) || 0;
var distance = {};
distance.x =
-Math.abs(dataX) +
distanceXnew * this.getModifier(rotateValue, 'X', rotateEl);
distance.y =
-Math.abs(dataY) +
distanceYnew * this.getModifier(rotateValue, 'Y', rotateEl);
var possibleSwipeCords = this.getPossibleSwipeDragCords($image, rotateValue);
distance.x = this.left + distanceXnew * this.modifierX;
distance.y = this.top + distanceYnew * this.modifierY;
var possibleSwipeCords = this.getPossibleSwipeDragCords(rotateValue);
if (Math.abs(distanceXnew) > 15 || Math.abs(distanceYnew) > 15) {
if (allowY) {
if (distance.y <= -possibleSwipeCords.maxY) {
distance.y = -possibleSwipeCords.maxY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
distance.y = possibleSwipeCords.minY;
}
else if (distance.y >= -possibleSwipeCords.minY) {
distance.y = -possibleSwipeCords.minY;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
distance.y = possibleSwipeCords.maxY;
}
}
if (allowX) {
if (distance.x <= -possibleSwipeCords.maxX) {
distance.x = -possibleSwipeCords.maxX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
distance.x = possibleSwipeCords.minX;
}
else if (distance.x >= -possibleSwipeCords.minX) {
distance.x = -possibleSwipeCords.minX;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
distance.x = possibleSwipeCords.maxX;
}
}
if (allowY) {
_LGel.attr('data-y', Math.abs(distance.y));
this.top = distance.y;
}
else {
var dataY_1 = parseFloat(_LGel.attr('data-y')) || 0;
distance.y = -Math.abs(dataY_1);
distance.y = this.top;
}
if (allowX) {
_LGel.attr('data-x', Math.abs(distance.x));
this.left = distance.x;
}
else {
var dataX_1 = parseFloat(_LGel.attr('data-x')) || 0;
distance.x = -Math.abs(dataX_1);
distance.x = this.left;
}

@@ -686,54 +733,66 @@ this.setZoomSwipeStyles(_LGel, distance);

};
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl) {
Zoom.prototype.getZoomSwipeCords = function (startCoords, endCoords, allowX, allowY, possibleSwipeCords) {
var distance = {};
if (allowY) {
distance.y =
-Math.abs(dataY) +
(endCoords.y - startCoords.y) *
this.getModifier(rotateValue, 'Y', rotateEl);
if (distance.y <= -possibleSwipeCords.maxY) {
var diffMaxY = -possibleSwipeCords.maxY - distance.y;
distance.y = -possibleSwipeCords.maxY - diffMaxY / 6;
this.top + (endCoords.y - startCoords.y) * this.modifierY;
if (this.isBeyondPossibleTop(distance.y, possibleSwipeCords.minY)) {
var diffMinY = possibleSwipeCords.minY - distance.y;
distance.y = possibleSwipeCords.minY - diffMinY / 6;
}
else if (distance.y >= -possibleSwipeCords.minY) {
var diffMinY = distance.y - -possibleSwipeCords.minY;
distance.y = -possibleSwipeCords.minY + diffMinY / 6;
else if (this.isBeyondPossibleBottom(distance.y, possibleSwipeCords.maxY)) {
var diffMaxY = distance.y - possibleSwipeCords.maxY;
distance.y = possibleSwipeCords.maxY + diffMaxY / 6;
}
}
else {
distance.y = -Math.abs(dataY);
distance.y = this.top;
}
if (allowX) {
distance.x =
-Math.abs(dataX) +
(endCoords.x - startCoords.x) *
this.getModifier(rotateValue, 'X', rotateEl);
if (distance.x <= -possibleSwipeCords.maxX) {
var diffMaxX = -possibleSwipeCords.maxX - distance.x;
distance.x = -possibleSwipeCords.maxX - diffMaxX / 6;
this.left + (endCoords.x - startCoords.x) * this.modifierX;
if (this.isBeyondPossibleLeft(distance.x, possibleSwipeCords.minX)) {
var diffMinX = possibleSwipeCords.minX - distance.x;
distance.x = possibleSwipeCords.minX - diffMinX / 6;
}
else if (distance.x >= -possibleSwipeCords.minX) {
var diffMinX = distance.x - -possibleSwipeCords.minX;
distance.x = -possibleSwipeCords.minX + diffMinX / 6;
else if (this.isBeyondPossibleRight(distance.x, possibleSwipeCords.maxX)) {
var difMaxX = distance.x - possibleSwipeCords.maxX;
distance.x = possibleSwipeCords.maxX + difMaxX / 6;
}
}
else {
distance.x = -Math.abs(dataX);
distance.x = this.left;
}
return distance;
};
Zoom.prototype.getPossibleSwipeDragCords = function ($image, rotateValue) {
var $cont = this.core.$lgContent;
var contHeight = $cont.height();
var contWidth = $cont.width();
var imageYSize = this.getImageSize($image.get(), rotateValue, 'y');
var imageXSize = this.getImageSize($image.get(), rotateValue, 'x');
var dataY = parseFloat($image.attr('data-scale')) || 1;
var elDataScale = Math.abs(dataY);
var minY = (contHeight - imageYSize) / 2;
var maxY = Math.abs(imageYSize * elDataScale - contHeight + minY);
var minX = (contWidth - imageXSize) / 2;
var maxX = Math.abs(imageXSize * elDataScale - contWidth + minX);
if (rotateValue === 90) {
return {
Zoom.prototype.isBeyondPossibleLeft = function (x, minX) {
return x >= minX;
};
Zoom.prototype.isBeyondPossibleRight = function (x, maxX) {
return x <= maxX;
};
Zoom.prototype.isBeyondPossibleTop = function (y, minY) {
return y >= minY;
};
Zoom.prototype.isBeyondPossibleBottom = function (y, maxY) {
return y <= maxY;
};
Zoom.prototype.getPossibleSwipeDragCords = function (rotateValue, scale) {
var dataScale = scale || this.scale || 1;
var elDataScale = Math.abs(dataScale);
var _a = this.core.mediaContainerPosition, top = _a.top, bottom = _a.bottom;
var topBottomSpacing = Math.abs(top - bottom) / 2;
var minY = (this.imageYSize - this.containerRect.height) / 2 +
topBottomSpacing * this.modifierX;
var maxY = this.containerRect.height - this.imageYSize * elDataScale + minY;
var minX = (this.imageXSize - this.containerRect.width) / 2;
var maxX = this.containerRect.width - this.imageXSize * elDataScale + minX;
var possibleSwipeCords = {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
if (Math.abs(rotateValue) === 90) {
possibleSwipeCords = {
minY: minX,

@@ -745,10 +804,3 @@ maxY: maxX,

}
else {
return {
minY: minY,
maxY: maxY,
minX: minX,
maxX: maxX,
};
}
return possibleSwipeCords;
};

@@ -769,8 +821,4 @@ Zoom.prototype.setZoomSwipeStyles = function (LGel, distance) {

var endTime = new Date();
var dataX = 0;
var dataY = 0;
var possibleSwipeCords;
var _LGel;
var rotateEl = null;
var rotateValue = 0;
var $item = this.core.getSlideItem(this.core.index);

@@ -791,6 +839,2 @@ this.core.$inner.on('touchstart.lg', function (e) {

_this.core.touchAction = 'zoomSwipe';
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -800,17 +844,9 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.first()
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;
allowX = dragAllowedAxises.allowX;
if (allowX || allowY) {
startCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
startCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
}
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
// reset opacity and transition duration

@@ -827,4 +863,4 @@ _this.core.outer.addClass('lg-zoom-dragging lg-zoom-drag-transition');

_this.core.touchAction = 'zoomSwipe';
endCoords = _this.getSwipeCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getSwipeCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
if (Math.abs(endCoords.x - startCoords.x) > 15 ||

@@ -849,3 +885,3 @@ Math.abs(endCoords.y - startCoords.y) > 15) {

var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -860,4 +896,2 @@ });

var isMoved = false;
var rotateEl = null;
var rotateValue = 0;
// Allow x direction drag

@@ -870,4 +904,2 @@ var allowX = false;

var possibleSwipeCords;
var dataY;
var dataX;
var _LGel;

@@ -884,7 +916,2 @@ this.core.outer.on('mousedown.lg.zoom', function (e) {

startTime = new Date();
// execute only on .lg-object
var $image = _this.core
.getSlideItem(_this.core.index)
.find('.lg-object')
.first();
_LGel = _this.core

@@ -894,8 +921,3 @@ .getSlideItem(_this.core.index)

.first();
rotateEl = _this.core
.getSlideItem(_this.core.index)
.find('.lg-img-rotate')
.get();
rotateValue = _this.getCurrentRotation(rotateEl);
var dragAllowedAxises = _this.getDragAllowedAxises($image, Math.abs(rotateValue));
var dragAllowedAxises = _this.getDragAllowedAxises(Math.abs(_this.rotateValue));
allowY = dragAllowedAxises.allowY;

@@ -907,7 +929,5 @@ allowX = dragAllowedAxises.allowX;

e.preventDefault();
startCoords = _this.getDragCords(e, Math.abs(rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords($image, rotateValue);
startCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
possibleSwipeCords = _this.getPossibleSwipeDragCords(_this.rotateValue);
isDragging = true;
dataY = parseFloat(_LGel.attr('data-y'));
dataX = parseFloat(_LGel.attr('data-x'));
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723

@@ -927,4 +947,4 @@ _this.core.outer.get().scrollLeft += 1;

isMoved = true;
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords, dataY, dataX, rotateValue, rotateEl);
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var distance = _this.getZoomSwipeCords(startCoords, endCoords, allowX, allowY, possibleSwipeCords);
_this.setZoomSwipeStyles(_LGel, distance);

@@ -942,5 +962,5 @@ }

startCoords.y !== endCoords.y)) {
endCoords = _this.getDragCords(e, Math.abs(rotateValue));
endCoords = _this.getDragCords(e, Math.abs(_this.rotateValue));
var touchDuration = endTime.valueOf() - startTime.valueOf();
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, rotateValue);
_this.touchendZoom(startCoords, endCoords, allowX, allowY, touchDuration, _this.rotateValue);
}

@@ -947,0 +967,0 @@ isMoved = false;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc