@builder.io/sdk-react 4.1.3 → 4.2.1

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 (72) hide show
  1. package/lib/browser/blocks-exports.cjs +8 -8
  2. package/lib/browser/blocks-exports.mjs +289 -265
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +6 -5
  5. package/lib/browser/server-entry-4cf669a1.cjs +2 -0
  6. package/lib/browser/{server-entry-4da1a296.js → server-entry-5e98a993.js} +24 -13
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +7 -6
  9. package/lib/edge/{accordion-78ee648e.cjs → accordion-4bab42b1.cjs} +1 -1
  10. package/lib/edge/{accordion-1784524c.js → accordion-a8a363e4.js} +1 -1
  11. package/lib/edge/{blocks-14702bfa.cjs → blocks-d07d0261.cjs} +1 -1
  12. package/lib/edge/{blocks-f5fb0ce5.js → blocks-e1f5b0d0.js} +2 -2
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-290c53b5.cjs → button-6734c0bb.cjs} +1 -1
  16. package/lib/edge/{button-21ceeedc.js → button-bbcadacf.js} +2 -2
  17. package/lib/edge/{columns-b7aced60.cjs → columns-821cba14.cjs} +1 -1
  18. package/lib/edge/{columns-1068516d.js → columns-cf3081c6.js} +3 -3
  19. package/lib/edge/{content-variants-90878d85.js → content-variants-a704e35c.js} +172 -150
  20. package/lib/edge/{content-variants-a264ddef.cjs → content-variants-ec180883.cjs} +6 -6
  21. package/lib/edge/{custom-code-2c87d654.cjs → custom-code-8fcaa31e.cjs} +1 -1
  22. package/lib/edge/{custom-code-4fa9e701.js → custom-code-f6c30129.js} +1 -1
  23. package/lib/edge/{embed-80b047e6.js → embed-3c0b5564.js} +1 -1
  24. package/lib/edge/{embed-d5d20b9d.cjs → embed-666d3cc4.cjs} +1 -1
  25. package/lib/edge/form-51f639ab.cjs +1 -0
  26. package/lib/edge/{form-539b46dc.js → form-8b068721.js} +9 -7
  27. package/lib/edge/{get-class-prop-name-57633f13.cjs → get-class-prop-name-2869a960.cjs} +1 -1
  28. package/lib/edge/{get-class-prop-name-7e842f9c.js → get-class-prop-name-d6d821d6.js} +1 -1
  29. package/lib/edge/{img-36b77f7e.cjs → img-b04b9b6d.cjs} +1 -1
  30. package/lib/edge/{img-e2d845d3.js → img-dfbd4080.js} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +4 -3
  33. package/lib/edge/{input-4b7d5309.js → input-665ef328.js} +1 -1
  34. package/lib/edge/{input-ad09fe4d.cjs → input-d31d6451.cjs} +1 -1
  35. package/lib/edge/{personalization-container-8dcdbc56.cjs → personalization-container-d12566e8.cjs} +1 -1
  36. package/lib/edge/{personalization-container-6a8723bf.js → personalization-container-e784836e.js} +4 -4
  37. package/lib/edge/{select-2c39366d.js → select-5fe49bd4.js} +1 -1
  38. package/lib/edge/{select-427609f7.cjs → select-c3085265.cjs} +1 -1
  39. package/lib/edge/server-entry-acf5ce7d.cjs +2 -0
  40. package/lib/edge/{server-entry-6e9f2e70.js → server-entry-c9d5300f.js} +22 -11
  41. package/lib/edge/server-entry.cjs +1 -1
  42. package/lib/edge/server-entry.mjs +7 -6
  43. package/lib/edge/{slot-74827ed2.js → slot-a17ee2d7.js} +3 -3
  44. package/lib/edge/{slot-780e168e.cjs → slot-cbbbb02e.cjs} +1 -1
  45. package/lib/edge/{symbol-8573a705.js → symbol-9f960685.js} +2 -2
  46. package/lib/edge/{symbol-c79c9cb2.cjs → symbol-b56b5675.cjs} +1 -1
  47. package/lib/edge/{tabs-90d614d8.js → tabs-26ac5b2f.js} +3 -3
  48. package/lib/edge/{tabs-706f56bf.cjs → tabs-bf6643d7.cjs} +1 -1
  49. package/lib/node/blocks-exports.cjs +14 -14
  50. package/lib/node/blocks-exports.mjs +292 -268
  51. package/lib/node/index.cjs +1 -1
  52. package/lib/node/index.mjs +6 -5
  53. package/lib/node/init.cjs +1 -1
  54. package/lib/node/init.mjs +3 -3
  55. package/lib/node/{server-entry-6d89489d.js → server-entry-48724189.js} +24 -13
  56. package/lib/node/server-entry-562c0663.cjs +2 -0
  57. package/lib/node/server-entry.cjs +1 -1
  58. package/lib/node/server-entry.mjs +7 -6
  59. package/lib/node/{setIvm-4d2ae811.cjs → setIvm-3b6199a0.cjs} +1 -1
  60. package/lib/node/{setIvm-96d70b3f.js → setIvm-a7aba6d2.js} +1 -1
  61. package/lib/node/setIvm.cjs +1 -1
  62. package/lib/node/setIvm.mjs +2 -2
  63. package/lib/node/{should-force-browser-runtime-in-node-f668d799.cjs → should-force-browser-runtime-in-node-cbe0ef14.cjs} +1 -1
  64. package/lib/node/{should-force-browser-runtime-in-node-4d8646f7.js → should-force-browser-runtime-in-node-fdc70f22.js} +1 -1
  65. package/package.json +1 -1
  66. package/types/constants/sdk-version.d.ts +1 -1
  67. package/types/functions/register.d.ts +18 -0
  68. package/types/server-index.d.ts +1 -1
  69. package/lib/browser/server-entry-2443e405.cjs +0 -2
  70. package/lib/edge/form-3e4c4ae4.cjs +0 -1
  71. package/lib/edge/server-entry-9c867b01.cjs +0 -2
  72. package/lib/node/server-entry-dd2d010e.cjs +0 -2
