@builder.io/sdk-react-nextjs 0.12.7 → 0.12.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 (38) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-456ca2b5.js → USE_CLIENT_BUNDLE-164b0828.js} +169 -175
  2. package/lib/browser/USE_CLIENT_BUNDLE-a350a268.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-dffaa191.js → browser/USE_SERVER_BUNDLE-5219d3fc.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-dbf92938.cjs → browser/USE_SERVER_BUNDLE-b1e8364e.cjs} +1 -1
  5. package/lib/browser/{bundle-a408994f.cjs → bundle-f375f07b.cjs} +19 -19
  6. package/lib/browser/{bundle-56e0b400.js → bundle-f83a1ca5.js} +345 -298
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +20 -19
  9. package/lib/{node/USE_CLIENT_BUNDLE-499aeaa2.js → edge/USE_CLIENT_BUNDLE-b8d07605.js} +169 -175
  10. package/lib/edge/USE_CLIENT_BUNDLE-f1ccd54b.cjs +21 -0
  11. package/lib/{node/USE_SERVER_BUNDLE-b3ad9a89.cjs → edge/USE_SERVER_BUNDLE-2e4c0a0a.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-e3da6caa.js → edge/USE_SERVER_BUNDLE-cd7a6238.js} +1 -1
  13. package/lib/edge/{bundle-4bf88f38.js → bundle-3da03df6.js} +386 -339
  14. package/lib/edge/{bundle-97ad81d1.cjs → bundle-5b207761.cjs} +25 -25
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +20 -19
  17. package/lib/{edge/USE_CLIENT_BUNDLE-789e694f.js → node/USE_CLIENT_BUNDLE-e0108fb4.js} +169 -175
  18. package/lib/node/USE_CLIENT_BUNDLE-e31c74cc.cjs +21 -0
  19. package/lib/{browser/USE_SERVER_BUNDLE-ee4a5d19.cjs → node/USE_SERVER_BUNDLE-29398256.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-e0f1c15b.js → node/USE_SERVER_BUNDLE-3e951ab1.js} +1 -1
  21. package/lib/node/{bundle-d3f89e99.js → bundle-6c5cef2d.js} +62 -15
  22. package/lib/node/{bundle-97b4832a.cjs → bundle-83186530.cjs} +9 -9
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +20 -19
  25. package/package.json +1 -1
  26. package/types/cjs/components/content-variants/helpers.d.ts +1 -1
  27. package/types/cjs/constants/sdk-version.d.ts +1 -1
  28. package/types/cjs/helpers/preview-lru-cache/get.d.ts +1 -1
  29. package/types/cjs/helpers/subscribe-to-editor.d.ts +35 -0
  30. package/types/cjs/server-index.d.ts +18 -3
  31. package/types/esm/components/content-variants/helpers.d.ts +1 -1
  32. package/types/esm/constants/sdk-version.d.ts +1 -1
  33. package/types/esm/helpers/preview-lru-cache/get.d.ts +1 -1
  34. package/types/esm/helpers/subscribe-to-editor.d.ts +35 -0
  35. package/types/esm/server-index.d.ts +18 -3
  36. package/lib/browser/USE_CLIENT_BUNDLE-9d2b983d.cjs +0 -21
  37. package/lib/edge/USE_CLIENT_BUNDLE-a6a0becc.cjs +0 -21
  38. package/lib/node/USE_CLIENT_BUNDLE-b2f9be29.cjs +0 -21
@@ -1,9 +1,9 @@
1
1
  "use client";
2
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, 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-56e0b400.js";
4
- import { useRef as T, useState as x, useEffect as f, createContext as me, createElement as ge } from "react";
5
- import { p as be } from "./USE_SERVER_BUNDLE-e0f1c15b.js";
6
- import { useRouter as he } from "next/navigation";
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-f83a1ca5.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-5219d3fc.js";
6
+ import { useRouter as be } from "next/navigation";
7
7
  function J(e) {
8
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
9
  }
