@modoitaliano/giorgia 0.1.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/assets/default-og.jpg +0 -0
- package/dist/assets/default-og.png +0 -0
- package/dist/assets/giorgia-navigation.js +1123 -0
- package/dist/assets/mi.svg +6 -0
- package/dist/carousels.d.ts +1 -0
- package/dist/carousels.js +65 -0
- package/dist/components/live-program/LiveProgram.d.ts +9 -0
- package/dist/components/live-program/LiveProgram.js +751 -0
- package/dist/components/live-program/assets.d.ts +14 -0
- package/dist/components/live-program/assets.js +14 -0
- package/dist/components/live-program/components/Marquee.d.ts +16 -0
- package/dist/components/live-program/components/Marquee.js +88 -0
- package/dist/components/live-program/components/MarqueeCurtain.d.ts +5 -0
- package/dist/components/live-program/components/MarqueeCurtain.js +30 -0
- package/dist/components/live-program/components/WorldClocks.d.ts +19 -0
- package/dist/components/live-program/components/WorldClocks.js +101 -0
- package/dist/components/live-program/components/slides/ArticleSlide.d.ts +14 -0
- package/dist/components/live-program/components/slides/ArticleSlide.js +32 -0
- package/dist/components/live-program/components/slides/CallsignSlide.d.ts +6 -0
- package/dist/components/live-program/components/slides/CallsignSlide.js +49 -0
- package/dist/components/live-program/components/slides/LiveEventSlide.d.ts +9 -0
- package/dist/components/live-program/components/slides/LiveEventSlide.js +86 -0
- package/dist/components/live-program/components/slides/slideStyles.d.ts +1 -0
- package/dist/components/live-program/components/slides/slideStyles.js +64 -0
- package/dist/components/live-program/events.d.ts +34 -0
- package/dist/components/live-program/events.js +167 -0
- package/dist/components/live-program/hooks/useSSE.d.ts +11 -0
- package/dist/components/live-program/hooks/useSSE.js +107 -0
- package/dist/components/live-program/i18n.d.ts +4 -0
- package/dist/components/live-program/i18n.js +305 -0
- package/dist/components/live-program/segments/ArticlesSegment.d.ts +6 -0
- package/dist/components/live-program/segments/ArticlesSegment.js +160 -0
- package/dist/components/live-program/segments/EarthquakeSegment.d.ts +16 -0
- package/dist/components/live-program/segments/EarthquakeSegment.js +130 -0
- package/dist/components/live-program/segments/LiveEventSegment.d.ts +4 -0
- package/dist/components/live-program/segments/LiveEventSegment.js +27 -0
- package/dist/components/live-program/segments/MarketsSegment.d.ts +12 -0
- package/dist/components/live-program/segments/MarketsSegment.js +76 -0
- package/dist/components/live-program/segments/WeatherSegment.d.ts +15 -0
- package/dist/components/live-program/segments/WeatherSegment.js +119 -0
- package/dist/components/live-program/segments/fetchLiveEvents.d.ts +20 -0
- package/dist/components/live-program/segments/fetchLiveEvents.js +76 -0
- package/dist/components/live-program/segments/index.d.ts +8 -0
- package/dist/components/live-program/segments/index.js +8 -0
- package/dist/components/live-program/segments/types.d.ts +23 -0
- package/dist/components/live-program/segments/types.js +1 -0
- package/dist/components/live-program/segments/usePlaylistEngine.d.ts +9 -0
- package/dist/components/live-program/segments/usePlaylistEngine.js +108 -0
- package/dist/components/live-program/utils/broadcastTime.d.ts +12 -0
- package/dist/components/live-program/utils/broadcastTime.js +33 -0
- package/dist/cronkite-manifest.d.ts +70 -0
- package/dist/cronkite-manifest.js +134 -0
- package/dist/cronkite-manifest.json +149 -0
- package/dist/fonts/barlow-condensed-latin-300-normal.woff2 +0 -0
- package/dist/fonts/barlow-condensed-latin-400-normal.woff2 +0 -0
- package/dist/fonts/barlow-condensed-latin-500-normal.woff2 +0 -0
- package/dist/fonts/barlow-condensed-latin-600-normal.woff2 +0 -0
- package/dist/fonts/barlow-condensed-latin-700-normal.woff2 +0 -0
- package/dist/fonts/barlow-condensed-latin-800-normal.woff2 +0 -0
- package/dist/fonts/barlow-latin-400-normal.woff2 +0 -0
- package/dist/fonts/barlow-latin-500-normal.woff2 +0 -0
- package/dist/fonts/barlow-latin-600-normal.woff2 +0 -0
- package/dist/fonts/barlow-latin-700-normal.woff2 +0 -0
- package/dist/fonts/barlow-latin-800-normal.woff2 +0 -0
- package/dist/fonts/fonts.css +18 -0
- package/dist/fonts/outfit-latin-400-normal.woff2 +0 -0
- package/dist/fonts/outfit-latin-500-normal.woff2 +0 -0
- package/dist/fonts/outfit-latin-600-normal.woff2 +0 -0
- package/dist/fonts/outfit-latin-700-normal.woff2 +0 -0
- package/dist/fonts/outfit-latin-800-normal.woff2 +0 -0
- package/dist/homepage-distributor.d.ts +55 -0
- package/dist/homepage-distributor.js +68 -0
- package/dist/instagram-image-template.d.ts +9 -0
- package/dist/instagram-image-template.js +51 -0
- package/dist/json-schema-formats.d.ts +2 -0
- package/dist/json-schema-formats.js +24 -0
- package/dist/layouts.d.ts +14 -0
- package/dist/layouts.js +13 -0
- package/dist/live-program/main.d.ts +1 -0
- package/dist/live-program/main.js +10 -0
- package/dist/live-program-page/index.html +16 -0
- package/dist/live-program-page/live-program.css +3 -0
- package/dist/live-program-page/live-program.js +76 -0
- package/dist/live-program-page/modoitaliano/audio/pipes.ogg +0 -0
- package/dist/live-program-page/modoitaliano/images/berlin.jpg +0 -0
- package/dist/live-program-page/modoitaliano/images/modoitaliano.png +0 -0
- package/dist/live-program-page/modoitaliano/images/nyc.jpg +0 -0
- package/dist/live-program-page/modoitaliano/images/nyse.jpg +0 -0
- package/dist/live-program-page/modoitaliano/images/santiago.jpg +0 -0
- package/dist/live-program-page/modoitaliano/images/seismograph.jpg +0 -0
- package/dist/live-program-page/modoitaliano/images/tokyo.jpg +0 -0
- package/dist/manifest-validation.d.ts +10 -0
- package/dist/manifest-validation.js +27 -0
- package/dist/outlet-config.d.ts +28 -0
- package/dist/outlet-config.js +28 -0
- package/dist/renderer.browser.d.ts +2 -0
- package/dist/renderer.browser.js +140 -0
- package/dist/renderer.core.d.ts +10 -0
- package/dist/renderer.core.js +403 -0
- package/dist/renderer.d.ts +8 -0
- package/dist/renderer.js +5 -0
- package/dist/renderer.node.d.ts +22 -0
- package/dist/renderer.node.js +184 -0
- package/dist/schemas/canonical-document.schema.json +1071 -0
- package/dist/schemas/cronkite-manifest.schema.json +501 -0
- package/dist/schemas/feed-renderable-input.schema.json +13 -0
- package/dist/schemas/search-index.schema.json +27 -0
- package/dist/schemas/search-manifest.schema.json +34 -0
- package/dist/types/canonical-article.d.ts +7 -0
- package/dist/types/canonical-article.js +21 -0
- package/dist/types/canonical-document-schema.generated.d.ts +1634 -0
- package/dist/types/canonical-document-schema.generated.js +1730 -0
- package/dist/types/canonical-document.generated.d.ts +541 -0
- package/dist/types/canonical-document.generated.js +3 -0
- package/dist/types/cronkite-manifest.generated.d.ts +339 -0
- package/dist/types/cronkite-manifest.generated.js +3 -0
- package/dist/utils/sofascore.d.ts +3 -0
- package/dist/utils/sofascore.js +31 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/dist/video/Root.d.ts +1 -0
- package/dist/video/Root.js +40 -0
- package/dist/video/ShortVideo.d.ts +3 -0
- package/dist/video/ShortVideo.js +92 -0
- package/dist/video/index.d.ts +2 -0
- package/dist/video/index.js +4 -0
- package/dist/video/types.d.ts +37 -0
- package/dist/video/types.js +1 -0
- package/package.json +121 -0
- package/src/partial-deps.json +53 -0
- package/src/styles/compiled.css +2 -0
- package/src/templates/assets/default-og.jpg +0 -0
- package/src/templates/assets/default-og.png +0 -0
- package/src/templates/assets/mi.svg +6 -0
- package/src/templates/layouts/404.hbs +7 -0
- package/src/templates/layouts/article-page.hbs +7 -0
- package/src/templates/layouts/category-page.hbs +7 -0
- package/src/templates/layouts/coming-soon.hbs +7 -0
- package/src/templates/layouts/homepage.hbs +7 -0
- package/src/templates/layouts/link-in-bio.hbs +228 -0
- package/src/templates/layouts/live-story.hbs +7 -0
- package/src/templates/layouts/media-page.hbs +7 -0
- package/src/templates/layouts/search-page.hbs +7 -0
- package/src/templates/layouts/standalone-page.hbs +7 -0
- package/src/templates/partials/blocks/audio.hbs +12 -0
- package/src/templates/partials/blocks/data-table.hbs +23 -0
- package/src/templates/partials/blocks/divider.hbs +1 -0
- package/src/templates/partials/blocks/heading.hbs +9 -0
- package/src/templates/partials/blocks/image.hbs +6 -0
- package/src/templates/partials/blocks/info-box.hbs +8 -0
- package/src/templates/partials/blocks/instagram.hbs +28 -0
- package/src/templates/partials/blocks/key-points.hbs +8 -0
- package/src/templates/partials/blocks/list.hbs +13 -0
- package/src/templates/partials/blocks/live-update.hbs +24 -0
- package/src/templates/partials/blocks/pull-quote.hbs +6 -0
- package/src/templates/partials/blocks/rich-text.hbs +1 -0
- package/src/templates/partials/blocks/spotify.hbs +14 -0
- package/src/templates/partials/blocks/tiktok.hbs +15 -0
- package/src/templates/partials/blocks/x.hbs +74 -0
- package/src/templates/partials/blocks/youtube.hbs +12 -0
- package/src/templates/partials/components/article-main.hbs +159 -0
- package/src/templates/partials/components/breaking-news/live-updates-column.hbs +29 -0
- package/src/templates/partials/components/breaking-news.hbs +56 -0
- package/src/templates/partials/components/category/header.hbs +5 -0
- package/src/templates/partials/components/category/main-grid.hbs +55 -0
- package/src/templates/partials/components/category/main.hbs +7 -0
- package/src/templates/partials/components/category/more-grid.hbs +26 -0
- package/src/templates/partials/components/coming-soon/main.hbs +14 -0
- package/src/templates/partials/components/editorial-hero.hbs +73 -0
- package/src/templates/partials/components/headline.hbs +15 -0
- package/src/templates/partials/components/hero-editorial.hbs +1 -0
- package/src/templates/partials/components/hero.hbs +1 -0
- package/src/templates/partials/components/home/landing.hbs +111 -0
- package/src/templates/partials/components/home/main.hbs +59 -0
- package/src/templates/partials/components/home/more-stories.hbs +23 -0
- package/src/templates/partials/components/home/must-read.hbs +77 -0
- package/src/templates/partials/components/live-story/main.hbs +229 -0
- package/src/templates/partials/components/media/main.hbs +228 -0
- package/src/templates/partials/components/not-found/main.hbs +28 -0
- package/src/templates/partials/components/search/main.hbs +424 -0
- package/src/templates/partials/components/snack.hbs +92 -0
- package/src/templates/partials/components/spotlight-hero.hbs +59 -0
- package/src/templates/partials/components/standalone-main.hbs +28 -0
- package/src/templates/partials/components/stream-player.hbs +40 -0
- package/src/templates/partials/components/trending.hbs +14 -0
- package/src/templates/partials/components/ui/accordion.hbs +30 -0
- package/src/templates/partials/components/ui/breadcrumb.hbs +16 -0
- package/src/templates/partials/components/ui/icon-button.hbs +19 -0
- package/src/templates/partials/components/ui/loading-spinner.hbs +27 -0
- package/src/templates/partials/components/ui/pagination.hbs +56 -0
- package/src/templates/partials/components/ui/scroll-area.hbs +12 -0
- package/src/templates/partials/components/ui/status-badge.hbs +21 -0
- package/src/templates/partials/footers/footer-full.hbs +73 -0
- package/src/templates/partials/headers/header-main.hbs +477 -0
- package/src/templates/partials/nav/nav-categories.hbs +5 -0
- package/src/templates/partials/shell/doc-end.hbs +637 -0
- package/src/templates/partials/shell/doc-start-404.hbs +42 -0
- package/src/templates/partials/shell/doc-start-standard.hbs +96 -0
- package/src/templates/templates/instagram-image.hbs +177 -0
|
@@ -0,0 +1,1123 @@
|
|
|
1
|
+
//#region node_modules/delegate-it/delegate.js
|
|
2
|
+
var e = /* @__PURE__ */ new WeakMap();
|
|
3
|
+
function t(t, n, r, i) {
|
|
4
|
+
if (!t && !e.has(n)) return !1;
|
|
5
|
+
let a = e.get(n) ?? /* @__PURE__ */ new WeakMap();
|
|
6
|
+
e.set(n, a);
|
|
7
|
+
let o = a.get(r) ?? /* @__PURE__ */ new Set();
|
|
8
|
+
a.set(r, o);
|
|
9
|
+
let s = o.has(i);
|
|
10
|
+
return t ? o.add(i) : o.delete(i), s && t;
|
|
11
|
+
}
|
|
12
|
+
function n(e, t) {
|
|
13
|
+
let n = e.target;
|
|
14
|
+
if (n instanceof Text && (n = n.parentElement), n instanceof Element && e.currentTarget instanceof Node) {
|
|
15
|
+
let r = n.closest(t);
|
|
16
|
+
if (r && e.currentTarget.contains(r)) return r;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function r(e, i, a, o = {}) {
|
|
20
|
+
if (Array.isArray(i)) {
|
|
21
|
+
for (let t of i) r(e, t, a, o);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let s = i, { signal: c, base: l = document } = o;
|
|
25
|
+
if (c?.aborted) return;
|
|
26
|
+
let { once: u, ...d } = o, f = l instanceof Document ? l.documentElement : l, p = !!(typeof o == "object" ? o.capture : o), m = (r) => {
|
|
27
|
+
let i = n(r, String(e));
|
|
28
|
+
if (i) {
|
|
29
|
+
let e = Object.assign(r, { delegateTarget: i });
|
|
30
|
+
a.call(f, e), u && (f.removeEventListener(s, m, d), t(!1, f, a, h));
|
|
31
|
+
}
|
|
32
|
+
}, h = JSON.stringify({
|
|
33
|
+
selector: e,
|
|
34
|
+
type: s,
|
|
35
|
+
capture: p
|
|
36
|
+
});
|
|
37
|
+
t(!0, f, a, h) || f.addEventListener(s, m, d), c?.addEventListener("abort", () => {
|
|
38
|
+
t(!1, f, a, h);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region node_modules/swup/dist/Swup.modern.js
|
|
43
|
+
function i() {
|
|
44
|
+
return i = Object.assign ? Object.assign.bind() : function(e) {
|
|
45
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
46
|
+
var n = arguments[t];
|
|
47
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
48
|
+
}
|
|
49
|
+
return e;
|
|
50
|
+
}, i.apply(null, arguments);
|
|
51
|
+
}
|
|
52
|
+
var a = (e, t) => String(e).toLowerCase().replace(/[\s/_.]+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+|-+$/g, "") || t || "", o = ({ hash: e } = {}) => window.location.pathname + window.location.search + (e ? window.location.hash : ""), s = (e, t = {}) => {
|
|
53
|
+
let n = i({
|
|
54
|
+
url: e ||= o({ hash: !0 }),
|
|
55
|
+
random: Math.random(),
|
|
56
|
+
source: "swup"
|
|
57
|
+
}, t);
|
|
58
|
+
window.history.pushState(n, "", e);
|
|
59
|
+
}, c = (e = null, t = {}) => {
|
|
60
|
+
e ||= o({ hash: !0 });
|
|
61
|
+
let n = i({}, window.history.state || {}, {
|
|
62
|
+
url: e,
|
|
63
|
+
random: Math.random(),
|
|
64
|
+
source: "swup"
|
|
65
|
+
}, t);
|
|
66
|
+
window.history.replaceState(n, "", e);
|
|
67
|
+
}, l = (e, t, n, a) => {
|
|
68
|
+
let o = new AbortController();
|
|
69
|
+
return a = i({}, a, { signal: o.signal }), r(e, t, n, a), { destroy: () => o.abort() };
|
|
70
|
+
}, u = class e extends URL {
|
|
71
|
+
constructor(t, n = document.baseURI) {
|
|
72
|
+
super(t.toString(), n), Object.setPrototypeOf(this, e.prototype);
|
|
73
|
+
}
|
|
74
|
+
get url() {
|
|
75
|
+
return this.pathname + this.search;
|
|
76
|
+
}
|
|
77
|
+
static fromElement(t) {
|
|
78
|
+
return new e(t.getAttribute("href") || t.getAttribute("xlink:href") || "");
|
|
79
|
+
}
|
|
80
|
+
static fromUrl(t) {
|
|
81
|
+
return new e(t);
|
|
82
|
+
}
|
|
83
|
+
}, d = class extends Error {
|
|
84
|
+
constructor(e, t) {
|
|
85
|
+
super(e), this.url = void 0, this.status = void 0, this.aborted = void 0, this.timedOut = void 0, this.name = "FetchError", this.url = t.url, this.status = t.status, this.aborted = t.aborted || !1, this.timedOut = t.timedOut || !1;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
async function f(e, t = {}) {
|
|
89
|
+
e = u.fromUrl(e).url;
|
|
90
|
+
let { visit: n = this.visit } = t, r = i({}, this.options.requestHeaders, t.headers), a = t.timeout ?? this.options.timeout, o = new AbortController(), { signal: s } = o;
|
|
91
|
+
t = i({}, t, {
|
|
92
|
+
headers: r,
|
|
93
|
+
signal: s
|
|
94
|
+
});
|
|
95
|
+
let c, l = !1, f = null;
|
|
96
|
+
a && a > 0 && (f = setTimeout(() => {
|
|
97
|
+
l = !0, o.abort("timeout");
|
|
98
|
+
}, a));
|
|
99
|
+
try {
|
|
100
|
+
c = await this.hooks.call("fetch:request", n, {
|
|
101
|
+
url: e,
|
|
102
|
+
options: t
|
|
103
|
+
}, (e, { url: t, options: n }) => fetch(t, n)), f && clearTimeout(f);
|
|
104
|
+
} catch (t) {
|
|
105
|
+
throw l ? (this.hooks.call("fetch:timeout", n, { url: e }), new d(`Request timed out: ${e}`, {
|
|
106
|
+
url: e,
|
|
107
|
+
timedOut: l
|
|
108
|
+
})) : t?.name === "AbortError" || s.aborted ? new d(`Request aborted: ${e}`, {
|
|
109
|
+
url: e,
|
|
110
|
+
aborted: !0
|
|
111
|
+
}) : t;
|
|
112
|
+
}
|
|
113
|
+
let { status: p, url: m } = c, h = await c.text();
|
|
114
|
+
if (p === 500) throw this.hooks.call("fetch:error", n, {
|
|
115
|
+
status: p,
|
|
116
|
+
response: c,
|
|
117
|
+
url: m
|
|
118
|
+
}), new d(`Server error: ${m}`, {
|
|
119
|
+
status: p,
|
|
120
|
+
url: m
|
|
121
|
+
});
|
|
122
|
+
if (!h) throw new d(`Empty response: ${m}`, {
|
|
123
|
+
status: p,
|
|
124
|
+
url: m
|
|
125
|
+
});
|
|
126
|
+
let { url: g } = u.fromUrl(m), _ = {
|
|
127
|
+
url: g,
|
|
128
|
+
html: h
|
|
129
|
+
};
|
|
130
|
+
return !n.cache.write || t.method && t.method !== "GET" || e !== g || this.cache.set(_.url, _), _;
|
|
131
|
+
}
|
|
132
|
+
var p = class {
|
|
133
|
+
constructor(e) {
|
|
134
|
+
this.swup = void 0, this.pages = /* @__PURE__ */ new Map(), this.swup = e;
|
|
135
|
+
}
|
|
136
|
+
get size() {
|
|
137
|
+
return this.pages.size;
|
|
138
|
+
}
|
|
139
|
+
get all() {
|
|
140
|
+
let e = /* @__PURE__ */ new Map();
|
|
141
|
+
return this.pages.forEach((t, n) => {
|
|
142
|
+
e.set(n, i({}, t));
|
|
143
|
+
}), e;
|
|
144
|
+
}
|
|
145
|
+
has(e) {
|
|
146
|
+
return this.pages.has(this.resolve(e));
|
|
147
|
+
}
|
|
148
|
+
get(e) {
|
|
149
|
+
let t = this.pages.get(this.resolve(e));
|
|
150
|
+
return t && i({}, t);
|
|
151
|
+
}
|
|
152
|
+
set(e, t) {
|
|
153
|
+
t = i({}, t, { url: e = this.resolve(e) }), this.pages.set(e, t), this.swup.hooks.callSync("cache:set", void 0, { page: t });
|
|
154
|
+
}
|
|
155
|
+
update(e, t) {
|
|
156
|
+
e = this.resolve(e);
|
|
157
|
+
let n = i({}, this.get(e), t, { url: e });
|
|
158
|
+
this.pages.set(e, n);
|
|
159
|
+
}
|
|
160
|
+
delete(e) {
|
|
161
|
+
this.pages.delete(this.resolve(e));
|
|
162
|
+
}
|
|
163
|
+
clear() {
|
|
164
|
+
this.pages.clear(), this.swup.hooks.callSync("cache:clear", void 0, void 0);
|
|
165
|
+
}
|
|
166
|
+
prune(e) {
|
|
167
|
+
this.pages.forEach((t, n) => {
|
|
168
|
+
e(n, t) && this.delete(n);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
resolve(e) {
|
|
172
|
+
let { url: t } = u.fromUrl(e);
|
|
173
|
+
return this.swup.resolveUrl(t);
|
|
174
|
+
}
|
|
175
|
+
}, m = (e, t = document) => t.querySelector(e), h = (e, t = document) => Array.from(t.querySelectorAll(e)), g = () => new Promise((e) => {
|
|
176
|
+
requestAnimationFrame(() => {
|
|
177
|
+
requestAnimationFrame(() => {
|
|
178
|
+
e();
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
function _(e) {
|
|
183
|
+
return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
184
|
+
}
|
|
185
|
+
function v(e, t = []) {
|
|
186
|
+
return new Promise((n, r) => {
|
|
187
|
+
let i = e(...t);
|
|
188
|
+
_(i) ? i.then(n, r) : n(i);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
function y(e, t) {
|
|
192
|
+
let n = e?.closest(`[${t}]`);
|
|
193
|
+
return n != null && n.hasAttribute(t) ? n?.getAttribute(t) || !0 : void 0;
|
|
194
|
+
}
|
|
195
|
+
var b = class {
|
|
196
|
+
constructor(e) {
|
|
197
|
+
this.swup = void 0, this.swupClasses = [
|
|
198
|
+
"to-",
|
|
199
|
+
"is-changing",
|
|
200
|
+
"is-rendering",
|
|
201
|
+
"is-popstate",
|
|
202
|
+
"is-animating",
|
|
203
|
+
"is-leaving"
|
|
204
|
+
], this.swup = e;
|
|
205
|
+
}
|
|
206
|
+
get selectors() {
|
|
207
|
+
let { scope: e } = this.swup.visit.animation;
|
|
208
|
+
return e === "containers" ? this.swup.visit.containers : e === "html" ? ["html"] : Array.isArray(e) ? e : [];
|
|
209
|
+
}
|
|
210
|
+
get selector() {
|
|
211
|
+
return this.selectors.join(",");
|
|
212
|
+
}
|
|
213
|
+
get targets() {
|
|
214
|
+
return this.selector.trim() ? h(this.selector) : [];
|
|
215
|
+
}
|
|
216
|
+
add(...e) {
|
|
217
|
+
this.targets.forEach((t) => t.classList.add(...e));
|
|
218
|
+
}
|
|
219
|
+
remove(...e) {
|
|
220
|
+
this.targets.forEach((t) => t.classList.remove(...e));
|
|
221
|
+
}
|
|
222
|
+
clear() {
|
|
223
|
+
this.targets.forEach((e) => {
|
|
224
|
+
let t = e.className.split(" ").filter((e) => this.isSwupClass(e));
|
|
225
|
+
e.classList.remove(...t);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
isSwupClass(e) {
|
|
229
|
+
return this.swupClasses.some((t) => e.startsWith(t));
|
|
230
|
+
}
|
|
231
|
+
}, x = class {
|
|
232
|
+
constructor(e, t) {
|
|
233
|
+
this.id = void 0, this.state = void 0, this.from = void 0, this.to = void 0, this.containers = void 0, this.animation = void 0, this.trigger = void 0, this.cache = void 0, this.history = void 0, this.scroll = void 0, this.meta = void 0;
|
|
234
|
+
let { to: n, from: r, hash: i, el: a, event: o } = t;
|
|
235
|
+
this.id = Math.random(), this.state = 1, this.from = {
|
|
236
|
+
url: r ?? e.location.url,
|
|
237
|
+
hash: e.location.hash
|
|
238
|
+
}, this.to = {
|
|
239
|
+
url: n,
|
|
240
|
+
hash: i
|
|
241
|
+
}, this.containers = e.options.containers, this.animation = {
|
|
242
|
+
animate: !0,
|
|
243
|
+
wait: !1,
|
|
244
|
+
name: void 0,
|
|
245
|
+
native: e.options.native,
|
|
246
|
+
scope: e.options.animationScope,
|
|
247
|
+
selector: e.options.animationSelector
|
|
248
|
+
}, this.trigger = {
|
|
249
|
+
el: a,
|
|
250
|
+
event: o
|
|
251
|
+
}, this.cache = {
|
|
252
|
+
read: e.options.cache,
|
|
253
|
+
write: e.options.cache
|
|
254
|
+
}, this.history = {
|
|
255
|
+
action: "push",
|
|
256
|
+
popstate: !1,
|
|
257
|
+
direction: void 0
|
|
258
|
+
}, this.scroll = {
|
|
259
|
+
reset: !0,
|
|
260
|
+
target: void 0
|
|
261
|
+
}, this.meta = {};
|
|
262
|
+
}
|
|
263
|
+
advance(e) {
|
|
264
|
+
this.state < e && (this.state = e);
|
|
265
|
+
}
|
|
266
|
+
abort() {
|
|
267
|
+
this.state = 8;
|
|
268
|
+
}
|
|
269
|
+
ignore() {
|
|
270
|
+
this.state = 10;
|
|
271
|
+
}
|
|
272
|
+
get done() {
|
|
273
|
+
return this.state >= 7;
|
|
274
|
+
}
|
|
275
|
+
get ignored() {
|
|
276
|
+
return this.state === 10;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
function S(e) {
|
|
280
|
+
return new x(this, e);
|
|
281
|
+
}
|
|
282
|
+
var C = class {
|
|
283
|
+
constructor(e) {
|
|
284
|
+
this.swup = void 0, this.registry = /* @__PURE__ */ new Map(), this.hooks = /* @__PURE__ */ "animation:out:start.animation:out:await.animation:out:end.animation:in:start.animation:in:await.animation:in:end.animation:skip.cache:clear.cache:set.content:replace.content:scroll.enable.disable.fetch:request.fetch:error.fetch:timeout.history:popstate.link:click.link:self.link:anchor.link:newtab.page:load.page:view.scroll:top.scroll:anchor.visit:start.visit:transition.visit:abort.visit:end".split("."), this.nextHookId = 0, this.swup = e, this.init();
|
|
285
|
+
}
|
|
286
|
+
init() {
|
|
287
|
+
this.hooks.forEach((e) => this.create(e));
|
|
288
|
+
}
|
|
289
|
+
create(e) {
|
|
290
|
+
this.registry.has(e) || this.registry.set(e, /* @__PURE__ */ new Map());
|
|
291
|
+
}
|
|
292
|
+
exists(e) {
|
|
293
|
+
return this.registry.has(e);
|
|
294
|
+
}
|
|
295
|
+
get(e) {
|
|
296
|
+
let t = this.registry.get(e);
|
|
297
|
+
if (t) return t;
|
|
298
|
+
console.error(`Unknown hook '${e}'`);
|
|
299
|
+
}
|
|
300
|
+
clear() {
|
|
301
|
+
this.registry.forEach((e) => e.clear());
|
|
302
|
+
}
|
|
303
|
+
on(e, t, n = {}) {
|
|
304
|
+
let r = this.get(e);
|
|
305
|
+
if (!r) return console.warn(`Hook '${e}' not found.`), () => {};
|
|
306
|
+
let a = i({}, n, {
|
|
307
|
+
id: ++this.nextHookId,
|
|
308
|
+
hook: e,
|
|
309
|
+
handler: t
|
|
310
|
+
});
|
|
311
|
+
return r.set(t, a), () => this.off(e, t);
|
|
312
|
+
}
|
|
313
|
+
before(e, t, n = {}) {
|
|
314
|
+
return this.on(e, t, i({}, n, { before: !0 }));
|
|
315
|
+
}
|
|
316
|
+
replace(e, t, n = {}) {
|
|
317
|
+
return this.on(e, t, i({}, n, { replace: !0 }));
|
|
318
|
+
}
|
|
319
|
+
once(e, t, n = {}) {
|
|
320
|
+
return this.on(e, t, i({}, n, { once: !0 }));
|
|
321
|
+
}
|
|
322
|
+
off(e, t) {
|
|
323
|
+
let n = this.get(e);
|
|
324
|
+
n && t ? n.delete(t) || console.warn(`Handler for hook '${e}' not found.`) : n && n.clear();
|
|
325
|
+
}
|
|
326
|
+
async call(e, t, n, r) {
|
|
327
|
+
let [i, a, o] = this.parseCallArgs(e, t, n, r), { before: s, handler: c, after: l } = this.getHandlers(e, o);
|
|
328
|
+
await this.run(s, i, a);
|
|
329
|
+
let [u] = await this.run(c, i, a, !0);
|
|
330
|
+
return await this.run(l, i, a), this.dispatchDomEvent(e, i, a), u;
|
|
331
|
+
}
|
|
332
|
+
callSync(e, t, n, r) {
|
|
333
|
+
let [i, a, o] = this.parseCallArgs(e, t, n, r), { before: s, handler: c, after: l } = this.getHandlers(e, o);
|
|
334
|
+
this.runSync(s, i, a);
|
|
335
|
+
let [u] = this.runSync(c, i, a, !0);
|
|
336
|
+
return this.runSync(l, i, a), this.dispatchDomEvent(e, i, a), u;
|
|
337
|
+
}
|
|
338
|
+
parseCallArgs(e, t, n, r) {
|
|
339
|
+
return t instanceof x || typeof t != "object" && typeof n != "function" ? [
|
|
340
|
+
t,
|
|
341
|
+
n,
|
|
342
|
+
r
|
|
343
|
+
] : [
|
|
344
|
+
void 0,
|
|
345
|
+
t,
|
|
346
|
+
n
|
|
347
|
+
];
|
|
348
|
+
}
|
|
349
|
+
async run(e, t = this.swup.visit, n, r = !1) {
|
|
350
|
+
let i = [];
|
|
351
|
+
for (let { hook: a, handler: o, defaultHandler: s, once: c } of e) if (t == null || !t.done) {
|
|
352
|
+
c && this.off(a, o);
|
|
353
|
+
try {
|
|
354
|
+
let e = await v(o, [
|
|
355
|
+
t,
|
|
356
|
+
n,
|
|
357
|
+
s
|
|
358
|
+
]);
|
|
359
|
+
i.push(e);
|
|
360
|
+
} catch (e) {
|
|
361
|
+
if (r) throw e;
|
|
362
|
+
console.error(`Error in hook '${a}':`, e);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return i;
|
|
366
|
+
}
|
|
367
|
+
runSync(e, t = this.swup.visit, n, r = !1) {
|
|
368
|
+
let i = [];
|
|
369
|
+
for (let { hook: a, handler: o, defaultHandler: s, once: c } of e) if (t == null || !t.done) {
|
|
370
|
+
c && this.off(a, o);
|
|
371
|
+
try {
|
|
372
|
+
let e = o(t, n, s);
|
|
373
|
+
i.push(e), _(e) && console.warn(`Swup will not await Promises in handler for synchronous hook '${a}'.`);
|
|
374
|
+
} catch (e) {
|
|
375
|
+
if (r) throw e;
|
|
376
|
+
console.error(`Error in hook '${a}':`, e);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return i;
|
|
380
|
+
}
|
|
381
|
+
getHandlers(e, t) {
|
|
382
|
+
let n = this.get(e);
|
|
383
|
+
if (!n) return {
|
|
384
|
+
found: !1,
|
|
385
|
+
before: [],
|
|
386
|
+
handler: [],
|
|
387
|
+
after: [],
|
|
388
|
+
replaced: !1
|
|
389
|
+
};
|
|
390
|
+
let r = Array.from(n.values()), i = this.sortRegistrations, a = r.filter(({ before: e, replace: t }) => e && !t).sort(i), o = r.filter(({ replace: e }) => e).filter((e) => !0).sort(i), s = r.filter(({ before: e, replace: t }) => !e && !t).sort(i), c = o.length > 0, l = [];
|
|
391
|
+
if (t && (l = [{
|
|
392
|
+
id: 0,
|
|
393
|
+
hook: e,
|
|
394
|
+
handler: t
|
|
395
|
+
}], c)) {
|
|
396
|
+
let n = o.length - 1, { handler: r, once: i } = o[n], a = (e) => {
|
|
397
|
+
let n = o[e - 1];
|
|
398
|
+
return n ? (t, r) => n.handler(t, r, a(e - 1)) : t;
|
|
399
|
+
};
|
|
400
|
+
l = [{
|
|
401
|
+
id: 0,
|
|
402
|
+
hook: e,
|
|
403
|
+
once: i,
|
|
404
|
+
handler: r,
|
|
405
|
+
defaultHandler: a(n)
|
|
406
|
+
}];
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
found: !0,
|
|
410
|
+
before: a,
|
|
411
|
+
handler: l,
|
|
412
|
+
after: s,
|
|
413
|
+
replaced: c
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
sortRegistrations(e, t) {
|
|
417
|
+
return (e.priority ?? 0) - (t.priority ?? 0) || e.id - t.id || 0;
|
|
418
|
+
}
|
|
419
|
+
dispatchDomEvent(e, t, n) {
|
|
420
|
+
if (t != null && t.done) return;
|
|
421
|
+
let r = {
|
|
422
|
+
hook: e,
|
|
423
|
+
args: n,
|
|
424
|
+
visit: t || this.swup.visit
|
|
425
|
+
};
|
|
426
|
+
document.dispatchEvent(new CustomEvent("swup:any", {
|
|
427
|
+
detail: r,
|
|
428
|
+
bubbles: !0
|
|
429
|
+
})), document.dispatchEvent(new CustomEvent(`swup:${e}`, {
|
|
430
|
+
detail: r,
|
|
431
|
+
bubbles: !0
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
434
|
+
parseName(e) {
|
|
435
|
+
let [t, ...n] = e.split(".");
|
|
436
|
+
return [t, n.reduce((e, t) => i({}, e, { [t]: !0 }), {})];
|
|
437
|
+
}
|
|
438
|
+
}, w = (e) => {
|
|
439
|
+
if (e && e.charAt(0) === "#" && (e = e.substring(1)), !e) return null;
|
|
440
|
+
let t = decodeURIComponent(e), n = document.getElementById(e) || document.getElementById(t) || m(`a[name='${CSS.escape(e)}']`) || m(`a[name='${CSS.escape(t)}']`);
|
|
441
|
+
return n || e !== "top" || (n = document.body), n;
|
|
442
|
+
}, T = "transition", E = "animation";
|
|
443
|
+
async function D({ selector: e, elements: t }) {
|
|
444
|
+
if (!1 === e && !t) return;
|
|
445
|
+
let n = [];
|
|
446
|
+
if (t) n = Array.from(t);
|
|
447
|
+
else if (e && (n = h(e, document.body), !n.length)) return void console.warn(`[swup] No elements found matching animationSelector \`${e}\``);
|
|
448
|
+
let r = n.map((e) => function(e) {
|
|
449
|
+
let { type: t, timeout: n, propCount: r } = function(e) {
|
|
450
|
+
let t = window.getComputedStyle(e), n = O(t, `${T}Delay`), r = O(t, `${T}Duration`), i = k(n, r), a = O(t, `${E}Delay`), o = O(t, `${E}Duration`), s = k(a, o), c = Math.max(i, s), l = c > 0 ? i > s ? T : E : null;
|
|
451
|
+
return {
|
|
452
|
+
type: l,
|
|
453
|
+
timeout: c,
|
|
454
|
+
propCount: l ? l === T ? r.length : o.length : 0
|
|
455
|
+
};
|
|
456
|
+
}(e);
|
|
457
|
+
return !(!t || !n) && new Promise((i) => {
|
|
458
|
+
let a = `${t}end`, o = performance.now(), s = 0, c = () => {
|
|
459
|
+
e.removeEventListener(a, l), i();
|
|
460
|
+
}, l = (t) => {
|
|
461
|
+
t.target === e && ((performance.now() - o) / 1e3 < t.elapsedTime || ++s >= r && c());
|
|
462
|
+
};
|
|
463
|
+
setTimeout(() => {
|
|
464
|
+
s < r && c();
|
|
465
|
+
}, n + 1), e.addEventListener(a, l);
|
|
466
|
+
});
|
|
467
|
+
}(e)).filter((e) => !1 !== e);
|
|
468
|
+
r.length ? await Promise.all(r) : e && console.warn(`[swup] No CSS animation duration defined on elements matching \`${e}\``);
|
|
469
|
+
}
|
|
470
|
+
function O(e, t) {
|
|
471
|
+
return (e[t] || "").split(", ");
|
|
472
|
+
}
|
|
473
|
+
function k(e, t) {
|
|
474
|
+
for (; e.length < t.length;) e = e.concat(e);
|
|
475
|
+
return Math.max(...t.map((t, n) => A(t) + A(e[n])));
|
|
476
|
+
}
|
|
477
|
+
function A(e) {
|
|
478
|
+
return 1e3 * parseFloat(e);
|
|
479
|
+
}
|
|
480
|
+
function j(e, t = {}, n = {}) {
|
|
481
|
+
if (typeof e != "string") throw Error("swup.navigate() requires a URL parameter");
|
|
482
|
+
if (this.shouldIgnoreVisit(e, {
|
|
483
|
+
el: n.el,
|
|
484
|
+
event: n.event
|
|
485
|
+
})) return void window.location.assign(e);
|
|
486
|
+
let { url: r, hash: a } = u.fromUrl(e), o = this.createVisit(i({}, n, {
|
|
487
|
+
to: r,
|
|
488
|
+
hash: a
|
|
489
|
+
}));
|
|
490
|
+
this.performNavigation(o, t);
|
|
491
|
+
}
|
|
492
|
+
async function ee(e, t = {}) {
|
|
493
|
+
if (this.navigating) {
|
|
494
|
+
if (this.visit.state >= 6) return e.state = 2, void (this.onVisitEnd = () => this.performNavigation(e, t));
|
|
495
|
+
await this.hooks.call("visit:abort", this.visit, void 0), delete this.visit.to.document, this.visit.state = 8;
|
|
496
|
+
}
|
|
497
|
+
this.navigating = !0, this.visit = e;
|
|
498
|
+
let { el: n } = e.trigger;
|
|
499
|
+
t.referrer = t.referrer || this.location.url, !1 === t.animate && (e.animation.animate = !1), e.animation.animate || this.classes.clear();
|
|
500
|
+
let r = t.history || y(n, "data-swup-history");
|
|
501
|
+
typeof r == "string" && ["push", "replace"].includes(r) && (e.history.action = r);
|
|
502
|
+
let i = t.animation || y(n, "data-swup-animation");
|
|
503
|
+
typeof i == "string" && (e.animation.name = i), e.meta = t.meta || {}, typeof t.cache == "object" ? (e.cache.read = t.cache.read ?? e.cache.read, e.cache.write = t.cache.write ?? e.cache.write) : t.cache !== void 0 && (e.cache = {
|
|
504
|
+
read: !!t.cache,
|
|
505
|
+
write: !!t.cache
|
|
506
|
+
}), delete t.cache;
|
|
507
|
+
try {
|
|
508
|
+
await this.hooks.call("visit:start", e, void 0), e.state = 3;
|
|
509
|
+
let n = this.hooks.call("page:load", e, { options: t }, async (e, t) => {
|
|
510
|
+
let n;
|
|
511
|
+
return e.cache.read && (n = this.cache.get(e.to.url)), t.page = n || await this.fetchPage(e.to.url, t.options), t.cache = !!n, t.page;
|
|
512
|
+
});
|
|
513
|
+
n.then(({ html: t }) => {
|
|
514
|
+
e.advance(5), e.to.html = t, e.to.document = new DOMParser().parseFromString(t, "text/html");
|
|
515
|
+
});
|
|
516
|
+
let r = e.to.url + e.to.hash;
|
|
517
|
+
if (e.history.popstate || (e.history.action === "replace" || e.to.url === this.location.url ? c(r) : (this.currentHistoryIndex++, s(r, { index: this.currentHistoryIndex }))), this.location = u.fromUrl(r), e.history.popstate && this.classes.add("is-popstate"), e.animation.name && this.classes.add(`to-${a(e.animation.name)}`), e.animation.wait && await n, e.ignored) throw Error(`Visit to ${e.to.url} manually ignored`);
|
|
518
|
+
if (e.done || (await this.hooks.call("visit:transition", e, void 0, async () => {
|
|
519
|
+
if (!e.animation.animate) return await this.hooks.call("animation:skip", void 0), void await this.renderPage(e, await n);
|
|
520
|
+
e.advance(4), await this.animatePageOut(e), e.animation.native && document.startViewTransition ? await document.startViewTransition(async () => await this.renderPage(e, await n)).finished : await this.renderPage(e, await n), await this.animatePageIn(e);
|
|
521
|
+
}), e.done)) return;
|
|
522
|
+
await this.hooks.call("visit:end", e, void 0, () => this.classes.clear()), e.state = 7, this.navigating = !1, this.onVisitEnd &&= (this.onVisitEnd(), void 0);
|
|
523
|
+
} catch (t) {
|
|
524
|
+
if (!t || t != null && t.aborted) return void e.advance(8);
|
|
525
|
+
e.advance(9), console.error(t), this.options.skipPopStateHandling = () => (window.location.assign(e.to.url + e.to.hash), !0), window.history.back();
|
|
526
|
+
} finally {
|
|
527
|
+
delete e.to.document;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
var te = async function(e) {
|
|
531
|
+
await this.hooks.call("animation:out:start", e, void 0, () => {
|
|
532
|
+
this.classes.add("is-changing", "is-animating", "is-leaving");
|
|
533
|
+
}), await this.hooks.call("animation:out:await", e, { skip: !1 }, (e, { skip: t }) => {
|
|
534
|
+
if (!t) return this.awaitAnimations({ selector: e.animation.selector });
|
|
535
|
+
}), await this.hooks.call("animation:out:end", e, void 0);
|
|
536
|
+
}, ne = function(e) {
|
|
537
|
+
let t = e.to.document;
|
|
538
|
+
if (!t) return !1;
|
|
539
|
+
let n = t.querySelector("title")?.innerText || "";
|
|
540
|
+
document.title = n;
|
|
541
|
+
let r = h("[data-swup-persist]:not([data-swup-persist=\"\"])"), i = e.containers.map((e) => {
|
|
542
|
+
let n = document.querySelector(e), r = t.querySelector(e);
|
|
543
|
+
return n && r ? (n.replaceWith(r.cloneNode(!0)), !0) : (n || console.warn(`[swup] Container missing in current document: ${e}`), r || console.warn(`[swup] Container missing in incoming document: ${e}`), !1);
|
|
544
|
+
}).filter(Boolean);
|
|
545
|
+
return r.forEach((e) => {
|
|
546
|
+
let t = m(`[data-swup-persist="${e.getAttribute("data-swup-persist")}"]`);
|
|
547
|
+
t && t !== e && t.replaceWith(e);
|
|
548
|
+
}), i.length === e.containers.length;
|
|
549
|
+
}, re = function(e) {
|
|
550
|
+
let t = { behavior: "auto" }, { target: n, reset: r } = e.scroll, a = n ?? e.to.hash, o = !1;
|
|
551
|
+
return a && (o = this.hooks.callSync("scroll:anchor", e, {
|
|
552
|
+
hash: a,
|
|
553
|
+
options: t
|
|
554
|
+
}, (e, { hash: t, options: n }) => {
|
|
555
|
+
let r = this.getAnchorElement(t);
|
|
556
|
+
return r && r.scrollIntoView(n), !!r;
|
|
557
|
+
})), r && !o && (o = this.hooks.callSync("scroll:top", e, { options: t }, (e, { options: t }) => (window.scrollTo(i({
|
|
558
|
+
top: 0,
|
|
559
|
+
left: 0
|
|
560
|
+
}, t)), !0))), o;
|
|
561
|
+
}, ie = async function(e) {
|
|
562
|
+
if (e.done) return;
|
|
563
|
+
let t = this.hooks.call("animation:in:await", e, { skip: !1 }, (e, { skip: t }) => {
|
|
564
|
+
if (!t) return this.awaitAnimations({ selector: e.animation.selector });
|
|
565
|
+
});
|
|
566
|
+
await g(), await this.hooks.call("animation:in:start", e, void 0, () => {
|
|
567
|
+
this.classes.remove("is-animating");
|
|
568
|
+
}), await t, await this.hooks.call("animation:in:end", e, void 0);
|
|
569
|
+
}, ae = async function(e, t) {
|
|
570
|
+
if (e.done) return;
|
|
571
|
+
e.advance(6);
|
|
572
|
+
let { url: n } = t;
|
|
573
|
+
this.isSameResolvedUrl(o(), n) || (c(n), this.location = u.fromUrl(n), e.to.url = this.location.url, e.to.hash = this.location.hash), await this.hooks.call("content:replace", e, { page: t }, (e, {}) => {
|
|
574
|
+
if (this.classes.remove("is-leaving"), e.animation.animate && this.classes.add("is-rendering"), !this.replaceContent(e)) throw Error("[swup] Container mismatch, aborting");
|
|
575
|
+
e.animation.animate && (this.classes.add("is-changing", "is-animating", "is-rendering"), e.animation.name && this.classes.add(`to-${a(e.animation.name)}`));
|
|
576
|
+
}), await this.hooks.call("content:scroll", e, void 0, () => this.scrollToContent(e)), await this.hooks.call("page:view", e, {
|
|
577
|
+
url: this.location.url,
|
|
578
|
+
title: document.title
|
|
579
|
+
});
|
|
580
|
+
}, oe = function(e) {
|
|
581
|
+
var t;
|
|
582
|
+
if (t = e, t?.isSwupPlugin) {
|
|
583
|
+
if (e.swup = this, !e._checkRequirements || e._checkRequirements()) return e._beforeMount && e._beforeMount(), e.mount(), this.plugins.push(e), this.plugins;
|
|
584
|
+
} else console.error("Not a swup plugin instance", e);
|
|
585
|
+
};
|
|
586
|
+
function M(e) {
|
|
587
|
+
let t = this.findPlugin(e);
|
|
588
|
+
if (t) return t.unmount(), t._afterUnmount && t._afterUnmount(), this.plugins = this.plugins.filter((e) => e !== t), this.plugins;
|
|
589
|
+
console.error("No such plugin", t);
|
|
590
|
+
}
|
|
591
|
+
function N(e) {
|
|
592
|
+
return this.plugins.find((t) => typeof e == "string" ? [`Swup${e}`, e].includes(t.name) : t === e);
|
|
593
|
+
}
|
|
594
|
+
function P(e) {
|
|
595
|
+
if (typeof this.options.resolveUrl != "function") return console.warn("[swup] options.resolveUrl expects a callback function."), e;
|
|
596
|
+
let t = this.options.resolveUrl(e);
|
|
597
|
+
return t && typeof t == "string" ? t.startsWith("//") || t.startsWith("http") ? (console.warn("[swup] options.resolveUrl needs to return a relative url"), e) : t : (console.warn("[swup] options.resolveUrl needs to return a url"), e);
|
|
598
|
+
}
|
|
599
|
+
function F(e, t) {
|
|
600
|
+
return this.resolveUrl(e) === this.resolveUrl(t);
|
|
601
|
+
}
|
|
602
|
+
var I = {
|
|
603
|
+
animateHistoryBrowsing: !1,
|
|
604
|
+
animationSelector: "[class*=\"transition-\"]",
|
|
605
|
+
animationScope: "html",
|
|
606
|
+
cache: !0,
|
|
607
|
+
containers: ["#swup"],
|
|
608
|
+
hooks: {},
|
|
609
|
+
ignoreVisit: (e, { el: t } = {}) => !(t == null || !t.closest("[data-no-swup]")),
|
|
610
|
+
linkSelector: "a[href]",
|
|
611
|
+
linkToSelf: "scroll",
|
|
612
|
+
native: !1,
|
|
613
|
+
plugins: [],
|
|
614
|
+
resolveUrl: (e) => e,
|
|
615
|
+
requestHeaders: {
|
|
616
|
+
"X-Requested-With": "swup",
|
|
617
|
+
Accept: "text/html, application/xhtml+xml"
|
|
618
|
+
},
|
|
619
|
+
skipPopStateHandling: (e) => e.state?.source !== "swup",
|
|
620
|
+
timeout: 0
|
|
621
|
+
}, L = class {
|
|
622
|
+
get currentPageUrl() {
|
|
623
|
+
return this.location.url;
|
|
624
|
+
}
|
|
625
|
+
constructor(e = {}) {
|
|
626
|
+
this.version = "4.9.2", this.options = void 0, this.defaults = I, this.plugins = [], this.visit = void 0, this.cache = void 0, this.hooks = void 0, this.classes = void 0, this.location = u.fromUrl(window.location.href), this.currentHistoryIndex = void 0, this.clickDelegate = void 0, this.navigating = !1, this.onVisitEnd = void 0, this.use = oe, this.unuse = M, this.findPlugin = N, this.log = () => {}, this.navigate = j, this.performNavigation = ee, this.createVisit = S, this.delegateEvent = l, this.fetchPage = f, this.awaitAnimations = D, this.renderPage = ae, this.replaceContent = ne, this.animatePageIn = ie, this.animatePageOut = te, this.scrollToContent = re, this.getAnchorElement = w, this.getCurrentUrl = o, this.resolveUrl = P, this.isSameResolvedUrl = F, this.options = i({}, this.defaults, e), this.handleLinkClick = this.handleLinkClick.bind(this), this.handlePopState = this.handlePopState.bind(this), this.cache = new p(this), this.classes = new b(this), this.hooks = new C(this), this.visit = this.createVisit({ to: "" }), this.currentHistoryIndex = window.history.state?.index ?? 1, this.enable();
|
|
627
|
+
}
|
|
628
|
+
async enable() {
|
|
629
|
+
let { linkSelector: e } = this.options;
|
|
630
|
+
this.clickDelegate = this.delegateEvent(e, "click", this.handleLinkClick), window.addEventListener("popstate", this.handlePopState), this.options.animateHistoryBrowsing && (window.history.scrollRestoration = "manual"), this.options.native = this.options.native && !!document.startViewTransition, this.options.plugins.forEach((e) => this.use(e));
|
|
631
|
+
for (let [e, t] of Object.entries(this.options.hooks)) {
|
|
632
|
+
let [n, r] = this.hooks.parseName(e);
|
|
633
|
+
this.hooks.on(n, t, r);
|
|
634
|
+
}
|
|
635
|
+
window.history.state?.source !== "swup" && c(null, { index: this.currentHistoryIndex }), await g(), await this.hooks.call("enable", void 0, void 0, () => {
|
|
636
|
+
let e = document.documentElement;
|
|
637
|
+
e.classList.add("swup-enabled"), e.classList.toggle("swup-native", this.options.native);
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
async destroy() {
|
|
641
|
+
this.clickDelegate.destroy(), window.removeEventListener("popstate", this.handlePopState), this.cache.clear(), this.plugins.forEach((e) => this.unuse(e)), await this.hooks.call("disable", void 0, void 0, () => {
|
|
642
|
+
let e = document.documentElement;
|
|
643
|
+
e.classList.remove("swup-enabled"), e.classList.remove("swup-native");
|
|
644
|
+
}), this.hooks.clear();
|
|
645
|
+
}
|
|
646
|
+
shouldIgnoreVisit(e, { el: t, event: n } = {}) {
|
|
647
|
+
let { origin: r, url: i, hash: a } = u.fromUrl(e);
|
|
648
|
+
return r !== window.location.origin || !(!t || !this.triggerWillOpenNewWindow(t)) || !!this.options.ignoreVisit(i + a, {
|
|
649
|
+
el: t,
|
|
650
|
+
event: n
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
handleLinkClick(e) {
|
|
654
|
+
let t = e.delegateTarget, { href: n, url: r, hash: i } = u.fromElement(t);
|
|
655
|
+
if (this.shouldIgnoreVisit(n, {
|
|
656
|
+
el: t,
|
|
657
|
+
event: e
|
|
658
|
+
})) return;
|
|
659
|
+
if (this.navigating && r === this.visit.to.url) return void e.preventDefault();
|
|
660
|
+
let a = this.createVisit({
|
|
661
|
+
to: r,
|
|
662
|
+
hash: i,
|
|
663
|
+
el: t,
|
|
664
|
+
event: e
|
|
665
|
+
});
|
|
666
|
+
e.metaKey || e.ctrlKey || e.shiftKey || e.altKey ? this.hooks.callSync("link:newtab", a, { href: n }) : e.button === 0 && this.hooks.callSync("link:click", a, {
|
|
667
|
+
el: t,
|
|
668
|
+
event: e
|
|
669
|
+
}, () => {
|
|
670
|
+
let t = a.from.url ?? "";
|
|
671
|
+
e.preventDefault(), r && r !== t ? this.isSameResolvedUrl(r, t) || this.performNavigation(a) : i ? this.hooks.callSync("link:anchor", a, { hash: i }, () => {
|
|
672
|
+
c(r + i), this.scrollToContent(a);
|
|
673
|
+
}) : this.hooks.callSync("link:self", a, void 0, () => {
|
|
674
|
+
this.options.linkToSelf === "navigate" ? this.performNavigation(a) : (c(r), this.scrollToContent(a));
|
|
675
|
+
});
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
handlePopState(e) {
|
|
679
|
+
let t = e.state?.url ?? window.location.href;
|
|
680
|
+
if (this.options.skipPopStateHandling(e) || this.isSameResolvedUrl(o(), this.location.url)) return;
|
|
681
|
+
let { url: n, hash: r } = u.fromUrl(t), i = this.createVisit({
|
|
682
|
+
to: n,
|
|
683
|
+
hash: r,
|
|
684
|
+
event: e
|
|
685
|
+
});
|
|
686
|
+
i.history.popstate = !0;
|
|
687
|
+
let a = e.state?.index ?? 0;
|
|
688
|
+
a && a !== this.currentHistoryIndex && (i.history.direction = a - this.currentHistoryIndex > 0 ? "forwards" : "backwards", this.currentHistoryIndex = a), i.animation.animate = !1, i.scroll.reset = !1, i.scroll.target = !1, this.options.animateHistoryBrowsing && (i.animation.animate = !0, i.scroll.reset = !0), this.hooks.callSync("history:popstate", i, { event: e }, () => {
|
|
689
|
+
this.performNavigation(i);
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
triggerWillOpenNewWindow(e) {
|
|
693
|
+
return !!e.matches("[download], [target=\"_blank\"]");
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region node_modules/@swup/plugin/dist/index.modern.js
|
|
698
|
+
function R() {
|
|
699
|
+
return R = Object.assign ? Object.assign.bind() : function(e) {
|
|
700
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
701
|
+
var n = arguments[t];
|
|
702
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
703
|
+
}
|
|
704
|
+
return e;
|
|
705
|
+
}, R.apply(this, arguments);
|
|
706
|
+
}
|
|
707
|
+
var z = (e) => String(e).split(".").map((e) => String(parseInt(e || "0", 10))).concat(["0", "0"]).slice(0, 3).join("."), B = class {
|
|
708
|
+
constructor() {
|
|
709
|
+
this.isSwupPlugin = !0, this.swup = void 0, this.version = void 0, this.requires = {}, this.handlersToUnregister = [];
|
|
710
|
+
}
|
|
711
|
+
mount() {}
|
|
712
|
+
unmount() {
|
|
713
|
+
this.handlersToUnregister.forEach((e) => e()), this.handlersToUnregister = [];
|
|
714
|
+
}
|
|
715
|
+
_beforeMount() {
|
|
716
|
+
if (!this.name) throw Error("You must define a name of plugin when creating a class.");
|
|
717
|
+
}
|
|
718
|
+
_afterUnmount() {}
|
|
719
|
+
_checkRequirements() {
|
|
720
|
+
return typeof this.requires != "object" || Object.entries(this.requires).forEach(([e, t]) => {
|
|
721
|
+
if (!function(e, t, n) {
|
|
722
|
+
let r = function(e, t) {
|
|
723
|
+
return e === "swup" ? t.version ?? "" : t.findPlugin(e)?.version ?? "";
|
|
724
|
+
}(e, n);
|
|
725
|
+
return !!r && ((e, t) => t.every((t) => {
|
|
726
|
+
let [, n, r] = t.match(/^([\D]+)?(.*)$/) || [];
|
|
727
|
+
var i, a;
|
|
728
|
+
return ((e, t) => {
|
|
729
|
+
let n = {
|
|
730
|
+
"": (e) => e === 0,
|
|
731
|
+
">": (e) => e > 0,
|
|
732
|
+
">=": (e) => e >= 0,
|
|
733
|
+
"<": (e) => e < 0,
|
|
734
|
+
"<=": (e) => e <= 0
|
|
735
|
+
};
|
|
736
|
+
return (n[t] || n[""])(e);
|
|
737
|
+
})((a = r, i = z(i = e), a = z(a), i.localeCompare(a, void 0, { numeric: !0 })), n || ">=");
|
|
738
|
+
}))(r, t);
|
|
739
|
+
}(e, t = Array.isArray(t) ? t : [t], this.swup)) {
|
|
740
|
+
let n = `${e} ${t.join(", ")}`;
|
|
741
|
+
throw Error(`Plugin version mismatch: ${this.name} requires ${n}`);
|
|
742
|
+
}
|
|
743
|
+
}), !0;
|
|
744
|
+
}
|
|
745
|
+
on(e, t, n = {}) {
|
|
746
|
+
var r;
|
|
747
|
+
t = !(r = t).name.startsWith("bound ") || r.hasOwnProperty("prototype") ? t.bind(this) : t;
|
|
748
|
+
let i = this.swup.hooks.on(e, t, n);
|
|
749
|
+
return this.handlersToUnregister.push(i), i;
|
|
750
|
+
}
|
|
751
|
+
once(e, t, n = {}) {
|
|
752
|
+
return this.on(e, t, R({}, n, { once: !0 }));
|
|
753
|
+
}
|
|
754
|
+
before(e, t, n = {}) {
|
|
755
|
+
return this.on(e, t, R({}, n, { before: !0 }));
|
|
756
|
+
}
|
|
757
|
+
replace(e, t, n = {}) {
|
|
758
|
+
return this.on(e, t, R({}, n, { replace: !0 }));
|
|
759
|
+
}
|
|
760
|
+
off(e, t) {
|
|
761
|
+
return this.swup.hooks.off(e, t);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region node_modules/focus-options-polyfill/index.js
|
|
766
|
+
(function() {
|
|
767
|
+
if (!(typeof window > "u" || typeof document > "u" || typeof HTMLElement > "u")) {
|
|
768
|
+
var e = !1;
|
|
769
|
+
try {
|
|
770
|
+
var t = document.createElement("div");
|
|
771
|
+
t.addEventListener("focus", function(e) {
|
|
772
|
+
e.preventDefault(), e.stopPropagation();
|
|
773
|
+
}, !0), t.focus(Object.defineProperty({}, "preventScroll", { get: function() {
|
|
774
|
+
if (navigator && navigator.userAgent !== void 0 && navigator.userAgent && navigator.userAgent.match(/Edge\/1[7-8]/)) return e = !1;
|
|
775
|
+
e = !0;
|
|
776
|
+
} }));
|
|
777
|
+
} catch {}
|
|
778
|
+
if (HTMLElement.prototype.nativeFocus === void 0 && !e) {
|
|
779
|
+
HTMLElement.prototype.nativeFocus = HTMLElement.prototype.focus;
|
|
780
|
+
var n = function(e) {
|
|
781
|
+
for (var t = e.parentNode, n = [], r = document.scrollingElement || document.documentElement; t && t !== r;) (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && n.push([
|
|
782
|
+
t,
|
|
783
|
+
t.scrollTop,
|
|
784
|
+
t.scrollLeft
|
|
785
|
+
]), t = t.parentNode;
|
|
786
|
+
return t = r, n.push([
|
|
787
|
+
t,
|
|
788
|
+
t.scrollTop,
|
|
789
|
+
t.scrollLeft
|
|
790
|
+
]), n;
|
|
791
|
+
}, r = function(e) {
|
|
792
|
+
for (var t = 0; t < e.length; t++) e[t][0].scrollTop = e[t][1], e[t][0].scrollLeft = e[t][2];
|
|
793
|
+
e = [];
|
|
794
|
+
}, i = function(e) {
|
|
795
|
+
if (e && e.preventScroll) {
|
|
796
|
+
var t = n(this);
|
|
797
|
+
if (typeof setTimeout == "function") {
|
|
798
|
+
var i = this;
|
|
799
|
+
setTimeout(function() {
|
|
800
|
+
i.nativeFocus(), r(t);
|
|
801
|
+
}, 0);
|
|
802
|
+
} else this.nativeFocus(), r(t);
|
|
803
|
+
} else this.nativeFocus();
|
|
804
|
+
};
|
|
805
|
+
HTMLElement.prototype.focus = i;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
})();
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region node_modules/@swup/a11y-plugin/dist/index.modern.js
|
|
811
|
+
function V() {
|
|
812
|
+
return V = Object.assign ? Object.assign.bind() : function(e) {
|
|
813
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
814
|
+
var n = arguments[t];
|
|
815
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
816
|
+
}
|
|
817
|
+
return e;
|
|
818
|
+
}, V.apply(this, arguments);
|
|
819
|
+
}
|
|
820
|
+
function H(e, t) {
|
|
821
|
+
return Object.keys(t).reduce((e, n) => e.replace(`{${n}}`, t[n] || ""), e || "");
|
|
822
|
+
}
|
|
823
|
+
var U = class {
|
|
824
|
+
constructor() {
|
|
825
|
+
this.id = "swup-announcer", this.style = "position:absolute;top:0;left:0;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap;word-wrap:normal;width:1px;height:1px;", this.region = void 0, this.region = this.getRegion() ?? this.createRegion();
|
|
826
|
+
}
|
|
827
|
+
getRegion() {
|
|
828
|
+
return document.getElementById(this.id);
|
|
829
|
+
}
|
|
830
|
+
createRegion() {
|
|
831
|
+
let e = function(e) {
|
|
832
|
+
let t = document.createElement("template");
|
|
833
|
+
return t.innerHTML = e, t.content.children[0];
|
|
834
|
+
}(`<p aria-live="assertive" aria-atomic="true" id="${this.id}" style="${this.style}"></p>`);
|
|
835
|
+
return document.body.appendChild(e), e;
|
|
836
|
+
}
|
|
837
|
+
announce(e, t = 0) {
|
|
838
|
+
return new Promise((n) => {
|
|
839
|
+
setTimeout(() => {
|
|
840
|
+
this.region.textContent === e && (e = `${e}.`), this.region.textContent = "", this.region.textContent = e, n();
|
|
841
|
+
}, t);
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
function W(e) {
|
|
846
|
+
let t;
|
|
847
|
+
if (t = typeof e == "string" ? document.querySelector(e) : e, !(t instanceof HTMLElement)) return;
|
|
848
|
+
let n = t.getAttribute("tabindex");
|
|
849
|
+
t.setAttribute("tabindex", "-1"), t.focus({ preventScroll: !0 }), n !== null && t.setAttribute("tabindex", n);
|
|
850
|
+
}
|
|
851
|
+
var G = class extends B {
|
|
852
|
+
constructor(e = {}) {
|
|
853
|
+
super(), this.name = "SwupA11yPlugin", this.requires = { swup: ">=4" }, this.defaults = {
|
|
854
|
+
headingSelector: ["main h1", "h1"],
|
|
855
|
+
respectReducedMotion: !0,
|
|
856
|
+
autofocus: !1,
|
|
857
|
+
announcements: {
|
|
858
|
+
visit: "Navigated to: {title}",
|
|
859
|
+
url: "New page at {url}"
|
|
860
|
+
}
|
|
861
|
+
}, this.options = void 0, this.announcer = void 0, this.announcementDelay = 100, this.rootSelector = "body", this.handleAnchorScroll = (e, { hash: t }) => {
|
|
862
|
+
let n = this.swup.getAnchorElement(t);
|
|
863
|
+
n instanceof HTMLElement && W(n);
|
|
864
|
+
}, this.options = V({}, this.defaults, e), this.announcer = new U();
|
|
865
|
+
}
|
|
866
|
+
mount() {
|
|
867
|
+
this.swup.hooks.create("content:announce"), this.swup.hooks.create("content:focus"), this.before("visit:start", this.prepareVisit), this.on("visit:start", this.markAsBusy), this.on("visit:end", this.unmarkAsBusy), this.on("content:replace", this.maybeFocusEarly), this.on("visit:end", this.maybeFocusLate), this.on("visit:end", this.announceContent), this.on("scroll:anchor", this.handleAnchorScroll), this.before("visit:start", this.disableAnimations), this.before("link:self", this.disableAnimations), this.before("link:anchor", this.disableAnimations), this.swup.announce = this.announce.bind(this);
|
|
868
|
+
}
|
|
869
|
+
unmount() {
|
|
870
|
+
this.swup.announce = void 0;
|
|
871
|
+
}
|
|
872
|
+
async announce(e) {
|
|
873
|
+
await this.announcer.announce(e);
|
|
874
|
+
}
|
|
875
|
+
markAsBusy() {
|
|
876
|
+
document.documentElement.setAttribute("aria-busy", "true");
|
|
877
|
+
}
|
|
878
|
+
unmarkAsBusy() {
|
|
879
|
+
document.documentElement.removeAttribute("aria-busy");
|
|
880
|
+
}
|
|
881
|
+
prepareVisit(e) {
|
|
882
|
+
e.a11y = {
|
|
883
|
+
announce: void 0,
|
|
884
|
+
focus: {
|
|
885
|
+
selector: this.rootSelector,
|
|
886
|
+
wait: !0
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
announceContent(e) {
|
|
891
|
+
this.swup.hooks.callSync("content:announce", e, void 0, (e) => {
|
|
892
|
+
e.a11y.announce === void 0 && (e.a11y.announce = this.getPageAnnouncement()), e.a11y.announce && this.announcer.announce(e.a11y.announce, this.announcementDelay);
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
maybeFocusEarly(e) {
|
|
896
|
+
let t = this.parseVisitFocus(e.a11y.focus);
|
|
897
|
+
t && !t.wait && this.focusContent(e);
|
|
898
|
+
}
|
|
899
|
+
maybeFocusLate(e) {
|
|
900
|
+
let t = this.parseVisitFocus(e.a11y.focus);
|
|
901
|
+
t && t.wait && this.focusContent(e);
|
|
902
|
+
}
|
|
903
|
+
focusContent(e) {
|
|
904
|
+
this.swup.hooks.callSync("content:focus", e, void 0, (e) => {
|
|
905
|
+
let t = this.parseVisitFocus(e.a11y.focus);
|
|
906
|
+
t && (this.options.autofocus && !0 === function() {
|
|
907
|
+
let e = function() {
|
|
908
|
+
let e = document.querySelector("body [autofocus]");
|
|
909
|
+
if (e && !e.closest("[inert], [aria-disabled], [aria-hidden=\"true\"]")) return e;
|
|
910
|
+
}();
|
|
911
|
+
return !!e && (e !== document.activeElement && e.focus(), !0);
|
|
912
|
+
}() || W(t.selector));
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
parseVisitFocus(e) {
|
|
916
|
+
if (!e) return !1;
|
|
917
|
+
let t = typeof e == "string" ? {
|
|
918
|
+
selector: e,
|
|
919
|
+
wait: !0
|
|
920
|
+
} : e;
|
|
921
|
+
return !!t.selector && t;
|
|
922
|
+
}
|
|
923
|
+
getPageAnnouncement() {
|
|
924
|
+
let { headingSelector: e, announcements: t } = this.options;
|
|
925
|
+
return function({ headingSelector: e = "h1", announcements: t = {} }) {
|
|
926
|
+
let n = document.documentElement.lang || "*", { href: r, url: i, pathname: a } = u.fromUrl(window.location.href), o = t[n] ?? t["*"] ?? t;
|
|
927
|
+
if (typeof o != "object") return;
|
|
928
|
+
let s = Array.isArray(e) ? e : [e], c = s.reduce((e, t) => e ?? document.querySelector(t), null);
|
|
929
|
+
c || console.warn(`SwupA11yPlugin: No main heading (${s.join(" / ")}) found on new page`);
|
|
930
|
+
let l = c?.getAttribute("aria-label") || c?.textContent || document.title || H(o.url, {
|
|
931
|
+
href: r,
|
|
932
|
+
url: i,
|
|
933
|
+
path: a
|
|
934
|
+
});
|
|
935
|
+
return H(o.visit, {
|
|
936
|
+
title: l,
|
|
937
|
+
href: r,
|
|
938
|
+
url: i,
|
|
939
|
+
path: a
|
|
940
|
+
});
|
|
941
|
+
}({
|
|
942
|
+
headingSelector: e,
|
|
943
|
+
announcements: t
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
disableAnimations(e) {
|
|
947
|
+
this.options.respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches && (e.animation.animate = !1, e.scroll.animate = !1);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
//#endregion
|
|
951
|
+
//#region node_modules/@swup/head-plugin/dist/index.modern.js
|
|
952
|
+
function K() {
|
|
953
|
+
return K = Object.assign ? Object.assign.bind() : function(e) {
|
|
954
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
955
|
+
var n = arguments[t];
|
|
956
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
957
|
+
}
|
|
958
|
+
return e;
|
|
959
|
+
}, K.apply(null, arguments);
|
|
960
|
+
}
|
|
961
|
+
function q(e) {
|
|
962
|
+
return e.localName !== "title" && !e.matches("[data-swup-theme]");
|
|
963
|
+
}
|
|
964
|
+
function J(e, t) {
|
|
965
|
+
return e.outerHTML === t.outerHTML;
|
|
966
|
+
}
|
|
967
|
+
function Y(e, t = []) {
|
|
968
|
+
let n = Array.from(e.attributes);
|
|
969
|
+
return t.length ? n.filter(({ name: e }) => t.some((t) => t instanceof RegExp ? t.test(e) : e === t)) : n;
|
|
970
|
+
}
|
|
971
|
+
function se(e) {
|
|
972
|
+
return e.matches("link[rel=stylesheet][href]");
|
|
973
|
+
}
|
|
974
|
+
var ce = class extends B {
|
|
975
|
+
constructor(e = {}) {
|
|
976
|
+
var t;
|
|
977
|
+
super(), t = this, this.name = "SwupHeadPlugin", this.requires = { swup: ">=4.6" }, this.defaults = {
|
|
978
|
+
persistTags: !1,
|
|
979
|
+
persistAssets: !1,
|
|
980
|
+
awaitAssets: !1,
|
|
981
|
+
attributes: ["lang", "dir"],
|
|
982
|
+
timeout: 3e3
|
|
983
|
+
}, this.options = void 0, this.updateHead = async function(e, { page: {} }) {
|
|
984
|
+
let { awaitAssets: n, attributes: r, timeout: i } = t.options, a = e.to.document, { removed: o, added: s } = function(e, t, { shouldPersist: n = () => !1 } = {}) {
|
|
985
|
+
let r = Array.from(e.children), i = Array.from(t.children), a = (o = r, i.reduce((e, t, n) => (o.some((e) => J(t, e)) || e.push({
|
|
986
|
+
el: t,
|
|
987
|
+
index: n
|
|
988
|
+
}), e), []));
|
|
989
|
+
var o;
|
|
990
|
+
let s = function(e, t) {
|
|
991
|
+
return e.reduce((e, n) => (t.some((e) => J(n, e)) || e.push({ el: n }), e), []);
|
|
992
|
+
}(r, i);
|
|
993
|
+
s.reverse().filter(({ el: e }) => q(e)).filter(({ el: e }) => !n(e)).forEach(({ el: t }) => e.removeChild(t));
|
|
994
|
+
let c = a.filter(({ el: e }) => q(e)).map((t) => {
|
|
995
|
+
let n = t.el.cloneNode(!0);
|
|
996
|
+
return e.insertBefore(n, e.children[(t.index || 0) + 1] || null), K({}, t, { el: n });
|
|
997
|
+
});
|
|
998
|
+
return {
|
|
999
|
+
removed: s.map(({ el: e }) => e),
|
|
1000
|
+
added: c.map(({ el: e }) => e)
|
|
1001
|
+
};
|
|
1002
|
+
}(document.head, a.head, { shouldPersist: (e) => t.isPersistentTag(e) });
|
|
1003
|
+
if (t.swup.log(`Removed ${o.length} / added ${s.length} tags in head`), r != null && r.length && function(e, t, n = []) {
|
|
1004
|
+
let r = /* @__PURE__ */ new Set();
|
|
1005
|
+
for (let { name: i, value: a } of Y(t, n)) e.setAttribute(i, a), r.add(i);
|
|
1006
|
+
for (let { name: t } of Y(e, n)) r.has(t) || e.removeAttribute(t);
|
|
1007
|
+
}(document.documentElement, a.documentElement, r), n) {
|
|
1008
|
+
let e = function(e, t = 0) {
|
|
1009
|
+
return e.filter(se).map((e) => function(e, t = 0) {
|
|
1010
|
+
let n, r = (t) => {
|
|
1011
|
+
e.sheet ? t() : n = setTimeout(() => r(t), 10);
|
|
1012
|
+
};
|
|
1013
|
+
return new Promise((i) => {
|
|
1014
|
+
r(() => i(e)), t > 0 && setTimeout(() => {
|
|
1015
|
+
n && clearTimeout(n), i(e);
|
|
1016
|
+
}, t);
|
|
1017
|
+
});
|
|
1018
|
+
}(e, t));
|
|
1019
|
+
}(s, i);
|
|
1020
|
+
e.length && (t.swup.log(`Waiting for ${e.length} assets to load`), await Promise.all(e));
|
|
1021
|
+
}
|
|
1022
|
+
}, this.options = K({}, this.defaults, e), this.options.persistAssets && !this.options.persistTags && (this.options.persistTags = "link[rel=stylesheet], script[src], style");
|
|
1023
|
+
}
|
|
1024
|
+
mount() {
|
|
1025
|
+
this.before("content:replace", this.updateHead);
|
|
1026
|
+
}
|
|
1027
|
+
isPersistentTag(e) {
|
|
1028
|
+
let { persistTags: t } = this.options;
|
|
1029
|
+
return typeof t == "function" ? t(e) : typeof t == "string" && t.length > 0 ? e.matches(t) : !!t;
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
//#endregion
|
|
1033
|
+
//#region node_modules/@swup/scripts-plugin/dist/index.modern.js
|
|
1034
|
+
function X() {
|
|
1035
|
+
return X = Object.assign ? Object.assign.bind() : function(e) {
|
|
1036
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1037
|
+
var n = arguments[t];
|
|
1038
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
1039
|
+
}
|
|
1040
|
+
return e;
|
|
1041
|
+
}, X.apply(this, arguments);
|
|
1042
|
+
}
|
|
1043
|
+
var le = class extends B {
|
|
1044
|
+
constructor(e = {}) {
|
|
1045
|
+
super(), this.name = "SwupScriptsPlugin", this.requires = { swup: ">=4" }, this.defaults = {
|
|
1046
|
+
head: !0,
|
|
1047
|
+
body: !0,
|
|
1048
|
+
optin: !1
|
|
1049
|
+
}, this.options = void 0, this.options = X({}, this.defaults, e);
|
|
1050
|
+
}
|
|
1051
|
+
mount() {
|
|
1052
|
+
this.on("content:replace", this.runScripts);
|
|
1053
|
+
}
|
|
1054
|
+
runScripts() {
|
|
1055
|
+
let { head: e, body: t, optin: n } = this.options, r = this.getScope({
|
|
1056
|
+
head: e,
|
|
1057
|
+
body: t
|
|
1058
|
+
});
|
|
1059
|
+
if (!r) return;
|
|
1060
|
+
let i = Array.from(r.querySelectorAll(n ? "script[data-swup-reload-script]" : "script:not([data-swup-ignore-script])"));
|
|
1061
|
+
i.forEach((e) => this.runScript(e)), this.swup.log(`Executed ${i.length} scripts.`);
|
|
1062
|
+
}
|
|
1063
|
+
runScript(e) {
|
|
1064
|
+
let t = document.createElement("script");
|
|
1065
|
+
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
1066
|
+
return t.textContent = e.textContent, e.replaceWith(t), t;
|
|
1067
|
+
}
|
|
1068
|
+
getScope({ head: e, body: t }) {
|
|
1069
|
+
return e && t ? document : e ? document.head : t ? document.body : null;
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
//#endregion
|
|
1073
|
+
//#region client/navigation.ts
|
|
1074
|
+
function Z(e) {
|
|
1075
|
+
let t = e.split("/").filter(Boolean)[0];
|
|
1076
|
+
return t === "en" || t === "it" ? t : "es";
|
|
1077
|
+
}
|
|
1078
|
+
function ue(e, { el: t } = {}) {
|
|
1079
|
+
if (t?.closest("[data-no-swup]")) return !0;
|
|
1080
|
+
let n = new URL(e, window.location.href), r = document.documentElement.lang || Z(window.location.pathname);
|
|
1081
|
+
return Z(n.pathname) !== r;
|
|
1082
|
+
}
|
|
1083
|
+
function Q(e) {
|
|
1084
|
+
let t = e.state;
|
|
1085
|
+
return t?.source === "swup" ? !1 : t?.source === "brokaw-page" && t.pageLayout ? document.querySelector("#page-content")?.dataset.pageLayout === t.pageLayout : !0;
|
|
1086
|
+
}
|
|
1087
|
+
function de() {
|
|
1088
|
+
let e = document.querySelector("#page-content");
|
|
1089
|
+
e && (window.__brokawHydrateRelativeTimes?.(e), window.__brokawInitCarousels?.(e), window.__brokawInitAnimatedHighlights?.(), window.__brokawSyncSofascoreTheme?.());
|
|
1090
|
+
}
|
|
1091
|
+
function fe() {
|
|
1092
|
+
let e = document.querySelector("#page-content");
|
|
1093
|
+
!e || typeof window.gtag != "function" || (window.gtag("event", "page_view", {
|
|
1094
|
+
page_location: window.location.href,
|
|
1095
|
+
page_title: document.title
|
|
1096
|
+
}), window.gtag("event", "page_metadata", {
|
|
1097
|
+
content_type: e.dataset.pageLayout || "",
|
|
1098
|
+
content_id: e.dataset.pageId || "",
|
|
1099
|
+
content_language: e.dataset.pageLanguage || document.documentElement.lang
|
|
1100
|
+
}));
|
|
1101
|
+
}
|
|
1102
|
+
var $ = new L({
|
|
1103
|
+
cache: !1,
|
|
1104
|
+
containers: ["#page-content"],
|
|
1105
|
+
ignoreVisit: ue,
|
|
1106
|
+
native: !0,
|
|
1107
|
+
skipPopStateHandling: Q,
|
|
1108
|
+
plugins: [
|
|
1109
|
+
new ce(),
|
|
1110
|
+
new G(),
|
|
1111
|
+
new le({
|
|
1112
|
+
head: !1,
|
|
1113
|
+
body: !0,
|
|
1114
|
+
optin: !0
|
|
1115
|
+
})
|
|
1116
|
+
]
|
|
1117
|
+
});
|
|
1118
|
+
$.hooks.before("content:replace", () => {
|
|
1119
|
+
window.__brokawPageCleanup?.(), window.__brokawPageCleanup = void 0;
|
|
1120
|
+
}), $.hooks.on("page:view", () => {
|
|
1121
|
+
de(), fe();
|
|
1122
|
+
});
|
|
1123
|
+
//#endregion
|