@builder.io/sdk-react-nextjs 0.14.6 → 0.14.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +8 -2
  2. package/lib/browser/USE_CLIENT_BUNDLE-9a694813.cjs +21 -0
  3. package/lib/browser/{USE_CLIENT_BUNDLE-dbef551d.js → USE_CLIENT_BUNDLE-f0eac1bb.js} +143 -136
  4. package/lib/{edge/USE_SERVER_BUNDLE-abb6c4ae.js → browser/USE_SERVER_BUNDLE-280036e3.js} +1 -1
  5. package/lib/{edge/USE_SERVER_BUNDLE-2000e927.cjs → browser/USE_SERVER_BUNDLE-ea761ee7.cjs} +1 -1
  6. package/lib/browser/{bundle-b2b7ab8b.js → bundle-187b6567.js} +620 -585
  7. package/lib/browser/bundle-f2d9f409.cjs +168 -0
  8. package/lib/browser/index.cjs +1 -1
  9. package/lib/browser/index.mjs +3 -3
  10. package/lib/{node/USE_CLIENT_BUNDLE-22e26b2f.js → edge/USE_CLIENT_BUNDLE-7cf0df22.js} +143 -136
  11. package/lib/edge/USE_CLIENT_BUNDLE-bda05805.cjs +21 -0
  12. package/lib/{node/USE_SERVER_BUNDLE-5a67cb67.cjs → edge/USE_SERVER_BUNDLE-0165e9c2.cjs} +1 -1
  13. package/lib/{node/USE_SERVER_BUNDLE-90b6e155.js → edge/USE_SERVER_BUNDLE-536a078a.js} +1 -1
  14. package/lib/edge/{bundle-9950e3ec.js → bundle-d26182eb.js} +1253 -1218
  15. package/lib/edge/{bundle-f4b34118.cjs → bundle-f84983cc.cjs} +35 -35
  16. package/lib/edge/index.cjs +1 -1
  17. package/lib/edge/index.mjs +3 -3
  18. package/lib/{edge/USE_CLIENT_BUNDLE-471a7309.js → node/USE_CLIENT_BUNDLE-04e65a8b.js} +143 -136
  19. package/lib/node/USE_CLIENT_BUNDLE-4e14ccee.cjs +21 -0
  20. package/lib/{browser/USE_SERVER_BUNDLE-545db2f7.cjs → node/USE_SERVER_BUNDLE-6f53d199.cjs} +1 -1
  21. package/lib/{browser/USE_SERVER_BUNDLE-a6a333bd.js → node/USE_SERVER_BUNDLE-dee3041b.js} +1 -1
  22. package/lib/node/{bundle-a8519a3b.js → bundle-29f6bee7.js} +245 -210
  23. package/lib/node/{bundle-9f34ab83.cjs → bundle-b303d0db.cjs} +11 -11
  24. package/lib/node/index.cjs +1 -1
  25. package/lib/node/index.mjs +3 -3
  26. package/package.json +1 -1
  27. package/types/cjs/components/block/block.helpers.d.ts +4 -0
  28. package/types/cjs/constants/sdk-version.d.ts +1 -1
  29. package/types/cjs/functions/evaluate/evaluate.d.ts +3 -1
  30. package/types/cjs/functions/evaluate/helpers.d.ts +1 -0
  31. package/types/esm/components/block/block.helpers.d.ts +4 -0
  32. package/types/esm/constants/sdk-version.d.ts +1 -1
  33. package/types/esm/functions/evaluate/evaluate.d.ts +3 -1
  34. package/types/esm/functions/evaluate/helpers.d.ts +1 -0
  35. package/lib/browser/USE_CLIENT_BUNDLE-e0428aec.cjs +0 -21
  36. package/lib/browser/bundle-0de8b96d.cjs +0 -168
  37. package/lib/edge/USE_CLIENT_BUNDLE-1ce5de06.cjs +0 -21
  38. package/lib/node/USE_CLIENT_BUNDLE-07b10dcb.cjs +0 -21
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { LRUCache } from "lru-cache";
4
- import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-22e26b2f.js";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-04e65a8b.js";
5
5
  import "next/navigation";
