This repository has been archived on 2022-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
frontend-styles/public/app.js

2 lines
8.5 KiB
JavaScript

/*! For license information please see app.js.LICENSE.txt */
(()=>{var e={594:e=>{!function(t,n,i){"use strict";var o=function(e,o){n.getComputedStyle||(n.getComputedStyle=function(e){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,(function(){return arguments[2].toUpperCase()}))),e.currentStyle[t]?e.currentStyle[t]:null},this});var s,r,a,c,l,u,h=function(e,t,n,i){if("addEventListener"in e)try{e.addEventListener(t,n,i)}catch(o){if("object"!=typeof n||!n.handleEvent)throw o;e.addEventListener(t,(function(e){n.handleEvent.call(n,e)}),i)}else"attachEvent"in e&&("object"==typeof n&&n.handleEvent?e.attachEvent("on"+t,(function(){n.handleEvent.call(n)})):e.attachEvent("on"+t,n))},p=function(e,t,n,i){if("removeEventListener"in e)try{e.removeEventListener(t,n,i)}catch(o){if("object"!=typeof n||!n.handleEvent)throw o;e.removeEventListener(t,(function(e){n.handleEvent.call(n,e)}),i)}else"detachEvent"in e&&("object"==typeof n&&n.handleEvent?e.detachEvent("on"+t,(function(){n.handleEvent.call(n)})):e.detachEvent("on"+t,n))},f=function(e,t){for(var n in t)e.setAttribute(n,t[n])},v=function(e,t){0!==e.className.indexOf(t)&&(e.className+=" "+t,e.className=e.className.replace(/(^\s*)|(\s*$)/g,""))},d=function(e,t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ").replace(/(^\s*)|(\s*$)/g,"")},g=t.createElement("style"),y=t.documentElement,m=function(e,n){var i;for(i in this.options={animate:!0,transition:284,label:"Menu",insert:"before",customToggle:"",closeOnNavClick:!1,openPos:"relative",navClass:"nav-collapse",navActiveClass:"js-nav-active",jsClass:"js",init:function(){},open:function(){},close:function(){}},n)this.options[i]=n[i];if(v(y,this.options.jsClass),this.wrapperEl=e.replace("#",""),t.getElementById(this.wrapperEl))this.wrapper=t.getElementById(this.wrapperEl);else{if(!t.querySelector(this.wrapperEl))throw new Error("The nav element you are trying to select doesn't exist");this.wrapper=t.querySelector(this.wrapperEl)}this.wrapper.inner=function(e){if(e.children.length<1)throw new Error("The Nav container has no containing elements");for(var t=[],n=0;n<e.children.length;n++)1===e.children[n].nodeType&&t.push(e.children[n]);return t}(this.wrapper),r=this.options,s=this.wrapper,this._init(this)};return m.prototype={destroy:function(){this._removeStyles(),d(s,"closed"),d(s,"opened"),d(s,r.navClass),d(s,r.navClass+"-"+this.index),d(y,r.navActiveClass),s.removeAttribute("style"),s.removeAttribute("aria-hidden"),p(n,"resize",this,!1),p(n,"focus",this,!1),p(t.body,"touchmove",this,!1),p(a,"touchstart",this,!1),p(a,"touchend",this,!1),p(a,"mouseup",this,!1),p(a,"keyup",this,!1),p(a,"click",this,!1),r.customToggle?a.removeAttribute("aria-hidden"):a.parentNode.removeChild(a)},toggle:function(){!0===c&&(u?this.close():this.open())},open:function(){u||(d(s,"closed"),v(s,"opened"),v(y,r.navActiveClass),v(a,"active"),s.style.position=r.openPos,f(s,{"aria-hidden":"false"}),u=!0,r.open())},close:function(){u&&(v(s,"closed"),d(s,"opened"),d(y,r.navActiveClass),d(a,"active"),f(s,{"aria-hidden":"true"}),r.animate?(c=!1,setTimeout((function(){s.style.position="absolute",c=!0}),r.transition+10)):s.style.position="absolute",u=!1,r.close())},resize:function(){"none"!==n.getComputedStyle(a,null).getPropertyValue("display")?(l=!0,f(a,{"aria-hidden":"false"}),s.className.match(/(^|\s)closed(\s|$)/)&&(f(s,{"aria-hidden":"true"}),s.style.position="absolute"),this._createStyles(),this._calcHeight()):(l=!1,f(a,{"aria-hidden":"true"}),f(s,{"aria-hidden":"false"}),s.style.position=r.openPos,this._removeStyles())},handleEvent:function(e){var t=e||n.event;switch(t.type){case"touchstart":this._onTouchStart(t);break;case"touchmove":this._onTouchMove(t);break;case"touchend":case"mouseup":this._onTouchEnd(t);break;case"click":this._preventDefault(t);break;case"keyup":this._onKeyUp(t);break;case"focus":case"resize":this.resize(t)}},_init:function(){this.index=i++,v(s,r.navClass),v(s,r.navClass+"-"+this.index),v(s,"closed"),c=!0,u=!1,this._closeOnNavClick(),this._createToggle(),this._transitions(),this.resize();var e=this;setTimeout((function(){e.resize()}),20),h(n,"resize",this,!1),h(n,"focus",this,!1),h(t.body,"touchmove",this,!1),h(a,"touchstart",this,!1),h(a,"touchend",this,!1),h(a,"mouseup",this,!1),h(a,"keyup",this,!1),h(a,"click",this,!1),r.init()},_createStyles:function(){g.parentNode||(g.type="text/css",t.getElementsByTagName("head")[0].appendChild(g))},_removeStyles:function(){g.parentNode&&g.parentNode.removeChild(g)},_createToggle:function(){if(r.customToggle){var e=r.customToggle.replace("#","");if(t.getElementById(e))a=t.getElementById(e);else{if(!t.querySelector(e))throw new Error("The custom nav toggle you are trying to select doesn't exist");a=t.querySelector(e)}}else{var n=t.createElement("a");n.innerHTML=r.label,f(n,{href:"#",class:"nav-toggle"}),"after"===r.insert?s.parentNode.insertBefore(n,s.nextSibling):s.parentNode.insertBefore(n,s),a=n}},_closeOnNavClick:function(){if(r.closeOnNavClick){var e=s.getElementsByTagName("a"),t=this;!function(e,t,n){for(var i=0;i<e.length;i++)t.call(undefined,i,e[i])}(e,(function(n,i){h(e[n],"click",(function(){l&&t.toggle()}),!1)}))}},_preventDefault:function(e){if(e.preventDefault)return e.stopImmediatePropagation&&e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation(),!1;e.returnValue=!1},_onTouchStart:function(e){Event.prototype.stopImmediatePropagation||this._preventDefault(e),this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY,this.touchHasMoved=!1,p(a,"mouseup",this,!1)},_onTouchMove:function(e){(Math.abs(e.touches[0].clientX-this.startX)>10||Math.abs(e.touches[0].clientY-this.startY)>10)&&(this.touchHasMoved=!0)},_onTouchEnd:function(e){if(this._preventDefault(e),l&&!this.touchHasMoved){if("touchend"===e.type)return void this.toggle();var t=e||n.event;3!==t.which&&2!==t.button&&this.toggle()}},_onKeyUp:function(e){13===(e||n.event).keyCode&&this.toggle()},_transitions:function(){if(r.animate){var e=s.style,t="max-height "+r.transition+"ms";e.WebkitTransition=e.MozTransition=e.OTransition=e.transition=t}},_calcHeight:function(){for(var e=0,t=0;t<s.inner.length;t++)e+=s.inner[t].offsetHeight;var n="."+r.jsClass+" ."+r.navClass+"-"+this.index+".opened{max-height:"+e+"px !important} ."+r.jsClass+" ."+r.navClass+"-"+this.index+".opened.dropdown-active {max-height:9999px !important}";g.styleSheet?g.styleSheet.cssText=n:g.innerHTML=n,n=""}},new m(e,o)};e.exports?e.exports=o:n.responsiveNav=o}(document,window,0)}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");i.length&&(e=i[i.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var t,i,o,s=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}var n,i;return n=t,(i=[{key:"printToConsole",value:function(e){console.log(e)}}])&&e(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();o="Hello. The source code lives via git. Find the repository here:",(i="SOURCECODE")in(t=s)?Object.defineProperty(t,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[i]=o;var r=n(594),a=n.n(r);function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}n.p,n.p,new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init()}var t,n;return t=e,(n=[{key:"init",value:function(){(new s).printToConsole(s.SOURCECODE),a()(".nav-collapse",{customToggle:".toggle",jsClass:"js"})}}])&&c(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}())})()})();