@builder.io/sdk-react 0.7.4 → 0.7.5
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.
- package/lib/browser/index.cjs +11 -11
- package/lib/browser/index.mjs +114 -117
- package/lib/edge/index.cjs +12 -12
- package/lib/edge/index.mjs +249 -252
- package/lib/node/index.cjs +9 -9
- package/lib/node/index.mjs +127 -130
- package/package.json +1 -1
- package/types/components/content/content.helpers.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/browser/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as T, Fragment as f, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as pe, useState as
|
|
3
|
+
import { createContext as pe, useState as p, useContext as le, createElement as ke, useRef as Z, useEffect as P } from "react";
|
|
4
4
|
import { i as $, j as N, k as $e, l as M, m as ee, n as G, T as L, r as Ne, o as U, p as ce, a as Fe, c as We, b as Ce, q as _e, u as se, v as de, w as Le } from "./server-entry-0aebe4be.mjs";
|
|
5
5
|
import { _ as sn, h as dn, f as un, g as mn, e as fn, d as hn, s as gn, t as bn } from "./server-entry-0aebe4be.mjs";
|
|
6
6
|
function je(e) {
|
|
@@ -315,7 +315,7 @@ function ne(e) {
|
|
|
315
315
|
return G(i.hide) ? !i.hide : G(i.show) ? i.show : !0;
|
|
316
316
|
}
|
|
317
317
|
function n() {
|
|
318
|
-
var
|
|
318
|
+
var b;
|
|
319
319
|
const i = D({
|
|
320
320
|
block: e.block,
|
|
321
321
|
localState: e.context.localState,
|
|
@@ -324,14 +324,14 @@ function ne(e) {
|
|
|
324
324
|
context: e.context.context,
|
|
325
325
|
shouldEvaluateBindings: !0
|
|
326
326
|
}), a = i.responsiveStyles, o = e.context.content, l = Te(
|
|
327
|
-
((
|
|
327
|
+
((b = o == null ? void 0 : o.meta) == null ? void 0 : b.breakpoints) || {}
|
|
328
328
|
), s = a == null ? void 0 : a.large, c = a == null ? void 0 : a.medium, d = a == null ? void 0 : a.small, u = i.id;
|
|
329
329
|
if (!u)
|
|
330
330
|
return "";
|
|
331
331
|
const g = s ? Y({
|
|
332
332
|
className: u,
|
|
333
333
|
styles: s
|
|
334
|
-
}) : "",
|
|
334
|
+
}) : "", v = c ? Y({
|
|
335
335
|
className: u,
|
|
336
336
|
styles: c,
|
|
337
337
|
mediaQuery: me(
|
|
@@ -346,7 +346,7 @@ function ne(e) {
|
|
|
346
346
|
l
|
|
347
347
|
)
|
|
348
348
|
}) : "";
|
|
349
|
-
return [g,
|
|
349
|
+
return [g, v, V].join(" ");
|
|
350
350
|
}
|
|
351
351
|
return /* @__PURE__ */ r(f, { children: n() && t() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles: n() }) }) : null });
|
|
352
352
|
}
|
|
@@ -511,7 +511,7 @@ const rt = ({
|
|
|
511
511
|
};
|
|
512
512
|
function he(e) {
|
|
513
513
|
var i, a;
|
|
514
|
-
const [t, n] =
|
|
514
|
+
const [t, n] = p(
|
|
515
515
|
() => e.isInteractive ? ot : e.componentRef
|
|
516
516
|
);
|
|
517
517
|
return /* @__PURE__ */ r(f, { children: e.componentRef ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ T(
|
|
@@ -549,7 +549,7 @@ function he(e) {
|
|
|
549
549
|
) }) : null });
|
|
550
550
|
}
|
|
551
551
|
function lt(e) {
|
|
552
|
-
const [t, n] =
|
|
552
|
+
const [t, n] = p(() => e.repeatContext);
|
|
553
553
|
return /* @__PURE__ */ r(te.Provider, { value: t, children: /* @__PURE__ */ r(
|
|
554
554
|
H,
|
|
555
555
|
{
|
|
@@ -560,7 +560,7 @@ function lt(e) {
|
|
|
560
560
|
) });
|
|
561
561
|
}
|
|
562
562
|
function H(e) {
|
|
563
|
-
var u, g,
|
|
563
|
+
var u, g, v, V;
|
|
564
564
|
function t() {
|
|
565
565
|
return Qe({
|
|
566
566
|
block: e.block,
|
|
@@ -575,7 +575,8 @@ function H(e) {
|
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
function i() {
|
|
578
|
-
|
|
578
|
+
var b;
|
|
579
|
+
return (b = e.block.repeat) != null && b.collection ? e.block : D({
|
|
579
580
|
block: e.block,
|
|
580
581
|
localState: e.context.localState,
|
|
581
582
|
rootState: e.context.rootState,
|
|
@@ -588,21 +589,22 @@ function H(e) {
|
|
|
588
589
|
return e.block.tagName || "div";
|
|
589
590
|
}
|
|
590
591
|
function o() {
|
|
591
|
-
|
|
592
|
+
var b, S;
|
|
593
|
+
return "hide" in i() ? !i().hide : "show" in i() ? i().show : !((b = e.block.repeat) != null && b.collection && !((S = n == null ? void 0 : n()) != null && S.length));
|
|
592
594
|
}
|
|
593
595
|
function l() {
|
|
594
|
-
var
|
|
595
|
-
return !((
|
|
596
|
+
var S;
|
|
597
|
+
return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? i().children ?? [] : [];
|
|
596
598
|
}
|
|
597
599
|
function s() {
|
|
598
|
-
var
|
|
600
|
+
var b, S, E, R, C;
|
|
599
601
|
return {
|
|
600
602
|
blockChildren: i().children ?? [],
|
|
601
|
-
componentRef: (
|
|
603
|
+
componentRef: (b = t == null ? void 0 : t()) == null ? void 0 : b.component,
|
|
602
604
|
componentOptions: {
|
|
603
605
|
...Me(i()),
|
|
604
606
|
builderContext: e.context,
|
|
605
|
-
...((
|
|
607
|
+
...((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
|
|
606
608
|
builderComponents: e.registeredComponents
|
|
607
609
|
} : {}
|
|
608
610
|
},
|
|
@@ -613,7 +615,7 @@ function H(e) {
|
|
|
613
615
|
isInteractive: !((C = t == null ? void 0 : t()) != null && C.isRSC)
|
|
614
616
|
};
|
|
615
617
|
}
|
|
616
|
-
const [c, d] =
|
|
618
|
+
const [c, d] = p(() => e.context);
|
|
617
619
|
return /* @__PURE__ */ r(f, { children: o() ? /* @__PURE__ */ r(f, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
618
620
|
he,
|
|
619
621
|
{
|
|
@@ -636,14 +638,14 @@ function H(e) {
|
|
|
636
638
|
hasChildren: !1
|
|
637
639
|
}
|
|
638
640
|
) }) : null,
|
|
639
|
-
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((
|
|
641
|
+
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((b, S) => /* @__PURE__ */ r(
|
|
640
642
|
lt,
|
|
641
643
|
{
|
|
642
|
-
repeatContext:
|
|
643
|
-
block:
|
|
644
|
+
repeatContext: b.context,
|
|
645
|
+
block: b.block,
|
|
644
646
|
registeredComponents: e.registeredComponents
|
|
645
647
|
},
|
|
646
|
-
|
|
648
|
+
S
|
|
647
649
|
)) }) : null,
|
|
648
650
|
!q(a()) && !n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ T(
|
|
649
651
|
fe,
|
|
@@ -666,22 +668,22 @@ function H(e) {
|
|
|
666
668
|
isInteractive: s().isInteractive
|
|
667
669
|
}
|
|
668
670
|
),
|
|
669
|
-
(
|
|
671
|
+
(v = l()) == null ? void 0 : v.map((b) => /* @__PURE__ */ r(
|
|
670
672
|
H,
|
|
671
673
|
{
|
|
672
|
-
block:
|
|
674
|
+
block: b,
|
|
673
675
|
context: c,
|
|
674
676
|
registeredComponents: e.registeredComponents
|
|
675
677
|
},
|
|
676
|
-
"block-" +
|
|
678
|
+
"block-" + b.id
|
|
677
679
|
)),
|
|
678
|
-
(V = l()) == null ? void 0 : V.map((
|
|
680
|
+
(V = l()) == null ? void 0 : V.map((b) => /* @__PURE__ */ r(
|
|
679
681
|
ne,
|
|
680
682
|
{
|
|
681
|
-
block:
|
|
683
|
+
block: b,
|
|
682
684
|
context: c
|
|
683
685
|
},
|
|
684
|
-
"block-style-" +
|
|
686
|
+
"block-style-" + b.id
|
|
685
687
|
))
|
|
686
688
|
]
|
|
687
689
|
}
|
|
@@ -774,9 +776,9 @@ function ie(e) {
|
|
|
774
776
|
}
|
|
775
777
|
function st(e) {
|
|
776
778
|
var R;
|
|
777
|
-
const [t, n] =
|
|
779
|
+
const [t, n] = p(
|
|
778
780
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
779
|
-
), [i, a] =
|
|
781
|
+
), [i, a] = p(() => e.columns || []), [o, l] = p(
|
|
780
782
|
() => e.stackColumnsAt || "tablet"
|
|
781
783
|
);
|
|
782
784
|
function s(C) {
|
|
@@ -799,7 +801,7 @@ function st(e) {
|
|
|
799
801
|
}) {
|
|
800
802
|
return o === "never" ? w : C;
|
|
801
803
|
}
|
|
802
|
-
const [g,
|
|
804
|
+
const [g, v] = p(
|
|
803
805
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
804
806
|
);
|
|
805
807
|
function V() {
|
|
@@ -811,7 +813,7 @@ function st(e) {
|
|
|
811
813
|
})
|
|
812
814
|
};
|
|
813
815
|
}
|
|
814
|
-
function
|
|
816
|
+
function b(C) {
|
|
815
817
|
const w = C === 0 ? 0 : t, A = c(C), B = `${w}px`, F = "100%", W = 0;
|
|
816
818
|
return {
|
|
817
819
|
width: A,
|
|
@@ -834,7 +836,7 @@ function st(e) {
|
|
|
834
836
|
})
|
|
835
837
|
};
|
|
836
838
|
}
|
|
837
|
-
function
|
|
839
|
+
function S(C) {
|
|
838
840
|
var A, B;
|
|
839
841
|
return Te(
|
|
840
842
|
((B = (A = e.builderContext.content) == null ? void 0 : A.meta) == null ? void 0 : B.breakpoints) || {}
|
|
@@ -842,7 +844,7 @@ function st(e) {
|
|
|
842
844
|
}
|
|
843
845
|
function E() {
|
|
844
846
|
return `
|
|
845
|
-
@media (max-width: ${
|
|
847
|
+
@media (max-width: ${S("medium")}px) {
|
|
846
848
|
.${e.builderBlock.id}-breakpoints {
|
|
847
849
|
flex-direction: var(--flex-dir-tablet);
|
|
848
850
|
align-items: stretch;
|
|
@@ -854,7 +856,7 @@ function st(e) {
|
|
|
854
856
|
}
|
|
855
857
|
}
|
|
856
858
|
|
|
857
|
-
@media (max-width: ${
|
|
859
|
+
@media (max-width: ${S("small")}px) {
|
|
858
860
|
.${e.builderBlock.id}-breakpoints {
|
|
859
861
|
flex-direction: var(--flex-dir);
|
|
860
862
|
align-items: stretch;
|
|
@@ -879,7 +881,7 @@ function st(e) {
|
|
|
879
881
|
"div",
|
|
880
882
|
{
|
|
881
883
|
className: "builder-column div-53636e90-2",
|
|
882
|
-
style:
|
|
884
|
+
style: b(w),
|
|
883
885
|
key: w
|
|
884
886
|
},
|
|
885
887
|
/* @__PURE__ */ r(
|
|
@@ -1304,7 +1306,7 @@ const gt = {
|
|
|
1304
1306
|
}]
|
|
1305
1307
|
};
|
|
1306
1308
|
function yt(e) {
|
|
1307
|
-
const t = Z(null), [n, i] =
|
|
1309
|
+
const t = Z(null), [n, i] = p(() => []), [a, o] = p(() => []);
|
|
1308
1310
|
return P(() => {
|
|
1309
1311
|
var s;
|
|
1310
1312
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window > "u")
|
|
@@ -1368,7 +1370,7 @@ const St = {
|
|
|
1368
1370
|
}]
|
|
1369
1371
|
}, vt = ["text/javascript", "application/javascript", "application/ecmascript"], pt = (e) => vt.includes(e.type);
|
|
1370
1372
|
function kt(e) {
|
|
1371
|
-
const t = Z(null), [n, i] =
|
|
1373
|
+
const t = Z(null), [n, i] = p(() => []), [a, o] = p(() => []), [l, s] = p(() => !1);
|
|
1372
1374
|
function c() {
|
|
1373
1375
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1374
1376
|
return;
|
|
@@ -1377,13 +1379,13 @@ function kt(e) {
|
|
|
1377
1379
|
const g = d[u];
|
|
1378
1380
|
if (g.src && !n.includes(g.src)) {
|
|
1379
1381
|
n.push(g.src);
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1382
|
+
const v = document.createElement("script");
|
|
1383
|
+
v.async = !0, v.src = g.src, document.head.appendChild(v);
|
|
1382
1384
|
} else if (pt(g) && !a.includes(g.innerText))
|
|
1383
1385
|
try {
|
|
1384
1386
|
a.push(g.innerText), new Function(g.innerText)();
|
|
1385
|
-
} catch (
|
|
1386
|
-
console.warn("`Embed`: Error running script:",
|
|
1387
|
+
} catch (v) {
|
|
1388
|
+
console.warn("`Embed`: Error running script:", v);
|
|
1387
1389
|
}
|
|
1388
1390
|
}
|
|
1389
1391
|
}
|
|
@@ -1430,8 +1432,8 @@ const Ct = {
|
|
|
1430
1432
|
let g = !1;
|
|
1431
1433
|
u.onload = () => {
|
|
1432
1434
|
g = !0, c(u);
|
|
1433
|
-
}, u.addEventListener("error", (
|
|
1434
|
-
console.warn("Image load failed",
|
|
1435
|
+
}, u.addEventListener("error", (v) => {
|
|
1436
|
+
console.warn("Image load failed", v.error), d(v.error);
|
|
1435
1437
|
}), u.src = l, setTimeout(() => {
|
|
1436
1438
|
g || d(new Error("Image load timed out"));
|
|
1437
1439
|
}, s);
|
|
@@ -2014,7 +2016,7 @@ const Mt = (e, t, n = !0) => {
|
|
|
2014
2016
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2015
2017
|
}
|
|
2016
2018
|
};
|
|
2017
|
-
}, Ot = "0.7.
|
|
2019
|
+
}, Ot = "0.7.5", Kt = () => {
|
|
2018
2020
|
Ne("insertMenu", {
|
|
2019
2021
|
name: "_default",
|
|
2020
2022
|
default: !0,
|
|
@@ -2067,8 +2069,8 @@ const Ht = (e = {}) => {
|
|
|
2067
2069
|
let u, g = null;
|
|
2068
2070
|
try {
|
|
2069
2071
|
u = d.apply(null, s);
|
|
2070
|
-
} catch (
|
|
2071
|
-
g =
|
|
2072
|
+
} catch (v) {
|
|
2073
|
+
g = v;
|
|
2072
2074
|
}
|
|
2073
2075
|
g ? (a = window.parent) == null || a.postMessage({
|
|
2074
2076
|
type: "builder.evaluateError",
|
|
@@ -2076,13 +2078,13 @@ const Ht = (e = {}) => {
|
|
|
2076
2078
|
id: c,
|
|
2077
2079
|
error: g.message
|
|
2078
2080
|
}
|
|
2079
|
-
}, "*") : u && typeof u.then == "function" ? u.then((
|
|
2081
|
+
}, "*") : u && typeof u.then == "function" ? u.then((v) => {
|
|
2080
2082
|
var V;
|
|
2081
2083
|
(V = window.parent) == null || V.postMessage({
|
|
2082
2084
|
type: "builder.evaluateResult",
|
|
2083
2085
|
data: {
|
|
2084
2086
|
id: c,
|
|
2085
|
-
result:
|
|
2087
|
+
result: v
|
|
2086
2088
|
}
|
|
2087
2089
|
}, "*");
|
|
2088
2090
|
}).catch(console.error) : (o = window.parent) == null || o.postMessage({
|
|
@@ -2099,18 +2101,18 @@ const Ht = (e = {}) => {
|
|
|
2099
2101
|
};
|
|
2100
2102
|
function zt(e) {
|
|
2101
2103
|
var A, B, F, W, z, ae, oe;
|
|
2102
|
-
const t = Z(null), [n, i] =
|
|
2104
|
+
const t = Z(null), [n, i] = p(() => 0);
|
|
2103
2105
|
function a(m) {
|
|
2104
|
-
var
|
|
2106
|
+
var x, y, k, I, re;
|
|
2105
2107
|
const h = {
|
|
2106
2108
|
...e.builderContextSignal.content,
|
|
2107
2109
|
...m,
|
|
2108
2110
|
data: {
|
|
2109
|
-
...(
|
|
2111
|
+
...(x = e.builderContextSignal.content) == null ? void 0 : x.data,
|
|
2110
2112
|
...m == null ? void 0 : m.data
|
|
2111
2113
|
},
|
|
2112
2114
|
meta: {
|
|
2113
|
-
...(
|
|
2115
|
+
...(y = e.builderContextSignal.content) == null ? void 0 : y.meta,
|
|
2114
2116
|
...m == null ? void 0 : m.meta,
|
|
2115
2117
|
breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((re = (I = e.builderContextSignal.content) == null ? void 0 : I.meta) == null ? void 0 : re.breakpoints)
|
|
2116
2118
|
}
|
|
@@ -2120,18 +2122,18 @@ function zt(e) {
|
|
|
2120
2122
|
content: h
|
|
2121
2123
|
}));
|
|
2122
2124
|
}
|
|
2123
|
-
|
|
2124
|
-
const [o, l] =
|
|
2125
|
+
p(() => 0);
|
|
2126
|
+
const [o, l] = p(
|
|
2125
2127
|
() => !1
|
|
2126
2128
|
);
|
|
2127
2129
|
function s(m) {
|
|
2128
|
-
var
|
|
2130
|
+
var x;
|
|
2129
2131
|
const { data: h } = m;
|
|
2130
2132
|
if (h)
|
|
2131
2133
|
switch (h.type) {
|
|
2132
2134
|
case "builder.configureSdk": {
|
|
2133
|
-
const
|
|
2134
|
-
if (!I || I !== ((
|
|
2135
|
+
const y = h.data, { breakpoints: k, contentId: I } = y;
|
|
2136
|
+
if (!I || I !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id))
|
|
2135
2137
|
return;
|
|
2136
2138
|
k && a({
|
|
2137
2139
|
meta: {
|
|
@@ -2141,15 +2143,15 @@ function zt(e) {
|
|
|
2141
2143
|
break;
|
|
2142
2144
|
}
|
|
2143
2145
|
case "builder.contentUpdate": {
|
|
2144
|
-
const
|
|
2146
|
+
const y = h.data, k = y.key || y.alias || y.entry || y.modelName, I = y.data;
|
|
2145
2147
|
k === e.model && (a(I), i(n + 1));
|
|
2146
2148
|
break;
|
|
2147
2149
|
}
|
|
2148
2150
|
}
|
|
2149
2151
|
}
|
|
2150
2152
|
function c() {
|
|
2151
|
-
var h,
|
|
2152
|
-
const m = (
|
|
2153
|
+
var h, x;
|
|
2154
|
+
const m = (x = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : x.jsCode;
|
|
2153
2155
|
m && _({
|
|
2154
2156
|
code: m,
|
|
2155
2157
|
context: e.context || {},
|
|
@@ -2158,28 +2160,28 @@ function zt(e) {
|
|
|
2158
2160
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2159
2161
|
});
|
|
2160
2162
|
}
|
|
2161
|
-
const [d, u] =
|
|
2163
|
+
const [d, u] = p(() => ({})), [g, v] = p(() => !1);
|
|
2162
2164
|
function V(m) {
|
|
2163
|
-
var h,
|
|
2165
|
+
var h, x;
|
|
2164
2166
|
if (e.builderContextSignal.content) {
|
|
2165
|
-
const
|
|
2167
|
+
const y = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, k = (x = e.builderContextSignal.content) == null ? void 0 : x.id;
|
|
2166
2168
|
ce({
|
|
2167
2169
|
type: "click",
|
|
2168
2170
|
canTrack: U(e.canTrack),
|
|
2169
2171
|
contentId: k,
|
|
2170
2172
|
apiKey: e.apiKey,
|
|
2171
|
-
variationId:
|
|
2173
|
+
variationId: y !== k ? y : void 0,
|
|
2172
2174
|
...Dt(m),
|
|
2173
2175
|
unique: !g
|
|
2174
2176
|
});
|
|
2175
2177
|
}
|
|
2176
|
-
g ||
|
|
2178
|
+
g || v(!0);
|
|
2177
2179
|
}
|
|
2178
|
-
function
|
|
2180
|
+
function b(m) {
|
|
2179
2181
|
return m.replace(
|
|
2180
2182
|
/{{([^}]+)}}/g,
|
|
2181
|
-
(h,
|
|
2182
|
-
code:
|
|
2183
|
+
(h, x) => _({
|
|
2184
|
+
code: x,
|
|
2183
2185
|
context: e.context || {},
|
|
2184
2186
|
localState: void 0,
|
|
2185
2187
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2187,27 +2189,27 @@ function zt(e) {
|
|
|
2187
2189
|
})
|
|
2188
2190
|
);
|
|
2189
2191
|
}
|
|
2190
|
-
function
|
|
2191
|
-
_e(m).then((
|
|
2192
|
+
function S({ url: m, key: h }) {
|
|
2193
|
+
_e(m).then((x) => x.json()).then((x) => {
|
|
2192
2194
|
var k, I;
|
|
2193
|
-
const
|
|
2195
|
+
const y = {
|
|
2194
2196
|
...e.builderContextSignal.rootState,
|
|
2195
|
-
[h]:
|
|
2197
|
+
[h]: x
|
|
2196
2198
|
};
|
|
2197
|
-
(I = (k = e.builderContextSignal).rootSetState) == null || I.call(k,
|
|
2198
|
-
}).catch((
|
|
2199
|
-
console.error("error fetching dynamic data", m,
|
|
2199
|
+
(I = (k = e.builderContextSignal).rootSetState) == null || I.call(k, y), d[h] = !0;
|
|
2200
|
+
}).catch((x) => {
|
|
2201
|
+
console.error("error fetching dynamic data", m, x);
|
|
2200
2202
|
});
|
|
2201
2203
|
}
|
|
2202
2204
|
function E() {
|
|
2203
|
-
var h,
|
|
2204
|
-
const m = ((
|
|
2205
|
-
Object.entries(m).forEach(([
|
|
2206
|
-
if (k && (!d[
|
|
2207
|
-
const I =
|
|
2208
|
-
|
|
2205
|
+
var h, x;
|
|
2206
|
+
const m = ((x = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : x.httpRequests) ?? {};
|
|
2207
|
+
Object.entries(m).forEach(([y, k]) => {
|
|
2208
|
+
if (k && (!d[y] || $())) {
|
|
2209
|
+
const I = b(k);
|
|
2210
|
+
S({
|
|
2209
2211
|
url: I,
|
|
2210
|
-
key:
|
|
2212
|
+
key: y
|
|
2211
2213
|
});
|
|
2212
2214
|
}
|
|
2213
2215
|
});
|
|
@@ -2241,19 +2243,19 @@ function zt(e) {
|
|
|
2241
2243
|
}), Object.values(
|
|
2242
2244
|
e.builderContextSignal.componentInfos
|
|
2243
2245
|
).forEach((h) => {
|
|
2244
|
-
var
|
|
2245
|
-
const
|
|
2246
|
-
(
|
|
2246
|
+
var y;
|
|
2247
|
+
const x = We(h);
|
|
2248
|
+
(y = window.parent) == null || y.postMessage(x, "*");
|
|
2247
2249
|
}), window.addEventListener(
|
|
2248
2250
|
"builder:component:stateChangeListenerActivated",
|
|
2249
2251
|
R
|
|
2250
2252
|
);
|
|
2251
2253
|
}
|
|
2252
2254
|
function w(m) {
|
|
2253
|
-
const h = new URL(location.href).searchParams,
|
|
2254
|
-
`builder.preview.${
|
|
2255
|
+
const h = new URL(location.href).searchParams, x = h.get("builder.preview"), y = h.get(
|
|
2256
|
+
`builder.preview.${x}`
|
|
2255
2257
|
), k = h.get("apiKey") || h.get("builder.space");
|
|
2256
|
-
|
|
2258
|
+
x === e.model && k === e.apiKey && (!e.content || y === e.content.id) && Ce({
|
|
2257
2259
|
model: e.model,
|
|
2258
2260
|
apiKey: e.apiKey,
|
|
2259
2261
|
apiVersion: e.builderContextSignal.apiVersion
|
|
@@ -2289,13 +2291,13 @@ function zt(e) {
|
|
|
2289
2291
|
var m, h;
|
|
2290
2292
|
if (N()) {
|
|
2291
2293
|
if ($() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && U(e.canTrack)) {
|
|
2292
|
-
const
|
|
2294
|
+
const y = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (h = e.builderContextSignal.content) == null ? void 0 : h.id, I = e.apiKey;
|
|
2293
2295
|
ce({
|
|
2294
2296
|
type: "impression",
|
|
2295
2297
|
canTrack: !0,
|
|
2296
2298
|
contentId: k,
|
|
2297
2299
|
apiKey: I,
|
|
2298
|
-
variationId:
|
|
2300
|
+
variationId: y !== k ? y : void 0
|
|
2299
2301
|
});
|
|
2300
2302
|
}
|
|
2301
2303
|
Fe() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2374,7 +2376,7 @@ font-weight: ${l};
|
|
|
2374
2376
|
contentId: t
|
|
2375
2377
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
2376
2378
|
function Gt(e) {
|
|
2377
|
-
const [t, n] =
|
|
2379
|
+
const [t, n] = p(
|
|
2378
2380
|
() => `
|
|
2379
2381
|
${Qt({
|
|
2380
2382
|
cssCode: e.cssCode,
|
|
@@ -2406,22 +2408,17 @@ const Jt = ({
|
|
|
2406
2408
|
locale: n
|
|
2407
2409
|
}) => {
|
|
2408
2410
|
var o, l, s;
|
|
2409
|
-
const i = {};
|
|
2410
|
-
(
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
|
|
2411
|
+
const i = {}, a = ((o = e == null ? void 0 : e.data) == null ? void 0 : o.state) || {};
|
|
2412
|
+
return (s = (l = e == null ? void 0 : e.data) == null ? void 0 : l.inputs) == null || s.forEach((c) => {
|
|
2413
|
+
c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
|
|
2414
|
+
}), {
|
|
2415
|
+
...i,
|
|
2416
|
+
...a,
|
|
2416
2417
|
...t,
|
|
2417
2418
|
...n ? {
|
|
2418
2419
|
locale: n
|
|
2419
2420
|
} : {}
|
|
2420
2421
|
};
|
|
2421
|
-
return {
|
|
2422
|
-
...i,
|
|
2423
|
-
...a
|
|
2424
|
-
};
|
|
2425
2422
|
}, Xt = ({
|
|
2426
2423
|
content: e,
|
|
2427
2424
|
data: t
|
|
@@ -2434,25 +2431,25 @@ const Jt = ({
|
|
|
2434
2431
|
meta: e == null ? void 0 : e.meta
|
|
2435
2432
|
} : void 0;
|
|
2436
2433
|
function ve(e) {
|
|
2437
|
-
var c, d, u, g,
|
|
2438
|
-
const [t, n] =
|
|
2434
|
+
var c, d, u, g, v, V, b;
|
|
2435
|
+
const [t, n] = p(
|
|
2439
2436
|
() => {
|
|
2440
|
-
var
|
|
2437
|
+
var S, E;
|
|
2441
2438
|
return jt({
|
|
2442
2439
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2443
|
-
variationId: (
|
|
2440
|
+
variationId: (S = e.content) == null ? void 0 : S.testVariationId,
|
|
2444
2441
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2445
2442
|
contentId: (E = e.content) == null ? void 0 : E.id
|
|
2446
2443
|
});
|
|
2447
2444
|
}
|
|
2448
2445
|
);
|
|
2449
|
-
function i(
|
|
2446
|
+
function i(S) {
|
|
2450
2447
|
s((E) => ({
|
|
2451
2448
|
...E,
|
|
2452
|
-
rootState:
|
|
2449
|
+
rootState: S
|
|
2453
2450
|
}));
|
|
2454
2451
|
}
|
|
2455
|
-
const [a, o] =
|
|
2452
|
+
const [a, o] = p(
|
|
2456
2453
|
() => [
|
|
2457
2454
|
...be(),
|
|
2458
2455
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2463,8 +2460,8 @@ function ve(e) {
|
|
|
2463
2460
|
...se,
|
|
2464
2461
|
...e.customComponents || []
|
|
2465
2462
|
].reduce(
|
|
2466
|
-
(
|
|
2467
|
-
...
|
|
2463
|
+
(S, { component: E, ...R }) => ({
|
|
2464
|
+
...S,
|
|
2468
2465
|
[R.name]: {
|
|
2469
2466
|
component: E,
|
|
2470
2467
|
...de(R)
|
|
@@ -2472,7 +2469,7 @@ function ve(e) {
|
|
|
2472
2469
|
}),
|
|
2473
2470
|
{}
|
|
2474
2471
|
)
|
|
2475
|
-
), [l, s] =
|
|
2472
|
+
), [l, s] = p(() => ({
|
|
2476
2473
|
content: Xt({
|
|
2477
2474
|
content: e.content,
|
|
2478
2475
|
data: e.data
|
|
@@ -2497,8 +2494,8 @@ function ve(e) {
|
|
|
2497
2494
|
...se,
|
|
2498
2495
|
...e.customComponents || []
|
|
2499
2496
|
].reduce(
|
|
2500
|
-
(
|
|
2501
|
-
...
|
|
2497
|
+
(S, { component: E, ...R }) => ({
|
|
2498
|
+
...S,
|
|
2502
2499
|
[R.name]: de(R)
|
|
2503
2500
|
}),
|
|
2504
2501
|
{}
|
|
@@ -2532,13 +2529,13 @@ function ve(e) {
|
|
|
2532
2529
|
{
|
|
2533
2530
|
contentId: (c = l.content) == null ? void 0 : c.id,
|
|
2534
2531
|
cssCode: (u = (d = l.content) == null ? void 0 : d.data) == null ? void 0 : u.cssCode,
|
|
2535
|
-
customFonts: (
|
|
2532
|
+
customFonts: (v = (g = l.content) == null ? void 0 : g.data) == null ? void 0 : v.customFonts
|
|
2536
2533
|
}
|
|
2537
2534
|
) }),
|
|
2538
2535
|
/* @__PURE__ */ r(
|
|
2539
2536
|
ie,
|
|
2540
2537
|
{
|
|
2541
|
-
blocks: (
|
|
2538
|
+
blocks: (b = (V = l.content) == null ? void 0 : V.data) == null ? void 0 : b.blocks,
|
|
2542
2539
|
context: l,
|
|
2543
2540
|
registeredComponents: a
|
|
2544
2541
|
}
|
|
@@ -2551,7 +2548,7 @@ function ve(e) {
|
|
|
2551
2548
|
}
|
|
2552
2549
|
function Ae(e) {
|
|
2553
2550
|
var l, s;
|
|
2554
|
-
const [t, n] =
|
|
2551
|
+
const [t, n] = p(
|
|
2555
2552
|
() => Ft({
|
|
2556
2553
|
canTrack: U(e.canTrack),
|
|
2557
2554
|
content: e.content
|
|
@@ -2662,7 +2659,7 @@ function en(e) {
|
|
|
2662
2659
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2663
2660
|
].filter(Boolean).join(" ");
|
|
2664
2661
|
}
|
|
2665
|
-
const [n, i] =
|
|
2662
|
+
const [n, i] = p(() => {
|
|
2666
2663
|
var c;
|
|
2667
2664
|
return (c = e.symbol) == null ? void 0 : c.content;
|
|
2668
2665
|
});
|