@builder.io/sdk-react-nextjs 0.14.6 → 0.14.8

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 (48) hide show
  1. package/README.md +8 -2
  2. package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +21 -0
  3. package/lib/browser/{USE_CLIENT_BUNDLE-dbef551d.js → USE_CLIENT_BUNDLE-78517750.js} +143 -136
  4. package/lib/{edge/USE_SERVER_BUNDLE-abb6c4ae.js → browser/USE_SERVER_BUNDLE-29f23050.js} +1 -1
  5. package/lib/{edge/USE_SERVER_BUNDLE-2000e927.cjs → browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs} +1 -1
  6. package/lib/browser/{bundle-b2b7ab8b.js → bundle-d78727c9.js} +630 -591
  7. package/lib/browser/bundle-eca4b0ba.cjs +169 -0
  8. package/lib/browser/index.cjs +1 -1
  9. package/lib/browser/index.mjs +3 -3
  10. package/lib/{node/USE_CLIENT_BUNDLE-22e26b2f.js → edge/USE_CLIENT_BUNDLE-01cf3cc1.js} +143 -136
  11. package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +21 -0
  12. package/lib/{node/USE_SERVER_BUNDLE-90b6e155.js → edge/USE_SERVER_BUNDLE-2cb317bc.js} +1 -1
  13. package/lib/{node/USE_SERVER_BUNDLE-5a67cb67.cjs → edge/USE_SERVER_BUNDLE-7cb08770.cjs} +1 -1
  14. package/lib/edge/{bundle-f4b34118.cjs → bundle-07c68bbe.cjs} +39 -38
  15. package/lib/edge/{bundle-9950e3ec.js → bundle-7da386a2.js} +1316 -1277
  16. package/lib/edge/index.cjs +1 -1
  17. package/lib/edge/index.mjs +3 -3
  18. package/lib/{edge/USE_CLIENT_BUNDLE-471a7309.js → node/USE_CLIENT_BUNDLE-690f58c3.js} +143 -136
  19. package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +21 -0
  20. package/lib/{browser/USE_SERVER_BUNDLE-a6a333bd.js → node/USE_SERVER_BUNDLE-649f2942.js} +1 -1
  21. package/lib/{browser/USE_SERVER_BUNDLE-545db2f7.cjs → node/USE_SERVER_BUNDLE-e8d80664.cjs} +1 -1
  22. package/lib/node/{bundle-a8519a3b.js → bundle-001f0cdc.js} +272 -233
  23. package/lib/node/{bundle-9f34ab83.cjs → bundle-77f045ce.cjs} +16 -15
  24. package/lib/node/index.cjs +1 -1
  25. package/lib/node/index.mjs +3 -3
  26. package/package.json +1 -1
  27. package/types/cjs/components/block/block.helpers.d.ts +4 -0
  28. package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
  29. package/types/cjs/components/content/components/styles.d.ts +1 -0
  30. package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
  31. package/types/cjs/components/content/contentProps.types.d.ts +6 -1
  32. package/types/cjs/components/content-variants/content-variants.d.ts +1 -1
  33. package/types/cjs/constants/sdk-version.d.ts +1 -1
  34. package/types/cjs/functions/evaluate/evaluate.d.ts +3 -1
  35. package/types/cjs/functions/evaluate/helpers.d.ts +1 -0
  36. package/types/esm/components/block/block.helpers.d.ts +4 -0
  37. package/types/esm/components/content/components/enable-editor.d.ts +1 -1
  38. package/types/esm/components/content/components/styles.d.ts +1 -0
  39. package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
  40. package/types/esm/components/content/contentProps.types.d.ts +6 -1
  41. package/types/esm/components/content-variants/content-variants.d.ts +1 -1
  42. package/types/esm/constants/sdk-version.d.ts +1 -1
  43. package/types/esm/functions/evaluate/evaluate.d.ts +3 -1
  44. package/types/esm/functions/evaluate/helpers.d.ts +1 -0
  45. package/lib/browser/USE_CLIENT_BUNDLE-e0428aec.cjs +0 -21
  46. package/lib/browser/bundle-0de8b96d.cjs +0 -168
  47. package/lib/edge/USE_CLIENT_BUNDLE-1ce5de06.cjs +0 -21
  48. package/lib/node/USE_CLIENT_BUNDLE-07b10dcb.cjs +0 -21
