'),this.$currentImage=n.querySelector(".slbImage"),this.options.showCaptions&&this.captions[t]&&n.appendChild(o('
'+this.captions[t]+"
")),this.loadImage(s,function(){i.setImageDimensions(),e.call(i,n),i.loadImage(i.items[i.normalizePosition(i.currentPosition+1)])})),this},loadImage:function(t,e){var n;this.options.videoRegex.test(t)||(n=new Image,e&&(n.onload=e),n.src=t)},setupLightboxHtml:function(){var t=this.options;return this.$el||(this.$el=o(''+(1
":"")+"
"),this.$content=this.$el.querySelector(".slbContent")),this.$content.innerHTML="",this},show:function(){return this.modalInDom||(document.querySelector(this.options.appendTarget).appendChild(this.$el),i(document.documentElement,this.options.htmlClass),this.setupLightboxEvents(),this.modalInDom=!0),this},setContent:function(t){t="string"==typeof t?o(t):t;return this.loading(!1),this.setupLightboxHtml(),s(this.$content,"slbDirectionNext"),s(this.$content,"slbDirectionPrev"),this.direction&&i(this.$content,"next"===this.direction?"slbDirectionNext":"slbDirectionPrev"),this.options.beforeSetContent&&this.options.beforeSetContent(t,this),this.$content.appendChild(t),this},setImageDimensions:function(){this.$currentImage&&(this.$currentImage.style.maxHeight=("innerHeight"in window?window.innerHeight:document.documentElement.offsetHeight)+"px")},setupLightboxEvents:function(){var e=this;return this.eventRegistry.lightbox.length||this.addEvent(this.$el,"click",function(t){t=t.target;n(t,".slbCloseBtn")||e.options.closeOnOverlayClick&&n(t,".slbWrap")?e.close():n(t,".slbArrow")?n(t,".next")?e.next():e.prev():e.options.nextOnImageClick&&1