!function(t,$){"use strict";var i="fancybox-thumbs",s=i+"-active";$.fancybox.defaults=$.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},$.fancybox.defaults);var n=function(t){this.init(t)};$.extend(n.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var i=this,s=t.group,n=0;i.instance=t,i.opts=s[t.currIndex].opts.thumbs,t.Thumbs=i,i.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var e=0,o=s.length;e<o&&(s[e].thumb&&n++,!(n>1));e++);n>1&&i.opts?(i.$button.removeAttr("style").on("click",(function(){i.toggle()})),i.isActive=!0):i.$button.hide()},create:function(){var t,s=this,n=s.instance,e=s.opts.parentEl,o=[];s.$grid||(s.$grid=$('<div class="'+i+" "+i+"-"+s.opts.axis+'"></div>').appendTo(n.$refs.container.find(e).addBack().filter(e)),s.$grid.on("click","a",(function(){n.jumpTo($(this).attr("data-index"))}))),s.$list||(s.$list=$('<div class="'+i+'__list">').appendTo(s.$grid)),$.each(n.group,(function(i,s){(t=s.thumb)||"image"!==s.type||(t=s.src),o.push('<a href="javascript:;" tabindex="0" data-index="'+i+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")})),s.$list[0].innerHTML=o.join(""),"x"===s.opts.axis&&s.$list.width(parseInt(s.$grid.css("padding-right"),10)+n.group.length*s.$list.children().eq(0).outerWidth(!0))},focus:function(t){var i,n,e=this,o=e.$list,a=e.$grid;e.instance.current&&(n=(i=o.children().removeClass(s).filter('[data-index="'+e.instance.current.index+'"]').addClass(s)).position(),"y"===e.opts.axis&&(n.top<0||n.top>o.height()-i.outerHeight())?o.stop().animate({scrollTop:o.scrollTop()+n.top},t):"x"===e.opts.axis&&(n.left<a.scrollLeft()||n.left>a.scrollLeft()+(a.width()-i.outerWidth()))&&o.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),$(t).on({"onInit.fb":function(t,i){var s;i&&!i.Thumbs&&(s=new n(i)).isActive&&!0===s.opts.autoStart&&s.show()},"beforeShow.fb":function(t,i,s,n){var e=i&&i.Thumbs;e&&e.isVisible&&e.focus(n?0:250)},"afterKeydown.fb":function(t,i,s,n,e){var o=i&&i.Thumbs;o&&o.isActive&&71===e&&(n.preventDefault(),o.toggle())},"beforeClose.fb":function(t,i){var s=i&&i.Thumbs;s&&s.isVisible&&!1!==s.opts.hideOnClose&&s.$grid.hide()}})}(document,jQuery);