@builder.io/sdk-react-nextjs 0.12.3 → 0.12.4

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.
Files changed (60) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-98a4fbf4.js → browser/USE_CLIENT_BUNDLE-e6d429be.js} +188 -187
  2. package/lib/browser/{USE_CLIENT_BUNDLE-64b6ec10.cjs → USE_CLIENT_BUNDLE-e9e1ee85.cjs} +3 -3
  3. package/lib/{edge/USE_SERVER_BUNDLE-4e9af8f5.js → browser/USE_SERVER_BUNDLE-44c49b1e.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-e79e6b55.cjs → browser/USE_SERVER_BUNDLE-9bcc0ad4.cjs} +1 -1
  5. package/lib/browser/bundle-0e5cec1c.cjs +168 -0
  6. package/lib/browser/{bundle-f3e8cd29.js → bundle-bab67847.js} +573 -516
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +14 -14
  9. package/lib/{browser/USE_CLIENT_BUNDLE-e89d3175.js → edge/USE_CLIENT_BUNDLE-8d251b8b.js} +188 -187
  10. package/lib/{node/USE_CLIENT_BUNDLE-990b655a.cjs → edge/USE_CLIENT_BUNDLE-d87c391a.cjs} +3 -3
  11. package/lib/{node/USE_SERVER_BUNDLE-c86a1fb8.cjs → edge/USE_SERVER_BUNDLE-816ab6e4.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-b231d861.js → edge/USE_SERVER_BUNDLE-c0911af0.js} +1 -1
  13. package/lib/edge/{bundle-cb191300.js → bundle-28d9d04c.js} +1018 -961
  14. package/lib/edge/{bundle-d4f509a3.cjs → bundle-e64fe0fd.cjs} +33 -37
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +14 -14
  17. package/lib/{edge/USE_CLIENT_BUNDLE-a3258a60.js → node/USE_CLIENT_BUNDLE-75f921e2.js} +188 -187
  18. package/lib/{edge/USE_CLIENT_BUNDLE-2aed408a.cjs → node/USE_CLIENT_BUNDLE-ee5a9d6f.cjs} +3 -3
  19. package/lib/{browser/USE_SERVER_BUNDLE-f34c0814.cjs → node/USE_SERVER_BUNDLE-793c12c9.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-d6bec4ec.js → node/USE_SERVER_BUNDLE-86d90afe.js} +1 -1
  21. package/lib/node/{bundle-11daeaca.js → bundle-031e3608.js} +348 -291
  22. package/lib/node/{bundle-b2d68b60.cjs → bundle-72df28b3.cjs} +6 -10
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +14 -14
  25. package/package.json +1 -1
  26. package/types/cjs/blocks/button/button.types.d.ts +2 -1
  27. package/types/cjs/blocks/columns/columns.types.d.ts +3 -3
  28. package/types/cjs/blocks/symbol/symbol.types.d.ts +2 -2
  29. package/types/cjs/components/block/block.d.ts +1 -0
  30. package/types/cjs/components/block/components/block-wrapper.d.ts +1 -0
  31. package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
  32. package/types/cjs/components/block/components/repeated-block.d.ts +3 -5
  33. package/types/cjs/components/blocks/blocks.types.d.ts +1 -0
  34. package/types/cjs/components/content-variants/content-variants.types.d.ts +6 -2
  35. package/types/cjs/constants/sdk-version.d.ts +1 -1
  36. package/types/cjs/functions/get-block-properties.d.ts +5 -1
  37. package/types/cjs/functions/get-class-prop-name.d.ts +1 -0
  38. package/types/cjs/functions/get-style.d.ts +12 -0
  39. package/types/cjs/functions/transform-block-properties.d.ts +7 -5
  40. package/types/cjs/functions/transform-style-property.d.ts +7 -0
  41. package/types/cjs/types/builder-block.d.ts +1 -0
  42. package/types/cjs/types/builder-props.d.ts +3 -0
  43. package/types/esm/blocks/button/button.types.d.ts +2 -1
  44. package/types/esm/blocks/columns/columns.types.d.ts +3 -3
  45. package/types/esm/blocks/symbol/symbol.types.d.ts +2 -2
  46. package/types/esm/components/block/block.d.ts +1 -0
  47. package/types/esm/components/block/components/block-wrapper.d.ts +1 -0
  48. package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
  49. package/types/esm/components/block/components/repeated-block.d.ts +3 -5
  50. package/types/esm/components/blocks/blocks.types.d.ts +1 -0
  51. package/types/esm/components/content-variants/content-variants.types.d.ts +6 -2
  52. package/types/esm/constants/sdk-version.d.ts +1 -1
  53. package/types/esm/functions/get-block-properties.d.ts +5 -1
  54. package/types/esm/functions/get-class-prop-name.d.ts +1 -0
  55. package/types/esm/functions/get-style.d.ts +12 -0
  56. package/types/esm/functions/transform-block-properties.d.ts +7 -5
  57. package/types/esm/functions/transform-style-property.d.ts +7 -0
  58. package/types/esm/types/builder-block.d.ts +1 -0
  59. package/types/esm/types/builder-props.d.ts +3 -0
  60. package/lib/browser/bundle-50ff23eb.cjs +0 -172