6
6
  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()), TARGET = "rsc", getClassPropName = () => {
7
7
  switch (TARGET) {
@@ -130,7 +130,7 @@ function flattenState({
130
130
  if (t && r in t)
131
131
  return t[r];
132
132
  const i = o[r];
133
- return typeof i == "object" ? flattenState({
133
+ return typeof i == "object" && i !== null ? flattenState({
134
134
  rootState: i,
135
135
  localState: void 0,
136
136
  rootSetState: n ? (a) => {
@@ -220,34 +220,34 @@ output;
220
220
  const s = safeDynamicRequire("isolated-vm"), c = fastClone({
221
221
  ...a,
222
222
  ...r
223
- }), u = getFunctionArguments({
223
+ }), d = getFunctionArguments({
224
224
  builder: t,
225
225
  context: n,
226
226
  event: o,
227
227
  state: c
228
- }), h = getIsolateContext(), m = h.global;
229
- m.setSync("global", m.derefInto()), m.setSync("log", function(...l) {
230
- console.log(...l);
231
- }), m.setSync(BUILDER_SET_STATE_NAME, function(l, d) {
232
- set(a, l, d), i == null || i(a);
233
- }), u.forEach(([l, d]) => {
234
- const b = typeof d == "object" ? new s.Reference(
228
+ }), g = getIsolateContext(), l = g.global;
229
+ l.setSync("global", l.derefInto()), l.setSync("log", function(...m) {
230
+ console.log(...m);
231
+ }), l.setSync(BUILDER_SET_STATE_NAME, function(m, u) {
232
+ set(a, m, u), i == null || i(a);
233
+ }), d.forEach(([m, u]) => {
234
+ const b = typeof u == "object" ? new s.Reference(
235
235
  // workaround: methods with default values for arguments is not being cloned over
236
- l === "builder" ? {
237
- ...d,
238
- getUserAttributes: () => d.getUserAttributes()
239
- } : d
236
+ m === "builder" ? {
237
+ ...u,
238
+ getUserAttributes: () => u.getUserAttributes()
239
+ } : u
240
240
  ) : null;
241
- m.setSync(getSyncValName(l), b);
242
- }), m.setSync(INJECTED_IVM_GLOBAL, s);
241
+ l.setSync(getSyncValName(m), b);
242
+ }), l.setSync(INJECTED_IVM_GLOBAL, s);
243
243
  const f = processCode({
244
244
  code: e,
245
- args: u
246
- }), g = h.evalSync(f);
245
+ args: d
246
+ }), p = g.evalSync(f);
247
247
  try {
248
- return JSON.parse(g);
248
+ return JSON.parse(p);
249
249
  } catch {
250
- return g;
250
+ return p;
251
251
  }
252
252
  }, checkIsDefined = (e) => e != null;
253
253
  function isNodeRuntime() {
@@ -260,7 +260,27 @@ const shouldForceBrowserRuntimeInNode = () => {
260
260
  return !1;
261
261
  const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
262
262
  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;
263
- }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e);
263
+ }, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), _EvalCache = class v {
264
+ static getCacheKey(t) {
265
+ return JSON.stringify({
266
+ ...t,
267
+ // replace the event with a random number to break cache
268
+ // thats because we can't serialize the event object due to circular refs in DOM node refs.
269
+ event: t.event ? Math.random() : void 0
270
+ });
271
+ }
272
+ static getCachedValue(t) {
273
+ return v.cache.get(t);
274
+ }
275
+ static setCachedValue(t, n) {
276
+ v.cache.size > 20 && v.cache.delete(v.cache.keys().next().value), v.cache.set(t, {
277
+ value: n
278
+ });
279
+ }
280
+ };
281
+ _EvalCache.cacheLimit = 20;
282
+ _EvalCache.cache = /* @__PURE__ */ new Map();
283
+ let EvalCache = _EvalCache;
264
284
  function evaluate({
265
285
  code: e,
266
286
  context: t,
@@ -268,13 +288,14 @@ function evaluate({
268
288
  rootState: o,
269
289
  rootSetState: r,
270
290
  event: i,
271
- isExpression: a = !0
291
+ isExpression: a = !0,
292
+ enableCache: s
272
293
  }) {
273
294
  if (e === "") {
274
295
  logger.warn("Skipping evaluation of empty code block.");
275
296
  return;
276
297
  }
277
- const s = {
298
+ const c = {
278
299
  code: parseCode(e, {
279
300
  isExpression: a
280
301
  }),
@@ -285,10 +306,20 @@ function evaluate({
285
306
  rootState: o,
286
307
  localState: n
287
308
  };
309
+ if (s) {
310
+ const d = EvalCache.getCacheKey(c), g = EvalCache.getCachedValue(d);
311
+ if (g)
312
+ return g.value;
313
+ }
288
314
  try {
289
- return chooseBrowserOrServerEval(s);
290
- } catch (c) {
291
- logger.error("Failed code evaluation: " + c.message, {
315
+ const d = chooseBrowserOrServerEval(c);
316
+ if (s) {
317
+ const g = EvalCache.getCacheKey(c);
318
+ EvalCache.setCachedValue(g, d);
319
+ }
320
+ return d;
321
+ } catch (d) {
322
+ logger.error("Failed code evaluation: " + d.message, {
292
323
  code: e
293
324
  });
294
325
  return;
@@ -316,14 +347,15 @@ const evaluateBindings = ({
316
347
  }
317
348
  };
318
349
  for (const s in e.bindings) {
319
- const c = e.bindings[s], u = evaluate({
350
+ const c = e.bindings[s], d = evaluate({
320
351
  code: c,
321
352
  localState: n,
322
353
  rootState: o,
323
354
  rootSetState: r,
324
- context: t
355
+ context: t,
356
+ enableCache: !0
325
357
  });
326
- set(a, s, u);
358
+ set(a, s, d);
327
359
  }
328
360
  return a;
329
361
  };
@@ -344,6 +376,48 @@ function getProcessedBlock({
344
376
  context: t
345
377
  }) : a;
346
378
  }
379
+ const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
380
+ if (typeof o == "string")
381
+ return `${camelToKebabCase(n)}: ${o};`;
382
+ }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
383
+ `), createCssClass = ({
384
+ mediaQuery: e,
385
+ className: t,
386
+ styles: n
387
+ }) => {
388
+ const o = `.${t} {
389
+ ${convertStyleMapToCSS(n)}
390
+ }`;
391
+ return e ? `${e} {
392
+ ${o}
393
+ }` : o;
394
+ };
395
+ function transformStyleProperty({
396
+ style: e
397
+ }) {
398
+ return e;
399
+ }
400
+ const getStyle = ({
401
+ block: e,
402
+ context: t
403
+ }) => mapStyleObjToStrIfNeeded(transformStyleProperty({
404
+ style: e.style || {},
405
+ context: t,
406
+ block: e
407
+ }));
408
+ function mapStyleObjToStrIfNeeded(e) {
409
+ switch (TARGET) {
410
+ case "svelte":
411
+ case "vue":
412
+ case "solid":
413
+ return convertStyleMapToCSSArray(e).join(" ");
414
+ case "qwik":
415
+ case "reactNative":
416
+ case "react":
417
+ case "rsc":
418
+ return e;
419
+ }
420
+ }
347
421
  const getComponent = ({
348
422
  block: e,
349
423
  context: t,
@@ -381,20 +455,21 @@ const getComponent = ({
381
455
  localState: t.localState,
382
456
  rootState: t.rootState,
383
457
  rootSetState: t.rootSetState,
384
- context: t.context
458
+ context: t.context,
459
+ enableCache: !0
385
460
  });
386
461
  if (!Array.isArray(r))
387
462
  return;
388
463
  const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
389
- return r.map((c, u) => ({
464
+ return r.map((c, d) => ({
390
465
  context: {
391
466
  ...t,
392
467
  localState: {
393
468
  ...t.localState,
394
- $index: u,
469
+ $index: d,
395
470
  $item: c,
396
471
  [a]: c,
397
- [`$${a}Index`]: u
472
+ [`$${a}Index`]: d
398
473
  }
399
474
  },
400
475
  block: o
@@ -441,21 +516,6 @@ const getComponent = ({
441
516
  min: i,
442
517
  default: i + 1
443
518
  }, n;
444
- }, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
445
- if (typeof o == "string")
446
- return `${camelToKebabCase(n)}: ${o};`;
447
- }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
448
- `), createCssClass = ({
449
- mediaQuery: e,
450
- className: t,
451
- styles: n
452
- }) => {
453
- const o = `.${t} {
454
- ${convertStyleMapToCSS(n)}
455
- }`;
456
- return e ? `${e} {
457
- ${o}
458
- }` : o;
459
519
  };
460
520
  function InlinedStyles(e) {
461
521
  return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
@@ -472,7 +532,7 @@ function BlockStyles(e) {
472
532
  });
473
533
  return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
474
534
  }, n = function() {
475
- var d;
535
+ var u;
476
536
  const r = getProcessedBlock({
477
537
  block: e.block,
478
538
  localState: e.context.localState,
@@ -481,29 +541,29 @@ function BlockStyles(e) {
481
541
  context: e.context.context,
482
542
  shouldEvaluateBindings: !0
483
543
  }), i = r.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
484
- ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
485
- ), c = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, h = i == null ? void 0 : i.small, m = r.id;
486
- if (!m)
544
+ ((u = a == null ? void 0 : a.meta) == null ? void 0 : u.breakpoints) || {}
545
+ ), c = i == null ? void 0 : i.large, d = i == null ? void 0 : i.medium, g = i == null ? void 0 : i.small, l = r.id;
546
+ if (!l)
487
547
  return "";
488
548
  const f = c ? createCssClass({
489
- className: m,
549
+ className: l,
490
550
  styles: c
491
- }) : "", g = u ? createCssClass({
492
- className: m,
493
- styles: u,
551
+ }) : "", p = d ? createCssClass({
552
+ className: l,
553
+ styles: d,
494
554
  mediaQuery: getMaxWidthQueryForSize(
495
555
  "medium",
496
556
  s
497
557
  )
498
- }) : "", l = h ? createCssClass({
499
- className: m,
500
- styles: h,
558
+ }) : "", m = g ? createCssClass({
559
+ className: l,
560
+ styles: g,
501
561
  mediaQuery: getMaxWidthQueryForSize(
502
562
  "small",
503
563
  s
504
564
  )
505
565
  }) : "";
506
- return [f, g, l].join(" ");
566
+ return [f, p, m].join(" ");
507
567
  };
508
568
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
509
569
  }
@@ -517,7 +577,8 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
517
577
  rootState: t.rootState,
518
578
  rootSetState: t.rootSetState,
519
579
  event: n,
520
- isExpression: !1
580
+ isExpression: !1,
581
+ enableCache: !0
521
582
  });
522
583
  function getBlockActions(e) {
523
584
  const t = {}, n = e.block.actions ?? {};
@@ -539,32 +600,6 @@ function getBlockActions(e) {
539
600
  }
540
601
  return t;
541
602
  }
542
- function transformStyleProperty({
543
- style: e
544
- }) {
545
- return e;
546
- }
547
- const getStyle = ({
548
- block: e,
549
- context: t
550
- }) => mapStyleObjToStrIfNeeded(transformStyleProperty({
551
- style: e.style || {},
552
- context: t,
553
- block: e
554
- }));
555
- function mapStyleObjToStrIfNeeded(e) {
556
- switch (TARGET) {
557
- case "svelte":
558
- case "vue":
559
- case "solid":
560
- return convertStyleMapToCSSArray(e).join(" ");
561
- case "qwik":
562
- case "reactNative":
563
- case "react":
564
- case "rsc":
565
- return e;
566
- }
567
- }
568
603
  function transformBlockProperties({
569
604
  properties: e
570
605
  }) {
@@ -666,7 +701,7 @@ function RepeatedBlock(e) {
666
701
  );
667
702
  }
668
703
  function Block(e) {
669
- var u, h, m;
704
+ var c, d, g;
670
705
  const t = function() {
671
706
  return getComponent({
672
707
  block: e.block,
@@ -679,8 +714,8 @@ function Block(e) {
679
714
  context: e.context
680
715
  });
681
716
  }, o = function() {
682
- var g;
683
- return (g = e.block.repeat) != null && g.collection ? e.block : getProcessedBlock({
717
+ var f;
718
+ return (f = e.block.repeat) != null && f.collection ? e.block : getProcessedBlock({
684
719
  block: e.block,
685
720
  localState: e.context.localState,
686
721
  rootState: e.context.rootState,
@@ -689,43 +724,43 @@ function Block(e) {
689
724
  shouldEvaluateBindings: !0
690
725
  });
691
726
  }, r = function() {
692
- var l;
693
- return e.block.tagName === "a" || ((l = o().properties) == null ? void 0 : l.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
727
+ var p;
728
+ return e.block.tagName === "a" || ((p = o().properties) == null ? void 0 : p.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
694
729
  }, i = function() {
695
- var d, b;
696
- if ((d = e.block.repeat) != null && d.collection)
697
- return !!((b = n()) != null && b.length);
698
- const g = "hide" in o() ? o().hide : !1;
699
- return ("show" in o() ? o().show : !0) && !g;
730
+ var m, u;
731
+ if ((m = e.block.repeat) != null && m.collection)
732
+ return !!((u = n()) != null && u.length);
733
+ const f = "hide" in o() ? o().hide : !1;
734
+ return ("show" in o() ? o().show : !0) && !f;
700
735
  }, a = function() {
701
- var l;
702
- return !((l = t()) != null && l.component) && !n() ? o().children ?? [] : [];
736
+ var p;
737
+ return !((p = t()) != null && p.component) && !n() ? o().children ?? [] : [];
703
738
  }, s = function() {
704
- var g, l, d, b, p, S, k, y, C, x;
739
+ var f, p, m, u, b, h, S, k, y, C;
705
740
  return {
706
741
  blockChildren: o().children ?? [],
707
- componentRef: (g = t()) == null ? void 0 : g.component,
742
+ componentRef: (f = t()) == null ? void 0 : f.component,
708
743
  componentOptions: {
709
744
  ...getBlockComponentOptions(o()),
710
745
  builderContext: e.context,
711
- ...((l = t()) == null ? void 0 : l.name) === "Core:Button" || ((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" || ((p = t()) == null ? void 0 : p.name) === "Form:Form" ? {
746
+ ...((p = t()) == null ? void 0 : p.name) === "Core:Button" || ((m = t()) == null ? void 0 : m.name) === "Symbol" || ((u = t()) == null ? void 0 : u.name) === "Columns" || ((b = t()) == null ? void 0 : b.name) === "Form:Form" ? {
712
747
  builderLinkComponent: e.linkComponent
713
748
  } : {},
714
- ...((S = t()) == null ? void 0 : S.name) === "Symbol" || ((k = t()) == null ? void 0 : k.name) === "Columns" || ((y = t()) == null ? void 0 : y.name) === "Form:Form" ? {
749
+ ...((h = t()) == null ? void 0 : h.name) === "Symbol" || ((S = t()) == null ? void 0 : S.name) === "Columns" || ((k = t()) == null ? void 0 : k.name) === "Form:Form" ? {
715
750
  builderComponents: e.registeredComponents
716
751
  } : {}
717
752
  },
718
- context: c,
753
+ context: e.context,
719
754
  linkComponent: e.linkComponent,
720
755
  registeredComponents: e.registeredComponents,
721
756
  builderBlock: o(),
722
- includeBlockProps: ((C = t()) == null ? void 0 : C.noWrap) === !0,
723
- isInteractive: !((x = t()) != null && x.isRSC)
757
+ includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
758
+ isInteractive: !((C = t()) != null && C.isRSC)
724
759
  };
725
- }, c = e.context;
760
+ };
726
761
  return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsxs(Fragment, { children: [
727
762
  /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
728
- (u = t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
763
+ (c = t()) != null && c.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
729
764
  ComponentRef,
730
765
  {
731
766
  componentRef: s().componentRef,
@@ -738,16 +773,16 @@ function Block(e) {
738
773
  includeBlockProps: s().includeBlockProps,
739
774
  isInteractive: s().isInteractive
740
775
  }
741
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (m = n()) == null ? void 0 : m.map((f, g) => /* @__PURE__ */ jsx(
776
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((l, f) => /* @__PURE__ */ jsx(
742
777
  RepeatedBlock,
743
778
  {
744
- repeatContext: f.context,
745
- block: f.block,
779
+ repeatContext: l.context,
780
+ block: l.block,
746
781
  registeredComponents: e.registeredComponents,
747
782
  linkComponent: e.linkComponent
748
783
  },
749
- g
750
- )) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
784
+ f
785
+ )) }) : /* @__PURE__ */ jsxs(
751
786
  BlockWrapper,
752
787
  {
753
788
  Wrapper: r(),
@@ -769,19 +804,19 @@ function Block(e) {
769
804
  isInteractive: s().isInteractive
770
805
  }
771
806
  ),
772
- (h = a()) == null ? void 0 : h.map((f) => /* @__PURE__ */ jsx(
807
+ (d = a()) == null ? void 0 : d.map((l) => /* @__PURE__ */ jsx(
773
808
  Block,
774
809
  {
775
- block: f,
776
- context: c,
810
+ block: l,
777
811
  registeredComponents: e.registeredComponents,
778
- linkComponent: e.linkComponent
812
+ linkComponent: e.linkComponent,
813
+ context: e.context
779
814
  },
780
- f.id
815
+ l.id
781
816
  ))
782
817
  ]
783
818
  }
784
- ) }) })
819
+ ) })
785
820
  ] }) : null });
786
821
  }
787
822
  function Blocks(e) {
@@ -809,24 +844,24 @@ function Blocks(e) {
809
844
  );
810
845
  }
811
846
  function Columns(e) {
812
- var g;
813
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(d) {
847
+ var p;
848
+ const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(u) {
814
849
  var b;
815
- return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
816
- }, i = function(d) {
850
+ return ((b = n[u]) == null ? void 0 : b.width) || 100 / n.length;
851
+ }, i = function(u) {
817
852
  const b = t * (n.length - 1) / n.length;
818
- return `calc(${r(d)}% - ${b}px)`;
853
+ return `calc(${r(u)}% - ${b}px)`;
819
854
  }, a = function({
820
- stackedStyle: d,
855
+ stackedStyle: u,
821
856
  desktopStyle: b
822
857
  }) {
823
- return o === "tablet" ? d : b;
858
+ return o === "tablet" ? u : b;
824
859
  }, s = function({
825
- stackedStyle: d,
860
+ stackedStyle: u,
826
861
  desktopStyle: b
827
862
  }) {
828
- return o === "never" ? b : d;
829
- }, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
863
+ return o === "never" ? b : u;
864
+ }, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", d = function() {
830
865
  return {
831
866
  "--flex-dir": c,
832
867
  "--flex-dir-tablet": a({
@@ -834,19 +869,19 @@ function Columns(e) {
834
869
  desktopStyle: "row"
835
870
  })
836
871
  };
837
- }, h = function(d) {
838
- const b = d === 0 ? 0 : t, p = i(d), S = `${b}px`, k = "100%", y = 0;
872
+ }, g = function(u) {
873
+ const b = u === 0 ? 0 : t, h = i(u), S = `${b}px`, k = "100%", y = 0;
839
874
  return {
840
875
  ...{
841
876
  display: "flex",
842
877
  flexDirection: "column",
843
878
  alignItems: "stretch"
844
879
  },
845
- width: p,
880
+ width: h,
846
881
  ["marginLeft"]: S,
847
882
  "--column-width-mobile": s({
848
883
  stackedStyle: k,
849
- desktopStyle: p
884
+ desktopStyle: h
850
885
  }),
851
886
  "--column-margin-left-mobile": s({
852
887
  stackedStyle: y,
@@ -854,21 +889,21 @@ function Columns(e) {
854
889
  }),
855
890
  "--column-width-tablet": a({
856
891
  stackedStyle: k,
857
- desktopStyle: p
892
+ desktopStyle: h
858
893
  }),
859
894
  "--column-margin-left-tablet": a({
860
895
  stackedStyle: y,
861
896
  desktopStyle: S
862
897
  })
863
898
  };
864
- }, m = function(d) {
865
- var p, S;
899
+ }, l = function(u) {
900
+ var h, S;
866
901
  return getSizesForBreakpoints(
867
- ((S = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : S.breakpoints) || {}
868
- )[d].max;
902
+ ((S = (h = e.builderContext.content) == null ? void 0 : h.meta) == null ? void 0 : S.breakpoints) || {}
903
+ )[u].max;
869
904
  }, f = function() {
870
905
  return `
871
- @media (max-width: ${m("medium")}px) {
906
+ @media (max-width: ${l("medium")}px) {
872
907
  .${e.builderBlock.id}-breakpoints {
873
908
  flex-direction: var(--flex-dir-tablet);
874
909
  align-items: stretch;
@@ -880,7 +915,7 @@ function Columns(e) {
880
915
  }
881
916
  }
882
917
 
883
- @media (max-width: ${m("small")}px) {
918
+ @media (max-width: ${l("small")}px) {
884
919
  .${e.builderBlock.id}-breakpoints {
885
920
  flex-direction: var(--flex-dir);
886
921
  align-items: stretch;
@@ -897,26 +932,26 @@ function Columns(e) {
897
932
  /* @__PURE__ */ jsxs(
898
933
  "div",
899
934
  {
900
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-1f78b21c`,
901
- style: u(),
935
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-7e6263b2`,
936
+ style: d(),
902
937
  children: [
903
- /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: f() }) }),
904
- (g = e.columns) == null ? void 0 : g.map((l, d) => /* @__PURE__ */ jsx(
938
+ /* @__PURE__ */ jsx(InlinedStyles, { styles: f() }),
939
+ (p = e.columns) == null ? void 0 : p.map((m, u) => /* @__PURE__ */ jsx(
905
940
  DynamicRenderer,
906
941
  {
907
- TagName: l.link ? e.builderLinkComponent || "a" : "div",
942
+ TagName: m.link ? e.builderLinkComponent || "a" : "div",
908
943
  actionAttributes: {},
909
944
  attributes: {
910
- ...l.link ? {
911
- href: l.link
945
+ ...m.link ? {
946
+ href: m.link
912
947
  } : {},
913
948
  [getClassPropName()]: "builder-column",
914
- style: mapStyleObjToStrIfNeeded(h(d))
949
+ style: mapStyleObjToStrIfNeeded(g(u))
915
950
  },
916
951
  children: /* @__PURE__ */ jsx(
917
952
  Blocks,
918
953
  {
919
- path: `component.options.columns.${d}.blocks`,
954
+ path: `component.options.columns.${u}.blocks`,
920
955
  parent: e.builderBlock.id,
921
956
  styleProp: {
922
957
  flexGrow: "1"
@@ -924,16 +959,16 @@ function Columns(e) {
924
959
  context: e.builderContext,
925
960
  registeredComponents: e.builderComponents,
926
961
  linkComponent: e.builderLinkComponent,
927
- blocks: l.blocks
962
+ blocks: m.blocks
928
963
  }
929
964
  )
930
965
  },
931
- d
966
+ u
932
967
  ))
933
968
  ]
934
969
  }
935
970
  ),
936
- /* @__PURE__ */ jsx("style", { children: `.div-1f78b21c {
971
+ /* @__PURE__ */ jsx("style", { children: `.div-7e6263b2 {
937
972
  display: flex;
938
973
  line-height: normal;
939
974
  }` })
@@ -1365,15 +1400,15 @@ const getTopLevelDomain = (e) => {
1365
1400
  onChange: (e) => {
1366
1401
  e.delete("srcset"), e.delete("noWebp");
1367
1402
  function n(a, s = 6e4) {
1368
- return new Promise((c, u) => {
1369
- const h = document.createElement("img");
1370
- let m = !1;
1371
- h.onload = () => {
1372
- m = !0, c(h);
1373
- }, h.addEventListener("error", (f) => {
1374
- console.warn("Image load failed", f.error), u(f.error);
1375
- }), h.src = a, setTimeout(() => {
1376
- m || u(new Error("Image load timed out"));
1403
+ return new Promise((c, d) => {
1404
+ const g = document.createElement("img");
1405
+ let l = !1;
1406
+ g.onload = () => {
1407
+ l = !0, c(g);
1408
+ }, g.addEventListener("error", (f) => {
1409
+ console.warn("Image load failed", f.error), d(f.error);
1410
+ }), g.src = a, setTimeout(() => {
1411
+ l || d(new Error("Image load timed out"));
1377
1412
  }, s);
1378
1413
  });
1379
1414
  }
@@ -1960,40 +1995,40 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
1960
1995
  enrich: a,
1961
1996
  locale: s,
1962
1997
  apiVersion: c = DEFAULT_API_VERSION,
1963
- fields: u,
1964
- omit: h,
1965
- offset: m,
1998
+ fields: d,
1999
+ omit: g,
2000
+ offset: l,
1966
2001
  cacheSeconds: f,
1967
- staleCacheSeconds: g,
1968
- sort: l,
1969
- includeUnpublished: d
2002
+ staleCacheSeconds: p,
2003
+ sort: m,
2004
+ includeUnpublished: u
1970
2005
  } = e;
1971
2006
  if (!i)
1972
2007
  throw new Error("Missing API key");
1973
2008
  if (!["v3"].includes(c))
1974
2009
  throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
1975
- const b = t !== 1, p = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
1976
- if (p.searchParams.set("apiKey", i), p.searchParams.set("limit", String(t)), p.searchParams.set("noTraverse", String(b)), p.searchParams.set("includeRefs", String(!0)), s && p.searchParams.set("locale", s), a && p.searchParams.set("enrich", String(a)), p.searchParams.set("omit", h || "meta.componentsUsed"), u && p.searchParams.set("fields", u), Number.isFinite(m) && m > -1 && p.searchParams.set("offset", String(Math.floor(m))), typeof d == "boolean" && p.searchParams.set("includeUnpublished", String(d)), f && isPositiveNumber(f) && p.searchParams.set("cacheSeconds", String(f)), g && isPositiveNumber(g) && p.searchParams.set("staleCacheSeconds", String(g)), l) {
2010
+ const b = t !== 1, h = new URL(`https://cdn.builder.io/api/${c}/content/${r}`);
2011
+ if (h.searchParams.set("apiKey", i), h.searchParams.set("limit", String(t)), h.searchParams.set("noTraverse", String(b)), h.searchParams.set("includeRefs", String(!0)), s && h.searchParams.set("locale", s), a && h.searchParams.set("enrich", String(a)), h.searchParams.set("omit", g || "meta.componentsUsed"), d && h.searchParams.set("fields", d), Number.isFinite(l) && l > -1 && h.searchParams.set("offset", String(Math.floor(l))), typeof u == "boolean" && h.searchParams.set("includeUnpublished", String(u)), f && isPositiveNumber(f) && h.searchParams.set("cacheSeconds", String(f)), p && isPositiveNumber(p) && h.searchParams.set("staleCacheSeconds", String(p)), m) {
1977
2012
  const y = flatten({
1978
- sort: l
2013
+ sort: m
1979
2014
  });
1980
2015
  for (const C in y)
1981
- p.searchParams.set(C, JSON.stringify(y[C]));
2016
+ h.searchParams.set(C, JSON.stringify(y[C]));
1982
2017
  }
1983
2018
  const S = {
1984
2019
  ...getBuilderSearchParamsFromWindow(),
1985
2020
  ...normalizeSearchParams(e.options || {})
1986
2021
  }, k = flatten(S);
1987
2022
  for (const y in k)
1988
- p.searchParams.set(y, String(k[y]));
1989
- if (n && p.searchParams.set("userAttributes", JSON.stringify(n)), o) {
2023
+ h.searchParams.set(y, String(k[y]));
2024
+ if (n && h.searchParams.set("userAttributes", JSON.stringify(n)), o) {
1990
2025
  const y = flatten({
1991
2026
  query: o
1992
2027
  });
1993
2028
  for (const C in y)
1994
- p.searchParams.set(C, JSON.stringify(y[C]));
2029
+ h.searchParams.set(C, JSON.stringify(y[C]));
1995
2030
  }
1996
- return p;
2031
+ return h;
1997
2032
  }, checkContentHasResults = (e) => "results" in e;
1998
2033
  async function fetchOneEntry(e) {
1999
2034
  const t = await fetchEntries({
@@ -2237,7 +2272,7 @@ function isFromTrustedHost(e, t) {
2237
2272
  const n = new URL(t.origin), o = n.hostname;
2238
2273
  return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
2239
2274
  }
2240
- const SDK_VERSION = "0.14.6", registry = {};
2275
+ const SDK_VERSION = "0.14.7", registry = {};
2241
2276
  function register(e, t) {
2242
2277
  let n = registry[e];
2243
2278
  if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
@@ -2307,33 +2342,33 @@ const setupBrowserForEditing = (e = {}) => {
2307
2342
  if (r != null && r.type)
2308
2343
  switch (r.type) {
2309
2344
  case "builder.evaluate": {
2310
- const s = r.data.text, c = r.data.arguments || [], u = r.data.id, h = new Function(s);
2311
- let m, f = null;
2345
+ const s = r.data.text, c = r.data.arguments || [], d = r.data.id, g = new Function(s);
2346
+ let l, f = null;
2312
2347
  try {
2313
- m = h.apply(null, c);
2314
- } catch (g) {
2315
- f = g;
2348
+ l = g.apply(null, c);
2349
+ } catch (p) {
2350
+ f = p;
2316
2351
  }
2317
2352
  f ? (i = window.parent) == null || i.postMessage({
2318
2353
  type: "builder.evaluateError",
2319
2354
  data: {
2320
- id: u,
2355
+ id: d,
2321
2356
  error: f.message
2322
2357
  }
2323
- }, "*") : m && typeof m.then == "function" ? m.then((g) => {
2324
- var l;
2325
- (l = window.parent) == null || l.postMessage({
2358
+ }, "*") : l && typeof l.then == "function" ? l.then((p) => {
2359
+ var m;
2360
+ (m = window.parent) == null || m.postMessage({
2326
2361
  type: "builder.evaluateResult",
2327
2362
  data: {
2328
- id: u,
2329
- result: g
2363
+ id: d,
2364
+ result: p
2330
2365
  }
2331
2366
  }, "*");
2332
2367
  }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2333
2368
  type: "builder.evaluateResult",
2334
2369
  data: {
2335
- result: m,
2336
- id: u
2370
+ result: l,
2371
+ id: d
2337
2372
  }
2338
2373
  }, "*");
2339
2374
  break;
@@ -2520,7 +2555,7 @@ const getRootStateInitialValue = ({
2520
2555
  meta: e == null ? void 0 : e.meta
2521
2556
  } : void 0;
2522
2557
  function ContentComponent(e) {
2523
- var r, i, a, s, c, u, h, m, f;
2558
+ var r, i, a, s, c, d, g, l, f;
2524
2559
  const t = getUpdateVariantVisibilityScript({
2525
2560
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2526
2561
  variationId: (r = e.content) == null ? void 0 : r.testVariationId,
@@ -2530,11 +2565,11 @@ function ContentComponent(e) {
2530
2565
  ...getDefaultRegisteredComponents(),
2531
2566
  ...e.customComponents || []
2532
2567
  ].reduce(
2533
- (g, { component: l, ...d }) => ({
2534
- ...g,
2535
- [d.name]: {
2536
- component: l,
2537
- ...serializeComponentInfo(d)
2568
+ (p, { component: m, ...u }) => ({
2569
+ ...p,
2570
+ [u.name]: {
2571
+ component: m,
2572
+ ...serializeComponentInfo(u)
2538
2573
  }
2539
2574
  }),
2540
2575
  {}
@@ -2557,9 +2592,9 @@ function ContentComponent(e) {
2557
2592
  ...getDefaultRegisteredComponents(),
2558
2593
  ...e.customComponents || []
2559
2594
  ].reduce(
2560
- (g, { component: l, ...d }) => ({
2561
- ...g,
2562
- [d.name]: serializeComponentInfo(d)
2595
+ (p, { component: m, ...u }) => ({
2596
+ ...p,
2597
+ [u.name]: serializeComponentInfo(u)
2563
2598
  }),
2564
2599
  {}
2565
2600
  ),
@@ -2585,19 +2620,19 @@ function ContentComponent(e) {
2585
2620
  linkComponent: e.linkComponent,
2586
2621
  trustedHosts: e.trustedHosts,
2587
2622
  children: [
2588
- e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2589
- /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2623
+ e.isSsrAbTest ? /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) : null,
2624
+ /* @__PURE__ */ jsx(
2590
2625
  ContentStyles,
2591
2626
  {
2592
2627
  contentId: (a = o.content) == null ? void 0 : a.id,
2593
2628
  cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2594
- customFonts: (h = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : h.customFonts
2629
+ customFonts: (g = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : g.customFonts
2595
2630
  }
2596
- ) }),
2631
+ ),
2597
2632
  /* @__PURE__ */ jsx(
2598
2633
  Blocks,
2599
2634
  {
2600
- blocks: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.blocks,
2635
+ blocks: (f = (l = o.content) == null ? void 0 : l.data) == null ? void 0 : f.blocks,
2601
2636
  context: o,
2602
2637
  registeredComponents: n,
2603
2638
  linkComponent: e.linkComponent
@@ -2615,9 +2650,9 @@ function ContentVariants(e) {
2615
2650
  }), n = function() {
2616
2651
  var c;
2617
2652
  return getUpdateCookieAndStylesScript(
2618
- getVariants(e.content).map((u) => ({
2619
- id: u.testVariationId,
2620
- testRatio: u.testRatio
2653
+ getVariants(e.content).map((d) => ({
2654
+ id: d.testVariationId,
2655
+ testRatio: d.testRatio
2621
2656
  })),
2622
2657
  ((c = e.content) == null ? void 0 : c.id) || ""
2623
2658
  );
@@ -2634,7 +2669,7 @@ function ContentVariants(e) {
2634
2669
  });
2635
2670
  };
2636
2671
  return /* @__PURE__ */ jsxs(Fragment, { children: [
2637
- !e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
2672
+ !e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) : null,
2638
2673
  t ? /* @__PURE__ */ jsxs(Fragment, { children: [
2639
2674
  /* @__PURE__ */ jsx(
2640
2675
  InlinedStyles,
@@ -2716,12 +2751,12 @@ const fetchSymbolContent = async ({
2716
2751
  async function Symbol$1(e) {
2717
2752
  var o, r, i, a, s;
2718
2753
  const t = function() {
2719
- var u, h;
2754
+ var d, g;
2720
2755
  return [
2721
2756
  e.attributes[getClassPropName()],
2722
2757
  "builder-symbol",
2723
- (u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
2724
- (h = e.symbol) != null && h.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2758
+ (d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
2759
+ (g = e.symbol) != null && g.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2725
2760
  ].filter(Boolean).join(" ");
2726
2761
  }, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
2727
2762
  symbol: e.symbol,