var tl,screenWidth,products;(function(n){if(typeof exports=="object"&&typeof module!="undefined")module.exports=n();else if(typeof define=="function"&&define.amd)define([],n);else{var t;t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this;t.Lightgallery=n()}})(function(){var n;return function t(n,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!n[f]){if(h=typeof require=="function"&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};n[f][0].call(s.exports,function(t){var i=n[f][1][t];return u(i?i:t)},s,s.exports,t,n,i,r)}return i[f].exports}for(var e=typeof require=="function"&&require,f=0;f2&&arguments[2]!==undefined?arguments[2]:null,i;n&&(i=new CustomEvent(t,{detail:r}),n.dispatchEvent(i))},Listener:{uid:0},on:function(n,i,r){n&&i.split(" ").forEach(function(i){var u=n.getAttribute("lg-event-uid")||"";t.Listener.uid++;u+="&"+t.Listener.uid;n.setAttribute("lg-event-uid",u);t.Listener[i+t.Listener.uid]=r;n.addEventListener(i.split(".")[0],r,!1)})},off:function(n,i){var r,u,f,e;if(n&&(r=n.getAttribute("lg-event-uid"),r))for(r=r.split("&"),u=0;u-1&&(n.removeEventListener(e.split(".")[0],t.Listener[e]),n.setAttribute("lg-event-uid",n.getAttribute("lg-event-uid").replace("&"+r[u],"")),delete t.Listener[e]);else n.removeEventListener(f.split(".")[0],t.Listener[f]),n.setAttribute("lg-event-uid",n.getAttribute("lg-event-uid").replace("&"+r[u],"")),delete t.Listener[f]},param:function(n){return Object.keys(n).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(n[t])}).join("&")}};n.default=t})},{}],2:[function(t,i,r){(function(i,u){if(typeof n=="function"&&n.amd)n(["./lg-utils"],u);else if(typeof r!="undefined")u(t("./lg-utils"));else u(i.lgUtils),i.lightgallery={exports:{}}.exports})(this,function(n){"use strict";function u(n){return n&&n.__esModule?n:{"default":n}}function i(n,t){if(this.el=n,this.s=f({},r,t),this.s.dynamic&&this.s.dynamicEl!=="undefined"&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.items=[],this.s.dynamic?this.items=this.s.dynamicEl:this.s.selector==="this"?this.items.push(this.el):this.items=this.s.selector!==""?this.s.selectWithin?document.querySelector(this.s.selectWithin).querySelectorAll(this.s.selector):this.el.querySelectorAll(this.s.selector):this.el.children,this.___slide="",this.outer="",this.init(),this}var t=u(n),f=Object.assign||function(n){for(var i,r,t=1;tn.items.length&&(n.s.preload=n.items.length),r=window.location.hash,r.indexOf("lg="+this.s.galleryId)>0&&(n.index=parseInt(r.split("&slide=")[1],10),t.default.addClass(document.body,"lg-from-hash"),t.default.hasClass(document.body,"lg-on")||(t.default.addClass(document.body,"lg-on"),setTimeout(function(){n.build(n.index)}))),n.s.dynamic)t.default.trigger(this.el,"onBeforeOpen"),n.index=n.s.index||0,t.default.hasClass(document.body,"lg-on")||(t.default.addClass(document.body,"lg-on"),setTimeout(function(){n.build(n.index)}));else for(i=0;i1&&(i.arrow(),setTimeout(function(){i.enableDrag();i.enableSwipe()},50),i.s.mousewheel&&i.mousewheel());i.counter();i.closeGallery();t.default.trigger(i.el,"onAfterOpen");t.default.on(i.outer,"mousemove.lg click.lg touchstart.lg",function(){t.default.removeClass(i.outer,"lg-hide-items");clearTimeout(i.hideBartimeout);i.hideBartimeout=setTimeout(function(){t.default.addClass(i.outer,"lg-hide-items")},i.s.hideBarsDelay)})};i.prototype.structure=function(){var u="",f="",n=0,e="",o,i=this,r;for(document.body.insertAdjacentHTML("beforeend",'
<\/div>'),t.default.setVendor(document.querySelector(".lg-backdrop"),"TransitionDuration",this.s.backdropDuration+"ms"),n=0;n<\/div>';this.s.controls&&this.items.length>1&&(f='
'+this.s.prevHtml+'<\/div>
'+this.s.nextHtml+"<\/div><\/div>");this.s.appendSubHtmlTo===".lg-sub-html"&&(e='
<\/div>');o='
'+u+'<\/div>
<\/span><\/div>'+f+e+"<\/div><\/div>";document.body.insertAdjacentHTML("beforeend",o);this.outer=document.querySelector(".lg-outer");this.___slide=this.outer.querySelectorAll(".lg-item");this.s.useLeft?(t.default.addClass(this.outer,"lg-use-left"),this.s.mode="lg-slide"):t.default.addClass(this.outer,"lg-use-css3");i.setTop();t.default.on(window,"resize.lg orientationchange.lg",function(){setTimeout(function(){i.setTop()},100)});t.default.addClass(this.___slide[this.index],"lg-current");this.doCss()?t.default.addClass(this.outer,"lg-css3"):(t.default.addClass(this.outer,"lg-css"),this.s.speed=0);t.default.addClass(this.outer,this.s.mode);this.s.enableDrag&&this.items.length>1&&t.default.addClass(this.outer,"lg-grab");this.s.showAfterLoad&&t.default.addClass(this.outer,"lg-show-after-load");this.doCss()&&(r=this.outer.querySelector(".lg-inner"),t.default.setVendor(r,"TransitionTimingFunction",this.s.cssEasing),t.default.setVendor(r,"TransitionDuration",this.s.speed+"ms"));setTimeout(function(){t.default.addClass(document.querySelector(".lg-backdrop"),"in")});setTimeout(function(){t.default.addClass(i.outer,"lg-visible")},this.s.backdropDuration);this.s.download&&this.outer.querySelector(".lg-toolbar").insertAdjacentHTML("beforeend",'<\/a>');this.prevScrollTop=document.documentElement.scrollTop||document.body.scrollTop};i.prototype.setTop=function(){if(this.s.height!=="100%"){var n=window.innerHeight,t=(n-parseInt(this.s.height,10))/2,i=this.outer.querySelector(".lg");i.style.top=n>=parseInt(this.s.height,10)?t+"px":"0px"}};i.prototype.doCss=function(){var n=function(){for(var t=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],i=document.documentElement,n=0,n=0;n'+(parseInt(this.index,10)+1)+'<\/span> / '+this.items.length+"<\/span><\/div>")};i.prototype.addHtml=function(n){var i=null,r,u;this.s.dynamic?i=this.s.dynamicEl[n].subHtml:(r=this.items[n],i=r.getAttribute("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!i&&(i=r.getAttribute("title"),i&&r.querySelector("img")&&(i=r.querySelector("img").getAttribute("alt"))));typeof i!="undefined"&&i!==null?(u=i.substring(0,1),(u==="."||u==="#")&&(i=this.s.subHtmlSelectorRelative&&!this.s.dynamic?r.querySelector(i).innerHTML:document.querySelector(i).innerHTML)):i="";this.s.appendSubHtmlTo===".lg-sub-html"?this.outer.querySelector(this.s.appendSubHtmlTo).innerHTML=i:this.___slide[n].insertAdjacentHTML("beforeend",i);typeof i!="undefined"&&i!==null&&(i===""?t.default.addClass(this.outer.querySelector(this.s.appendSubHtmlTo),"lg-empty-html"):t.default.removeClass(this.outer.querySelector(this.s.appendSubHtmlTo),"lg-empty-html"));t.default.trigger(this.el,"onAfterAppendSubHtml",{index:n})};i.prototype.preload=function(n){for(var t=1,i=1,t=1;t<=this.s.preload;t++){if(t>=this.items.length-n)break;this.loadContent(n+t,!1,0)}for(i=1;i<=this.s.preload;i++){if(n-i<0)break;this.loadContent(n-i,!1,0)}};i.prototype.loadContent=function(n,i,r){var u=this,o=!1,s,e,a,h,c,v,p=function(n){for(var t,o,i,r=[],f=[],u=0;uo){e=f[i];break}},w,b,l,f,y;if(u.s.dynamic?(u.s.dynamicEl[n].poster&&(o=!0,a=u.s.dynamicEl[n].poster),v=u.s.dynamicEl[n].html,e=u.s.dynamicEl[n].src,u.s.dynamicEl[n].responsive&&(w=u.s.dynamicEl[n].responsive.split(","),p(w)),h=u.s.dynamicEl[n].srcset,c=u.s.dynamicEl[n].sizes):(u.items[n].getAttribute("data-poster")&&(o=!0,a=u.items[n].getAttribute("data-poster")),v=u.items[n].getAttribute("data-html"),e=u.items[n].getAttribute("href")||u.items[n].getAttribute("data-src"),u.items[n].getAttribute("data-responsive")&&(b=u.items[n].getAttribute("data-responsive").split(","),p(b)),h=u.items[n].getAttribute("data-srcset"),c=u.items[n].getAttribute("data-sizes")),l=!1,u.s.dynamic?u.s.dynamicEl[n].iframe&&(l=!0):u.items[n].getAttribute("data-iframe")==="true"&&(l=!0),f=u.isVideo(e,n),!t.default.hasClass(u.___slide[n],"lg-loaded")){if(l?u.___slide[n].insertAdjacentHTML("afterbegin",'