\n '))}},{key:"set",value:function(t){var e=this;this.show(),this.current=t;var n=t.getAttribute("src"),r=this.container.querySelector(".Lightbox-image");this.container.appendChild(this.imageForURL(n)),r&&(this.animating=!0,fadeOut(r,(function(){r.remove(),e.animating=!1})))}},{key:"shift",value:function(t){if(!this.animating){var e=this.current,n=t>0?e.nextElementSibling||e.parentNode.firstElementChild:e.previousElementSibling||e.parentNode.lastElementChild;this.set(n)}}}]),t}(),TouchLightbox=function(t){"use strict";_inherits(n,t);var e=_createSuper(n);function n(t){var r,i;return _classCallCheck(this,n),r=e.call(this,t),t.querySelector(".Lightbox-caretRight").classList.add("dn"),t.querySelector(".Lightbox-caretLeft").classList.add("dn"),t.addEventListener("touchstart",(function(t){r.visible()&&(r.animating||(i=t.pageX))})),t.addEventListener("touchmove",(function(t){if(i){var e=t.pageX-i,n=e<0?1:-1;-1==n&&0==r.currentIdx||1==n&&r.currentIdx==r.length-1||(r.container.style.transform="translateX(calc(".concat(e,"px - ").concat(100*r.currentIdx,"%))"))}})),t.addEventListener("touchend",(function(t){if(i){var e=t.pageX-i;if(i=null,0!=e){var n=e<0?r.current.nextElementSibling:r.current.previousElementSibling;if(n){r.current=n,r.currentIdx+=e<0?1:-1;r.container.style.transition="transform ".concat(400,"ms"),r.setXForCurrent(),r.animating=!0,setTimeout((function(){r.container.style.transition="",r.animating=!1}),400)}else r.setXForCurrent()}}})),r}return _createClass(n,[{key:"setXForCurrent",value:function(){this.container.style.transform="translateX(-".concat(100*this.currentIdx,"%)")}},{key:"set",value:function(t){this.show(),this.current=t,this.length=t.parentNode.children.length;var e=0,n=!0,r=!1,i=void 0;try{for(var o,a=Array.from(t.parentNode.children)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;t==s&&(this.currentIdx=e);var c=s.getAttribute("src"),u=this.imageForURL(c);u.style.left="".concat(100*e,"%"),this.container.appendChild(u),e++}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.setXForCurrent()}},{key:"shift",value:function(){}}]),n}(Lightbox),lightbox=0==navigator.maxTouchPoints?new Lightbox(document.querySelector(".Lightbox")):new TouchLightbox(document.querySelector(".Lightbox"));document.addEventListener("click",(function(t){var e=t.target.closest(".Image");e&&(t.preventDefault(),lightbox.set(e))}));