@builder.io/sdk-react-nextjs 0.14.3 → 0.14.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-1270c8f4.js → USE_CLIENT_BUNDLE-74f3e6f2.js} +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-516849e4.cjs → browser/USE_CLIENT_BUNDLE-e56f01ec.cjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-f29a4a48.js → browser/USE_SERVER_BUNDLE-3a3dc483.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-28ff24f9.cjs → browser/USE_SERVER_BUNDLE-7c06c484.cjs} +1 -1
- package/lib/browser/{bundle-bebe179f.cjs → bundle-8ef8c5b6.cjs} +21 -21
- package/lib/browser/{bundle-333e93b9.js → bundle-a12814b3.js} +312 -308
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-c1f06a46.cjs → edge/USE_CLIENT_BUNDLE-b2a39225.cjs} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-6ecc05ac.js → edge/USE_CLIENT_BUNDLE-e67f07cc.js} +3 -3
- package/lib/{node/USE_SERVER_BUNDLE-6a09d70e.js → edge/USE_SERVER_BUNDLE-73867d79.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-6860cf7c.cjs → edge/USE_SERVER_BUNDLE-e3fffb73.cjs} +1 -1
- package/lib/edge/{bundle-49ee510b.js → bundle-0b05a864.js} +428 -424
- package/lib/edge/{bundle-8abf9251.cjs → bundle-c16ee70d.cjs} +29 -29
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-91b3973b.js → node/USE_CLIENT_BUNDLE-2f41762a.js} +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-e0cb789c.cjs → node/USE_CLIENT_BUNDLE-b515332f.cjs} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-24e8f107.cjs → node/USE_SERVER_BUNDLE-77a99533.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-99e0334d.js → node/USE_SERVER_BUNDLE-e3a245fd.js} +1 -1
- package/lib/node/{bundle-e917fcc7.cjs → bundle-2d222eef.cjs} +2 -2
- package/lib/node/{bundle-35759433.js → bundle-860c064c.js} +17 -13
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-builder-search-params/index.d.ts +1 -4
- package/types/cjs/functions/is-editing.d.ts +2 -1
- package/types/cjs/functions/is-previewing.d.ts +2 -1
- package/types/cjs/helpers/search/search.d.ts +5 -0
- package/types/cjs/index.d.ts +5 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-builder-search-params/index.d.ts +1 -4
- package/types/esm/functions/is-editing.d.ts +2 -1
- package/types/esm/functions/is-previewing.d.ts +2 -1
- package/types/esm/helpers/search/search.d.ts +5 -0
- package/types/esm/index.d.ts +5 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as l, Fragment as S, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { LRUCache as
|
|
4
|
-
import { I as
|
|
3
|
+
import { LRUCache as Be } from "lru-cache";
|
|
4
|
+
import { I as Ve, B as We, a as Oe, D as $e, C as Fe, E as Ne, b as Le, V as Ue, c as _e, F as De, d as je, S as Me, e as He } from "./USE_CLIENT_BUNDLE-74f3e6f2.js";
|
|
5
5
|
import "next/navigation";
|
|
6
|
-
const
|
|
6
|
+
const Ke = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), no = (e) => typeof e == "string" && Ke.has(e.toLowerCase()), T = "rsc", D = () => {
|
|
7
7
|
switch (T) {
|
|
8
8
|
case "react":
|
|
9
9
|
case "reactNative":
|
|
@@ -16,7 +16,7 @@ const He = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr",
|
|
|
16
16
|
return "class";
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function ze(e) {
|
|
20
20
|
var t;
|
|
21
21
|
return {
|
|
22
22
|
...(t = e.component) == null ? void 0 : t.options,
|
|
@@ -36,20 +36,26 @@ const P = "[Builder.io]: ", x = {
|
|
|
36
36
|
function k() {
|
|
37
37
|
return typeof window < "u" && typeof document < "u";
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
const qe = (e) => {
|
|
40
|
+
const t = {};
|
|
41
|
+
return e.forEach((n, o) => {
|
|
42
|
+
t[o] = n;
|
|
43
|
+
}), t;
|
|
44
|
+
}, se = (e) => e instanceof URLSearchParams ? qe(e) : e, ce = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
|
|
45
|
+
function Ge() {
|
|
40
46
|
return k() && window.self !== window.top;
|
|
41
47
|
}
|
|
42
|
-
function j() {
|
|
43
|
-
return
|
|
48
|
+
function j(e) {
|
|
49
|
+
return Ge() && ce(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
44
50
|
}
|
|
45
|
-
const
|
|
51
|
+
const Ye = () => {
|
|
46
52
|
if (k()) {
|
|
47
53
|
const e = new URL(location.href);
|
|
48
54
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
49
55
|
} else
|
|
50
56
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
51
|
-
},
|
|
52
|
-
const e =
|
|
57
|
+
}, Je = () => typeof navigator == "object" && navigator.userAgent || "", le = () => {
|
|
58
|
+
const e = Je(), t = {
|
|
53
59
|
Android() {
|
|
54
60
|
return e.match(/Android/i);
|
|
55
61
|
},
|
|
@@ -68,13 +74,13 @@ const qe = () => {
|
|
|
68
74
|
any() {
|
|
69
75
|
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || T === "reactNative";
|
|
70
76
|
}
|
|
71
|
-
}, n = e.match(/Tablet|iPad/i), o =
|
|
77
|
+
}, n = e.match(/Tablet|iPad/i), o = Ye();
|
|
72
78
|
return {
|
|
73
79
|
urlPath: o == null ? void 0 : o.pathname,
|
|
74
80
|
host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
|
|
75
81
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
76
82
|
};
|
|
77
|
-
},
|
|
83
|
+
}, Qe = ({
|
|
78
84
|
builder: e,
|
|
79
85
|
context: t,
|
|
80
86
|
event: n,
|
|
@@ -86,12 +92,12 @@ const qe = () => {
|
|
|
86
92
|
builder: e,
|
|
87
93
|
context: t,
|
|
88
94
|
event: n
|
|
89
|
-
}),
|
|
95
|
+
}), Xe = () => ({
|
|
90
96
|
isEditing: j(),
|
|
91
97
|
isBrowser: k(),
|
|
92
98
|
isServer: !k(),
|
|
93
|
-
getUserAttributes: () =>
|
|
94
|
-
}),
|
|
99
|
+
getUserAttributes: () => le()
|
|
100
|
+
}), Ze = (e, {
|
|
95
101
|
isExpression: t = !0
|
|
96
102
|
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, q = ({
|
|
97
103
|
code: e,
|
|
@@ -102,11 +108,11 @@ const qe = () => {
|
|
|
102
108
|
rootSetState: r,
|
|
103
109
|
rootState: a
|
|
104
110
|
}) => {
|
|
105
|
-
const s =
|
|
111
|
+
const s = Qe({
|
|
106
112
|
builder: t,
|
|
107
113
|
context: n,
|
|
108
114
|
event: o,
|
|
109
|
-
state:
|
|
115
|
+
state: de({
|
|
110
116
|
rootState: a,
|
|
111
117
|
localState: i,
|
|
112
118
|
rootSetState: r
|
|
@@ -114,7 +120,7 @@ const qe = () => {
|
|
|
114
120
|
});
|
|
115
121
|
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
116
122
|
};
|
|
117
|
-
function
|
|
123
|
+
function de({
|
|
118
124
|
rootState: e,
|
|
119
125
|
localState: t,
|
|
120
126
|
rootSetState: n
|
|
@@ -124,7 +130,7 @@ function ce({
|
|
|
124
130
|
if (t && i in t)
|
|
125
131
|
return t[i];
|
|
126
132
|
const r = o[i];
|
|
127
|
-
return typeof r == "object" ?
|
|
133
|
+
return typeof r == "object" ? de({
|
|
128
134
|
rootState: r,
|
|
129
135
|
localState: void 0,
|
|
130
136
|
rootSetState: n ? (a) => {
|
|
@@ -140,17 +146,17 @@ function ce({
|
|
|
140
146
|
});
|
|
141
147
|
}
|
|
142
148
|
const w = (e) => e != null;
|
|
143
|
-
function
|
|
149
|
+
function et() {
|
|
144
150
|
var e;
|
|
145
151
|
return typeof process < "u" && w((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
146
152
|
}
|
|
147
|
-
const
|
|
153
|
+
const tt = () => {
|
|
148
154
|
var o;
|
|
149
|
-
if (!
|
|
155
|
+
if (!et())
|
|
150
156
|
return !1;
|
|
151
157
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
152
158
|
return e && t && !n ? (x.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
153
|
-
},
|
|
159
|
+
}, nt = (e) => (k() || tt(), q(e));
|
|
154
160
|
function M({
|
|
155
161
|
code: e,
|
|
156
162
|
context: t,
|
|
@@ -165,10 +171,10 @@ function M({
|
|
|
165
171
|
return;
|
|
166
172
|
}
|
|
167
173
|
const s = {
|
|
168
|
-
code:
|
|
174
|
+
code: Ze(e, {
|
|
169
175
|
isExpression: a
|
|
170
176
|
}),
|
|
171
|
-
builder:
|
|
177
|
+
builder: Xe(),
|
|
172
178
|
context: t,
|
|
173
179
|
event: r,
|
|
174
180
|
rootSetState: i,
|
|
@@ -176,7 +182,7 @@ function M({
|
|
|
176
182
|
localState: n
|
|
177
183
|
};
|
|
178
184
|
try {
|
|
179
|
-
return
|
|
185
|
+
return nt(s);
|
|
180
186
|
} catch (c) {
|
|
181
187
|
x.error("Failed code evaluation: " + c.message, {
|
|
182
188
|
code: e
|
|
@@ -184,13 +190,13 @@ function M({
|
|
|
184
190
|
return;
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
|
-
const W = (e) => JSON.parse(JSON.stringify(e)),
|
|
193
|
+
const W = (e) => JSON.parse(JSON.stringify(e)), ot = (e, t, n) => {
|
|
188
194
|
if (Object(e) !== e)
|
|
189
195
|
return e;
|
|
190
196
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
191
197
|
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;
|
|
192
198
|
};
|
|
193
|
-
const
|
|
199
|
+
const it = ({
|
|
194
200
|
block: e,
|
|
195
201
|
context: t,
|
|
196
202
|
localState: n,
|
|
@@ -216,7 +222,7 @@ const nt = ({
|
|
|
216
222
|
rootSetState: i,
|
|
217
223
|
context: t
|
|
218
224
|
});
|
|
219
|
-
|
|
225
|
+
ot(a, s, m);
|
|
220
226
|
}
|
|
221
227
|
return a;
|
|
222
228
|
};
|
|
@@ -229,7 +235,7 @@ function V({
|
|
|
229
235
|
rootSetState: r
|
|
230
236
|
}) {
|
|
231
237
|
const a = e;
|
|
232
|
-
return n ?
|
|
238
|
+
return n ? it({
|
|
233
239
|
block: a,
|
|
234
240
|
localState: o,
|
|
235
241
|
rootState: i,
|
|
@@ -237,7 +243,7 @@ function V({
|
|
|
237
243
|
context: t
|
|
238
244
|
}) : a;
|
|
239
245
|
}
|
|
240
|
-
const
|
|
246
|
+
const rt = ({
|
|
241
247
|
block: e,
|
|
242
248
|
context: t,
|
|
243
249
|
registeredComponents: n
|
|
@@ -259,7 +265,7 @@ const ot = ({
|
|
|
259
265
|
console.warn(`
|
|
260
266
|
Could not find a registered component named "${o}".
|
|
261
267
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
262
|
-
},
|
|
268
|
+
}, at = ({
|
|
263
269
|
block: e,
|
|
264
270
|
context: t
|
|
265
271
|
}) => {
|
|
@@ -292,7 +298,7 @@ const ot = ({
|
|
|
292
298
|
},
|
|
293
299
|
block: o
|
|
294
300
|
}));
|
|
295
|
-
},
|
|
301
|
+
}, ue = {
|
|
296
302
|
small: {
|
|
297
303
|
min: 320,
|
|
298
304
|
default: 321,
|
|
@@ -308,11 +314,11 @@ const ot = ({
|
|
|
308
314
|
default: 991,
|
|
309
315
|
max: 1200
|
|
310
316
|
}
|
|
311
|
-
}, G = (e, t =
|
|
317
|
+
}, G = (e, t = ue) => `@media (max-width: ${t[e].max}px)`, me = ({
|
|
312
318
|
small: e,
|
|
313
319
|
medium: t
|
|
314
320
|
}) => {
|
|
315
|
-
const n = W(
|
|
321
|
+
const n = W(ue);
|
|
316
322
|
if (!e || !t)
|
|
317
323
|
return n;
|
|
318
324
|
const o = Math.floor(e / 2);
|
|
@@ -334,17 +340,17 @@ const ot = ({
|
|
|
334
340
|
min: r,
|
|
335
341
|
default: r + 1
|
|
336
342
|
}, n;
|
|
337
|
-
},
|
|
343
|
+
}, st = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), fe = (e) => Object.entries(e).map(([n, o]) => {
|
|
338
344
|
if (typeof o == "string")
|
|
339
|
-
return `${
|
|
340
|
-
}).filter(w),
|
|
345
|
+
return `${st(n)}: ${o};`;
|
|
346
|
+
}).filter(w), ct = (e) => fe(e).join(`
|
|
341
347
|
`), N = ({
|
|
342
348
|
mediaQuery: e,
|
|
343
349
|
className: t,
|
|
344
350
|
styles: n
|
|
345
351
|
}) => {
|
|
346
352
|
const o = `.${t} {
|
|
347
|
-
${
|
|
353
|
+
${ct(n)}
|
|
348
354
|
}`;
|
|
349
355
|
return e ? `${e} {
|
|
350
356
|
${o}
|
|
@@ -353,7 +359,7 @@ const ot = ({
|
|
|
353
359
|
function O(e) {
|
|
354
360
|
return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
355
361
|
}
|
|
356
|
-
function
|
|
362
|
+
function lt(e) {
|
|
357
363
|
const t = function() {
|
|
358
364
|
const i = V({
|
|
359
365
|
block: e.block,
|
|
@@ -373,7 +379,7 @@ function st(e) {
|
|
|
373
379
|
rootSetState: e.context.rootSetState,
|
|
374
380
|
context: e.context.context,
|
|
375
381
|
shouldEvaluateBindings: !0
|
|
376
|
-
}), r = i.responsiveStyles, a = e.context.content, s =
|
|
382
|
+
}), r = i.responsiveStyles, a = e.context.content, s = me(
|
|
377
383
|
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
378
384
|
), c = r == null ? void 0 : r.large, m = r == null ? void 0 : r.medium, b = r == null ? void 0 : r.small, g = i.id;
|
|
379
385
|
if (!g)
|
|
@@ -400,10 +406,10 @@ function st(e) {
|
|
|
400
406
|
};
|
|
401
407
|
return /* @__PURE__ */ l(S, { children: n() && t() ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(O, { styles: n() }) }) : null });
|
|
402
408
|
}
|
|
403
|
-
function
|
|
409
|
+
function dt(e) {
|
|
404
410
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
405
411
|
}
|
|
406
|
-
const
|
|
412
|
+
const ut = (e) => `on${dt(e)}`, mt = (e, t) => (n) => M({
|
|
407
413
|
code: e,
|
|
408
414
|
context: t.context,
|
|
409
415
|
localState: t.localState,
|
|
@@ -412,13 +418,13 @@ const lt = (e) => `on${ct(e)}`, dt = (e, t) => (n) => M({
|
|
|
412
418
|
event: n,
|
|
413
419
|
isExpression: !1
|
|
414
420
|
});
|
|
415
|
-
function
|
|
421
|
+
function oo(e) {
|
|
416
422
|
const t = {}, n = e.block.actions ?? {};
|
|
417
423
|
for (const o in n) {
|
|
418
424
|
if (!n.hasOwnProperty(o))
|
|
419
425
|
continue;
|
|
420
426
|
const i = n[o];
|
|
421
|
-
let r =
|
|
427
|
+
let r = ut(o);
|
|
422
428
|
if (e.stripPrefix)
|
|
423
429
|
switch (T) {
|
|
424
430
|
case "vue":
|
|
@@ -428,29 +434,29 @@ function no(e) {
|
|
|
428
434
|
r = r.replace("on:", "");
|
|
429
435
|
break;
|
|
430
436
|
}
|
|
431
|
-
t[r] =
|
|
437
|
+
t[r] = mt(i, e);
|
|
432
438
|
}
|
|
433
439
|
return t;
|
|
434
440
|
}
|
|
435
|
-
function
|
|
441
|
+
function ft({
|
|
436
442
|
style: e
|
|
437
443
|
}) {
|
|
438
444
|
return e;
|
|
439
445
|
}
|
|
440
|
-
const
|
|
446
|
+
const ht = ({
|
|
441
447
|
block: e,
|
|
442
448
|
context: t
|
|
443
|
-
}) =>
|
|
449
|
+
}) => he(ft({
|
|
444
450
|
style: e.style || {},
|
|
445
451
|
context: t,
|
|
446
452
|
block: e
|
|
447
453
|
}));
|
|
448
|
-
function
|
|
454
|
+
function he(e) {
|
|
449
455
|
switch (T) {
|
|
450
456
|
case "svelte":
|
|
451
457
|
case "vue":
|
|
452
458
|
case "solid":
|
|
453
|
-
return
|
|
459
|
+
return fe(e).join(" ");
|
|
454
460
|
case "qwik":
|
|
455
461
|
case "reactNative":
|
|
456
462
|
case "react":
|
|
@@ -458,36 +464,36 @@ function me(e) {
|
|
|
458
464
|
return e;
|
|
459
465
|
}
|
|
460
466
|
}
|
|
461
|
-
function
|
|
467
|
+
function pt({
|
|
462
468
|
properties: e
|
|
463
469
|
}) {
|
|
464
470
|
return e;
|
|
465
471
|
}
|
|
466
|
-
const
|
|
472
|
+
const gt = (e) => ({
|
|
467
473
|
href: e.href
|
|
468
474
|
});
|
|
469
|
-
function
|
|
475
|
+
function bt({
|
|
470
476
|
block: e,
|
|
471
477
|
context: t
|
|
472
478
|
}) {
|
|
473
479
|
var o;
|
|
474
480
|
const n = {
|
|
475
|
-
...
|
|
481
|
+
...gt(e),
|
|
476
482
|
...e.properties,
|
|
477
483
|
"builder-id": e.id,
|
|
478
|
-
style:
|
|
484
|
+
style: ht({
|
|
479
485
|
block: e,
|
|
480
486
|
context: t
|
|
481
487
|
}),
|
|
482
488
|
[D()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
483
489
|
};
|
|
484
|
-
return
|
|
490
|
+
return pt({
|
|
485
491
|
properties: n,
|
|
486
492
|
context: t,
|
|
487
493
|
block: e
|
|
488
494
|
});
|
|
489
495
|
}
|
|
490
|
-
const
|
|
496
|
+
const yt = ({
|
|
491
497
|
componentOptions: e,
|
|
492
498
|
builderBlock: t,
|
|
493
499
|
context: n,
|
|
@@ -503,7 +509,7 @@ const gt = ({
|
|
|
503
509
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
504
510
|
*/
|
|
505
511
|
...i ? {
|
|
506
|
-
attributes:
|
|
512
|
+
attributes: bt({
|
|
507
513
|
block: t,
|
|
508
514
|
context: a
|
|
509
515
|
})
|
|
@@ -519,11 +525,11 @@ const gt = ({
|
|
|
519
525
|
};
|
|
520
526
|
function Y(e) {
|
|
521
527
|
var n;
|
|
522
|
-
const t = e.isInteractive ?
|
|
528
|
+
const t = e.isInteractive ? Ve : e.componentRef;
|
|
523
529
|
return /* @__PURE__ */ l(S, { children: e.componentRef ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(
|
|
524
530
|
t,
|
|
525
531
|
{
|
|
526
|
-
...
|
|
532
|
+
...yt({
|
|
527
533
|
componentOptions: e.componentOptions,
|
|
528
534
|
builderBlock: e.builderBlock,
|
|
529
535
|
context: e.context,
|
|
@@ -546,7 +552,7 @@ function Y(e) {
|
|
|
546
552
|
}
|
|
547
553
|
) }) : null });
|
|
548
554
|
}
|
|
549
|
-
function
|
|
555
|
+
function St(e) {
|
|
550
556
|
const t = e.repeatContext;
|
|
551
557
|
return /* @__PURE__ */ l(
|
|
552
558
|
$,
|
|
@@ -561,13 +567,13 @@ function bt(e) {
|
|
|
561
567
|
function $(e) {
|
|
562
568
|
var m, b, g;
|
|
563
569
|
const t = function() {
|
|
564
|
-
return
|
|
570
|
+
return rt({
|
|
565
571
|
block: e.block,
|
|
566
572
|
context: e.context,
|
|
567
573
|
registeredComponents: e.registeredComponents
|
|
568
574
|
});
|
|
569
575
|
}, n = function() {
|
|
570
|
-
return
|
|
576
|
+
return at({
|
|
571
577
|
block: e.block,
|
|
572
578
|
context: e.context
|
|
573
579
|
});
|
|
@@ -599,7 +605,7 @@ function $(e) {
|
|
|
599
605
|
blockChildren: o().children ?? [],
|
|
600
606
|
componentRef: (h = t()) == null ? void 0 : h.component,
|
|
601
607
|
componentOptions: {
|
|
602
|
-
...
|
|
608
|
+
...ze(o()),
|
|
603
609
|
builderContext: e.context,
|
|
604
610
|
...((u = t()) == null ? void 0 : u.name) === "Core:Button" || ((d = t()) == null ? void 0 : d.name) === "Symbol" || ((y = t()) == null ? void 0 : y.name) === "Columns" || ((p = t()) == null ? void 0 : p.name) === "Form:Form" ? {
|
|
605
611
|
builderLinkComponent: e.linkComponent
|
|
@@ -617,7 +623,7 @@ function $(e) {
|
|
|
617
623
|
};
|
|
618
624
|
}, c = e.context;
|
|
619
625
|
return /* @__PURE__ */ l(S, { children: r() ? /* @__PURE__ */ R(S, { children: [
|
|
620
|
-
/* @__PURE__ */ l(
|
|
626
|
+
/* @__PURE__ */ l(lt, { block: e.block, context: e.context }),
|
|
621
627
|
(m = t()) != null && m.noWrap ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(
|
|
622
628
|
Y,
|
|
623
629
|
{
|
|
@@ -632,7 +638,7 @@ function $(e) {
|
|
|
632
638
|
isInteractive: s().isInteractive
|
|
633
639
|
}
|
|
634
640
|
) }) : /* @__PURE__ */ l(S, { children: n() ? /* @__PURE__ */ l(S, { children: (g = n()) == null ? void 0 : g.map((f, h) => /* @__PURE__ */ l(
|
|
635
|
-
|
|
641
|
+
St,
|
|
636
642
|
{
|
|
637
643
|
repeatContext: f.context,
|
|
638
644
|
block: f.block,
|
|
@@ -641,7 +647,7 @@ function $(e) {
|
|
|
641
647
|
},
|
|
642
648
|
h
|
|
643
649
|
)) }) : /* @__PURE__ */ l(S, { children: /* @__PURE__ */ R(
|
|
644
|
-
|
|
650
|
+
We,
|
|
645
651
|
{
|
|
646
652
|
Wrapper: i(),
|
|
647
653
|
block: o(),
|
|
@@ -680,7 +686,7 @@ function $(e) {
|
|
|
680
686
|
function H(e) {
|
|
681
687
|
var t, n, o;
|
|
682
688
|
return /* @__PURE__ */ l(
|
|
683
|
-
|
|
689
|
+
Oe,
|
|
684
690
|
{
|
|
685
691
|
blocks: e.blocks,
|
|
686
692
|
parent: e.parent,
|
|
@@ -701,7 +707,7 @@ function H(e) {
|
|
|
701
707
|
}
|
|
702
708
|
);
|
|
703
709
|
}
|
|
704
|
-
function
|
|
710
|
+
function kt(e) {
|
|
705
711
|
var h;
|
|
706
712
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
|
|
707
713
|
var y;
|
|
@@ -756,7 +762,7 @@ function yt(e) {
|
|
|
756
762
|
};
|
|
757
763
|
}, g = function(d) {
|
|
758
764
|
var p, C;
|
|
759
|
-
return
|
|
765
|
+
return me(
|
|
760
766
|
((C = (p = e.builderContext.content) == null ? void 0 : p.meta) == null ? void 0 : C.breakpoints) || {}
|
|
761
767
|
)[d].max;
|
|
762
768
|
}, f = function() {
|
|
@@ -795,7 +801,7 @@ function yt(e) {
|
|
|
795
801
|
children: [
|
|
796
802
|
/* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(O, { styles: f() }) }),
|
|
797
803
|
(h = e.columns) == null ? void 0 : h.map((u, d) => /* @__PURE__ */ l(
|
|
798
|
-
|
|
804
|
+
$e,
|
|
799
805
|
{
|
|
800
806
|
TagName: u.link ? e.builderLinkComponent || "a" : "div",
|
|
801
807
|
actionAttributes: {},
|
|
@@ -804,7 +810,7 @@ function yt(e) {
|
|
|
804
810
|
href: u.link
|
|
805
811
|
} : {},
|
|
806
812
|
[D()]: "builder-column",
|
|
807
|
-
style:
|
|
813
|
+
style: he(b(d))
|
|
808
814
|
},
|
|
809
815
|
children: /* @__PURE__ */ l(
|
|
810
816
|
H,
|
|
@@ -835,11 +841,11 @@ function yt(e) {
|
|
|
835
841
|
function J(e) {
|
|
836
842
|
return e.replace(/http(s)?:/, "");
|
|
837
843
|
}
|
|
838
|
-
function
|
|
844
|
+
function vt(e = "", t, n) {
|
|
839
845
|
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
840
846
|
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
841
847
|
}
|
|
842
|
-
function
|
|
848
|
+
function xt(e, t) {
|
|
843
849
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
844
850
|
return e;
|
|
845
851
|
if (t === "master")
|
|
@@ -851,23 +857,23 @@ function kt(e, t) {
|
|
|
851
857
|
}
|
|
852
858
|
return null;
|
|
853
859
|
}
|
|
854
|
-
function
|
|
860
|
+
function io(e) {
|
|
855
861
|
if (!e)
|
|
856
862
|
return e;
|
|
857
863
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
858
864
|
if (e.match(/builder\.io/)) {
|
|
859
865
|
let n = e;
|
|
860
866
|
const o = Number(e.split("?width=")[1]);
|
|
861
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${
|
|
867
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${vt(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
862
868
|
}
|
|
863
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [
|
|
869
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [xt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
864
870
|
}
|
|
865
|
-
const
|
|
871
|
+
const Ct = (e) => {
|
|
866
872
|
if (e === "localhost" || e === "127.0.0.1")
|
|
867
873
|
return e;
|
|
868
874
|
const t = e.split(".");
|
|
869
875
|
return t.length > 2 ? t.slice(1).join(".") : e;
|
|
870
|
-
},
|
|
876
|
+
}, pe = ({
|
|
871
877
|
name: e,
|
|
872
878
|
canTrack: t
|
|
873
879
|
}) => {
|
|
@@ -878,14 +884,14 @@ const vt = (e) => {
|
|
|
878
884
|
x.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
879
885
|
return;
|
|
880
886
|
}
|
|
881
|
-
},
|
|
887
|
+
}, ge = async (e) => pe(e), wt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(w).join("; "), It = [["secure", ""], ["SameSite", "None"]], Tt = ({
|
|
882
888
|
name: e,
|
|
883
889
|
value: t,
|
|
884
890
|
expires: n
|
|
885
891
|
}) => {
|
|
886
|
-
const i = (k() ? location.protocol === "https:" : !0) ?
|
|
887
|
-
return
|
|
888
|
-
},
|
|
892
|
+
const i = (k() ? location.protocol === "https:" : !0) ? It : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Ct(window.location.hostname)], ...i];
|
|
893
|
+
return wt(a);
|
|
894
|
+
}, be = async ({
|
|
889
895
|
name: e,
|
|
890
896
|
value: t,
|
|
891
897
|
expires: n,
|
|
@@ -894,7 +900,7 @@ const vt = (e) => {
|
|
|
894
900
|
try {
|
|
895
901
|
if (!o)
|
|
896
902
|
return;
|
|
897
|
-
const i =
|
|
903
|
+
const i = Tt({
|
|
898
904
|
name: e,
|
|
899
905
|
value: t,
|
|
900
906
|
expires: n
|
|
@@ -903,24 +909,24 @@ const vt = (e) => {
|
|
|
903
909
|
} catch (i) {
|
|
904
910
|
x.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
905
911
|
}
|
|
906
|
-
},
|
|
912
|
+
}, Et = "builder.tests", K = (e) => `${Et}.${e}`, Rt = ({
|
|
907
913
|
contentId: e
|
|
908
|
-
}) =>
|
|
914
|
+
}) => ge({
|
|
909
915
|
name: K(e),
|
|
910
916
|
canTrack: !0
|
|
911
|
-
}),
|
|
917
|
+
}), Pt = ({
|
|
912
918
|
contentId: e
|
|
913
|
-
}) =>
|
|
919
|
+
}) => pe({
|
|
914
920
|
name: K(e),
|
|
915
921
|
canTrack: !0
|
|
916
|
-
}),
|
|
922
|
+
}), At = ({
|
|
917
923
|
contentId: e,
|
|
918
924
|
value: t
|
|
919
|
-
}) =>
|
|
925
|
+
}) => be({
|
|
920
926
|
name: K(e),
|
|
921
927
|
value: t,
|
|
922
928
|
canTrack: !0
|
|
923
|
-
}),
|
|
929
|
+
}), ye = (e) => w(e.id) && w(e.variations) && Object.keys(e.variations).length > 0, Bt = ({
|
|
924
930
|
id: e,
|
|
925
931
|
variations: t
|
|
926
932
|
}) => {
|
|
@@ -933,15 +939,15 @@ const vt = (e) => {
|
|
|
933
939
|
return r;
|
|
934
940
|
}
|
|
935
941
|
return e;
|
|
936
|
-
},
|
|
937
|
-
const t =
|
|
938
|
-
return
|
|
942
|
+
}, Se = (e) => {
|
|
943
|
+
const t = Bt(e);
|
|
944
|
+
return At({
|
|
939
945
|
contentId: e.id,
|
|
940
946
|
value: t
|
|
941
947
|
}).catch((n) => {
|
|
942
948
|
x.error("could not store A/B test variation: ", n);
|
|
943
949
|
}), t;
|
|
944
|
-
},
|
|
950
|
+
}, ke = ({
|
|
945
951
|
item: e,
|
|
946
952
|
testGroupId: t
|
|
947
953
|
}) => {
|
|
@@ -955,7 +961,7 @@ const vt = (e) => {
|
|
|
955
961
|
testVariationId: n.id,
|
|
956
962
|
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
957
963
|
};
|
|
958
|
-
},
|
|
964
|
+
}, Vt = ({
|
|
959
965
|
item: e,
|
|
960
966
|
canTrack: t
|
|
961
967
|
}) => {
|
|
@@ -963,14 +969,14 @@ const vt = (e) => {
|
|
|
963
969
|
return e;
|
|
964
970
|
if (!e)
|
|
965
971
|
return;
|
|
966
|
-
if (!
|
|
972
|
+
if (!ye(e))
|
|
967
973
|
return e;
|
|
968
|
-
const n =
|
|
974
|
+
const n = Pt({
|
|
969
975
|
contentId: e.id
|
|
970
|
-
}) ||
|
|
976
|
+
}) || Se({
|
|
971
977
|
variations: e.variations,
|
|
972
978
|
id: e.id
|
|
973
|
-
}), o =
|
|
979
|
+
}), o = ke({
|
|
974
980
|
item: e,
|
|
975
981
|
testGroupId: n
|
|
976
982
|
});
|
|
@@ -978,18 +984,18 @@ const vt = (e) => {
|
|
|
978
984
|
...e,
|
|
979
985
|
...o
|
|
980
986
|
};
|
|
981
|
-
},
|
|
987
|
+
}, Wt = async ({
|
|
982
988
|
item: e,
|
|
983
989
|
canTrack: t
|
|
984
990
|
}) => {
|
|
985
|
-
if (!t || !
|
|
991
|
+
if (!t || !ye(e))
|
|
986
992
|
return e;
|
|
987
|
-
const o = await
|
|
993
|
+
const o = await Rt({
|
|
988
994
|
contentId: e.id
|
|
989
|
-
}) ||
|
|
995
|
+
}) || Se({
|
|
990
996
|
variations: e.variations,
|
|
991
997
|
id: e.id
|
|
992
|
-
}), i =
|
|
998
|
+
}), i = ke({
|
|
993
999
|
item: e,
|
|
994
1000
|
testGroupId: o
|
|
995
1001
|
});
|
|
@@ -997,7 +1003,7 @@ const vt = (e) => {
|
|
|
997
1003
|
...e,
|
|
998
1004
|
...i
|
|
999
1005
|
};
|
|
1000
|
-
}, L = (e) => w(e) ? e : !0,
|
|
1006
|
+
}, L = (e) => w(e) ? e : !0, Ot = {
|
|
1001
1007
|
name: "Core:Button",
|
|
1002
1008
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1003
1009
|
defaultStyles: {
|
|
@@ -1030,7 +1036,7 @@ const vt = (e) => {
|
|
|
1030
1036
|
}],
|
|
1031
1037
|
static: !0,
|
|
1032
1038
|
noWrap: !0
|
|
1033
|
-
},
|
|
1039
|
+
}, $t = {
|
|
1034
1040
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1035
1041
|
name: "Columns",
|
|
1036
1042
|
isRSC: !0,
|
|
@@ -1231,13 +1237,13 @@ const vt = (e) => {
|
|
|
1231
1237
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1232
1238
|
advanced: !0
|
|
1233
1239
|
}]
|
|
1234
|
-
},
|
|
1240
|
+
}, Ft = {
|
|
1235
1241
|
name: "Fragment",
|
|
1236
1242
|
static: !0,
|
|
1237
1243
|
hidden: !0,
|
|
1238
1244
|
canHaveChildren: !0,
|
|
1239
1245
|
noWrap: !0
|
|
1240
|
-
},
|
|
1246
|
+
}, Nt = {
|
|
1241
1247
|
name: "Image",
|
|
1242
1248
|
static: !0,
|
|
1243
1249
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1337,7 +1343,7 @@ const vt = (e) => {
|
|
|
1337
1343
|
advanced: !0,
|
|
1338
1344
|
defaultValue: 0.7041
|
|
1339
1345
|
}]
|
|
1340
|
-
},
|
|
1346
|
+
}, Lt = {
|
|
1341
1347
|
name: "Core:Section",
|
|
1342
1348
|
static: !0,
|
|
1343
1349
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1376,7 +1382,7 @@ const vt = (e) => {
|
|
|
1376
1382
|
}
|
|
1377
1383
|
}
|
|
1378
1384
|
}]
|
|
1379
|
-
},
|
|
1385
|
+
}, Ut = {
|
|
1380
1386
|
name: "Slot",
|
|
1381
1387
|
isRSC: !0,
|
|
1382
1388
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -1390,7 +1396,7 @@ const vt = (e) => {
|
|
|
1390
1396
|
defaultValue: "children"
|
|
1391
1397
|
}]
|
|
1392
1398
|
};
|
|
1393
|
-
function
|
|
1399
|
+
function _t(e) {
|
|
1394
1400
|
var t, n, o;
|
|
1395
1401
|
return /* @__PURE__ */ l(
|
|
1396
1402
|
"div",
|
|
@@ -1413,7 +1419,7 @@ function Lt(e) {
|
|
|
1413
1419
|
}
|
|
1414
1420
|
);
|
|
1415
1421
|
}
|
|
1416
|
-
const
|
|
1422
|
+
const Dt = {
|
|
1417
1423
|
name: "Symbol",
|
|
1418
1424
|
noWrap: !0,
|
|
1419
1425
|
static: !0,
|
|
@@ -1446,7 +1452,7 @@ const Ut = {
|
|
|
1446
1452
|
hideFromUI: !0,
|
|
1447
1453
|
type: "boolean"
|
|
1448
1454
|
}]
|
|
1449
|
-
},
|
|
1455
|
+
}, jt = {
|
|
1450
1456
|
name: "Text",
|
|
1451
1457
|
static: !0,
|
|
1452
1458
|
isRSC: !0,
|
|
@@ -1465,7 +1471,7 @@ const Ut = {
|
|
|
1465
1471
|
textAlign: "center"
|
|
1466
1472
|
}
|
|
1467
1473
|
};
|
|
1468
|
-
function
|
|
1474
|
+
function Mt(e) {
|
|
1469
1475
|
var t;
|
|
1470
1476
|
return /* @__PURE__ */ l(
|
|
1471
1477
|
"div",
|
|
@@ -1478,7 +1484,7 @@ function Dt(e) {
|
|
|
1478
1484
|
}
|
|
1479
1485
|
);
|
|
1480
1486
|
}
|
|
1481
|
-
const
|
|
1487
|
+
const Ht = {
|
|
1482
1488
|
name: "Custom Code",
|
|
1483
1489
|
static: !0,
|
|
1484
1490
|
requiredPermissions: ["editCode"],
|
|
@@ -1500,7 +1506,7 @@ const jt = {
|
|
|
1500
1506
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1501
1507
|
advanced: !0
|
|
1502
1508
|
}]
|
|
1503
|
-
},
|
|
1509
|
+
}, Kt = {
|
|
1504
1510
|
name: "Embed",
|
|
1505
1511
|
static: !0,
|
|
1506
1512
|
inputs: [{
|
|
@@ -1525,7 +1531,7 @@ const jt = {
|
|
|
1525
1531
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1526
1532
|
hideFromUI: !0
|
|
1527
1533
|
}]
|
|
1528
|
-
},
|
|
1534
|
+
}, zt = ["text/javascript", "application/javascript", "application/ecmascript"], ro = (e) => zt.includes(e.type), qt = {
|
|
1529
1535
|
// friendlyName?
|
|
1530
1536
|
name: "Raw:Img",
|
|
1531
1537
|
hideFromInsertMenu: !0,
|
|
@@ -1539,7 +1545,7 @@ const jt = {
|
|
|
1539
1545
|
}],
|
|
1540
1546
|
noWrap: !0,
|
|
1541
1547
|
static: !0
|
|
1542
|
-
},
|
|
1548
|
+
}, Gt = {
|
|
1543
1549
|
name: "Video",
|
|
1544
1550
|
canHaveChildren: !0,
|
|
1545
1551
|
defaultStyles: {
|
|
@@ -1620,58 +1626,58 @@ const jt = {
|
|
|
1620
1626
|
defaultValue: !0,
|
|
1621
1627
|
advanced: !0
|
|
1622
1628
|
}]
|
|
1623
|
-
},
|
|
1624
|
-
component: $e,
|
|
1625
|
-
...jt
|
|
1626
|
-
}, {
|
|
1629
|
+
}, Yt = () => [{
|
|
1627
1630
|
component: Fe,
|
|
1628
|
-
...
|
|
1631
|
+
...Ht
|
|
1629
1632
|
}, {
|
|
1630
1633
|
component: Ne,
|
|
1631
1634
|
...Kt
|
|
1632
1635
|
}, {
|
|
1633
1636
|
component: Le,
|
|
1634
|
-
...
|
|
1635
|
-
}], Q = () => [{
|
|
1636
|
-
component: Ue,
|
|
1637
|
-
...Vt
|
|
1638
|
-
}, {
|
|
1639
|
-
component: yt,
|
|
1640
|
-
...Wt
|
|
1637
|
+
...qt
|
|
1641
1638
|
}, {
|
|
1639
|
+
component: Ue,
|
|
1640
|
+
...Gt
|
|
1641
|
+
}], Q = () => [{
|
|
1642
1642
|
component: _e,
|
|
1643
1643
|
...Ot
|
|
1644
1644
|
}, {
|
|
1645
|
-
component:
|
|
1645
|
+
component: kt,
|
|
1646
1646
|
...$t
|
|
1647
1647
|
}, {
|
|
1648
|
-
component:
|
|
1648
|
+
component: De,
|
|
1649
1649
|
...Ft
|
|
1650
1650
|
}, {
|
|
1651
|
-
component:
|
|
1651
|
+
component: je,
|
|
1652
1652
|
...Nt
|
|
1653
1653
|
}, {
|
|
1654
|
-
component:
|
|
1654
|
+
component: Me,
|
|
1655
|
+
...Lt
|
|
1656
|
+
}, {
|
|
1657
|
+
component: _t,
|
|
1655
1658
|
...Ut
|
|
1656
1659
|
}, {
|
|
1657
|
-
component:
|
|
1658
|
-
...
|
|
1659
|
-
},
|
|
1660
|
+
component: Jn,
|
|
1661
|
+
...Dt
|
|
1662
|
+
}, {
|
|
1663
|
+
component: Mt,
|
|
1664
|
+
...jt
|
|
1665
|
+
}, ...Yt()], ao = (e) => ({
|
|
1660
1666
|
type: "builder.registerComponent",
|
|
1661
1667
|
data: U(e)
|
|
1662
|
-
}),
|
|
1668
|
+
}), Jt = (e) => {
|
|
1663
1669
|
const t = e.toString().trim();
|
|
1664
1670
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1665
|
-
},
|
|
1671
|
+
}, Qt = (e) => typeof e == "function" ? Jt(e) : W(e), U = ({
|
|
1666
1672
|
inputs: e,
|
|
1667
1673
|
...t
|
|
1668
1674
|
}) => ({
|
|
1669
1675
|
...W(t),
|
|
1670
1676
|
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1671
1677
|
...o,
|
|
1672
|
-
[i]:
|
|
1678
|
+
[i]: Qt(r)
|
|
1673
1679
|
}), {}))
|
|
1674
|
-
}),
|
|
1680
|
+
}), Xt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1675
1681
|
function getAndSetVariantId() {
|
|
1676
1682
|
function setCookie(name, value, days) {
|
|
1677
1683
|
let expires = '';
|
|
@@ -1727,7 +1733,7 @@ const jt = {
|
|
|
1727
1733
|
}).join('');
|
|
1728
1734
|
styleEl.innerHTML = newStyleStr;
|
|
1729
1735
|
}
|
|
1730
|
-
}`,
|
|
1736
|
+
}`, Zt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
1731
1737
|
if (!navigator.cookieEnabled) {
|
|
1732
1738
|
return;
|
|
1733
1739
|
}
|
|
@@ -1761,24 +1767,24 @@ const jt = {
|
|
|
1761
1767
|
thisScriptEl?.remove();
|
|
1762
1768
|
}
|
|
1763
1769
|
return;
|
|
1764
|
-
}`,
|
|
1770
|
+
}`, ve = "builderIoAbTest", xe = "builderIoRenderContent", A = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
1765
1771
|
...t,
|
|
1766
1772
|
testVariationId: t.id,
|
|
1767
1773
|
id: e == null ? void 0 : e.id
|
|
1768
|
-
})),
|
|
1774
|
+
})), en = ({
|
|
1769
1775
|
canTrack: e,
|
|
1770
1776
|
content: t
|
|
1771
|
-
}) => !(!(A(t).length > 0) || !e || k()),
|
|
1772
|
-
window.${
|
|
1773
|
-
window.${
|
|
1774
|
-
`,
|
|
1775
|
-
window.${
|
|
1776
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
1777
|
-
)`,
|
|
1777
|
+
}) => !(!(A(t).length > 0) || !e || k()), tn = (e) => e === "react" || e === "reactNative", Ce = tn(T), nn = () => `
|
|
1778
|
+
window.${ve} = ${Xt}
|
|
1779
|
+
window.${xe} = ${Zt}
|
|
1780
|
+
`, on = (e, t) => `
|
|
1781
|
+
window.${ve}(
|
|
1782
|
+
"${t}",${JSON.stringify(e)}, ${Ce}
|
|
1783
|
+
)`, rn = ({
|
|
1778
1784
|
contentId: e,
|
|
1779
1785
|
variationId: t
|
|
1780
|
-
}) => `window.${
|
|
1781
|
-
"${t}", "${e}", ${
|
|
1786
|
+
}) => `window.${xe}(
|
|
1787
|
+
"${t}", "${e}", ${Ce}
|
|
1782
1788
|
)`;
|
|
1783
1789
|
function _(e) {
|
|
1784
1790
|
return /* @__PURE__ */ l(
|
|
@@ -1789,33 +1795,33 @@ function _(e) {
|
|
|
1789
1795
|
}
|
|
1790
1796
|
);
|
|
1791
1797
|
}
|
|
1792
|
-
const
|
|
1798
|
+
const an = (e) => {
|
|
1793
1799
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
1794
1800
|
return n || x.warn("No previewed ID found in search params."), n;
|
|
1795
1801
|
};
|
|
1796
|
-
function
|
|
1797
|
-
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new
|
|
1802
|
+
function sn() {
|
|
1803
|
+
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Be({
|
|
1798
1804
|
max: 500,
|
|
1799
1805
|
// how long to live in ms
|
|
1800
1806
|
ttl: 1e3 * 60 * 5
|
|
1801
1807
|
}));
|
|
1802
1808
|
}
|
|
1803
|
-
function
|
|
1804
|
-
|
|
1805
|
-
const t =
|
|
1809
|
+
function cn(e) {
|
|
1810
|
+
sn();
|
|
1811
|
+
const t = an(e);
|
|
1806
1812
|
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
1807
1813
|
}
|
|
1808
|
-
function
|
|
1814
|
+
function ln() {
|
|
1809
1815
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
1810
1816
|
}
|
|
1811
|
-
function
|
|
1812
|
-
const e =
|
|
1817
|
+
function dn() {
|
|
1818
|
+
const e = ln().fetch;
|
|
1813
1819
|
if (typeof e > "u")
|
|
1814
1820
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
1815
1821
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
1816
1822
|
return e;
|
|
1817
1823
|
}
|
|
1818
|
-
const
|
|
1824
|
+
const un = dn();
|
|
1819
1825
|
function B(e, t = null, n = ".") {
|
|
1820
1826
|
return Object.keys(e).reduce((o, i) => {
|
|
1821
1827
|
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
@@ -1828,27 +1834,22 @@ function B(e, t = null, n = ".") {
|
|
|
1828
1834
|
};
|
|
1829
1835
|
}, {});
|
|
1830
1836
|
}
|
|
1831
|
-
const
|
|
1832
|
-
const t = {};
|
|
1833
|
-
return e.forEach((n, o) => {
|
|
1834
|
-
t[o] = n;
|
|
1835
|
-
}), t;
|
|
1836
|
-
}, xe = (e) => {
|
|
1837
|
+
const mn = "v3", X = "builder.", fn = "options.", we = (e) => {
|
|
1837
1838
|
if (!e)
|
|
1838
1839
|
return {};
|
|
1839
|
-
const t =
|
|
1840
|
+
const t = se(e), n = {};
|
|
1840
1841
|
return Object.keys(t).forEach((o) => {
|
|
1841
1842
|
if (o.startsWith(X)) {
|
|
1842
|
-
const i = o.replace(X, "").replace(
|
|
1843
|
+
const i = o.replace(X, "").replace(fn, "");
|
|
1843
1844
|
n[i] = t[o];
|
|
1844
1845
|
}
|
|
1845
1846
|
}), n;
|
|
1846
|
-
},
|
|
1847
|
+
}, hn = () => {
|
|
1847
1848
|
if (!k())
|
|
1848
1849
|
return {};
|
|
1849
1850
|
const e = new URLSearchParams(window.location.search);
|
|
1850
|
-
return
|
|
1851
|
-
},
|
|
1851
|
+
return we(e);
|
|
1852
|
+
}, Z = (e) => typeof e == "number" && !isNaN(e) && e >= 0, z = (e) => {
|
|
1852
1853
|
const {
|
|
1853
1854
|
limit: t = 30,
|
|
1854
1855
|
userAttributes: n,
|
|
@@ -1857,7 +1858,7 @@ const dn = "v3", X = "builder.", un = "options.", mn = (e) => {
|
|
|
1857
1858
|
apiKey: r,
|
|
1858
1859
|
enrich: a,
|
|
1859
1860
|
locale: s,
|
|
1860
|
-
apiVersion: c =
|
|
1861
|
+
apiVersion: c = mn,
|
|
1861
1862
|
fields: m,
|
|
1862
1863
|
omit: b,
|
|
1863
1864
|
offset: g,
|
|
@@ -1879,8 +1880,8 @@ const dn = "v3", X = "builder.", un = "options.", mn = (e) => {
|
|
|
1879
1880
|
p.searchParams.set(I, JSON.stringify(v[I]));
|
|
1880
1881
|
}
|
|
1881
1882
|
const C = {
|
|
1882
|
-
...
|
|
1883
|
-
...
|
|
1883
|
+
...hn(),
|
|
1884
|
+
...se(e.options || {})
|
|
1884
1885
|
}, E = B(C);
|
|
1885
1886
|
for (const v in E)
|
|
1886
1887
|
p.searchParams.set(v, String(E[v]));
|
|
@@ -1892,23 +1893,23 @@ const dn = "v3", X = "builder.", un = "options.", mn = (e) => {
|
|
|
1892
1893
|
p.searchParams.set(I, JSON.stringify(v[I]));
|
|
1893
1894
|
}
|
|
1894
1895
|
return p;
|
|
1895
|
-
},
|
|
1896
|
-
async function
|
|
1897
|
-
const t = await
|
|
1896
|
+
}, pn = (e) => "results" in e;
|
|
1897
|
+
async function Ie(e) {
|
|
1898
|
+
const t = await yn({
|
|
1898
1899
|
...e,
|
|
1899
1900
|
limit: 1
|
|
1900
1901
|
});
|
|
1901
1902
|
return t && t[0] || null;
|
|
1902
1903
|
}
|
|
1903
|
-
const
|
|
1904
|
+
const gn = async (e) => {
|
|
1904
1905
|
const t = z(e);
|
|
1905
|
-
return await (await
|
|
1906
|
-
},
|
|
1906
|
+
return await (await un(t.href)).json();
|
|
1907
|
+
}, bn = async (e, t, n = z(e)) => {
|
|
1907
1908
|
const o = L(e.canTrack);
|
|
1908
1909
|
if (n.search.includes("preview=")) {
|
|
1909
1910
|
const r = [];
|
|
1910
1911
|
for (const a of t.results) {
|
|
1911
|
-
const s =
|
|
1912
|
+
const s = cn(n.searchParams);
|
|
1912
1913
|
r.push(s || a);
|
|
1913
1914
|
}
|
|
1914
1915
|
t.results = r;
|
|
@@ -1918,7 +1919,7 @@ const pn = async (e) => {
|
|
|
1918
1919
|
try {
|
|
1919
1920
|
const r = [];
|
|
1920
1921
|
for (const a of t.results)
|
|
1921
|
-
r.push(await
|
|
1922
|
+
r.push(await Wt({
|
|
1922
1923
|
item: a,
|
|
1923
1924
|
canTrack: o
|
|
1924
1925
|
}));
|
|
@@ -1928,10 +1929,10 @@ const pn = async (e) => {
|
|
|
1928
1929
|
}
|
|
1929
1930
|
return t.results;
|
|
1930
1931
|
};
|
|
1931
|
-
async function
|
|
1932
|
+
async function yn(e) {
|
|
1932
1933
|
try {
|
|
1933
|
-
const t = z(e), n = await
|
|
1934
|
-
return
|
|
1934
|
+
const t = z(e), n = await gn(e);
|
|
1935
|
+
return pn(n) ? bn(e, n) : (x.error("Error fetching data. ", {
|
|
1935
1936
|
url: t,
|
|
1936
1937
|
content: n,
|
|
1937
1938
|
options: e
|
|
@@ -1940,91 +1941,94 @@ async function bn(e) {
|
|
|
1940
1941
|
return x.error("Error fetching data. ", t), null;
|
|
1941
1942
|
}
|
|
1942
1943
|
}
|
|
1943
|
-
function
|
|
1944
|
-
|
|
1944
|
+
function so(e) {
|
|
1945
|
+
if (!k())
|
|
1946
|
+
return !1;
|
|
1947
|
+
const t = ce(e || window.location.search);
|
|
1948
|
+
return j(t) ? !1 : t.indexOf("builder.preview=") !== -1;
|
|
1945
1949
|
}
|
|
1946
|
-
function
|
|
1950
|
+
function Sn() {
|
|
1947
1951
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1948
1952
|
const t = Math.random() * 16 | 0;
|
|
1949
1953
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
1950
1954
|
});
|
|
1951
1955
|
}
|
|
1952
|
-
function
|
|
1953
|
-
return
|
|
1956
|
+
function Te() {
|
|
1957
|
+
return Sn().replace(/-/g, "");
|
|
1954
1958
|
}
|
|
1955
|
-
const
|
|
1959
|
+
const Ee = "builderSessionId", kn = async ({
|
|
1956
1960
|
canTrack: e
|
|
1957
1961
|
}) => {
|
|
1958
1962
|
if (!e)
|
|
1959
1963
|
return;
|
|
1960
|
-
const t = await
|
|
1961
|
-
name:
|
|
1964
|
+
const t = await ge({
|
|
1965
|
+
name: Ee,
|
|
1962
1966
|
canTrack: e
|
|
1963
1967
|
});
|
|
1964
1968
|
if (w(t))
|
|
1965
1969
|
return t;
|
|
1966
1970
|
{
|
|
1967
|
-
const n =
|
|
1968
|
-
return
|
|
1971
|
+
const n = vn();
|
|
1972
|
+
return xn({
|
|
1969
1973
|
id: n,
|
|
1970
1974
|
canTrack: e
|
|
1971
1975
|
}), n;
|
|
1972
1976
|
}
|
|
1973
|
-
},
|
|
1977
|
+
}, vn = () => Te(), xn = ({
|
|
1974
1978
|
id: e,
|
|
1975
1979
|
canTrack: t
|
|
1976
|
-
}) =>
|
|
1977
|
-
name:
|
|
1980
|
+
}) => be({
|
|
1981
|
+
name: Ee,
|
|
1978
1982
|
value: e,
|
|
1979
1983
|
canTrack: t
|
|
1980
|
-
}),
|
|
1984
|
+
}), Re = () => k() && typeof localStorage < "u" ? localStorage : void 0, Cn = ({
|
|
1981
1985
|
key: e,
|
|
1982
1986
|
canTrack: t
|
|
1983
1987
|
}) => {
|
|
1984
1988
|
var n;
|
|
1985
1989
|
try {
|
|
1986
|
-
return t ? (n =
|
|
1990
|
+
return t ? (n = Re()) == null ? void 0 : n.getItem(e) : void 0;
|
|
1987
1991
|
} catch (o) {
|
|
1988
1992
|
console.debug("[LocalStorage] GET error: ", o);
|
|
1989
1993
|
return;
|
|
1990
1994
|
}
|
|
1991
|
-
},
|
|
1995
|
+
}, wn = ({
|
|
1992
1996
|
key: e,
|
|
1993
1997
|
canTrack: t,
|
|
1994
1998
|
value: n
|
|
1995
1999
|
}) => {
|
|
1996
2000
|
var o;
|
|
1997
2001
|
try {
|
|
1998
|
-
t && ((o =
|
|
2002
|
+
t && ((o = Re()) == null || o.setItem(e, n));
|
|
1999
2003
|
} catch (i) {
|
|
2000
2004
|
console.debug("[LocalStorage] SET error: ", i);
|
|
2001
2005
|
}
|
|
2002
|
-
},
|
|
2006
|
+
}, Pe = "builderVisitorId", In = ({
|
|
2003
2007
|
canTrack: e
|
|
2004
2008
|
}) => {
|
|
2005
2009
|
if (!e)
|
|
2006
2010
|
return;
|
|
2007
|
-
const t =
|
|
2008
|
-
key:
|
|
2011
|
+
const t = Cn({
|
|
2012
|
+
key: Pe,
|
|
2009
2013
|
canTrack: e
|
|
2010
2014
|
});
|
|
2011
2015
|
if (w(t))
|
|
2012
2016
|
return t;
|
|
2013
2017
|
{
|
|
2014
|
-
const n =
|
|
2015
|
-
return
|
|
2018
|
+
const n = Tn();
|
|
2019
|
+
return En({
|
|
2016
2020
|
id: n,
|
|
2017
2021
|
canTrack: e
|
|
2018
2022
|
}), n;
|
|
2019
2023
|
}
|
|
2020
|
-
},
|
|
2024
|
+
}, Tn = () => Te(), En = ({
|
|
2021
2025
|
id: e,
|
|
2022
2026
|
canTrack: t
|
|
2023
|
-
}) =>
|
|
2024
|
-
key:
|
|
2027
|
+
}) => wn({
|
|
2028
|
+
key: Pe,
|
|
2025
2029
|
value: e,
|
|
2026
2030
|
canTrack: t
|
|
2027
|
-
}),
|
|
2031
|
+
}), Rn = async ({
|
|
2028
2032
|
canTrack: e
|
|
2029
2033
|
}) => {
|
|
2030
2034
|
if (!e)
|
|
@@ -2032,16 +2036,16 @@ const Te = "builderSessionId", Sn = async ({
|
|
|
2032
2036
|
visitorId: void 0,
|
|
2033
2037
|
sessionId: void 0
|
|
2034
2038
|
};
|
|
2035
|
-
const t = await
|
|
2039
|
+
const t = await kn({
|
|
2036
2040
|
canTrack: e
|
|
2037
|
-
}), n =
|
|
2041
|
+
}), n = In({
|
|
2038
2042
|
canTrack: e
|
|
2039
2043
|
});
|
|
2040
2044
|
return {
|
|
2041
2045
|
sessionId: t,
|
|
2042
2046
|
visitorId: n
|
|
2043
2047
|
};
|
|
2044
|
-
},
|
|
2048
|
+
}, Pn = async ({
|
|
2045
2049
|
type: e,
|
|
2046
2050
|
canTrack: t,
|
|
2047
2051
|
apiKey: n,
|
|
@@ -2055,14 +2059,14 @@ const Te = "builderSessionId", Sn = async ({
|
|
|
2055
2059
|
url: location.href,
|
|
2056
2060
|
...o
|
|
2057
2061
|
},
|
|
2058
|
-
...await
|
|
2062
|
+
...await Rn({
|
|
2059
2063
|
canTrack: t
|
|
2060
2064
|
}),
|
|
2061
|
-
userAttributes:
|
|
2065
|
+
userAttributes: le(),
|
|
2062
2066
|
ownerId: n
|
|
2063
2067
|
}
|
|
2064
2068
|
});
|
|
2065
|
-
async function
|
|
2069
|
+
async function An(e) {
|
|
2066
2070
|
if (!e.apiKey) {
|
|
2067
2071
|
x.error("Missing API key for track call. Please provide your API key.");
|
|
2068
2072
|
return;
|
|
@@ -2071,7 +2075,7 @@ async function Pn(e) {
|
|
|
2071
2075
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
2072
2076
|
method: "POST",
|
|
2073
2077
|
body: JSON.stringify({
|
|
2074
|
-
events: [await
|
|
2078
|
+
events: [await Pn(e)]
|
|
2075
2079
|
}),
|
|
2076
2080
|
headers: {
|
|
2077
2081
|
"content-type": "application/json"
|
|
@@ -2081,14 +2085,14 @@ async function Pn(e) {
|
|
|
2081
2085
|
console.error("Failed to track: ", t);
|
|
2082
2086
|
});
|
|
2083
2087
|
}
|
|
2084
|
-
const
|
|
2088
|
+
const co = (e) => An({
|
|
2085
2089
|
...e,
|
|
2086
2090
|
canTrack: !0
|
|
2087
2091
|
});
|
|
2088
2092
|
function ee(e) {
|
|
2089
2093
|
return Math.round(e * 1e3) / 1e3;
|
|
2090
2094
|
}
|
|
2091
|
-
const
|
|
2095
|
+
const Bn = (e, t, n = !0) => {
|
|
2092
2096
|
if (!(e instanceof HTMLElement))
|
|
2093
2097
|
return null;
|
|
2094
2098
|
let o = n ? e : e.parentElement;
|
|
@@ -2099,7 +2103,7 @@ const An = (e, t, n = !0) => {
|
|
|
2099
2103
|
return o;
|
|
2100
2104
|
} while (o = o.parentElement);
|
|
2101
2105
|
return null;
|
|
2102
|
-
},
|
|
2106
|
+
}, Vn = (e) => Bn(e, (t) => {
|
|
2103
2107
|
const n = t.getAttribute("builder-id") || t.id;
|
|
2104
2108
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
2105
2109
|
}), te = ({
|
|
@@ -2111,8 +2115,8 @@ const An = (e, t, n = !0) => {
|
|
|
2111
2115
|
x: r,
|
|
2112
2116
|
y: a
|
|
2113
2117
|
};
|
|
2114
|
-
},
|
|
2115
|
-
const t = e.target, n = t &&
|
|
2118
|
+
}, lo = (e) => {
|
|
2119
|
+
const t = e.target, n = t && Vn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2116
2120
|
return {
|
|
2117
2121
|
targetBuilderElement: o || void 0,
|
|
2118
2122
|
metadata: {
|
|
@@ -2127,13 +2131,13 @@ const An = (e, t, n = !0) => {
|
|
|
2127
2131
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2128
2132
|
}
|
|
2129
2133
|
};
|
|
2130
|
-
},
|
|
2131
|
-
function
|
|
2134
|
+
}, Wn = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
2135
|
+
function Ae(e, t) {
|
|
2132
2136
|
const n = new URL(t.origin), o = n.hostname;
|
|
2133
|
-
return (e ||
|
|
2137
|
+
return (e || Wn).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
2134
2138
|
}
|
|
2135
|
-
const
|
|
2136
|
-
function
|
|
2139
|
+
const On = "0.14.5", ne = {};
|
|
2140
|
+
function $n(e, t) {
|
|
2137
2141
|
let n = ne[e];
|
|
2138
2142
|
if (n || (n = ne[e] = []), n.push(t), k()) {
|
|
2139
2143
|
const o = {
|
|
@@ -2150,8 +2154,8 @@ function On(e, t) {
|
|
|
2150
2154
|
}
|
|
2151
2155
|
}
|
|
2152
2156
|
}
|
|
2153
|
-
const
|
|
2154
|
-
|
|
2157
|
+
const uo = () => {
|
|
2158
|
+
$n("insertMenu", {
|
|
2155
2159
|
name: "_default",
|
|
2156
2160
|
default: !0,
|
|
2157
2161
|
items: [{
|
|
@@ -2174,13 +2178,13 @@ const lo = () => {
|
|
|
2174
2178
|
});
|
|
2175
2179
|
};
|
|
2176
2180
|
let oe = !1;
|
|
2177
|
-
const
|
|
2181
|
+
const Fn = (e = {}) => {
|
|
2178
2182
|
var t, n;
|
|
2179
2183
|
oe || (oe = !0, k() && ((t = window.parent) == null || t.postMessage({
|
|
2180
2184
|
type: "builder.sdkInfo",
|
|
2181
2185
|
data: {
|
|
2182
2186
|
target: T,
|
|
2183
|
-
version:
|
|
2187
|
+
version: On,
|
|
2184
2188
|
supportsPatchUpdates: !1,
|
|
2185
2189
|
// Supports builder-model="..." attribute which is needed to
|
|
2186
2190
|
// scope our '+ add block' button styling
|
|
@@ -2194,7 +2198,7 @@ const $n = (e = {}) => {
|
|
|
2194
2198
|
}
|
|
2195
2199
|
}, "*"), window.addEventListener("message", (o) => {
|
|
2196
2200
|
var r, a;
|
|
2197
|
-
if (!
|
|
2201
|
+
if (!Ae(e.trustedHosts, o))
|
|
2198
2202
|
return;
|
|
2199
2203
|
const {
|
|
2200
2204
|
data: i
|
|
@@ -2235,12 +2239,12 @@ const $n = (e = {}) => {
|
|
|
2235
2239
|
}
|
|
2236
2240
|
}
|
|
2237
2241
|
})));
|
|
2238
|
-
},
|
|
2242
|
+
}, Nn = ({
|
|
2239
2243
|
model: e,
|
|
2240
2244
|
trustedHosts: t,
|
|
2241
2245
|
callbacks: n
|
|
2242
2246
|
}) => (o) => {
|
|
2243
|
-
if (!
|
|
2247
|
+
if (!Ae(t, o))
|
|
2244
2248
|
return;
|
|
2245
2249
|
const {
|
|
2246
2250
|
data: i
|
|
@@ -2261,12 +2265,12 @@ const $n = (e = {}) => {
|
|
|
2261
2265
|
break;
|
|
2262
2266
|
}
|
|
2263
2267
|
}
|
|
2264
|
-
},
|
|
2268
|
+
}, mo = (e, t, n) => {
|
|
2265
2269
|
if (!k)
|
|
2266
2270
|
return x.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
2267
2271
|
};
|
|
2268
|
-
|
|
2269
|
-
const o =
|
|
2272
|
+
Fn();
|
|
2273
|
+
const o = Nn({
|
|
2270
2274
|
callbacks: {
|
|
2271
2275
|
contentUpdate: t,
|
|
2272
2276
|
animation: () => {
|
|
@@ -2291,38 +2295,38 @@ function ie(e, ...t) {
|
|
|
2291
2295
|
}
|
|
2292
2296
|
return n;
|
|
2293
2297
|
}
|
|
2294
|
-
const
|
|
2295
|
-
function
|
|
2298
|
+
const Ln = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
2299
|
+
function Un(e) {
|
|
2296
2300
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2297
2301
|
}
|
|
2298
|
-
function
|
|
2299
|
-
const n =
|
|
2302
|
+
function _n(e, t) {
|
|
2303
|
+
const n = Dn(e), o = getComputedStyle(t), i = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [i, r];
|
|
2300
2304
|
for (const s of a)
|
|
2301
2305
|
for (const c of n)
|
|
2302
2306
|
c in s || (s[c] = o[c]);
|
|
2303
2307
|
}
|
|
2304
|
-
function
|
|
2308
|
+
function Dn(e) {
|
|
2305
2309
|
const t = [];
|
|
2306
2310
|
for (const n of e.steps)
|
|
2307
2311
|
for (const o in n.styles)
|
|
2308
2312
|
t.indexOf(o) === -1 && t.push(o);
|
|
2309
2313
|
return t;
|
|
2310
2314
|
}
|
|
2311
|
-
function
|
|
2315
|
+
function fo(e) {
|
|
2312
2316
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2313
2317
|
if (!t.length) {
|
|
2314
|
-
|
|
2318
|
+
Un(e.elementId || e.id || "");
|
|
2315
2319
|
return;
|
|
2316
2320
|
}
|
|
2317
2321
|
Array.from(t).forEach((n) => {
|
|
2318
|
-
|
|
2319
|
-
n.style.transition = `all ${e.duration}s ${
|
|
2322
|
+
_n(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ie(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2323
|
+
n.style.transition = `all ${e.duration}s ${Ln(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ie(n.style, e.steps[1].styles), setTimeout(() => {
|
|
2320
2324
|
n.style.transition = "", n.style.transitionDelay = "";
|
|
2321
2325
|
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2322
2326
|
});
|
|
2323
2327
|
});
|
|
2324
2328
|
}
|
|
2325
|
-
const
|
|
2329
|
+
const jn = (e) => {
|
|
2326
2330
|
var r;
|
|
2327
2331
|
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);
|
|
2328
2332
|
let i = "";
|
|
@@ -2348,22 +2352,22 @@ font-weight: ${a};
|
|
|
2348
2352
|
`.trim());
|
|
2349
2353
|
}
|
|
2350
2354
|
return i;
|
|
2351
|
-
},
|
|
2355
|
+
}, Mn = ({
|
|
2352
2356
|
customFonts: e
|
|
2353
2357
|
}) => {
|
|
2354
2358
|
var t;
|
|
2355
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
2356
|
-
},
|
|
2359
|
+
return ((t = e == null ? void 0 : e.map((n) => jn(n))) == null ? void 0 : t.join(" ")) || "";
|
|
2360
|
+
}, Hn = ({
|
|
2357
2361
|
cssCode: e,
|
|
2358
2362
|
contentId: t
|
|
2359
2363
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
2360
|
-
function
|
|
2364
|
+
function Kn(e) {
|
|
2361
2365
|
const t = `
|
|
2362
|
-
${
|
|
2366
|
+
${Hn({
|
|
2363
2367
|
cssCode: e.cssCode,
|
|
2364
2368
|
contentId: e.contentId
|
|
2365
2369
|
})}
|
|
2366
|
-
${
|
|
2370
|
+
${Mn({
|
|
2367
2371
|
customFonts: e.customFonts
|
|
2368
2372
|
})}
|
|
2369
2373
|
|
|
@@ -2386,7 +2390,7 @@ ${jn({
|
|
|
2386
2390
|
`.trim();
|
|
2387
2391
|
return /* @__PURE__ */ l(O, { styles: t });
|
|
2388
2392
|
}
|
|
2389
|
-
const
|
|
2393
|
+
const zn = ({
|
|
2390
2394
|
content: e,
|
|
2391
2395
|
data: t,
|
|
2392
2396
|
locale: n
|
|
@@ -2403,7 +2407,7 @@ const Kn = ({
|
|
|
2403
2407
|
locale: n
|
|
2404
2408
|
} : {}
|
|
2405
2409
|
};
|
|
2406
|
-
},
|
|
2410
|
+
}, qn = ({
|
|
2407
2411
|
content: e,
|
|
2408
2412
|
data: t
|
|
2409
2413
|
}) => e ? {
|
|
@@ -2416,7 +2420,7 @@ const Kn = ({
|
|
|
2416
2420
|
} : void 0;
|
|
2417
2421
|
function re(e) {
|
|
2418
2422
|
var i, r, a, s, c, m, b, g, f;
|
|
2419
|
-
const t =
|
|
2423
|
+
const t = rn({
|
|
2420
2424
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2421
2425
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
2422
2426
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -2434,12 +2438,12 @@ function re(e) {
|
|
|
2434
2438
|
}),
|
|
2435
2439
|
{}
|
|
2436
2440
|
), o = {
|
|
2437
|
-
content:
|
|
2441
|
+
content: qn({
|
|
2438
2442
|
content: e.content,
|
|
2439
2443
|
data: e.data
|
|
2440
2444
|
}),
|
|
2441
2445
|
localState: void 0,
|
|
2442
|
-
rootState:
|
|
2446
|
+
rootState: zn({
|
|
2443
2447
|
content: e.content,
|
|
2444
2448
|
data: e.data,
|
|
2445
2449
|
locale: e.locale
|
|
@@ -2463,7 +2467,7 @@ function re(e) {
|
|
|
2463
2467
|
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
2464
2468
|
};
|
|
2465
2469
|
return /* @__PURE__ */ R(
|
|
2466
|
-
|
|
2470
|
+
He,
|
|
2467
2471
|
{
|
|
2468
2472
|
content: e.content,
|
|
2469
2473
|
data: e.data,
|
|
@@ -2482,7 +2486,7 @@ function re(e) {
|
|
|
2482
2486
|
children: [
|
|
2483
2487
|
e.isSsrAbTest ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(_, { scriptStr: t }) }) : null,
|
|
2484
2488
|
/* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(
|
|
2485
|
-
|
|
2489
|
+
Kn,
|
|
2486
2490
|
{
|
|
2487
2491
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2488
2492
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
@@ -2502,14 +2506,14 @@ function re(e) {
|
|
|
2502
2506
|
}
|
|
2503
2507
|
);
|
|
2504
2508
|
}
|
|
2505
|
-
function
|
|
2509
|
+
function Gn(e) {
|
|
2506
2510
|
var r, a;
|
|
2507
|
-
const t =
|
|
2511
|
+
const t = en({
|
|
2508
2512
|
canTrack: L(e.canTrack),
|
|
2509
2513
|
content: e.content
|
|
2510
2514
|
}), n = function() {
|
|
2511
2515
|
var c;
|
|
2512
|
-
return
|
|
2516
|
+
return on(
|
|
2513
2517
|
A(e.content).map((m) => ({
|
|
2514
2518
|
id: m.testVariationId,
|
|
2515
2519
|
testRatio: m.testRatio
|
|
@@ -2523,13 +2527,13 @@ function qn(e) {
|
|
|
2523
2527
|
return t ? {
|
|
2524
2528
|
...e.content,
|
|
2525
2529
|
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2526
|
-
} :
|
|
2530
|
+
} : Vt({
|
|
2527
2531
|
item: e.content,
|
|
2528
2532
|
canTrack: L(e.canTrack)
|
|
2529
2533
|
});
|
|
2530
2534
|
};
|
|
2531
2535
|
return /* @__PURE__ */ R(S, { children: [
|
|
2532
|
-
!e.__isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(_, { scriptStr:
|
|
2536
|
+
!e.__isNestedRender && T !== "reactNative" ? /* @__PURE__ */ l(S, { children: /* @__PURE__ */ l(_, { scriptStr: nn() }) }) : null,
|
|
2533
2537
|
t ? /* @__PURE__ */ R(S, { children: [
|
|
2534
2538
|
/* @__PURE__ */ l(
|
|
2535
2539
|
O,
|
|
@@ -2589,13 +2593,13 @@ function qn(e) {
|
|
|
2589
2593
|
)
|
|
2590
2594
|
] });
|
|
2591
2595
|
}
|
|
2592
|
-
const
|
|
2596
|
+
const Yn = async ({
|
|
2593
2597
|
builderContextValue: e,
|
|
2594
2598
|
symbol: t
|
|
2595
2599
|
}) => {
|
|
2596
2600
|
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
2597
2601
|
(e != null && e.apiKey))
|
|
2598
|
-
return
|
|
2602
|
+
return Ie({
|
|
2599
2603
|
model: t.model,
|
|
2600
2604
|
apiKey: e.apiKey,
|
|
2601
2605
|
apiVersion: e.apiVersion,
|
|
@@ -2608,7 +2612,7 @@ const Gn = async ({
|
|
|
2608
2612
|
x.error("Could not fetch symbol content: ", n);
|
|
2609
2613
|
});
|
|
2610
2614
|
};
|
|
2611
|
-
async function
|
|
2615
|
+
async function Jn(e) {
|
|
2612
2616
|
var o, i, r, a, s;
|
|
2613
2617
|
const t = function() {
|
|
2614
2618
|
var m, b;
|
|
@@ -2618,12 +2622,12 @@ async function Yn(e) {
|
|
|
2618
2622
|
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2619
2623
|
(b = e.symbol) != null && b.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2620
2624
|
].filter(Boolean).join(" ");
|
|
2621
|
-
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await
|
|
2625
|
+
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await Yn({
|
|
2622
2626
|
symbol: e.symbol,
|
|
2623
2627
|
builderContextValue: e.builderContext
|
|
2624
2628
|
});
|
|
2625
2629
|
return /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
|
|
2626
|
-
|
|
2630
|
+
Gn,
|
|
2627
2631
|
{
|
|
2628
2632
|
__isNestedRender: !0,
|
|
2629
2633
|
apiVersion: e.builderContext.apiVersion,
|
|
@@ -2647,7 +2651,7 @@ async function Yn(e) {
|
|
|
2647
2651
|
) });
|
|
2648
2652
|
}
|
|
2649
2653
|
const ae = {};
|
|
2650
|
-
function
|
|
2654
|
+
function ho(e) {
|
|
2651
2655
|
if (k()) {
|
|
2652
2656
|
Object.assign(ae, e);
|
|
2653
2657
|
const t = {
|
|
@@ -2657,7 +2661,7 @@ function fo(e) {
|
|
|
2657
2661
|
parent.postMessage(t, "*");
|
|
2658
2662
|
}
|
|
2659
2663
|
}
|
|
2660
|
-
const
|
|
2664
|
+
const po = async (e) => {
|
|
2661
2665
|
var o, i, r;
|
|
2662
2666
|
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2663
2667
|
...e,
|
|
@@ -2669,49 +2673,49 @@ const ho = async (e) => {
|
|
|
2669
2673
|
urlPath: t
|
|
2670
2674
|
} : {}
|
|
2671
2675
|
},
|
|
2672
|
-
options:
|
|
2676
|
+
options: we(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
|
|
2673
2677
|
};
|
|
2674
2678
|
return {
|
|
2675
2679
|
apiKey: n.apiKey,
|
|
2676
2680
|
model: n.model,
|
|
2677
|
-
content: await
|
|
2681
|
+
content: await Ie(n)
|
|
2678
2682
|
};
|
|
2679
2683
|
};
|
|
2680
2684
|
export {
|
|
2681
|
-
|
|
2685
|
+
co as A,
|
|
2682
2686
|
H as B,
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2687
|
+
kt as C,
|
|
2688
|
+
mo as D,
|
|
2689
|
+
po as E,
|
|
2690
|
+
bn as F,
|
|
2691
|
+
yn as G,
|
|
2692
|
+
Jn as S,
|
|
2693
|
+
Mt as T,
|
|
2694
|
+
An as _,
|
|
2695
|
+
bt as a,
|
|
2696
|
+
oo as b,
|
|
2693
2697
|
j as c,
|
|
2694
|
-
|
|
2695
|
-
|
|
2698
|
+
io as d,
|
|
2699
|
+
ro as e,
|
|
2696
2700
|
k as f,
|
|
2697
2701
|
D as g,
|
|
2698
2702
|
L as h,
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2703
|
+
no as i,
|
|
2704
|
+
so as j,
|
|
2705
|
+
Nn as k,
|
|
2702
2706
|
x as l,
|
|
2703
2707
|
M as m,
|
|
2704
|
-
|
|
2708
|
+
lo as n,
|
|
2705
2709
|
W as o,
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2710
|
+
ao as p,
|
|
2711
|
+
Ie as q,
|
|
2712
|
+
uo as r,
|
|
2713
|
+
Fn as s,
|
|
2714
|
+
fo as t,
|
|
2715
|
+
un as u,
|
|
2716
|
+
sn as v,
|
|
2717
|
+
Gn as w,
|
|
2718
|
+
$n as x,
|
|
2719
|
+
ho as y,
|
|
2720
|
+
we as z
|
|
2717
2721
|
};
|