@builder.io/sdk-react-nextjs 0.7.3 → 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/USE_CLIENT_BUNDLE-02851f5b.js +711 -0
- package/lib/browser/USE_CLIENT_BUNDLE-19024ae3.cjs +23 -0
- package/lib/{edge/USE_SERVER_BUNDLE-6089c743.js → browser/USE_SERVER_BUNDLE-0dbfec06.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-edaaf934.cjs → browser/USE_SERVER_BUNDLE-99af92f3.cjs} +1 -1
- package/lib/browser/{bundle-34c6ede8.cjs → bundle-cf866f2c.cjs} +111 -19
- package/lib/browser/{bundle-abfb58cd.js → bundle-ed21dd97.js} +556 -545
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-853614ad.cjs +23 -0
- package/lib/edge/USE_CLIENT_BUNDLE-a1ac1e61.js +711 -0
- package/lib/{node/USE_SERVER_BUNDLE-d10edbf4.cjs → edge/USE_SERVER_BUNDLE-949923da.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-ee34a991.js → edge/USE_SERVER_BUNDLE-f8e4c4d9.js} +1 -1
- package/lib/edge/{bundle-52813dc2.js → bundle-48628d9c.js} +1490 -1479
- package/lib/edge/bundle-97130d9a.cjs +188 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/node/USE_CLIENT_BUNDLE-23b5881f.cjs +23 -0
- package/lib/node/USE_CLIENT_BUNDLE-b63c2d8e.js +711 -0
- package/lib/{browser/USE_SERVER_BUNDLE-a299f76e.js → node/USE_SERVER_BUNDLE-643288fc.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-f71d2896.cjs → node/USE_SERVER_BUNDLE-d645bd91.cjs} +1 -1
- package/lib/node/{bundle-72453996.js → bundle-3ab5a1ab.js} +349 -338
- package/lib/node/{bundle-c9c796be.cjs → bundle-3f7e723b.cjs} +110 -18
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +8 -1
- package/types/cjs/blocks/video/video.d.ts +4 -0
- package/types/cjs/components/content/content.helpers.d.ts +1 -1
- package/types/cjs/components/content/content.types.d.ts +0 -4
- package/types/cjs/components/content-variants/helpers.d.ts +3 -3
- package/types/cjs/components/content-variants/inlined-fns.d.ts +14 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/blocks/video/video.d.ts +4 -0
- package/types/esm/components/content/content.helpers.d.ts +1 -1
- package/types/esm/components/content/content.types.d.ts +0 -4
- package/types/esm/components/content-variants/helpers.d.ts +3 -3
- package/types/esm/components/content-variants/inlined-fns.d.ts +14 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-6ab88b18.cjs +0 -23
- package/lib/browser/USE_CLIENT_BUNDLE-72ddb99c.js +0 -657
- package/lib/edge/USE_CLIENT_BUNDLE-9cc3d141.js +0 -657
- package/lib/edge/USE_CLIENT_BUNDLE-feffcd7a.cjs +0 -23
- package/lib/edge/bundle-b146b975.cjs +0 -96
- package/lib/node/USE_CLIENT_BUNDLE-43abdb50.js +0 -657
- package/lib/node/USE_CLIENT_BUNDLE-ac21f383.cjs +0 -23
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LRUCache } from "lru-cache";
|
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createElement } from "react";
|
|
4
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-b63c2d8e.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
function getBlockComponentOptions(e) {
|
|
7
7
|
var t;
|
|
@@ -86,15 +86,15 @@ const getLocation = () => {
|
|
|
86
86
|
builder: t,
|
|
87
87
|
context: n,
|
|
88
88
|
event: o,
|
|
89
|
-
localState:
|
|
90
|
-
rootSetState:
|
|
89
|
+
localState: i,
|
|
90
|
+
rootSetState: r,
|
|
91
91
|
rootState: a
|
|
92
92
|
}) => {
|
|
93
93
|
const s = getFunctionArguments({
|
|
94
94
|
builder: t,
|
|
95
95
|
context: n,
|
|
96
96
|
event: o,
|
|
97
|
-
state: flattenState(a,
|
|
97
|
+
state: flattenState(a, i, r)
|
|
98
98
|
});
|
|
99
99
|
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
100
100
|
};
|
|
@@ -102,11 +102,11 @@ function flattenState(e, t, n) {
|
|
|
102
102
|
if (e === t)
|
|
103
103
|
throw new Error("rootState === localState");
|
|
104
104
|
return new Proxy(e, {
|
|
105
|
-
get: (o,
|
|
106
|
-
set: (o,
|
|
107
|
-
if (t &&
|
|
105
|
+
get: (o, i) => t && i in t ? t[i] : e[i],
|
|
106
|
+
set: (o, i, r) => {
|
|
107
|
+
if (t && i in t)
|
|
108
108
|
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
109
|
-
return e[
|
|
109
|
+
return e[i] = r, n == null || n(e), !0;
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
}
|
|
@@ -114,7 +114,7 @@ const fastClone = (e) => JSON.parse(JSON.stringify(e)), set = (e, t, n) => {
|
|
|
114
114
|
if (Object(e) !== e)
|
|
115
115
|
return e;
|
|
116
116
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
117
|
-
return o.slice(0, -1).reduce((
|
|
117
|
+
return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
118
118
|
}, noop = () => null;
|
|
119
119
|
let safeDynamicRequire = noop;
|
|
120
120
|
try {
|
|
@@ -174,37 +174,37 @@ output;
|
|
|
174
174
|
builder: t,
|
|
175
175
|
context: n,
|
|
176
176
|
event: o,
|
|
177
|
-
localState:
|
|
178
|
-
rootSetState:
|
|
177
|
+
localState: i,
|
|
178
|
+
rootSetState: r,
|
|
179
179
|
rootState: a
|
|
180
180
|
}) => {
|
|
181
181
|
const s = fastClone({
|
|
182
182
|
...a,
|
|
183
|
-
...
|
|
183
|
+
...i
|
|
184
184
|
}), c = getFunctionArguments({
|
|
185
185
|
builder: t,
|
|
186
186
|
context: n,
|
|
187
187
|
event: o,
|
|
188
188
|
state: s
|
|
189
|
-
}),
|
|
190
|
-
|
|
189
|
+
}), m = getIsolateContext(), f = m.global;
|
|
190
|
+
f.setSync("global", f.derefInto()), f.setSync("log", function(...l) {
|
|
191
191
|
console.log(...l);
|
|
192
|
-
}),
|
|
193
|
-
set(a, l,
|
|
194
|
-
}), c.forEach(([l,
|
|
195
|
-
const d = typeof
|
|
192
|
+
}), f.setSync(BUILDER_SET_STATE_NAME, function(l, u) {
|
|
193
|
+
set(a, l, u), r == null || r(a);
|
|
194
|
+
}), c.forEach(([l, u]) => {
|
|
195
|
+
const d = typeof u == "object" ? new ivm.Reference(
|
|
196
196
|
// workaround: methods with default values for arguments is not being cloned over
|
|
197
197
|
l === "builder" ? {
|
|
198
|
-
...
|
|
199
|
-
getUserAttributes: () =>
|
|
200
|
-
} :
|
|
198
|
+
...u,
|
|
199
|
+
getUserAttributes: () => u.getUserAttributes()
|
|
200
|
+
} : u
|
|
201
201
|
) : null;
|
|
202
|
-
|
|
203
|
-
}),
|
|
204
|
-
const
|
|
202
|
+
f.setSync(getSyncValName(l), d);
|
|
203
|
+
}), f.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
204
|
+
const g = processCode({
|
|
205
205
|
code: e,
|
|
206
206
|
args: c
|
|
207
|
-
}), p =
|
|
207
|
+
}), p = m.evalSync(g);
|
|
208
208
|
try {
|
|
209
209
|
return JSON.parse(p);
|
|
210
210
|
} catch {
|
|
@@ -216,8 +216,8 @@ function evaluate({
|
|
|
216
216
|
context: t,
|
|
217
217
|
localState: n,
|
|
218
218
|
rootState: o,
|
|
219
|
-
rootSetState:
|
|
220
|
-
event:
|
|
219
|
+
rootSetState: i,
|
|
220
|
+
event: r,
|
|
221
221
|
isExpression: a = !0
|
|
222
222
|
}) {
|
|
223
223
|
if (e === "") {
|
|
@@ -230,8 +230,8 @@ function evaluate({
|
|
|
230
230
|
}),
|
|
231
231
|
builder: getBuilderGlobals(),
|
|
232
232
|
context: t,
|
|
233
|
-
event:
|
|
234
|
-
rootSetState:
|
|
233
|
+
event: r,
|
|
234
|
+
rootSetState: i,
|
|
235
235
|
rootState: o,
|
|
236
236
|
localState: n
|
|
237
237
|
};
|
|
@@ -252,28 +252,28 @@ const evaluateBindings = ({
|
|
|
252
252
|
context: t,
|
|
253
253
|
localState: n,
|
|
254
254
|
rootState: o,
|
|
255
|
-
rootSetState:
|
|
255
|
+
rootSetState: i
|
|
256
256
|
}) => {
|
|
257
257
|
if (!e.bindings)
|
|
258
258
|
return e;
|
|
259
|
-
const
|
|
260
|
-
...
|
|
259
|
+
const r = fastClone(e), a = {
|
|
260
|
+
...r,
|
|
261
261
|
properties: {
|
|
262
|
-
...
|
|
262
|
+
...r.properties
|
|
263
263
|
},
|
|
264
264
|
actions: {
|
|
265
|
-
...
|
|
265
|
+
...r.actions
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
for (const s in e.bindings) {
|
|
269
|
-
const c = e.bindings[s],
|
|
269
|
+
const c = e.bindings[s], m = evaluate({
|
|
270
270
|
code: c,
|
|
271
271
|
localState: n,
|
|
272
272
|
rootState: o,
|
|
273
|
-
rootSetState:
|
|
273
|
+
rootSetState: i,
|
|
274
274
|
context: t
|
|
275
275
|
});
|
|
276
|
-
set(a, s,
|
|
276
|
+
set(a, s, m);
|
|
277
277
|
}
|
|
278
278
|
return a;
|
|
279
279
|
};
|
|
@@ -282,15 +282,15 @@ function getProcessedBlock({
|
|
|
282
282
|
context: t,
|
|
283
283
|
shouldEvaluateBindings: n,
|
|
284
284
|
localState: o,
|
|
285
|
-
rootState:
|
|
286
|
-
rootSetState:
|
|
285
|
+
rootState: i,
|
|
286
|
+
rootSetState: r
|
|
287
287
|
}) {
|
|
288
288
|
const a = e;
|
|
289
289
|
return n ? evaluateBindings({
|
|
290
290
|
block: a,
|
|
291
291
|
localState: o,
|
|
292
|
-
rootState:
|
|
293
|
-
rootSetState:
|
|
292
|
+
rootState: i,
|
|
293
|
+
rootSetState: r,
|
|
294
294
|
context: t
|
|
295
295
|
}) : a;
|
|
296
296
|
}
|
|
@@ -299,20 +299,20 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
299
299
|
context: t,
|
|
300
300
|
registeredComponents: n
|
|
301
301
|
}) => {
|
|
302
|
-
var
|
|
303
|
-
const o = (
|
|
302
|
+
var r;
|
|
303
|
+
const o = (r = getProcessedBlock({
|
|
304
304
|
block: e,
|
|
305
305
|
localState: t.localState,
|
|
306
306
|
rootState: t.rootState,
|
|
307
307
|
rootSetState: t.rootSetState,
|
|
308
308
|
context: t.context,
|
|
309
309
|
shouldEvaluateBindings: !1
|
|
310
|
-
}).component) == null ? void 0 :
|
|
310
|
+
}).component) == null ? void 0 : r.name;
|
|
311
311
|
if (!o)
|
|
312
312
|
return null;
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
return
|
|
313
|
+
const i = n[o];
|
|
314
|
+
if (i)
|
|
315
|
+
return i;
|
|
316
316
|
console.warn(`
|
|
317
317
|
Could not find a registered component named "${o}".
|
|
318
318
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
@@ -326,25 +326,25 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
326
326
|
} = e;
|
|
327
327
|
if (!(n != null && n.collection))
|
|
328
328
|
return;
|
|
329
|
-
const
|
|
329
|
+
const i = evaluate({
|
|
330
330
|
code: n.collection,
|
|
331
331
|
localState: t.localState,
|
|
332
332
|
rootState: t.rootState,
|
|
333
333
|
rootSetState: t.rootSetState,
|
|
334
334
|
context: t.context
|
|
335
335
|
});
|
|
336
|
-
if (!Array.isArray(
|
|
336
|
+
if (!Array.isArray(i))
|
|
337
337
|
return;
|
|
338
|
-
const
|
|
339
|
-
return
|
|
338
|
+
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
339
|
+
return i.map((c, m) => ({
|
|
340
340
|
context: {
|
|
341
341
|
...t,
|
|
342
342
|
localState: {
|
|
343
343
|
...t.localState,
|
|
344
|
-
$index:
|
|
344
|
+
$index: m,
|
|
345
345
|
$item: c,
|
|
346
346
|
[a]: c,
|
|
347
|
-
[`$${a}Index`]:
|
|
347
|
+
[`$${a}Index`]: m
|
|
348
348
|
}
|
|
349
349
|
},
|
|
350
350
|
block: o
|
|
@@ -378,18 +378,18 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
378
378
|
min: o,
|
|
379
379
|
default: o + 1
|
|
380
380
|
};
|
|
381
|
-
const
|
|
381
|
+
const i = n.small.max + 1;
|
|
382
382
|
n.medium = {
|
|
383
383
|
max: t,
|
|
384
|
-
min:
|
|
385
|
-
default:
|
|
384
|
+
min: i,
|
|
385
|
+
default: i + 1
|
|
386
386
|
};
|
|
387
|
-
const
|
|
387
|
+
const r = n.medium.max + 1;
|
|
388
388
|
return n.large = {
|
|
389
389
|
max: 2e3,
|
|
390
390
|
// TODO: decide upper limit
|
|
391
|
-
min:
|
|
392
|
-
default:
|
|
391
|
+
min: r,
|
|
392
|
+
default: r + 1
|
|
393
393
|
}, n;
|
|
394
394
|
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), checkIsDefined = (e) => e != null, convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
395
395
|
if (typeof o == "string")
|
|
@@ -412,7 +412,7 @@ function InlinedStyles(e) {
|
|
|
412
412
|
}
|
|
413
413
|
function BlockStyles(e) {
|
|
414
414
|
const t = function() {
|
|
415
|
-
const
|
|
415
|
+
const i = getProcessedBlock({
|
|
416
416
|
block: e.block,
|
|
417
417
|
localState: e.context.localState,
|
|
418
418
|
rootState: e.context.rootState,
|
|
@@ -420,40 +420,40 @@ function BlockStyles(e) {
|
|
|
420
420
|
context: e.context.context,
|
|
421
421
|
shouldEvaluateBindings: !0
|
|
422
422
|
});
|
|
423
|
-
return checkIsDefined(
|
|
423
|
+
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
424
424
|
}, n = function() {
|
|
425
425
|
var d;
|
|
426
|
-
const
|
|
426
|
+
const i = getProcessedBlock({
|
|
427
427
|
block: e.block,
|
|
428
428
|
localState: e.context.localState,
|
|
429
429
|
rootState: e.context.rootState,
|
|
430
430
|
rootSetState: e.context.rootSetState,
|
|
431
431
|
context: e.context.context,
|
|
432
432
|
shouldEvaluateBindings: !0
|
|
433
|
-
}),
|
|
433
|
+
}), r = i.responsiveStyles, a = e.context.content, s = getSizesForBreakpoints(
|
|
434
434
|
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
435
|
-
), c =
|
|
436
|
-
if (!
|
|
435
|
+
), c = r == null ? void 0 : r.large, m = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, g = i.id;
|
|
436
|
+
if (!g)
|
|
437
437
|
return "";
|
|
438
438
|
const p = c ? createCssClass({
|
|
439
|
-
className:
|
|
439
|
+
className: g,
|
|
440
440
|
styles: c
|
|
441
|
-
}) : "", l =
|
|
442
|
-
className:
|
|
443
|
-
styles:
|
|
441
|
+
}) : "", l = m ? createCssClass({
|
|
442
|
+
className: g,
|
|
443
|
+
styles: m,
|
|
444
444
|
mediaQuery: getMaxWidthQueryForSize(
|
|
445
445
|
"medium",
|
|
446
446
|
s
|
|
447
447
|
)
|
|
448
|
-
}) : "",
|
|
449
|
-
className:
|
|
450
|
-
styles:
|
|
448
|
+
}) : "", u = f ? createCssClass({
|
|
449
|
+
className: g,
|
|
450
|
+
styles: f,
|
|
451
451
|
mediaQuery: getMaxWidthQueryForSize(
|
|
452
452
|
"small",
|
|
453
453
|
s
|
|
454
454
|
)
|
|
455
455
|
}) : "";
|
|
456
|
-
return [p, l,
|
|
456
|
+
return [p, l, u].join(" ");
|
|
457
457
|
};
|
|
458
458
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
459
459
|
}
|
|
@@ -474,19 +474,19 @@ function getBlockActions(e) {
|
|
|
474
474
|
for (const o in n) {
|
|
475
475
|
if (!n.hasOwnProperty(o))
|
|
476
476
|
continue;
|
|
477
|
-
const
|
|
478
|
-
let
|
|
477
|
+
const i = n[o];
|
|
478
|
+
let r = getEventHandlerName(o);
|
|
479
479
|
if (e.stripPrefix)
|
|
480
480
|
switch (TARGET) {
|
|
481
481
|
case "vue2":
|
|
482
482
|
case "vue3":
|
|
483
|
-
|
|
483
|
+
r = r.replace("v-on:", "");
|
|
484
484
|
break;
|
|
485
485
|
case "svelte":
|
|
486
|
-
|
|
486
|
+
r = r.replace("on:", "");
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
|
-
t[
|
|
489
|
+
t[r] = createEventHandler(i, e);
|
|
490
490
|
}
|
|
491
491
|
return t;
|
|
492
492
|
}
|
|
@@ -529,10 +529,10 @@ const getWrapperProps = ({
|
|
|
529
529
|
builderBlock: t,
|
|
530
530
|
context: n,
|
|
531
531
|
componentRef: o,
|
|
532
|
-
includeBlockProps:
|
|
533
|
-
isInteractive:
|
|
532
|
+
includeBlockProps: i,
|
|
533
|
+
isInteractive: r,
|
|
534
534
|
contextValue: a
|
|
535
|
-
}) =>
|
|
535
|
+
}) => r ? {
|
|
536
536
|
Wrapper: o,
|
|
537
537
|
block: t,
|
|
538
538
|
context: n,
|
|
@@ -543,7 +543,7 @@ const getWrapperProps = ({
|
|
|
543
543
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
544
544
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
545
545
|
*/
|
|
546
|
-
...
|
|
546
|
+
...i ? {
|
|
547
547
|
attributes: getBlockProperties({
|
|
548
548
|
block: t,
|
|
549
549
|
context: a
|
|
@@ -566,22 +566,22 @@ function ComponentRef(e) {
|
|
|
566
566
|
contextValue: e.context
|
|
567
567
|
}),
|
|
568
568
|
children: [
|
|
569
|
-
(n = e.blockChildren) == null ? void 0 : n.map((
|
|
569
|
+
(n = e.blockChildren) == null ? void 0 : n.map((i) => /* @__PURE__ */ jsx(
|
|
570
570
|
Block,
|
|
571
571
|
{
|
|
572
|
-
block:
|
|
572
|
+
block: i,
|
|
573
573
|
context: e.context,
|
|
574
574
|
registeredComponents: e.registeredComponents
|
|
575
575
|
},
|
|
576
|
-
"block-" +
|
|
576
|
+
"block-" + i.id
|
|
577
577
|
)),
|
|
578
|
-
(o = e.blockChildren) == null ? void 0 : o.map((
|
|
578
|
+
(o = e.blockChildren) == null ? void 0 : o.map((i) => /* @__PURE__ */ jsx(
|
|
579
579
|
BlockStyles,
|
|
580
580
|
{
|
|
581
|
-
block:
|
|
581
|
+
block: i,
|
|
582
582
|
context: e.context
|
|
583
583
|
},
|
|
584
|
-
"block-style-" +
|
|
584
|
+
"block-style-" + i.id
|
|
585
585
|
))
|
|
586
586
|
]
|
|
587
587
|
}
|
|
@@ -599,7 +599,7 @@ function RepeatedBlock(e) {
|
|
|
599
599
|
);
|
|
600
600
|
}
|
|
601
601
|
function Block(e) {
|
|
602
|
-
var
|
|
602
|
+
var m, f, g, p;
|
|
603
603
|
const t = function() {
|
|
604
604
|
return getComponent({
|
|
605
605
|
block: e.block,
|
|
@@ -612,7 +612,8 @@ function Block(e) {
|
|
|
612
612
|
context: e.context
|
|
613
613
|
});
|
|
614
614
|
}, o = function() {
|
|
615
|
-
|
|
615
|
+
var u;
|
|
616
|
+
return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
|
|
616
617
|
block: e.block,
|
|
617
618
|
localState: e.context.localState,
|
|
618
619
|
rootState: e.context.rootState,
|
|
@@ -620,18 +621,19 @@ function Block(e) {
|
|
|
620
621
|
context: e.context.context,
|
|
621
622
|
shouldEvaluateBindings: !0
|
|
622
623
|
});
|
|
623
|
-
}, r = function() {
|
|
624
|
-
return e.block.tagName || "div";
|
|
625
624
|
}, i = function() {
|
|
626
|
-
return
|
|
625
|
+
return e.block.tagName || "div";
|
|
626
|
+
}, r = function() {
|
|
627
|
+
var u, d;
|
|
628
|
+
return "hide" in o() ? !o().hide : "show" in o() ? o().show : !((u = e.block.repeat) != null && u.collection && !((d = n()) != null && d.length));
|
|
627
629
|
}, a = function() {
|
|
628
630
|
var d;
|
|
629
631
|
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
630
632
|
}, s = function() {
|
|
631
|
-
var
|
|
633
|
+
var u, d, b, y, h;
|
|
632
634
|
return {
|
|
633
635
|
blockChildren: o().children ?? [],
|
|
634
|
-
componentRef: (
|
|
636
|
+
componentRef: (u = t()) == null ? void 0 : u.component,
|
|
635
637
|
componentOptions: {
|
|
636
638
|
...getBlockComponentOptions(o()),
|
|
637
639
|
builderContext: e.context,
|
|
@@ -643,10 +645,10 @@ function Block(e) {
|
|
|
643
645
|
registeredComponents: e.registeredComponents,
|
|
644
646
|
builderBlock: o(),
|
|
645
647
|
includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
|
|
646
|
-
isInteractive: !((
|
|
648
|
+
isInteractive: !((h = t()) != null && h.isRSC)
|
|
647
649
|
};
|
|
648
650
|
}, c = e.context;
|
|
649
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
651
|
+
return /* @__PURE__ */ jsx(Fragment, { children: r() ? /* @__PURE__ */ jsx(Fragment, { children: (m = t()) != null && m.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
650
652
|
ComponentRef,
|
|
651
653
|
{
|
|
652
654
|
componentRef: s().componentRef,
|
|
@@ -659,28 +661,28 @@ function Block(e) {
|
|
|
659
661
|
isInteractive: s().isInteractive
|
|
660
662
|
}
|
|
661
663
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
662
|
-
isEmptyHtmlElement(
|
|
664
|
+
isEmptyHtmlElement(i()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
663
665
|
BlockWrapper,
|
|
664
666
|
{
|
|
665
|
-
Wrapper:
|
|
667
|
+
Wrapper: i(),
|
|
666
668
|
block: o(),
|
|
667
669
|
context: e.context,
|
|
668
670
|
hasChildren: !1
|
|
669
671
|
}
|
|
670
672
|
) }) : null,
|
|
671
|
-
!isEmptyHtmlElement(
|
|
673
|
+
!isEmptyHtmlElement(i()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((l, u) => /* @__PURE__ */ jsx(
|
|
672
674
|
RepeatedBlock,
|
|
673
675
|
{
|
|
674
676
|
repeatContext: l.context,
|
|
675
677
|
block: l.block,
|
|
676
678
|
registeredComponents: e.registeredComponents
|
|
677
679
|
},
|
|
678
|
-
|
|
680
|
+
u
|
|
679
681
|
)) }) : null,
|
|
680
|
-
!isEmptyHtmlElement(
|
|
682
|
+
!isEmptyHtmlElement(i()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
681
683
|
BlockWrapper,
|
|
682
684
|
{
|
|
683
|
-
Wrapper:
|
|
685
|
+
Wrapper: i(),
|
|
684
686
|
block: o(),
|
|
685
687
|
context: e.context,
|
|
686
688
|
hasChildren: !0,
|
|
@@ -698,7 +700,7 @@ function Block(e) {
|
|
|
698
700
|
isInteractive: s().isInteractive
|
|
699
701
|
}
|
|
700
702
|
),
|
|
701
|
-
(
|
|
703
|
+
(g = a()) == null ? void 0 : g.map((l) => /* @__PURE__ */ jsx(
|
|
702
704
|
Block,
|
|
703
705
|
{
|
|
704
706
|
block: l,
|
|
@@ -753,12 +755,12 @@ function Blocks(e) {
|
|
|
753
755
|
}
|
|
754
756
|
function Columns(e) {
|
|
755
757
|
var l;
|
|
756
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet",
|
|
758
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
|
|
757
759
|
var b;
|
|
758
760
|
return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
|
|
759
|
-
},
|
|
761
|
+
}, r = function(d) {
|
|
760
762
|
const b = t * (n.length - 1) / n.length;
|
|
761
|
-
return `calc(${
|
|
763
|
+
return `calc(${i(d)}% - ${b}px)`;
|
|
762
764
|
}, a = function({
|
|
763
765
|
stackedStyle: d,
|
|
764
766
|
desktopStyle: b
|
|
@@ -769,7 +771,7 @@ function Columns(e) {
|
|
|
769
771
|
desktopStyle: b
|
|
770
772
|
}) {
|
|
771
773
|
return o === "never" ? b : d;
|
|
772
|
-
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column",
|
|
774
|
+
}, c = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
|
|
773
775
|
return {
|
|
774
776
|
"--flex-dir": c,
|
|
775
777
|
"--flex-dir-tablet": a({
|
|
@@ -777,36 +779,36 @@ function Columns(e) {
|
|
|
777
779
|
desktopStyle: "row"
|
|
778
780
|
})
|
|
779
781
|
};
|
|
780
|
-
},
|
|
781
|
-
const b = d === 0 ? 0 : t, y =
|
|
782
|
+
}, f = function(d) {
|
|
783
|
+
const b = d === 0 ? 0 : t, y = r(d), h = `${b}px`, v = "100%", x = 0;
|
|
782
784
|
return {
|
|
783
785
|
width: y,
|
|
784
|
-
["marginLeft"]:
|
|
786
|
+
["marginLeft"]: h,
|
|
785
787
|
"--column-width-mobile": s({
|
|
786
|
-
stackedStyle:
|
|
788
|
+
stackedStyle: v,
|
|
787
789
|
desktopStyle: y
|
|
788
790
|
}),
|
|
789
791
|
"--column-margin-left-mobile": s({
|
|
790
792
|
stackedStyle: x,
|
|
791
|
-
desktopStyle:
|
|
793
|
+
desktopStyle: h
|
|
792
794
|
}),
|
|
793
795
|
"--column-width-tablet": a({
|
|
794
|
-
stackedStyle:
|
|
796
|
+
stackedStyle: v,
|
|
795
797
|
desktopStyle: y
|
|
796
798
|
}),
|
|
797
799
|
"--column-margin-left-tablet": a({
|
|
798
800
|
stackedStyle: x,
|
|
799
|
-
desktopStyle:
|
|
801
|
+
desktopStyle: h
|
|
800
802
|
})
|
|
801
803
|
};
|
|
802
|
-
},
|
|
803
|
-
var y,
|
|
804
|
+
}, g = function(d) {
|
|
805
|
+
var y, h;
|
|
804
806
|
return getSizesForBreakpoints(
|
|
805
|
-
((
|
|
807
|
+
((h = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : h.breakpoints) || {}
|
|
806
808
|
)[d].max;
|
|
807
809
|
}, p = function() {
|
|
808
810
|
return `
|
|
809
|
-
@media (max-width: ${
|
|
811
|
+
@media (max-width: ${g("medium")}px) {
|
|
810
812
|
.${e.builderBlock.id}-breakpoints {
|
|
811
813
|
flex-direction: var(--flex-dir-tablet);
|
|
812
814
|
align-items: stretch;
|
|
@@ -818,7 +820,7 @@ function Columns(e) {
|
|
|
818
820
|
}
|
|
819
821
|
}
|
|
820
822
|
|
|
821
|
-
@media (max-width: ${
|
|
823
|
+
@media (max-width: ${g("small")}px) {
|
|
822
824
|
.${e.builderBlock.id}-breakpoints {
|
|
823
825
|
flex-direction: var(--flex-dir);
|
|
824
826
|
align-items: stretch;
|
|
@@ -836,14 +838,14 @@ function Columns(e) {
|
|
|
836
838
|
"div",
|
|
837
839
|
{
|
|
838
840
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-0d69fe26`,
|
|
839
|
-
style:
|
|
841
|
+
style: m(),
|
|
840
842
|
children: [
|
|
841
843
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
|
|
842
|
-
(l = e.columns) == null ? void 0 : l.map((
|
|
844
|
+
(l = e.columns) == null ? void 0 : l.map((u, d) => /* @__PURE__ */ createElement(
|
|
843
845
|
"div",
|
|
844
846
|
{
|
|
845
847
|
className: "builder-column div-0d69fe26-2",
|
|
846
|
-
style:
|
|
848
|
+
style: f(d),
|
|
847
849
|
key: d
|
|
848
850
|
},
|
|
849
851
|
/* @__PURE__ */ jsx(
|
|
@@ -856,7 +858,7 @@ function Columns(e) {
|
|
|
856
858
|
},
|
|
857
859
|
context: e.builderContext,
|
|
858
860
|
registeredComponents: e.builderComponents,
|
|
859
|
-
blocks:
|
|
861
|
+
blocks: u.blocks
|
|
860
862
|
}
|
|
861
863
|
)
|
|
862
864
|
))
|
|
@@ -877,8 +879,8 @@ function removeProtocol(e) {
|
|
|
877
879
|
return e.replace(/http(s)?:/, "");
|
|
878
880
|
}
|
|
879
881
|
function updateQueryParam(e = "", t, n) {
|
|
880
|
-
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"),
|
|
881
|
-
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e +
|
|
882
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
883
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
882
884
|
}
|
|
883
885
|
function getShopifyImageUrl(e, t) {
|
|
884
886
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
@@ -887,8 +889,8 @@ function getShopifyImageUrl(e, t) {
|
|
|
887
889
|
return removeProtocol(e);
|
|
888
890
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
889
891
|
if (n) {
|
|
890
|
-
const o = e.split(n[0]),
|
|
891
|
-
return removeProtocol(`${o[0]}_${
|
|
892
|
+
const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
|
|
893
|
+
return removeProtocol(`${o[0]}_${r}${i}`);
|
|
892
894
|
}
|
|
893
895
|
return null;
|
|
894
896
|
}
|
|
@@ -899,7 +901,7 @@ function getSrcSet(e) {
|
|
|
899
901
|
if (e.match(/builder\.io/)) {
|
|
900
902
|
let n = e;
|
|
901
903
|
const o = Number(e.split("?width=")[1]);
|
|
902
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((
|
|
904
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${updateQueryParam(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
903
905
|
}
|
|
904
906
|
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
905
907
|
}
|
|
@@ -924,7 +926,7 @@ const getTopLevelDomain = (e) => {
|
|
|
924
926
|
value: t,
|
|
925
927
|
expires: n
|
|
926
928
|
}) => {
|
|
927
|
-
const
|
|
929
|
+
const i = (isBrowser() ? location.protocol === "https:" : !0) ? SECURE_CONFIG : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", getTopLevelDomain(window.location.hostname)], ...i];
|
|
928
930
|
return stringifyCookie(a);
|
|
929
931
|
}, setCookie = async ({
|
|
930
932
|
name: e,
|
|
@@ -935,14 +937,14 @@ const getTopLevelDomain = (e) => {
|
|
|
935
937
|
try {
|
|
936
938
|
if (!o)
|
|
937
939
|
return;
|
|
938
|
-
const
|
|
940
|
+
const i = createCookieString({
|
|
939
941
|
name: e,
|
|
940
942
|
value: t,
|
|
941
943
|
expires: n
|
|
942
944
|
});
|
|
943
|
-
document.cookie =
|
|
944
|
-
} catch (
|
|
945
|
-
logger.warn("[COOKIE] SET error: ", (
|
|
945
|
+
document.cookie = i;
|
|
946
|
+
} catch (i) {
|
|
947
|
+
logger.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
946
948
|
}
|
|
947
949
|
}, BUILDER_STORE_PREFIX = "builder.tests", getContentTestKey = (e) => `${BUILDER_STORE_PREFIX}.${e}`, getContentVariationCookie = ({
|
|
948
950
|
contentId: e
|
|
@@ -965,13 +967,13 @@ const getTopLevelDomain = (e) => {
|
|
|
965
967
|
id: e,
|
|
966
968
|
variations: t
|
|
967
969
|
}) => {
|
|
968
|
-
var
|
|
970
|
+
var i;
|
|
969
971
|
let n = 0;
|
|
970
972
|
const o = Math.random();
|
|
971
|
-
for (const
|
|
972
|
-
const a = (
|
|
973
|
+
for (const r in t) {
|
|
974
|
+
const a = (i = t[r]) == null ? void 0 : i.testRatio;
|
|
973
975
|
if (n += a, o < n)
|
|
974
|
-
return
|
|
976
|
+
return r;
|
|
975
977
|
}
|
|
976
978
|
return e;
|
|
977
979
|
}, getAndSetVariantId = (e) => {
|
|
@@ -1030,13 +1032,13 @@ const getTopLevelDomain = (e) => {
|
|
|
1030
1032
|
}) || getAndSetVariantId({
|
|
1031
1033
|
variations: e.variations,
|
|
1032
1034
|
id: e.id
|
|
1033
|
-
}),
|
|
1035
|
+
}), i = getTestFields({
|
|
1034
1036
|
item: e,
|
|
1035
1037
|
testGroupId: o
|
|
1036
1038
|
});
|
|
1037
1039
|
return {
|
|
1038
1040
|
...e,
|
|
1039
|
-
...
|
|
1041
|
+
...i
|
|
1040
1042
|
};
|
|
1041
1043
|
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, componentInfo$a = {
|
|
1042
1044
|
name: "Core:Button",
|
|
@@ -1250,7 +1252,7 @@ const getTopLevelDomain = (e) => {
|
|
|
1250
1252
|
});
|
|
1251
1253
|
}
|
|
1252
1254
|
const n = e.get("columns");
|
|
1253
|
-
Array.isArray(n) && n.find((
|
|
1255
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1254
1256
|
}
|
|
1255
1257
|
}, {
|
|
1256
1258
|
name: "space",
|
|
@@ -1346,28 +1348,28 @@ const getTopLevelDomain = (e) => {
|
|
|
1346
1348
|
onChange: (e) => {
|
|
1347
1349
|
e.delete("srcset"), e.delete("noWebp");
|
|
1348
1350
|
function n(a, s = 6e4) {
|
|
1349
|
-
return new Promise((c,
|
|
1350
|
-
const
|
|
1351
|
-
let
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
},
|
|
1355
|
-
console.warn("Image load failed", p.error),
|
|
1356
|
-
}),
|
|
1357
|
-
|
|
1351
|
+
return new Promise((c, m) => {
|
|
1352
|
+
const f = document.createElement("img");
|
|
1353
|
+
let g = !1;
|
|
1354
|
+
f.onload = () => {
|
|
1355
|
+
g = !0, c(f);
|
|
1356
|
+
}, f.addEventListener("error", (p) => {
|
|
1357
|
+
console.warn("Image load failed", p.error), m(p.error);
|
|
1358
|
+
}), f.src = a, setTimeout(() => {
|
|
1359
|
+
g || m(new Error("Image load timed out"));
|
|
1358
1360
|
}, s);
|
|
1359
1361
|
});
|
|
1360
1362
|
}
|
|
1361
1363
|
function o(a) {
|
|
1362
1364
|
return Math.round(a * 1e3) / 1e3;
|
|
1363
1365
|
}
|
|
1364
|
-
const
|
|
1365
|
-
if (fetch(
|
|
1366
|
+
const i = e.get("image"), r = e.get("aspectRatio");
|
|
1367
|
+
if (fetch(i).then((a) => a.blob()).then((a) => {
|
|
1366
1368
|
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1367
|
-
}),
|
|
1368
|
-
return n(
|
|
1369
|
+
}), i && (!r || r === 0.7041))
|
|
1370
|
+
return n(i).then((a) => {
|
|
1369
1371
|
const s = e.get("aspectRatio");
|
|
1370
|
-
e.get("image") ===
|
|
1372
|
+
e.get("image") === i && (!s || s === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
|
|
1371
1373
|
});
|
|
1372
1374
|
}
|
|
1373
1375
|
}, {
|
|
@@ -1668,108 +1670,125 @@ const componentInfo = {
|
|
|
1668
1670
|
...t
|
|
1669
1671
|
}) => ({
|
|
1670
1672
|
...fastClone(t),
|
|
1671
|
-
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [
|
|
1673
|
+
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1672
1674
|
...o,
|
|
1673
|
-
[
|
|
1675
|
+
[i]: serializeValue(r)
|
|
1674
1676
|
}), {}))
|
|
1675
|
-
}),
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
function bldrAbTest(e, t, n) {
|
|
1684
|
-
var a;
|
|
1685
|
-
function o() {
|
|
1686
|
-
function s(f, d, b) {
|
|
1687
|
-
let y = "";
|
|
1688
|
-
if (b) {
|
|
1689
|
-
const g = /* @__PURE__ */ new Date();
|
|
1690
|
-
g.setTime(g.getTime() + b * 24 * 60 * 60 * 1e3), y = "; expires=" + g.toUTCString();
|
|
1677
|
+
}), UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1678
|
+
function getAndSetVariantId() {
|
|
1679
|
+
function setCookie(name, value, days) {
|
|
1680
|
+
let expires = '';
|
|
1681
|
+
if (days) {
|
|
1682
|
+
const date = new Date();
|
|
1683
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1684
|
+
expires = '; expires=' + date.toUTCString();
|
|
1691
1685
|
}
|
|
1692
|
-
document.cookie =
|
|
1686
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
1693
1687
|
}
|
|
1694
|
-
function
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
if (
|
|
1701
|
-
return g.substring(d.length, g.length);
|
|
1688
|
+
function getCookie(name) {
|
|
1689
|
+
const nameEQ = name + '=';
|
|
1690
|
+
const ca = document.cookie.split(';');
|
|
1691
|
+
for (let i = 0; i < ca.length; i++) {
|
|
1692
|
+
let c = ca[i];
|
|
1693
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
1694
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
1702
1695
|
}
|
|
1703
1696
|
return null;
|
|
1704
1697
|
}
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1698
|
+
const cookieName = \`builder.tests.\${contentId}\`;
|
|
1699
|
+
const variantInCookie = getCookie(cookieName);
|
|
1700
|
+
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
1701
|
+
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
1702
|
+
return variantInCookie;
|
|
1703
|
+
}
|
|
1704
|
+
let n = 0;
|
|
1705
|
+
const random = Math.random();
|
|
1706
|
+
for (let i = 0; i < variants.length; i++) {
|
|
1707
|
+
const variant = variants[i];
|
|
1708
|
+
const testRatio = variant.testRatio;
|
|
1709
|
+
n += testRatio;
|
|
1710
|
+
if (random < n) {
|
|
1711
|
+
setCookie(cookieName, variant.id);
|
|
1712
|
+
return variant.id;
|
|
1713
|
+
}
|
|
1714
1714
|
}
|
|
1715
|
-
|
|
1715
|
+
setCookie(cookieName, contentId);
|
|
1716
|
+
return contentId;
|
|
1716
1717
|
}
|
|
1717
|
-
const
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1718
|
+
const winningVariantId = getAndSetVariantId();
|
|
1719
|
+
const styleEl = document.currentScript?.previousElementSibling;
|
|
1720
|
+
if (isHydrationTarget) {
|
|
1721
|
+
styleEl.remove();
|
|
1722
|
+
const thisScriptEl = document.currentScript;
|
|
1723
|
+
thisScriptEl?.remove();
|
|
1722
1724
|
} else {
|
|
1723
|
-
const
|
|
1724
|
-
id:
|
|
1725
|
-
}).filter(
|
|
1726
|
-
|
|
1727
|
-
|
|
1725
|
+
const newStyleStr = variants.concat({
|
|
1726
|
+
id: contentId
|
|
1727
|
+
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
1728
|
+
return \`.variant-\${value.id} { display: none; }
|
|
1729
|
+
\`;
|
|
1730
|
+
}).join('');
|
|
1731
|
+
styleEl.innerHTML = newStyleStr;
|
|
1728
1732
|
}
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
var c;
|
|
1732
|
-
if (!navigator.cookieEnabled)
|
|
1733
|
+
}`, UPDATE_VARIANT_VISIBILITY_SCRIPT = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
1734
|
+
if (!navigator.cookieEnabled) {
|
|
1733
1735
|
return;
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1736
|
+
}
|
|
1737
|
+
function getCookie(name) {
|
|
1738
|
+
const nameEQ = name + '=';
|
|
1739
|
+
const ca = document.cookie.split(';');
|
|
1740
|
+
for (let i = 0; i < ca.length; i++) {
|
|
1741
|
+
let c = ca[i];
|
|
1742
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
1743
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
1742
1744
|
}
|
|
1743
1745
|
return null;
|
|
1744
1746
|
}
|
|
1745
|
-
const
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1747
|
+
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
1748
|
+
const winningVariant = getCookie(cookieName);
|
|
1749
|
+
const parentDiv = document.currentScript?.parentElement;
|
|
1750
|
+
const isDefaultContent = variantContentId === defaultContentId;
|
|
1751
|
+
const isWinningVariant = winningVariant === variantContentId;
|
|
1752
|
+
if (isWinningVariant && !isDefaultContent) {
|
|
1753
|
+
parentDiv?.removeAttribute('hidden');
|
|
1754
|
+
parentDiv?.removeAttribute('aria-hidden');
|
|
1755
|
+
} else if (!isWinningVariant && isDefaultContent) {
|
|
1756
|
+
parentDiv?.setAttribute('hidden', 'true');
|
|
1757
|
+
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
1753
1758
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1759
|
+
if (isHydrationTarget) {
|
|
1760
|
+
if (!isWinningVariant) {
|
|
1761
|
+
parentDiv?.remove();
|
|
1762
|
+
}
|
|
1763
|
+
const thisScriptEl = document.currentScript;
|
|
1764
|
+
thisScriptEl?.remove();
|
|
1765
|
+
}
|
|
1766
|
+
return;
|
|
1767
|
+
}`, UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest", UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent", getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
1768
|
+
...t,
|
|
1769
|
+
testVariationId: t.id,
|
|
1770
|
+
id: e == null ? void 0 : e.id
|
|
1771
|
+
})), checkShouldRenderVariants = ({
|
|
1772
|
+
canTrack: e,
|
|
1773
|
+
content: t
|
|
1774
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getScriptString = () => `
|
|
1775
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
1776
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
1777
|
+
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
1778
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
1779
|
+
"${t}",${JSON.stringify(e)}, ${isHydrationTarget}
|
|
1780
|
+
)`, getUpdateVariantVisibilityScript = ({
|
|
1763
1781
|
contentId: e,
|
|
1764
1782
|
variationId: t
|
|
1765
|
-
}) => `
|
|
1766
|
-
|
|
1783
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
1784
|
+
"${t}", "${e}", ${isHydrationTarget}
|
|
1785
|
+
)`;
|
|
1767
1786
|
function InlinedScript(e) {
|
|
1768
1787
|
return /* @__PURE__ */ jsx(
|
|
1769
1788
|
"script",
|
|
1770
1789
|
{
|
|
1771
1790
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
1772
|
-
id: e.id
|
|
1791
|
+
id: e.id || ""
|
|
1773
1792
|
}
|
|
1774
1793
|
);
|
|
1775
1794
|
}
|
|
@@ -1801,14 +1820,14 @@ function getFetch() {
|
|
|
1801
1820
|
}
|
|
1802
1821
|
const fetch$1 = getFetch();
|
|
1803
1822
|
function flatten(e, t = null, n = ".") {
|
|
1804
|
-
return Object.keys(e).reduce((o,
|
|
1805
|
-
const
|
|
1806
|
-
return [typeof
|
|
1823
|
+
return Object.keys(e).reduce((o, i) => {
|
|
1824
|
+
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
1825
|
+
return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
|
|
1807
1826
|
...o,
|
|
1808
|
-
...flatten(
|
|
1827
|
+
...flatten(r, a, n)
|
|
1809
1828
|
} : {
|
|
1810
1829
|
...o,
|
|
1811
|
-
[a]:
|
|
1830
|
+
[a]: r
|
|
1812
1831
|
};
|
|
1813
1832
|
}, {});
|
|
1814
1833
|
}
|
|
@@ -1823,8 +1842,8 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1823
1842
|
const t = normalizeSearchParams(e), n = {};
|
|
1824
1843
|
return Object.keys(t).forEach((o) => {
|
|
1825
1844
|
if (o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
|
|
1826
|
-
const
|
|
1827
|
-
n[
|
|
1845
|
+
const i = o.replace(BUILDER_SEARCHPARAMS_PREFIX, "").replace(BUILDER_OPTIONS_PREFIX, "");
|
|
1846
|
+
n[i] = t[o];
|
|
1828
1847
|
}
|
|
1829
1848
|
}), n;
|
|
1830
1849
|
}, getBuilderSearchParamsFromWindow = () => {
|
|
@@ -1839,48 +1858,48 @@ const DEFAULT_API_VERSION = "v3", BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUIL
|
|
|
1839
1858
|
const {
|
|
1840
1859
|
limit: n = 30,
|
|
1841
1860
|
userAttributes: o,
|
|
1842
|
-
query:
|
|
1843
|
-
model:
|
|
1861
|
+
query: i,
|
|
1862
|
+
model: r,
|
|
1844
1863
|
apiKey: a,
|
|
1845
1864
|
includeRefs: s = !0,
|
|
1846
1865
|
enrich: c,
|
|
1847
|
-
locale:
|
|
1848
|
-
apiVersion:
|
|
1849
|
-
fields:
|
|
1866
|
+
locale: m,
|
|
1867
|
+
apiVersion: f = DEFAULT_API_VERSION,
|
|
1868
|
+
fields: g,
|
|
1850
1869
|
omit: p,
|
|
1851
1870
|
offset: l,
|
|
1852
|
-
cacheSeconds:
|
|
1871
|
+
cacheSeconds: u,
|
|
1853
1872
|
staleCacheSeconds: d,
|
|
1854
1873
|
sort: b,
|
|
1855
1874
|
includeUnpublished: y
|
|
1856
1875
|
} = e;
|
|
1857
1876
|
if (!a)
|
|
1858
1877
|
throw new Error("Missing API key");
|
|
1859
|
-
if (!["v2", "v3"].includes(
|
|
1860
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
1878
|
+
if (!["v2", "v3"].includes(f))
|
|
1879
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
1861
1880
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1862
|
-
const
|
|
1863
|
-
if (
|
|
1881
|
+
const h = new URL(`https://cdn.builder.io/api/${f}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1882
|
+
if (h.searchParams.set("omit", p || "meta.componentsUsed"), g && h.searchParams.set("fields", g), Number.isFinite(l) && l > -1 && h.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && h.searchParams.set("includeUnpublished", String(y)), u && isPositiveNumber(u) && h.searchParams.set("cacheSeconds", String(u)), d && isPositiveNumber(d) && h.searchParams.set("staleCacheSeconds", String(d)), b) {
|
|
1864
1883
|
const S = flatten({
|
|
1865
1884
|
sort: b
|
|
1866
1885
|
});
|
|
1867
1886
|
for (const C in S)
|
|
1868
|
-
|
|
1887
|
+
h.searchParams.set(C, JSON.stringify(S[C]));
|
|
1869
1888
|
}
|
|
1870
|
-
const
|
|
1889
|
+
const v = {
|
|
1871
1890
|
...getBuilderSearchParamsFromWindow(),
|
|
1872
1891
|
...normalizeSearchParams(e.options || {})
|
|
1873
|
-
}, x = flatten(
|
|
1892
|
+
}, x = flatten(v);
|
|
1874
1893
|
for (const S in x)
|
|
1875
|
-
|
|
1876
|
-
if (o &&
|
|
1894
|
+
h.searchParams.set(S, String(x[S]));
|
|
1895
|
+
if (o && h.searchParams.set("userAttributes", JSON.stringify(o)), i) {
|
|
1877
1896
|
const S = flatten({
|
|
1878
|
-
query:
|
|
1897
|
+
query: i
|
|
1879
1898
|
});
|
|
1880
1899
|
for (const C in S)
|
|
1881
|
-
|
|
1900
|
+
h.searchParams.set(C, JSON.stringify(S[C]));
|
|
1882
1901
|
}
|
|
1883
|
-
return
|
|
1902
|
+
return h;
|
|
1884
1903
|
}, checkContentHasResults = (e) => "results" in e;
|
|
1885
1904
|
async function fetchOneEntry(e) {
|
|
1886
1905
|
const t = await fetchEntries({
|
|
@@ -1895,25 +1914,25 @@ const getContent = fetchOneEntry, _fetchContent = async (e) => {
|
|
|
1895
1914
|
}, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
|
|
1896
1915
|
const o = getDefaultCanTrack(e.canTrack);
|
|
1897
1916
|
if (n.search.includes("preview=")) {
|
|
1898
|
-
const
|
|
1917
|
+
const r = [];
|
|
1899
1918
|
for (const a of t.results) {
|
|
1900
1919
|
const s = getPreviewContent(n.searchParams);
|
|
1901
|
-
|
|
1920
|
+
r.push(s || a);
|
|
1902
1921
|
}
|
|
1903
|
-
t.results =
|
|
1922
|
+
t.results = r;
|
|
1904
1923
|
}
|
|
1905
1924
|
if (!o || !(isBrowser() || TARGET === "reactNative"))
|
|
1906
1925
|
return t;
|
|
1907
1926
|
try {
|
|
1908
|
-
const
|
|
1927
|
+
const r = [];
|
|
1909
1928
|
for (const a of t.results)
|
|
1910
|
-
|
|
1929
|
+
r.push(await handleABTesting({
|
|
1911
1930
|
item: a,
|
|
1912
1931
|
canTrack: o
|
|
1913
1932
|
}));
|
|
1914
|
-
t.results =
|
|
1915
|
-
} catch (
|
|
1916
|
-
logger.error("Could not process A/B tests. ",
|
|
1933
|
+
t.results = r;
|
|
1934
|
+
} catch (r) {
|
|
1935
|
+
logger.error("Could not process A/B tests. ", r);
|
|
1917
1936
|
}
|
|
1918
1937
|
return t;
|
|
1919
1938
|
};
|
|
@@ -1986,8 +2005,8 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
1986
2005
|
var o;
|
|
1987
2006
|
try {
|
|
1988
2007
|
t && ((o = getLocalStorage()) == null || o.setItem(e, n));
|
|
1989
|
-
} catch (
|
|
1990
|
-
console.debug("[LocalStorage] SET error: ",
|
|
2008
|
+
} catch (i) {
|
|
2009
|
+
console.debug("[LocalStorage] SET error: ", i);
|
|
1991
2010
|
}
|
|
1992
2011
|
}, VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId", getVisitorId = ({
|
|
1993
2012
|
canTrack: e
|
|
@@ -2036,11 +2055,11 @@ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
|
2036
2055
|
canTrack: t,
|
|
2037
2056
|
apiKey: n,
|
|
2038
2057
|
metadata: o,
|
|
2039
|
-
...
|
|
2058
|
+
...i
|
|
2040
2059
|
}) => ({
|
|
2041
2060
|
type: e,
|
|
2042
2061
|
data: {
|
|
2043
|
-
...
|
|
2062
|
+
...i,
|
|
2044
2063
|
metadata: {
|
|
2045
2064
|
url: location.href,
|
|
2046
2065
|
...o
|
|
@@ -2096,9 +2115,9 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2096
2115
|
event: e,
|
|
2097
2116
|
target: t
|
|
2098
2117
|
}) => {
|
|
2099
|
-
const n = t.getBoundingClientRect(), o = e.clientX - n.left,
|
|
2118
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = round(o / n.width), a = round(i / n.height);
|
|
2100
2119
|
return {
|
|
2101
|
-
x:
|
|
2120
|
+
x: r,
|
|
2102
2121
|
y: a
|
|
2103
2122
|
};
|
|
2104
2123
|
}, getInteractionPropertiesForEvent = (e) => {
|
|
@@ -2117,7 +2136,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2117
2136
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2118
2137
|
}
|
|
2119
2138
|
};
|
|
2120
|
-
}, SDK_VERSION = "0.7.
|
|
2139
|
+
}, SDK_VERSION = "0.7.5", registry = {};
|
|
2121
2140
|
function register(e, t) {
|
|
2122
2141
|
let n = registry[e];
|
|
2123
2142
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2130,8 +2149,8 @@ function register(e, t) {
|
|
|
2130
2149
|
};
|
|
2131
2150
|
try {
|
|
2132
2151
|
parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
|
|
2133
|
-
} catch (
|
|
2134
|
-
console.debug("Could not postmessage",
|
|
2152
|
+
} catch (i) {
|
|
2153
|
+
console.debug("Could not postmessage", i);
|
|
2135
2154
|
}
|
|
2136
2155
|
}
|
|
2137
2156
|
}
|
|
@@ -2180,24 +2199,24 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2180
2199
|
}, "*"), window.addEventListener("message", ({
|
|
2181
2200
|
data: o
|
|
2182
2201
|
}) => {
|
|
2183
|
-
var
|
|
2202
|
+
var i, r;
|
|
2184
2203
|
if (o != null && o.type)
|
|
2185
2204
|
switch (o.type) {
|
|
2186
2205
|
case "builder.evaluate": {
|
|
2187
|
-
const a = o.data.text, s = o.data.arguments || [], c = o.data.id,
|
|
2188
|
-
let
|
|
2206
|
+
const a = o.data.text, s = o.data.arguments || [], c = o.data.id, m = new Function(a);
|
|
2207
|
+
let f, g = null;
|
|
2189
2208
|
try {
|
|
2190
|
-
|
|
2209
|
+
f = m.apply(null, s);
|
|
2191
2210
|
} catch (p) {
|
|
2192
|
-
|
|
2211
|
+
g = p;
|
|
2193
2212
|
}
|
|
2194
|
-
|
|
2213
|
+
g ? (i = window.parent) == null || i.postMessage({
|
|
2195
2214
|
type: "builder.evaluateError",
|
|
2196
2215
|
data: {
|
|
2197
2216
|
id: c,
|
|
2198
|
-
error:
|
|
2217
|
+
error: g.message
|
|
2199
2218
|
}
|
|
2200
|
-
}, "*") :
|
|
2219
|
+
}, "*") : f && typeof f.then == "function" ? f.then((p) => {
|
|
2201
2220
|
var l;
|
|
2202
2221
|
(l = window.parent) == null || l.postMessage({
|
|
2203
2222
|
type: "builder.evaluateResult",
|
|
@@ -2206,10 +2225,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2206
2225
|
result: p
|
|
2207
2226
|
}
|
|
2208
2227
|
}, "*");
|
|
2209
|
-
}).catch(console.error) : (
|
|
2228
|
+
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
2210
2229
|
type: "builder.evaluateResult",
|
|
2211
2230
|
data: {
|
|
2212
|
-
result:
|
|
2231
|
+
result: f,
|
|
2213
2232
|
id: c
|
|
2214
2233
|
}
|
|
2215
2234
|
}, "*");
|
|
@@ -2218,10 +2237,10 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2218
2237
|
}
|
|
2219
2238
|
})));
|
|
2220
2239
|
}, getCssFromFont = (e) => {
|
|
2221
|
-
var
|
|
2222
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((
|
|
2223
|
-
let
|
|
2224
|
-
if (o && t && n && (
|
|
2240
|
+
var r;
|
|
2241
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
|
|
2242
|
+
let i = "";
|
|
2243
|
+
if (o && t && n && (i += `
|
|
2225
2244
|
@font-face {
|
|
2226
2245
|
font-family: "${t}";
|
|
2227
2246
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -2233,7 +2252,7 @@ font-weight: 400;
|
|
|
2233
2252
|
if (!(String(Number(a)) === a))
|
|
2234
2253
|
continue;
|
|
2235
2254
|
const c = e.files[a];
|
|
2236
|
-
c && c !== o && (
|
|
2255
|
+
c && c !== o && (i += `
|
|
2237
2256
|
@font-face {
|
|
2238
2257
|
font-family: "${t}";
|
|
2239
2258
|
src: url('${c}') format('woff2');
|
|
@@ -2242,7 +2261,7 @@ font-weight: ${a};
|
|
|
2242
2261
|
}
|
|
2243
2262
|
`.trim());
|
|
2244
2263
|
}
|
|
2245
|
-
return
|
|
2264
|
+
return i;
|
|
2246
2265
|
}, getFontCss = ({
|
|
2247
2266
|
customFonts: e
|
|
2248
2267
|
}) => {
|
|
@@ -2282,23 +2301,18 @@ const getContextStateInitialValue = ({
|
|
|
2282
2301
|
data: t,
|
|
2283
2302
|
locale: n
|
|
2284
2303
|
}) => {
|
|
2285
|
-
var
|
|
2286
|
-
const o = {};
|
|
2287
|
-
(
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
|
|
2304
|
+
var r, a, s;
|
|
2305
|
+
const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
|
|
2306
|
+
return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
|
|
2307
|
+
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
2308
|
+
}), {
|
|
2309
|
+
...o,
|
|
2310
|
+
...i,
|
|
2293
2311
|
...t,
|
|
2294
2312
|
...n ? {
|
|
2295
2313
|
locale: n
|
|
2296
2314
|
} : {}
|
|
2297
2315
|
};
|
|
2298
|
-
return {
|
|
2299
|
-
...o,
|
|
2300
|
-
...r
|
|
2301
|
-
};
|
|
2302
2316
|
}, getContentInitialValue = ({
|
|
2303
2317
|
content: e,
|
|
2304
2318
|
data: t
|
|
@@ -2311,12 +2325,12 @@ const getContextStateInitialValue = ({
|
|
|
2311
2325
|
meta: e == null ? void 0 : e.meta
|
|
2312
2326
|
} : void 0;
|
|
2313
2327
|
function ContentComponent(e) {
|
|
2314
|
-
var
|
|
2315
|
-
const t =
|
|
2328
|
+
var i, r, a, s, c, m, f, g, p;
|
|
2329
|
+
const t = getUpdateVariantVisibilityScript({
|
|
2316
2330
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2317
|
-
variationId: (
|
|
2331
|
+
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
2318
2332
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2319
|
-
contentId: (
|
|
2333
|
+
contentId: (r = e.content) == null ? void 0 : r.id
|
|
2320
2334
|
}), n = [
|
|
2321
2335
|
...getDefaultRegisteredComponents(),
|
|
2322
2336
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2327,10 +2341,10 @@ function ContentComponent(e) {
|
|
|
2327
2341
|
...components,
|
|
2328
2342
|
...e.customComponents || []
|
|
2329
2343
|
].reduce(
|
|
2330
|
-
(l, { component:
|
|
2344
|
+
(l, { component: u, ...d }) => ({
|
|
2331
2345
|
...l,
|
|
2332
2346
|
[d.name]: {
|
|
2333
|
-
component:
|
|
2347
|
+
component: u,
|
|
2334
2348
|
...serializeComponentInfo(d)
|
|
2335
2349
|
}
|
|
2336
2350
|
}),
|
|
@@ -2360,7 +2374,7 @@ function ContentComponent(e) {
|
|
|
2360
2374
|
...components,
|
|
2361
2375
|
...e.customComponents || []
|
|
2362
2376
|
].reduce(
|
|
2363
|
-
(l, { component:
|
|
2377
|
+
(l, { component: u, ...d }) => ({
|
|
2364
2378
|
...l,
|
|
2365
2379
|
[d.name]: serializeComponentInfo(d)
|
|
2366
2380
|
}),
|
|
@@ -2379,7 +2393,6 @@ function ContentComponent(e) {
|
|
|
2379
2393
|
locale: e.locale,
|
|
2380
2394
|
includeRefs: e.includeRefs,
|
|
2381
2395
|
enrich: e.enrich,
|
|
2382
|
-
classNameProp: e.classNameProp,
|
|
2383
2396
|
showContent: e.showContent,
|
|
2384
2397
|
builderContextSignal: o,
|
|
2385
2398
|
children: [
|
|
@@ -2389,13 +2402,13 @@ function ContentComponent(e) {
|
|
|
2389
2402
|
{
|
|
2390
2403
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2391
2404
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
2392
|
-
customFonts: (
|
|
2405
|
+
customFonts: (f = (m = o.content) == null ? void 0 : m.data) == null ? void 0 : f.customFonts
|
|
2393
2406
|
}
|
|
2394
2407
|
) }),
|
|
2395
2408
|
/* @__PURE__ */ jsx(
|
|
2396
2409
|
Blocks,
|
|
2397
2410
|
{
|
|
2398
|
-
blocks: (p = (
|
|
2411
|
+
blocks: (p = (g = o.content) == null ? void 0 : g.data) == null ? void 0 : p.blocks,
|
|
2399
2412
|
context: o,
|
|
2400
2413
|
registeredComponents: n
|
|
2401
2414
|
}
|
|
@@ -2405,26 +2418,26 @@ function ContentComponent(e) {
|
|
|
2405
2418
|
);
|
|
2406
2419
|
}
|
|
2407
2420
|
function ContentVariants(e) {
|
|
2408
|
-
var
|
|
2409
|
-
const t =
|
|
2421
|
+
var r, a;
|
|
2422
|
+
const t = checkShouldRenderVariants({
|
|
2410
2423
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2411
2424
|
content: e.content
|
|
2412
2425
|
}), n = function() {
|
|
2413
|
-
var
|
|
2414
|
-
return
|
|
2426
|
+
var c;
|
|
2427
|
+
return getUpdateCookieAndStylesScript(
|
|
2415
2428
|
getVariants(e.content).map((m) => ({
|
|
2416
2429
|
id: m.testVariationId,
|
|
2417
2430
|
testRatio: m.testRatio
|
|
2418
2431
|
})),
|
|
2419
|
-
((
|
|
2432
|
+
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2420
2433
|
);
|
|
2421
2434
|
}, o = function() {
|
|
2422
|
-
return getVariants(e.content).map((
|
|
2423
|
-
},
|
|
2424
|
-
var
|
|
2435
|
+
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2436
|
+
}, i = function() {
|
|
2437
|
+
var c;
|
|
2425
2438
|
return t ? {
|
|
2426
2439
|
...e.content,
|
|
2427
|
-
testVariationId: (
|
|
2440
|
+
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2428
2441
|
} : handleABTestingSync({
|
|
2429
2442
|
item: e.content,
|
|
2430
2443
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2436,17 +2449,16 @@ function ContentVariants(e) {
|
|
|
2436
2449
|
/* @__PURE__ */ jsx(
|
|
2437
2450
|
InlinedStyles,
|
|
2438
2451
|
{
|
|
2439
|
-
id: `variants-styles-${(
|
|
2452
|
+
id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
|
|
2440
2453
|
styles: o()
|
|
2441
2454
|
}
|
|
2442
2455
|
),
|
|
2443
2456
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: n() }),
|
|
2444
|
-
(a = getVariants(e.content)) == null ? void 0 : a.map((
|
|
2457
|
+
(a = getVariants(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ jsx(
|
|
2445
2458
|
ContentComponent,
|
|
2446
2459
|
{
|
|
2447
|
-
content:
|
|
2460
|
+
content: s,
|
|
2448
2461
|
showContent: !1,
|
|
2449
|
-
classNameProp: void 0,
|
|
2450
2462
|
model: e.model,
|
|
2451
2463
|
data: e.data,
|
|
2452
2464
|
context: e.context,
|
|
@@ -2459,14 +2471,13 @@ function ContentVariants(e) {
|
|
|
2459
2471
|
enrich: e.enrich,
|
|
2460
2472
|
isSsrAbTest: t
|
|
2461
2473
|
},
|
|
2462
|
-
|
|
2474
|
+
s.testVariationId
|
|
2463
2475
|
))
|
|
2464
2476
|
] }) : null,
|
|
2465
2477
|
/* @__PURE__ */ jsx(
|
|
2466
2478
|
ContentComponent,
|
|
2467
2479
|
{
|
|
2468
|
-
content:
|
|
2469
|
-
classNameProp: `variant-${(s = e.content) == null ? void 0 : s.id}`,
|
|
2480
|
+
content: i(),
|
|
2470
2481
|
showContent: !0,
|
|
2471
2482
|
model: e.model,
|
|
2472
2483
|
data: e.data,
|
|
@@ -2503,14 +2514,14 @@ const fetchSymbolContent = async ({
|
|
|
2503
2514
|
});
|
|
2504
2515
|
};
|
|
2505
2516
|
async function Symbol$1(e) {
|
|
2506
|
-
var o,
|
|
2517
|
+
var o, i, r, a;
|
|
2507
2518
|
const t = function() {
|
|
2508
|
-
var c,
|
|
2519
|
+
var c, m;
|
|
2509
2520
|
return [
|
|
2510
2521
|
e.attributes.className,
|
|
2511
2522
|
"builder-symbol",
|
|
2512
2523
|
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2513
|
-
(
|
|
2524
|
+
(m = e.symbol) != null && m.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2514
2525
|
].filter(Boolean).join(" ");
|
|
2515
2526
|
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2516
2527
|
symbol: e.symbol,
|
|
@@ -2525,9 +2536,9 @@ async function Symbol$1(e) {
|
|
|
2525
2536
|
context: e.builderContext.context,
|
|
2526
2537
|
customComponents: Object.values(e.builderComponents),
|
|
2527
2538
|
data: {
|
|
2528
|
-
...(
|
|
2539
|
+
...(i = e.symbol) == null ? void 0 : i.data,
|
|
2529
2540
|
...e.builderContext.localState,
|
|
2530
|
-
...(
|
|
2541
|
+
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2531
2542
|
},
|
|
2532
2543
|
model: (a = e.symbol) == null ? void 0 : a.model,
|
|
2533
2544
|
content: n
|
|
@@ -2546,8 +2557,8 @@ function setEditorSettings(e) {
|
|
|
2546
2557
|
}
|
|
2547
2558
|
}
|
|
2548
2559
|
const fetchBuilderProps = async (e) => {
|
|
2549
|
-
var o,
|
|
2550
|
-
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((
|
|
2560
|
+
var o, i, r;
|
|
2561
|
+
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2551
2562
|
...e,
|
|
2552
2563
|
apiKey: e.apiKey,
|
|
2553
2564
|
model: e.model || "page",
|
|
@@ -2557,7 +2568,7 @@ const fetchBuilderProps = async (e) => {
|
|
|
2557
2568
|
urlPath: t
|
|
2558
2569
|
} : {}
|
|
2559
2570
|
},
|
|
2560
|
-
options: getBuilderSearchParams(e.searchParams || ((
|
|
2571
|
+
options: getBuilderSearchParams(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
|
|
2561
2572
|
};
|
|
2562
2573
|
return {
|
|
2563
2574
|
apiKey: n.apiKey,
|