@@ -1,8 +1,8 @@
1
- import { jsx as v, jsxs as U, Fragment as j } from "react/jsx-runtime";
2
- import { lazy as I, useRef as Q, useState as V, useEffect as W } from "react";
3
- import { TARGET as F, isBrowser as _, isEditing as N, isPreviewing as oe, setupBrowserForEditing as ge, createRegisterComponentMessage as he, getDefaultCanTrack as q, getCookieSync as be, _track as X, fetchOneEntry as ye, createEditorListener as ve, logFetch as xe, serializeIncludingFunctions as Z, logger as Se, handleABTestingSync as Te } from "./server-entry-6e9f2e70.js";
1
+ import { jsx as T, jsxs as B, Fragment as j } from "react/jsx-runtime";
2
+ import { lazy as C, useRef as Q, useState as R, useEffect as W } from "react";
3
+ import { TARGET as F, isBrowser as U, isEditing as N, isPreviewing as oe, setupBrowserForEditing as ge, createRegisterComponentMessage as he, getDefaultCanTrack as O, getCookieSync as be, _track as X, fetchOneEntry as ye, createEditorListener as ve, logFetch as xe, serializeIncludingFunctions as Z, logger as Se, handleABTestingSync as Te } from "./server-entry-c9d5300f.js";
4
4
  import { Video as Ie, Button as ke, Columns as Ce, Fragment as we, Image as Ve, Section as Ee, Symbol as Re, Text as Ae, BuilderContext as De } from "./blocks-exports.mjs";
