@builder.io/sdk-react 0.12.0 → 0.12.2

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.
@@ -79,26 +79,26 @@ const getFunctionArguments = ({
79
79
  context: n,
80
80
  event: i,
81
81
  localState: o,
82
- rootSetState: a,
83
- rootState: r
82
+ rootSetState: r,
83
+ rootState: a
84
84
  }) => {
85
- const l = getFunctionArguments({
85
+ const c = getFunctionArguments({
86
86
  builder: t,
87
87
  context: n,
88
88
  event: i,
89
- state: flattenState(r, o, a)
89
+ state: flattenState(a, o, r)
90
90
  });
91
- return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
91
+ return new Function(...c.map(([s]) => s), e)(...c.map(([, s]) => s));
92
92
  };
93
93
  function flattenState(e, t, n) {
94
94
  if (e === t)
95
95
  throw new Error("rootState === localState");
96
96
  return new Proxy(e, {
97
97
  get: (i, o) => t && o in t ? t[o] : e[o],
98
- set: (i, o, a) => {
98
+ set: (i, o, r) => {
99
99
  if (t && o in t)
100
100
  throw new Error("Writing to local state is not allowed as it is read-only.");
101
- return e[o] = a, n == null || n(e), !0;
101
+ return e[o] = r, n == null || n(e), !0;
102
102
  }
103
103
  });
104
104
  }
@@ -106,7 +106,7 @@ const set = (e, t, n) => {
106
106
  if (Object(e) !== e)
107
107
  return e;
108
108
  const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
109
- return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
109
+ return i.slice(0, -1).reduce((o, r, a) => Object(o[r]) === o[r] ? o[r] : o[r] = Math.abs(Number(i[a + 1])) >> 0 === +i[a + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
110
110
  }, noop = () => {
111
111
  };
112
112
  let safeDynamicRequire = noop;
@@ -172,40 +172,40 @@ output;
172
172
  context: n,
173
173
  event: i,
174
174
  localState: o,
175
- rootSetState: a,
176
- rootState: r
175
+ rootSetState: r,
176
+ rootState: a
177
177
  }) => {
178
- const l = fastClone({
179
- ...r,
178
+ const c = fastClone({
179
+ ...a,
180
180
  ...o
181
- }), c = getFunctionArguments({
181
+ }), s = getFunctionArguments({
182
182
  builder: t,
183
183
  context: n,
184
184
  event: i,
185
- state: l
186
- }), s = getIsolateContext(), d = s.global;
185
+ state: c
186
+ }), l = getIsolateContext(), d = l.global;
187
187
  d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
188
188
  console.log(...f);
189
- }), d.setSync(BUILDER_SET_STATE_NAME, function(f, S) {
190
- set(r, f, S), a == null || a(r);
191
- }), c.forEach(([f, S]) => {
192
- const y = typeof S == "object" ? new ivm.Reference(
189
+ }), d.setSync(BUILDER_SET_STATE_NAME, function(f, b) {
190
+ set(a, f, b), r == null || r(a);
191
+ }), s.forEach(([f, b]) => {
192
+ const y = typeof b == "object" ? new ivm.Reference(
193
193
  // workaround: methods with default values for arguments is not being cloned over
194
194
  f === "builder" ? {
195
- ...S,
196
- getUserAttributes: () => S.getUserAttributes()
197
- } : S
195
+ ...b,
196
+ getUserAttributes: () => b.getUserAttributes()
197
+ } : b
198
198
  ) : null;
199
199
  d.setSync(getSyncValName(f), y);
200
200
  }), d.setSync(INJECTED_IVM_GLOBAL, ivm);
201
201
  const g = processCode({
202
202
  code: e,
203
- args: c
204
- }), x = s.evalSync(g);
203
+ args: s
204
+ }), S = l.evalSync(g);
205
205
  try {
206
- return JSON.parse(x);
206
+ return JSON.parse(S);
207
207
  } catch {
208
- return x;
208
+ return S;
209
209
  }
210
210
  }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
