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