@storyblok/react 4.3.4 → 4.3.6

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.
@@ -1,5 +1,5 @@
1
1
  let H = !1;
2
- const U = [], F = (o) => new Promise((e, t) => {
2
+ const U = [], F = (n) => new Promise((e, t) => {
3
3
  if (typeof window > "u" || (window.storyblokRegisterEvent = (s) => {
4
4
  if (window.location === window.parent.location) {
5
5
  console.warn("You are not in Draft Mode or in the Visual Editor.");
@@ -9,35 +9,35 @@ const U = [], F = (o) => new Promise((e, t) => {
9
9
  }, document.getElementById("storyblok-javascript-bridge")))
10
10
  return;
11
11
  const r = document.createElement("script");
12
- r.async = !0, r.src = o, r.id = "storyblok-javascript-bridge", r.onerror = (s) => t(s), r.onload = (s) => {
13
- U.forEach((n) => n()), H = !0, e(s);
12
+ r.async = !0, r.src = n, r.id = "storyblok-javascript-bridge", r.onerror = (s) => t(s), r.onload = (s) => {
13
+ U.forEach((o) => o()), H = !0, e(s);
14
14
  }, document.getElementsByTagName("head")[0].appendChild(r);
15
15
  });
16
- var Q = Object.defineProperty, Z = (o, e, t) => e in o ? Q(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, p = (o, e, t) => Z(o, typeof e != "symbol" ? e + "" : e, t);
16
+ var Q = Object.defineProperty, Z = (n, e, t) => e in n ? Q(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, p = (n, e, t) => Z(n, typeof e != "symbol" ? e + "" : e, t);
17
17
  class ee extends Error {
18
18
  constructor(e) {
19
19
  super(e), this.name = "AbortError";
20
20
  }
21
21
  }
22
- function te(o, e, t) {
22
+ function te(n, e, t) {
23
23
  if (!Number.isFinite(e))
24
24
  throw new TypeError("Expected `limit` to be a finite number");
25
25
  if (!Number.isFinite(t))
26
26
  throw new TypeError("Expected `interval` to be a finite number");
27
27
  const r = [];
28
- let s = [], n = 0, i = !1;
28
+ let s = [], o = 0, i = !1;
29
29
  const l = async () => {
30
- n++;
30
+ o++;
31
31
  const h = r.shift();
32
32
  if (h)
33
33
  try {
34
- const d = await o(...h.args);
34
+ const d = await n(...h.args);
35
35
  h.resolve(d);
36
36
  } catch (d) {
37
37
  h.reject(d);
38
38
  }
39
39
  const u = setTimeout(() => {
40
- n--, r.length > 0 && l(), s = s.filter((d) => d !== u);
40
+ o--, r.length > 0 && l(), s = s.filter((d) => d !== u);
41
41
  }, t);
42
42
  s.includes(u) || s.push(u);
43
43
  }, a = (...h) => i ? Promise.reject(
@@ -49,7 +49,7 @@ function te(o, e, t) {
49
49
  resolve: u,
50
50
  reject: d,
51
51
  args: h
52
- }), n < e && l();
52
+ }), o < e && l();
53
53
  });
54
54
  return a.abort = () => {
55
55
  i = !0, s.forEach(clearTimeout), s = [], r.forEach(
@@ -65,7 +65,7 @@ class A {
65
65
  page: r
66
66
  })), p(this, "delay", (e) => new Promise((t) => setTimeout(t, e))), p(this, "arrayFrom", (e = 0, t) => Array.from({ length: e }, t)), p(this, "range", (e = 0, t = e) => {
67
67
  const r = Math.abs(t - e) || 0, s = e < t ? 1 : -1;
68
- return this.arrayFrom(r, (n, i) => i * s + e);
68
+ return this.arrayFrom(r, (o, i) => i * s + e);
69
69
  }), p(this, "asyncMap", async (e, t) => Promise.all(e.map(t))), p(this, "flatMap", (e = [], t) => e.map(t).reduce((r, s) => [...r, ...s], [])), p(this, "escapeHTML", function(e) {
70
70
  const t = {
71
71
  "&": "&amp;",
@@ -74,7 +74,7 @@ class A {
74
74
  '"': "&quot;",
75
75
  "'": "&#39;"
76
76
  }, r = /[&<>"']/g, s = new RegExp(r.source);
77
- return e && s.test(e) ? e.replace(r, (n) => t[n]) : e;
77
+ return e && s.test(e) ? e.replace(r, (o) => t[o]) : e;
78
78
  });
79
79
  }
80
80
  /**
@@ -86,10 +86,10 @@ class A {
86
86
  */
87
87
  stringify(e, t, r) {
88
88
  const s = [];
89
- for (const n in e) {
90
- if (!Object.prototype.hasOwnProperty.call(e, n))
89
+ for (const o in e) {
90
+ if (!Object.prototype.hasOwnProperty.call(e, o))
91
91
  continue;
92
- const i = e[n], l = r ? "" : encodeURIComponent(n);
92
+ const i = e[o], l = r ? "" : encodeURIComponent(o);
93
93
  let a;
94
94
  typeof i == "object" ? a = this.stringify(
95
95
  i,
@@ -105,14 +105,14 @@ class A {
105
105
  * @return {string} The base URL of the region
106
106
  */
107
107
  getRegionURL(e) {
108
- const t = "api.storyblok.com", r = "api-us.storyblok.com", s = "app.storyblokchina.cn", n = "api-ap.storyblok.com", i = "api-ca.storyblok.com";
108
+ const t = "api.storyblok.com", r = "api-us.storyblok.com", s = "app.storyblokchina.cn", o = "api-ap.storyblok.com", i = "api-ca.storyblok.com";
109
109
  switch (e) {
110
110
  case "us":
111
111
  return r;
112
112
  case "cn":
113
113
  return s;
114
114
  case "ap":
115
- return n;
115
+ return o;
116
116
  case "ca":
117
117
  return i;
118
118
  default:
@@ -120,36 +120,36 @@ class A {
120
120
  }
121
121
  }
122
122
  }
123
- const re = function(o, e) {
123
+ const re = function(n, e) {
124
124
  const t = {};
125
- for (const r in o) {
126
- const s = o[r];
125
+ for (const r in n) {
126
+ const s = n[r];
127
127
  e.includes(r) && s !== null && (t[r] = s);
128
128
  }
129
129
  return t;
130
- }, se = (o) => o === "email", oe = () => ({
130
+ }, se = (n) => n === "email", ne = () => ({
131
131
  singleTag: "hr"
132
- }), ne = () => ({
132
+ }), oe = () => ({
133
133
  tag: "blockquote"
134
134
  }), ie = () => ({
135
135
  tag: "ul"
136
- }), ae = (o) => ({
136
+ }), ae = (n) => ({
137
137
  tag: [
138
138
  "pre",
139
139
  {
140
140
  tag: "code",
141
- attrs: o.attrs
141
+ attrs: n.attrs
142
142
  }
143
143
  ]
144
144
  }), le = () => ({
145
145
  singleTag: "br"
146
- }), ce = (o) => ({
147
- tag: `h${o.attrs.level}`
148
- }), he = (o) => ({
146
+ }), ce = (n) => ({
147
+ tag: `h${n.attrs.level}`
148
+ }), he = (n) => ({
149
149
  singleTag: [
150
150
  {
151
151
  tag: "img",
152
- attrs: re(o.attrs, ["src", "alt", "title"])
152
+ attrs: re(n.attrs, ["src", "alt", "title"])
153
153
  }
154
154
  ]
155
155
  }), ue = () => ({
@@ -158,20 +158,20 @@ const re = function(o, e) {
158
158
  tag: "ol"
159
159
  }), pe = () => ({
160
160
  tag: "p"
161
- }), ge = (o) => ({
161
+ }), ge = (n) => ({
162
162
  tag: [
163
163
  {
164
164
  tag: "span",
165
165
  attrs: {
166
166
  "data-type": "emoji",
167
- "data-name": o.attrs.name,
168
- emoji: o.attrs.emoji
167
+ "data-name": n.attrs.name,
168
+ emoji: n.attrs.emoji
169
169
  }
170
170
  }
171
171
  ]
172
- }), me = () => ({
173
- tag: "b"
174
172
  }), fe = () => ({
173
+ tag: "b"
174
+ }), me = () => ({
175
175
  tag: "s"
176
176
  }), ye = () => ({
177
177
  tag: "u"
@@ -179,15 +179,15 @@ const re = function(o, e) {
179
179
  tag: "strong"
180
180
  }), ke = () => ({
181
181
  tag: "code"
182
- }), ve = () => ({
182
+ }), $e = () => ({
183
183
  tag: "i"
184
- }), $e = (o) => {
185
- if (!o.attrs)
184
+ }), ve = (n) => {
185
+ if (!n.attrs)
186
186
  return {
187
187
  tag: ""
188
188
  };
189
- const e = new A().escapeHTML, t = { ...o.attrs }, { linktype: r = "url" } = o.attrs;
190
- if (delete t.linktype, t.href && (t.href = e(o.attrs.href || "")), se(r) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
189
+ const e = new A().escapeHTML, t = { ...n.attrs }, { linktype: r = "url" } = n.attrs;
190
+ if (delete t.linktype, t.href && (t.href = e(n.attrs.href || "")), se(r) && (t.href = `mailto:${t.href}`), t.anchor && (t.href = `${t.href}#${t.anchor}`, delete t.anchor), t.custom) {
191
191
  for (const s in t.custom)
192
192
  t[s] = t.custom[s];
193
193
  delete t.custom;
@@ -200,46 +200,46 @@ const re = function(o, e) {
200
200
  }
201
201
  ]
202
202
  };
203
- }, Te = (o) => ({
203
+ }, Te = (n) => ({
204
204
  tag: [
205
205
  {
206
206
  tag: "span",
207
- attrs: o.attrs
207
+ attrs: n.attrs
208
208
  }
209
209
  ]
210
210
  }), we = () => ({
211
211
  tag: "sub"
212
212
  }), Re = () => ({
213
213
  tag: "sup"
214
- }), _e = (o) => ({
214
+ }), _e = (n) => ({
215
215
  tag: [
216
216
  {
217
217
  tag: "span",
218
- attrs: o.attrs
218
+ attrs: n.attrs
219
219
  }
220
220
  ]
221
- }), Se = (o) => {
221
+ }), Se = (n) => {
222
222
  var e;
223
- return (e = o.attrs) != null && e.color ? {
223
+ return (e = n.attrs) != null && e.color ? {
224
224
  tag: [
225
225
  {
226
226
  tag: "span",
227
227
  attrs: {
228
- style: `background-color:${o.attrs.color};`
228
+ style: `background-color:${n.attrs.color};`
229
229
  }
230
230
  }
231
231
  ]
232
232
  } : {
233
233
  tag: ""
234
234
  };
235
- }, Ee = (o) => {
235
+ }, Ee = (n) => {
236
236
  var e;
237
- return (e = o.attrs) != null && e.color ? {
237
+ return (e = n.attrs) != null && e.color ? {
238
238
  tag: [
239
239
  {
240
240
  tag: "span",
241
241
  attrs: {
242
- style: `color:${o.attrs.color}`
242
+ style: `color:${n.attrs.color}`
243
243
  }
244
244
  }
245
245
  ]
@@ -248,8 +248,8 @@ const re = function(o, e) {
248
248
  };
249
249
  }, je = {
250
250
  nodes: {
251
- horizontal_rule: oe,
252
- blockquote: ne,
251
+ horizontal_rule: ne,
252
+ blockquote: oe,
253
253
  bullet_list: ie,
254
254
  code_block: ae,
255
255
  hard_break: le,
@@ -261,13 +261,13 @@ const re = function(o, e) {
261
261
  emoji: ge
262
262
  },
263
263
  marks: {
264
- bold: me,
265
- strike: fe,
264
+ bold: fe,
265
+ strike: me,
266
266
  underline: ye,
267
267
  strong: be,
268
268
  code: ke,
269
- italic: ve,
270
- link: $e,
269
+ italic: $e,
270
+ link: ve,
271
271
  styled: Te,
272
272
  subscript: we,
273
273
  superscript: Re,
@@ -275,7 +275,7 @@ const re = function(o, e) {
275
275
  highlight: Se,
276
276
  textStyle: Ee
277
277
  }
278
- }, Ie = function(o) {
278
+ }, Ie = function(n) {
279
279
  const e = {
280
280
  "&": "&amp;",
281
281
  "<": "&lt;",
@@ -283,7 +283,7 @@ const re = function(o, e) {
283
283
  '"': "&quot;",
284
284
  "'": "&#39;"
285
285
  }, t = /[&<>"']/g, r = new RegExp(t.source);
286
- return o && r.test(o) ? o.replace(t, (s) => e[s]) : o;
286
+ return n && r.test(n) ? n.replace(t, (s) => e[s]) : n;
287
287
  };
288
288
  let z = !1;
289
289
  class xe {
@@ -301,8 +301,8 @@ class xe {
301
301
  "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/"
302
302
  ), z = !0), e && e.content && Array.isArray(e.content)) {
303
303
  let s = "";
304
- return e.content.forEach((n) => {
305
- s += this.renderNode(n);
304
+ return e.content.forEach((o) => {
305
+ s += this.renderNode(o);
306
306
  }), t.optimizeImages ? this.optimizeImages(s, t.optimizeImages) : s;
307
307
  }
308
308
  return console.warn(
@@ -333,8 +333,8 @@ class xe {
333
333
  ), "";
334
334
  }
335
335
  optimizeImages(e, t) {
336
- let r = 0, s = 0, n = "", i = "";
337
- typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (n += `width="${t.width}" `, r = 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 && (i += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (i += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-F]{6}/gi) || t.filters.fill === "transparent") && (i += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (i += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (i += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (i += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (i += `:rotate(${t.filters.rotate})`), i.length > 0 && (i = `/filters${i}`))), n.length > 0 && (e = e.replace(/<img/g, `<img ${n.trim()}`));
336
+ let r = 0, s = 0, o = "", i = "";
337
+ typeof t != "boolean" && (typeof t.width == "number" && t.width > 0 && (o += `width="${t.width}" `, r = t.width), typeof t.height == "number" && t.height > 0 && (o += `height="${t.height}" `, s = t.height), (t.loading === "lazy" || t.loading === "eager") && (o += `loading="${t.loading}" `), typeof t.class == "string" && t.class.length > 0 && (o += `class="${t.class}" `), t.filters && (typeof t.filters.blur == "number" && t.filters.blur >= 0 && t.filters.blur <= 100 && (i += `:blur(${t.filters.blur})`), typeof t.filters.brightness == "number" && t.filters.brightness >= -100 && t.filters.brightness <= 100 && (i += `:brightness(${t.filters.brightness})`), t.filters.fill && (t.filters.fill.match(/[0-9A-F]{6}/gi) || t.filters.fill === "transparent") && (i += `:fill(${t.filters.fill})`), t.filters.format && ["webp", "png", "jpeg"].includes(t.filters.format) && (i += `:format(${t.filters.format})`), typeof t.filters.grayscale == "boolean" && t.filters.grayscale && (i += ":grayscale()"), typeof t.filters.quality == "number" && t.filters.quality >= 0 && t.filters.quality <= 100 && (i += `:quality(${t.filters.quality})`), t.filters.rotate && [90, 180, 270].includes(t.filters.rotate) && (i += `:rotate(${t.filters.rotate})`), i.length > 0 && (i = `/filters${i}`))), o.length > 0 && (e = e.replace(/<img/g, `<img ${o.trim()}`));
338
338
  const l = r > 0 || s > 0 || i.length > 0 ? `${r}x${s}${i}` : "";
339
339
  return e = e.replace(
340
340
  /a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g,
@@ -345,7 +345,7 @@ class xe {
345
345
  /a.storyblok.com\/f\/(\d+)\/([^.]+)\.(gif|jpg|jpeg|png|tif|bmp)/g
346
346
  );
347
347
  if (d && d.length > 0) {
348
- const f = {
348
+ const m = {
349
349
  srcset: (h = t.srcset) == null ? void 0 : h.map((y) => {
350
350
  if (typeof y == "number")
351
351
  return `//${d}/m/${y}x0${i} ${y}w`;
@@ -358,7 +358,7 @@ class xe {
358
358
  sizes: (u = t.sizes) == null ? void 0 : u.map((y) => y).join(", ")
359
359
  };
360
360
  let b = "";
361
- return f.srcset && (b += `srcset="${f.srcset}" `), f.sizes && (b += `sizes="${f.sizes}" `), a.replace(/<img/g, `<img ${b.trim()}`);
361
+ return m.srcset && (b += `srcset="${m.srcset}" `), m.sizes && (b += `sizes="${m.sizes}" `), a.replace(/<img/g, `<img ${b.trim()}`);
362
362
  }
363
363
  return a;
364
364
  })), e;
@@ -366,15 +366,15 @@ class xe {
366
366
  renderNode(e) {
367
367
  const t = [];
368
368
  e.marks && e.marks.forEach((s) => {
369
- const n = this.getMatchingMark(s);
370
- n && n.tag !== "" && t.push(this.renderOpeningTag(n.tag));
369
+ const o = this.getMatchingMark(s);
370
+ o && o.tag !== "" && t.push(this.renderOpeningTag(o.tag));
371
371
  });
372
372
  const r = this.getMatchingNode(e);
373
373
  return r && r.tag && t.push(this.renderOpeningTag(r.tag)), e.content ? e.content.forEach((s) => {
374
374
  t.push(this.renderNode(s));
375
375
  }) : e.text ? t.push(Ie(e.text)) : r && r.singleTag ? t.push(this.renderTag(r.singleTag, " /")) : r && r.html ? t.push(r.html) : e.type === "emoji" && t.push(this.renderEmoji(e)), r && r.tag && t.push(this.renderClosingTag(r.tag)), e.marks && e.marks.slice(0).reverse().forEach((s) => {
376
- const n = this.getMatchingMark(s);
377
- n && n.tag !== "" && t.push(this.renderClosingTag(n.tag));
376
+ const o = this.getMatchingMark(s);
377
+ o && o.tag !== "" && t.push(this.renderClosingTag(o.tag));
378
378
  }), t.join("");
379
379
  }
380
380
  renderTag(e, t) {
@@ -384,10 +384,10 @@ class xe {
384
384
  {
385
385
  let s = `<${r.tag}`;
386
386
  if (r.attrs) {
387
- for (const n in r.attrs)
388
- if (Object.prototype.hasOwnProperty.call(r.attrs, n)) {
389
- const i = r.attrs[n];
390
- i !== null && (s += ` ${n}="${i}"`);
387
+ for (const o in r.attrs)
388
+ if (Object.prototype.hasOwnProperty.call(r.attrs, o)) {
389
+ const i = r.attrs[o];
390
+ i !== null && (s += ` ${o}="${i}"`);
391
391
  }
392
392
  }
393
393
  return `${s}${t}>`;
@@ -473,9 +473,9 @@ class Oe {
473
473
  )}`;
474
474
  } else
475
475
  r = JSON.stringify(this.parameters);
476
- const s = new URL(t), n = new AbortController(), { signal: i } = n;
476
+ const s = new URL(t), o = new AbortController(), { signal: i } = o;
477
477
  let l;
478
- this.timeout && (l = setTimeout(() => n.abort(), this.timeout));
478
+ this.timeout && (l = setTimeout(() => o.abort(), this.timeout));
479
479
  try {
480
480
  const a = await this.fetch(`${s}`, {
481
481
  method: e,
@@ -506,12 +506,12 @@ class Oe {
506
506
  return new Promise((r, s) => {
507
507
  if (t.test(`${e.status}`))
508
508
  return r(e);
509
- const n = {
509
+ const o = {
510
510
  message: e.statusText,
511
511
  status: e.status,
512
512
  response: Array.isArray(e.data) ? e.data[0] : e.data.error || e.data.slug
513
513
  };
514
- s(n);
514
+ s(o);
515
515
  });
516
516
  }
517
517
  }
@@ -542,10 +542,10 @@ class Le {
542
542
  P.defaultAgentVersion,
543
543
  P.packageVersion
544
544
  ));
545
- let n = 5;
546
- e.oauthToken && (s.set("Authorization", e.oauthToken), n = 3), e.rateLimit && (n = e.rateLimit), e.richTextSchema ? this.richTextResolver = new L(e.richTextSchema) : this.richTextResolver = new L(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries || 10, this.retriesDelay = 300, this.throttle = te(
545
+ let o = 5;
546
+ e.oauthToken && (s.set("Authorization", e.oauthToken), o = 3), e.rateLimit && (o = e.rateLimit), e.richTextSchema ? this.richTextResolver = new L(e.richTextSchema) : this.richTextResolver = new L(), e.componentResolver && this.setComponentResolver(e.componentResolver), this.maxRetries = e.maxRetries || 10, this.retriesDelay = 300, this.throttle = te(
547
547
  this.throttledRequest.bind(this),
548
- n,
548
+ o,
549
549
  1e3
550
550
  ), this.accessToken = e.accessToken || "", this.relations = {}, this.links = {}, this.cache = e.cache || { clear: "manual" }, this.helpers = new A(), this.resolveCounter = 0, this.resolveNestedRelations = e.resolveNestedRelations || !0, this.stringifiedStoriesCache = {}, this.client = new Ae({
551
551
  baseURL: r,
@@ -571,30 +571,30 @@ class Le {
571
571
  factoryParamOptions(e, t) {
572
572
  return this.helpers.isCDNUrl(e) ? this.parseParams(t) : t;
573
573
  }
574
- makeRequest(e, t, r, s, n) {
574
+ makeRequest(e, t, r, s, o) {
575
575
  const i = this.factoryParamOptions(
576
576
  e,
577
577
  this.helpers.getOptionsPage(t, r, s)
578
578
  );
579
- return this.cacheResponse(e, i, void 0, n);
579
+ return this.cacheResponse(e, i, void 0, o);
580
580
  }
581
581
  get(e, t, r) {
582
582
  t || (t = {});
583
- const s = `/${e}`, n = this.factoryParamOptions(s, t);
584
- return this.cacheResponse(s, n, void 0, r);
583
+ const s = `/${e}`, o = this.factoryParamOptions(s, t);
584
+ return this.cacheResponse(s, o, void 0, r);
585
585
  }
586
586
  async getAll(e, t, r, s) {
587
- const n = (t == null ? void 0 : t.per_page) || 25, i = `/${e}`.replace(/\/$/, ""), l = r ?? i.substring(i.lastIndexOf("/") + 1), a = 1, h = await this.makeRequest(
587
+ const o = (t == null ? void 0 : t.per_page) || 25, i = `/${e}`.replace(/\/$/, ""), l = r ?? i.substring(i.lastIndexOf("/") + 1), a = 1, h = await this.makeRequest(
588
588
  i,
589
589
  t,
590
- n,
590
+ o,
591
591
  a,
592
592
  s
593
- ), u = h.total ? Math.ceil(h.total / n) : 1, d = await this.helpers.asyncMap(
593
+ ), u = h.total ? Math.ceil(h.total / o) : 1, d = await this.helpers.asyncMap(
594
594
  this.helpers.range(a, u),
595
- (f) => this.makeRequest(i, t, n, f + 1, s)
595
+ (m) => this.makeRequest(i, t, o, m + 1, s)
596
596
  );
597
- return this.helpers.flatMap([h, ...d], (f) => Object.values(f.data[l]));
597
+ return this.helpers.flatMap([h, ...d], (m) => Object.values(m.data[l]));
598
598
  }
599
599
  post(e, t, r) {
600
600
  const s = `/${e}`;
@@ -659,7 +659,7 @@ class Le {
659
659
  _resolveField(e, t, r) {
660
660
  const s = e[t];
661
661
  typeof s == "string" ? e[t] = this.getStoryReference(r, s) : Array.isArray(s) && (e[t] = s.map(
662
- (n) => this.getStoryReference(r, n)
662
+ (o) => this.getStoryReference(r, o)
663
663
  ).filter(Boolean));
664
664
  }
665
665
  /**
@@ -684,8 +684,8 @@ class Le {
684
684
  this._resolveField(e, t, s);
685
685
  return;
686
686
  }
687
- const n = e.component ? `${e.component}.${t}` : t;
688
- (Array.isArray(r) ? r.includes(n) : r === n) && this._resolveField(e, t, s);
687
+ const o = e.component ? `${e.component}.${t}` : t;
688
+ (Array.isArray(r) ? r.includes(o) : r === o) && this._resolveField(e, t, s);
689
689
  }
690
690
  /**
691
691
  * Recursively traverses and resolves relations in the story content tree
@@ -694,14 +694,14 @@ class Le {
694
694
  * @param resolveId - The unique identifier for the current resolution context
695
695
  */
696
696
  iterateTree(e, t, r) {
697
- const s = (n, i = "") => {
698
- if (!(!n || n._stopResolving)) {
699
- if (Array.isArray(n))
700
- n.forEach((l, a) => s(l, `${i}[${a}]`));
701
- else if (typeof n == "object")
702
- for (const l in n) {
697
+ const s = (o, i = "") => {
698
+ if (!(!o || o._stopResolving)) {
699
+ if (Array.isArray(o))
700
+ o.forEach((l, a) => s(l, `${i}[${a}]`));
701
+ else if (typeof o == "object")
702
+ for (const l in o) {
703
703
  const a = i ? `${i}.${l}` : l;
704
- (n.component && n._uid || n.type === "link") && (this._insertRelations(n, l, t, r), this._insertLinks(n, l, r)), s(n[l], a);
704
+ (o.component && o._uid || o.type === "link") && (this._insertRelations(o, l, t, r), this._insertLinks(o, l, r)), s(o[l], a);
705
705
  }
706
706
  }
707
707
  };
@@ -710,9 +710,9 @@ class Le {
710
710
  async resolveLinks(e, t, r) {
711
711
  let s = [];
712
712
  if (e.link_uuids) {
713
- const n = e.link_uuids.length, i = [], l = 50;
714
- for (let a = 0; a < n; a += l) {
715
- const h = Math.min(n, a + l);
713
+ const o = e.link_uuids.length, i = [], l = 50;
714
+ for (let a = 0; a < o; a += l) {
715
+ const h = Math.min(o, a + l);
716
716
  i.push(e.link_uuids.slice(a, h));
717
717
  }
718
718
  for (let a = 0; a < i.length; a++)
@@ -728,9 +728,9 @@ class Le {
728
728
  );
729
729
  } else
730
730
  s = e.links;
731
- s.forEach((n) => {
732
- this.links[r][n.uuid] = {
733
- ...n,
731
+ s.forEach((o) => {
732
+ this.links[r][o.uuid] = {
733
+ ...o,
734
734
  _stopResolving: !0
735
735
  };
736
736
  });
@@ -738,9 +738,9 @@ class Le {
738
738
  async resolveRelations(e, t, r) {
739
739
  let s = [];
740
740
  if (e.rel_uuids) {
741
- const n = e.rel_uuids.length, i = [], l = 50;
742
- for (let a = 0; a < n; a += l) {
743
- const h = Math.min(n, a + l);
741
+ const o = e.rel_uuids.length, i = [], l = 50;
742
+ for (let a = 0; a < o; a += l) {
743
+ const h = Math.min(o, a + l);
744
744
  i.push(e.rel_uuids.slice(a, h));
745
745
  }
746
746
  for (let a = 0; a < i.length; a++)
@@ -755,9 +755,9 @@ class Le {
755
755
  });
756
756
  } else
757
757
  s = e.rels;
758
- s && s.length > 0 && s.forEach((n) => {
759
- this.relations[r][n.uuid] = {
760
- ...n,
758
+ s && s.length > 0 && s.forEach((o) => {
759
+ this.relations[r][o.uuid] = {
760
+ ...o,
761
761
  _stopResolving: !0
762
762
  };
763
763
  });
@@ -772,9 +772,9 @@ class Le {
772
772
  *
773
773
  */
774
774
  async resolveStories(e, t, r) {
775
- var s, n;
775
+ var s, o;
776
776
  let i = [];
777
- if (this.links[r] = {}, this.relations[r] = {}, typeof t.resolve_relations < "u" && t.resolve_relations.length > 0 && (typeof t.resolve_relations == "string" && (i = t.resolve_relations.split(",")), await this.resolveRelations(e, t, r)), t.resolve_links && ["1", "story", "url", "link"].includes(t.resolve_links) && ((s = e.links) != null && s.length || (n = e.link_uuids) != null && n.length) && await this.resolveLinks(e, t, r), this.resolveNestedRelations)
777
+ if (this.links[r] = {}, this.relations[r] = {}, typeof t.resolve_relations < "u" && t.resolve_relations.length > 0 && (typeof t.resolve_relations == "string" && (i = t.resolve_relations.split(",")), await this.resolveRelations(e, t, r)), t.resolve_links && ["1", "story", "url", "link"].includes(t.resolve_links) && ((s = e.links) != null && s.length || (o = e.link_uuids) != null && o.length) && await this.resolveLinks(e, t, r), this.resolveNestedRelations)
778
778
  for (const l in this.relations[r])
779
779
  this.iterateTree(
780
780
  this.relations[r][l],
@@ -786,9 +786,9 @@ class Le {
786
786
  }), this.stringifiedStoriesCache = {}, delete this.links[r], delete this.relations[r];
787
787
  }
788
788
  async cacheResponse(e, t, r, s) {
789
- const n = this.helpers.stringify({ url: e, params: t }), i = this.cacheProvider();
789
+ const o = this.helpers.stringify({ url: e, params: t }), i = this.cacheProvider();
790
790
  if (this.cache.clear === "auto" && t.version === "draft" && await this.flushCache(), t.version === "published" && e !== "/cdn/spaces/me") {
791
- const l = await i.get(n);
791
+ const l = await i.get(o);
792
792
  if (l)
793
793
  return Promise.resolve(l);
794
794
  }
@@ -808,10 +808,10 @@ class Le {
808
808
  perPage: u.headers["per-page"] ? Number.parseInt(u.headers["per-page"]) : 0,
809
809
  total: u.headers["per-page"] ? Number.parseInt(u.headers.total) : 0
810
810
  })), d.data.story || d.data.stories) {
811
- const f = this.resolveCounter = ++this.resolveCounter % 1e3;
812
- await this.resolveStories(d.data, t, `${f}`);
811
+ const m = this.resolveCounter = ++this.resolveCounter % 1e3;
812
+ await this.resolveStories(d.data, t, `${m}`);
813
813
  }
814
- return t.version === "published" && e !== "/cdn/spaces/me" && await i.set(n, d), d.data.cv && t.token && E[t.token] !== d.data.cv && (await this.flushCache(), E[t.token] = d.data.cv), l(d);
814
+ return t.version === "published" && e !== "/cdn/spaces/me" && await i.set(o, d), d.data.cv && t.token && E[t.token] !== d.data.cv && (await this.flushCache(), E[t.token] = d.data.cv), l(d);
815
815
  } catch (u) {
816
816
  if (u.response && u.status === 429 && (r = typeof r > "u" ? 0 : r + 1, r < this.maxRetries))
817
817
  return console.log(
@@ -877,8 +877,8 @@ class Le {
877
877
  return await this.cacheProvider().flush(), this.clearCacheVersion(), this;
878
878
  }
879
879
  }
880
- const ze = (o = {}) => {
881
- const { apiOptions: e } = o;
880
+ const ze = (n = {}) => {
881
+ const { apiOptions: e } = n;
882
882
  if (!e || !e.accessToken) {
883
883
  console.error(
884
884
  "You need to provide an access token to interact with Storyblok API. Read https://www.storyblok.com/docs/api/content-delivery#topics/authentication"
@@ -886,12 +886,12 @@ const ze = (o = {}) => {
886
886
  return;
887
887
  }
888
888
  return { storyblokApi: new Le(e) };
889
- }, De = (o) => {
890
- if (typeof o != "object" || typeof o._editable > "u")
889
+ }, De = (n) => {
890
+ if (typeof n != "object" || typeof n._editable > "u")
891
891
  return {};
892
892
  try {
893
893
  const e = JSON.parse(
894
- o._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
894
+ n._editable.replace(/^<!--#storyblok#/, "").replace(/-->$/, "")
895
895
  );
896
896
  return e ? {
897
897
  "data-blok-c": JSON.stringify(e),
@@ -901,38 +901,38 @@ const ze = (o = {}) => {
901
901
  return {};
902
902
  }
903
903
  };
904
- function Ce(o, e) {
904
+ function Ce(n, e) {
905
905
  if (!e)
906
- return { src: o, attrs: {} };
906
+ return { src: n, attrs: {} };
907
907
  let t = 0, r = 0;
908
- const s = {}, n = [];
909
- function i(a, h, u, d, f) {
910
- typeof a != "number" || a <= h || a >= u ? console.warn(`[StoryblokRichText] - ${d.charAt(0).toUpperCase() + d.slice(1)} value must be a number between ${h} and ${u} (inclusive)`) : f.push(`${d}(${a})`);
908
+ const s = {}, o = [];
909
+ function i(a, h, u, d, m) {
910
+ typeof a != "number" || a <= h || a >= u ? console.warn(`[StoryblokRichText] - ${d.charAt(0).toUpperCase() + d.slice(1)} value must be a number between ${h} and ${u} (inclusive)`) : m.push(`${d}(${a})`);
911
911
  }
912
912
  if (typeof e == "object") {
913
913
  if (typeof e.width == "number" && e.width > 0 ? (s.width = e.width, t = e.width) : console.warn("[StoryblokRichText] - Width value must be a number greater than 0"), e.height && typeof e.height == "number" && e.height > 0 ? (s.height = e.height, r = e.height) : console.warn("[StoryblokRichText] - Height value must be a number greater than 0"), e.loading && ["lazy", "eager"].includes(e.loading) && (s.loading = e.loading), e.class && (s.class = e.class), e.filters) {
914
- const { filters: a } = e || {}, { blur: h, brightness: u, fill: d, format: f, grayscale: b, quality: y, rotate: _ } = a || {};
915
- h && i(h, 0, 100, "blur", n), y && i(y, 0, 100, "quality", n), u && i(u, 0, 100, "brightness", n), d && n.push(`fill(${d})`), b && n.push("grayscale()"), _ && [0, 90, 180, 270].includes(e.filters.rotate || 0) && n.push(`rotate(${_})`), f && ["webp", "png", "jpeg"].includes(f) && n.push(`format(${f})`);
914
+ const { filters: a } = e || {}, { blur: h, brightness: u, fill: d, format: m, grayscale: b, quality: y, rotate: _ } = a || {};
915
+ h && i(h, 0, 100, "blur", o), y && i(y, 0, 100, "quality", o), u && i(u, 0, 100, "brightness", o), d && o.push(`fill(${d})`), b && o.push("grayscale()"), _ && [0, 90, 180, 270].includes(e.filters.rotate || 0) && o.push(`rotate(${_})`), m && ["webp", "png", "jpeg"].includes(m) && o.push(`format(${m})`);
916
916
  }
917
917
  e.srcset && (s.srcset = e.srcset.map((a) => {
918
918
  if (typeof a == "number")
919
- return `${o}/m/${a}x0/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${a}w`;
919
+ return `${n}/m/${a}x0/${o.length > 0 ? `filters:${o.join(":")}` : ""} ${a}w`;
920
920
  if (Array.isArray(a) && a.length === 2) {
921
921
  const [h, u] = a;
922
- return `${o}/m/${h}x${u}/${n.length > 0 ? `filters:${n.join(":")}` : ""} ${h}w`;
922
+ return `${n}/m/${h}x${u}/${o.length > 0 ? `filters:${o.join(":")}` : ""} ${h}w`;
923
923
  } else {
924
924
  console.warn("[StoryblokRichText] - srcset entry must be a number or a tuple of two numbers");
925
925
  return;
926
926
  }
927
927
  }).join(", ")), e.sizes && (s.sizes = e.sizes.join(", "));
928
928
  }
929
- let l = `${o}/m/`;
930
- return t > 0 && r > 0 && (l = `${l}${t}x${r}/`), n.length > 0 && (l = `${l}filters:${n.join(":")}`), {
929
+ let l = `${n}/m/`;
930
+ return t > 0 && r > 0 && (l = `${l}${t}x${r}/`), o.length > 0 && (l = `${l}filters:${o.join(":")}`), {
931
931
  src: l,
932
932
  attrs: s
933
933
  };
934
934
  }
935
- var $ = /* @__PURE__ */ ((o) => (o.DOCUMENT = "doc", o.HEADING = "heading", o.PARAGRAPH = "paragraph", o.QUOTE = "blockquote", o.OL_LIST = "ordered_list", o.UL_LIST = "bullet_list", o.LIST_ITEM = "list_item", o.CODE_BLOCK = "code_block", o.HR = "horizontal_rule", o.BR = "hard_break", o.IMAGE = "image", o.EMOJI = "emoji", o.COMPONENT = "blok", o))($ || {}), T = /* @__PURE__ */ ((o) => (o.BOLD = "bold", o.STRONG = "strong", o.STRIKE = "strike", o.UNDERLINE = "underline", o.ITALIC = "italic", o.CODE = "code", o.LINK = "link", o.ANCHOR = "anchor", o.STYLED = "styled", o.SUPERSCRIPT = "superscript", o.SUBSCRIPT = "subscript", o.TEXT_STYLE = "textStyle", o.HIGHLIGHT = "highlight", o))(T || {}), G = /* @__PURE__ */ ((o) => (o.TEXT = "text", o))(G || {}), I = /* @__PURE__ */ ((o) => (o.URL = "url", o.STORY = "story", o.ASSET = "asset", o.EMAIL = "email", o))(I || {});
935
+ var v = /* @__PURE__ */ ((n) => (n.DOCUMENT = "doc", n.HEADING = "heading", n.PARAGRAPH = "paragraph", n.QUOTE = "blockquote", n.OL_LIST = "ordered_list", n.UL_LIST = "bullet_list", n.LIST_ITEM = "list_item", n.CODE_BLOCK = "code_block", n.HR = "horizontal_rule", n.BR = "hard_break", n.IMAGE = "image", n.EMOJI = "emoji", n.COMPONENT = "blok", n))(v || {}), T = /* @__PURE__ */ ((n) => (n.BOLD = "bold", n.STRONG = "strong", n.STRIKE = "strike", n.UNDERLINE = "underline", n.ITALIC = "italic", n.CODE = "code", n.LINK = "link", n.ANCHOR = "anchor", n.STYLED = "styled", n.SUPERSCRIPT = "superscript", n.SUBSCRIPT = "subscript", n.TEXT_STYLE = "textStyle", n.HIGHLIGHT = "highlight", n))(T || {}), G = /* @__PURE__ */ ((n) => (n.TEXT = "text", n))(G || {}), I = /* @__PURE__ */ ((n) => (n.URL = "url", n.STORY = "story", n.ASSET = "asset", n.EMAIL = "email", n))(I || {});
936
936
  const Pe = [
937
937
  "area",
938
938
  "base",
@@ -948,35 +948,35 @@ const Pe = [
948
948
  "source",
949
949
  "track",
950
950
  "wbr"
951
- ], Ne = (o = {}) => Object.keys(o).map((e) => `${e}="${o[e]}"`).join(" "), Me = (o = {}) => Object.keys(o).map((e) => `${e}: ${o[e]}`).join("; ");
952
- function He(o) {
953
- return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
951
+ ], Ne = (n = {}) => Object.keys(n).map((e) => `${e}="${n[e]}"`).join(" "), Me = (n = {}) => Object.keys(n).map((e) => `${e}: ${n[e]}`).join("; ");
952
+ function He(n) {
953
+ return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
954
954
  }
955
- const B = (o) => Object.fromEntries(Object.entries(o).filter(([e, t]) => t !== void 0));
956
- function q(o, e = {}, t) {
957
- const r = Ne(e), s = r ? `${o} ${r}` : o, n = Array.isArray(t) ? t.join("") : t || "";
958
- if (o) {
959
- if (Pe.includes(o))
955
+ const B = (n) => Object.fromEntries(Object.entries(n).filter(([e, t]) => t !== void 0));
956
+ function q(n, e = {}, t) {
957
+ const r = Ne(e), s = r ? `${n} ${r}` : n, o = Array.isArray(t) ? t.join("") : t || "";
958
+ if (n) {
959
+ if (Pe.includes(n))
960
960
  return `<${s}>`;
961
- } else return n;
962
- return `<${s}>${n}</${o}>`;
961
+ } else return o;
962
+ return `<${s}>${o}</${n}>`;
963
963
  }
964
- function Be(o = {}) {
964
+ function Be(n = {}) {
965
965
  let e = 0;
966
966
  const {
967
967
  renderFn: t = q,
968
968
  textFn: r = He,
969
969
  resolvers: s = {},
970
- optimizeImages: n = !1,
970
+ optimizeImages: o = !1,
971
971
  keyedResolvers: i = !1
972
- } = o, l = t !== q, a = (c) => (g) => {
973
- const m = g.attrs || {};
974
- return i && (m.key = `${c}-${e}`), t(c, m, g.children || null);
972
+ } = n, l = t !== q, a = (c) => (g) => {
973
+ const f = g.attrs || {};
974
+ return i && (f.key = `${c}-${e}`), t(c, f, g.children || null);
975
975
  }, h = (c) => {
976
- const { src: g, alt: m, title: k, srcset: R, sizes: v } = c.attrs || {};
976
+ const { src: g, alt: f, title: k, srcset: R, sizes: $ } = c.attrs || {};
977
977
  let w = g, S = {};
978
- if (n) {
979
- const { src: W, attrs: X } = Ce(g, n);
978
+ if (o) {
979
+ const { src: W, attrs: X } = Ce(g, o);
980
980
  w = W, S = X;
981
981
  }
982
982
  i && (S = {
@@ -985,23 +985,23 @@ function Be(o = {}) {
985
985
  });
986
986
  const Y = {
987
987
  src: w,
988
- alt: m,
988
+ alt: f,
989
989
  title: k,
990
990
  srcset: R,
991
- sizes: v,
991
+ sizes: $,
992
992
  ...S
993
993
  };
994
994
  return t("img", B(Y));
995
995
  }, u = (c) => {
996
- const { level: g, ...m } = c.attrs || {}, k = {
997
- ...m
996
+ const { level: g, ...f } = c.attrs || {}, k = {
997
+ ...f
998
998
  };
999
999
  return i && (k.key = `h${g}-${e}`), t(`h${g}`, k, c.children);
1000
1000
  }, d = (c) => {
1001
- var g, m, k, R;
1002
- const v = t("img", {
1001
+ var g, f, k, R;
1002
+ const $ = t("img", {
1003
1003
  src: (g = c.attrs) == null ? void 0 : g.fallbackImage,
1004
- alt: (m = c.attrs) == null ? void 0 : m.alt,
1004
+ alt: (f = c.attrs) == null ? void 0 : f.alt,
1005
1005
  style: "width: 1.25em; height: 1.25em; vertical-align: text-top",
1006
1006
  draggable: "false",
1007
1007
  loading: "lazy"
@@ -1010,67 +1010,67 @@ function Be(o = {}) {
1010
1010
  "data-name": (k = c.attrs) == null ? void 0 : k.name,
1011
1011
  "data-emoji": (R = c.attrs) == null ? void 0 : R.emoji
1012
1012
  };
1013
- return i && (w.key = `emoji-${e}`), t("span", w, v);
1014
- }, f = (c) => t("pre", {
1013
+ return i && (w.key = `emoji-${e}`), t("span", w, $);
1014
+ }, m = (c) => t("pre", {
1015
1015
  ...c.attrs,
1016
1016
  key: `code-${e}`
1017
- }, t("code", { key: `code-${e}` }, c.children || "")), b = (c, g = !1) => ({ text: m, attrs: k }) => {
1018
- const { class: R, id: v, ...w } = k || {}, S = g ? {
1017
+ }, t("code", { key: `code-${e}` }, c.children || "")), b = (c, g = !1) => ({ text: f, attrs: k }) => {
1018
+ const { class: R, id: $, ...w } = k || {}, S = g ? {
1019
1019
  class: R,
1020
- id: v,
1020
+ id: $,
1021
1021
  style: Me(w) || void 0
1022
1022
  } : k || {};
1023
- return i && (S.key = `${c}-${e}`), t(c, B(S), m);
1023
+ return i && (S.key = `${c}-${e}`), t(c, B(S), f);
1024
1024
  }, y = (c) => C(c), _ = (c) => {
1025
- const { marks: g, ...m } = c;
1025
+ const { marks: g, ...f } = c;
1026
1026
  return "text" in c ? g ? g.reduce(
1027
1027
  (k, R) => y({ ...R, text: k }),
1028
1028
  // Fix: Ensure render function returns a string
1029
- y({ ...m, children: m.children })
1029
+ y({ ...f, children: f.children })
1030
1030
  // Fix: Cast children to string
1031
- ) : r(m.text) : "";
1031
+ ) : r(f.text) : "";
1032
1032
  }, j = (c) => {
1033
- const { linktype: g, href: m, anchor: k, ...R } = c.attrs || {};
1034
- let v = "";
1033
+ const { linktype: g, href: f, anchor: k, ...R } = c.attrs || {};
1034
+ let $ = "";
1035
1035
  switch (g) {
1036
1036
  case I.ASSET:
1037
1037
  case I.URL:
1038
- v = m;
1038
+ $ = f;
1039
1039
  break;
1040
1040
  case I.EMAIL:
1041
- v = `mailto:${m}`;
1041
+ $ = `mailto:${f}`;
1042
1042
  break;
1043
1043
  case I.STORY:
1044
- v = m, k && (v = `${v}#${k}`);
1044
+ $ = f, k && ($ = `${$}#${k}`);
1045
1045
  break;
1046
1046
  default:
1047
- v = m;
1047
+ $ = f;
1048
1048
  break;
1049
1049
  }
1050
1050
  const w = { ...R };
1051
- return v && (w.href = v), i && (w.key = `a-${e}`), t("a", w, c.text);
1051
+ return $ && (w.href = $), i && (w.key = `a-${e}`), t("a", w, c.text);
1052
1052
  }, J = (c) => {
1053
- var g, m;
1053
+ var g, f;
1054
1054
  return console.warn("[StoryblokRichtText] - BLOK resolver is not available for vanilla usage"), t("span", {
1055
1055
  blok: (g = c == null ? void 0 : c.attrs) == null ? void 0 : g.body[0],
1056
- id: (m = c.attrs) == null ? void 0 : m.id,
1056
+ id: (f = c.attrs) == null ? void 0 : f.id,
1057
1057
  key: `component-${e}`,
1058
1058
  style: "display: none"
1059
1059
  });
1060
1060
  }, K = new Map([
1061
- [$.DOCUMENT, a("")],
1062
- [$.HEADING, u],
1063
- [$.PARAGRAPH, a("p")],
1064
- [$.UL_LIST, a("ul")],
1065
- [$.OL_LIST, a("ol")],
1066
- [$.LIST_ITEM, a("li")],
1067
- [$.IMAGE, h],
1068
- [$.EMOJI, d],
1069
- [$.CODE_BLOCK, f],
1070
- [$.HR, a("hr")],
1071
- [$.BR, a("br")],
1072
- [$.QUOTE, a("blockquote")],
1073
- [$.COMPONENT, J],
1061
+ [v.DOCUMENT, a("")],
1062
+ [v.HEADING, u],
1063
+ [v.PARAGRAPH, a("p")],
1064
+ [v.UL_LIST, a("ul")],
1065
+ [v.OL_LIST, a("ol")],
1066
+ [v.LIST_ITEM, a("li")],
1067
+ [v.IMAGE, h],
1068
+ [v.EMOJI, d],
1069
+ [v.CODE_BLOCK, m],
1070
+ [v.HR, a("hr")],
1071
+ [v.BR, a("br")],
1072
+ [v.QUOTE, a("blockquote")],
1073
+ [v.COMPONENT, J],
1074
1074
  [G.TEXT, _],
1075
1075
  [T.LINK, j],
1076
1076
  [T.ANCHOR, j],
@@ -1093,10 +1093,10 @@ function Be(o = {}) {
1093
1093
  return console.error("<Storyblok>", `No resolver found for node type ${c.type}`), "";
1094
1094
  if (c.type === "text")
1095
1095
  return g(c);
1096
- const m = c.content ? c.content.map(C) : void 0;
1096
+ const f = c.content ? c.content.map(C) : void 0;
1097
1097
  return g({
1098
1098
  ...c,
1099
- children: m
1099
+ children: f
1100
1100
  // Fix: Update the type of 'children' to Node[]
1101
1101
  });
1102
1102
  }
@@ -1108,25 +1108,25 @@ function Be(o = {}) {
1108
1108
  };
1109
1109
  }
1110
1110
  let N, M = "https://app.storyblok.com/f/storyblok-v2-latest.js";
1111
- const qe = (o, e, t = {}) => {
1111
+ const qe = (n, e, t = {}) => {
1112
1112
  var r;
1113
- const s = !(typeof window > "u") && typeof window.storyblokRegisterEvent < "u", n = new URL((r = window.location) == null ? void 0 : r.href).searchParams.get(
1113
+ const s = !(typeof window > "u") && typeof window.storyblokRegisterEvent < "u", o = new URL((r = window.location) == null ? void 0 : r.href).searchParams.get(
1114
1114
  "_storyblok"
1115
- ), i = n !== null && +n === o;
1115
+ ), i = o !== null && +o === n;
1116
1116
  if (!(!s || !i)) {
1117
- if (!o) {
1117
+ if (!n) {
1118
1118
  console.warn("Story ID is not defined. Please provide a valid ID.");
1119
1119
  return;
1120
1120
  }
1121
1121
  window.storyblokRegisterEvent(() => {
1122
1122
  new window.StoryblokBridge(t).on(["input", "published", "change"], (l) => {
1123
1123
  var a;
1124
- l && (l.action === "input" && ((a = l.story) == null ? void 0 : a.id) === o ? e(l.story) : (l.action === "change" || l.action === "published") && l.storyId === o && window.location.reload());
1124
+ l && (l.action === "input" && ((a = l.story) == null ? void 0 : a.id) === n ? e(l.story) : (l.action === "change" || l.action === "published") && l.storyId === n && window.location.reload());
1125
1125
  });
1126
1126
  });
1127
1127
  }
1128
- }, V = (o, e) => {
1129
- o.addNode("blok", (t) => {
1128
+ }, V = (n, e) => {
1129
+ n.addNode("blok", (t) => {
1130
1130
  let r = "";
1131
1131
  return t.attrs.body.forEach((s) => {
1132
1132
  r += e(s.component, s);
@@ -1134,28 +1134,28 @@ const qe = (o, e, t = {}) => {
1134
1134
  html: r
1135
1135
  };
1136
1136
  });
1137
- }, Fe = (o = {}) => {
1137
+ }, Fe = (n = {}) => {
1138
1138
  var e, t;
1139
1139
  const {
1140
1140
  bridge: r,
1141
1141
  accessToken: s,
1142
- use: n = [],
1142
+ use: o = [],
1143
1143
  apiOptions: i = {},
1144
1144
  richText: l = {},
1145
1145
  bridgeUrl: a
1146
- } = o;
1146
+ } = n;
1147
1147
  i.accessToken = i.accessToken || s;
1148
1148
  const h = { bridge: r, apiOptions: i };
1149
1149
  let u = {};
1150
- n.forEach((f) => {
1151
- u = { ...u, ...f(h) };
1150
+ o.forEach((m) => {
1151
+ u = { ...u, ...m(h) };
1152
1152
  }), a && (M = a);
1153
1153
  const d = !(typeof window > "u") && ((t = (e = window.location) == null ? void 0 : e.search) == null ? void 0 : t.includes("_storyblok_tk"));
1154
1154
  return r !== !1 && d && F(M), N = new L(l.schema), l.resolver && V(N, l.resolver), u;
1155
- }, Ue = (o) => {
1155
+ }, Ue = (n) => {
1156
1156
  var e;
1157
- return !o || !((e = o == null ? void 0 : o.content) != null && e.some((t) => t.content || t.type === "blok" || t.type === "horizontal_rule"));
1158
- }, Ge = (o, e, t) => {
1157
+ return !n || !((e = n == null ? void 0 : n.content) != null && e.some((t) => t.content || t.type === "blok" || t.type === "horizontal_rule"));
1158
+ }, Ge = (n, e, t) => {
1159
1159
  let r = t || N;
1160
1160
  if (!r) {
1161
1161
  console.error(
@@ -1163,10 +1163,10 @@ const qe = (o, e, t = {}) => {
1163
1163
  );
1164
1164
  return;
1165
1165
  }
1166
- return Ue(o) ? "" : (e && (r = new L(e.schema), e.resolver && V(r, e.resolver)), r.render(o, {}, !1));
1166
+ return Ue(n) ? "" : (e && (r = new L(e.schema), e.resolver && V(r, e.resolver)), r.render(n, {}, !1));
1167
1167
  }, Ve = () => F(M);
1168
1168
  export {
1169
- $ as BlockTypes,
1169
+ v as BlockTypes,
1170
1170
  T as MarkTypes,
1171
1171
  L as RichTextResolver,
1172
1172
  je as RichTextSchema,