var Concertina,Gallery;$(function(){Concertina.Init()});Concertina=function(){return{Init:function(){this.Bindings()},Bindings:function(){var n=$(".o-concertina__list__item__header");if(n.length)n.off("click").on("click",function(n){n.preventDefault();var i=$(this),t=i.closest(".o-concertina__list__item");t.length&&Concertina.Toggle(t)})},Open:function(n){if(typeof n!="undefined"&&n.length){var t=n.find(".o-concertina__list__item__content").first(),i=n.find(".o-concertina__list__item__content__inner").first(),r=n.find(".o-concertina__list__item__header");t.length&&i.length&&r.length&&(r.addClass("o-concertina__list__item__header--open"),t.removeClass("visually-hidden").hide().slideDown(100,function(){i.addClass("o-concertina__list__item__content__inner--open")}))}},Close:function(n){if(typeof n!="undefined"&&n.length){var t=n.find(".o-concertina__list__item__content").first(),i=n.find(".o-concertina__list__item__content__inner").first(),r=n.find(".o-concertina__list__item__header");t.length&&i.length&&r.length&&(r.removeClass("o-concertina__list__item__header--open").blur(),i.removeClass("o-concertina__list__item__content__inner--open"),setTimeout(function(){t.slideUp(100,function(){t.addClass("visually-hidden")})},400))}},Toggle:function(n){if(typeof n!="undefined"&&n.length){var t=n.find(".o-concertina__list__item__content").first();t.length&&(t.hasClass("visually-hidden")?this.Open(n):this.Close(n))}}}}();$(function(){Gallery.Init()});Gallery=function(){return{Init:function(){this.Bindings()},Bindings:function(){var t=$(".w-gallery"),n;if(t.length){$(window).on("mouseup touchend",function(n){Gallery.CurrentFocus=$(n.target)});t.each(function(){var n=$(this),t,i;n.magnificPopup({delegate:"a",type:"image",disableOn:768,closeMarkup:'<button title="%title%" type="button" class="w-gallery__close mfp-close">Close gallery<\/button>',gallery:{enabled:!0,arrowMarkup:'<button title="%title%" type="button" class="w-gallery__%dir%">Navigate gallery %dir%<\/button>',tCounter:""}});t=n.find(".w-gallery__item__link");i=Gallery.CreateMobileGallery(n);t.on("click",function(n){$(window).width()<768&&n.preventDefault()}).each(function(){var n=$(this),t=n.attr("href");Gallery.AddImageToMobileGallery(t,i)})});n=$(".w-gallery__mobile");n.each(function(){var n=$(this);n.slick({arrows:!0,prevArrow:n.find(".w-gallery__mobile__prev").first(),nextArrow:n.find(".w-gallery__mobile__next").first(),lazyLoad:"progressive",slide:".w-gallery__mobile__slide",useCSS:!0,touchThreshold:10,useTransform:!0,useCSS:!0})});$(window).on("orientationchange resize",function(){Gallery.IsMobileLandscape()?Gallery.ShowMobileGalleryInView(n):Gallery.HideMobileGalleries()}).trigger("orientationchange");$(document).on("click",".w-gallery",function(n){var i=$(n.target),r=i.closest(".w-gallery"),u=r.find(".w-gallery__mobile"),t;(i.closest(".w-gallery__mobile").length||$(window).trigger("orientationchange"),t=$(n.target).closest(".w-gallery").find(".w-gallery__rotate-device").first(),t.length)&&(t.show(),setTimeout(function(){t.fadeOut(300)},1e3))}).on("click",".w-gallery__mobile__close",function(){Gallery.HideMobileGalleries();$(":focus").blur()})}},CreateMobileGallery:function(n){if(typeof n!="undefined"&&n.length){n.append('<div class="w-gallery__mobile visually-hidden" />');var t=n.find(".w-gallery__mobile").first();return $('<button type="button" class="w-gallery__mobile__close" />').appendTo(t),$('<button type="button" class="w-gallery__mobile__prev" />').appendTo(t),$('<button type="button" class="w-gallery__mobile__next" />').appendTo(t),t}},IsMobileLandscape:function(){var n=$(window);return n.width()<768&&n.width()>n.height()},AddImageToMobileGallery:function(n,t){typeof n!="undefined"&&t.length&&$('<img src="'+n+'">').addClass("w-gallery__mobile__slide__image").appendTo(t).wrap('<div class="w-gallery__mobile__slide" />')},ShowMobileGallery:function(n){typeof n!="undefined"&&n.length&&n.removeClass("visually-hidden")},CloseMobileGallery:function(n){typeof n!="undefined"&&n.length&&n.addClass("visually-hidden")},CurrentFocus:null,ShowMobileGalleryInView:function(n){var t,i,r;(n=typeof n!="undefined"&&n.length?n:$(".w-gallery__mobile"),Gallery.HideMobileGalleries(),t=null,i=this.CurrentFocus,i!==null&&i.length)&&(n.each(function(){var n=$(this),r=n.closest(".w-gallery");(r.has(i).length||r.is(i))&&(t=t===null?n:t.add(n))}),t!==null&&t.length&&(r=t.first(),Gallery.ShowMobileGallery(r),r.slick("slickGoTo",1,!0)))},HideMobileGalleries:function(){var n=$(".w-gallery__mobile");n.length&&n.addClass("visually-hidden")}}}()