5
- import { triggerAnimation as Fe, evaluate as re, fastClone as Pe, InlinedStyles as se, ComponentsContext as We, Blocks as Ne } from "./blocks-f5fb0ce5.js";
5
+ import { triggerAnimation as Fe, evaluate as re, fastClone as Pe, InlinedStyles as se, ComponentsContext as We, Blocks as Ne } from "./blocks-e1f5b0d0.js";
6
6
  function Gt(e, t, n, o) {
7
7
  function r(f) {
8
8
  return typeof f == "string";
@@ -12,24 +12,24 @@ function Gt(e, t, n, o) {
12
12
  }
13
13
  function i(f, m) {
14
14
  return (() => {
15
- const x = m.property, C = m.operator;
15
+ const I = m.property, E = m.operator;
16
16
  let d = m.value;
17
- if (m && m.property === "urlPath" && m.value && typeof m.value == "string" && m.value !== "/" && m.value.endsWith("/") && (d = m.value.slice(0, -1)), !(x && C))
17
+ if (m && m.property === "urlPath" && m.value && typeof m.value == "string" && m.value !== "/" && m.value.endsWith("/") && (d = m.value.slice(0, -1)), !(I && E))
18
18
  return !0;
19
19
  if (Array.isArray(d))
20
- return C === "isNot" ? d.every((k) => i(f, {
21
- property: x,
22
- operator: C,
23
- value: k
24
- })) : !!d.find((k) => i(f, {
25
- property: x,
26
- operator: C,
27
- value: k
20
+ return E === "isNot" ? d.every((w) => i(f, {
21
+ property: I,
22
+ operator: E,
23
+ value: w
24
+ })) : !!d.find((w) => i(f, {
25
+ property: I,
26
+ operator: E,
27
+ value: w
28
28
  }));
29
- const u = f[x];
29
+ const u = f[I];
30
30
  if (Array.isArray(u))
31
31
  return u.includes(d);
32
- switch (C) {
32
+ switch (E) {
33
33
  case "is":
34
34
  return u === d;
35
35
  case "isNot":
@@ -223,7 +223,7 @@ const $e = `function getPersonalizedVariant(variants, blockId, isHydrationTarget
223
223
  }
224
224
  }`, Ue = "default", Be = "filterWithCustomTargeting", le = "builderIoPersonalization", ue = "updateVisibilityStylesScript", de = ["react", "vue", "svelte", "qwik"], He = ["vue", "svelte", "qwik"];
225
225
  function Xt(e, t) {
226
- return !(e && e.length > 0) || !t ? !1 : He.includes(F) ? !0 : !_();
226
+ return !(e && e.length > 0) || !t ? !1 : He.includes(F) ? !0 : !U();
227
227
  }
228
228
  function Zt({
229
229
  variants: e,
@@ -250,7 +250,7 @@ function Zt({
250
250
  }
251
251
  return s;
252
252
  }
253
- if (_()) {
253
+ if (U()) {
254
254
  const a = o == null ? void 0 : o[0];
255
255
  if (a && e) {
256
256
  const l = e.indexOf(a);
@@ -392,7 +392,7 @@ const qe = () => `
392
392
  builderComponents: !0,
393
393
  builderLinkComponent: !0
394
394
  }
395
- }, je = I(() => import("./accordion-1784524c.js")), Me = {
395
+ }, je = C(() => import("./accordion-a8a363e4.js")), Me = {
396
396
  name: "Core:Button",
397
397
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
398
398
  defaultStyles: {
@@ -667,8 +667,8 @@ const qe = () => `
667
667
  let P = !1;
668
668
  m.onload = () => {
669
669
  P = !0, l(m);
670
- }, m.addEventListener("error", (x) => {
671
- console.warn("Image load failed", x.error), f(x.error);
670
+ }, m.addEventListener("error", (I) => {
671
+ console.warn("Image load failed", I.error), f(I.error);
672
672
  }), m.src = i, setTimeout(() => {
673
673
  P || f(new Error("Image load timed out"));
674
674
  }, a);
@@ -789,7 +789,7 @@ const qe = () => `
789
789
  defaultValue: []
790
790
  }]
791
791
  }]
792
- }, Ge = I(() => import("./personalization-container-6a8723bf.js")), Xe = {
792
+ }, Ge = C(() => import("./personalization-container-e784836e.js")), Xe = {
793
793
  name: "Core:Section",
794
794
  static: !0,
795
795
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -845,7 +845,7 @@ const qe = () => `
845
845
  builderContext: !0,
846
846
  builderComponents: !0
847
847
  }
848
- }, et = I(() => import("./slot-74827ed2.js")), tt = {
848
+ }, et = C(() => import("./slot-a17ee2d7.js")), tt = {
849
849
  name: "Symbol",
850
850
  noWrap: !0,
851
851
  static: !0,
@@ -1025,7 +1025,7 @@ const qe = () => `
1025
1025
  builderComponents: !0,
1026
1026
  builderLinkComponent: !0
1027
1027
  }
1028
- }, at = I(() => import("./tabs-90d614d8.js")), it = {
1028
+ }, at = C(() => import("./tabs-26ac5b2f.js")), it = {
1029
1029
  shouldReceiveBuilderProps: {},
1030
1030
  name: "Text",
1031
1031
  static: !0,
@@ -1066,7 +1066,7 @@ const qe = () => `
1066
1066
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1067
1067
  advanced: !0
1068
1068
  }]
1069
- }, rt = I(() => import("./custom-code-4fa9e701.js")), st = {
1069
+ }, rt = C(() => import("./custom-code-f6c30129.js")), st = {
1070
1070
  name: "Embed",
1071
1071
  static: !0,
1072
1072
  inputs: [{
@@ -1081,7 +1081,7 @@ const qe = () => `
1081
1081
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1082
1082
  hideFromUI: !0
1083
1083
  }]
1084
- }, lt = I(() => import("./embed-80b047e6.js")), ut = {
1084
+ }, lt = C(() => import("./embed-3c0b5564.js")), ut = {
1085
1085
  name: "Form:Form",
1086
1086
  // editableTags: ['builder-form-error']
1087
1087
  defaults: {
@@ -1318,7 +1318,7 @@ const qe = () => `
1318
1318
  builderComponents: !0,
1319
1319
  builderLinkComponent: !0
1320
1320
  }
1321
- }, dt = I(() => import("./form-539b46dc.js")), ct = {
1321
+ }, dt = C(() => import("./form-8b068721.js")), ct = {
1322
1322
  name: "Form:Input",
1323
1323
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
1324
1324
  inputs: [
@@ -1369,7 +1369,7 @@ const qe = () => `
1369
1369
  borderStyle: "solid",
1370
1370
  borderColor: "#ccc"
1371
1371
  }
1372
- }, mt = I(() => import("./input-4b7d5309.js")), pt = {
1372
+ }, mt = C(() => import("./input-665ef328.js")), pt = {
1373
1373
  name: "Form:Select",
1374
1374
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
1375
1375
  defaultStyles: {
@@ -1411,7 +1411,7 @@ const qe = () => `
1411
1411
  }],
1412
1412
  static: !0,
1413
1413
  noWrap: !0
1414
- }, ft = I(() => import("./select-2c39366d.js")), gt = {
1414
+ }, ft = C(() => import("./select-5fe49bd4.js")), gt = {
1415
1415
  name: "Form:SubmitButton",
1416
1416
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
1417
1417
  defaultStyles: {
@@ -1436,7 +1436,7 @@ const qe = () => `
1436
1436
  // that only shows if advanced setting is flipped
1437
1437
  // TODO: defaultChildren
1438
1438
  // canHaveChildren: true,
1439
- }, ht = I(() => import("./submit-button-b48361a7.js")), bt = {
1439
+ }, ht = C(() => import("./submit-button-b48361a7.js")), bt = {
1440
1440
  name: "Form:TextArea",
1441
1441
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
1442
1442
  inputs: [{
@@ -1472,7 +1472,7 @@ const qe = () => `
1472
1472
  },
1473
1473
  static: !0,
1474
1474
  noWrap: !0
1475
- }, yt = I(() => import("./textarea-d29025e9.js")), vt = {
1475
+ }, yt = C(() => import("./textarea-d29025e9.js")), vt = {
1476
1476
  // friendlyName?
1477
1477
  name: "Raw:Img",
1478
1478
  hideFromInsertMenu: !0,
@@ -1486,7 +1486,7 @@ const qe = () => `
1486
1486
  }],
1487
1487
  noWrap: !0,
1488
1488
  static: !0
1489
- }, xt = I(() => import("./img-e2d845d3.js")), St = {
1489
+ }, xt = C(() => import("./img-dfbd4080.js")), St = {
1490
1490
  name: "Video",
1491
1491
  canHaveChildren: !0,
1492
1492
  defaultStyles: {
@@ -1723,14 +1723,14 @@ const qe = () => `
1723
1723
  thisScriptEl?.remove();
1724
1724
  }
1725
1725
  return;
1726
- }`, me = "builderIoAbTest", pe = "builderIoRenderContent", B = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1726
+ }`, me = "builderIoAbTest", pe = "builderIoRenderContent", H = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1727
1727
  ...t,
1728
1728
  testVariationId: t.id,
1729
1729
  id: e == null ? void 0 : e.id
1730
1730
  })), Ct = ({
1731
1731
  canTrack: e,
1732
1732
  content: t
1733
- }) => !(!(B(t).length > 0) || !e || _()), wt = (e) => e === "react" || e === "reactNative", Vt = F === "angular", fe = wt(F), Et = () => `
1733
+ }) => !(!(H(t).length > 0) || !e || U()), wt = (e) => e === "react" || e === "reactNative", Vt = F === "angular", fe = wt(F), Et = () => `
1734
1734
  window.${me} = ${It}
1735
1735
  window.${pe} = ${kt}
1736
1736
  `, Rt = (e, t) => `
@@ -1742,8 +1742,8 @@ const qe = () => `
1742
1742
  }) => `window.${pe}(
1743
1743
  "${t}", "${e}", ${fe}
1744
1744
  )`;
1745
- function H(e) {
1746
- return /* @__PURE__ */ v(
1745
+ function q(e) {
1746
+ return /* @__PURE__ */ T(
1747
1747
  "script",
1748
1748
  {
1749
1749
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -1847,9 +1847,9 @@ font-weight: ${a};
1847
1847
  }
1848
1848
  `, Ut = (e) => e ? "" : Lt, Bt = (e) => `variant-${e}`;
1849
1849
  function Ht(e) {
1850
- var y, T, A;
1850
+ var v, k, D;
1851
1851
  const t = Q(null);
1852
- V(() => !1);
1852
+ R(() => !1);
1853
1853
  function n(c) {
1854
1854
  var h, b;
1855
1855
  const p = {
@@ -1862,7 +1862,7 @@ function Ht(e) {
1862
1862
  }));
1863
1863
  }
1864
1864
  function o(c) {
1865
- var h, b, g, D, E;
1865
+ var h, b, g, x, A;
1866
1866
  const p = {
1867
1867
  ...e.builderContextSignal.content,
1868
1868
  ...c,
@@ -1873,11 +1873,11 @@ function Ht(e) {
1873
1873
  meta: {
1874
1874
  ...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
1875
1875
  ...c == null ? void 0 : c.meta,
1876
- breakpoints: ((g = c == null ? void 0 : c.meta) == null ? void 0 : g.breakpoints) || ((E = (D = e.builderContextSignal.content) == null ? void 0 : D.meta) == null ? void 0 : E.breakpoints)
1876
+ breakpoints: ((g = c == null ? void 0 : c.meta) == null ? void 0 : g.breakpoints) || ((A = (x = e.builderContextSignal.content) == null ? void 0 : x.meta) == null ? void 0 : A.breakpoints)
1877
1877
  }
1878
1878
  };
1879
- e.setBuilderContextSignal((w) => ({
1880
- ...w,
1879
+ e.setBuilderContextSignal((_) => ({
1880
+ ..._,
1881
1881
  content: p
1882
1882
  }));
1883
1883
  }
@@ -1887,7 +1887,7 @@ function Ht(e) {
1887
1887
  "aria-hidden": !0
1888
1888
  };
1889
1889
  }
1890
- const [s, i] = V(
1890
+ const [s, i] = R(
1891
1891
  () => e.contentWrapper || "div"
1892
1892
  );
1893
1893
  function a(c) {
@@ -1916,7 +1916,7 @@ function Ht(e) {
1916
1916
  }
1917
1917
  })(c);
1918
1918
  }
1919
- const [l, f] = V(() => ({})), [m, P] = V(() => ({})), [x, C] = V(() => !1);
1919
+ const [l, f] = R(() => ({})), [m, P] = R(() => ({})), [I, E] = R(() => !1);
1920
1920
  function d(c) {
1921
1921
  var p, h;
1922
1922
  if (e.builderContextSignal.content) {
@@ -1924,47 +1924,69 @@ function Ht(e) {
1924
1924
  X({
1925
1925
  apiHost: e.apiHost,
1926
1926
  type: "click",
1927
- canTrack: q(e.canTrack),
1927
+ canTrack: O(e.canTrack),
1928
1928
  contentId: g,
1929
1929
  apiKey: e.apiKey,
1930
1930
  variationId: b !== g ? b : void 0,
1931
1931
  ...Pt(c),
1932
- unique: !x
1932
+ unique: !I
1933
1933
  });
1934
1934
  }
1935
- x || C(!0);
1935
+ I || E(!0);
1936
1936
  }
1937
1937
  function u() {
1938
1938
  var p, h, b;
1939
1939
  const c = (b = (h = (p = e.builderContextSignal.content) == null ? void 0 : p.data) == null ? void 0 : h.httpRequests) != null ? b : {};
1940
- Object.entries(c).forEach(([g, D]) => {
1941
- if (!D || m[g] || l[g] && !N())
1942
- return;
1943
- m[g] = !0;
1944
- const E = D.replace(
1945
- /{{([^}]+)}}/g,
1946
- (w, S) => String(
1947
- re({
1948
- code: S,
1949
- context: e.context || {},
1950
- localState: void 0,
1951
- rootState: e.builderContextSignal.rootState,
1952
- rootSetState: e.builderContextSignal.rootSetState
1953
- })
1954
- )
1955
- );
1956
- xe(E), fetch(E).then((w) => w.json()).then((w) => {
1957
- n({
1958
- [g]: w
1959
- }), l[g] = !0;
1960
- }).catch((w) => {
1961
- console.error("error fetching dynamic data", D, w);
1962
- }).finally(() => {
1963
- m[g] = !1;
1964
- });
1965
- });
1940
+ Object.entries(c).forEach(
1941
+ ([g, x]) => {
1942
+ if (!x)
1943
+ return;
1944
+ const A = typeof x == "object" && x["@type"] === "@builder.io/core:Request";
1945
+ if (m[g] || l[g] && !N())
1946
+ return;
1947
+ const _ = A ? x.request.url : x;
1948
+ m[g] = !0;
1949
+ const S = _.replace(
1950
+ /{{([^}]+)}}/g,
1951
+ (V, L) => String(
1952
+ re({
1953
+ code: L,
1954
+ context: e.context || {},
1955
+ localState: void 0,
1956
+ rootState: e.builderContextSignal.rootState,
1957
+ rootSetState: e.builderContextSignal.rootSetState
1958
+ })
1959
+ )
1960
+ ), y = A ? {
1961
+ url: S,
1962
+ method: x.request.method,
1963
+ headers: x.request.headers,
1964
+ body: x.request.body
1965
+ } : {
1966
+ url: S,
1967
+ method: "GET"
1968
+ };
1969
+ xe(JSON.stringify(y)), fetch(y.url, {
1970
+ method: y.method,
1971
+ headers: y.headers,
1972
+ body: y.body
1973
+ }).then((V) => V.json()).then((V) => {
1974
+ n({
1975
+ [g]: V
1976
+ }), l[g] = !0;
1977
+ }).catch((V) => {
1978
+ console.error(
1979
+ "error fetching dynamic data",
1980
+ JSON.stringify(x),
1981
+ V
1982
+ );
1983
+ }).finally(() => {
1984
+ m[g] = !1;
1985
+ });
1986
+ }
1987
+ );
1966
1988
  }
1967
- function k() {
1989
+ function w() {
1968
1990
  N() && window.dispatchEvent(
1969
1991
  new CustomEvent(
1970
1992
  "builder:component:stateChange",
@@ -1980,9 +2002,9 @@ function Ht(e) {
1980
2002
  );
1981
2003
  }
1982
2004
  const $ = Q(!1);
1983
- return $.current || (u(), k(), $.current = !0), W(() => {
2005
+ return $.current || (u(), w(), $.current = !0), W(() => {
1984
2006
  var c, p, h, b, g;
1985
- if (_()) {
2007
+ if (U()) {
1986
2008
  N() && !e.isNestedRender && (window.addEventListener("message", a), ge({
1987
2009
  ...e.locale ? {
1988
2010
  locale: e.locale
@@ -1998,39 +2020,39 @@ function Ht(e) {
1998
2020
  }), Object.values(
1999
2021
  e.builderContextSignal.componentInfos
2000
2022
  ).forEach((S) => {
2001
- var R, L;
2002
- if (!((R = S.models) != null && R.length) || S.models.includes(e.model)) {
2003
- const O = he(S);
2004
- (L = window.parent) == null || L.postMessage(O, "*");
2023
+ var y, V;
2024
+ if (!((y = S.models) != null && y.length) || S.models.includes(e.model)) {
2025
+ const L = he(S);
2026
+ (V = window.parent) == null || V.postMessage(L, "*");
2005
2027
  }
2006
2028
  }), window.addEventListener(
2007
2029
  "builder:component:stateChangeListenerActivated",
2008
- k
2030
+ w
2009
2031
  ));
2010
- const D = e.builderContextSignal.content && q(e.canTrack), E = be({
2032
+ const x = e.builderContextSignal.content && O(e.canTrack), A = be({
2011
2033
  name: `builder.tests.${(p = e.builderContextSignal.content) == null ? void 0 : p.id}`,
2012
2034
  canTrack: !0
2013
- }), w = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId;
2014
- if (D && w === E) {
2015
- const S = (b = e.builderContextSignal.content) == null ? void 0 : b.id, R = e.apiKey;
2035
+ }), _ = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId;
2036
+ if (x && _ === A) {
2037
+ const S = (b = e.builderContextSignal.content) == null ? void 0 : b.id, y = e.apiKey;
2016
2038
  X({
2017
2039
  apiHost: e.apiHost,
2018
2040
  type: "impression",
2019
2041
  canTrack: !0,
2020
2042
  contentId: S,
2021
- apiKey: R,
2022
- variationId: E !== S ? E : void 0
2043
+ apiKey: y,
2044
+ variationId: A !== S ? A : void 0
2023
2045
  });
2024
2046
  }
2025
2047
  if (oe() && !N()) {
2026
- const S = new URL(location.href).searchParams, R = S.get("builder.preview"), L = S.get(
2027
- `builder.overrides.${R}`
2028
- ), O = S.get("apiKey") || S.get("builder.space");
2029
- (R === "BUILDER_STUDIO" || R === e.model && O === e.apiKey && (!e.content || L === e.content.id)) && ye({
2048
+ const S = new URL(location.href).searchParams, y = S.get("builder.preview"), V = S.get(
2049
+ `builder.overrides.${y}`
2050
+ ), L = S.get("apiKey") || S.get("builder.space");
2051
+ (y === "BUILDER_STUDIO" || y === e.model && L === e.apiKey && (!e.content || V === e.content.id)) && ye({
2030
2052
  model: e.model,
2031
2053
  apiKey: e.apiKey,
2032
2054
  apiVersion: e.builderContextSignal.apiVersion,
2033
- ...R === "BUILDER_STUDIO" && ((g = e.context) != null && g.symbolId) ? {
2055
+ ...y === "BUILDER_STUDIO" && ((g = e.context) != null && g.symbolId) ? {
2034
2056
  query: {
2035
2057
  id: e.context.symbolId
2036
2058
  }
@@ -2043,7 +2065,7 @@ function Ht(e) {
2043
2065
  }, []), W(() => {
2044
2066
  e.content && o(e.content);
2045
2067
  }, [e.content]), W(() => {
2046
- k();
2068
+ w();
2047
2069
  }, [e.builderContextSignal.rootState]), W(() => {
2048
2070
  e.data && n(e.data);
2049
2071
  }, [e.data]), W(() => {
@@ -2051,19 +2073,19 @@ function Ht(e) {
2051
2073
  locale: e.locale
2052
2074
  });
2053
2075
  }, [e.locale]), W(() => () => {
2054
- _() && (window.removeEventListener("message", a), window.removeEventListener(
2076
+ U() && (window.removeEventListener("message", a), window.removeEventListener(
2055
2077
  "builder:component:stateChangeListenerActivated",
2056
- k
2078
+ w
2057
2079
  ));
2058
- }, []), /* @__PURE__ */ v(De.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || ae() ? /* @__PURE__ */ v(
2080
+ }, []), /* @__PURE__ */ T(De.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || ae() ? /* @__PURE__ */ T(
2059
2081
  s,
2060
2082
  {
2061
2083
  ref: t,
2062
2084
  onClick: (c) => d(c),
2063
- "builder-content-id": (y = e.builderContextSignal.content) == null ? void 0 : y.id,
2085
+ "builder-content-id": (v = e.builderContextSignal.content) == null ? void 0 : v.id,
2064
2086
  "builder-model": e.model,
2065
2087
  className: Bt(
2066
- ((T = e.content) == null ? void 0 : T.testVariationId) || ((A = e.content) == null ? void 0 : A.id)
2088
+ ((k = e.content) == null ? void 0 : k.testVariationId) || ((D = e.content) == null ? void 0 : D.id)
2067
2089
  ),
2068
2090
  style: {
2069
2091
  display: !e.builderContextSignal.content && ae() ? "none" : void 0
@@ -2075,7 +2097,7 @@ function Ht(e) {
2075
2097
  ) : null });
2076
2098
  }
2077
2099
  function qt(e) {
2078
- const [t, n] = V(
2100
+ const [t, n] = R(
2079
2101
  () => `
2080
2102
  ${_t({
2081
2103
  cssCode: e.cssCode,
@@ -2087,7 +2109,7 @@ ${$t({
2087
2109
  ${Ut(e.isNestedRender)}
2088
2110
  `.trim()
2089
2111
  );
2090
- return /* @__PURE__ */ v(
2112
+ return /* @__PURE__ */ T(
2091
2113
  se,
2092
2114
  {
2093
2115
  id: "builderio-content",
@@ -2125,39 +2147,39 @@ const Ot = ({
2125
2147
  meta: e == null ? void 0 : e.meta
2126
2148
  } : void 0;
2127
2149
  function ie(e) {
2128
- var f, m, P, x, C, d, u, k, $;
2129
- const [t, n] = V(
2150
+ var f, m, P, I, E, d, u, w, $;
2151
+ const [t, n] = R(
2130
2152
  () => {
2131
- var y, T;
2153
+ var v, k;
2132
2154
  return At({
2133
2155
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2134
- variationId: (y = e.content) == null ? void 0 : y.testVariationId,
2156
+ variationId: (v = e.content) == null ? void 0 : v.testVariationId,
2135
2157
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2136
- contentId: (T = e.content) == null ? void 0 : T.id
2158
+ contentId: (k = e.content) == null ? void 0 : k.id
2137
2159
  });
2138
2160
  }
2139
2161
  );
2140
- function o(y) {
2141
- a((T) => ({
2142
- ...T,
2143
- rootState: y
2162
+ function o(v) {
2163
+ a((k) => ({
2164
+ ...k,
2165
+ rootState: v
2144
2166
  }));
2145
2167
  }
2146
- const [r, s] = V(
2168
+ const [r, s] = R(
2147
2169
  () => [
2148
2170
  ...ee(),
2149
2171
  ...e.customComponents || []
2150
2172
  ].reduce(
2151
- (y, { component: T, ...A }) => ({
2152
- ...y,
2153
- [A.name]: {
2154
- component: T,
2155
- ...Z(A)
2173
+ (v, { component: k, ...D }) => ({
2174
+ ...v,
2175
+ [D.name]: {
2176
+ component: k,
2177
+ ...Z(D)
2156
2178
  }
2157
2179
  }),
2158
2180
  {}
2159
2181
  )
2160
- ), [i, a] = V(() => ({
2182
+ ), [i, a] = R(() => ({
2161
2183
  content: jt({
2162
2184
  content: e.content,
2163
2185
  data: e.data
@@ -2177,9 +2199,9 @@ function ie(e) {
2177
2199
  ...ee(),
2178
2200
  ...e.customComponents || []
2179
2201
  ].reduce(
2180
- (y, { component: T, ...A }) => ({
2181
- ...y,
2182
- [A.name]: Z(A)
2202
+ (v, { component: k, ...D }) => ({
2203
+ ...v,
2204
+ [D.name]: Z(D)
2183
2205
  }),
2184
2206
  {}
2185
2207
  ),
@@ -2193,25 +2215,25 @@ function ie(e) {
2193
2215
  e.apiKey || Se.error(
2194
2216
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2195
2217
  );
2196
- const y = (m = (f = i.content) == null ? void 0 : f.data) == null ? void 0 : m.jsCode;
2197
- y && re({
2198
- code: y,
2218
+ const v = (m = (f = i.content) == null ? void 0 : f.data) == null ? void 0 : m.jsCode;
2219
+ v && re({
2220
+ code: v,
2199
2221
  context: e.context || {},
2200
2222
  localState: void 0,
2201
2223
  rootState: i.rootState,
2202
- rootSetState: (T) => {
2203
- Object.assign(i.rootState, T);
2224
+ rootSetState: (k) => {
2225
+ Object.assign(i.rootState, k);
2204
2226
  },
2205
2227
  isExpression: !1
2206
2228
  }), l.current = !0;
2207
2229
  }
2208
- return /* @__PURE__ */ v(
2230
+ return /* @__PURE__ */ T(
2209
2231
  We.Provider,
2210
2232
  {
2211
2233
  value: {
2212
2234
  registeredComponents: r
2213
2235
  },
2214
- children: /* @__PURE__ */ U(
2236
+ children: /* @__PURE__ */ B(
2215
2237
  Ht,
2216
2238
  {
2217
2239
  apiHost: e.apiHost,
@@ -2232,28 +2254,28 @@ function ie(e) {
2232
2254
  isNestedRender: e.isNestedRender,
2233
2255
  setBuilderContextSignal: a,
2234
2256
  children: [
2235
- e.isSsrAbTest ? /* @__PURE__ */ v(
2236
- H,
2257
+ e.isSsrAbTest ? /* @__PURE__ */ T(
2258
+ q,
2237
2259
  {
2238
2260
  id: "builderio-variant-visibility",
2239
2261
  scriptStr: t,
2240
2262
  nonce: e.nonce || ""
2241
2263
  }
2242
2264
  ) : null,
2243
- /* @__PURE__ */ v(
2265
+ /* @__PURE__ */ T(
2244
2266
  qt,
2245
2267
  {
2246
2268
  nonce: e.nonce || "",
2247
2269
  isNestedRender: e.isNestedRender,
2248
2270
  contentId: (P = i.content) == null ? void 0 : P.id,
2249
- cssCode: (C = (x = i.content) == null ? void 0 : x.data) == null ? void 0 : C.cssCode,
2271
+ cssCode: (E = (I = i.content) == null ? void 0 : I.data) == null ? void 0 : E.cssCode,
2250
2272
  customFonts: (u = (d = i.content) == null ? void 0 : d.data) == null ? void 0 : u.customFonts
2251
2273
  }
2252
2274
  ),
2253
- /* @__PURE__ */ v(
2275
+ /* @__PURE__ */ T(
2254
2276
  Ne,
2255
2277
  {
2256
- blocks: ($ = (k = i.content) == null ? void 0 : k.data) == null ? void 0 : $.blocks,
2278
+ blocks: ($ = (w = i.content) == null ? void 0 : w.data) == null ? void 0 : $.blocks,
2257
2279
  context: i,
2258
2280
  registeredComponents: r,
2259
2281
  linkComponent: e.linkComponent
@@ -2267,16 +2289,16 @@ function ie(e) {
2267
2289
  }
2268
2290
  function Mt(e) {
2269
2291
  var i;
2270
- const [t, n] = V(
2292
+ const [t, n] = R(
2271
2293
  () => Ct({
2272
- canTrack: q(e.canTrack),
2294
+ canTrack: O(e.canTrack),
2273
2295
  content: e.content
2274
2296
  })
2275
2297
  );
2276
2298
  function o() {
2277
2299
  var a;
2278
2300
  return Rt(
2279
- B(e.content).map((l) => ({
2301
+ H(e.content).map((l) => ({
2280
2302
  id: l.testVariationId,
2281
2303
  testRatio: l.testRatio
2282
2304
  })),
@@ -2284,7 +2306,7 @@ function Mt(e) {
2284
2306
  );
2285
2307
  }
2286
2308
  function r() {
2287
- return B(e.content).map((a) => `.variant-${a.testVariationId} { display: none; } `).join("");
2309
+ return H(e.content).map((a) => `.variant-${a.testVariationId} { display: none; } `).join("");
2288
2310
  }
2289
2311
  function s() {
2290
2312
  var a;
@@ -2293,22 +2315,22 @@ function Mt(e) {
2293
2315
  testVariationId: (a = e.content) == null ? void 0 : a.id
2294
2316
  } : Te({
2295
2317
  item: e.content,
2296
- canTrack: q(e.canTrack)
2318
+ canTrack: O(e.canTrack)
2297
2319
  });
2298
2320
  }
2299
2321
  return W(() => {
2300
- }, []), /* @__PURE__ */ U(j, { children: [
2301
- !e.isNestedRender && F !== "reactNative" ? /* @__PURE__ */ U(j, { children: [
2302
- /* @__PURE__ */ v(
2303
- H,
2322
+ }, []), /* @__PURE__ */ B(j, { children: [
2323
+ !e.isNestedRender && F !== "reactNative" ? /* @__PURE__ */ B(j, { children: [
2324
+ /* @__PURE__ */ T(
2325
+ q,
2304
2326
  {
2305
2327
  id: "builderio-init-variants-fns",
2306
2328
  scriptStr: Et(),
2307
2329
  nonce: e.nonce || ""
2308
2330
  }
2309
2331
  ),
2310
- de.includes(F) ? /* @__PURE__ */ v(
2311
- H,
2332
+ de.includes(F) ? /* @__PURE__ */ T(
2333
+ q,
2312
2334
  {
2313
2335
  id: "builderio-init-personalization-variants-fns",
2314
2336
  nonce: e.nonce || "",
@@ -2316,8 +2338,8 @@ function Mt(e) {
2316
2338
  }
2317
2339
  ) : null
2318
2340
  ] }) : null,
2319
- t ? /* @__PURE__ */ U(j, { children: [
2320
- /* @__PURE__ */ v(
2341
+ t ? /* @__PURE__ */ B(j, { children: [
2342
+ /* @__PURE__ */ T(
2321
2343
  se,
2322
2344
  {
2323
2345
  id: "builderio-variants",
@@ -2325,15 +2347,15 @@ function Mt(e) {
2325
2347
  nonce: e.nonce || ""
2326
2348
  }
2327
2349
  ),
2328
- /* @__PURE__ */ v(
2329
- H,
2350
+ /* @__PURE__ */ T(
2351
+ q,
2330
2352
  {
2331
2353
  id: "builderio-variants-visibility",
2332
2354
  scriptStr: o(),
2333
2355
  nonce: e.nonce || ""
2334
2356
  }
2335
2357
  ),
2336
- (i = B(e.content)) == null ? void 0 : i.map((a) => /* @__PURE__ */ v(
2358
+ (i = H(e.content)) == null ? void 0 : i.map((a) => /* @__PURE__ */ T(
2337
2359
  ie,
2338
2360
  {
2339
2361
  apiHost: e.apiHost,
@@ -2361,7 +2383,7 @@ function Mt(e) {
2361
2383
  a.testVariationId
2362
2384
  ))
2363
2385
  ] }) : null,
2364
- /* @__PURE__ */ v(
2386
+ /* @__PURE__ */ T(
2365
2387
  ie,
2366
2388
  {
2367
2389
  apiHost: e.apiHost,
@@ -2395,7 +2417,7 @@ const nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2395
2417
  }, Symbol.toStringTag, { value: "Module" }));
2396
2418
  export {
2397
2419
  Ue as DEFAULT_INDEX,
2398
- H as InlinedScript,
2420
+ q as InlinedScript,
2399
2421
  He as SDKS_REQUIRING_RESET_APPROACH,
2400
2422
  Xt as checkShouldRenderVariants,
2401
2423
  nn as contentVariants,