1(function () { 2 'use strict'; 3 4 const defaults = { 5 duration: 400, 6 easing: (currentTime, startValue, diffValue, dureation) => { 7 return -diffValue * (currentTime /= dureation) * (currentTime - 2) + startValue; 8 } 9 }; 10 const directions = { 11 OPEN: 1, 12 CLOSE: 2 13 }; 14 const slideUp = (element, args = {}) => { 15 if (isInteger(args)) { 16 args = { duration: args }; 17 } 18 const options = extend(defaults, args); 19 options.direction = directions.CLOSE; 20 options.to = 0; 21 options.startingHeight = element.scrollHeight; 22 options.distanceHeight = -options.startingHeight; 23 setElementAnimationStyles(element); 24 window.requestAnimationFrame((timestamp) => animate(element, options, timestamp)); 25 }; 26 const slideDown = (element, args = {}) => { 27 if (isInteger(args)) { 28 args = { duration: args }; 29 } 30 element.style.height = '0px'; 31 setElementAnimationStyles(element); 32 const options = extend(defaults, args); 33 options.direction = directions.OPEN; 34 options.to = element.scrollHeight; 35 options.startingHeight = 0; 36 options.distanceHeight = options.to; 37 window.requestAnimationFrame((timestamp) => animate(element, options, timestamp)); 38 }; 39 const animate = (element, options, now) => { 40 if (!options.startTime) { 41 options.startTime = now; 42 } 43 const currentTime = now - options.startTime; 44 let animationContinue = currentTime < options.duration; 45 let newHeight = options.easing(currentTime, options.startingHeight, options.distanceHeight, options.duration); 46 if (animationContinue) { 47 element.style.height = `${newHeight.toFixed(2)}px`; 48 window.requestAnimationFrame((timestamp) => animate(element, options, timestamp)); 49 } 50 else { 51 if (options.direction === directions.CLOSE) { 52 element.style.display = 'none'; 53 } 54 if (options.direction === directions.OPEN) { 55 element.style.display = 'block'; 56 } 57 removeElementAnimationStyles(element); 58 } 59 }; 60 const setElementAnimationStyles = (element) => { 61 element.style.display = 'block'; 62 element.style.overflow = 'hidden'; 63 element.style.marginTop = '0'; 64 element.style.marginBottom = '0'; 65 element.style.paddingTop = '0'; 66 element.style.paddingBottom = '0'; 67 }; 68 const removeElementAnimationStyles = (element) => { 69 element.style.height = null; 70 element.style.overflow = null; 71 element.style.marginTop = null; 72 element.style.marginBottom = null; 73 element.style.paddingTop = null; 74 element.style.paddingBottom = null; 75 }; 76 const isInteger = (value) => { 77 if (Number.isInteger) { 78 return Number.isInteger(value); 79 } 80 else { 81 return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; 82 } 83 }; 84 const extend = (defaults, options) => { 85 const extendedOptions = {}; 86 for (let key in defaults) { 87 extendedOptions[key] = options[key] || defaults[key]; 88 } 89 return extendedOptions; 90 }; 91 92 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 93 94 var barba_umd = {exports: {}}; 95 96 (function (module, exports) { 97 !function(t,n){module.exports=n();}(commonjsGlobal,(function(){function t(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e);}}function n(n,r,e){return r&&t(n.prototype,r),e&&t(n,e),n}function r(){return (r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);}return t}).apply(this,arguments)}function e(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;}
97function i(t){return (i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,n){return (o=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function u(t,n,r){return (u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return !1}}()?Reflect.construct:function(t,n,r){var e=[null];e.push.apply(e,n);var i=new(Function.bind.apply(t,e));return r&&o(i,r.prototype),i}).apply(null,arguments)}function f(t){var n="function"==typeof Map?new Map:void 0;return (f=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,r);}function r(){return u(t,arguments,i(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,t)})(t)}function s(t,n){try{var r=t();}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var c,a="2.9.7",h=function(){};!function(t){t[t.off=0]="off",t[t.error=1]="error",t[t.warning=2]="warning",t[t.info=3]="info",t[t.debug=4]="debug";}(c||(c={}));var v=c.off,l=function(){function t(t){this.t=t;}t.getLevel=function(){return v},t.setLevel=function(t){return v=c[t]};var n=t.prototype;return n.error=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.error,c.error,n);},n.warn=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.warn,c.warning,n);},n.info=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.info,c.info,n);},n.debug=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.i(console.log,c.debug,n);},n.i=function(n,r,e){r<=t.getLevel()&&n.apply(console,["["+this.t+"] "].concat(e));},t}(),d=O,m=E,p=g,w=x,b=T,y="/",P=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function g(t,n){for(var r,e=[],i=0,o=0,u="",f=n&&n.delimiter||y,s=n&&n.whitelist||void 0,c=!1;null!==(r=P.exec(t));){var a=r[0],h=r[1],v=r.index;if(u+=t.slice(o,v),o=v+a.length,h)u+=h[1],c=!0;else {var l="",d=r[2],m=r[3],p=r[4],w=r[5];if(!c&&u.length){var b=u.length-1,g=u[b];(!s||s.indexOf(g)>-1)&&(l=g,u=u.slice(0,b));}u&&(e.push(u),u="",c=!1);var E=m||p,x=l||f;e.push({name:d||i++,prefix:l,delimiter:x,optional:"?"===w||"*"===w,repeat:"+"===w||"*"===w,pattern:E?A(E):"[^"+k(x===f?x:x+f)+"]+?"});}}return (u||o<t.length)&&e.push(u+t.substr(o)),e}function E(t,n){return function(r,e){var i=t.exec(r);if(!i)return !1;for(var o=i[0],u=i.index,f={},s=e&&e.decode||decodeURIComponent,c=1;c<i.length;c++)if(void 0!==i[c]){var a=n[c-1];f[a.name]=a.repeat?i[c].split(a.delimiter).map((function(t){return s(t,a)})):s(i[c],a);}return {path:o,index:u,params:f}}}function x(t,n){for(var r=new Array(t.length),e=0;e<t.length;e++)"object"==typeof t[e]&&(r[e]=new RegExp("^(?:"+t[e].pattern+")$",R(n)));return function(n,e){for(var i="",o=e&&e.encode||encodeURIComponent,u=!e||!1!==e.validate,f=0;f<t.length;f++){var s=t[f];if("string"!=typeof s){var c,a=n?n[s.name]:void 0;if(Array.isArray(a)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but got array');if(0===a.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var h=0;h<a.length;h++){if(c=o(a[h],s),u&&!r[f].test(c))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'"');i+=(0===h?s.prefix:s.delimiter)+c;}}else if("string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a){if(!s.optional)throw new TypeError('Expected "'+s.name+'" to be '+(s.repeat?"an array":"a string"))}else {if(c=o(String(a),s),u&&!r[f].test(c))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but got "'+c+'"');i+=s.prefix+c;}}else i+=s;}return i}}function k(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function A(t){return t.replace(/([=!:$/()])/g,"\\$1")}function R(t){return t&&t.sensitive?"":"i"}function T(t,n,r){for(var e=(r=r||{}).strict,i=!1!==r.start,o=!1!==r.end,u=r.delimiter||y,f=[].concat(r.endsWith||[]).map(k).concat("$").join("|"),s=i?"^":"",c=0;c<t.length;c++){var a=t[c];if("string"==typeof a)s+=k(a);else {var h=a.repeat?"(?:"+a.pattern+")(?:"+k(a.delimiter)+"(?:"+a.pattern+"))*":a.pattern;n&&n.push(a),s+=a.optional?a.prefix?"(?:"+k(a.prefix)+"("+h+"))?":"("+h+")?":k(a.prefix)+"("+h+")";}}if(o)e||(s+="(?:"+k(u)+")?"),s+="$"===f?"$":"(?="+f+")";else {var v=t[t.length-1],l="string"==typeof v?v[v.length-1]===u:void 0===v;e||(s+="(?:"+k(u)+"(?="+f+"))?"),l||(s+="(?="+k(u)+"|"+f+")");}return new RegExp(s,R(r))}function O(t,n,r){return t instanceof RegExp?function(t,n){if(!n)return t;var r=t.source.match(/\((?!\?)/g);if(r)for(var e=0;e<r.length;e++)n.push({name:e,prefix:null,delimiter:null,optional:!1,repeat:!1,pattern:null});return t}(t,n):Array.isArray(t)?function(t,n,r){for(var e=[],i=0;i<t.length;i++)e.push(O(t[i],n,r).source);return new RegExp("(?:"+e.join("|")+")",R(r))}(t,n,r):function(t,n,r){return T(g(t,r),n,r)}(t,n,r)}d.match=function(t,n){var r=[];return E(O(t,r,n),r)},d.regexpToFunction=m,d.parse=p,d.compile=function(t,n){return x(g(t,n),n)},d.tokensToFunction=w,d.tokensToRegExp=b;var S={container:"container",history:"history",namespace:"namespace",prefix:"data-barba",prevent:"prevent",wrapper:"wrapper"},j=new(function(){function t(){this.o=S,this.u=new DOMParser;}var n=t.prototype;return n.toString=function(t){return t.outerHTML},n.toDocument=function(t){return this.u.parseFromString(t,"text/html")},n.toElement=function(t){var n=document.createElement("div");return n.innerHTML=t,n},n.getHtml=function(t){return void 0===t&&(t=document),this.toString(t.documentElement)},n.getWrapper=function(t){return void 0===t&&(t=document),t.querySelector("["+this.o.prefix+'="'+this.o.wrapper+'"]')},n.getContainer=function(t){return void 0===t&&(t=document),t.querySelector("["+this.o.prefix+'="'+this.o.container+'"]')},n.removeContainer=function(t){document.body.contains(t)&&t.parentNode.removeChild(t);},n.addContainer=function(t,n){var r=this.getContainer();r?this.s(t,r):n.appendChild(t);},n.getNamespace=function(t){void 0===t&&(t=document);var n=t.querySelector("["+this.o.prefix+"-"+this.o.namespace+"]");return n?n.getAttribute(this.o.prefix+"-"+this.o.namespace):null},n.getHref=function(t){if(t.tagName&&"a"===t.tagName.toLowerCase()){if("string"==typeof t.href)return t.href;var n=t.getAttribute("href")||t.getAttribute("xlink:href");if(n)return this.resolveUrl(n.baseVal||n)}return null},n.resolveUrl=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var i=document.createElement("base");if(i.href=arguments[0],1===e)return i.href;var o=document.getElementsByTagName("head")[0];o.insertBefore(i,o.firstChild);for(var u,f=document.createElement("a"),s=1;s<e;s++)f.href=arguments[s],i.href=u=f.href;return o.removeChild(i),u},n.s=function(t,n){n.parentNode.insertBefore(t,n.nextSibling);},t}()),M=new(function(){function t(){this.h=[],this.v=-1;}var e=t.prototype;return e.init=function(t,n){this.l="barba";var r={ns:n,scroll:{x:window.scrollX,y:window.scrollY},url:t};this.h.push(r),this.v=0;var e={from:this.l,index:0,states:[].concat(this.h)};window.history&&window.history.replaceState(e,"",t);},e.change=function(t,n,r){if(r&&r.state){var e=r.state,i=e.index;n=this.m(this.v-i),this.replace(e.states),this.v=i;}else this.add(t,n);return n},e.add=function(t,n){var r=this.size,e=this.p(n),i={ns:"tmp",scroll:{x:window.scrollX,y:window.scrollY},url:t};this.h.push(i),this.v=r;var o={from:this.l,index:r,states:[].concat(this.h)};switch(e){case"push":window.history&&window.history.pushState(o,"",t);break;case"replace":window.history&&window.history.replaceState(o,"",t);}},e.update=function(t,n){var e=n||this.v,i=r({},this.get(e),{},t);this.set(e,i);},e.remove=function(t){t?this.h.splice(t,1):this.h.pop(),this.v--;},e.clear=function(){this.h=[],this.v=-1;},e.replace=function(t){this.h=t;},e.get=function(t){return this.h[t]},e.set=function(t,n){return this.h[t]=n},e.p=function(t){var n="push",r=t,e=S.prefix+"-"+S.history;return r.hasAttribute&&r.hasAttribute(e)&&(n=r.getAttribute(e)),n},e.m=function(t){return Math.abs(t)>1?t>0?"forward":"back":0===t?"popstate":t>0?"back":"forward"},n(t,[{key:"current",get:function(){return this.h[this.v]}},{key:"state",get:function(){return this.h[this.h.length-1]}},{key:"previous",get:function(){return this.v<1?null:this.h[this.v-1]}},{key:"size",get:function(){return this.h.length}}]),t}()),L=function(t,n){try{var r=function(){if(!n.next.html)return Promise.resolve(t).then((function(t){var r=n.next;if(t){var e=j.toElement(t);r.namespace=j.getNamespace(e),r.container=j.getContainer(e),r.html=t,M.update({ns:r.namespace});var i=j.toDocument(t);document.title=i.title;}}))}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(t){return Promise.reject(t)}},$=d,_={__proto__:null,update:L,nextTick:function(){return new Promise((function(t){window.requestAnimationFrame(t);}))},pathToRegexp:$},q=function(){return window.location.origin},B=function(t){return void 0===t&&(t=window.location.href),U(t).port},U=function(t){var n,r=t.match(/:\d+/);if(null===r)/^http/.test(t)&&(n=80),/^https/.test(t)&&(n=443);else {var e=r[0].substring(1);n=parseInt(e,10);}var i,o=t.replace(q(),""),u={},f=o.indexOf("#");f>=0&&(i=o.slice(f+1),o=o.slice(0,f));var s=o.indexOf("?");return s>=0&&(u=D(o.slice(s+1)),o=o.slice(0,s)),{hash:i,path:o,port:n,query:u}},D=function(t){return t.split("&").reduce((function(t,n){var r=n.split("=");return t[r[0]]=r[1],t}),{})},F=function(t){return void 0===t&&(t=window.location.href),t.replace(/(\/#.*|\/|#.*)$/,"")},H={__proto__:null,getHref:function(){return window.location.href},getOrigin:q,getPort:B,getPath:function(t){return void 0===t&&(t=window.location.href),U(t).path},parse:U,parseQuery:D,clean:F};function I(t,n,r){return void 0===n&&(n=2e3),new Promise((function(e,i){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE)if(200===o.status)e(o.responseText);else if(o.status){var n={status:o.status,statusText:o.statusText};r(t,n),i(n);}},o.ontimeout=function(){var e=new Error("Timeout error ["+n+"]");r(t,e),i(e);},o.onerror=function(){var n=new Error("Fetch error");r(t,n),i(n);},o.open("GET",t),o.timeout=n,o.setRequestHeader("Accept","text/html,application/xhtml+xml,application/xml"),o.setRequestHeader("x-barba","yes"),o.send();}))}var C=function(t){return !!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then};function N(t,n){return void 0===n&&(n={}),function(){for(var r=arguments.length,e=new Array(r),i=0;i<r;i++)e[i]=arguments[i];var o=!1,u=new Promise((function(r,i){n.async=function(){return o=!0,function(t,n){t?i(t):r(n);}};var u=t.apply(n,e);o||(C(u)?u.then(r,i):r(u));}));return u}}var X=new(function(t){function n(){var n;return (n=t.call(this)||this).logger=new l("@barba/core"),n.all=["ready","page","reset","currentAdded","currentRemoved","nextAdded","nextRemoved","beforeOnce","once","afterOnce","before","beforeLeave","leave","afterLeave","beforeEnter","enter","afterEnter","after"],n.registered=new Map,n.init(),n}e(n,t);var r=n.prototype;return r.init=function(){var t=this;this.registered.clear(),this.all.forEach((function(n){t[n]||(t[n]=function(r,e){t.registered.has(n)||t.registered.set(n,new Set),t.registered.get(n).add({ctx:e||{},fn:r});});}));},r.do=function(t){for(var n=this,r=arguments.length,e=new Array(r>1?r-1:0),i=1;i<r;i++)e[i-1]=arguments[i];if(this.registered.has(t)){var o=Promise.resolve();return this.registered.get(t).forEach((function(t){o=o.then((function(){return N(t.fn,t.ctx).apply(void 0,e)}));}
97)),o.catch((function(r){n.logger.debug("Hook error ["+t+"]"),n.logger.error(r);}))}return Promise.resolve()},r.clear=function(){var t=this;this.all.forEach((function(n){delete t[n];})),this.init();},r.help=function(){this.logger.info("Available hooks: "+this.all.join(","));var t=[];this.registered.forEach((function(n,r){return t.push(r)})),this.logger.info("Registered hooks: "+t.join(","));},n}(h)),z=function(){function t(t){if(this.P=[],"boolean"==typeof t)this.g=t;else {var n=Array.isArray(t)?t:[t];this.P=n.map((function(t){return $(t)}));}}return t.prototype.checkHref=function(t){if("boolean"==typeof this.g)return this.g;var n=U(t).path;return this.P.some((function(t){return null!==t.exec(n)}))},t}(),G=function(t){function n(n){var r;return (r=t.call(this,n)||this).k=new Map,r}e(n,t);var i=n.prototype;return i.set=function(t,n,r){return this.k.set(t,{action:r,request:n}),{action:r,request:n}},i.get=function(t){return this.k.get(t)},i.getRequest=function(t){return this.k.get(t).request},i.getAction=function(t){return this.k.get(t).action},i.has=function(t){return !this.checkHref(t)&&this.k.has(t)},i.delete=function(t){return this.k.delete(t)},i.update=function(t,n){var e=r({},this.k.get(t),{},n);return this.k.set(t,e),e},n}(z),Q=function(){return !window.history.pushState},W=function(t){return !t.el||!t.href},J=function(t){var n=t.event;return n.which>1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey},K=function(t){var n=t.el;return n.hasAttribute("target")&&"_blank"===n.target},V=function(t){var n=t.el;return void 0!==n.protocol&&window.location.protocol!==n.protocol||void 0!==n.hostname&&window.location.hostname!==n.hostname},Y=function(t){var n=t.el;return void 0!==n.port&&B()!==B(n.href)},Z=function(t){var n=t.el;return n.getAttribute&&"string"==typeof n.getAttribute("download")},tt=function(t){return t.el.hasAttribute(S.prefix+"-"+S.prevent)},nt=function(t){return Boolean(t.el.closest("["+S.prefix+"-"+S.prevent+'="all"]'))},rt=function(t){var n=t.href;return F(n)===F()&&B(n)===B()},et=function(t){function n(n){var r;return (r=t.call(this,n)||this).suite=[],r.tests=new Map,r.init(),r}e(n,t);var r=n.prototype;return r.init=function(){this.add("pushState",Q),this.add("exists",W),this.add("newTab",J),this.add("blank",K),this.add("corsDomain",V),this.add("corsPort",Y),this.add("download",Z),this.add("preventSelf",tt),this.add("preventAll",nt),this.add("sameUrl",rt,!1);},r.add=function(t,n,r){void 0===r&&(r=!0),this.tests.set(t,n),r&&this.suite.push(t);},r.run=function(t,n,r,e){return this.tests.get(t)({el:n,event:r,href:e})},r.checkLink=function(t,n,r){var e=this;return this.suite.some((function(i){return e.run(i,t,n,r)}))},n}(z),it=function(t){function n(r,e){var i;void 0===e&&(e="Barba error");for(var o=arguments.length,u=new Array(o>2?o-2:0),f=2;f<o;f++)u[f-2]=arguments[f];return (i=t.call.apply(t,[this].concat(u))||this).error=r,i.label=e,Error.captureStackTrace&&Error.captureStackTrace(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i),n),i.name="BarbaError",i}return e(n,t),n}(f(Error)),ot=function(){function t(t){void 0===t&&(t=[]),this.logger=new l("@barba/core"),this.all=[],this.page=[],this.once=[],this.A=[{name:"namespace",type:"strings"},{name:"custom",type:"function"}],t&&(this.all=this.all.concat(t)),this.update();}var n=t.prototype;return n.add=function(t,n){switch(t){case"rule":this.A.splice(n.position||0,0,n.value);break;case"transition":default:this.all.push(n);}this.update();},n.resolve=function(t,n){var r=this;void 0===n&&(n={});var e=n.once?this.once:this.page;e=e.filter(n.self?function(t){return t.name&&"self"===t.name}:function(t){return !t.name||"self"!==t.name});var i=new Map,o=e.find((function(e){var o=!0,u={};return !(!n.self||"self"!==e.name)||(r.A.reverse().forEach((function(n){o&&(o=r.R(e,n,t,u),e.from&&e.to&&(o=r.R(e,n,t,u,"from")&&r.R(e,n,t,u,"to")),e.from&&!e.to&&(o=r.R(e,n,t,u,"from")),!e.from&&e.to&&(o=r.R(e,n,t,u,"to")));})),i.set(e,u),o)})),u=i.get(o),f=[];if(f.push(n.once?"once":"page"),n.self&&f.push("self"),u){var s,c=[o];Object.keys(u).length>0&&c.push(u),(s=this.logger).info.apply(s,["Transition found ["+f.join(",")+"]"].concat(c));}else this.logger.info("No transition found ["+f.join(",")+"]");return o},n.update=function(){var t=this;this.all=this.all.map((function(n){return t.T(n)})).sort((function(t,n){return t.priority-n.priority})).reverse().map((function(t){return delete t.priority,t})),this.page=this.all.filter((function(t){return void 0!==t.leave||void 0!==t.enter})),this.once=this.all.filter((function(t){return void 0!==t.once}));},n.R=function(t,n,r,e,i){var o=!0,u=!1,f=t,s=n.name,c=s,a=s,h=s,v=i?f[i]:f,l="to"===i?r.next:r.current;if(i?v&&v[s]:v[s]){switch(n.type){case"strings":default:var d=Array.isArray(v[c])?v[c]:[v[c]];l[c]&&-1!==d.indexOf(l[c])&&(u=!0),-1===d.indexOf(l[c])&&(o=!1);break;case"object":var m=Array.isArray(v[a])?v[a]:[v[a]];l[a]?(l[a].name&&-1!==m.indexOf(l[a].name)&&(u=!0),-1===m.indexOf(l[a].name)&&(o=!1)):o=!1;break;case"function":v[h](r)?u=!0:o=!1;}u&&(i?(e[i]=e[i]||{},e[i][s]=f[i][s]):e[s]=f[s]);}return o},n.O=function(t,n,r){var e=0;return (t[n]||t.from&&t.from[n]||t.to&&t.to[n])&&(e+=Math.pow(10,r),t.from&&t.from[n]&&(e+=1),t.to&&t.to[n]&&(e+=2)),e},n.T=function(t){var n=this;t.priority=0;var r=0;return this.A.forEach((function(e,i){r+=n.O(t,e.name,i+1);})),t.priority=r,t},t}(),ut=function(){function t(t){void 0===t&&(t=[]),this.logger=new l("@barba/core"),this.S=!1,this.store=new ot(t);}var r=t.prototype;return r.get=function(t,n){return this.store.resolve(t,n)},r.doOnce=function(t){var n=t.data,r=t.transition;try{var e=function(){i.S=!1;},i=this,o=r||{};i.S=!0;var u=s((function(){return Promise.resolve(i.j("beforeOnce",n,o)).then((function(){return Promise.resolve(i.once(n,o)).then((function(){return Promise.resolve(i.j("afterOnce",n,o)).then((function(){}))}))}))}),(function(t){i.S=!1,i.logger.debug("Transition error [before/after/once]"),i.logger.error(t);}));return Promise.resolve(u&&u.then?u.then(e):e())}catch(t){return Promise.reject(t)}},r.doPage=function(t){var n=t.data,r=t.transition,e=t.page,i=t.wrapper;try{var o=function(t){if(u)return t;f.S=!1;},u=!1,f=this,c=r||{},a=!0===c.sync||!1;f.S=!0;var h=s((function(){function t(){return Promise.resolve(f.j("before",n,c)).then((function(){var t=!1;function r(r){return t?r:Promise.resolve(f.remove(n)).then((function(){return Promise.resolve(f.j("after",n,c)).then((function(){}))}))}var o=function(){if(a)return s((function(){return Promise.resolve(f.add(n,i)).then((function(){return Promise.resolve(f.j("beforeLeave",n,c)).then((function(){return Promise.resolve(f.j("beforeEnter",n,c)).then((function(){return Promise.resolve(Promise.all([f.leave(n,c),f.enter(n,c)])).then((function(){return Promise.resolve(f.j("afterLeave",n,c)).then((function(){return Promise.resolve(f.j("afterEnter",n,c)).then((function(){}))}))}))}))}))}))}),(function(t){if(f.M(t))throw new it(t,"Transition error [sync]")}));var r=function(r){return t?r:s((function(){var t=function(){if(!1!==o)return Promise.resolve(f.add(n,i)).then((function(){return Promise.resolve(f.j("beforeEnter",n,c)).then((function(){return Promise.resolve(f.enter(n,c,o)).then((function(){return Promise.resolve(f.j("afterEnter",n,c)).then((function(){}))}))}))}))}();if(t&&t.then)return t.then((function(){}))}),(function(t){if(f.M(t))throw new it(t,"Transition error [before/after/enter]")}))},o=!1,u=s((function(){return Promise.resolve(f.j("beforeLeave",n,c)).then((function(){return Promise.resolve(Promise.all([f.leave(n,c),L(e,n
97)]).then((function(t){return t[0]}))).then((function(t){return o=t,Promise.resolve(f.j("afterLeave",n,c)).then((function(){}))}))}))}),(function(t){if(f.M(t))throw new it(t,"Transition error [before/after/leave]")}));return u&&u.then?u.then(r):r(u)}();return o&&o.then?o.then(r):r(o)}))}var r=function(){if(a)return Promise.resolve(L(e,n)).then((function(){}))}();return r&&r.then?r.then(t):t()}),(function(t){if(f.S=!1,t.name&&"BarbaError"===t.name)throw f.logger.debug(t.label),f.logger.error(t.error),t;throw f.logger.debug("Transition error [page]"),f.logger.error(t),t}));return Promise.resolve(h&&h.then?h.then(o):o(h))}catch(t){return Promise.reject(t)}},r.once=function(t,n){try{return Promise.resolve(X.do("once",t,n)).then((function(){return n.once?N(n.once,n)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},r.leave=function(t,n){try{return Promise.resolve(X.do("leave",t,n)).then((function(){return n.leave?N(n.leave,n)(t):Promise.resolve()}))}catch(t){return Promise.reject(t)}},r.enter=function(t,n,r){try{return Promise.resolve(X.do("enter",t,n)).then((function(){return n.enter?N(n.enter,n)(t,r):Promise.resolve()}))}catch(t){return Promise.reject(t)}},r.add=function(t,n){try{return j.addContainer(t.next.container,n),X.do("nextAdded",t),Promise.resolve()}catch(t){return Promise.reject(t)}},r.remove=function(t){try{return j.removeContainer(t.current.container),X.do("currentRemoved",t),Promise.resolve()}catch(t){return Promise.reject(t)}},r.M=function(t){return t.message?!/Timeout error|Fetch error/.test(t.message):!t.status},r.j=function(t,n,r){try{return Promise.resolve(X.do(t,n,r)).then((function(){return r[t]?N(r[t],r)(n):Promise.resolve()}))}catch(t){return Promise.reject(t)}},n(t,[{key:"isRunning",get:function(){return this.S},set:function(t){this.S=t;}},{key:"hasOnce",get:function(){return this.store.once.length>0}},{key:"hasSelf",get:function(){return this.store.all.some((function(t){return "self"===t.name}))}},{key:"shouldWait",get:function(){return this.store.all.some((function(t){return t.to&&!t.to.route||t.sync}))}}]),t}(),ft=function(){function t(t){var n=this;this.names=["beforeLeave","afterLeave","beforeEnter","afterEnter"],this.byNamespace=new Map,0!==t.length&&(t.forEach((function(t){n.byNamespace.set(t.namespace,t);})),this.names.forEach((function(t){X[t](n.L(t));})));}return t.prototype.L=function(t){var n=this;return function(r){var e=t.match(/enter/i)?r.next:r.current,i=n.byNamespace.get(e.namespace);return i&&i[t]?N(i[t],i)(r):Promise.resolve()}},t}();Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var n=this;do{if(n.matches(t))return n;n=n.parentElement||n.parentNode;}while(null!==n&&1===n.nodeType);return null});var st={container:null,html:"",namespace:"",url:{hash:"",href:"",path:"",port:null,query:{}}};return new(function(){function t(){this.version=a,this.schemaPage=st,this.Logger=l,this.logger=new l("@barba/core"),this.plugins=[],this.hooks=X,this.dom=j,this.helpers=_,this.history=M,this.request=I,this.url=H;}var e=t.prototype;return e.use=function(t,n){var r=this.plugins;r.indexOf(t)>-1?this.logger.warn("Plugin ["+t.name+"] already installed."):"function"==typeof t.install?(t.install(this,n),r.push(t)):this.logger.warn("Plugin ["+t.name+'] has no "install" method.');},e.init=function(t){var n=void 0===t?{}:t,e=n.transitions,i=void 0===e?[]:e,o=n.views,u=void 0===o?[]:o,f=n.schema,s=void 0===f?S:f,c=n.requestError,a=n.timeout,h=void 0===a?2e3:a,v=n.cacheIgnore,d=void 0!==v&&v,m=n.prefetchIgnore,p=void 0!==m&&m,w=n.preventRunning,b=void 0!==w&&w,y=n.prevent,P=void 0===y?null:y,g=n.debug,E=n.logLevel;if(l.setLevel(!0===(void 0!==g&&g)?"debug":void 0===E?"off":E),this.logger.info(this.version),Object.keys(s).forEach((function(t){S[t]&&(S[t]=s[t]);})),this.$=c,this.timeout=h,this.cacheIgnore=d,this.prefetchIgnore=p,this.preventRunning=b,this._=this.dom.getWrapper(),!this._)throw new Error("[@barba/core] No Barba wrapper found");this._.setAttribute("aria-live","polite"),this.q();var x=this.data.current;if(!x.container)throw new Error("[@barba/core] No Barba container found");if(this.cache=new G(d),this.prevent=new et(p),this.transitions=new ut(i),this.views=new ft(u),null!==P){if("function"!=typeof P)throw new Error("[@barba/core] Prevent should be a function");this.prevent.add("preventCustom",P);}this.history.init(x.url.href,x.namespace),this.B=this.B.bind(this),this.U=this.U.bind(this),this.D=this.D.bind(this),this.F(),this.plugins.forEach((function(t){return t.init()}));var k=this.data;k.trigger="barba",k.next=k.current,k.current=r({},this.schemaPage),this.hooks.do("ready",k),this.once(k),this.q();},e.destroy=function(){this.q(),this.H(),this.history.clear(),this.hooks.clear(),this.plugins=[];},e.force=function(t){window.location.assign(t);},e.go=function(t,n,r){var e;if(void 0===n&&(n="barba"),this.transitions.isRunning)this.force(t);else if(!(e="popstate"===n?this.history.current&&this.url.getPath(this.history.current.url)===this.url.getPath(t):this.prevent.run("sameUrl",null,null,t))||this.transitions.hasSelf)return n=this.history.change(t,n,r),r&&(r.stopPropagation(),r.preventDefault()),this.page(t,n,e)},e.once=function(t){try{var n=this;return Promise.resolve(n.hooks.do("beforeEnter",t)).then((function(){function r(){return Promise.resolve(n.hooks.do("afterEnter",t)).then((function(){}))}var e=function(){if(n.transitions.hasOnce){var r=n.transitions.get(t,{once:!0});return Promise.resolve(n.transitions.doOnce({transition:r,data:t})).then((function(){}))}}();return e&&e.then?e.then(r):r()}))}catch(t){return Promise.reject(t)}},e.page=function(t,n,e){try{var i=function(){var t=o.data;return Promise.resolve(o.hooks.do("page",t)).then((function(){var n=s((function(){var n=o.transitions.get(t,{once:!1,self:e});return Promise.resolve(o.transitions.doPage({data:t,page:u,transition:n,wrapper:o._})).then((function(){o.q();}))}),(function(){0===l.getLevel()&&o.force(t.current.url.href);}));if(n&&n.then)return n.then((function(){}))}))},o=this;o.data.next.url=r({href:t},o.url.parse(t)),o.data.trigger=n;var u=o.cache.has(t)?o.cache.update(t,{action:"click"}).request:o.cache.set(t,o.request(t,o.timeout,o.onRequestError.bind(o,n)),"click").request,f=function(){if(o.transitions.shouldWait)return Promise.resolve(L(u,o.data)).then((function(){}))}();return Promise.resolve(f&&f.then?f.then(i):i())}catch(t){return Promise.reject(t)}},e.onRequestError=function(t){this.transitions.isRunning=!1;for(var n=arguments.length,r=new Array(n>1?n-1:0),e=1;e<n;e++)r[e-1]=arguments[e];var i=r[0],o=r[1],u=this.cache.getAction(i);return this.cache.delete(i),!(this.$&&!1===this.$(t,u,i,o)||("click"===u&&this.force(i),1))},e.prefetch=function(t){var n=this;this.cache.has(t)||this.cache.set(t,this.request(t,this.timeout,this.onRequestError.bind(this,"barba")).catch((function(t){n.logger.error(t);})),"prefetch");},e.F=function(){!0!==this.prefetchIgnore&&(document.addEventListener("mouseover",this.B),document.addEventListener("touchstart",this.B)),document.addEventListener("click",this.U),window.addEventListener("popstate",this.D);},e.H=function(){!0!==this.prefetchIgnore&&(document.removeEventListener("mouseover",this.B),document.removeEventListener("touchstart",this.B)),document.removeEventListener("click",this.U),window.removeEventListener("popstate",this.D);},e.B=function(t){var n=this,r=this.I(t);if(r){var e=this.dom.getHref(r);this.prevent.checkHref(e)||this.cache.has(e)||this.cache.set(e,this.request(e,this.timeout,this.onRequestError.bind(this,r)).catch((function(t){n.logger.error(t);})),"enter");}},e.U=function(t){var n=this.I(t);if(n)return this.transitions.isRunning&&this.preventRunning?(t.preventDefault(),void t.stopPropagation()):void this.go(this.dom.getHref(n),n,t)},e.D=function(t){this.go(this.url.getHref(),"popstate",t);},e.I=function(t){for(var n=t.target;
97n&&!this.dom.getHref(n);)n=n.parentNode;if(n&&!this.prevent.checkLink(n,t,this.dom.getHref(n)))return n},e.q=function(){var t=this.url.getHref(),n={container:this.dom.getContainer(),html:this.dom.getHtml(),namespace:this.dom.getNamespace(),url:r({href:t},this.url.parse(t))};this.C={current:n,next:r({},this.schemaPage),trigger:void 0},this.hooks.do("reset",this.data);},n(t,[{key:"data",get:function(){return this.C}},{key:"wrapper",get:function(){return this._}}]),t}())})); 98 99 }(barba_umd)); 100 101 document.addEventListener("DOMContentLoaded", function () { 102 var siteHeaderNavToggler = document.querySelector('.site-header-nav-toggler'); 103 var siteHeader = document.querySelector('.site-header'); 104 document.querySelector('.site-header-bar'); 105 document.querySelector('.site-header-menu'); 106 var siteHeaderExpanded = false; 107 var navSectionExpanded = false; 108 var bodyStyles = window.getComputedStyle(document.body); 109 var colorValues = []; 110 console.log(bodyStyles); 111 112 for (var i = 0; i < bodyStyles.length; i++) { 113 if (bodyStyles[i].startsWith('--color-')) { 114 var name = '--color-' + bodyStyles[i]; 115 colorValues.push({ 116 'name': name, 117 'hex': bodyStyles.getPropertyValue(name) 118 }); 119 } 120 } 121 122 console.log(colorValues); 123 siteHeaderNavToggler.addEventListener('click', function (e) { 124 if (siteHeaderExpanded) { 125 siteHeader.classList.remove('expanded'); 126 document.body.classList.remove('menu-visible'); 127 siteHeaderExpanded = false; 128 } else { 129 siteHeader.classList.add('expanded'); 130 document.body.classList.add('menu-visible'); 131 siteHeaderExpanded = true; 132 } 133 }); 134 document.querySelectorAll('.menu-item-has-children span').forEach(function (el, index, array) { 135 el.addEventListener('click', function (e) { 136 if (e.target.parentNode.classList.contains('active')) { 137 e.target.parentNode.classList.remove('active'); 138 slideUp(e.target.parentNode.querySelector('ul')); 139 } else { 140 e.target.parentNode.classList.add('active'); 141 slideDown(e.target.parentNode.querySelector('ul')); 142 navSectionExpanded = true; 143 } 144 145 if (navSectionExpanded) { 146 document.querySelectorAll('#menu-main-navigation > li').forEach(function (el2, index, array) { 147 if (el2 != e.target.parentNode) { 148 el2.classList.remove('active'); 149 slideUp(el2.querySelector('ul')); 150 navSectionExpanded = false; 151 } 152 }); 153 } 154 }); 155 }); // document.querySelectorAll('button').forEach(function(el, index, array) { 156 // el.addEventListener('click', function(e) { 157 // let member = el.dataset.member 158 // document.querySelectorAll('.member').forEach(function(el, index, array) { 159 // if (el.classList.contains('is-visible')) { 160 // el.classList.remove('is-visible') 161 // } 162 // }) 163 // document.querySelector(".member--" + member).classList.add('is-visible') 164 // }) 165 // }) 166 // function propsToVars(targets, props, vars) { 167 // let data = []; 168 // props = props.split(","); 169 // vars = vars || {}; 170 // gsap.utils.toArray(targets).forEach((target, i) => { 171 // let d = (data[i] = {}), 172 // get = gsap.getProperty(target); 173 // props.forEach((p) => (d[p] = get(p))); 174 // }); 175 // props.forEach((p) => (vars[p] = (i) => data[i][p])); 176 // return vars; 177 // } 178 // function toNative(targets, props, vars) { 179 // vars = propsToVars(targets, props, vars); 180 // gsap.set(targets, { clearProps: true }); 181 // return gsap.from(targets, vars); 182 // } 183 // let circle1OriginalProperties = propsToVars(".circle1", "left,top"); 184 // let circle2OriginalProperties = propsToVars(".circle2", "left,top"); 185 // let circle3OriginalProperties = propsToVars(".circle3", "left,top"); 186 187 var circle1OriginalSize = 15; 188 var circle1OriginalLeft = 20; 189 var circle1OriginalTop = 15; 190 var circle2OriginalSize = 25; 191 var circle2OriginalLeft = 57; 192 var circle2OriginalTop = 15; 193 var circle3OriginalSize = 40; 194 var circle3OriginalLeft = 10; 195 var circle3OriginalTop = 50; 196 var tl = gsap.timeline({ 197 repeat: -1 198 }); 199 gsap.defaults({ 200 ease: "power3.out", 201 duration: 1 202 }); 203 204 function calculate(positionWanted, positionOriginal, sizeOriginal) { 205 return (positionWanted - positionOriginal) / sizeOriginal * 100; 206 } 207 208 tl.addLabel("firstMoveStart", "+=2"); // Moves 3 circles first time 209 210 tl.to(".circle1", { 211 xPercent: calculate(75, circle1OriginalLeft, circle1OriginalSize), 212 yPercent: calculate(25, circle1OriginalTop, circle1OriginalSize) 213 }, "firstMoveStart"); 214 tl.to(".circle2", { 215 xPercent: calculate(55, circle2OriginalLeft, circle2OriginalSize), 216 yPercent: calculate(60, circle2OriginalTop, circle2OriginalSize) 217 }, "firstMoveStart"); 218 tl.to(".circle3", { 219 xPercent: calculate(6, circle3OriginalLeft, circle3OriginalSize), 220 yPercent: calculate(10, circle3OriginalTop, circle3OriginalSize) 221 }, "firstMoveStart"); // Hides device 1 222 223 tl.to(".device1", { 224 rotation: 50, 225 opacity: 0, 226 scale: 0.2 227 }, "firstMoveStart"); // Shows device 2 228 229 tl.fromTo(".device2", { 230 rotation: -50, 231 opacity: 0, 232 scale: 0.2 233 }, { 234 rotation: 0, 235 opacity: 1, 236 scale: 1 237 }, "firstMoveStart"); 238 tl.addLabel("firstMoveEnd"); 239 tl.addLabel("secondMoveStart", "+=3"); // Moves 3 circles second time 240 241 tl.to(".circle1", { 242 xPercent: calculate(51, circle1OriginalLeft, circle1OriginalSize), 243 yPercent: calculate(80, circle1OriginalTop, circle1OriginalSize) 244 }, "secondMoveStart"); 245 tl.to(".circle2", { 246 xPercent: calculate(15, circle2OriginalLeft, circle2OriginalSize), 247 yPercent: calculate(10, circle2OriginalTop, circle2OriginalSize) 248 }, "secondMoveStart"); 249 tl.to(".circle3", { 250 xPercent: calculate(52, circle3OriginalLeft, circle3OriginalSize), 251 yPercent: calculate(25, circle3OriginalTop, circle3OriginalSize) 252 }, "secondMoveStart"); // Hides device 2 253 254 tl.to(".device2", { 255 rotation: 50, 256 opacity: 0, 257 scale: 0.2 258 }, "secondMoveStart"); // Shows device 3 259 260 tl.fromTo(".device3", { 261 transform: -50, 262 rotation: -50, 263 opacity: 0, 264 scale: 0.2 265 }, { 266 transform: -50, 267 rotation: 0, 268 opacity: 1, 269 scale: 1 270 }, "secondMoveStart"); 271 tl.addLabel("secondMoveEnd"); 272 tl.addLabel("thirdMoveStart", "+=3"); // Moves 3 circles third time 273 274 tl.to(".circle1", { 275 xPercent: calculate(20, circle1OriginalLeft, circle1OriginalSize), 276 yPercent: calculate(15, circle1OriginalTop, circle1OriginalSize) 277 }, "thirdMoveStart"); 278 tl.to(".circle2", { 279 xPercent: calculate(57, circle2OriginalLeft, circle2OriginalSize), 280 yPercent: calculate(15, circle2OriginalTop, circle2OriginalSize) 281 }, "thirdMoveStart"); 282 tl.to(".circle3", { 283 xPercent: calculate(10, circle3OriginalLeft, circle3OriginalSize), 284 yPercent: calculate(50, circle3OriginalTop, circle3OriginalSize) 285 }, "thirdMoveStart"); // Hides device 3 286 287 tl.to(".device3", { 288 rotation: 50, 289 opacity: 0, 290 scale: 0.2 291 }, "thirdMoveStart"); // Shoes device 1 292 293 tl.set(".device1", { 294 opacity: 0, 295 scale: 0.2, 296 rotation: -50 297 }, "thirdMoveStart"); 298 tl.to(".device1", { 299 rotation: 0, 300 opacity: 1, 301 scale: 1 302 }, "thirdMoveStart"); 303 tl.addLabel("thirdMoveEnd"); // function delay(n) { 304 // n = n || 2000 305 // // Keep official documentation wording, done -> resolve 306 // // and make it more concise 307 // return new Promise(resolve => { 308 // setTimeout(resolve, n) 309 // }) 310 // } 311 });
311 // function init() { 312 // const loader = document.querySelector('.loader'); 313 // // reset position of the loading screen 314 // gsap.set(loader, { 315 // scaleX: 0, 316 // rotation: 10, 317 // xPercent: -5, 318 // yPercent: -50, 319 // transformOrigin: 'left center', 320 // autoAlpha: 1 321 // }); 322 // function loaderIn() { 323 // // GSAP tween to stretch the loading screen across the whole screen 324 // return gsap.fromTo(loader, 325 // { 326 // rotation: 10, 327 // scaleX: 0, 328 // xPercent: -5 329 // }, 330 // { 331 // duration: 0.8, 332 // xPercent: 0, 333 // scaleX: 1, 334 // rotation: 0, 335 // ease: 'Power4.inOut', 336 // transformOrigin: 'left center' 337 // }); 338 // } 339 // function loaderAway() { 340 // // GSAP tween to hide the loading screen 341 // return gsap.to(loader, { 342 // duration: 0.8, 343 // scaleX: 0, 344 // xPercent: 5, 345 // rotation: -10, 346 // transformOrigin: 'right center', 347 // ease: 'Power4.inOut' 348 // }); 349 // } 350 // // do something before the transition starts 351 // barba.hooks.before(() => { 352 // document.querySelector('html').classList.add('is-transitioning'); 353 // barba.wrapper.classList.add('is-animating'); 354 // }); 355 // // do something after the transition finishes 356 // barba.hooks.after(() => { 357 // document.querySelector('html').classList.remove('is-transitioning'); 358 // barba.wrapper.classList.remove('is-animating'); 359 // }); 360 // // scroll to the top of the page 361 // barba.hooks.enter(() => { 362 // window.scrollTo(0, 0); 363 // }); 364 // barba.init({ 365 // transitions: [{ 366 // async leave() { 367 // await loaderIn(); 368 // }, 369 // enter() { 370 // loaderAway(); 371 // } 372 // }] 373 // }) 374 // } 375 // window.addEventListener('load', function(){ 376 // init(); 377 // }); 378 379})(); 380//# sourceMappingURL=application-min.js.map 381;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.