var blogtory=blogtory||{};function blogtoryDomReady(t){if("function"==typeof t)return"interactive"===document.readyState||"complete"===document.readyState?t():void document.addEventListener("DOMContentLoaded",t,!1)}function blogtoryToggleAttribute(t,e,o,n){t.classList.contains("close-search-toggle")||(void 0===o&&(o=!0),void 0===n&&(n=!1),t.getAttribute(e)!==o?t.setAttribute(e,o):t.setAttribute(e,n))}function blogtoryMenuToggle(t,e){var o,n,i,a,r,s=[],l=[];t&&(i=t.closest(".menu-wrapper"),(a=i.querySelectorAll(".menu-item")).forEach(function(t,e){s[e]={x:t.offsetLeft,y:t.offsetTop}}),o=t.parentElement.offsetHeight,t.classList.add("toggling-target"),t.classList.toggle("active"),a.forEach(function(t,e){l[e]={x:t.offsetLeft,y:t.offsetTop}}),n=t.parentElement.offsetHeight,t.classList.toggle("active"),i.classList.add("is-toggling"),t.classList.toggle("active"),a.forEach(function(e,n){var i=s[n];0===i.y&&e.parentElement===t&&(i.y=o),e.style.transform="translate("+i.x+"px, "+i.y+"px)"}),requestAnimationFrame(function(){requestAnimationFrame(function(){i.classList.add("is-animating"),a.forEach(function(o,i){var a=l[i];0===a.y&&o.parentElement===t&&(a.y=n),void 0!==e&&(o.style.transitionDuration=e+"ms"),o.style.transform="translate("+a.x+"px, "+a.y+"px)"}),void 0!==e&&(t.style.transitionDuration=e+"ms")}),r=function(){i.classList.remove("is-animating"),i.classList.remove("is-toggling"),t.classList.remove("toggling-target"),a.forEach(function(t){t.style.transform="",t.style.transitionDuration=""}),t.style.transitionDuration="",t.removeEventListener("transitionend",r)},t.addEventListener("transitionend",r)}))}function blogtoryFindParents(t,e){var o=[];return function t(n){var i=n.parentNode;i instanceof HTMLElement&&(i.matches(e)&&o.push(i),t(i))}(t),o}blogtory.scrolled=0,Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(t,e){var o,n=this.length;for(e=e||window,o=0;o=0&&e.item(o)!==this;);return o>-1}),blogtory.touchEnabled={init:function(){var t;("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||(t=["(",["-webkit-","-moz-","-o-","-ms-"].join("touch-enabled),("),"heartz",")"].join(""),window.matchMedia&&window.matchMedia(t).matches))&&document.body.classList.add("touch-enabled")}},blogtory.coverModals={init:function(){document.querySelector(".cover-modal")&&(this.onToggle(),this.outsideUntoggle(),this.closeOnEscape(),this.hideAndShowModals())},onToggle:function(){document.querySelectorAll(".cover-modal").forEach(function(t){t.addEventListener("toggled",function(t){var e=t.target,o=document.body;e.classList.contains("active")?o.classList.add("showing-modal"):(o.classList.remove("showing-modal"),o.classList.add("hiding-modal"),setTimeout(function(){o.classList.remove("hiding-modal")},500))})})},outsideUntoggle:function(){document.addEventListener("click",function(t){var e=t.target,o=document.querySelector(".cover-modal.active");"a"===t.target.tagName.toLowerCase()&&t.target.hash.includes("#")&&null!==o&&(this.untoggleModal(o),setTimeout(function(){document.getElementById(t.target.hash.slice(1)).scrollIntoView()},550)),e===o&&this.untoggleModal(e)}.bind(this))},closeOnEscape:function(){document.addEventListener("keydown",function(t){27===t.keyCode&&(t.preventDefault(),document.querySelectorAll(".cover-modal.active").forEach(function(t){this.untoggleModal(t)}.bind(this)))}.bind(this))},hideAndShowModals:function(){var t=document,e=window,o=t.querySelectorAll(".cover-modal"),n=t.documentElement.style,i=t.querySelector("#wpadminbar");function a(t){var o,n=e.pageYOffset;return i?(o=n+i.getBoundingClientRect().height,t?-o:o):0===n?0:-n}function r(){return{"overflow-y":e.innerHeight>t.documentElement.getBoundingClientRect().height?"hidden":"scroll",position:"fixed",width:"100%",top:a(!0)+"px",left:0}}o.forEach(function(o){o.addEventListener("toggle-target-before-inactive",function(s){var l=r(),c=e.pageYOffset,d=Math.abs(a())-c+"px",g=e.matchMedia("(max-width: 600px)");s.target===o&&(Object.keys(l).forEach(function(t){n.setProperty(t,l[t])}),e.blogtory.scrolled=parseInt(l.top,10),i&&(t.body.style.setProperty("padding-top",d),g.matches&&(c>=a()?o.style.setProperty("top",0):o.style.setProperty("top",a()-c+"px"))),o.classList.add("show-modal"))}),o.addEventListener("toggle-target-after-inactive",function(s){s.target===o&&setTimeout(function(){var s=blogtory.toggles.clickedEl;o.classList.remove("show-modal"),Object.keys(r()).forEach(function(t){n.removeProperty(t)}),i&&(t.body.style.removeProperty("padding-top"),o.style.removeProperty("top")),!1!==s&&(s.focus(),s=!1),e.scrollTo(0,Math.abs(e.blogtory.scrolled+a())),e.blogtory.scrolled=0},500)})})},untoggleModal:function(t){var e,o=!1;t.dataset.modalTargetString&&(e=t.dataset.modalTargetString,o=document.querySelector('*[data-toggle-target="'+e+'"]')),o?o.click():t.classList.remove("active")}},blogtory.intrinsicRatioVideos={init:function(){this.makeFit(),window.addEventListener("resize",function(){this.makeFit()}.bind(this))},makeFit:function(){document.querySelectorAll("iframe, object, video").forEach(function(t){var e,o,n=t.parentNode;if(t.classList.contains("intrinsic-ignore")||t.parentNode.classList.contains("intrinsic-ignore"))return!0;t.dataset.origwidth||(t.setAttribute("data-origwidth",t.width),t.setAttribute("data-origheight",t.height)),e=(o=n.offsetWidth)/t.dataset.origwidth,t.style.width=o+"px",t.style.height=t.dataset.origheight*e+"px"})}},blogtory.modalMenu={init:function(){this.expandLevel(),this.keepFocusInModal()},expandLevel:function(){document.querySelectorAll(".modal-menu").forEach(function(t){var e=t.querySelector(".current-menu-item");e&&blogtoryFindParents(e,"li").forEach(function(t){var e=t.querySelector(".sub-menu-toggle");e&&blogtory.toggles.performToggle(e,!0)})})},keepFocusInModal:function(){var t=document;t.addEventListener("keydown",function(e){var o,n,i,a,r,s,l,c,d,g,u=blogtory.toggles.clickedEl;u&&t.body.classList.contains("showing-modal")&&(o=u.dataset.toggleTarget,"input, a, button",n=t.querySelector(o),i=n.querySelectorAll("input, a, button"),i=Array.prototype.slice.call(i),".menu-modal"===o&&(a=(a=window.matchMedia("(min-width: 1000px)").matches)?".expanded-menu":".mobile-menu",(i=i.filter(function(t){return null!==t.closest(a)&&null!==t.offsetParent})).unshift(t.querySelector(".close-nav-toggle")),(r=t.querySelector(".menu-bottom > nav"))&&r.querySelectorAll("input, a, button").forEach(function(t){i.push(t)})),l=i[i.length-1],c=i[0],s=t.activeElement,d=9===e.keyCode,!(g=e.shiftKey)&&d&&l===s&&(e.preventDefault(),c.focus()),g&&d&&c===s&&(e.preventDefault(),l.focus()))})}},blogtory.primaryMenu={init:function(){this.focusMenuWithChildren()},focusMenuWithChildren:function(){var t,e,o,n=document.querySelector(".primary-menu-wrapper");if(!n)return!1;for(e=0,o=(t=n.getElementsByTagName("a")).length;eo||n&&ti||a&&t