@builder.io/sdk-react 1.0.13 → 1.0.15

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 (52) hide show
  1. package/lib/browser/blocks-exports.cjs +27 -27
  2. package/lib/browser/blocks-exports.mjs +777 -783
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/{server-entry-1a840bf8.js → server-entry-3d9c0013.js} +16 -15
  6. package/lib/browser/server-entry-60192a70.cjs +2 -0
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{blocks-fd4ab30c.js → blocks-874a3da2.js} +2 -2
  10. package/lib/edge/{blocks-ca61b343.cjs → blocks-8cf047ac.cjs} +1 -1
  11. package/lib/edge/blocks-exports.cjs +1 -1
  12. package/lib/edge/blocks-exports.mjs +2 -2
  13. package/lib/edge/{button-6d8b002c.cjs → button-e8062d3a.cjs} +1 -1
  14. package/lib/edge/{button-45681a80.js → button-f921801d.js} +2 -2
  15. package/lib/edge/{columns-61e1043d.js → columns-3d6fd99f.js} +3 -3
  16. package/lib/edge/{columns-77e4f17d.cjs → columns-cd3277d0.cjs} +1 -1
  17. package/lib/edge/content-variants-23991643.cjs +134 -0
  18. package/lib/edge/{content-variants-c085fa7f.js → content-variants-716e35d3.js} +303 -309
  19. package/lib/edge/{form-b996f9f9.cjs → form-9e4155f9.cjs} +1 -1
  20. package/lib/edge/{form-4fae6192.js → form-ed39d763.js} +3 -3
  21. package/lib/edge/{get-class-prop-name-0e4b7b88.js → get-class-prop-name-63df96dc.js} +1 -1
  22. package/lib/edge/{get-class-prop-name-14e14eea.cjs → get-class-prop-name-97c37936.cjs} +1 -1
  23. package/lib/edge/{img-c623011b.cjs → img-4c6f100c.cjs} +1 -1
  24. package/lib/edge/{img-1259941e.js → img-60cd5cd5.js} +1 -1
  25. package/lib/edge/index.cjs +1 -1
  26. package/lib/edge/index.mjs +1 -1
  27. package/lib/edge/{input-2c618b06.cjs → input-2d8eb4bc.cjs} +1 -1
  28. package/lib/edge/{input-02a1cd9f.js → input-cf3adf1f.js} +1 -1
  29. package/lib/edge/{select-b1b6d0bf.js → select-03974bcf.js} +1 -1
  30. package/lib/edge/{select-3acbf5f6.cjs → select-8e2ef3ed.cjs} +1 -1
  31. package/lib/edge/{server-entry-d8f950e0.cjs → server-entry-1263a732.cjs} +2 -2
  32. package/lib/edge/{server-entry-3f0061ea.js → server-entry-24e90a71.js} +17 -16
  33. package/lib/edge/server-entry.cjs +1 -1
  34. package/lib/edge/server-entry.mjs +1 -1
  35. package/lib/edge/{slot-3cefe326.js → slot-1408ceff.js} +3 -3
  36. package/lib/edge/{slot-92eac261.cjs → slot-972c3844.cjs} +1 -1
  37. package/lib/edge/{symbol-741f0aee.cjs → symbol-781970fe.cjs} +1 -1
  38. package/lib/edge/{symbol-e2a47b92.js → symbol-80a11943.js} +2 -2
  39. package/lib/node/blocks-exports.cjs +10 -10
  40. package/lib/node/blocks-exports.mjs +310 -316
  41. package/lib/node/index.cjs +1 -1
  42. package/lib/node/index.mjs +1 -1
  43. package/lib/node/{server-entry-383e8da6.js → server-entry-016a36f7.js} +16 -15
  44. package/lib/node/server-entry-71df0c38.cjs +2 -0
  45. package/lib/node/server-entry.cjs +1 -1
  46. package/lib/node/server-entry.mjs +1 -1
  47. package/package.json +1 -1
  48. package/types/constants/sdk-version.d.ts +1 -1
  49. package/types/functions/get-content/types.d.ts +8 -0
  50. package/lib/browser/server-entry-20402a85.cjs +0 -2
  51. package/lib/edge/content-variants-c86fdb5a.cjs +0 -134
  52. package/lib/node/server-entry-6d61d1cf.cjs +0 -2
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- var D = Object.defineProperty;
3
- var _ = (e, t, n) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var W = (e, t, n) => (_(e, typeof t != "symbol" ? t + "" : t, n), n);
2
+ var N = Object.defineProperty;
3
+ var V = (e, t, n) => t in e ? N(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var F = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
5
5
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
6
- import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-383e8da6.js";
6
+ import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-016a36f7.js";
7
7
  import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
8
8
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
9
9
  function DynamicRenderer(e) {
@@ -213,29 +213,29 @@ output;
213
213
  context: n,
214
214
  event: o,
215
215
  state: c
216
- }), d = getIsolateContext(), u = d.global;
217
- u.setSync("global", u.derefInto()), u.setSync("log", function(...h) {
218
- console.log(...h);
219
- }), u.setSync(BUILDER_SET_STATE_NAME, function(h, y) {
220
- set(r, h, y), a == null || a(r);
221
- }), l.forEach(([h, y]) => {
222
- const T = typeof y == "object" ? new s.Reference(
216
+ }), d = getIsolateContext(), m = d.global;
217
+ m.setSync("global", m.derefInto()), m.setSync("log", function(...y) {
218
+ console.log(...y);
219
+ }), m.setSync(BUILDER_SET_STATE_NAME, function(y, S) {
220
+ set(r, y, S), a == null || a(r);
221
+ }), l.forEach(([y, S]) => {
222
+ const k = typeof S == "object" ? new s.Reference(
223
223
  // workaround: methods with default values for arguments is not being cloned over
224
- h === "builder" ? {
225
- ...y,
226
- getUserAttributes: () => y.getUserAttributes()
227
- } : y
224
+ y === "builder" ? {
225
+ ...S,
226
+ getUserAttributes: () => S.getUserAttributes()
227
+ } : S
228
228
  ) : null;
229
- u.setSync(getSyncValName(h), T);
230
- }), u.setSync(INJECTED_IVM_GLOBAL, s);
231
- const m = processCode({
229
+ m.setSync(getSyncValName(y), k);
230
+ }), m.setSync(INJECTED_IVM_GLOBAL, s);
231
+ const g = processCode({
232
232
  code: e,
233
233
  args: l
234
- }), g = d.evalSync(m);
234
+ }), b = d.evalSync(g);
235
235
  try {
236
- return JSON.parse(g);
236
+ return JSON.parse(b);
237
237
  } catch {
238
- return g;
238
+ return b;
239
239
  }
