@builder.io/sdk-react-nextjs 0.6.3 → 0.7.0
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-3a41b1ba.js +23 -0
- package/lib/browser/{USE_CLIENT_BUNDLE-7df521d2.mjs → USE_CLIENT_BUNDLE-fc8c1bc0.mjs} +177 -179
- package/lib/{edge/USE_SERVER_BUNDLE-6554eb5e.mjs → browser/USE_SERVER_BUNDLE-226a15ac.mjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-b339a170.js → browser/USE_SERVER_BUNDLE-d8c698c8.js} +1 -1
- package/lib/browser/{bundle-a1b650c9.js → bundle-0fae602b.js} +8 -8
- package/lib/browser/{bundle-c727cf36.mjs → bundle-3b073b16.mjs} +24 -20
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +7 -7
- package/lib/{node/USE_CLIENT_BUNDLE-7df521d2.mjs → edge/USE_CLIENT_BUNDLE-0e9f8e67.mjs} +177 -179
- package/lib/edge/USE_CLIENT_BUNDLE-d48583e8.js +23 -0
- package/lib/{node/USE_SERVER_BUNDLE-7d2b1f4f.js → edge/USE_SERVER_BUNDLE-105e9ef3.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-4eda8de6.mjs → edge/USE_SERVER_BUNDLE-f6a1e321.mjs} +1 -1
- package/lib/edge/{bundle-56d2ffe3.js → bundle-0c1d9099.js} +24 -24
- package/lib/edge/{bundle-75be1e37.mjs → bundle-ed178c62.mjs} +878 -874
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +7 -7
- package/lib/node/USE_CLIENT_BUNDLE-3a41b1ba.js +23 -0
- package/lib/{edge/USE_CLIENT_BUNDLE-88bd3402.mjs → node/USE_CLIENT_BUNDLE-fc8c1bc0.mjs} +177 -179
- package/lib/{browser/USE_SERVER_BUNDLE-4eda8de6.mjs → node/USE_SERVER_BUNDLE-226a15ac.mjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-7d2b1f4f.js → node/USE_SERVER_BUNDLE-d8c698c8.js} +1 -1
- package/lib/node/{bundle-a1b650c9.js → bundle-0fae602b.js} +8 -8
- package/lib/node/{bundle-c727cf36.mjs → bundle-3b073b16.mjs} +24 -20
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +7 -7
- package/package.json +2 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-ba140db3.js +0 -23
- package/lib/edge/USE_CLIENT_BUNDLE-c1e8e1b1.js +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-ba140db3.js +0 -23
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { g as
|
|
4
|
-
import { useRef as j, useState as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
e.link ? /* @__PURE__ */ n(
|
|
2
|
+
import { jsxs as E, Fragment as m, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { g as T, a as N, i as R, b as w, c as J, l as O, d as P, r as G, s as Q, e as X, _ as W, f as _, h as A, j as Y, k as Z, m as $ } from "./bundle-3b073b16.mjs";
|
|
4
|
+
import { useRef as j, useState as v, useEffect as k, createContext as p } from "react";
|
|
5
|
+
import { p as ee } from "./USE_SERVER_BUNDLE-226a15ac.mjs";
|
|
6
|
+
import { useRouter as te } from "next/navigation";
|
|
7
|
+
function re(e) {
|
|
8
|
+
return /* @__PURE__ */ E(m, { children: [
|
|
9
|
+
e.link ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
10
10
|
"a",
|
|
11
11
|
{
|
|
12
12
|
role: "button",
|
|
@@ -15,7 +15,7 @@ function se(e) {
|
|
|
15
15
|
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
16
16
|
children: e.text
|
|
17
17
|
}
|
|
18
|
-
) }) : /* @__PURE__ */ n(
|
|
18
|
+
) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
...e.attributes,
|
|
@@ -29,13 +29,13 @@ function se(e) {
|
|
|
29
29
|
}` })
|
|
30
30
|
] });
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function de(e) {
|
|
33
33
|
return /* @__PURE__ */ n(
|
|
34
34
|
e.Wrapper,
|
|
35
35
|
{
|
|
36
36
|
...e.wrapperProps,
|
|
37
37
|
attributes: {
|
|
38
|
-
...
|
|
38
|
+
...T({
|
|
39
39
|
block: e.block,
|
|
40
40
|
context: e.context
|
|
41
41
|
}),
|
|
@@ -51,13 +51,13 @@ function ue(e) {
|
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
function se(e) {
|
|
55
|
+
return /* @__PURE__ */ E(m, { children: [
|
|
56
56
|
" ",
|
|
57
|
-
e.hasChildren ? /* @__PURE__ */ n(
|
|
57
|
+
e.hasChildren ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ E(
|
|
58
58
|
e.Wrapper,
|
|
59
59
|
{
|
|
60
|
-
...
|
|
60
|
+
...T({
|
|
61
61
|
block: e.block,
|
|
62
62
|
context: e.context
|
|
63
63
|
}),
|
|
@@ -75,10 +75,10 @@ function me(e) {
|
|
|
75
75
|
" "
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
|
-
) }) : /* @__PURE__ */ n(
|
|
78
|
+
) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
79
79
|
e.Wrapper,
|
|
80
80
|
{
|
|
81
|
-
...
|
|
81
|
+
...T({
|
|
82
82
|
block: e.block,
|
|
83
83
|
context: e.context
|
|
84
84
|
}),
|
|
@@ -95,14 +95,14 @@ function me(e) {
|
|
|
95
95
|
" "
|
|
96
96
|
] });
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
function
|
|
100
|
-
var
|
|
101
|
-
return "builder-blocks" + ((
|
|
98
|
+
function ue(e) {
|
|
99
|
+
function a() {
|
|
100
|
+
var c;
|
|
101
|
+
return "builder-blocks" + ((c = e.blocks) != null && c.length ? "" : " no-blocks");
|
|
102
102
|
}
|
|
103
103
|
function s() {
|
|
104
|
-
var
|
|
105
|
-
|
|
104
|
+
var c, g;
|
|
105
|
+
R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
|
|
106
106
|
{
|
|
107
107
|
type: "builder.clickEmptyBlocks",
|
|
108
108
|
data: {
|
|
@@ -113,9 +113,9 @@ function be(e) {
|
|
|
113
113
|
"*"
|
|
114
114
|
));
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
var
|
|
118
|
-
|
|
116
|
+
function f() {
|
|
117
|
+
var c, g;
|
|
118
|
+
R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
|
|
119
119
|
{
|
|
120
120
|
type: "builder.hoverEmptyBlocks",
|
|
121
121
|
data: {
|
|
@@ -126,17 +126,17 @@ function be(e) {
|
|
|
126
126
|
"*"
|
|
127
127
|
));
|
|
128
128
|
}
|
|
129
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ E(m, { children: [
|
|
130
130
|
/* @__PURE__ */ n(
|
|
131
131
|
"div",
|
|
132
132
|
{
|
|
133
|
-
className:
|
|
133
|
+
className: a() + " div-5821bd52",
|
|
134
134
|
"builder-path": e.path,
|
|
135
135
|
"builder-parent-id": e.parent,
|
|
136
136
|
style: e.styleProp,
|
|
137
|
-
onClick: (
|
|
138
|
-
onMouseEnter: (
|
|
139
|
-
onKeyPress: (
|
|
137
|
+
onClick: (c) => s(),
|
|
138
|
+
onMouseEnter: (c) => f(),
|
|
139
|
+
onKeyPress: (c) => s(),
|
|
140
140
|
children: e.children
|
|
141
141
|
}
|
|
142
142
|
),
|
|
@@ -147,43 +147,43 @@ function be(e) {
|
|
|
147
147
|
}` })
|
|
148
148
|
] });
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function me(e) {
|
|
151
151
|
return /* @__PURE__ */ n("span", { children: e.children });
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
var
|
|
155
|
-
function
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
if (!
|
|
153
|
+
function be(e) {
|
|
154
|
+
var c, g, y, h;
|
|
155
|
+
function a() {
|
|
156
|
+
var b;
|
|
157
|
+
const o = e.image || e.src;
|
|
158
|
+
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
159
159
|
// images, otherwise you can supply this prop manually
|
|
160
|
-
!(
|
|
160
|
+
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
161
161
|
return e.srcset;
|
|
162
|
-
if (e.srcset && ((
|
|
162
|
+
if (e.srcset && ((b = e.image) != null && b.includes("builder.io/api/v1/image"))) {
|
|
163
163
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
164
|
-
return console.debug("Removed given srcset"), w(
|
|
164
|
+
return console.debug("Removed given srcset"), w(o);
|
|
165
165
|
} else if (e.image && !e.srcset)
|
|
166
|
-
return w(
|
|
167
|
-
return w(
|
|
166
|
+
return w(o);
|
|
167
|
+
return w(o);
|
|
168
168
|
}
|
|
169
169
|
function s() {
|
|
170
|
-
var
|
|
171
|
-
return (
|
|
170
|
+
var u;
|
|
171
|
+
return (u = a == null ? void 0 : a()) != null && u.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
173
|
+
function f() {
|
|
174
|
+
const u = {
|
|
175
175
|
position: "absolute",
|
|
176
176
|
height: "100%",
|
|
177
177
|
width: "100%",
|
|
178
178
|
left: "0px",
|
|
179
179
|
top: "0px"
|
|
180
180
|
};
|
|
181
|
-
return e.aspectRatio ?
|
|
181
|
+
return e.aspectRatio ? u : void 0;
|
|
182
182
|
}
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
s() ? /* @__PURE__ */ n(
|
|
183
|
+
return /* @__PURE__ */ E(m, { children: [
|
|
184
|
+
/* @__PURE__ */ E(m, { children: [
|
|
185
|
+
/* @__PURE__ */ E("picture", { children: [
|
|
186
|
+
s() ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
187
187
|
/* @__PURE__ */ n(
|
|
188
188
|
"img",
|
|
189
189
|
{
|
|
@@ -193,16 +193,16 @@ function ge(e) {
|
|
|
193
193
|
style: {
|
|
194
194
|
objectPosition: e.backgroundPosition || "center",
|
|
195
195
|
objectFit: e.backgroundSize || "cover",
|
|
196
|
-
...
|
|
196
|
+
...f()
|
|
197
197
|
},
|
|
198
198
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
|
|
199
199
|
src: e.image,
|
|
200
|
-
srcSet:
|
|
200
|
+
srcSet: a(),
|
|
201
201
|
sizes: e.sizes
|
|
202
202
|
}
|
|
203
203
|
)
|
|
204
204
|
] }),
|
|
205
|
-
e.aspectRatio && !((
|
|
205
|
+
e.aspectRatio && !((g = (c = e.builderBlock) == null ? void 0 : c.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
208
208
|
className: "builder-image-sizer div-ef11a6be",
|
|
@@ -211,8 +211,8 @@ function ge(e) {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
) }) : null,
|
|
214
|
-
(
|
|
215
|
-
!e.fitContent && e.children ? /* @__PURE__ */ n(
|
|
214
|
+
(h = (y = e.builderBlock) == null ? void 0 : y.children) != null && h.length && e.fitContent ? /* @__PURE__ */ n(m, { children: e.children }) : null,
|
|
215
|
+
!e.fitContent && e.children ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
|
|
216
216
|
] }),
|
|
217
217
|
/* @__PURE__ */ n("style", { children: `.img-ef11a6be {
|
|
218
218
|
opacity: 1;
|
|
@@ -233,7 +233,7 @@ function ge(e) {
|
|
|
233
233
|
}` })
|
|
234
234
|
] });
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function fe(e) {
|
|
237
237
|
return /* @__PURE__ */ n(
|
|
238
238
|
"section",
|
|
239
239
|
{
|
|
@@ -254,9 +254,9 @@ function he(e) {
|
|
|
254
254
|
}
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
var
|
|
259
|
-
function
|
|
257
|
+
function ge(e) {
|
|
258
|
+
var f;
|
|
259
|
+
function a() {
|
|
260
260
|
return {
|
|
261
261
|
...e.autoPlay === !0 ? {
|
|
262
262
|
autoPlay: !0
|
|
@@ -278,7 +278,7 @@ function Se(e) {
|
|
|
278
278
|
function s() {
|
|
279
279
|
return {
|
|
280
280
|
...e.attributes,
|
|
281
|
-
...
|
|
281
|
+
...a()
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
return /* @__PURE__ */ n(
|
|
@@ -289,7 +289,7 @@ function Se(e) {
|
|
|
289
289
|
style: {
|
|
290
290
|
width: "100%",
|
|
291
291
|
height: "100%",
|
|
292
|
-
...(
|
|
292
|
+
...(f = e.attributes) == null ? void 0 : f.style,
|
|
293
293
|
objectFit: e.fit,
|
|
294
294
|
objectPosition: e.position,
|
|
295
295
|
// Hack to get object fit to work as expected and
|
|
@@ -301,38 +301,38 @@ function Se(e) {
|
|
|
301
301
|
}
|
|
302
302
|
);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const
|
|
306
|
-
function
|
|
307
|
-
if (!
|
|
304
|
+
function he(e) {
|
|
305
|
+
const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []), [y, h] = v(() => !1);
|
|
306
|
+
function u() {
|
|
307
|
+
if (!a.current || !a.current.getElementsByTagName)
|
|
308
308
|
return;
|
|
309
|
-
const
|
|
310
|
-
for (let
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
s.push(
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
} else if (
|
|
309
|
+
const o = a.current.getElementsByTagName("script");
|
|
310
|
+
for (let b = 0; b < o.length; b++) {
|
|
311
|
+
const x = o[b];
|
|
312
|
+
if (x.src && !s.includes(x.src)) {
|
|
313
|
+
s.push(x.src);
|
|
314
|
+
const C = document.createElement("script");
|
|
315
|
+
C.async = !0, C.src = x.src, document.head.appendChild(C);
|
|
316
|
+
} else if (J(x) && !c.includes(x.innerText))
|
|
317
317
|
try {
|
|
318
|
-
|
|
319
|
-
} catch (
|
|
320
|
-
console.warn("`Embed`: Error running script:",
|
|
318
|
+
c.push(x.innerText), new Function(x.innerText)();
|
|
319
|
+
} catch (C) {
|
|
320
|
+
console.warn("`Embed`: Error running script:", C);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
}, [
|
|
324
|
+
return k(() => {
|
|
325
|
+
a.current && !y && (h(!0), u());
|
|
326
|
+
}, [a.current, y]), /* @__PURE__ */ n(
|
|
327
327
|
"div",
|
|
328
328
|
{
|
|
329
329
|
className: "builder-embed",
|
|
330
|
-
ref:
|
|
330
|
+
ref: a,
|
|
331
331
|
dangerouslySetInnerHTML: { __html: e.content }
|
|
332
332
|
}
|
|
333
333
|
);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Se(e) {
|
|
336
336
|
return /* @__PURE__ */ n(
|
|
337
337
|
"img",
|
|
338
338
|
{
|
|
@@ -344,50 +344,50 @@ function ve(e) {
|
|
|
344
344
|
src: e.imgSrc || e.image,
|
|
345
345
|
...e.attributes
|
|
346
346
|
},
|
|
347
|
-
|
|
347
|
+
R() && e.imgSrc || "default-key"
|
|
348
348
|
);
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
const
|
|
352
|
-
function
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
for (let
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
if (s.includes(
|
|
350
|
+
function xe(e) {
|
|
351
|
+
const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []);
|
|
352
|
+
function y() {
|
|
353
|
+
if (a.current && a.current.getElementsByTagName && typeof window < "u") {
|
|
354
|
+
const h = a.current.getElementsByTagName("script");
|
|
355
|
+
for (let u = 0; u < h.length; u++) {
|
|
356
|
+
const o = h[u];
|
|
357
|
+
if (o.src) {
|
|
358
|
+
if (s.includes(o.src))
|
|
359
359
|
continue;
|
|
360
|
-
s.push(
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
} else if (!
|
|
360
|
+
s.push(o.src);
|
|
361
|
+
const b = document.createElement("script");
|
|
362
|
+
b.async = !0, b.src = o.src, document.head.appendChild(b);
|
|
363
|
+
} else if (!o.type || [
|
|
364
364
|
"text/javascript",
|
|
365
365
|
"application/javascript",
|
|
366
366
|
"application/ecmascript"
|
|
367
|
-
].includes(
|
|
368
|
-
if (
|
|
367
|
+
].includes(o.type)) {
|
|
368
|
+
if (c.includes(o.innerText))
|
|
369
369
|
continue;
|
|
370
370
|
try {
|
|
371
|
-
|
|
372
|
-
} catch (
|
|
373
|
-
console.warn("`CustomCode`: Error running script:",
|
|
371
|
+
c.push(o.innerText), new Function(o.innerText)();
|
|
372
|
+
} catch (b) {
|
|
373
|
+
console.warn("`CustomCode`: Error running script:", b);
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
return
|
|
380
|
-
|
|
379
|
+
return k(() => {
|
|
380
|
+
y();
|
|
381
381
|
}, []), /* @__PURE__ */ n(
|
|
382
382
|
"div",
|
|
383
383
|
{
|
|
384
|
-
ref:
|
|
384
|
+
ref: a,
|
|
385
385
|
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
386
386
|
dangerouslySetInnerHTML: { __html: e.code }
|
|
387
387
|
}
|
|
388
388
|
);
|
|
389
389
|
}
|
|
390
|
-
const
|
|
390
|
+
const ne = p({
|
|
391
391
|
content: null,
|
|
392
392
|
context: {},
|
|
393
393
|
localState: void 0,
|
|
@@ -399,13 +399,11 @@ const ae = te({
|
|
|
399
399
|
componentInfos: {},
|
|
400
400
|
inheritedStyles: {}
|
|
401
401
|
});
|
|
402
|
-
function
|
|
403
|
-
var L, M, q, z
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
function x(t) {
|
|
408
|
-
var i, r, d, g, W;
|
|
402
|
+
function ve(e) {
|
|
403
|
+
var F, L, M, q, z;
|
|
404
|
+
const a = j(null), [s, f] = v(() => 0);
|
|
405
|
+
function c(t) {
|
|
406
|
+
var i, r, d, S, K;
|
|
409
407
|
const l = {
|
|
410
408
|
...e.builderContextSignal.content,
|
|
411
409
|
...t,
|
|
@@ -416,39 +414,39 @@ function ye(e) {
|
|
|
416
414
|
meta: {
|
|
417
415
|
...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
|
|
418
416
|
...t == null ? void 0 : t.meta,
|
|
419
|
-
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((
|
|
417
|
+
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((K = (S = e.builderContextSignal.content) == null ? void 0 : S.meta) == null ? void 0 : K.breakpoints)
|
|
420
418
|
}
|
|
421
419
|
};
|
|
422
|
-
|
|
420
|
+
ee({
|
|
423
421
|
value: l,
|
|
424
422
|
key: l.id
|
|
425
423
|
}).then(() => {
|
|
426
|
-
|
|
424
|
+
U.refresh();
|
|
427
425
|
});
|
|
428
426
|
}
|
|
429
|
-
|
|
430
|
-
const [
|
|
427
|
+
v(() => 0);
|
|
428
|
+
const [g, y] = v(
|
|
431
429
|
() => !1
|
|
432
430
|
);
|
|
433
|
-
function
|
|
431
|
+
function h(t) {
|
|
434
432
|
var i;
|
|
435
433
|
const { data: l } = t;
|
|
436
434
|
if (l)
|
|
437
435
|
switch (l.type) {
|
|
438
436
|
case "builder.configureSdk": {
|
|
439
|
-
const r = l.data, { breakpoints: d, contentId:
|
|
440
|
-
if (!
|
|
437
|
+
const r = l.data, { breakpoints: d, contentId: S } = r;
|
|
438
|
+
if (!S || S !== ((i = e.builderContextSignal.content) == null ? void 0 : i.id))
|
|
441
439
|
return;
|
|
442
|
-
d &&
|
|
440
|
+
d && c({
|
|
443
441
|
meta: {
|
|
444
442
|
breakpoints: d
|
|
445
443
|
}
|
|
446
|
-
}),
|
|
444
|
+
}), f(s + 1);
|
|
447
445
|
break;
|
|
448
446
|
}
|
|
449
447
|
case "builder.contentUpdate": {
|
|
450
|
-
const r = l.data, d = r.key || r.alias || r.entry || r.modelName,
|
|
451
|
-
d === e.model && (
|
|
448
|
+
const r = l.data, d = r.key || r.alias || r.entry || r.modelName, S = r.data;
|
|
449
|
+
d === e.model && (c(S), f(s + 1));
|
|
452
450
|
break;
|
|
453
451
|
}
|
|
454
452
|
}
|
|
@@ -464,22 +462,22 @@ function ye(e) {
|
|
|
464
462
|
rootSetState: e.builderContextSignal.rootSetState
|
|
465
463
|
});
|
|
466
464
|
}
|
|
467
|
-
const [
|
|
465
|
+
const [o, b] = v(() => ({})), [x, C] = v(() => !1);
|
|
468
466
|
function V(t) {
|
|
469
467
|
var l, i;
|
|
470
468
|
if (e.builderContextSignal.content) {
|
|
471
469
|
const r = (l = e.builderContextSignal.content) == null ? void 0 : l.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
472
|
-
|
|
470
|
+
W({
|
|
473
471
|
type: "click",
|
|
474
|
-
canTrack:
|
|
472
|
+
canTrack: _(e.canTrack),
|
|
475
473
|
contentId: d,
|
|
476
474
|
apiKey: e.apiKey,
|
|
477
475
|
variationId: r !== d ? r : void 0,
|
|
478
|
-
|
|
479
|
-
unique: !
|
|
476
|
+
...Y(t),
|
|
477
|
+
unique: !x
|
|
480
478
|
});
|
|
481
479
|
}
|
|
482
|
-
|
|
480
|
+
x || C(!0);
|
|
483
481
|
}
|
|
484
482
|
function D(t) {
|
|
485
483
|
return t.replace(
|
|
@@ -494,37 +492,37 @@ function ye(e) {
|
|
|
494
492
|
);
|
|
495
493
|
}
|
|
496
494
|
function H({ url: t, key: l }) {
|
|
497
|
-
|
|
498
|
-
var d,
|
|
495
|
+
$(t).then((i) => i.json()).then((i) => {
|
|
496
|
+
var d, S;
|
|
499
497
|
const r = {
|
|
500
498
|
...e.builderContextSignal.rootState,
|
|
501
499
|
[l]: i
|
|
502
500
|
};
|
|
503
|
-
(
|
|
501
|
+
(S = (d = e.builderContextSignal).rootSetState) == null || S.call(d, r), o[l] = !0;
|
|
504
502
|
}).catch((i) => {
|
|
505
503
|
console.error("error fetching dynamic data", t, i);
|
|
506
504
|
});
|
|
507
505
|
}
|
|
508
|
-
function
|
|
506
|
+
function B() {
|
|
509
507
|
var l, i;
|
|
510
508
|
const t = ((i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.httpRequests) ?? {};
|
|
511
509
|
Object.entries(t).forEach(([r, d]) => {
|
|
512
|
-
if (d && (!
|
|
513
|
-
const
|
|
510
|
+
if (d && (!o[r] || R())) {
|
|
511
|
+
const S = D(d);
|
|
514
512
|
H({
|
|
515
|
-
url:
|
|
513
|
+
url: S,
|
|
516
514
|
key: r
|
|
517
515
|
});
|
|
518
516
|
}
|
|
519
517
|
});
|
|
520
518
|
}
|
|
521
|
-
function
|
|
522
|
-
|
|
519
|
+
function I() {
|
|
520
|
+
R() && window.dispatchEvent(
|
|
523
521
|
new CustomEvent(
|
|
524
522
|
"builder:component:stateChange",
|
|
525
523
|
{
|
|
526
524
|
detail: {
|
|
527
|
-
state:
|
|
525
|
+
state: Z(e.builderContextSignal.rootState),
|
|
528
526
|
ref: {
|
|
529
527
|
name: e.model
|
|
530
528
|
}
|
|
@@ -533,13 +531,13 @@ function ye(e) {
|
|
|
533
531
|
)
|
|
534
532
|
);
|
|
535
533
|
}
|
|
536
|
-
const
|
|
537
|
-
return
|
|
534
|
+
const U = te();
|
|
535
|
+
return k(() => {
|
|
538
536
|
var t, l;
|
|
539
|
-
if (e.apiKey ||
|
|
537
|
+
if (e.apiKey || O.error(
|
|
540
538
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
541
|
-
),
|
|
542
|
-
if (
|
|
539
|
+
), P()) {
|
|
540
|
+
if (R() && (f(s + 1), window.addEventListener("message", h), G(), Q({
|
|
543
541
|
...e.locale ? {
|
|
544
542
|
locale: e.locale
|
|
545
543
|
} : {},
|
|
@@ -553,46 +551,46 @@ function ye(e) {
|
|
|
553
551
|
e.builderContextSignal.componentInfos
|
|
554
552
|
).forEach((i) => {
|
|
555
553
|
var d;
|
|
556
|
-
const r =
|
|
554
|
+
const r = X(i);
|
|
557
555
|
(d = window.parent) == null || d.postMessage(r, "*");
|
|
558
556
|
}), window.addEventListener(
|
|
559
557
|
"builder:component:stateChangeListenerActivated",
|
|
560
|
-
|
|
558
|
+
I
|
|
561
559
|
)), e.builderContextSignal.content) {
|
|
562
560
|
const i = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
|
|
563
|
-
|
|
561
|
+
W({
|
|
564
562
|
type: "impression",
|
|
565
|
-
canTrack:
|
|
563
|
+
canTrack: _(e.canTrack),
|
|
566
564
|
contentId: r,
|
|
567
565
|
apiKey: e.apiKey,
|
|
568
566
|
variationId: i !== r ? i : void 0
|
|
569
567
|
});
|
|
570
568
|
}
|
|
571
|
-
u(),
|
|
569
|
+
u(), B(), I();
|
|
572
570
|
}
|
|
573
|
-
}, []),
|
|
574
|
-
}, [e.content]),
|
|
575
|
-
|
|
576
|
-
}, [
|
|
571
|
+
}, []), k(() => {
|
|
572
|
+
}, [e.content]), k(() => {
|
|
573
|
+
P() && (window.removeEventListener("message", h), window.addEventListener("message", h));
|
|
574
|
+
}, [g]), k(() => {
|
|
577
575
|
u();
|
|
578
576
|
}, [
|
|
579
|
-
(
|
|
577
|
+
(L = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : L.jsCode,
|
|
580
578
|
e.builderContextSignal.rootState
|
|
581
|
-
]),
|
|
582
|
-
|
|
583
|
-
}, [(
|
|
584
|
-
|
|
585
|
-
}, [e.builderContextSignal.rootState]),
|
|
586
|
-
|
|
579
|
+
]), k(() => {
|
|
580
|
+
B();
|
|
581
|
+
}, [(q = (M = e.builderContextSignal.content) == null ? void 0 : M.data) == null ? void 0 : q.httpRequests]), k(() => {
|
|
582
|
+
I();
|
|
583
|
+
}, [e.builderContextSignal.rootState]), k(() => () => {
|
|
584
|
+
P() && (window.removeEventListener("message", h), window.removeEventListener(
|
|
587
585
|
"builder:component:stateChangeListenerActivated",
|
|
588
|
-
|
|
586
|
+
I
|
|
589
587
|
));
|
|
590
|
-
}, []), /* @__PURE__ */ n(
|
|
588
|
+
}, []), /* @__PURE__ */ n(ne.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
591
589
|
"div",
|
|
592
590
|
{
|
|
593
|
-
ref:
|
|
591
|
+
ref: a,
|
|
594
592
|
onClick: (t) => V(t),
|
|
595
|
-
"builder-content-id": (
|
|
593
|
+
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
596
594
|
"builder-model": e.model,
|
|
597
595
|
...e.showContent ? {} : {
|
|
598
596
|
hidden: !0,
|
|
@@ -601,20 +599,20 @@ function ye(e) {
|
|
|
601
599
|
className: e.classNameProp,
|
|
602
600
|
children: e.children
|
|
603
601
|
},
|
|
604
|
-
|
|
602
|
+
s
|
|
605
603
|
) }) : null });
|
|
606
604
|
}
|
|
607
605
|
export {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
606
|
+
se as B,
|
|
607
|
+
xe as C,
|
|
608
|
+
he as E,
|
|
609
|
+
me as F,
|
|
610
|
+
de as I,
|
|
611
|
+
fe as S,
|
|
612
|
+
ge as V,
|
|
613
|
+
ue as a,
|
|
614
|
+
re as b,
|
|
615
|
+
be as c,
|
|
616
|
+
Se as d,
|
|
617
|
+
ve as e
|
|
620
618
|
};
|