@builder.io/sdk-react-nextjs 0.6.4 → 0.7.0

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 (29) hide show
  1. package/lib/browser/USE_CLIENT_BUNDLE-3a41b1ba.js +23 -0
  2. package/lib/{node/USE_CLIENT_BUNDLE-f8df6014.mjs → browser/USE_CLIENT_BUNDLE-fc8c1bc0.mjs} +177 -179
  3. package/lib/{edge/USE_SERVER_BUNDLE-079fd7e9.mjs → browser/USE_SERVER_BUNDLE-226a15ac.mjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-5955a553.js → browser/USE_SERVER_BUNDLE-d8c698c8.js} +1 -1
  5. package/lib/browser/{bundle-e116a057.js → bundle-0fae602b.js} +8 -8
  6. package/lib/browser/{bundle-6ca5e123.mjs → bundle-3b073b16.mjs} +24 -20
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +7 -7
  9. package/lib/{browser/USE_CLIENT_BUNDLE-f8df6014.mjs → edge/USE_CLIENT_BUNDLE-0e9f8e67.mjs} +177 -179
  10. package/lib/edge/USE_CLIENT_BUNDLE-d48583e8.js +23 -0
  11. package/lib/{node/USE_SERVER_BUNDLE-c4ad0f9f.js → edge/USE_SERVER_BUNDLE-105e9ef3.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-a9a2d553.mjs → edge/USE_SERVER_BUNDLE-f6a1e321.mjs} +1 -1
  13. package/lib/edge/{bundle-df0d312f.js → bundle-0c1d9099.js} +24 -24
  14. package/lib/edge/{bundle-1e4b4476.mjs → bundle-ed178c62.mjs} +878 -874
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +7 -7
  17. package/lib/node/USE_CLIENT_BUNDLE-3a41b1ba.js +23 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-bd1c5cd0.mjs → node/USE_CLIENT_BUNDLE-fc8c1bc0.mjs} +177 -179
  19. package/lib/{browser/USE_SERVER_BUNDLE-a9a2d553.mjs → node/USE_SERVER_BUNDLE-226a15ac.mjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-c4ad0f9f.js → node/USE_SERVER_BUNDLE-d8c698c8.js} +1 -1
  21. package/lib/node/{bundle-e116a057.js → bundle-0fae602b.js} +8 -8
  22. package/lib/node/{bundle-6ca5e123.mjs → bundle-3b073b16.mjs} +24 -20
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +7 -7
  25. package/package.json +2 -1
  26. package/types/constants/sdk-version.d.ts +1 -1
  27. package/lib/browser/USE_CLIENT_BUNDLE-4b8ab2a7.js +0 -23
  28. package/lib/edge/USE_CLIENT_BUNDLE-fc2e4ccd.js +0 -23
  29. package/lib/node/USE_CLIENT_BUNDLE-4b8ab2a7.js +0 -23
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as C, Fragment as b, jsx as n } from "react/jsx-runtime";
3
- import { g as P, a as N, i as I, b as w, c as O, d as G, l as Q, e as T, r as X, s as Y, f as Z, _, h as A, j as $, k as p, m as ee } from "./bundle-1e4b4476.mjs";
4
- import { useRef as j, useState as S, useEffect as y, createContext as te } from "react";
5
- import { p as ne } from "./USE_SERVER_BUNDLE-079fd7e9.mjs";
6
- import { useRouter as ie } from "next/navigation";
7
- function se(e) {
8
- return /* @__PURE__ */ C(b, { children: [
9
- e.link ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
2
+ import { jsxs as E, Fragment as m, jsx as n } from "react/jsx-runtime";
3
+ import { g as T, a as N, i as R, b as w, c as J, l as O, d as P, r as G, s as Q, e as X, _ as W, f as _, h as A, j as Y, k as Z, m as $ } from "./bundle-3b073b16.mjs";
4
+ import { useRef as j, useState as v, useEffect as k, createContext as p } from "react";
5
+ import { p as ee } from "./USE_SERVER_BUNDLE-226a15ac.mjs";
6
+ import { useRouter as te } from "next/navigation";
7
+ function re(e) {
8
+ return /* @__PURE__ */ E(m, { children: [
9
+ e.link ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
10
10
  "a",
11
11
  {
12
12
  role: "button",
@@ -15,7 +15,7 @@ function se(e) {
15
15
  target: e.openLinkInNewTab ? "_blank" : void 0,
16
16
  children: e.text
17
17
  }
18
- ) }) : /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
18
+ ) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
19
19
  "button",
20
20
  {
21
21
  ...e.attributes,
@@ -29,13 +29,13 @@ function se(e) {
29
29
  }` })
30
30
  ] });
31
31
  }
32
- function ue(e) {
32
+ function de(e) {
33
33
  return /* @__PURE__ */ n(
34
34
  e.Wrapper,
35
35
  {
36
36
  ...e.wrapperProps,
37
37
  attributes: {
38
- ...P({
38
+ ...T({
39
39
  block: e.block,
40
40
  context: e.context
41
41
  }),
@@ -51,13 +51,13 @@ function ue(e) {
51
51
  }
52
52
  );
53
53
  }
54
- function me(e) {
55
- return /* @__PURE__ */ C(b, { children: [
54
+ function se(e) {
55
+ return /* @__PURE__ */ E(m, { children: [
56
56
  " ",
57
- e.hasChildren ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ C(
57
+ e.hasChildren ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ E(
58
58
  e.Wrapper,
59
59
  {
60
- ...P({
60
+ ...T({
61
61
  block: e.block,
62
62
  context: e.context
63
63
  }),
@@ -75,10 +75,10 @@ function me(e) {
75
75
  " "
76
76
  ]
77
77
  }
78
- ) }) : /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
78
+ ) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
79
79
  e.Wrapper,
80
80
  {
81
- ...P({
81
+ ...T({
82
82
  block: e.block,
83
83
  context: e.context
84
84
  }),
@@ -95,14 +95,14 @@ function me(e) {
95
95
  " "
96
96
  ] });
97
97
  }
98
- function be(e) {
99
- function o() {
100
- var a;
101
- return "builder-blocks" + ((a = e.blocks) != null && a.length ? "" : " no-blocks");
98
+ function ue(e) {
99
+ function a() {
100
+ var c;
101
+ return "builder-blocks" + ((c = e.blocks) != null && c.length ? "" : " no-blocks");
102
102
  }
103
103
  function s() {
104
- var a, m;
105
- I() && !((a = e.blocks) != null && a.length) && ((m = window.parent) == null || m.postMessage(
104
+ var c, g;
105
+ R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
106
106
  {
107
107
  type: "builder.clickEmptyBlocks",
108
108
  data: {
@@ -113,9 +113,9 @@ function be(e) {
113
113
  "*"
114
114
  ));
115
115
  }
116
- function v() {
117
- var a, m;
118
- I() && !((a = e.blocks) != null && a.length) && ((m = window.parent) == null || m.postMessage(
116
+ function f() {
117
+ var c, g;
118
+ R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
119
119
  {
120
120
  type: "builder.hoverEmptyBlocks",
121
121
  data: {
@@ -126,17 +126,17 @@ function be(e) {
126
126
  "*"
127
127
  ));
128
128
  }
129
- return /* @__PURE__ */ C(b, { children: [
129
+ return /* @__PURE__ */ E(m, { children: [
130
130
  /* @__PURE__ */ n(
131
131
  "div",
132
132
  {
133
- className: o() + " div-5821bd52",
133
+ className: a() + " div-5821bd52",
134
134
  "builder-path": e.path,
135
135
  "builder-parent-id": e.parent,
136
136
  style: e.styleProp,
137
- onClick: (a) => s(),
138
- onMouseEnter: (a) => v(),
139
- onKeyPress: (a) => s(),
137
+ onClick: (c) => s(),
138
+ onMouseEnter: (c) => f(),
139
+ onKeyPress: (c) => s(),
140
140
  children: e.children
141
141
  }
142
142
  ),
@@ -147,43 +147,43 @@ function be(e) {
147
147
  }` })
148
148
  ] });
149
149
  }