@@ -14,7 +14,7 @@ function we(e) {
14
14
  TagName: e.link ? e.builderLinkComponent || "a" : "button",
15
15
  attributes: {
16
16
  ...e.attributes,
17
- [D()]: `${e.link ? "" : "builder-button"} ${e.attributes[D()] || ""}`,
17
+ [H()]: `${e.link ? "" : "builder-button"} ${e.attributes[H()] || ""}`,
18
18
  ...e.link ? {
19
19
  href: e.link,
20
20
  target: e.openLinkInNewTab ? "_blank" : void 0,
@@ -73,12 +73,12 @@ function Ie(e) {
73
73
  }
74
74
  function Re(e) {
75
75
  function c() {
76
- var l;
77
- return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
76
+ var r;
77
+ return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
78
78
  }
79
79
  function s() {
80
- var l, u;
81
- w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
80
+ var r, u;
81
+ w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
82
82
  {
83
83
  type: "builder.clickEmptyBlocks",
84
84
  data: {
@@ -89,9 +89,9 @@ function Re(e) {
89
89
  "*"
90
90
  ));
91
91
  }
92
- function v() {
93
- var l, u;
94
- w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
92
+ function S() {
93
+ var r, u;
94
+ w() && !((r = e.blocks) != null && r.length) && ((u = window.parent) == null || u.postMessage(
95
95
  {
96
96
  type: "builder.hoverEmptyBlocks",
97
97
  data: {
@@ -110,9 +110,9 @@ function Re(e) {
110
110
  "builder-path": e.path,
111
111
  "builder-parent-id": e.parent,
112
112
  style: e.styleProp,
113
- onClick: (l) => s(),
114
- onMouseEnter: (l) => v(),
115
- onKeyPress: (l) => s(),
113
+ onClick: (r) => s(),
114
+ onMouseEnter: (r) => S(),
115
+ onKeyPress: (r) => s(),
116
116
  ...e.BlocksWrapperProps,
117
117
  children: e.children
118
118
  }
@@ -128,34 +128,34 @@ function Pe(e) {
128
128
  return /* @__PURE__ */ i("span", { children: e.children });
129
129
  }
130
130
  function Te(e) {
131
- var l, u, S, y;
131
+ var r, u, f, y;
132
132
  function c() {
133
133
  var m;
134
- const o = e.image || e.src;
135
- if (!o || // We can auto add srcset for cdn.builder.io and shopify
134
+ const l = e.image || e.src;
135
+ if (!l || // We can auto add srcset for cdn.builder.io and shopify
136
136
  // images, otherwise you can supply this prop manually
137
- !(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
137
+ !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
138
138
  return e.srcset;
139
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
- return console.debug("Removed given srcset"), R(o);
141
+ return console.debug("Removed given srcset"), R(l);
142
142
  } else if (e.image && !e.srcset)
143
- return R(o);
144
- return R(o);
143
+ return R(l);
144
+ return R(l);
145
145
  }
146
146
  function s() {
147
- var b;
148
- return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
147
+ var g;
148
+ return (g = c == null ? void 0 : c()) != null && g.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
149
149
  }
150
- function v() {
151
- const b = {
150
+ function S() {
151
+ const g = {
152
152
  position: "absolute",
153
153
  height: "100%",
154
154
  width: "100%",
155
155
  left: "0px",
156
156
  top: "0px"
157
157
  };
158
- return e.aspectRatio ? b : void 0;
158
+ return e.aspectRatio ? g : void 0;
159
159
  }
160
160
  return /* @__PURE__ */ E(h, { children: [
161
161
  /* @__PURE__ */ E(h, { children: [
@@ -170,7 +170,7 @@ function Te(e) {
170
170
  style: {
171
171
  objectPosition: e.backgroundPosition || "center",
172
172
  objectFit: e.backgroundSize || "cover",
173
- ...v()
173
+ ...S()
174
174
  },
175
175
  className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
176
176
  src: e.image,
@@ -179,7 +179,7 @@ function Te(e) {
179
179
  }
180
180
  )
181
181
  ] }),
182
- e.aspectRatio && !((u = (l = e.builderBlock) == null ? void 0 : l.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__ */ i(h, { children: /* @__PURE__ */ i(
183
183
  "div",
184
184
  {
185
185
  className: "builder-image-sizer div-40c70c9b",
@@ -188,7 +188,7 @@ function Te(e) {
188
188
  }
189
189
  }
190
190
  ) }) : null,
191
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
191
+ (y = (f = e.builderBlock) == null ? void 0 : f.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
192
192
  !e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
193
193
  ] }),
194
194
  /* @__PURE__ */ i("style", { children: `.img-40c70c9b {
@@ -232,29 +232,29 @@ function Ne(e) {
232
232
  );
233
233
  }
234
234
  function Be(e) {
235
- const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
236
- return f(() => {
235
+ const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []);
236
+ return b(() => {
237
237
  var y;
238
238
  if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
239
239
  return;
240
- const S = c.current.getElementsByTagName("script");
241
- for (let b = 0; b < S.length; b++) {
242
- const o = S[b];
243
- if (o.src) {
244
- if (s.includes(o.src))
240
+ const f = c.current.getElementsByTagName("script");
241
+ for (let g = 0; g < f.length; g++) {
242
+ const l = f[g];
243
+ if (l.src) {
244
+ if (s.includes(l.src))
245
245
  continue;
246
- s.push(o.src);
246
+ s.push(l.src);
247
247
  const m = document.createElement("script");
248
- m.async = !0, m.src = o.src, document.head.appendChild(m);
249
- } else if (!o.type || [
248
+ m.async = !0, m.src = l.src, document.head.appendChild(m);
249
+ } else if (!l.type || [
250
250
  "text/javascript",
251
251
  "application/javascript",
252
252
  "application/ecmascript"
253
- ].includes(o.type)) {
254
- if (l.includes(o.innerText))
253
+ ].includes(l.type)) {
254
+ if (r.includes(l.innerText))
255
255
  continue;
256
256
  try {
257
- l.push(o.innerText), new Function(o.innerText)();
257
+ r.push(l.innerText), new Function(l.innerText)();
258
258
  } catch (m) {
259
259
  console.warn("`CustomCode`: Error running script:", m);
260
260
  }
@@ -270,28 +270,28 @@ function Be(e) {
270
270
  );
271
271
  }
272
272
  function Le(e) {
273
- const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
274
- function b() {
273
+ const c = T(null), [s, S] = x(() => []), [r, u] = x(() => []), [f, y] = x(() => !1);
274
+ function g() {
275
275
  if (!c.current || !c.current.getElementsByTagName)
276
276
  return;
277
- const o = c.current.getElementsByTagName("script");
278
- for (let m = 0; m < o.length; m++) {
279
- const k = o[m];
277
+ const l = c.current.getElementsByTagName("script");
278
+ for (let m = 0; m < l.length; m++) {
279
+ const k = l[m];
280
280
  if (k.src && !s.includes(k.src)) {
281
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 (ee(k) && !l.includes(k.innerText))
284
+ } else if (ee(k) && !r.includes(k.innerText))
285
285
  try {
286
- l.push(k.innerText), new Function(k.innerText)();
286
+ r.push(k.innerText), new Function(k.innerText)();
287
287
  } catch (C) {
288
288
  console.warn("`Embed`: Error running script:", C);
289
289
  }
290
290
  }
291
291
  }
292
- return f(() => {
293
- c.current && !S && (y(!0), b());
294
- }, [c.current, S]), /* @__PURE__ */ i(
292
+ return b(() => {
293
+ c.current && !f && (y(!0), g());
294
+ }, [c.current, f]), /* @__PURE__ */ i(
295
295
  "div",
296
296
  {
297
297
  className: "builder-embed",
@@ -316,7 +316,7 @@ function je(e) {
316
316
  );
317
317
  }
318
318
  function We(e) {
319
- var v, l, u, S, y, b, o;
319
+ var S, r, u, f, y, g, l;
320
320
  function c() {
321
321
  return {
322
322
  ...e.autoPlay === !0 ? {
@@ -357,7 +357,7 @@ function We(e) {
357
357
  style: {
358
358
  width: "100%",
359
359
  height: "100%",
360
- ...(v = e.attributes) == null ? void 0 : v.style,
360
+ ...(S = e.attributes) == null ? void 0 : S.style,
361
361
  objectFit: e.fit,
362
362
  objectPosition: e.position,
363
363
  // Hack to get object fit to work as expected and
@@ -373,7 +373,7 @@ function We(e) {
373
373
  children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
374
374
  }
375
375
  ),
376
- e.aspectRatio && !(e.fitContent && ((u = (l = e.builderBlock) == null ? void 0 : l.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__ */ i(h, { children: /* @__PURE__ */ i(
377
377
  "div",
378
378
  {
379
379
  style: {
@@ -384,7 +384,7 @@ function We(e) {
384
384
  }
385
385
  }
386
386
  ) }) : null,
387
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
387
+ (y = (f = e.builderBlock) == null ? void 0 : f.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 We(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__ */ i(h, { children: /* @__PURE__ */ i(
398
+ (l = (g = e.builderBlock) == null ? void 0 : g.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
399
399
  "div",
400
400
  {
401
401
  style: {
@@ -430,80 +430,74 @@ const fe = me({
430
430
  BlocksWrapper: "div",
431
431
  BlocksWrapperProps: {}
432
432
  });
433
- function Ae(e) {
434
- var W, A, F, K, z, M, _;
435
- const c = T(null), [s, v] = x(() => 0);
433
+ function Ke(e) {
434
+ var W, K, A, F, z, M, _;
435
+ const c = T(null), [s, S] = x(() => 0);
436
436
  x(() => !0);
437
- function l(t) {
438
- var a, r;
439
- const n = {
437
+ function r(n) {
438
+ var a, o;
439
+ const t = {
440
440
  ...e.builderContextSignal.rootState,
441
- ...t
441
+ ...n
442
442
  };
443
- e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, n) : e.builderContextSignal.rootState = n;
443
+ e.builderContextSignal.rootSetState ? (o = (a = e.builderContextSignal).rootSetState) == null || o.call(a, t) : e.builderContextSignal.rootState = t;
444
444
  }
445
- function u(t) {
446
- var a, r, d, g, q;
447
- const n = {
445
+ function u(n) {
446
+ var a, o, d, v, q;
447
+ const t = {
448
448
  ...e.builderContextSignal.content,
449
- ...t,
449
+ ...n,
450
450
  data: {
451
451
  ...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
452
- ...t == null ? void 0 : t.data
452
+ ...n == null ? void 0 : n.data
453
453
  },
454
454
  meta: {
455
- ...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
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)
455
+ ...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
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)
458
458
  }
459
459
  };
460
- be({
461
- value: n,
462
- key: n.id
460
+ he({
461
+ value: t,
462
+ key: t.id
463
463
  }).then(() => {
464
464
  Z.refresh();
465
465
  });
466
466
  }
467
467
  x(() => 0);
468
- const [S, y] = x(
468
+ const [f, y] = x(
469
469
  () => !1
470
- ), [b, o] = x(
470
+ ), [g, l] = x(
471
471
  () => e.contentWrapper || "div"
472
472
  );
473
- function m(t) {
474
- var a;
475
- if (!ie(e.trustedHosts, t))
476
- return;
477
- const { data: n } = t;
478
- if (n)
479
- switch (n.type) {
480
- case "builder.configureSdk": {
481
- const r = n.data, { breakpoints: d, contentId: g } = r;
482
- if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
483
- return;
484
- d && u({
473
+ function m(n) {
474
+ return ie({
475
+ model: e.model,
476
+ trustedHosts: e.trustedHosts,
477
+ callbacks: {
478
+ configureSdk: (t) => {
479
+ var d;
480
+ const { breakpoints: a, contentId: o } = t;
481
+ !o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || a && (u({
485
482
  meta: {
486
- breakpoints: d
483
+ breakpoints: a
487
484
  }
488
- }), v(s + 1);
489
- break;
490
- }
491
- case "builder.triggerAnimation": {
492
- ae(n.data);
493
- break;
494
- }
495
- case "builder.contentUpdate": {
496
- const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
497
- d === e.model && (u(g), v(s + 1));
498
- break;
485
+ }), S(s + 1));
486
+ },
487
+ animation: (t) => {
488
+ ae(t);
489
+ },
490
+ contentUpdate: (t) => {
491
+ u(t), S(s + 1);
499
492
  }
500
493
  }
494
+ })(n);
501
495
  }
502
496
  function k() {
503
- var n, a;
504
- const t = (a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.jsCode;
505
- t && U({
506
- code: t,
497
+ var t, a;
498
+ const n = (a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.jsCode;
499
+ n && U({
500
+ code: n,
507
501
  context: e.context || {},
508
502
  localState: void 0,
509
503
  rootState: e.builderContextSignal.rootState,
@@ -511,26 +505,26 @@ function Ae(e) {
511
505
  });
512
506
  }
513
507
  const [C, Se] = x(() => ({})), [N, G] = x(() => !1);
514
- function Q(t) {
515
- var n, a;
508
+ function Q(n) {
509
+ var t, a;
516
510
  if (e.builderContextSignal.content) {
517
- const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
518
- V({
511
+ const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
512
+ D({
519
513
  type: "click",
520
- canTrack: H(e.canTrack),
514
+ canTrack: V(e.canTrack),
521
515
  contentId: d,
522
516
  apiKey: e.apiKey,
523
- variationId: r !== d ? r : void 0,
524
- ...ce(t),
517
+ variationId: o !== d ? o : void 0,
518
+ ...ce(n),
525
519
  unique: !N
526
520
  });
527
521
  }
528
522
  N || G(!0);
529
523
  }
530
- function X(t) {
531
- return t.replace(
524
+ function X(n) {
525
+ return n.replace(
532
526
  /{{([^}]+)}}/g,
533
- (n, a) => U({
527
+ (t, a) => U({
534
528
  code: a,
535
529
  context: e.context || {},
536
530
  localState: void 0,
@@ -539,27 +533,27 @@ function Ae(e) {
539
533
  })
540
534
  );
541
535
  }
542
- function Y({ url: t, key: n }) {
543
- ue(t).then((a) => a.json()).then((a) => {
544
- var d, g;
545
- const r = {
536
+ function Y({ url: n, key: t }) {
537
+ ue(n).then((a) => a.json()).then((a) => {
538
+ var d, v;
539
+ const o = {
546
540
  ...e.builderContextSignal.rootState,
547
- [n]: a
541
+ [t]: a
548
542
  };
549
- (g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), C[n] = !0;
543
+ (v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), C[t] = !0;
550
544
  }).catch((a) => {
551
- console.error("error fetching dynamic data", t, a);
545
+ console.error("error fetching dynamic data", n, a);
552
546
  });
553
547
  }
554
548
  function B() {
555
- var n, a;
556
- const t = ((a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.httpRequests) ?? {};
557
- Object.entries(t).forEach(([r, d]) => {
558
- if (d && (!C[r] || w())) {
559
- const g = X(d);
549
+ var t, a;
550
+ const n = ((a = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : a.httpRequests) ?? {};
551
+ Object.entries(n).forEach(([o, d]) => {
552
+ if (d && (!C[o] || w())) {
553
+ const v = X(d);
560
554
  Y({
561
- url: g,
562
- key: r
555
+ url: v,
556
+ key: o
563
557
  });
564
558
  }
565
559
  });
@@ -579,8 +573,8 @@ function Ae(e) {
579
573
  )
580
574
  );
581
575
  }
582
- function L(t) {
583
- v(s + 1), window.addEventListener("message", m), le(), oe({
576
+ function L(n) {
577
+ S(s + 1), window.addEventListener("message", m), le(), oe({
584
578
  ...e.locale ? {
585
579
  locale: e.locale
586
580
  } : {},
@@ -595,97 +589,97 @@ function Ae(e) {
595
589
  } : {}
596
590
  }), Object.values(
597
591
  e.builderContextSignal.componentInfos
598
- ).forEach((n) => {
599
- var r;
600
- const a = de(n);
601
- (r = window.parent) == null || r.postMessage(a, "*");
592
+ ).forEach((t) => {
593
+ var o;
594
+ const a = de(t);
595
+ (o = window.parent) == null || o.postMessage(a, "*");
602
596
  }), window.addEventListener(
603
597
  "builder:component:stateChangeListenerActivated",
604
598
  I
605
599
  );
606
600
  }
607
- function j(t) {
608
- const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
601
+ function j(n) {
602
+ const t = new URL(location.href).searchParams, a = t.get("builder.preview"), o = t.get(
609
603
  `builder.preview.${a}`
610
- ), d = n.get("apiKey") || n.get("builder.space");
611
- a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && se({
604
+ ), d = t.get("apiKey") || t.get("builder.space");
605
+ a === e.model && d === e.apiKey && (!e.content || o === e.content.id) && se({
612
606
  model: e.model,
613
607
  apiKey: e.apiKey,
614
608
  apiVersion: e.builderContextSignal.apiVersion
615
- }).then((g) => {
616
- g && u(g);
609
+ }).then((v) => {
610
+ v && u(v);
617
611
  });
618
612
  }
619
- const Z = he();
620
- return f(() => {
621
- var t;
622
- return (t = c.current) == null || t.addEventListener(
613
+ const Z = be();
614
+ return b(() => {
615
+ var n;
616
+ return (n = c.current) == null || n.addEventListener(
623
617
  "initeditingbldr",
624
618
  L
625
619
  ), () => {
626
- var n;
627
- return (n = c.current) == null ? void 0 : n.removeEventListener(
620
+ var t;
621
+ return (t = c.current) == null ? void 0 : t.removeEventListener(
628
622
  "initeditingbldr",
629
623
  L
630
624
  );
631
625
  };
632
- }, []), f(() => {
633
- var t;
634
- return (t = c.current) == null || t.addEventListener(
626
+ }, []), b(() => {
627
+ var n;
628
+ return (n = c.current) == null || n.addEventListener(
635
629
  "initpreviewingbldr",
636
630
  j
637
631
  ), () => {
638
- var n;
639
- return (n = c.current) == null ? void 0 : n.removeEventListener(
632
+ var t;
633
+ return (t = c.current) == null ? void 0 : t.removeEventListener(
640
634
  "initpreviewingbldr",
641
635
  j
642
636
  );
643
637
  };
644
- }, []), f(() => {
645
- var t, n;
638
+ }, []), b(() => {
639
+ var n, t;
646
640
  if (P()) {
647
- if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
648
- const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, g = e.apiKey;
649
- V({
641
+ if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
642
+ const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, v = e.apiKey;
643
+ D({
650
644
  type: "impression",
651
645
  canTrack: !0,
652
646
  contentId: d,
653
- apiKey: g,
654
- variationId: r !== d ? r : void 0
647
+ apiKey: v,
648
+ variationId: o !== d ? o : void 0
655
649
  });
656
650
  }
657
651
  te() && c.current;
658
652
  }
659
- }, []), f(() => {
653
+ }, []), b(() => {
660
654
  e.apiKey || ne.error(
661
655
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
662
656
  ), k(), B(), I();
663
- }, []), f(() => {
664
- }, [e.content]), f(() => {
657
+ }, []), b(() => {
658
+ }, [e.content]), b(() => {
665
659
  P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
666
- }, [S]), f(() => {
660
+ }, [f]), b(() => {
667
661
  k();
668
- }, [(A = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : A.jsCode]), f(() => {
662
+ }, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), b(() => {
669
663
  B();
670
- }, [(K = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : K.httpRequests]), f(() => {
664
+ }, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
671
665
  I();
672
- }, [e.builderContextSignal.rootState]), f(() => {
673
- e.data && l(e.data);
674
- }, [e.data]), f(() => {
675
- e.locale && l({
666
+ }, [e.builderContextSignal.rootState]), b(() => {
667
+ e.data && r(e.data);
668
+ }, [e.data]), b(() => {
669
+ e.locale && r({
676
670
  locale: e.locale
677
671
  });
678
- }, [e.locale]), f(() => () => {
672
+ }, [e.locale]), b(() => () => {
679
673
  P() && (window.removeEventListener("message", m), window.removeEventListener(
680
674
  "builder:component:stateChangeListenerActivated",
681
675
  I
682
676
  ));
683
677
  }, []), /* @__PURE__ */ i(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ ge(
684
- b,
678
+ g,
685
679
  {
686
680
  key: s,
687
681
  ref: c,
688
- onClick: (t) => Q(t),
682
+ onClick: (n) => Q(n),
689
683
  "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
690
684
  "builder-model": e.model,
691
685
  ...e.showContent ? {} : {
@@ -711,5 +705,5 @@ export {
711
705
  we as b,
712
706
  Te as c,
713
707
  je as d,
714
- Ae as e
708
+ Ke as e
715
709
  };