diff --git a/assets/scripts/app.js b/assets/scripts/app.js
index 7aa6643a..87a76510 100644
--- a/assets/scripts/app.js
+++ b/assets/scripts/app.js
@@ -1,7 +1,8 @@
import modular from 'modujs';
import * as modules from './modules';
import globals from './globals';
-import { html } from './utils/environment';
+import { $html } from './utils/dom';
+import config from './config';
const app = new modular({
modules: modules
@@ -28,8 +29,8 @@ function init() {
app.init(app);
- html.classList.add('is-loaded');
- html.classList.add('is-ready');
- html.classList.remove('is-loading');
+ $html.classList.add(config.CSS_CLASS.LOADED);
+ $html.classList.add(config.CSS_CLASS.READY);
+ $html.classList.remove(config.CSS_CLASS.LOADING);
}
diff --git a/assets/scripts/config.js b/assets/scripts/config.js
new file mode 100644
index 00000000..b2782039
--- /dev/null
+++ b/assets/scripts/config.js
@@ -0,0 +1,15 @@
+const env = process.env.NODE_ENV
+
+export default config = Object.freeze({
+ // Environments
+ ENV: env,
+ IS_PROD: env === 'production',
+ IS_DEV: env === 'development',
+
+ // CSS class names
+ CSS_CLASS: {
+ LOADING: 'is-loading',
+ READY: 'is-ready',
+ LOADED: 'is-loaded',
+ },
+})
diff --git a/assets/scripts/modules/Load.js b/assets/scripts/modules/Load.js
index 8ff708ef..58910428 100644
--- a/assets/scripts/modules/Load.js
+++ b/assets/scripts/modules/Load.js
@@ -1,5 +1,6 @@
import { module } from 'modujs';
-import modularLoad from 'modularload';
+import barba from '@barba/core';
+import config from '../config'
export default class extends module {
constructor(m) {
@@ -7,16 +8,20 @@ export default class extends module {
}
init() {
- const load = new modularLoad({
- enterDelay: 0,
- transitions: {
- customTransition: {}
- }
- });
-
- load.on('loaded', (transition, oldContainer, newContainer) => {
- this.call('destroy', oldContainer, 'app');
- this.call('update', newContainer, 'app');
+ barba.init({
+ debug: config.IS_DEV,
+ schema: {
+ prefix: 'data-load',
+ },
+ transitions: [{
+ name: 'default-transition',
+ leave: (data) => {
+ this.call('destroy', data.current.container, 'app');
+ },
+ enter: (data) => {
+ this.call('update', data.next.container, 'app');
+ }
+ }]
});
}
}
diff --git a/assets/scripts/utils/dom.js b/assets/scripts/utils/dom.js
new file mode 100644
index 00000000..ed173bd7
--- /dev/null
+++ b/assets/scripts/utils/dom.js
@@ -0,0 +1,4 @@
+const $html = document.documentElement;
+const $body = document.body;
+
+export { $html, $body };
diff --git a/assets/scripts/utils/environment.js b/assets/scripts/utils/environment.js
deleted file mode 100644
index 0a179b0e..00000000
--- a/assets/scripts/utils/environment.js
+++ /dev/null
@@ -1,8 +0,0 @@
-const APP_NAME = 'Boilerplate';
-const DATA_API_KEY = '.data-api';
-
-const html = document.documentElement;
-const body = document.body;
-const isDebug = html.hasAttribute('data-debug');
-
-export { APP_NAME, DATA_API_KEY, html, body, isDebug };
diff --git a/assets/scripts/utils/visibility.js b/assets/scripts/utils/visibility.js
index 63805033..1a870b70 100644
--- a/assets/scripts/utils/visibility.js
+++ b/assets/scripts/utils/visibility.js
@@ -1,6 +1,5 @@
import { isFunction } from './is';
import { arrayContains, findByKeyValue, removeFromArray } from './array';
-import { $document, $window, $html, $body } from './environment';
const CALLBACKS = {
hidden: [],
@@ -22,7 +21,7 @@ const PREFIX = 'v-';
let UUID = 0;
// Main event
-$document.on('visibilitychange', function(event) {
+document.addEventListener('visibilitychange', function(event) {
if (document.hidden) {
onDocumentChange('hidden');
} else {
diff --git a/package-lock.json b/package-lock.json
index 75c7f7eb..84b03c18 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,9 +8,9 @@
"name": "@locomotivemtl/boilerplate",
"version": "1.0.0",
"dependencies": {
+ "@barba/core": "^2.9.7",
"locomotive-scroll": "^4.1.4",
"modujs": "^1.4.2",
- "modularload": "^1.2.6",
"normalize.css": "^8.0.1",
"svg4everybody": "^2.1.9"
},
@@ -66,6 +66,15 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@barba/core": {
+ "version": "2.9.7",
+ "resolved": "https://registry.npmjs.org/@barba/core/-/core-2.9.7.tgz",
+ "integrity": "sha512-GLtpty1fzWnd500AoUHd+hJoSCVElqth20P4W8Bf0IAA9nd1K5e8NbPnCegXC4KzOwV+JHk5DVofAZcoc+I54Q==",
+ "dependencies": {
+ "is-promise": "^2.1.0",
+ "path-to-regexp": "^3.0.0"
+ }
+ },
"node_modules/@gar/promisify": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz",
@@ -3467,6 +3476,11 @@
"node": ">=0.10.0"
}
},
+ "node_modules/is-promise": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
+ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
+ },
"node_modules/is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
@@ -4267,11 +4281,6 @@
"resolved": "https://registry.npmjs.org/modujs/-/modujs-1.4.2.tgz",
"integrity": "sha512-avRHEER9hblxPSDEqX3Z05rmjp8pAcbZL4BjLqxfpL8jDxyCJUEO71fLC8raSLnfg7C3GRTwsN/nAPGiKDO3dA=="
},
- "node_modules/modularload": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/modularload/-/modularload-1.2.8.tgz",
- "integrity": "sha512-UKYB5nXTcv4DVkXJzwdp9vPw7QFfphkLc3Ka3MeFu9kw27SE/9MZivoHIvrtyUqa4Pt7Ss81h4siSI3dt+5xCQ=="
- },
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -4851,6 +4860,11 @@
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
+ "node_modules/path-to-regexp": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
+ "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
+ },
"node_modules/performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -7135,6 +7149,15 @@
"js-tokens": "^4.0.0"
}
},
+ "@barba/core": {
+ "version": "2.9.7",
+ "resolved": "https://registry.npmjs.org/@barba/core/-/core-2.9.7.tgz",
+ "integrity": "sha512-GLtpty1fzWnd500AoUHd+hJoSCVElqth20P4W8Bf0IAA9nd1K5e8NbPnCegXC4KzOwV+JHk5DVofAZcoc+I54Q==",
+ "requires": {
+ "is-promise": "^2.1.0",
+ "path-to-regexp": "^3.0.0"
+ }
+ },
"@gar/promisify": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.2.tgz",
@@ -9728,6 +9751,11 @@
"isobject": "^3.0.1"
}
},
+ "is-promise": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
+ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
+ },
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
@@ -10368,11 +10396,6 @@
"resolved": "https://registry.npmjs.org/modujs/-/modujs-1.4.2.tgz",
"integrity": "sha512-avRHEER9hblxPSDEqX3Z05rmjp8pAcbZL4BjLqxfpL8jDxyCJUEO71fLC8raSLnfg7C3GRTwsN/nAPGiKDO3dA=="
},
- "modularload": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/modularload/-/modularload-1.2.8.tgz",
- "integrity": "sha512-UKYB5nXTcv4DVkXJzwdp9vPw7QFfphkLc3Ka3MeFu9kw27SE/9MZivoHIvrtyUqa4Pt7Ss81h4siSI3dt+5xCQ=="
- },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -10818,6 +10841,11 @@
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
+ "path-to-regexp": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.2.0.tgz",
+ "integrity": "sha512-jczvQbCUS7XmS7o+y1aEO9OBVFeZBQ1MDSEqmO7xSoPgOPoowY/SxLpZ6Vh97/8qHZOteiCKb7gkG9gA2ZUxJA=="
+ },
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
diff --git a/package.json b/package.json
index af5db4a7..77b3eec2 100644
--- a/package.json
+++ b/package.json
@@ -14,9 +14,9 @@
"build": "node --experimental-json-modules --no-warnings build/build.js"
},
"dependencies": {
+ "@barba/core": "^2.9.7",
"locomotive-scroll": "^4.1.4",
"modujs": "^1.4.2",
- "modularload": "^1.2.6",
"normalize.css": "^8.0.1",
"svg4everybody": "^2.1.9"
},
diff --git a/www/assets/scripts/app.js b/www/assets/scripts/app.js
index 7dbbe650..40bd8338 100644
--- a/www/assets/scripts/app.js
+++ b/www/assets/scripts/app.js
@@ -56,6 +56,1004 @@
});
};
+ // node_modules/@barba/core/dist/barba.umd.js
+ var require_barba_umd = __commonJS({
+ "node_modules/@barba/core/dist/barba.umd.js"(exports, module) {
+ !function(t, n) {
+ typeof exports == "object" && typeof module != "undefined" ? module.exports = n() : typeof define == "function" && define.amd ? define(n) : (t = t || self).barba = n();
+ }(exports, function() {
+ function t(t2, n2) {
+ for (var r2 = 0; r2 < n2.length; r2++) {
+ var e2 = n2[r2];
+ e2.enumerable = e2.enumerable || false, e2.configurable = true, "value" in e2 && (e2.writable = true), Object.defineProperty(t2, e2.key, e2);
+ }
+ }
+ function n(n2, r2, e2) {
+ return r2 && t(n2.prototype, r2), e2 && t(n2, e2), n2;
+ }
+ function r() {
+ return (r = Object.assign || function(t2) {
+ for (var n2 = 1; n2 < arguments.length; n2++) {
+ var r2 = arguments[n2];
+ for (var e2 in r2)
+ Object.prototype.hasOwnProperty.call(r2, e2) && (t2[e2] = r2[e2]);
+ }
+ return t2;
+ }).apply(this, arguments);
+ }
+ function e(t2, n2) {
+ t2.prototype = Object.create(n2.prototype), t2.prototype.constructor = t2, t2.__proto__ = n2;
+ }
+ function i(t2) {
+ return (i = Object.setPrototypeOf ? Object.getPrototypeOf : function(t3) {
+ return t3.__proto__ || Object.getPrototypeOf(t3);
+ })(t2);
+ }
+ function o(t2, n2) {
+ return (o = Object.setPrototypeOf || function(t3, n3) {
+ return t3.__proto__ = n3, t3;
+ })(t2, n2);
+ }
+ function u(t2, n2, r2) {
+ return (u = function() {
+ if (typeof Reflect == "undefined" || !Reflect.construct)
+ return false;
+ if (Reflect.construct.sham)
+ return false;
+ if (typeof Proxy == "function")
+ return true;
+ try {
+ return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
+ })), true;
+ } catch (t3) {
+ return false;
+ }
+ }() ? Reflect.construct : function(t3, n3, r3) {
+ var e2 = [null];
+ e2.push.apply(e2, n3);
+ var i2 = new (Function.bind.apply(t3, e2))();
+ return r3 && o(i2, r3.prototype), i2;
+ }).apply(null, arguments);
+ }
+ function f(t2) {
+ var n2 = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
+ return (f = function(t3) {
+ if (t3 === null || Function.toString.call(t3).indexOf("[native code]") === -1)
+ return t3;
+ if (typeof t3 != "function")
+ throw new TypeError("Super expression must either be null or a function");
+ if (n2 !== void 0) {
+ if (n2.has(t3))
+ return n2.get(t3);
+ n2.set(t3, r2);
+ }
+ function r2() {
+ return u(t3, arguments, i(this).constructor);
+ }
+ return r2.prototype = Object.create(t3.prototype, { constructor: { value: r2, enumerable: false, writable: true, configurable: true } }), o(r2, t3);
+ })(t2);
+ }
+ function s(t2, n2) {
+ try {
+ var r2 = t2();
+ } catch (t3) {
+ return n2(t3);
+ }
+ return r2 && r2.then ? r2.then(void 0, n2) : r2;
+ }
+ typeof Symbol != "undefined" && (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))), typeof Symbol != "undefined" && (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")));
+ var c, a = "2.9.7", h = function() {
+ };
+ !function(t2) {
+ t2[t2.off = 0] = "off", t2[t2.error = 1] = "error", t2[t2.warning = 2] = "warning", t2[t2.info = 3] = "info", t2[t2.debug = 4] = "debug";
+ }(c || (c = {}));
+ var v = c.off, l = function() {
+ function t2(t3) {
+ this.t = t3;
+ }
+ t2.getLevel = function() {
+ return v;
+ }, t2.setLevel = function(t3) {
+ return v = c[t3];
+ };
+ var n2 = t2.prototype;
+ return n2.error = function() {
+ for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++)
+ n3[r2] = arguments[r2];
+ this.i(console.error, c.error, n3);
+ }, n2.warn = function() {
+ for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++)
+ n3[r2] = arguments[r2];
+ this.i(console.warn, c.warning, n3);
+ }, n2.info = function() {
+ for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++)
+ n3[r2] = arguments[r2];
+ this.i(console.info, c.info, n3);
+ }, n2.debug = function() {
+ for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++)
+ n3[r2] = arguments[r2];
+ this.i(console.log, c.debug, n3);
+ }, n2.i = function(n3, r2, e2) {
+ r2 <= t2.getLevel() && n3.apply(console, ["[" + this.t + "] "].concat(e2));
+ }, t2;
+ }(), d = O, m = E2, p = g, w = x, b = T, y = "/", P = new RegExp(["(\\\\.)", "(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"), "g");
+ function g(t2, n2) {
+ for (var r2, e2 = [], i2 = 0, o2 = 0, u2 = "", f2 = n2 && n2.delimiter || y, s2 = n2 && n2.whitelist || void 0, c2 = false; (r2 = P.exec(t2)) !== null; ) {
+ var a2 = r2[0], h2 = r2[1], v2 = r2.index;
+ if (u2 += t2.slice(o2, v2), o2 = v2 + a2.length, h2)
+ u2 += h2[1], c2 = true;
+ else {
+ var l2 = "", d2 = r2[2], m2 = r2[3], p2 = r2[4], w2 = r2[5];
+ if (!c2 && u2.length) {
+ var b2 = u2.length - 1, g2 = u2[b2];
+ (!s2 || s2.indexOf(g2) > -1) && (l2 = g2, u2 = u2.slice(0, b2));
+ }
+ u2 && (e2.push(u2), u2 = "", c2 = false);
+ var E3 = m2 || p2, x2 = l2 || f2;
+ e2.push({ name: d2 || i2++, prefix: l2, delimiter: x2, optional: w2 === "?" || w2 === "*", repeat: w2 === "+" || w2 === "*", pattern: E3 ? A2(E3) : "[^" + k(x2 === f2 ? x2 : x2 + f2) + "]+?" });
+ }
+ }
+ return (u2 || o2 < t2.length) && e2.push(u2 + t2.substr(o2)), e2;
+ }
+ function E2(t2, n2) {
+ return function(r2, e2) {
+ var i2 = t2.exec(r2);
+ if (!i2)
+ return false;
+ for (var o2 = i2[0], u2 = i2.index, f2 = {}, s2 = e2 && e2.decode || decodeURIComponent, c2 = 1; c2 < i2.length; c2++)
+ if (i2[c2] !== void 0) {
+ var a2 = n2[c2 - 1];
+ f2[a2.name] = a2.repeat ? i2[c2].split(a2.delimiter).map(function(t3) {
+ return s2(t3, a2);
+ }) : s2(i2[c2], a2);
+ }
+ return { path: o2, index: u2, params: f2 };
+ };
+ }
+ function x(t2, n2) {
+ for (var r2 = new Array(t2.length), e2 = 0; e2 < t2.length; e2++)
+ typeof t2[e2] == "object" && (r2[e2] = new RegExp("^(?:" + t2[e2].pattern + ")$", R(n2)));
+ return function(n3, e3) {
+ for (var i2 = "", o2 = e3 && e3.encode || encodeURIComponent, u2 = !e3 || e3.validate !== false, f2 = 0; f2 < t2.length; f2++) {
+ var s2 = t2[f2];
+ if (typeof s2 != "string") {
+ var c2, a2 = n3 ? n3[s2.name] : void 0;
+ if (Array.isArray(a2)) {
+ if (!s2.repeat)
+ throw new TypeError('Expected "' + s2.name + '" to not repeat, but got array');
+ if (a2.length === 0) {
+ if (s2.optional)
+ continue;
+ throw new TypeError('Expected "' + s2.name + '" to not be empty');
+ }
+ for (var h2 = 0; h2 < a2.length; h2++) {
+ if (c2 = o2(a2[h2], s2), u2 && !r2[f2].test(c2))
+ throw new TypeError('Expected all "' + s2.name + '" to match "' + s2.pattern + '"');
+ i2 += (h2 === 0 ? s2.prefix : s2.delimiter) + c2;
+ }
+ } else if (typeof a2 != "string" && typeof a2 != "number" && typeof a2 != "boolean") {
+ if (!s2.optional)
+ throw new TypeError('Expected "' + s2.name + '" to be ' + (s2.repeat ? "an array" : "a string"));
+ } else {
+ if (c2 = o2(String(a2), s2), u2 && !r2[f2].test(c2))
+ throw new TypeError('Expected "' + s2.name + '" to match "' + s2.pattern + '", but got "' + c2 + '"');
+ i2 += s2.prefix + c2;
+ }
+ } else
+ i2 += s2;
+ }
+ return i2;
+ };
+ }
+ function k(t2) {
+ return t2.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
+ }
+ function A2(t2) {
+ return t2.replace(/([=!:$/()])/g, "\\$1");
+ }
+ function R(t2) {
+ return t2 && t2.sensitive ? "" : "i";
+ }
+ function T(t2, n2, r2) {
+ for (var e2 = (r2 = r2 || {}).strict, i2 = r2.start !== false, o2 = r2.end !== false, u2 = r2.delimiter || y, f2 = [].concat(r2.endsWith || []).map(k).concat("$").join("|"), s2 = i2 ? "^" : "", c2 = 0; c2 < t2.length; c2++) {
+ var a2 = t2[c2];
+ if (typeof a2 == "string")
+ s2 += k(a2);
+ else {
+ var h2 = a2.repeat ? "(?:" + a2.pattern + ")(?:" + k(a2.delimiter) + "(?:" + a2.pattern + "))*" : a2.pattern;
+ n2 && n2.push(a2), s2 += a2.optional ? a2.prefix ? "(?:" + k(a2.prefix) + "(" + h2 + "))?" : "(" + h2 + ")?" : k(a2.prefix) + "(" + h2 + ")";
+ }
+ }
+ if (o2)
+ e2 || (s2 += "(?:" + k(u2) + ")?"), s2 += f2 === "$" ? "$" : "(?=" + f2 + ")";
+ else {
+ var v2 = t2[t2.length - 1], l2 = typeof v2 == "string" ? v2[v2.length - 1] === u2 : v2 === void 0;
+ e2 || (s2 += "(?:" + k(u2) + "(?=" + f2 + "))?"), l2 || (s2 += "(?=" + k(u2) + "|" + f2 + ")");
+ }
+ return new RegExp(s2, R(r2));
+ }
+ function O(t2, n2, r2) {
+ return t2 instanceof RegExp ? function(t3, n3) {
+ if (!n3)
+ return t3;
+ var r3 = t3.source.match(/\((?!\?)/g);
+ if (r3)
+ for (var e2 = 0; e2 < r3.length; e2++)
+ n3.push({ name: e2, prefix: null, delimiter: null, optional: false, repeat: false, pattern: null });
+ return t3;
+ }(t2, n2) : Array.isArray(t2) ? function(t3, n3, r3) {
+ for (var e2 = [], i2 = 0; i2 < t3.length; i2++)
+ e2.push(O(t3[i2], n3, r3).source);
+ return new RegExp("(?:" + e2.join("|") + ")", R(r3));
+ }(t2, n2, r2) : function(t3, n3, r3) {
+ return T(g(t3, r3), n3, r3);
+ }(t2, n2, r2);
+ }
+ d.match = function(t2, n2) {
+ var r2 = [];
+ return E2(O(t2, r2, n2), r2);
+ }, d.regexpToFunction = m, d.parse = p, d.compile = function(t2, n2) {
+ return x(g(t2, n2), n2);
+ }, 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 t2() {
+ this.o = S, this.u = new DOMParser();
+ }
+ var n2 = t2.prototype;
+ return n2.toString = function(t3) {
+ return t3.outerHTML;
+ }, n2.toDocument = function(t3) {
+ return this.u.parseFromString(t3, "text/html");
+ }, n2.toElement = function(t3) {
+ var n3 = document.createElement("div");
+ return n3.innerHTML = t3, n3;
+ }, n2.getHtml = function(t3) {
+ return t3 === void 0 && (t3 = document), this.toString(t3.documentElement);
+ }, n2.getWrapper = function(t3) {
+ return t3 === void 0 && (t3 = document), t3.querySelector("[" + this.o.prefix + '="' + this.o.wrapper + '"]');
+ }, n2.getContainer = function(t3) {
+ return t3 === void 0 && (t3 = document), t3.querySelector("[" + this.o.prefix + '="' + this.o.container + '"]');
+ }, n2.removeContainer = function(t3) {
+ document.body.contains(t3) && t3.parentNode.removeChild(t3);
+ }, n2.addContainer = function(t3, n3) {
+ var r2 = this.getContainer();
+ r2 ? this.s(t3, r2) : n3.appendChild(t3);
+ }, n2.getNamespace = function(t3) {
+ t3 === void 0 && (t3 = document);
+ var n3 = t3.querySelector("[" + this.o.prefix + "-" + this.o.namespace + "]");
+ return n3 ? n3.getAttribute(this.o.prefix + "-" + this.o.namespace) : null;
+ }, n2.getHref = function(t3) {
+ if (t3.tagName && t3.tagName.toLowerCase() === "a") {
+ if (typeof t3.href == "string")
+ return t3.href;
+ var n3 = t3.getAttribute("href") || t3.getAttribute("xlink:href");
+ if (n3)
+ return this.resolveUrl(n3.baseVal || n3);
+ }
+ return null;
+ }, n2.resolveUrl = function() {
+ for (var t3 = arguments.length, n3 = new Array(t3), r2 = 0; r2 < t3; r2++)
+ n3[r2] = arguments[r2];
+ var e2 = n3.length;
+ if (e2 === 0)
+ throw new Error("resolveUrl requires at least one argument; got none.");
+ var i2 = document.createElement("base");
+ if (i2.href = arguments[0], e2 === 1)
+ return i2.href;
+ var o2 = document.getElementsByTagName("head")[0];
+ o2.insertBefore(i2, o2.firstChild);
+ for (var u2, f2 = document.createElement("a"), s2 = 1; s2 < e2; s2++)
+ f2.href = arguments[s2], i2.href = u2 = f2.href;
+ return o2.removeChild(i2), u2;
+ }, n2.s = function(t3, n3) {
+ n3.parentNode.insertBefore(t3, n3.nextSibling);
+ }, t2;
+ }())(), M = new (function() {
+ function t2() {
+ this.h = [], this.v = -1;
+ }
+ var e2 = t2.prototype;
+ return e2.init = function(t3, n2) {
+ this.l = "barba";
+ var r2 = { ns: n2, scroll: { x: window.scrollX, y: window.scrollY }, url: t3 };
+ this.h.push(r2), this.v = 0;
+ var e3 = { from: this.l, index: 0, states: [].concat(this.h) };
+ window.history && window.history.replaceState(e3, "", t3);
+ }, e2.change = function(t3, n2, r2) {
+ if (r2 && r2.state) {
+ var e3 = r2.state, i2 = e3.index;
+ n2 = this.m(this.v - i2), this.replace(e3.states), this.v = i2;
+ } else
+ this.add(t3, n2);
+ return n2;
+ }, e2.add = function(t3, n2) {
+ var r2 = this.size, e3 = this.p(n2), i2 = { ns: "tmp", scroll: { x: window.scrollX, y: window.scrollY }, url: t3 };
+ this.h.push(i2), this.v = r2;
+ var o2 = { from: this.l, index: r2, states: [].concat(this.h) };
+ switch (e3) {
+ case "push":
+ window.history && window.history.pushState(o2, "", t3);
+ break;
+ case "replace":
+ window.history && window.history.replaceState(o2, "", t3);
+ }
+ }, e2.update = function(t3, n2) {
+ var e3 = n2 || this.v, i2 = r({}, this.get(e3), {}, t3);
+ this.set(e3, i2);
+ }, e2.remove = function(t3) {
+ t3 ? this.h.splice(t3, 1) : this.h.pop(), this.v--;
+ }, e2.clear = function() {
+ this.h = [], this.v = -1;
+ }, e2.replace = function(t3) {
+ this.h = t3;
+ }, e2.get = function(t3) {
+ return this.h[t3];
+ }, e2.set = function(t3, n2) {
+ return this.h[t3] = n2;
+ }, e2.p = function(t3) {
+ var n2 = "push", r2 = t3, e3 = S.prefix + "-" + S.history;
+ return r2.hasAttribute && r2.hasAttribute(e3) && (n2 = r2.getAttribute(e3)), n2;
+ }, e2.m = function(t3) {
+ return Math.abs(t3) > 1 ? t3 > 0 ? "forward" : "back" : t3 === 0 ? "popstate" : t3 > 0 ? "back" : "forward";
+ }, n(t2, [{ 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;
+ } }]), t2;
+ }())(), L = function(t2, n2) {
+ try {
+ var r2 = function() {
+ if (!n2.next.html)
+ return Promise.resolve(t2).then(function(t3) {
+ var r3 = n2.next;
+ if (t3) {
+ var e2 = j.toElement(t3);
+ r3.namespace = j.getNamespace(e2), r3.container = j.getContainer(e2), r3.html = t3, M.update({ ns: r3.namespace });
+ var i2 = j.toDocument(t3);
+ document.title = i2.title;
+ }
+ });
+ }();
+ return Promise.resolve(r2 && r2.then ? r2.then(function() {
+ }) : void 0);
+ } catch (t3) {
+ return Promise.reject(t3);
+ }
+ }, $ = d, _ = { __proto__: null, update: L, nextTick: function() {
+ return new Promise(function(t2) {
+ window.requestAnimationFrame(t2);
+ });
+ }, pathToRegexp: $ }, q = function() {
+ return window.location.origin;
+ }, B2 = function(t2) {
+ return t2 === void 0 && (t2 = window.location.href), U(t2).port;
+ }, U = function(t2) {
+ var n2, r2 = t2.match(/:\d+/);
+ if (r2 === null)
+ /^http/.test(t2) && (n2 = 80), /^https/.test(t2) && (n2 = 443);
+ else {
+ var e2 = r2[0].substring(1);
+ n2 = parseInt(e2, 10);
+ }
+ var i2, o2 = t2.replace(q(), ""), u2 = {}, f2 = o2.indexOf("#");
+ f2 >= 0 && (i2 = o2.slice(f2 + 1), o2 = o2.slice(0, f2));
+ var s2 = o2.indexOf("?");
+ return s2 >= 0 && (u2 = D(o2.slice(s2 + 1)), o2 = o2.slice(0, s2)), { hash: i2, path: o2, port: n2, query: u2 };
+ }, D = function(t2) {
+ return t2.split("&").reduce(function(t3, n2) {
+ var r2 = n2.split("=");
+ return t3[r2[0]] = r2[1], t3;
+ }, {});
+ }, F = function(t2) {
+ return t2 === void 0 && (t2 = window.location.href), t2.replace(/(\/#.*|\/|#.*)$/, "");
+ }, H = { __proto__: null, getHref: function() {
+ return window.location.href;
+ }, getOrigin: q, getPort: B2, getPath: function(t2) {
+ return t2 === void 0 && (t2 = window.location.href), U(t2).path;
+ }, parse: U, parseQuery: D, clean: F };
+ function I(t2, n2, r2) {
+ return n2 === void 0 && (n2 = 2e3), new Promise(function(e2, i2) {
+ var o2 = new XMLHttpRequest();
+ o2.onreadystatechange = function() {
+ if (o2.readyState === XMLHttpRequest.DONE) {
+ if (o2.status === 200)
+ e2(o2.responseText);
+ else if (o2.status) {
+ var n3 = { status: o2.status, statusText: o2.statusText };
+ r2(t2, n3), i2(n3);
+ }
+ }
+ }, o2.ontimeout = function() {
+ var e3 = new Error("Timeout error [" + n2 + "]");
+ r2(t2, e3), i2(e3);
+ }, o2.onerror = function() {
+ var n3 = new Error("Fetch error");
+ r2(t2, n3), i2(n3);
+ }, o2.open("GET", t2), o2.timeout = n2, o2.setRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml"), o2.setRequestHeader("x-barba", "yes"), o2.send();
+ });
+ }
+ var C2 = function(t2) {
+ return !!t2 && (typeof t2 == "object" || typeof t2 == "function") && typeof t2.then == "function";
+ };
+ function N(t2, n2) {
+ return n2 === void 0 && (n2 = {}), function() {
+ for (var r2 = arguments.length, e2 = new Array(r2), i2 = 0; i2 < r2; i2++)
+ e2[i2] = arguments[i2];
+ var o2 = false, u2 = new Promise(function(r3, i3) {
+ n2.async = function() {
+ return o2 = true, function(t3, n3) {
+ t3 ? i3(t3) : r3(n3);
+ };
+ };
+ var u3 = t2.apply(n2, e2);
+ o2 || (C2(u3) ? u3.then(r3, i3) : r3(u3));
+ });
+ return u2;
+ };
+ }
+ var X = new (function(t2) {
+ function n2() {
+ var n3;
+ return (n3 = t2.call(this) || this).logger = new l("@barba/core"), n3.all = ["ready", "page", "reset", "currentAdded", "currentRemoved", "nextAdded", "nextRemoved", "beforeOnce", "once", "afterOnce", "before", "beforeLeave", "leave", "afterLeave", "beforeEnter", "enter", "afterEnter", "after"], n3.registered = /* @__PURE__ */ new Map(), n3.init(), n3;
+ }
+ e(n2, t2);
+ var r2 = n2.prototype;
+ return r2.init = function() {
+ var t3 = this;
+ this.registered.clear(), this.all.forEach(function(n3) {
+ t3[n3] || (t3[n3] = function(r3, e2) {
+ t3.registered.has(n3) || t3.registered.set(n3, /* @__PURE__ */ new Set()), t3.registered.get(n3).add({ ctx: e2 || {}, fn: r3 });
+ });
+ });
+ }, r2.do = function(t3) {
+ for (var n3 = this, r3 = arguments.length, e2 = new Array(r3 > 1 ? r3 - 1 : 0), i2 = 1; i2 < r3; i2++)
+ e2[i2 - 1] = arguments[i2];
+ if (this.registered.has(t3)) {
+ var o2 = Promise.resolve();
+ return this.registered.get(t3).forEach(function(t4) {
+ o2 = o2.then(function() {
+ return N(t4.fn, t4.ctx).apply(void 0, e2);
+ });
+ }), o2.catch(function(r4) {
+ n3.logger.debug("Hook error [" + t3 + "]"), n3.logger.error(r4);
+ });
+ }
+ return Promise.resolve();
+ }, r2.clear = function() {
+ var t3 = this;
+ this.all.forEach(function(n3) {
+ delete t3[n3];
+ }), this.init();
+ }, r2.help = function() {
+ this.logger.info("Available hooks: " + this.all.join(","));
+ var t3 = [];
+ this.registered.forEach(function(n3, r3) {
+ return t3.push(r3);
+ }), this.logger.info("Registered hooks: " + t3.join(","));
+ }, n2;
+ }(h))(), z = function() {
+ function t2(t3) {
+ if (this.P = [], typeof t3 == "boolean")
+ this.g = t3;
+ else {
+ var n2 = Array.isArray(t3) ? t3 : [t3];
+ this.P = n2.map(function(t4) {
+ return $(t4);
+ });
+ }
+ }
+ return t2.prototype.checkHref = function(t3) {
+ if (typeof this.g == "boolean")
+ return this.g;
+ var n2 = U(t3).path;
+ return this.P.some(function(t4) {
+ return t4.exec(n2) !== null;
+ });
+ }, t2;
+ }(), G = function(t2) {
+ function n2(n3) {
+ var r2;
+ return (r2 = t2.call(this, n3) || this).k = /* @__PURE__ */ new Map(), r2;
+ }
+ e(n2, t2);
+ var i2 = n2.prototype;
+ return i2.set = function(t3, n3, r2) {
+ return this.k.set(t3, { action: r2, request: n3 }), { action: r2, request: n3 };
+ }, i2.get = function(t3) {
+ return this.k.get(t3);
+ }, i2.getRequest = function(t3) {
+ return this.k.get(t3).request;
+ }, i2.getAction = function(t3) {
+ return this.k.get(t3).action;
+ }, i2.has = function(t3) {
+ return !this.checkHref(t3) && this.k.has(t3);
+ }, i2.delete = function(t3) {
+ return this.k.delete(t3);
+ }, i2.update = function(t3, n3) {
+ var e2 = r({}, this.k.get(t3), {}, n3);
+ return this.k.set(t3, e2), e2;
+ }, n2;
+ }(z), Q = function() {
+ return !window.history.pushState;
+ }, W = function(t2) {
+ return !t2.el || !t2.href;
+ }, J = function(t2) {
+ var n2 = t2.event;
+ return n2.which > 1 || n2.metaKey || n2.ctrlKey || n2.shiftKey || n2.altKey;
+ }, K = function(t2) {
+ var n2 = t2.el;
+ return n2.hasAttribute("target") && n2.target === "_blank";
+ }, V = function(t2) {
+ var n2 = t2.el;
+ return n2.protocol !== void 0 && window.location.protocol !== n2.protocol || n2.hostname !== void 0 && window.location.hostname !== n2.hostname;
+ }, Y = function(t2) {
+ var n2 = t2.el;
+ return n2.port !== void 0 && B2() !== B2(n2.href);
+ }, Z = function(t2) {
+ var n2 = t2.el;
+ return n2.getAttribute && typeof n2.getAttribute("download") == "string";
+ }, tt = function(t2) {
+ return t2.el.hasAttribute(S.prefix + "-" + S.prevent);
+ }, nt = function(t2) {
+ return Boolean(t2.el.closest("[" + S.prefix + "-" + S.prevent + '="all"]'));
+ }, rt = function(t2) {
+ var n2 = t2.href;
+ return F(n2) === F() && B2(n2) === B2();
+ }, et = function(t2) {
+ function n2(n3) {
+ var r3;
+ return (r3 = t2.call(this, n3) || this).suite = [], r3.tests = /* @__PURE__ */ new Map(), r3.init(), r3;
+ }
+ e(n2, t2);
+ var r2 = n2.prototype;
+ return r2.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, false);
+ }, r2.add = function(t3, n3, r3) {
+ r3 === void 0 && (r3 = true), this.tests.set(t3, n3), r3 && this.suite.push(t3);
+ }, r2.run = function(t3, n3, r3, e2) {
+ return this.tests.get(t3)({ el: n3, event: r3, href: e2 });
+ }, r2.checkLink = function(t3, n3, r3) {
+ var e2 = this;
+ return this.suite.some(function(i2) {
+ return e2.run(i2, t3, n3, r3);
+ });
+ }, n2;
+ }(z), it = function(t2) {
+ function n2(r2, e2) {
+ var i2;
+ e2 === void 0 && (e2 = "Barba error");
+ for (var o2 = arguments.length, u2 = new Array(o2 > 2 ? o2 - 2 : 0), f2 = 2; f2 < o2; f2++)
+ u2[f2 - 2] = arguments[f2];
+ return (i2 = t2.call.apply(t2, [this].concat(u2)) || this).error = r2, i2.label = e2, Error.captureStackTrace && Error.captureStackTrace(function(t3) {
+ if (t3 === void 0)
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ return t3;
+ }(i2), n2), i2.name = "BarbaError", i2;
+ }
+ return e(n2, t2), n2;
+ }(f(Error)), ot = function() {
+ function t2(t3) {
+ t3 === void 0 && (t3 = []), this.logger = new l("@barba/core"), this.all = [], this.page = [], this.once = [], this.A = [{ name: "namespace", type: "strings" }, { name: "custom", type: "function" }], t3 && (this.all = this.all.concat(t3)), this.update();
+ }
+ var n2 = t2.prototype;
+ return n2.add = function(t3, n3) {
+ switch (t3) {
+ case "rule":
+ this.A.splice(n3.position || 0, 0, n3.value);
+ break;
+ case "transition":
+ default:
+ this.all.push(n3);
+ }
+ this.update();
+ }, n2.resolve = function(t3, n3) {
+ var r2 = this;
+ n3 === void 0 && (n3 = {});
+ var e2 = n3.once ? this.once : this.page;
+ e2 = e2.filter(n3.self ? function(t4) {
+ return t4.name && t4.name === "self";
+ } : function(t4) {
+ return !t4.name || t4.name !== "self";
+ });
+ var i2 = /* @__PURE__ */ new Map(), o2 = e2.find(function(e3) {
+ var o3 = true, u3 = {};
+ return !(!n3.self || e3.name !== "self") || (r2.A.reverse().forEach(function(n4) {
+ o3 && (o3 = r2.R(e3, n4, t3, u3), e3.from && e3.to && (o3 = r2.R(e3, n4, t3, u3, "from") && r2.R(e3, n4, t3, u3, "to")), e3.from && !e3.to && (o3 = r2.R(e3, n4, t3, u3, "from")), !e3.from && e3.to && (o3 = r2.R(e3, n4, t3, u3, "to")));
+ }), i2.set(e3, u3), o3);
+ }), u2 = i2.get(o2), f2 = [];
+ if (f2.push(n3.once ? "once" : "page"), n3.self && f2.push("self"), u2) {
+ var s2, c2 = [o2];
+ Object.keys(u2).length > 0 && c2.push(u2), (s2 = this.logger).info.apply(s2, ["Transition found [" + f2.join(",") + "]"].concat(c2));
+ } else
+ this.logger.info("No transition found [" + f2.join(",") + "]");
+ return o2;
+ }, n2.update = function() {
+ var t3 = this;
+ this.all = this.all.map(function(n3) {
+ return t3.T(n3);
+ }).sort(function(t4, n3) {
+ return t4.priority - n3.priority;
+ }).reverse().map(function(t4) {
+ return delete t4.priority, t4;
+ }), this.page = this.all.filter(function(t4) {
+ return t4.leave !== void 0 || t4.enter !== void 0;
+ }), this.once = this.all.filter(function(t4) {
+ return t4.once !== void 0;
+ });
+ }, n2.R = function(t3, n3, r2, e2, i2) {
+ var o2 = true, u2 = false, f2 = t3, s2 = n3.name, c2 = s2, a2 = s2, h2 = s2, v2 = i2 ? f2[i2] : f2, l2 = i2 === "to" ? r2.next : r2.current;
+ if (i2 ? v2 && v2[s2] : v2[s2]) {
+ switch (n3.type) {
+ case "strings":
+ default:
+ var d2 = Array.isArray(v2[c2]) ? v2[c2] : [v2[c2]];
+ l2[c2] && d2.indexOf(l2[c2]) !== -1 && (u2 = true), d2.indexOf(l2[c2]) === -1 && (o2 = false);
+ break;
+ case "object":
+ var m2 = Array.isArray(v2[a2]) ? v2[a2] : [v2[a2]];
+ l2[a2] ? (l2[a2].name && m2.indexOf(l2[a2].name) !== -1 && (u2 = true), m2.indexOf(l2[a2].name) === -1 && (o2 = false)) : o2 = false;
+ break;
+ case "function":
+ v2[h2](r2) ? u2 = true : o2 = false;
+ }
+ u2 && (i2 ? (e2[i2] = e2[i2] || {}, e2[i2][s2] = f2[i2][s2]) : e2[s2] = f2[s2]);
+ }
+ return o2;
+ }, n2.O = function(t3, n3, r2) {
+ var e2 = 0;
+ return (t3[n3] || t3.from && t3.from[n3] || t3.to && t3.to[n3]) && (e2 += Math.pow(10, r2), t3.from && t3.from[n3] && (e2 += 1), t3.to && t3.to[n3] && (e2 += 2)), e2;
+ }, n2.T = function(t3) {
+ var n3 = this;
+ t3.priority = 0;
+ var r2 = 0;
+ return this.A.forEach(function(e2, i2) {
+ r2 += n3.O(t3, e2.name, i2 + 1);
+ }), t3.priority = r2, t3;
+ }, t2;
+ }(), ut = function() {
+ function t2(t3) {
+ t3 === void 0 && (t3 = []), this.logger = new l("@barba/core"), this.S = false, this.store = new ot(t3);
+ }
+ var r2 = t2.prototype;
+ return r2.get = function(t3, n2) {
+ return this.store.resolve(t3, n2);
+ }, r2.doOnce = function(t3) {
+ var n2 = t3.data, r3 = t3.transition;
+ try {
+ var e2 = function() {
+ i2.S = false;
+ }, i2 = this, o2 = r3 || {};
+ i2.S = true;
+ var u2 = s(function() {
+ return Promise.resolve(i2.j("beforeOnce", n2, o2)).then(function() {
+ return Promise.resolve(i2.once(n2, o2)).then(function() {
+ return Promise.resolve(i2.j("afterOnce", n2, o2)).then(function() {
+ });
+ });
+ });
+ }, function(t4) {
+ i2.S = false, i2.logger.debug("Transition error [before/after/once]"), i2.logger.error(t4);
+ });
+ return Promise.resolve(u2 && u2.then ? u2.then(e2) : e2());
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.doPage = function(t3) {
+ var n2 = t3.data, r3 = t3.transition, e2 = t3.page, i2 = t3.wrapper;
+ try {
+ var o2 = function(t4) {
+ if (u2)
+ return t4;
+ f2.S = false;
+ }, u2 = false, f2 = this, c2 = r3 || {}, a2 = c2.sync === true || false;
+ f2.S = true;
+ var h2 = s(function() {
+ function t4() {
+ return Promise.resolve(f2.j("before", n2, c2)).then(function() {
+ var t5 = false;
+ function r5(r6) {
+ return t5 ? r6 : Promise.resolve(f2.remove(n2)).then(function() {
+ return Promise.resolve(f2.j("after", n2, c2)).then(function() {
+ });
+ });
+ }
+ var o3 = function() {
+ if (a2)
+ return s(function() {
+ return Promise.resolve(f2.add(n2, i2)).then(function() {
+ return Promise.resolve(f2.j("beforeLeave", n2, c2)).then(function() {
+ return Promise.resolve(f2.j("beforeEnter", n2, c2)).then(function() {
+ return Promise.resolve(Promise.all([f2.leave(n2, c2), f2.enter(n2, c2)])).then(function() {
+ return Promise.resolve(f2.j("afterLeave", n2, c2)).then(function() {
+ return Promise.resolve(f2.j("afterEnter", n2, c2)).then(function() {
+ });
+ });
+ });
+ });
+ });
+ });
+ }, function(t6) {
+ if (f2.M(t6))
+ throw new it(t6, "Transition error [sync]");
+ });
+ var r6 = function(r7) {
+ return t5 ? r7 : s(function() {
+ var t6 = function() {
+ if (o4 !== false)
+ return Promise.resolve(f2.add(n2, i2)).then(function() {
+ return Promise.resolve(f2.j("beforeEnter", n2, c2)).then(function() {
+ return Promise.resolve(f2.enter(n2, c2, o4)).then(function() {
+ return Promise.resolve(f2.j("afterEnter", n2, c2)).then(function() {
+ });
+ });
+ });
+ });
+ }();
+ if (t6 && t6.then)
+ return t6.then(function() {
+ });
+ }, function(t6) {
+ if (f2.M(t6))
+ throw new it(t6, "Transition error [before/after/enter]");
+ });
+ }, o4 = false, u3 = s(function() {
+ return Promise.resolve(f2.j("beforeLeave", n2, c2)).then(function() {
+ return Promise.resolve(Promise.all([f2.leave(n2, c2), L(e2, n2)]).then(function(t6) {
+ return t6[0];
+ })).then(function(t6) {
+ return o4 = t6, Promise.resolve(f2.j("afterLeave", n2, c2)).then(function() {
+ });
+ });
+ });
+ }, function(t6) {
+ if (f2.M(t6))
+ throw new it(t6, "Transition error [before/after/leave]");
+ });
+ return u3 && u3.then ? u3.then(r6) : r6(u3);
+ }();
+ return o3 && o3.then ? o3.then(r5) : r5(o3);
+ });
+ }
+ var r4 = function() {
+ if (a2)
+ return Promise.resolve(L(e2, n2)).then(function() {
+ });
+ }();
+ return r4 && r4.then ? r4.then(t4) : t4();
+ }, function(t4) {
+ if (f2.S = false, t4.name && t4.name === "BarbaError")
+ throw f2.logger.debug(t4.label), f2.logger.error(t4.error), t4;
+ throw f2.logger.debug("Transition error [page]"), f2.logger.error(t4), t4;
+ });
+ return Promise.resolve(h2 && h2.then ? h2.then(o2) : o2(h2));
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.once = function(t3, n2) {
+ try {
+ return Promise.resolve(X.do("once", t3, n2)).then(function() {
+ return n2.once ? N(n2.once, n2)(t3) : Promise.resolve();
+ });
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.leave = function(t3, n2) {
+ try {
+ return Promise.resolve(X.do("leave", t3, n2)).then(function() {
+ return n2.leave ? N(n2.leave, n2)(t3) : Promise.resolve();
+ });
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.enter = function(t3, n2, r3) {
+ try {
+ return Promise.resolve(X.do("enter", t3, n2)).then(function() {
+ return n2.enter ? N(n2.enter, n2)(t3, r3) : Promise.resolve();
+ });
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.add = function(t3, n2) {
+ try {
+ return j.addContainer(t3.next.container, n2), X.do("nextAdded", t3), Promise.resolve();
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.remove = function(t3) {
+ try {
+ return j.removeContainer(t3.current.container), X.do("currentRemoved", t3), Promise.resolve();
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, r2.M = function(t3) {
+ return t3.message ? !/Timeout error|Fetch error/.test(t3.message) : !t3.status;
+ }, r2.j = function(t3, n2, r3) {
+ try {
+ return Promise.resolve(X.do(t3, n2, r3)).then(function() {
+ return r3[t3] ? N(r3[t3], r3)(n2) : Promise.resolve();
+ });
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, n(t2, [{ key: "isRunning", get: function() {
+ return this.S;
+ }, set: function(t3) {
+ this.S = t3;
+ } }, { key: "hasOnce", get: function() {
+ return this.store.once.length > 0;
+ } }, { key: "hasSelf", get: function() {
+ return this.store.all.some(function(t3) {
+ return t3.name === "self";
+ });
+ } }, { key: "shouldWait", get: function() {
+ return this.store.all.some(function(t3) {
+ return t3.to && !t3.to.route || t3.sync;
+ });
+ } }]), t2;
+ }(), ft = function() {
+ function t2(t3) {
+ var n2 = this;
+ this.names = ["beforeLeave", "afterLeave", "beforeEnter", "afterEnter"], this.byNamespace = /* @__PURE__ */ new Map(), t3.length !== 0 && (t3.forEach(function(t4) {
+ n2.byNamespace.set(t4.namespace, t4);
+ }), this.names.forEach(function(t4) {
+ X[t4](n2.L(t4));
+ }));
+ }
+ return t2.prototype.L = function(t3) {
+ var n2 = this;
+ return function(r2) {
+ var e2 = t3.match(/enter/i) ? r2.next : r2.current, i2 = n2.byNamespace.get(e2.namespace);
+ return i2 && i2[t3] ? N(i2[t3], i2)(r2) : Promise.resolve();
+ };
+ }, t2;
+ }();
+ Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector), Element.prototype.closest || (Element.prototype.closest = function(t2) {
+ var n2 = this;
+ do {
+ if (n2.matches(t2))
+ return n2;
+ n2 = n2.parentElement || n2.parentNode;
+ } while (n2 !== null && n2.nodeType === 1);
+ return null;
+ });
+ var st = { container: null, html: "", namespace: "", url: { hash: "", href: "", path: "", port: null, query: {} } };
+ return new (function() {
+ function t2() {
+ 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 e2 = t2.prototype;
+ return e2.use = function(t3, n2) {
+ var r2 = this.plugins;
+ r2.indexOf(t3) > -1 ? this.logger.warn("Plugin [" + t3.name + "] already installed.") : typeof t3.install == "function" ? (t3.install(this, n2), r2.push(t3)) : this.logger.warn("Plugin [" + t3.name + '] has no "install" method.');
+ }, e2.init = function(t3) {
+ var n2 = t3 === void 0 ? {} : t3, e3 = n2.transitions, i2 = e3 === void 0 ? [] : e3, o2 = n2.views, u2 = o2 === void 0 ? [] : o2, f2 = n2.schema, s2 = f2 === void 0 ? S : f2, c2 = n2.requestError, a2 = n2.timeout, h2 = a2 === void 0 ? 2e3 : a2, v2 = n2.cacheIgnore, d2 = v2 !== void 0 && v2, m2 = n2.prefetchIgnore, p2 = m2 !== void 0 && m2, w2 = n2.preventRunning, b2 = w2 !== void 0 && w2, y2 = n2.prevent, P2 = y2 === void 0 ? null : y2, g2 = n2.debug, E3 = n2.logLevel;
+ if (l.setLevel((g2 !== void 0 && g2) === true ? "debug" : E3 === void 0 ? "off" : E3), this.logger.info(this.version), Object.keys(s2).forEach(function(t4) {
+ S[t4] && (S[t4] = s2[t4]);
+ }), this.$ = c2, this.timeout = h2, this.cacheIgnore = d2, this.prefetchIgnore = p2, this.preventRunning = b2, this._ = this.dom.getWrapper(), !this._)
+ throw new Error("[@barba/core] No Barba wrapper found");
+ this._.setAttribute("aria-live", "polite"), this.q();
+ var x2 = this.data.current;
+ if (!x2.container)
+ throw new Error("[@barba/core] No Barba container found");
+ if (this.cache = new G(d2), this.prevent = new et(p2), this.transitions = new ut(i2), this.views = new ft(u2), P2 !== null) {
+ if (typeof P2 != "function")
+ throw new Error("[@barba/core] Prevent should be a function");
+ this.prevent.add("preventCustom", P2);
+ }
+ this.history.init(x2.url.href, x2.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(t4) {
+ return t4.init();
+ });
+ var k2 = this.data;
+ k2.trigger = "barba", k2.next = k2.current, k2.current = r({}, this.schemaPage), this.hooks.do("ready", k2), this.once(k2), this.q();
+ }, e2.destroy = function() {
+ this.q(), this.H(), this.history.clear(), this.hooks.clear(), this.plugins = [];
+ }, e2.force = function(t3) {
+ window.location.assign(t3);
+ }, e2.go = function(t3, n2, r2) {
+ var e3;
+ if (n2 === void 0 && (n2 = "barba"), this.transitions.isRunning)
+ this.force(t3);
+ else if (!(e3 = n2 === "popstate" ? this.history.current && this.url.getPath(this.history.current.url) === this.url.getPath(t3) : this.prevent.run("sameUrl", null, null, t3)) || this.transitions.hasSelf)
+ return n2 = this.history.change(t3, n2, r2), r2 && (r2.stopPropagation(), r2.preventDefault()), this.page(t3, n2, e3);
+ }, e2.once = function(t3) {
+ try {
+ var n2 = this;
+ return Promise.resolve(n2.hooks.do("beforeEnter", t3)).then(function() {
+ function r2() {
+ return Promise.resolve(n2.hooks.do("afterEnter", t3)).then(function() {
+ });
+ }
+ var e3 = function() {
+ if (n2.transitions.hasOnce) {
+ var r3 = n2.transitions.get(t3, { once: true });
+ return Promise.resolve(n2.transitions.doOnce({ transition: r3, data: t3 })).then(function() {
+ });
+ }
+ }();
+ return e3 && e3.then ? e3.then(r2) : r2();
+ });
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, e2.page = function(t3, n2, e3) {
+ try {
+ var i2 = function() {
+ var t4 = o2.data;
+ return Promise.resolve(o2.hooks.do("page", t4)).then(function() {
+ var n3 = s(function() {
+ var n4 = o2.transitions.get(t4, { once: false, self: e3 });
+ return Promise.resolve(o2.transitions.doPage({ data: t4, page: u2, transition: n4, wrapper: o2._ })).then(function() {
+ o2.q();
+ });
+ }, function() {
+ l.getLevel() === 0 && o2.force(t4.current.url.href);
+ });
+ if (n3 && n3.then)
+ return n3.then(function() {
+ });
+ });
+ }, o2 = this;
+ o2.data.next.url = r({ href: t3 }, o2.url.parse(t3)), o2.data.trigger = n2;
+ var u2 = o2.cache.has(t3) ? o2.cache.update(t3, { action: "click" }).request : o2.cache.set(t3, o2.request(t3, o2.timeout, o2.onRequestError.bind(o2, n2)), "click").request, f2 = function() {
+ if (o2.transitions.shouldWait)
+ return Promise.resolve(L(u2, o2.data)).then(function() {
+ });
+ }();
+ return Promise.resolve(f2 && f2.then ? f2.then(i2) : i2());
+ } catch (t4) {
+ return Promise.reject(t4);
+ }
+ }, e2.onRequestError = function(t3) {
+ this.transitions.isRunning = false;
+ for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), e3 = 1; e3 < n2; e3++)
+ r2[e3 - 1] = arguments[e3];
+ var i2 = r2[0], o2 = r2[1], u2 = this.cache.getAction(i2);
+ return this.cache.delete(i2), !(this.$ && this.$(t3, u2, i2, o2) === false || (u2 === "click" && this.force(i2), 1));
+ }, e2.prefetch = function(t3) {
+ var n2 = this;
+ this.cache.has(t3) || this.cache.set(t3, this.request(t3, this.timeout, this.onRequestError.bind(this, "barba")).catch(function(t4) {
+ n2.logger.error(t4);
+ }), "prefetch");
+ }, e2.F = function() {
+ this.prefetchIgnore !== true && (document.addEventListener("mouseover", this.B), document.addEventListener("touchstart", this.B)), document.addEventListener("click", this.U), window.addEventListener("popstate", this.D);
+ }, e2.H = function() {
+ this.prefetchIgnore !== true && (document.removeEventListener("mouseover", this.B), document.removeEventListener("touchstart", this.B)), document.removeEventListener("click", this.U), window.removeEventListener("popstate", this.D);
+ }, e2.B = function(t3) {
+ var n2 = this, r2 = this.I(t3);
+ if (r2) {
+ var e3 = this.dom.getHref(r2);
+ this.prevent.checkHref(e3) || this.cache.has(e3) || this.cache.set(e3, this.request(e3, this.timeout, this.onRequestError.bind(this, r2)).catch(function(t4) {
+ n2.logger.error(t4);
+ }), "enter");
+ }
+ }, e2.U = function(t3) {
+ var n2 = this.I(t3);
+ if (n2)
+ return this.transitions.isRunning && this.preventRunning ? (t3.preventDefault(), void t3.stopPropagation()) : void this.go(this.dom.getHref(n2), n2, t3);
+ }, e2.D = function(t3) {
+ this.go(this.url.getHref(), "popstate", t3);
+ }, e2.I = function(t3) {
+ for (var n2 = t3.target; n2 && !this.dom.getHref(n2); )
+ n2 = n2.parentNode;
+ if (n2 && !this.prevent.checkLink(n2, t3, this.dom.getHref(n2)))
+ return n2;
+ }, e2.q = function() {
+ var t3 = this.url.getHref(), n2 = { container: this.dom.getContainer(), html: this.dom.getHtml(), namespace: this.dom.getNamespace(), url: r({ href: t3 }, this.url.parse(t3)) };
+ this.C = { current: n2, next: r({}, this.schemaPage), trigger: void 0 }, this.hooks.do("reset", this.data);
+ }, n(t2, [{ key: "data", get: function() {
+ return this.C;
+ } }, { key: "wrapper", get: function() {
+ return this._;
+ } }]), t2;
+ }())();
+ });
+ }
+ });
+
// node_modules/svg4everybody/dist/svg4everybody.js
var require_svg4everybody = __commonJS({
"node_modules/svg4everybody/dist/svg4everybody.js"(exports, module) {
@@ -250,13 +1248,13 @@
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var _default = /* @__PURE__ */ function() {
- function _default4(options) {
- _classCallCheck(this, _default4);
+ function _default3(options) {
+ _classCallCheck(this, _default3);
this.mAttr = "data-" + options.dataName;
this.mCaptureEvents = ["mouseenter", "mouseleave"];
this.el = options.el;
}
- _createClass(_default4, [{
+ _createClass(_default3, [{
key: "mInit",
value: function mInit(modules) {
var _this = this;
@@ -433,11 +1431,11 @@
value: function destroy() {
}
}]);
- return _default4;
+ return _default3;
}();
var _default$1 = /* @__PURE__ */ function() {
- function _default4(options) {
- _classCallCheck(this, _default4);
+ function _default3(options) {
+ _classCallCheck(this, _default3);
this.app;
this.modules = options.modules;
this.currentModules = {};
@@ -445,7 +1443,7 @@
this.newModules = {};
this.moduleId = 0;
}
- _createClass(_default4, [{
+ _createClass(_default3, [{
key: "init",
value: function init2(app2, scope) {
var _this = this;
@@ -602,7 +1600,7 @@
return str.charAt(0).toUpperCase() + str.slice(1);
}
}]);
- return _default4;
+ return _default3;
}();
var main_esm_default = _default$1;
@@ -613,467 +1611,21 @@
Scroll: () => Scroll_default
});
- // node_modules/modularload/dist/main.esm.js
- function _classCallCheck2(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- function _defineProperties2(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass2(Constructor, protoProps, staticProps) {
- if (protoProps)
- _defineProperties2(Constructor.prototype, protoProps);
- if (staticProps)
- _defineProperties2(Constructor, staticProps);
- return Constructor;
- }
- function _slicedToArray2(arr, i) {
- return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2();
- }
- function _arrayWithHoles2(arr) {
- if (Array.isArray(arr))
- return arr;
- }
- function _iterableToArrayLimit2(arr, i) {
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
- if (_i == null)
- return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i)
- break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null)
- _i["return"]();
- } finally {
- if (_d)
- throw _e;
- }
- }
- return _arr;
- }
- function _unsupportedIterableToArray2(o, minLen) {
- if (!o)
- return;
- if (typeof o === "string")
- return _arrayLikeToArray2(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor)
- n = o.constructor.name;
- if (n === "Map" || n === "Set")
- return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
- return _arrayLikeToArray2(o, minLen);
- }
- function _arrayLikeToArray2(arr, len) {
- if (len == null || len > arr.length)
- len = arr.length;
- for (var i = 0, arr2 = new Array(len); i < len; i++)
- arr2[i] = arr[i];
- return arr2;
- }
- function _nonIterableRest2() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- var _default2 = /* @__PURE__ */ function() {
- function _default4(options) {
- _classCallCheck2(this, _default4);
- this.defaults = {
- name: "load",
- loadingClass: "is-loading",
- loadedClass: "is-loaded",
- readyClass: "is-ready",
- transitionsPrefix: "is-",
- transitionsHistory: true,
- enterDelay: 0,
- exitDelay: 0,
- loadedDelay: 0,
- isLoaded: false,
- isEntered: false,
- isUrl: false,
- transitionContainer: null,
- popstateIgnore: false
- };
- Object.assign(this, this.defaults, options);
- this.options = options;
- this.namespace = "modular";
- this.html = document.documentElement;
- this.href = window.location.href;
- this.container = "data-" + this.name + "-container";
- this.subContainer = false;
- this.prevTransition = null;
- this.loadAttributes = ["src", "srcset", "style", "href"];
- this.isInserted = false;
- this.isLoading = false;
- this.enterTimeout = false;
- this.controller = new AbortController();
- this.classContainer = this.html;
- this.isChrome = navigator.userAgent.indexOf("Chrome") != -1 ? true : false;
- this.init();
+ // assets/scripts/modules/Load.js
+ var import_core = __toESM(require_barba_umd(), 1);
+
+ // assets/scripts/config.js
+ var env = "development";
+ var config_default = config = Object.freeze({
+ ENV: env,
+ IS_PROD: env === "production",
+ IS_DEV: env === "development",
+ CLASS_NAME: {
+ LOADING: "is-loading",
+ READY: "is-ready",
+ LOADED: "is-loaded"
}
- _createClass2(_default4, [{
- key: "init",
- value: function init2() {
- var _this = this;
- window.addEventListener("popstate", function(e) {
- return _this.checkState(e);
- }, false);
- this.html.addEventListener("click", function(e) {
- return _this.checkClick(e);
- }, false);
- this.loadEls(document);
- }
- }, {
- key: "checkClick",
- value: function checkClick(e) {
- if (!e.ctrlKey && !e.metaKey) {
- var target = e.target;
- while (target && target !== document) {
- if (target.matches("a") && target.getAttribute("download") == null) {
- var href = target.getAttribute("href");
- if (!href.startsWith("#") && !href.startsWith("mailto:") && !href.startsWith("tel:")) {
- e.preventDefault();
- this.reset();
- this.getClickOptions(target);
- }
- break;
- }
- target = target.parentNode;
- }
- }
- }
- }, {
- key: "checkState",
- value: function checkState() {
- if (typeof this.popstateIgnore === "string" && window.location.href.indexOf(this.popstateIgnore) > -1) {
- return;
- }
- this.reset();
- this.getStateOptions();
- }
- }, {
- key: "reset",
- value: function reset() {
- if (this.isLoading) {
- this.controller.abort();
- this.isLoading = false;
- this.controller = new AbortController();
- }
- window.clearTimeout(this.enterTimeout);
- if (this.isInserted) {
- this.removeContainer();
- }
- this.classContainer = this.html;
- Object.assign(this, this.defaults, this.options);
- }
- }, {
- key: "getClickOptions",
- value: function getClickOptions(link) {
- this.transition = link.getAttribute("data-" + this.name);
- this.isUrl = link.getAttribute("data-" + this.name + "-url");
- var href = link.getAttribute("href");
- var target = link.getAttribute("target");
- if (target == "_blank") {
- window.open(href, "_blank");
- return;
- }
- if (this.transition == "false") {
- window.location = href;
- return;
- }
- this.setOptions(href, true);
- }
- }, {
- key: "getStateOptions",
- value: function getStateOptions() {
- if (this.transitionsHistory) {
- this.transition = history.state;
- } else {
- this.transition = false;
- }
- var href = window.location.href;
- this.setOptions(href);
- }
- }, {
- key: "goTo",
- value: function goTo(href, transition, isUrl) {
- this.reset();
- this.transition = transition;
- this.isUrl = isUrl;
- this.setOptions(href, true);
- }
- }, {
- key: "setOptions",
- value: function setOptions(href, push) {
- var container = "[" + this.container + "]";
- var oldContainer;
- if (this.transition && this.transition != "true") {
- this.transitionContainer = "[" + this.container + '="' + this.transition + '"]';
- this.loadingClass = this.transitions[this.transition].loadingClass || this.loadingClass;
- this.loadedClass = this.transitions[this.transition].loadedClass || this.loadedClass;
- this.readyClass = this.transitions[this.transition].readyClass || this.readyClass;
- this.transitionsPrefix = this.transitions[this.transition].transitionsPrefix || this.transitionsPrefix;
- this.enterDelay = this.transitions[this.transition].enterDelay || this.enterDelay;
- this.exitDelay = this.transitions[this.transition].exitDelay || this.exitDelay;
- this.loadedDelay = this.transitions[this.transition].loadedDelay || this.loadedDelay;
- oldContainer = document.querySelector(this.transitionContainer);
- }
- if (oldContainer) {
- container = this.transitionContainer;
- this.oldContainer = oldContainer;
- this.classContainer = this.oldContainer.parentNode;
- if (!this.subContainer) {
- history.replaceState(this.transition, null, this.href);
- }
- this.subContainer = true;
- } else {
- this.oldContainer = document.querySelector(container);
- if (this.subContainer) {
- history.replaceState(this.prevTransition, null, this.href);
- }
- this.subContainer = false;
- }
- this.href = href;
- this.parentContainer = this.oldContainer.parentNode;
- if (this.isUrl === "" || this.isUrl != null && this.isUrl != "false" && this.isUrl != false) {
- history.pushState(this.transition, null, href);
- } else {
- this.oldContainer.classList.add("is-old");
- this.setLoading();
- this.startEnterDelay();
- this.loadHref(href, container, push);
- }
- }
- }, {
- key: "setLoading",
- value: function setLoading() {
- this.classContainer.classList.remove(this.loadedClass, this.readyClass);
- this.classContainer.classList.add(this.loadingClass);
- this.classContainer.classList.remove(this.transitionsPrefix + this.prevTransition);
- if (this.transition) {
- this.classContainer.classList.add(this.transitionsPrefix + this.transition);
- }
- if (!this.subContainer) {
- this.prevTransition = this.transition;
- }
- var loadingEvent = new Event(this.namespace + "loading");
- window.dispatchEvent(loadingEvent);
- }
- }, {
- key: "startEnterDelay",
- value: function startEnterDelay() {
- var _this2 = this;
- this.enterTimeout = window.setTimeout(function() {
- _this2.isEntered = true;
- if (_this2.isLoaded) {
- _this2.transitionContainers();
- }
- }, this.enterDelay);
- }
- }, {
- key: "loadHref",
- value: function loadHref(href, container, push) {
- var _this3 = this;
- this.isLoading = true;
- var signal = this.controller.signal;
- fetch(href, {
- signal
- }).then(function(response) {
- return response.text();
- }).then(function(data) {
- if (push) {
- history.pushState(_this3.transition, null, href);
- }
- var parser = new DOMParser();
- _this3.data = parser.parseFromString(data, "text/html");
- _this3.newContainer = _this3.data.querySelector(container);
- _this3.newContainer.classList.add("is-new");
- _this3.parentNewContainer = _this3.newContainer.parentNode;
- _this3.hideContainer();
- _this3.parentContainer.insertBefore(_this3.newContainer, _this3.oldContainer);
- _this3.isInserted = true;
- _this3.setSvgs();
- _this3.isLoaded = true;
- if (_this3.isEntered) {
- _this3.transitionContainers();
- }
- _this3.loadEls(_this3.newContainer);
- _this3.isLoading = false;
- })["catch"](function(err) {
- window.location = href;
- });
- }
- }, {
- key: "transitionContainers",
- value: function transitionContainers() {
- var _this4 = this;
- this.setAttributes();
- this.showContainer();
- this.setLoaded();
- setTimeout(function() {
- _this4.removeContainer();
- _this4.setReady();
- }, this.exitDelay);
- }
- }, {
- key: "setSvgs",
- value: function setSvgs() {
- if (this.isChrome) {
- var svgs = this.newContainer.querySelectorAll("use");
- if (svgs.length) {
- svgs.forEach(function(svg) {
- var xhref = svg.getAttribute("xlink:href");
- if (xhref) {
- svg.parentNode.innerHTML = '';
- } else {
- var href = svg.getAttribute("href");
- if (href)
- svg.parentNode.innerHTML = '';
- }
- });
- }
- }
- }
- }, {
- key: "setAttributes",
- value: function setAttributes() {
- var _this5 = this;
- var title = this.data.getElementsByTagName("title")[0];
- var newDesc = this.data.head.querySelector('meta[name="description"]');
- var oldDesc = document.head.querySelector('meta[name="description"]');
- var container;
- var newContainer;
- if (this.subContainer) {
- newContainer = this.parentNewContainer;
- container = document.querySelector(this.transitionContainer).parentNode;
- } else {
- newContainer = this.data.querySelector("html");
- container = document.querySelector("html");
- }
- var datas = Object.assign({}, newContainer.dataset);
- if (title)
- document.title = title.innerText;
- if (oldDesc && newDesc)
- oldDesc.setAttribute("content", newDesc.getAttribute("content"));
- if (datas) {
- Object.entries(datas).forEach(function(_ref) {
- var _ref2 = _slicedToArray2(_ref, 2), key = _ref2[0], val = _ref2[1];
- container.setAttribute("data-" + _this5.toDash(key), val);
- });
- }
- }
- }, {
- key: "toDash",
- value: function toDash(str) {
- return str.split(/(?=[A-Z])/).join("-").toLowerCase();
- }
- }, {
- key: "hideContainer",
- value: function hideContainer() {
- this.newContainer.style.visibility = "hidden";
- this.newContainer.style.height = 0;
- this.newContainer.style.overflow = "hidden";
- }
- }, {
- key: "showContainer",
- value: function showContainer() {
- this.newContainer.style.visibility = "";
- this.newContainer.style.height = "";
- this.newContainer.style.overflow = "";
- }
- }, {
- key: "loadEls",
- value: function loadEls(container) {
- var _this6 = this;
- var promises = [];
- this.loadAttributes.forEach(function(attr) {
- var data = "data-" + _this6.name + "-" + attr;
- var els = container.querySelectorAll("[" + data + "]");
- if (els.length) {
- els.forEach(function(el) {
- var elData = el.getAttribute(data);
- el.setAttribute(attr, elData);
- if (attr == "src" || attr == "srcset") {
- var promise = new Promise(function(resolve) {
- el.onload = function() {
- return resolve(el);
- };
- });
- promises.push(promise);
- }
- });
- }
- });
- Promise.all(promises).then(function(val) {
- var imagesEvent = new Event(_this6.namespace + "images");
- window.dispatchEvent(imagesEvent);
- });
- }
- }, {
- key: "setLoaded",
- value: function setLoaded() {
- var _this7 = this;
- this.classContainer.classList.remove(this.loadingClass);
- setTimeout(function() {
- _this7.classContainer.classList.add(_this7.loadedClass);
- }, this.loadedDelay);
- var loadedEvent = new Event(this.namespace + "loaded");
- window.dispatchEvent(loadedEvent);
- }
- }, {
- key: "removeContainer",
- value: function removeContainer() {
- this.parentContainer.removeChild(this.oldContainer);
- this.newContainer.classList.remove("is-new");
- this.isInserted = false;
- }
- }, {
- key: "setReady",
- value: function setReady() {
- this.classContainer.classList.add(this.readyClass);
- var readyEvent = new Event(this.namespace + "ready");
- window.dispatchEvent(readyEvent);
- }
- }, {
- key: "on",
- value: function on(event, func) {
- var _this8 = this;
- window.addEventListener(this.namespace + event, function() {
- switch (event) {
- case "loading":
- return func(_this8.transition, _this8.oldContainer);
- case "loaded":
- return func(_this8.transition, _this8.oldContainer, _this8.newContainer);
- case "ready":
- return func(_this8.transition, _this8.newContainer);
- default:
- return func();
- }
- }, false);
- }
- }]);
- return _default4;
- }();
- var main_esm_default2 = _default2;
+ });
// assets/scripts/modules/Load.js
var Load_default = class extends _default {
@@ -1081,15 +1633,20 @@
super(m);
}
init() {
- const load = new main_esm_default2({
- enterDelay: 0,
- transitions: {
- customTransition: {}
- }
- });
- load.on("loaded", (transition, oldContainer, newContainer) => {
- this.call("destroy", oldContainer, "app");
- this.call("update", newContainer, "app");
+ import_core.default.init({
+ debug: config_default.IS_DEV,
+ schema: {
+ prefix: "data-load"
+ },
+ transitions: [{
+ name: "default-transition",
+ leave: (data) => {
+ this.call("destroy", data.current.container, "app");
+ },
+ enter: (data) => {
+ this.call("update", data.next.container, "app");
+ }
+ }]
});
}
};
@@ -1161,12 +1718,12 @@
}
// node_modules/locomotive-scroll/dist/locomotive-scroll.esm.js
- function _classCallCheck3(instance, Constructor) {
+ function _classCallCheck2(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
- function _defineProperties3(target, props) {
+ function _defineProperties2(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
@@ -1176,11 +1733,11 @@
Object.defineProperty(target, descriptor.key, descriptor);
}
}
- function _createClass3(Constructor, protoProps, staticProps) {
+ function _createClass2(Constructor, protoProps, staticProps) {
if (protoProps)
- _defineProperties3(Constructor.prototype, protoProps);
+ _defineProperties2(Constructor.prototype, protoProps);
if (staticProps)
- _defineProperties3(Constructor, staticProps);
+ _defineProperties2(Constructor, staticProps);
return Constructor;
}
function _defineProperty2(obj, key, value) {
@@ -1317,17 +1874,17 @@
}
return _get(target, property, receiver || target);
}
- function _slicedToArray3(arr, i) {
- return _arrayWithHoles3(arr) || _iterableToArrayLimit3(arr, i) || _unsupportedIterableToArray3(arr, i) || _nonIterableRest3();
+ function _slicedToArray2(arr, i) {
+ return _arrayWithHoles2(arr) || _iterableToArrayLimit2(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest2();
}
function _toConsumableArray2(arr) {
- return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray3(arr) || _nonIterableSpread2();
+ return _arrayWithoutHoles2(arr) || _iterableToArray2(arr) || _unsupportedIterableToArray2(arr) || _nonIterableSpread2();
}
function _arrayWithoutHoles2(arr) {
if (Array.isArray(arr))
- return _arrayLikeToArray3(arr);
+ return _arrayLikeToArray2(arr);
}
- function _arrayWithHoles3(arr) {
+ function _arrayWithHoles2(arr) {
if (Array.isArray(arr))
return arr;
}
@@ -1335,7 +1892,7 @@
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
return Array.from(iter);
}
- function _iterableToArrayLimit3(arr, i) {
+ function _iterableToArrayLimit2(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
return;
var _arr = [];
@@ -1362,20 +1919,20 @@
}
return _arr;
}
- function _unsupportedIterableToArray3(o, minLen) {
+ function _unsupportedIterableToArray2(o, minLen) {
if (!o)
return;
if (typeof o === "string")
- return _arrayLikeToArray3(o, minLen);
+ return _arrayLikeToArray2(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
- return _arrayLikeToArray3(o, minLen);
+ return _arrayLikeToArray2(o, minLen);
}
- function _arrayLikeToArray3(arr, len) {
+ function _arrayLikeToArray2(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++)
@@ -1385,7 +1942,7 @@
function _nonIterableSpread2() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
- function _nonIterableRest3() {
+ function _nonIterableRest2() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var defaults = {
@@ -1428,10 +1985,10 @@
gestureDirection: "vertical"
}
};
- var _default3 = /* @__PURE__ */ function() {
- function _default4() {
+ var _default2 = /* @__PURE__ */ function() {
+ function _default3() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- _classCallCheck3(this, _default4);
+ _classCallCheck2(this, _default3);
Object.assign(this, defaults, options);
this.smartphone = defaults.smartphone;
if (options.smartphone)
@@ -1491,7 +2048,7 @@
this.html.classList.add(this.initClass);
window.addEventListener("resize", this.checkResize, false);
}
- _createClass3(_default4, [{
+ _createClass2(_default3, [{
key: "init",
value: function init2() {
this.initEvents();
@@ -1572,7 +2129,7 @@
var scrollLeft = this.instance.scroll.x;
var scrollRight = scrollLeft + this.windowWidth;
Object.entries(this.els).forEach(function(_ref) {
- var _ref2 = _slicedToArray3(_ref, 2), i = _ref2[0], el = _ref2[1];
+ var _ref2 = _slicedToArray2(_ref, 2), i = _ref2[0], el = _ref2[1];
if (el && (!el.inView || hasCallEventSet)) {
if (_this3.direction === "horizontal") {
if (scrollRight >= el.left && scrollLeft < el.right) {
@@ -1729,7 +2286,7 @@
this.html.classList.remove(this.initClass);
}
}]);
- return _default4;
+ return _default3;
}();
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function createCommonjsModule(fn, module) {
@@ -1743,13 +2300,13 @@
if ("scrollBehavior" in d.documentElement.style && w.__forceSmoothScrollPolyfill__ !== true) {
return;
}
- var Element = w.HTMLElement || w.Element;
+ var Element2 = w.HTMLElement || w.Element;
var SCROLL_TIME = 468;
var original = {
scroll: w.scroll || w.scrollTo,
scrollBy: w.scrollBy,
- elementScroll: Element.prototype.scroll || scrollElement,
- scrollIntoView: Element.prototype.scrollIntoView
+ elementScroll: Element2.prototype.scroll || scrollElement,
+ scrollIntoView: Element2.prototype.scrollIntoView
};
var now = w.performance && w.performance.now ? w.performance.now.bind(w.performance) : Date.now;
function isMicrosoftBrowser(userAgent) {
@@ -1858,7 +2415,7 @@
}
smoothScroll.call(w, d.body, ~~arguments[0].left + (w.scrollX || w.pageXOffset), ~~arguments[0].top + (w.scrollY || w.pageYOffset));
};
- Element.prototype.scroll = Element.prototype.scrollTo = function() {
+ Element2.prototype.scroll = Element2.prototype.scrollTo = function() {
if (arguments[0] === void 0) {
return;
}
@@ -1873,7 +2430,7 @@
var top = arguments[0].top;
smoothScroll.call(this, this, typeof left === "undefined" ? this.scrollLeft : ~~left, typeof top === "undefined" ? this.scrollTop : ~~top);
};
- Element.prototype.scrollBy = function() {
+ Element2.prototype.scrollBy = function() {
if (arguments[0] === void 0) {
return;
}
@@ -1887,7 +2444,7 @@
behavior: arguments[0].behavior
});
};
- Element.prototype.scrollIntoView = function() {
+ Element2.prototype.scrollIntoView = function() {
if (shouldBailOut(arguments[0]) === true) {
original.scrollIntoView.call(this, arguments[0] === void 0 ? true : arguments[0]);
return;
@@ -1920,12 +2477,12 @@
});
var smoothscroll_1 = smoothscroll.polyfill;
var _default$12 = /* @__PURE__ */ function(_Core) {
- _inherits(_default4, _Core);
- var _super = _createSuper(_default4);
- function _default4() {
+ _inherits(_default3, _Core);
+ var _super = _createSuper(_default3);
+ function _default3() {
var _this;
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- _classCallCheck3(this, _default4);
+ _classCallCheck2(this, _default3);
_this = _super.call(this, options);
if (_this.resetNativeScroll) {
if (history.scrollRestoration) {
@@ -1940,19 +2497,19 @@
}
return _this;
}
- _createClass3(_default4, [{
+ _createClass2(_default3, [{
key: "init",
value: function init2() {
this.instance.scroll.y = window.pageYOffset;
this.addElements();
this.detectElements();
- _get(_getPrototypeOf(_default4.prototype), "init", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "init", this).call(this);
}
}, {
key: "checkScroll",
value: function checkScroll() {
var _this2 = this;
- _get(_getPrototypeOf(_default4.prototype), "checkScroll", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "checkScroll", this).call(this);
if (this.getDirection) {
this.addDirection();
}
@@ -2063,7 +2620,7 @@
value: function updateElements() {
var _this4 = this;
Object.entries(this.els).forEach(function(_ref) {
- var _ref2 = _slicedToArray3(_ref, 2), i = _ref2[0], el = _ref2[1];
+ var _ref2 = _slicedToArray2(_ref, 2), i = _ref2[0], el = _ref2[1];
var top = el.targetEl.getBoundingClientRect().top + _this4.instance.scroll.y;
var bottom = top + el.targetEl.offsetHeight;
var relativeOffset = _this4.getRelativeOffset(el.offset);
@@ -2152,12 +2709,12 @@
}, {
key: "destroy",
value: function destroy() {
- _get(_getPrototypeOf(_default4.prototype), "destroy", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "destroy", this).call(this);
window.removeEventListener("scroll", this.checkScroll, false);
}
}]);
- return _default4;
- }(_default3);
+ return _default3;
+ }(_default2);
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
@@ -2700,12 +3257,12 @@
END: 35
};
var _default$2 = /* @__PURE__ */ function(_Core) {
- _inherits(_default4, _Core);
- var _super = _createSuper(_default4);
- function _default4() {
+ _inherits(_default3, _Core);
+ var _super = _createSuper(_default3);
+ function _default3() {
var _this;
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- _classCallCheck3(this, _default4);
+ _classCallCheck2(this, _default3);
if (history.scrollRestoration) {
history.scrollRestoration = "manual";
}
@@ -2724,7 +3281,7 @@
window.addEventListener("keydown", _this.checkKey, false);
return _this;
}
- _createClass3(_default4, [{
+ _createClass2(_default3, [{
key: "init",
value: function init2() {
var _this2 = this;
@@ -2766,7 +3323,7 @@
this.addElements();
this.checkScroll(true);
this.transformElements(true, true);
- _get(_getPrototypeOf(_default4.prototype), "init", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "init", this).call(this);
}
}, {
key: "setScrollLimit",
@@ -2896,7 +3453,7 @@
this.stopScrolling();
}
Object.entries(this.sections).forEach(function(_ref) {
- var _ref2 = _slicedToArray3(_ref, 2), i = _ref2[0], section = _ref2[1];
+ var _ref2 = _slicedToArray2(_ref, 2), i = _ref2[0], section = _ref2[1];
if (section.persistent || _this4.instance.scroll[_this4.directionAxis] > section.offset[_this4.directionAxis] && _this4.instance.scroll[_this4.directionAxis] < section.limit[_this4.directionAxis]) {
if (_this4.direction === "horizontal") {
_this4.transform(section.el, -_this4.instance.scroll[_this4.directionAxis], 0);
@@ -2936,7 +3493,7 @@
this.transform(this.scrollbarThumb, 0, scrollBarTranslation);
}
}
- _get(_getPrototypeOf(_default4.prototype), "checkScroll", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "checkScroll", this).call(this);
this.hasScrollTicking = false;
}
}
@@ -3142,7 +3699,7 @@
els.forEach(function(el, index) {
var targetParents = getParents(el);
var section = Object.entries(_this6.sections).map(function(_ref3) {
- var _ref4 = _slicedToArray3(_ref3, 2), key = _ref4[0], section2 = _ref4[1];
+ var _ref4 = _slicedToArray2(_ref3, 2), key = _ref4[0], section2 = _ref4[1];
return section2;
}).find(function(section2) {
return targetParents.includes(section2.el);
@@ -3333,7 +3890,7 @@
y: this.instance.scroll.y + this.windowMiddle.y
};
Object.entries(this.parallaxElements).forEach(function(_ref5) {
- var _ref6 = _slicedToArray3(_ref5, 2), i = _ref6[0], current = _ref6[1];
+ var _ref6 = _slicedToArray2(_ref5, 2), i = _ref6[0], current = _ref6[1];
var transformDistance = false;
if (isForced) {
transformDistance = 0;
@@ -3444,7 +4001,7 @@
var targetParents = getParents(target);
var parentSection = targetParents.find(function(candidate) {
return Object.entries(_this9.sections).map(function(_ref7) {
- var _ref8 = _slicedToArray3(_ref7, 2), key = _ref8[0], section = _ref8[1];
+ var _ref8 = _slicedToArray2(_ref7, 2), key = _ref8[0], section = _ref8[1];
return section;
}).find(function(section) {
return section.el == candidate;
@@ -3538,7 +4095,7 @@
}, {
key: "destroy",
value: function destroy() {
- _get(_getPrototypeOf(_default4.prototype), "destroy", this).call(this);
+ _get(_getPrototypeOf(_default3.prototype), "destroy", this).call(this);
this.stopScrolling();
this.html.classList.remove(this.smoothClass);
this.vs.destroy();
@@ -3546,12 +4103,12 @@
window.removeEventListener("keydown", this.checkKey, false);
}
}]);
- return _default4;
- }(_default3);
+ return _default3;
+ }(_default2);
var Smooth = /* @__PURE__ */ function() {
function Smooth2() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- _classCallCheck3(this, Smooth2);
+ _classCallCheck2(this, Smooth2);
this.options = options;
Object.assign(this, defaults, options);
this.smartphone = defaults.smartphone;
@@ -3568,7 +4125,7 @@
console.warn("\u{1F6A8} `smooth:false` & `horizontal` direction are not yet compatible (smartphone)");
this.init();
}
- _createClass3(Smooth2, [{
+ _createClass2(Smooth2, [{
key: "init",
value: function init2() {
this.options.isMobile = /Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 || window.innerWidth < this.tablet.breakpoint;
@@ -3662,10 +4219,9 @@
(0, import_svg4everybody.default)();
}
- // assets/scripts/utils/environment.js
- var html = document.documentElement;
- var body = document.body;
- var isDebug = html.hasAttribute("data-debug");
+ // assets/scripts/utils/dom.js
+ var $html = document.documentElement;
+ var $body = document.body;
// assets/scripts/app.js
var app = new main_esm_default({
@@ -3688,9 +4244,9 @@
function init() {
globals_default();
app.init(app);
- html.classList.add("is-loaded");
- html.classList.add("is-ready");
- html.classList.remove("is-loading");
+ $html.classList.add(config_default.CLASS_NAME.LOADED);
+ $html.classList.add(config_default.CLASS_NAME.READY);
+ $html.classList.remove(config_default.CLASS_NAME.LOADING);
}
})();
/*
diff --git a/www/assets/scripts/app.js.map b/www/assets/scripts/app.js.map
index c5254735..bc75144e 100644
--- a/www/assets/scripts/app.js.map
+++ b/www/assets/scripts/app.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
- "sources": ["../../../node_modules/svg4everybody/dist/svg4everybody.js", "../../../node_modules/modujs/dist/main.esm.js", "../../../assets/scripts/modules.js", "../../../node_modules/modularload/dist/main.esm.js", "../../../assets/scripts/modules/Load.js", "../../../assets/scripts/utils/image.js", "../../../node_modules/locomotive-scroll/dist/locomotive-scroll.esm.js", "../../../assets/scripts/modules/Scroll.js", "../../../assets/scripts/globals.js", "../../../assets/scripts/utils/environment.js", "../../../assets/scripts/app.js"],
- "sourcesContent": ["!function(root, factory) {\n \"function\" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set\n define([], function() {\n return root.svg4everybody = factory();\n }) : \"object\" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory() : root.svg4everybody = factory();\n}(this, function() {\n /*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */\n function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }\n function loadreadystatechange(xhr) {\n // listen to changes in the request\n xhr.onreadystatechange = function() {\n // if the request is ready\n if (4 === xhr.readyState) {\n // get the cached html document\n var cachedDocument = xhr._cachedDocument;\n // ensure the cached html document based on the xhr response\n cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(\"\"), \n cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item\n xhr._embeds.splice(0).map(function(item) {\n // get the cached target\n var target = xhr._cachedTarget[item.id];\n // ensure the cached target\n target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)), \n // embed the target into the svg\n embed(item.parent, item.svg, target);\n });\n }\n }, // test the ready state change immediately\n xhr.onreadystatechange();\n }\n function svg4everybody(rawopts) {\n function oninterval() {\n // while the index exists in the live