@@ -1,39 +1,39 @@
1
1
  "use client";
2
- import { jsx as t, Fragment as s, jsxs as E } from "react/jsx-runtime";
3
- import { i as Y, g as U, a as O, b as w, c as R, d as Z, e as P, f as H, _ as V, h as p, l as ee, j as te, k as D, m as ne, n as ie, r as ae, s as ce, o as re, p as le, q as oe } from "./bundle-cb191300.js";
4
- import { useRef as T, useState as x, useEffect as f, createContext as de, createElement as se } from "react";
5
- import { p as ue } from "./USE_SERVER_BUNDLE-4e9af8f5.js";
6
- import { useRouter as me } from "next/navigation";
7
- function ke(e) {
8
- return /* @__PURE__ */ t(s, { children: e.link ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
9
- "a",
10
- {
11
- ...e.attributes,
12
- href: e.link,
13
- target: e.openLinkInNewTab ? "_blank" : void 0,
14
- role: "button",
15
- children: e.text
16
- }
17
- ) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
18
- "button",
2
+ import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
3
+ import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, m as U, n as ae, o as ce, r as re, s as le, p as oe, q as de, t as se } from "./bundle-031e3608.js";
4
+ import { useRef as T, useState as x, useEffect as f, createContext as ue, createElement as me } from "react";
5
+ import { p as ge } from "./USE_SERVER_BUNDLE-86d90afe.js";
6
+ import { useRouter as be } from "next/navigation";
7
+ function J(e) {
8
+ return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
9
+ }
10
+ function Ce(e) {
11
+ return /* @__PURE__ */ i(
12
+ J,
19
13
  {
20
- role: "button",
21
- ...e.attributes,
22
- className: `builder-button ${e.attributes.className}`,
23
- style: e.attributes.style,
14
+ TagName: e.link ? e.builderLinkComponent || "a" : "button",
15
+ attributes: {
16
+ ...e.attributes,
17
+ [D()]: `${e.link ? "" : "builder-button"} ${e.attributes[D()] || ""}`,
18
+ ...e.link ? {
19
+ href: e.link,
20
+ target: e.openLinkInNewTab ? "_blank" : void 0,
21
+ role: "link"
22
+ } : {
23
+ role: "button"
24
+ }
25
+ },
26
+ actionAttributes: {},
24
27
  children: e.text
25
28
  }
26
- ) }) });
27
- }
28
- function ge(e) {
29
- return /* @__PURE__ */ t(s, { children: Y(e.TagName) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(s, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
29
+ );
30
30
  }
31
- function Ce(e) {
32
- return /* @__PURE__ */ t(
33
- ge,
31
+ function we(e) {
32
+ return /* @__PURE__ */ i(
33
+ J,
34
34
  {
35
35
  TagName: e.Wrapper,
36
- attributes: U({
36
+ attributes: $({
37
37
  block: e.block,
38
38
  context: e.context
39
39
  }),
@@ -49,13 +49,13 @@ function Ce(e) {
49
49
  }
50
50
  );
51
51
  }
52
- function we(e) {
53
- return /* @__PURE__ */ t(
52
+ function Ee(e) {
53
+ return /* @__PURE__ */ i(
54
54
  e.Wrapper,
55
55
  {
56
56
  ...e.wrapperProps,
57
57
  attributes: e.includeBlockProps ? {
58
- ...U({
58
+ ...$({
59
59
  block: e.block,
60
60
  context: e.context
61
61
  }),
@@ -71,14 +71,14 @@ function we(e) {
71
71
  }
72
72
  );
73
73
  }
74
- function Ee(e) {
74
+ function Ie(e) {
75
75
  function c() {
76
76
  var l;
77
77
  return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
78
78
  }
79
- function u() {
80
- var l, m;
81
- w() && !((l = e.blocks) != null && l.length) && ((m = window.parent) == null || m.postMessage(
79
+ function s() {
80
+ var l, u;
81
+ w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
82
82
  {
83
83
  type: "builder.clickEmptyBlocks",
84
84
  data: {
@@ -90,8 +90,8 @@ function Ee(e) {
90
90
  ));
91
91
  }
92
92
  function v() {
93
- var l, m;
94
- w() && !((l = e.blocks) != null && l.length) && ((m = window.parent) == null || m.postMessage(
93
+ var l, u;
94
+ w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
95
95
  {
96
96
  type: "builder.hoverEmptyBlocks",
97
97
  data: {
@@ -102,48 +102,48 @@ function Ee(e) {
102
102
  "*"
103
103
  ));
104
104
  }
105
- return /* @__PURE__ */ E(s, { children: [
106
- /* @__PURE__ */ t(
105
+ return /* @__PURE__ */ E(h, { children: [
106
+ /* @__PURE__ */ i(
107
107
  e.BlocksWrapper,
108
108
  {
109
109
  className: c() + " props-blocks-wrapper-4f2c12d8",
110
110
  "builder-path": e.path,
111
111
  "builder-parent-id": e.parent,
112
112
  style: e.styleProp,
113
- onClick: (l) => u(),
113
+ onClick: (l) => s(),
114
114
  onMouseEnter: (l) => v(),
115
- onKeyPress: (l) => u(),
115
+ onKeyPress: (l) => s(),
116
116
  ...e.BlocksWrapperProps,
117
117
  children: e.children
118
118
  }
119
119
  ),
120
- /* @__PURE__ */ t("style", { children: `.props-blocks-wrapper-4f2c12d8 {
120
+ /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
121
121
  display: flex;
122
122
  flex-direction: column;
123
123
  align-items: stretch;
124
124
  }` })
125
125
  ] });
126
126
  }
127
- function Ie(e) {
128
- return /* @__PURE__ */ t("span", { children: e.children });
129
- }
130
127
  function Re(e) {
131
- var l, m, S, y;
128
+ return /* @__PURE__ */ i("span", { children: e.children });
129
+ }
130
+ function Pe(e) {
131
+ var l, u, S, y;
132
132
  function c() {
133
- var g;
133
+ var m;
134
134
  const o = e.image || e.src;
135
135
  if (!o || // We can auto add srcset for cdn.builder.io and shopify
136
136
  // images, otherwise you can supply this prop manually
137
137
  !(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
138
138
  return e.srcset;
139
- if (e.srcset && ((g = e.image) != null && g.includes("builder.io/api/v1/image"))) {
139
+ if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
140
140
  if (!e.srcset.includes(e.image.split("?")[0]))
141
141
  return console.debug("Removed given srcset"), R(o);
142
142
  } else if (e.image && !e.srcset)
143
143
  return R(o);
144
144
  return R(o);
145
145
  }
146
- function u() {
146
+ function s() {
147
147
  var b;
148
148
  return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
149
149
  }
@@ -157,11 +157,11 @@ function Re(e) {
157
157
  };
158
158
  return e.aspectRatio ? b : void 0;
159
159
  }
160
- return /* @__PURE__ */ E(s, { children: [
161
- /* @__PURE__ */ E(s, { children: [
160
+ return /* @__PURE__ */ E(h, { children: [
161
+ /* @__PURE__ */ E(h, { children: [
162
162
  /* @__PURE__ */ E("picture", { children: [
163
- u() ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("source", { type: "image/webp", srcSet: u() }) }) : null,
164
- /* @__PURE__ */ t(
163
+ s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
164
+ /* @__PURE__ */ i(
165
165
  "img",
166
166
  {
167
167
  loading: "lazy",
@@ -179,7 +179,7 @@ function Re(e) {
179
179
  }
180
180
  )
181
181
  ] }),
182
- e.aspectRatio && !((m = (l = e.builderBlock) == null ? void 0 : l.children) != null && m.length && e.fitContent) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
182
+ e.aspectRatio && !((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
183
183
  "div",
184
184
  {
185
185
  className: "builder-image-sizer div-40c70c9b",
@@ -188,10 +188,10 @@ function Re(e) {
188
188
  }
189
189
  }
190
190
  ) }) : null,
191
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: e.children }) : null,
192
- !e.fitContent && e.children ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
191
+ (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
192
+ !e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
193
193
  ] }),
194
- /* @__PURE__ */ t("style", { children: `.img-40c70c9b {
194
+ /* @__PURE__ */ i("style", { children: `.img-40c70c9b {
195
195
  opacity: 1;
196
196
  transition: opacity 0.2s ease-in-out;
197
197
  }.div-40c70c9b {
@@ -210,8 +210,8 @@ function Re(e) {
210
210
  }` })
211
211
  ] });
212
212
  }
213
- function Pe(e) {
214
- return /* @__PURE__ */ t(
213
+ function Te(e) {
214
+ return /* @__PURE__ */ i(
215
215
  "section",
216
216
  {
217
217
  ...e.attributes,
@@ -231,8 +231,8 @@ function Pe(e) {
231
231
  }
232
232
  );
233
233
  }
234
- function Te(e) {
235
- const c = T(null), [u, v] = x(() => []), [l, m] = x(() => []);
234
+ function Ne(e) {
235
+ const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
236
236
  return f(() => {
237
237
  var y;
238
238
  if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
@@ -241,11 +241,11 @@ function Te(e) {
241
241
  for (let b = 0; b < S.length; b++) {
242
242
  const o = S[b];
243
243
  if (o.src) {
244
- if (u.includes(o.src))
244
+ if (s.includes(o.src))
245
245
  continue;
246
- u.push(o.src);
247
- const g = document.createElement("script");
248
- g.async = !0, g.src = o.src, document.head.appendChild(g);
246
+ s.push(o.src);
247
+ const m = document.createElement("script");
248
+ m.async = !0, m.src = o.src, document.head.appendChild(m);
249
249
  } else if (!o.type || [
250
250
  "text/javascript",
251
251
  "application/javascript",
@@ -255,12 +255,12 @@ function Te(e) {
255
255
  continue;
256
256
  try {
257
257
  l.push(o.innerText), new Function(o.innerText)();
258
- } catch (g) {
259
- console.warn("`CustomCode`: Error running script:", g);
258
+ } catch (m) {
259
+ console.warn("`CustomCode`: Error running script:", m);
260
260
  }
261
261
  }
262
262
  }
263
- }, []), /* @__PURE__ */ t(
263
+ }, []), /* @__PURE__ */ i(
264
264
  "div",
265
265
  {
266
266
  ref: c,
@@ -269,19 +269,19 @@ function Te(e) {
269
269
  }
270
270
  );
271
271
  }
272
- function Ne(e) {
273
- const c = T(null), [u, v] = x(() => []), [l, m] = x(() => []), [S, y] = x(() => !1);
272
+ function Be(e) {
273
+ const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
274
274
  function b() {
275
275
  if (!c.current || !c.current.getElementsByTagName)
276
276
  return;
277
277
  const o = c.current.getElementsByTagName("script");
278
- for (let g = 0; g < o.length; g++) {
279
- const k = o[g];
280
- if (k.src && !u.includes(k.src)) {
281
- u.push(k.src);
278
+ for (let m = 0; m < o.length; m++) {
279
+ const k = o[m];
280
+ if (k.src && !s.includes(k.src)) {
281
+ s.push(k.src);
282
282
  const C = document.createElement("script");
283
283
  C.async = !0, C.src = k.src, document.head.appendChild(C);
284
- } else if (Z(k) && !l.includes(k.innerText))
284
+ } else if (ee(k) && !l.includes(k.innerText))
285
285
  try {
286
286
  l.push(k.innerText), new Function(k.innerText)();
287
287
  } catch (C) {
@@ -291,7 +291,7 @@ function Ne(e) {
291
291
  }
292
292
  return f(() => {
293
293
  c.current && !S && (y(!0), b());
294
- }, [c.current, S]), /* @__PURE__ */ t(
294
+ }, [c.current, S]), /* @__PURE__ */ i(
295
295
  "div",
296
296
  {
297
297
  className: "builder-embed",
@@ -300,8 +300,8 @@ function Ne(e) {
300
300
  }
301
301
  );
302
302
  }
303
- function Be(e) {
304
- return /* @__PURE__ */ t(
303
+ function Le(e) {
304
+ return /* @__PURE__ */ i(
305
305
  "img",
306
306
  {
307
307
  style: {
@@ -315,8 +315,8 @@ function Be(e) {
315
315
  w() && e.imgSrc || "default-key"
316
316
  );
317
317
  }
318
- function Le(e) {
319
- var v, l, m, S, y, b, o;
318
+ function je(e) {
319
+ var v, l, u, S, y, b, o;
320
320
  function c() {
321
321
  return {
322
322
  ...e.autoPlay === !0 ? {
@@ -336,7 +336,7 @@ function Le(e) {
336
336
  } : {}
337
337
  };
338
338
  }
339
- function u() {
339
+ function s() {
340
340
  return {
341
341
  ...c()
342
342
  };
@@ -348,11 +348,11 @@ function Le(e) {
348
348
  position: "relative"
349
349
  },
350
350
  children: [
351
- /* @__PURE__ */ t(
351
+ /* @__PURE__ */ i(
352
352
  "video",
353
353
  {
354
354
  className: "builder-video",
355
- ...u(),
355
+ ...s(),
356
356
  preload: e.preload || "metadata",
357
357
  style: {
358
358
  width: "100%",
@@ -370,10 +370,10 @@ function Le(e) {
370
370
  },
371
371
  src: e.video || "no-src",
372
372
  poster: e.posterImage,
373
- children: e.lazyLoad ? null : /* @__PURE__ */ t("source", { type: "video/mp4", src: e.video })
373
+ children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
374
374
  }
375
375
  ),
376
- e.aspectRatio && !(e.fitContent && ((m = (l = e.builderBlock) == null ? void 0 : l.children) != null && m.length)) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
376
+ e.aspectRatio && !(e.fitContent && ((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
377
377
  "div",
378
378
  {
379
379
  style: {
@@ -384,7 +384,7 @@ function Le(e) {
384
384
  }
385
385
  }
386
386
  ) }) : null,
387
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
387
+ (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
388
388
  "div",
389
389
  {
390
390
  style: {
@@ -395,7 +395,7 @@ function Le(e) {
395
395
  children: e.children
396
396
  }
397
397
  ) }) : null,
398
- (o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
398
+ (o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
399
399
  "div",
400
400
  {
401
401
  style: {
@@ -416,7 +416,7 @@ function Le(e) {
416
416
  }
417
417
  );
418
418
  }
419
- const he = de({
419
+ const he = ue({
420
420
  content: null,
421
421
  context: {},
422
422
  localState: void 0,
@@ -430,38 +430,38 @@ const he = de({
430
430
  BlocksWrapper: "div",
431
431
  BlocksWrapperProps: {}
432
432
  });
433
- function je(e) {
434
- var W, F, K, z, A, M, _;
435
- const c = T(null), [u, v] = x(() => 0);
433
+ function We(e) {
434
+ var W, F, K, A, z, M, _;
435
+ const c = T(null), [s, v] = x(() => 0);
436
436
  x(() => !0);
437
- function l(n) {
437
+ function l(t) {
438
438
  var a, r;
439
- const i = {
439
+ const n = {
440
440
  ...e.builderContextSignal.rootState,
441
- ...n
441
+ ...t
442
442
  };
443
- e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, i) : e.builderContextSignal.rootState = i;
443
+ e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, n) : e.builderContextSignal.rootState = n;
444
444
  }
445
- function m(n) {
446
- var a, r, d, h, q;
447
- const i = {
445
+ function u(t) {
446
+ var a, r, d, g, q;
447
+ const n = {
448
448
  ...e.builderContextSignal.content,
449
- ...n,
449
+ ...t,
450
450
  data: {
451
451
  ...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
452
- ...n == null ? void 0 : n.data
452
+ ...t == null ? void 0 : t.data
453
453
  },
454
454
  meta: {
455
455
  ...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
456
- ...n == null ? void 0 : n.meta,
457
- breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (h = e.builderContextSignal.content) == null ? void 0 : h.meta) == null ? void 0 : q.breakpoints)
456
+ ...t == null ? void 0 : t.meta,
457
+ breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((q = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : q.breakpoints)
458
458
  }
459
459
  };
460
- ue({
461
- value: i,
462
- key: i.id
460
+ ge({
461
+ value: n,
462
+ key: n.id
463
463
  }).then(() => {
464
- X.refresh();
464
+ Z.refresh();
465
465
  });
466
466
  }
467
467
  x(() => 0);
@@ -470,63 +470,63 @@ function je(e) {
470
470
  ), [b, o] = x(
471
471
  () => e.contentWrapper || "div"
472
472
  );
473
- function g(n) {
473
+ function m(t) {
474
474
  var a;
475
- if (!te(e.trustedHosts, n))
475
+ if (!ie(e.trustedHosts, t))
476
476
  return;
477
- const { data: i } = n;
478
- if (i)
479
- switch (i.type) {
477
+ const { data: n } = t;
478
+ if (n)
479
+ switch (n.type) {
480
480
  case "builder.configureSdk": {
481
- const r = i.data, { breakpoints: d, contentId: h } = r;
482
- if (!h || h !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
481
+ const r = n.data, { breakpoints: d, contentId: g } = r;
482
+ if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
483
483
  return;
484
- d && m({
484
+ d && u({
485
485
  meta: {
486
486
  breakpoints: d
487
487
  }
488
- }), v(u + 1);
488
+ }), v(s + 1);
489
489
  break;
490
490
  }
491
491
  case "builder.contentUpdate": {
492
- const r = i.data, d = r.key || r.alias || r.entry || r.modelName, h = r.data;
493
- d === e.model && (m(h), v(u + 1));
492
+ const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
493
+ d === e.model && (u(g), v(s + 1));
494
494
  break;
495
495
  }
496
496
  }
497
497
  }
498
498
  function k() {
499
- var i, a;
500
- const n = (a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.jsCode;
501
- n && D({
502
- code: n,
499
+ var n, a;
500
+ const t = (a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.jsCode;
501
+ t && U({
502
+ code: t,
503
503
  context: e.context || {},
504
504
  localState: void 0,
505
505
  rootState: e.builderContextSignal.rootState,
506
506
  rootSetState: e.builderContextSignal.rootSetState
507
507
  });
508
508
  }
509
- const [C, be] = x(() => ({})), [N, $] = x(() => !1);
510
- function J(n) {
511
- var i, a;
509
+ const [C, fe] = x(() => ({})), [N, G] = x(() => !1);
510
+ function Q(t) {
511
+ var n, a;
512
512
  if (e.builderContextSignal.content) {
513
- const r = (i = e.builderContextSignal.content) == null ? void 0 : i.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
513
+ const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
514
514
  V({
515
515
  type: "click",
516
516
  canTrack: H(e.canTrack),
517
517
  contentId: d,
518
518
  apiKey: e.apiKey,
519
519
  variationId: r !== d ? r : void 0,
520
- ...ne(n),
520
+ ...ae(t),
521
521
  unique: !N
522
522
  });
523
523
  }
524
- N || $(!0);
524
+ N || G(!0);
525
525
  }
526
- function G(n) {
527
- return n.replace(
526
+ function X(t) {
527
+ return t.replace(
528
528
  /{{([^}]+)}}/g,
529
- (i, a) => D({
529
+ (n, a) => U({
530
530
  code: a,
531
531
  context: e.context || {},
532
532
  localState: void 0,
@@ -535,26 +535,26 @@ function je(e) {
535
535
  })
536
536
  );
537
537
  }
538
- function Q({ url: n, key: i }) {
539
- oe(n).then((a) => a.json()).then((a) => {
540
- var d, h;
538
+ function Y({ url: t, key: n }) {
539
+ se(t).then((a) => a.json()).then((a) => {
540
+ var d, g;
541
541
  const r = {
542
542
  ...e.builderContextSignal.rootState,
543
- [i]: a
543
+ [n]: a
544
544
  };
545
- (h = (d = e.builderContextSignal).rootSetState) == null || h.call(d, r), C[i] = !0;
545
+ (g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), C[n] = !0;
546
546
  }).catch((a) => {
547
- console.error("error fetching dynamic data", n, a);
547
+ console.error("error fetching dynamic data", t, a);
548
548
  });
549
549
  }
550
550
  function B() {
551
- var i, a;
552
- const n = ((a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.httpRequests) ?? {};
553
- Object.entries(n).forEach(([r, d]) => {
551
+ var n, a;
552
+ const t = ((a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.httpRequests) ?? {};
553
+ Object.entries(t).forEach(([r, d]) => {
554
554
  if (d && (!C[r] || w())) {
555
- const h = G(d);
556
- Q({
557
- url: h,
555
+ const g = X(d);
556
+ Y({
557
+ url: g,
558
558
  key: r
559
559
  });
560
560
  }
@@ -566,7 +566,7 @@ function je(e) {
566
566
  "builder:component:stateChange",
567
567
  {
568
568
  detail: {
569
- state: ie(e.builderContextSignal.rootState),
569
+ state: ce(e.builderContextSignal.rootState),
570
570
  ref: {
571
571
  name: e.model
572
572
  }
@@ -575,8 +575,8 @@ function je(e) {
575
575
  )
576
576
  );
577
577
  }
578
- function L(n) {
579
- v(u + 1), window.addEventListener("message", g), ae(), ce({
578
+ function L(t) {
579
+ v(s + 1), window.addEventListener("message", m), re(), le({
580
580
  ...e.locale ? {
581
581
  locale: e.locale
582
582
  } : {},
@@ -591,74 +591,74 @@ function je(e) {
591
591
  } : {}
592
592
  }), Object.values(
593
593
  e.builderContextSignal.componentInfos
594
- ).forEach((i) => {
594
+ ).forEach((n) => {
595
595
  var r;
596
- const a = re(i);
596
+ const a = oe(n);
597
597
  (r = window.parent) == null || r.postMessage(a, "*");
598
598
  }), window.addEventListener(
599
599
  "builder:component:stateChangeListenerActivated",
600
600
  I
601
601
  );
602
602
  }
603
- function j(n) {
604
- const i = new URL(location.href).searchParams, a = i.get("builder.preview"), r = i.get(
603
+ function j(t) {
604
+ const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
605
605
  `builder.preview.${a}`
606
- ), d = i.get("apiKey") || i.get("builder.space");
607
- a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && le({
606
+ ), d = n.get("apiKey") || n.get("builder.space");
607
+ a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && de({
608
608
  model: e.model,
609
609
  apiKey: e.apiKey,
610
610
  apiVersion: e.builderContextSignal.apiVersion
611
- }).then((h) => {
612
- h && m(h);
611
+ }).then((g) => {
612
+ g && u(g);
613
613
  });
614
614
  }
615
- const X = me();
615
+ const Z = be();
616
616
  return f(() => {
617
- var n;
618
- return (n = c.current) == null || n.addEventListener(
617
+ var t;
618
+ return (t = c.current) == null || t.addEventListener(
619
619
  "initeditingbldr",
620
620
  L
621
621
  ), () => {
622
- var i;
623
- return (i = c.current) == null ? void 0 : i.removeEventListener(
622
+ var n;
623
+ return (n = c.current) == null ? void 0 : n.removeEventListener(
624
624
  "initeditingbldr",
625
625
  L
626
626
  );
627
627
  };
628
628
  }, []), f(() => {
629
- var n;
630
- return (n = c.current) == null || n.addEventListener(
629
+ var t;
630
+ return (t = c.current) == null || t.addEventListener(
631
631
  "initpreviewingbldr",
632
632
  j
633
633
  ), () => {
634
- var i;
635
- return (i = c.current) == null ? void 0 : i.removeEventListener(
634
+ var n;
635
+ return (n = c.current) == null ? void 0 : n.removeEventListener(
636
636
  "initpreviewingbldr",
637
637
  j
638
638
  );
639
639
  };
640
640
  }, []), f(() => {
641
- var n, i;
641
+ var t, n;
642
642
  if (P()) {
643
643
  if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
644
- const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id, h = e.apiKey;
644
+ const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, g = e.apiKey;
645
645
  V({
646
646
  type: "impression",
647
647
  canTrack: !0,
648
648
  contentId: d,
649
- apiKey: h,
649
+ apiKey: g,
650
650
  variationId: r !== d ? r : void 0
651
651
  });
652
652
  }
653
- p() && c.current;
653
+ te() && c.current;
654
654
  }
655
655
  }, []), f(() => {
656
- e.apiKey || ee.error(
656
+ e.apiKey || ne.error(
657
657
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
658
658
  ), k(), B(), I();
659
659
  }, []), f(() => {
660
660
  }, [e.content]), f(() => {
661
- P() && (window.removeEventListener("message", g), window.addEventListener("message", g));
661
+ P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
662
662
  }, [S]), f(() => {
663
663
  k();
664
664
  }, [
@@ -666,7 +666,7 @@ function je(e) {
666
666
  e.builderContextSignal.rootState
667
667
  ]), f(() => {
668
668
  B();
669
- }, [(z = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : z.httpRequests]), f(() => {
669
+ }, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
670
670
  I();
671
671
  }, [e.builderContextSignal.rootState]), f(() => {
672
672
  e.data && l(e.data);
@@ -675,17 +675,17 @@ function je(e) {
675
675
  locale: e.locale
676
676
  });
677
677
  }, [e.locale]), f(() => () => {
678
- P() && (window.removeEventListener("message", g), window.removeEventListener(
678
+ P() && (window.removeEventListener("message", m), window.removeEventListener(
679
679
  "builder:component:stateChangeListenerActivated",
680
680
  I
681
681
  ));
682
- }, []), /* @__PURE__ */ t(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ se(
682
+ }, []), /* @__PURE__ */ i(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ me(
683
683
  b,
684
684
  {
685
- key: u,
685
+ key: s,
686
686
  ref: c,
687
- onClick: (n) => J(n),
688
- "builder-content-id": (A = e.builderContextSignal.content) == null ? void 0 : A.id,
687
+ onClick: (t) => Q(t),
688
+ "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
689
689
  "builder-model": e.model,
690
690
  ...e.showContent ? {} : {
691
691
  hidden: !0,
@@ -698,16 +698,17 @@ function je(e) {
698
698
  ) }) : null });
699
699
  }
700
700
  export {
701
- Ce as B,
702
- Te as C,
703
- Ne as E,
704
- Ie as F,
705
- we as I,
706
- Pe as S,
707
- Le as V,
708
- Ee as a,
709
- ke as b,
710
- Re as c,
711
- Be as d,
712
- je as e
701
+ we as B,
702
+ Ne as C,
703
+ J as D,
704
+ Be as E,
705
+ Re as F,
706
+ Ee as I,
707
+ Te as S,
708
+ je as V,
709
+ Ie as a,
710
+ Ce as b,
711
+ Pe as c,
712
+ Le as d,
713
+ We as e
713
714
  };