@@ -1,14 +1,14 @@
1
1
  "use client";
2
- import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
3
- import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-b2b7ab8b.js";
4
- import { useRef as T, useState as x, useEffect as b, createContext as me, createElement as ge } from "react";
5
- import { p as he } from "./USE_SERVER_BUNDLE-a6a333bd.js";
6
- import { useRouter as be } from "next/navigation";
2
+ import { jsx as c, Fragment as C, jsxs as E } from "react/jsx-runtime";
3
+ import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-d78727c9.js";
4
+ import { useRef as T, useState as v, useEffect as b, createContext as me, createElement as ge } from "react";
5
+ import { p as be } from "./USE_SERVER_BUNDLE-29f23050.js";
6
+ import { useRouter as he } from "next/navigation";
7
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 }) }) }) });
8
+ return /* @__PURE__ */ c(C, { children: p(e.TagName) ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ c(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
9
9
  }
10
10
  function we(e) {
11
- return /* @__PURE__ */ i(
11
+ return /* @__PURE__ */ c(
12
12
  J,
13
13
  {
14
14
  attributes: {
@@ -29,7 +29,7 @@ function we(e) {
29
29
  );
30
30
  }
31
31
  function Ee(e) {
32
- return /* @__PURE__ */ i(
32
+ return /* @__PURE__ */ c(
33
33
  J,
34
34
  {
35
35
  TagName: e.Wrapper,
@@ -50,7 +50,7 @@ function Ee(e) {
50
50
  );
51
51
  }
52
52
  function Ie(e) {
53
- return /* @__PURE__ */ i(
53
+ return /* @__PURE__ */ c(
54
54
  e.Wrapper,
55
55
  {
56
56
  ...e.wrapperProps,
@@ -72,7 +72,7 @@ function Ie(e) {
72
72
  );
73
73
  }
74
74
  function Re(e) {
75
- function c() {
75
+ function a() {
76
76
  var r;
77
77
  return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
78
78
  }
@@ -89,7 +89,7 @@ function Re(e) {
89
89
  "*"
90
90
  ));
91
91
  }
92
- function S() {
92
+ function f() {
93
93
  var r, u;
94
94
  w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
95
95
  {
@@ -102,22 +102,22 @@ function Re(e) {
102
102
  "*"
103
103
  ));
104
104
  }
105
- return /* @__PURE__ */ E(h, { children: [
106
- /* @__PURE__ */ i(
105
+ return /* @__PURE__ */ E(C, { children: [
106
+ /* @__PURE__ */ c(
107
107
  e.BlocksWrapper,
108
108
  {
109
- className: c() + " props-blocks-wrapper-7354e098",
109
+ className: a() + " props-blocks-wrapper-7cd1560e",
110
110
  "builder-path": e.path,
111
111
  "builder-parent-id": e.parent,
112
112
  style: e.styleProp,
113
113
  onClick: (r) => s(),
114
- onMouseEnter: (r) => S(),
114
+ onMouseEnter: (r) => f(),
115
115
  onKeyPress: (r) => s(),
116
116
  ...e.BlocksWrapperProps,
117
117
  children: e.children
118
118
  }
119
119
  ),
120
- /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-7354e098 {
120
+ /* @__PURE__ */ c("style", { children: `.props-blocks-wrapper-7cd1560e {
121
121
  display: flex;
122
122
  flex-direction: column;
123
123
  align-items: stretch;
@@ -125,11 +125,11 @@ function Re(e) {
125
125
  ] });
126
126
  }
127
127
  function Pe(e) {
128
- return /* @__PURE__ */ i("span", { children: e.children });
128
+ return /* @__PURE__ */ c("span", { children: e.children });
129
129
  }
130
130
  function Te(e) {
131
- var r, u, f, y;
132
- function c() {
131
+ var r, u, h, x;
132
+ function a() {
133
133
  var m;
134
134
  const l = e.image || e.src;
135
135
  if (!l || // We can auto add srcset for cdn.builder.io and shopify
@@ -145,9 +145,9 @@ function Te(e) {
145
145
  }
146
146
  function s() {
147
147
  var g;
148
- return (g = c == null ? void 0 : c()) != null && g.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
148
+ return (g = a == null ? void 0 : a()) != null && g.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
149
149
  }
150
- function S() {
150
+ function f() {
151
151
  const g = {
152
152
  position: "absolute",
153
153
  height: "100%",
@@ -157,11 +157,11 @@ function Te(e) {
157
157
  };
158
158
  return e.aspectRatio ? g : void 0;
159
159
  }
160
- return /* @__PURE__ */ E(h, { children: [
161
- /* @__PURE__ */ E(h, { children: [
160
+ return /* @__PURE__ */ E(C, { children: [
161
+ /* @__PURE__ */ E(C, { children: [
162
162
  /* @__PURE__ */ E("picture", { children: [
163
- s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
164
- /* @__PURE__ */ i(
163
+ s() ? /* @__PURE__ */ c("source", { type: "image/webp", srcSet: s() }) : null,
164
+ /* @__PURE__ */ c(
165
165
  "img",
166
166
  {
167
167
  loading: "lazy",
@@ -170,35 +170,35 @@ function Te(e) {
170
170
  style: {
171
171
  objectPosition: e.backgroundPosition || "center",
172
172
  objectFit: e.backgroundSize || "cover",
173
- ...S()
173
+ ...f()
174
174
  },
175
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-0614da04",
175
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
176
176
  src: e.image,
177
- srcSet: c(),
177
+ srcSet: a(),
178
178
  sizes: e.sizes
179
179
  }
180
180
  )
181
181
  ] }),
182
- e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
182
+ e.aspectRatio && !((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ c(
183
183
  "div",
184
184
  {
185
- className: "builder-image-sizer div-0614da04",
185
+ className: "builder-image-sizer div-a0c95e8c",
186
186
  style: {
187
187
  paddingTop: e.aspectRatio * 100 + "%"
188
188
  }
189
189
  }
190
- ) }) : null,
191
- (y = (f = e.builderBlock) == null ? void 0 : f.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-0614da04-2", children: e.children }) }) : null
190
+ ) : null,
191
+ (x = (h = e.builderBlock) == null ? void 0 : h.children) != null && x.length && e.fitContent ? /* @__PURE__ */ c(C, { children: e.children }) : null,
192
+ !e.fitContent && e.children ? /* @__PURE__ */ c("div", { className: "div-a0c95e8c-2", children: e.children }) : null
193
193
  ] }),
194
- /* @__PURE__ */ i("style", { children: `.img-0614da04 {
194
+ /* @__PURE__ */ c("style", { children: `.img-a0c95e8c {
195
195
  opacity: 1;
196
196
  transition: opacity 0.2s ease-in-out;
197
- }.div-0614da04 {
197
+ }.div-a0c95e8c {
198
198
  width: 100%;
199
199
  pointer-events: none;
200
200
  font-size: 0;
201
- }.div-0614da04-2 {
201
+ }.div-a0c95e8c-2 {
202
202
  display: flex;
203
203
  flex-direction: column;
204
204
  align-items: stretch;
@@ -211,7 +211,7 @@ function Te(e) {
211
211
  ] });
212
212
  }
213
213
  function Ne(e) {
214
- return /* @__PURE__ */ i(
214
+ return /* @__PURE__ */ c(
215
215
  "section",
216
216
  {
217
217
  ...e.attributes,
@@ -232,14 +232,14 @@ function Ne(e) {
232
232
  );
233
233
  }
234
234
  function Be(e) {
235
- const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []);
235
+ const a = T(null), [s, f] = v(() => []), [r, u] = v(() => []);
236
236
  return b(() => {
237
- var y;
238
- if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
237
+ var x;
238
+ if (!((x = a.current) != null && x.getElementsByTagName) || typeof window > "u")
239
239
  return;
240
- const f = c.current.getElementsByTagName("script");
241
- for (let g = 0; g < f.length; g++) {
242
- const l = f[g];
240
+ const h = a.current.getElementsByTagName("script");
241
+ for (let g = 0; g < h.length; g++) {
242
+ const l = h[g];
243
243
  if (l.src) {
244
244
  if (s.includes(l.src))
245
245
  continue;
@@ -260,48 +260,48 @@ function Be(e) {
260
260
  }
261
261
  }
262
262
  }
263
- }, []), /* @__PURE__ */ i(
263
+ }, []), /* @__PURE__ */ c(
264
264
  "div",
265
265
  {
266
- ref: c,
266
+ ref: a,
267
267
  className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
268
268
  dangerouslySetInnerHTML: { __html: e.code }
269
269
  }
270
270
  );
271
271
  }
272
272
  function Le(e) {
273
- const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []), [f, y] = x(() => !1);
273
+ const a = T(null), [s, f] = v(() => []), [r, u] = v(() => []), [h, x] = v(() => !1);
274
274
  function g() {
275
- if (!c.current || !c.current.getElementsByTagName)
275
+ if (!a.current || !a.current.getElementsByTagName)
276
276
  return;
277
- const l = c.current.getElementsByTagName("script");
277
+ const l = a.current.getElementsByTagName("script");
278
278
  for (let m = 0; m < l.length; m++) {
279
- const k = l[m];
280
- if (k.src && !s.includes(k.src)) {
281
- s.push(k.src);
282
- const C = document.createElement("script");
283
- C.async = !0, C.src = k.src, document.head.appendChild(C);
284
- } else if (ee(k) && !r.includes(k.innerText))
279
+ const y = l[m];
280
+ if (y.src && !s.includes(y.src)) {
281
+ s.push(y.src);
282
+ const k = document.createElement("script");
283
+ k.async = !0, k.src = y.src, document.head.appendChild(k);
284
+ } else if (ee(y) && !r.includes(y.innerText))
285
285
  try {
286
- r.push(k.innerText), new Function(k.innerText)();
287
- } catch (C) {
288
- console.warn("`Embed`: Error running script:", C);
286
+ r.push(y.innerText), new Function(y.innerText)();
287
+ } catch (k) {
288
+ console.warn("`Embed`: Error running script:", k);
289
289
  }
290
290
  }
291
291
  }
292
292
  return b(() => {
293
- c.current && !f && (y(!0), g());
294
- }, [c.current, f]), /* @__PURE__ */ i(
293
+ a.current && !h && (x(!0), g());
294
+ }, [a.current, h]), /* @__PURE__ */ c(
295
295
  "div",
296
296
  {
297
297
  className: "builder-embed",
298
- ref: c,
298
+ ref: a,
299
299
  dangerouslySetInnerHTML: { __html: e.content }
300
300
  }
301
301
  );
302
302
  }
303
303
  function je(e) {
304
- return /* @__PURE__ */ i(
304
+ return /* @__PURE__ */ c(
305
305
  "img",
306
306
  {
307
307
  style: {
@@ -316,8 +316,8 @@ function je(e) {
316
316
  );
317
317
  }
318
318
  function We(e) {
319
- var S, r, u, f, y, g, l;
320
- function c() {
319
+ var f, r, u, h, x, g, l;
320
+ function a() {
321
321
  return {
322
322
  ...e.autoPlay === !0 ? {
323
323
  autoPlay: !0
@@ -338,7 +338,7 @@ function We(e) {
338
338
  }
339
339
  function s() {
340
340
  return {
341
- ...c()
341
+ ...a()
342
342
  };
343
343
  }
344
344
  return /* @__PURE__ */ E(
@@ -348,7 +348,7 @@ function We(e) {
348
348
  position: "relative"
349
349
  },
350
350
  children: [
351
- /* @__PURE__ */ i(
351
+ /* @__PURE__ */ c(
352
352
  "video",
353
353
  {
354
354
  className: "builder-video",
@@ -357,7 +357,7 @@ function We(e) {
357
357
  style: {
358
358
  width: "100%",
359
359
  height: "100%",
360
- ...(S = e.attributes) == null ? void 0 : S.style,
360
+ ...(f = e.attributes) == null ? void 0 : f.style,
361
361
  objectFit: e.fit,
362
362
  objectPosition: e.position,
363
363
  // Hack to get object fit to work as expected and
@@ -370,10 +370,10 @@ function We(e) {
370
370
  },
371
371
  src: e.video || "no-src",
372
372
  poster: e.posterImage,
373
- children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
373
+ children: e.lazyLoad ? null : /* @__PURE__ */ c("source", { type: "video/mp4", src: e.video })
374
374
  }
375
375
  ),
376
- e.aspectRatio && !(e.fitContent && ((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
376
+ e.aspectRatio && !(e.fitContent && ((u = (r = e.builderBlock) == null ? void 0 : r.children) != null && u.length)) ? /* @__PURE__ */ c(
377
377
  "div",
378
378
  {
379
379
  style: {
@@ -383,8 +383,8 @@ function We(e) {
383
383
  fontSize: "0px"
384
384
  }
385
385
  }
386
- ) }) : null,
387
- (y = (f = e.builderBlock) == null ? void 0 : f.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
386
+ ) : null,
387
+ (x = (h = e.builderBlock) == null ? void 0 : h.children) != null && x.length && e.fitContent ? /* @__PURE__ */ c(
388
388
  "div",
389
389
  {
390
390
  style: {
@@ -394,8 +394,8 @@ function We(e) {
394
394
  },
395
395
  children: e.children
396
396
  }
397
- ) }) : null,
398
- (l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
397
+ ) : null,
398
+ (l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ c(
399
399
  "div",
400
400
  {
401
401
  style: {
@@ -411,7 +411,7 @@ function We(e) {
411
411
  },
412
412
  children: e.children
413
413
  }
414
- ) }) : null
414
+ ) : null
415
415
  ]
416
416
  }
417
417
  );
@@ -432,42 +432,42 @@ const fe = me({
432
432
  });
433
433
  function Ke(e) {
434
434
  var W, K, A, F, z, M, _;
435
- const c = T(null), [s, S] = x(() => 0);
436
- x(() => !0);
435
+ const a = T(null), [s, f] = v(() => 0);
436
+ v(() => !0);
437
437
  function r(n) {
438
- var a, o;
438
+ var i, o;
439
439
  const t = {
440
440
  ...e.builderContextSignal.rootState,
441
441
  ...n
442
442
  };
443
- e.builderContextSignal.rootSetState ? (o = (a = e.builderContextSignal).rootSetState) == null || o.call(a, t) : e.builderContextSignal.rootState = t;
443
+ e.builderContextSignal.rootSetState ? (o = (i = e.builderContextSignal).rootSetState) == null || o.call(i, t) : e.builderContextSignal.rootState = t;
444
444
  }
445
445
  function u(n) {
446
- var a, o, d, v, q;
446
+ var i, o, d, S, q;
447
447
  const t = {
448
448
  ...e.builderContextSignal.content,
449
449
  ...n,
450
450
  data: {
451
- ...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
451
+ ...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
452
452
  ...n == null ? void 0 : n.data
453
453
  },
454
454
  meta: {
455
455
  ...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
456
456
  ...n == null ? void 0 : n.meta,
457
- breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (v = e.builderContextSignal.content) == null ? void 0 : v.meta) == null ? void 0 : q.breakpoints)
457
+ breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (S = e.builderContextSignal.content) == null ? void 0 : S.meta) == null ? void 0 : q.breakpoints)
458
458
  }
459
459
  };
460
- he({
460
+ be({
461
461
  value: t,
462
462
  key: t.id
463
463
  }).then(() => {
464
464
  Z.refresh();
465
465
  });
466
466
  }
467
- x(() => 0);
468
- const [f, y] = x(
467
+ v(() => 0);
468
+ const [h, x] = v(
469
469
  () => !1
470
- ), [g, l] = x(
470
+ ), [g, l] = v(
471
471
  () => e.contentWrapper || "div"
472
472
  );
473
473
  function m(n) {
@@ -477,38 +477,42 @@ function Ke(e) {
477
477
  callbacks: {
478
478
  configureSdk: (t) => {
479
479
  var d;
480
- const { breakpoints: a, contentId: o } = t;
481
- !o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || a && (u({
480
+ const { breakpoints: i, contentId: o } = t;
481
+ !o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || i && (u({
482
482
  meta: {
483
- breakpoints: a
483
+ breakpoints: i
484
484
  }
485
- }), S(s + 1));
485
+ }), f(s + 1));
486
486
  },
487
487
  animation: (t) => {
488
488
  ae(t);
489
489
  },
490
490
  contentUpdate: (t) => {
491
- u(t), S(s + 1);
491
+ u(t), f(s + 1);
492
492
  }
493
493
  }
494
494
  })(n);
495
495
  }
496
- function k() {
497
- var t, a;
498
- const n = (a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.jsCode;
496
+ function y() {
497
+ var t, i;
498
+ const n = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.jsCode;
499
499
  n && U({
500
500
  code: n,
501
501
  context: e.context || {},
502
502
  localState: void 0,
503
503
  rootState: e.builderContextSignal.rootState,
504
- rootSetState: e.builderContextSignal.rootSetState
504
+ rootSetState: e.builderContextSignal.rootSetState,
505
+ /**
506
+ * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
507
+ */
508
+ enableCache: !1
505
509
  });
506
510
  }
507
- const [C, Se] = x(() => ({})), [N, G] = x(() => !1);
511
+ const [k, Se] = v(() => ({})), [N, G] = v(() => !1);
508
512
  function Q(n) {
509
- var t, a;
513
+ var t, i;
510
514
  if (e.builderContextSignal.content) {
511
- const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
515
+ const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
512
516
  D({
513
517
  type: "click",
514
518
  canTrack: V(e.canTrack),
@@ -524,35 +528,38 @@ function Ke(e) {
524
528
  function X(n) {
525
529
  return n.replace(
526
530
  /{{([^}]+)}}/g,
527
- (t, a) => U({
528
- code: a,
529
- context: e.context || {},
530
- localState: void 0,
531
- rootState: e.builderContextSignal.rootState,
532
- rootSetState: e.builderContextSignal.rootSetState
533
- })
531
+ (t, i) => String(
532
+ U({
533
+ code: i,
534
+ context: e.context || {},
535
+ localState: void 0,
536
+ rootState: e.builderContextSignal.rootState,
537
+ rootSetState: e.builderContextSignal.rootSetState,
538
+ enableCache: !0
539
+ })
540
+ )
534
541
  );
535
542
  }
536
543
  function Y({ url: n, key: t }) {
537
- ue(n).then((a) => a.json()).then((a) => {
538
- var d, v;
544
+ ue(n).then((i) => i.json()).then((i) => {
545
+ var d, S;
539
546
  const o = {
540
547
  ...e.builderContextSignal.rootState,
541
- [t]: a
548
+ [t]: i
542
549
  };
543
- (v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), C[t] = !0;
544
- }).catch((a) => {
545
- console.error("error fetching dynamic data", n, a);
550
+ (S = (d = e.builderContextSignal).rootSetState) == null || S.call(d, o), k[t] = !0;
551
+ }).catch((i) => {
552
+ console.error("error fetching dynamic data", n, i);
546
553
  });
547
554
  }
548
555
  function B() {
549
- var t, a;
550
- const n = ((a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.httpRequests) ?? {};
556
+ var t, i;
557
+ const n = ((i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) ?? {};
551
558
  Object.entries(n).forEach(([o, d]) => {
552
- if (d && (!C[o] || w())) {
553
- const v = X(d);
559
+ if (d && (!k[o] || w())) {
560
+ const S = X(d);
554
561
  Y({
555
- url: v,
562
+ url: S,
556
563
  key: o
557
564
  });
558
565
  }
@@ -574,7 +581,7 @@ function Ke(e) {
574
581
  );
575
582
  }
576
583
  function L(n) {
577
- S(s + 1), window.addEventListener("message", m), le(), oe({
584
+ f(s + 1), window.addEventListener("message", m), le(), oe({
578
585
  ...e.locale ? {
579
586
  locale: e.locale
580
587
  } : {},
@@ -588,46 +595,46 @@ function Ke(e) {
588
595
  e.builderContextSignal.componentInfos
589
596
  ).forEach((t) => {
590
597
  var o;
591
- const a = de(t);
592
- (o = window.parent) == null || o.postMessage(a, "*");
598
+ const i = de(t);
599
+ (o = window.parent) == null || o.postMessage(i, "*");
593
600
  }), window.addEventListener(
594
601
  "builder:component:stateChangeListenerActivated",
595
602
  I
596
603
  );
597
604
  }
598
605
  function j(n) {
599
- const t = new URL(location.href).searchParams, a = t.get("builder.preview"), o = t.get(
600
- `builder.preview.${a}`
606
+ const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
607
+ `builder.preview.${i}`
601
608
  ), d = t.get("apiKey") || t.get("builder.space");
602
- a === e.model && d === e.apiKey && (!e.content || o === e.content.id) && se({
609
+ i === e.model && d === e.apiKey && (!e.content || o === e.content.id) && se({
603
610
  model: e.model,
604
611
  apiKey: e.apiKey,
605
612
  apiVersion: e.builderContextSignal.apiVersion
606
- }).then((v) => {
607
- v && u(v);
613
+ }).then((S) => {
614
+ S && u(S);
608
615
  });
609
616
  }
610
- const Z = be();
617
+ const Z = he();
611
618
  return b(() => {
612
619
  var n;
613
- return (n = c.current) == null || n.addEventListener(
620
+ return (n = a.current) == null || n.addEventListener(
614
621
  "initeditingbldr",
615
622
  L
616
623
  ), () => {
617
624
  var t;
618
- return (t = c.current) == null ? void 0 : t.removeEventListener(
625
+ return (t = a.current) == null ? void 0 : t.removeEventListener(
619
626
  "initeditingbldr",
620
627
  L
621
628
  );
622
629
  };
623
630
  }, []), b(() => {
624
631
  var n;
625
- return (n = c.current) == null || n.addEventListener(
632
+ return (n = a.current) == null || n.addEventListener(
626
633
  "initpreviewingbldr",
627
634
  j
628
635
  ), () => {
629
636
  var t;
630
- return (t = c.current) == null ? void 0 : t.removeEventListener(
637
+ return (t = a.current) == null ? void 0 : t.removeEventListener(
631
638
  "initpreviewingbldr",
632
639
  j
633
640
  );
@@ -635,13 +642,13 @@ function Ke(e) {
635
642
  }, []), b(() => {
636
643
  var n, t;
637
644
  if (P()) {
638
- if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
639
- const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, v = e.apiKey;
645
+ if (w() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
646
+ const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, S = e.apiKey;
640
647
  D({
641
648
  type: "impression",
642
649
  canTrack: !0,
643
650
  contentId: d,
644
- apiKey: v,
651
+ apiKey: S,
645
652
  variationId: o !== d ? o : void 0
646
653
  });
647
654
  }
@@ -650,12 +657,12 @@ function Ke(e) {
650
657
  }, []), b(() => {
651
658
  e.apiKey || ne.error(
652
659
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
653
- ), k(), B(), I();
660
+ ), y(), B(), I();
654
661
  }, []), b(() => {
655
662
  }, [e.content]), b(() => {
656
663
  P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
657
- }, [f]), b(() => {
658
- k();
664
+ }, [h]), b(() => {
665
+ y();
659
666
  }, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), b(() => {
660
667
  B();
661
668
  }, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
@@ -671,11 +678,11 @@ function Ke(e) {
671
678
  "builder:component:stateChangeListenerActivated",
672
679
  I
673
680
  ));
674
- }, []), /* @__PURE__ */ i(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ ge(
681
+ }, []), /* @__PURE__ */ c(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ ge(
675
682
  g,
676
683
  {
677
684
  key: s,
678
- ref: c,
685
+ ref: a,
679
686
  onClick: (n) => Q(n),
680
687
  "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
681
688
  "builder-model": e.model,
@@ -687,7 +694,7 @@ function Ke(e) {
687
694
  className: `variant-${((M = e.content) == null ? void 0 : M.testVariationId) || ((_ = e.content) == null ? void 0 : _.id)}`
688
695
  },
689
696
  e.children
690
- ) }) : null });
697
+ ) : null });
691
698
  }
692
699
  export {
693
700
  Ee as B,
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { v as s } from "./bundle-9950e3ec.js";
2
+ import { v as s } from "./bundle-d78727c9.js";
3
3
  async function n({
4
4
  key: t,
5
5
  value: r
@@ -1 +1 @@
1
- "use server";"use strict";const n=require("./bundle-f4b34118.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
1
+ "use server";"use strict";const n=require("./bundle-eca4b0ba.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;