@builder.io/sdk-react-nextjs 0.14.17 → 0.14.20

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 (54) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-8dadab11.js → browser/USE_CLIENT_BUNDLE-b0af90c6.js} +251 -247
  2. package/lib/browser/USE_CLIENT_BUNDLE-eb52194d.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-4035cf43.cjs → browser/USE_SERVER_BUNDLE-719f53b1.cjs} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-6b33cfd7.js → browser/USE_SERVER_BUNDLE-d83b7d23.js} +1 -1
  5. package/lib/browser/bundle-12d2c3ee.cjs +169 -0
  6. package/lib/browser/{bundle-974bbd75.js → bundle-83df769b.js} +590 -578
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +4 -4
  9. package/lib/{browser/USE_CLIENT_BUNDLE-f685a480.js → edge/USE_CLIENT_BUNDLE-2d9b453e.js} +251 -247
  10. package/lib/edge/USE_CLIENT_BUNDLE-47285217.cjs +21 -0
  11. package/lib/{node/USE_SERVER_BUNDLE-d847a064.cjs → edge/USE_SERVER_BUNDLE-9e66cbc6.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-d7d118c1.js → edge/USE_SERVER_BUNDLE-c879ad04.js} +1 -1
  13. package/lib/edge/{bundle-0e4ba4de.js → bundle-73367f5c.js} +1016 -1004
  14. package/lib/edge/bundle-8a8fdc14.cjs +189 -0
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +4 -4
  17. package/lib/{edge/USE_CLIENT_BUNDLE-bf35f13e.js → node/USE_CLIENT_BUNDLE-68277019.js} +251 -247
  18. package/lib/node/USE_CLIENT_BUNDLE-8d2c6823.cjs +21 -0
  19. package/lib/{browser/USE_SERVER_BUNDLE-fbe70d66.js → node/USE_SERVER_BUNDLE-84ab22ef.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-1ee4e92a.cjs → node/USE_SERVER_BUNDLE-a4d10e9b.cjs} +1 -1
  21. package/lib/node/{bundle-a8217ddb.js → bundle-08369562.js} +256 -242
  22. package/lib/node/{bundle-39fe7680.cjs → bundle-832f5a95.cjs} +18 -18
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +4 -4
  25. package/package.json +1 -1
  26. package/types/cjs/blocks/columns/columns.types.d.ts +1 -1
  27. package/types/cjs/blocks/columns/helpers.d.ts +1 -0
  28. package/types/cjs/blocks/tabs/component-info.d.ts +2 -0
  29. package/types/cjs/blocks/tabs/index.d.ts +1 -0
  30. package/types/cjs/blocks/tabs/tabs.d.ts +4 -0
  31. package/types/cjs/blocks/tabs/tabs.types.d.ts +13 -0
  32. package/types/cjs/blocks/text/text.types.d.ts +2 -1
  33. package/types/cjs/components/block/block.helpers.d.ts +4 -2
  34. package/types/cjs/components/content/components/styles.helpers.d.ts +1 -0
  35. package/types/cjs/components/dynamic-div.d.ts +15 -0
  36. package/types/cjs/constants/sdk-version.d.ts +1 -1
  37. package/types/cjs/types/targets.d.ts +1 -1
  38. package/types/esm/blocks/columns/columns.types.d.ts +1 -1
  39. package/types/esm/blocks/columns/helpers.d.ts +1 -0
  40. package/types/esm/blocks/tabs/component-info.d.ts +2 -0
  41. package/types/esm/blocks/tabs/index.d.ts +1 -0
  42. package/types/esm/blocks/tabs/tabs.d.ts +4 -0
  43. package/types/esm/blocks/tabs/tabs.types.d.ts +13 -0
  44. package/types/esm/blocks/text/text.types.d.ts +2 -1
  45. package/types/esm/components/block/block.helpers.d.ts +4 -2
  46. package/types/esm/components/content/components/styles.helpers.d.ts +1 -0
  47. package/types/esm/components/dynamic-div.d.ts +15 -0
  48. package/types/esm/constants/sdk-version.d.ts +1 -1
  49. package/types/esm/types/targets.d.ts +1 -1
  50. package/lib/browser/USE_CLIENT_BUNDLE-f11159f6.cjs +0 -21
  51. package/lib/browser/bundle-e5f3c905.cjs +0 -169
  52. package/lib/edge/USE_CLIENT_BUNDLE-22f09854.cjs +0 -21
  53. package/lib/edge/bundle-15a88622.cjs +0 -189
  54. package/lib/node/USE_CLIENT_BUNDLE-e62d9c72.cjs +0 -21
