@builder.io/sdk-react-nextjs 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.
- package/lib/browser/USE_CLIENT_BUNDLE-4b1b3c99.cjs +23 -0
- package/lib/browser/{USE_CLIENT_BUNDLE-109dedea.js → USE_CLIENT_BUNDLE-550679f9.js} +250 -265
- package/lib/{edge/USE_SERVER_BUNDLE-35036883.js → browser/USE_SERVER_BUNDLE-464dccd7.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-ab530745.cjs → browser/USE_SERVER_BUNDLE-6234c5ea.cjs} +1 -1
- package/lib/browser/bundle-1d763be7.cjs +168 -0
- package/lib/browser/{bundle-f769d53a.js → bundle-d905bf70.js} +614 -572
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -17
- package/lib/{node/USE_CLIENT_BUNDLE-f1c14740.js → edge/USE_CLIENT_BUNDLE-aa38a343.js} +250 -265
- package/lib/edge/USE_CLIENT_BUNDLE-edb18eb8.cjs +23 -0
- package/lib/{node/USE_SERVER_BUNDLE-a546a48c.js → edge/USE_SERVER_BUNDLE-70c27ea1.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-ce3684c3.cjs → edge/USE_SERVER_BUNDLE-f0eeb33e.cjs} +1 -1
- package/lib/edge/{bundle-593d3883.cjs → bundle-25fa71b1.cjs} +31 -31
- package/lib/edge/{bundle-80ec9a4d.js → bundle-834dbf29.js} +873 -831
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +17 -17
- package/lib/{edge/USE_CLIENT_BUNDLE-bffeb179.js → node/USE_CLIENT_BUNDLE-d30db795.js} +250 -265
- package/lib/node/USE_CLIENT_BUNDLE-def5165a.cjs +23 -0
- package/lib/{browser/USE_SERVER_BUNDLE-a36e67c3.js → node/USE_SERVER_BUNDLE-610c83b3.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-7d41532a.cjs → node/USE_SERVER_BUNDLE-a5db98bc.cjs} +1 -1
- package/lib/node/{bundle-fd27db7d.js → bundle-1f73ead0.js} +236 -194
- package/lib/node/bundle-4efd9623.cjs +208 -0
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -17
- package/package.json +1 -1
- package/types/cjs/blocks/slot/component-info.d.ts +2 -0
- package/types/cjs/blocks/slot/slot.d.ts +11 -0
- package/types/cjs/components/block/block.helpers.d.ts +0 -1
- package/types/cjs/components/block/components/block-wrapper.d.ts +2 -6
- package/types/cjs/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.d.ts +8 -0
- package/types/cjs/components/dynamic-renderer/dynamic-renderer.helpers.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/is-from-trusted-host.d.ts +3 -0
- package/types/cjs/scripts/init-editing.d.ts +1 -0
- package/types/esm/blocks/slot/component-info.d.ts +2 -0
- package/types/esm/blocks/slot/slot.d.ts +11 -0
- package/types/esm/components/block/block.helpers.d.ts +0 -1
- package/types/esm/components/block/components/block-wrapper.d.ts +2 -6
- package/types/esm/components/content-variants/content-variants.types.d.ts +4 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.d.ts +8 -0
- package/types/esm/components/dynamic-renderer/dynamic-renderer.helpers.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/is-from-trusted-host.d.ts +3 -0
- package/types/esm/scripts/init-editing.d.ts +1 -0
- package/lib/browser/USE_CLIENT_BUNDLE-c6f253a6.cjs +0 -23
- package/lib/browser/bundle-ff1186e7.cjs +0 -168
- package/lib/edge/USE_CLIENT_BUNDLE-23097d3f.cjs +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-ff4465dc.cjs +0 -23
- package/lib/node/bundle-6e88a55c.cjs +0 -208
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as w, Fragment as
|
|
3
|
-
import {
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */ w(
|
|
9
|
-
e.link ? /* @__PURE__ */
|
|
2
|
+
import { jsxs as w, Fragment as s, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { i as Y, g as U, a as O, b as E, c as R, d as Z, e as P, f as H, _ as V, h as p, l as ee, j as te, k as D, m as ne, n as ie, r as ae, s as ce, o as le, p as re, q as oe } from "./bundle-834dbf29.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as f, createContext as de, createElement as se } from "react";
|
|
5
|
+
import { p as ue } from "./USE_SERVER_BUNDLE-70c27ea1.js";
|
|
6
|
+
import { useRouter as me } from "next/navigation";
|
|
7
|
+
function ke(e) {
|
|
8
|
+
return /* @__PURE__ */ w(s, { children: [
|
|
9
|
+
e.link ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
10
10
|
"a",
|
|
11
11
|
{
|
|
12
12
|
...e.attributes,
|
|
@@ -15,7 +15,7 @@ function xe(e) {
|
|
|
15
15
|
role: "button",
|
|
16
16
|
children: e.text
|
|
17
17
|
}
|
|
18
|
-
) }) : /* @__PURE__ */
|
|
18
|
+
) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
@@ -24,66 +24,46 @@ function xe(e) {
|
|
|
24
24
|
children: e.text
|
|
25
25
|
}
|
|
26
26
|
) }),
|
|
27
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ t("style", { children: `.button-fdf49de0 {
|
|
28
28
|
all: unset;
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
" ",
|
|
35
|
-
e.hasChildren ? /* @__PURE__ */ i(g, { children: /* @__PURE__ */ w(
|
|
36
|
-
e.Wrapper,
|
|
37
|
-
{
|
|
38
|
-
...T({
|
|
39
|
-
block: e.block,
|
|
40
|
-
context: e.context
|
|
41
|
-
}),
|
|
42
|
-
...B({
|
|
43
|
-
block: e.block,
|
|
44
|
-
rootState: e.context.rootState,
|
|
45
|
-
rootSetState: e.context.rootSetState,
|
|
46
|
-
localState: e.context.localState,
|
|
47
|
-
context: e.context.context,
|
|
48
|
-
stripPrefix: !0
|
|
49
|
-
}),
|
|
50
|
-
children: [
|
|
51
|
-
" ",
|
|
52
|
-
e.children,
|
|
53
|
-
" "
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
) }) : /* @__PURE__ */ i(g, { children: /* @__PURE__ */ i(
|
|
57
|
-
e.Wrapper,
|
|
58
|
-
{
|
|
59
|
-
...T({
|
|
60
|
-
block: e.block,
|
|
61
|
-
context: e.context
|
|
62
|
-
}),
|
|
63
|
-
...B({
|
|
64
|
-
block: e.block,
|
|
65
|
-
rootState: e.context.rootState,
|
|
66
|
-
rootSetState: e.context.rootSetState,
|
|
67
|
-
localState: e.context.localState,
|
|
68
|
-
context: e.context.context,
|
|
69
|
-
stripPrefix: !0
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
) }),
|
|
73
|
-
" "
|
|
74
|
-
] });
|
|
32
|
+
function ge(e) {
|
|
33
|
+
return /* @__PURE__ */ t(s, { children: Y(e.TagName) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(s, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
75
34
|
}
|
|
76
|
-
function
|
|
77
|
-
return /* @__PURE__ */
|
|
35
|
+
function Ce(e) {
|
|
36
|
+
return /* @__PURE__ */ t(
|
|
37
|
+
ge,
|
|
38
|
+
{
|
|
39
|
+
TagName: e.Wrapper,
|
|
40
|
+
attributes: U({
|
|
41
|
+
block: e.block,
|
|
42
|
+
context: e.context
|
|
43
|
+
}),
|
|
44
|
+
actionAttributes: O({
|
|
45
|
+
block: e.block,
|
|
46
|
+
rootState: e.context.rootState,
|
|
47
|
+
rootSetState: e.context.rootSetState,
|
|
48
|
+
localState: e.context.localState,
|
|
49
|
+
context: e.context.context,
|
|
50
|
+
stripPrefix: !0
|
|
51
|
+
}),
|
|
52
|
+
children: e.children
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function we(e) {
|
|
57
|
+
return /* @__PURE__ */ t(
|
|
78
58
|
e.Wrapper,
|
|
79
59
|
{
|
|
80
60
|
...e.wrapperProps,
|
|
81
61
|
attributes: e.includeBlockProps ? {
|
|
82
|
-
...
|
|
62
|
+
...U({
|
|
83
63
|
block: e.block,
|
|
84
64
|
context: e.context
|
|
85
65
|
}),
|
|
86
|
-
...
|
|
66
|
+
...O({
|
|
87
67
|
block: e.block,
|
|
88
68
|
rootState: e.context.rootState,
|
|
89
69
|
rootSetState: e.context.rootSetState,
|
|
@@ -95,14 +75,14 @@ function ye(e) {
|
|
|
95
75
|
}
|
|
96
76
|
);
|
|
97
77
|
}
|
|
98
|
-
function
|
|
78
|
+
function Ee(e) {
|
|
99
79
|
function c() {
|
|
100
|
-
var
|
|
101
|
-
return "builder-blocks" + ((
|
|
80
|
+
var r;
|
|
81
|
+
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
102
82
|
}
|
|
103
|
-
function
|
|
104
|
-
var
|
|
105
|
-
E() && !((
|
|
83
|
+
function u() {
|
|
84
|
+
var r, m;
|
|
85
|
+
E() && !((r = e.blocks) != null && r.length) && ((m = window.parent) == null || m.postMessage(
|
|
106
86
|
{
|
|
107
87
|
type: "builder.clickEmptyBlocks",
|
|
108
88
|
data: {
|
|
@@ -113,9 +93,9 @@ function ke(e) {
|
|
|
113
93
|
"*"
|
|
114
94
|
));
|
|
115
95
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
118
|
-
E() && !((
|
|
96
|
+
function v() {
|
|
97
|
+
var r, m;
|
|
98
|
+
E() && !((r = e.blocks) != null && r.length) && ((m = window.parent) == null || m.postMessage(
|
|
119
99
|
{
|
|
120
100
|
type: "builder.hoverEmptyBlocks",
|
|
121
101
|
data: {
|
|
@@ -126,66 +106,66 @@ function ke(e) {
|
|
|
126
106
|
"*"
|
|
127
107
|
));
|
|
128
108
|
}
|
|
129
|
-
return /* @__PURE__ */ w(
|
|
130
|
-
/* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ w(s, { children: [
|
|
110
|
+
/* @__PURE__ */ t(
|
|
131
111
|
e.BlocksWrapper,
|
|
132
112
|
{
|
|
133
113
|
className: c() + " props-blocks-wrapper-4f2c12d8",
|
|
134
114
|
"builder-path": e.path,
|
|
135
115
|
"builder-parent-id": e.parent,
|
|
136
116
|
style: e.styleProp,
|
|
137
|
-
onClick: (
|
|
138
|
-
onMouseEnter: (
|
|
139
|
-
onKeyPress: (
|
|
117
|
+
onClick: (r) => u(),
|
|
118
|
+
onMouseEnter: (r) => v(),
|
|
119
|
+
onKeyPress: (r) => u(),
|
|
140
120
|
...e.BlocksWrapperProps,
|
|
141
121
|
children: e.children
|
|
142
122
|
}
|
|
143
123
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ t("style", { children: `.props-blocks-wrapper-4f2c12d8 {
|
|
145
125
|
display: flex;
|
|
146
126
|
flex-direction: column;
|
|
147
127
|
align-items: stretch;
|
|
148
128
|
}` })
|
|
149
129
|
] });
|
|
150
130
|
}
|
|
151
|
-
function
|
|
152
|
-
return /* @__PURE__ */
|
|
131
|
+
function Ie(e) {
|
|
132
|
+
return /* @__PURE__ */ t("span", { children: e.children });
|
|
153
133
|
}
|
|
154
|
-
function
|
|
155
|
-
var
|
|
134
|
+
function Re(e) {
|
|
135
|
+
var r, m, S, y;
|
|
156
136
|
function c() {
|
|
157
|
-
var
|
|
158
|
-
const
|
|
159
|
-
if (!
|
|
137
|
+
var g;
|
|
138
|
+
const o = e.image || e.src;
|
|
139
|
+
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
160
140
|
// images, otherwise you can supply this prop manually
|
|
161
|
-
!(
|
|
141
|
+
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
162
142
|
return e.srcset;
|
|
163
|
-
if (e.srcset && ((
|
|
143
|
+
if (e.srcset && ((g = e.image) != null && g.includes("builder.io/api/v1/image"))) {
|
|
164
144
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
165
|
-
return console.debug("Removed given srcset"), R(
|
|
145
|
+
return console.debug("Removed given srcset"), R(o);
|
|
166
146
|
} else if (e.image && !e.srcset)
|
|
167
|
-
return R(
|
|
168
|
-
return R(
|
|
147
|
+
return R(o);
|
|
148
|
+
return R(o);
|
|
169
149
|
}
|
|
170
|
-
function
|
|
171
|
-
var
|
|
172
|
-
return (
|
|
150
|
+
function u() {
|
|
151
|
+
var b;
|
|
152
|
+
return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
173
153
|
}
|
|
174
|
-
function
|
|
175
|
-
const
|
|
154
|
+
function v() {
|
|
155
|
+
const b = {
|
|
176
156
|
position: "absolute",
|
|
177
157
|
height: "100%",
|
|
178
158
|
width: "100%",
|
|
179
159
|
left: "0px",
|
|
180
160
|
top: "0px"
|
|
181
161
|
};
|
|
182
|
-
return e.aspectRatio ?
|
|
162
|
+
return e.aspectRatio ? b : void 0;
|
|
183
163
|
}
|
|
184
|
-
return /* @__PURE__ */ w(
|
|
185
|
-
/* @__PURE__ */ w(
|
|
164
|
+
return /* @__PURE__ */ w(s, { children: [
|
|
165
|
+
/* @__PURE__ */ w(s, { children: [
|
|
186
166
|
/* @__PURE__ */ w("picture", { children: [
|
|
187
|
-
|
|
188
|
-
/* @__PURE__ */
|
|
167
|
+
u() ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("source", { type: "image/webp", srcSet: u() }) }) : null,
|
|
168
|
+
/* @__PURE__ */ t(
|
|
189
169
|
"img",
|
|
190
170
|
{
|
|
191
171
|
loading: "lazy",
|
|
@@ -194,7 +174,7 @@ function we(e) {
|
|
|
194
174
|
style: {
|
|
195
175
|
objectPosition: e.backgroundPosition || "center",
|
|
196
176
|
objectFit: e.backgroundSize || "cover",
|
|
197
|
-
...
|
|
177
|
+
...v()
|
|
198
178
|
},
|
|
199
179
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
|
|
200
180
|
src: e.image,
|
|
@@ -203,7 +183,7 @@ function we(e) {
|
|
|
203
183
|
}
|
|
204
184
|
)
|
|
205
185
|
] }),
|
|
206
|
-
e.aspectRatio && !((
|
|
186
|
+
e.aspectRatio && !((m = (r = e.builderBlock) == null ? void 0 : r.children) != null && m.length && e.fitContent) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
207
187
|
"div",
|
|
208
188
|
{
|
|
209
189
|
className: "builder-image-sizer div-40c70c9b",
|
|
@@ -212,10 +192,10 @@ function we(e) {
|
|
|
212
192
|
}
|
|
213
193
|
}
|
|
214
194
|
) }) : null,
|
|
215
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
216
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
195
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: e.children }) : null,
|
|
196
|
+
!e.fitContent && e.children ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
217
197
|
] }),
|
|
218
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ t("style", { children: `.img-40c70c9b {
|
|
219
199
|
opacity: 1;
|
|
220
200
|
transition: opacity 0.2s ease-in-out;
|
|
221
201
|
}.div-40c70c9b {
|
|
@@ -234,8 +214,8 @@ function we(e) {
|
|
|
234
214
|
}` })
|
|
235
215
|
] });
|
|
236
216
|
}
|
|
237
|
-
function
|
|
238
|
-
return /* @__PURE__ */
|
|
217
|
+
function Pe(e) {
|
|
218
|
+
return /* @__PURE__ */ t(
|
|
239
219
|
"section",
|
|
240
220
|
{
|
|
241
221
|
...e.attributes,
|
|
@@ -255,36 +235,36 @@ function Ee(e) {
|
|
|
255
235
|
}
|
|
256
236
|
);
|
|
257
237
|
}
|
|
258
|
-
function
|
|
259
|
-
const c =
|
|
260
|
-
return
|
|
238
|
+
function Te(e) {
|
|
239
|
+
const c = T(null), [u, v] = x(() => []), [r, m] = x(() => []);
|
|
240
|
+
return f(() => {
|
|
261
241
|
var y;
|
|
262
242
|
if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
|
|
263
243
|
return;
|
|
264
244
|
const S = c.current.getElementsByTagName("script");
|
|
265
|
-
for (let
|
|
266
|
-
const
|
|
267
|
-
if (
|
|
268
|
-
if (
|
|
245
|
+
for (let b = 0; b < S.length; b++) {
|
|
246
|
+
const o = S[b];
|
|
247
|
+
if (o.src) {
|
|
248
|
+
if (u.includes(o.src))
|
|
269
249
|
continue;
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
} else if (!
|
|
250
|
+
u.push(o.src);
|
|
251
|
+
const g = document.createElement("script");
|
|
252
|
+
g.async = !0, g.src = o.src, document.head.appendChild(g);
|
|
253
|
+
} else if (!o.type || [
|
|
274
254
|
"text/javascript",
|
|
275
255
|
"application/javascript",
|
|
276
256
|
"application/ecmascript"
|
|
277
|
-
].includes(
|
|
278
|
-
if (
|
|
257
|
+
].includes(o.type)) {
|
|
258
|
+
if (r.includes(o.innerText))
|
|
279
259
|
continue;
|
|
280
260
|
try {
|
|
281
|
-
|
|
282
|
-
} catch (
|
|
283
|
-
console.warn("`CustomCode`: Error running script:",
|
|
261
|
+
r.push(o.innerText), new Function(o.innerText)();
|
|
262
|
+
} catch (g) {
|
|
263
|
+
console.warn("`CustomCode`: Error running script:", g);
|
|
284
264
|
}
|
|
285
265
|
}
|
|
286
266
|
}
|
|
287
|
-
}, []), /* @__PURE__ */
|
|
267
|
+
}, []), /* @__PURE__ */ t(
|
|
288
268
|
"div",
|
|
289
269
|
{
|
|
290
270
|
ref: c,
|
|
@@ -293,29 +273,29 @@ function Ie(e) {
|
|
|
293
273
|
}
|
|
294
274
|
);
|
|
295
275
|
}
|
|
296
|
-
function
|
|
297
|
-
const c =
|
|
298
|
-
function
|
|
276
|
+
function Ne(e) {
|
|
277
|
+
const c = T(null), [u, v] = x(() => []), [r, m] = x(() => []), [S, y] = x(() => !1);
|
|
278
|
+
function b() {
|
|
299
279
|
if (!c.current || !c.current.getElementsByTagName)
|
|
300
280
|
return;
|
|
301
|
-
const
|
|
302
|
-
for (let
|
|
303
|
-
const k =
|
|
304
|
-
if (k.src && !
|
|
305
|
-
|
|
281
|
+
const o = c.current.getElementsByTagName("script");
|
|
282
|
+
for (let g = 0; g < o.length; g++) {
|
|
283
|
+
const k = o[g];
|
|
284
|
+
if (k.src && !u.includes(k.src)) {
|
|
285
|
+
u.push(k.src);
|
|
306
286
|
const C = document.createElement("script");
|
|
307
287
|
C.async = !0, C.src = k.src, document.head.appendChild(C);
|
|
308
|
-
} else if (
|
|
288
|
+
} else if (Z(k) && !r.includes(k.innerText))
|
|
309
289
|
try {
|
|
310
|
-
|
|
290
|
+
r.push(k.innerText), new Function(k.innerText)();
|
|
311
291
|
} catch (C) {
|
|
312
292
|
console.warn("`Embed`: Error running script:", C);
|
|
313
293
|
}
|
|
314
294
|
}
|
|
315
295
|
}
|
|
316
|
-
return
|
|
317
|
-
c.current && !S && (y(!0),
|
|
318
|
-
}, [c.current, S]), /* @__PURE__ */
|
|
296
|
+
return f(() => {
|
|
297
|
+
c.current && !S && (y(!0), b());
|
|
298
|
+
}, [c.current, S]), /* @__PURE__ */ t(
|
|
319
299
|
"div",
|
|
320
300
|
{
|
|
321
301
|
className: "builder-embed",
|
|
@@ -324,8 +304,8 @@ function Re(e) {
|
|
|
324
304
|
}
|
|
325
305
|
);
|
|
326
306
|
}
|
|
327
|
-
function
|
|
328
|
-
return /* @__PURE__ */
|
|
307
|
+
function Be(e) {
|
|
308
|
+
return /* @__PURE__ */ t(
|
|
329
309
|
"img",
|
|
330
310
|
{
|
|
331
311
|
style: {
|
|
@@ -339,8 +319,8 @@ function Pe(e) {
|
|
|
339
319
|
E() && e.imgSrc || "default-key"
|
|
340
320
|
);
|
|
341
321
|
}
|
|
342
|
-
function
|
|
343
|
-
var
|
|
322
|
+
function Le(e) {
|
|
323
|
+
var v, r, m, S, y, b, o;
|
|
344
324
|
function c() {
|
|
345
325
|
return {
|
|
346
326
|
...e.autoPlay === !0 ? {
|
|
@@ -360,7 +340,7 @@ function Te(e) {
|
|
|
360
340
|
} : {}
|
|
361
341
|
};
|
|
362
342
|
}
|
|
363
|
-
function
|
|
343
|
+
function u() {
|
|
364
344
|
return {
|
|
365
345
|
...c()
|
|
366
346
|
};
|
|
@@ -372,16 +352,16 @@ function Te(e) {
|
|
|
372
352
|
position: "relative"
|
|
373
353
|
},
|
|
374
354
|
children: [
|
|
375
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ t(
|
|
376
356
|
"video",
|
|
377
357
|
{
|
|
378
358
|
className: "builder-video",
|
|
379
|
-
...
|
|
359
|
+
...u(),
|
|
380
360
|
preload: e.preload || "metadata",
|
|
381
361
|
style: {
|
|
382
362
|
width: "100%",
|
|
383
363
|
height: "100%",
|
|
384
|
-
...(
|
|
364
|
+
...(v = e.attributes) == null ? void 0 : v.style,
|
|
385
365
|
objectFit: e.fit,
|
|
386
366
|
objectPosition: e.position,
|
|
387
367
|
// Hack to get object fit to work as expected and
|
|
@@ -394,10 +374,10 @@ function Te(e) {
|
|
|
394
374
|
},
|
|
395
375
|
src: e.video || "no-src",
|
|
396
376
|
poster: e.posterImage,
|
|
397
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
377
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ t("source", { type: "video/mp4", src: e.video })
|
|
398
378
|
}
|
|
399
379
|
),
|
|
400
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
380
|
+
e.aspectRatio && !(e.fitContent && ((m = (r = e.builderBlock) == null ? void 0 : r.children) != null && m.length)) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
401
381
|
"div",
|
|
402
382
|
{
|
|
403
383
|
style: {
|
|
@@ -408,7 +388,7 @@ function Te(e) {
|
|
|
408
388
|
}
|
|
409
389
|
}
|
|
410
390
|
) }) : null,
|
|
411
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
391
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
412
392
|
"div",
|
|
413
393
|
{
|
|
414
394
|
style: {
|
|
@@ -419,7 +399,7 @@ function Te(e) {
|
|
|
419
399
|
children: e.children
|
|
420
400
|
}
|
|
421
401
|
) }) : null,
|
|
422
|
-
(
|
|
402
|
+
(o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
423
403
|
"div",
|
|
424
404
|
{
|
|
425
405
|
style: {
|
|
@@ -440,7 +420,7 @@ function Te(e) {
|
|
|
440
420
|
}
|
|
441
421
|
);
|
|
442
422
|
}
|
|
443
|
-
const
|
|
423
|
+
const he = de({
|
|
444
424
|
content: null,
|
|
445
425
|
context: {},
|
|
446
426
|
localState: void 0,
|
|
@@ -454,101 +434,103 @@ const ue = oe({
|
|
|
454
434
|
BlocksWrapper: "div",
|
|
455
435
|
BlocksWrapperProps: {}
|
|
456
436
|
});
|
|
457
|
-
function
|
|
458
|
-
var
|
|
459
|
-
const c =
|
|
460
|
-
|
|
461
|
-
function
|
|
437
|
+
function je(e) {
|
|
438
|
+
var W, F, K, z, A, M, _;
|
|
439
|
+
const c = T(null), [u, v] = x(() => 0);
|
|
440
|
+
x(() => !0);
|
|
441
|
+
function r(n) {
|
|
462
442
|
var a, l;
|
|
463
|
-
const
|
|
443
|
+
const i = {
|
|
464
444
|
...e.builderContextSignal.rootState,
|
|
465
|
-
...
|
|
445
|
+
...n
|
|
466
446
|
};
|
|
467
|
-
e.builderContextSignal.rootSetState ? (l = (a = e.builderContextSignal).rootSetState) == null || l.call(a,
|
|
447
|
+
e.builderContextSignal.rootSetState ? (l = (a = e.builderContextSignal).rootSetState) == null || l.call(a, i) : e.builderContextSignal.rootState = i;
|
|
468
448
|
}
|
|
469
|
-
function
|
|
470
|
-
var a, l, d, h,
|
|
471
|
-
const
|
|
449
|
+
function m(n) {
|
|
450
|
+
var a, l, d, h, q;
|
|
451
|
+
const i = {
|
|
472
452
|
...e.builderContextSignal.content,
|
|
473
|
-
...
|
|
453
|
+
...n,
|
|
474
454
|
data: {
|
|
475
455
|
...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
|
|
476
|
-
...
|
|
456
|
+
...n == null ? void 0 : n.data
|
|
477
457
|
},
|
|
478
458
|
meta: {
|
|
479
459
|
...(l = e.builderContextSignal.content) == null ? void 0 : l.meta,
|
|
480
|
-
...
|
|
481
|
-
breakpoints: ((d =
|
|
460
|
+
...n == null ? void 0 : n.meta,
|
|
461
|
+
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (h = e.builderContextSignal.content) == null ? void 0 : h.meta) == null ? void 0 : q.breakpoints)
|
|
482
462
|
}
|
|
483
463
|
};
|
|
484
|
-
|
|
485
|
-
value:
|
|
486
|
-
key:
|
|
464
|
+
ue({
|
|
465
|
+
value: i,
|
|
466
|
+
key: i.id
|
|
487
467
|
}).then(() => {
|
|
488
468
|
X.refresh();
|
|
489
469
|
});
|
|
490
470
|
}
|
|
491
|
-
|
|
492
|
-
const [S, y] =
|
|
471
|
+
x(() => 0);
|
|
472
|
+
const [S, y] = x(
|
|
493
473
|
() => !1
|
|
494
|
-
), [
|
|
474
|
+
), [b, o] = x(
|
|
495
475
|
() => e.contentWrapper || "div"
|
|
496
476
|
);
|
|
497
|
-
function
|
|
477
|
+
function g(n) {
|
|
498
478
|
var a;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
479
|
+
if (!te(e.trustedHosts, n))
|
|
480
|
+
return;
|
|
481
|
+
const { data: i } = n;
|
|
482
|
+
if (i)
|
|
483
|
+
switch (i.type) {
|
|
502
484
|
case "builder.configureSdk": {
|
|
503
|
-
const l =
|
|
485
|
+
const l = i.data, { breakpoints: d, contentId: h } = l;
|
|
504
486
|
if (!h || h !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
|
|
505
487
|
return;
|
|
506
|
-
d &&
|
|
488
|
+
d && m({
|
|
507
489
|
meta: {
|
|
508
490
|
breakpoints: d
|
|
509
491
|
}
|
|
510
|
-
}),
|
|
492
|
+
}), v(u + 1);
|
|
511
493
|
break;
|
|
512
494
|
}
|
|
513
495
|
case "builder.contentUpdate": {
|
|
514
|
-
const l =
|
|
515
|
-
d === e.model && (
|
|
496
|
+
const l = i.data, d = l.key || l.alias || l.entry || l.modelName, h = l.data;
|
|
497
|
+
d === e.model && (m(h), v(u + 1));
|
|
516
498
|
break;
|
|
517
499
|
}
|
|
518
500
|
}
|
|
519
501
|
}
|
|
520
502
|
function k() {
|
|
521
|
-
var
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
code:
|
|
503
|
+
var i, a;
|
|
504
|
+
const n = (a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.jsCode;
|
|
505
|
+
n && D({
|
|
506
|
+
code: n,
|
|
525
507
|
context: e.context || {},
|
|
526
508
|
localState: void 0,
|
|
527
509
|
rootState: e.builderContextSignal.rootState,
|
|
528
510
|
rootSetState: e.builderContextSignal.rootSetState
|
|
529
511
|
});
|
|
530
512
|
}
|
|
531
|
-
const [C,
|
|
532
|
-
function $(
|
|
533
|
-
var
|
|
513
|
+
const [C, be] = x(() => ({})), [N, J] = x(() => !1);
|
|
514
|
+
function $(n) {
|
|
515
|
+
var i, a;
|
|
534
516
|
if (e.builderContextSignal.content) {
|
|
535
|
-
const l = (
|
|
536
|
-
|
|
517
|
+
const l = (i = e.builderContextSignal.content) == null ? void 0 : i.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
|
|
518
|
+
V({
|
|
537
519
|
type: "click",
|
|
538
|
-
canTrack:
|
|
520
|
+
canTrack: H(e.canTrack),
|
|
539
521
|
contentId: d,
|
|
540
522
|
apiKey: e.apiKey,
|
|
541
523
|
variationId: l !== d ? l : void 0,
|
|
542
|
-
...
|
|
543
|
-
unique: !
|
|
524
|
+
...ne(n),
|
|
525
|
+
unique: !N
|
|
544
526
|
});
|
|
545
527
|
}
|
|
546
|
-
|
|
528
|
+
N || J(!0);
|
|
547
529
|
}
|
|
548
|
-
function G(
|
|
549
|
-
return
|
|
530
|
+
function G(n) {
|
|
531
|
+
return n.replace(
|
|
550
532
|
/{{([^}]+)}}/g,
|
|
551
|
-
(
|
|
533
|
+
(i, a) => D({
|
|
552
534
|
code: a,
|
|
553
535
|
context: e.context || {},
|
|
554
536
|
localState: void 0,
|
|
@@ -557,22 +539,22 @@ function Be(e) {
|
|
|
557
539
|
})
|
|
558
540
|
);
|
|
559
541
|
}
|
|
560
|
-
function Q({ url:
|
|
561
|
-
|
|
542
|
+
function Q({ url: n, key: i }) {
|
|
543
|
+
oe(n).then((a) => a.json()).then((a) => {
|
|
562
544
|
var d, h;
|
|
563
545
|
const l = {
|
|
564
546
|
...e.builderContextSignal.rootState,
|
|
565
|
-
[
|
|
547
|
+
[i]: a
|
|
566
548
|
};
|
|
567
|
-
(h = (d = e.builderContextSignal).rootSetState) == null || h.call(d, l), C[
|
|
549
|
+
(h = (d = e.builderContextSignal).rootSetState) == null || h.call(d, l), C[i] = !0;
|
|
568
550
|
}).catch((a) => {
|
|
569
|
-
console.error("error fetching dynamic data",
|
|
551
|
+
console.error("error fetching dynamic data", n, a);
|
|
570
552
|
});
|
|
571
553
|
}
|
|
572
|
-
function
|
|
573
|
-
var
|
|
574
|
-
const
|
|
575
|
-
Object.entries(
|
|
554
|
+
function B() {
|
|
555
|
+
var i, a;
|
|
556
|
+
const n = ((a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.httpRequests) ?? {};
|
|
557
|
+
Object.entries(n).forEach(([l, d]) => {
|
|
576
558
|
if (d && (!C[l] || E())) {
|
|
577
559
|
const h = G(d);
|
|
578
560
|
Q({
|
|
@@ -588,7 +570,7 @@ function Be(e) {
|
|
|
588
570
|
"builder:component:stateChange",
|
|
589
571
|
{
|
|
590
572
|
detail: {
|
|
591
|
-
state:
|
|
573
|
+
state: ie(e.builderContextSignal.rootState),
|
|
592
574
|
ref: {
|
|
593
575
|
name: e.model
|
|
594
576
|
}
|
|
@@ -597,8 +579,8 @@ function Be(e) {
|
|
|
597
579
|
)
|
|
598
580
|
);
|
|
599
581
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
582
|
+
function L(n) {
|
|
583
|
+
v(u + 1), window.addEventListener("message", g), ae(), ce({
|
|
602
584
|
...e.locale ? {
|
|
603
585
|
locale: e.locale
|
|
604
586
|
} : {},
|
|
@@ -607,61 +589,64 @@ function Be(e) {
|
|
|
607
589
|
} : {},
|
|
608
590
|
...e.enrich ? {
|
|
609
591
|
enrich: e.enrich
|
|
592
|
+
} : {},
|
|
593
|
+
...e.trustedHosts ? {
|
|
594
|
+
trustedHosts: e.trustedHosts
|
|
610
595
|
} : {}
|
|
611
596
|
}), Object.values(
|
|
612
597
|
e.builderContextSignal.componentInfos
|
|
613
|
-
).forEach((
|
|
598
|
+
).forEach((i) => {
|
|
614
599
|
var l;
|
|
615
|
-
const a =
|
|
600
|
+
const a = le(i);
|
|
616
601
|
(l = window.parent) == null || l.postMessage(a, "*");
|
|
617
602
|
}), window.addEventListener(
|
|
618
603
|
"builder:component:stateChangeListenerActivated",
|
|
619
604
|
I
|
|
620
605
|
);
|
|
621
606
|
}
|
|
622
|
-
function
|
|
623
|
-
const
|
|
607
|
+
function j(n) {
|
|
608
|
+
const i = new URL(location.href).searchParams, a = i.get("builder.preview"), l = i.get(
|
|
624
609
|
`builder.preview.${a}`
|
|
625
|
-
), d =
|
|
626
|
-
a === e.model && d === e.apiKey && (!e.content || l === e.content.id) &&
|
|
610
|
+
), d = i.get("apiKey") || i.get("builder.space");
|
|
611
|
+
a === e.model && d === e.apiKey && (!e.content || l === e.content.id) && re({
|
|
627
612
|
model: e.model,
|
|
628
613
|
apiKey: e.apiKey,
|
|
629
614
|
apiVersion: e.builderContextSignal.apiVersion
|
|
630
615
|
}).then((h) => {
|
|
631
|
-
h &&
|
|
616
|
+
h && m(h);
|
|
632
617
|
});
|
|
633
618
|
}
|
|
634
|
-
const X =
|
|
635
|
-
return
|
|
636
|
-
var
|
|
637
|
-
return (
|
|
619
|
+
const X = me();
|
|
620
|
+
return f(() => {
|
|
621
|
+
var n;
|
|
622
|
+
return (n = c.current) == null || n.addEventListener(
|
|
638
623
|
"initeditingbldr",
|
|
639
|
-
|
|
624
|
+
L
|
|
640
625
|
), () => {
|
|
641
|
-
var
|
|
642
|
-
return (
|
|
626
|
+
var i;
|
|
627
|
+
return (i = c.current) == null ? void 0 : i.removeEventListener(
|
|
643
628
|
"initeditingbldr",
|
|
644
|
-
|
|
629
|
+
L
|
|
645
630
|
);
|
|
646
631
|
};
|
|
647
|
-
}, []),
|
|
648
|
-
var
|
|
649
|
-
return (
|
|
632
|
+
}, []), f(() => {
|
|
633
|
+
var n;
|
|
634
|
+
return (n = c.current) == null || n.addEventListener(
|
|
650
635
|
"initpreviewingbldr",
|
|
651
|
-
|
|
636
|
+
j
|
|
652
637
|
), () => {
|
|
653
|
-
var
|
|
654
|
-
return (
|
|
638
|
+
var i;
|
|
639
|
+
return (i = c.current) == null ? void 0 : i.removeEventListener(
|
|
655
640
|
"initpreviewingbldr",
|
|
656
|
-
|
|
641
|
+
j
|
|
657
642
|
);
|
|
658
643
|
};
|
|
659
|
-
}, []),
|
|
660
|
-
var
|
|
644
|
+
}, []), f(() => {
|
|
645
|
+
var n, i;
|
|
661
646
|
if (P()) {
|
|
662
|
-
if (E() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content &&
|
|
663
|
-
const l = (
|
|
664
|
-
|
|
647
|
+
if (E() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
|
|
648
|
+
const l = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id, h = e.apiKey;
|
|
649
|
+
V({
|
|
665
650
|
type: "impression",
|
|
666
651
|
canTrack: !0,
|
|
667
652
|
contentId: d,
|
|
@@ -669,64 +654,64 @@ function Be(e) {
|
|
|
669
654
|
variationId: l !== d ? l : void 0
|
|
670
655
|
});
|
|
671
656
|
}
|
|
672
|
-
|
|
657
|
+
p() && c.current;
|
|
673
658
|
}
|
|
674
|
-
}, []),
|
|
675
|
-
e.apiKey ||
|
|
659
|
+
}, []), f(() => {
|
|
660
|
+
e.apiKey || ee.error(
|
|
676
661
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
677
|
-
), k(),
|
|
678
|
-
}, []),
|
|
679
|
-
}, [e.content]),
|
|
680
|
-
P() && (window.removeEventListener("message",
|
|
681
|
-
}, [S]),
|
|
662
|
+
), k(), B(), I();
|
|
663
|
+
}, []), f(() => {
|
|
664
|
+
}, [e.content]), f(() => {
|
|
665
|
+
P() && (window.removeEventListener("message", g), window.addEventListener("message", g));
|
|
666
|
+
}, [S]), f(() => {
|
|
682
667
|
k();
|
|
683
668
|
}, [
|
|
684
|
-
(
|
|
669
|
+
(F = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : F.jsCode,
|
|
685
670
|
e.builderContextSignal.rootState
|
|
686
|
-
]),
|
|
687
|
-
|
|
688
|
-
}, [(
|
|
671
|
+
]), f(() => {
|
|
672
|
+
B();
|
|
673
|
+
}, [(z = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : z.httpRequests]), f(() => {
|
|
689
674
|
I();
|
|
690
|
-
}, [e.builderContextSignal.rootState]),
|
|
691
|
-
e.data &&
|
|
692
|
-
}, [e.data]),
|
|
693
|
-
e.locale &&
|
|
675
|
+
}, [e.builderContextSignal.rootState]), f(() => {
|
|
676
|
+
e.data && r(e.data);
|
|
677
|
+
}, [e.data]), f(() => {
|
|
678
|
+
e.locale && r({
|
|
694
679
|
locale: e.locale
|
|
695
680
|
});
|
|
696
|
-
}, [e.locale]),
|
|
697
|
-
P() && (window.removeEventListener("message",
|
|
681
|
+
}, [e.locale]), f(() => () => {
|
|
682
|
+
P() && (window.removeEventListener("message", g), window.removeEventListener(
|
|
698
683
|
"builder:component:stateChangeListenerActivated",
|
|
699
684
|
I
|
|
700
685
|
));
|
|
701
|
-
}, []), /* @__PURE__ */
|
|
702
|
-
|
|
686
|
+
}, []), /* @__PURE__ */ t(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ se(
|
|
687
|
+
b,
|
|
703
688
|
{
|
|
704
|
-
key:
|
|
689
|
+
key: u,
|
|
705
690
|
ref: c,
|
|
706
|
-
onClick: (
|
|
707
|
-
"builder-content-id": (
|
|
691
|
+
onClick: (n) => $(n),
|
|
692
|
+
"builder-content-id": (A = e.builderContextSignal.content) == null ? void 0 : A.id,
|
|
708
693
|
"builder-model": e.model,
|
|
709
694
|
...e.showContent ? {} : {
|
|
710
695
|
hidden: !0,
|
|
711
696
|
"aria-hidden": !0
|
|
712
697
|
},
|
|
713
698
|
...e.contentWrapperProps,
|
|
714
|
-
className: `variant-${((
|
|
699
|
+
className: `variant-${((M = e.content) == null ? void 0 : M.testVariationId) || ((_ = e.content) == null ? void 0 : _.id)}`
|
|
715
700
|
},
|
|
716
701
|
e.children
|
|
717
702
|
) }) : null });
|
|
718
703
|
}
|
|
719
704
|
export {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
705
|
+
Ce as B,
|
|
706
|
+
Te as C,
|
|
707
|
+
Ne as E,
|
|
708
|
+
Ie as F,
|
|
709
|
+
we as I,
|
|
710
|
+
Pe as S,
|
|
711
|
+
Le as V,
|
|
712
|
+
Ee as a,
|
|
713
|
+
ke as b,
|
|
714
|
+
Re as c,
|
|
715
|
+
Be as d,
|
|
716
|
+
je as e
|
|
732
717
|
};
|