@builder.io/sdk-react 4.2.1 → 4.2.3
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/blocks-exports.cjs +37 -37
- package/lib/browser/blocks-exports.mjs +1238 -1168
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-0817de95.cjs +2 -0
- package/lib/browser/{server-entry-5e98a993.js → server-entry-331e2fd4.js} +248 -246
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-4bab42b1.cjs → accordion-1559ca68.cjs} +1 -1
- package/lib/edge/{accordion-a8a363e4.js → accordion-3e9ee224.js} +1 -1
- package/lib/edge/{blocks-d07d0261.cjs → blocks-4f20c19a.cjs} +14 -14
- package/lib/edge/{blocks-e1f5b0d0.js → blocks-b9be7dc1.js} +749 -736
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-6734c0bb.cjs → button-0a632d4f.cjs} +1 -1
- package/lib/edge/{button-bbcadacf.js → button-ba852235.js} +2 -2
- package/lib/edge/{columns-821cba14.cjs → columns-66170ac9.cjs} +1 -1
- package/lib/edge/{columns-cf3081c6.js → columns-ee2fba7b.js} +3 -3
- package/lib/edge/content-variants-4f54d98a.cjs +302 -0
- package/lib/edge/{content-variants-a704e35c.js → content-variants-c013569a.js} +489 -444
- package/lib/edge/{custom-code-f6c30129.js → custom-code-38e2c9d5.js} +1 -1
- package/lib/edge/{custom-code-8fcaa31e.cjs → custom-code-48579935.cjs} +1 -1
- package/lib/edge/{embed-3c0b5564.js → embed-1ce0435c.js} +1 -1
- package/lib/edge/{embed-666d3cc4.cjs → embed-9a7f29ff.cjs} +1 -1
- package/lib/edge/form-d9b6dea6.cjs +1 -0
- package/lib/edge/{form-8b068721.js → form-f558f5d4.js} +24 -21
- package/lib/edge/{get-class-prop-name-d6d821d6.js → get-class-prop-name-35ccd32a.js} +1 -1
- package/lib/edge/{get-class-prop-name-2869a960.cjs → get-class-prop-name-d2be9a48.cjs} +1 -1
- package/lib/edge/image-cce92f6c.cjs +17 -0
- package/lib/edge/image-d87761af.js +123 -0
- package/lib/edge/img-a1e0f10e.js +33 -0
- package/lib/edge/img-b21eb075.cjs +1 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-665ef328.js → input-5c0d3350.js} +1 -1
- package/lib/edge/{input-d31d6451.cjs → input-6854bc85.cjs} +1 -1
- package/lib/edge/{personalization-container-e784836e.js → personalization-container-adf9e0bd.js} +4 -4
- package/lib/edge/{personalization-container-d12566e8.cjs → personalization-container-f7fdc090.cjs} +1 -1
- package/lib/edge/{select-c3085265.cjs → select-6c4637ae.cjs} +1 -1
- package/lib/edge/{select-5fe49bd4.js → select-713e73f6.js} +1 -1
- package/lib/edge/server-entry-0bef3cb1.cjs +2 -0
- package/lib/{node/server-entry-48724189.js → edge/server-entry-71badd34.js} +307 -307
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-cbbbb02e.cjs → slot-59a86f46.cjs} +1 -1
- package/lib/edge/{slot-a17ee2d7.js → slot-a3c27352.js} +3 -3
- package/lib/edge/symbol-3d81a9de.cjs +1 -0
- package/lib/edge/{symbol-9f960685.js → symbol-86e5a3f0.js} +26 -23
- package/lib/edge/tabs-0d914e5c.cjs +1 -0
- package/lib/edge/{tabs-26ac5b2f.js → tabs-60f8bb61.js} +24 -23
- package/lib/node/blocks-exports.cjs +38 -38
- package/lib/node/blocks-exports.mjs +1375 -1305
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/server-entry-05b0f263.cjs +2 -0
- package/lib/{edge/server-entry-c9d5300f.js → node/server-entry-68823bb0.js} +346 -342
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-a7aba6d2.js → setIvm-bb3d0e32.js} +1 -1
- package/lib/node/{setIvm-3b6199a0.cjs → setIvm-bec8f1ed.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-fdc70f22.js → should-force-browser-runtime-in-node-a4c71d14.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-cbe0ef14.cjs → should-force-browser-runtime-in-node-bbbdf124.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/img/img.d.ts +2 -0
- package/types/blocks/symbol/symbol.types.d.ts +1 -2
- package/types/components/awaiter.d.ts +1 -11
- package/types/components/awaiter.types.d.ts +7 -0
- package/types/components/block/components/live-edit-block-styles.d.ts +8 -0
- package/types/components/block/components/style-wrapper.d.ts +9 -0
- package/types/components/live-edit.d.ts +9 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/find-block.d.ts +18 -0
- package/types/helpers/subscribe-to-editor.d.ts +3 -2
- package/lib/browser/server-entry-4cf669a1.cjs +0 -2
- package/lib/edge/content-variants-ec180883.cjs +0 -302
- package/lib/edge/form-51f639ab.cjs +0 -1
- package/lib/edge/image-209835f4.js +0 -94
- package/lib/edge/image-87a4e006.cjs +0 -17
- package/lib/edge/image.helpers-3e926d47.js +0 -33
- package/lib/edge/image.helpers-dba8a869.cjs +0 -1
- package/lib/edge/img-b04b9b6d.cjs +0 -1
- package/lib/edge/img-dfbd4080.js +0 -28
- package/lib/edge/server-entry-acf5ce7d.cjs +0 -2
- package/lib/edge/symbol-b56b5675.cjs +0 -1
- package/lib/edge/tabs-bf6643d7.cjs +0 -1
- package/lib/node/server-entry-562c0663.cjs +0 -2
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
const b = "react",
|
|
2
|
-
log: (...t) => console.log(
|
|
3
|
-
error: (...t) => console.error(
|
|
4
|
-
warn: (...t) => console.warn(
|
|
5
|
-
debug: (...t) => console.debug(
|
|
1
|
+
const b = "react", I = "[Builder.io]: ", h = {
|
|
2
|
+
log: (...t) => console.log(I, ...t),
|
|
3
|
+
error: (...t) => console.error(I, ...t),
|
|
4
|
+
warn: (...t) => console.warn(I, ...t),
|
|
5
|
+
debug: (...t) => console.debug(I, ...t)
|
|
6
6
|
};
|
|
7
7
|
function c() {
|
|
8
8
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
9
|
}
|
|
10
|
-
const
|
|
10
|
+
const it = (t) => {
|
|
11
11
|
const e = {};
|
|
12
12
|
return t.forEach((n, r) => {
|
|
13
13
|
e[r] = n;
|
|
14
14
|
}), e;
|
|
15
|
-
},
|
|
16
|
-
function
|
|
15
|
+
}, K = (t) => t instanceof URLSearchParams ? it(t) : t, M = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
16
|
+
function at() {
|
|
17
17
|
return c() && window.self !== window.top;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
|
|
19
|
+
function ct(t) {
|
|
20
|
+
return at() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
21
|
+
M(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const ut = () => {
|
|
24
24
|
if (c()) {
|
|
25
25
|
const t = new URL(location.href);
|
|
26
26
|
return t.pathname === "" && (t.pathname = "/"), t;
|
|
27
27
|
} else
|
|
28
28
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
29
|
-
},
|
|
30
|
-
const t =
|
|
29
|
+
}, lt = () => typeof navigator == "object" && navigator.userAgent || "", dt = () => {
|
|
30
|
+
const t = lt(), e = {
|
|
31
31
|
Android() {
|
|
32
32
|
return t.match(/Android/i);
|
|
33
33
|
},
|
|
@@ -46,32 +46,32 @@ const lt = () => {
|
|
|
46
46
|
any() {
|
|
47
47
|
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || b === "reactNative";
|
|
48
48
|
}
|
|
49
|
-
}, n = t.match(/Tablet|iPad/i), r =
|
|
49
|
+
}, n = t.match(/Tablet|iPad/i), r = ut();
|
|
50
50
|
return {
|
|
51
51
|
urlPath: r == null ? void 0 : r.pathname,
|
|
52
52
|
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
53
53
|
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
54
54
|
};
|
|
55
55
|
}, y = (t) => t != null;
|
|
56
|
-
function
|
|
56
|
+
function te(t) {
|
|
57
57
|
const e = t || (c() ? window.location.search : void 0);
|
|
58
|
-
return e ?
|
|
58
|
+
return e ? M(e).indexOf("builder.preview=") !== -1 : !1;
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const ee = (t) => ({
|
|
61
61
|
type: "builder.registerComponent",
|
|
62
|
-
data:
|
|
63
|
-
}),
|
|
62
|
+
data: W(t)
|
|
63
|
+
}), ft = (t) => {
|
|
64
64
|
const e = t.toString().trim(), n = /^[a-zA-Z0-9_]+\s*=>/i.test(e);
|
|
65
65
|
return `return (${!e.startsWith("function") && !e.startsWith("async") && !e.startsWith("(") && !n ? "function " : ""}${e}).apply(this, arguments)`;
|
|
66
66
|
};
|
|
67
|
-
function
|
|
68
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
67
|
+
function W(t) {
|
|
68
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? ft(n) : n));
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
function
|
|
72
|
-
t === "plugin" && (e =
|
|
73
|
-
let n =
|
|
74
|
-
if (n || (n =
|
|
70
|
+
const x = {};
|
|
71
|
+
function ne(t, e) {
|
|
72
|
+
t === "plugin" && (e = W(e));
|
|
73
|
+
let n = x[t];
|
|
74
|
+
if (n || (n = x[t] = []), n.push(e), c()) {
|
|
75
75
|
const r = {
|
|
76
76
|
type: "builder.register",
|
|
77
77
|
data: {
|
|
@@ -86,7 +86,7 @@ function re(t, e) {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function re(t) {
|
|
90
90
|
var e;
|
|
91
91
|
if (c()) {
|
|
92
92
|
const n = JSON.parse(JSON.stringify(t));
|
|
@@ -96,42 +96,42 @@ function se(t) {
|
|
|
96
96
|
}, "*");
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
function
|
|
99
|
+
const _ = {};
|
|
100
|
+
function se(t) {
|
|
101
101
|
if (c()) {
|
|
102
|
-
Object.assign(
|
|
102
|
+
Object.assign(_, t);
|
|
103
103
|
const e = {
|
|
104
104
|
type: "builder.settingsChange",
|
|
105
|
-
data:
|
|
105
|
+
data: _
|
|
106
106
|
};
|
|
107
107
|
parent.postMessage(e, "*");
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const L = "builder.", ht = "options.", j = (t) => {
|
|
111
111
|
if (!t)
|
|
112
112
|
return {};
|
|
113
|
-
const e =
|
|
113
|
+
const e = K(t), n = {};
|
|
114
114
|
return Object.keys(e).forEach((r) => {
|
|
115
|
-
if (r.startsWith(
|
|
116
|
-
const s = r.replace(
|
|
115
|
+
if (r.startsWith(L)) {
|
|
116
|
+
const s = r.replace(L, "").replace(ht, "");
|
|
117
117
|
n[s] = e[r];
|
|
118
118
|
}
|
|
119
119
|
}), n;
|
|
120
|
-
},
|
|
120
|
+
}, gt = () => {
|
|
121
121
|
if (!c())
|
|
122
122
|
return {};
|
|
123
123
|
const t = new URLSearchParams(window.location.search);
|
|
124
|
-
return
|
|
125
|
-
},
|
|
124
|
+
return j(t);
|
|
125
|
+
}, $ = "4.2.3", G = () => ({
|
|
126
126
|
"X-Builder-SDK": b,
|
|
127
127
|
"X-Builder-SDK-GEN": "2",
|
|
128
|
-
"X-Builder-SDK-Version":
|
|
129
|
-
}),
|
|
128
|
+
"X-Builder-SDK-Version": $
|
|
129
|
+
}), pt = (t) => {
|
|
130
130
|
if (t === "localhost" || t === "127.0.0.1")
|
|
131
131
|
return t;
|
|
132
132
|
const e = t.split(".");
|
|
133
133
|
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
134
|
-
},
|
|
134
|
+
}, U = ({
|
|
135
135
|
name: t,
|
|
136
136
|
canTrack: e
|
|
137
137
|
}) => {
|
|
@@ -139,16 +139,16 @@ const N = "builder.", gt = "options.", $ = (t) => {
|
|
|
139
139
|
try {
|
|
140
140
|
return e ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${t}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
141
141
|
} catch (r) {
|
|
142
|
-
|
|
142
|
+
h.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, J = async (t) => U(t), St = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(y).join("; "), yt = [["secure", ""], ["SameSite", "None"]], bt = ({
|
|
146
146
|
name: t,
|
|
147
147
|
value: e,
|
|
148
148
|
expires: n
|
|
149
149
|
}) => {
|
|
150
|
-
const s = (c() ? location.protocol === "https:" : !0) ?
|
|
151
|
-
return
|
|
150
|
+
const s = (c() ? location.protocol === "https:" : !0) ? yt : [[]], o = n ? [["expires", n.toUTCString()]] : [[]], i = [[t, e], ...o, ["path", "/"], ["domain", pt(window.location.hostname)], ...s];
|
|
151
|
+
return St(i);
|
|
152
152
|
}, T = async ({
|
|
153
153
|
name: t,
|
|
154
154
|
value: e,
|
|
@@ -158,103 +158,103 @@ const N = "builder.", gt = "options.", $ = (t) => {
|
|
|
158
158
|
try {
|
|
159
159
|
if (!r)
|
|
160
160
|
return;
|
|
161
|
-
const s =
|
|
161
|
+
const s = bt({
|
|
162
162
|
name: t,
|
|
163
163
|
value: e,
|
|
164
164
|
expires: n
|
|
165
165
|
});
|
|
166
166
|
document.cookie = s;
|
|
167
167
|
} catch (s) {
|
|
168
|
-
|
|
168
|
+
h.warn("[COOKIE] SET error: ", (s == null ? void 0 : s.message) || s);
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
-
function
|
|
171
|
+
function mt() {
|
|
172
172
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
173
173
|
const e = Math.random() * 16 | 0;
|
|
174
174
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
function
|
|
178
|
-
return
|
|
177
|
+
function z() {
|
|
178
|
+
return mt().replace(/-/g, "");
|
|
179
179
|
}
|
|
180
|
-
const
|
|
180
|
+
const X = "builderSessionId", wt = async ({
|
|
181
181
|
canTrack: t
|
|
182
182
|
}) => {
|
|
183
183
|
if (!t)
|
|
184
184
|
return;
|
|
185
|
-
const e = await
|
|
186
|
-
name:
|
|
185
|
+
const e = await J({
|
|
186
|
+
name: X,
|
|
187
187
|
canTrack: t
|
|
188
188
|
});
|
|
189
189
|
if (y(e))
|
|
190
190
|
return e;
|
|
191
191
|
{
|
|
192
|
-
const n =
|
|
193
|
-
return
|
|
192
|
+
const n = Et();
|
|
193
|
+
return At({
|
|
194
194
|
id: n,
|
|
195
195
|
canTrack: t
|
|
196
196
|
}), n;
|
|
197
197
|
}
|
|
198
|
-
},
|
|
198
|
+
}, Et = () => z(), At = ({
|
|
199
199
|
id: t,
|
|
200
200
|
canTrack: e
|
|
201
201
|
}) => T({
|
|
202
|
-
name:
|
|
202
|
+
name: X,
|
|
203
203
|
value: t,
|
|
204
204
|
canTrack: e
|
|
205
|
-
}),
|
|
205
|
+
}), H = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, It = ({
|
|
206
206
|
key: t,
|
|
207
207
|
canTrack: e
|
|
208
208
|
}) => {
|
|
209
209
|
var n;
|
|
210
210
|
try {
|
|
211
|
-
return e ? (n =
|
|
211
|
+
return e ? (n = H()) == null ? void 0 : n.getItem(t) : void 0;
|
|
212
212
|
} catch (r) {
|
|
213
213
|
console.debug("[LocalStorage] GET error: ", r);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
},
|
|
216
|
+
}, vt = ({
|
|
217
217
|
key: t,
|
|
218
218
|
canTrack: e,
|
|
219
219
|
value: n
|
|
220
220
|
}) => {
|
|
221
221
|
var r;
|
|
222
222
|
try {
|
|
223
|
-
e && ((r =
|
|
223
|
+
e && ((r = H()) == null || r.setItem(t, n));
|
|
224
224
|
} catch (s) {
|
|
225
225
|
console.debug("[LocalStorage] SET error: ", s);
|
|
226
226
|
}
|
|
227
|
-
},
|
|
227
|
+
}, Q = "builderVisitorId", kt = ({
|
|
228
228
|
canTrack: t
|
|
229
229
|
}) => {
|
|
230
230
|
if (!t)
|
|
231
231
|
return;
|
|
232
|
-
const e =
|
|
233
|
-
key:
|
|
232
|
+
const e = It({
|
|
233
|
+
key: Q,
|
|
234
234
|
canTrack: t
|
|
235
235
|
});
|
|
236
236
|
if (y(e))
|
|
237
237
|
return e;
|
|
238
238
|
{
|
|
239
|
-
const n =
|
|
239
|
+
const n = Ut();
|
|
240
240
|
return Tt({
|
|
241
241
|
id: n,
|
|
242
242
|
canTrack: t
|
|
243
243
|
}), n;
|
|
244
244
|
}
|
|
245
|
-
},
|
|
245
|
+
}, Ut = () => z(), Tt = ({
|
|
246
246
|
id: t,
|
|
247
247
|
canTrack: e
|
|
248
|
-
}) =>
|
|
249
|
-
key:
|
|
248
|
+
}) => vt({
|
|
249
|
+
key: Q,
|
|
250
250
|
value: t,
|
|
251
251
|
canTrack: e
|
|
252
252
|
});
|
|
253
|
-
function
|
|
253
|
+
function Ot(t) {
|
|
254
254
|
var e;
|
|
255
|
-
typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" &&
|
|
255
|
+
typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" && h.log(t);
|
|
256
256
|
}
|
|
257
|
-
const
|
|
257
|
+
const Pt = async ({
|
|
258
258
|
canTrack: t
|
|
259
259
|
}) => {
|
|
260
260
|
if (!t)
|
|
@@ -262,16 +262,16 @@ const Rt = async ({
|
|
|
262
262
|
visitorId: void 0,
|
|
263
263
|
sessionId: void 0
|
|
264
264
|
};
|
|
265
|
-
const e = await
|
|
265
|
+
const e = await wt({
|
|
266
266
|
canTrack: t
|
|
267
|
-
}), n =
|
|
267
|
+
}), n = kt({
|
|
268
268
|
canTrack: t
|
|
269
269
|
});
|
|
270
270
|
return {
|
|
271
271
|
sessionId: e,
|
|
272
272
|
visitorId: n
|
|
273
273
|
};
|
|
274
|
-
},
|
|
274
|
+
}, Rt = async ({
|
|
275
275
|
type: t,
|
|
276
276
|
canTrack: e,
|
|
277
277
|
apiKey: n,
|
|
@@ -285,56 +285,56 @@ const Rt = async ({
|
|
|
285
285
|
url: location.href,
|
|
286
286
|
...r
|
|
287
287
|
},
|
|
288
|
-
...await
|
|
288
|
+
...await Pt({
|
|
289
289
|
canTrack: e
|
|
290
290
|
}),
|
|
291
|
-
userAttributes:
|
|
291
|
+
userAttributes: dt(),
|
|
292
292
|
ownerId: n
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
|
-
async function
|
|
295
|
+
async function Ct({
|
|
296
296
|
apiHost: t,
|
|
297
297
|
...e
|
|
298
298
|
}) {
|
|
299
299
|
if (!e.apiKey) {
|
|
300
|
-
|
|
300
|
+
h.error("Missing API key for track call. Please provide your API key.");
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
if (!e.canTrack ||
|
|
303
|
+
if (!e.canTrack || ct() || !(c() || b === "reactNative"))
|
|
304
304
|
return;
|
|
305
305
|
const r = `${t || "https://cdn.builder.io"}/api/v1/track`;
|
|
306
|
-
return
|
|
306
|
+
return Ot(r), fetch(r, {
|
|
307
307
|
method: "POST",
|
|
308
308
|
body: JSON.stringify({
|
|
309
|
-
events: [await
|
|
309
|
+
events: [await Rt(e)]
|
|
310
310
|
}),
|
|
311
311
|
headers: {
|
|
312
312
|
"content-type": "application/json",
|
|
313
|
-
...
|
|
313
|
+
...G()
|
|
314
314
|
},
|
|
315
315
|
mode: "cors"
|
|
316
316
|
}).catch((s) => {
|
|
317
317
|
console.error("Failed to track: ", s);
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const oe = (t) => Ct({
|
|
321
321
|
...t,
|
|
322
322
|
canTrack: !0
|
|
323
|
-
}),
|
|
324
|
-
function
|
|
323
|
+
}), Bt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
324
|
+
function Y(t, e) {
|
|
325
325
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
326
326
|
return !1;
|
|
327
327
|
const n = new URL(e.origin), r = n.hostname;
|
|
328
|
-
return (t ||
|
|
328
|
+
return (t || Bt).findIndex((s) => s.startsWith("*.") ? r.endsWith(s.slice(1)) : s === r) > -1;
|
|
329
329
|
}
|
|
330
|
-
let
|
|
331
|
-
const
|
|
330
|
+
let N = !1;
|
|
331
|
+
const xt = (t) => {
|
|
332
332
|
var e, n;
|
|
333
|
-
|
|
333
|
+
N || (N = !0, c() && ((e = window.parent) == null || e.postMessage({
|
|
334
334
|
type: "builder.sdkInfo",
|
|
335
335
|
data: {
|
|
336
336
|
target: b,
|
|
337
|
-
version:
|
|
337
|
+
version: $,
|
|
338
338
|
supportsPatchUpdates: !1,
|
|
339
339
|
// Supports builder-model="..." attribute which is needed to
|
|
340
340
|
// scope our '+ add block' button styling
|
|
@@ -352,7 +352,7 @@ const _t = (t) => {
|
|
|
352
352
|
}
|
|
353
353
|
}, "*"), window.addEventListener("message", (r) => {
|
|
354
354
|
var o, i;
|
|
355
|
-
if (!
|
|
355
|
+
if (!Y(t.trustedHosts, r))
|
|
356
356
|
return;
|
|
357
357
|
const {
|
|
358
358
|
data: s
|
|
@@ -360,45 +360,45 @@ const _t = (t) => {
|
|
|
360
360
|
if (s != null && s.type)
|
|
361
361
|
switch (s.type) {
|
|
362
362
|
case "builder.evaluate": {
|
|
363
|
-
const u = s.data.text,
|
|
364
|
-
let
|
|
363
|
+
const u = s.data.text, l = s.data.arguments || [], S = s.data.id, m = new Function(u);
|
|
364
|
+
let d, g = null;
|
|
365
365
|
try {
|
|
366
|
-
|
|
367
|
-
} catch (
|
|
368
|
-
|
|
366
|
+
d = m.apply(null, l);
|
|
367
|
+
} catch (p) {
|
|
368
|
+
g = p;
|
|
369
369
|
}
|
|
370
|
-
|
|
370
|
+
g ? (o = window.parent) == null || o.postMessage({
|
|
371
371
|
type: "builder.evaluateError",
|
|
372
372
|
data: {
|
|
373
|
-
id:
|
|
374
|
-
error:
|
|
373
|
+
id: S,
|
|
374
|
+
error: g.message
|
|
375
375
|
}
|
|
376
|
-
}, "*") :
|
|
377
|
-
var
|
|
378
|
-
(
|
|
376
|
+
}, "*") : d && typeof d.then == "function" ? d.then((p) => {
|
|
377
|
+
var w;
|
|
378
|
+
(w = window.parent) == null || w.postMessage({
|
|
379
379
|
type: "builder.evaluateResult",
|
|
380
380
|
data: {
|
|
381
|
-
id:
|
|
382
|
-
result:
|
|
381
|
+
id: S,
|
|
382
|
+
result: p
|
|
383
383
|
}
|
|
384
384
|
}, "*");
|
|
385
385
|
}).catch(console.error) : (i = window.parent) == null || i.postMessage({
|
|
386
386
|
type: "builder.evaluateResult",
|
|
387
387
|
data: {
|
|
388
|
-
result:
|
|
389
|
-
id:
|
|
388
|
+
result: d,
|
|
389
|
+
id: S
|
|
390
390
|
}
|
|
391
391
|
}, "*");
|
|
392
392
|
break;
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
})));
|
|
396
|
-
},
|
|
396
|
+
}, _t = ({
|
|
397
397
|
model: t,
|
|
398
398
|
trustedHosts: e,
|
|
399
399
|
callbacks: n
|
|
400
400
|
}) => (r) => {
|
|
401
|
-
if (!
|
|
401
|
+
if (!Y(e, r))
|
|
402
402
|
return;
|
|
403
403
|
const {
|
|
404
404
|
data: s
|
|
@@ -414,30 +414,30 @@ const _t = (t) => {
|
|
|
414
414
|
break;
|
|
415
415
|
}
|
|
416
416
|
case "builder.resetState": {
|
|
417
|
-
const o = s.data, i = o.model, u = o == null ? void 0 : o.state;
|
|
418
|
-
i === t && u && n.stateUpdate(u);
|
|
417
|
+
const o = s.data, i = o.model, u = o == null ? void 0 : o.state, l = o.editType;
|
|
418
|
+
i === t && u && n.stateUpdate(u, l);
|
|
419
419
|
break;
|
|
420
420
|
}
|
|
421
421
|
case "builder.contentUpdate": {
|
|
422
|
-
const o = s.data, i = o.key || o.alias || o.entry || o.modelName, u = o.data;
|
|
423
|
-
i === t && n.contentUpdate(u);
|
|
422
|
+
const o = s.data, i = o.key || o.alias || o.entry || o.modelName, u = o.data, l = o.editType;
|
|
423
|
+
i === t && n.contentUpdate(u, l);
|
|
424
424
|
break;
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
|
-
},
|
|
427
|
+
}, ie = ({
|
|
428
428
|
model: t,
|
|
429
429
|
apiKey: e,
|
|
430
430
|
callback: n,
|
|
431
431
|
trustedHosts: r
|
|
432
432
|
}) => {
|
|
433
433
|
if (!c)
|
|
434
|
-
return
|
|
434
|
+
return h.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
435
435
|
};
|
|
436
|
-
|
|
436
|
+
xt({
|
|
437
437
|
modelName: t,
|
|
438
438
|
apiKey: e
|
|
439
439
|
});
|
|
440
|
-
const s =
|
|
440
|
+
const s = _t({
|
|
441
441
|
callbacks: {
|
|
442
442
|
contentUpdate: n,
|
|
443
443
|
animation: () => {
|
|
@@ -453,24 +453,24 @@ const _t = (t) => {
|
|
|
453
453
|
return window.addEventListener("message", s), () => {
|
|
454
454
|
window.removeEventListener("message", s);
|
|
455
455
|
};
|
|
456
|
-
},
|
|
456
|
+
}, Lt = "builder.tests", O = (t) => `${Lt}.${t}`, Nt = ({
|
|
457
457
|
contentId: t
|
|
458
|
-
}) =>
|
|
459
|
-
name:
|
|
458
|
+
}) => J({
|
|
459
|
+
name: O(t),
|
|
460
460
|
canTrack: !0
|
|
461
|
-
}),
|
|
461
|
+
}), Vt = ({
|
|
462
462
|
contentId: t
|
|
463
|
-
}) =>
|
|
464
|
-
name:
|
|
463
|
+
}) => U({
|
|
464
|
+
name: O(t),
|
|
465
465
|
canTrack: !0
|
|
466
|
-
}),
|
|
466
|
+
}), Dt = ({
|
|
467
467
|
contentId: t,
|
|
468
468
|
value: e
|
|
469
469
|
}) => T({
|
|
470
|
-
name:
|
|
470
|
+
name: O(t),
|
|
471
471
|
value: e,
|
|
472
472
|
canTrack: !0
|
|
473
|
-
}),
|
|
473
|
+
}), Z = (t) => y(t.id) && y(t.variations) && Object.keys(t.variations).length > 0, Ft = ({
|
|
474
474
|
id: t,
|
|
475
475
|
variations: e
|
|
476
476
|
}) => {
|
|
@@ -483,15 +483,15 @@ const _t = (t) => {
|
|
|
483
483
|
return o;
|
|
484
484
|
}
|
|
485
485
|
return t;
|
|
486
|
-
},
|
|
487
|
-
const e =
|
|
488
|
-
return
|
|
486
|
+
}, q = (t) => {
|
|
487
|
+
const e = Ft(t);
|
|
488
|
+
return Dt({
|
|
489
489
|
contentId: t.id,
|
|
490
490
|
value: e
|
|
491
491
|
}).catch((n) => {
|
|
492
|
-
|
|
492
|
+
h.error("could not store A/B test variation: ", n);
|
|
493
493
|
}), e;
|
|
494
|
-
},
|
|
494
|
+
}, tt = ({
|
|
495
495
|
item: t,
|
|
496
496
|
testGroupId: e
|
|
497
497
|
}) => {
|
|
@@ -505,7 +505,7 @@ const _t = (t) => {
|
|
|
505
505
|
testVariationId: n.id,
|
|
506
506
|
testVariationName: n.name || (n.id === t.id ? "Default" : "")
|
|
507
507
|
};
|
|
508
|
-
},
|
|
508
|
+
}, ae = ({
|
|
509
509
|
item: t,
|
|
510
510
|
canTrack: e
|
|
511
511
|
}) => {
|
|
@@ -513,14 +513,14 @@ const _t = (t) => {
|
|
|
513
513
|
return t;
|
|
514
514
|
if (!t)
|
|
515
515
|
return;
|
|
516
|
-
if (!
|
|
516
|
+
if (!Z(t))
|
|
517
517
|
return t;
|
|
518
|
-
const n =
|
|
518
|
+
const n = Vt({
|
|
519
519
|
contentId: t.id
|
|
520
|
-
}) ||
|
|
520
|
+
}) || q({
|
|
521
521
|
variations: t.variations,
|
|
522
522
|
id: t.id
|
|
523
|
-
}), r =
|
|
523
|
+
}), r = tt({
|
|
524
524
|
item: t,
|
|
525
525
|
testGroupId: n
|
|
526
526
|
});
|
|
@@ -528,18 +528,18 @@ const _t = (t) => {
|
|
|
528
528
|
...t,
|
|
529
529
|
...r
|
|
530
530
|
};
|
|
531
|
-
},
|
|
531
|
+
}, Kt = async ({
|
|
532
532
|
item: t,
|
|
533
533
|
canTrack: e
|
|
534
534
|
}) => {
|
|
535
|
-
if (!e || !
|
|
535
|
+
if (!e || !Z(t))
|
|
536
536
|
return t;
|
|
537
|
-
const r = await
|
|
537
|
+
const r = await Nt({
|
|
538
538
|
contentId: t.id
|
|
539
|
-
}) ||
|
|
539
|
+
}) || q({
|
|
540
540
|
variations: t.variations,
|
|
541
541
|
id: t.id
|
|
542
|
-
}), s =
|
|
542
|
+
}), s = tt({
|
|
543
543
|
item: t,
|
|
544
544
|
testGroupId: r
|
|
545
545
|
});
|
|
@@ -548,8 +548,8 @@ const _t = (t) => {
|
|
|
548
548
|
...s
|
|
549
549
|
};
|
|
550
550
|
};
|
|
551
|
-
const
|
|
552
|
-
function
|
|
551
|
+
const V = "builder.userAttributes";
|
|
552
|
+
function D() {
|
|
553
553
|
let t = !0;
|
|
554
554
|
const e = /* @__PURE__ */ new Set();
|
|
555
555
|
return {
|
|
@@ -561,14 +561,14 @@ function F() {
|
|
|
561
561
|
...n
|
|
562
562
|
};
|
|
563
563
|
T({
|
|
564
|
-
name:
|
|
564
|
+
name: V,
|
|
565
565
|
value: JSON.stringify(r),
|
|
566
566
|
canTrack: t
|
|
567
567
|
}), e.forEach((s) => s(r));
|
|
568
568
|
},
|
|
569
569
|
getUserAttributes() {
|
|
570
|
-
return c() ? JSON.parse(
|
|
571
|
-
name:
|
|
570
|
+
return c() ? JSON.parse(U({
|
|
571
|
+
name: V,
|
|
572
572
|
canTrack: t
|
|
573
573
|
}) || "{}") : {};
|
|
574
574
|
},
|
|
@@ -584,45 +584,45 @@ function F() {
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
|
-
let
|
|
588
|
-
c() && b === "qwik" ? (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ || (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ =
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
},
|
|
587
|
+
let v;
|
|
588
|
+
c() && b === "qwik" ? (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ || (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = D()), v = window.__BUILDER_USER_ATTRIBUTES_SERVICE__) : v = D();
|
|
589
|
+
const et = v, ce = (t) => {
|
|
590
|
+
et.setUserAttributes(t);
|
|
591
|
+
}, Mt = (t) => {
|
|
592
592
|
const e = y(t) ? t : !0;
|
|
593
|
-
return
|
|
593
|
+
return et.setCanTrack(e), e;
|
|
594
594
|
};
|
|
595
|
-
function
|
|
595
|
+
function Wt() {
|
|
596
596
|
return typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : globalThis;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
599
|
-
const t =
|
|
598
|
+
function jt() {
|
|
599
|
+
const t = Wt().fetch;
|
|
600
600
|
if (typeof t == "undefined")
|
|
601
601
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
602
602
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
603
603
|
return t;
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
function
|
|
605
|
+
const $t = jt();
|
|
606
|
+
function k(t, e = null, n = ".") {
|
|
607
607
|
return Object.keys(t).reduce((r, s) => {
|
|
608
608
|
const o = t[s], i = [e, s].filter(Boolean).join(n);
|
|
609
609
|
return [typeof o == "object", o !== null, !(Array.isArray(o) && o.length === 0)].every(Boolean) ? {
|
|
610
610
|
...r,
|
|
611
|
-
...
|
|
611
|
+
...k(o, i, n)
|
|
612
612
|
} : {
|
|
613
613
|
...r,
|
|
614
614
|
[i]: o
|
|
615
615
|
};
|
|
616
616
|
}, {});
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function nt(t, e, n = {}) {
|
|
619
619
|
for (const r in t) {
|
|
620
620
|
const s = t[r], o = e ? e + "." + r : r;
|
|
621
|
-
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ?
|
|
621
|
+
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ? nt(s, o, n) : n[o] = s;
|
|
622
622
|
}
|
|
623
623
|
return n;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Gt(t) {
|
|
626
626
|
const e = {};
|
|
627
627
|
for (const n in t) {
|
|
628
628
|
const r = n.split(".");
|
|
@@ -634,7 +634,7 @@ function Jt(t) {
|
|
|
634
634
|
}
|
|
635
635
|
return e;
|
|
636
636
|
}
|
|
637
|
-
const
|
|
637
|
+
const Jt = "v3", F = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t) => {
|
|
638
638
|
const {
|
|
639
639
|
limit: e = 30,
|
|
640
640
|
userAttributes: n,
|
|
@@ -643,113 +643,115 @@ const zt = "v3", K = (t) => typeof t == "number" && !isNaN(t) && t >= 0, R = (t)
|
|
|
643
643
|
apiKey: o,
|
|
644
644
|
enrich: i,
|
|
645
645
|
locale: u,
|
|
646
|
-
apiVersion:
|
|
647
|
-
fields:
|
|
648
|
-
omit:
|
|
649
|
-
offset:
|
|
650
|
-
cacheSeconds:
|
|
651
|
-
staleCacheSeconds:
|
|
652
|
-
sort:
|
|
653
|
-
includeUnpublished:
|
|
654
|
-
apiHost:
|
|
646
|
+
apiVersion: l = Jt,
|
|
647
|
+
fields: S,
|
|
648
|
+
omit: m,
|
|
649
|
+
offset: d,
|
|
650
|
+
cacheSeconds: g,
|
|
651
|
+
staleCacheSeconds: p,
|
|
652
|
+
sort: w,
|
|
653
|
+
includeUnpublished: R,
|
|
654
|
+
apiHost: rt
|
|
655
655
|
} = t;
|
|
656
656
|
if (!o)
|
|
657
657
|
throw new Error("Missing API key");
|
|
658
|
-
if (!["v3"].includes(
|
|
659
|
-
throw new Error(`Invalid apiVersion: expected 'v3', received '${
|
|
660
|
-
const
|
|
661
|
-
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
...S
|
|
667
|
-
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", w != null ? w : "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof C == "boolean" && a.searchParams.set("includeUnpublished", String(C)), h && K(h) && a.searchParams.set("cacheSeconds", String(h)), g && K(g) && a.searchParams.set("staleCacheSeconds", String(g)), E) {
|
|
668
|
-
const d = U({
|
|
669
|
-
sort: E
|
|
658
|
+
if (!["v3"].includes(l))
|
|
659
|
+
throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);
|
|
660
|
+
const st = e !== 1, ot = rt || "https://cdn.builder.io", a = new URL(`${ot}/api/${l}/content/${s}`);
|
|
661
|
+
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(st)), a.searchParams.set("includeRefs", String(!0)), u && a.searchParams.set("locale", u);
|
|
662
|
+
let A = n || {};
|
|
663
|
+
if (i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", m != null ? m : "meta.componentsUsed"), S && a.searchParams.set("fields", S), Number.isFinite(d) && d > -1 && a.searchParams.set("offset", String(Math.floor(d))), typeof R == "boolean" && a.searchParams.set("includeUnpublished", String(R)), g && F(g) && a.searchParams.set("cacheSeconds", String(g)), p && F(p) && a.searchParams.set("staleCacheSeconds", String(p)), w) {
|
|
664
|
+
const f = k({
|
|
665
|
+
sort: w
|
|
670
666
|
});
|
|
671
|
-
for (const
|
|
672
|
-
a.searchParams.set(
|
|
667
|
+
for (const E in f)
|
|
668
|
+
a.searchParams.set(E, JSON.stringify(f[E]));
|
|
673
669
|
}
|
|
674
|
-
const
|
|
675
|
-
...
|
|
676
|
-
...
|
|
670
|
+
const C = {
|
|
671
|
+
...gt(),
|
|
672
|
+
...K(t.options || {})
|
|
677
673
|
};
|
|
678
|
-
|
|
679
|
-
...
|
|
680
|
-
...
|
|
674
|
+
A = {
|
|
675
|
+
...A,
|
|
676
|
+
...Xt(C)
|
|
681
677
|
};
|
|
682
|
-
const
|
|
683
|
-
for (const
|
|
684
|
-
a.searchParams.set(
|
|
685
|
-
if (Object.keys(
|
|
686
|
-
const
|
|
678
|
+
const B = k(C);
|
|
679
|
+
for (const f in B)
|
|
680
|
+
a.searchParams.set(f, String(B[f]));
|
|
681
|
+
if (Object.keys(A).length > 0 && a.searchParams.set("userAttributes", JSON.stringify(A)), r) {
|
|
682
|
+
const f = nt({
|
|
687
683
|
query: r
|
|
688
684
|
});
|
|
689
|
-
for (const
|
|
690
|
-
a.searchParams.set(
|
|
685
|
+
for (const E in f)
|
|
686
|
+
a.searchParams.set(E, JSON.stringify(f[E]));
|
|
691
687
|
}
|
|
692
688
|
return a;
|
|
693
|
-
},
|
|
689
|
+
}, zt = (t) => {
|
|
694
690
|
const e = {};
|
|
695
691
|
for (const n in t)
|
|
696
692
|
n.startsWith("userAttributes.") && (e[n] = t[n], delete t[n]);
|
|
697
693
|
return e;
|
|
698
|
-
},
|
|
694
|
+
}, Xt = (t) => {
|
|
699
695
|
if (c() && t.preview === "BUILDER_STUDIO") {
|
|
700
696
|
t["userAttributes.urlPath"] = window.location.pathname, t["userAttributes.host"] = window.location.host;
|
|
701
|
-
const e =
|
|
697
|
+
const e = zt(t), {
|
|
702
698
|
userAttributes: n
|
|
703
|
-
} =
|
|
699
|
+
} = Gt(e);
|
|
704
700
|
return n;
|
|
705
701
|
}
|
|
706
702
|
return {};
|
|
707
|
-
},
|
|
708
|
-
async function
|
|
709
|
-
|
|
703
|
+
}, Ht = (t) => "results" in t;
|
|
704
|
+
async function Qt(t) {
|
|
705
|
+
var r;
|
|
706
|
+
const e = t.locale || ((r = t.userAttributes) == null ? void 0 : r.locale);
|
|
707
|
+
e && (t.locale = e, t.userAttributes = {
|
|
708
|
+
locale: e,
|
|
709
|
+
...t.userAttributes
|
|
710
|
+
});
|
|
711
|
+
const n = await qt({
|
|
710
712
|
...t,
|
|
711
713
|
limit: 1
|
|
712
714
|
});
|
|
713
|
-
return
|
|
715
|
+
return n && n[0] || null;
|
|
714
716
|
}
|
|
715
|
-
const
|
|
717
|
+
const Yt = async (t) => {
|
|
716
718
|
var i, u;
|
|
717
|
-
const e =
|
|
719
|
+
const e = P(t), n = (i = t.fetch) != null ? i : $t, r = {
|
|
718
720
|
...t.fetchOptions,
|
|
719
721
|
headers: {
|
|
720
722
|
...(u = t.fetchOptions) == null ? void 0 : u.headers,
|
|
721
|
-
...
|
|
723
|
+
...G()
|
|
722
724
|
}
|
|
723
725
|
};
|
|
724
726
|
return await (await n(e.href, r)).json();
|
|
725
|
-
},
|
|
726
|
-
const r =
|
|
727
|
+
}, Zt = async (t, e, n = P(t)) => {
|
|
728
|
+
const r = Mt(t.canTrack);
|
|
727
729
|
if (n.search.includes("preview="), !r || !(c() || b === "reactNative"))
|
|
728
730
|
return e.results;
|
|
729
731
|
try {
|
|
730
732
|
const s = [];
|
|
731
733
|
for (const o of e.results)
|
|
732
|
-
s.push(await
|
|
734
|
+
s.push(await Kt({
|
|
733
735
|
item: o,
|
|
734
736
|
canTrack: r
|
|
735
737
|
}));
|
|
736
738
|
e.results = s;
|
|
737
739
|
} catch (s) {
|
|
738
|
-
|
|
740
|
+
h.error("Could not process A/B tests. ", s);
|
|
739
741
|
}
|
|
740
742
|
return e.results;
|
|
741
743
|
};
|
|
742
|
-
async function
|
|
743
|
-
const e =
|
|
744
|
-
if (!
|
|
745
|
-
throw
|
|
744
|
+
async function qt(t) {
|
|
745
|
+
const e = P(t), n = await Yt(t);
|
|
746
|
+
if (!Ht(n))
|
|
747
|
+
throw h.error("Error fetching data. ", {
|
|
746
748
|
url: e,
|
|
747
749
|
content: n,
|
|
748
750
|
options: t
|
|
749
751
|
}), n;
|
|
750
|
-
return
|
|
752
|
+
return Zt(t, n);
|
|
751
753
|
}
|
|
752
|
-
const
|
|
754
|
+
const ue = async (t) => {
|
|
753
755
|
var r, s, o;
|
|
754
756
|
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((s = t.userAttributes) == null ? void 0 : s.urlPath), n = {
|
|
755
757
|
...t,
|
|
@@ -761,41 +763,41 @@ const le = async (t) => {
|
|
|
761
763
|
urlPath: e
|
|
762
764
|
} : {}
|
|
763
765
|
},
|
|
764
|
-
options:
|
|
766
|
+
options: j(t.searchParams || ((o = t.url) == null ? void 0 : o.searchParams) || t.options)
|
|
765
767
|
};
|
|
766
768
|
return {
|
|
767
769
|
apiKey: n.apiKey,
|
|
768
770
|
model: n.model,
|
|
769
|
-
content: await
|
|
771
|
+
content: await Qt(n)
|
|
770
772
|
};
|
|
771
773
|
};
|
|
772
774
|
export {
|
|
773
775
|
b as TARGET,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
+
Zt as _processContentResult,
|
|
777
|
+
Ct as _track,
|
|
776
778
|
y as checkIsDefined,
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
779
|
+
_t as createEditorListener,
|
|
780
|
+
ee as createRegisterComponentMessage,
|
|
781
|
+
ue as fetchBuilderProps,
|
|
782
|
+
qt as fetchEntries,
|
|
783
|
+
Qt as fetchOneEntry,
|
|
784
|
+
j as getBuilderSearchParams,
|
|
785
|
+
U as getCookieSync,
|
|
786
|
+
Mt as getDefaultCanTrack,
|
|
787
|
+
dt as getUserAttributes,
|
|
788
|
+
ae as handleABTestingSync,
|
|
787
789
|
c as isBrowser,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
790
|
+
ct as isEditing,
|
|
791
|
+
te as isPreviewing,
|
|
792
|
+
Ot as logFetch,
|
|
793
|
+
h as logger,
|
|
794
|
+
ne as register,
|
|
795
|
+
re as registerAction,
|
|
796
|
+
W as serializeIncludingFunctions,
|
|
797
|
+
ce as setClientUserAttributes,
|
|
798
|
+
se as setEditorSettings,
|
|
799
|
+
xt as setupBrowserForEditing,
|
|
800
|
+
ie as subscribeToEditor,
|
|
801
|
+
oe as track,
|
|
802
|
+
et as userAttributesService
|
|
801
803
|
};
|