!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).glightbox=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof symbol&&"symbol"==typeof symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof symbol&&e.constructor===symbol&&e!==symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new typeerror("cannot call a class as a function")}function i(e,t){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=e[s]=e[s]||[],l={all:n,evt:null,found:null};return t&&i&&p(n)>0&&o(n,(function(e,n){if(e.eventname==t&&e.fn.tostring()==i.tostring())return l.found=!0,l.evt=n,!1})),l}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.onelement,n=t.withcallback,s=t.avoidduplicate,l=void 0===s||s,a=t.once,h=void 0!==a&&a,d=t.usecapture,c=void 0!==d&&d,u=arguments.length>2?arguments[2]:void 0,g=i||[];function v(e){t(n)&&n.call(u,e,this),h&&v.destroy()}return c(g)&&(g=document.queryselectorall(g)),v.destroy=function(){o(g,(function(t){var i=r(t,e,v);i.found&&i.all.splice(i.evt,1),t.removeeventlistener&&t.removeeventlistener(e,v,c)}))},o(g,(function(t){var i=r(t,e,v);(t.addeventlistener&&l&&!i.found||!l)&&(t.addeventlistener(e,v,c),i.all.push({eventname:e,fn:v}))})),v}function h(e,t){o(t.split(" "),(function(t){return e.classlist.add(t)}))}function d(e,t){o(t.split(" "),(function(t){return e.classlist.remove(t)}))}function c(e,t){return e.classlist.contains(t)}function u(e,t){for(;e!==document.body;){if(!(e=e.parentelement))return!1;if("function"==typeof e.matches?e.matches(t):e.msmatchesselector(t))return e}}function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||""===t)return!1;if("none"==t)return t(i)&&i(),!1;var n=x(),s=t.split(" ");o(s,(function(t){h(e,"g"+t)})),a(n,{onelement:e,avoidduplicate:!1,once:!0,withcallback:function(e,t){o(s,(function(e){d(t,"g"+e)})),t(i)&&i()}})}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(""==t)return e.style.webkittransform="",e.style.moztransform="",e.style.mstransform="",e.style.otransform="",e.style.transform="",!1;e.style.webkittransform=t,e.style.moztransform=t,e.style.mstransform=t,e.style.otransform=t,e.style.transform=t}function f(e){e.style.display="block"}function p(e){e.style.display="none"}function m(e){var t=document.createdocumentfragment(),i=document.createelement("div");for(i.innerhtml=e;i.firstchild;)t.appendchild(i.firstchild);return t}function y(){return{width:window.innerwidth||document.documentelement.clientwidth||document.body.clientwidth,height:window.innerheight||document.documentelement.clientheight||document.body.clientheight}}function x(){var e,t=document.createelement("fakeelement"),i={animation:"animationend",oanimation:"oanimationend",mozanimation:"animationend",webkitanimation:"webkitanimationend"};for(e in i)if(void 0!==t.style[e])return i[e]}function b(e,t,i,n){if(e())t();else{var s;i||(i=100);var l=setinterval((function(){e()&&(clearinterval(l),s&&cleartimeout(s),t())}),i);n&&(s=settimeout((function(){clearinterval(l)}),n))}}function s(e,t,i){if(i(e))console.error("inject assets error");else if(t(t)&&(i=t,t=!1),c(t)&&t in window)t(i)&&i();else{var n;if(-1!==e.indexof(".css")){if((n=document.queryselectorall('link[href="'+e+'"]'))&&n.length>0)return void(t(i)&&i());var s=document.getelementsbytagname("head")[0],l=s.queryselectorall('link[rel="stylesheet"]'),o=document.createelement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.media="all",l?s.insertbefore(o,l[0]):s.appendchild(o),void(t(i)&&i())}if((n=document.queryselectorall('script[src="'+e+'"]'))&&n.length>0){if(t(i)){if(c(t))return b((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}}else{var r=document.createelement("script");r.type="text/javascript",r.src=e,r.onload=function(){if(t(i)){if(c(t))return b((function(){return void 0!==window[t]}),(function(){i()})),!1;i()}},document.body.appendchild(r)}}}function w(){return"navigator"in window&&window.navigator.useragent.match(/(ipad)|(iphone)|(ipod)|(android)|(playbook)|(bb10)|(blackberry)|(opera mini)|(iemobile)|(webos)|(meego)/i)}function t(e){return"function"==typeof e}function c(e){return"string"==typeof e}function k(e){return!(!e||!e.nodetype||1!=e.nodetype)}function e(e){return array.isarray(e)}function a(e){return e&&e.length&&isfinite(e.length)}function l(t){return"object"===e(t)&&null!=t&&!t(t)&&!e(t)}function i(e){return null==e}function o(e,t){return null!==e&&hasownproperty.call(e,t)}function p(e){if(l(e)){if(e.keys)return e.keys().length;var t=0;for(var i in e)o(e,i)&&t++;return t}return e.length}function z(e){return!isnan(parsefloat(e))&&isfinite(e)}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=document.queryselectorall(".gbtn[data-taborder]:not(.disabled)");if(!t.length)return!1;if(1==t.length)return t[0];"string"==typeof e&&(e=parseint(e));var i=e<0?1:e+1;i>t.length&&(i="1");var n=[];o(t,(function(e){n.push(e.getattribute("data-taborder"))}));var s=n.filter((function(e){return e>=parseint(i)})),l=s.sort()[0];return document.queryselector('.gbtn[data-taborder="'.concat(l,'"]'))}function x(e){if(e.events.hasownproperty("keyboard"))return!1;e.events.keyboard=a("keydown",{onelement:window,withcallback:function(t,i){var n=(t=t||window.event).keycode;if(9==n){var s=document.queryselector(".gbtn.focused");if(!s){var l=!(!document.activeelement||!document.activeelement.nodename)&&document.activeelement.nodename.tolocalelowercase();if("input"==l||"textarea"==l||"button"==l)return}t.preventdefault();var o=document.queryselectorall(".gbtn[data-taborder]");if(!o||o.length<=0)return;if(!s){var r=m();return void(r&&(r.focus(),h(r,"focused")))}var a=m(s.getattribute("data-taborder"));d(s,"focused"),a&&(a.focus(),h(a,"focused"))}39==n&&e.nextslide(),37==n&&e.prevslide(),27==n&&e.close()}})}function y(e){return math.sqrt(e.x*e.x+e.y*e.y)}function q(e,t){var i=function(e,t){var i=y(e)*y(t);if(0===i)return 0;var n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/i;return n>1&&(n=1),math.acos(n)}(e,t);return function(e,t){return e.x*t.y-t.x*e.y}(e,t)>0&&(i*=-1),180*i/math.pi}var n=function(){function e(i){t(this,e),this.handlers=[],this.el=i}return n(e,[{key:"add",value:function(e){this.handlers.push(e)}},{key:"del",value:function(e){e||(this.handlers=[]);for(var t=this.handlers.length;t>=0;t--)this.handlers[t]===e&&this.handlers.splice(t,1)}},{key:"dispatch",value:function(){for(var e=0,t=this.handlers.length;e=0)console.log("ignore drag for this touched element",e.target.nodename.tolowercase());else{this.now=date.now(),this.x1=e.touches[0].pagex,this.y1=e.touches[0].pagey,this.delta=this.now-(this.last||this.now),this.touchstart.dispatch(e,this.element),null!==this.pretapposition.x&&(this.isdoubletap=this.delta>0&&this.delta<=250&&math.abs(this.pretapposition.x-this.x1)<30&&math.abs(this.pretapposition.y-this.y1)<30,this.isdoubletap&&cleartimeout(this.singletaptimeout)),this.pretapposition.x=this.x1,this.pretapposition.y=this.y1,this.last=this.now;var t=this.prev;if(e.touches.length>1){this._cancellongtap(),this._cancelsingletap();var i={x:e.touches[1].pagex-this.x1,y:e.touches[1].pagey-this.y1};t.x=i.x,t.y=i.y,this.pinchstartlen=y(t),this.multipointstart.dispatch(e,this.element)}this._preventtap=!1,this.longtaptimeout=settimeout(function(){this.longtap.dispatch(e,this.element),this._preventtap=!0}.bind(this),750)}}}},{key:"move",value:function(e){if(e.touches){var t=this.prev,i=e.touches.length,n=e.touches[0].pagex,s=e.touches[0].pagey;if(this.isdoubletap=!1,i>1){var l=e.touches[1].pagex,o=e.touches[1].pagey,r={x:e.touches[1].pagex-n,y:e.touches[1].pagey-s};null!==t.x&&(this.pinchstartlen>0&&(e.zoom=y(r)/this.pinchstartlen,this.pinch.dispatch(e,this.element)),e.angle=q(r,t),this.rotate.dispatch(e,this.element)),t.x=r.x,t.y=r.y,null!==this.x2&&null!==this.sx2?(e.deltax=(n-this.x2+l-this.sx2)/2,e.deltay=(s-this.y2+o-this.sy2)/2):(e.deltax=0,e.deltay=0),this.twofingerpressmove.dispatch(e,this.element),this.sx2=l,this.sy2=o}else{if(null!==this.x2){e.deltax=n-this.x2,e.deltay=s-this.y2;var a=math.abs(this.x1-this.x2),h=math.abs(this.y1-this.y2);(a>10||h>10)&&(this._preventtap=!0)}else e.deltax=0,e.deltay=0;this.pressmove.dispatch(e,this.element)}this.touchmove.dispatch(e,this.element),this._cancellongtap(),this.x2=n,this.y2=s,i>1&&e.preventdefault()}}},{key:"end",value:function(e){if(e.changedtouches){this._cancellongtap();var t=this;e.touches.length<2&&(this.multipointend.dispatch(e,this.element),this.sx2=this.sy2=null),this.x2&&math.abs(this.x1-this.x2)>30||this.y2&&math.abs(this.y1-this.y2)>30?(e.direction=this._swipedirection(this.x1,this.x2,this.y1,this.y2),this.swipetimeout=settimeout((function(){t.swipe.dispatch(e,t.element)}),0)):(this.taptimeout=settimeout((function(){t._preventtap||t.tap.dispatch(e,t.element),t.isdoubletap&&(t.doubletap.dispatch(e,t.element),t.isdoubletap=!1)}),0),t.isdoubletap||(t.singletaptimeout=settimeout((function(){t.singletap.dispatch(e,t.element)}),250))),this.touchend.dispatch(e,this.element),this.prev.x=0,this.prev.y=0,this.zoom=1,this.pinchstartlen=null,this.x1=this.x2=this.y1=this.y2=null}}},{key:"cancelall",value:function(){this._preventtap=!0,cleartimeout(this.singletaptimeout),cleartimeout(this.taptimeout),cleartimeout(this.longtaptimeout),cleartimeout(this.swipetimeout)}},{key:"cancel",value:function(e){this.cancelall(),this.touchcancel.dispatch(e,this.element)}},{key:"_cancellongtap",value:function(){cleartimeout(this.longtaptimeout)}},{key:"_cancelsingletap",value:function(){cleartimeout(this.singletaptimeout)}},{key:"_swipedirection",value:function(e,t,i,n){return math.abs(e-t)>=math.abs(i-n)?e-t>0?"left":"right":i-n>0?"up":"down"}},{key:"on",value:function(e,t){this[e]&&this[e].add(t)}},{key:"off",value:function(e,t){this[e]&&this[e].del(t)}},{key:"destroy",value:function(){return this.singletaptimeout&&cleartimeout(this.singletaptimeout),this.taptimeout&&cleartimeout(this.taptimeout),this.longtaptimeout&&cleartimeout(this.longtaptimeout),this.swipetimeout&&cleartimeout(this.swipetimeout),this.element.removeeventlistener("touchstart",this.start),this.element.removeeventlistener("touchmove",this.move),this.element.removeeventlistener("touchend",this.end),this.element.removeeventlistener("touchcancel",this.cancel),this.rotate.del(),this.touchstart.del(),this.multipointstart.del(),this.multipointend.del(),this.pinch.del(),this.swipe.del(),this.tap.del(),this.doubletap.del(),this.longtap.del(),this.singletap.del(),this.pressmove.del(),this.twofingerpressmove.del(),this.touchmove.del(),this.touchend.del(),this.touchcancel.del(),this.prev=this.pinchstartlen=this.zoom=this.isdoubletap=this.delta=this.last=this.now=this.taptimeout=this.singletaptimeout=this.longtaptimeout=this.swipetimeout=this.x1=this.x2=this.y1=this.y2=this.pretapposition=this.rotate=this.touchstart=this.multipointstart=this.multipointend=this.pinch=this.swipe=this.tap=this.doubletap=this.longtap=this.singletap=this.pressmove=this.touchmove=this.touchend=this.touchcancel=this.twofingerpressmove=null,window.removeeventlistener("scroll",this._cancelallhandler),null}}]),e}();function w(e){var t=function(){var e,t=document.createelement("fakeelement"),i={transition:"transitionend",otransition:"otransitionend",moztransition:"transitionend",webkittransition:"webkittransitionend"};for(e in i)if(void 0!==t.style[e])return i[e]}(),i=window.innerwidth||document.documentelement.clientwidth||document.body.clientwidth,n=c(e,"gslide-media")?e:e.queryselector(".gslide-media"),s=u(n,".ginner-container"),l=e.queryselector(".gslide-description");i>769&&(n=s),h(n,"greset"),v(n,"translate3d(0, 0, 0)"),a(t,{onelement:n,once:!0,withcallback:function(e,t){d(n,"greset")}}),n.style.opacity="",l&&(l.style.opacity="")}function b(e){if(e.events.hasownproperty("touch"))return!1;var t,i,n,s=y(),l=s.width,o=s.height,r=!1,a=null,g=null,f=null,p=!1,m=1,x=1,b=!1,s=!1,w=null,t=null,c=null,k=null,e=0,a=0,l=!1,i=!1,o={},p={},z=0,m=0,x=document.getelementbyid("glightbox-slider"),y=document.queryselector(".goverlay"),q=new _(x,{touchstart:function(t){if(r=!0,(c(t.targettouches[0].target,"ginner-container")||u(t.targettouches[0].target,".gslide-desc")||"a"==t.targettouches[0].target.nodename.tolowercase())&&(r=!1),u(t.targettouches[0].target,".gslide-inline")&&!c(t.targettouches[0].target.parentnode,"gslide-inline")&&(r=!1),r){if(p=t.targettouches[0],o.pagex=t.targettouches[0].pagex,o.pagey=t.targettouches[0].pagey,z=t.targettouches[0].clientx,m=t.targettouches[0].clienty,a=e.activeslide,g=a.queryselector(".gslide-media"),n=a.queryselector(".gslide-inline"),f=null,c(g,"gslide-image")&&(f=g.queryselector("img")),(window.innerwidth||document.documentelement.clientwidth||document.body.clientwidth)>769&&(g=a.queryselector(".ginner-container")),d(y,"greset"),t.pagex>20&&t.pagexo){var a=o.pagex-p.pagex;if(math.abs(a)<=13)return!1}p=!0;var h,d=s.targettouches[0].clientx,c=s.targettouches[0].clienty,u=z-d,m=m-c;if(math.abs(u)>math.abs(m)?(l=!1,i=!0):(i=!1,l=!0),t=p.pagex-o.pagex,e=100*t/l,i=p.pagey-o.pagey,a=100*i/o,l&&f&&(h=1-math.abs(i)/o,y.style.opacity=h,e.settings.touchfollowaxis&&(e=0)),i&&(h=1-math.abs(t)/l,g.style.opacity=h,e.settings.touchfollowaxis&&(a=0)),!f)return v(g,"translate3d(".concat(e,"%, 0, 0)"));v(g,"translate3d(".concat(e,"%, ").concat(a,"%, 0)"))}},touchend:function(){if(r){if(p=!1,s||b)return c=w,void(k=t);var t=math.abs(parseint(a)),i=math.abs(parseint(e));if(!(t>29&&f))return t<29&&i<25?(h(y,"greset"),y.style.opacity=1,w(g)):void 0;e.close()}},multipointend:function(){settimeout((function(){b=!1}),50)},multipointstart:function(){b=!0,m=x||1},pinch:function(e){if(!f||p)return!1;b=!0,f.scalex=f.scaley=m*e.zoom;var t=m*e.zoom;if(s=!0,t<=1)return s=!1,t=1,k=null,c=null,w=null,t=null,void f.setattribute("style","");t>4.5&&(t=4.5),f.style.transform="scale3d(".concat(t,", ").concat(t,", 1)"),x=t},pressmove:function(e){if(s&&!b){var t=p.pagex-o.pagex,i=p.pagey-o.pagey;c&&(t+=c),k&&(i+=k),w=t,t=i;var n="translate3d(".concat(t,"px, ").concat(i,"px, 0)");x&&(n+=" scale3d(".concat(x,", ").concat(x,", 1)")),v(f,n)}},swipe:function(t){if(!s)if(b)b=!1;else{if("left"==t.direction){if(e.index==e.elements.length-1)return w(g);e.nextslide()}if("right"==t.direction){if(0==e.index)return w(g);e.prevslide()}}}});e.events.touch=q}var h=function(){function e(i,n){var s=this,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t(this,e),this.img=i,this.slide=n,this.onclose=l,this.img.setzoomevents)return!1;this.active=!1,this.zoomedin=!1,this.dragging=!1,this.currentx=null,this.currenty=null,this.initialx=null,this.initialy=null,this.xoffset=0,this.yoffset=0,this.img.addeventlistener("mousedown",(function(e){return s.dragstart(e)}),!1),this.img.addeventlistener("mouseup",(function(e){return s.dragend(e)}),!1),this.img.addeventlistener("mousemove",(function(e){return s.drag(e)}),!1),this.img.addeventlistener("click",(function(e){return s.slide.classlist.contains("dragging-nav")?(s.zoomout(),!1):s.zoomedin?void(s.zoomedin&&!s.dragging&&s.zoomout()):s.zoomin()}),!1),this.img.setzoomevents=!0}return n(e,[{key:"zoomin",value:function(){var e=this.widowwidth();if(!(this.zoomedin||e<=768)){var t=this.img;if(t.setattribute("data-style",t.getattribute("style")),t.style.maxwidth=t.naturalwidth+"px",t.style.maxheight=t.naturalheight+"px",t.naturalwidth>e){var i=e/2-t.naturalwidth/2;this.settranslate(this.img.parentnode,i,0)}this.slide.classlist.add("zoomed"),this.zoomedin=!0}}},{key:"zoomout",value:function(){this.img.parentnode.setattribute("style",""),this.img.setattribute("style",this.img.getattribute("data-style")),this.slide.classlist.remove("zoomed"),this.zoomedin=!1,this.currentx=null,this.currenty=null,this.initialx=null,this.initialy=null,this.xoffset=0,this.yoffset=0,this.onclose&&"function"==typeof this.onclose&&this.onclose()}},{key:"dragstart",value:function(e){e.preventdefault(),this.zoomedin?("touchstart"===e.type?(this.initialx=e.touches[0].clientx-this.xoffset,this.initialy=e.touches[0].clienty-this.yoffset):(this.initialx=e.clientx-this.xoffset,this.initialy=e.clienty-this.yoffset),e.target===this.img&&(this.active=!0,this.img.classlist.add("dragging"))):this.active=!1}},{key:"dragend",value:function(e){var t=this;e.preventdefault(),this.initialx=this.currentx,this.initialy=this.currenty,this.active=!1,settimeout((function(){t.dragging=!1,t.img.isdragging=!1,t.img.classlist.remove("dragging")}),100)}},{key:"drag",value:function(e){this.active&&(e.preventdefault(),"touchmove"===e.type?(this.currentx=e.touches[0].clientx-this.initialx,this.currenty=e.touches[0].clienty-this.initialy):(this.currentx=e.clientx-this.initialx,this.currenty=e.clienty-this.initialy),this.xoffset=this.currentx,this.yoffset=this.currenty,this.img.isdragging=!0,this.dragging=!0,this.settranslate(this.img,this.currentx,this.currenty))}},{key:"onmove",value:function(e){if(this.zoomedin){var t=e.clientx-this.img.naturalwidth/2,i=e.clienty-this.img.naturalheight/2;this.settranslate(this.img,t,i)}}},{key:"settranslate",value:function(e,t,i){e.style.transform="translate3d("+t+"px, "+i+"px, 0)"}},{key:"widowwidth",value:function(){return window.innerwidth||document.documentelement.clientwidth||document.body.clientwidth}}]),e}(),v=function(){function e(){var i=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e);var s=n.dragel,l=n.tolerancex,o=void 0===l?40:l,r=n.tolerancey,a=void 0===r?65:r,h=n.slide,d=void 0===h?null:h,c=n.instance,u=void 0===c?null:c;this.el=s,this.active=!1,this.dragging=!1,this.currentx=null,this.currenty=null,this.initialx=null,this.initialy=null,this.xoffset=0,this.yoffset=0,this.direction=null,this.lastdirection=null,this.tolerancex=o,this.tolerancey=a,this.tolerancereached=!1,this.dragcontainer=this.el,this.slide=d,this.instance=u,this.el.addeventlistener("mousedown",(function(e){return i.dragstart(e)}),!1),this.el.addeventlistener("mouseup",(function(e){return i.dragend(e)}),!1),this.el.addeventlistener("mousemove",(function(e){return i.drag(e)}),!1)}return n(e,[{key:"dragstart",value:function(e){if(this.slide.classlist.contains("zoomed"))this.active=!1;else{"touchstart"===e.type?(this.initialx=e.touches[0].clientx-this.xoffset,this.initialy=e.touches[0].clienty-this.yoffset):(this.initialx=e.clientx-this.xoffset,this.initialy=e.clienty-this.yoffset);var t=e.target.nodename.tolowercase();e.target.classlist.contains("nodrag")||u(e.target,".nodrag")||-1!==["input","select","textarea","button","a"].indexof(t)?this.active=!1:(e.preventdefault(),(e.target===this.el||"img"!==t&&u(e.target,".gslide-inline"))&&(this.active=!0,this.el.classlist.add("dragging"),this.dragcontainer=u(e.target,".ginner-container")))}}},{key:"dragend",value:function(e){var t=this;e&&e.preventdefault(),this.initialx=0,this.initialy=0,this.currentx=null,this.currenty=null,this.initialx=null,this.initialy=null,this.xoffset=0,this.yoffset=0,this.active=!1,this.doslidechange&&(this.instance.preventoutsideclick=!0,"right"==this.doslidechange&&this.instance.prevslide(),"left"==this.doslidechange&&this.instance.nextslide()),this.doslideclose&&this.instance.close(),this.tolerancereached||this.settranslate(this.dragcontainer,0,0,!0),settimeout((function(){t.instance.preventoutsideclick=!1,t.tolerancereached=!1,t.lastdirection=null,t.dragging=!1,t.el.isdragging=!1,t.el.classlist.remove("dragging"),t.slide.classlist.remove("dragging-nav"),t.dragcontainer.style.transform="",t.dragcontainer.style.transition=""}),100)}},{key:"drag",value:function(e){if(this.active){e.preventdefault(),this.slide.classlist.add("dragging-nav"),"touchmove"===e.type?(this.currentx=e.touches[0].clientx-this.initialx,this.currenty=e.touches[0].clienty-this.initialy):(this.currentx=e.clientx-this.initialx,this.currenty=e.clienty-this.initialy),this.xoffset=this.currentx,this.yoffset=this.currenty,this.el.isdragging=!0,this.dragging=!0,this.doslidechange=!1,this.doslideclose=!1;var t=math.abs(this.currentx),i=math.abs(this.currenty);if(t>0&&t>=math.abs(this.currenty)&&(!this.lastdirection||"x"==this.lastdirection)){this.yoffset=0,this.lastdirection="x",this.settranslate(this.dragcontainer,this.currentx,0);var n=this.shouldchange();if(!this.instance.settings.dragautosnap&&n&&(this.doslidechange=n),this.instance.settings.dragautosnap&&n)return this.instance.preventoutsideclick=!0,this.tolerancereached=!0,this.active=!1,this.instance.preventoutsideclick=!0,this.dragend(null),"right"==n&&this.instance.prevslide(),void("left"==n&&this.instance.nextslide())}if(this.tolerancey>0&&i>0&&i>=t&&(!this.lastdirection||"y"==this.lastdirection)){this.xoffset=0,this.lastdirection="y",this.settranslate(this.dragcontainer,0,this.currenty);var s=this.shouldclose();return!this.instance.settings.dragautosnap&&s&&(this.doslideclose=!0),void(this.instance.settings.dragautosnap&&s&&this.instance.close())}}}},{key:"shouldchange",value:function(){var e=!1;if(math.abs(this.currentx)>=this.tolerancex){var t=this.currentx>0?"right":"left";("left"==t&&this.slide!==this.slide.parentnode.lastchild||"right"==t&&this.slide!==this.slide.parentnode.firstchild)&&(e=t)}return e}},{key:"shouldclose",value:function(){var e=!1;return math.abs(this.currenty)>=this.tolerancey&&(e=!0),e}},{key:"settranslate",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.style.transition=n?"all .2s ease":"",e.style.transform="translate3d(".concat(t,"px, ").concat(i,"px, 0)")}}]),e}();function j(e,t,i,n){var s=e.queryselector(".gslide-media"),l=new image,o="gslidetitle_"+i,r="gslidedesc_"+i;l.addeventlistener("load",(function(){t(n)&&n()}),!1),l.src=t.href,""!=t.sizes&&""!=t.srcset&&(l.sizes=t.sizes,l.srcset=t.srcset),l.alt="",i(t.alt)||""===t.alt||(l.alt=t.alt),""!==t.title&&l.setattribute("aria-labelledby",o),""!==t.description&&l.setattribute("aria-describedby",r),t.hasownproperty("_hascustomwidth")&&t._hascustomwidth&&(l.style.width=t.width),t.hasownproperty("_hascustomheight")&&t._hascustomheight&&(l.style.height=t.height),s.insertbefore(l,s.firstchild)}function f(e,t,i,n){var s=this,l=e.queryselector(".ginner-container"),o="gvideo"+i,r=e.queryselector(".gslide-media"),a=this.getallplayers();h(l,"gvideo-container"),r.insertbefore(m('
'),r.firstchild);var d=e.queryselector(".gvideo-wrapper");s(this.settings.plyr.css,"plyr");var c=t.href,u=location.protocol.replace(":",""),g="",v="",f=!1;"file"==u&&(u="http"),r.style.maxwidth=t.width,s(this.settings.plyr.js,"plyr",(function(){if(c.match(/vimeo\.com\/([0-9]*)/)){var l=/vimeo.*\/(\d+)/i.exec(c);g="vimeo",v=l[1]}if(c.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-za-z0-9\-_]+)/)||c.match(/youtu\.be\/([a-za-z0-9\-_]+)/)||c.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-za-z0-9\-_]+)/)){var r=function(e){var t="";t=void 0!==(e=e.replace(/(>|<)/gi,"").split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/))[2]?(t=e[2].split(/[^0-9a-z_\-]/i))[0]:e;return t}(c);g="youtube",v=r}if(null!==c.match(/\.(mp4|ogg|webm|mov)$/)){g="local";var u='")}var w=f||m('
'));h(d,"".concat(g,"-video gvideo")),d.appendchild(w),d.setattribute("data-id",o),d.setattribute("data-index",i);var c=o(s.settings.plyr,"config")?s.settings.plyr.config:{},k=new plyr("#"+o,c);k.on("ready",(function(e){var t=e.detail.plyr;a[o]=t,t(n)&&n()})),b((function(){return e.queryselector("iframe")&&"true"==e.queryselector("iframe").dataset.ready}),(function(){s.resize(e)})),k.on("enterfullscreen",r),k.on("exitfullscreen",r)}))}function r(e){var t=u(e.target,".gslide-media");"enterfullscreen"==e.type&&h(t,"fullscreen"),"exitfullscreen"==e.type&&d(t,"fullscreen")}function g(e,t,i,n){var s,l=this,o=e.queryselector(".gslide-media"),r=!(!o(t,"href")||!t.href)&&t.href.split("#").pop().trim(),d=!(!o(t,"content")||!t.content)&&t.content;if(d&&(c(d)&&(s=m('
'.concat(d,"
"))),k(d))){"none"==d.style.display&&(d.style.display="block");var c=document.createelement("div");c.classname="ginlined-content",c.appendchild(d),s=c}if(r){var u=document.getelementbyid(r);if(!u)return!1;var g=u.clonenode(!0);g.style.height=t.height,g.style.maxwidth=t.width,h(g,"ginlined-content"),s=g}if(!s)return console.error("unable to append inline slide content",t),!1;o.style.height=t.height,o.style.width=t.width,o.appendchild(s),this.events["inlineclose"+r]=a("click",{onelement:o.queryselectorall(".gtrigger-close"),withcallback:function(e){e.preventdefault(),l.close()}}),t(n)&&n()}function z(e,t,i,n){var s=e.queryselector(".gslide-media"),l=function(e){var t=e.url,i=e.allow,n=e.callback,s=e.appendto,l=document.createelement("iframe");return l.classname="vimeo-video gvideo",l.src=t,l.style.width="100%",l.style.height="100%",i&&l.setattribute("allow",i),l.onload=function(){h(l,"node-ready"),t(n)&&n()},s&&s.appendchild(l),l}({url:t.href,callback:n});s.parentnode.style.maxwidth=t.width,s.parentnode.style.height=t.height,s.appendchild(l)}var $=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),this.defaults={href:"",sizes:"",srcset:"",title:"",type:"",description:"",alt:"",descposition:"bottom",effect:"",width:"",height:"",content:!1,zoomable:!0,draggable:!0},l(i)&&(this.defaults=l(this.defaults,i))}return n(e,[{key:"sourcetype",value:function(e){var t=e;if(null!==(e=e.tolowercase()).match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|avif|svg)/))return"image";if(e.match(/(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-za-z0-9\-_]+)/)||e.match(/youtu\.be\/([a-za-z0-9\-_]+)/)||e.match(/(youtube\.com|youtube-nocookie\.com)\/embed\/([a-za-z0-9\-_]+)/))return"video";if(e.match(/vimeo\.com\/([0-9]*)/))return"video";if(null!==e.match(/\.(mp4|ogg|webm|mov)/))return"video";if(null!==e.match(/\.(mp3|wav|wma|aac|ogg)/))return"audio";if(e.indexof("#")>-1&&""!==t.split("#").pop().trim())return"inline";return e.indexof("goajax=true")>-1?"ajax":"external"}},{key:"parseconfig",value:function(e,t){var i=this,n=l({descposition:t.descposition},this.defaults);if(l(e)&&!k(e)){o(e,"type")||(o(e,"content")&&e.content?e.type="inline":o(e,"href")&&(e.type=this.sourcetype(e.href)));var s=l(n,e);return this.setsize(s,t),s}var r="",a=e.getattribute("data-glightbox"),h=e.nodename.tolowercase();if("a"===h&&(r=e.href),"img"===h&&(r=e.src,n.alt=e.alt),n.href=r,o(n,(function(s,l){o(t,l)&&"width"!==l&&(n[l]=t[l]);var o=e.dataset[l];i(o)||(n[l]=i.sanitizevalue(o))})),n.content&&(n.type="inline"),!n.type&&r&&(n.type=this.sourcetype(r)),i(a)){if(!n.title&&"a"==h){var d=e.title;i(d)||""===d||(n.title=d)}if(!n.title&&"img"==h){var c=e.alt;i(c)||""===c||(n.title=c)}}else{var u=[];o(n,(function(e,t){u.push(";\\s?"+t)})),u=u.join("\\s?:|"),""!==a.trim()&&o(n,(function(e,t){var s=a,l=new regexp("s?"+t+"s?:s?(.*?)("+u+"s?:|$)"),o=s.match(l);if(o&&o.length&&o[1]){var r=o[1].trim().replace(/;\s*$/,"");n[t]=i.sanitizevalue(r)}}))}if(n.description&&"."===n.description.substring(0,1)){var g;try{g=document.queryselector(n.description).innerhtml}catch(e){if(!(e instanceof domexception))throw e}g&&(n.description=g)}if(!n.description){var v=e.queryselector(".glightbox-desc");v&&(n.description=v.innerhtml)}return this.setsize(n,t,e),this.slideconfig=n,n}},{key:"setsize",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n="video"==e.type?this.checksize(t.videoswidth):this.checksize(t.width),s=this.checksize(t.height);return e.width=o(e,"width")&&""!==e.width?this.checksize(e.width):n,e.height=o(e,"height")&&""!==e.height?this.checksize(e.height):s,i&&"image"==e.type&&(e._hascustomwidth=!!i.dataset.width,e._hascustomheight=!!i.dataset.height),e}},{key:"checksize",value:function(e){return z(e)?"".concat(e,"px"):e}},{key:"sanitizevalue",value:function(e){return"true"!==e&&"false"!==e?e:"true"===e}}]),e}(),u=function(){function e(i,n,s){t(this,e),this.element=i,this.instance=n,this.index=s}return n(e,[{key:"setcontent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(c(t,"loaded"))return!1;var n=this.instance.settings,s=this.slideconfig,l=w();t(n.beforeslideload)&&n.beforeslideload({index:this.index,slide:t,player:!1});var o=s.type,r=s.descposition,a=t.queryselector(".gslide-media"),d=t.queryselector(".gslide-title"),u=t.queryselector(".gslide-desc"),g=t.queryselector(".gdesc-inner"),v=i,f="gslidetitle_"+this.index,p="gslidedesc_"+this.index;if(t(n.afterslideload)&&(v=function(){t(i)&&i(),n.afterslideload({index:e.index,slide:t,player:e.instance.getslideplayerinstance(e.index)})}),""==s.title&&""==s.description?g&&g.parentnode.parentnode.removechild(g.parentnode):(d&&""!==s.title?(d.id=f,d.innerhtml=s.title):d.parentnode.removechild(d),u&&""!==s.description?(u.id=p,l&&n.morelength>0?(s.smalldescription=this.slideshortdesc(s.description,n.morelength,n.moretext),u.innerhtml=s.smalldescription,this.descriptionevents(u,s)):u.innerhtml=s.description):u.parentnode.removechild(u),h(a.parentnode,"desc-".concat(r)),h(g.parentnode,"description-".concat(r))),h(a,"gslide-".concat(o)),h(t,"loaded"),"video"!==o){if("external"!==o)return"inline"===o?(g.apply(this.instance,[t,s,this.index,v]),void(s.draggable&&new v({dragel:t.queryselector(".gslide-inline"),tolerancex:n.dragtolerancex,tolerancey:n.dragtolerancey,slide:t,instance:this.instance}))):void("image"!==o?t(v)&&v():j(t,s,this.index,(function(){var i=t.queryselector("img");s.draggable&&new v({dragel:i,tolerancex:n.dragtolerancex,tolerancey:n.dragtolerancey,slide:t,instance:e.instance}),s.zoomable&&i.naturalwidth>i.offsetwidth&&(h(i,"zoomable"),new h(i,t,(function(){e.instance.resize()}))),t(v)&&v()})));z.apply(this,[t,s,this.index,v])}else f.apply(this.instance,[t,s,this.index,v])}},{key:"slideshortdesc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=document.createelement("div");n.innerhtml=e;var s=n.innertext,l=i;if((e=s.trim()).length<=t)return e;var o=e.substr(0,t-1);return l?(n=null,o+'... '+i+""):o}},{key:"descriptionevents",value:function(e,t){var i=this,n=e.queryselector(".desc-more");if(!n)return!1;a("click",{onelement:n,withcallback:function(e,n){e.preventdefault();var s=document.body,l=u(n,".gslide-desc");if(!l)return!1;l.innerhtml=t.description,h(s,"gdesc-open");var o=a("click",{onelement:[s,u(l,".gslide-description")],withcallback:function(e,n){"a"!==e.target.nodename.tolowercase()&&(d(s,"gdesc-open"),h(s,"gdesc-closed"),l.innerhtml=t.smalldescription,i.descriptionevents(l,t),settimeout((function(){d(s,"gdesc-closed")}),400),o.destroy())}})}})}},{key:"create",value:function(){return m(this.instance.settings.slidehtml)}},{key:"getconfig",value:function(){k(this.element)||this.element.hasownproperty("draggable")||(this.element.draggable=this.instance.settings.draggable);var e=new $(this.instance.settings.slideextraattributes);return this.slideconfig=e.parseconfig(this.element,this.instance.settings),this.slideconfig}}]),e}(),j=w(),k=null!==w()||void 0!==document.createtouch||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msmaxtouchpoints,q=document.getelementsbytagname("html")[0],ee={selector:".glightbox",elements:null,skin:"clean",theme:"clean",closebutton:!0,startat:null,autoplayvideos:!0,autofocusvideos:!0,descposition:"bottom",width:"900px",height:"506px",videoswidth:"960px",beforeslidechange:null,afterslidechange:null,beforeslideload:null,afterslideload:null,slideinserted:null,slideremoved:null,slideextraattributes:null,onopen:null,onclose:null,loop:!1,zoomable:!0,draggable:!0,dragautosnap:!1,dragtolerancex:40,dragtolerancey:65,preload:!0,oneslideperopen:!1,touchnavigation:!0,touchfollowaxis:!0,keyboardnavigation:!0,closeonoutsideclick:!0,plugins:!1,plyr:{css:"https://cdn.plyr.io/3.6.8/plyr.css",js:"https://cdn.plyr.io/3.6.8/plyr.js",config:{ratio:"16:9",fullscreen:{enabled:!0,iosnative:!0},youtube:{nocookie:!0,rel:0,showinfo:0,iv_load_policy:3},vimeo:{byline:!1,portrait:!1,title:!1,transparent:!1}}},openeffect:"zoom",closeeffect:"zoom",slideeffect:"slide",moretext:"see more",morelength:60,cssefects:{fade:{in:"fadein",out:"fadeout"},zoom:{in:"zoomin",out:"zoomout"},slide:{in:"slideinright",out:"slideoutleft"},slideback:{in:"slideinleft",out:"slideoutright"},none:{in:"none",out:"none"}},svg:{close:'',next:' ',prev:''},slidehtml:'
\n
\n
\n
\n
\n
\n
\n

\n
\n
\n
\n
\n
\n
',lightboxhtml:''},te=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),this.customoptions=i,this.settings=l(ee,i),this.effectsclasses=this.getanimationclasses(),this.videoplayers={},this.apievents=[],this.fullelementslist=!1}return n(e,[{key:"init",value:function(){var e=this,t=this.getselector();t&&(this.baseevents=a("click",{onelement:t,withcallback:function(t,i){t.preventdefault(),e.open(i)}})),this.elements=this.getelements()}},{key:"open",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0==this.elements.length)return!1;this.activeslide=null,this.prevactiveslideindex=null,this.prevactiveslide=null;var i=z(t)?t:this.settings.startat;if(k(e)){var n=e.getattribute("data-gallery");n&&(this.fullelementslist=this.elements,this.elements=this.getgalleryelements(this.elements,n)),i(i)&&(i=this.getelementindex(e))<0&&(i=0)}z(i)||(i=0),this.build(),g(this.overlay,"none"==this.settings.openeffect?"none":this.settings.cssefects.fade.in);var s=document.body,l=window.innerwidth-document.documentelement.clientwidth;if(l>0){var o=document.createelement("style");o.type="text/css",o.classname="gcss-styles",o.innertext=".gscrollbar-fixer {margin-right: ".concat(l,"px}"),document.head.appendchild(o),h(s,"gscrollbar-fixer")}h(s,"glightbox-open"),h(q,"glightbox-open"),j&&(h(document.body,"glightbox-mobile"),this.settings.slideeffect="slide"),this.showslide(i,!0),1==this.elements.length?(h(this.prevbutton,"glightbox-button-hidden"),h(this.nextbutton,"glightbox-button-hidden")):(d(this.prevbutton,"glightbox-button-hidden"),d(this.nextbutton,"glightbox-button-hidden")),this.lightboxopen=!0,this.trigger("open"),t(this.settings.onopen)&&this.settings.onopen(),k&&this.settings.touchnavigation&&b(this),this.settings.keyboardnavigation&&x(this)}},{key:"openat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.open(null,e)}},{key:"showslide",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];f(this.loader),this.index=parseint(t);var n=this.slidescontainer.queryselector(".current");n&&d(n,"current"),this.slideanimateout();var s=this.slidescontainer.queryselectorall(".gslide")[t];if(c(s,"loaded"))this.slideanimatein(s,i),p(this.loader);else{f(this.loader);var l=this.elements[t],o={index:this.index,slide:s,slidenode:s,slideconfig:l.slideconfig,slideindex:this.index,trigger:l.node,player:null};this.trigger("slide_before_load",o),l.instance.setcontent(s,(function(){p(e.loader),e.resize(),e.slideanimatein(s,i),e.trigger("slide_after_load",o)}))}this.slidedescription=s.queryselector(".gslide-description"),this.slidedescriptioncontained=this.slidedescription&&c(this.slidedescription.parentnode,"gslide-media"),this.settings.preload&&(this.preloadslide(t+1),this.preloadslide(t-1)),this.updatenavigationclasses(),this.activeslide=s}},{key:"preloadslide",value:function(e){var t=this;if(e<0||e>this.elements.length-1)return!1;if(i(this.elements[e]))return!1;var i=this.slidescontainer.queryselectorall(".gslide")[e];if(c(i,"loaded"))return!1;var n=this.elements[e],s=n.type,l={index:e,slide:i,slidenode:i,slideconfig:n.slideconfig,slideindex:e,trigger:n.node,player:null};this.trigger("slide_before_load",l),"video"==s||"external"==s?settimeout((function(){n.instance.setcontent(i,(function(){t.trigger("slide_after_load",l)}))}),200):n.instance.setcontent(i,(function(){t.trigger("slide_after_load",l)}))}},{key:"prevslide",value:function(){this.gotoslide(this.index-1)}},{key:"nextslide",value:function(){this.gotoslide(this.index+1)}},{key:"gotoslide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.prevactiveslide=this.activeslide,this.prevactiveslideindex=this.index,!this.loop()&&(e<0||e>this.elements.length-1))return!1;e<0?e=this.elements.length-1:e>=this.elements.length&&(e=0),this.showslide(e)}},{key:"insertslide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;t<0&&(t=this.elements.length);var i=new u(e,this,t),n=i.getconfig(),s=l({},n),o=i.create(),r=this.elements.length-1;s.index=t,s.node=!1,s.instance=i,s.slideconfig=n,this.elements.splice(t,0,s);var a=null,h=null;if(this.slidescontainer){if(t>r)this.slidescontainer.appendchild(o);else{var d=this.slidescontainer.queryselectorall(".gslide")[t];this.slidescontainer.insertbefore(o,d)}(this.settings.preload&&0==this.index&&0==t||this.index-1==t||this.index+1==t)&&this.preloadslide(t),0==this.index&&0==t&&(this.index=1),this.updatenavigationclasses(),a=this.slidescontainer.queryselectorall(".gslide")[t],h=this.getslideplayerinstance(t),s.slidenode=a}this.trigger("slide_inserted",{index:t,slide:a,slidenode:a,slideconfig:n,slideindex:t,trigger:null,player:h}),t(this.settings.slideinserted)&&this.settings.slideinserted({index:t,slide:a,player:h})}},{key:"removeslide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e<0||e>this.elements.length-1)return!1;var t=this.slidescontainer&&this.slidescontainer.queryselectorall(".gslide")[e];t&&(this.getactiveslideindex()==e&&(e==this.elements.length-1?this.prevslide():this.nextslide()),t.parentnode.removechild(t)),this.elements.splice(e,1),this.trigger("slide_removed",e),t(this.settings.slideremoved)&&this.settings.slideremoved(e)}},{key:"slideanimatein",value:function(e,t){var i=this,n=e.queryselector(".gslide-media"),s=e.queryselector(".gslide-description"),l={index:this.prevactiveslideindex,slide:this.prevactiveslide,slidenode:this.prevactiveslide,slideindex:this.prevactiveslide,slideconfig:i(this.prevactiveslideindex)?null:this.elements[this.prevactiveslideindex].slideconfig,trigger:i(this.prevactiveslideindex)?null:this.elements[this.prevactiveslideindex].node,player:this.getslideplayerinstance(this.prevactiveslideindex)},o={index:this.index,slide:this.activeslide,slidenode:this.activeslide,slideconfig:this.elements[this.index].slideconfig,slideindex:this.index,trigger:this.elements[this.index].node,player:this.getslideplayerinstance(this.index)};if(n.offsetwidth>0&&s&&(p(s),s.style.display=""),d(e,this.effectsclasses),t)g(e,this.settings.cssefects[this.settings.openeffect].in,(function(){i.settings.autoplayvideos&&i.slideplayerplay(e),i.trigger("slide_changed",{prev:l,current:o}),t(i.settings.afterslidechange)&&i.settings.afterslidechange.apply(i,[l,o])}));else{var r=this.settings.slideeffect,a="none"!==r?this.settings.cssefects[r].in:r;this.prevactiveslideindex>this.index&&"slide"==this.settings.slideeffect&&(a=this.settings.cssefects.slideback.in),g(e,a,(function(){i.settings.autoplayvideos&&i.slideplayerplay(e),i.trigger("slide_changed",{prev:l,current:o}),t(i.settings.afterslidechange)&&i.settings.afterslidechange.apply(i,[l,o])}))}settimeout((function(){i.resize(e)}),100),h(e,"current")}},{key:"slideanimateout",value:function(){if(!this.prevactiveslide)return!1;var e=this.prevactiveslide;d(e,this.effectsclasses),h(e,"prev");var t=this.settings.slideeffect,i="none"!==t?this.settings.cssefects[t].out:t;this.slideplayerpause(e),this.trigger("slide_before_change",{prev:{index:this.prevactiveslideindex,slide:this.prevactiveslide,slidenode:this.prevactiveslide,slideindex:this.prevactiveslideindex,slideconfig:i(this.prevactiveslideindex)?null:this.elements[this.prevactiveslideindex].slideconfig,trigger:i(this.prevactiveslideindex)?null:this.elements[this.prevactiveslideindex].node,player:this.getslideplayerinstance(this.prevactiveslideindex)},current:{index:this.index,slide:this.activeslide,slidenode:this.activeslide,slideindex:this.index,slideconfig:this.elements[this.index].slideconfig,trigger:this.elements[this.index].node,player:this.getslideplayerinstance(this.index)}}),t(this.settings.beforeslidechange)&&this.settings.beforeslidechange.apply(this,[{index:this.prevactiveslideindex,slide:this.prevactiveslide,player:this.getslideplayerinstance(this.prevactiveslideindex)},{index:this.index,slide:this.activeslide,player:this.getslideplayerinstance(this.index)}]),this.prevactiveslideindex>this.index&&"slide"==this.settings.slideeffect&&(i=this.settings.cssefects.slideback.out),g(e,i,(function(){var t=e.queryselector(".ginner-container"),i=e.queryselector(".gslide-media"),n=e.queryselector(".gslide-description");t.style.transform="",i.style.transform="",d(i,"greset"),i.style.opacity="",n&&(n.style.opacity=""),d(e,"prev")}))}},{key:"getallplayers",value:function(){return this.videoplayers}},{key:"getslideplayerinstance",value:function(e){var t="gvideo"+e,i=this.getallplayers();return!(!o(i,t)||!i[t])&&i[t]}},{key:"stopslidevideo",value:function(e){if(k(e)){var t=e.queryselector(".gvideo-wrapper");t&&(e=t.getattribute("data-index"))}console.log("stopslidevideo is deprecated, use slideplayerpause");var i=this.getslideplayerinstance(e);i&&i.playing&&i.pause()}},{key:"slideplayerpause",value:function(e){if(k(e)){var t=e.queryselector(".gvideo-wrapper");t&&(e=t.getattribute("data-index"))}var i=this.getslideplayerinstance(e);i&&i.playing&&i.pause()}},{key:"playslidevideo",value:function(e){if(k(e)){var t=e.queryselector(".gvideo-wrapper");t&&(e=t.getattribute("data-index"))}console.log("playslidevideo is deprecated, use slideplayerplay");var i=this.getslideplayerinstance(e);i&&!i.playing&&i.play()}},{key:"slideplayerplay",value:function(e){if(k(e)){var t=e.queryselector(".gvideo-wrapper");t&&(e=t.getattribute("data-index"))}var i=this.getslideplayerinstance(e);i&&!i.playing&&(i.play(),this.settings.autofocusvideos&&i.elements.container.focus())}},{key:"setelements",value:function(e){var t=this;this.settings.elements=!1;var i=[];e&&e.length&&o(e,(function(e,n){var s=new u(e,t,n),o=s.getconfig(),r=l({},o);r.slideconfig=o,r.instance=s,r.index=n,i.push(r)})),this.elements=i,this.lightboxopen&&(this.slidescontainer.innerhtml="",this.elements.length&&(o(this.elements,(function(){var e=m(t.settings.slidehtml);t.slidescontainer.appendchild(e)})),this.showslide(0,!0)))}},{key:"getelementindex",value:function(e){var t=!1;return o(this.elements,(function(i,n){if(o(i,"node")&&i.node==e)return t=n,!0})),t}},{key:"getelements",value:function(){var e=this,t=[];this.elements=this.elements?this.elements:[],!i(this.settings.elements)&&e(this.settings.elements)&&this.settings.elements.length&&o(this.settings.elements,(function(i,n){var s=new u(i,e,n),o=s.getconfig(),r=l({},o);r.node=!1,r.index=n,r.instance=s,r.slideconfig=o,t.push(r)}));var i=!1;return this.getselector()&&(i=document.queryselectorall(this.getselector())),i?(o(i,(function(i,n){var s=new u(i,e,n),o=s.getconfig(),r=l({},o);r.node=i,r.index=n,r.instance=s,r.slideconfig=o,r.gallery=i.getattribute("data-gallery"),t.push(r)})),t):t}},{key:"getgalleryelements",value:function(e,t){return e.filter((function(e){return e.gallery==t}))}},{key:"getselector",value:function(){return!this.settings.elements&&(this.settings.selector&&"data-"==this.settings.selector.substring(0,5)?"*[".concat(this.settings.selector,"]"):this.settings.selector)}},{key:"getactiveslide",value:function(){return this.slidescontainer.queryselectorall(".gslide")[this.index]}},{key:"getactiveslideindex",value:function(){return this.index}},{key:"getanimationclasses",value:function(){var e=[];for(var t in this.settings.cssefects)if(this.settings.cssefects.hasownproperty(t)){var i=this.settings.cssefects[t];e.push("g".concat(i.in)),e.push("g".concat(i.out))}return e.join(" ")}},{key:"build",value:function(){var e=this;if(this.built)return!1;var t=document.body.childnodes,i=[];o(t,(function(e){e.parentnode==document.body&&"#"!==e.nodename.charat(0)&&e.hasattribute&&!e.hasattribute("aria-hidden")&&(i.push(e),e.setattribute("aria-hidden","true"))}));var n=o(this.settings.svg,"next")?this.settings.svg.next:"",s=o(this.settings.svg,"prev")?this.settings.svg.prev:"",l=o(this.settings.svg,"close")?this.settings.svg.close:"",r=this.settings.lightboxhtml;r=m(r=(r=(r=r.replace(/{nextsvg}/g,n)).replace(/{prevsvg}/g,s)).replace(/{closesvg}/g,l)),document.body.appendchild(r);var d=document.getelementbyid("glightbox-body");this.modal=d;var g=d.queryselector(".gclose");this.prevbutton=d.queryselector(".gprev"),this.nextbutton=d.queryselector(".gnext"),this.overlay=d.queryselector(".goverlay"),this.loader=d.queryselector(".gloader"),this.slidescontainer=document.getelementbyid("glightbox-slider"),this.bodyhiddenchildelms=i,this.events={},h(this.modal,"glightbox-"+this.settings.skin),this.settings.closebutton&&g&&(this.events.close=a("click",{onelement:g,withcallback:function(t,i){t.preventdefault(),e.close()}})),g&&!this.settings.closebutton&&g.parentnode.removechild(g),this.nextbutton&&(this.events.next=a("click",{onelement:this.nextbutton,withcallback:function(t,i){t.preventdefault(),e.nextslide()}})),this.prevbutton&&(this.events.prev=a("click",{onelement:this.prevbutton,withcallback:function(t,i){t.preventdefault(),e.prevslide()}})),this.settings.closeonoutsideclick&&(this.events.outclose=a("click",{onelement:d,withcallback:function(t,i){e.preventoutsideclick||c(document.body,"glightbox-mobile")||u(t.target,".ginner-container")||u(t.target,".gbtn")||c(t.target,"gnext")||c(t.target,"gprev")||e.close()}})),o(this.elements,(function(t,i){e.slidescontainer.appendchild(t.instance.create()),t.slidenode=e.slidescontainer.queryselectorall(".gslide")[i]})),k&&h(document.body,"glightbox-touch"),this.events.resize=a("resize",{onelement:window,withcallback:function(){e.resize()}}),this.built=!0}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if((e=e||this.activeslide)&&!c(e,"zoomed")){var t=y(),i=e.queryselector(".gvideo-wrapper"),n=e.queryselector(".gslide-image"),s=this.slidedescription,l=t.width,o=t.height;if(l<=768?h(document.body,"glightbox-mobile"):d(document.body,"glightbox-mobile"),i||n){var r=!1;if(s&&(c(s,"description-bottom")||c(s,"description-top"))&&!c(s,"gabsolute")&&(r=!0),n)if(l<=768)n.queryselector("img");else if(r){var a=s.offsetheight,u=n.queryselector("img");u.setattribute("style","max-height: calc(100vh - ".concat(a,"px)")),s.setattribute("style","max-width: ".concat(u.offsetwidth,"px;"))}if(i){var g=o(this.settings.plyr.config,"ratio")?this.settings.plyr.config.ratio:"";if(!g){var v=i.clientwidth,f=i.clientheight,p=v/f;g="".concat(v/p,":").concat(f/p)}var m=g.split(":"),x=this.settings.videoswidth,b=this.settings.videoswidth,s=(b=z(x)||-1!==x.indexof("px")?parseint(x):-1!==x.indexof("vw")?l*parseint(x)/100:-1!==x.indexof("vh")?o*parseint(x)/100:-1!==x.indexof("%")?l*parseint(x)/100:parseint(i.clientwidth))/(parseint(m[0])/parseint(m[1]));if(s=math.floor(s),r&&(o-=s.offsetheight),b>l||s>o||ob){var w=i.offsetwidth,t=i.offsetheight,c=o/t,k={width:w*c,height:t*c};i.parentnode.setattribute("style","max-width: ".concat(k.width,"px")),r&&s.setattribute("style","max-width: ".concat(k.width,"px;"))}else i.parentnode.style.maxwidth="".concat(x),r&&s.setattribute("style","max-width: ".concat(x,";"))}}}}},{key:"reload",value:function(){this.init()}},{key:"updatenavigationclasses",value:function(){var e=this.loop();d(this.nextbutton,"disabled"),d(this.prevbutton,"disabled"),0==this.index&&this.elements.length-1==0?(h(this.prevbutton,"disabled"),h(this.nextbutton,"disabled")):0!==this.index||e?this.index!==this.elements.length-1||e||h(this.nextbutton,"disabled"):h(this.prevbutton,"disabled")}},{key:"loop",value:function(){var e=o(this.settings,"loopatend")?this.settings.loopatend:null;return e=o(this.settings,"loop")?this.settings.loop:e,e}},{key:"close",value:function(){var e=this;if(!this.lightboxopen){if(this.events){for(var t in this.events)this.events.hasownproperty(t)&&this.events[t].destroy();this.events=null}return!1}if(this.closing)return!1;this.closing=!0,this.slideplayerpause(this.activeslide),this.fullelementslist&&(this.elements=this.fullelementslist),this.bodyhiddenchildelms.length&&o(this.bodyhiddenchildelms,(function(e){e.removeattribute("aria-hidden")})),h(this.modal,"glightbox-closing"),g(this.overlay,"none"==this.settings.openeffect?"none":this.settings.cssefects.fade.out),g(this.activeslide,this.settings.cssefects[this.settings.closeeffect].out,(function(){if(e.activeslide=null,e.prevactiveslideindex=null,e.prevactiveslide=null,e.built=!1,e.events){for(var t in e.events)e.events.hasownproperty(t)&&e.events[t].destroy();e.events=null}var i=document.body;d(q,"glightbox-open"),d(i,"glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer"),e.modal.parentnode.removechild(e.modal),e.trigger("close"),t(e.settings.onclose)&&e.settings.onclose();var n=document.queryselector(".gcss-styles");n&&n.parentnode.removechild(n),e.lightboxopen=!1,e.closing=null}))}},{key:"destroy",value:function(){this.close(),this.clearallevents(),this.baseevents&&this.baseevents.destroy()}},{key:"on",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e||!t(t))throw new typeerror("event name and callback must be defined");this.apievents.push({evt:e,once:i,callback:t})}},{key:"once",value:function(e,t){this.on(e,t,!0)}},{key:"trigger",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];o(this.apievents,(function(t,s){var l=t.evt,o=t.once,r=t.callback;l==e&&(r(i),o&&n.push(s))})),n.length&&o(n,(function(e){return t.apievents.splice(e,1)}))}},{key:"clearallevents",value:function(){this.apievents.splice(0,this.apievents.length)}},{key:"version",value:function(){return"3.1.1"}}]),e}();return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new te(e);return t.init(),t}}));