150
- function fe(e) {
150
+ function me(e) {
151
151
  return /* @__PURE__ */ n("span", { children: e.children });
152
152
  }
153
- function ge(e) {
154
- var a, m, x, k;
155
- function o() {
156
- var u;
157
- const c = e.image || e.src;
158
- if (!c || // We can auto add srcset for cdn.builder.io and shopify
153
+ function be(e) {
154
+ var c, g, y, h;
155
+ function a() {
156
+ var b;
157
+ const o = e.image || e.src;
158
+ if (!o || // We can auto add srcset for cdn.builder.io and shopify
159
159
  // images, otherwise you can supply this prop manually
160
- !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
160
+ !(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
161
161
  return e.srcset;
162
- if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
162
+ if (e.srcset && ((b = e.image) != null && b.includes("builder.io/api/v1/image"))) {
163
163
  if (!e.srcset.includes(e.image.split("?")[0]))
164
- return console.debug("Removed given srcset"), w(c);
164
+ return console.debug("Removed given srcset"), w(o);
165
165
  } else if (e.image && !e.srcset)
166
- return w(c);
167
- return w(c);
166
+ return w(o);
167
+ return w(o);
168
168
  }
169
169
  function s() {
170
- var f;
171
- return (f = o == null ? void 0 : o()) != null && f.match(/builder\.io/) && !e.noWebp ? o().replace(/\?/g, "?format=webp&") : "";
170
+ var u;
171
+ return (u = a == null ? void 0 : a()) != null && u.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
172
172
  }
173
- function v() {
174
- const f = {
173
+ function f() {
174
+ const u = {
175
175
  position: "absolute",
176
176
  height: "100%",
177
177
  width: "100%",
178
178
  left: "0px",
179
179
  top: "0px"
180
180
  };
181
- return e.aspectRatio ? f : void 0;
181
+ return e.aspectRatio ? u : void 0;
182
182
  }
183
- return /* @__PURE__ */ C(b, { children: [
184
- /* @__PURE__ */ C(b, { children: [
185
- /* @__PURE__ */ C("picture", { children: [
186
- s() ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n("source", { type: "image/webp", srcSet: s() }) }) : null,
183
+ return /* @__PURE__ */ E(m, { children: [
184
+ /* @__PURE__ */ E(m, { children: [
185
+ /* @__PURE__ */ E("picture", { children: [
186
+ s() ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("source", { type: "image/webp", srcSet: s() }) }) : null,
187
187
  /* @__PURE__ */ n(
188
188
  "img",
189
189
  {
@@ -193,16 +193,16 @@ function ge(e) {
193
193
  style: {
194
194
  objectPosition: e.backgroundPosition || "center",
195
195
  objectFit: e.backgroundSize || "cover",
196
- ...v()
196
+ ...f()
197
197
  },
198
198
  className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
199
199
  src: e.image,
200
- srcSet: o(),
200
+ srcSet: a(),
201
201
  sizes: e.sizes
202
202
  }
203
203
  )
204
204
  ] }),
205
- e.aspectRatio && !((m = (a = e.builderBlock) == null ? void 0 : a.children) != null && m.length && e.fitContent) ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
205
+ e.aspectRatio && !((g = (c = e.builderBlock) == null ? void 0 : c.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
206
206
  "div",
207
207
  {
208
208
  className: "builder-image-sizer div-ef11a6be",
@@ -211,8 +211,8 @@ function ge(e) {
211
211
  }
212
212
  }
213
213
  ) }) : null,
214
- (k = (x = e.builderBlock) == null ? void 0 : x.children) != null && k.length && e.fitContent ? /* @__PURE__ */ n(b, { children: e.children }) : null,
215
- !e.fitContent && e.children ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
214
+ (h = (y = e.builderBlock) == null ? void 0 : y.children) != null && h.length && e.fitContent ? /* @__PURE__ */ n(m, { children: e.children }) : null,
215
+ !e.fitContent && e.children ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
216
216
  ] }),
217
217
  /* @__PURE__ */ n("style", { children: `.img-ef11a6be {
218
218
  opacity: 1;
@@ -233,7 +233,7 @@ function ge(e) {
233
233
  }` })
234
234
  ] });
235
235
  }
236
- function he(e) {
236
+ function fe(e) {
237
237
  return /* @__PURE__ */ n(
238
238
  "section",
239
239
  {
@@ -254,9 +254,9 @@ function he(e) {
254
254
  }
255
255
  );
256
256
  }
257
- function Se(e) {
258
- var v;
259
- function o() {
257
+ function ge(e) {
258
+ var f;
259
+ function a() {
260
260
  return {
261
261
  ...e.autoPlay === !0 ? {
262
262
  autoPlay: !0
@@ -278,7 +278,7 @@ function Se(e) {
278
278
  function s() {
279
279
  return {
280
280
  ...e.attributes,
281
- ...o()
281
+ ...a()
282
282
  };
283
283
  }
284
284
  return /* @__PURE__ */ n(
@@ -289,7 +289,7 @@ function Se(e) {
289
289
  style: {
290
290
  width: "100%",
291
291
  height: "100%",
292
- ...(v = e.attributes) == null ? void 0 : v.style,
292
+ ...(f = e.attributes) == null ? void 0 : f.style,
293
293
  objectFit: e.fit,
294
294
  objectPosition: e.position,
295
295
  // Hack to get object fit to work as expected and
@@ -301,38 +301,38 @@ function Se(e) {
301
301
  }
302
302
  );
303
303
  }
304
- function xe(e) {
305
- const o = j(null), [s, v] = S(() => []), [a, m] = S(() => []), [x, k] = S(() => !1);
306
- function f() {
307
- if (!o.current || !o.current.getElementsByTagName)
304
+ function he(e) {
305
+ const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []), [y, h] = v(() => !1);
306
+ function u() {
307
+ if (!a.current || !a.current.getElementsByTagName)
308
308
  return;
309
- const c = o.current.getElementsByTagName("script");
310
- for (let u = 0; u < c.length; u++) {
311
- const h = c[u];
312
- if (h.src && !s.includes(h.src)) {
313
- s.push(h.src);
314
- const E = document.createElement("script");
315
- E.async = !0, E.src = h.src, document.head.appendChild(E);
316
- } else if (O(h) && !a.includes(h.innerText))
309
+ const o = a.current.getElementsByTagName("script");
310
+ for (let b = 0; b < o.length; b++) {
311
+ const x = o[b];
312
+ if (x.src && !s.includes(x.src)) {
313
+ s.push(x.src);
314
+ const C = document.createElement("script");
315
+ C.async = !0, C.src = x.src, document.head.appendChild(C);
316
+ } else if (J(x) && !c.includes(x.innerText))
317
317
  try {
318
- a.push(h.innerText), new Function(h.innerText)();
319
- } catch (E) {
320
- console.warn("`Embed`: Error running script:", E);
318
+ c.push(x.innerText), new Function(x.innerText)();
319
+ } catch (C) {
320
+ console.warn("`Embed`: Error running script:", C);
321
321
  }
322
322
  }
323
323
  }
324
- return y(() => {
325
- o.current && !x && (k(!0), f());
326
- }, [o.current, x]), /* @__PURE__ */ n(
324
+ return k(() => {
325
+ a.current && !y && (h(!0), u());
326
+ }, [a.current, y]), /* @__PURE__ */ n(
327
327
  "div",
328
328
  {
329
329
  className: "builder-embed",
330
- ref: o,
330
+ ref: a,
331
331
  dangerouslySetInnerHTML: { __html: e.content }
332
332
  }
333
333
  );
334
334
  }
335
- function ve(e) {
335
+ function Se(e) {
336
336
  return /* @__PURE__ */ n(
337
337
  "img",
338
338
  {
@@ -344,50 +344,50 @@ function ve(e) {
344
344
  src: e.imgSrc || e.image,
345
345
  ...e.attributes
346
346
  },
347
- I() && e.imgSrc || "default-key"
347
+ R() && e.imgSrc || "default-key"
348
348
  );
349
349
  }
350
- function ke(e) {
351
- const o = j(null), [s, v] = S(() => []), [a, m] = S(() => []);
352
- function x() {
353
- if (o.current && o.current.getElementsByTagName && typeof window < "u") {
354
- const k = o.current.getElementsByTagName("script");
355
- for (let f = 0; f < k.length; f++) {
356
- const c = k[f];
357
- if (c.src) {
358
- if (s.includes(c.src))
350
+ function xe(e) {
351
+ const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []);
352
+ function y() {
353
+ if (a.current && a.current.getElementsByTagName && typeof window < "u") {
354
+ const h = a.current.getElementsByTagName("script");
355
+ for (let u = 0; u < h.length; u++) {
356
+ const o = h[u];
357
+ if (o.src) {
358
+ if (s.includes(o.src))
359
359
  continue;
360
- s.push(c.src);
361
- const u = document.createElement("script");
362
- u.async = !0, u.src = c.src, document.head.appendChild(u);
363
- } else if (!c.type || [
360
+ s.push(o.src);
361
+ const b = document.createElement("script");
362
+ b.async = !0, b.src = o.src, document.head.appendChild(b);
363
+ } else if (!o.type || [
364
364
  "text/javascript",
365
365
  "application/javascript",
366
366
  "application/ecmascript"
367
- ].includes(c.type)) {
368
- if (a.includes(c.innerText))
367
+ ].includes(o.type)) {
368
+ if (c.includes(o.innerText))
369
369
  continue;
370
370
  try {
371
- a.push(c.innerText), new Function(c.innerText)();
372
- } catch (u) {
373
- console.warn("`CustomCode`: Error running script:", u);
371
+ c.push(o.innerText), new Function(o.innerText)();
372
+ } catch (b) {
373
+ console.warn("`CustomCode`: Error running script:", b);
374
374
  }
375
375
  }
376
376
  }
377
377
  }
378
378
  }
379
- return y(() => {
380
- x();
379
+ return k(() => {
380
+ y();
381
381
  }, []), /* @__PURE__ */ n(
382
382
  "div",
383
383
  {
384
- ref: o,
384
+ ref: a,
385
385
  className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
386
386
  dangerouslySetInnerHTML: { __html: e.code }
387
387
  }
388
388
  );
389
389
  }
390
- const ae = te({
390
+ const ne = p({
391
391
  content: null,
392
392
  context: {},
393
393
  localState: void 0,
@@ -399,13 +399,11 @@ const ae = te({
399
399
  componentInfos: {},
400
400
  inheritedStyles: {}
401
401
  });
402
- function ye(e) {
403
- var L, M, q, z, K;
404
- const o = j(null), [s, v] = S(
405
- () => G(e.canTrack) ? e.canTrack : !0
406
- ), [a, m] = S(() => 0);
407
- function x(t) {
408
- var i, r, d, g, W;
402
+ function ve(e) {
403
+ var F, L, M, q, z;
404
+ const a = j(null), [s, f] = v(() => 0);
405
+ function c(t) {
406
+ var i, r, d, S, K;
409
407
  const l = {
410
408
  ...e.builderContextSignal.content,
411
409
  ...t,
@@ -416,39 +414,39 @@ function ye(e) {
416
414
  meta: {
417
415
  ...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
418
416
  ...t == null ? void 0 : t.meta,
419
- breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((W = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : W.breakpoints)
417
+ breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((K = (S = e.builderContextSignal.content) == null ? void 0 : S.meta) == null ? void 0 : K.breakpoints)
420
418
  }
421
419
  };
422
- ne({
420
+ ee({
423
421
  value: l,
424
422
  key: l.id
425
423
  }).then(() => {
426
- J.refresh();
424
+ U.refresh();
427
425
  });
428
426
  }
429
- S(() => 0);
430
- const [k, f] = S(
427
+ v(() => 0);
428
+ const [g, y] = v(
431
429
  () => !1
432
430
  );
433
- function c(t) {
431
+ function h(t) {
434
432
  var i;
435
433
  const { data: l } = t;
436
434
  if (l)
437
435
  switch (l.type) {
438
436
  case "builder.configureSdk": {
439
- const r = l.data, { breakpoints: d, contentId: g } = r;
440
- if (!g || g !== ((i = e.builderContextSignal.content) == null ? void 0 : i.id))
437
+ const r = l.data, { breakpoints: d, contentId: S } = r;
438
+ if (!S || S !== ((i = e.builderContextSignal.content) == null ? void 0 : i.id))
441
439
  return;
442
- d && x({
440
+ d && c({
443
441
  meta: {
444
442
  breakpoints: d
445
443
  }
446
- }), m(a + 1);
444
+ }), f(s + 1);
447
445
  break;
448
446
  }
449
447
  case "builder.contentUpdate": {
450
- const r = l.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
451
- d === e.model && (x(g), m(a + 1));
448
+ const r = l.data, d = r.key || r.alias || r.entry || r.modelName, S = r.data;
449
+ d === e.model && (c(S), f(s + 1));
452
450
  break;
453
451
  }
454
452
  }
@@ -464,22 +462,22 @@ function ye(e) {
464
462
  rootSetState: e.builderContextSignal.rootSetState
465
463
  });
466
464
  }
467
- const [h, E] = S(() => ({})), [B, U] = S(() => !1);
465
+ const [o, b] = v(() => ({})), [x, C] = v(() => !1);
468
466
  function V(t) {
469
467
  var l, i;
470
468
  if (e.builderContextSignal.content) {
471
469
  const r = (l = e.builderContextSignal.content) == null ? void 0 : l.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
472
- _({
470
+ W({
473
471
  type: "click",
474
- canTrack: s,
472
+ canTrack: _(e.canTrack),
475
473
  contentId: d,
476
474
  apiKey: e.apiKey,
477
475
  variationId: r !== d ? r : void 0,
478
- ...$(t),
479
- unique: !B
476
+ ...Y(t),
477
+ unique: !x
480
478
  });
481
479
  }
482
- B || U(!0);
480
+ x || C(!0);
483
481
  }
484
482
  function D(t) {
485
483
  return t.replace(
@@ -494,37 +492,37 @@ function ye(e) {
494
492
  );
495
493
  }
496
494
  function H({ url: t, key: l }) {
497
- ee(t).then((i) => i.json()).then((i) => {
498
- var d, g;
495
+ $(t).then((i) => i.json()).then((i) => {
496
+ var d, S;
499
497
  const r = {
500
498
  ...e.builderContextSignal.rootState,
501
499
  [l]: i
502
500
  };
503
- (g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), h[l] = !0;
501
+ (S = (d = e.builderContextSignal).rootSetState) == null || S.call(d, r), o[l] = !0;
504
502
  }).catch((i) => {
505
503
  console.error("error fetching dynamic data", t, i);
506
504
  });
507
505
  }
508
- function F() {
506
+ function B() {
509
507
  var l, i;
510
508
  const t = ((i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.httpRequests) ?? {};
511
509
  Object.entries(t).forEach(([r, d]) => {
512
- if (d && (!h[r] || I())) {
513
- const g = D(d);
510
+ if (d && (!o[r] || R())) {
511
+ const S = D(d);
514
512
  H({
515
- url: g,
513
+ url: S,
516
514
  key: r
517
515
  });
518
516
  }
519
517
  });
520
518
  }
521
- function R() {
522
- I() && window.dispatchEvent(
519
+ function I() {
520
+ R() && window.dispatchEvent(
523
521
  new CustomEvent(
524
522
  "builder:component:stateChange",
525
523
  {
526
524
  detail: {
527
- state: p(e.builderContextSignal.rootState),
525
+ state: Z(e.builderContextSignal.rootState),
528
526
  ref: {
529
527
  name: e.model
530
528
  }
@@ -533,13 +531,13 @@ function ye(e) {
533
531
  )
534
532
  );
535
533
  }
536
- const J = ie();
537
- return y(() => {
534
+ const U = te();
535
+ return k(() => {
538
536
  var t, l;
539
- if (e.apiKey || Q.error(
537
+ if (e.apiKey || O.error(
540
538
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
541
- ), T()) {
542
- if (I() && (m(a + 1), window.addEventListener("message", c), X(), Y({
539
+ ), P()) {
540
+ if (R() && (f(s + 1), window.addEventListener("message", h), G(), Q({
543
541
  ...e.locale ? {
544
542
  locale: e.locale
545
543
  } : {},
@@ -553,46 +551,46 @@ function ye(e) {
553
551
  e.builderContextSignal.componentInfos
554
552
  ).forEach((i) => {
555
553
  var d;
556
- const r = Z(i);
554
+ const r = X(i);
557
555
  (d = window.parent) == null || d.postMessage(r, "*");
558
556
  }), window.addEventListener(
559
557
  "builder:component:stateChangeListenerActivated",
560
- R
558
+ I
561
559
  )), e.builderContextSignal.content) {
562
560
  const i = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
563
- _({
561
+ W({
564
562
  type: "impression",
565
- canTrack: s,
563
+ canTrack: _(e.canTrack),
566
564
  contentId: r,
567
565
  apiKey: e.apiKey,
568
566
  variationId: i !== r ? i : void 0
569
567
  });
570
568
  }
571
- u(), F(), R();
569
+ u(), B(), I();
572
570
  }
573
- }, []), y(() => {
574
- }, [e.content]), y(() => {
575
- T() && (window.removeEventListener("message", c), window.addEventListener("message", c));
576
- }, [k]), y(() => {
571
+ }, []), k(() => {
572
+ }, [e.content]), k(() => {
573
+ P() && (window.removeEventListener("message", h), window.addEventListener("message", h));
574
+ }, [g]), k(() => {
577
575
  u();
578
576
  }, [
579
- (M = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : M.jsCode,
577
+ (L = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : L.jsCode,
580
578
  e.builderContextSignal.rootState
581
- ]), y(() => {
582
- F();
583
- }, [(z = (q = e.builderContextSignal.content) == null ? void 0 : q.data) == null ? void 0 : z.httpRequests]), y(() => {
584
- R();
585
- }, [e.builderContextSignal.rootState]), y(() => () => {
586
- T() && (window.removeEventListener("message", c), window.removeEventListener(
579
+ ]), k(() => {
580
+ B();
581
+ }, [(q = (M = e.builderContextSignal.content) == null ? void 0 : M.data) == null ? void 0 : q.httpRequests]), k(() => {
582
+ I();
583
+ }, [e.builderContextSignal.rootState]), k(() => () => {
584
+ P() && (window.removeEventListener("message", h), window.removeEventListener(
587
585
  "builder:component:stateChangeListenerActivated",
588
- R
586
+ I
589
587
  ));
590
- }, []), /* @__PURE__ */ n(ae.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
588
+ }, []), /* @__PURE__ */ n(ne.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
591
589
  "div",
592
590
  {
593
- ref: o,
591
+ ref: a,
594
592
  onClick: (t) => V(t),
595
- "builder-content-id": (K = e.builderContextSignal.content) == null ? void 0 : K.id,
593
+ "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
596
594
  "builder-model": e.model,
597
595
  ...e.showContent ? {} : {
598
596
  hidden: !0,
@@ -601,20 +599,20 @@ function ye(e) {
601
599
  className: e.classNameProp,
602
600
  children: e.children
603
601
  },
604
- a
602
+ s
605
603
  ) }) : null });
606
604
  }
607
605
  export {
608
- me as B,
609
- ke as C,
610
- xe as E,
611
- fe as F,
612
- ue as I,
613
- he as S,
614
- Se as V,
615
- be as a,
616
- se as b,
617
- ge as c,
618
- ve as d,
619
- ye as e
606
+ se as B,
607
+ xe as C,
608
+ he as E,
609
+ me as F,
610
+ de as I,
611
+ fe as S,
612
+ ge as V,
613
+ ue as a,
614
+ re as b,
615
+ be as c,
616
+ Se as d,
617
+ ve as e
620
618
  };
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { n as r } from "./bundle-6ca5e123.mjs";
2
+ import { n as r } from "./bundle-3b073b16.mjs";
3
3
  async function e({
4
4
  key: t,
5
5
  value: n