@storyblok/astro 5.1.1 → 6.0.0-next.1
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/dist/index.d.ts +3 -56
- package/dist/lib/helpers.d.ts +8 -0
- package/dist/lib/storyblok-integration.d.ts +51 -0
- package/dist/storyblok-astro.es.js +407 -1036
- package/dist/storyblok-astro.umd.js +36 -41
- package/dist/types.d.ts +1 -1
- package/package.json +2 -4
- package/dist/utils/generateFinalBridgeObject.d.ts +0 -3
- package/dist/utils/parseAstCode.d.ts +0 -7
- package/dist/vite-plugins/vite-plugin-storyblok-bridge.d.ts +0 -12
|
@@ -1,93 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
use: ${t ? "[]" : "[apiPlugin]"},
|
|
16
|
-
apiOptions: ${JSON.stringify(r)},
|
|
17
|
-
});
|
|
18
|
-
export const storyblokApiInstance = storyblokApi;
|
|
19
|
-
`;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const Or = /[\p{Lu}]/u, xr = /[\p{Ll}]/u, Me = /^[\p{Lu}](?![\p{Lu}])/gu, Je = /([\p{Alpha}\p{N}_]|$)/u, fe = /[_.\- ]+/, jr = new RegExp("^" + fe.source), Ne = new RegExp(fe.source + Je.source, "gu"), ze = new RegExp("\\d+" + Je.source, "gu"), Er = (o, t, r, s) => {
|
|
24
|
-
let i = !1, l = !1, u = !1, f = !1;
|
|
25
|
-
for (let g = 0; g < o.length; g++) {
|
|
26
|
-
const y = o[g];
|
|
27
|
-
f = g > 2 ? o[g - 3] === "-" : !0, i && Or.test(y) ? (o = o.slice(0, g) + "-" + o.slice(g), i = !1, u = l, l = !0, g++) : l && u && xr.test(y) && (!f || s) ? (o = o.slice(0, g - 1) + "-" + o.slice(g - 1), u = l, l = !1, i = !0) : (i = t(y) === y && r(y) !== y, u = l, l = r(y) === y && t(y) !== y);
|
|
1
|
+
const A = `<svg width="45px" height="53px" viewBox="0 0 45 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<g id="storyblok-logo-kit" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
3
|
+
<g id="storyblok-partner-logo" transform="translate(-59.000000, -169.000000)" fill-rule="nonzero">
|
|
4
|
+
<g id="storyblok-symbol" transform="translate(59.000000, 169.000000)">
|
|
5
|
+
<path d="M2.32662261,0 C1.03405449,0 0,1.0331384 0,2.27290448 L0,42.8752437 C0,44.1150097 1.03405449,44.8898635 2.27491989,44.8898635 L8.27243596,44.8898635 L8.27243596,53 L15.7176283,44.9415205 L42.9132615,44.9415205 C44.1541269,44.9415205 44.9296678,44.1666667 44.9296678,42.8752437 L44.9296678,2.3245614 C44.9296678,1.08479532 44.2058296,0 42.9132615,0 L2.32662261,0 Z" id="Shape-path-Copy" fill="#0AB3AF"></path>
|
|
6
|
+
<path d="M29.1016723,8.11483254 C30.1351059,8.11483254 31.0135245,8.32132604 31.8402713,8.78593643 C32.6153465,9.19892344 33.33875,9.76678059 33.9071385,10.4378845 C35.0647615,11.8482391 35.6869248,13.6215753 35.6639755,15.445352 C35.6639755,16.7875598 35.3022738,18.0781442 34.630542,19.3171053 C33.9341248,20.5632996 32.8438147,21.5436614 31.5302412,22.1047676 C33.183735,22.569378 34.4755269,23.395352 35.4572888,24.5826897 C36.387379,25.8216507 36.8524241,27.4219754 36.8524241,29.4352871 C36.8524241,30.7258715 36.6168825,31.8756998 36.1290206,32.7391832 C35.6123039,33.668404 34.8372287,34.4427546 33.9071385,35.0106118 C32.9253766,35.6300923 31.8402713,36.1979494 30.600151,36.4560663 C29.3600307,36.7658066 28.0165671,37.0239234 26.6214318,37.0239234 L8.32965751,37.0239234 L8.32965751,8.11483254 L29.1016723,8.11483254 Z M26.1340815,24.271851 L15.77813,24.271851 L15.77813,29.1552028 L25.8851404,29.1552028 C26.4825991,29.1552028 27.0302696,28.9110352 27.4783637,28.5203671 C27.8766695,28.1296989 28.1256107,27.5436967 28.1256107,26.811194 C28.140051,26.1827412 27.948041,25.5663945 27.5779401,25.0531873 C27.1796343,24.5648522 26.7315403,24.271851 26.1340815,24.271851 Z M25.2876816,14.5051475 L15.77813,14.5051475 L15.77813,18.9001641 L25.0885287,18.9001641 C25.586411,18.9001641 26.0842933,18.6559965 26.4825991,18.3629954 C26.9306932,18.0699943 27.1298461,17.4351586 27.1298461,16.6049888 C27.1298461,15.872486 26.9306932,15.3353173 26.5821756,14.9934827 C26.233658,14.7004816 25.7855639,14.5051475 25.2876816,14.5051475 Z" id="Combined-Shape-Copy-3" fill="#FFFFFF"></path>
|
|
7
|
+
</g>
|
|
8
|
+
</g>
|
|
9
|
+
</g>
|
|
10
|
+
</svg>`, E = /[\p{Lu}]/u, L = /[\p{Ll}]/u, k = /^[\p{Lu}](?![\p{Lu}])/gu, x = /([\p{Alpha}\p{N}_]|$)/u, y = /[_.\- ]+/, R = new RegExp("^" + y.source), w = new RegExp(y.source + x.source, "gu"), $ = new RegExp("\\d+" + x.source, "gu"), j = (r, e, t, o) => {
|
|
11
|
+
let s = !1, n = !1, a = !1, l = !1;
|
|
12
|
+
for (let i = 0; i < r.length; i++) {
|
|
13
|
+
const c = r[i];
|
|
14
|
+
l = i > 2 ? r[i - 3] === "-" : !0, s && E.test(c) ? (r = r.slice(0, i) + "-" + r.slice(i), s = !1, a = n, n = !0, i++) : n && a && L.test(c) && (!l || o) ? (r = r.slice(0, i - 1) + "-" + r.slice(i - 1), a = n, n = !1, s = !0) : (s = e(c) === c && t(c) !== c, a = n, n = t(c) === c && e(c) !== c);
|
|
28
15
|
}
|
|
29
|
-
return
|
|
30
|
-
},
|
|
31
|
-
function
|
|
32
|
-
if (!(typeof
|
|
16
|
+
return r;
|
|
17
|
+
}, M = (r, e) => (k.lastIndex = 0, r.replaceAll(k, (t) => e(t))), P = (r, e) => (w.lastIndex = 0, $.lastIndex = 0, r.replaceAll($, (t, o, s) => ["_", "-"].includes(r.charAt(s + t.length)) ? t : e(t)).replaceAll(w, (t, o) => e(o)));
|
|
18
|
+
function O(r, e) {
|
|
19
|
+
if (!(typeof r == "string" || Array.isArray(r)))
|
|
33
20
|
throw new TypeError("Expected the input to be `string | string[]`");
|
|
34
|
-
if (
|
|
21
|
+
if (e = {
|
|
35
22
|
pascalCase: !1,
|
|
36
23
|
preserveConsecutiveUppercase: !1,
|
|
37
|
-
...
|
|
38
|
-
}, Array.isArray(
|
|
24
|
+
...e
|
|
25
|
+
}, Array.isArray(r) ? r = r.map((n) => n.trim()).filter((n) => n.length).join("-") : r = r.trim(), r.length === 0)
|
|
39
26
|
return "";
|
|
40
|
-
const
|
|
41
|
-
return
|
|
27
|
+
const t = e.locale === !1 ? (n) => n.toLowerCase() : (n) => n.toLocaleLowerCase(e.locale), o = e.locale === !1 ? (n) => n.toUpperCase() : (n) => n.toLocaleUpperCase(e.locale);
|
|
28
|
+
return r.length === 1 ? y.test(r) ? "" : e.pascalCase ? o(r) : t(r) : (r !== t(r) && (r = j(r, t, o, e.preserveConsecutiveUppercase)), r = r.replace(R, ""), r = e.preserveConsecutiveUppercase ? M(r, t) : t(r), e.pascalCase && (r = o(r.charAt(0)) + r.slice(1)), P(r, o));
|
|
42
29
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
30
|
+
function v(r) {
|
|
31
|
+
return O(r);
|
|
45
32
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
33
|
+
function _(r, e = {}, t, o) {
|
|
34
|
+
const s = "virtual:storyblok-components", n = `\0${s}`;
|
|
48
35
|
return {
|
|
49
36
|
name: "vite-plugin-storyblok-components",
|
|
50
|
-
async resolveId(
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
37
|
+
async resolveId(a) {
|
|
38
|
+
if (a === s)
|
|
39
|
+
return n;
|
|
53
40
|
},
|
|
54
|
-
async load(
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
for await (const [
|
|
58
|
-
const
|
|
59
|
-
`/${
|
|
41
|
+
async load(a) {
|
|
42
|
+
if (a === n) {
|
|
43
|
+
const l = [], i = [];
|
|
44
|
+
for await (const [u, p] of Object.entries(e)) {
|
|
45
|
+
const f = await this.resolve(
|
|
46
|
+
`/${r}/${p}.astro`
|
|
60
47
|
);
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
else if (
|
|
64
|
-
|
|
48
|
+
if (f)
|
|
49
|
+
l.push(`import ${v(u)} from "${f.id}"`);
|
|
50
|
+
else if (t)
|
|
51
|
+
i.push(u);
|
|
65
52
|
else
|
|
66
53
|
throw new Error(
|
|
67
|
-
`Component could not be found for blok "${
|
|
54
|
+
`Component could not be found for blok "${u}"! Does "${`/${r}/${p}`}.astro" exist?`
|
|
68
55
|
);
|
|
69
56
|
}
|
|
70
|
-
let
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
`/${
|
|
57
|
+
let c = "";
|
|
58
|
+
if (t)
|
|
59
|
+
if (c = ",FallbackComponent", o) {
|
|
60
|
+
const u = await this.resolve(
|
|
61
|
+
`/${r}/${o}.astro`
|
|
75
62
|
);
|
|
76
|
-
if (!
|
|
63
|
+
if (!u)
|
|
77
64
|
throw new Error(
|
|
78
|
-
`Custom fallback component could not be found. Does "${`/${
|
|
65
|
+
`Custom fallback component could not be found. Does "${`/${r}/${o}`}.astro" exist?`
|
|
79
66
|
);
|
|
80
|
-
|
|
81
|
-
`import FallbackComponent from "${
|
|
67
|
+
l.push(
|
|
68
|
+
`import FallbackComponent from "${u.id}"`
|
|
82
69
|
);
|
|
83
70
|
} else
|
|
84
|
-
|
|
71
|
+
l.push(
|
|
85
72
|
"import FallbackComponent from '@storyblok/astro/FallbackComponent.astro'"
|
|
86
73
|
);
|
|
87
|
-
if (Object.values(
|
|
88
|
-
return `${
|
|
89
|
-
if (
|
|
90
|
-
return `${
|
|
74
|
+
if (Object.values(e).length)
|
|
75
|
+
return `${l.join(";")};export default {${Object.keys(e).filter((u) => !i.includes(u)).map((u) => v(u)).join(",")}${c}}`;
|
|
76
|
+
if (t)
|
|
77
|
+
return `${l[0]}; export default {${c.replace(",", "")}}`;
|
|
91
78
|
throw new Error(
|
|
92
79
|
`Currently, no Storyblok components are registered in astro.config.mjs.
|
|
93
80
|
Please register your components or enable the fallback component.
|
|
@@ -97,53 +84,75 @@ Detailed information can be found here: https://github.com/storyblok/storyblok-a
|
|
|
97
84
|
}
|
|
98
85
|
};
|
|
99
86
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
87
|
+
function N(r, e, t) {
|
|
88
|
+
const o = "virtual:storyblok-init", s = `\0${o}`;
|
|
89
|
+
return {
|
|
90
|
+
name: "vite-plugin-storyblok-init",
|
|
91
|
+
async resolveId(n) {
|
|
92
|
+
if (n === o)
|
|
93
|
+
return s;
|
|
94
|
+
},
|
|
95
|
+
async load(n) {
|
|
96
|
+
if (n === s)
|
|
97
|
+
return `
|
|
98
|
+
import { storyblokInit, apiPlugin } from "@storyblok/js";
|
|
99
|
+
const { storyblokApi } = storyblokInit({
|
|
100
|
+
accessToken: "${r}",
|
|
101
|
+
use: ${e ? "[]" : "[apiPlugin]"},
|
|
102
|
+
apiOptions: ${JSON.stringify(t)},
|
|
103
|
+
});
|
|
104
|
+
export const storyblokApiInstance = storyblokApi;
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function z(r) {
|
|
110
|
+
const e = "virtual:storyblok-options", t = `\0${e}`;
|
|
102
111
|
return {
|
|
103
112
|
name: "vite-plugin-storyblok-options",
|
|
104
|
-
async resolveId(
|
|
105
|
-
if (
|
|
106
|
-
return
|
|
113
|
+
async resolveId(o) {
|
|
114
|
+
if (o === e)
|
|
115
|
+
return t;
|
|
107
116
|
},
|
|
108
|
-
async load(
|
|
109
|
-
if (
|
|
110
|
-
return `export default ${JSON.stringify(
|
|
117
|
+
async load(o) {
|
|
118
|
+
if (o === t)
|
|
119
|
+
return `export default ${JSON.stringify(r)}`;
|
|
111
120
|
}
|
|
112
121
|
};
|
|
113
122
|
}
|
|
114
|
-
let
|
|
115
|
-
const
|
|
116
|
-
if (typeof window > "u" || (window.storyblokRegisterEvent = (
|
|
123
|
+
let C = !1;
|
|
124
|
+
const I = [], B = (r) => new Promise((e, t) => {
|
|
125
|
+
if (typeof window > "u" || (window.storyblokRegisterEvent = (s) => {
|
|
117
126
|
if (window.location === window.parent.location) {
|
|
118
127
|
console.warn("You are not in Draft Mode or in the Visual Editor.");
|
|
119
128
|
return;
|
|
120
129
|
}
|
|
121
|
-
|
|
130
|
+
C ? s() : I.push(s);
|
|
122
131
|
}, document.getElementById("storyblok-javascript-bridge"))) return;
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, document.getElementsByTagName("head")[0].appendChild(
|
|
132
|
+
const o = document.createElement("script");
|
|
133
|
+
o.async = !0, o.src = r, o.id = "storyblok-javascript-bridge", o.onerror = (s) => t(s), o.onload = (s) => {
|
|
134
|
+
I.forEach((n) => n()), C = !0, e(s);
|
|
135
|
+
}, document.getElementsByTagName("head")[0].appendChild(o);
|
|
127
136
|
});
|
|
128
|
-
var
|
|
129
|
-
let
|
|
137
|
+
var F = Object.defineProperty, D = (r, e, t) => e in r ? F(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, g = (r, e, t) => D(r, typeof e != "symbol" ? e + "" : e, t);
|
|
138
|
+
let U = class {
|
|
130
139
|
constructor() {
|
|
131
|
-
|
|
132
|
-
...
|
|
133
|
-
per_page:
|
|
134
|
-
page:
|
|
135
|
-
})),
|
|
136
|
-
const
|
|
137
|
-
return this.arrayFrom(
|
|
138
|
-
}),
|
|
139
|
-
const
|
|
140
|
+
g(this, "isCDNUrl", (r = "") => r.includes("/cdn/")), g(this, "getOptionsPage", (r, e = 25, t = 1) => ({
|
|
141
|
+
...r,
|
|
142
|
+
per_page: e,
|
|
143
|
+
page: t
|
|
144
|
+
})), g(this, "delay", (r) => new Promise((e) => setTimeout(e, r))), g(this, "arrayFrom", (r = 0, e) => Array.from({ length: r }, e)), g(this, "range", (r = 0, e = r) => {
|
|
145
|
+
const t = Math.abs(e - r) || 0, o = r < e ? 1 : -1;
|
|
146
|
+
return this.arrayFrom(t, (s, n) => n * o + r);
|
|
147
|
+
}), g(this, "asyncMap", async (r, e) => Promise.all(r.map(e))), g(this, "flatMap", (r = [], e) => r.map(e).reduce((t, o) => [...t, ...o], [])), g(this, "escapeHTML", function(r) {
|
|
148
|
+
const e = {
|
|
140
149
|
"&": "&",
|
|
141
150
|
"<": "<",
|
|
142
151
|
">": ">",
|
|
143
152
|
'"': """,
|
|
144
153
|
"'": "'"
|
|
145
|
-
},
|
|
146
|
-
return
|
|
154
|
+
}, t = /[&<>"']/g, o = new RegExp(t.source);
|
|
155
|
+
return r && o.test(r) ? r.replace(t, (s) => e[s]) : r;
|
|
147
156
|
});
|
|
148
157
|
}
|
|
149
158
|
/**
|
|
@@ -153,226 +162,226 @@ let Br = class {
|
|
|
153
162
|
* @param {boolean} isArray
|
|
154
163
|
* @return {string} Stringified object
|
|
155
164
|
*/
|
|
156
|
-
stringify(
|
|
157
|
-
const
|
|
158
|
-
for (const
|
|
159
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
165
|
+
stringify(r, e, t) {
|
|
166
|
+
const o = [];
|
|
167
|
+
for (const s in r) {
|
|
168
|
+
if (!Object.prototype.hasOwnProperty.call(r, s))
|
|
160
169
|
continue;
|
|
161
|
-
const
|
|
162
|
-
let
|
|
163
|
-
typeof
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Array.isArray(
|
|
167
|
-
) :
|
|
168
|
-
}
|
|
169
|
-
return
|
|
170
|
+
const n = r[s], a = t ? "" : encodeURIComponent(s);
|
|
171
|
+
let l;
|
|
172
|
+
typeof n == "object" ? l = this.stringify(
|
|
173
|
+
n,
|
|
174
|
+
e ? e + encodeURIComponent(`[${a}]`) : a,
|
|
175
|
+
Array.isArray(n)
|
|
176
|
+
) : l = `${e ? e + encodeURIComponent(`[${a}]`) : a}=${encodeURIComponent(n)}`, o.push(l);
|
|
177
|
+
}
|
|
178
|
+
return o.join("&");
|
|
170
179
|
}
|
|
171
180
|
/**
|
|
172
181
|
* @method getRegionURL
|
|
173
182
|
* @param {string} regionCode region code, could be eu, us, cn, ap or ca
|
|
174
183
|
* @return {string} The base URL of the region
|
|
175
184
|
*/
|
|
176
|
-
getRegionURL(
|
|
177
|
-
const
|
|
178
|
-
switch (
|
|
185
|
+
getRegionURL(r) {
|
|
186
|
+
const e = "api.storyblok.com", t = "api-us.storyblok.com", o = "app.storyblokchina.cn", s = "api-ap.storyblok.com", n = "api-ca.storyblok.com";
|
|
187
|
+
switch (r) {
|
|
179
188
|
case "us":
|
|
180
|
-
return
|
|
189
|
+
return t;
|
|
181
190
|
case "cn":
|
|
182
|
-
return
|
|
191
|
+
return o;
|
|
183
192
|
case "ap":
|
|
184
|
-
return
|
|
193
|
+
return s;
|
|
185
194
|
case "ca":
|
|
186
|
-
return
|
|
195
|
+
return n;
|
|
187
196
|
default:
|
|
188
|
-
return
|
|
197
|
+
return e;
|
|
189
198
|
}
|
|
190
199
|
}
|
|
191
200
|
};
|
|
192
|
-
const
|
|
193
|
-
const
|
|
194
|
-
for (const
|
|
195
|
-
const
|
|
196
|
-
|
|
201
|
+
const q = function(r, e) {
|
|
202
|
+
const t = {};
|
|
203
|
+
for (const o in r) {
|
|
204
|
+
const s = r[o];
|
|
205
|
+
e.includes(o) && s !== null && (t[o] = s);
|
|
197
206
|
}
|
|
198
|
-
return
|
|
199
|
-
},
|
|
207
|
+
return t;
|
|
208
|
+
}, H = (r) => r === "email", W = () => ({
|
|
200
209
|
singleTag: "hr"
|
|
201
|
-
}),
|
|
210
|
+
}), J = () => ({
|
|
202
211
|
tag: "blockquote"
|
|
203
|
-
}),
|
|
212
|
+
}), V = () => ({
|
|
204
213
|
tag: "ul"
|
|
205
|
-
}),
|
|
214
|
+
}), K = (r) => ({
|
|
206
215
|
tag: [
|
|
207
216
|
"pre",
|
|
208
217
|
{
|
|
209
218
|
tag: "code",
|
|
210
|
-
attrs:
|
|
219
|
+
attrs: r.attrs
|
|
211
220
|
}
|
|
212
221
|
]
|
|
213
|
-
}),
|
|
222
|
+
}), Z = () => ({
|
|
214
223
|
singleTag: "br"
|
|
215
|
-
}),
|
|
216
|
-
tag: `h${
|
|
217
|
-
}),
|
|
224
|
+
}), G = (r) => ({
|
|
225
|
+
tag: `h${r.attrs.level}`
|
|
226
|
+
}), X = (r) => ({
|
|
218
227
|
singleTag: [
|
|
219
228
|
{
|
|
220
229
|
tag: "img",
|
|
221
|
-
attrs:
|
|
230
|
+
attrs: q(r.attrs, ["src", "alt", "title"])
|
|
222
231
|
}
|
|
223
232
|
]
|
|
224
|
-
}),
|
|
233
|
+
}), Y = () => ({
|
|
225
234
|
tag: "li"
|
|
226
|
-
}),
|
|
235
|
+
}), Q = () => ({
|
|
227
236
|
tag: "ol"
|
|
228
|
-
}),
|
|
237
|
+
}), ee = () => ({
|
|
229
238
|
tag: "p"
|
|
230
|
-
}),
|
|
239
|
+
}), te = (r) => ({
|
|
231
240
|
tag: [
|
|
232
241
|
{
|
|
233
242
|
tag: "span",
|
|
234
243
|
attrs: {
|
|
235
244
|
"data-type": "emoji",
|
|
236
|
-
"data-name":
|
|
237
|
-
emoji:
|
|
245
|
+
"data-name": r.attrs.name,
|
|
246
|
+
emoji: r.attrs.emoji
|
|
238
247
|
}
|
|
239
248
|
}
|
|
240
249
|
]
|
|
241
|
-
}),
|
|
250
|
+
}), re = () => ({
|
|
242
251
|
tag: "b"
|
|
243
|
-
}),
|
|
252
|
+
}), oe = () => ({
|
|
244
253
|
tag: "s"
|
|
245
|
-
}),
|
|
254
|
+
}), se = () => ({
|
|
246
255
|
tag: "u"
|
|
247
|
-
}),
|
|
256
|
+
}), ne = () => ({
|
|
248
257
|
tag: "strong"
|
|
249
|
-
}),
|
|
258
|
+
}), ae = () => ({
|
|
250
259
|
tag: "code"
|
|
251
|
-
}),
|
|
260
|
+
}), le = () => ({
|
|
252
261
|
tag: "i"
|
|
253
|
-
}),
|
|
254
|
-
if (!
|
|
262
|
+
}), ie = (r) => {
|
|
263
|
+
if (!r.attrs)
|
|
255
264
|
return {
|
|
256
265
|
tag: ""
|
|
257
266
|
};
|
|
258
|
-
const
|
|
259
|
-
if (delete
|
|
260
|
-
for (const
|
|
261
|
-
|
|
262
|
-
delete
|
|
267
|
+
const e = new U().escapeHTML, t = { ...r.attrs }, { linktype: o = "url" } = r.attrs;
|
|
268
|
+
if (delete t.linktype, t.href && (t.href = e(r.attrs.href || "")), H(o) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
|
|
269
|
+
for (const s in t.custom)
|
|
270
|
+
t[s] = t.custom[s];
|
|
271
|
+
delete t.custom;
|
|
263
272
|
}
|
|
264
273
|
return {
|
|
265
274
|
tag: [
|
|
266
275
|
{
|
|
267
276
|
tag: "a",
|
|
268
|
-
attrs:
|
|
277
|
+
attrs: t
|
|
269
278
|
}
|
|
270
279
|
]
|
|
271
280
|
};
|
|
272
|
-
},
|
|
281
|
+
}, ce = (r) => ({
|
|
273
282
|
tag: [
|
|
274
283
|
{
|
|
275
284
|
tag: "span",
|
|
276
|
-
attrs:
|
|
285
|
+
attrs: r.attrs
|
|
277
286
|
}
|
|
278
287
|
]
|
|
279
|
-
}),
|
|
288
|
+
}), ue = () => ({
|
|
280
289
|
tag: "sub"
|
|
281
|
-
}),
|
|
290
|
+
}), de = () => ({
|
|
282
291
|
tag: "sup"
|
|
283
|
-
}),
|
|
292
|
+
}), ge = (r) => ({
|
|
284
293
|
tag: [
|
|
285
294
|
{
|
|
286
295
|
tag: "span",
|
|
287
|
-
attrs:
|
|
296
|
+
attrs: r.attrs
|
|
288
297
|
}
|
|
289
298
|
]
|
|
290
|
-
}),
|
|
291
|
-
var
|
|
292
|
-
return (
|
|
299
|
+
}), pe = (r) => {
|
|
300
|
+
var e;
|
|
301
|
+
return (e = r.attrs) != null && e.color ? {
|
|
293
302
|
tag: [
|
|
294
303
|
{
|
|
295
304
|
tag: "span",
|
|
296
305
|
attrs: {
|
|
297
|
-
style: `background-color:${
|
|
306
|
+
style: `background-color:${r.attrs.color};`
|
|
298
307
|
}
|
|
299
308
|
}
|
|
300
309
|
]
|
|
301
310
|
} : {
|
|
302
311
|
tag: ""
|
|
303
312
|
};
|
|
304
|
-
},
|
|
305
|
-
var
|
|
306
|
-
return (
|
|
313
|
+
}, fe = (r) => {
|
|
314
|
+
var e;
|
|
315
|
+
return (e = r.attrs) != null && e.color ? {
|
|
307
316
|
tag: [
|
|
308
317
|
{
|
|
309
318
|
tag: "span",
|
|
310
319
|
attrs: {
|
|
311
|
-
style: `color:${
|
|
320
|
+
style: `color:${r.attrs.color}`
|
|
312
321
|
}
|
|
313
322
|
}
|
|
314
323
|
]
|
|
315
324
|
} : {
|
|
316
325
|
tag: ""
|
|
317
326
|
};
|
|
318
|
-
},
|
|
327
|
+
}, he = {
|
|
319
328
|
nodes: {
|
|
320
|
-
horizontal_rule:
|
|
321
|
-
blockquote:
|
|
322
|
-
bullet_list:
|
|
323
|
-
code_block:
|
|
324
|
-
hard_break:
|
|
325
|
-
heading:
|
|
326
|
-
image:
|
|
327
|
-
list_item:
|
|
328
|
-
ordered_list:
|
|
329
|
-
paragraph:
|
|
330
|
-
emoji:
|
|
329
|
+
horizontal_rule: W,
|
|
330
|
+
blockquote: J,
|
|
331
|
+
bullet_list: V,
|
|
332
|
+
code_block: K,
|
|
333
|
+
hard_break: Z,
|
|
334
|
+
heading: G,
|
|
335
|
+
image: X,
|
|
336
|
+
list_item: Y,
|
|
337
|
+
ordered_list: Q,
|
|
338
|
+
paragraph: ee,
|
|
339
|
+
emoji: te
|
|
331
340
|
},
|
|
332
341
|
marks: {
|
|
333
|
-
bold:
|
|
334
|
-
strike:
|
|
335
|
-
underline:
|
|
336
|
-
strong:
|
|
337
|
-
code:
|
|
338
|
-
italic:
|
|
339
|
-
link:
|
|
340
|
-
styled:
|
|
341
|
-
subscript:
|
|
342
|
-
superscript:
|
|
343
|
-
anchor:
|
|
344
|
-
highlight:
|
|
345
|
-
textStyle:
|
|
342
|
+
bold: re,
|
|
343
|
+
strike: oe,
|
|
344
|
+
underline: se,
|
|
345
|
+
strong: ne,
|
|
346
|
+
code: ae,
|
|
347
|
+
italic: le,
|
|
348
|
+
link: ie,
|
|
349
|
+
styled: ce,
|
|
350
|
+
subscript: ue,
|
|
351
|
+
superscript: de,
|
|
352
|
+
anchor: ge,
|
|
353
|
+
highlight: pe,
|
|
354
|
+
textStyle: fe
|
|
346
355
|
}
|
|
347
|
-
},
|
|
348
|
-
const
|
|
356
|
+
}, be = function(r) {
|
|
357
|
+
const e = {
|
|
349
358
|
"&": "&",
|
|
350
359
|
"<": "<",
|
|
351
360
|
">": ">",
|
|
352
361
|
'"': """,
|
|
353
362
|
"'": "'"
|
|
354
|
-
},
|
|
355
|
-
return
|
|
363
|
+
}, t = /[&<>"']/g, o = new RegExp(t.source);
|
|
364
|
+
return r && o.test(r) ? r.replace(t, (s) => e[s]) : r;
|
|
356
365
|
};
|
|
357
|
-
let
|
|
358
|
-
class
|
|
359
|
-
constructor(
|
|
360
|
-
|
|
366
|
+
let S = !1;
|
|
367
|
+
class ye {
|
|
368
|
+
constructor(e) {
|
|
369
|
+
g(this, "marks"), g(this, "nodes"), e || (e = he), this.marks = e.marks || [], this.nodes = e.nodes || [];
|
|
361
370
|
}
|
|
362
|
-
addNode(
|
|
363
|
-
this.nodes[
|
|
371
|
+
addNode(e, t) {
|
|
372
|
+
this.nodes[e] = t;
|
|
364
373
|
}
|
|
365
|
-
addMark(
|
|
366
|
-
this.marks[
|
|
374
|
+
addMark(e, t) {
|
|
375
|
+
this.marks[e] = t;
|
|
367
376
|
}
|
|
368
|
-
render(
|
|
369
|
-
if (!
|
|
377
|
+
render(e, t = { optimizeImages: !1 }, o = !0) {
|
|
378
|
+
if (!S && o && (console.warn(
|
|
370
379
|
"Warning ⚠️: The RichTextResolver class is deprecated and will be removed in the next major release. Please use the `@storyblok/richtext` package instead. https://github.com/storyblok/richtext/"
|
|
371
|
-
),
|
|
372
|
-
let
|
|
373
|
-
return
|
|
374
|
-
|
|
375
|
-
}),
|
|
380
|
+
), S = !0), e && e.content && Array.isArray(e.content)) {
|
|
381
|
+
let s = "";
|
|
382
|
+
return e.content.forEach((n) => {
|
|
383
|
+
s += this.renderNode(n);
|
|
384
|
+
}), t.optimizeImages ? this.optimizeImages(s, t.optimizeImages) : s;
|
|
376
385
|
}
|
|
377
386
|
return console.warn(
|
|
378
387
|
`The render method must receive an Object with a "content" field.
|
|
@@ -401,924 +410,286 @@ class yn {
|
|
|
401
410
|
}`
|
|
402
411
|
), "";
|
|
403
412
|
}
|
|
404
|
-
optimizeImages(
|
|
405
|
-
let
|
|
406
|
-
typeof
|
|
407
|
-
const
|
|
408
|
-
return
|
|
413
|
+
optimizeImages(e, t) {
|
|
414
|
+
let o = 0, s = 0, n = "", a = "";
|
|
415
|
+
typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (n += `width="${t.width}" `, o = t.width), typeof t.height == "number" && t.height > 0 && (n += `height="${t.height}" `, s = t.height), (t.loading === "lazy" || t.loading === "eager") && (n += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (n += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (a += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (a += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-F]{6}/gi) || t.filters.fill === "transparent") && (a += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (a += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (a += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (a += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (a += `:rotate(${t.filters.rotate})`), a.length > 0 && (a = `/filters${a}`))), n.length > 0 && (e = e.replace(/<img/g, `<img ${n.trim()}`));
|
|
416
|
+
const l = o > 0 || s > 0 || a.length > 0 ? `${o}x${s}${a}` : "";
|
|
417
|
+
return e = e.replace(
|
|
409
418
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g,
|
|
410
|
-
`a.storyblok.com/f/$1/$2.$3/m/${
|
|
411
|
-
), typeof
|
|
412
|
-
var
|
|
413
|
-
const
|
|
419
|
+
`a.storyblok.com/f/$1/$2.$3/m/${l}`
|
|
420
|
+
), typeof t != "boolean" && (t.sizes || t.srcset) && (e = e.replace(/<img.*?src=["|'](.*?)["|']/g, (i) => {
|
|
421
|
+
var c, u;
|
|
422
|
+
const p = i.match(
|
|
414
423
|
/a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g
|
|
415
424
|
);
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
srcset: (
|
|
419
|
-
if (typeof
|
|
420
|
-
return `//${
|
|
421
|
-
if (typeof
|
|
422
|
-
let
|
|
423
|
-
return typeof
|
|
425
|
+
if (p && p.length > 0) {
|
|
426
|
+
const f = {
|
|
427
|
+
srcset: (c = t.srcset) == null ? void 0 : c.map((d) => {
|
|
428
|
+
if (typeof d == "number")
|
|
429
|
+
return `//${p}/m/${d}x0${a} ${d}w`;
|
|
430
|
+
if (typeof d == "object" && d.length === 2) {
|
|
431
|
+
let b = 0, m = 0;
|
|
432
|
+
return typeof d[0] == "number" && (b = d[0]), typeof d[1] == "number" && (m = d[1]), `//${p}/m/${b}x${m}${a} ${b}w`;
|
|
424
433
|
}
|
|
425
434
|
return "";
|
|
426
435
|
}).join(", "),
|
|
427
|
-
sizes: (
|
|
436
|
+
sizes: (u = t.sizes) == null ? void 0 : u.map((d) => d).join(", ")
|
|
428
437
|
};
|
|
429
|
-
let
|
|
430
|
-
return
|
|
438
|
+
let h = "";
|
|
439
|
+
return f.srcset && (h += `srcset="${f.srcset}" `), f.sizes && (h += `sizes="${f.sizes}" `), i.replace(/<img/g, `<img ${h.trim()}`);
|
|
431
440
|
}
|
|
432
|
-
return
|
|
433
|
-
})),
|
|
441
|
+
return i;
|
|
442
|
+
})), e;
|
|
434
443
|
}
|
|
435
|
-
renderNode(
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
|
|
444
|
+
renderNode(e) {
|
|
445
|
+
const t = [];
|
|
446
|
+
e.marks && e.marks.forEach((s) => {
|
|
447
|
+
const n = this.getMatchingMark(s);
|
|
448
|
+
n && n.tag !== "" && t.push(this.renderOpeningTag(n.tag));
|
|
440
449
|
});
|
|
441
|
-
const
|
|
442
|
-
return
|
|
443
|
-
|
|
444
|
-
}) :
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
}),
|
|
450
|
+
const o = this.getMatchingNode(e);
|
|
451
|
+
return o && o.tag && t.push(this.renderOpeningTag(o.tag)), e.content ? e.content.forEach((s) => {
|
|
452
|
+
t.push(this.renderNode(s));
|
|
453
|
+
}) : e.text ? t.push(be(e.text)) : o && o.singleTag ? t.push(this.renderTag(o.singleTag, " /")) : o && o.html ? t.push(o.html) : e.type === "emoji" && t.push(this.renderEmoji(e)), o && o.tag && t.push(this.renderClosingTag(o.tag)), e.marks && e.marks.slice(0).reverse().forEach((s) => {
|
|
454
|
+
const n = this.getMatchingMark(s);
|
|
455
|
+
n && n.tag !== "" && t.push(this.renderClosingTag(n.tag));
|
|
456
|
+
}), t.join("");
|
|
448
457
|
}
|
|
449
|
-
renderTag(
|
|
450
|
-
return
|
|
451
|
-
if (
|
|
452
|
-
return `<${
|
|
458
|
+
renderTag(e, t) {
|
|
459
|
+
return e.constructor === String ? `<${e}${t}>` : e.map((o) => {
|
|
460
|
+
if (o.constructor === String)
|
|
461
|
+
return `<${o}${t}>`;
|
|
453
462
|
{
|
|
454
|
-
let
|
|
455
|
-
if (
|
|
456
|
-
for (const
|
|
457
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
458
|
-
const
|
|
459
|
-
|
|
463
|
+
let s = `<${o.tag}`;
|
|
464
|
+
if (o.attrs) {
|
|
465
|
+
for (const n in o.attrs)
|
|
466
|
+
if (Object.prototype.hasOwnProperty.call(o.attrs, n)) {
|
|
467
|
+
const a = o.attrs[n];
|
|
468
|
+
a !== null && (s += ` ${n}="${a}"`);
|
|
460
469
|
}
|
|
461
470
|
}
|
|
462
|
-
return `${
|
|
471
|
+
return `${s}${t}>`;
|
|
463
472
|
}
|
|
464
473
|
}).join("");
|
|
465
474
|
}
|
|
466
|
-
renderOpeningTag(
|
|
467
|
-
return this.renderTag(
|
|
475
|
+
renderOpeningTag(e) {
|
|
476
|
+
return this.renderTag(e, "");
|
|
468
477
|
}
|
|
469
|
-
renderClosingTag(
|
|
470
|
-
return
|
|
478
|
+
renderClosingTag(e) {
|
|
479
|
+
return e.constructor === String ? `</${e}>` : e.slice(0).reverse().map((t) => t.constructor === String ? `</${t}>` : `</${t.tag}>`).join("");
|
|
471
480
|
}
|
|
472
|
-
getMatchingNode(
|
|
473
|
-
const
|
|
474
|
-
if (typeof
|
|
475
|
-
return
|
|
481
|
+
getMatchingNode(e) {
|
|
482
|
+
const t = this.nodes[e.type];
|
|
483
|
+
if (typeof t == "function")
|
|
484
|
+
return t(e);
|
|
476
485
|
}
|
|
477
|
-
getMatchingMark(
|
|
478
|
-
const
|
|
479
|
-
if (typeof
|
|
480
|
-
return
|
|
486
|
+
getMatchingMark(e) {
|
|
487
|
+
const t = this.marks[e.type];
|
|
488
|
+
if (typeof t == "function")
|
|
489
|
+
return t(e);
|
|
481
490
|
}
|
|
482
|
-
renderEmoji(
|
|
483
|
-
if (
|
|
484
|
-
return
|
|
485
|
-
const
|
|
491
|
+
renderEmoji(e) {
|
|
492
|
+
if (e.attrs.emoji)
|
|
493
|
+
return e.attrs.emoji;
|
|
494
|
+
const t = [
|
|
486
495
|
{
|
|
487
496
|
tag: "img",
|
|
488
497
|
attrs: {
|
|
489
|
-
src:
|
|
498
|
+
src: e.attrs.fallbackImage,
|
|
490
499
|
draggable: "false",
|
|
491
500
|
loading: "lazy",
|
|
492
501
|
align: "absmiddle"
|
|
493
502
|
}
|
|
494
503
|
}
|
|
495
504
|
];
|
|
496
|
-
return this.renderTag(
|
|
505
|
+
return this.renderTag(t, " /");
|
|
497
506
|
}
|
|
498
507
|
}
|
|
499
|
-
const
|
|
500
|
-
if (typeof
|
|
508
|
+
const me = ye, xe = (r) => {
|
|
509
|
+
if (typeof r != "object" || typeof r._editable > "u")
|
|
501
510
|
return {};
|
|
502
511
|
try {
|
|
503
|
-
const
|
|
504
|
-
|
|
512
|
+
const e = JSON.parse(
|
|
513
|
+
r._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
|
|
505
514
|
);
|
|
506
|
-
return
|
|
507
|
-
"data-blok-c": JSON.stringify(
|
|
508
|
-
"data-blok-uid":
|
|
515
|
+
return e ? {
|
|
516
|
+
"data-blok-c": JSON.stringify(e),
|
|
517
|
+
"data-blok-uid": e.id + "-" + e.uid
|
|
509
518
|
} : {};
|
|
510
519
|
} catch {
|
|
511
520
|
return {};
|
|
512
521
|
}
|
|
513
522
|
};
|
|
514
|
-
let
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
let
|
|
518
|
-
return
|
|
519
|
-
|
|
523
|
+
let ke, we = "https://app.storyblok.com/f/storyblok-v2-latest.js";
|
|
524
|
+
const $e = (r, e) => {
|
|
525
|
+
r.addNode("blok", (t) => {
|
|
526
|
+
let o = "";
|
|
527
|
+
return t.attrs.body.forEach((s) => {
|
|
528
|
+
o += e(s.component, s);
|
|
520
529
|
}), {
|
|
521
|
-
html:
|
|
530
|
+
html: o
|
|
522
531
|
};
|
|
523
532
|
});
|
|
524
|
-
},
|
|
525
|
-
let
|
|
526
|
-
if (!
|
|
533
|
+
}, ve = (r) => !r || !(r != null && r.content.some((e) => e.content || e.type === "blok" || e.type === "horizontal_rule")), Ce = (r, e, t) => {
|
|
534
|
+
let o = t || ke;
|
|
535
|
+
if (!o) {
|
|
527
536
|
console.error(
|
|
528
537
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
529
538
|
);
|
|
530
539
|
return;
|
|
531
540
|
}
|
|
532
|
-
return
|
|
533
|
-
},
|
|
534
|
-
function
|
|
535
|
-
const t = {
|
|
536
|
-
resolveRelations: []
|
|
537
|
-
};
|
|
538
|
-
function r(s) {
|
|
539
|
-
s && Array.isArray(t.resolveRelations) && t.resolveRelations.push(
|
|
540
|
-
...Array.isArray(s) ? s : [s]
|
|
541
|
-
);
|
|
542
|
-
}
|
|
543
|
-
for (const s of o)
|
|
544
|
-
if (s.options) {
|
|
545
|
-
const { apiOptions: i, bridgeOptions: l } = s.options;
|
|
546
|
-
if (r(i == null ? void 0 : i.resolve_relations), l) {
|
|
547
|
-
const { resolveRelations: u, ...f } = l;
|
|
548
|
-
r(u), Object.assign(t, f);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
return t.resolveRelations = [...new Set(t.resolveRelations)], t;
|
|
552
|
-
}
|
|
553
|
-
var Y = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
554
|
-
function An(o) {
|
|
555
|
-
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
556
|
-
}
|
|
557
|
-
var U = { exports: {} };
|
|
558
|
-
U.exports;
|
|
559
|
-
var He;
|
|
560
|
-
function Sn() {
|
|
561
|
-
return He || (He = 1, function(o, t) {
|
|
562
|
-
var r = 200, s = "__lodash_hash_undefined__", i = 800, l = 16, u = 9007199254740991, f = "[object Arguments]", g = "[object Array]", y = "[object AsyncFunction]", _ = "[object Boolean]", C = "[object Date]", T = "[object Error]", $ = "[object Function]", w = "[object GeneratorFunction]", x = "[object Map]", H = "[object Number]", We = "[object Null]", de = "[object Object]", Ke = "[object Proxy]", Ze = "[object RegExp]", Ve = "[object Set]", Xe = "[object String]", Ye = "[object Undefined]", Qe = "[object WeakMap]", et = "[object ArrayBuffer]", tt = "[object DataView]", rt = "[object Float32Array]", nt = "[object Float64Array]", ot = "[object Int8Array]", at = "[object Int16Array]", st = "[object Int32Array]", it = "[object Uint8Array]", lt = "[object Uint8ClampedArray]", ct = "[object Uint16Array]", ut = "[object Uint32Array]", ft = /[\\^$.*+?()[\]{}|]/g, dt = /^\[object .+?Constructor\]$/, pt = /^(?:0|[1-9]\d*)$/, b = {};
|
|
563
|
-
b[rt] = b[nt] = b[ot] = b[at] = b[st] = b[it] = b[lt] = b[ct] = b[ut] = !0, b[f] = b[g] = b[et] = b[_] = b[tt] = b[C] = b[T] = b[$] = b[x] = b[H] = b[de] = b[Ze] = b[Ve] = b[Xe] = b[Qe] = !1;
|
|
564
|
-
var pe = typeof Y == "object" && Y && Y.Object === Object && Y, gt = typeof self == "object" && self && self.Object === Object && self, M = pe || gt || Function("return this")(), ge = t && !t.nodeType && t, N = ge && !0 && o && !o.nodeType && o, he = N && N.exports === ge, Q = he && pe.process, be = function() {
|
|
565
|
-
try {
|
|
566
|
-
var e = N && N.require && N.require("util").types;
|
|
567
|
-
return e || Q && Q.binding && Q.binding("util");
|
|
568
|
-
} catch {
|
|
569
|
-
}
|
|
570
|
-
}(), ye = be && be.isTypedArray;
|
|
571
|
-
function ht(e, n, a) {
|
|
572
|
-
switch (a.length) {
|
|
573
|
-
case 0:
|
|
574
|
-
return e.call(n);
|
|
575
|
-
case 1:
|
|
576
|
-
return e.call(n, a[0]);
|
|
577
|
-
case 2:
|
|
578
|
-
return e.call(n, a[0], a[1]);
|
|
579
|
-
case 3:
|
|
580
|
-
return e.call(n, a[0], a[1], a[2]);
|
|
581
|
-
}
|
|
582
|
-
return e.apply(n, a);
|
|
583
|
-
}
|
|
584
|
-
function bt(e, n) {
|
|
585
|
-
for (var a = -1, c = Array(e); ++a < e; )
|
|
586
|
-
c[a] = n(a);
|
|
587
|
-
return c;
|
|
588
|
-
}
|
|
589
|
-
function yt(e) {
|
|
590
|
-
return function(n) {
|
|
591
|
-
return e(n);
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
function mt(e, n) {
|
|
595
|
-
return e == null ? void 0 : e[n];
|
|
596
|
-
}
|
|
597
|
-
function vt(e, n) {
|
|
598
|
-
return function(a) {
|
|
599
|
-
return e(n(a));
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
var _t = Array.prototype, wt = Function.prototype, q = Object.prototype, ee = M["__core-js_shared__"], G = wt.toString, O = q.hasOwnProperty, me = function() {
|
|
603
|
-
var e = /[^.]+$/.exec(ee && ee.keys && ee.keys.IE_PROTO || "");
|
|
604
|
-
return e ? "Symbol(src)_1." + e : "";
|
|
605
|
-
}(), ve = q.toString, kt = G.call(Object), Tt = RegExp(
|
|
606
|
-
"^" + G.call(O).replace(ft, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
607
|
-
), J = he ? M.Buffer : void 0, _e = M.Symbol, we = M.Uint8Array;
|
|
608
|
-
J && J.allocUnsafe;
|
|
609
|
-
var ke = vt(Object.getPrototypeOf, Object), Te = Object.create, Ct = q.propertyIsEnumerable, At = _t.splice, j = _e ? _e.toStringTag : void 0, W = function() {
|
|
610
|
-
try {
|
|
611
|
-
var e = ne(Object, "defineProperty");
|
|
612
|
-
return e({}, "", {}), e;
|
|
613
|
-
} catch {
|
|
614
|
-
}
|
|
615
|
-
}(), St = J ? J.isBuffer : void 0, Ce = Math.max, It = Date.now, Ae = ne(M, "Map"), z = ne(Object, "create"), $t = /* @__PURE__ */ function() {
|
|
616
|
-
function e() {
|
|
617
|
-
}
|
|
618
|
-
return function(n) {
|
|
619
|
-
if (!R(n))
|
|
620
|
-
return {};
|
|
621
|
-
if (Te)
|
|
622
|
-
return Te(n);
|
|
623
|
-
e.prototype = n;
|
|
624
|
-
var a = new e();
|
|
625
|
-
return e.prototype = void 0, a;
|
|
626
|
-
};
|
|
627
|
-
}();
|
|
628
|
-
function E(e) {
|
|
629
|
-
var n = -1, a = e == null ? 0 : e.length;
|
|
630
|
-
for (this.clear(); ++n < a; ) {
|
|
631
|
-
var c = e[n];
|
|
632
|
-
this.set(c[0], c[1]);
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
function Ot() {
|
|
636
|
-
this.__data__ = z ? z(null) : {}, this.size = 0;
|
|
637
|
-
}
|
|
638
|
-
function xt(e) {
|
|
639
|
-
var n = this.has(e) && delete this.__data__[e];
|
|
640
|
-
return this.size -= n ? 1 : 0, n;
|
|
641
|
-
}
|
|
642
|
-
function jt(e) {
|
|
643
|
-
var n = this.__data__;
|
|
644
|
-
if (z) {
|
|
645
|
-
var a = n[e];
|
|
646
|
-
return a === s ? void 0 : a;
|
|
647
|
-
}
|
|
648
|
-
return O.call(n, e) ? n[e] : void 0;
|
|
649
|
-
}
|
|
650
|
-
function Et(e) {
|
|
651
|
-
var n = this.__data__;
|
|
652
|
-
return z ? n[e] !== void 0 : O.call(n, e);
|
|
653
|
-
}
|
|
654
|
-
function Rt(e, n) {
|
|
655
|
-
var a = this.__data__;
|
|
656
|
-
return this.size += this.has(e) ? 0 : 1, a[e] = z && n === void 0 ? s : n, this;
|
|
657
|
-
}
|
|
658
|
-
E.prototype.clear = Ot, E.prototype.delete = xt, E.prototype.get = jt, E.prototype.has = Et, E.prototype.set = Rt;
|
|
659
|
-
function I(e) {
|
|
660
|
-
var n = -1, a = e == null ? 0 : e.length;
|
|
661
|
-
for (this.clear(); ++n < a; ) {
|
|
662
|
-
var c = e[n];
|
|
663
|
-
this.set(c[0], c[1]);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
function Lt() {
|
|
667
|
-
this.__data__ = [], this.size = 0;
|
|
668
|
-
}
|
|
669
|
-
function Pt(e) {
|
|
670
|
-
var n = this.__data__, a = K(n, e);
|
|
671
|
-
if (a < 0)
|
|
672
|
-
return !1;
|
|
673
|
-
var c = n.length - 1;
|
|
674
|
-
return a == c ? n.pop() : At.call(n, a, 1), --this.size, !0;
|
|
675
|
-
}
|
|
676
|
-
function Mt(e) {
|
|
677
|
-
var n = this.__data__, a = K(n, e);
|
|
678
|
-
return a < 0 ? void 0 : n[a][1];
|
|
679
|
-
}
|
|
680
|
-
function Nt(e) {
|
|
681
|
-
return K(this.__data__, e) > -1;
|
|
682
|
-
}
|
|
683
|
-
function zt(e, n) {
|
|
684
|
-
var a = this.__data__, c = K(a, e);
|
|
685
|
-
return c < 0 ? (++this.size, a.push([e, n])) : a[c][1] = n, this;
|
|
686
|
-
}
|
|
687
|
-
I.prototype.clear = Lt, I.prototype.delete = Pt, I.prototype.get = Mt, I.prototype.has = Nt, I.prototype.set = zt;
|
|
688
|
-
function L(e) {
|
|
689
|
-
var n = -1, a = e == null ? 0 : e.length;
|
|
690
|
-
for (this.clear(); ++n < a; ) {
|
|
691
|
-
var c = e[n];
|
|
692
|
-
this.set(c[0], c[1]);
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
function Ft() {
|
|
696
|
-
this.size = 0, this.__data__ = {
|
|
697
|
-
hash: new E(),
|
|
698
|
-
map: new (Ae || I)(),
|
|
699
|
-
string: new E()
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
function Dt(e) {
|
|
703
|
-
var n = V(this, e).delete(e);
|
|
704
|
-
return this.size -= n ? 1 : 0, n;
|
|
705
|
-
}
|
|
706
|
-
function Bt(e) {
|
|
707
|
-
return V(this, e).get(e);
|
|
708
|
-
}
|
|
709
|
-
function Ut(e) {
|
|
710
|
-
return V(this, e).has(e);
|
|
711
|
-
}
|
|
712
|
-
function Ht(e, n) {
|
|
713
|
-
var a = V(this, e), c = a.size;
|
|
714
|
-
return a.set(e, n), this.size += a.size == c ? 0 : 1, this;
|
|
715
|
-
}
|
|
716
|
-
L.prototype.clear = Ft, L.prototype.delete = Dt, L.prototype.get = Bt, L.prototype.has = Ut, L.prototype.set = Ht;
|
|
717
|
-
function P(e) {
|
|
718
|
-
var n = this.__data__ = new I(e);
|
|
719
|
-
this.size = n.size;
|
|
720
|
-
}
|
|
721
|
-
function qt() {
|
|
722
|
-
this.__data__ = new I(), this.size = 0;
|
|
723
|
-
}
|
|
724
|
-
function Gt(e) {
|
|
725
|
-
var n = this.__data__, a = n.delete(e);
|
|
726
|
-
return this.size = n.size, a;
|
|
727
|
-
}
|
|
728
|
-
function Jt(e) {
|
|
729
|
-
return this.__data__.get(e);
|
|
730
|
-
}
|
|
731
|
-
function Wt(e) {
|
|
732
|
-
return this.__data__.has(e);
|
|
733
|
-
}
|
|
734
|
-
function Kt(e, n) {
|
|
735
|
-
var a = this.__data__;
|
|
736
|
-
if (a instanceof I) {
|
|
737
|
-
var c = a.__data__;
|
|
738
|
-
if (!Ae || c.length < r - 1)
|
|
739
|
-
return c.push([e, n]), this.size = ++a.size, this;
|
|
740
|
-
a = this.__data__ = new L(c);
|
|
741
|
-
}
|
|
742
|
-
return a.set(e, n), this.size = a.size, this;
|
|
743
|
-
}
|
|
744
|
-
P.prototype.clear = qt, P.prototype.delete = Gt, P.prototype.get = Jt, P.prototype.has = Wt, P.prototype.set = Kt;
|
|
745
|
-
function Zt(e, n) {
|
|
746
|
-
var a = se(e), c = !a && ae(e), d = !a && !c && xe(e), h = !a && !c && !d && Ee(e), m = a || c || d || h, p = m ? bt(e.length, String) : [], v = p.length;
|
|
747
|
-
for (var A in e)
|
|
748
|
-
m && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
749
|
-
(A == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
750
|
-
d && (A == "offset" || A == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
751
|
-
h && (A == "buffer" || A == "byteLength" || A == "byteOffset") || // Skip index properties.
|
|
752
|
-
$e(A, v)) || p.push(A);
|
|
753
|
-
return p;
|
|
754
|
-
}
|
|
755
|
-
function te(e, n, a) {
|
|
756
|
-
(a !== void 0 && !X(e[n], a) || a === void 0 && !(n in e)) && re(e, n, a);
|
|
757
|
-
}
|
|
758
|
-
function Vt(e, n, a) {
|
|
759
|
-
var c = e[n];
|
|
760
|
-
(!(O.call(e, n) && X(c, a)) || a === void 0 && !(n in e)) && re(e, n, a);
|
|
761
|
-
}
|
|
762
|
-
function K(e, n) {
|
|
763
|
-
for (var a = e.length; a--; )
|
|
764
|
-
if (X(e[a][0], n))
|
|
765
|
-
return a;
|
|
766
|
-
return -1;
|
|
767
|
-
}
|
|
768
|
-
function re(e, n, a) {
|
|
769
|
-
n == "__proto__" && W ? W(e, n, {
|
|
770
|
-
configurable: !0,
|
|
771
|
-
enumerable: !0,
|
|
772
|
-
value: a,
|
|
773
|
-
writable: !0
|
|
774
|
-
}) : e[n] = a;
|
|
775
|
-
}
|
|
776
|
-
var Xt = ur();
|
|
777
|
-
function Z(e) {
|
|
778
|
-
return e == null ? e === void 0 ? Ye : We : j && j in Object(e) ? fr(e) : yr(e);
|
|
779
|
-
}
|
|
780
|
-
function Se(e) {
|
|
781
|
-
return F(e) && Z(e) == f;
|
|
782
|
-
}
|
|
783
|
-
function Yt(e) {
|
|
784
|
-
if (!R(e) || hr(e))
|
|
785
|
-
return !1;
|
|
786
|
-
var n = le(e) ? Tt : dt;
|
|
787
|
-
return n.test(wr(e));
|
|
788
|
-
}
|
|
789
|
-
function Qt(e) {
|
|
790
|
-
return F(e) && je(e.length) && !!b[Z(e)];
|
|
791
|
-
}
|
|
792
|
-
function er(e) {
|
|
793
|
-
if (!R(e))
|
|
794
|
-
return br(e);
|
|
795
|
-
var n = Oe(e), a = [];
|
|
796
|
-
for (var c in e)
|
|
797
|
-
c == "constructor" && (n || !O.call(e, c)) || a.push(c);
|
|
798
|
-
return a;
|
|
799
|
-
}
|
|
800
|
-
function Ie(e, n, a, c, d) {
|
|
801
|
-
e !== n && Xt(n, function(h, m) {
|
|
802
|
-
if (d || (d = new P()), R(h))
|
|
803
|
-
tr(e, n, m, a, Ie, c, d);
|
|
804
|
-
else {
|
|
805
|
-
var p = c ? c(oe(e, m), h, m + "", e, n, d) : void 0;
|
|
806
|
-
p === void 0 && (p = h), te(e, m, p);
|
|
807
|
-
}
|
|
808
|
-
}, Re);
|
|
809
|
-
}
|
|
810
|
-
function tr(e, n, a, c, d, h, m) {
|
|
811
|
-
var p = oe(e, a), v = oe(n, a), A = m.get(v);
|
|
812
|
-
if (A) {
|
|
813
|
-
te(e, a, A);
|
|
814
|
-
return;
|
|
815
|
-
}
|
|
816
|
-
var k = h ? h(p, v, a + "", e, n, m) : void 0, D = k === void 0;
|
|
817
|
-
if (D) {
|
|
818
|
-
var ce = se(v), ue = !ce && xe(v), Pe = !ce && !ue && Ee(v);
|
|
819
|
-
k = v, ce || ue || Pe ? se(p) ? k = p : kr(p) ? k = ir(p) : ue ? (D = !1, k = or(v)) : Pe ? (D = !1, k = sr(v)) : k = [] : Tr(v) || ae(v) ? (k = p, ae(p) ? k = Cr(p) : (!R(p) || le(p)) && (k = dr(v))) : D = !1;
|
|
820
|
-
}
|
|
821
|
-
D && (m.set(v, k), d(k, v, c, h, m), m.delete(v)), te(e, a, k);
|
|
822
|
-
}
|
|
823
|
-
function rr(e, n) {
|
|
824
|
-
return vr(mr(e, n, Le), e + "");
|
|
825
|
-
}
|
|
826
|
-
var nr = W ? function(e, n) {
|
|
827
|
-
return W(e, "toString", {
|
|
828
|
-
configurable: !0,
|
|
829
|
-
enumerable: !1,
|
|
830
|
-
value: Sr(n),
|
|
831
|
-
writable: !0
|
|
832
|
-
});
|
|
833
|
-
} : Le;
|
|
834
|
-
function or(e, n) {
|
|
835
|
-
return e.slice();
|
|
836
|
-
}
|
|
837
|
-
function ar(e) {
|
|
838
|
-
var n = new e.constructor(e.byteLength);
|
|
839
|
-
return new we(n).set(new we(e)), n;
|
|
840
|
-
}
|
|
841
|
-
function sr(e, n) {
|
|
842
|
-
var a = ar(e.buffer);
|
|
843
|
-
return new e.constructor(a, e.byteOffset, e.length);
|
|
844
|
-
}
|
|
845
|
-
function ir(e, n) {
|
|
846
|
-
var a = -1, c = e.length;
|
|
847
|
-
for (n || (n = Array(c)); ++a < c; )
|
|
848
|
-
n[a] = e[a];
|
|
849
|
-
return n;
|
|
850
|
-
}
|
|
851
|
-
function lr(e, n, a, c) {
|
|
852
|
-
var d = !a;
|
|
853
|
-
a || (a = {});
|
|
854
|
-
for (var h = -1, m = n.length; ++h < m; ) {
|
|
855
|
-
var p = n[h], v = void 0;
|
|
856
|
-
v === void 0 && (v = e[p]), d ? re(a, p, v) : Vt(a, p, v);
|
|
857
|
-
}
|
|
858
|
-
return a;
|
|
859
|
-
}
|
|
860
|
-
function cr(e) {
|
|
861
|
-
return rr(function(n, a) {
|
|
862
|
-
var c = -1, d = a.length, h = d > 1 ? a[d - 1] : void 0, m = d > 2 ? a[2] : void 0;
|
|
863
|
-
for (h = e.length > 3 && typeof h == "function" ? (d--, h) : void 0, m && pr(a[0], a[1], m) && (h = d < 3 ? void 0 : h, d = 1), n = Object(n); ++c < d; ) {
|
|
864
|
-
var p = a[c];
|
|
865
|
-
p && e(n, p, c, h);
|
|
866
|
-
}
|
|
867
|
-
return n;
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
function ur(e) {
|
|
871
|
-
return function(n, a, c) {
|
|
872
|
-
for (var d = -1, h = Object(n), m = c(n), p = m.length; p--; ) {
|
|
873
|
-
var v = m[++d];
|
|
874
|
-
if (a(h[v], v, h) === !1)
|
|
875
|
-
break;
|
|
876
|
-
}
|
|
877
|
-
return n;
|
|
878
|
-
};
|
|
879
|
-
}
|
|
880
|
-
function V(e, n) {
|
|
881
|
-
var a = e.__data__;
|
|
882
|
-
return gr(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map;
|
|
883
|
-
}
|
|
884
|
-
function ne(e, n) {
|
|
885
|
-
var a = mt(e, n);
|
|
886
|
-
return Yt(a) ? a : void 0;
|
|
887
|
-
}
|
|
888
|
-
function fr(e) {
|
|
889
|
-
var n = O.call(e, j), a = e[j];
|
|
890
|
-
try {
|
|
891
|
-
e[j] = void 0;
|
|
892
|
-
var c = !0;
|
|
893
|
-
} catch {
|
|
894
|
-
}
|
|
895
|
-
var d = ve.call(e);
|
|
896
|
-
return c && (n ? e[j] = a : delete e[j]), d;
|
|
897
|
-
}
|
|
898
|
-
function dr(e) {
|
|
899
|
-
return typeof e.constructor == "function" && !Oe(e) ? $t(ke(e)) : {};
|
|
900
|
-
}
|
|
901
|
-
function $e(e, n) {
|
|
902
|
-
var a = typeof e;
|
|
903
|
-
return n = n ?? u, !!n && (a == "number" || a != "symbol" && pt.test(e)) && e > -1 && e % 1 == 0 && e < n;
|
|
904
|
-
}
|
|
905
|
-
function pr(e, n, a) {
|
|
906
|
-
if (!R(a))
|
|
907
|
-
return !1;
|
|
908
|
-
var c = typeof n;
|
|
909
|
-
return (c == "number" ? ie(a) && $e(n, a.length) : c == "string" && n in a) ? X(a[n], e) : !1;
|
|
910
|
-
}
|
|
911
|
-
function gr(e) {
|
|
912
|
-
var n = typeof e;
|
|
913
|
-
return n == "string" || n == "number" || n == "symbol" || n == "boolean" ? e !== "__proto__" : e === null;
|
|
914
|
-
}
|
|
915
|
-
function hr(e) {
|
|
916
|
-
return !!me && me in e;
|
|
917
|
-
}
|
|
918
|
-
function Oe(e) {
|
|
919
|
-
var n = e && e.constructor, a = typeof n == "function" && n.prototype || q;
|
|
920
|
-
return e === a;
|
|
921
|
-
}
|
|
922
|
-
function br(e) {
|
|
923
|
-
var n = [];
|
|
924
|
-
if (e != null)
|
|
925
|
-
for (var a in Object(e))
|
|
926
|
-
n.push(a);
|
|
927
|
-
return n;
|
|
928
|
-
}
|
|
929
|
-
function yr(e) {
|
|
930
|
-
return ve.call(e);
|
|
931
|
-
}
|
|
932
|
-
function mr(e, n, a) {
|
|
933
|
-
return n = Ce(n === void 0 ? e.length - 1 : n, 0), function() {
|
|
934
|
-
for (var c = arguments, d = -1, h = Ce(c.length - n, 0), m = Array(h); ++d < h; )
|
|
935
|
-
m[d] = c[n + d];
|
|
936
|
-
d = -1;
|
|
937
|
-
for (var p = Array(n + 1); ++d < n; )
|
|
938
|
-
p[d] = c[d];
|
|
939
|
-
return p[n] = a(m), ht(e, this, p);
|
|
940
|
-
};
|
|
941
|
-
}
|
|
942
|
-
function oe(e, n) {
|
|
943
|
-
if (!(n === "constructor" && typeof e[n] == "function") && n != "__proto__")
|
|
944
|
-
return e[n];
|
|
945
|
-
}
|
|
946
|
-
var vr = _r(nr);
|
|
947
|
-
function _r(e) {
|
|
948
|
-
var n = 0, a = 0;
|
|
949
|
-
return function() {
|
|
950
|
-
var c = It(), d = l - (c - a);
|
|
951
|
-
if (a = c, d > 0) {
|
|
952
|
-
if (++n >= i)
|
|
953
|
-
return arguments[0];
|
|
954
|
-
} else
|
|
955
|
-
n = 0;
|
|
956
|
-
return e.apply(void 0, arguments);
|
|
957
|
-
};
|
|
958
|
-
}
|
|
959
|
-
function wr(e) {
|
|
960
|
-
if (e != null) {
|
|
961
|
-
try {
|
|
962
|
-
return G.call(e);
|
|
963
|
-
} catch {
|
|
964
|
-
}
|
|
965
|
-
try {
|
|
966
|
-
return e + "";
|
|
967
|
-
} catch {
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
return "";
|
|
971
|
-
}
|
|
972
|
-
function X(e, n) {
|
|
973
|
-
return e === n || e !== e && n !== n;
|
|
974
|
-
}
|
|
975
|
-
var ae = Se(/* @__PURE__ */ function() {
|
|
976
|
-
return arguments;
|
|
977
|
-
}()) ? Se : function(e) {
|
|
978
|
-
return F(e) && O.call(e, "callee") && !Ct.call(e, "callee");
|
|
979
|
-
}, se = Array.isArray;
|
|
980
|
-
function ie(e) {
|
|
981
|
-
return e != null && je(e.length) && !le(e);
|
|
982
|
-
}
|
|
983
|
-
function kr(e) {
|
|
984
|
-
return F(e) && ie(e);
|
|
985
|
-
}
|
|
986
|
-
var xe = St || Ir;
|
|
987
|
-
function le(e) {
|
|
988
|
-
if (!R(e))
|
|
989
|
-
return !1;
|
|
990
|
-
var n = Z(e);
|
|
991
|
-
return n == $ || n == w || n == y || n == Ke;
|
|
992
|
-
}
|
|
993
|
-
function je(e) {
|
|
994
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= u;
|
|
995
|
-
}
|
|
996
|
-
function R(e) {
|
|
997
|
-
var n = typeof e;
|
|
998
|
-
return e != null && (n == "object" || n == "function");
|
|
999
|
-
}
|
|
1000
|
-
function F(e) {
|
|
1001
|
-
return e != null && typeof e == "object";
|
|
1002
|
-
}
|
|
1003
|
-
function Tr(e) {
|
|
1004
|
-
if (!F(e) || Z(e) != de)
|
|
1005
|
-
return !1;
|
|
1006
|
-
var n = ke(e);
|
|
1007
|
-
if (n === null)
|
|
1008
|
-
return !0;
|
|
1009
|
-
var a = O.call(n, "constructor") && n.constructor;
|
|
1010
|
-
return typeof a == "function" && a instanceof a && G.call(a) == kt;
|
|
1011
|
-
}
|
|
1012
|
-
var Ee = ye ? yt(ye) : Qt;
|
|
1013
|
-
function Cr(e) {
|
|
1014
|
-
return lr(e, Re(e));
|
|
1015
|
-
}
|
|
1016
|
-
function Re(e) {
|
|
1017
|
-
return ie(e) ? Zt(e) : er(e);
|
|
1018
|
-
}
|
|
1019
|
-
var Ar = cr(function(e, n, a, c) {
|
|
1020
|
-
Ie(e, n, a, c);
|
|
1021
|
-
});
|
|
1022
|
-
function Sr(e) {
|
|
1023
|
-
return function() {
|
|
1024
|
-
return e;
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
function Le(e) {
|
|
1028
|
-
return e;
|
|
1029
|
-
}
|
|
1030
|
-
function Ir() {
|
|
1031
|
-
return !1;
|
|
1032
|
-
}
|
|
1033
|
-
o.exports = Ar;
|
|
1034
|
-
}(U, U.exports)), U.exports;
|
|
1035
|
-
}
|
|
1036
|
-
var In = Sn();
|
|
1037
|
-
const $n = /* @__PURE__ */ An(In);
|
|
1038
|
-
function On(o) {
|
|
1039
|
-
let t = {};
|
|
1040
|
-
function r(s, i) {
|
|
1041
|
-
if ((i == null ? void 0 : i.type) === "AwaitExpression" && i.argument.type === "CallExpression" && i.argument.callee.type === "Identifier" && i.argument.callee.name === "useStoryblok") {
|
|
1042
|
-
const l = i.argument.arguments;
|
|
1043
|
-
if (l && l[1].type === "ObjectExpression") {
|
|
1044
|
-
const u = qe(l[1].properties);
|
|
1045
|
-
t = {
|
|
1046
|
-
...t,
|
|
1047
|
-
apiOptions: u
|
|
1048
|
-
};
|
|
1049
|
-
}
|
|
1050
|
-
if (l && l[2].type === "ObjectExpression") {
|
|
1051
|
-
const u = qe(l[2].properties);
|
|
1052
|
-
t = {
|
|
1053
|
-
...t,
|
|
1054
|
-
bridgeOptions: u
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
return $n({}, o, r), t;
|
|
1060
|
-
}
|
|
1061
|
-
function qe(o) {
|
|
1062
|
-
const t = {};
|
|
1063
|
-
return o.reduce((r, s) => {
|
|
1064
|
-
if (s.type !== "Property")
|
|
1065
|
-
return r;
|
|
1066
|
-
const { key: i, value: l } = s, { type: u } = l;
|
|
1067
|
-
if (i.type !== "Identifier")
|
|
1068
|
-
return r;
|
|
1069
|
-
if (u === "Literal")
|
|
1070
|
-
r[i.name] = l.value;
|
|
1071
|
-
else if (u === "ArrayExpression") {
|
|
1072
|
-
const f = l.elements.reduce(
|
|
1073
|
-
(g, y) => y.type === "Literal" && y.value ? [...g, y.value] : g,
|
|
1074
|
-
[]
|
|
1075
|
-
);
|
|
1076
|
-
r[i.name] = f;
|
|
1077
|
-
}
|
|
1078
|
-
return r;
|
|
1079
|
-
}, t);
|
|
1080
|
-
}
|
|
1081
|
-
let B = [];
|
|
1082
|
-
function xn(o, t) {
|
|
1083
|
-
const r = "virtual:storyblok-bridge", s = `\0${r}`;
|
|
1084
|
-
if (!o || t !== "server")
|
|
1085
|
-
return {
|
|
1086
|
-
name: "vite-plugin-storyblok-bridge",
|
|
1087
|
-
resolveId(f) {
|
|
1088
|
-
if (f === r)
|
|
1089
|
-
return s;
|
|
1090
|
-
},
|
|
1091
|
-
load(f) {
|
|
1092
|
-
if (f === s)
|
|
1093
|
-
return "export const bridgeOptions = null";
|
|
1094
|
-
}
|
|
1095
|
-
};
|
|
1096
|
-
let i = [], l = null, u;
|
|
1097
|
-
return {
|
|
1098
|
-
name: "vite-plugin-storyblok-bridge",
|
|
1099
|
-
async resolveId(f) {
|
|
1100
|
-
if (f === r)
|
|
1101
|
-
return s;
|
|
1102
|
-
},
|
|
1103
|
-
async transform(f, g) {
|
|
1104
|
-
var w;
|
|
1105
|
-
if (g.includes("node_modules") && !g.includes("/pages/") || !f.includes("useStoryblok"))
|
|
1106
|
-
return;
|
|
1107
|
-
const _ = this.getModuleInfo(g);
|
|
1108
|
-
if (!((w = _ == null ? void 0 : _.meta) != null && w.astro))
|
|
1109
|
-
return;
|
|
1110
|
-
const [, ...C] = g.split("src/pages/"), T = C.join("/").replace(".astro", ""), $ = On(this.parse(f));
|
|
1111
|
-
B.length && (i = B.filter((x) => x.url !== T)), i.push({
|
|
1112
|
-
url: T,
|
|
1113
|
-
options: $
|
|
1114
|
-
}), l && (u && clearTimeout(u), u = setTimeout(() => {
|
|
1115
|
-
jn(B, i) || (B.length !== 0 && (l == null || l.restart(), console.info("Bridge options updated. Restarting...")), B = [...i]);
|
|
1116
|
-
}, 1e3));
|
|
1117
|
-
},
|
|
1118
|
-
async load(f) {
|
|
1119
|
-
if (f === s)
|
|
1120
|
-
return `export const bridgeOptions = ${JSON.stringify(Cn(i))}`;
|
|
1121
|
-
},
|
|
1122
|
-
configureServer(f) {
|
|
1123
|
-
l = f;
|
|
1124
|
-
}
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
function jn(o = [], t = []) {
|
|
1128
|
-
return t.every(({ url: r, options: s }) => {
|
|
1129
|
-
const i = o.find((l) => (l == null ? void 0 : l.url) === r);
|
|
1130
|
-
return i && JSON.stringify(s) === JSON.stringify(i.options);
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
const En = `<svg width="45px" height="53px" viewBox="0 0 45 53" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
1134
|
-
<g id="storyblok-logo-kit" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1135
|
-
<g id="storyblok-partner-logo" transform="translate(-59.000000, -169.000000)" fill-rule="nonzero">
|
|
1136
|
-
<g id="storyblok-symbol" transform="translate(59.000000, 169.000000)">
|
|
1137
|
-
<path d="M2.32662261,0 C1.03405449,0 0,1.0331384 0,2.27290448 L0,42.8752437 C0,44.1150097 1.03405449,44.8898635 2.27491989,44.8898635 L8.27243596,44.8898635 L8.27243596,53 L15.7176283,44.9415205 L42.9132615,44.9415205 C44.1541269,44.9415205 44.9296678,44.1666667 44.9296678,42.8752437 L44.9296678,2.3245614 C44.9296678,1.08479532 44.2058296,0 42.9132615,0 L2.32662261,0 Z" id="Shape-path-Copy" fill="#0AB3AF"></path>
|
|
1138
|
-
<path d="M29.1016723,8.11483254 C30.1351059,8.11483254 31.0135245,8.32132604 31.8402713,8.78593643 C32.6153465,9.19892344 33.33875,9.76678059 33.9071385,10.4378845 C35.0647615,11.8482391 35.6869248,13.6215753 35.6639755,15.445352 C35.6639755,16.7875598 35.3022738,18.0781442 34.630542,19.3171053 C33.9341248,20.5632996 32.8438147,21.5436614 31.5302412,22.1047676 C33.183735,22.569378 34.4755269,23.395352 35.4572888,24.5826897 C36.387379,25.8216507 36.8524241,27.4219754 36.8524241,29.4352871 C36.8524241,30.7258715 36.6168825,31.8756998 36.1290206,32.7391832 C35.6123039,33.668404 34.8372287,34.4427546 33.9071385,35.0106118 C32.9253766,35.6300923 31.8402713,36.1979494 30.600151,36.4560663 C29.3600307,36.7658066 28.0165671,37.0239234 26.6214318,37.0239234 L8.32965751,37.0239234 L8.32965751,8.11483254 L29.1016723,8.11483254 Z M26.1340815,24.271851 L15.77813,24.271851 L15.77813,29.1552028 L25.8851404,29.1552028 C26.4825991,29.1552028 27.0302696,28.9110352 27.4783637,28.5203671 C27.8766695,28.1296989 28.1256107,27.5436967 28.1256107,26.811194 C28.140051,26.1827412 27.948041,25.5663945 27.5779401,25.0531873 C27.1796343,24.5648522 26.7315403,24.271851 26.1340815,24.271851 Z M25.2876816,14.5051475 L15.77813,14.5051475 L15.77813,18.9001641 L25.0885287,18.9001641 C25.586411,18.9001641 26.0842933,18.6559965 26.4825991,18.3629954 C26.9306932,18.0699943 27.1298461,17.4351586 27.1298461,16.6049888 C27.1298461,15.872486 26.9306932,15.3353173 26.5821756,14.9934827 C26.233658,14.7004816 25.7855639,14.5051475 25.2876816,14.5051475 Z" id="Combined-Shape-Copy-3" fill="#FFFFFF"></path>
|
|
1139
|
-
</g>
|
|
1140
|
-
</g>
|
|
1141
|
-
</g>
|
|
1142
|
-
</svg>`;
|
|
1143
|
-
let Ge;
|
|
1144
|
-
async function Nn(o) {
|
|
1145
|
-
const { action: t, story: r } = o || {};
|
|
1146
|
-
if (t === "input" && r) {
|
|
1147
|
-
const s = async () => {
|
|
1148
|
-
const l = await Ln(r), u = document.body;
|
|
1149
|
-
if (l.outerHTML === u.outerHTML)
|
|
1150
|
-
return;
|
|
1151
|
-
const f = document.querySelector('[data-blok-focused="true"]');
|
|
1152
|
-
Rn(u, l, f);
|
|
1153
|
-
};
|
|
1154
|
-
clearTimeout(Ge), Ge = setTimeout(s, 500);
|
|
1155
|
-
}
|
|
1156
|
-
["published", "change"].includes(o == null ? void 0 : o.action) && location.reload();
|
|
1157
|
-
}
|
|
1158
|
-
function Rn(o, t, r) {
|
|
1159
|
-
if (r) {
|
|
1160
|
-
const s = r.getAttribute("data-blok-uid"), i = t.querySelector(
|
|
1161
|
-
`[data-blok-uid="${s}"]`
|
|
1162
|
-
);
|
|
1163
|
-
i && (i.setAttribute("data-blok-focused", "true"), r.replaceWith(i));
|
|
1164
|
-
} else
|
|
1165
|
-
o.replaceWith(t);
|
|
1166
|
-
}
|
|
1167
|
-
async function Ln(o) {
|
|
1168
|
-
const r = await (await fetch(location.href, {
|
|
1169
|
-
method: "POST",
|
|
1170
|
-
body: JSON.stringify({
|
|
1171
|
-
...o,
|
|
1172
|
-
is_storyblok_preview: !0
|
|
1173
|
-
}),
|
|
1174
|
-
headers: {
|
|
1175
|
-
"Content-Type": "application/json"
|
|
1176
|
-
}
|
|
1177
|
-
})).text();
|
|
1178
|
-
return new DOMParser().parseFromString(r, "text/html").body;
|
|
1179
|
-
}
|
|
1180
|
-
function zn() {
|
|
541
|
+
return ve(r) ? "" : (e && (o = new me(e.schema), e.resolver && $e(o, e.resolver)), o.render(r, {}, !1));
|
|
542
|
+
}, Ae = () => B(we);
|
|
543
|
+
function Ee() {
|
|
1181
544
|
if (!(globalThis != null && globalThis.storyblokApiInstance))
|
|
1182
545
|
throw new Error("storyblokApiInstance has not been initialized correctly");
|
|
1183
546
|
return globalThis.storyblokApiInstance;
|
|
1184
547
|
}
|
|
1185
|
-
async function
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
throw new Error("storyblokApiInstance has not been initialized correctly");
|
|
1189
|
-
let i = null;
|
|
1190
|
-
if (s && s.locals._storyblok_preview_data)
|
|
1191
|
-
i = s.locals._storyblok_preview_data;
|
|
1192
|
-
else {
|
|
1193
|
-
const { data: u } = await ((l = globalThis == null ? void 0 : globalThis.storyblokApiInstance) == null ? void 0 : l.get(
|
|
1194
|
-
o,
|
|
1195
|
-
t
|
|
1196
|
-
));
|
|
1197
|
-
i = u.story;
|
|
1198
|
-
}
|
|
1199
|
-
return i;
|
|
548
|
+
async function Le(r) {
|
|
549
|
+
let e = null;
|
|
550
|
+
return r && r.locals._storyblok_preview_data && (e = r.locals._storyblok_preview_data), e;
|
|
1200
551
|
}
|
|
1201
|
-
function
|
|
1202
|
-
var
|
|
1203
|
-
const
|
|
1204
|
-
if (!
|
|
552
|
+
function Re(r, e) {
|
|
553
|
+
var o;
|
|
554
|
+
const t = (o = globalThis == null ? void 0 : globalThis.storyblokApiInstance) == null ? void 0 : o.richTextResolver;
|
|
555
|
+
if (!t)
|
|
1205
556
|
throw new Error(
|
|
1206
557
|
"Please initialize the Storyblok SDK before calling the renderRichText function"
|
|
1207
558
|
);
|
|
1208
|
-
return
|
|
559
|
+
return Ce(r, e, t);
|
|
1209
560
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const
|
|
561
|
+
function Ie(r) {
|
|
562
|
+
return typeof r == "object" ? `const storyblokInstance = new StoryblokBridge(${JSON.stringify(r)});` : "const storyblokInstance = new StoryblokBridge();";
|
|
563
|
+
}
|
|
564
|
+
function je(r) {
|
|
565
|
+
const e = {
|
|
1212
566
|
useCustomApi: !1,
|
|
1213
567
|
bridge: !0,
|
|
1214
568
|
componentsDir: "src",
|
|
1215
569
|
enableFallbackComponent: !1,
|
|
1216
570
|
livePreview: !1,
|
|
1217
|
-
...
|
|
1218
|
-
};
|
|
571
|
+
...r
|
|
572
|
+
}, t = Ie(e.bridge);
|
|
1219
573
|
return {
|
|
1220
574
|
name: "@storyblok/astro",
|
|
1221
575
|
hooks: {
|
|
1222
576
|
"astro:config:setup": ({
|
|
1223
|
-
injectScript:
|
|
577
|
+
injectScript: o,
|
|
1224
578
|
updateConfig: s,
|
|
1225
|
-
addDevToolbarApp:
|
|
1226
|
-
addMiddleware:
|
|
1227
|
-
config:
|
|
579
|
+
addDevToolbarApp: n,
|
|
580
|
+
addMiddleware: a,
|
|
581
|
+
config: l
|
|
1228
582
|
}) => {
|
|
1229
583
|
if (s({
|
|
1230
584
|
vite: {
|
|
1231
585
|
plugins: [
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
586
|
+
N(
|
|
587
|
+
e.accessToken,
|
|
588
|
+
e.useCustomApi,
|
|
589
|
+
e.apiOptions
|
|
1236
590
|
),
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
591
|
+
_(
|
|
592
|
+
e.componentsDir,
|
|
593
|
+
e.components,
|
|
594
|
+
e.enableFallbackComponent,
|
|
595
|
+
e.customFallbackComponent
|
|
1242
596
|
),
|
|
1243
|
-
|
|
1244
|
-
xn(
|
|
1245
|
-
t.livePreview,
|
|
1246
|
-
u.output
|
|
1247
|
-
)
|
|
597
|
+
z(e)
|
|
1248
598
|
]
|
|
1249
599
|
}
|
|
1250
|
-
}),
|
|
600
|
+
}), e.livePreview && (l == null ? void 0 : l.output) !== "server")
|
|
1251
601
|
throw new Error(
|
|
1252
602
|
"To utilize the Astro Storyblok Live feature, Astro must be configured to run in SSR mode. Please disable this feature or switch Astro to SSR mode."
|
|
1253
603
|
);
|
|
1254
|
-
|
|
604
|
+
o(
|
|
1255
605
|
"page-ssr",
|
|
1256
606
|
`
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
`
|
|
1260
|
-
), t.bridge && !t.livePreview) {
|
|
1261
|
-
let f = "";
|
|
1262
|
-
if (typeof t.bridge == "object") {
|
|
1263
|
-
const g = { ...t.bridge };
|
|
1264
|
-
f = `const storyblokInstance = new StoryblokBridge(${JSON.stringify(
|
|
1265
|
-
g
|
|
1266
|
-
)});`;
|
|
1267
|
-
} else
|
|
1268
|
-
f = "const storyblokInstance = new StoryblokBridge()";
|
|
1269
|
-
r(
|
|
1270
|
-
"page",
|
|
607
|
+
import { storyblokApiInstance } from "virtual:storyblok-init";
|
|
608
|
+
globalThis.storyblokApiInstance = storyblokApiInstance;
|
|
1271
609
|
`
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
610
|
+
), e.bridge && !e.livePreview && o(
|
|
611
|
+
"page",
|
|
612
|
+
`
|
|
613
|
+
import { loadStoryblokBridge } from "@storyblok/astro";
|
|
614
|
+
loadStoryblokBridge().then(() => {
|
|
615
|
+
const { StoryblokBridge, location } = window;
|
|
616
|
+
${t}
|
|
617
|
+
storyblokInstance.on(["published", "change"], (event) => {
|
|
618
|
+
if (!event.slugChanged) {
|
|
619
|
+
location.reload(true);
|
|
620
|
+
}
|
|
621
|
+
});
|
|
1281
622
|
});
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
);
|
|
1285
|
-
}
|
|
1286
|
-
t.livePreview && (r(
|
|
623
|
+
`
|
|
624
|
+
), e.livePreview && (o(
|
|
1287
625
|
"page",
|
|
1288
626
|
`
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
const { StoryblokBridge, location } = window;
|
|
1294
|
-
if(bridgeOptions){
|
|
1295
|
-
const storyblokInstance = new StoryblokBridge(bridgeOptions);
|
|
627
|
+
import { loadStoryblokBridge, handleStoryblokMessage } from "@storyblok/astro";
|
|
628
|
+
loadStoryblokBridge().then(() => {
|
|
629
|
+
const { StoryblokBridge, location } = window;
|
|
630
|
+
${t}
|
|
1296
631
|
storyblokInstance.on(["published", "change", "input"], handleStoryblokMessage);
|
|
1297
|
-
};
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
), l({
|
|
632
|
+
});
|
|
633
|
+
`
|
|
634
|
+
), a({
|
|
1301
635
|
entrypoint: "@storyblok/astro/middleware.ts",
|
|
1302
636
|
order: "pre"
|
|
1303
|
-
})),
|
|
637
|
+
})), n({
|
|
1304
638
|
id: "storyblok",
|
|
1305
639
|
name: "Storyblok",
|
|
1306
|
-
icon:
|
|
640
|
+
icon: A,
|
|
1307
641
|
entrypoint: "@storyblok/astro/toolbarApp.ts"
|
|
1308
642
|
});
|
|
1309
643
|
}
|
|
1310
644
|
}
|
|
1311
645
|
};
|
|
1312
646
|
}
|
|
647
|
+
let T;
|
|
648
|
+
async function Me(r) {
|
|
649
|
+
const { action: e, story: t } = r || {};
|
|
650
|
+
if (e === "input" && t) {
|
|
651
|
+
const o = async () => {
|
|
652
|
+
const n = await Te(t), a = document.body;
|
|
653
|
+
if (n.outerHTML === a.outerHTML)
|
|
654
|
+
return;
|
|
655
|
+
const l = document.querySelector('[data-blok-focused="true"]');
|
|
656
|
+
Se(a, n, l), document.dispatchEvent(new Event("storyblok-live-preview-updated"));
|
|
657
|
+
};
|
|
658
|
+
clearTimeout(T), T = setTimeout(o, 500);
|
|
659
|
+
}
|
|
660
|
+
["published", "change"].includes(r == null ? void 0 : r.action) && location.reload();
|
|
661
|
+
}
|
|
662
|
+
function Se(r, e, t) {
|
|
663
|
+
if (t) {
|
|
664
|
+
const o = t.getAttribute("data-blok-uid"), s = e.querySelector(
|
|
665
|
+
`[data-blok-uid="${o}"]`
|
|
666
|
+
);
|
|
667
|
+
s && (s.setAttribute("data-blok-focused", "true"), t.replaceWith(s));
|
|
668
|
+
} else
|
|
669
|
+
r.replaceWith(e);
|
|
670
|
+
}
|
|
671
|
+
async function Te(r) {
|
|
672
|
+
const t = await (await fetch(location.href, {
|
|
673
|
+
method: "POST",
|
|
674
|
+
body: JSON.stringify({
|
|
675
|
+
...r,
|
|
676
|
+
is_storyblok_preview: !0
|
|
677
|
+
}),
|
|
678
|
+
headers: {
|
|
679
|
+
"Content-Type": "application/json"
|
|
680
|
+
}
|
|
681
|
+
})).text();
|
|
682
|
+
return new DOMParser().parseFromString(t, "text/html").body;
|
|
683
|
+
}
|
|
1313
684
|
export {
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
685
|
+
me as RichTextResolver,
|
|
686
|
+
he as RichTextSchema,
|
|
687
|
+
Le as getLiveStory,
|
|
688
|
+
Me as handleStoryblokMessage,
|
|
689
|
+
Ae as loadStoryblokBridge,
|
|
690
|
+
Re as renderRichText,
|
|
691
|
+
je as storyblok,
|
|
692
|
+
xe as storyblokEditable,
|
|
693
|
+
v as toCamelCase,
|
|
694
|
+
Ee as useStoryblokApi
|
|
1324
695
|
};
|