240
240
  };
241
241
  function isNodeRuntime() {
@@ -248,7 +248,7 @@ const shouldForceBrowserRuntimeInNode = () => {
248
248
  return !1;
249
249
  const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
250
250
  return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
251
- }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), A = class A {
251
+ }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), R = class R {
252
252
  static getCacheKey(t) {
253
253
  return JSON.stringify({
254
254
  ...t,
@@ -258,16 +258,16 @@ const shouldForceBrowserRuntimeInNode = () => {
258
258
  });
259
259
  }
260
260
  static getCachedValue(t) {
261
- return A.cache.get(t);
261
+ return R.cache.get(t);
262
262
  }
263
263
  static setCachedValue(t, n) {
264
- A.cache.size > 20 && A.cache.delete(A.cache.keys().next().value), A.cache.set(t, {
264
+ R.cache.size > 20 && R.cache.delete(R.cache.keys().next().value), R.cache.set(t, {
265
265
  value: n
266
266
  });
267
267
  }
268
268
  };
269
- W(A, "cacheLimit", 20), W(A, "cache", /* @__PURE__ */ new Map());
270
- let EvalCache = A;
269
+ F(R, "cacheLimit", 20), F(R, "cache", /* @__PURE__ */ new Map());
270
+ let EvalCache = R;
271
271
  function evaluate({
272
272
  code: e,
273
273
  context: t,
@@ -470,8 +470,8 @@ function bindScrollInViewAnimation(e) {
470
470
  leading: !1
471
471
  });
472
472
  function s(d) {
473
- const u = d.getBoundingClientRect(), m = window.innerHeight, h = (e.thresholdPercent || 0) / 100 * m;
474
- return u.bottom > h && u.top < m - h;
473
+ const m = d.getBoundingClientRect(), g = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * g;
474
+ return m.bottom > y && m.top < g - y;
475
475
  }
476
476
  const c = e.steps[0].styles;
477
477
  function l() {
@@ -642,7 +642,7 @@ function BlockStyles(e) {
642
642
  return checkIsDefined(o.hide) ? !o.hide : checkIsDefined(o.show) ? o.show : !0;
643
643
  }
644
644
  function n() {
645
- var h;
645
+ var y;
646
646
  const o = getProcessedBlock({
647
647
  block: e.block,
648
648
  localState: e.context.localState,
@@ -651,21 +651,21 @@ function BlockStyles(e) {
651
651
  context: e.context.context,
652
652
  shouldEvaluateBindings: !0
653
653
  }), i = o.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
654
- ((h = a == null ? void 0 : a.meta) == null ? void 0 : h.breakpoints) || {}
654
+ ((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
655
655
  ), s = i == null ? void 0 : i.large, c = i == null ? void 0 : i.medium, l = i == null ? void 0 : i.small, d = o.id;
656
656
  if (!d)
657
657
  return "";
658
- const u = s ? createCssClass({
658
+ const m = s ? createCssClass({
659
659
  className: d,
660
660
  styles: s
661
- }) : "", m = c ? createCssClass({
661
+ }) : "", g = c ? createCssClass({
662
662
  className: d,
663
663
  styles: c,
664
664
  mediaQuery: getMaxWidthQueryForSize(
665
665
  "medium",
666
666
  r
667
667
  )
668
- }) : "", g = l ? createCssClass({
668
+ }) : "", b = l ? createCssClass({
669
669
  className: d,
670
670
  styles: l,
671
671
  mediaQuery: getMaxWidthQueryForSize(
@@ -673,7 +673,7 @@ function BlockStyles(e) {
673
673
  r
674
674
  )
675
675
  }) : "";
676
- return [u, m, g].join(" ");
676
+ return [m, g, b].join(" ");
677
677
  }
678
678
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
679
679
  }
@@ -872,8 +872,8 @@ function Block(e) {
872
872
  });
873
873
  }
874
874
  function o() {
875
- var u;
876
- return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
875
+ var m;
876
+ return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
877
877
  block: e.block,
878
878
  localState: e.context.localState,
879
879
  rootState: e.context.rootState,
@@ -883,32 +883,32 @@ function Block(e) {
883
883
  });
884
884
  }
885
885
  function i() {
886
- var m;
887
- return e.block.tagName === "a" || ((m = o().properties) == null ? void 0 : m.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
886
+ var g;
887
+ return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
888
888
  }
889
889
  function a() {
890
- var g, h;
891
- if ((g = e.block.repeat) != null && g.collection)
892
- return !!((h = n == null ? void 0 : n()) != null && h.length);
893
- const u = "hide" in o() ? o().hide : !1;
894
- return ("show" in o() ? o().show : !0) && !u;
890
+ var b, y;
891
+ if ((b = e.block.repeat) != null && b.collection)
892
+ return !!((y = n == null ? void 0 : n()) != null && y.length);
893
+ const m = "hide" in o() ? o().hide : !1;
894
+ return ("show" in o() ? o().show : !0) && !m;
895
895
  }
896
896
  function r() {
897
- var m, g;
898
- return !((m = t == null ? void 0 : t()) != null && m.component) && !n() ? (g = o().children) != null ? g : [] : [];
897
+ var g, b;
898
+ return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (b = o().children) != null ? b : [] : [];
899
899
  }
900
900
  function s() {
901
- var u, m, g, h, y, T, R, p, C, w, E;
901
+ var m, g, b, y, S, k, T, x, C, E, I;
902
902
  return {
903
- blockChildren: (u = o().children) != null ? u : [],
904
- componentRef: (m = t == null ? void 0 : t()) == null ? void 0 : m.component,
903
+ blockChildren: (m = o().children) != null ? m : [],
904
+ componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
905
905
  componentOptions: {
906
906
  ...getBlockComponentOptions(o()),
907
907
  builderContext: e.context,
908
- ...((g = t == null ? void 0 : t()) == null ? void 0 : g.name) === "Core:Button" || ((h = t == null ? void 0 : t()) == null ? void 0 : h.name) === "Symbol" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Columns" || ((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Form:Form" ? {
908
+ ...((b = t == null ? void 0 : t()) == null ? void 0 : b.name) === "Core:Button" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
909
909
  builderLinkComponent: e.linkComponent
910
910
  } : {},
911
- ...((R = t == null ? void 0 : t()) == null ? void 0 : R.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
911
+ ...((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Symbol" || ((x = t == null ? void 0 : t()) == null ? void 0 : x.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
912
912
  builderComponents: e.registeredComponents
913
913
  } : {}
914
914
  },
@@ -916,16 +916,16 @@ function Block(e) {
916
916
  linkComponent: e.linkComponent,
917
917
  registeredComponents: e.registeredComponents,
918
918
  builderBlock: o(),
919
- includeBlockProps: ((w = t == null ? void 0 : t()) == null ? void 0 : w.noWrap) === !0,
920
- isInteractive: !((E = t == null ? void 0 : t()) != null && E.isRSC)
919
+ includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
920
+ isInteractive: !((I = t == null ? void 0 : t()) != null && I.isRSC)
921
921
  };
922
922
  }
923
923
  return useEffect(() => {
924
- const u = o().id, m = o().animations;
925
- m && u && bindAnimations(
926
- m.filter((g) => g.trigger !== "hover").map((g) => ({
927
- ...g,
928
- elementId: u
924
+ const m = o().id, g = o().animations;
925
+ g && m && bindAnimations(
926
+ g.filter((b) => b.trigger !== "hover").map((b) => ({
927
+ ...b,
928
+ elementId: m
929
929
  }))
930
930
  );
931
931
  }, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -943,15 +943,15 @@ function Block(e) {
943
943
  includeBlockProps: s().includeBlockProps,
944
944
  isInteractive: s().isInteractive
945
945
  }
946
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((u, m) => /* @__PURE__ */ jsx(
946
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((m, g) => /* @__PURE__ */ jsx(
947
947
  RepeatedBlock,
948
948
  {
949
- repeatContext: u.context,
950
- block: u.block,
949
+ repeatContext: m.context,
950
+ block: m.block,
951
951
  registeredComponents: e.registeredComponents,
952
952
  linkComponent: e.linkComponent
953
953
  },
954
- m
954
+ g
955
955
  )) }) : /* @__PURE__ */ jsxs(
956
956
  BlockWrapper,
957
957
  {
@@ -974,15 +974,15 @@ function Block(e) {
974
974
  isInteractive: s().isInteractive
975
975
  }
976
976
  ),
977
- (l = r()) == null ? void 0 : l.map((u) => /* @__PURE__ */ jsx(
977
+ (l = r()) == null ? void 0 : l.map((m) => /* @__PURE__ */ jsx(
978
978
  Block,
979
979
  {
980
- block: u,
980
+ block: m,
981
981
  registeredComponents: e.registeredComponents,
982
982
  linkComponent: e.linkComponent,
983
983
  context: e.context
984
984
  },
985
- u.id
985
+ m.id
986
986
  ))
987
987
  ]
988
988
  }
@@ -1068,81 +1068,81 @@ function Blocks(e) {
1068
1068
  );
1069
1069
  }
1070
1070
  function Columns(e) {
1071
- var R;
1071
+ var T;
1072
1072
  const [t, n] = useState(
1073
1073
  () => typeof e.space == "number" ? e.space || 0 : 20
1074
1074
  ), [o, i] = useState(() => e.columns || []), [a, r] = useState(
1075
1075
  () => e.stackColumnsAt || "tablet"
1076
1076
  );
1077
- function s(p) {
1077
+ function s(x) {
1078
1078
  var C;
1079
- return ((C = o[p]) == null ? void 0 : C.width) || 100 / o.length;
1079
+ return ((C = o[x]) == null ? void 0 : C.width) || 100 / o.length;
1080
1080
  }
1081
- function c(p) {
1081
+ function c(x) {
1082
1082
  const C = t * (o.length - 1) / o.length;
1083
- return `calc(${s(p)}% - ${C}px)`;
1083
+ return `calc(${s(x)}% - ${C}px)`;
1084
1084
  }
1085
1085
  function l({
1086
- stackedStyle: p,
1086
+ stackedStyle: x,
1087
1087
  desktopStyle: C
1088
1088
  }) {
1089
- return a === "tablet" ? p : C;
1089
+ return a === "tablet" ? x : C;
1090
1090
  }
1091
1091
  function d({
1092
- stackedStyle: p,
1092
+ stackedStyle: x,
1093
1093
  desktopStyle: C
1094
1094
  }) {
1095
- return a === "never" ? C : p;
1095
+ return a === "never" ? C : x;
1096
1096
  }
1097
- const [u, m] = useState(
1097
+ const [m, g] = useState(
1098
1098
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
1099
1099
  );
1100
- function g() {
1100
+ function b() {
1101
1101
  return {
1102
- "--flex-dir": u,
1102
+ "--flex-dir": m,
1103
1103
  "--flex-dir-tablet": l({
1104
- stackedStyle: u,
1104
+ stackedStyle: m,
1105
1105
  desktopStyle: "row"
1106
1106
  })
1107
1107
  };
1108
1108
  }
1109
- function h(p) {
1110
- const C = p === 0 ? 0 : t, w = c(p), E = `${C}px`, F = "100%", N = 0;
1109
+ function y(x) {
1110
+ const C = x === 0 ? 0 : t, E = c(x), I = `${C}px`, P = "100%", B = 0;
1111
1111
  return {
1112
1112
  ...{
1113
1113
  display: "flex",
1114
1114
  flexDirection: "column",
1115
1115
  alignItems: "stretch"
1116
1116
  },
1117
- width: w,
1118
- ["marginLeft"]: E,
1117
+ width: E,
1118
+ ["marginLeft"]: I,
1119
1119
  "--column-width-mobile": d({
1120
- stackedStyle: F,
1121
- desktopStyle: w
1120
+ stackedStyle: P,
1121
+ desktopStyle: E
1122
1122
  }),
1123
1123
  "--column-margin-left-mobile": d({
1124
- stackedStyle: N,
1125
- desktopStyle: E
1124
+ stackedStyle: B,
1125
+ desktopStyle: I
1126
1126
  }),
1127
1127
  "--column-width-tablet": l({
1128
- stackedStyle: F,
1129
- desktopStyle: w
1128
+ stackedStyle: P,
1129
+ desktopStyle: E
1130
1130
  }),
1131
1131
  "--column-margin-left-tablet": l({
1132
- stackedStyle: N,
1133
- desktopStyle: E
1132
+ stackedStyle: B,
1133
+ desktopStyle: I
1134
1134
  })
1135
1135
  };
1136
1136
  }
1137
- function y(p) {
1138
- var w, E;
1137
+ function S(x) {
1138
+ var E, I;
1139
1139
  return getSizesForBreakpoints(
1140
- ((E = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : E.breakpoints) || {}
1141
- )[p].max;
1140
+ ((I = (E = e.builderContext.content) == null ? void 0 : E.meta) == null ? void 0 : I.breakpoints) || {}
1141
+ )[x].max;
1142
1142
  }
1143
- function T() {
1143
+ function k() {
1144
1144
  return `
1145
- @media (max-width: ${y("medium")}px) {
1145
+ @media (max-width: ${S("medium")}px) {
1146
1146
  .${e.builderBlock.id}-breakpoints {
1147
1147
  flex-direction: var(--flex-dir-tablet);
1148
1148
  align-items: stretch;
@@ -1154,7 +1154,7 @@ function Columns(e) {
1154
1154
  }
1155
1155
  }
1156
1156
 
1157
- @media (max-width: ${y("small")}px) {
1157
+ @media (max-width: ${S("small")}px) {
1158
1158
  .${e.builderBlock.id}-breakpoints {
1159
1159
  flex-direction: var(--flex-dir);
1160
1160
  align-items: stretch;
@@ -1172,20 +1172,20 @@ function Columns(e) {
1172
1172
  "div",
1173
1173
  {
1174
1174
  className: `builder-columns ${e.builderBlock.id}-breakpoints div-5e636bea`,
1175
- style: g(),
1175
+ style: b(),
1176
1176
  children: [
1177
- /* @__PURE__ */ jsx(InlinedStyles, { styles: T() }),
1178
- (R = e.columns) == null ? void 0 : R.map((p, C) => /* @__PURE__ */ jsx(
1177
+ /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }),
1178
+ (T = e.columns) == null ? void 0 : T.map((x, C) => /* @__PURE__ */ jsx(
1179
1179
  DynamicRenderer,
1180
1180
  {
1181
- TagName: p.link ? e.builderLinkComponent || "a" : "div",
1181
+ TagName: x.link ? e.builderLinkComponent || "a" : "div",
1182
1182
  actionAttributes: {},
1183
1183
  attributes: {
1184
- ...p.link ? {
1185
- href: p.link
1184
+ ...x.link ? {
1185
+ href: x.link
1186
1186
  } : {},
1187
1187
  [getClassPropName()]: "builder-column",
1188
- style: mapStyleObjToStrIfNeeded(h(C))
1188
+ style: mapStyleObjToStrIfNeeded(y(C))
1189
1189
  },
1190
1190
  children: /* @__PURE__ */ jsx(
1191
1191
  Blocks,
@@ -1198,7 +1198,7 @@ function Columns(e) {
1198
1198
  context: e.builderContext,
1199
1199
  registeredComponents: e.builderComponents,
1200
1200
  linkComponent: e.builderLinkComponent,
1201
- blocks: p.blocks
1201
+ blocks: x.blocks
1202
1202
  }
1203
1203
  )
1204
1204
  },
@@ -1613,13 +1613,13 @@ const componentInfo$f = {
1613
1613
  function n(r, s = 6e4) {
1614
1614
  return new Promise((c, l) => {
1615
1615
  const d = document.createElement("img");
1616
- let u = !1;
1616
+ let m = !1;
1617
1617
  d.onload = () => {
1618
- u = !0, c(d);
1619
- }, d.addEventListener("error", (m) => {
1620
- console.warn("Image load failed", m.error), l(m.error);
1618
+ m = !0, c(d);
1619
+ }, d.addEventListener("error", (g) => {
1620
+ console.warn("Image load failed", g.error), l(g.error);
1621
1621
  }), d.src = r, setTimeout(() => {
1622
- u || l(new Error("Image load timed out"));
1622
+ m || l(new Error("Image load timed out"));
1623
1623
  }, s);
1624
1624
  });
1625
1625
  }
@@ -1925,16 +1925,16 @@ function Embed(e) {
1925
1925
  return;
1926
1926
  const l = t.current.getElementsByTagName("script");
1927
1927
  for (let d = 0; d < l.length; d++) {
1928
- const u = l[d];
1929
- if (u.src && !n.includes(u.src)) {
1930
- n.push(u.src);
1931
- const m = document.createElement("script");
1932
- m.async = !0, m.src = u.src, document.head.appendChild(m);
1933
- } else if (isJsScript(u) && !i.includes(u.innerText))
1928
+ const m = l[d];
1929
+ if (m.src && !n.includes(m.src)) {
1930
+ n.push(m.src);
1931
+ const g = document.createElement("script");
1932
+ g.async = !0, g.src = m.src, document.head.appendChild(g);
1933
+ } else if (isJsScript(m) && !i.includes(m.innerText))
1934
1934
  try {
1935
- i.push(u.innerText), new Function(u.innerText)();
1936
- } catch (m) {
1937
- console.warn("`Embed`: Error running script:", m);
1935
+ i.push(m.innerText), new Function(m.innerText)();
1936
+ } catch (g) {
1937
+ console.warn("`Embed`: Error running script:", g);
1938
1938
  }
1939
1939
  }
1940
1940
  }
@@ -2188,112 +2188,112 @@ const componentInfo$5 = {
2188
2188
  return o === void 0 || o === e ? n : o;
2189
2189
  };
2190
2190
  function FormComponent(e) {
2191
- var u, m;
2191
+ var m, g;
2192
2192
  const t = useRef(null), [n, o] = useState(() => "unsubmitted"), [i, a] = useState(() => null), [r, s] = useState(() => "");
2193
- function c(g) {
2194
- var y, T;
2195
- const h = {
2193
+ function c(b) {
2194
+ var S, k;
2195
+ const y = {
2196
2196
  ...e.builderContext.rootState,
2197
- ...g
2197
+ ...b
2198
2198
  };
2199
- e.builderContext.rootSetState ? (T = (y = e.builderContext).rootSetState) == null || T.call(y, h) : e.builderContext.rootState = h;
2199
+ e.builderContext.rootSetState ? (k = (S = e.builderContext).rootSetState) == null || k.call(S, y) : e.builderContext.rootState = y;
2200
2200
  }
2201
2201
  function l() {
2202
2202
  return isEditing() && e.previewState || n;
2203
2203
  }
2204
- function d(g) {
2205
- var y;
2206
- const h = e.sendWithJs || e.sendSubmissionsTo === "email";
2204
+ function d(b) {
2205
+ var S;
2206
+ const y = e.sendWithJs || e.sendSubmissionsTo === "email";
2207
2207
  if (e.sendSubmissionsTo === "zapier")
2208
- g.preventDefault();
2209
- else if (h) {
2208
+ b.preventDefault();
2209
+ else if (y) {
2210
2210
  if (!(e.action || e.sendSubmissionsTo === "email")) {
2211
- g.preventDefault();
2211
+ b.preventDefault();
2212
2212
  return;
2213
2213
  }
2214
- g.preventDefault();
2215
- const T = g.currentTarget, R = e.customHeaders || {};
2216
- let p;
2217
- const C = new FormData(T), w = Array.from(
2218
- g.currentTarget.querySelectorAll("input,select,textarea")
2219
- ).filter((f) => !!f.name).map((f) => {
2220
- let I;
2221
- const j = f.name;
2222
- if (f instanceof HTMLInputElement)
2223
- if (f.type === "radio") {
2224
- if (f.checked)
2225
- return I = f.name, {
2226
- key: j,
2227
- value: I
2214
+ b.preventDefault();
2215
+ const k = b.currentTarget, T = e.customHeaders || {};
2216
+ let x;
2217
+ const C = new FormData(k), E = Array.from(
2218
+ b.currentTarget.querySelectorAll("input,select,textarea")
2219
+ ).filter((u) => !!u.name).map((u) => {
2220
+ let f;
2221
+ const p = u.name;
2222
+ if (u instanceof HTMLInputElement)
2223
+ if (u.type === "radio") {
2224
+ if (u.checked)
2225
+ return f = u.name, {
2226
+ key: p,
2227
+ value: f
2228
2228
  };
2229
- } else if (f.type === "checkbox")
2230
- I = f.checked;
2231
- else if (f.type === "number" || f.type === "range") {
2232
- const P = f.valueAsNumber;
2233
- isNaN(P) || (I = P);
2229
+ } else if (u.type === "checkbox")
2230
+ f = u.checked;
2231
+ else if (u.type === "number" || u.type === "range") {
2232
+ const h = u.valueAsNumber;
2233
+ isNaN(h) || (f = h);
2234
2234
  } else
2235
- f.type === "file" ? I = f.files : I = f.value;
2235
+ u.type === "file" ? f = u.files : f = u.value;
2236
2236
  else
2237
- I = f.value;
2237
+ f = u.value;
2238
2238
  return {
2239
- key: j,
2240
- value: I
2239
+ key: p,
2240
+ value: f
2241
2241
  };
2242
2242
  });
2243
- let E = e.contentType;
2244
- if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(w).forEach(({ value: f }) => {
2245
- (f instanceof File || Array.isArray(f) && f[0] instanceof File || f instanceof FileList) && (E = "multipart/form-data");
2246
- }), E !== "application/json")
2247
- p = C;
2243
+ let I = e.contentType;
2244
+ if (e.sendSubmissionsTo === "email" && (I = "multipart/form-data"), Array.from(E).forEach(({ value: u }) => {
2245
+ (u instanceof File || Array.isArray(u) && u[0] instanceof File || u instanceof FileList) && (I = "multipart/form-data");
2246
+ }), I !== "application/json")
2247
+ x = C;
2248
2248
  else {
2249
- const f = {};
2250
- Array.from(w).forEach(({ value: I, key: j }) => {
2251
- set(f, j, I);
2252
- }), p = JSON.stringify(f);
2249
+ const u = {};
2250
+ Array.from(E).forEach(({ value: f, key: p }) => {
2251
+ set(u, p, f);
2252
+ }), x = JSON.stringify(u);
2253
2253
  }
2254
- E && E !== "multipart/form-data" && (h && ((y = e.action) != null && y.includes("zapier.com")) || (R["content-type"] = E));
2255
- const F = new CustomEvent("presubmit", { detail: { body: p } });
2256
- if (t.current && (t.current.dispatchEvent(F), F.defaultPrevented))
2254
+ I && I !== "multipart/form-data" && (y && ((S = e.action) != null && S.includes("zapier.com")) || (T["content-type"] = I));
2255
+ const P = new CustomEvent("presubmit", { detail: { body: x } });
2256
+ if (t.current && (t.current.dispatchEvent(P), P.defaultPrevented))
2257
2257
  return;
2258
2258
  o("sending");
2259
- const N = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2259
+ const B = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2260
2260
  e.sendSubmissionsToEmail || ""
2261
2261
  )}&name=${encodeURIComponent(e.name || "")}`;
2262
2262
  fetch(
2263
- e.sendSubmissionsTo === "email" ? N : e.action,
2264
- { body: p, headers: R, method: e.method || "post" }
2263
+ e.sendSubmissionsTo === "email" ? B : e.action,
2264
+ { body: x, headers: T, method: e.method || "post" }
2265
2265
  ).then(
2266
- async (f) => {
2267
- let I;
2268
- const j = f.headers.get("content-type");
2269
- if (j && j.indexOf("application/json") !== -1 ? I = await f.json() : I = await f.text(), !f.ok && e.errorMessagePath) {
2270
- let P = get(I, e.errorMessagePath);
2271
- P && (typeof P != "string" && (P = JSON.stringify(P)), s(P), c({ formErrorMessage: P }));
2266
+ async (u) => {
2267
+ let f;
2268
+ const p = u.headers.get("content-type");
2269
+ if (p && p.indexOf("application/json") !== -1 ? f = await u.json() : f = await u.text(), !u.ok && e.errorMessagePath) {
2270
+ let h = get(f, e.errorMessagePath);
2271
+ h && (typeof h != "string" && (h = JSON.stringify(h)), s(h), c({ formErrorMessage: h }));
2272
2272
  }
2273
- if (a(I), o(f.ok ? "success" : "error"), f.ok) {
2274
- const P = new CustomEvent("submit:success", {
2275
- detail: { res: f, body: I }
2273
+ if (a(f), o(u.ok ? "success" : "error"), u.ok) {
2274
+ const h = new CustomEvent("submit:success", {
2275
+ detail: { res: u, body: f }
2276
2276
  });
2277
2277
  if (t.current) {
2278
- if (t.current.dispatchEvent(P), P.defaultPrevented)
2278
+ if (t.current.dispatchEvent(h), h.defaultPrevented)
2279
2279
  return;
2280
2280
  e.resetFormOnSubmit !== !1 && t.current.reset();
2281
2281
  }
2282
2282
  if (e.successUrl)
2283
2283
  if (t.current) {
2284
- const b = new CustomEvent("route", {
2284
+ const v = new CustomEvent("route", {
2285
2285
  detail: { url: e.successUrl }
2286
2286
  });
2287
- t.current.dispatchEvent(b), b.defaultPrevented || (location.href = e.successUrl);
2287
+ t.current.dispatchEvent(v), v.defaultPrevented || (location.href = e.successUrl);
2288
2288
  } else
2289
2289
  location.href = e.successUrl;
2290
2290
  }
2291
2291
  },
2292
- (f) => {
2293
- const I = new CustomEvent("submit:error", {
2294
- detail: { error: f }
2292
+ (u) => {
2293
+ const f = new CustomEvent("submit:error", {
2294
+ detail: { error: u }
2295
2295
  });
2296
- t.current && (t.current.dispatchEvent(I), I.defaultPrevented) || (a(f), o("error"));
2296
+ t.current && (t.current.dispatchEvent(f), f.defaultPrevented) || (a(u), o("error"));
2297
2297
  }
2298
2298
  );
2299
2299
  }
@@ -2308,18 +2308,18 @@ function FormComponent(e) {
2308
2308
  action: !e.sendWithJs && e.action,
2309
2309
  method: e.method,
2310
2310
  name: e.name,
2311
- onSubmit: (g) => d(g),
2311
+ onSubmit: (b) => d(b),
2312
2312
  ...e.attributes,
2313
2313
  children: [
2314
- e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (m = (u = e.builderBlock) == null ? void 0 : u.children) == null ? void 0 : m.map((g, h) => /* @__PURE__ */ jsx(
2314
+ e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (g = (m = e.builderBlock) == null ? void 0 : m.children) == null ? void 0 : g.map((b, y) => /* @__PURE__ */ jsx(
2315
2315
  Block,
2316
2316
  {
2317
- block: g,
2317
+ block: b,
2318
2318
  context: e.builderContext,
2319
2319
  registeredComponents: e.builderComponents,
2320
2320
  linkComponent: e.builderLinkComponent
2321
2321
  },
2322
- `form-block-${h}`
2322
+ `form-block-${y}`
2323
2323
  )) }) : null,
2324
2324
  l() === "error" ? /* @__PURE__ */ jsx(
2325
2325
  Blocks,
@@ -2930,74 +2930,70 @@ const findParentElement = (e, t, n = !0) => {
2930
2930
  };
2931
2931
  };
2932
2932
  function EnableEditor(e) {
2933
- var E, F, N, f, I, j, P;
2934
- const t = useRef(null), [n, o] = useState(() => 0);
2935
- useState(() => !0);
2936
- function i(b) {
2937
- var x, v;
2938
- const S = {
2933
+ var T, x, C, E, I, P, B;
2934
+ const t = useRef(null);
2935
+ function n(u) {
2936
+ var p, h;
2937
+ const f = {
2939
2938
  ...e.builderContextSignal.rootState,
2940
- ...b
2939
+ ...u
2941
2940
  };
2942
- e.builderContextSignal.rootSetState ? (v = (x = e.builderContextSignal).rootSetState) == null || v.call(x, S) : e.setBuilderContextSignal((k) => ({
2943
- ...k,
2944
- rootState: S
2941
+ e.builderContextSignal.rootSetState ? (h = (p = e.builderContextSignal).rootSetState) == null || h.call(p, f) : e.setBuilderContextSignal((v) => ({
2942
+ ...v,
2943
+ rootState: f
2945
2944
  }));
2946
2945
  }
2947
- function a(b) {
2948
- var x, v, k, B, V;
2949
- const S = {
2946
+ function o(u) {
2947
+ var p, h, v, w, j;
2948
+ const f = {
2950
2949
  ...e.builderContextSignal.content,
2951
- ...b,
2950
+ ...u,
2952
2951
  data: {
2953
- ...(x = e.builderContextSignal.content) == null ? void 0 : x.data,
2954
- ...b == null ? void 0 : b.data
2952
+ ...(p = e.builderContextSignal.content) == null ? void 0 : p.data,
2953
+ ...u == null ? void 0 : u.data
2955
2954
  },
2956
2955
  meta: {
2957
- ...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
2958
- ...b == null ? void 0 : b.meta,
2959
- breakpoints: ((k = b == null ? void 0 : b.meta) == null ? void 0 : k.breakpoints) || ((V = (B = e.builderContextSignal.content) == null ? void 0 : B.meta) == null ? void 0 : V.breakpoints)
2956
+ ...(h = e.builderContextSignal.content) == null ? void 0 : h.meta,
2957
+ ...u == null ? void 0 : u.meta,
2958
+ breakpoints: ((v = u == null ? void 0 : u.meta) == null ? void 0 : v.breakpoints) || ((j = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : j.breakpoints)
2960
2959
  }
2961
2960
  };
2962
- e.setBuilderContextSignal(($) => ({
2963
- ...$,
2964
- content: S
2961
+ e.setBuilderContextSignal((A) => ({
2962
+ ...A,
2963
+ content: f
2965
2964
  }));
2966
2965
  }
2967
- useState(() => 0);
2968
- const [r, s] = useState(
2969
- () => !1
2970
- ), [c, l] = useState(
2966
+ const [i, a] = useState(
2971
2967
  () => e.contentWrapper || "div"
2972
2968
  );
2973
- function d(b) {
2969
+ function r(u) {
2974
2970
  return createEditorListener({
2975
2971
  model: e.model,
2976
2972
  trustedHosts: e.trustedHosts,
2977
2973
  callbacks: {
2978
- configureSdk: (S) => {
2979
- var k;
2980
- const { breakpoints: x, contentId: v } = S;
2981
- !v || v !== ((k = e.builderContextSignal.content) == null ? void 0 : k.id) || x && (a({
2974
+ configureSdk: (f) => {
2975
+ var v;
2976
+ const { breakpoints: p, contentId: h } = f;
2977
+ !h || h !== ((v = e.builderContextSignal.content) == null ? void 0 : v.id) || p && o({
2982
2978
  meta: {
2983
- breakpoints: x
2979
+ breakpoints: p
2984
2980
  }
2985
- }), o(n + 1));
2981
+ });
2986
2982
  },
2987
- animation: (S) => {
2988
- triggerAnimation(S);
2983
+ animation: (f) => {
2984
+ triggerAnimation(f);
2989
2985
  },
2990
- contentUpdate: (S) => {
2991
- a(S), o(n + 1);
2986
+ contentUpdate: (f) => {
2987
+ o(f);
2992
2988
  }
2993
2989
  }
2994
- })(b);
2990
+ })(u);
2995
2991
  }
2996
- function u() {
2997
- var S, x;
2998
- const b = (x = (S = e.builderContextSignal.content) == null ? void 0 : S.data) == null ? void 0 : x.jsCode;
2999
- b && evaluate({
3000
- code: b,
2992
+ function s() {
2993
+ var f, p;
2994
+ const u = (p = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : p.jsCode;
2995
+ u && evaluate({
2996
+ code: u,
3001
2997
  context: e.context || {},
3002
2998
  localState: void 0,
3003
2999
  rootState: e.builderContextSignal.rootState,
@@ -3008,29 +3004,29 @@ function EnableEditor(e) {
3008
3004
  enableCache: !1
3009
3005
  });
3010
3006
  }
3011
- const [m, g] = useState(() => ({})), [h, y] = useState(() => !1);
3012
- function T(b) {
3013
- var S, x;
3007
+ const [c, l] = useState(() => ({})), [d, m] = useState(() => !1);
3008
+ function g(u) {
3009
+ var f, p;
3014
3010
  if (e.builderContextSignal.content) {
3015
- const v = (S = e.builderContextSignal.content) == null ? void 0 : S.testVariationId, k = (x = e.builderContextSignal.content) == null ? void 0 : x.id;
3011
+ const h = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, v = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
3016
3012
  _track({
3017
3013
  type: "click",
3018
3014
  canTrack: getDefaultCanTrack(e.canTrack),
3019
- contentId: k,
3015
+ contentId: v,
3020
3016
  apiKey: e.apiKey,
3021
- variationId: v !== k ? v : void 0,
3022
- ...getInteractionPropertiesForEvent(b),
3023
- unique: !h
3017
+ variationId: h !== v ? h : void 0,
3018
+ ...getInteractionPropertiesForEvent(u),
3019
+ unique: !d
3024
3020
  });
3025
3021
  }
3026
- h || y(!0);
3022
+ d || m(!0);
3027
3023
  }
3028
- function R(b) {
3029
- return b.replace(
3024
+ function b(u) {
3025
+ return u.replace(
3030
3026
  /{{([^}]+)}}/g,
3031
- (S, x) => String(
3027
+ (f, p) => String(
3032
3028
  evaluate({
3033
- code: x,
3029
+ code: p,
3034
3030
  context: e.context || {},
3035
3031
  localState: void 0,
3036
3032
  rootState: e.builderContextSignal.rootState,
@@ -3040,32 +3036,32 @@ function EnableEditor(e) {
3040
3036
  )
3041
3037
  );
3042
3038
  }
3043
- function p({ url: b, key: S }) {
3044
- fetch$1(b).then((x) => x.json()).then((x) => {
3045
- var k, B;
3046
- const v = {
3039
+ function y({ url: u, key: f }) {
3040
+ fetch$1(u).then((p) => p.json()).then((p) => {
3041
+ var v, w;
3042
+ const h = {
3047
3043
  ...e.builderContextSignal.rootState,
3048
- [S]: x
3044
+ [f]: p
3049
3045
  };
3050
- (B = (k = e.builderContextSignal).rootSetState) == null || B.call(k, v), m[S] = !0;
3051
- }).catch((x) => {
3052
- console.error("error fetching dynamic data", b, x);
3046
+ (w = (v = e.builderContextSignal).rootSetState) == null || w.call(v, h), c[f] = !0;
3047
+ }).catch((p) => {
3048
+ console.error("error fetching dynamic data", u, p);
3053
3049
  });
3054
3050
  }
3055
- function C() {
3056
- var S, x, v;
3057
- const b = (v = (x = (S = e.builderContextSignal.content) == null ? void 0 : S.data) == null ? void 0 : x.httpRequests) != null ? v : {};
3058
- Object.entries(b).forEach(([k, B]) => {
3059
- if (B && (!m[k] || isEditing())) {
3060
- const V = R(B);
3061
- p({
3062
- url: V,
3063
- key: k
3051
+ function S() {
3052
+ var f, p, h;
3053
+ const u = (h = (p = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : p.httpRequests) != null ? h : {};
3054
+ Object.entries(u).forEach(([v, w]) => {
3055
+ if (w && (!c[v] || isEditing())) {
3056
+ const j = b(w);
3057
+ y({
3058
+ url: j,
3059
+ key: v
3064
3060
  });
3065
3061
  }
3066
3062
  });
3067
3063
  }
3068
- function w() {
3064
+ function k() {
3069
3065
  isEditing() && window.dispatchEvent(
3070
3066
  new CustomEvent(
3071
3067
  "builder:component:stateChange",
@@ -3081,9 +3077,9 @@ function EnableEditor(e) {
3081
3077
  );
3082
3078
  }
3083
3079
  return useEffect(() => {
3084
- var b, S;
3080
+ var u, f;
3085
3081
  if (isBrowser()) {
3086
- if (isEditing() && (o(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
3082
+ if (isEditing() && (window.addEventListener("message", r), registerInsertMenu(), setupBrowserForEditing({
3087
3083
  ...e.locale ? {
3088
3084
  locale: e.locale
3089
3085
  } : {},
@@ -3095,66 +3091,64 @@ function EnableEditor(e) {
3095
3091
  } : {}
3096
3092
  }), Object.values(
3097
3093
  e.builderContextSignal.componentInfos
3098
- ).forEach((v) => {
3099
- var B;
3100
- const k = createRegisterComponentMessage(v);
3101
- (B = window.parent) == null || B.postMessage(k, "*");
3094
+ ).forEach((h) => {
3095
+ var w;
3096
+ const v = createRegisterComponentMessage(h);
3097
+ (w = window.parent) == null || w.postMessage(v, "*");
3102
3098
  }), window.addEventListener(
3103
3099
  "builder:component:stateChangeListenerActivated",
3104
- w
3100
+ k
3105
3101
  )), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
3106
- const v = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId, k = (S = e.builderContextSignal.content) == null ? void 0 : S.id, B = e.apiKey;
3102
+ const h = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, v = (f = e.builderContextSignal.content) == null ? void 0 : f.id, w = e.apiKey;
3107
3103
  _track({
3108
3104
  type: "impression",
3109
3105
  canTrack: !0,
3110
- contentId: k,
3111
- apiKey: B,
3112
- variationId: v !== k ? v : void 0
3106
+ contentId: v,
3107
+ apiKey: w,
3108
+ variationId: h !== v ? h : void 0
3113
3109
  });
3114
3110
  }
3115
3111
  if (isPreviewing()) {
3116
- const v = new URL(location.href).searchParams, k = v.get("builder.preview"), B = v.get(
3117
- `builder.preview.${k}`
3118
- ), V = v.get("apiKey") || v.get("builder.space");
3119
- k === e.model && V === e.apiKey && (!e.content || B === e.content.id) && fetchOneEntry({
3112
+ const h = new URL(location.href).searchParams, v = h.get("builder.preview"), w = h.get(
3113
+ `builder.preview.${v}`
3114
+ ), j = h.get("apiKey") || h.get("builder.space");
3115
+ v === e.model && j === e.apiKey && (!e.content || w === e.content.id) && fetchOneEntry({
3120
3116
  model: e.model,
3121
3117
  apiKey: e.apiKey,
3122
3118
  apiVersion: e.builderContextSignal.apiVersion
3123
- }).then(($) => {
3124
- $ && a($);
3119
+ }).then((A) => {
3120
+ A && o(A);
3125
3121
  });
3126
3122
  }
3127
3123
  }
3128
3124
  }, []), useEffect(() => {
3129
3125
  e.apiKey || logger.error(
3130
3126
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
3131
- ), u(), C(), w();
3127
+ ), s(), S(), k();
3132
3128
  }, []), useEffect(() => {
3133
- e.content && a(e.content);
3129
+ e.content && o(e.content);
3134
3130
  }, [e.content]), useEffect(() => {
3135
- }, [r]), useEffect(() => {
3136
- u();
3137
- }, [(F = (E = e.builderContextSignal.content) == null ? void 0 : E.data) == null ? void 0 : F.jsCode]), useEffect(() => {
3138
- C();
3139
- }, [(f = (N = e.builderContextSignal.content) == null ? void 0 : N.data) == null ? void 0 : f.httpRequests]), useEffect(() => {
3140
- w();
3131
+ s();
3132
+ }, [(x = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : x.jsCode]), useEffect(() => {
3133
+ S();
3134
+ }, [(E = (C = e.builderContextSignal.content) == null ? void 0 : C.data) == null ? void 0 : E.httpRequests]), useEffect(() => {
3135
+ k();
3141
3136
  }, [e.builderContextSignal.rootState]), useEffect(() => {
3142
- e.data && i(e.data);
3137
+ e.data && n(e.data);
3143
3138
  }, [e.data]), useEffect(() => {
3144
- e.locale && i({
3139
+ e.locale && n({
3145
3140
  locale: e.locale
3146
3141
  });
3147
3142
  }, [e.locale]), useEffect(() => () => {
3148
- isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
3143
+ isBrowser() && (window.removeEventListener("message", r), window.removeEventListener(
3149
3144
  "builder:component:stateChangeListenerActivated",
3150
- w
3145
+ k
3151
3146
  ));
3152
- }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ createElement(
3153
- c,
3147
+ }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(
3148
+ i,
3154
3149
  {
3155
- key: n,
3156
3150
  ref: t,
3157
- onClick: (b) => T(b),
3151
+ onClick: (u) => g(u),
3158
3152
  "builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
3159
3153
  "builder-model": e.model,
3160
3154
  ...e.showContent ? {} : {
@@ -3162,9 +3156,9 @@ function EnableEditor(e) {
3162
3156
  "aria-hidden": !0
3163
3157
  },
3164
3158
  ...e.contentWrapperProps,
3165
- className: `variant-${((j = e.content) == null ? void 0 : j.testVariationId) || ((P = e.content) == null ? void 0 : P.id)}`
3166
- },
3167
- e.children
3159
+ className: `variant-${((P = e.content) == null ? void 0 : P.testVariationId) || ((B = e.content) == null ? void 0 : B.id)}`,
3160
+ children: e.children
3161
+ }
3168
3162
  ) : null });
3169
3163
  }
3170
3164
  const getCssFromFont = (e) => {
@@ -3263,22 +3257,22 @@ const getRootStateInitialValue = ({
3263
3257
  meta: e == null ? void 0 : e.meta
3264
3258
  } : void 0;
3265
3259
  function ContentComponent(e) {
3266
- var c, l, d, u, m, g, h;
3260
+ var c, l, d, m, g, b, y;
3267
3261
  const [t, n] = useState(
3268
3262
  () => {
3269
- var y, T;
3263
+ var S, k;
3270
3264
  return getUpdateVariantVisibilityScript({
3271
3265
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3272
- variationId: (y = e.content) == null ? void 0 : y.testVariationId,
3266
+ variationId: (S = e.content) == null ? void 0 : S.testVariationId,
3273
3267
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3274
- contentId: (T = e.content) == null ? void 0 : T.id
3268
+ contentId: (k = e.content) == null ? void 0 : k.id
3275
3269
  });
3276
3270
  }
3277
3271
  );
3278
- function o(y) {
3279
- s((T) => ({
3280
- ...T,
3281
- rootState: y
3272
+ function o(S) {
3273
+ s((k) => ({
3274
+ ...k,
3275
+ rootState: S
3282
3276
  }));
3283
3277
  }
3284
3278
  const [i, a] = useState(
@@ -3286,11 +3280,11 @@ function ContentComponent(e) {
3286
3280
  ...getDefaultRegisteredComponents(),
3287
3281
  ...e.customComponents || []
3288
3282
  ].reduce(
3289
- (y, { component: T, ...R }) => ({
3290
- ...y,
3291
- [R.name]: {
3292
- component: T,
3293
- ...serializeComponentInfo(R)
3283
+ (S, { component: k, ...T }) => ({
3284
+ ...S,
3285
+ [T.name]: {
3286
+ component: k,
3287
+ ...serializeComponentInfo(T)
3294
3288
  }
3295
3289
  }),
3296
3290
  {}
@@ -3314,9 +3308,9 @@ function ContentComponent(e) {
3314
3308
  ...getDefaultRegisteredComponents(),
3315
3309
  ...e.customComponents || []
3316
3310
  ].reduce(
3317
- (y, { component: T, ...R }) => ({
3318
- ...y,
3319
- [R.name]: serializeComponentInfo(R)
3311
+ (S, { component: k, ...T }) => ({
3312
+ ...S,
3313
+ [T.name]: serializeComponentInfo(T)
3320
3314
  }),
3321
3315
  {}
3322
3316
  ),
@@ -3356,13 +3350,13 @@ function ContentComponent(e) {
3356
3350
  isNestedRender: e.isNestedRender,
3357
3351
  contentId: (c = r.content) == null ? void 0 : c.id,
3358
3352
  cssCode: (d = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
3359
- customFonts: (m = (u = r.content) == null ? void 0 : u.data) == null ? void 0 : m.customFonts
3353
+ customFonts: (g = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : g.customFonts
3360
3354
  }
3361
3355
  ),
3362
3356
  /* @__PURE__ */ jsx(
3363
3357
  Blocks,
3364
3358
  {
3365
- blocks: (h = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : h.blocks,
3359
+ blocks: (y = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : y.blocks,
3366
3360
  context: r,
3367
3361
  registeredComponents: i,
3368
3362
  linkComponent: e.linkComponent