211
211
  function evaluate({
@@ -214,28 +214,28 @@ function evaluate({
214
214
  localState: n,
215
215
  rootState: i,
216
216
  rootSetState: o,
217
- event: a,
218
- isExpression: r = !0
217
+ event: r,
218
+ isExpression: a = !0
219
219
  }) {
220
220
  if (e === "") {
221
221
  logger.warn("Skipping evaluation of empty code block.");
222
222
  return;
223
223
  }
224
- const l = {
224
+ const c = {
225
225
  code: parseCode(e, {
226
- isExpression: r
226
+ isExpression: a
227
227
  }),
228
228
  builder: getBuilderGlobals(),
229
229
  context: t,
230
- event: a,
230
+ event: r,
231
231
  rootSetState: o,
232
232
  rootState: i,
233
233
  localState: n
234
234
  };
235
235
  try {
236
- return chooseBrowserOrServerEval(l);
237
- } catch (c) {
238
- logger.error("Failed code evaluation: " + c.message, {
236
+ return chooseBrowserOrServerEval(c);
237
+ } catch (s) {
238
+ logger.error("Failed code evaluation: " + s.message, {
239
239
  code: e
240
240
  });
241
241
  return;
@@ -253,26 +253,26 @@ const evaluateBindings = ({
253
253
  }) => {
254
254
  if (!e.bindings)
255
255
  return e;
256
- const a = fastClone(e), r = {
257
- ...a,
256
+ const r = fastClone(e), a = {
257
+ ...r,
258
258
  properties: {
259
- ...a.properties
259
+ ...r.properties
260
260
  },
261
261
  actions: {
262
- ...a.actions
262
+ ...r.actions
263
263
  }
264
264
  };
265
- for (const l in e.bindings) {
266
- const c = e.bindings[l], s = evaluate({
267
- code: c,
265
+ for (const c in e.bindings) {
266
+ const s = e.bindings[c], l = evaluate({
267
+ code: s,
268
268
  localState: n,
269
269
  rootState: i,
270
270
  rootSetState: o,
271
271
  context: t
272
272
  });
273
- set(r, l, s);
273
+ set(a, c, l);
274
274
  }
275
- return r;
275
+ return a;
276
276
  };
277
277
  function getProcessedBlock({
278
278
  block: e,
@@ -280,31 +280,31 @@ function getProcessedBlock({
280
280
  shouldEvaluateBindings: n,
281
281
  localState: i,
282
282
  rootState: o,
283
- rootSetState: a
283
+ rootSetState: r
284
284
  }) {
285
- const r = e;
285
+ const a = e;
286
286
  return n ? evaluateBindings({
287
- block: r,
287
+ block: a,
288
288
  localState: i,
289
289
  rootState: o,
290
- rootSetState: a,
290
+ rootSetState: r,
291
291
  context: t
292
- }) : r;
292
+ }) : a;
293
293
  }
294
- const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
294
+ const getComponent = ({
295
295
  block: e,
296
296
  context: t,
297
297
  registeredComponents: n
298
298
  }) => {
299
- var a;
300
- const i = (a = getProcessedBlock({
299
+ var r;
300
+ const i = (r = getProcessedBlock({
301
301
  block: e,
302
302
  localState: t.localState,
303
303
  rootState: t.rootState,
304
304
  rootSetState: t.rootSetState,
305
305
  context: t.context,
306
306
  shouldEvaluateBindings: !1
307
- }).component) == null ? void 0 : a.name;
307
+ }).component) == null ? void 0 : r.name;
308
308
  if (!i)
309
309
  return null;
310
310
  const o = n[i];
@@ -332,16 +332,16 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
332
332
  });
333
333
  if (!Array.isArray(o))
334
334
  return;
335
- const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
336
- return o.map((c, s) => ({
335
+ const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
336
+ return o.map((s, l) => ({
337
337
  context: {
338
338
  ...t,
339
339
  localState: {
340
340
  ...t.localState,
341
- $index: s,
342
- $item: c,
343
- [r]: c,
344
- [`$${r}Index`]: s
341
+ $index: l,
342
+ $item: s,
343
+ [a]: s,
344
+ [`$${a}Index`]: l
345
345
  }
346
346
  },
347
347
  block: i
@@ -381,12 +381,12 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
381
381
  min: o,
382
382
  default: o + 1
383
383
  };
384
- const a = n.medium.max + 1;
384
+ const r = n.medium.max + 1;
385
385
  return n.large = {
386
386
  max: 2e3,
387
387
  // TODO: decide upper limit
388
- min: a,
389
- default: a + 1
388
+ min: r,
389
+ default: r + 1
390
390
  }, n;
391
391
  }, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
392
392
  if (typeof i == "string")
@@ -420,7 +420,7 @@ function BlockStyles(e) {
420
420
  return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
421
421
  }
422
422
  function n() {
423
- var S;
423
+ var b;
424
424
  const i = getProcessedBlock({
425
425
  block: e.block,
426
426
  localState: e.context.localState,
@@ -428,30 +428,30 @@ function BlockStyles(e) {
428
428
  rootSetState: e.context.rootSetState,
429
429
  context: e.context.context,
430
430
  shouldEvaluateBindings: !0
431
- }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
432
- ((S = a == null ? void 0 : a.meta) == null ? void 0 : S.breakpoints) || {}
433
- ), l = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
431
+ }), o = i.responsiveStyles, r = e.context.content, a = getSizesForBreakpoints(
432
+ ((b = r == null ? void 0 : r.meta) == null ? void 0 : b.breakpoints) || {}
433
+ ), c = o == null ? void 0 : o.large, s = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, d = i.id;
434
434
  if (!d)
435
435
  return "";
436
- const g = l ? createCssClass({
436
+ const g = c ? createCssClass({
437
437
  className: d,
438
- styles: l
439
- }) : "", x = c ? createCssClass({
438
+ styles: c
439
+ }) : "", S = s ? createCssClass({
440
440
  className: d,
441
- styles: c,
441
+ styles: s,
442
442
  mediaQuery: getMaxWidthQueryForSize(
443
443
  "medium",
444
- r
444
+ a
445
445
  )
446
- }) : "", f = s ? createCssClass({
446
+ }) : "", f = l ? createCssClass({
447
447
  className: d,
448
- styles: s,
448
+ styles: l,
449
449
  mediaQuery: getMaxWidthQueryForSize(
450
450
  "small",
451
- r
451
+ a
452
452
  )
453
453
  }) : "";
454
- return [g, x, f].join(" ");
454
+ return [g, S, f].join(" ");
455
455
  }
456
456
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
457
457
  }
@@ -473,18 +473,18 @@ function getBlockActions(e) {
473
473
  for (const o in n) {
474
474
  if (!n.hasOwnProperty(o))
475
475
  continue;
476
- const a = n[o];
477
- let r = getEventHandlerName(o);
476
+ const r = n[o];
477
+ let a = getEventHandlerName(o);
478
478
  if (e.stripPrefix)
479
479
  switch (TARGET) {
480
480
  case "vue":
481
- r = r.replace("v-on:", "");
481
+ a = a.replace("v-on:", "");
482
482
  break;
483
483
  case "svelte":
484
- r = r.replace("on:", "");
484
+ a = a.replace("on:", "");
485
485
  break;
486
486
  }
487
- t[r] = createEventHandler(a, e);
487
+ t[a] = createEventHandler(r, e);
488
488
  }
489
489
  return t;
490
490
  }
@@ -527,49 +527,30 @@ function getStyleAttribute(e) {
527
527
  return e;
528
528
  }
529
529
  }
530
+ 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());
531
+ function DynamicRenderer(e) {
532
+ return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
533
+ }
530
534
  function BlockWrapper(e) {
531
- return /* @__PURE__ */ jsxs(Fragment, { children: [
532
- " ",
533
- e.hasChildren ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
534
- e.Wrapper,
535
- {
536
- ...getBlockProperties({
537
- block: e.block,
538
- context: e.context
539
- }),
540
- ...getBlockActions({
541
- block: e.block,
542
- rootState: e.context.rootState,
543
- rootSetState: e.context.rootSetState,
544
- localState: e.context.localState,
545
- context: e.context.context,
546
- stripPrefix: !0
547
- }),
548
- children: [
549
- " ",
550
- e.children,
551
- " "
552
- ]
553
- }
554
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
555
- e.Wrapper,
556
- {
557
- ...getBlockProperties({
558
- block: e.block,
559
- context: e.context
560
- }),
561
- ...getBlockActions({
562
- block: e.block,
563
- rootState: e.context.rootState,
564
- rootSetState: e.context.rootSetState,
565
- localState: e.context.localState,
566
- context: e.context.context,
567
- stripPrefix: !0
568
- })
569
- }
570
- ) }),
571
- " "
572
- ] });
535
+ return /* @__PURE__ */ jsx(
536
+ DynamicRenderer,
537
+ {
538
+ TagName: e.Wrapper,
539
+ attributes: getBlockProperties({
540
+ block: e.block,
541
+ context: e.context
542
+ }),
543
+ actionAttributes: getBlockActions({
544
+ block: e.block,
545
+ rootState: e.context.rootState,
546
+ rootSetState: e.context.rootSetState,
547
+ localState: e.context.localState,
548
+ context: e.context.context,
549
+ stripPrefix: !0
550
+ }),
551
+ children: e.children
552
+ }
553
+ );
573
554
  }
574
555
  function InteractiveElement(e) {
575
556
  return /* @__PURE__ */ jsx(
@@ -599,10 +580,10 @@ const getWrapperProps = ({
599
580
  context: n,
600
581
  componentRef: i,
601
582
  includeBlockProps: o,
602
- isInteractive: a,
603
- contextValue: r
583
+ isInteractive: r,
584
+ contextValue: a
604
585
  }) => {
605
- const l = {
586
+ const c = {
606
587
  ...e,
607
588
  /**
608
589
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
@@ -611,17 +592,17 @@ const getWrapperProps = ({
611
592
  ...o ? {
612
593
  attributes: getBlockProperties({
613
594
  block: t,
614
- context: r
595
+ context: a
615
596
  })
616
597
  } : {}
617
598
  };
618
- return a ? {
599
+ return r ? {
619
600
  Wrapper: i,
620
601
  block: t,
621
602
  context: n,
622
603
  wrapperProps: e,
623
604
  includeBlockProps: o
624
- } : l;
605
+ } : c;
625
606
  };
626
607
  function ComponentRef(e) {
627
608
  var i;
@@ -664,7 +645,7 @@ function RepeatedBlock(e) {
664
645
  ) });
665
646
  }
666
647
  function Block(e) {
667
- var d, g, x;
648
+ var d, g, S;
668
649
  function t() {
669
650
  return getComponent({
670
651
  block: e.block,
@@ -692,22 +673,22 @@ function Block(e) {
692
673
  function o() {
693
674
  return e.block.tagName || "div";
694
675
  }
695
- function a() {
676
+ function r() {
696
677
  var y, I;
697
678
  if ((y = e.block.repeat) != null && y.collection)
698
679
  return !!((I = n == null ? void 0 : n()) != null && I.length);
699
680
  const f = "hide" in i() ? i().hide : !1;
700
681
  return ("show" in i() ? i().show : !0) && !f;
701
682
  }
702
- function r() {
703
- var S, y;
704
- return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? (y = i().children) != null ? y : [] : [];
683
+ function a() {
684
+ var b, y;
685
+ return !((b = t == null ? void 0 : t()) != null && b.component) && !n() ? (y = i().children) != null ? y : [] : [];
705
686
  }
706
- function l() {
707
- var f, S, y, I, E, v;
687
+ function c() {
688
+ var f, b, y, I, E, v;
708
689
  return {
709
690
  blockChildren: (f = i().children) != null ? f : [],
710
- componentRef: (S = t == null ? void 0 : t()) == null ? void 0 : S.component,
691
+ componentRef: (b = t == null ? void 0 : t()) == null ? void 0 : b.component,
711
692
  componentOptions: {
712
693
  ...getBlockComponentOptions(i()),
713
694
  builderContext: e.context,
@@ -715,81 +696,68 @@ function Block(e) {
715
696
  builderComponents: e.registeredComponents
716
697
  } : {}
717
698
  },
718
- context: c,
699
+ context: s,
719
700
  registeredComponents: e.registeredComponents,
720
701
  builderBlock: i(),
721
702
  includeBlockProps: ((E = t == null ? void 0 : t()) == null ? void 0 : E.noWrap) === !0,
722
703
  isInteractive: !((v = t == null ? void 0 : t()) != null && v.isRSC)
723
704
  };
724
705
  }
725
- const [c, s] = useState(() => e.context);
726
- return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
706
+ const [s, l] = useState(() => e.context);
707
+ return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsxs(Fragment, { children: [
727
708
  /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
728
709
  (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
729
710
  ComponentRef,
730
711
  {
731
- componentRef: l().componentRef,
732
- componentOptions: l().componentOptions,
733
- blockChildren: l().blockChildren,
734
- context: l().context,
735
- registeredComponents: l().registeredComponents,
736
- builderBlock: l().builderBlock,
737
- includeBlockProps: l().includeBlockProps,
738
- isInteractive: l().isInteractive
712
+ componentRef: c().componentRef,
713
+ componentOptions: c().componentOptions,
714
+ blockChildren: c().blockChildren,
715
+ context: c().context,
716
+ registeredComponents: c().registeredComponents,
717
+ builderBlock: c().builderBlock,
718
+ includeBlockProps: c().includeBlockProps,
719
+ isInteractive: c().isInteractive
739
720
  }
740
- ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
741
- isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
742
- BlockWrapper,
743
- {
744
- Wrapper: o(),
745
- block: i(),
746
- context: e.context,
747
- hasChildren: !1
748
- }
749
- ) }) : null,
750
- !isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (g = n()) == null ? void 0 : g.map((f, S) => /* @__PURE__ */ jsx(
751
- RepeatedBlock,
752
- {
753
- repeatContext: f.context,
754
- block: f.block,
755
- registeredComponents: e.registeredComponents
756
- },
757
- S
758
- )) }) : null,
759
- !isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
760
- BlockWrapper,
761
- {
762
- Wrapper: o(),
763
- block: i(),
764
- context: e.context,
765
- hasChildren: !0,
766
- children: [
767
- /* @__PURE__ */ jsx(
768
- ComponentRef,
769
- {
770
- componentRef: l().componentRef,
771
- componentOptions: l().componentOptions,
772
- blockChildren: l().blockChildren,
773
- context: l().context,
774
- registeredComponents: l().registeredComponents,
775
- builderBlock: l().builderBlock,
776
- includeBlockProps: l().includeBlockProps,
777
- isInteractive: l().isInteractive
778
- }
779
- ),
780
- (x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ jsx(
781
- Block,
782
- {
783
- block: f,
784
- context: c,
785
- registeredComponents: e.registeredComponents
786
- },
787
- f.id
788
- ))
789
- ]
790
- }
791
- ) }) : null
792
- ] })
721
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (S = n()) == null ? void 0 : S.map((f, b) => /* @__PURE__ */ jsx(
722
+ RepeatedBlock,
723
+ {
724
+ repeatContext: f.context,
725
+ block: f.block,
726
+ registeredComponents: e.registeredComponents
727
+ },
728
+ b
729
+ )) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
730
+ BlockWrapper,
731
+ {
732
+ Wrapper: o(),
733
+ block: i(),
734
+ context: e.context,
735
+ children: [
736
+ /* @__PURE__ */ jsx(
737
+ ComponentRef,
738
+ {
739
+ componentRef: c().componentRef,
740
+ componentOptions: c().componentOptions,
741
+ blockChildren: c().blockChildren,
742
+ context: c().context,
743
+ registeredComponents: c().registeredComponents,
744
+ builderBlock: c().builderBlock,
745
+ includeBlockProps: c().includeBlockProps,
746
+ isInteractive: c().isInteractive
747
+ }
748
+ ),
749
+ (g = a()) == null ? void 0 : g.map((f) => /* @__PURE__ */ jsx(
750
+ Block,
751
+ {
752
+ block: f,
753
+ context: s,
754
+ registeredComponents: e.registeredComponents
755
+ },
756
+ f.id
757
+ ))
758
+ ]
759
+ }
760
+ ) }) })
793
761
  ] }) : null });
