@builder.io/sdk-react-nextjs 0.12.4 → 0.12.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/{node/USE_CLIENT_BUNDLE-ee5a9d6f.cjs → browser/USE_CLIENT_BUNDLE-70be4cc5.cjs} +1 -1
- package/lib/browser/{USE_CLIENT_BUNDLE-e6d429be.js → USE_CLIENT_BUNDLE-7492ecd8.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-816ab6e4.cjs → browser/USE_SERVER_BUNDLE-875d4629.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-c0911af0.js → browser/USE_SERVER_BUNDLE-fe386ed3.js} +1 -1
- package/lib/browser/{bundle-0e5cec1c.cjs → bundle-bd9886c9.cjs} +20 -20
- package/lib/browser/{bundle-bab67847.js → bundle-f9f52242.js} +247 -236
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-e9e1ee85.cjs → edge/USE_CLIENT_BUNDLE-1148158d.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-75f921e2.js → edge/USE_CLIENT_BUNDLE-cb840c0f.js} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-86d90afe.js → edge/USE_SERVER_BUNDLE-36de460d.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-793c12c9.cjs → edge/USE_SERVER_BUNDLE-50c2f18b.cjs} +1 -1
- package/lib/edge/{bundle-e64fe0fd.cjs → bundle-71cfdd3e.cjs} +23 -23
- package/lib/edge/{bundle-28d9d04c.js → bundle-765860e3.js} +323 -312
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-d87c391a.cjs → node/USE_CLIENT_BUNDLE-2f43c320.cjs} +1 -1
- package/lib/{edge/USE_CLIENT_BUNDLE-8d251b8b.js → node/USE_CLIENT_BUNDLE-4ba4594d.js} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-44c49b1e.js → node/USE_SERVER_BUNDLE-2534ef71.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-9bcc0ad4.cjs → node/USE_SERVER_BUNDLE-473d50ad.cjs} +1 -1
- package/lib/node/{bundle-72df28b3.cjs → bundle-1c54df65.cjs} +5 -5
- package/lib/node/{bundle-031e3608.js → bundle-305bb463.js} +15 -4
- 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/evaluate/should-force-browser-runtime-in-node.d.ts +1 -0
- package/types/cjs/functions/is-node-runtime.d.ts +4 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/should-force-browser-runtime-in-node.d.ts +1 -0
- package/types/esm/functions/is-node-runtime.d.ts +4 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LRUCache as Zr } from "lru-cache";
|
|
2
2
|
import { jsx as C, Fragment as L, jsxs as xe } from "react/jsx-runtime";
|
|
3
|
-
import { I as Qr, B as eo, a as to, D as no, b as ro, C as oo, E as io, F as ao, c as so, d as lo, S as co, V as uo, e as fo } from "./USE_CLIENT_BUNDLE-
|
|
3
|
+
import { I as Qr, B as eo, a as to, D as no, b as ro, C as oo, E as io, F as ao, c as so, d as lo, S as co, V as uo, e as fo } from "./USE_CLIENT_BUNDLE-cb840c0f.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "next/navigation";
|
|
6
|
-
const po = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]),
|
|
6
|
+
const po = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Na = (e) => typeof e == "string" && po.has(e.toLowerCase()), he = "rsc", Xt = () => {
|
|
7
7
|
switch (he) {
|
|
8
8
|
case "react":
|
|
9
9
|
case "reactNative":
|
|
@@ -27,7 +27,7 @@ function ho(e) {
|
|
|
27
27
|
builderBlock: e
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const at = "[Builder.io]: ",
|
|
30
|
+
const at = "[Builder.io]: ", z = {
|
|
31
31
|
log: (...e) => console.log(at, ...e),
|
|
32
32
|
error: (...e) => console.error(at, ...e),
|
|
33
33
|
warn: (...e) => console.warn(at, ...e),
|
|
@@ -158,7 +158,7 @@ var N, xo = function(e) {
|
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
function a() {
|
|
161
|
-
this.line = Se, this.ab = f -
|
|
161
|
+
this.line = Se, this.ab = f - se;
|
|
162
162
|
}
|
|
163
163
|
function s(i, l) {
|
|
164
164
|
Ce = f, O.C && (Et = new a()), I = i, d(), Q = l, Ue = i.m;
|
|
@@ -174,9 +174,9 @@ var N, xo = function(e) {
|
|
|
174
174
|
if (i === 32)
|
|
175
175
|
++f;
|
|
176
176
|
else if (i === 13)
|
|
177
|
-
++f, i = g.charCodeAt(f), i === 10 && ++f, O.C && (++Se,
|
|
177
|
+
++f, i = g.charCodeAt(f), i === 10 && ++f, O.C && (++Se, se = f);
|
|
178
178
|
else if (i === 10 || i === 8232 || i === 8233)
|
|
179
|
-
++f, O.C && (++Se,
|
|
179
|
+
++f, O.C && (++Se, se = f);
|
|
180
180
|
else if (8 < i && 14 > i)
|
|
181
181
|
++f;
|
|
182
182
|
else if (i === 47)
|
|
@@ -185,7 +185,7 @@ var N, xo = function(e) {
|
|
|
185
185
|
var l = O.va && O.C && new a(), c = f, p = g.indexOf("*/", f += 2);
|
|
186
186
|
if (p === -1 && r(f - 2, "Unterminated comment"), f = p + 2, O.C)
|
|
187
187
|
for (it.lastIndex = c; (i = it.exec(g)) && i.index < f; )
|
|
188
|
-
++Se,
|
|
188
|
+
++Se, se = i.index + i[0].length;
|
|
189
189
|
O.va && O.va(!0, g.slice(c + 2, p), c, f, l, O.C && new a());
|
|
190
190
|
} else if (i === 47)
|
|
191
191
|
u();
|
|
@@ -205,11 +205,11 @@ var N, xo = function(e) {
|
|
|
205
205
|
i = g.charCodeAt(f + 1), 48 <= i && 57 >= i ? v(!0) : (++f, s(Nn));
|
|
206
206
|
return;
|
|
207
207
|
case 40:
|
|
208
|
-
return ++f, s(
|
|
208
|
+
return ++f, s(le);
|
|
209
209
|
case 41:
|
|
210
210
|
return ++f, s(re);
|
|
211
211
|
case 59:
|
|
212
|
-
return ++f, s(
|
|
212
|
+
return ++f, s(ce);
|
|
213
213
|
case 44:
|
|
214
214
|
return ++f, s(ye);
|
|
215
215
|
case 91:
|
|
@@ -255,7 +255,7 @@ var N, xo = function(e) {
|
|
|
255
255
|
for (p && (p = p[0]); p && 255 < parseInt(p, 8); )
|
|
256
256
|
p = p.slice(0, -1);
|
|
257
257
|
if (p === "0" && (p = null), ++f, p)
|
|
258
|
-
|
|
258
|
+
q && r(f - 2, "Octal literal in strict mode"), l += String.fromCharCode(parseInt(p, 8)), f += p.length - 1;
|
|
259
259
|
else
|
|
260
260
|
switch (c) {
|
|
261
261
|
case 110:
|
|
@@ -292,7 +292,7 @@ var N, xo = function(e) {
|
|
|
292
292
|
case 13:
|
|
293
293
|
g.charCodeAt(f) === 10 && ++f;
|
|
294
294
|
case 10:
|
|
295
|
-
O.C && (
|
|
295
|
+
O.C && (se = f, ++Se);
|
|
296
296
|
break;
|
|
297
297
|
default:
|
|
298
298
|
l += String.fromCharCode(c);
|
|
@@ -387,7 +387,7 @@ var N, xo = function(e) {
|
|
|
387
387
|
var l = f, c = !1, p = g.charCodeAt(f) === 48;
|
|
388
388
|
i || j(10) !== null || r(l, "Invalid number"), g.charCodeAt(f) === 46 && (++f, j(10), c = !0), i = g.charCodeAt(f), (i === 69 || i === 101) && (i = g.charCodeAt(++f), i !== 43 && i !== 45 || ++f, j(10) === null && r(l, "Invalid number"), c = !0), n(g.charCodeAt(f)) && r(f, "Identifier directly after number"), i = g.slice(l, f);
|
|
389
389
|
var T;
|
|
390
|
-
c ? T = parseFloat(i) : p && i.length !== 1 ? /[89]/.test(i) ||
|
|
390
|
+
c ? T = parseFloat(i) : p && i.length !== 1 ? /[89]/.test(i) || q ? r(l, "Invalid number") : T = parseInt(i, 8) : T = parseInt(i, 10), s(Ve, T);
|
|
391
391
|
}
|
|
392
392
|
function x(i) {
|
|
393
393
|
return i = j(16, i), i === null && r(D, "Bad character escape sequence"), i;
|
|
@@ -416,10 +416,10 @@ var N, xo = function(e) {
|
|
|
416
416
|
It = D, ge = Ce, Tt = Et, E();
|
|
417
417
|
}
|
|
418
418
|
function ee(i) {
|
|
419
|
-
if (
|
|
420
|
-
for (; f <
|
|
421
|
-
|
|
422
|
-
`,
|
|
419
|
+
if (q = i, f = D, O.C)
|
|
420
|
+
for (; f < se; )
|
|
421
|
+
se = g.lastIndexOf(`
|
|
422
|
+
`, se - 2) + 1, --Se;
|
|
423
423
|
d(), E();
|
|
424
424
|
}
|
|
425
425
|
function te() {
|
|
@@ -449,16 +449,16 @@ var N, xo = function(e) {
|
|
|
449
449
|
return !O.fc && (I === At || I === Ie || ot.test(g.slice(ge, D)));
|
|
450
450
|
}
|
|
451
451
|
function be() {
|
|
452
|
-
U(
|
|
452
|
+
U(ce) || Ze() || ie();
|
|
453
453
|
}
|
|
454
454
|
function F(i) {
|
|
455
|
-
I === i ? m() :
|
|
455
|
+
I === i ? m() : ie();
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function ie() {
|
|
458
458
|
r(D, "Unexpected token");
|
|
459
459
|
}
|
|
460
460
|
function Qe(i) {
|
|
461
|
-
i.type !== "Identifier" && i.type !== "MemberExpression" && r(i.start, "Assigning to rvalue"),
|
|
461
|
+
i.type !== "Identifier" && i.type !== "MemberExpression" && r(i.start, "Assigning to rvalue"), q && i.type === "Identifier" && rt(i.name) && r(i.start, "Assigning to " + i.name + " in strict mode");
|
|
462
462
|
}
|
|
463
463
|
function ne() {
|
|
464
464
|
(I === Mn || I === we && Q === "/=") && E(!0);
|
|
@@ -468,7 +468,7 @@ var N, xo = function(e) {
|
|
|
468
468
|
case gn:
|
|
469
469
|
m();
|
|
470
470
|
var c = i === Ot;
|
|
471
|
-
U(
|
|
471
|
+
U(ce) || Ze() ? l.label = null : I !== Ee ? ie() : (l.label = ae(), be());
|
|
472
472
|
for (var p = 0; p < V.length; ++p) {
|
|
473
473
|
var T = V[p];
|
|
474
474
|
if ((l.label === null || T.name === l.label.name) && (T.kind !== null && (c || T.kind === "loop") || l.label && c))
|
|
@@ -480,30 +480,30 @@ var N, xo = function(e) {
|
|
|
480
480
|
case bn:
|
|
481
481
|
return m(), V.push(Ft), l.body = ne(), V.pop(), F(Bt), l.test = Ne(), be(), A(l, "DoWhileStatement");
|
|
482
482
|
case xn:
|
|
483
|
-
return m(), V.push(Ft), F(
|
|
483
|
+
return m(), V.push(Ft), F(le), I === ce ? yt(l, null) : I === Nt ? (i = M(), m(), pn(i, !0), A(i, "VariableDeclaration"), i.fa.length === 1 && U(nt) ? fn(l, i) : yt(l, i)) : (i = K(!1, !0), U(nt) ? (Qe(i), fn(l, i)) : yt(l, i));
|
|
484
484
|
case Rt:
|
|
485
485
|
return m(), wt(l, !0);
|
|
486
486
|
case kn:
|
|
487
487
|
return m(), l.test = Ne(), l.da = ne(), l.alternate = U(Sn) ? ne() : null, A(l, "IfStatement");
|
|
488
488
|
case Cn:
|
|
489
|
-
return Fe || O.Ib || r(D, "'return' outside of function"), m(), U(
|
|
489
|
+
return Fe || O.Ib || r(D, "'return' outside of function"), m(), U(ce) || Ze() ? l.K = null : (l.K = K(), be()), A(l, "ReturnStatement");
|
|
490
490
|
case Pt:
|
|
491
491
|
for (m(), l.Qb = Ne(), l.tb = [], F(De), V.push(qr); I !== Ie; )
|
|
492
|
-
I === jt || I === vn ? (i = I === jt, p && A(p, "SwitchCase"), l.tb.push(p = M()), p.da = [], m(), i ? p.test = K() : (c && r(It, "Multiple default clauses"), c = !0, p.test = null), F(_e)) : (p ||
|
|
492
|
+
I === jt || I === vn ? (i = I === jt, p && A(p, "SwitchCase"), l.tb.push(p = M()), p.da = [], m(), i ? p.test = K() : (c && r(It, "Multiple default clauses"), c = !0, p.test = null), F(_e)) : (p || ie(), p.da.push(ne()));
|
|
493
493
|
return p && A(p, "SwitchCase"), m(), V.pop(), A(l, "SwitchStatement");
|
|
494
494
|
case En:
|
|
495
495
|
return m(), ot.test(g.slice(ge, D)) && r(ge, "Illegal newline after throw"), l.K = K(), be(), A(l, "ThrowStatement");
|
|
496
496
|
case In:
|
|
497
|
-
return m(), l.block = Be(), l.Ea = null, I === mn && (i = M(), m(), F(
|
|
497
|
+
return m(), l.block = Be(), l.Ea = null, I === mn && (i = M(), m(), F(le), i.Ua = ae(), q && rt(i.Ua.name) && r(i.Ua.start, "Binding " + i.Ua.name + " in strict mode"), F(re), i.body = Be(), l.Ea = A(i, "CatchClause")), l.fb = U(wn) ? Be() : null, l.Ea || l.fb || r(l.start, "Missing catch or finally clause"), A(l, "TryStatement");
|
|
498
498
|
case Nt:
|
|
499
499
|
return m(), pn(l), be(), A(l, "VariableDeclaration");
|
|
500
500
|
case Bt:
|
|
501
501
|
return m(), l.test = Ne(), V.push(Ft), l.body = ne(), V.pop(), A(l, "WhileStatement");
|
|
502
502
|
case Tn:
|
|
503
|
-
return
|
|
503
|
+
return q && r(D, "'with' in strict mode"), m(), l.object = Ne(), l.body = ne(), A(l, "WithStatement");
|
|
504
504
|
case De:
|
|
505
505
|
return Be();
|
|
506
|
-
case
|
|
506
|
+
case ce:
|
|
507
507
|
return m(), A(l, "EmptyStatement");
|
|
508
508
|
default:
|
|
509
509
|
if (c = Q, T = K(), i === Ee && T.type === "Identifier" && U(_e)) {
|
|
@@ -518,7 +518,7 @@ var N, xo = function(e) {
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
function Ne() {
|
|
521
|
-
F(
|
|
521
|
+
F(le);
|
|
522
522
|
var i = K();
|
|
523
523
|
return F(re), i;
|
|
524
524
|
}
|
|
@@ -535,7 +535,7 @@ var N, xo = function(e) {
|
|
|
535
535
|
return p && !_ && ee(!1), A(l, "BlockStatement");
|
|
536
536
|
}
|
|
537
537
|
function yt(i, l) {
|
|
538
|
-
return i.ua = l, F(
|
|
538
|
+
return i.ua = l, F(ce), i.test = I === ce ? null : K(), F(ce), i.update = I === re ? null : K(), F(re), i.body = ne(), V.pop(), A(i, "ForStatement");
|
|
539
539
|
}
|
|
540
540
|
function fn(i, l) {
|
|
541
541
|
return i.left = l, i.right = K(), F(re), i.body = ne(), V.pop(), A(i, "ForInStatement");
|
|
@@ -543,7 +543,7 @@ var N, xo = function(e) {
|
|
|
543
543
|
function pn(i, l) {
|
|
544
544
|
for (i.fa = [], i.kind = "var"; ; ) {
|
|
545
545
|
var c = M();
|
|
546
|
-
if (c.id =
|
|
546
|
+
if (c.id = ae(), q && rt(c.id.name) && r(c.id.start, "Binding " + c.id.name + " in strict mode"), c.ua = U(Un) ? K(!0, l) : null, i.fa.push(A(c, "VariableDeclarator")), !U(ye))
|
|
547
547
|
break;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -575,7 +575,7 @@ var N, xo = function(e) {
|
|
|
575
575
|
function St() {
|
|
576
576
|
if (I.prefix) {
|
|
577
577
|
var i = M(), l = I.$b;
|
|
578
|
-
return i.operator = Q, Ue = i.prefix = !0, m(), i.K = St(), l ? Qe(i.K) :
|
|
578
|
+
return i.operator = Q, Ue = i.prefix = !0, m(), i.K = St(), l ? Qe(i.K) : q && i.operator === "delete" && i.K.type === "Identifier" && r(i.start, "Deleting local variable in strict mode"), A(i, l ? "UpdateExpression" : "UnaryExpression");
|
|
579
579
|
}
|
|
580
580
|
for (l = Me(et()); I.cc && !Ze(); )
|
|
581
581
|
i = me(l), i.operator = Q, i.prefix = !1, i.K = l, Qe(l), m(), l = A(i, "UpdateExpression");
|
|
@@ -584,9 +584,9 @@ var N, xo = function(e) {
|
|
|
584
584
|
function Me(i, l) {
|
|
585
585
|
if (U(Nn)) {
|
|
586
586
|
var c = me(i);
|
|
587
|
-
return c.object = i, c.Wa =
|
|
587
|
+
return c.object = i, c.Wa = ae(!0), c.bb = !1, Me(A(c, "MemberExpression"), l);
|
|
588
588
|
}
|
|
589
|
-
return U(Mt) ? (c = me(i), c.object = i, c.Wa = K(), c.bb = !0, F(Ut), Me(A(c, "MemberExpression"), l)) : !l && U(
|
|
589
|
+
return U(Mt) ? (c = me(i), c.object = i, c.Wa = K(), c.bb = !0, F(Ut), Me(A(c, "MemberExpression"), l)) : !l && U(le) ? (c = me(i), c.callee = i, c.arguments = xt(re, !1), Me(A(c, "CallExpression"), l)) : i;
|
|
590
590
|
}
|
|
591
591
|
function et() {
|
|
592
592
|
switch (I) {
|
|
@@ -594,7 +594,7 @@ var N, xo = function(e) {
|
|
|
594
594
|
var i = M();
|
|
595
595
|
return m(), A(i, "ThisExpression");
|
|
596
596
|
case Ee:
|
|
597
|
-
return
|
|
597
|
+
return ae();
|
|
598
598
|
case Ve:
|
|
599
599
|
case tt:
|
|
600
600
|
case hn:
|
|
@@ -603,7 +603,7 @@ var N, xo = function(e) {
|
|
|
603
603
|
case Rn:
|
|
604
604
|
case Pn:
|
|
605
605
|
return i = M(), i.value = I.$a, i.raw = I.l, m(), A(i, "Literal");
|
|
606
|
-
case
|
|
606
|
+
case le:
|
|
607
607
|
i = Ct;
|
|
608
608
|
var l = D;
|
|
609
609
|
m();
|
|
@@ -618,19 +618,19 @@ var N, xo = function(e) {
|
|
|
618
618
|
else if (F(ye), O.sb && U(Ie))
|
|
619
619
|
break;
|
|
620
620
|
var p = {
|
|
621
|
-
key: I === Ve || I === tt ? et() :
|
|
621
|
+
key: I === Ve || I === tt ? et() : ae(!0)
|
|
622
622
|
}, T = !1;
|
|
623
623
|
if (U(_e)) {
|
|
624
624
|
p.value = K(!0);
|
|
625
625
|
var _ = p.kind = "init";
|
|
626
626
|
} else
|
|
627
|
-
p.key.type !== "Identifier" || p.key.name !== "get" && p.key.name !== "set" ?
|
|
628
|
-
if (p.key.type === "Identifier" && (
|
|
627
|
+
p.key.type !== "Identifier" || p.key.name !== "get" && p.key.name !== "set" ? ie() : (T = c = !0, _ = p.kind = p.key.name, p.key = I === Ve || I === tt ? et() : ae(!0), I !== le && ie(), p.value = wt(M(), !1));
|
|
628
|
+
if (p.key.type === "Identifier" && (q || c))
|
|
629
629
|
for (var X = 0; X < i.h.length; ++X) {
|
|
630
630
|
var Ae = i.h[X];
|
|
631
631
|
if (Ae.key.name === p.key.name) {
|
|
632
632
|
var Vt = _ === Ae.kind || T && Ae.kind === "init" || _ === "init" && (Ae.kind === "get" || Ae.kind === "set");
|
|
633
|
-
Vt && !
|
|
633
|
+
Vt && !q && _ === "init" && Ae.kind === "init" && (Vt = !1), Vt && r(p.key.start, "Redefinition of property");
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
i.h.push(p);
|
|
@@ -639,18 +639,18 @@ var N, xo = function(e) {
|
|
|
639
639
|
case Rt:
|
|
640
640
|
return i = M(), m(), wt(i, !1);
|
|
641
641
|
case An:
|
|
642
|
-
return i = M(), m(), i.callee = Me(et(), !0), i.arguments = U(
|
|
642
|
+
return i = M(), m(), i.callee = Me(et(), !0), i.arguments = U(le) ? xt(re, !1) : Ur, A(i, "NewExpression");
|
|
643
643
|
}
|
|
644
|
-
|
|
644
|
+
ie();
|
|
645
645
|
}
|
|
646
646
|
function wt(i, l) {
|
|
647
|
-
I === Ee ? i.id =
|
|
647
|
+
I === Ee ? i.id = ae() : l ? ie() : i.id = null, i.oa = [];
|
|
648
648
|
var c = !0;
|
|
649
|
-
for (F(
|
|
650
|
-
c ? c = !1 : F(ye), i.oa.push(
|
|
649
|
+
for (F(le); !U(re); )
|
|
650
|
+
c ? c = !1 : F(ye), i.oa.push(ae());
|
|
651
651
|
c = Fe;
|
|
652
652
|
var p = V;
|
|
653
|
-
if (Fe = !0, V = [], i.body = Be(!0), Fe = c, V = p,
|
|
653
|
+
if (Fe = !0, V = [], i.body = Be(!0), Fe = c, V = p, q || i.body.body.length && gt(i.body.body[0])) {
|
|
654
654
|
for (c = i.id ? -1 : 0; c < i.oa.length; ++c)
|
|
655
655
|
if (p = 0 > c ? i.id : i.oa[c], (_n(p.name) || rt(p.name)) && r(p.start, "Defining '" + p.name + "' in strict mode"), 0 <= c)
|
|
656
656
|
for (var T = 0; T < c; ++T)
|
|
@@ -668,9 +668,9 @@ var N, xo = function(e) {
|
|
|
668
668
|
}
|
|
669
669
|
return p;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function ae(i) {
|
|
672
672
|
var l = M();
|
|
673
|
-
return i && O.yb === "everywhere" && (i = !1), I === Ee ? (!i && (O.yb && Xr(Q) ||
|
|
673
|
+
return i && O.yb === "everywhere" && (i = !1), I === Ee ? (!i && (O.yb && Xr(Q) || q && _n(Q)) && g.slice(D, Ce).indexOf("\\") === -1 && r(D, "The keyword '" + Q + "' is reserved"), l.name = Q) : i && I.l ? l.name = I.l : ie(), Ue = !1, m(), A(l, "Identifier");
|
|
674
674
|
}
|
|
675
675
|
e.version = "0.5.0";
|
|
676
676
|
var O, g = "", ke, kt;
|
|
@@ -678,7 +678,7 @@ var N, xo = function(e) {
|
|
|
678
678
|
g = String(i), ke = g.length, O = l || {};
|
|
679
679
|
for (var c in dn)
|
|
680
680
|
Object.prototype.hasOwnProperty.call(O, c) || (O[c] = dn[c]);
|
|
681
|
-
for (kt = O.sourceFile, Se = 1, f =
|
|
681
|
+
for (kt = O.sourceFile, Se = 1, f = se = 0, Ue = !0, d(), c = O.dc, It = ge = f, O.C && (Tt = new a()), Fe = q = !1, V = [], E(), i = c || M(), l = !0, c || (i.body = []); I !== At; )
|
|
682
682
|
c = ne(), i.body.push(c), l && gt(c) && ee(!0), l = !1;
|
|
683
683
|
return A(i, "Program");
|
|
684
684
|
};
|
|
@@ -693,7 +693,7 @@ var N, xo = function(e) {
|
|
|
693
693
|
dc: null,
|
|
694
694
|
sourceFile: null,
|
|
695
695
|
vb: null
|
|
696
|
-
}, f = 0, D = 0, Ce = 0, Ct, Et, I, Q, Ue, Se,
|
|
696
|
+
}, f = 0, D = 0, Ce = 0, Ct, Et, I, Q, Ue, Se, se, It = 0, ge = 0, Tt, Fe, V, q, Ur = [], Ve = {
|
|
697
697
|
type: "num"
|
|
698
698
|
}, hn = {
|
|
699
699
|
type: "regexp"
|
|
@@ -822,7 +822,7 @@ var N, xo = function(e) {
|
|
|
822
822
|
m: !0
|
|
823
823
|
}, Ie = {
|
|
824
824
|
type: "}"
|
|
825
|
-
},
|
|
825
|
+
}, le = {
|
|
826
826
|
type: "(",
|
|
827
827
|
m: !0
|
|
828
828
|
}, re = {
|
|
@@ -830,7 +830,7 @@ var N, xo = function(e) {
|
|
|
830
830
|
}, ye = {
|
|
831
831
|
type: ",",
|
|
832
832
|
m: !0
|
|
833
|
-
},
|
|
833
|
+
}, ce = {
|
|
834
834
|
type: ";",
|
|
835
835
|
m: !0
|
|
836
836
|
}, _e = {
|
|
@@ -944,7 +944,7 @@ var Wn = {
|
|
|
944
944
|
VALUE_IN_DESCRIPTOR: !0
|
|
945
945
|
}, Oe = {
|
|
946
946
|
REGEXP_TIMEOUT: !0
|
|
947
|
-
}, Hn = [],
|
|
947
|
+
}, Hn = [], fe = null, Ge = null, ve = typeof globalThis > "u" ? void 0 : globalThis, ko = ["onmessage = function(e) {", "var result;", "var data = e.data;", "switch (data[0]) {", "case 'split':", "result = data[1].split(data[2], data[3]);", "break;", "case 'match':", "result = data[1].match(data[2]);", "break;", "case 'search':", "result = data[1].search(data[2]);", "break;", "case 'replace':", "result = data[1].replace(data[2], data[3]);", "break;", "case 'exec':", "var regexp = data[1];", "regexp.lastIndex = data[2];", "result = [regexp.exec(data[3]), data[1].lastIndex];", "break;", "default:", "throw Error('Unknown RegExp operation: ' + data[0]);", "}", "postMessage(result);", "close();", "};"];
|
|
948
948
|
function zt(e) {
|
|
949
949
|
var t = e >>> 0;
|
|
950
950
|
return t === Number(e) ? t : NaN;
|
|
@@ -1093,17 +1093,17 @@ function Io(e, t) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
var r = function(o) {
|
|
1095
1095
|
if (o == null)
|
|
1096
|
-
return
|
|
1096
|
+
return de(e) ? this : e.s(e.M);
|
|
1097
1097
|
if (!(o instanceof R)) {
|
|
1098
|
-
var a = e.s(
|
|
1098
|
+
var a = e.s(pe(e, o));
|
|
1099
1099
|
return a.data = o, a;
|
|
1100
1100
|
}
|
|
1101
1101
|
return o;
|
|
1102
1102
|
};
|
|
1103
1103
|
e.v = e.i(r, !0), e.g(e.v, "prototype", e.M, y), e.g(e.M, "constructor", e.v, y), e.g(t, "Object", e.v, y), r = function(o) {
|
|
1104
|
-
return n(o),
|
|
1104
|
+
return n(o), ue(e, Object.getOwnPropertyNames(o instanceof R ? o.h : o));
|
|
1105
1105
|
}, e.g(e.v, "getOwnPropertyNames", e.i(r, !1), y), r = function(o) {
|
|
1106
|
-
return n(o), o instanceof R && (o = o.h),
|
|
1106
|
+
return n(o), o instanceof R && (o = o.h), ue(e, Object.keys(o));
|
|
1107
1107
|
}, e.g(e.v, "keys", e.i(r, !1), y), r = function(o) {
|
|
1108
1108
|
return o === null ? e.s(null) : (o instanceof R || w(e, e.j, "Object prototype may only be an Object or null, not " + o), e.s(o));
|
|
1109
1109
|
}, e.g(e.v, "create", e.i(r, !1), y), e.ba.push("(function() {", "var create_ = Object.create;", "Object.create = function create(proto, props) {", "var obj = create_(proto);", "props && Object.defineProperties(obj, props);", "return obj;", "};", "})();", ""), r = function(o, a, s) {
|
|
@@ -1114,7 +1114,7 @@ function Io(e, t) {
|
|
|
1114
1114
|
return o = o.Y[a], a = e.s(e.M), u || o ? (e.g(a, "get", u), e.g(a, "set", o)) : (e.g(a, "value", s.value), e.g(a, "writable", s.writable)), e.g(a, "configurable", s.configurable), e.g(a, "enumerable", s.enumerable), a;
|
|
1115
1115
|
}
|
|
1116
1116
|
}, e.g(e.v, "getOwnPropertyDescriptor", e.i(r, !1), y), r = function(o) {
|
|
1117
|
-
return n(o),
|
|
1117
|
+
return n(o), pe(e, o);
|
|
1118
1118
|
}, e.g(e.v, "getPrototypeOf", e.i(r, !1), y), r = function(o) {
|
|
1119
1119
|
return !!o && !o.preventExtensions;
|
|
1120
1120
|
}, e.g(e.v, "isExtensible", e.i(r, !1), y), r = function(o) {
|
|
@@ -1125,7 +1125,7 @@ function Io(e, t) {
|
|
|
1125
1125
|
return n(this), this instanceof R ? Object.prototype.propertyIsEnumerable.call(this.h, o) : this.propertyIsEnumerable(o);
|
|
1126
1126
|
}, W(e, e.v, "propertyIsEnumerable", r), r = function(o) {
|
|
1127
1127
|
for (; ; ) {
|
|
1128
|
-
if (o =
|
|
1128
|
+
if (o = pe(e, o), !o)
|
|
1129
1129
|
return !1;
|
|
1130
1130
|
if (o === this)
|
|
1131
1131
|
return !0;
|
|
@@ -1134,7 +1134,7 @@ function Io(e, t) {
|
|
|
1134
1134
|
}
|
|
1135
1135
|
function To(e, t) {
|
|
1136
1136
|
var n = function(r) {
|
|
1137
|
-
var o =
|
|
1137
|
+
var o = de(e) ? this : Re(e), a = arguments[0];
|
|
1138
1138
|
if (arguments.length === 1 && typeof a == "number")
|
|
1139
1139
|
isNaN(zt(a)) && w(e, e.ob, "Invalid array length: " + a), o.h.length = a;
|
|
1140
1140
|
else {
|
|
@@ -1154,7 +1154,7 @@ function To(e, t) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
function Ao(e, t) {
|
|
1156
1156
|
var n = function(r) {
|
|
1157
|
-
return r = arguments.length ? ve.String(r) : "",
|
|
1157
|
+
return r = arguments.length ? ve.String(r) : "", de(e) ? (this.data = r, this) : r;
|
|
1158
1158
|
};
|
|
1159
1159
|
for (e.J = e.i(n, !0), e.g(t, "String", e.J, y), e.g(e.J, "fromCharCode", e.i(String.fromCharCode, !1), y), t = "charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" "), n = 0; n < t.length; n++)
|
|
1160
1160
|
W(e, e.J, t[n], String.prototype[t[n]]);
|
|
@@ -1168,41 +1168,41 @@ function Ao(e, t) {
|
|
|
1168
1168
|
}, W(e, e.J, "localeCompare", n), n = function(r, o, a) {
|
|
1169
1169
|
var s = String(this);
|
|
1170
1170
|
if (o = o ? Number(o) : void 0, H(e, r, e.I) && (r = r.data, $e(e, r, a), e.REGEXP_MODE === 2)) {
|
|
1171
|
-
if (
|
|
1171
|
+
if (fe)
|
|
1172
1172
|
r = We(e, "string.split(separator, limit)", {
|
|
1173
1173
|
string: s,
|
|
1174
1174
|
separator: r,
|
|
1175
1175
|
limit: o
|
|
1176
|
-
}, r, a), r !== Oe && a(
|
|
1176
|
+
}, r, a), r !== Oe && a(ue(e, r));
|
|
1177
1177
|
else {
|
|
1178
1178
|
var u = e.ha(), d = He(e, r, u, a);
|
|
1179
1179
|
u.onmessage = function(k) {
|
|
1180
|
-
clearTimeout(d), a(
|
|
1180
|
+
clearTimeout(d), a(ue(e, k.data));
|
|
1181
1181
|
}, u.postMessage(["split", s, r, o]);
|
|
1182
1182
|
}
|
|
1183
1183
|
return;
|
|
1184
1184
|
}
|
|
1185
|
-
r = s.split(r, o), a(
|
|
1185
|
+
r = s.split(r, o), a(ue(e, r));
|
|
1186
1186
|
}, Ke(e, e.J, "split", n), n = function(r, o) {
|
|
1187
1187
|
var a = String(this);
|
|
1188
1188
|
if (r = H(e, r, e.I) ? r.data : new RegExp(r), $e(e, r, o), e.REGEXP_MODE === 2)
|
|
1189
|
-
if (
|
|
1189
|
+
if (fe)
|
|
1190
1190
|
r = We(e, "string.match(regexp)", {
|
|
1191
1191
|
string: a,
|
|
1192
1192
|
regexp: r
|
|
1193
|
-
}, r, o), r !== Oe && o(r &&
|
|
1193
|
+
}, r, o), r !== Oe && o(r && ue(e, r));
|
|
1194
1194
|
else {
|
|
1195
1195
|
var s = e.ha(), u = He(e, r, s, o);
|
|
1196
1196
|
s.onmessage = function(d) {
|
|
1197
|
-
clearTimeout(u), o(d.data &&
|
|
1197
|
+
clearTimeout(u), o(d.data && ue(e, d.data));
|
|
1198
1198
|
}, s.postMessage(["match", a, r]);
|
|
1199
1199
|
}
|
|
1200
1200
|
else
|
|
1201
|
-
r = a.match(r), o(r &&
|
|
1201
|
+
r = a.match(r), o(r && ue(e, r));
|
|
1202
1202
|
}, Ke(e, e.J, "match", n), n = function(r, o) {
|
|
1203
1203
|
var a = String(this);
|
|
1204
1204
|
if (H(e, r, e.I) ? r = r.data : r = new RegExp(r), $e(e, r, o), e.REGEXP_MODE === 2)
|
|
1205
|
-
if (
|
|
1205
|
+
if (fe)
|
|
1206
1206
|
r = We(e, "string.search(regexp)", {
|
|
1207
1207
|
string: a,
|
|
1208
1208
|
regexp: r
|
|
@@ -1218,7 +1218,7 @@ function Ao(e, t) {
|
|
|
1218
1218
|
}, Ke(e, e.J, "search", n), n = function(r, o, a) {
|
|
1219
1219
|
var s = String(this);
|
|
1220
1220
|
if (o = String(o), H(e, r, e.I) && (r = r.data, $e(e, r, a), e.REGEXP_MODE === 2)) {
|
|
1221
|
-
if (
|
|
1221
|
+
if (fe)
|
|
1222
1222
|
r = We(e, "string.replace(substr, newSubstr)", {
|
|
1223
1223
|
string: s,
|
|
1224
1224
|
substr: r,
|
|
@@ -1237,12 +1237,12 @@ function Ao(e, t) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
function Oo(e, t) {
|
|
1239
1239
|
e.mb = e.i(function(n) {
|
|
1240
|
-
return n = ve.Boolean(n),
|
|
1240
|
+
return n = ve.Boolean(n), de(e) ? (this.data = n, this) : n;
|
|
1241
1241
|
}, !0), e.g(t, "Boolean", e.mb, y);
|
|
1242
1242
|
}
|
|
1243
1243
|
function jo(e, t) {
|
|
1244
1244
|
var n = function(r) {
|
|
1245
|
-
return r = arguments.length ? ve.Number(r) : 0,
|
|
1245
|
+
return r = arguments.length ? ve.Number(r) : 0, de(e) ? (this.data = r, this) : r;
|
|
1246
1246
|
};
|
|
1247
1247
|
for (e.aa = e.i(n, !0), e.g(t, "Number", e.aa, y), t = ["MAX_VALUE", "MIN_VALUE", "NaN", "NEGATIVE_INFINITY", "POSITIVE_INFINITY"], n = 0; n < t.length; n++)
|
|
1248
1248
|
e.g(e.aa, t[n], Number[t[n]], Le);
|
|
@@ -1281,7 +1281,7 @@ function jo(e, t) {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
function Ro(e, t) {
|
|
1283
1283
|
var n = function(o, a) {
|
|
1284
|
-
if (!
|
|
1284
|
+
if (!de(e))
|
|
1285
1285
|
return ve.Date();
|
|
1286
1286
|
var s = [null].concat(Array.from(arguments));
|
|
1287
1287
|
return this.data = new (Function.prototype.bind.apply(ve.Date, s))(), this;
|
|
@@ -1300,7 +1300,7 @@ function Ro(e, t) {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
function Po(e, t) {
|
|
1302
1302
|
var n = function(r, o) {
|
|
1303
|
-
if (
|
|
1303
|
+
if (de(e))
|
|
1304
1304
|
var a = this;
|
|
1305
1305
|
else {
|
|
1306
1306
|
if (o === void 0 && H(e, r, e.I))
|
|
@@ -1318,14 +1318,14 @@ function Po(e, t) {
|
|
|
1318
1318
|
e.I = e.i(n, !0), e.Ma = e.I.h.prototype, e.g(t, "RegExp", e.I, y), e.g(e.I.h.prototype, "global", void 0, J), e.g(e.I.h.prototype, "ignoreCase", void 0, J), e.g(e.I.h.prototype, "multiline", void 0, J), e.g(e.I.h.prototype, "source", "(?:)", J), e.ba.push("Object.defineProperty(RegExp.prototype, 'test',", "{configurable: true, writable: true, value:", "function test(str) {", "return !!this.exec(str);", "}", "});"), n = function(r, o) {
|
|
1319
1319
|
function a(E) {
|
|
1320
1320
|
if (E) {
|
|
1321
|
-
var S =
|
|
1321
|
+
var S = ue(e, E);
|
|
1322
1322
|
return e.g(S, "index", E.index), e.g(S, "input", E.input), S;
|
|
1323
1323
|
}
|
|
1324
1324
|
return null;
|
|
1325
1325
|
}
|
|
1326
1326
|
var s = this.data;
|
|
1327
1327
|
if (r = String(r), s.lastIndex = Number(e.G(this, "lastIndex")), $e(e, s, o), e.REGEXP_MODE === 2)
|
|
1328
|
-
if (
|
|
1328
|
+
if (fe)
|
|
1329
1329
|
r = We(e, "regexp.exec(string)", {
|
|
1330
1330
|
string: r,
|
|
1331
1331
|
regexp: s
|
|
@@ -1343,13 +1343,13 @@ function Po(e, t) {
|
|
|
1343
1343
|
function No(e, t) {
|
|
1344
1344
|
function n(r) {
|
|
1345
1345
|
var o = e.i(function(a) {
|
|
1346
|
-
var s =
|
|
1346
|
+
var s = de(e) ? this : e.Aa(o);
|
|
1347
1347
|
return Wt(e, s, a), s;
|
|
1348
1348
|
}, !0);
|
|
1349
1349
|
return e.g(o, "prototype", e.Aa(e.D), y), e.g(o.h.prototype, "name", r, y), e.g(t, r, o, y), o;
|
|
1350
1350
|
}
|
|
1351
1351
|
e.D = e.i(function(r) {
|
|
1352
|
-
var o =
|
|
1352
|
+
var o = de(e) ? this : e.Aa(e.D);
|
|
1353
1353
|
return Wt(e, o, r), o;
|
|
1354
1354
|
}, !0), e.g(t, "Error", e.D, y), e.g(e.D.h.prototype, "message", "", y), e.g(e.D.h.prototype, "name", "Error", y), n("EvalError"), e.ob = n("RangeError"), e.pb = n("ReferenceError"), e.T = n("SyntaxError"), e.j = n("TypeError"), e.Gb = n("URIError");
|
|
1355
1355
|
}
|
|
@@ -1388,7 +1388,7 @@ function H(e, t, n) {
|
|
|
1388
1388
|
return !1;
|
|
1389
1389
|
if (n = n.h.prototype, t === n)
|
|
1390
1390
|
return !0;
|
|
1391
|
-
for (t =
|
|
1391
|
+
for (t = pe(e, t); t; ) {
|
|
1392
1392
|
if (t === n)
|
|
1393
1393
|
return !0;
|
|
1394
1394
|
t = t.xa;
|
|
@@ -1427,7 +1427,7 @@ function We(e, t, n, r, o) {
|
|
|
1427
1427
|
timeout: e.REGEXP_THREAD_TIMEOUT
|
|
1428
1428
|
};
|
|
1429
1429
|
try {
|
|
1430
|
-
return
|
|
1430
|
+
return fe.runInNewContext(t, n, a);
|
|
1431
1431
|
} catch {
|
|
1432
1432
|
o(null), w(e, e.D, "RegExp Timeout: " + r);
|
|
1433
1433
|
}
|
|
@@ -1438,16 +1438,16 @@ function $e(e, t, n) {
|
|
|
1438
1438
|
var r = !1;
|
|
1439
1439
|
else if (e.REGEXP_MODE === 1)
|
|
1440
1440
|
r = !0;
|
|
1441
|
-
else if (
|
|
1441
|
+
else if (fe)
|
|
1442
1442
|
r = !0;
|
|
1443
1443
|
else if (typeof Worker == "function" && typeof URL == "function")
|
|
1444
1444
|
r = !0;
|
|
1445
1445
|
else if (typeof require == "function") {
|
|
1446
1446
|
try {
|
|
1447
|
-
|
|
1447
|
+
fe = require("vm");
|
|
1448
1448
|
} catch {
|
|
1449
1449
|
}
|
|
1450
|
-
r = !!
|
|
1450
|
+
r = !!fe;
|
|
1451
1451
|
} else
|
|
1452
1452
|
r = !1;
|
|
1453
1453
|
r || (n(null), w(e, e.D, "Regular expressions not supported: " + t));
|
|
@@ -1553,7 +1553,7 @@ N.R = function(e, t) {
|
|
|
1553
1553
|
});
|
|
1554
1554
|
return t.hb.pop(), t.Sa.pop(), n;
|
|
1555
1555
|
};
|
|
1556
|
-
function
|
|
1556
|
+
function ue(e, t) {
|
|
1557
1557
|
for (var n = Re(e), r = Object.getOwnPropertyNames(t), o = 0; o < r.length; o++)
|
|
1558
1558
|
e.g(n, r[o], t[r[o]]);
|
|
1559
1559
|
return n;
|
|
@@ -1564,7 +1564,7 @@ function fr(e, t) {
|
|
|
1564
1564
|
n[r] = e.G(t, r);
|
|
1565
1565
|
return n.length = zt(e.G(t, "length")) || 0, n;
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function pe(e, t) {
|
|
1568
1568
|
switch (typeof t) {
|
|
1569
1569
|
case "number":
|
|
1570
1570
|
return e.aa.h.prototype;
|
|
@@ -1591,7 +1591,7 @@ N.G = function(e, t) {
|
|
|
1591
1591
|
do
|
|
1592
1592
|
if (e.h && t in e.h)
|
|
1593
1593
|
return (n = e.V[t]) ? (this.P = !0, n) : e.h[t];
|
|
1594
|
-
while (e =
|
|
1594
|
+
while (e = pe(this, e));
|
|
1595
1595
|
};
|
|
1596
1596
|
function ft(e, t, n) {
|
|
1597
1597
|
if (!(t instanceof R))
|
|
@@ -1606,7 +1606,7 @@ function ft(e, t, n) {
|
|
|
1606
1606
|
do
|
|
1607
1607
|
if (t.h && n in t.h)
|
|
1608
1608
|
return !0;
|
|
1609
|
-
while (t =
|
|
1609
|
+
while (t = pe(e, t));
|
|
1610
1610
|
return !1;
|
|
1611
1611
|
}
|
|
1612
1612
|
N.g = function(e, t, n, r) {
|
|
@@ -1651,7 +1651,7 @@ N.g = function(e, t, n, r) {
|
|
|
1651
1651
|
if (n === Ye)
|
|
1652
1652
|
throw ReferenceError("Value not specified");
|
|
1653
1653
|
for (r = e; !(t in r.h); )
|
|
1654
|
-
if (r =
|
|
1654
|
+
if (r = pe(this, r), !r) {
|
|
1655
1655
|
r = e;
|
|
1656
1656
|
break;
|
|
1657
1657
|
}
|
|
@@ -1778,7 +1778,7 @@ function Je(e, t, n) {
|
|
|
1778
1778
|
r[s] === !0 ? e.g(n.object, s, void 0, $n) : e.g(n.object, s, Qt(e, r[s], n), $n);
|
|
1779
1779
|
return r;
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function de(e) {
|
|
1782
1782
|
return e.o[e.o.length - 1].isConstructor;
|
|
1783
1783
|
}
|
|
1784
1784
|
function rn(e, t) {
|
|
@@ -1910,7 +1910,7 @@ function an(e, t, n, r) {
|
|
|
1910
1910
|
return o.type = "CallExpression", e = new b(o, e.o[e.o.length - 1].scope), e.ia = 2, e.B = n, e.U = t, e.Qa = !0, e.F = [r], e;
|
|
1911
1911
|
}
|
|
1912
1912
|
function Dt(e, t) {
|
|
1913
|
-
return t == null ? e.Na : t instanceof R ? t : (e = e.s(
|
|
1913
|
+
return t == null ? e.Na : t instanceof R ? t : (e = e.s(pe(e, t)), e.data = t, e);
|
|
1914
1914
|
}
|
|
1915
1915
|
N.Xb = function() {
|
|
1916
1916
|
return this.N;
|
|
@@ -2267,7 +2267,7 @@ h.prototype.stepForInStatement = function(e, t, n) {
|
|
|
2267
2267
|
break e;
|
|
2268
2268
|
}
|
|
2269
2269
|
}
|
|
2270
|
-
if (t.u =
|
|
2270
|
+
if (t.u = pe(this, t.u), t.wa = null, t.u === null) {
|
|
2271
2271
|
e.pop();
|
|
2272
2272
|
return;
|
|
2273
2273
|
}
|
|
@@ -2572,7 +2572,7 @@ const Vo = (e) => e.split(`
|
|
|
2572
2572
|
}).join(`
|
|
2573
2573
|
`), E = Vo(s);
|
|
2574
2574
|
if (E === "") {
|
|
2575
|
-
|
|
2575
|
+
z.warn("Skipping evaluation of empty code block.");
|
|
2576
2576
|
return;
|
|
2577
2577
|
}
|
|
2578
2578
|
const S = `
|
|
@@ -2595,12 +2595,23 @@ theFunction();
|
|
|
2595
2595
|
const v = new h(S, j);
|
|
2596
2596
|
return v.run(), v.pseudoToNative(v.value);
|
|
2597
2597
|
} catch (v) {
|
|
2598
|
-
|
|
2598
|
+
z.warn("Custom code error in edge runtime. NOTE: your code must be ES5 JavaScript.", {
|
|
2599
2599
|
e: v
|
|
2600
2600
|
});
|
|
2601
2601
|
return;
|
|
2602
2602
|
}
|
|
2603
|
-
},
|
|
2603
|
+
}, oe = (e) => e != null;
|
|
2604
|
+
function _o() {
|
|
2605
|
+
var e;
|
|
2606
|
+
return typeof process < "u" && oe((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
2607
|
+
}
|
|
2608
|
+
const Lo = () => {
|
|
2609
|
+
var r;
|
|
2610
|
+
if (!_o())
|
|
2611
|
+
return !1;
|
|
2612
|
+
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (r = process.env.NODE_OPTIONS) == null ? void 0 : r.includes("--no-node-snapshot");
|
|
2613
|
+
return e && t && !n ? (z.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;
|
|
2614
|
+
}, Wo = (e) => G() || Lo() ? So(e) : Do(e);
|
|
2604
2615
|
function sn({
|
|
2605
2616
|
code: e,
|
|
2606
2617
|
context: t,
|
|
@@ -2611,7 +2622,7 @@ function sn({
|
|
|
2611
2622
|
isExpression: s = !0
|
|
2612
2623
|
}) {
|
|
2613
2624
|
if (e === "") {
|
|
2614
|
-
|
|
2625
|
+
z.warn("Skipping evaluation of empty code block.");
|
|
2615
2626
|
return;
|
|
2616
2627
|
}
|
|
2617
2628
|
const u = {
|
|
@@ -2626,16 +2637,16 @@ function sn({
|
|
|
2626
2637
|
localState: n
|
|
2627
2638
|
};
|
|
2628
2639
|
try {
|
|
2629
|
-
return
|
|
2640
|
+
return Wo(u);
|
|
2630
2641
|
} catch (d) {
|
|
2631
|
-
|
|
2642
|
+
z.error("Failed code evaluation: " + d.message, {
|
|
2632
2643
|
code: e
|
|
2633
2644
|
});
|
|
2634
2645
|
return;
|
|
2635
2646
|
}
|
|
2636
2647
|
}
|
|
2637
2648
|
const pt = (e) => JSON.parse(JSON.stringify(e));
|
|
2638
|
-
const
|
|
2649
|
+
const $o = ({
|
|
2639
2650
|
block: e,
|
|
2640
2651
|
context: t,
|
|
2641
2652
|
localState: n,
|
|
@@ -2674,7 +2685,7 @@ function ct({
|
|
|
2674
2685
|
rootSetState: a
|
|
2675
2686
|
}) {
|
|
2676
2687
|
const s = e;
|
|
2677
|
-
return n ?
|
|
2688
|
+
return n ? $o({
|
|
2678
2689
|
block: s,
|
|
2679
2690
|
localState: r,
|
|
2680
2691
|
rootState: o,
|
|
@@ -2682,7 +2693,7 @@ function ct({
|
|
|
2682
2693
|
context: t
|
|
2683
2694
|
}) : s;
|
|
2684
2695
|
}
|
|
2685
|
-
const
|
|
2696
|
+
const Ho = ({
|
|
2686
2697
|
block: e,
|
|
2687
2698
|
context: t,
|
|
2688
2699
|
registeredComponents: n
|
|
@@ -2704,7 +2715,7 @@ const Wo = ({
|
|
|
2704
2715
|
console.warn(`
|
|
2705
2716
|
Could not find a registered component named "${r}".
|
|
2706
2717
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
2707
|
-
},
|
|
2718
|
+
}, Ko = ({
|
|
2708
2719
|
block: e,
|
|
2709
2720
|
context: t
|
|
2710
2721
|
}) => {
|
|
@@ -2779,17 +2790,17 @@ const Wo = ({
|
|
|
2779
2790
|
min: a,
|
|
2780
2791
|
default: a + 1
|
|
2781
2792
|
}, n;
|
|
2782
|
-
},
|
|
2793
|
+
}, Go = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), yr = (e) => Object.entries(e).map(([n, r]) => {
|
|
2783
2794
|
if (typeof r == "string")
|
|
2784
|
-
return `${
|
|
2785
|
-
}).filter(
|
|
2795
|
+
return `${Go(n)}: ${r};`;
|
|
2796
|
+
}).filter(oe), Xo = (e) => yr(e).join(`
|
|
2786
2797
|
`), _t = ({
|
|
2787
2798
|
mediaQuery: e,
|
|
2788
2799
|
className: t,
|
|
2789
2800
|
styles: n
|
|
2790
2801
|
}) => {
|
|
2791
2802
|
const r = `.${t} {
|
|
2792
|
-
${
|
|
2803
|
+
${Xo(n)}
|
|
2793
2804
|
}`;
|
|
2794
2805
|
return e ? `${e} {
|
|
2795
2806
|
${r}
|
|
@@ -2798,7 +2809,7 @@ const Wo = ({
|
|
|
2798
2809
|
function dt(e) {
|
|
2799
2810
|
return /* @__PURE__ */ C("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
2800
2811
|
}
|
|
2801
|
-
function
|
|
2812
|
+
function Yo(e) {
|
|
2802
2813
|
const t = function() {
|
|
2803
2814
|
const o = ct({
|
|
2804
2815
|
block: e.block,
|
|
@@ -2808,7 +2819,7 @@ function Go(e) {
|
|
|
2808
2819
|
context: e.context.context,
|
|
2809
2820
|
shouldEvaluateBindings: !0
|
|
2810
2821
|
});
|
|
2811
|
-
return
|
|
2822
|
+
return oe(o.hide) ? !o.hide : oe(o.show) ? o.show : !0;
|
|
2812
2823
|
}, n = function() {
|
|
2813
2824
|
var x;
|
|
2814
2825
|
const o = ct({
|
|
@@ -2845,10 +2856,10 @@ function Go(e) {
|
|
|
2845
2856
|
};
|
|
2846
2857
|
return /* @__PURE__ */ C(L, { children: n() && t() ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(dt, { styles: n() }) }) : null });
|
|
2847
2858
|
}
|
|
2848
|
-
function
|
|
2859
|
+
function Jo(e) {
|
|
2849
2860
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2850
2861
|
}
|
|
2851
|
-
const
|
|
2862
|
+
const zo = (e) => `on${Jo(e)}`, qo = (e, t) => (n) => sn({
|
|
2852
2863
|
code: e,
|
|
2853
2864
|
context: t.context,
|
|
2854
2865
|
localState: t.localState,
|
|
@@ -2857,13 +2868,13 @@ const Yo = (e) => `on${Xo(e)}`, Jo = (e, t) => (n) => sn({
|
|
|
2857
2868
|
event: n,
|
|
2858
2869
|
isExpression: !1
|
|
2859
2870
|
});
|
|
2860
|
-
function
|
|
2871
|
+
function Ba(e) {
|
|
2861
2872
|
const t = {}, n = e.block.actions ?? {};
|
|
2862
2873
|
for (const r in n) {
|
|
2863
2874
|
if (!n.hasOwnProperty(r))
|
|
2864
2875
|
continue;
|
|
2865
2876
|
const o = n[r];
|
|
2866
|
-
let a =
|
|
2877
|
+
let a = zo(r);
|
|
2867
2878
|
if (e.stripPrefix)
|
|
2868
2879
|
switch (he) {
|
|
2869
2880
|
case "vue":
|
|
@@ -2873,19 +2884,19 @@ function Pa(e) {
|
|
|
2873
2884
|
a = a.replace("on:", "");
|
|
2874
2885
|
break;
|
|
2875
2886
|
}
|
|
2876
|
-
t[a] =
|
|
2887
|
+
t[a] = qo(o, e);
|
|
2877
2888
|
}
|
|
2878
2889
|
return t;
|
|
2879
2890
|
}
|
|
2880
|
-
function
|
|
2891
|
+
function Zo({
|
|
2881
2892
|
style: e
|
|
2882
2893
|
}) {
|
|
2883
2894
|
return e;
|
|
2884
2895
|
}
|
|
2885
|
-
const
|
|
2896
|
+
const Qo = ({
|
|
2886
2897
|
block: e,
|
|
2887
2898
|
context: t
|
|
2888
|
-
}) => vr(
|
|
2899
|
+
}) => vr(Zo({
|
|
2889
2900
|
style: e.style || {},
|
|
2890
2901
|
context: t,
|
|
2891
2902
|
block: e
|
|
@@ -2903,36 +2914,36 @@ function vr(e) {
|
|
|
2903
2914
|
return e;
|
|
2904
2915
|
}
|
|
2905
2916
|
}
|
|
2906
|
-
function
|
|
2917
|
+
function ei({
|
|
2907
2918
|
properties: e
|
|
2908
2919
|
}) {
|
|
2909
2920
|
return e;
|
|
2910
2921
|
}
|
|
2911
|
-
const
|
|
2922
|
+
const ti = (e) => ({
|
|
2912
2923
|
href: e.href
|
|
2913
2924
|
});
|
|
2914
|
-
function
|
|
2925
|
+
function ni({
|
|
2915
2926
|
block: e,
|
|
2916
2927
|
context: t
|
|
2917
2928
|
}) {
|
|
2918
2929
|
var r;
|
|
2919
2930
|
const n = {
|
|
2920
|
-
...
|
|
2931
|
+
...ti(e),
|
|
2921
2932
|
...e.properties,
|
|
2922
2933
|
"builder-id": e.id,
|
|
2923
|
-
style:
|
|
2934
|
+
style: Qo({
|
|
2924
2935
|
block: e,
|
|
2925
2936
|
context: t
|
|
2926
2937
|
}),
|
|
2927
2938
|
[Xt()]: [e.id, "builder-block", e.class, (r = e.properties) == null ? void 0 : r.class].filter(Boolean).join(" ")
|
|
2928
2939
|
};
|
|
2929
|
-
return
|
|
2940
|
+
return ei({
|
|
2930
2941
|
properties: n,
|
|
2931
2942
|
context: t,
|
|
2932
2943
|
block: e
|
|
2933
2944
|
});
|
|
2934
2945
|
}
|
|
2935
|
-
const
|
|
2946
|
+
const ri = ({
|
|
2936
2947
|
componentOptions: e,
|
|
2937
2948
|
builderBlock: t,
|
|
2938
2949
|
context: n,
|
|
@@ -2948,7 +2959,7 @@ const ti = ({
|
|
|
2948
2959
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
2949
2960
|
*/
|
|
2950
2961
|
...o ? {
|
|
2951
|
-
attributes:
|
|
2962
|
+
attributes: ni({
|
|
2952
2963
|
block: t,
|
|
2953
2964
|
context: s
|
|
2954
2965
|
})
|
|
@@ -2968,7 +2979,7 @@ function Jn(e) {
|
|
|
2968
2979
|
return /* @__PURE__ */ C(L, { children: e.componentRef ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(
|
|
2969
2980
|
t,
|
|
2970
2981
|
{
|
|
2971
|
-
...
|
|
2982
|
+
...ri({
|
|
2972
2983
|
componentOptions: e.componentOptions,
|
|
2973
2984
|
builderBlock: e.builderBlock,
|
|
2974
2985
|
context: e.context,
|
|
@@ -2991,7 +3002,7 @@ function Jn(e) {
|
|
|
2991
3002
|
}
|
|
2992
3003
|
) }) : null });
|
|
2993
3004
|
}
|
|
2994
|
-
function
|
|
3005
|
+
function oi(e) {
|
|
2995
3006
|
const t = e.repeatContext;
|
|
2996
3007
|
return /* @__PURE__ */ C(
|
|
2997
3008
|
ht,
|
|
@@ -3006,13 +3017,13 @@ function ni(e) {
|
|
|
3006
3017
|
function ht(e) {
|
|
3007
3018
|
var k, E, S;
|
|
3008
3019
|
const t = function() {
|
|
3009
|
-
return
|
|
3020
|
+
return Ho({
|
|
3010
3021
|
block: e.block,
|
|
3011
3022
|
context: e.context,
|
|
3012
3023
|
registeredComponents: e.registeredComponents
|
|
3013
3024
|
});
|
|
3014
3025
|
}, n = function() {
|
|
3015
|
-
return
|
|
3026
|
+
return Ko({
|
|
3016
3027
|
block: e.block,
|
|
3017
3028
|
context: e.context
|
|
3018
3029
|
});
|
|
@@ -3062,7 +3073,7 @@ function ht(e) {
|
|
|
3062
3073
|
};
|
|
3063
3074
|
}, d = e.context;
|
|
3064
3075
|
return /* @__PURE__ */ C(L, { children: a() ? /* @__PURE__ */ xe(L, { children: [
|
|
3065
|
-
/* @__PURE__ */ C(
|
|
3076
|
+
/* @__PURE__ */ C(Yo, { block: e.block, context: e.context }),
|
|
3066
3077
|
(k = t()) != null && k.noWrap ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(
|
|
3067
3078
|
Jn,
|
|
3068
3079
|
{
|
|
@@ -3077,7 +3088,7 @@ function ht(e) {
|
|
|
3077
3088
|
isInteractive: u().isInteractive
|
|
3078
3089
|
}
|
|
3079
3090
|
) }) : /* @__PURE__ */ C(L, { children: n() ? /* @__PURE__ */ C(L, { children: (S = n()) == null ? void 0 : S.map((P, j) => /* @__PURE__ */ C(
|
|
3080
|
-
|
|
3091
|
+
oi,
|
|
3081
3092
|
{
|
|
3082
3093
|
repeatContext: P.context,
|
|
3083
3094
|
block: P.block,
|
|
@@ -3146,7 +3157,7 @@ function mt(e) {
|
|
|
3146
3157
|
}
|
|
3147
3158
|
);
|
|
3148
3159
|
}
|
|
3149
|
-
function
|
|
3160
|
+
function ii(e) {
|
|
3150
3161
|
var j;
|
|
3151
3162
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], r = e.stackColumnsAt || "tablet", o = function(x) {
|
|
3152
3163
|
var B;
|
|
@@ -3280,11 +3291,11 @@ function ri(e) {
|
|
|
3280
3291
|
function zn(e) {
|
|
3281
3292
|
return e.replace(/http(s)?:/, "");
|
|
3282
3293
|
}
|
|
3283
|
-
function
|
|
3294
|
+
function ai(e = "", t, n) {
|
|
3284
3295
|
const r = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
|
|
3285
3296
|
return e.match(r) ? e.replace(r, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
|
|
3286
3297
|
}
|
|
3287
|
-
function
|
|
3298
|
+
function si(e, t) {
|
|
3288
3299
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
3289
3300
|
return e;
|
|
3290
3301
|
if (t === "master")
|
|
@@ -3296,18 +3307,18 @@ function ii(e, t) {
|
|
|
3296
3307
|
}
|
|
3297
3308
|
return null;
|
|
3298
3309
|
}
|
|
3299
|
-
function
|
|
3310
|
+
function Ma(e) {
|
|
3300
3311
|
if (!e)
|
|
3301
3312
|
return e;
|
|
3302
3313
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
3303
3314
|
if (e.match(/builder\.io/)) {
|
|
3304
3315
|
let n = e;
|
|
3305
3316
|
const r = Number(e.split("?width=")[1]);
|
|
3306
|
-
return isNaN(r) || (n = `${n} ${r}w`), t.filter((o) => o !== r).map((o) => `${
|
|
3317
|
+
return isNaN(r) || (n = `${n} ${r}w`), t.filter((o) => o !== r).map((o) => `${ai(e, "width", o)} ${o}w`).concat([n]).join(", ");
|
|
3307
3318
|
}
|
|
3308
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [
|
|
3319
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [si(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, r]) => `${n} ${r}w`).concat([e]).join(", ") : e;
|
|
3309
3320
|
}
|
|
3310
|
-
const
|
|
3321
|
+
const li = (e) => {
|
|
3311
3322
|
if (e === "localhost" || e === "127.0.0.1")
|
|
3312
3323
|
return e;
|
|
3313
3324
|
const t = e.split(".");
|
|
@@ -3320,16 +3331,16 @@ const ai = (e) => {
|
|
|
3320
3331
|
try {
|
|
3321
3332
|
return t ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
3322
3333
|
} catch (r) {
|
|
3323
|
-
|
|
3334
|
+
z.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
3324
3335
|
return;
|
|
3325
3336
|
}
|
|
3326
|
-
}, Sr = async (e) => br(e),
|
|
3337
|
+
}, Sr = async (e) => br(e), ci = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(oe).join("; "), ui = [["secure", ""], ["SameSite", "None"]], fi = ({
|
|
3327
3338
|
name: e,
|
|
3328
3339
|
value: t,
|
|
3329
3340
|
expires: n
|
|
3330
3341
|
}) => {
|
|
3331
|
-
const o = (G() ? location.protocol === "https:" : !0) ?
|
|
3332
|
-
return
|
|
3342
|
+
const o = (G() ? location.protocol === "https:" : !0) ? ui : [[]], a = n ? [["expires", n.toUTCString()]] : [[]], s = [[e, t], ...a, ["path", "/"], ["domain", li(window.location.hostname)], ...o];
|
|
3343
|
+
return ci(s);
|
|
3333
3344
|
}, wr = async ({
|
|
3334
3345
|
name: e,
|
|
3335
3346
|
value: t,
|
|
@@ -3339,33 +3350,33 @@ const ai = (e) => {
|
|
|
3339
3350
|
try {
|
|
3340
3351
|
if (!r)
|
|
3341
3352
|
return;
|
|
3342
|
-
const o =
|
|
3353
|
+
const o = fi({
|
|
3343
3354
|
name: e,
|
|
3344
3355
|
value: t,
|
|
3345
3356
|
expires: n
|
|
3346
3357
|
});
|
|
3347
3358
|
document.cookie = o;
|
|
3348
3359
|
} catch (o) {
|
|
3349
|
-
|
|
3360
|
+
z.warn("[COOKIE] SET error: ", (o == null ? void 0 : o.message) || o);
|
|
3350
3361
|
}
|
|
3351
|
-
},
|
|
3362
|
+
}, pi = "builder.tests", ln = (e) => `${pi}.${e}`, di = ({
|
|
3352
3363
|
contentId: e
|
|
3353
3364
|
}) => Sr({
|
|
3354
3365
|
name: ln(e),
|
|
3355
3366
|
canTrack: !0
|
|
3356
|
-
}),
|
|
3367
|
+
}), hi = ({
|
|
3357
3368
|
contentId: e
|
|
3358
3369
|
}) => br({
|
|
3359
3370
|
name: ln(e),
|
|
3360
3371
|
canTrack: !0
|
|
3361
|
-
}),
|
|
3372
|
+
}), mi = ({
|
|
3362
3373
|
contentId: e,
|
|
3363
3374
|
value: t
|
|
3364
3375
|
}) => wr({
|
|
3365
3376
|
name: ln(e),
|
|
3366
3377
|
value: t,
|
|
3367
3378
|
canTrack: !0
|
|
3368
|
-
}), xr = (e) =>
|
|
3379
|
+
}), xr = (e) => oe(e.id) && oe(e.variations) && Object.keys(e.variations).length > 0, gi = ({
|
|
3369
3380
|
id: e,
|
|
3370
3381
|
variations: t
|
|
3371
3382
|
}) => {
|
|
@@ -3379,12 +3390,12 @@ const ai = (e) => {
|
|
|
3379
3390
|
}
|
|
3380
3391
|
return e;
|
|
3381
3392
|
}, kr = (e) => {
|
|
3382
|
-
const t =
|
|
3383
|
-
return
|
|
3393
|
+
const t = gi(e);
|
|
3394
|
+
return mi({
|
|
3384
3395
|
contentId: e.id,
|
|
3385
3396
|
value: t
|
|
3386
3397
|
}).catch((n) => {
|
|
3387
|
-
|
|
3398
|
+
z.error("could not store A/B test variation: ", n);
|
|
3388
3399
|
}), t;
|
|
3389
3400
|
}, Cr = ({
|
|
3390
3401
|
item: e,
|
|
@@ -3400,7 +3411,7 @@ const ai = (e) => {
|
|
|
3400
3411
|
testVariationId: n.id,
|
|
3401
3412
|
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
3402
3413
|
};
|
|
3403
|
-
},
|
|
3414
|
+
}, yi = ({
|
|
3404
3415
|
item: e,
|
|
3405
3416
|
canTrack: t
|
|
3406
3417
|
}) => {
|
|
@@ -3410,7 +3421,7 @@ const ai = (e) => {
|
|
|
3410
3421
|
return;
|
|
3411
3422
|
if (!xr(e))
|
|
3412
3423
|
return e;
|
|
3413
|
-
const n =
|
|
3424
|
+
const n = hi({
|
|
3414
3425
|
contentId: e.id
|
|
3415
3426
|
}) || kr({
|
|
3416
3427
|
variations: e.variations,
|
|
@@ -3423,13 +3434,13 @@ const ai = (e) => {
|
|
|
3423
3434
|
...e,
|
|
3424
3435
|
...r
|
|
3425
3436
|
};
|
|
3426
|
-
},
|
|
3437
|
+
}, vi = async ({
|
|
3427
3438
|
item: e,
|
|
3428
3439
|
canTrack: t
|
|
3429
3440
|
}) => {
|
|
3430
3441
|
if (!t || !xr(e))
|
|
3431
3442
|
return e;
|
|
3432
|
-
const r = await
|
|
3443
|
+
const r = await di({
|
|
3433
3444
|
contentId: e.id
|
|
3434
3445
|
}) || kr({
|
|
3435
3446
|
variations: e.variations,
|
|
@@ -3442,7 +3453,7 @@ const ai = (e) => {
|
|
|
3442
3453
|
...e,
|
|
3443
3454
|
...o
|
|
3444
3455
|
};
|
|
3445
|
-
}, Ht = (e) =>
|
|
3456
|
+
}, Ht = (e) => oe(e) ? e : !0, bi = {
|
|
3446
3457
|
name: "Core:Button",
|
|
3447
3458
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
3448
3459
|
defaultStyles: {
|
|
@@ -3475,7 +3486,7 @@ const ai = (e) => {
|
|
|
3475
3486
|
}],
|
|
3476
3487
|
static: !0,
|
|
3477
3488
|
noWrap: !0
|
|
3478
|
-
},
|
|
3489
|
+
}, Si = {
|
|
3479
3490
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
3480
3491
|
name: "Columns",
|
|
3481
3492
|
isRSC: !0,
|
|
@@ -3676,7 +3687,7 @@ const ai = (e) => {
|
|
|
3676
3687
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
3677
3688
|
advanced: !0
|
|
3678
3689
|
}]
|
|
3679
|
-
},
|
|
3690
|
+
}, wi = {
|
|
3680
3691
|
name: "Custom Code",
|
|
3681
3692
|
static: !0,
|
|
3682
3693
|
requiredPermissions: ["editCode"],
|
|
@@ -3698,7 +3709,7 @@ const ai = (e) => {
|
|
|
3698
3709
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
3699
3710
|
advanced: !0
|
|
3700
3711
|
}]
|
|
3701
|
-
},
|
|
3712
|
+
}, xi = {
|
|
3702
3713
|
name: "Embed",
|
|
3703
3714
|
static: !0,
|
|
3704
3715
|
inputs: [{
|
|
@@ -3723,13 +3734,13 @@ const ai = (e) => {
|
|
|
3723
3734
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
3724
3735
|
hideFromUI: !0
|
|
3725
3736
|
}]
|
|
3726
|
-
},
|
|
3737
|
+
}, ki = ["text/javascript", "application/javascript", "application/ecmascript"], Ua = (e) => ki.includes(e.type), Ci = {
|
|
3727
3738
|
name: "Fragment",
|
|
3728
3739
|
static: !0,
|
|
3729
3740
|
hidden: !0,
|
|
3730
3741
|
canHaveChildren: !0,
|
|
3731
3742
|
noWrap: !0
|
|
3732
|
-
},
|
|
3743
|
+
}, Ei = {
|
|
3733
3744
|
name: "Image",
|
|
3734
3745
|
static: !0,
|
|
3735
3746
|
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",
|
|
@@ -3829,7 +3840,7 @@ const ai = (e) => {
|
|
|
3829
3840
|
advanced: !0,
|
|
3830
3841
|
defaultValue: 0.7041
|
|
3831
3842
|
}]
|
|
3832
|
-
},
|
|
3843
|
+
}, Ii = {
|
|
3833
3844
|
// friendlyName?
|
|
3834
3845
|
name: "Raw:Img",
|
|
3835
3846
|
hideFromInsertMenu: !0,
|
|
@@ -3843,7 +3854,7 @@ const ai = (e) => {
|
|
|
3843
3854
|
}],
|
|
3844
3855
|
noWrap: !0,
|
|
3845
3856
|
static: !0
|
|
3846
|
-
},
|
|
3857
|
+
}, Ti = {
|
|
3847
3858
|
name: "Core:Section",
|
|
3848
3859
|
static: !0,
|
|
3849
3860
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -3882,7 +3893,7 @@ const ai = (e) => {
|
|
|
3882
3893
|
}
|
|
3883
3894
|
}
|
|
3884
3895
|
}]
|
|
3885
|
-
},
|
|
3896
|
+
}, Ai = {
|
|
3886
3897
|
name: "Slot",
|
|
3887
3898
|
isRSC: !0,
|
|
3888
3899
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -3896,7 +3907,7 @@ const ai = (e) => {
|
|
|
3896
3907
|
defaultValue: "children"
|
|
3897
3908
|
}]
|
|
3898
3909
|
};
|
|
3899
|
-
function
|
|
3910
|
+
function Oi(e) {
|
|
3900
3911
|
var t, n, r;
|
|
3901
3912
|
return /* @__PURE__ */ C(
|
|
3902
3913
|
"div",
|
|
@@ -3919,7 +3930,7 @@ function Ti(e) {
|
|
|
3919
3930
|
}
|
|
3920
3931
|
);
|
|
3921
3932
|
}
|
|
3922
|
-
const
|
|
3933
|
+
const ji = {
|
|
3923
3934
|
name: "Symbol",
|
|
3924
3935
|
noWrap: !0,
|
|
3925
3936
|
static: !0,
|
|
@@ -3952,7 +3963,7 @@ const Ai = {
|
|
|
3952
3963
|
hideFromUI: !0,
|
|
3953
3964
|
type: "boolean"
|
|
3954
3965
|
}]
|
|
3955
|
-
},
|
|
3966
|
+
}, Ri = {
|
|
3956
3967
|
name: "Text",
|
|
3957
3968
|
static: !0,
|
|
3958
3969
|
isRSC: !0,
|
|
@@ -3971,7 +3982,7 @@ const Ai = {
|
|
|
3971
3982
|
textAlign: "center"
|
|
3972
3983
|
}
|
|
3973
3984
|
};
|
|
3974
|
-
function
|
|
3985
|
+
function Pi(e) {
|
|
3975
3986
|
var t;
|
|
3976
3987
|
return /* @__PURE__ */ C(
|
|
3977
3988
|
"div",
|
|
@@ -3984,7 +3995,7 @@ function ji(e) {
|
|
|
3984
3995
|
}
|
|
3985
3996
|
);
|
|
3986
3997
|
}
|
|
3987
|
-
const
|
|
3998
|
+
const Ni = {
|
|
3988
3999
|
name: "Video",
|
|
3989
4000
|
canHaveChildren: !0,
|
|
3990
4001
|
defaultStyles: {
|
|
@@ -4067,56 +4078,56 @@ const Ri = {
|
|
|
4067
4078
|
}]
|
|
4068
4079
|
}, qn = () => [{
|
|
4069
4080
|
component: ro,
|
|
4070
|
-
...
|
|
4081
|
+
...bi
|
|
4071
4082
|
}, {
|
|
4072
|
-
component:
|
|
4073
|
-
...
|
|
4083
|
+
component: ii,
|
|
4084
|
+
...Si
|
|
4074
4085
|
}, {
|
|
4075
4086
|
component: oo,
|
|
4076
|
-
...
|
|
4087
|
+
...wi
|
|
4077
4088
|
}, {
|
|
4078
4089
|
component: io,
|
|
4079
|
-
...
|
|
4090
|
+
...xi
|
|
4080
4091
|
}, {
|
|
4081
4092
|
component: ao,
|
|
4082
|
-
...
|
|
4093
|
+
...Ci
|
|
4083
4094
|
}, {
|
|
4084
4095
|
component: so,
|
|
4085
|
-
...
|
|
4096
|
+
...Ei
|
|
4086
4097
|
}, {
|
|
4087
4098
|
component: lo,
|
|
4088
|
-
...
|
|
4099
|
+
...Ii
|
|
4089
4100
|
}, {
|
|
4090
4101
|
component: co,
|
|
4091
|
-
...
|
|
4102
|
+
...Ti
|
|
4092
4103
|
}, {
|
|
4093
|
-
component:
|
|
4094
|
-
...
|
|
4104
|
+
component: Ta,
|
|
4105
|
+
...ji
|
|
4095
4106
|
}, {
|
|
4096
|
-
component:
|
|
4097
|
-
...
|
|
4107
|
+
component: Pi,
|
|
4108
|
+
...Ri
|
|
4098
4109
|
}, {
|
|
4099
4110
|
component: uo,
|
|
4100
|
-
...
|
|
4111
|
+
...Ni
|
|
4101
4112
|
}, {
|
|
4102
|
-
component:
|
|
4103
|
-
...
|
|
4104
|
-
}], Zn = [],
|
|
4113
|
+
component: Oi,
|
|
4114
|
+
...Ai
|
|
4115
|
+
}], Zn = [], Fa = (e) => ({
|
|
4105
4116
|
type: "builder.registerComponent",
|
|
4106
4117
|
data: Kt(e)
|
|
4107
|
-
}),
|
|
4118
|
+
}), Bi = (e) => {
|
|
4108
4119
|
const t = e.toString().trim();
|
|
4109
4120
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
4110
|
-
},
|
|
4121
|
+
}, Mi = (e) => typeof e == "function" ? Bi(e) : pt(e), Kt = ({
|
|
4111
4122
|
inputs: e,
|
|
4112
4123
|
...t
|
|
4113
4124
|
}) => ({
|
|
4114
4125
|
...pt(t),
|
|
4115
4126
|
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((r, [o, a]) => ({
|
|
4116
4127
|
...r,
|
|
4117
|
-
[o]:
|
|
4128
|
+
[o]: Mi(a)
|
|
4118
4129
|
}), {}))
|
|
4119
|
-
}),
|
|
4130
|
+
}), Ui = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
4120
4131
|
function getAndSetVariantId() {
|
|
4121
4132
|
function setCookie(name, value, days) {
|
|
4122
4133
|
let expires = '';
|
|
@@ -4172,7 +4183,7 @@ const Ri = {
|
|
|
4172
4183
|
}).join('');
|
|
4173
4184
|
styleEl.innerHTML = newStyleStr;
|
|
4174
4185
|
}
|
|
4175
|
-
}`,
|
|
4186
|
+
}`, Fi = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
4176
4187
|
if (!navigator.cookieEnabled) {
|
|
4177
4188
|
return;
|
|
4178
4189
|
}
|
|
@@ -4210,16 +4221,16 @@ const Ri = {
|
|
|
4210
4221
|
...t,
|
|
4211
4222
|
testVariationId: t.id,
|
|
4212
4223
|
id: e == null ? void 0 : e.id
|
|
4213
|
-
})),
|
|
4224
|
+
})), Vi = ({
|
|
4214
4225
|
canTrack: e,
|
|
4215
4226
|
content: t
|
|
4216
|
-
}) => !(!(st(t).length > 0) || !e || G()),
|
|
4217
|
-
window.${Er} = ${
|
|
4218
|
-
window.${Ir} = ${
|
|
4219
|
-
`,
|
|
4227
|
+
}) => !(!(st(t).length > 0) || !e || G()), Di = (e) => e === "react" || e === "reactNative", Tr = Di(he), _i = () => `
|
|
4228
|
+
window.${Er} = ${Ui}
|
|
4229
|
+
window.${Ir} = ${Fi}
|
|
4230
|
+
`, Li = (e, t) => `
|
|
4220
4231
|
window.${Er}(
|
|
4221
4232
|
"${t}",${JSON.stringify(e)}, ${Tr}
|
|
4222
|
-
)`,
|
|
4233
|
+
)`, Wi = ({
|
|
4223
4234
|
contentId: e,
|
|
4224
4235
|
variationId: t
|
|
4225
4236
|
}) => `window.${Ir}(
|
|
@@ -4234,33 +4245,33 @@ function Gt(e) {
|
|
|
4234
4245
|
}
|
|
4235
4246
|
);
|
|
4236
4247
|
}
|
|
4237
|
-
const
|
|
4248
|
+
const $i = (e) => {
|
|
4238
4249
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
4239
|
-
return n ||
|
|
4250
|
+
return n || z.warn("No previewed ID found in search params."), n;
|
|
4240
4251
|
};
|
|
4241
|
-
function
|
|
4252
|
+
function Hi() {
|
|
4242
4253
|
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Zr({
|
|
4243
4254
|
max: 500,
|
|
4244
4255
|
// how long to live in ms
|
|
4245
4256
|
ttl: 1e3 * 60 * 5
|
|
4246
4257
|
}));
|
|
4247
4258
|
}
|
|
4248
|
-
function
|
|
4249
|
-
|
|
4250
|
-
const t =
|
|
4259
|
+
function Ki(e) {
|
|
4260
|
+
Hi();
|
|
4261
|
+
const t = $i(e);
|
|
4251
4262
|
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
4252
4263
|
}
|
|
4253
|
-
function
|
|
4264
|
+
function Gi() {
|
|
4254
4265
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
4255
4266
|
}
|
|
4256
|
-
function
|
|
4257
|
-
const e =
|
|
4267
|
+
function Xi() {
|
|
4268
|
+
const e = Gi().fetch;
|
|
4258
4269
|
if (typeof e > "u")
|
|
4259
4270
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
4260
4271
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
4261
4272
|
return e;
|
|
4262
4273
|
}
|
|
4263
|
-
const
|
|
4274
|
+
const Yi = Xi();
|
|
4264
4275
|
function lt(e, t = null, n = ".") {
|
|
4265
4276
|
return Object.keys(e).reduce((r, o) => {
|
|
4266
4277
|
const a = e[o], s = [t, o].filter(Boolean).join(n);
|
|
@@ -4273,7 +4284,7 @@ function lt(e, t = null, n = ".") {
|
|
|
4273
4284
|
};
|
|
4274
4285
|
}, {});
|
|
4275
4286
|
}
|
|
4276
|
-
const
|
|
4287
|
+
const Ji = "v3", Qn = "builder.", zi = "options.", qi = (e) => {
|
|
4277
4288
|
const t = {};
|
|
4278
4289
|
return e.forEach((n, r) => {
|
|
4279
4290
|
t[r] = n;
|
|
@@ -4284,16 +4295,16 @@ const Xi = "v3", Qn = "builder.", Yi = "options.", Ji = (e) => {
|
|
|
4284
4295
|
const t = Or(e), n = {};
|
|
4285
4296
|
return Object.keys(t).forEach((r) => {
|
|
4286
4297
|
if (r.startsWith(Qn)) {
|
|
4287
|
-
const o = r.replace(Qn, "").replace(
|
|
4298
|
+
const o = r.replace(Qn, "").replace(zi, "");
|
|
4288
4299
|
n[o] = t[r];
|
|
4289
4300
|
}
|
|
4290
4301
|
}), n;
|
|
4291
|
-
},
|
|
4302
|
+
}, Zi = () => {
|
|
4292
4303
|
if (!G())
|
|
4293
4304
|
return {};
|
|
4294
4305
|
const e = new URLSearchParams(window.location.search);
|
|
4295
4306
|
return Ar(e);
|
|
4296
|
-
}, Or = (e) => e instanceof URLSearchParams ?
|
|
4307
|
+
}, Or = (e) => e instanceof URLSearchParams ? qi(e) : e, er = (e) => typeof e == "number" && !isNaN(e) && e >= 0, cn = (e) => {
|
|
4297
4308
|
let {
|
|
4298
4309
|
noTraverse: t = !1
|
|
4299
4310
|
} = e;
|
|
@@ -4306,7 +4317,7 @@ const Xi = "v3", Qn = "builder.", Yi = "options.", Ji = (e) => {
|
|
|
4306
4317
|
includeRefs: u = !0,
|
|
4307
4318
|
enrich: d,
|
|
4308
4319
|
locale: k,
|
|
4309
|
-
apiVersion: E =
|
|
4320
|
+
apiVersion: E = Ji,
|
|
4310
4321
|
fields: S,
|
|
4311
4322
|
omit: P,
|
|
4312
4323
|
offset: j,
|
|
@@ -4329,7 +4340,7 @@ const Xi = "v3", Qn = "builder.", Yi = "options.", Ji = (e) => {
|
|
|
4329
4340
|
m.searchParams.set(M, JSON.stringify(Z[M]));
|
|
4330
4341
|
}
|
|
4331
4342
|
const ee = {
|
|
4332
|
-
...
|
|
4343
|
+
...Zi(),
|
|
4333
4344
|
...Or(e.options || {})
|
|
4334
4345
|
}, te = lt(ee);
|
|
4335
4346
|
for (const Z in te)
|
|
@@ -4342,7 +4353,7 @@ const Xi = "v3", Qn = "builder.", Yi = "options.", Ji = (e) => {
|
|
|
4342
4353
|
m.searchParams.set(M, JSON.stringify(Z[M]));
|
|
4343
4354
|
}
|
|
4344
4355
|
return m;
|
|
4345
|
-
},
|
|
4356
|
+
}, Qi = (e) => "results" in e;
|
|
4346
4357
|
async function un(e) {
|
|
4347
4358
|
const t = await jr({
|
|
4348
4359
|
...e,
|
|
@@ -4350,15 +4361,15 @@ async function un(e) {
|
|
|
4350
4361
|
});
|
|
4351
4362
|
return t && t[0] || null;
|
|
4352
4363
|
}
|
|
4353
|
-
const
|
|
4364
|
+
const Va = un, ea = async (e) => {
|
|
4354
4365
|
const t = cn(e);
|
|
4355
|
-
return await (await
|
|
4356
|
-
},
|
|
4366
|
+
return await (await Yi(t.href)).json();
|
|
4367
|
+
}, ta = async (e, t, n = cn(e)) => {
|
|
4357
4368
|
const r = Ht(e.canTrack);
|
|
4358
4369
|
if (n.search.includes("preview=")) {
|
|
4359
4370
|
const a = [];
|
|
4360
4371
|
for (const s of t.results) {
|
|
4361
|
-
const u =
|
|
4372
|
+
const u = Ki(n.searchParams);
|
|
4362
4373
|
a.push(u || s);
|
|
4363
4374
|
}
|
|
4364
4375
|
t.results = a;
|
|
@@ -4368,46 +4379,46 @@ const Ua = un, Zi = async (e) => {
|
|
|
4368
4379
|
try {
|
|
4369
4380
|
const a = [];
|
|
4370
4381
|
for (const s of t.results)
|
|
4371
|
-
a.push(await
|
|
4382
|
+
a.push(await vi({
|
|
4372
4383
|
item: s,
|
|
4373
4384
|
canTrack: r
|
|
4374
4385
|
}));
|
|
4375
4386
|
t.results = a;
|
|
4376
4387
|
} catch (a) {
|
|
4377
|
-
|
|
4388
|
+
z.error("Could not process A/B tests. ", a);
|
|
4378
4389
|
}
|
|
4379
4390
|
return t.results;
|
|
4380
4391
|
};
|
|
4381
4392
|
async function jr(e) {
|
|
4382
4393
|
try {
|
|
4383
|
-
const t = cn(e), n = await
|
|
4384
|
-
return
|
|
4394
|
+
const t = cn(e), n = await ea(e);
|
|
4395
|
+
return Qi(n) ? ta(e, n) : (z.error("Error fetching data. ", {
|
|
4385
4396
|
url: t,
|
|
4386
4397
|
content: n,
|
|
4387
4398
|
options: e
|
|
4388
4399
|
}), null);
|
|
4389
4400
|
} catch (t) {
|
|
4390
|
-
return
|
|
4401
|
+
return z.error("Error fetching data. ", t), null;
|
|
4391
4402
|
}
|
|
4392
4403
|
}
|
|
4393
|
-
const
|
|
4394
|
-
function
|
|
4404
|
+
const Da = jr, na = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
4405
|
+
function ra(e, t) {
|
|
4395
4406
|
const n = new URL(t.origin), r = n.hostname;
|
|
4396
|
-
return (e ||
|
|
4407
|
+
return (e || na).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
4397
4408
|
}
|
|
4398
|
-
function
|
|
4409
|
+
function _a() {
|
|
4399
4410
|
return !G() || Yt() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
4400
4411
|
}
|
|
4401
|
-
function
|
|
4412
|
+
function oa() {
|
|
4402
4413
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
4403
4414
|
const t = Math.random() * 16 | 0;
|
|
4404
4415
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
4405
4416
|
});
|
|
4406
4417
|
}
|
|
4407
4418
|
function Rr() {
|
|
4408
|
-
return
|
|
4419
|
+
return oa().replace(/-/g, "");
|
|
4409
4420
|
}
|
|
4410
|
-
const Pr = "builderSessionId",
|
|
4421
|
+
const Pr = "builderSessionId", ia = async ({
|
|
4411
4422
|
canTrack: e
|
|
4412
4423
|
}) => {
|
|
4413
4424
|
if (!e)
|
|
@@ -4416,23 +4427,23 @@ const Pr = "builderSessionId", ra = async ({
|
|
|
4416
4427
|
name: Pr,
|
|
4417
4428
|
canTrack: e
|
|
4418
4429
|
});
|
|
4419
|
-
if (
|
|
4430
|
+
if (oe(t))
|
|
4420
4431
|
return t;
|
|
4421
4432
|
{
|
|
4422
|
-
const n =
|
|
4423
|
-
return
|
|
4433
|
+
const n = aa();
|
|
4434
|
+
return sa({
|
|
4424
4435
|
id: n,
|
|
4425
4436
|
canTrack: e
|
|
4426
4437
|
}), n;
|
|
4427
4438
|
}
|
|
4428
|
-
},
|
|
4439
|
+
}, aa = () => Rr(), sa = ({
|
|
4429
4440
|
id: e,
|
|
4430
4441
|
canTrack: t
|
|
4431
4442
|
}) => wr({
|
|
4432
4443
|
name: Pr,
|
|
4433
4444
|
value: e,
|
|
4434
4445
|
canTrack: t
|
|
4435
|
-
}), Nr = () => G() && typeof localStorage < "u" ? localStorage : void 0,
|
|
4446
|
+
}), Nr = () => G() && typeof localStorage < "u" ? localStorage : void 0, la = ({
|
|
4436
4447
|
key: e,
|
|
4437
4448
|
canTrack: t
|
|
4438
4449
|
}) => {
|
|
@@ -4443,7 +4454,7 @@ const Pr = "builderSessionId", ra = async ({
|
|
|
4443
4454
|
console.debug("[LocalStorage] GET error: ", r);
|
|
4444
4455
|
return;
|
|
4445
4456
|
}
|
|
4446
|
-
},
|
|
4457
|
+
}, ca = ({
|
|
4447
4458
|
key: e,
|
|
4448
4459
|
canTrack: t,
|
|
4449
4460
|
value: n
|
|
@@ -4454,32 +4465,32 @@ const Pr = "builderSessionId", ra = async ({
|
|
|
4454
4465
|
} catch (o) {
|
|
4455
4466
|
console.debug("[LocalStorage] SET error: ", o);
|
|
4456
4467
|
}
|
|
4457
|
-
}, Br = "builderVisitorId",
|
|
4468
|
+
}, Br = "builderVisitorId", ua = ({
|
|
4458
4469
|
canTrack: e
|
|
4459
4470
|
}) => {
|
|
4460
4471
|
if (!e)
|
|
4461
4472
|
return;
|
|
4462
|
-
const t =
|
|
4473
|
+
const t = la({
|
|
4463
4474
|
key: Br,
|
|
4464
4475
|
canTrack: e
|
|
4465
4476
|
});
|
|
4466
|
-
if (
|
|
4477
|
+
if (oe(t))
|
|
4467
4478
|
return t;
|
|
4468
4479
|
{
|
|
4469
|
-
const n =
|
|
4470
|
-
return
|
|
4480
|
+
const n = fa();
|
|
4481
|
+
return pa({
|
|
4471
4482
|
id: n,
|
|
4472
4483
|
canTrack: e
|
|
4473
4484
|
}), n;
|
|
4474
4485
|
}
|
|
4475
|
-
},
|
|
4486
|
+
}, fa = () => Rr(), pa = ({
|
|
4476
4487
|
id: e,
|
|
4477
4488
|
canTrack: t
|
|
4478
|
-
}) =>
|
|
4489
|
+
}) => ca({
|
|
4479
4490
|
key: Br,
|
|
4480
4491
|
value: e,
|
|
4481
4492
|
canTrack: t
|
|
4482
|
-
}),
|
|
4493
|
+
}), da = async ({
|
|
4483
4494
|
canTrack: e
|
|
4484
4495
|
}) => {
|
|
4485
4496
|
if (!e)
|
|
@@ -4487,16 +4498,16 @@ const Pr = "builderSessionId", ra = async ({
|
|
|
4487
4498
|
visitorId: void 0,
|
|
4488
4499
|
sessionId: void 0
|
|
4489
4500
|
};
|
|
4490
|
-
const t = await
|
|
4501
|
+
const t = await ia({
|
|
4491
4502
|
canTrack: e
|
|
4492
|
-
}), n =
|
|
4503
|
+
}), n = ua({
|
|
4493
4504
|
canTrack: e
|
|
4494
4505
|
});
|
|
4495
4506
|
return {
|
|
4496
4507
|
sessionId: t,
|
|
4497
4508
|
visitorId: n
|
|
4498
4509
|
};
|
|
4499
|
-
},
|
|
4510
|
+
}, ha = async ({
|
|
4500
4511
|
type: e,
|
|
4501
4512
|
canTrack: t,
|
|
4502
4513
|
apiKey: n,
|
|
@@ -4510,23 +4521,23 @@ const Pr = "builderSessionId", ra = async ({
|
|
|
4510
4521
|
url: location.href,
|
|
4511
4522
|
...r
|
|
4512
4523
|
},
|
|
4513
|
-
...await
|
|
4524
|
+
...await da({
|
|
4514
4525
|
canTrack: t
|
|
4515
4526
|
}),
|
|
4516
4527
|
userAttributes: sr(),
|
|
4517
4528
|
ownerId: n
|
|
4518
4529
|
}
|
|
4519
4530
|
});
|
|
4520
|
-
async function
|
|
4531
|
+
async function ma(e) {
|
|
4521
4532
|
if (!e.apiKey) {
|
|
4522
|
-
|
|
4533
|
+
z.error("Missing API key for track call. Please provide your API key.");
|
|
4523
4534
|
return;
|
|
4524
4535
|
}
|
|
4525
4536
|
if (e.canTrack && !Yt() && (G() || he === "reactNative"))
|
|
4526
4537
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
4527
4538
|
method: "POST",
|
|
4528
4539
|
body: JSON.stringify({
|
|
4529
|
-
events: [await
|
|
4540
|
+
events: [await ha(e)]
|
|
4530
4541
|
}),
|
|
4531
4542
|
headers: {
|
|
4532
4543
|
"content-type": "application/json"
|
|
@@ -4536,14 +4547,14 @@ async function da(e) {
|
|
|
4536
4547
|
console.error("Failed to track: ", t);
|
|
4537
4548
|
});
|
|
4538
4549
|
}
|
|
4539
|
-
const
|
|
4550
|
+
const La = (e) => ma({
|
|
4540
4551
|
...e,
|
|
4541
4552
|
canTrack: !0
|
|
4542
4553
|
});
|
|
4543
4554
|
function tr(e) {
|
|
4544
4555
|
return Math.round(e * 1e3) / 1e3;
|
|
4545
4556
|
}
|
|
4546
|
-
const
|
|
4557
|
+
const ga = (e, t, n = !0) => {
|
|
4547
4558
|
if (!(e instanceof HTMLElement))
|
|
4548
4559
|
return null;
|
|
4549
4560
|
let r = n ? e : e.parentElement;
|
|
@@ -4554,7 +4565,7 @@ const ha = (e, t, n = !0) => {
|
|
|
4554
4565
|
return r;
|
|
4555
4566
|
} while (r = r.parentElement);
|
|
4556
4567
|
return null;
|
|
4557
|
-
},
|
|
4568
|
+
}, ya = (e) => ga(e, (t) => {
|
|
4558
4569
|
const n = t.getAttribute("builder-id") || t.id;
|
|
4559
4570
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
4560
4571
|
}), nr = ({
|
|
@@ -4566,8 +4577,8 @@ const ha = (e, t, n = !0) => {
|
|
|
4566
4577
|
x: a,
|
|
4567
4578
|
y: s
|
|
4568
4579
|
};
|
|
4569
|
-
},
|
|
4570
|
-
const t = e.target, n = t &&
|
|
4580
|
+
}, Wa = (e) => {
|
|
4581
|
+
const t = e.target, n = t && ya(t), r = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
4571
4582
|
return {
|
|
4572
4583
|
targetBuilderElement: r || void 0,
|
|
4573
4584
|
metadata: {
|
|
@@ -4582,8 +4593,8 @@ const ha = (e, t, n = !0) => {
|
|
|
4582
4593
|
builderElementIndex: n && r ? [].slice.call(document.getElementsByClassName(r)).indexOf(n) : void 0
|
|
4583
4594
|
}
|
|
4584
4595
|
};
|
|
4585
|
-
},
|
|
4586
|
-
function
|
|
4596
|
+
}, va = "0.12.5", rr = {};
|
|
4597
|
+
function ba(e, t) {
|
|
4587
4598
|
let n = rr[e];
|
|
4588
4599
|
if (n || (n = rr[e] = []), n.push(t), G()) {
|
|
4589
4600
|
const r = {
|
|
@@ -4600,8 +4611,8 @@ function ya(e, t) {
|
|
|
4600
4611
|
}
|
|
4601
4612
|
}
|
|
4602
4613
|
}
|
|
4603
|
-
const
|
|
4604
|
-
|
|
4614
|
+
const $a = () => {
|
|
4615
|
+
ba("insertMenu", {
|
|
4605
4616
|
name: "_default",
|
|
4606
4617
|
default: !0,
|
|
4607
4618
|
items: [{
|
|
@@ -4624,13 +4635,13 @@ const La = () => {
|
|
|
4624
4635
|
});
|
|
4625
4636
|
};
|
|
4626
4637
|
let or = !1;
|
|
4627
|
-
const
|
|
4638
|
+
const Ha = (e = {}) => {
|
|
4628
4639
|
var t, n;
|
|
4629
4640
|
or || (or = !0, G() && ((t = window.parent) == null || t.postMessage({
|
|
4630
4641
|
type: "builder.sdkInfo",
|
|
4631
4642
|
data: {
|
|
4632
4643
|
target: he,
|
|
4633
|
-
version:
|
|
4644
|
+
version: va,
|
|
4634
4645
|
supportsPatchUpdates: !1,
|
|
4635
4646
|
// Supports builder-model="..." attribute which is needed to
|
|
4636
4647
|
// scope our '+ add block' button styling
|
|
@@ -4644,7 +4655,7 @@ const Wa = (e = {}) => {
|
|
|
4644
4655
|
}
|
|
4645
4656
|
}, "*"), window.addEventListener("message", (r) => {
|
|
4646
4657
|
var a, s;
|
|
4647
|
-
if (!
|
|
4658
|
+
if (!ra(e.trustedHosts, r))
|
|
4648
4659
|
return;
|
|
4649
4660
|
const {
|
|
4650
4661
|
data: o
|
|
@@ -4685,7 +4696,7 @@ const Wa = (e = {}) => {
|
|
|
4685
4696
|
}
|
|
4686
4697
|
}
|
|
4687
4698
|
})));
|
|
4688
|
-
},
|
|
4699
|
+
}, Sa = (e) => {
|
|
4689
4700
|
var a;
|
|
4690
4701
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], r = e.fileUrl ?? ((a = e == null ? void 0 : e.files) == null ? void 0 : a.regular);
|
|
4691
4702
|
let o = "";
|
|
@@ -4711,22 +4722,22 @@ font-weight: ${s};
|
|
|
4711
4722
|
`.trim());
|
|
4712
4723
|
}
|
|
4713
4724
|
return o;
|
|
4714
|
-
},
|
|
4725
|
+
}, wa = ({
|
|
4715
4726
|
customFonts: e
|
|
4716
4727
|
}) => {
|
|
4717
4728
|
var t;
|
|
4718
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
4719
|
-
},
|
|
4729
|
+
return ((t = e == null ? void 0 : e.map((n) => Sa(n))) == null ? void 0 : t.join(" ")) || "";
|
|
4730
|
+
}, xa = ({
|
|
4720
4731
|
cssCode: e,
|
|
4721
4732
|
contentId: t
|
|
4722
4733
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
4723
|
-
function
|
|
4734
|
+
function ka(e) {
|
|
4724
4735
|
const t = `
|
|
4725
|
-
${
|
|
4736
|
+
${xa({
|
|
4726
4737
|
cssCode: e.cssCode,
|
|
4727
4738
|
contentId: e.contentId
|
|
4728
4739
|
})}
|
|
4729
|
-
${
|
|
4740
|
+
${wa({
|
|
4730
4741
|
customFonts: e.customFonts
|
|
4731
4742
|
})}
|
|
4732
4743
|
|
|
@@ -4749,7 +4760,7 @@ ${ba({
|
|
|
4749
4760
|
`.trim();
|
|
4750
4761
|
return /* @__PURE__ */ C(dt, { styles: t });
|
|
4751
4762
|
}
|
|
4752
|
-
const
|
|
4763
|
+
const Ca = ({
|
|
4753
4764
|
content: e,
|
|
4754
4765
|
data: t,
|
|
4755
4766
|
locale: n
|
|
@@ -4766,7 +4777,7 @@ const xa = ({
|
|
|
4766
4777
|
locale: n
|
|
4767
4778
|
} : {}
|
|
4768
4779
|
};
|
|
4769
|
-
},
|
|
4780
|
+
}, Ea = ({
|
|
4770
4781
|
content: e,
|
|
4771
4782
|
data: t
|
|
4772
4783
|
}) => e ? {
|
|
@@ -4779,7 +4790,7 @@ const xa = ({
|
|
|
4779
4790
|
} : void 0;
|
|
4780
4791
|
function ir(e) {
|
|
4781
4792
|
var o, a, s, u, d, k, E, S, P;
|
|
4782
|
-
const t =
|
|
4793
|
+
const t = Wi({
|
|
4783
4794
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
4784
4795
|
variationId: (o = e.content) == null ? void 0 : o.testVariationId,
|
|
4785
4796
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -4803,12 +4814,12 @@ function ir(e) {
|
|
|
4803
4814
|
}),
|
|
4804
4815
|
{}
|
|
4805
4816
|
), r = {
|
|
4806
|
-
content:
|
|
4817
|
+
content: Ea({
|
|
4807
4818
|
content: e.content,
|
|
4808
4819
|
data: e.data
|
|
4809
4820
|
}),
|
|
4810
4821
|
localState: void 0,
|
|
4811
|
-
rootState:
|
|
4822
|
+
rootState: Ca({
|
|
4812
4823
|
content: e.content,
|
|
4813
4824
|
data: e.data,
|
|
4814
4825
|
locale: e.locale
|
|
@@ -4858,7 +4869,7 @@ function ir(e) {
|
|
|
4858
4869
|
children: [
|
|
4859
4870
|
e.isSsrAbTest ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(Gt, { scriptStr: t }) }) : null,
|
|
4860
4871
|
/* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(
|
|
4861
|
-
|
|
4872
|
+
ka,
|
|
4862
4873
|
{
|
|
4863
4874
|
contentId: (s = r.content) == null ? void 0 : s.id,
|
|
4864
4875
|
cssCode: (d = (u = r.content) == null ? void 0 : u.data) == null ? void 0 : d.cssCode,
|
|
@@ -4880,12 +4891,12 @@ function ir(e) {
|
|
|
4880
4891
|
}
|
|
4881
4892
|
function Mr(e) {
|
|
4882
4893
|
var a, s;
|
|
4883
|
-
const t =
|
|
4894
|
+
const t = Vi({
|
|
4884
4895
|
canTrack: Ht(e.canTrack),
|
|
4885
4896
|
content: e.content
|
|
4886
4897
|
}), n = function() {
|
|
4887
4898
|
var d;
|
|
4888
|
-
return
|
|
4899
|
+
return Li(
|
|
4889
4900
|
st(e.content).map((k) => ({
|
|
4890
4901
|
id: k.testVariationId,
|
|
4891
4902
|
testRatio: k.testRatio
|
|
@@ -4899,13 +4910,13 @@ function Mr(e) {
|
|
|
4899
4910
|
return t ? {
|
|
4900
4911
|
...e.content,
|
|
4901
4912
|
testVariationId: (d = e.content) == null ? void 0 : d.id
|
|
4902
|
-
} :
|
|
4913
|
+
} : yi({
|
|
4903
4914
|
item: e.content,
|
|
4904
4915
|
canTrack: Ht(e.canTrack)
|
|
4905
4916
|
});
|
|
4906
4917
|
};
|
|
4907
4918
|
return /* @__PURE__ */ xe(L, { children: [
|
|
4908
|
-
!e.__isNestedRender && he !== "reactNative" ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(Gt, { scriptStr:
|
|
4919
|
+
!e.__isNestedRender && he !== "reactNative" ? /* @__PURE__ */ C(L, { children: /* @__PURE__ */ C(Gt, { scriptStr: _i() }) }) : null,
|
|
4909
4920
|
t ? /* @__PURE__ */ xe(L, { children: [
|
|
4910
4921
|
/* @__PURE__ */ C(
|
|
4911
4922
|
dt,
|
|
@@ -4967,7 +4978,7 @@ function Mr(e) {
|
|
|
4967
4978
|
)
|
|
4968
4979
|
] });
|
|
4969
4980
|
}
|
|
4970
|
-
const
|
|
4981
|
+
const Ia = async ({
|
|
4971
4982
|
builderContextValue: e,
|
|
4972
4983
|
symbol: t
|
|
4973
4984
|
}) => {
|
|
@@ -4983,10 +4994,10 @@ const Ca = async ({
|
|
|
4983
4994
|
}
|
|
4984
4995
|
}
|
|
4985
4996
|
}).catch((n) => {
|
|
4986
|
-
|
|
4997
|
+
z.error("Could not fetch symbol content: ", n);
|
|
4987
4998
|
});
|
|
4988
4999
|
};
|
|
4989
|
-
async function
|
|
5000
|
+
async function Ta(e) {
|
|
4990
5001
|
var r, o, a, s, u;
|
|
4991
5002
|
const t = function() {
|
|
4992
5003
|
var k, E;
|
|
@@ -4996,7 +5007,7 @@ async function Ea(e) {
|
|
|
4996
5007
|
(k = e.symbol) != null && k.inline ? "builder-inline-symbol" : void 0,
|
|
4997
5008
|
(E = e.symbol) != null && E.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
4998
5009
|
].filter(Boolean).join(" ");
|
|
4999
|
-
}, n = ((r = e.symbol) == null ? void 0 : r.content) || await
|
|
5010
|
+
}, n = ((r = e.symbol) == null ? void 0 : r.content) || await Ia({
|
|
5000
5011
|
symbol: e.symbol,
|
|
5001
5012
|
builderContextValue: e.builderContext
|
|
5002
5013
|
});
|
|
@@ -5022,8 +5033,8 @@ async function Ea(e) {
|
|
|
5022
5033
|
}
|
|
5023
5034
|
) });
|
|
5024
5035
|
}
|
|
5025
|
-
const
|
|
5026
|
-
function
|
|
5036
|
+
const Ka = mt, Ga = Mr, ar = {};
|
|
5037
|
+
function Xa(e) {
|
|
5027
5038
|
if (G()) {
|
|
5028
5039
|
Object.assign(ar, e);
|
|
5029
5040
|
const t = {
|
|
@@ -5033,7 +5044,7 @@ function Ka(e) {
|
|
|
5033
5044
|
parent.postMessage(t, "*");
|
|
5034
5045
|
}
|
|
5035
5046
|
}
|
|
5036
|
-
const
|
|
5047
|
+
const Ya = async (e) => {
|
|
5037
5048
|
var r, o, a;
|
|
5038
5049
|
const t = e.path || ((r = e.url) == null ? void 0 : r.pathname) || ((o = e.userAttributes) == null ? void 0 : o.urlPath), n = {
|
|
5039
5050
|
...e,
|
|
@@ -5057,39 +5068,39 @@ export {
|
|
|
5057
5068
|
jr as A,
|
|
5058
5069
|
mt as B,
|
|
5059
5070
|
Mr as C,
|
|
5060
|
-
|
|
5061
|
-
|
|
5071
|
+
Da as D,
|
|
5072
|
+
Va as E,
|
|
5062
5073
|
Ar as F,
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5074
|
+
La as G,
|
|
5075
|
+
Ya as H,
|
|
5076
|
+
Ka as R,
|
|
5077
|
+
Ta as S,
|
|
5078
|
+
Pi as T,
|
|
5079
|
+
ma as _,
|
|
5080
|
+
ni as a,
|
|
5081
|
+
Ba as b,
|
|
5071
5082
|
Yt as c,
|
|
5072
|
-
|
|
5073
|
-
|
|
5083
|
+
Ma as d,
|
|
5084
|
+
Ua as e,
|
|
5074
5085
|
G as f,
|
|
5075
5086
|
Xt as g,
|
|
5076
5087
|
Ht as h,
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5088
|
+
Na as i,
|
|
5089
|
+
_a as j,
|
|
5090
|
+
ra as k,
|
|
5091
|
+
z as l,
|
|
5081
5092
|
sn as m,
|
|
5082
|
-
|
|
5093
|
+
Wa as n,
|
|
5083
5094
|
pt as o,
|
|
5084
|
-
|
|
5095
|
+
Fa as p,
|
|
5085
5096
|
un as q,
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5097
|
+
$a as r,
|
|
5098
|
+
Ha as s,
|
|
5099
|
+
Yi as t,
|
|
5100
|
+
Hi as u,
|
|
5101
|
+
Ga as v,
|
|
5102
|
+
ii as w,
|
|
5103
|
+
ba as x,
|
|
5104
|
+
Xa as y,
|
|
5105
|
+
ta as z
|
|
5095
5106
|
};
|