@@ -1,43 +1,46 @@
1
1
  "use client";
2
- import { jsx as i, Fragment as w, jsxs as I } from "react/jsx-runtime";
3
- import { i as Y, g as q, a as U, b as $, c as E, d as R, e as Z, f as H, h as _, _ as V, j as p, l as ee, k as te, t as ne, m as D, n as ie, o as ae, p as ce, r as re, s as le, q as oe, u as de } from "./bundle-a8217ddb.js";
4
- import { useRef as T, useState as k, useEffect as f, createContext as se } from "react";
5
- import { p as ue } from "./USE_SERVER_BUNDLE-d7d118c1.js";
6
- import { useRouter as me } from "next/navigation";
7
- function O(e) {
8
- return /* @__PURE__ */ i(w, { children: Y(e.TagName) ? /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
2
+ import { jsx as a, Fragment as E, jsxs as I } from "react/jsx-runtime";
3
+ import { i as Z, g as H, a as $, b as O, c as w, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-83df769b.js";
4
+ import { useRef as T, useState as C, useEffect as f, createContext as me } from "react";
5
+ import { p as ge } from "./USE_SERVER_BUNDLE-d83b7d23.js";
6
+ import { useRouter as be } from "next/navigation";
7
+ function J(e) {
8
+ return /* @__PURE__ */ a(E, { children: Z(e.TagName) ? /* @__PURE__ */ a(E, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(E, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
9
9
  }
10
- function xe(e) {
11
- return /* @__PURE__ */ i(
12
- O,
10
+ function ke(e) {
11
+ function i() {
12
+ return {
13
+ ...e.attributes,
14
+ [H()]: `${e.link ? "" : "builder-button"} ${e.attributes[H()] || ""}`,
15
+ ...e.link ? {
16
+ href: e.link,
17
+ target: e.openLinkInNewTab ? "_blank" : void 0,
18
+ role: "link"
19
+ } : {
20
+ role: "button"
21
+ }
22
+ };
23
+ }
24
+ return /* @__PURE__ */ a(
25
+ J,
13
26
  {
14
- attributes: {
15
- ...e.attributes,
16
- [q()]: `${e.link ? "" : "builder-button"} ${e.attributes[q()] || ""}`,
17
- ...e.link ? {
18
- href: e.link,
19
- target: e.openLinkInNewTab ? "_blank" : void 0,
20
- role: "link"
21
- } : {
22
- role: "button"
23
- }
24
- },
27
+ attributes: i(),
25
28
  TagName: e.link ? e.builderLinkComponent || "a" : "button",
26
29
  actionAttributes: {},
27
30
  children: e.text
28
31
  }
29
32
  );
30
33
  }
31
- function ye(e) {
32
- return /* @__PURE__ */ i(
33
- O,
34
+ function Ce(e) {
35
+ return /* @__PURE__ */ a(
36
+ J,
34
37
  {
35
38
  TagName: e.Wrapper,
36
- attributes: U({
39
+ attributes: $({
37
40
  block: e.block,
38
41
  context: e.context
39
42
  }),
40
- actionAttributes: $({
43
+ actionAttributes: O({
41
44
  block: e.block,
42
45
  rootState: e.context.rootState,
43
46
  rootSetState: e.context.rootSetState,
@@ -49,36 +52,32 @@ function ye(e) {
49
52
  }
50
53
  );
51
54
  }
52
- function ke(e) {
53
- return /* @__PURE__ */ i(
54
- e.Wrapper,
55
- {
56
- ...e.wrapperProps,
57
- attributes: e.includeBlockProps ? {
58
- ...U({
59
- block: e.block,
60
- context: e.context
61
- }),
62
- ...$({
63
- block: e.block,
64
- rootState: e.context.rootState,
65
- rootSetState: e.context.rootSetState,
66
- localState: e.context.localState,
67
- context: e.context.context
68
- })
69
- } : {},
70
- children: e.children
71
- }
72
- );
55
+ function we(e) {
56
+ function i() {
57
+ return e.includeBlockProps ? {
58
+ ...$({
59
+ block: e.block,
60
+ context: e.context
61
+ }),
62
+ ...O({
63
+ block: e.block,
64
+ rootState: e.context.rootState,
65
+ rootSetState: e.context.rootSetState,
66
+ localState: e.context.localState,
67
+ context: e.context.context
68
+ })
69
+ } : {};
70
+ }
71
+ return /* @__PURE__ */ a(e.Wrapper, { ...e.wrapperProps, attributes: i(), children: e.children });
73
72
  }
74
- function Ce(e) {
75
- function a() {
73
+ function Ee(e) {
74
+ function i() {
76
75
  var r;
77
76
  return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
78
77
  }
79
- function d() {
78
+ function s() {
80
79
  var r, g;
81
- E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
80
+ w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
82
81
  {
83
82
  type: "builder.clickEmptyBlocks",
84
83
  data: {
@@ -91,7 +90,7 @@ function Ce(e) {
91
90
  }
92
91
  function S() {
93
92
  var r, g;
94
- E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
93
+ w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
95
94
  {
96
95
  type: "builder.hoverEmptyBlocks",
97
96
  data: {
@@ -102,66 +101,66 @@ function Ce(e) {
102
101
  "*"
103
102
  ));
104
103
  }
105
- return /* @__PURE__ */ I(w, { children: [
106
- /* @__PURE__ */ i(
104
+ return /* @__PURE__ */ I(E, { children: [
105
+ /* @__PURE__ */ a(
107
106
  e.BlocksWrapper,
108
107
  {
109
- className: a() + " props-blocks-wrapper-7cd1560e",
108
+ className: i() + " props-blocks-wrapper-7cd1560e",
110
109
  "builder-path": e.path,
111
110
  "builder-parent-id": e.parent,
112
111
  style: e.styleProp,
113
- onClick: (r) => d(),
112
+ onClick: (r) => s(),
114
113
  onMouseEnter: (r) => S(),
115
- onKeyPress: (r) => d(),
114
+ onKeyPress: (r) => s(),
116
115
  ...e.BlocksWrapperProps,
117
116
  children: e.children
118
117
  }
119
118
  ),
120
- /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-7cd1560e {
119
+ /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-7cd1560e {
121
120
  display: flex;
122
121
  flex-direction: column;
123
122
  align-items: stretch;
124
123
  }` })
125
124
  ] });
126
125
  }
127
- function Ee(e) {
128
- return /* @__PURE__ */ i("span", { children: e.children });
126
+ function Ie(e) {
127
+ return /* @__PURE__ */ a("span", { children: e.children });
129
128
  }
130
- function we(e) {
131
- var r, g, b, h;
132
- function a() {
133
- var m;
134
- const l = e.image || e.src;
135
- if (!l || // We can auto add srcset for cdn.builder.io and shopify
129
+ function Pe(e) {
130
+ var r, g, v, h, b, o;
131
+ function i() {
132
+ var x;
133
+ const d = e.image || e.src;
134
+ if (!d || // We can auto add srcset for cdn.builder.io and shopify
136
135
  // images, otherwise you can supply this prop manually
137
- !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
136
+ !(d.match(/builder\.io/) || d.match(/cdn\.shopify\.com/)))
138
137
  return e.srcset;
139
- if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
138
+ if (e.srcset && ((x = e.image) != null && x.includes("builder.io/api/v1/image"))) {
140
139
  if (!e.srcset.includes(e.image.split("?")[0]))
141
- return console.debug("Removed given srcset"), R(l);
140
+ return console.debug("Removed given srcset"), R(d);
142
141
  } else if (e.image && !e.srcset)
143
- return R(l);
144
- return R(l);
142
+ return R(d);
143
+ return R(d);
145
144
  }
146
- function d() {
147
- var s;
148
- return (s = a == null ? void 0 : a()) != null && s.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
145
+ function s() {
146
+ var m;
147
+ return (m = i == null ? void 0 : i()) != null && m.match(/builder\.io/) && !e.noWebp ? i().replace(/\?/g, "?format=webp&") : "";
149
148
  }
150
149
  function S() {
151
- const s = {
150
+ const m = {
152
151
  position: "absolute",
153
152
  height: "100%",
154
153
  width: "100%",
155
154
  left: "0px",
156
155
  top: "0px"
157
156
  };
158
- return e.aspectRatio ? s : void 0;
157
+ return e.aspectRatio ? m : void 0;
159
158
  }
160
- return /* @__PURE__ */ I(w, { children: [
161
- /* @__PURE__ */ I(w, { children: [
159
+ return /* @__PURE__ */ I(E, { children: [
160
+ /* @__PURE__ */ I(E, { children: [
162
161
  /* @__PURE__ */ I("picture", { children: [
163
- d() ? /* @__PURE__ */ i("source", { type: "image/webp", srcSet: d() }) : null,
164
- /* @__PURE__ */ i(
162
+ s() ? /* @__PURE__ */ a("source", { type: "image/webp", srcSet: s() }) : null,
163
+ /* @__PURE__ */ a(
165
164
  "img",
166
165
  {
167
166
  loading: "lazy",
@@ -172,33 +171,33 @@ function we(e) {
172
171
  objectFit: e.backgroundSize || "cover",
173
172
  ...S()
174
173
  },
175
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
174
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-3ac67dd4",
176
175
  src: e.image,
177
- srcSet: a(),
176
+ srcSet: i(),
178
177
  sizes: e.sizes
179
178
  }
180
179
  )
181
180
  ] }),
182
- e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ i(
181
+ e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ a(
183
182
  "div",
184
183
  {
185
- className: "builder-image-sizer div-a0c95e8c",
184
+ className: "builder-image-sizer div-3ac67dd4",
186
185
  style: {
187
186
  paddingTop: e.aspectRatio * 100 + "%"
188
187
  }
189
188
  }
190
189
  ) : null,
191
- (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(w, { children: e.children }) : null,
192
- !e.fitContent && e.children ? /* @__PURE__ */ i("div", { className: "div-a0c95e8c-2", children: e.children }) : null
190
+ (h = (v = e.builderBlock) == null ? void 0 : v.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(E, { children: e.children }) : null,
191
+ !e.fitContent && ((o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length) ? /* @__PURE__ */ a("div", { className: "div-3ac67dd4-2", children: e.children }) : null
193
192
  ] }),
194
- /* @__PURE__ */ i("style", { children: `.img-a0c95e8c {
193
+ /* @__PURE__ */ a("style", { children: `.img-3ac67dd4 {
195
194
  opacity: 1;
196
195
  transition: opacity 0.2s ease-in-out;
197
- }.div-a0c95e8c {
196
+ }.div-3ac67dd4 {
198
197
  width: 100%;
199
198
  pointer-events: none;
200
199
  font-size: 0;
201
- }.div-a0c95e8c-2 {
200
+ }.div-3ac67dd4-2 {
202
201
  display: flex;
203
202
  flex-direction: column;
204
203
  align-items: stretch;
@@ -210,8 +209,8 @@ function we(e) {
210
209
  }` })
211
210
  ] });
212
211
  }
213
- function Ie(e) {
214
- return /* @__PURE__ */ i(
212
+ function Re(e) {
213
+ return /* @__PURE__ */ a(
215
214
  "section",
216
215
  {
217
216
  ...e.attributes,
@@ -231,77 +230,77 @@ function Ie(e) {
231
230
  }
232
231
  );
233
232
  }
234
- function Pe(e) {
235
- const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []);
233
+ function Te(e) {
234
+ const i = T(null), [s, S] = C(() => []), [r, g] = C(() => []);
236
235
  return f(() => {
237
236
  var h;
238
- if (!((h = a.current) != null && h.getElementsByTagName) || typeof window > "u")
237
+ if (!((h = i.current) != null && h.getElementsByTagName) || typeof window > "u")
239
238
  return;
240
- const b = a.current.getElementsByTagName("script");
241
- for (let s = 0; s < b.length; s++) {
242
- const l = b[s];
243
- if (l.src) {
244
- if (d.includes(l.src))
239
+ const v = i.current.getElementsByTagName("script");
240
+ for (let b = 0; b < v.length; b++) {
241
+ const o = v[b];
242
+ if (o.src) {
243
+ if (s.includes(o.src))
245
244
  continue;
246
- d.push(l.src);
245
+ s.push(o.src);
247
246
  const m = document.createElement("script");
248
- m.async = !0, m.src = l.src, document.head.appendChild(m);
249
- } else if (!l.type || [
247
+ m.async = !0, m.src = o.src, document.head.appendChild(m);
248
+ } else if (!o.type || [
250
249
  "text/javascript",
251
250
  "application/javascript",
252
251
  "application/ecmascript"
253
- ].includes(l.type)) {
254
- if (r.includes(l.innerText))
252
+ ].includes(o.type)) {
253
+ if (r.includes(o.innerText))
255
254
  continue;
256
255
  try {
257
- r.push(l.innerText), new Function(l.innerText)();
256
+ r.push(o.innerText), new Function(o.innerText)();
258
257
  } catch (m) {
259
258
  console.warn("`CustomCode`: Error running script:", m);
260
259
  }
261
260
  }
262
261
  }
263
- }, []), /* @__PURE__ */ i(
262
+ }, []), /* @__PURE__ */ a(
264
263
  "div",
265
264
  {
266
- ref: a,
265
+ ref: i,
267
266
  className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
268
267
  dangerouslySetInnerHTML: { __html: e.code }
269
268
  }
270
269
  );
271
270
  }
272
- function Re(e) {
273
- const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []), [b, h] = k(() => !1);
274
- function s() {
275
- if (!a.current || !a.current.getElementsByTagName)
271
+ function Ne(e) {
272
+ const i = T(null), [s, S] = C(() => []), [r, g] = C(() => []), [v, h] = C(() => !1);
273
+ function b() {
274
+ if (!i.current || !i.current.getElementsByTagName)
276
275
  return;
277
- const l = a.current.getElementsByTagName("script");
278
- for (let m = 0; m < l.length; m++) {
279
- const v = l[m];
280
- if (v.src && !d.includes(v.src)) {
281
- d.push(v.src);
282
- const C = document.createElement("script");
283
- C.async = !0, C.src = v.src, document.head.appendChild(C);
284
- } else if (Z(v) && !r.includes(v.innerText))
276
+ const o = i.current.getElementsByTagName("script");
277
+ for (let m = 0; m < o.length; m++) {
278
+ const d = o[m];
279
+ if (d.src && !s.includes(d.src)) {
280
+ s.push(d.src);
281
+ const x = document.createElement("script");
282
+ x.async = !0, x.src = d.src, document.head.appendChild(x);
283
+ } else if (p(d) && !r.includes(d.innerText))
285
284
  try {
286
- r.push(v.innerText), new Function(v.innerText)();
287
- } catch (C) {
288
- console.warn("`Embed`: Error running script:", C);
285
+ r.push(d.innerText), new Function(d.innerText)();
286
+ } catch (x) {
287
+ console.warn("`Embed`: Error running script:", x);
289
288
  }
290
289
  }
291
290
  }
292
291
  return f(() => {
293
- a.current && !b && (h(!0), s());
294
- }, [a.current, b]), /* @__PURE__ */ i(
292
+ i.current && !v && (h(!0), b());
293
+ }, [i.current, v]), /* @__PURE__ */ a(
295
294
  "div",
296
295
  {
297
296
  className: "builder-embed",
298
- ref: a,
297
+ ref: i,
299
298
  dangerouslySetInnerHTML: { __html: e.content }
300
299
  }
301
300
  );
302
301
  }
303
- function Te(e) {
304
- return /* @__PURE__ */ i(
302
+ function Be(e) {
303
+ return /* @__PURE__ */ a(
305
304
  "img",
306
305
  {
307
306
  style: {
@@ -312,12 +311,12 @@ function Te(e) {
312
311
  src: e.imgSrc || e.image,
313
312
  ...e.attributes
314
313
  },
315
- E() && e.imgSrc || "default-key"
314
+ w() && e.imgSrc || "default-key"
316
315
  );
317
316
  }
318
- function Ne(e) {
319
- var S, r, g, b, h, s, l;
320
- function a() {
317
+ function Le(e) {
318
+ var S, r, g, v, h, b, o;
319
+ function i() {
321
320
  return {
322
321
  ...e.autoPlay === !0 ? {
323
322
  autoPlay: !0
@@ -336,9 +335,9 @@ function Ne(e) {
336
335
  } : {}
337
336
  };
338
337
  }
339
- function d() {
338
+ function s() {
340
339
  return {
341
- ...a()
340
+ ...i()
342
341
  };
343
342
  }
344
343
  return /* @__PURE__ */ I(
@@ -348,11 +347,11 @@ function Ne(e) {
348
347
  position: "relative"
349
348
  },
350
349
  children: [
351
- /* @__PURE__ */ i(
350
+ /* @__PURE__ */ a(
352
351
  "video",
353
352
  {
354
353
  className: "builder-video",
355
- ...d(),
354
+ ...s(),
356
355
  preload: e.preload || "metadata",
357
356
  style: {
358
357
  width: "100%",
@@ -370,10 +369,10 @@ function Ne(e) {
370
369
  },
371
370
  src: e.video || "no-src",
372
371
  poster: e.posterImage,
373
- children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
372
+ children: e.lazyLoad ? null : /* @__PURE__ */ a("source", { type: "video/mp4", src: e.video })
374
373
  }
375
374
  ),
376
- e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ i(
375
+ e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ a(
377
376
  "div",
378
377
  {
379
378
  style: {
@@ -384,7 +383,7 @@ function Ne(e) {
384
383
  }
385
384
  }
386
385
  ) : null,
387
- (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(
386
+ (h = (v = e.builderBlock) == null ? void 0 : v.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(
388
387
  "div",
389
388
  {
390
389
  style: {
@@ -395,7 +394,7 @@ function Ne(e) {
395
394
  children: e.children
396
395
  }
397
396
  ) : null,
398
- (l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(
397
+ (o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ a(
399
398
  "div",
400
399
  {
401
400
  style: {
@@ -416,7 +415,7 @@ function Ne(e) {
416
415
  }
417
416
  );
418
417
  }
419
- const ge = se({
418
+ const he = me({
420
419
  content: null,
421
420
  context: {},
422
421
  localState: void 0,
@@ -430,58 +429,64 @@ const ge = se({
430
429
  BlocksWrapper: "div",
431
430
  BlocksWrapperProps: {}
432
431
  });
433
- function Be(e) {
434
- var j, W, K, A, F, z, M;
435
- const a = T(null);
436
- function d(n) {
437
- var o, c;
432
+ function je(e) {
433
+ var W, K, A, F, z, M, q;
434
+ const i = T(null);
435
+ function s(n) {
436
+ var l, c;
438
437
  const t = {
439
438
  ...e.builderContextSignal.rootState,
440
439
  ...n
441
440
  };
442
- e.builderContextSignal.rootSetState ? (c = (o = e.builderContextSignal).rootSetState) == null || c.call(o, t) : e.builderContextSignal.rootState = t;
441
+ e.builderContextSignal.rootSetState ? (c = (l = e.builderContextSignal).rootSetState) == null || c.call(l, t) : e.builderContextSignal.rootState = t;
443
442
  }
444
443
  function S(n) {
445
- var o, c, u, x, y;
444
+ var l, c, u, y, k;
446
445
  const t = {
447
446
  ...e.builderContextSignal.content,
448
447
  ...n,
449
448
  data: {
450
- ...(o = e.builderContextSignal.content) == null ? void 0 : o.data,
449
+ ...(l = e.builderContextSignal.content) == null ? void 0 : l.data,
451
450
  ...n == null ? void 0 : n.data
452
451
  },
453
452
  meta: {
454
453
  ...(c = e.builderContextSignal.content) == null ? void 0 : c.meta,
455
454
  ...n == null ? void 0 : n.meta,
456
- breakpoints: ((u = n == null ? void 0 : n.meta) == null ? void 0 : u.breakpoints) || ((y = (x = e.builderContextSignal.content) == null ? void 0 : x.meta) == null ? void 0 : y.breakpoints)
455
+ breakpoints: ((u = n == null ? void 0 : n.meta) == null ? void 0 : u.breakpoints) || ((k = (y = e.builderContextSignal.content) == null ? void 0 : y.meta) == null ? void 0 : k.breakpoints)
457
456
  }
458
457
  };
459
- ue({
458
+ ge({
460
459
  value: t,
461
460
  key: t.id
462
461
  }).then(() => {
463
- Q.refresh();
462
+ X.refresh();
464
463
  });
465
464
  }
466
- const [r, g] = k(
465
+ function r() {
466
+ return e.showContent ? {} : {
467
+ hidden: !0,
468
+ "aria-hidden": !0
469
+ };
470
+ }
471
+ const [g, v] = C(
467
472
  () => e.contentWrapper || "div"
468
473
  );
469
- function b(n) {
470
- return te({
474
+ function h(n) {
475
+ return ie({
471
476
  model: e.model,
472
477
  trustedHosts: e.trustedHosts,
473
478
  callbacks: {
474
479
  configureSdk: (t) => {
475
480
  var u;
476
- const { breakpoints: o, contentId: c } = t;
477
- !c || c !== ((u = e.builderContextSignal.content) == null ? void 0 : u.id) || o && S({
481
+ const { breakpoints: l, contentId: c } = t;
482
+ !c || c !== ((u = e.builderContextSignal.content) == null ? void 0 : u.id) || l && S({
478
483
  meta: {
479
- breakpoints: o
484
+ breakpoints: l
480
485
  }
481
486
  });
482
487
  },
483
488
  animation: (t) => {
484
- ne(t);
489
+ ae(t);
485
490
  },
486
491
  contentUpdate: (t) => {
487
492
  S(t);
@@ -489,10 +494,10 @@ function Be(e) {
489
494
  }
490
495
  })(n);
491
496
  }
492
- function h() {
493
- var t, o;
494
- const n = (o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.jsCode;
495
- n && D({
497
+ function b() {
498
+ var t, l;
499
+ const n = (l = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : l.jsCode;
500
+ n && U({
496
501
  code: n,
497
502
  context: e.context || {},
498
503
  localState: void 0,
@@ -504,35 +509,35 @@ function Be(e) {
504
509
  enableCache: !1
505
510
  });
506
511
  }
507
- const [s, l] = k(() => ({})), [m, v] = k(() => ({})), [C, J] = k(() => !1);
508
- function G(n) {
509
- var t, o;
512
+ const [o, m] = C(() => ({})), [d, x] = C(() => ({})), [N, G] = C(() => !1);
513
+ function Q(n) {
514
+ var t, l;
510
515
  if (e.builderContextSignal.content) {
511
- const c = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, u = (o = e.builderContextSignal.content) == null ? void 0 : o.id;
512
- V({
516
+ const c = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, u = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
517
+ D({
513
518
  type: "click",
514
- canTrack: _(e.canTrack),
519
+ canTrack: V(e.canTrack),
515
520
  contentId: u,
516
521
  apiKey: e.apiKey,
517
522
  variationId: c !== u ? c : void 0,
518
- ...ie(n),
519
- unique: !C
523
+ ...ce(n),
524
+ unique: !N
520
525
  });
521
526
  }
522
- C || J(!0);
527
+ N || G(!0);
523
528
  }
524
- function N() {
525
- var t, o;
526
- const n = ((o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.httpRequests) ?? {};
529
+ function B() {
530
+ var t, l;
531
+ const n = ((l = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : l.httpRequests) ?? {};
527
532
  Object.entries(n).forEach(([c, u]) => {
528
- if (!u || m[c] || s[c] && !E())
533
+ if (!u || d[c] || o[c] && !w())
529
534
  return;
530
- m[c] = !0;
531
- const x = u.replace(
535
+ d[c] = !0;
536
+ const y = u.replace(
532
537
  /{{([^}]+)}}/g,
533
- (y, X) => String(
534
- D({
535
- code: X,
538
+ (k, Y) => String(
539
+ U({
540
+ code: Y,
536
541
  context: e.context || {},
537
542
  localState: void 0,
538
543
  rootState: e.builderContextSignal.rootState,
@@ -541,24 +546,24 @@ function Be(e) {
541
546
  })
542
547
  )
543
548
  );
544
- ae(x).then((y) => y.json()).then((y) => {
545
- d({
546
- [c]: y
547
- }), s[c] = !0;
548
- }).catch((y) => {
549
- console.error("error fetching dynamic data", u, y);
549
+ re(y).then((k) => k.json()).then((k) => {
550
+ s({
551
+ [c]: k
552
+ }), o[c] = !0;
553
+ }).catch((k) => {
554
+ console.error("error fetching dynamic data", u, k);
550
555
  }).finally(() => {
551
- m[c] = !1;
556
+ d[c] = !1;
552
557
  });
553
558
  });
554
559
  }
555
560
  function P() {
556
- E() && window.dispatchEvent(
561
+ w() && window.dispatchEvent(
557
562
  new CustomEvent(
558
563
  "builder:component:stateChange",
559
564
  {
560
565
  detail: {
561
- state: ce(e.builderContextSignal.rootState),
566
+ state: le(e.builderContextSignal.rootState),
562
567
  ref: {
563
568
  name: e.model
564
569
  }
@@ -567,8 +572,8 @@ function Be(e) {
567
572
  )
568
573
  );
569
574
  }
570
- function B(n) {
571
- window.addEventListener("message", b), re(), le({
575
+ function L(n) {
576
+ window.addEventListener("message", h), oe(), de({
572
577
  ...e.locale ? {
573
578
  locale: e.locale
574
579
  } : {},
@@ -582,117 +587,116 @@ function Be(e) {
582
587
  e.builderContextSignal.componentInfos
583
588
  ).forEach((t) => {
584
589
  var c;
585
- const o = oe(t);
586
- (c = window.parent) == null || c.postMessage(o, "*");
590
+ const l = se(t);
591
+ (c = window.parent) == null || c.postMessage(l, "*");
587
592
  }), window.addEventListener(
588
593
  "builder:component:stateChangeListenerActivated",
589
594
  P
590
595
  );
591
596
  }
592
- function L(n) {
593
- const t = new URL(location.href).searchParams, o = t.get("builder.preview"), c = t.get(
594
- `builder.preview.${o}`
597
+ function j(n) {
598
+ const t = new URL(location.href).searchParams, l = t.get("builder.preview"), c = t.get(
599
+ `builder.preview.${l}`
595
600
  ), u = t.get("apiKey") || t.get("builder.space");
596
- o === e.model && u === e.apiKey && (!e.content || c === e.content.id) && de({
601
+ l === e.model && u === e.apiKey && (!e.content || c === e.content.id) && ue({
597
602
  model: e.model,
598
603
  apiKey: e.apiKey,
599
604
  apiVersion: e.builderContextSignal.apiVersion
600
- }).then((x) => {
601
- x && S(x);
605
+ }).then((y) => {
606
+ y && S(y);
602
607
  });
603
608
  }
604
- const Q = me();
609
+ const X = be();
605
610
  return f(() => {
606
611
  var n;
607
- return (n = a.current) == null || n.addEventListener(
612
+ return (n = i.current) == null || n.addEventListener(
608
613
  "initeditingbldr",
609
- B
614
+ L
610
615
  ), () => {
611
616
  var t;
612
- return (t = a.current) == null ? void 0 : t.removeEventListener(
617
+ return (t = i.current) == null ? void 0 : t.removeEventListener(
613
618
  "initeditingbldr",
614
- B
619
+ L
615
620
  );
616
621
  };
617
622
  }, []), f(() => {
618
623
  var n;
619
- return (n = a.current) == null || n.addEventListener(
624
+ return (n = i.current) == null || n.addEventListener(
620
625
  "initpreviewingbldr",
621
- L
626
+ j
622
627
  ), () => {
623
628
  var t;
624
- return (t = a.current) == null ? void 0 : t.removeEventListener(
629
+ return (t = i.current) == null ? void 0 : t.removeEventListener(
625
630
  "initpreviewingbldr",
626
- L
631
+ j
627
632
  );
628
633
  };
629
634
  }, []), f(() => {
630
635
  var n, t;
631
- if (H()) {
632
- if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && _(e.canTrack)) {
633
- const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, x = e.apiKey;
634
- V({
636
+ if (_()) {
637
+ if (w() && i.current && i.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && V(e.canTrack)) {
638
+ const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, y = e.apiKey;
639
+ D({
635
640
  type: "impression",
636
641
  canTrack: !0,
637
642
  contentId: u,
638
- apiKey: x,
643
+ apiKey: y,
639
644
  variationId: c !== u ? c : void 0
640
645
  });
641
646
  }
642
- p() && E();
647
+ ee() && w();
643
648
  }
644
649
  }, []), f(() => {
645
- e.apiKey || ee.error(
650
+ e.apiKey || te.error(
646
651
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
647
- ), h(), N(), P();
652
+ ), b(), B(), P();
648
653
  }, []), f(() => {
649
654
  }, [e.content]), f(() => {
650
- h();
651
- }, [(W = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : W.jsCode]), f(() => {
652
- N();
653
- }, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
655
+ b();
656
+ }, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.jsCode]), f(() => {
657
+ B();
658
+ }, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), f(() => {
654
659
  P();
655
660
  }, [e.builderContextSignal.rootState]), f(() => {
656
- e.data && d(e.data);
661
+ e.data && s(e.data);
657
662
  }, [e.data]), f(() => {
658
- e.locale && d({
663
+ e.locale && s({
659
664
  locale: e.locale
660
665
  });
661
666
  }, [e.locale]), f(() => () => {
662
- H() && (window.removeEventListener("message", b), window.removeEventListener(
667
+ _() && (window.removeEventListener("message", h), window.removeEventListener(
663
668
  "builder:component:stateChangeListenerActivated",
664
669
  P
665
670
  ));
666
- }, []), /* @__PURE__ */ i(ge.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(
667
- r,
671
+ }, []), /* @__PURE__ */ a(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ a(
672
+ g,
668
673
  {
669
- ref: a,
670
- onClick: (n) => G(n),
671
- "builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
674
+ ref: i,
675
+ onClick: (n) => Q(n),
676
+ "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
672
677
  "builder-model": e.model,
673
- ...e.showContent ? {} : {
674
- hidden: !0,
675
- "aria-hidden": !0
676
- },
678
+ ...r(),
677
679
  ...e.contentWrapperProps,
678
- className: `variant-${((z = e.content) == null ? void 0 : z.testVariationId) || ((M = e.content) == null ? void 0 : M.id)}`,
680
+ className: ne(
681
+ ((M = e.content) == null ? void 0 : M.testVariationId) || ((q = e.content) == null ? void 0 : q.id)
682
+ ),
679
683
  children: e.children
680
684
  }
681
685
  ) : null });
682
686
  }
683
687
  export {
684
- ye as B,
685
- Pe as C,
686
- O as D,
687
- Re as E,
688
- Ee as F,
689
- ke as I,
690
- Ie as S,
691
- Ne as V,
692
- Ce as a,
693
- Te as b,
694
- xe as c,
695
- we as d,
696
- Be as e,
697
- ge as f
688
+ Ce as B,
689
+ Te as C,
690
+ J as D,
691
+ Ne as E,
692
+ Ie as F,
693
+ we as I,
694
+ Re as S,
695
+ Le as V,
696
+ Ee as a,
697
+ Be as b,
698
+ ke as c,
699
+ Pe as d,
700
+ je as e,
701
+ he as f
698
702
  };