// source --> https://www.perse.es/wp-content/themes/monument-valley/assets/js/vendors/a11y-menu/a11y-menu.dist.min.js?ver=2.0.1 
"use strict";
/*!
@package      A11y Menu
@description  A keyboard accessible navigational menu script.
@version      1.2.0
@author       WebMan Design, Oliver Juhas, https://www.webmandesign.eu
@copyright    2019 WebMan Design, Oliver Juhas
@license      GPL-3.0-or-later, https://www.gnu.org/licenses/gpl-3.0-standalone.html
@link         https://github.com/webmandesign/a11y-menu

@global  window, document, a11yMenuConfig
*/!function(t){var e={init:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;e.setOptions(t),e.polyfill(),e.getMenus().length&&e.getOption("expanded_class")&&e.getMenus().forEach((function(t){var n=t.querySelectorAll(e.getOption("child_menu_selector"));if(Object.keys(n).length){var o=e.getButton(e.getOption("button_attributes"));n.forEach((function(t){var n=t.parentNode;if(n.classList.add("a11y-menu--has-children"),null!=o){var a=o.cloneNode(!0);n.insertBefore(a,t),e.changeButtonAttributes(n),a.addEventListener("mousedown",(function(t){return e.onClickButton(t)})),a.addEventListener("keyup",(function(t){return e.onClickButton(t)}))}if(e.isMode("touch")){var i=n.querySelector("a[href]");null!=i&&i.addEventListener("touchstart",(function(t){return e.onTouchLink(t)}),!0)}})),e.isMode("tab")&&(t.addEventListener("focusin",(function(t){return e.onFocus(t)}),!0),t.addEventListener("focusout",(function(t){return e.onFocus(t)}),!0)),e.isMode("esc")&&document.addEventListener("keyup",(function(t){return e.onKeyESC(t)}))}}))},onFocus:function(t){var e=this,n=e.getParents(t);"focusin"===t.type?n.map((function(t){return t.classList.add(e.getOption("expanded_class"))})):n.map((function(t){return t.classList.remove(e.getOption("expanded_class"))})),e.isMode("button")&&(e.changeButtonAttributes(t),n.map((function(t){return e.changeButtonAttributes(t)})))},onClickButton:function(t){if("keyup"===t.type&&-1===[13,32].indexOf(t.keyCode))return!1;var e=this,n=e.getOption("expanded_class"),o=t.target.parentNode,a=o.classList.contains(n);e.getSiblings(o).map((function(t){t.classList.remove(n),e.changeButtonAttributes(t)})),a?o.classList.remove(n):o.classList.add(n),e.changeButtonAttributes(t),e.getParents(o).map((function(t){return e.changeButtonAttributes(t)})),t.preventDefault()},onTouchLink:function(t){var e=this,n=t.target,o=n.parentNode,a=e.getOption("expanded_class");if(o.classList.contains(a))n!==document.activeElement&&(t.preventDefault(),o.classList.remove(a),e.isMode("button")&&e.changeButtonAttributes(t));else{t.preventDefault(),n.focus();var i=e.getSiblings(o),r=e.getParents(t);i.map((function(t){return t.classList.remove(a)})),r.map((function(t){return t.classList.add(a)})),e.isMode("button")&&(e.changeButtonAttributes(t),r.map((function(t){return e.changeButtonAttributes(t)})))}},onKeyESC:function(t){if(27===t.keyCode){var e=this,n=e.getOption("expanded_class");e.getMenus().forEach((function(t){t.querySelectorAll("."+n).forEach((function(t){t.classList.remove(n),e.isMode("button")&&e.changeButtonAttributes(t)}))}))}},getMenus:function(){var t=this,e=t.getOption("menu_selector");return!t.menus.length&&e&&document.querySelectorAll(e).forEach((function(e){return t.menus.push(e)})),t.menus},getSiblings:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".a11y-menu--has-children",n=[],o=t.parentNode.firstChild;o;o=o.nextElementSibling)1===o.nodeType&&o.matches(e)&&t!==o&&n.push(o);return n},getParents:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"a11y-menu--has-children",n=this,o=n.getMenus(),a=[],i=1===t.nodeType?t:t.target;-1===o.indexOf(i);)a.push(i),i=i.parentNode;return e&&(a=a.filter((function(t){return t.matches(e)}))),a},getButton:function(t){t=t||{};var e=Object.keys(t);if(!e.length||!this.isMode("button"))return null;var n=document.createElement("button"),o=["class","tabindex","title"];return n.setAttribute("aria-expanded","false"),e.forEach((function(e){-1===o.indexOf(e)&&0!==e.indexOf("aria-")&&0!==e.indexOf("data-")||n.setAttribute(e.toLowerCase(),t[e])})),null!=t["aria-label"]&&null!=t["aria-label"].expand&&n.setAttribute("aria-label",t["aria-label"].expand),n},changeButtonAttributes:function(t){var e,n=1===t.nodeType?t:t.target.parentNode,o="";if(null!=n&&(e=n.querySelector("button[aria-expanded]")),null!=e&&1===e.nodeType){var a=n.querySelector("a[data-submenu-label]");null!=a&&(o=a.dataset.submenuLabel);var i=n.classList.contains(this.getOption("expanded_class")),r=this.getOption("button_attributes","aria-label");"string"!=typeof r&&null!=r&&(i&&null!=r.collapse?e.setAttribute("aria-label",r.collapse.replace("%s",o)):i||null==r.expand||e.setAttribute("aria-label",r.expand.replace("%s",o))),e.setAttribute("aria-expanded",i.toString())}},setOptions:function(t){var e={button_attributes:{class:"button-toggle-sub-menu","aria-label":{collapse:"Collapse child menu",expand:"Expand child menu"}},child_menu_selector:".sub-menu",expanded_class:"has-expanded-sub-menu",menu_selector:"nav .menu",mode:["tab","esc","button","touch"]};for(var n in t)e.hasOwnProperty(n)&&(e[n]="expanded_class"===n?t[n].replace(/[^a-zA-Z0-9\-_]/g,""):t[n]);this.options=e,this.menus=[]},getOption:function(){var t=this.options,e=arguments,n=e.length;if(1===n)t=null!=t[e[0]]&&t[e[0]];else for(var o=0;o<n&&!1!==t;o++)t=null!=t[e[o]]&&t[e[o]];return t},isMode:function(t){return-1!==this.getOption("mode").indexOf(t)},polyfill:function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector)}};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(function(){return e.init(t)})):e.init(t)}(window.a11yMenuConfig||{});
// source --> https://www.perse.es/wp-includes/js/imagesloaded.min.js?ver=6.2.9 
/*! This file is auto-generated */
/*!
 * imagesLoaded PACKAGED v4.1.4
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */

!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});