794
762
  }
795
763
  function BlocksWrapper(e) {
@@ -798,8 +766,8 @@ function BlocksWrapper(e) {
798
766
  return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
799
767
  }
800
768
  function n() {
801
- var o, a;
802
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
769
+ var o, r;
770
+ isEditing() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
803
771
  {
804
772
  type: "builder.clickEmptyBlocks",
805
773
  data: {
@@ -811,8 +779,8 @@ function BlocksWrapper(e) {
811
779
  ));
812
780
  }
813
781
  function i() {
814
- var o, a;
815
- isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
782
+ var o, r;
783
+ isEditing() && !((o = e.blocks) != null && o.length) && ((r = window.parent) == null || r.postMessage(
816
784
  {
817
785
  type: "builder.hoverEmptyBlocks",
818
786
  data: {
@@ -846,7 +814,7 @@ function BlocksWrapper(e) {
846
814
  ] });
847
815
  }
848
816
  function Blocks(e) {
849
- var i, o, a;
817
+ var i, o, r;
850
818
  const t = useContext(builderContext), n = useContext(ComponentsContext);
851
819
  return /* @__PURE__ */ jsx(
852
820
  BlocksWrapper,
@@ -857,14 +825,14 @@ function Blocks(e) {
857
825
  styleProp: e.styleProp,
858
826
  BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
859
827
  BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
860
- children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
828
+ children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (r = e.blocks) == null ? void 0 : r.map((a) => /* @__PURE__ */ jsx(
861
829
  Block,
862
830
  {
863
- block: r,
831
+ block: a,
864
832
  context: e.context || t,
865
833
  registeredComponents: e.registeredComponents || n.registeredComponents
866
834
  },
867
- r.id
835
+ a.id
868
836
  )) }) : null
869
837
  }
870
838
  );
@@ -873,43 +841,43 @@ function Columns(e) {
873
841
  var E;
874
842
  const [t, n] = useState(
875
843
  () => typeof e.space == "number" ? e.space || 0 : 20
876
- ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
844
+ ), [i, o] = useState(() => e.columns || []), [r, a] = useState(
877
845
  () => e.stackColumnsAt || "tablet"
878
846
  );
879
- function l(v) {
847
+ function c(v) {
880
848
  var C;
881
849
  return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
882
850
  }
883
- function c(v) {
851
+ function s(v) {
884
852
  const C = t * (i.length - 1) / i.length;
885
- return `calc(${l(v)}% - ${C}px)`;
853
+ return `calc(${c(v)}% - ${C}px)`;
886
854
  }
887
- function s({
855
+ function l({
888
856
  stackedStyle: v,
889
857
  desktopStyle: C
890
858
  }) {
891
- return a === "tablet" ? v : C;
859
+ return r === "tablet" ? v : C;
892
860
  }
893
861
  function d({
894
862
  stackedStyle: v,
895
863
  desktopStyle: C
896
864
  }) {
897
- return a === "never" ? C : v;
865
+ return r === "never" ? C : v;
898
866
  }
899
- const [g, x] = useState(
867
+ const [g, S] = useState(
900
868
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
901
869
  );
902
870
  function f() {
903
871
  return {
904
872
  "--flex-dir": g,
905
- "--flex-dir-tablet": s({
873
+ "--flex-dir-tablet": l({
906
874
  stackedStyle: g,
907
875
  desktopStyle: "row"
908
876
  })
909
877
  };
910
878
  }
911
- function S(v) {
912
- const C = v === 0 ? 0 : t, T = c(v), w = `${C}px`, R = "100%", j = 0;
879
+ function b(v) {
880
+ const C = v === 0 ? 0 : t, T = s(v), w = `${C}px`, R = "100%", j = 0;
913
881
  return {
914
882
  width: T,
915
883
  ["marginLeft"]: w,
@@ -921,11 +889,11 @@ function Columns(e) {
921
889
  stackedStyle: j,
922
890
  desktopStyle: w
923
891
  }),
924
- "--column-width-tablet": s({
892
+ "--column-width-tablet": l({
925
893
  stackedStyle: R,
926
894
  desktopStyle: T
927
895
  }),
928
- "--column-margin-left-tablet": s({
896
+ "--column-margin-left-tablet": l({
929
897
  stackedStyle: j,
930
898
  desktopStyle: w
931
899
  })
@@ -976,7 +944,7 @@ function Columns(e) {
976
944
  "div",
977
945
  {
978
946
  className: "builder-column div-3c01d6ec-2",
979
- style: S(C),
947
+ style: b(C),
980
948
  key: C
981
949
  },
982
950
  /* @__PURE__ */ jsx(
@@ -1023,8 +991,8 @@ function getShopifyImageUrl(e, t) {
1023
991
  return removeProtocol(e);
1024
992
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
1025
993
  if (n) {
1026
- const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1027
- return removeProtocol(`${i[0]}_${a}${o}`);
994
+ const i = e.split(n[0]), o = n[3], r = t.match("x") ? t : `${t}x`;
995
+ return removeProtocol(`${i[0]}_${r}${o}`);
1028
996
  }
1029
997
  return null;
1030
998
  }
@@ -1040,34 +1008,34 @@ function getSrcSet(e) {
1040
1008
  return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1041
1009
  }
1042
1010
  function Image(e) {
1043
- var o, a, r, l;
1011
+ var o, r, a, c;
1044
1012
  function t() {
1045
1013
  var d;
1046
- const s = e.image || e.src;
1047
- if (!s || // We can auto add srcset for cdn.builder.io and shopify
1014
+ const l = e.image || e.src;
1015
+ if (!l || // We can auto add srcset for cdn.builder.io and shopify
1048
1016
  // images, otherwise you can supply this prop manually
1049
- !(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
1017
+ !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
1050
1018
  return e.srcset;
1051
1019
  if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
1052
1020
  if (!e.srcset.includes(e.image.split("?")[0]))
1053
- return console.debug("Removed given srcset"), getSrcSet(s);
1021
+ return console.debug("Removed given srcset"), getSrcSet(l);
1054
1022
  } else if (e.image && !e.srcset)
1055
- return getSrcSet(s);
1056
- return getSrcSet(s);
1023
+ return getSrcSet(l);
1024
+ return getSrcSet(l);
1057
1025
  }
1058
1026
  function n() {
1059
- var c;
1060
- return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1027
+ var s;
1028
+ return (s = t == null ? void 0 : t()) != null && s.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1061
1029
  }
1062
1030
  function i() {
1063
- const c = {
1031
+ const s = {
1064
1032
  position: "absolute",
1065
1033
  height: "100%",
1066
1034
  width: "100%",
1067
1035
  left: "0px",
1068
1036
  top: "0px"
1069
1037
  };
1070
- return e.aspectRatio ? c : void 0;
1038
+ return e.aspectRatio ? s : void 0;
1071
1039
  }
1072
1040
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1073
1041
  /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1091,7 +1059,7 @@ function Image(e) {
1091
1059
  }
1092
1060
  )
1093
1061
  ] }),
1094
- e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1062
+ e.aspectRatio && !((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1095
1063
  "div",
1096
1064
  {
1097
1065
  className: "builder-image-sizer div-40c70c9b",
@@ -1100,7 +1068,7 @@ function Image(e) {
1100
1068
  }
1101
1069
  }
1102
1070
  ) }) : null,
1103
- (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1071
+ (c = (a = e.builderBlock) == null ? void 0 : a.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1104
1072
  !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
1105
1073
  ] }),
1106
1074
  /* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
@@ -1143,7 +1111,7 @@ function SectionComponent(e) {
1143
1111
  }
1144
1112
  );
1145
1113
  }
1146
- const componentInfo$a = {
1114
+ const componentInfo$b = {
1147
1115
  name: "Core:Button",
1148
1116
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1149
1117
  defaultStyles: {
@@ -1176,7 +1144,7 @@ const componentInfo$a = {
1176
1144
  }],
1177
1145
  static: !0,
1178
1146
  noWrap: !0
1179
- }, componentInfo$9 = {
1147
+ }, componentInfo$a = {
1180
1148
  // TODO: ways to statically preprocess JSON for references, functions, etc
1181
1149
  name: "Columns",
1182
1150
  isRSC: !0,
@@ -1355,7 +1323,7 @@ const componentInfo$a = {
1355
1323
  });
1356
1324
  }
1357
1325
  const n = e.get("columns");
1358
- Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, c) => l + c.get("width"), 0) !== 100) && t();
1326
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
1359
1327
  }
1360
1328
  }, {
1361
1329
  name: "space",
@@ -1377,7 +1345,7 @@ const componentInfo$a = {
1377
1345
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1378
1346
  advanced: !0
1379
1347
  }]
1380
- }, componentInfo$8 = {
1348
+ }, componentInfo$9 = {
1381
1349
  name: "Custom Code",
1382
1350
  static: !0,
1383
1351
  requiredPermissions: ["editCode"],
@@ -1401,29 +1369,29 @@ const componentInfo$a = {
1401
1369
  }]
1402
1370
  };
1403
1371
  function CustomCode(e) {
1404
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1372
+ const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []);
1405
1373
  return useEffect(() => {
1406
- var l;
1407
- if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
1374
+ var c;
1375
+ if (!((c = t.current) != null && c.getElementsByTagName) || typeof window == "undefined")
1408
1376
  return;
1409
- const r = t.current.getElementsByTagName("script");
1410
- for (let c = 0; c < r.length; c++) {
1411
- const s = r[c];
1412
- if (s.src) {
1413
- if (n.includes(s.src))
1377
+ const a = t.current.getElementsByTagName("script");
1378
+ for (let s = 0; s < a.length; s++) {
1379
+ const l = a[s];
1380
+ if (l.src) {
1381
+ if (n.includes(l.src))
1414
1382
  continue;
1415
- n.push(s.src);
1383
+ n.push(l.src);
1416
1384
  const d = document.createElement("script");
1417
- d.async = !0, d.src = s.src, document.head.appendChild(d);
1418
- } else if (!s.type || [
1385
+ d.async = !0, d.src = l.src, document.head.appendChild(d);
1386
+ } else if (!l.type || [
1419
1387
  "text/javascript",
1420
1388
  "application/javascript",
1421
1389
  "application/ecmascript"
1422
- ].includes(s.type)) {
1423
- if (o.includes(s.innerText))
1390
+ ].includes(l.type)) {
1391
+ if (o.includes(l.innerText))
1424
1392
  continue;
1425
1393
  try {
1426
- o.push(s.innerText), new Function(s.innerText)();
1394
+ o.push(l.innerText), new Function(l.innerText)();
1427
1395
  } catch (d) {
1428
1396
  console.warn("`CustomCode`: Error running script:", d);
1429
1397
  }
@@ -1438,7 +1406,7 @@ function CustomCode(e) {
1438
1406
  }
1439
1407
  );
1440
1408
  }
1441
- const componentInfo$7 = {
1409
+ const componentInfo$8 = {
1442
1410
  name: "Embed",
1443
1411
  static: !0,
1444
1412
  inputs: [{
@@ -1465,28 +1433,28 @@ const componentInfo$7 = {
1465
1433
  }]
1466
1434
  }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1467
1435
  function Embed(e) {
1468
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
1469
- function c() {
1436
+ const t = useRef(null), [n, i] = useState(() => []), [o, r] = useState(() => []), [a, c] = useState(() => !1);
1437
+ function s() {
1470
1438
  if (!t.current || !t.current.getElementsByTagName)
1471
1439
  return;
1472
- const s = t.current.getElementsByTagName("script");
1473
- for (let d = 0; d < s.length; d++) {
1474
- const g = s[d];
1440
+ const l = t.current.getElementsByTagName("script");
1441
+ for (let d = 0; d < l.length; d++) {
1442
+ const g = l[d];
1475
1443
  if (g.src && !n.includes(g.src)) {
1476
1444
  n.push(g.src);
1477
- const x = document.createElement("script");
1478
- x.async = !0, x.src = g.src, document.head.appendChild(x);
1445
+ const S = document.createElement("script");
1446
+ S.async = !0, S.src = g.src, document.head.appendChild(S);
1479
1447
  } else if (isJsScript(g) && !o.includes(g.innerText))
1480
1448
  try {
1481
1449
  o.push(g.innerText), new Function(g.innerText)();
1482
- } catch (x) {
1483
- console.warn("`Embed`: Error running script:", x);
1450
+ } catch (S) {
1451
+ console.warn("`Embed`: Error running script:", S);
1484
1452
  }
1485
1453
  }
1486
1454
  }
1487
1455
  return useEffect(() => {
1488
- t.current && !r && (l(!0), c());
1489
- }, [t.current, r]), /* @__PURE__ */ jsx(
1456
+ t.current && !a && (c(!0), s());
1457
+ }, [t.current, a]), /* @__PURE__ */ jsx(
1490
1458
  "div",
1491
1459
  {
1492
1460
  className: "builder-embed",
@@ -1495,13 +1463,13 @@ function Embed(e) {
1495
1463
  }
1496
1464
  );
1497
1465
  }
1498
- const componentInfo$6 = {
1466
+ const componentInfo$7 = {
1499
1467
  name: "Fragment",
1500
1468
  static: !0,
1501
1469
  hidden: !0,
1502
1470
  canHaveChildren: !0,
1503
1471
  noWrap: !0
1504
- }, componentInfo$5 = {
1472
+ }, componentInfo$6 = {
1505
1473
  name: "Image",
1506
1474
  static: !0,
1507
1475
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -1521,29 +1489,29 @@ const componentInfo$6 = {
1521
1489
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1522
1490
  onChange: (e) => {
1523
1491
  e.delete("srcset"), e.delete("noWebp");
1524
- function n(r, l = 6e4) {
1525
- return new Promise((c, s) => {
1492
+ function n(a, c = 6e4) {
1493
+ return new Promise((s, l) => {
1526
1494
  const d = document.createElement("img");
1527
1495
  let g = !1;
1528
1496
  d.onload = () => {
1529
- g = !0, c(d);
1530
- }, d.addEventListener("error", (x) => {
1531
- console.warn("Image load failed", x.error), s(x.error);
1532
- }), d.src = r, setTimeout(() => {
1533
- g || s(new Error("Image load timed out"));
1534
- }, l);
1497
+ g = !0, s(d);
1498
+ }, d.addEventListener("error", (S) => {
1499
+ console.warn("Image load failed", S.error), l(S.error);
1500
+ }), d.src = a, setTimeout(() => {
1501
+ g || l(new Error("Image load timed out"));
1502
+ }, c);
1535
1503
  });
1536
1504
  }
1537
- function i(r) {
1538
- return Math.round(r * 1e3) / 1e3;
1505
+ function i(a) {
1506
+ return Math.round(a * 1e3) / 1e3;
1539
1507
  }
1540
- const o = e.get("image"), a = e.get("aspectRatio");
1541
- if (fetch(o).then((r) => r.blob()).then((r) => {
1542
- r.type.includes("svg") && e.set("noWebp", !0);
1543
- }), o && (!a || a === 0.7041))
1544
- return n(o).then((r) => {
1545
- const l = e.get("aspectRatio");
1546
- e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1508
+ const o = e.get("image"), r = e.get("aspectRatio");
1509
+ if (fetch(o).then((a) => a.blob()).then((a) => {
1510
+ a.type.includes("svg") && e.set("noWebp", !0);
1511
+ }), o && (!r || r === 0.7041))
1512
+ return n(o).then((a) => {
1513
+ const c = e.get("aspectRatio");
1514
+ e.get("image") === o && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1547
1515
  });
1548
1516
  }
1549
1517
  }, {
@@ -1601,7 +1569,7 @@ const componentInfo$6 = {
1601
1569
  advanced: !0,
1602
1570
  defaultValue: 0.7041
1603
1571
  }]
1604
- }, componentInfo$4 = {
1572
+ }, componentInfo$5 = {
1605
1573
  // friendlyName?
1606
1574
  name: "Raw:Img",
1607
1575
  hideFromInsertMenu: !0,
@@ -1631,7 +1599,7 @@ function ImgComponent(e) {
1631
1599
  isEditing() && e.imgSrc || "default-key"
1632
1600
  );
1633
1601
  }
1634
- const componentInfo$3 = {
1602
+ const componentInfo$4 = {
1635
1603
  name: "Core:Section",
1636
1604
  static: !0,
1637
1605
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1670,7 +1638,44 @@ const componentInfo$3 = {
1670
1638
  }
1671
1639
  }
1672
1640
  }]
1673
- }, componentInfo$2 = {
1641
+ }, componentInfo$3 = {
1642
+ name: "Slot",
1643
+ isRSC: !0,
1644
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
1645
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
1646
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
1647
+ // Maybe wrap this for canHaveChildren so bind children to this hm
1648
+ inputs: [{
1649
+ name: "name",
1650
+ type: "string",
1651
+ required: !0,
1652
+ defaultValue: "children"
1653
+ }]
1654
+ };
1655
+ function Slot(e) {
1656
+ var t, n, i;
1657
+ return /* @__PURE__ */ jsx(
1658
+ "div",
1659
+ {
1660
+ style: {
1661
+ pointerEvents: "auto"
1662
+ },
1663
+ ...!((t = e.builderContext.context) != null && t.symbolId) && {
1664
+ "builder-slot": e.name
1665
+ },
1666
+ children: /* @__PURE__ */ jsx(
1667
+ Blocks,
1668
+ {
1669
+ parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1670
+ path: `symbol.data.${e.name}`,
1671
+ context: e.builderContext,
1672
+ blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
1673
+ }
1674
+ )
1675
+ }
1676
+ );
1677
+ }
1678
+ const componentInfo$2 = {
1674
1679
  name: "Symbol",
1675
1680
  noWrap: !0,
1676
1681
  static: !0,
@@ -1818,7 +1823,7 @@ const componentInfo = {
1818
1823
  }]
1819
1824
  };
1820
1825
  function Video(e) {
1821
- var i, o, a, r, l, c, s;
1826
+ var i, o, r, a, c, s, l;
1822
1827
  function t() {
1823
1828
  return {
1824
1829
  ...e.autoPlay === !0 ? {
@@ -1875,7 +1880,7 @@ function Video(e) {
1875
1880
  children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
1876
1881
  }
1877
1882
  ),
1878
- e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1883
+ e.aspectRatio && !(e.fitContent && ((r = (o = e.builderBlock) == null ? void 0 : o.children) != null && r.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1879
1884
  "div",
1880
1885
  {
1881
1886
  style: {
@@ -1886,7 +1891,7 @@ function Video(e) {
1886
1891
  }
1887
1892
  }
1888
1893
  ) }) : null,
1889
- (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1894
+ (c = (a = e.builderBlock) == null ? void 0 : a.children) != null && c.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1890
1895
  "div",
1891
1896
  {
1892
1897
  style: {
@@ -1897,7 +1902,7 @@ function Video(e) {
1897
1902
  children: e.children
1898
1903
  }
1899
1904
  ) }) : null,
1900
- (s = (c = e.builderBlock) == null ? void 0 : c.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1905
+ (l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1901
1906
  "div",
1902
1907
  {
1903
1908
  style: {
@@ -1920,28 +1925,28 @@ function Video(e) {
1920
1925
  }
1921
1926
  const getDefaultRegisteredComponents = () => [{
1922
1927
  component: Button,
1923
- ...componentInfo$a
1928
+ ...componentInfo$b
1924
1929
  }, {
1925
1930
  component: Columns,
1926
- ...componentInfo$9
1931
+ ...componentInfo$a
1927
1932
  }, {
1928
1933
  component: CustomCode,
1929
- ...componentInfo$8
1934
+ ...componentInfo$9
1930
1935
  }, {
1931
1936
  component: Embed,
1932
- ...componentInfo$7
1937
+ ...componentInfo$8
1933
1938
  }, {
1934
1939
  component: FragmentComponent,
1935
- ...componentInfo$6
1940
+ ...componentInfo$7
1936
1941
  }, {
1937
1942
  component: Image,
1938
- ...componentInfo$5
1943
+ ...componentInfo$6
1939
1944
  }, {
1940
1945
  component: ImgComponent,
1941
- ...componentInfo$4
1946
+ ...componentInfo$5
1942
1947
  }, {
1943
1948
  component: SectionComponent,
1944
- ...componentInfo$3
1949
+ ...componentInfo$4
1945
1950
  }, {
1946
1951
  component: Symbol$1,
1947
1952
  ...componentInfo$2
@@ -1951,6 +1956,9 @@ const getDefaultRegisteredComponents = () => [{
1951
1956
  }, {
1952
1957
  component: Video,
1953
1958
  ...componentInfo
1959
+ }, {
1960
+ component: Slot,
1961
+ ...componentInfo$3
1954
1962
  }], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1955
1963
  function getAndSetVariantId() {
1956
1964
  function setCookie(name, value, days) {
@@ -2069,6 +2077,11 @@ function InlinedScript(e) {
2069
2077
  }
2070
2078
  );
2071
2079
  }
2080
+ const DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
2081
+ function isFromTrustedHost(e, t) {
2082
+ const n = new URL(t.origin), i = n.hostname;
2083
+ return (e || DEFAULT_TRUSTED_HOSTS).findIndex((o) => o.startsWith("*.") ? i.endsWith(o.slice(1)) : o === i) > -1;
2084
+ }
2072
2085
  function round(e) {
2073
2086
  return Math.round(e * 1e3) / 1e3;
2074
2087
  }
@@ -2090,10 +2103,10 @@ const findParentElement = (e, t, n = !0) => {
2090
2103
  event: e,
2091
2104
  target: t
2092
2105
  }) => {
2093
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2106
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, r = round(i / n.width), a = round(o / n.height);
2094
2107
  return {
2095
- x: a,
2096
- y: r
2108
+ x: r,
2109
+ y: a
2097
2110
  };
2098
2111
  }, getInteractionPropertiesForEvent = (e) => {
2099
2112
  const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
@@ -2111,7 +2124,7 @@ const findParentElement = (e, t, n = !0) => {
2111
2124
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2112
2125
  }
2113
2126
  };
2114
- }, SDK_VERSION = "0.12.0", registerInsertMenu = () => {
2127
+ }, SDK_VERSION = "0.12.2", registerInsertMenu = () => {
2115
2128
  register("insertMenu", {
2116
2129
  name: "_default",
2117
2130
  default: !0,
@@ -2153,40 +2166,43 @@ const setupBrowserForEditing = (e = {}) => {
2153
2166
  data: {
2154
2167
  options: e
2155
2168
  }
2156
- }, "*"), window.addEventListener("message", ({
2157
- data: i
2158
- }) => {
2159
- var o, a;
2160
- if (i != null && i.type)
2161
- switch (i.type) {
2169
+ }, "*"), window.addEventListener("message", (i) => {
2170
+ var r, a;
2171
+ if (!isFromTrustedHost(e.trustedHosts, i))
2172
+ return;
2173
+ const {
2174
+ data: o
2175
+ } = i;
2176
+ if (o != null && o.type)
2177
+ switch (o.type) {
2162
2178
  case "builder.evaluate": {
2163
- const r = i.data.text, l = i.data.arguments || [], c = i.data.id, s = new Function(r);
2164
- let d, g = null;
2179
+ const c = o.data.text, s = o.data.arguments || [], l = o.data.id, d = new Function(c);
2180
+ let g, S = null;
2165
2181
  try {
2166
- d = s.apply(null, l);
2167
- } catch (x) {
2168
- g = x;
2182
+ g = d.apply(null, s);
2183
+ } catch (f) {
2184
+ S = f;
2169
2185
  }
2170
- g ? (o = window.parent) == null || o.postMessage({
2186
+ S ? (r = window.parent) == null || r.postMessage({
2171
2187
  type: "builder.evaluateError",
2172
2188
  data: {
2173
- id: c,
2174
- error: g.message
2189
+ id: l,
2190
+ error: S.message
2175
2191
  }
2176
- }, "*") : d && typeof d.then == "function" ? d.then((x) => {
2177
- var f;
2178
- (f = window.parent) == null || f.postMessage({
2192
+ }, "*") : g && typeof g.then == "function" ? g.then((f) => {
2193
+ var b;
2194
+ (b = window.parent) == null || b.postMessage({
2179
2195
  type: "builder.evaluateResult",
2180
2196
  data: {
2181
- id: c,
2182
- result: x
2197
+ id: l,
2198
+ result: f
2183
2199
  }
2184
2200
  }, "*");
2185
2201
  }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2186
2202
  type: "builder.evaluateResult",
2187
2203
  data: {
2188
- result: d,
2189
- id: c
2204
+ result: g,
2205
+ id: l
2190
2206
  }
2191
2207
  }, "*");
2192
2208
  break;
@@ -2195,22 +2211,22 @@ const setupBrowserForEditing = (e = {}) => {
2195
2211
  })));
2196
2212
  };
2197
2213
  function EnableEditor(e) {
2198
- var j, P, A, F, _, V, W;
2214
+ var j, P, A, F, _, V, N;
2199
2215
  const t = useRef(null), [n, i] = useState(() => 0);
2200
2216
  useState(() => !0);
2201
2217
  function o(u) {
2202
- var h, b;
2218
+ var h, x;
2203
2219
  const m = {
2204
2220
  ...e.builderContextSignal.rootState,
2205
2221
  ...u
2206
2222
  };
2207
- e.builderContextSignal.rootSetState ? (b = (h = e.builderContextSignal).rootSetState) == null || b.call(h, m) : e.setBuilderContextSignal((p) => ({
2223
+ e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, m) : e.setBuilderContextSignal((p) => ({
2208
2224
  ...p,
2209
2225
  rootState: m
2210
2226
  }));
2211
2227
  }
2212
- function a(u) {
2213
- var h, b, p, k, B;
2228
+ function r(u) {
2229
+ var h, x, p, k, B;
2214
2230
  const m = {
2215
2231
  ...e.builderContextSignal.content,
2216
2232
  ...u,
@@ -2219,7 +2235,7 @@ function EnableEditor(e) {
2219
2235
  ...u == null ? void 0 : u.data
2220
2236
  },
2221
2237
  meta: {
2222
- ...(b = e.builderContextSignal.content) == null ? void 0 : b.meta,
2238
+ ...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
2223
2239
  ...u == null ? void 0 : u.meta,
2224
2240
  breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
2225
2241
  }
@@ -2230,21 +2246,23 @@ function EnableEditor(e) {
2230
2246
  }));
2231
2247
  }
2232
2248
  useState(() => 0);
2233
- const [r, l] = useState(
2249
+ const [a, c] = useState(
2234
2250
  () => !1
2235
- ), [c, s] = useState(
2251
+ ), [s, l] = useState(
2236
2252
  () => e.contentWrapper || "div"
2237
2253
  );
2238
2254
  function d(u) {
2239
2255
  var h;
2256
+ if (!isFromTrustedHost(e.trustedHosts, u))
2257
+ return;
2240
2258
  const { data: m } = u;
2241
2259
  if (m)
2242
2260
  switch (m.type) {
2243
2261
  case "builder.configureSdk": {
2244
- const b = m.data, { breakpoints: p, contentId: k } = b;
2262
+ const x = m.data, { breakpoints: p, contentId: k } = x;
2245
2263
  if (!k || k !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
2246
2264
  return;
2247
- p && a({
2265
+ p && r({
2248
2266
  meta: {
2249
2267
  breakpoints: p
2250
2268
  }
@@ -2252,8 +2270,8 @@ function EnableEditor(e) {
2252
2270
  break;
2253
2271
  }
2254
2272
  case "builder.contentUpdate": {
2255
- const b = m.data, p = b.key || b.alias || b.entry || b.modelName, k = b.data;
2256
- p === e.model && (a(k), i(n + 1));
2273
+ const x = m.data, p = x.key || x.alias || x.entry || x.modelName, k = x.data;
2274
+ p === e.model && (r(k), i(n + 1));
2257
2275
  break;
2258
2276
  }
2259
2277
  }
@@ -2269,22 +2287,22 @@ function EnableEditor(e) {
2269
2287
  rootSetState: e.builderContextSignal.rootSetState
2270
2288
  });
2271
2289
  }
2272
- const [x, f] = useState(() => ({})), [S, y] = useState(() => !1);
2290
+ const [S, f] = useState(() => ({})), [b, y] = useState(() => !1);
2273
2291
  function I(u) {
2274
2292
  var m, h;
2275
2293
  if (e.builderContextSignal.content) {
2276
- const b = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
2294
+ const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
2277
2295
  _track({
2278
2296
  type: "click",
2279
2297
  canTrack: getDefaultCanTrack(e.canTrack),
2280
2298
  contentId: p,
2281
2299
  apiKey: e.apiKey,
2282
- variationId: b !== p ? b : void 0,
2300
+ variationId: x !== p ? x : void 0,
2283
2301
  ...getInteractionPropertiesForEvent(u),
2284
- unique: !S
2302
+ unique: !b
2285
2303
  });
2286
2304
  }
2287
- S || y(!0);
2305
+ b || y(!0);
2288
2306
  }
2289
2307
  function E(u) {
2290
2308
  return u.replace(
@@ -2301,20 +2319,20 @@ function EnableEditor(e) {
2301
2319
  function v({ url: u, key: m }) {
2302
2320
  fetch$1(u).then((h) => h.json()).then((h) => {
2303
2321
  var p, k;
2304
- const b = {
2322
+ const x = {
2305
2323
  ...e.builderContextSignal.rootState,
2306
2324
  [m]: h
2307
2325
  };
2308
- (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, b), x[m] = !0;
2326
+ (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, x), S[m] = !0;
2309
2327
  }).catch((h) => {
2310
2328
  console.error("error fetching dynamic data", u, h);
2311
2329
  });
2312
2330
  }
2313
2331
  function C() {
2314
- var m, h, b;
2315
- const u = (b = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? b : {};
2332
+ var m, h, x;
2333
+ const u = (x = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? x : {};
2316
2334
  Object.entries(u).forEach(([p, k]) => {
2317
- if (k && (!x[p] || isEditing())) {
2335
+ if (k && (!S[p] || isEditing())) {
2318
2336
  const B = E(k);
2319
2337
  v({
2320
2338
  url: B,
@@ -2348,28 +2366,31 @@ function EnableEditor(e) {
2348
2366
  } : {},
2349
2367
  ...e.enrich ? {
2350
2368
  enrich: e.enrich
2369
+ } : {},
2370
+ ...e.trustedHosts ? {
2371
+ trustedHosts: e.trustedHosts
2351
2372
  } : {}
2352
2373
  }), Object.values(
2353
2374
  e.builderContextSignal.componentInfos
2354
2375
  ).forEach((m) => {
2355
- var b;
2376
+ var x;
2356
2377
  const h = createRegisterComponentMessage(m);
2357
- (b = window.parent) == null || b.postMessage(h, "*");
2378
+ (x = window.parent) == null || x.postMessage(h, "*");
2358
2379
  }), window.addEventListener(
2359
2380
  "builder:component:stateChangeListenerActivated",
2360
2381
  T
2361
2382
  );
2362
2383
  }
2363
2384
  function R(u) {
2364
- const m = new URL(location.href).searchParams, h = m.get("builder.preview"), b = m.get(
2385
+ const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
2365
2386
  `builder.preview.${h}`
2366
2387
  ), p = m.get("apiKey") || m.get("builder.space");
2367
- h === e.model && p === e.apiKey && (!e.content || b === e.content.id) && fetchOneEntry({
2388
+ h === e.model && p === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
2368
2389
  model: e.model,
2369
2390
  apiKey: e.apiKey,
2370
2391
  apiVersion: e.builderContextSignal.apiVersion
2371
2392
  }).then((k) => {
2372
- k && a(k);
2393
+ k && r(k);
2373
2394
  });
2374
2395
  }
2375
2396
  return useEffect(() => {
@@ -2400,13 +2421,13 @@ function EnableEditor(e) {
2400
2421
  var u, m;
2401
2422
  if (isBrowser()) {
2402
2423
  if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2403
- const b = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
2424
+ const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
2404
2425
  _track({
2405
2426
  type: "impression",
2406
2427
  canTrack: !0,
2407
2428
  contentId: p,
2408
2429
  apiKey: k,
2409
- variationId: b !== p ? b : void 0
2430
+ variationId: x !== p ? x : void 0
2410
2431
  });
2411
2432
  }
2412
2433
  isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
@@ -2416,9 +2437,9 @@ function EnableEditor(e) {
2416
2437
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2417
2438
  ), g(), C(), T();
2418
2439
  }, []), useEffect(() => {
2419
- e.content && a(e.content);
2440
+ e.content && r(e.content);
2420
2441
  }, [e.content]), useEffect(() => {
2421
- }, [r]), useEffect(() => {
2442
+ }, [a]), useEffect(() => {
2422
2443
  g();
2423
2444
  }, [
2424
2445
  (P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode,
@@ -2439,7 +2460,7 @@ function EnableEditor(e) {
2439
2460
  T
2440
2461
  ));
2441
2462
  }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2442
- c,
2463
+ s,
2443
2464
  {
2444
2465
  key: n,
2445
2466
  ref: t,
@@ -2451,14 +2472,14 @@ function EnableEditor(e) {
2451
2472
  "aria-hidden": !0
2452
2473
  },
2453
2474
  ...e.contentWrapperProps,
2454
- className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((W = e.content) == null ? void 0 : W.id)}`
2475
+ className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || ((N = e.content) == null ? void 0 : N.id)}`
2455
2476
  },
2456
2477
  e.children
2457
2478
  ) }) : null });
2458
2479
  }
2459
2480
  const getCssFromFont = (e) => {
2460
- var a, r;
2461
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
2481
+ var r, a;
2482
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (r = e == null ? void 0 : e.files) == null ? void 0 : r.regular;
2462
2483
  let o = "";
2463
2484
  if (i && t && n && (o += `
2464
2485
  @font-face {
@@ -2468,16 +2489,16 @@ font-display: fallback;
2468
2489
  font-weight: 400;
2469
2490
  }
2470
2491
  `.trim()), e.files)
2471
- for (const l in e.files) {
2472
- if (!(String(Number(l)) === l))
2492
+ for (const c in e.files) {
2493
+ if (!(String(Number(c)) === c))
2473
2494
  continue;
2474
- const s = e.files[l];
2475
- s && s !== i && (o += `
2495
+ const l = e.files[c];
2496
+ l && l !== i && (o += `
2476
2497
  @font-face {
2477
2498
  font-family: "${t}";
2478
- src: url('${s}') format('woff2');
2499
+ src: url('${l}') format('woff2');
2479
2500
  font-display: fallback;
2480
- font-weight: ${l};
2501
+ font-weight: ${c};
2481
2502
  }
2482
2503
  `.trim());
2483
2504
  }
@@ -2523,10 +2544,10 @@ const getRootStateInitialValue = ({
2523
2544
  data: t,
2524
2545
  locale: n
2525
2546
  }) => {
2526
- var a, r, l;
2527
- const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
2528
- return (l = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || l.forEach((c) => {
2529
- c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
2547
+ var r, a, c;
2548
+ const i = {}, o = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
2549
+ return (c = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || c.forEach((s) => {
2550
+ s.name && s.defaultValue !== void 0 && (i[s.name] = s.defaultValue);
2530
2551
  }), {
2531
2552
  ...i,
2532
2553
  ...o,
@@ -2547,7 +2568,7 @@ const getRootStateInitialValue = ({
2547
2568
  meta: e == null ? void 0 : e.meta
2548
2569
  } : void 0;
2549
2570
  function ContentComponent(e) {
2550
- var c, s, d, g, x, f, S;
2571
+ var s, l, d, g, S, f, b;
2551
2572
  const [t, n] = useState(
2552
2573
  () => {
2553
2574
  var y, I;
@@ -2560,12 +2581,12 @@ function ContentComponent(e) {
2560
2581
  }
2561
2582
  );
2562
2583
  function i(y) {
2563
- l((I) => ({
2584
+ c((I) => ({
2564
2585
  ...I,
2565
2586
  rootState: y
2566
2587
  }));
2567
2588
  }
2568
- const [o, a] = useState(
2589
+ const [o, r] = useState(
2569
2590
  () => [
2570
2591
  ...getDefaultRegisteredComponents(),
2571
2592
  // While this `components` object is deprecated, we must maintain support for it.
@@ -2585,7 +2606,7 @@ function ContentComponent(e) {
2585
2606
  }),
2586
2607
  {}
2587
2608
  )
2588
- ), [r, l] = useState(() => ({
2609
+ ), [a, c] = useState(() => ({
2589
2610
  content: getContentInitialValue({
2590
2611
  content: e.content,
2591
2612
  data: e.data
@@ -2639,25 +2660,26 @@ function ContentComponent(e) {
2639
2660
  includeRefs: e.includeRefs,
2640
2661
  enrich: e.enrich,
2641
2662
  showContent: e.showContent,
2642
- builderContextSignal: r,
2663
+ builderContextSignal: a,
2643
2664
  contentWrapper: e.contentWrapper,
2644
2665
  contentWrapperProps: e.contentWrapperProps,
2645
- setBuilderContextSignal: l,
2666
+ trustedHosts: e.trustedHosts,
2667
+ setBuilderContextSignal: c,
2646
2668
  children: [
2647
2669
  e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2648
2670
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2649
2671
  ContentStyles,
2650
2672
  {
2651
- contentId: (c = r.content) == null ? void 0 : c.id,
2652
- cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
2653
- customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
2673
+ contentId: (s = a.content) == null ? void 0 : s.id,
2674
+ cssCode: (d = (l = a.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
2675
+ customFonts: (S = (g = a.content) == null ? void 0 : g.data) == null ? void 0 : S.customFonts
2654
2676
  }
2655
2677
  ) }),
2656
2678
  /* @__PURE__ */ jsx(
2657
2679
  Blocks,
2658
2680
  {
2659
- blocks: (S = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : S.blocks,
2660
- context: r,
2681
+ blocks: (b = (f = a.content) == null ? void 0 : f.data) == null ? void 0 : b.blocks,
2682
+ context: a,
2661
2683
  registeredComponents: o
2662
2684
  }
2663
2685
  )
@@ -2668,7 +2690,7 @@ function ContentComponent(e) {
2668
2690
  );
2669
2691
  }
2670
2692
  function ContentVariants(e) {
2671
- var r, l;
2693
+ var a, c;
2672
2694
  const [t, n] = useState(
2673
2695
  () => checkShouldRenderVariants({
2674
2696
  canTrack: getDefaultCanTrack(e.canTrack),
@@ -2676,23 +2698,23 @@ function ContentVariants(e) {
2676
2698
  })
2677
2699
  );
2678
2700
  function i() {
2679
- var c;
2701
+ var s;
2680
2702
  return getUpdateCookieAndStylesScript(
2681
- getVariants(e.content).map((s) => ({
2682
- id: s.testVariationId,
2683
- testRatio: s.testRatio
2703
+ getVariants(e.content).map((l) => ({
2704
+ id: l.testVariationId,
2705
+ testRatio: l.testRatio
2684
2706
  })),
2685
- ((c = e.content) == null ? void 0 : c.id) || ""
2707
+ ((s = e.content) == null ? void 0 : s.id) || ""
2686
2708
  );
2687
2709
  }
2688
2710
  function o() {
2689
- return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2711
+ return getVariants(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2690
2712
  }
2691
- function a() {
2692
- var c;
2713
+ function r() {
2714
+ var s;
2693
2715
  return t ? {
2694
2716
  ...e.content,
2695
- testVariationId: (c = e.content) == null ? void 0 : c.id
2717
+ testVariationId: (s = e.content) == null ? void 0 : s.id
2696
2718
  } : handleABTestingSync({
2697
2719
  item: e.content,
2698
2720
  canTrack: getDefaultCanTrack(e.canTrack)
@@ -2705,15 +2727,15 @@ function ContentVariants(e) {
2705
2727
  /* @__PURE__ */ jsx(
2706
2728
  InlinedStyles,
2707
2729
  {
2708
- id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
2730
+ id: `variants-styles-${(a = e.content) == null ? void 0 : a.id}`,
2709
2731
  styles: o()
2710
2732
  }
2711
2733
  ),
2712
2734
  /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2713
- (l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
2735
+ (c = getVariants(e.content)) == null ? void 0 : c.map((s) => /* @__PURE__ */ jsx(
2714
2736
  ContentComponent,
2715
2737
  {
2716
- content: c,
2738
+ content: s,
2717
2739
  showContent: !1,
2718
2740
  model: e.model,
2719
2741
  data: e.data,
@@ -2729,15 +2751,16 @@ function ContentVariants(e) {
2729
2751
  blocksWrapper: e.blocksWrapper,
2730
2752
  blocksWrapperProps: e.blocksWrapperProps,
2731
2753
  contentWrapper: e.contentWrapper,
2732
- contentWrapperProps: e.contentWrapperProps
2754
+ contentWrapperProps: e.contentWrapperProps,
2755
+ trustedHosts: e.trustedHosts
2733
2756
  },
2734
- c.testVariationId
2757
+ s.testVariationId
2735
2758
  ))
2736
2759
  ] }) : null,
2737
2760
  /* @__PURE__ */ jsx(
2738
2761
  ContentComponent,
2739
2762
  {
2740
- content: a(),
2763
+ content: r(),
2741
2764
  showContent: !0,
2742
2765
  model: e.model,
2743
2766
  data: e.data,
@@ -2753,7 +2776,8 @@ function ContentVariants(e) {
2753
2776
  blocksWrapper: e.blocksWrapper,
2754
2777
  blocksWrapperProps: e.blocksWrapperProps,
2755
2778
  contentWrapper: e.contentWrapper,
2756
- contentWrapperProps: e.contentWrapperProps
2779
+ contentWrapperProps: e.contentWrapperProps,
2780
+ trustedHosts: e.trustedHosts
2757
2781
  }
2758
2782
  )
2759
2783
  ] });
@@ -2778,26 +2802,26 @@ const fetchSymbolContent = async ({
2778
2802
  });
2779
2803
  };
2780
2804
  function Symbol$1(e) {
2781
- var a, r, l;
2805
+ var r, a, c, s;
2782
2806
  function t() {
2783
- var c, s;
2807
+ var l, d;
2784
2808
  return [
2785
2809
  e.attributes.className,
2786
2810
  "builder-symbol",
2787
- (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2788
- (s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2811
+ (l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
2812
+ (d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2789
2813
  ].filter(Boolean).join(" ");
2790
2814
  }
2791
2815
  const [n, i] = useState(() => {
2792
- var c;
2793
- return (c = e.symbol) == null ? void 0 : c.content;
2816
+ var l;
2817
+ return (l = e.symbol) == null ? void 0 : l.content;
2794
2818
  });
2795
2819
  function o() {
2796
2820
  n || fetchSymbolContent({
2797
2821
  symbol: e.symbol,
2798
2822
  builderContextValue: e.builderContext
2799
- }).then((c) => {
2800
- c && i(c);
2823
+ }).then((l) => {
2824
+ l && i(l);
2801
2825
  });
2802
2826
  }
2803
2827
  return useEffect(() => {
@@ -2809,14 +2833,17 @@ function Symbol$1(e) {
2809
2833
  __isNestedRender: !0,
2810
2834
  apiVersion: e.builderContext.apiVersion,
2811
2835
  apiKey: e.builderContext.apiKey,
2812
- context: e.builderContext.context,
2836
+ context: {
2837
+ ...e.builderContext.context,
2838
+ symbolId: (r = e.builderBlock) == null ? void 0 : r.id
2839
+ },
2813
2840
  customComponents: Object.values(e.builderComponents),
2814
2841
  data: {
2815
2842
  ...(a = e.symbol) == null ? void 0 : a.data,
2816
2843
  ...e.builderContext.localState,
2817
- ...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
2844
+ ...(c = n == null ? void 0 : n.data) == null ? void 0 : c.state
2818
2845
  },
2819
- model: (l = e.symbol) == null ? void 0 : l.model,
2846
+ model: (s = e.symbol) == null ? void 0 : s.model,
2820
2847
  content: n
2821
2848
  }
2822
2849
  ) });